Commit c41af661 by songbingqi

完成授权接口部分调试

parent c6d3d382
...@@ -84,10 +84,10 @@ ...@@ -84,10 +84,10 @@
<button v-if="!userms" class="payment" style="border-radius: 0;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">付款</button> <button v-if="!userms" class="payment" style="border-radius: 0;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">付款</button>
</div> </div>
<show-toast ref="toast"/> <show-toast ref="toast"/>
<u-popup :show="messagePopup" mode="bottom" :round="5" :overlay="true" zIndex="10071"> <u-popup :show="messagePopup" mode="bottom" :round="5" :overlay="true" zIndex="10071" :customStyle="{'background':'#2C2C2C'}">
<view class="messageBox"> <view class="messageBox">
<view class="title"> <view class="title">
<image class="image" src="../../../static/imgs/weixin-3.png"></image> <image class="image" src="../../../static/imgs/messageLogo.png"></image>
<view class="text">HOOLOO COFFEE 申请</view> <view class="text">HOOLOO COFFEE 申请</view>
</view> </view>
<view class="desc"> <view class="desc">
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<view class="submit btn" @click="submitMessage">确定</view> <view class="submit btn" @click="submitMessage">确定</view>
</view> </view>
<view class="save"> <view class="save">
<view :class="saveFlag?'checked':'nochecked'" :style="{'width':'20rpx','height':'20rpx'}" @click="changeSaveFlage"></view> <view :class="saveFlag?'checked':'nochecked'" :style="{'width':'26rpx','height':'26rpx'}" @click="changeSaveFlage"></view>
<view class="text">总是保持以上选择,不在询问</view> <view class="text">总是保持以上选择,不在询问</view>
</view> </view>
</view> </view>
...@@ -132,10 +132,13 @@ export default { ...@@ -132,10 +132,13 @@ export default {
this.TermsStatus = uni.getStorageSync('TermsStatus') || false this.TermsStatus = uni.getStorageSync('TermsStatus') || false
}, },
onLoad(option) { onLoad(option) {
console.log(123)
// 清除优惠卷信息 // 清除优惠卷信息
this.$store.commit("cleanInfo",{}) this.$store.commit("cleanInfo",{})
setTimeout(() => {
this.msgInfo.sendMsgFlag1 = ''
this.msgInfo.flagExpireData = ''
}, 1000);
if(!this.userms){ if(!this.userms){
User.wxLoginAndGetOpenid(true).then(loginInfo=>{ User.wxLoginAndGetOpenid(true).then(loginInfo=>{
...@@ -226,7 +229,10 @@ export default { ...@@ -226,7 +229,10 @@ export default {
Utils, Utils,
agreeTerms:true, agreeTerms:true,
TermsStatus:true, TermsStatus:true,
ticketNum:0 ticketNum:0,
msgInfo:{
}
} }
}, },
computed: { computed: {
...@@ -284,9 +290,30 @@ export default { ...@@ -284,9 +290,30 @@ export default {
}, },
methods: { methods: {
cancleMessage() { cancleMessage() {
this.messagePopup = false
this.saveReserve()
}, },
submitMessage() { // 保存用户通知授权信息
async submitMessage() {
const sendData = {
sendMsgFlag1:false,
sendMsgFlag2:false,
sendMsgFlag3:false,
saveFlag:this.saveFlag
}
this.messageList.forEach((item,index) => {
sendData[`sendMsgFlag${index+1}`] = item.status
})
// let a = await User.setAllow(sendData)
// console.log(a)
this.messagePopup = false
this.saveReserve()
}, },
changeContentFlag(index) { changeContentFlag(index) {
...@@ -321,8 +348,25 @@ export default { ...@@ -321,8 +348,25 @@ export default {
} }
}, },
messageAndSave() { messageAndSave() {
// this.messagePopup = true let needChoseMsg = true
// return const { sendMsgFlag1, flagExpireData } = this.msgInfo
if(!sendMsgFlag1&&!flagExpireData){
needChoseMsg = true
}else{
if(!flagExpireData&&sendMsgFlag1){
needChoseMsg = false
}else if(flagExpireData<new Date().valueOf()){
needChoseMsg = true
}
}
console.log(needChoseMsg)
if(needChoseMsg) {
this.messagePopup = true
}else{
this.saveReserve()
}
return
if(!this.TermsStatus&&!this.agreeTerms){ if(!this.TermsStatus&&!this.agreeTerms){
this.showToast({ title: "请同意下方协议条款" }); this.showToast({ title: "请同意下方协议条款" });
return return
...@@ -387,7 +431,7 @@ export default { ...@@ -387,7 +431,7 @@ export default {
} }
}, },
//结算组装数据发起订单 //结算组装数据发起订单
async saveReserve(val={}) { async saveReserve(val = {}) {
// 组装购物车数据或者立即支付数据 // 组装购物车数据或者立即支付数据
let list = []; let list = [];
if (this.payType == '1') { if (this.payType == '1') {
...@@ -441,7 +485,7 @@ export default { ...@@ -441,7 +485,7 @@ export default {
} }
.messageBox { .messageBox {
padding: 30rpx 20rpx; padding: 58rpx 32rpx 0rpx 32rpx;
.title { .title {
display: flex; display: flex;
...@@ -449,92 +493,105 @@ export default { ...@@ -449,92 +493,105 @@ export default {
align-items: center; align-items: center;
.image { .image {
width: 30rpx; width: 40rpx;
height: 30rpx; height: 40rpx;
} }
.text { .text {
font-size: 28rpx; margin-left: 8rpx;
font-weight: 500; font-size: 24prx;
font-family: ArialMT;
color: #DDDDDD;
} }
} }
.desc { .desc {
padding: 30rpx 0rpx; padding-top: 36rpx;
border-bottom: 1rpx solid black; font-size: 26rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
font-size: 34rpx; color: #DDDDDD;
} }
.content { .content {
margin-top: 35rpx;
.contentItem{ .contentItem{
padding: 15rpx 0rpx; padding: 26rpx 0rpx;
border-bottom: 1rpx solid black; border-bottom: 1rpx solid #303030;
display: flex; display: flex;
align-items: center; align-items: center;
.checked{ .checked{
background: url('../../../static/imgs/duigouxuanzhong.png') center center no-repeat; background: url('../../../static/imgs/messageXuanzhong.png') center center no-repeat;
background-size:100% 100%; background-size:100% 100%;
border-radius: 50%;
} }
.nochecked{ .nochecked{
background: url('../../../static/imgs/weixuanzhong.png') center center no-repeat; background: url('../../../static/imgs/messageWeixuanzhong.png') center center no-repeat;
background-size:100% 100%; background-size:100% 100%;
border-radius: 50%;
} }
.text { .text {
font-weight: 500; font-size: 28rpx;
margin-left: 15rpx; font-family: PingFangSC-Regular, PingFang SC;
font-size: 30rpx; font-weight: 400;
color: #DDDDDD;
margin-left: 28rpx;
} }
} }
} }
.btns { .btns {
margin-top: 40rpx; margin-top: 69.26rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
.btn { .btn {
width: 150rpx; width: 198rpx;
height: 60rpx; height: 66rpx;
text-align: center; text-align: center;
line-height: 60rpx; line-height: 60rpx;
border-radius: 10rpx; border-radius: 8rpx;
} }
.cancle { .cancle {
color: #58be6b; color: #DDDDDD;
background: #f2f2f2; background: #3D3D3D;
margin-right: 10rpx; margin-right: 14rpx;
} }
.submit { .submit {
margin-left: 10rpx; margin-left: 14rpx;
color: white; color: #DDDDDD;
background: #58be6b; background: #58BE6C;
} }
} }
.save { .save {
margin-top:30rpx; margin-top:39.82rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
line-height: center;
.checked{ .checked{
background: url('../../../static/imgs/duigouxuanzhong.png') center center no-repeat; background: url('../../../static/imgs/messageXuanzhong.png') center center no-repeat;
background-size:100% 100%; background-size:100% 100%;
border-radius: 50%;
} }
.nochecked{ .nochecked{
background: url('../../../static/imgs/weixuanzhong.png') center center no-repeat; background: url('../../../static/imgs/messageWeixuanzhong.png') center center no-repeat;
background-size:100% 100%; background-size:100% 100%;
border-radius: 50%;
} }
.text { .text {
color: gray; font-size: 23rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #DDDDDD;
margin-left: 10rpx;
} }
} }
} }
......
...@@ -155,18 +155,17 @@ export default { ...@@ -155,18 +155,17 @@ export default {
}); });
}); });
}, },
setAllow(allow) { setAllow(params) {
uni.$u.http uni.$u.http
.get('/system/customer/allow', { .post('/system/customer/allow', params)
params: {
allow,
},
})
.then((res) => { .then((res) => {
return res; return res;
}) })
.catch((err) => { .catch((err) => {
context.showToast({ title: '服务器错误', icon: 'none' }); const {data} = err
const {msg} = data
context.showToast({ title: msg, icon: 'none' });
return err
}); });
}, },
}; };
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