diff --git a/framework/0-conf.js b/framework/0-conf.js index d002bd2..5d0ebde 100644 --- a/framework/0-conf.js +++ b/framework/0-conf.js @@ -8,10 +8,10 @@ const proxyApi = "/api" // const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试 // const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试 // const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试 -const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布 -const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布 -// const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上 -// const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上 +// const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布 +// const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布 +const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上 +const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上 // #endif // #ifdef H5 diff --git a/pages/member/billDetails.vue b/pages/member/billDetails.vue index 295a1a1..1b03148 100644 --- a/pages/member/billDetails.vue +++ b/pages/member/billDetails.vue @@ -4,11 +4,11 @@ 我的余额 - {{info.amount}} + {{info.amount||0}} 我的积分 - {{info.accountPoints}} + {{info.accountPoints||0}} @@ -34,7 +34,7 @@ - {{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}} + {{$u.timeFormat(active == 1 ? item.create_time : item.createTime, 'yyyy-mm-dd hh:MM:ss')}} 余额:{{item.balance}} diff --git a/pages/user/coupon.vue b/pages/user/coupon.vue index b7c4ccb..360c27f 100644 --- a/pages/user/coupon.vue +++ b/pages/user/coupon.vue @@ -42,14 +42,13 @@ - - {{ item.shopName }} - {{ item.name }} + + {{ item.shopName }} 无门槛使用 - {{ item.type == 2 ? '会员商品券' : '通用红包券'}} + {{ item.type == 2 ? '会员商品券' : item.name}} @@ -113,6 +112,7 @@ if (options.productList) { this.productList = JSON.parse(decodeURIComponent(options.productList)) } }, onShow() { + this.list = []; this.getCouponList() }, methods: { @@ -124,6 +124,7 @@ towcontentclick(item) { this.tabIndex = item.type; this.status = item.type; + this.list = []; this.getCouponList() }, @@ -142,7 +143,6 @@ if ( this.shopId ) { params.shopId = this.shopId; } - console.log("params",params) let res = await this.api.conponList(params) if (res.code == 0) { console.log(res) diff --git a/pagesOrder/components/orderInfoAfter.vue b/pagesOrder/components/orderInfoAfter.vue index 2210777..ded971b 100644 --- a/pagesOrder/components/orderInfoAfter.vue +++ b/pagesOrder/components/orderInfoAfter.vue @@ -66,19 +66,21 @@ - - {{items.name}} - X{{items.num}} - -¥{{items.discountAmount || 0}} - - + + + {{items.name}} + X{{items.num}} + -¥{{items.discountAmount || 0}} + + + 使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}} - {{calcUsablePointsData.unusableReason}} + {{calcUsablePointsData.unusableReason||''}} @@ -275,19 +277,24 @@ } } + let calcUsablePointsData = {} if ( this.listinfo.orderInfo.pointsDiscountAmount ) { this.payAmount = this.payAmount + this.listinfo.orderInfo.pointsDiscountAmount this.isPointsChecked = true; + calcUsablePointsData.pointsNum = this.listinfo.orderInfo.pointsDiscountAmount } + this.$emit("setPayAmount",{ payAmount: this.listinfo.payAmount, userCouponInfos: this.userCouponInfos, freeCheck: this.freeCheck, isPointsChecked: this.isPointsChecked, + calcUsablePointsData: calcUsablePointsData, }) }, methods: { childOnShow() { + console.log('isShow==',this.isShow) if (!this.isShow ) { this.getCalcUsablePoints() return; @@ -318,7 +325,7 @@ //不包含优惠券的金额 let currentPayAmount = (this.userCouponInfos.filter(v => v.type == 1).length > 0 ? Number(this.listinfo.payAmount) + couponData.discountAmount : this.listinfo.payAmount) // 判断优惠金额不能大于支付金额 - if ( couponData.discountAmount < currentPayAmount) { + if ( couponData.discountAmount <= currentPayAmount) { // if ( this.isPointsChecked && this.calcUsablePointsData) { // this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2); @@ -353,8 +360,8 @@ // 商品券处理 if ( productList.length > 0 ) { //商品券使用数量 - - + + let payAmount = this.listinfo.payAmount productList.map((item,index)=>{ // 筛选选中商品券商品列表 let productDetails = this.listinfo.details.filter(v => v.productId == item.proId); @@ -371,15 +378,15 @@ productDetails.map((v,indexs) => { productDetailsNum += v.num; }) - console.log(minCouponList) for (let i = 0; i < v.num; i++){ - if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.price) <= (this.listinfo.payAmount - productPayAmount) )) { + if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.price) <= (payAmount - productPayAmount) )) { productNum++ productAllNum++ productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price } } + payAmount = payAmount - productPayAmount }) @@ -502,7 +509,7 @@ } let res = await this.api.calcUsablePoints(params) this.calcUsablePointsData = res.data; - if ( this.calcUsablePointsData.usable && this.listinfo.payAmount >= this.calcUsablePointsData.minPaymentAmount) { + if ( this.calcUsablePointsData.usable && params.orderAmount >= this.calcUsablePointsData.minPaymentAmount) { this.calcUsablePointsData.pointsNum = this.calcUsablePointsData.accountPoints >= this.calcUsablePointsData.maxUsablePoints ? this.calcUsablePointsData.maxUsablePoints : this.calcUsablePointsData.accountPoints } }, @@ -796,9 +803,11 @@ } } - .favorable_right.column{ + .favorable_right{ + .column{ display: flex; flex-direction: column; + align-items: flex-end; .favorable_right_text{ margin-bottom: 10rpx; text:nth-child(1){ @@ -816,6 +825,10 @@ } } + } + } + .favorable_right.column{ + align-items: flex-start; } } .favorable.column{ diff --git a/pagesOrder/components/rechargeFree.vue b/pagesOrder/components/rechargeFree.vue index 12536d1..3f371f2 100644 --- a/pagesOrder/components/rechargeFree.vue +++ b/pagesOrder/components/rechargeFree.vue @@ -38,7 +38,7 @@ }, watch: { payAmount (newVal) { - if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) { + if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) { this.freeDisabled = true } else { this.freeDisabled = false @@ -46,7 +46,12 @@ } }, mounted() { - + if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) { + this.freeDisabled = true + } else { + this.freeDisabled = false + } + console.log(this.freeDisabled ) }, methods: { diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue index 5db2307..6cde1d9 100644 --- a/pagesOrder/confirm_order/index.vue +++ b/pagesOrder/confirm_order/index.vue @@ -99,19 +99,21 @@ - - {{items.name}} - X{{items.num}} - -¥{{items.discountAmount || 0}} + + + {{items.name}} + X{{items.num}} + -¥{{items.discountAmount || 0}} + - + 使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}} - {{calcUsablePointsData.unusableReason}} + {{calcUsablePointsData.unusableReason||''}} @@ -140,7 +142,7 @@ - + @@ -293,7 +295,6 @@ this.is_type = 1; } this.getProductqueryShop(); - this.getchoseEatModel('index',0); uni.cache.set('selectCouponData',[]) }, onShow() { @@ -308,7 +309,7 @@ item.show = true; } }) - + this.getAount() this.getchoseEatModel('index',this.is_type) }, methods: { @@ -329,7 +330,7 @@ let currentPayAmount = (this.userCouponInfos.filter(v => v.type == 1).length > 0 ? Number(this.listinfo.payAmount) + couponData.discountAmount : this.listinfo.payAmount) console.log(this.listinfo.payAmount) // 判断优惠金额不能大于支付金额 - if ( couponData.discountAmount < currentPayAmount) { + if ( couponData.discountAmount <= currentPayAmount) { console.log(this.calcUsablePointsData) // if ( this.isPointsChecked && this.calcUsablePointsData) { // this.listinfo.payAmount = (Number(this.listinfo.payAmount)-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2); @@ -363,7 +364,7 @@ //商品券使用数量 - + let payAmount = this.listinfo.payAmount productList.map((item,index)=>{ // 筛选选中商品券商品列表 let productDetails = this.listinfo.details.filter(v => v.productId == item.proId); @@ -383,14 +384,14 @@ productDetailsNum += v.number; }) for (let i = 0; i < v.number; i++){ - if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.salePrice) <= (this.listinfo.payAmount - productPayAmount) )) { + if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.salePrice) <= (payAmount - productPayAmount) )) { productNum++ productAllNum++ productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.salePrice } } - + payAmount = payAmount - productPayAmount }) if ( productNum > 0 ) { this.userCouponInfos.push({ @@ -622,6 +623,7 @@ this.freeDingConfig = res.data.freeDingConfig; this.shopTableInfo = res.data.shopTableInfo; this.storeInfo = res.data.storeInfo; + this.getchoseEatModel('index',this.is_type) }, /** @@ -1494,9 +1496,11 @@ } } - .favorable_right.column{ + .favorable_right{ + >.column{ display: flex; flex-direction: column; + align-items: flex-end; .favorable_right_text{ margin-bottom: 10rpx; text:nth-child(1){ @@ -1514,6 +1518,10 @@ } } + } + } + .favorable_right.column{ + align-items: flex-start; } } .favorable.column{ diff --git a/pagesOrder/order_detail/index.vue b/pagesOrder/order_detail/index.vue index 93960e0..4451274 100644 --- a/pagesOrder/order_detail/index.vue +++ b/pagesOrder/order_detail/index.vue @@ -34,7 +34,7 @@ { this.$refs.orderInfoAfterRef.childOnShow(); }) - + } + }, + onShow() { + console.log("this.listinfo==",this.listinfo) + if ( this.listinfo.useType == "dine-in-after") { + console.log(this.$refs.orderInfoAfterRef) + this.$nextTick(()=>{ + this.$refs.orderInfoAfterRef.childOnShow(); + }) + } + if ( this.listinfo ) { + this.getAount(); } }, onUnload() { @@ -150,7 +162,7 @@ this.couopnInfo = data; this.freeDisabled = data.freeDisabled this.freeCheck = data.freeCheck - if ( this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) { + if ( this.listinfo.freeDingConfig && this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) { this.freeDisabled = true } else { this.freeDisabled = false @@ -165,7 +177,6 @@ // this.freeCheck = val; this.rechargeFreeChecked = !val - if ( this.rechargeFreeChecked ) { if ( this.couopnInfo) { if ( this.couopnInfo.isPointsChecked ) { @@ -186,10 +197,9 @@ } this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2) } else { - this.couopnInfo.isPointsChecked = false; this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2) if ( this.couopnInfo) { - + this.couopnInfo.isPointsChecked = false; let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1); if ( couponList.length > 0) { this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) - couponList[0].discountAmount : this.listinfo.payAmount) @@ -203,9 +213,6 @@ } } - - - console.log(this.freeCheck) }, saveImage (url) { uni.saveImage({ @@ -223,7 +230,7 @@ */ async getAount() { let res = await this.api.shopUserInfo({ - "shopId": this.shopId, + "shopId": this.listinfo.shopId, "userId": uni.cache.get('userInfo').id, }) if (res.code == 0) { @@ -253,11 +260,12 @@ if (this.listinfo.useType == " ") { //堂食先付费 } - if ( this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) { + if ( this.listinfo.freeDingConfig && this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) { this.freeDisabled = true } console.log(this.listinfo) if ( this.listinfo.useType == "dine-in-after") { + console.log(this.$refs.orderInfoAfterRef) this.$nextTick(()=>{ this.$refs.orderInfoAfterRef.childOnShow(); }) @@ -265,17 +273,8 @@ this.getAount(); } - let params = { - userId: uni.cache.get('userInfo').id, - status: 1, - orderId: -1, - shopId: this.shopId - } - console.log("params",params) - let ress = await this.api.conponList(params) - if (ress.code == 0) { - let list = ress.data; - } + + }, /** @@ -283,7 +282,7 @@ */ goRecharge() { uni.pro.navigateTo('/pages/member/index', { - shopId: this.shopId + shopId: this.listinfo.shopId }) }, @@ -304,6 +303,7 @@ orderId: this.listinfo.orderId, userCouponInfos: this.couopnInfo.userCouponInfos, } + console.log( this.couopnInfo ) if ( this.couopnInfo.isPointsChecked && this.couopnInfo.calcUsablePointsData.pointsNum && this.couopnInfo.calcUsablePointsData.pointsNum > 0) { params.pointsNum = this.couopnInfo.calcUsablePointsData.pointsNum; } @@ -424,7 +424,7 @@ } else { console.log(this.listinfo.payAmount) res = await this.api.paymemeberIn({ - shopId: uni.cache.get('shopId'), + shopId: this.listinfo.shopId, amount: this.listinfo.payAmount, orderId: this.orderId, // #ifdef MP-WEIXIN