Commit abc500e6 by 宋冰琦

修复部分bug

parent d9bc3e5b
...@@ -334,7 +334,6 @@ export default { ...@@ -334,7 +334,6 @@ export default {
console.log(sendData); console.log(sendData);
await Mine.editUserAvatar({ avatarUrl: avatarUrl, id }); await Mine.editUserAvatar({ avatarUrl: avatarUrl, id });
const { data } = await Mine.editUserInfo(sendData); const { data } = await Mine.editUserInfo(sendData);
console.log(data);
const { code = 0 } = data; const { code = 0 } = data;
if (code === 200) { if (code === 200) {
this.showToast({ title: "保存成功" }); this.showToast({ title: "保存成功" });
......
...@@ -261,6 +261,7 @@ export default { ...@@ -261,6 +261,7 @@ export default {
console.log(uni.getStorageSync("goodsList")); console.log(uni.getStorageSync("goodsList"));
this.goods = uni.getStorageSync("goodsList") || []; this.goods = uni.getStorageSync("goodsList") || [];
this.payType = "2"; this.payType = "2";
this.saveGetTicket(); this.saveGetTicket();
return; return;
} }
...@@ -271,9 +272,9 @@ export default { ...@@ -271,9 +272,9 @@ export default {
// console.log(q); // console.log(q);
if (q) { if (q) {
console.log("扫码进入", q); console.log("扫码进入", q);
this.payType = "2";
uni.setStorageSync("selectFlag", false); uni.setStorageSync("selectFlag", false);
// this.getMessageFlag() // this.getMessageFlag()
this.saveGetTicket();
User.getLocation((state, params) => { User.getLocation((state, params) => {
uni.removeStorageSync("shopCarInfo"); uni.removeStorageSync("shopCarInfo");
$EventBus.$emit("updateCar"); $EventBus.$emit("updateCar");
...@@ -291,18 +292,21 @@ export default { ...@@ -291,18 +292,21 @@ export default {
} }
Menu.getScreenShopCar(id, params, sendData).then((res) => { Menu.getScreenShopCar(id, params, sendData).then((res) => {
const data = JSON.parse(res.data.data); const data = JSON.parse(res.data.data);
console.log(data); this.goods = data.goods.map((item) => {
const data = { ...item, skuId: item.sku.skuId, flag: true };
Utils.getallNum(data, true); // 不校验数量
return data;
});
uni.setStorageSync("shopData",data.shop)
uni.setStorageSync("goodsList",this.goods)
this.shopData = data.shop; this.shopData = data.shop;
const {state} = this.shopData const {state} = this.shopData
this.saveGetTicket();
if(state!==1) { if(state!==1) {
this.goHome() this.goHome()
} }
this.buyType = data.screenNo; this.buyType = data.screenNo;
this.goods = data.goods.map((item) => {
const data = { ...item, skuId: item.sku.skuId, flag: true };
Utils.getallNum(data, true); // 不校验数量
return data;
});
}); });
}); });
return; return;
...@@ -505,7 +509,8 @@ export default { ...@@ -505,7 +509,8 @@ export default {
if (recognizePerson) { if (recognizePerson) {
e.faceInfoId = recognizePerson; e.faceInfoId = recognizePerson;
} }
User.getPhoneNumber(e); User.getPhoneNumber(e,this.saveGetTicket);
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
this.showToast({ this.showToast({
title: "已拒绝手机号授权,请同意授权", title: "已拒绝手机号授权,请同意授权",
...@@ -572,7 +577,7 @@ export default { ...@@ -572,7 +577,7 @@ export default {
async saveGetTicket() { async saveGetTicket() {
// 组装购物车数据或者立即支付数据 // 组装购物车数据或者立即支付数据
const res = this.AssemblyOrder(); const res = this.AssemblyOrder();
if (res) { if (res&&this.userms) {
const { data: list } = await Menu.requestTicketList(res); const { data: list } = await Menu.requestTicketList(res);
const { data: num } = await Menu.requestTicketNum(res); const { data: num } = await Menu.requestTicketNum(res);
if (list.code == 200) { if (list.code == 200) {
......
...@@ -13,7 +13,9 @@ const order = { ...@@ -13,7 +13,9 @@ const order = {
// 设置结算页面优惠卷信息 // 设置结算页面优惠卷信息
setTickerList(state, data) { setTickerList(state, data) {
console.log(data) console.log(data)
const canuse = data.fitable.map((item,index)=>{ const fitable = data.fitable || []
const notfitable = data.notfitable || []
const canuse = fitable.map((item,index)=>{
let timeStart = '' let timeStart = ''
let timeEnd = '' let timeEnd = ''
if(item.useStartTime){ if(item.useStartTime){
...@@ -24,7 +26,7 @@ const order = { ...@@ -24,7 +26,7 @@ const order = {
} }
return { return {
index:index+1, index:index+1,
allLength:data.fitable.length, allLength:fitable.length,
id: item.id, id: item.id,
status: 0, status: 0,
couponType: item.type, couponType: item.type,
...@@ -55,7 +57,7 @@ const order = { ...@@ -55,7 +57,7 @@ const order = {
} }
} }
if(canuse.length!=0)canuse[0].checkStatus = true if(canuse.length!=0)canuse[0].checkStatus = true
const cantUse = data.notfitable.map(item=>{ const cantUse = notfitable.map(item=>{
let timeStart = '' let timeStart = ''
let timeEnd = '' let timeEnd = ''
if(item.useStartTime){ if(item.useStartTime){
......
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