112 lines
2.1 KiB
JavaScript
112 lines
2.1 KiB
JavaScript
const app = getApp();
|
|
const model = app.loadModel("index")
|
|
const regeneratorRuntime = app.loadAsync()
|
|
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
isLogin: {
|
|
type: Boolean
|
|
},
|
|
propData: {
|
|
type: Number
|
|
},
|
|
cityInfo: {
|
|
type: Object,
|
|
value: {
|
|
city: "未定位",
|
|
city_code: ""
|
|
}
|
|
},
|
|
system: {
|
|
type: Object,
|
|
value: {
|
|
titleHeight: "",
|
|
statusHeight: ""
|
|
}
|
|
},
|
|
pageTitle: {
|
|
type: String,
|
|
value: "伊莎洗衣"
|
|
},
|
|
isBack: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
isLocation: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
isContact: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
titleColor: {
|
|
type: Object,
|
|
value: {
|
|
bColor: "#ffffff",
|
|
tColor: "#333333"
|
|
}
|
|
},
|
|
backColor: {
|
|
type: String,
|
|
value: null
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 组件的初始数据
|
|
*/
|
|
data: {
|
|
isCount: 0
|
|
},
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
goBack: function (e) {
|
|
var pages = getCurrentPages();
|
|
var prevPage = pages[pages.length - 2]
|
|
if (!!prevPage) {
|
|
wx.navigateBack({
|
|
delta: 1
|
|
})
|
|
} else {
|
|
wx.reLaunch({
|
|
url: '/pages/auth/auth'
|
|
})
|
|
}
|
|
},
|
|
changePhone: function () {
|
|
var that = this;
|
|
var isCount = that.data.isCount;
|
|
that.setData({
|
|
isCount: isCount == 0 ? 1 : 0
|
|
})
|
|
this.triggerEvent('changeInput', {
|
|
isCount: isCount == 0 ? 1 : 0
|
|
})
|
|
},
|
|
storeJump: async function (e) {
|
|
let getSetting = await model.getauth.getSetting() //获取已经授权的信息
|
|
let url = e.currentTarget.dataset.url
|
|
if (!getSetting.authSetting['scope.userLocation']) {
|
|
// 用户取消授权的处理
|
|
wx.showModal({
|
|
title: '你拒绝了地理位置授权',
|
|
content: '请点击确定,到权限表设置',
|
|
success(res) {
|
|
if (res.confirm) {
|
|
wx.openSetting()
|
|
}
|
|
}
|
|
})
|
|
return
|
|
}
|
|
wx.navigateTo({
|
|
url: url
|
|
})
|
|
}
|
|
}
|
|
}) |