This commit is contained in:
ylj20011123 2025-11-14 16:35:39 +08:00
parent 86c49df528
commit 4175217ee2
72 changed files with 1117 additions and 377 deletions

View File

@ -10,7 +10,7 @@
<scroll-view class="couponContent" scroll-y>
<view class="couponItem" v-for="(item, index) in showCouponList" :key="index">
<view class="couponItemTop">
<view class="couponItemLeft">
<view class="couponItemLeft" v-if="item.CouponType !== 9000">
<view class="couponItemPrice">
<text class="couponItemPriceUnit">¥</text>
<text class="couponItemPriceValue">{{ item.UseAmount }}</text>
@ -23,6 +23,12 @@
: "无门槛使用"
}}</view>
</view>
<view class="couponItemLeft" v-if="item.CouponType === 9000">
<view class="couponItemPrice">
<text class="couponItemPriceUnit">¥</text>
<text class="couponItemPriceValue">{{ item.UseAmount }}</text>
</view>
</view>
<view class="couponItemRight">
<view class="couponItemRightLeft">
@ -102,12 +108,11 @@ export default {
// this.couponList = []
// this.novalid = []
// },
onShow() {
async onShow() {
// this.getList();
await this.handleGetData()
},
async onLoad(option) {
await this.handleGetData()
this.$utils.addUserBehaviorNew({
behaviorRecordDesc: "查看券包"
});
@ -167,10 +172,15 @@ export default {
// uni.navigateTo({
// url: "/pages/couponDetail/index?sendId=" + item.CouponSendId,
// });
uni.navigateTo({
url: "/pages/serviceList/index?type=food",
});
if (item.CouponType === 9000) {
uni.navigateTo({
url: `/pages/payfor/index?cid=${item.CouponSendId}`,
});
} else {
uni.navigateTo({
url: "/pages/serviceList/index?type=food",
});
}
},
couponBtn() {
this.$store.commit("couponPrice", this.couponList[this.radio]);
@ -206,6 +216,7 @@ export default {
}
})
}
console.log('toBeUsedtoBeUsedtoBeUsed', toBeUsed);
this.allCouponList = [toBeUsed, usedAlready, expired]
this.showCouponList = this.allCouponList[this.selectTab - 1]
@ -312,7 +323,7 @@ export default {
box-sizing: border-box;
padding: 28rpx 24rpx;
background: #FFFFFF;
border-radius: 8rpx;
border-radius: 16rpx;
margin-bottom: 22rpx;
.couponItemTop {

View File

@ -120,9 +120,56 @@
</div>
</div>
<!-- 二维码的框 -->
<div class="qrCodeBox">
<!-- 券轮播图 -->
<div class="qrCodeBox" v-if="orderInfo.CouponList && orderInfo.CouponList.length > 0">
<!-- Swiper轮播区域 -->
<swiper class="coupon-swiper" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="300"
:circular="true" :current="currentIndex" @change="onSwiperChange">
<swiper-item v-for="(item, index) in orderInfo.CouponList" :key="index">
<div class="coupon-item">
<div class="itemTop">
<div class="itemTopLeft"
:style="{ textDecoration: item.COUPON_STATE === 0 ? '' : 'line-through', color: item.COUPON_STATE === 0 ? '' : '#8a8a8a' }">
{{
item.COUPON_STATE
=== 0 ? '待使用' : item.COUPON_STATE === 1 ? '已使用' :
item.COUPON_STATE
=== 2 ? '已失效' : '' }}</div>
<div class="itemTopRight" v-if="item.COUPON_STATE === 0" @click="handleGoWriteOff(item)">去核销</div>
</div>
<div class="itemBottom">
<div class="itemBottomItem">
<div class="itemBottomItemLabel">卡券名称</div>
<div class="itemBottomItemValue">{{ item.COUPON_NAME || "" }}</div>
</div>
<div class="itemBottomItem">
<div class="itemBottomItemLabel">核销时间</div>
<div class="itemBottomItemValue">{{ item.USED_DATE || "" }}</div>
</div>
<div class="itemBottomItem">
<div class="itemBottomItemLabel">卡券要求</div>
<div class="itemBottomItemValue">{{ item.COOPSHOP_DESC || "" }}</div>
</div>
</div>
<!-- 页码显示 -->
<div class="coupon-page" v-if="orderInfo.CouponList.length > 1">
<span class="page-current">{{ index + 1 }}</span>
<span class="page-separator">/</span>
<span class="page-total">{{ orderInfo.CouponList.length }}</span>
</div>
<!-- <div class="coupon-name">{{ coupon.COUPON_NAME || '' }}</div>
<div class="qr-code-area">
<div class="qr-code-placeholder">
<canvas :canvas-id="'qrCode' + coupon.COUPON_ID" style="height: 280rpx; width: 280rpx" />
</div>
</div>
<div class="coupon-page">{{ index + 1 }}/{{ orderInfo.CouponList.length }}</div> -->
</div>
</swiper-item>
</swiper>
</div>
<!-- 订单详情 -->
<div class="order-info">
@ -281,19 +328,26 @@ export default {
},
sellchildid: "", // ID
showNotice: false,
//
couponList: [], //
currentIndex: 0, //
};
},
computed: {
...mapGetters(["user"]),
tatalMoney() {
let total = this.orderAmount;
total =
this.orderInfo.COUPON_ID ? Math.round((total - this.orderInfo.COUPON_AMOUNT || 0) * 100) / 100 : total
total = this.orderInfo.COUPON_ID ? Math.round((total - this.orderInfo.COUPON_AMOUNT || 0) * 100) / 100 : total
return total;
return total.toFixed(2);
},
},
methods: {
handleGoWriteOff(obj) {
uni.navigateTo({
url: `/pages/payfor/index?cid=${obj.COUPON_SEND_ID}`,
});
},
//
handleClipboard(text) {
if (!text) {
@ -623,6 +677,9 @@ export default {
//
_this.showTime();
}
//
// _this.getCouponData();
}
});
},
@ -964,6 +1021,69 @@ export default {
});
}
},
// Swiper
onSwiperChange(e) {
this.currentIndex = e.detail.current;
},
//
async getCouponData() {
console.log('_this.orderInfo_this.orderInfo', this.orderInfo);
let list = this.orderInfo.CouponList
console.log('listlistlistlistlist', list);
if (list && list.length > 0) {
// for (let i = 0; i < list.length; i++) {
// let item = list[i]
// const res = await this.$api.$get("/WeChat/GetMemberECode", {
// membershipId: this.user.MEMBERSHIP_ID || "",
// couponCode: item.CouponSendId || "",
// })
// // .then((res) => {
// // console.log("resdsadasd", res);
// // if (res.Result_Code === 100) {
// // _this.allCode = res.Result_Data.Membership_ECode;
// // _this.paintCode(res.Result_Data.Membership_ECode);
// // }
// // _this.isLoading = false;
// // });
// }
list.forEach((item) => {
this.$utils.qrc(
`qrCode${item.COUPON_ID}`,
item.COUPON_CODE,
140,
140,
null,
""
);
})
}
//
//
// const res = await this.$api.getCoop({
// action_type: "GetCoupons",
// orderId: this.orderInfo.SALEBILL_ID
// });
// this.couponList = res.Data || [];
//
// this.couponList = [
// {
// name: '1',
// qrData: '1'
// },
// {
// name: '2',
// qrData: '2'
// }
// ];
},
//
async handleChangeOrderStatus() {
let _this = this;
@ -1122,13 +1242,209 @@ page {
.qrCodeBox {
width: calc(100vw - 48rpx);
height: 500rpx;
background-color: #fff;
height: 400rpx;
background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
box-sizing: border-box;
padding: 0 24rpx;
padding: 0;
margin-left: 24rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
position: relative;
overflow: hidden;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
border: 1rpx solid #f0f0f0;
}
/* 箭头按钮 */
.arrow-btn {
width: 60rpx;
height: 60rpx;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
z-index: 10;
transition: all 0.3s ease;
}
.arrow-btn:active {
transform: scale(0.95);
background-color: rgba(255, 255, 255, 0.7);
}
.arrow-text {
font-size: 40rpx;
font-weight: bold;
color: #666;
line-height: 1;
display: block;
margin-top: -2rpx;
/* 微调位置 */
}
.left-arrow {
margin-right: 20rpx;
}
.right-arrow {
margin-left: 20rpx;
}
/* Swiper轮播区域 */
.coupon-swiper {
flex: 1;
height: 100%;
width: 100%;
}
.coupon-item {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 24rpx;
box-sizing: border-box;
background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
border-radius: 12rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
border: 1rpx solid rgba(0, 0, 0, 0.05);
}
.itemTop {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
.itemTopLeft {
font-size: 28rpx;
font-weight: 600;
color: #333;
display: inline-block;
}
.itemTopRight {
font-size: 26rpx;
font-weight: 500;
color: #fff;
background: linear-gradient(135deg, #4BCB7E 0%, #45b675 100%);
padding: 8rpx 20rpx;
border-radius: 24rpx;
display: inline-block;
box-shadow: 0 2rpx 8rpx rgba(75, 203, 126, 0.3);
transition: all 0.3s ease;
}
.itemTopRight:active {
transform: scale(0.95);
box-shadow: 0 1rpx 4rpx rgba(75, 203, 126, 0.3);
}
}
/* 券详细信息 */
.itemBottom {
width: 100%;
flex: 1;
display: flex;
flex-direction: column;
gap: 12rpx;
}
.itemBottomItem {
display: flex;
align-items: flex-start;
justify-content: space-between;
width: 100%;
min-height: 36rpx;
}
.itemBottomItemLabel {
font-size: 24rpx;
font-weight: 500;
color: #666;
min-width: 120rpx;
flex-shrink: 0;
line-height: 1.5;
}
.itemBottomItemValue {
font-size: 24rpx;
font-weight: 400;
color: #333;
flex: 1;
text-align: left;
line-height: 1.5;
word-break: break-all;
min-width: 0;
padding-left: 16rpx;
box-sizing: border-box;
}
/* 卡券名称 - 支持两行省略 */
.itemBottomItem:nth-child(1) .itemBottomItemValue {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.4;
max-height: 2.8em;
/* 2行的高度 */
text-align: left;
}
/* 卡券要求 - 支持两行省略 */
.itemBottomItem:nth-child(3) .itemBottomItemValue {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.4;
max-height: 2.8em;
/* 2行的高度 */
text-align: left;
}
/* 页码显示 */
.coupon-page {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 16rpx 0 8rpx 0;
margin-top: 8rpx;
border-top: 1rpx solid rgba(240, 240, 240, 0.6);
}
.page-current {
font-size: 26rpx;
font-weight: 600;
color: #4BCB7E;
background: linear-gradient(135deg, #4BCB7E 0%, #45b675 100%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bold;
}
.page-separator {
font-size: 22rpx;
color: #999;
margin: 0 8rpx;
font-weight: normal;
}
.page-total {
font-size: 24rpx;
color: #666;
font-weight: normal;
}
.pageDesc {

View File

@ -150,7 +150,7 @@
'/static/images/home/defultImg.png'
" />
</view>
<view class="simPriceBox">
<view :class="item.showDiscount ? 'simPriceBox haveDiscount' : 'simPriceBox'">
<text class="sumPriceUnit"></text>{{
$utils.handleFormatNumber(
item.COMMODITY_MEMBERPRICE * item.count
@ -158,13 +158,13 @@
}}
</view>
<!-- <view class="discountedPrice" v-if="item.showDiscount">
<view class="discountedPrice" v-if="item.showDiscount">
<text class="sumPriceUnit"></text>{{
preciseRound(
item.discountedPrice * item.count
)
}}
</view> -->
</view>
</div>
<div class="detailRight">
@ -230,15 +230,15 @@
@click="handleAllDelete" />全选
</div>
<div class="bottomRight" v-if="pageType === 'normal'">
<!-- <view style="display: flex;flex-direction: column;align-items: flex-end;"> -->
<view class="submitTextBox">
<text class="sum">合计</text>
<text class="sumPrice"></text>
<!-- <text class="sunNumber">{{ totalDiscount || totalPay }}</text> -->
<text class="sunNumber">{{ totalPay }}</text>
<view style="display: flex;flex-direction: column;align-items: flex-end;">
<view class="submitTextBox">
<text class="sum">合计</text>
<text class="sumPrice"></text>
<text class="sunNumber">{{ totalDiscount || totalPay }}</text>
<!-- <text class="sunNumber">{{ totalPay }}</text> -->
</view>
<view class="discountText" v-if="totalDiscount">已减{{ discountAmount }}</view>
</view>
<!-- <view class="discountText" v-if="totalDiscount">已减{{ discountAmount }}</view> -->
<!-- </view> -->
<div class="submitBtn" @click="goPayFn"
:style="{ background: bigPageType === 'UnionMall' ? '#4BCB7E' : '#4BCB7E' }">立即下单</div>
@ -536,7 +536,7 @@ export default {
if (shopCarList && shopCarList.length > 0) {
//
// let haveSum = 0
let haveSum = 0
shopCarList.forEach((item) => {
let goodNum = Number(item.count);
@ -544,20 +544,20 @@ export default {
item.COMMODITY_NAME && item.COMMODITY_NAME.length / 14 > 1
? Math.ceil(item.COMMODITY_NAME.length / 14)
: 1;
// if (item.select === true && item.COMMODITY_NATURE === 7000) {
// haveSum += 1 * goodNum
// }
if (item.select === true && item.COMMODITY_NATURE === 7000) {
haveSum += 1 * goodNum
}
});
// if (haveSum >= 2) {
// // 2 95
// shopCarList.forEach((item) => {
// if (item.COMMODITY_NATURE === 7000) {
// item.showDiscount = true
// item.discountedPrice = this.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE)
// }
// })
// }
if (haveSum >= 2) {
// 2 95
shopCarList.forEach((item) => {
if (item.select === true && item.COMMODITY_NATURE === 7000) {
item.showDiscount = true
item.discountedPrice = this.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE)
}
})
}
}
this.shopList = shopCarList;
@ -618,7 +618,7 @@ export default {
handleSum() {
this.totalPay = 0;
//
// let haveSum = 0
let haveSum = 0
//
let allSelect = true
this.shopList.forEach((u) => {
@ -629,9 +629,9 @@ export default {
this.totalPay = Number(this.totalPay.toFixed(2));
// //
// if (u.COMMODITY_NATURE === 7000) {
// haveSum += 1 * goodNum
// }
if (u.COMMODITY_NATURE === 7000) {
haveSum += 1 * goodNum
}
} else {
allSelect = false
}
@ -641,37 +641,37 @@ export default {
this.isAllSelect = true
}
// if (haveSum >= 2) {
// // 2 95
// //
// // 95
// let discountedProducts = 0
// let noDiscountedProducts = 0
if (haveSum >= 2) {
// 2 95
//
// 95
let discountedProducts = 0
let noDiscountedProducts = 0
// this.shopList.forEach((item) => {
// let goodNum = Number(item.count);
// if (item.COMMODITY_NATURE === 7000 && item.select) {
// item.showDiscount = true
// item.discountedPrice = this.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE)
// discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// } else if (item.select) {
// noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// }
// })
this.shopList.forEach((item) => {
let goodNum = Number(item.count);
if (item.COMMODITY_NATURE === 7000 && item.select) {
item.showDiscount = true
item.discountedPrice = this.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE)
discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
} else if (item.select) {
noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
}
})
// this.totalDiscount = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2)
// this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2)
this.totalDiscount = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2)
this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2)
// } else {
// this.shopList.forEach((item) => {
// if (item.COMMODITY_NATURE === 7000) {
// item.showDiscount = false
// item.discountedPrice = 0
// }
// })
// this.totalDiscount = 0
// this.discountAmount = 0
// }
} else {
this.shopList.forEach((item) => {
if (item.COMMODITY_NATURE === 7000) {
item.showDiscount = false
item.discountedPrice = 0
}
})
this.totalDiscount = 0
this.discountAmount = 0
}
},
//
handleChangeSelect(item) {
@ -1244,7 +1244,7 @@ export default {
color: #ff6219;
line-height: 18px;
width: 100%;
margin-top: 24rpx;
margin-top: 8rpx;
text-align: left;
box-sizing: border-box;
padding-left: 56rpx;
@ -1253,8 +1253,8 @@ export default {
font-size: 12px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
// color: #ff6219;
color: #ff6219;
// color: #9fa3a8;
line-height: 12px;
}
}

View File

@ -306,7 +306,7 @@
<view class="funItemText">我的爱车</view>
</view>
<!-- @click="handleGoNormal({ value: 3 })" -->
<view class="funItemBox" >
<view class="funItemBox">
<image class="funItemImg" src="/static/images/home/suggestion.svg" />
<view class="funItemText">建议反馈</view>
</view>
@ -458,12 +458,12 @@ export default {
let height = uni.getStorageSync("safeHeight");
this.safeHeight = Number(height);
//
let userData = uni.getStorageSync('userData')
if (userData) {
this.userInfo = userData
this.cards = userData.LicencePlate.List && userData.LicencePlate.List.length > 0 ? userData.LicencePlate.List[0].License_Plate : ""
}
// //
// let userData = uni.getStorageSync('userData')
// if (userData) {
// this.userInfo = userData
// this.cards = userData.LicencePlate.List && userData.LicencePlate.List.length > 0 ? userData.LicencePlate.List[0].License_Plate : ""
// }
//
await this.handleGetUserDetail();
let shopOrderStatus = uni.getStorageSync('shopOrderStatus')
@ -992,11 +992,12 @@ export default {
_this.user.MEMBERSHIP_MOBILEPHONE =
_data.Data.MEMBERSHIP_MOBILEPHONE || "";
_this.WXProfile = _data.Data.MEMBERSHIP_HEADIMAGEURL;
uni.setStorageSync('userData', _this.user)
_this.$store.commit("setUser", _this.user);
_this.$forceUpdate()
} else {
// _this.setUser({});
uni.setStorageSync('userData', user)
_this.$store.commit("setUser", user);
}
});

View File

@ -27,13 +27,13 @@
<div class="flex-row justify-between">
<span class="font_2">单价: {{ obj.COMMODITY_MEMBERPRICE }}/{{
obj.COMMODITY_UNIT
}}</span>
}}</span>
<view style="display: flex;flex-direction: column;align-items: flex-end;">
<span class="font_2">¥{{ obj.cartItemAoumt
}}</span>
<!-- <span class="font_2" v-if="obj.showDiscount">¥{{ preciseRound(
<span class="font_2" :style="{ textDecoration: obj.showDiscount ? 'line-through' : '' }">¥{{ obj.cartItemAoumt
}}</span>
<span class="font_2" v-if="obj.showDiscount">¥{{ preciseRound(
obj.discountedPrice * obj.count
) }}</span> -->
) }}</span>
</view>
</div>
<div class="remark" v-if="isSubmit && obj.SALEDETAIL_DESC">

View File

@ -106,9 +106,9 @@
<div class="sum_count">
合计<span class="unit"></span><span class="price">{{ couponOrder }}</span>
</div>
<!-- <div class="discountAmount" v-if="discountAmount">
<div class="discountAmount" v-if="discountAmount">
已减{{ discountAmount }}
</div> -->
</div>
</div>
@ -119,7 +119,8 @@
<div v-if="
(pageType === 'UnionMall' && payType === 0) ||
pageType !== 'UnionMall'
" class="place_order_btn" @click="createOrder">
" class="place_order_btn" @click="handleBeforeCreateOrder">
<!-- @click="createOrder" -->
立即下单
</div>
</div>
@ -237,40 +238,40 @@ export default {
// console.log('computedcomputed', this.shopOrder);
// 2 95
// let haveSum = 0
// this.shopOrder.forEach((item) => {
// let goodNum = Number(item.count);
// // if (item.showDiscount) {
// // haveSum += 1 * goodNum
// // }
// })
let haveSum = 0
this.shopOrder.forEach((item) => {
let goodNum = Number(item.count);
if (item.showDiscount) {
haveSum += 1 * goodNum
}
})
// if (haveSum >= 2) {
// let discountedProducts = 0 // (0.95)
// let noDiscountedProducts = 0
if (haveSum >= 2) {
let discountedProducts = 0 // (0.95)
let noDiscountedProducts = 0
// this.shopOrder.forEach((item) => {
// let goodNum = Number(item.count);
// if (item.showDiscount) {
// discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// } else {
// noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// }
// })
this.shopOrder.forEach((item) => {
let goodNum = Number(item.count);
if (item.showDiscount) {
discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
} else {
noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
}
})
// this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2)
// let res = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2)
// console.log('this.discountAmount this.discountAmount', this.discountAmount);
this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2)
let res = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2)
console.log('this.discountAmount this.discountAmount', this.discountAmount);
// return res
// } else {
//
this.shopOrder.map((v) => {
amount += v.ORDER_AMOUNT;
});
this.discountAmount = 0
return amount.toFixed(2);
// }
return res
} else {
//
this.shopOrder.map((v) => {
amount += v.ORDER_AMOUNT;
});
this.discountAmount = 0
return amount.toFixed(2);
}
},
},
onShow() {
@ -451,8 +452,26 @@ export default {
const phoneRegex = /^1[3-9]\d{9}$/; //
return phoneRegex.test(phoneNumber);
},
//
handleBeforeCreateOrder() {
if (this.user.TEST_MEMBER) {
let _this = this
uni.showModal({
content: "此单是否为测试订单?",
success: function (res) {
if (res.confirm) {
_this.createOrder(true)
} else if (res.cancel) {
_this.createOrder()
}
}
})
} else {
this.createOrder()
}
},
//
async createOrder() {
async createOrder(testPay) {
if (this.selectTab === 1) {
if (!this.addressInfo.MEMBERADDRESS_ID) {
uni.showToast({
@ -579,6 +598,7 @@ export default {
recommendCode: app.globalData.recommendCode || "",
recommendId: app.globalData.recommendId || "",
requestType: "application/x-www-form-urlencoded",
testPay: testPay
// const scanParams = app.globalData.recommendCode;
// const scanParams2 = app.globalData.recommendId;
@ -608,28 +628,36 @@ export default {
});
if (this.pageType === "UnionMall") {
this.handleBalancePayment(data.Data);
this.handleBalancePayment(data.Data, testPay);
} else {
if (this.user.TEST_MEMBER) {
let _this = this
uni.showModal({
content: "此单是否为测试订单?",
success: function (res) {
if (res.confirm) {
//
_this.handleUpdateOrderGrowth(data.Data.SALEBILL_ID, data.Data.PAY_AMOUNT)
uni.redirectTo({
url: `/pages/order/orderdetail/index?orderInternal=${data.Data.SALEBILL_ID}`,
});
} else if (res.cancel) {
_this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
}
}
})
if (testPay) {
this.handleUpdateOrderGrowth(data.Data.SALEBILL_ID, data.Data.PAY_AMOUNT)
uni.redirectTo({
url: `/pages/order/orderdetail/index?orderInternal=${data.Data.SALEBILL_ID}`,
});
} else {
this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
}
// if (this.user.TEST_MEMBER) {
// let _this = this
// uni.showModal({
// content: "",
// success: function (res) {
// if (res.confirm) {
// //
// _this.handleUpdateOrderGrowth(data.Data.SALEBILL_ID, data.Data.PAY_AMOUNT)
// uni.redirectTo({
// url: `/pages/order/orderdetail/index?orderInternal=${data.Data.SALEBILL_ID}`,
// });
// } else if (res.cancel) {
// _this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
// }
// }
// })
// } else {
// this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
// }
}
// let [provinceId, cityId, districtId, streetId] =
@ -757,9 +785,47 @@ export default {
"/Member/RecordMemberScoreInfo",
req
);
//
//
let nowShopCarList = []
let idList = []
if (this.shopOrder && this.shopOrder.length > 0) {
this.shopOrder.forEach((item) => {
idList.push(item.COMMODITY_ID)
})
}
if (this.pageType === "UnionMall") {
nowShopCarList = this.$store.state.unionMyShopCar;
} else {
nowShopCarList = this.$store.state.myShopCar;
}
let newShopList = []
console.log('nowShopCarListnowShopCarList', nowShopCarList);
if (nowShopCarList && nowShopCarList.length > 0) {
nowShopCarList.forEach((item) => {
if (idList.indexOf(item.COMMODITY_ID) === -1) {
newShopList.push(item)
}
})
}
console.log('newShopListnewShopList', newShopList);
// 3000 30001
if (this.pageType === "UnionMall") {
this.$store.commit("unionMyShopCar", newShopList);
} else {
this.$store.commit("myShopCar", newShopList);
}
},
//
async handleBalancePayment(obj) {
async handleBalancePayment(obj, testPay) {
let _this = this;
//
@ -804,27 +870,36 @@ export default {
uni.showLoading({
title: "进行组合支付...",
});
if (testPay) {
//
_this.handleUpdateOrderGrowth(data.ResultData.SALEBILL_ID, data.ResultData.PAY_AMOUNT)
if (_this.user.TEST_MEMBER) {
let _this = this
uni.showModal({
content: "此单是否为测试订单?",
success: function (res) {
if (res.confirm) {
//
_this.handleUpdateOrderGrowth(data.ResultData.SALEBILL_ID, data.ResultData.PAY_AMOUNT)
uni.redirectTo({
url: `/pages/order/orderdetail/index?orderInternal=${obj.SALEBILL_ID}`,
});
} else if (res.cancel) {
_this.getOrderInfo(obj, data.ResultData);
}
}
})
uni.redirectTo({
url: `/pages/order/orderdetail/index?orderInternal=${obj.SALEBILL_ID}`,
});
} else {
this.getOrderInfo(obj, data.ResultData);
_this.getOrderInfo(obj, data.ResultData);
}
// if (_this.user.TEST_MEMBER) {
// let _this = this
// uni.showModal({
// content: "",
// success: function (res) {
// if (res.confirm) {
// //
// _this.handleUpdateOrderGrowth(data.ResultData.SALEBILL_ID, data.ResultData.PAY_AMOUNT)
// uni.redirectTo({
// url: `/pages/order/orderdetail/index?orderInternal=${obj.SALEBILL_ID}`,
// });
// } else if (res.cancel) {
// _this.getOrderInfo(obj, data.ResultData);
// }
// }
// })
// } else {
// this.getOrderInfo(obj, data.ResultData);
// }
uni.hideLoading();
} else if (res.cancel) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -125,14 +125,30 @@ var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
var g0 =
var g0 = _vm.isorder
? _vm.orderInfo.CouponList && _vm.orderInfo.CouponList.length > 0
: null
var l0 =
_vm.isorder && g0
? _vm.__map(_vm.orderInfo.CouponList, function (item, index) {
var $orig = _vm.__get_orig(item)
var g1 = _vm.orderInfo.CouponList.length
var g2 = g1 > 1 ? _vm.orderInfo.CouponList.length : null
return {
$orig: $orig,
g1: g1,
g2: g2,
}
})
: null
var g3 =
_vm.isorder &&
_vm.orderInfo.TAKE_TYPE === 2000 &&
_vm.orderInfo.SALEBILL_STATE >= 2010 &&
_vm.orderInfo.TABLE_NUMBER
? _vm.orderInfo.TABLE_NUMBER.split("|")
: null
var g1 =
var g4 =
_vm.isorder &&
_vm.orderInfo.TAKE_TYPE === 2000 &&
_vm.orderInfo.SALEBILL_STATE >= 2010 &&
@ -144,7 +160,9 @@ var render = function () {
{
$root: {
g0: g0,
g1: g1,
l0: l0,
g3: g3,
g4: g4,
},
}
)
@ -232,17 +250,27 @@ var _default = {
},
sellchildid: "",
// 子ID
showNotice: false
showNotice: false,
// 券轮播图相关数据
couponList: [],
// 券数据列表,预留数据接口
currentIndex: 0 // 当前显示的券索引
};
},
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapGetters)(["user"])), {}, {
tatalMoney: function tatalMoney() {
var total = this.orderAmount;
total = this.orderInfo.COUPON_ID ? Math.round((total - this.orderInfo.COUPON_AMOUNT || 0) * 100) / 100 : total;
return total;
return total.toFixed(2);
}
}),
methods: {
handleGoWriteOff: function handleGoWriteOff(obj) {
uni.navigateTo({
url: "/pages/payfor/index?cid=".concat(obj.COUPON_SEND_ID)
});
},
// 复制内容
handleClipboard: function handleClipboard(text) {
if (!text) {
@ -637,6 +665,9 @@ var _default = {
// 待付款时添加倒计时
_this.showTime();
}
// 获取券数据
// _this.getCouponData();
}
});
},
@ -952,16 +983,84 @@ var _default = {
});
}
},
// 修改订单状态
handleChangeOrderStatus: function handleChangeOrderStatus() {
// Swiper切换事件
onSwiperChange: function onSwiperChange(e) {
this.currentIndex = e.detail.current;
},
// 获取券数据的方法(预留接口)
getCouponData: function getCouponData() {
var _this4 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
var _this, req, data;
var list;
return _regenerator.default.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
_this = _this4;
console.log('_this.orderInfo_this.orderInfo', _this4.orderInfo);
list = _this4.orderInfo.CouponList;
console.log('listlistlistlistlist', list);
if (list && list.length > 0) {
// for (let i = 0; i < list.length; i++) {
// let item = list[i]
// const res = await this.$api.$get("/WeChat/GetMemberECode", {
// membershipId: this.user.MEMBERSHIP_ID || "",
// couponCode: item.CouponSendId || "",
// })
// // .then((res) => {
// // console.log("resdsadasd", res);
// // if (res.Result_Code === 100) {
// // _this.allCode = res.Result_Data.Membership_ECode;
// // _this.paintCode(res.Result_Data.Membership_ECode);
// // }
// // _this.isLoading = false;
// // });
// }
list.forEach(function (item) {
_this4.$utils.qrc("qrCode".concat(item.COUPON_ID), item.COUPON_CODE, 140, 140, null, "");
});
}
// 这里您可以根据实际需求获取券数据
// 例如:
// const res = await this.$api.getCoop({
// action_type: "GetCoupons",
// orderId: this.orderInfo.SALEBILL_ID
// });
// this.couponList = res.Data || [];
// 临时注释,等待您接入真实数据
// this.couponList = [
// {
// name: '优惠券名称1',
// qrData: '二维码数据1'
// },
// {
// name: '优惠券名称2',
// qrData: '二维码数据2'
// }
// ];
case 4:
case "end":
return _context7.stop();
}
}
}, _callee7);
}))();
},
// 修改订单状态
handleChangeOrderStatus: function handleChangeOrderStatus() {
var _this5 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
var _this, req, data;
return _regenerator.default.wrap(function _callee8$(_context8) {
while (1) {
switch (_context8.prev = _context8.next) {
case 0:
_this = _this5;
req = {
action_type: "UpdateOrderState",
action_data: _this.orderInfo.SALEBILL_ID,
@ -971,16 +1070,16 @@ var _default = {
};
console.log("req", req);
_context7.next = 5;
_context8.next = 5;
return _this.$api.getCoop(req);
case 5:
data = _context7.sent;
data = _context8.sent;
case 6:
case "end":
return _context7.stop();
return _context8.stop();
}
}
}, _callee7);
}, _callee8);
}))();
}
},

