Commit c41af661 by songbingqi

完成授权接口部分调试

parent c6d3d382
......@@ -84,10 +84,10 @@
<button v-if="!userms" class="payment" style="border-radius: 0;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">付款</button>
</div>
<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="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>
<view class="desc">
......@@ -104,7 +104,7 @@
<view class="submit btn" @click="submitMessage">确定</view>
</view>
<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>
</view>
......@@ -132,10 +132,13 @@ export default {
this.TermsStatus = uni.getStorageSync('TermsStatus') || false
},
onLoad(option) {
console.log(123)
// 清除优惠卷信息
this.$store.commit("cleanInfo",{})
setTimeout(() => {
this.msgInfo.sendMsgFlag1 = ''
this.msgInfo.flagExpireData = ''
}, 1000);
if(!this.userms){
User.wxLoginAndGetOpenid(true).then(loginInfo=>{
......@@ -226,7 +229,10 @@ export default {
Utils,
agreeTerms:true,
TermsStatus:true,
ticketNum:0
ticketNum:0,
msgInfo:{
}
}
},
computed: {
......@@ -284,9 +290,30 @@ export default {
},
methods: {
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) {
......@@ -321,8 +348,25 @@ export default {
}
},
messageAndSave() {
// this.messagePopup = true
// return
let needChoseMsg = true
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){
this.showToast({ title: "请同意下方协议条款" });
return
......@@ -387,7 +431,7 @@ export default {
}
},
//结算组装数据发起订单
async saveReserve(val={}) {
async saveReserve(val = {}) {
// 组装购物车数据或者立即支付数据
let list = [];
if (this.payType == '1') {
......@@ -441,7 +485,7 @@ export default {
}
.messageBox {
padding: 30rpx 20rpx;
padding: 58rpx 32rpx 0rpx 32rpx;
.title {
display: flex;
......@@ -449,92 +493,105 @@ export default {
align-items: center;
.image {
width: 30rpx;
height: 30rpx;
width: 40rpx;
height: 40rpx;
}
.text {
font-size: 28rpx;
font-weight: 500;
margin-left: 8rpx;
font-size: 24prx;
font-family: ArialMT;
color: #DDDDDD;
}
}
.desc {
padding: 30rpx 0rpx;
border-bottom: 1rpx solid black;
padding-top: 36rpx;
font-size: 26rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-size: 34rpx;
color: #DDDDDD;
}
.content {
margin-top: 35rpx;
.contentItem{
padding: 15rpx 0rpx;
border-bottom: 1rpx solid black;
padding: 26rpx 0rpx;
border-bottom: 1rpx solid #303030;
display: flex;
align-items: center;
.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%;
border-radius: 50%;
}
.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%;
border-radius: 50%;
}
.text {
font-weight: 500;
margin-left: 15rpx;
font-size: 30rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #DDDDDD;
margin-left: 28rpx;
}
}
}
.btns {
margin-top: 40rpx;
margin-top: 69.26rpx;
display: flex;
justify-content: center;
.btn {
width: 150rpx;
height: 60rpx;
width: 198rpx;
height: 66rpx;
text-align: center;
line-height: 60rpx;
border-radius: 10rpx;
border-radius: 8rpx;
}
.cancle {
color: #58be6b;
background: #f2f2f2;
margin-right: 10rpx;
color: #DDDDDD;
background: #3D3D3D;
margin-right: 14rpx;
}
.submit {
margin-left: 10rpx;
color: white;
background: #58be6b;
margin-left: 14rpx;
color: #DDDDDD;
background: #58BE6C;
}
}
.save {
margin-top:30rpx;
margin-top:39.82rpx;
display: flex;
justify-content: center;
align-items: center;
line-height: center;
.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%;
border-radius: 50%;
}
.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%;
border-radius: 50%;
}
.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 {
});
});
},
setAllow(allow) {
setAllow(params) {
uni.$u.http
.get('/system/customer/allow', {
params: {
allow,
},
})
.post('/system/customer/allow', params)
.then((res) => {
return res;
})
.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