订单相关修改提测
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
<view class="remark">
|
||||
<view class="remark_bg">
|
||||
<view class="remark_title">订单备注</view>
|
||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="false" :clearable="true"/>
|
||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="textareaBorder" :clearable="true"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
{ name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||
],
|
||||
paymentMethodList:[
|
||||
{ name: "会员卡支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||
{ name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
||||
],
|
||||
order: {
|
||||
@@ -191,7 +191,8 @@
|
||||
payPasswordShow: false,
|
||||
amountVIP: null, // 会员信息
|
||||
listinfoid: null,
|
||||
paymentBtnText: "会员卡支付",
|
||||
paymentBtnText: "余额支付",
|
||||
isSocket: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -210,9 +211,13 @@
|
||||
uni.$off('message')
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(JSON.parse(e.cartList))
|
||||
this.listinfo.name = JSON.parse(e.storeInfo).shopName;
|
||||
this.listinfo.details = JSON.parse(e.cartList).data;
|
||||
this.listinfo.payAmount = JSON.parse(e.cartList).amount;
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.listinfoid)
|
||||
if (this.listinfoid) {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.orderorderInfo()
|
||||
@@ -244,6 +249,7 @@
|
||||
} else {
|
||||
switch (msg.type) {
|
||||
case 'createOrder':
|
||||
this.isSocket = true;
|
||||
this.listinfoid = msg.data.id
|
||||
console.log(msg)
|
||||
this.listinfo.details = msg.data.detailList;
|
||||
@@ -253,7 +259,7 @@
|
||||
break;
|
||||
case 'addCart':
|
||||
console.log("商品列表===",msg)
|
||||
|
||||
this.isSocket = true;
|
||||
if (this.listinfoid) {
|
||||
this.orderorderInfo()
|
||||
} else {
|
||||
@@ -276,6 +282,7 @@
|
||||
this.listinfo.details = msg.data;
|
||||
this.listinfo.payAmount = msg.amount;
|
||||
}
|
||||
this.isSocket = true;
|
||||
break;
|
||||
}
|
||||
this.$set(this, 'cartLists', msg)
|
||||
@@ -298,7 +305,7 @@
|
||||
*/
|
||||
groupChange(n) {
|
||||
this.radiovalue = n;
|
||||
this.paymentBtnText = n==1?'会员卡支付':'微信支付'
|
||||
this.paymentBtnText = n==1?'余额支付':'微信支付'
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -309,7 +316,7 @@
|
||||
this.socketTicket ? this.socketTicket.Close() : null
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
@@ -331,7 +338,7 @@
|
||||
*/
|
||||
async getAount() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
@@ -365,7 +372,7 @@
|
||||
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
||||
// console.log(this.amountVIP.isVip, '调试1')
|
||||
uni.pro.navigateTo('/pages/member/index', {
|
||||
shopId: uni.cache.get('shopUser')
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
},
|
||||
|
||||
@@ -374,6 +381,13 @@
|
||||
*/
|
||||
orderdetail() {
|
||||
console.log(this.listinfo.details)
|
||||
if (!this.isSocket) {
|
||||
uni.showToast({
|
||||
title: "当前网络异常,请稍后再试",
|
||||
icon: "none",
|
||||
})
|
||||
return;
|
||||
}
|
||||
if ( this.listinfo.details.length == 0) {
|
||||
uni.showToast({
|
||||
title: "购物车为空,请添加商品",
|
||||
@@ -390,7 +404,7 @@
|
||||
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||
"productId": '', //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
}
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
||||
<view class="container">
|
||||
<!-- 占位符 接口请求完毕才显示 -->
|
||||
<view v-if="fixedtrue"
|
||||
<!-- <view v-if="fixedtrue"
|
||||
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
||||
<image style="width: 140rpx; height: 140rpx;" src="@/static/1.gif" mode="aspectFill"></image>
|
||||
<text style="margin-left:10rpx;font-size: 40rpx;color: #7d7d76;">加载中</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 顶部面板 -->
|
||||
<view class="top--panel">
|
||||
<navseat :opacity='opacity' :inputshow="true" :readonly="true" @searchStatus="searchStatus" :titleshow='true' @navigateBacknav='navigateBacknav'
|
||||
@@ -243,7 +243,7 @@
|
||||
<view class="list-wrap">
|
||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||
<view class="cover">
|
||||
<c-image :src="item.coverImg" width="120" height="120"></c-image>
|
||||
<u-image :src="item.coverImg" width="120" height="120"></u-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="name"> {{ item.name }} </view>
|
||||
@@ -427,6 +427,7 @@
|
||||
orderdetailFlag: true,
|
||||
forceUpdate: false,
|
||||
shopExtend: null,
|
||||
shopId: null,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -468,8 +469,11 @@
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
if (this.socketTicket) {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
}
|
||||
|
||||
this.fixedtrue = true
|
||||
},
|
||||
async onShow() {
|
||||
@@ -489,7 +493,7 @@
|
||||
*/
|
||||
async getShopExtend () {
|
||||
let res = await this.api.getShopExtend({
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
autokey: "shopInfo_bg" //index_bg my_bg member_bg shopInfo_bg
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
@@ -514,7 +518,7 @@
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
@@ -573,7 +577,9 @@
|
||||
'',
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('shopUser', res.data.storeInfo.id)
|
||||
let expireTime = uni.utils.timestamp() + 30 * 60; // 有效期
|
||||
uni.cache.set('shopId', res.data.storeInfo.id, expireTime)
|
||||
this.shopId = res.data.storeInfo.id;
|
||||
this.shopInfo = res.data;
|
||||
this.productqueryProduct() //list 数据
|
||||
this.handlemessage() //监听websocket返回
|
||||
@@ -691,7 +697,7 @@
|
||||
"type": a == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
@@ -715,7 +721,7 @@
|
||||
"type": c == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.productId, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
@@ -743,7 +749,7 @@
|
||||
*/
|
||||
async cartclear() {
|
||||
let res = await this.api.cleanCart({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
})
|
||||
},
|
||||
@@ -964,7 +970,7 @@
|
||||
// console.log(this.skuidname.join(","))
|
||||
let res = await this.api.productqueryProductSku({
|
||||
code: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
productId: item.id, //商品id
|
||||
isVip: item.isVip, //商品id
|
||||
spec_tag: this.skuidname.join(","),
|
||||
@@ -978,7 +984,7 @@
|
||||
"type": c == '+' ? 1 : 0,
|
||||
"productId": item.id, //商品id
|
||||
"isVip": item.isVip,
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
@@ -1018,7 +1024,7 @@
|
||||
return false
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_food/confirm_order?storeInfo=' + JSON.stringify(this.shopInfo.storeInfo)
|
||||
url: `/pages/order_food/confirm_order?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
|
||||
});
|
||||
|
||||
},
|
||||
@@ -1102,7 +1108,7 @@
|
||||
*/
|
||||
async productqueryProduct() {
|
||||
let res = await this.api.productqueryProduct({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"productGroupId": ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
@@ -1203,7 +1209,9 @@
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
|
||||
::v-deep .u-input input{
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbarcontent .active {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<page-meta :page-style="'overflow:'+(pagemetashow?'hidden':'visible')"></page-meta>
|
||||
<view class="container">
|
||||
<!-- 占位符 接口请求完毕才显示 -->
|
||||
<view v-if="fixedtrue"
|
||||
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
||||
<image style="width: 140rpx; height: 140rpx;" src="@/static/1.gif" mode="aspectFill"></image>
|
||||
<text style="margin-left:10rpx;font-size: 40rpx;color: #7d7d76;">加载中</text>
|
||||
</view>
|
||||
|
||||
<!-- 顶部面板 -->
|
||||
<view class="top--panel">
|
||||
<navseat :opacity='true' :inputshow="true" :readonly="false" :focus="true" @searchVal="searchVal" :titleshow='true' @navigateBacknav='navigateBacknav'
|
||||
:navigateBacknavtitle='false'></navseat>
|
||||
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
|
||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;width:100%;background-color: #E8AD7B;'}"></view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;width:100%;'}"></view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view :style="{'height':systemInfo.titleBarHeight+systemInfo.statusBarHeight+'px;width:100%;'}"></view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<!-- 滚动区域 -->
|
||||
<view class="scroll-panel" id="scroll-panel">
|
||||
@@ -126,7 +126,7 @@
|
||||
<view class="list-wrap">
|
||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||
<view class="cover">
|
||||
<c-image :src="item.coverImg" width="120" height="120"></c-image>
|
||||
<u-image :src="item.coverImg" width="120" height="120"></u-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="name"> {{ item.name }} </view>
|
||||
@@ -238,7 +238,6 @@
|
||||
data() {
|
||||
return {
|
||||
pagemetashow: false,
|
||||
fixedtrue: true,
|
||||
userInfo: uni.cache.get('userInfo'), //个人信息
|
||||
opacity: false, //是否显示
|
||||
fillHeight: 0, // 填充高度,用于最后一项低于滚动区域时使用
|
||||
@@ -269,6 +268,7 @@
|
||||
orderdetailFlag: true,
|
||||
|
||||
searchList: [],
|
||||
systemInfo: getApp().globalData.systemInfo,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -293,9 +293,9 @@
|
||||
onHide() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
this.fixedtrue = true
|
||||
},
|
||||
async onShow() {
|
||||
this.shopId = uni.cache.get('shopId');
|
||||
let _this = this;
|
||||
this.orderdetailFlag = true;
|
||||
uni.pageScrollTo({
|
||||
@@ -314,7 +314,7 @@
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
@@ -333,7 +333,6 @@
|
||||
'',
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('shopUser', res.data.storeInfo.id)
|
||||
this.shopInfo = res.data;
|
||||
this.productqueryProduct() //list 数据
|
||||
this.handlemessage() //监听websocket返回
|
||||
@@ -350,7 +349,7 @@
|
||||
*/
|
||||
async productqueryProduct() {
|
||||
let res = await this.api.productqueryProduct({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"productGroupId": ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
@@ -468,7 +467,7 @@
|
||||
"type": a == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
@@ -492,7 +491,7 @@
|
||||
"type": c == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.productId, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
@@ -520,7 +519,7 @@
|
||||
*/
|
||||
async cartclear() {
|
||||
let res = await this.api.cleanCart({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
})
|
||||
},
|
||||
@@ -580,7 +579,6 @@
|
||||
* @param {Object} index1
|
||||
*/
|
||||
async clickspecifications(item1, index1, type) {
|
||||
console.log(item1)
|
||||
if ( item1.isPauseSale != 0 || item1.isSale == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -595,15 +593,12 @@
|
||||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||
this.skuBtnText = `添加到购物车`
|
||||
} else {
|
||||
console.log(3)
|
||||
// 多规格数据处理
|
||||
this.isSpec = false;
|
||||
let obj = await this.api.productquerySpec({
|
||||
productId: item1.id, //商品id
|
||||
})
|
||||
console.log(2)
|
||||
this.querySpecList = obj.data;
|
||||
console.log(1)
|
||||
this.specifications.tagSnap = JSON.parse(item1.productSkuResult.tagSnap).map((item,index) => {
|
||||
let res = {
|
||||
id: item1.id, //商品id
|
||||
@@ -645,9 +640,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
console.log(1)
|
||||
this.skuBtnText = `您还没选择${this.specifications.tagSnap[0].name}哦`
|
||||
console.log(this.specifications)
|
||||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||
}
|
||||
|
||||
@@ -743,15 +736,13 @@
|
||||
*/
|
||||
async hodgepodge(item, a, c, num) { //此接口去获取商品id !!!赋值库存 数量 价格等
|
||||
try {
|
||||
console.log(this.skuidname.join(","))
|
||||
let res = await this.api.productqueryProductSku({
|
||||
code: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: this.shopId,
|
||||
productId: item.id, //商品id
|
||||
isVip: item.isVip, //商品id
|
||||
spec_tag: this.skuidname.join(","),
|
||||
})
|
||||
console.log(res)
|
||||
this.salePrice = res.data.salePrice // 价格
|
||||
let data = null;
|
||||
if (a == 1) { //1添加购物车 2是websocket返回这个商品的价格(应为不同的多规格商品返回不同的价格)
|
||||
@@ -761,7 +752,7 @@
|
||||
"type": c == '+' ? 1 : 0,
|
||||
"productId": item.id, //商品id
|
||||
"isVip": item.isVip,
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
"tableId": uni.cache.get('tableCode'),
|
||||
}
|
||||
@@ -801,7 +792,7 @@
|
||||
return false
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/order_food/confirm_order?storeInfo=' + JSON.stringify(this.shopInfo.storeInfo)
|
||||
url: `/pages/order_food/confirm_order?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
|
||||
});
|
||||
|
||||
},
|
||||
@@ -812,10 +803,8 @@
|
||||
*/
|
||||
getMessage(msg) { //wss 回显数据
|
||||
if (msg == 1) { // 网络在连接
|
||||
this.fixedtrue = true
|
||||
return false
|
||||
}
|
||||
this.fixedtrue = false
|
||||
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
||||
return false
|
||||
}
|
||||
@@ -885,7 +874,11 @@
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
|
||||
|
||||
::v-deep .u-input input{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&>view {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user