2.0.0相关修改更新

This commit is contained in:
GaoHao
2024-11-25 16:06:59 +08:00
parent 28950f0ad1
commit 740a3201e4
7 changed files with 94 additions and 68 deletions

View File

@@ -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

View File

@@ -4,11 +4,11 @@
<view class="bild">
<view class="bildLeft">
<text>我的余额</text>
<view>{{info.amount}}</view>
<view>{{info.amount||0}}</view>
</view>
<view class="bildRight">
<text>我的积分</text>
<view>{{info.accountPoints}}</view>
<view>{{info.accountPoints||0}}</view>
</view>
</view>
<view class="navTop">
@@ -34,7 +34,7 @@
</view>
</view>
<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>
</view>

View File

@@ -42,14 +42,13 @@
<view class="containertopboxitemright">
<view class="containertopboxitemright_one">
<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">
<text class="title" v-if="item.type == 2 ">{{ item.shopName }}</text>
<text class="title" v-if="item.type == 1 ">{{ item.name }}</text>
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png" mode="aspectFill">
<text class="title">{{ item.shopName }}</text>
</view>
<text>无门槛使用</text>
</view>
<view class="containertopboxitemright_tow">
<view> {{ item.type == 2 ? '会员商品券' : '通用红包券'}}</view>
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
<view
@click="navigatorGo(item)"
: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)) }
},
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)

View File

@@ -66,19 +66,21 @@
<u-icon name="arrow-right" color="#575B66" size="28" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"></u-icon>
</view>
<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">
<text>{{items.name}}</text>
<text>X{{items.num}}</text>
<text>-{{items.discountAmount || 0}}</text>
</view>
<u-icon v-if="item.value.length <= 0 && (listinfo.status == 'unpaid' || listinfo.status == 'paying')" name="arrow-right" color="#575B66" size="28"></u-icon>
<view :class="{column:item.value.length>0}">
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
<text>{{items.name}}</text>
<text>X{{items.num}}</text>
<text>-{{items.discountAmount || 0}}</text>
</view>
</view>
<u-icon name="arrow-right" color="#575B66" size="28" style="margin-top: 5rpx;"></u-icon>
</view>
<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">
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
</text>
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
{{calcUsablePointsData.unusableReason}}
{{calcUsablePointsData.unusableReason||''}}
</text>
<u-checkbox-group iconPlacement="right" @change="pointsChange">
@@ -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{

View File

@@ -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: {

View File

@@ -99,19 +99,21 @@
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
</view>
<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">
<text>{{items.name}}</text>
<text>X{{items.num}}</text>
<text>-{{items.discountAmount || 0}}</text>
<view :class="{column:item.value.length>0}">
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
<text>{{items.name}}</text>
<text>X{{items.num}}</text>
<text>-{{items.discountAmount || 0}}</text>
</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 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">
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
</text>
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
{{calcUsablePointsData.unusableReason}}
{{calcUsablePointsData.unusableReason||''}}
</text>
<u-checkbox-group iconPlacement="right" @change="pointsChange">
@@ -140,7 +142,7 @@
<!-- 充值免单 -->
<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>
<!-- 充值活动 -->
<topUpActivity v-if="storeInfo.registerType == 'munchies'" ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
@@ -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{

View File

@@ -34,7 +34,7 @@
<block v-if="listinfo.useType == 'dine-in-after'">
<rechargeFree
: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"
:freeDisabled="freeDisabled"
:payAmount="listinfo.payAmount"
@@ -43,7 +43,7 @@
<block v-else>
<rechargeFree
: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"
:freeDisabled="freeDisabled"
:payAmount="listinfo.payAmount"
@@ -122,12 +122,24 @@
this.orderId = e.orderId
this.orderorderInfo()
},
onShow() {
mounted() {
if ( this.listinfo.useType == "dine-in-after") {
console.log(this.$refs.orderInfoAfterRef)
this.$nextTick(()=>{
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