Browse Source

首页

master
tianyi 4 weeks ago
parent
commit
19b11d93c9
  1. 30
      pages/index/index.vue

30
pages/index/index.vue

@ -67,7 +67,7 @@
<view class="like-box"> <view class="like-box">
<view class="like-title"> <view class="like-title">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e0c44bc9b69a46559d3aa4160d3cf4a5.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e0c44bc9b69a46559d3aa4160d3cf4a5.png" alt="" />
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button>
</view> </view>
<view class="like-content-box"> <view class="like-content-box">
@ -590,34 +590,6 @@
} }
}, },
methods: { methods: {
getPhoneNumber (e) {
console.log(e)
if (e.detail.code) {
// code
this.tui.request("/social/wechat/getPhone", "POST", {
code: e.detail.code
}, false, true).then((res) => {
if (res.code == 200) {
//
this.tui.toast('获取手机号成功'+res.result);
// phone便使
if (res.result) {
uni.setStorageSync('phone', res.result);
}
} else {
this.tui.toast(res.message || '获取失败');
}
}).catch((err) => {
console.log("请求异常: ", err);
this.tui.toast('请求获取手机号失败');
});
} else {
//
console.log('用户取消授权', e.detail.errMsg);
this.tui.toast('您取消了手机号授权');
}
},
//便 //便
aaaaaaa(item){ aaaaaaa(item){
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save