Commit fd48b2da by songbingqi

完成部分开发

parent 46804ace
...@@ -159,12 +159,7 @@ export default { ...@@ -159,12 +159,7 @@ export default {
loginInfo: "", loginInfo: "",
img: "", img: "",
isInRange: true, isInRange: true,
dayTitle: "", dayTitle: ""
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
]
}; };
}, },
computed: { computed: {
...@@ -357,7 +352,6 @@ export default { ...@@ -357,7 +352,6 @@ export default {
console.log(data) console.log(data)
}, },
async getHomeOrder(id = this.shopInfo.id) { async getHomeOrder(id = this.shopInfo.id) {
console.log(123)
if (!this.userms) return; if (!this.userms) return;
const res = await Order.getHomeOrder({ shopId: id }); const res = await Order.getHomeOrder({ shopId: id });
const data = res?.data; const data = res?.data;
...@@ -398,10 +392,20 @@ export default { ...@@ -398,10 +392,20 @@ export default {
this.$refs.AreaPicker.showArea(); this.$refs.AreaPicker.showArea();
}, },
// 手机号授权登录 // 手机号授权登录
getPhoneNumber(e) { async getPhoneNumber(e) {
if (e.detail.errMsg == "getPhoneNumber:ok") { if (e.detail.errMsg == "getPhoneNumber:ok") {
e.loginInfo = this.loginInfo; e.loginInfo = this.loginInfo;
User.getPhoneNumber(e, this.getHomeOrder); await User.getPhoneNumber(e,()=>{
this.getHomeOrder()
uni.getSetting({
success: (res) => {
// 已经授权位置不获取默认店铺
if (!res.authSetting["scope.userLocation"]) {
this.getShopMenus()
}
},
});
});
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
this.showToast({ this.showToast({
title: "已拒绝手机号授权,请同意授权", title: "已拒绝手机号授权,请同意授权",
...@@ -427,7 +431,7 @@ export default { ...@@ -427,7 +431,7 @@ export default {
}, },
fail: (err) => { fail: (err) => {
//1.2 拒绝授权 //1.2 拒绝授权
this.getShopMenus(); // this.getShopMenus();
wx.exitMiniProgram({ success: (res) => {} }); wx.exitMiniProgram({ success: (res) => {} });
console.log("获取位置失败") console.log("获取位置失败")
this.showToast({ this.showToast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment