Commit abc500e6 by 宋冰琦

修复部分bug

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