|
@@ -33,6 +33,15 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <u-popup v-model="modal.show" mode="bottom" :mask-close-able="false" border-radius="15">
|
|
|
|
+ <view class="popup-content">
|
|
|
|
+ <view class="title">需要绑定您的手机号</view>
|
|
|
|
+ <view class="btn-popup main-between">
|
|
|
|
+ <button class="btn main-center cross-center" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </u-popup>
|
|
|
|
+
|
|
</app-layout>
|
|
</app-layout>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -45,7 +54,10 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
setting: {},
|
|
setting: {},
|
|
- interval: null
|
|
|
|
|
|
+ interval: null,
|
|
|
|
+ modal: {
|
|
|
|
+ show: false
|
|
|
|
+ },
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -66,6 +78,11 @@
|
|
});
|
|
});
|
|
return false
|
|
return false
|
|
}*/
|
|
}*/
|
|
|
|
+ if(!this.vuex_user_data.phone_num){
|
|
|
|
+ this.modal.show = true;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
uni.showLoading({title: '数据处理中...'})
|
|
uni.showLoading({title: '数据处理中...'})
|
|
this.$u.api.userBuy().then(data => {
|
|
this.$u.api.userBuy().then(data => {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
@@ -113,6 +130,29 @@
|
|
this.$u.vuex(this.$const.USER_DATA, data)
|
|
this.$u.vuex(this.$const.USER_DATA, data)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getPhoneNumber(phoneNumber){
|
|
|
|
+ if(phoneNumber.detail.errMsg !== 'getPhoneNumber:ok'){
|
|
|
|
+ this.$u.toast('已取消');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ uni.checkSession({
|
|
|
|
+ success: data => {
|
|
|
|
+ this.$u.api.userBindPhone(phoneNumber.detail).then(data => {
|
|
|
|
+ this.$u.vuex(this.$const.USER_DATA,data)
|
|
|
|
+ this.modal.show = false
|
|
|
|
+ this.handleBuy();
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ fail: err => {
|
|
|
|
+ this.sureClearCache()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ sureClearCache(){
|
|
|
|
+ this.$u.vuex(this.$const.USER_TOKEN,null)
|
|
|
|
+ this.$u.vuex(this.$const.USER_DATA,null)
|
|
|
|
+ this.$jump({url:'/pages/login/login?redirect=pages/my/index',type:'redirect'})
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed:{
|
|
computed:{
|
|
btnStyle() {
|
|
btnStyle() {
|
|
@@ -207,4 +247,33 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .popup-content{
|
|
|
|
+ height: 280rpx;
|
|
|
|
+ position: relative;
|
|
|
|
+ .title{
|
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ font-size: 42rpx;
|
|
|
|
+ }
|
|
|
|
+ .btn-popup{
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ .btn{
|
|
|
|
+ background: $main-color;
|
|
|
|
+ color: #fff;
|
|
|
|
+ border-radius: 0;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ flex: 1;
|
|
|
|
+ &.cancel{
|
|
|
|
+ background: #f5f5f5;
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ &:after{
|
|
|
|
+ content: unset;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|