2.0.0相关修改更新
This commit is contained in:
@@ -8,10 +8,10 @@ const proxyApi = "/api"
|
|||||||
// const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试
|
// const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试
|
||||||
// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||||
const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布
|
// const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布
|
||||||
const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布
|
// const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布
|
||||||
// const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||||
// const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上
|
const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<view class="bild">
|
<view class="bild">
|
||||||
<view class="bildLeft">
|
<view class="bildLeft">
|
||||||
<text>我的余额</text>
|
<text>我的余额</text>
|
||||||
<view>{{info.amount}}</view>
|
<view>{{info.amount||0}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bildRight">
|
<view class="bildRight">
|
||||||
<text>我的积分</text>
|
<text>我的积分</text>
|
||||||
<view>{{info.accountPoints}}</view>
|
<view>{{info.accountPoints||0}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="navTop">
|
<view class="navTop">
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="listrigth2">
|
<view class="listrigth2">
|
||||||
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
<view>{{$u.timeFormat(active == 1 ? item.create_time : item.createTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
||||||
<view v-if="active == 1">余额:{{item.balance}}</view>
|
<view v-if="active == 1">余额:{{item.balance}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -42,14 +42,13 @@
|
|||||||
<view class="containertopboxitemright">
|
<view class="containertopboxitemright">
|
||||||
<view class="containertopboxitemright_one">
|
<view class="containertopboxitemright_one">
|
||||||
<view class="flex-start">
|
<view class="flex-start">
|
||||||
<image class="icon" v-if="item.type == 2 " src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png" mode="aspectFill">
|
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png" mode="aspectFill">
|
||||||
<text class="title" v-if="item.type == 2 ">{{ item.shopName }}</text>
|
<text class="title">{{ item.shopName }}</text>
|
||||||
<text class="title" v-if="item.type == 1 ">{{ item.name }}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<text>无门槛使用</text>
|
<text>无门槛使用</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitemright_tow">
|
<view class="containertopboxitemright_tow">
|
||||||
<view> {{ item.type == 2 ? '会员商品券' : '通用红包券'}}</view>
|
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
|
||||||
<view
|
<view
|
||||||
@click="navigatorGo(item)"
|
@click="navigatorGo(item)"
|
||||||
:class="status == 1?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
:class="status == 1?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
||||||
@@ -113,6 +112,7 @@
|
|||||||
if (options.productList) { this.productList = JSON.parse(decodeURIComponent(options.productList)) }
|
if (options.productList) { this.productList = JSON.parse(decodeURIComponent(options.productList)) }
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.list = [];
|
||||||
this.getCouponList()
|
this.getCouponList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -124,6 +124,7 @@
|
|||||||
towcontentclick(item) {
|
towcontentclick(item) {
|
||||||
this.tabIndex = item.type;
|
this.tabIndex = item.type;
|
||||||
this.status = item.type;
|
this.status = item.type;
|
||||||
|
this.list = [];
|
||||||
this.getCouponList()
|
this.getCouponList()
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -142,7 +143,6 @@
|
|||||||
if ( this.shopId ) {
|
if ( this.shopId ) {
|
||||||
params.shopId = this.shopId;
|
params.shopId = this.shopId;
|
||||||
}
|
}
|
||||||
console.log("params",params)
|
|
||||||
let res = await this.api.conponList(params)
|
let res = await this.api.conponList(params)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
|||||||
@@ -66,19 +66,21 @@
|
|||||||
<u-icon name="arrow-right" color="#575B66" size="28" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"></u-icon>
|
<u-icon name="arrow-right" color="#575B66" size="28" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="favorable_right" :class="{column:item.value.length>0}" v-if="item.type=='product'">
|
<view class="favorable_right" :class="{column:item.value.length>0}" v-if="item.type=='product'">
|
||||||
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
|
<view :class="{column:item.value.length>0}">
|
||||||
<text>{{items.name}}</text>
|
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
|
||||||
<text>X{{items.num}}</text>
|
<text>{{items.name}}</text>
|
||||||
<text>-¥{{items.discountAmount || 0}}</text>
|
<text>X{{items.num}}</text>
|
||||||
</view>
|
<text>-¥{{items.discountAmount || 0}}</text>
|
||||||
<u-icon v-if="item.value.length <= 0 && (listinfo.status == 'unpaid' || listinfo.status == 'paying')" name="arrow-right" color="#575B66" size="28"></u-icon>
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-icon name="arrow-right" color="#575B66" size="28" style="margin-top: 5rpx;"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;" v-if="calcUsablePointsData.usable">
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;" v-if="calcUsablePointsData.usable">
|
||||||
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
|
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
|
||||||
</text>
|
</text>
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
|
||||||
{{calcUsablePointsData.unusableReason}}
|
{{calcUsablePointsData.unusableReason||''}}
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<u-checkbox-group iconPlacement="right" @change="pointsChange">
|
<u-checkbox-group iconPlacement="right" @change="pointsChange">
|
||||||
@@ -275,19 +277,24 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let calcUsablePointsData = {}
|
||||||
if ( this.listinfo.orderInfo.pointsDiscountAmount ) {
|
if ( this.listinfo.orderInfo.pointsDiscountAmount ) {
|
||||||
this.payAmount = this.payAmount + this.listinfo.orderInfo.pointsDiscountAmount
|
this.payAmount = this.payAmount + this.listinfo.orderInfo.pointsDiscountAmount
|
||||||
this.isPointsChecked = true;
|
this.isPointsChecked = true;
|
||||||
|
calcUsablePointsData.pointsNum = this.listinfo.orderInfo.pointsDiscountAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit("setPayAmount",{
|
this.$emit("setPayAmount",{
|
||||||
payAmount: this.listinfo.payAmount,
|
payAmount: this.listinfo.payAmount,
|
||||||
userCouponInfos: this.userCouponInfos,
|
userCouponInfos: this.userCouponInfos,
|
||||||
freeCheck: this.freeCheck,
|
freeCheck: this.freeCheck,
|
||||||
isPointsChecked: this.isPointsChecked,
|
isPointsChecked: this.isPointsChecked,
|
||||||
|
calcUsablePointsData: calcUsablePointsData,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
childOnShow() {
|
childOnShow() {
|
||||||
|
console.log('isShow==',this.isShow)
|
||||||
if (!this.isShow ) {
|
if (!this.isShow ) {
|
||||||
this.getCalcUsablePoints()
|
this.getCalcUsablePoints()
|
||||||
return;
|
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)
|
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) {
|
// if ( this.isPointsChecked && this.calcUsablePointsData) {
|
||||||
// this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
// this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||||
@@ -353,8 +360,8 @@
|
|||||||
// 商品券处理
|
// 商品券处理
|
||||||
if ( productList.length > 0 ) {
|
if ( productList.length > 0 ) {
|
||||||
//商品券使用数量
|
//商品券使用数量
|
||||||
|
|
||||||
|
let payAmount = this.listinfo.payAmount
|
||||||
productList.map((item,index)=>{
|
productList.map((item,index)=>{
|
||||||
// 筛选选中商品券商品列表
|
// 筛选选中商品券商品列表
|
||||||
let productDetails = this.listinfo.details.filter(v => v.productId == item.proId);
|
let productDetails = this.listinfo.details.filter(v => v.productId == item.proId);
|
||||||
@@ -371,15 +378,15 @@
|
|||||||
productDetails.map((v,indexs) => {
|
productDetails.map((v,indexs) => {
|
||||||
productDetailsNum += v.num;
|
productDetailsNum += v.num;
|
||||||
})
|
})
|
||||||
console.log(minCouponList)
|
|
||||||
for (let i = 0; i < v.num; i++){
|
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++
|
productNum++
|
||||||
productAllNum++
|
productAllNum++
|
||||||
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price
|
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
payAmount = payAmount - productPayAmount
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -502,7 +509,7 @@
|
|||||||
}
|
}
|
||||||
let res = await this.api.calcUsablePoints(params)
|
let res = await this.api.calcUsablePoints(params)
|
||||||
this.calcUsablePointsData = res.data;
|
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
|
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;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
.favorable_right_text{
|
.favorable_right_text{
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
text:nth-child(1){
|
text:nth-child(1){
|
||||||
@@ -816,6 +825,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.favorable_right.column{
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.favorable.column{
|
.favorable.column{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
payAmount (newVal) {
|
payAmount (newVal) {
|
||||||
if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||||
this.freeDisabled = true
|
this.freeDisabled = true
|
||||||
} else {
|
} else {
|
||||||
this.freeDisabled = false
|
this.freeDisabled = false
|
||||||
@@ -46,7 +46,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||||
|
this.freeDisabled = true
|
||||||
|
} else {
|
||||||
|
this.freeDisabled = false
|
||||||
|
}
|
||||||
|
console.log(this.freeDisabled )
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|||||||
@@ -99,19 +99,21 @@
|
|||||||
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
|
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="favorable_right" :class="{column:item.value.length>0}" v-if="item.type=='product'">
|
<view class="favorable_right" :class="{column:item.value.length>0}" v-if="item.type=='product'">
|
||||||
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
|
<view :class="{column:item.value.length>0}">
|
||||||
<text>{{items.name}}</text>
|
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
|
||||||
<text>X{{items.num}}</text>
|
<text>{{items.name}}</text>
|
||||||
<text>-¥{{items.discountAmount || 0}}</text>
|
<text>X{{items.num}}</text>
|
||||||
|
<text>-¥{{items.discountAmount || 0}}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-icon v-if="item.value.length <= 0" name="arrow-right" color="#575B66" size="28"></u-icon>
|
<u-icon name="arrow-right" color="#575B66" size="28" style="margin-top: 5rpx;"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;" v-if="calcUsablePointsData.usable">
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;" v-if="calcUsablePointsData.usable">
|
||||||
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
|
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
|
||||||
</text>
|
</text>
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
|
||||||
{{calcUsablePointsData.unusableReason}}
|
{{calcUsablePointsData.unusableReason||''}}
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<u-checkbox-group iconPlacement="right" @change="pointsChange">
|
<u-checkbox-group iconPlacement="right" @change="pointsChange">
|
||||||
@@ -140,7 +142,7 @@
|
|||||||
|
|
||||||
<!-- 充值免单 -->
|
<!-- 充值免单 -->
|
||||||
<view style="padding: 0 20rpx;">
|
<view style="padding: 0 20rpx;">
|
||||||
<rechargeFree v-if="freeDingConfig.enable == 1&&storeInfo.registerType == 'munchies'" ref="rechargeFree" :rechargeFreeChecked="rechargeFreeChecked" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
<rechargeFree v-if="freeDingConfig&&freeDingConfig.enable == 1&&storeInfo.registerType == 'munchies'" ref="rechargeFree" :rechargeFreeChecked="rechargeFreeChecked" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
||||||
</view>
|
</view>
|
||||||
<!-- 充值活动 -->
|
<!-- 充值活动 -->
|
||||||
<topUpActivity v-if="storeInfo.registerType == 'munchies'" ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
<topUpActivity v-if="storeInfo.registerType == 'munchies'" ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
||||||
@@ -293,7 +295,6 @@
|
|||||||
this.is_type = 1;
|
this.is_type = 1;
|
||||||
}
|
}
|
||||||
this.getProductqueryShop();
|
this.getProductqueryShop();
|
||||||
this.getchoseEatModel('index',0);
|
|
||||||
uni.cache.set('selectCouponData',[])
|
uni.cache.set('selectCouponData',[])
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -308,7 +309,7 @@
|
|||||||
item.show = true;
|
item.show = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.getAount()
|
||||||
this.getchoseEatModel('index',this.is_type)
|
this.getchoseEatModel('index',this.is_type)
|
||||||
},
|
},
|
||||||
methods: {
|
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)
|
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)
|
console.log(this.listinfo.payAmount)
|
||||||
// 判断优惠金额不能大于支付金额
|
// 判断优惠金额不能大于支付金额
|
||||||
if ( couponData.discountAmount < currentPayAmount) {
|
if ( couponData.discountAmount <= currentPayAmount) {
|
||||||
console.log(this.calcUsablePointsData)
|
console.log(this.calcUsablePointsData)
|
||||||
// if ( this.isPointsChecked && this.calcUsablePointsData) {
|
// if ( this.isPointsChecked && this.calcUsablePointsData) {
|
||||||
// this.listinfo.payAmount = (Number(this.listinfo.payAmount)-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
// 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)=>{
|
productList.map((item,index)=>{
|
||||||
// 筛选选中商品券商品列表
|
// 筛选选中商品券商品列表
|
||||||
let productDetails = this.listinfo.details.filter(v => v.productId == item.proId);
|
let productDetails = this.listinfo.details.filter(v => v.productId == item.proId);
|
||||||
@@ -383,14 +384,14 @@
|
|||||||
productDetailsNum += v.number;
|
productDetailsNum += v.number;
|
||||||
})
|
})
|
||||||
for (let i = 0; i < v.number; i++){
|
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++
|
productNum++
|
||||||
productAllNum++
|
productAllNum++
|
||||||
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.salePrice
|
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.salePrice
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
payAmount = payAmount - productPayAmount
|
||||||
})
|
})
|
||||||
if ( productNum > 0 ) {
|
if ( productNum > 0 ) {
|
||||||
this.userCouponInfos.push({
|
this.userCouponInfos.push({
|
||||||
@@ -622,6 +623,7 @@
|
|||||||
this.freeDingConfig = res.data.freeDingConfig;
|
this.freeDingConfig = res.data.freeDingConfig;
|
||||||
this.shopTableInfo = res.data.shopTableInfo;
|
this.shopTableInfo = res.data.shopTableInfo;
|
||||||
this.storeInfo = res.data.storeInfo;
|
this.storeInfo = res.data.storeInfo;
|
||||||
|
this.getchoseEatModel('index',this.is_type)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1494,9 +1496,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.favorable_right.column{
|
.favorable_right{
|
||||||
|
>.column{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
.favorable_right_text{
|
.favorable_right_text{
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
text:nth-child(1){
|
text:nth-child(1){
|
||||||
@@ -1514,6 +1518,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.favorable_right.column{
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.favorable.column{
|
.favorable.column{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<block v-if="listinfo.useType == 'dine-in-after'">
|
<block v-if="listinfo.useType == 'dine-in-after'">
|
||||||
<rechargeFree
|
<rechargeFree
|
||||||
:rechargeFreeChecked="rechargeFreeChecked"
|
:rechargeFreeChecked="rechargeFreeChecked"
|
||||||
v-if="listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
||||||
ref="rechargeFree"
|
ref="rechargeFree"
|
||||||
:freeDisabled="freeDisabled"
|
:freeDisabled="freeDisabled"
|
||||||
:payAmount="listinfo.payAmount"
|
:payAmount="listinfo.payAmount"
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<rechargeFree
|
<rechargeFree
|
||||||
:rechargeFreeChecked="rechargeFreeChecked"
|
:rechargeFreeChecked="rechargeFreeChecked"
|
||||||
v-if="listinfo.freeDingConfig.enable == 1&&(!listinfo.orderInfo.couponInfoList&&listinfo.orderInfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(!listinfo.orderInfo.couponInfoList&&listinfo.orderInfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
||||||
ref="rechargeFree"
|
ref="rechargeFree"
|
||||||
:freeDisabled="freeDisabled"
|
:freeDisabled="freeDisabled"
|
||||||
:payAmount="listinfo.payAmount"
|
:payAmount="listinfo.payAmount"
|
||||||
@@ -122,12 +122,24 @@
|
|||||||
this.orderId = e.orderId
|
this.orderId = e.orderId
|
||||||
this.orderorderInfo()
|
this.orderorderInfo()
|
||||||
},
|
},
|
||||||
onShow() {
|
mounted() {
|
||||||
if ( this.listinfo.useType == "dine-in-after") {
|
if ( this.listinfo.useType == "dine-in-after") {
|
||||||
|
console.log(this.$refs.orderInfoAfterRef)
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.orderInfoAfterRef.childOnShow();
|
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() {
|
onUnload() {
|
||||||
@@ -150,7 +162,7 @@
|
|||||||
this.couopnInfo = data;
|
this.couopnInfo = data;
|
||||||
this.freeDisabled = data.freeDisabled
|
this.freeDisabled = data.freeDisabled
|
||||||
this.freeCheck = data.freeCheck
|
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
|
this.freeDisabled = true
|
||||||
} else {
|
} else {
|
||||||
this.freeDisabled = false
|
this.freeDisabled = false
|
||||||
@@ -165,7 +177,6 @@
|
|||||||
// this.freeCheck = val;
|
// this.freeCheck = val;
|
||||||
this.rechargeFreeChecked = !val
|
this.rechargeFreeChecked = !val
|
||||||
|
|
||||||
|
|
||||||
if ( this.rechargeFreeChecked ) {
|
if ( this.rechargeFreeChecked ) {
|
||||||
if ( this.couopnInfo) {
|
if ( this.couopnInfo) {
|
||||||
if ( this.couopnInfo.isPointsChecked ) {
|
if ( this.couopnInfo.isPointsChecked ) {
|
||||||
@@ -186,10 +197,9 @@
|
|||||||
}
|
}
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
||||||
} else {
|
} else {
|
||||||
this.couopnInfo.isPointsChecked = false;
|
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
||||||
if ( this.couopnInfo) {
|
if ( this.couopnInfo) {
|
||||||
|
this.couopnInfo.isPointsChecked = false;
|
||||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
||||||
if ( couponList.length > 0) {
|
if ( couponList.length > 0) {
|
||||||
this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) - couponList[0].discountAmount : this.listinfo.payAmount)
|
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) {
|
saveImage (url) {
|
||||||
uni.saveImage({
|
uni.saveImage({
|
||||||
@@ -223,7 +230,7 @@
|
|||||||
*/
|
*/
|
||||||
async getAount() {
|
async getAount() {
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
"shopId": this.shopId,
|
"shopId": this.listinfo.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -253,11 +260,12 @@
|
|||||||
if (this.listinfo.useType == " ") {
|
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
|
this.freeDisabled = true
|
||||||
}
|
}
|
||||||
console.log(this.listinfo)
|
console.log(this.listinfo)
|
||||||
if ( this.listinfo.useType == "dine-in-after") {
|
if ( this.listinfo.useType == "dine-in-after") {
|
||||||
|
console.log(this.$refs.orderInfoAfterRef)
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.orderInfoAfterRef.childOnShow();
|
this.$refs.orderInfoAfterRef.childOnShow();
|
||||||
})
|
})
|
||||||
@@ -265,17 +273,8 @@
|
|||||||
this.getAount();
|
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() {
|
goRecharge() {
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
uni.pro.navigateTo('/pages/member/index', {
|
||||||
shopId: this.shopId
|
shopId: this.listinfo.shopId
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -304,6 +303,7 @@
|
|||||||
orderId: this.listinfo.orderId,
|
orderId: this.listinfo.orderId,
|
||||||
userCouponInfos: this.couopnInfo.userCouponInfos,
|
userCouponInfos: this.couopnInfo.userCouponInfos,
|
||||||
}
|
}
|
||||||
|
console.log( this.couopnInfo )
|
||||||
if ( this.couopnInfo.isPointsChecked && this.couopnInfo.calcUsablePointsData.pointsNum && this.couopnInfo.calcUsablePointsData.pointsNum > 0) {
|
if ( this.couopnInfo.isPointsChecked && this.couopnInfo.calcUsablePointsData.pointsNum && this.couopnInfo.calcUsablePointsData.pointsNum > 0) {
|
||||||
params.pointsNum = this.couopnInfo.calcUsablePointsData.pointsNum;
|
params.pointsNum = this.couopnInfo.calcUsablePointsData.pointsNum;
|
||||||
}
|
}
|
||||||
@@ -424,7 +424,7 @@
|
|||||||
} else {
|
} else {
|
||||||
console.log(this.listinfo.payAmount)
|
console.log(this.listinfo.payAmount)
|
||||||
res = await this.api.paymemeberIn({
|
res = await this.api.paymemeberIn({
|
||||||
shopId: uni.cache.get('shopId'),
|
shopId: this.listinfo.shopId,
|
||||||
amount: this.listinfo.payAmount,
|
amount: this.listinfo.payAmount,
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|||||||
Reference in New Issue
Block a user