购物车修改

This commit is contained in:
GaoHao
2024-09-27 15:28:37 +08:00
parent 587fa3a620
commit a3e1d951e6
10 changed files with 4528 additions and 845 deletions

View File

@@ -232,7 +232,6 @@
},
},
onUnload() {
console.log(this)
if (this.socketTicket) {
this.socketTicket.Close()
uni.$off('message')
@@ -248,7 +247,6 @@
onLoad(e) {
console.log(e)
this.storeInfo = JSON.parse(decodeURIComponent(e.storeInfo));
console.log(this.storeInfo)
this.shopId =this.storeInfo.shopId;
this.listinfo.name = this.storeInfo.shopName;
this.listinfo.details = JSON.parse(e.cartLists).data;
@@ -269,7 +267,6 @@
}
},
onShow() {
console.log(this.listinfoid)
if (this.listinfoid) {
uni.$on('message', this.getMessage)
this.orderorderInfo()
@@ -286,7 +283,6 @@
scan () {
uni.scanCode({
success: (res) => {
console.log(res)
this.tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
if (this.tableCode) {
this.getProductqueryShop();
@@ -298,6 +294,10 @@
})
},
/**
* 获取店铺信息。桌台信息
* @param {Object} tableCode
*/
async getProductqueryShop (tableCode) {
let params = {
lng: uni.cache.get('getLocationstorage').lng ? uni.cache.get('getLocationstorage').lng :
@@ -309,7 +309,6 @@
if (this.shopId) {params.shopId = this.shopId}
let res = await this.api.productqueryShop(params)
this.shopTableInfo = res.data.shopTableInfo;
console.log(res)
},
/**
@@ -337,7 +336,6 @@
* @param {Object} msg
*/
getMessage(msg) {
console.log(msg)
if (msg == 1) { // 网络在连接
return false
}
@@ -371,7 +369,6 @@
this.orderorderInfo(1)
break;
case 'addCart':
console.log("商品列表===",msg)
this.isSocket = true;
if (this.listinfoid) {
this.orderorderInfo()
@@ -425,7 +422,6 @@
* @param {Object} n
*/
groupChange(e) {
console.log(e)
this.radiovalue = e.type;
this.paymentBtnText = e.name;
},
@@ -464,7 +460,6 @@
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
console.log("会员信息===",res)
this.amountVIP = res.data;
}
},
@@ -474,12 +469,10 @@
* @param {Object} i
*/
async orderorderInfo(i) {
console.log(this.listinfo)
let res = await this.api.orderorderInfo({
orderId: this.listinfoid
})
if (res.code == 0) {
console.log(res)
this.listinfo = res.data
if (i == 1) { //请求完了详情在去调支付
this.showpopupclickdd()
@@ -502,7 +495,6 @@
* 生成订单
*/
orderdetail() {
console.log(this.listinfo.details)
if (!this.isSocket) {
uni.showToast({
title: "当前网络异常,请稍后再试",
@@ -517,10 +509,7 @@
})
return;
}
let noteList = [];
this.listinfo.details.map((item)=>{
console.log(item)
})
let data = {
"skuId": '',
"num": '', //数量
@@ -544,7 +533,6 @@
* 去支付
*/
showpopupclickdd() {
console.log(this.radiovalue)
if ( this.radiovalue == 2 || this.radiovalue == 3 && this.listinfo.payAmount <= 0 ) {
uni.showToast({
title: "支付金额必须大于0",
@@ -566,7 +554,6 @@
this.goRecharge();
} else {
console.log(this.amountVIP)
if (uni.cache.get('userInfo').isPwd == 0) {
uni.navigateTo({
url: '/pages/member/setPassword?shopUserInfo=' + JSON.stringify(this.amountVIP)
@@ -680,7 +667,6 @@
*/
async accountPayevent(pwd) {
this.ispws = false;
console.log(pwd)
let res = await this.api.accountPay({
orderId: this.listinfoid,
memberId: this.amountVIP.id,

View File

@@ -42,7 +42,6 @@
};
},
onLoad(options) {
console.log(options)
this.tableCode = options.tableCode;
this.shopId = options.shopId;
},
@@ -55,7 +54,6 @@
* 切换桌型
*/
tabCut(index) {
console.log(index)
this.numIndex = index;
if ( index != -1) {
this.dinersNum = index+1;