File diff suppressed because one or more lines are too long

View File

@ -80,13 +80,190 @@ page.data-v-8f520710 {
}
.qrCodeBox.data-v-8f520710 {
width: calc(100vw - 48rpx);
height: 500rpx;
background-color: #fff;
height: 400rpx;
background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
box-sizing: border-box;
padding: 0 24rpx;
padding: 0;
margin-left: 24rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
position: relative;
overflow: hidden;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
border: 1rpx solid #f0f0f0;
}
/* 箭头按钮 */
.arrow-btn.data-v-8f520710 {
width: 60rpx;
height: 60rpx;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
z-index: 10;
transition: all 0.3s ease;
}
.arrow-btn.data-v-8f520710:active {
-webkit-transform: scale(0.95);
transform: scale(0.95);
background-color: rgba(255, 255, 255, 0.7);
}
.arrow-text.data-v-8f520710 {
font-size: 40rpx;
font-weight: bold;
color: #666;
line-height: 1;
display: block;
margin-top: -2rpx;
/* 微调位置 */
}
.left-arrow.data-v-8f520710 {
margin-right: 20rpx;
}
.right-arrow.data-v-8f520710 {
margin-left: 20rpx;
}
/* Swiper轮播区域 */
.coupon-swiper.data-v-8f520710 {
flex: 1;
height: 100%;
width: 100%;
}
.coupon-item.data-v-8f520710 {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 24rpx;
box-sizing: border-box;
background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
border-radius: 12rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
border: 1rpx solid rgba(0, 0, 0, 0.05);
}
.itemTop.data-v-8f520710 {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.itemTop .itemTopLeft.data-v-8f520710 {
font-size: 28rpx;
font-weight: 600;
color: #333;
display: inline-block;
}
.itemTop .itemTopRight.data-v-8f520710 {
font-size: 26rpx;
font-weight: 500;
color: #fff;
background: linear-gradient(135deg, #4BCB7E 0%, #45b675 100%);
padding: 8rpx 20rpx;
border-radius: 24rpx;
display: inline-block;
box-shadow: 0 2rpx 8rpx rgba(75, 203, 126, 0.3);
transition: all 0.3s ease;
}
.itemTop .itemTopRight.data-v-8f520710:active {
-webkit-transform: scale(0.95);
transform: scale(0.95);
box-shadow: 0 1rpx 4rpx rgba(75, 203, 126, 0.3);
}
/* 券详细信息 */
.itemBottom.data-v-8f520710 {
width: 100%;
flex: 1;
display: flex;
flex-direction: column;
gap: 12rpx;
}
.itemBottomItem.data-v-8f520710 {
display: flex;
align-items: flex-start;
justify-content: space-between;
width: 100%;
min-height: 36rpx;
}
.itemBottomItemLabel.data-v-8f520710 {
font-size: 24rpx;
font-weight: 500;
color: #666;
min-width: 120rpx;
flex-shrink: 0;
line-height: 1.5;
}
.itemBottomItemValue.data-v-8f520710 {
font-size: 24rpx;
font-weight: 400;
color: #333;
flex: 1;
text-align: left;
line-height: 1.5;
word-break: break-all;
min-width: 0;
padding-left: 16rpx;
box-sizing: border-box;
}
/* 卡券名称 - 支持两行省略 */
.itemBottomItem:nth-child(1) .itemBottomItemValue.data-v-8f520710 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.4;
max-height: 2.8em;
/* 2行的高度 */
text-align: left;
}
/* 卡券要求 - 支持两行省略 */
.itemBottomItem:nth-child(3) .itemBottomItemValue.data-v-8f520710 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.4;
max-height: 2.8em;
/* 2行的高度 */
text-align: left;
}
/* 页码显示 */
.coupon-page.data-v-8f520710 {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 16rpx 0 8rpx 0;
margin-top: 8rpx;
border-top: 1rpx solid rgba(240, 240, 240, 0.6);
}
.page-current.data-v-8f520710 {
font-size: 26rpx;
font-weight: 600;
color: #4BCB7E;
background: linear-gradient(135deg, #4BCB7E 0%, #45b675 100%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bold;
}
.page-separator.data-v-8f520710 {
font-size: 22rpx;
color: #999;
margin: 0 8rpx;
font-weight: normal;
}
.page-total.data-v-8f520710 {
font-size: 24rpx;
color: #666;
font-weight: normal;
}
.pageDesc.data-v-8f520710 {
width: 100%;

View File

@ -136,12 +136,16 @@ var render = function () {
var g3 = _vm.$utils.handleFormatNumber(
item.COMMODITY_MEMBERPRICE * item.count
)
var m0 = item.showDiscount
? _vm.preciseRound(item.discountedPrice * item.count)
: null
return {
$orig: $orig,
g0: g0,
g1: g1,
g2: g2,
g3: g3,
m0: m0,
}
})
: null
@ -529,6 +533,7 @@ var _default = {
},
// 判断当前购物车是否有内容 有内容的话 处理
handleGetNowShopCarList: function handleGetNowShopCarList() {
var _this6 = this;
var shopCarList = [];
if (this.bigPageType === "UnionMall") {
shopCarList = this.$store.state.unionMyShopCar;
@ -538,27 +543,24 @@ var _default = {
console.log('shopCarListshopCarList', JSON.parse(JSON.stringify(shopCarList)));
if (shopCarList && shopCarList.length > 0) {
// 判断一下 当前购物车中 活动模块的商品有多少个被选中
// let haveSum = 0
var haveSum = 0;
shopCarList.forEach(function (item) {
var goodNum = Number(item.count);
item.rows = item.COMMODITY_NAME && item.COMMODITY_NAME.length / 14 > 1 ? Math.ceil(item.COMMODITY_NAME.length / 14) : 1;
// if (item.select === true && item.COMMODITY_NATURE === 7000) {
// haveSum += 1 * goodNum
// }
if (item.select === true && item.COMMODITY_NATURE === 7000) {
haveSum += 1 * goodNum;
}
});
// if (haveSum >= 2) {
// // 如果 活动模块 的商品大于等于2个 那么 就是打95折 做好打折标记 和 打折完的钱
// shopCarList.forEach((item) => {
// if (item.COMMODITY_NATURE === 7000) {
// item.showDiscount = true
// item.discountedPrice = this.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE)
// }
// })
// }
if (haveSum >= 2) {
// 如果 活动模块 的商品大于等于2个 那么 就是打95折 做好打折标记 和 打折完的钱
shopCarList.forEach(function (item) {
if (item.select === true && item.COMMODITY_NATURE === 7000) {
item.showDiscount = true;
item.discountedPrice = _this6.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE);
}
});
}
}
this.shopList = shopCarList;
// 商品处理了 之后 再算钱
@ -617,23 +619,23 @@ var _default = {
},
// 拿到合计金额
handleSum: function handleSum() {
var _this6 = this;
var _this7 = this;
this.totalPay = 0;
// 判断一下 当前购物车中 活动模块的商品有多少个被选中
// let haveSum = 0
var haveSum = 0;
// 判断一下是不是全部都已经被选择乐
var allSelect = true;
this.shopList.forEach(function (u) {
var goodNum = Number(u.count);
if (u.select === true) {
var _goodNum = Number(u.count);
_this6.totalPay += Number(u.COMMODITY_MEMBERPRICE) * _goodNum;
_this6.totalPay = Number(_this6.totalPay.toFixed(2));
_this7.totalPay += Number(u.COMMODITY_MEMBERPRICE) * _goodNum;
_this7.totalPay = Number(_this7.totalPay.toFixed(2));
// // 添加参数 判断一下
// if (u.COMMODITY_NATURE === 7000) {
// haveSum += 1 * goodNum
// }
if (u.COMMODITY_NATURE === 7000) {
haveSum += 1 * _goodNum;
}
} else {
allSelect = false;
}
@ -641,38 +643,34 @@ var _default = {
if (allSelect) {
this.isAllSelect = true;
}
// if (haveSum >= 2) {
// // 如果 活动模块 的商品大于等于2个 那么 就是打95折 做好打折标记 和 打折完的钱
// // 注意!!!!!!!!!!!!!!!!!!!
// // 只是 活动模块 的商品 打95折 其他商品不做处理的
// let discountedProducts = 0
// let noDiscountedProducts = 0
// this.shopList.forEach((item) => {
// let goodNum = Number(item.count);
// if (item.COMMODITY_NATURE === 7000 && item.select) {
// item.showDiscount = true
// item.discountedPrice = this.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE)
// discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// } else if (item.select) {
// noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// }
// })
// this.totalDiscount = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2)
// this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2)
// } else {
// this.shopList.forEach((item) => {
// if (item.COMMODITY_NATURE === 7000) {
// item.showDiscount = false
// item.discountedPrice = 0
// }
// })
// this.totalDiscount = 0
// this.discountAmount = 0
// }
if (haveSum >= 2) {
// 如果 活动模块 的商品大于等于2个 那么 就是打95折 做好打折标记 和 打折完的钱
// 注意!!!!!!!!!!!!!!!!!!!
// 只是 活动模块 的商品 打95折 其他商品不做处理的
var discountedProducts = 0;
var noDiscountedProducts = 0;
this.shopList.forEach(function (item) {
var goodNum = Number(item.count);
if (item.COMMODITY_NATURE === 7000 && item.select) {
item.showDiscount = true;
item.discountedPrice = _this7.preciseRound(0.95 * item.COMMODITY_MEMBERPRICE);
discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum;
} else if (item.select) {
noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum;
}
});
this.totalDiscount = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2);
this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2);
} else {
this.shopList.forEach(function (item) {
if (item.COMMODITY_NATURE === 7000) {
item.showDiscount = false;
item.discountedPrice = 0;
}
});
this.totalDiscount = 0;
this.discountAmount = 0;
}
},
// 修改商品前面的单选框选中效果
handleChangeSelect: function handleChangeSelect(item) {

File diff suppressed because one or more lines are too long

View File

@ -149,7 +149,7 @@
color: #ff6219;
line-height: 18px;
width: 100%;
margin-top: 24rpx;
margin-top: 8rpx;
text-align: left;
box-sizing: border-box;
padding-left: 56rpx;

View File

@ -86,6 +86,9 @@ var render = function () {
: null
var g1 = _vm.obj.IMAGE_PATH && g0 ? _vm.obj.IMAGE_PATH.split(",") : null
var g2 = !_vm.obj.IMAGE_PATH ? _vm.obj.List && _vm.obj.List.length > 0 : null
var m0 = _vm.obj.showDiscount
? _vm.preciseRound(_vm.obj.discountedPrice * _vm.obj.count)
: null
_vm.$mp.data = Object.assign(
{},
{
@ -93,6 +96,7 @@ var render = function () {
g0: g0,
g1: g1,
g2: g2,
m0: m0,
},
}
)

View File

@ -1 +1 @@
<view class="flex-row space-x-12 _div data-v-5a6f0e03"><image class="shrink-0 self-start image_9 _img data-v-5a6f0e03" src="{{obj.IMAGE_PATH?$root.g0?$root.g1[0]:obj.IMAGE_PATH:$root.g2?obj.List[0].IMAGE_URL:obj.DEFAULT_IMG?obj.DEFAULT_IMG:'/static/images/home/defultImg.png'}}"></image><view class="flex-col info _div data-v-5a6f0e03"><view class="flex-row justify-between _div data-v-5a6f0e03"><block wx:if="{{obj.bracketContent}}"><view class="font_3 titleName _div data-v-5a6f0e03"><label style="font-weight:600;color:red;" class="_span data-v-5a6f0e03">{{''+(obj.COMMODITY_RULE?''+obj.COMMODITY_RULE+'':"")+obj.bracketContent}}</label><label class="_span data-v-5a6f0e03">{{obj.restContent||""}}</label></view></block><block wx:else><view class="font_3 titleName _div data-v-5a6f0e03">{{(obj.COMMODITY_RULE?''+obj.COMMODITY_RULE+'':"")+(obj.COMMODITY_NAME||"")}}</view></block><view class="font_3 _div data-v-5a6f0e03" style="width:100px;text-align:right;">{{'x'+obj.count+obj.COMMODITY_UNIT+''}}</view></view><view class="flex-row justify-between _div data-v-5a6f0e03"><label class="font_2 _span data-v-5a6f0e03">{{"单价: "+obj.COMMODITY_MEMBERPRICE+"元/"+obj.COMMODITY_UNIT}}</label><view style="display:flex;flex-direction:column;align-items:flex-end;" class="data-v-5a6f0e03"><label class="font_2 _span data-v-5a6f0e03">{{"¥"+obj.cartItemAoumt}}</label></view></view><block wx:if="{{isSubmit&&obj.SALEDETAIL_DESC}}"><view class="remark _div data-v-5a6f0e03"><input class="input data-v-5a6f0e03" disabled="{{isSubmit}}" data-event-opts="{{[['input',[['__set_model',['$0','SALEDETAIL_DESC','$event',[]],['obj']]]]]}}" value="{{obj.SALEDETAIL_DESC}}" bindinput="__e"/></view></block><block wx:if="{{!isSubmit}}"><view class="remark _div data-v-5a6f0e03"><input class="input data-v-5a6f0e03" placeholder="这里是备注的内容" data-event-opts="{{[['blur',[['handleChangeValue',['$event','$0'],['obj']]]]]}}" value="{{obj.SALEDETAIL_DESC}}" bindblur="__e"/></view></block></view></view>
<view class="flex-row space-x-12 _div data-v-5a6f0e03"><image class="shrink-0 self-start image_9 _img data-v-5a6f0e03" src="{{obj.IMAGE_PATH?$root.g0?$root.g1[0]:obj.IMAGE_PATH:$root.g2?obj.List[0].IMAGE_URL:obj.DEFAULT_IMG?obj.DEFAULT_IMG:'/static/images/home/defultImg.png'}}"></image><view class="flex-col info _div data-v-5a6f0e03"><view class="flex-row justify-between _div data-v-5a6f0e03"><block wx:if="{{obj.bracketContent}}"><view class="font_3 titleName _div data-v-5a6f0e03"><label style="font-weight:600;color:red;" class="_span data-v-5a6f0e03">{{''+(obj.COMMODITY_RULE?''+obj.COMMODITY_RULE+'':"")+obj.bracketContent}}</label><label class="_span data-v-5a6f0e03">{{obj.restContent||""}}</label></view></block><block wx:else><view class="font_3 titleName _div data-v-5a6f0e03">{{(obj.COMMODITY_RULE?''+obj.COMMODITY_RULE+'':"")+(obj.COMMODITY_NAME||"")}}</view></block><view class="font_3 _div data-v-5a6f0e03" style="width:100px;text-align:right;">{{'x'+obj.count+obj.COMMODITY_UNIT+''}}</view></view><view class="flex-row justify-between _div data-v-5a6f0e03"><label class="font_2 _span data-v-5a6f0e03">{{"单价: "+obj.COMMODITY_MEMBERPRICE+"元/"+obj.COMMODITY_UNIT}}</label><view style="display:flex;flex-direction:column;align-items:flex-end;" class="data-v-5a6f0e03"><label class="font_2 _span data-v-5a6f0e03" style="{{'text-decoration:'+(obj.showDiscount?'line-through':'')+';'}}">{{"¥"+obj.cartItemAoumt}}</label><block wx:if="{{obj.showDiscount}}"><label class="font_2 _span data-v-5a6f0e03">{{"¥"+$root.m0}}</label></block></view></view><block wx:if="{{isSubmit&&obj.SALEDETAIL_DESC}}"><view class="remark _div data-v-5a6f0e03"><input class="input data-v-5a6f0e03" disabled="{{isSubmit}}" data-event-opts="{{[['input',[['__set_model',['$0','SALEDETAIL_DESC','$event',[]],['obj']]]]]}}" value="{{obj.SALEDETAIL_DESC}}" bindinput="__e"/></view></block><block wx:if="{{!isSubmit}}"><view class="remark _div data-v-5a6f0e03"><input class="input data-v-5a6f0e03" placeholder="这里是备注的内容" data-event-opts="{{[['blur',[['handleChangeValue',['$event','$0'],['obj']]]]]}}" value="{{obj.SALEDETAIL_DESC}}" bindblur="__e"/></view></block></view></view>

View File

@ -297,40 +297,36 @@ var _default = {
// console.log('computedcomputed', this.shopOrder);
// 判断 活动模块 的商品是不是大于等于2个 那么 就是打95折
// let haveSum = 0
// this.shopOrder.forEach((item) => {
// let goodNum = Number(item.count);
// // if (item.showDiscount) {
// // haveSum += 1 * goodNum
// // }
// })
// if (haveSum >= 2) {
// let discountedProducts = 0 // 打折商品的合计钱(还没乘0.95的)
// let noDiscountedProducts = 0
// this.shopOrder.forEach((item) => {
// let goodNum = Number(item.count);
// if (item.showDiscount) {
// discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// } else {
// noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum
// }
// })
// this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2)
// let res = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2)
// console.log('this.discountAmount this.discountAmount', this.discountAmount);
// return res
// } else {
// 正常算钱
this.shopOrder.map(function (v) {
amount += v.ORDER_AMOUNT;
var haveSum = 0;
this.shopOrder.forEach(function (item) {
var goodNum = Number(item.count);
if (item.showDiscount) {
haveSum += 1 * goodNum;
}
});
this.discountAmount = 0;
return amount.toFixed(2);
// }
if (haveSum >= 2) {
var discountedProducts = 0; // 打折商品的合计钱(还没乘0.95的)
var noDiscountedProducts = 0;
this.shopOrder.forEach(function (item) {
var goodNum = Number(item.count);
if (item.showDiscount) {
discountedProducts += item.COMMODITY_MEMBERPRICE * goodNum;
} else {
noDiscountedProducts += item.COMMODITY_MEMBERPRICE * goodNum;
}
});
this.discountAmount = (discountedProducts - this.preciseRound(0.95 * discountedProducts)).toFixed(2);
var res = (this.preciseRound(0.95 * discountedProducts) + noDiscountedProducts).toFixed(2);
console.log('this.discountAmount this.discountAmount', this.discountAmount);
return res;
} else {
// 正常算钱
this.shopOrder.map(function (v) {
amount += v.ORDER_AMOUNT;
});
this.discountAmount = 0;
return amount.toFixed(2);
}
}
}),
onShow: function onShow() {
@ -547,11 +543,29 @@ var _default = {
var phoneRegex = /^1[3-9]\d{9}$/; // 中国手机号码常见正则
return phoneRegex.test(phoneNumber);
},
// 预处理一下立即下单 判断是否为测试订单 是否需要付钱
handleBeforeCreateOrder: function handleBeforeCreateOrder() {
if (this.user.TEST_MEMBER) {
var _this = this;
uni.showModal({
content: "此单是否为测试订单?",
success: function success(res) {
if (res.confirm) {
_this.createOrder(true);
} else if (res.cancel) {
_this.createOrder();
}
}
});
} else {
this.createOrder();
}
},
// 立即下单
createOrder: function createOrder() {
createOrder: function createOrder(testPay) {
var _this5 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
var DATAFORMATType, openId, app, newShopList, t_saleorderdetail, req, data, shopOrderNameList, _this;
var DATAFORMATType, openId, app, newShopList, t_saleorderdetail, req, data, shopOrderNameList;
return _regenerator.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
@ -683,7 +697,8 @@ var _default = {
t_saleorderdetail: JSON.stringify(t_saleorderdetail),
recommendCode: app.globalData.recommendCode || "",
recommendId: app.globalData.recommendId || "",
requestType: "application/x-www-form-urlencoded"
requestType: "application/x-www-form-urlencoded",
testPay: testPay
// const scanParams = app.globalData.recommendCode;
// const scanParams2 = app.globalData.recommendId;
@ -711,27 +726,36 @@ var _default = {
behaviorRecordDesc: "\u521B\u5EFA\u4E86\u5546\u57CE\u8BA2\u5355\u3010".concat(shopOrderNameList, "\u3011")
});
if (_this5.pageType === "UnionMall") {
_this5.handleBalancePayment(data.Data);
_this5.handleBalancePayment(data.Data, testPay);
} else {
if (_this5.user.TEST_MEMBER) {
_this = _this5;
uni.showModal({
content: "此单是否为测试订单?",
success: function success(res) {
if (res.confirm) {
// 因为是内部会员 跳过支付 所以 直接跳转 且给成长值
_this.handleUpdateOrderGrowth(data.Data.SALEBILL_ID, data.Data.PAY_AMOUNT);
uni.redirectTo({
url: "/pages/order/orderdetail/index?orderInternal=".concat(data.Data.SALEBILL_ID)
});
} else if (res.cancel) {
_this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
}
}
if (testPay) {
_this5.handleUpdateOrderGrowth(data.Data.SALEBILL_ID, data.Data.PAY_AMOUNT);
uni.redirectTo({
url: "/pages/order/orderdetail/index?orderInternal=".concat(data.Data.SALEBILL_ID)
});
} else {
_this5.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
}
// if (this.user.TEST_MEMBER) {
// let _this = this
// uni.showModal({
// content: "此单是否为测试订单?",
// success: function (res) {
// if (res.confirm) {
// // 因为是内部会员 跳过支付 所以 直接跳转 且给成长值
// _this.handleUpdateOrderGrowth(data.Data.SALEBILL_ID, data.Data.PAY_AMOUNT)
// uni.redirectTo({
// url: `/pages/order/orderdetail/index?orderInternal=${data.Data.SALEBILL_ID}`,
// });
// } else if (res.cancel) {
// _this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
// }
// }
// })
// } else {
// this.getOrderInfo(data.Data, data.Data.PAY_AMOUNT);
// }
}
// let [provinceId, cityId, districtId, streetId] =
@ -853,7 +877,7 @@ var _default = {
handleUpdateOrderGrowth: function handleUpdateOrderGrowth(id, money) {
var _this6 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
var req, data;
var req, data, nowShopCarList, idList, newShopList;
return _regenerator.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
@ -872,7 +896,38 @@ var _default = {
return _this6.$api.$zzyLocalPost("/Member/RecordMemberScoreInfo", req);
case 3:
data = _context4.sent;
case 4:
// 假付钱 也删掉购物车的商品
// 删除购物车中的商品
nowShopCarList = [];
idList = [];
if (_this6.shopOrder && _this6.shopOrder.length > 0) {
_this6.shopOrder.forEach(function (item) {
idList.push(item.COMMODITY_ID);
});
}
if (_this6.pageType === "UnionMall") {
nowShopCarList = _this6.$store.state.unionMyShopCar;
} else {
nowShopCarList = _this6.$store.state.myShopCar;
}
newShopList = [];
console.log('nowShopCarListnowShopCarList', nowShopCarList);
if (nowShopCarList && nowShopCarList.length > 0) {
nowShopCarList.forEach(function (item) {
if (idList.indexOf(item.COMMODITY_ID) === -1) {
newShopList.push(item);
}
});
}
console.log('newShopListnewShopList', newShopList);
// 判断是工会商城 还是 精选商城 3000 精选 30001 工会
if (_this6.pageType === "UnionMall") {
_this6.$store.commit("unionMyShopCar", newShopList);
} else {
_this6.$store.commit("myShopCar", newShopList);
}
case 13:
case "end":
return _context4.stop();
}
@ -881,7 +936,7 @@ var _default = {
}))();
},
// 余额支付
handleBalancePayment: function handleBalancePayment(obj) {
handleBalancePayment: function handleBalancePayment(obj, testPay) {
var _this7 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
var _this, userData, insufficientBalance, req, data;
@ -935,25 +990,36 @@ var _default = {
uni.showLoading({
title: "进行组合支付..."
});
if (_this.user.TEST_MEMBER) {
var _this8 = this;
uni.showModal({
content: "此单是否为测试订单?",
success: function success(res) {
if (res.confirm) {
// 因为是内部会员 跳过支付 所以 直接跳转 且给成长值
_this8.handleUpdateOrderGrowth(data.ResultData.SALEBILL_ID, data.ResultData.PAY_AMOUNT);
uni.redirectTo({
url: "/pages/order/orderdetail/index?orderInternal=".concat(obj.SALEBILL_ID)
});
} else if (res.cancel) {
_this8.getOrderInfo(obj, data.ResultData);
}
}
if (testPay) {
// 因为是内部会员 跳过支付 所以 直接跳转 且给成长值
_this.handleUpdateOrderGrowth(data.ResultData.SALEBILL_ID, data.ResultData.PAY_AMOUNT);
uni.redirectTo({
url: "/pages/order/orderdetail/index?orderInternal=".concat(obj.SALEBILL_ID)
});
} else {
this.getOrderInfo(obj, data.ResultData);
_this.getOrderInfo(obj, data.ResultData);
}
// if (_this.user.TEST_MEMBER) {
// let _this = this
// uni.showModal({
// content: "此单是否为测试订单?",
// success: function (res) {
// if (res.confirm) {
// // 因为是内部会员 跳过支付 所以 直接跳转 且给成长值
// _this.handleUpdateOrderGrowth(data.ResultData.SALEBILL_ID, data.ResultData.PAY_AMOUNT)
// uni.redirectTo({
// url: `/pages/order/orderdetail/index?orderInternal=${obj.SALEBILL_ID}`,
// });
// } else if (res.cancel) {
// _this.getOrderInfo(obj, data.ResultData);
// }
// }
// })
// } else {
// this.getOrderInfo(obj, data.ResultData);
// }
uni.hideLoading();
} else if (res.cancel) {
// 删除购物车中的商品
@ -1075,7 +1141,7 @@ var _default = {
// 生成一个符合要求的商户订单号长度为16的示例
// 获取后台信息调取微信支付
getOrderInfo: function getOrderInfo(obj, payMoney) {
var _this9 = this;
var _this8 = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
var _this, mchid, timeStamp, nonceStr, serial_no, out_trade_no, req, reqSign, data, Authorization, AuthorizationStr;
return _regenerator.default.wrap(function _callee7$(_context7) {
@ -1083,7 +1149,7 @@ var _default = {
switch (_context7.prev = _context7.next) {
case 0:
// payMoney 工会之家订单 组合支付时可能会出现的值
_this = _this9; // 拿到签名
_this = _this8; // 拿到签名
mchid = "1672298991";
timeStamp = Math.ceil(new Date().getTime() / 1000);
nonceStr = Math.random().toString(36).substring(2, 8);
@ -1115,7 +1181,7 @@ var _default = {
provinceCode: _this.provinceCode || "530000"
};
_context7.next = 10;
return _this9.$api.$get("/WeChat/GenerateSign", reqSign);
return _this8.$api.$get("/WeChat/GenerateSign", reqSign);
case 10:
data = _context7.sent;
console.log("data3213123", data.Result_Data);

File diff suppressed because one or more lines are too long

View File

@ -9,23 +9,16 @@
"miniprogram": {
"list": [
{
"name": "pages/order/orderdetail/index",
"pathName": "pages/order/orderdetail/index",
"query": "orderInternal=131809",
"name": "pages/shopMallPage/shopCar/index",
"pathName": "pages/shopMallPage/shopCar/index",
"query": "pageType=",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/order/orderdetail/index",
"pathName": "pages/order/orderdetail/index",
"query": "sellchildid=131784&orderInternal=131782&orderStatus=1010&SUPPLIER_NAME=undefined",
"launchMode": "default",
"scene": null
},
{
"name": "pages/shopMallPage/shopCar/index",
"pathName": "pages/shopMallPage/shopCar/index",
"query": "pageType=",
"query": "sellchildid=131841&orderInternal=131839&orderStatus=1010&SUPPLIER_NAME=undefined",
"launchMode": "default",
"scene": null
}