Commit 017b947f by songbingqi

修复部分bug

parent 15f4467a
......@@ -13,8 +13,15 @@ export default function initPopup(v) {
state.show = false
},
showPopup(state,data) {
state = Object.assign(state,data)
state.show = true
state.url = ''
state.title = ''
console.log(data,'data')
const timer = setTimeout(() => {
state.url = data.url
state.title = data.title
state.show = true
clearTimeout(timer)
}, 1);
},
}
})
......@@ -26,4 +33,7 @@ export default function initPopup(v) {
v.prototype.$popupStore.commit('showPopup', option)
}
}
v.prototype.closePopup = function (option) {
v.prototype.$popupStore.commit('closePopup')
}
}
......@@ -207,6 +207,14 @@ export default {
} else {
Store.commit("setMenuOption", optionDecode);
}
}else{
if(this.userms) {
const sendData = {
phone: this.userInfo.phoneNumber,
user_id: this.userInfo.id,
};
Menu.sendUserCoupon(sendData);
}
}
uni.getSetting({
success: (res) => {
......
......@@ -136,6 +136,10 @@ export default {
return uni.$u.http
.post("/v1/issue/user/coupon", data)
.then((res) => {
const { url,flag,title } = res.data.data
if(flag===1) {
context.showPopup({ url: url,title: title });
}
return res;
})
.catch((err) => {
......
......@@ -152,6 +152,10 @@ export default {
.post("/v1/issue/user/coupon", data)
.then((res) => {
Store.commit("setMenuOption", {});
const { url,flag,title } = res.data.data
if(flag===1) {
context.showPopup({ url: url,title: title });
}
return res;
})
.catch((err) => {
......@@ -190,20 +194,31 @@ export default {
uni.setStorageSync("UserInfo", sendData);
this.getCouponImg()
const MenuOption = Store.state.user.menuOption;
if (JSON.stringify(MenuOption) !== "{}") {
if (JSON.stringify(MenuOption) !== "{}") { // 扫码进入逻辑
const { num, serial_no, source, serials } = MenuOption;
if(source) {
const sendDataOption = {
phone: sendData.phoneNumber,
user_id: sendData.id,
source: source,
param: JSON.stringify({
serial_no,
num,
serials
}),
};
this.sendUserCoupon(sendDataOption);
}
} else { // 非扫码进入逻辑
const sendDataOption = {
phone: sendData.phoneNumber,
user_id: sendData.id,
source: source,
param: JSON.stringify({
serial_no,
num,
serials
}),
user_id: sendData.id
};
this.sendUserCoupon(sendDataOption);
}
})
.catch((err) => {
context.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