From a1f904e97c7f5740ceb721ee2b34358382a666ac Mon Sep 17 00:00:00 2001
From: "DESKTOP-GMUNQ1B\\k" <1154079537@qq.com>
Date: Wed, 20 Mar 2024 11:55:11 +0800
Subject: [PATCH] 1
---
components/orderGoods/index.vue | 315 ++++++++++++++++++++-----------
components/popups/index.vue | 17 +-
pages/payment/get_payment.vue | 85 ++-------
pages/payment/settlement.vue | 2 +-
pages/users/order_list/index.vue | 49 ++---
5 files changed, 248 insertions(+), 220 deletions(-)
diff --git a/components/orderGoods/index.vue b/components/orderGoods/index.vue
index ad01883..7eb01a7 100644
--- a/components/orderGoods/index.vue
+++ b/components/orderGoods/index.vue
@@ -10,74 +10,115 @@
-
+
+
- 预售{{item.cart_info.product.store_name}}
- ¥{{item.cart_info.productPresellAttr.presell_price}}
x {{item.product_num}}
+ 预售{{item.cart_info.product.store_name}}
+
+ ¥{{item.cart_info.productPresellAttr.presell_price}}
x
+ {{item.product_num}}
+
- {{item.cart_info.productAttr.sku}}
- 发货时间:
+
+ {{item.cart_info.productAttr.sku}}
+
+ 发货时间:
- {{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内
+ {{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内
- {{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内
-
+ {{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内
+
- 申请退款
- 退款中 x {{item.product_num - item.refund_num}}
- 已退款 x {{item.product_num - item.refund_num}}
- 去评价
+ 申请退款
+ 退款中 x
+ {{item.product_num - item.refund_num}}
+
+ 已退款 x
+ {{item.product_num - item.refund_num}}
+
+ 去评价
已评价
-
+
阶段一: 买家已付款
- 商品定金 ¥{{ orderData.pay_price }}
- 定金实付款¥{{ orderData.pay_price }}
+ 商品定金 ¥{{ orderData.pay_price }}
+ 定金实付款¥{{ orderData.pay_price }}
- 阶段二:
- 未开始
- 等待买家付尾款
- 交易已关闭
+ 阶段二:
+ 未开始
+ 等待买家付尾款
+ 交易已关闭
- 商品尾款 ¥{{ orderData.presellOrder.pay_price }}
- 尾款需付款¥{{ orderData.presellOrder.pay_price }}
+ 商品尾款 ¥{{ orderData.presellOrder.pay_price }}
+ 尾款需付款¥{{ orderData.presellOrder.pay_price }}
-
+
+
-
- {{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}{{item.cart_info.product.store_name}}
- x {{item.product_num}}
-
- {{item.cart_info.productAttr.sku}}
- ¥{{item.cart_info.productAssistAttr.assist_price}}
- ¥{{item.cart_info.activeSku.active_price}}
-
- ¥{{item.cart_info.productAttr.price}}
-
+
+ {{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}{{item.cart_info.product.store_name}}
+ x {{item.product_num}}
+
+
+ {{item.cart_info.productAttr.sku}}
+
+
+ ¥{{item.cart_info.productAssistAttr.assist_price}}
+
+ ¥{{item.cart_info.activeSku.active_price}}
+
+ ¥{{item.cart_info.productAttr.price}}
+
+
- 退款中 x {{item.product_num - item.refund_num}}
- 已退款 x {{item.product_num - item.refund_num}}
- 申请退款
- 去评价
+ 退款中 x
+ {{item.product_num - item.refund_num}}
+
+ 已退款 x {{item.product_num - item.refund_num}}
+
+ 申请退款
+ 去评价
已评价
-
+
@@ -93,11 +134,21 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team
// +----------------------------------------------------------------------
- import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
- import { goShopDetail } from '@/libs/order.js'
- import { initiateAssistApi } from '@/api/activity.js';
- import { mapGetters } from "vuex";
- import { HTTP_REQUEST_URL } from '@/config/app';
+ import {
+ openOrderRefundSubscribe
+ } from '@/utils/SubscribeMessage.js';
+ import {
+ goShopDetail
+ } from '@/libs/order.js'
+ import {
+ initiateAssistApi
+ } from '@/api/activity.js';
+ import {
+ mapGetters
+ } from "vuex";
+ import {
+ HTTP_REQUEST_URL
+ } from '@/config/app';
export default {
props: {
evaluate: {
@@ -133,17 +184,21 @@
data() {
return {
domain: HTTP_REQUEST_URL,
- totalNmu:'',
+ totalNmu: '',
isTimePay: false, //是否到支付时间
};
},
- watch:{
- cartInfo:function(nVal,oVal){
+ watch: {
+ cartInfo: function(nVal, oVal) {
+ console.log(nVal);
+ console.log(oVal);
let num = 0
- nVal.forEach((item,index)=>{
+ nVal.forEach((item, index) => {
num += item.cart_num
})
this.totalNmu = num
+
+ console.log(nVal);
}
},
onShow() {
@@ -151,52 +206,59 @@
},
mounted() {},
methods: {
- evaluateTap:function(unique,orderId){
+ evaluateTap: function(unique, orderId) {
uni.navigateTo({
- url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
+ url: `/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
})
},
// 判断是否到支付尾款时间
- isPayBalance(){
+ isPayBalance() {
let that = this;
- if(that.orderData.status === 10){
- if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
+ if (that.orderData.status === 10) {
+ if (new Date() < new Date(that.orderData.presellOrder.final_start_time)) {
that.isTimePay = false; //未开始
- }else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
+ } else if ((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <=
+ new Date(that.orderData.presellOrder.final_start_time))) {
that.isTimePay = true; //立即支付
}
}
},
- jumpCon:function(item){
- if(item.product_type == 4)item.activity_id = item.cart_info && item.cart_info.activeSku.product_group_id
- if(item.product_type == 3)item.activity_id = item.cart_info && item.cart_info.productAssistAttr.product_assist_id
+ jumpCon: function(item) {
+ if (item.product_type == 4) item.activity_id = item.cart_info && item.cart_info.activeSku
+ .product_group_id
+ if (item.product_type == 3) item.activity_id = item.cart_info && item.cart_info.productAssistAttr
+ .product_assist_id
goShopDetail(item).then(res => {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
- uni.hideLoading();
- uni.navigateTo({
- url: '/pages/activity/assist_detail/index?id=' + id
- });
- }).catch((err) => {
- uni.showToast({
- title: err,
- icon: 'none'
- })
+ uni.hideLoading();
+ uni.navigateTo({
+ url: '/pages/activity/assist_detail/index?id=' + id
+ });
+ }).catch((err) => {
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
});
- })
+ })
},
// 退款
- refund(item){
+ refund(item) {
// #ifdef MP
openOrderRefundSubscribe().then(() => {
uni.hideLoading();
- if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0){
+ if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
uni.navigateTo({
- url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
+ url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' +
+ '&ids=' + item.order_product_id + '&refund_type=1&order_type=' + this
+ .orderData.order_type
})
- }else{
+ } else {
uni.navigateTo({
- url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
+ url: '/pages/users/refund/select?order_id=' + this.orderId +
+ '&type=1&order_type=' + this.orderData.order_type + '&ids=' + item
+ .order_product_id
})
}
}).catch(() => {
@@ -204,13 +266,15 @@
})
// #endif
// #ifdef H5 || APP-PLUS
- if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0){
+ if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
uni.navigateTo({
- url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
+ url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
+ .order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type
})
- }else{
+ } else {
uni.navigateTo({
- url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
+ url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
+ .orderData.order_type + '&ids=' + item.order_product_id
})
}
// #endif
@@ -223,83 +287,101 @@
.orderGoods {
background-color: #fff;
}
+
.p-color {
color: var(--view-priceColor);
}
- .t-color{
+
+ .t-color {
color: var(--view-theme);
}
- .svip-img{
+
+ .svip-img {
width: 65rpx;
height: 28rpx;
margin: 4rpx 0 0 4rpx;
}
- .title{
+
+ .title {
height: 86rpx;
position: relative;
padding: 0 30rpx;
- &::after{
+
+ &::after {
content: "";
width: 750rpx;
- border-bottom: 2rpx dotted #D8D8D8;
+ border-bottom: 2rpx dotted #D8D8D8;
position: absolute;
bottom: 0;
left: 0;
}
- .item-status{
+
+ .item-status {
color: #999999;
font-size: 30rpx;
- &.status0{
+
+ &.status0 {
color: #2291F8;
}
}
- .item-date{
+
+ .item-date {
color: #666666;
font-size: 28rpx;
}
- }
- .right-btn-box{
+ }
+
+ .right-btn-box {
display: flex;
align-items: center;
justify-content: flex-end;
- &.event_box{
+
+ &.event_box {
position: static;
}
- .btn-item{
+
+ .btn-item {
display: flex;
align-items: center;
justify-content: center;
- width:140rpx;
- height:46rpx;
+ width: 140rpx;
+ height: 46rpx;
margin-left: 10rpx;
- border:1px solid rgba(187,187,187,1);
- border-radius:23rpx;
+ border: 1px solid rgba(187, 187, 187, 1);
+ border-radius: 23rpx;
font-size: 24rpx;
color: #282828;
- &.on{
- background:rgba(220,220,220,1);
- border-color: rgba(220,220,220,1);
+
+ &.on {
+ background: rgba(220, 220, 220, 1);
+ border-color: rgba(220, 220, 220, 1);
}
- &.err{
- background:rgba(247,247,247,1);
- border-color: rgba(247,247,247,1);
+
+ &.err {
+ background: rgba(247, 247, 247, 1);
+ border-color: rgba(247, 247, 247, 1);
color: #AAAAAA;
}
}
}
- .event_bg{
+
+ .event_bg {
background: #FF7F00;
}
- .event_color{
+
+ .event_color {
color: #FF7F00;
}
- .presell_item{
+
+ .presell_item {
height: auto;
padding-bottom: 15rpx;
}
- .event_progress{
+
+ .event_progress {
margin-top: 20rpx;
background: #fff;
+
.progress_name {
padding-left: 30rpx;
height: 60rpx;
@@ -308,7 +390,8 @@
font-weight: bold;
position: relative;
color: var(--view-theme);
- &::before{
+
+ &::before {
content: "";
display: inline-block;
width: 5rpx;
@@ -319,43 +402,49 @@
left: 0;
}
}
- .align_right{
+
+ .align_right {
float: right;
font-weight: bold;
}
- .progress_price{
+
+ .progress_price {
padding: 20rpx 30rpx;
color: #999999;
font-size: 22rpx;
}
- .progress_pay{
+
+ .progress_pay {
padding: 25rpx 30rpx;
background: var(--view-minorColor);
font-size: 26rpx;
color: #282828;
}
}
- .event_name{
+
+ .event_name {
display: inline-block;
margin-right: 9rpx;
color: #fff;
font-size: 20rpx;
padding: 0 8rpx;
- line-height: 30rpx;
+ line-height: 30rpx;
text-align: center;
- border-radius: 6rpx;
+ border-radius: 6rpx;
}
- .event_ship{
+
+ .event_ship {
font-size: 20rpx;
- margin-top: 10rpx;
+ margin-top: 10rpx;
}
- .goodWrapper.item1{
- &::after{
+
+ .goodWrapper.item1 {
+ &::after {
content: "";
display: block;
width: 750rpx;
height: 14rpx;
background: #F0F0F0;
- }
+ }
}
-
+
\ No newline at end of file
diff --git a/components/popups/index.vue b/components/popups/index.vue
index 3a6713b..cd3a3aa 100644
--- a/components/popups/index.vue
+++ b/components/popups/index.vue
@@ -1,5 +1,6 @@
-
+
@@ -30,6 +31,7 @@
},
methods: {
+
// 键盘点击
handleClick(item) {
if (this.value.length >= 10) return;
@@ -68,9 +70,11 @@
// 付款
handlePay() {
- if (this.value && this.value.lastIndexOf('.') + 1 == this.value.length) {
- this.value = this.value.substring(0, this.value.length - 1);
+ // 如果最后一位是. 去除
+ if (this.value && this.value.endsWith('.')) {
+ this.value = this.value.replace('.', '');
}
+
this.$emit('confirm', this.value);
this.handleClose();
},
@@ -84,9 +88,12 @@
handleClose() {
this.$refs.popup.close();
},
+
+
maskClick() {
- if (this.value && this.value.lastIndexOf('.') + 1 == this.value.length) {
- this.value = this.value.substring(0, this.value.length - 1);
+ // 如果最后一位是. 去除
+ if (this.value && this.value.endsWith('.')) {
+ this.value = this.value.replace('.', '');
}
this.$emit('change', this.value);
}
diff --git a/pages/payment/get_payment.vue b/pages/payment/get_payment.vue
index 5af02bf..5f4fcab 100644
--- a/pages/payment/get_payment.vue
+++ b/pages/payment/get_payment.vue
@@ -18,8 +18,7 @@
¥
+ v-model="cartForm.total_amount" placeholderStyle="color:#999;font-size:32rpx">
@@ -50,19 +49,17 @@
-
+
+
+
+ -->
+
+
@@ -145,7 +142,7 @@
}
} else {
this.checkForm.cart_id = [];
- this.getProductInfoByMerid(this.mer_id);
+ this.getProductInfoByMerid();
}
},
methods: {
@@ -166,7 +163,7 @@
}
},
- // 键盘回调
+ // 键盘提交
handleConfirm(e) {
if (!e) return;
this.cartForm.total_amount = e;
@@ -176,19 +173,13 @@
// 清空
handleClear() {
this.cartForm.total_amount = '';
+ this.merchantInfo = [];
},
// 输入数字
handleChange(e) {
this.cartForm.total_amount = e;
- },
-
- validateDecimal(event) {
- let val = (that.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
- that.$nextTick(() => {
- that.cartForm.total_amount = val;
- uni.$u.throttle(that.getProductInfoByMerid, 30)
- })
+ uni.$u.throttle(that.getProductInfoByMerid, 20)
},
leftClick(e) {
@@ -215,9 +206,6 @@
})
}
- if (this.cartForm.total_amount.endsWith('.')) this.cartForm.cartForm.total_amount = this.cartForm
- .cartForm.total_amount.replace('.', '');
-
// 循环加入购物车
for (var i = 0; i < that.merchantInfo.length; i++) {
let info = {
@@ -263,14 +251,12 @@
});
},
- hide(e) {
- this.keyBoardShow = false;
- },
-
+ // 折叠商品
handleOpen() {
this.isOpen = !this.isOpen;
},
+ // 根据店铺获取商品
getProductInfoByMerid(merid, money) {
getProductInfo({
mer_id: that.mer_id,
@@ -298,49 +284,6 @@
that.isEmpty = true;
// #endif
})
- },
-
- // 图片保存
- handleSavePic() {
- // 获取要保存的图片路径或URL
- let imageUrl = this.qrcodeUrl; // 这里使用了网络上的图片作为示例
-
- // #ifdef H5
- var a = document.createElement("a");
- a.download = imageUrl;
- a.href = imageUrl;
- document.body.appendChild(a);
- a.click();
- a.remove();
- // #endif
-
- // #ifndef H5
- let that = this;
- uni.downloadFile({
- url: imageUrl,
- success(res) {
- if (res.statusCode === 200) {
- let tempFilePath = res.tempFilePath; // 临时文件路径
- uni.saveImageToPhotosAlbum({
- filePath: tempFilePath,
- success() {
- return that.$util.Tips({
- title: '图片已保存至相册!'
- });
- },
- fail(err) {
- console.error('保存失败', err);
- }
- });
- } else {
- console.error('下载失败', res.statusCode);
- }
- },
- fail(err) {
- console.error('下载失败', err);
- }
- });
- // #endif
}
}
}
diff --git a/pages/payment/settlement.vue b/pages/payment/settlement.vue
index 4cf16db..735c248 100644
--- a/pages/payment/settlement.vue
+++ b/pages/payment/settlement.vue
@@ -294,7 +294,7 @@
let data = uni.getStorageSync("datas");
this.productData = data.productData;
- this.platformConsumption = data.platformConsumption;
+ this.platformConsumption = data.platformConsumption || [];
this.checkForm.cart_id = data.checkForm.cart_id;
this.payForm.cart_id = this.checkForm.cart_id;
diff --git a/pages/users/order_list/index.vue b/pages/users/order_list/index.vue
index 4ee5e2c..1355e98 100644
--- a/pages/users/order_list/index.vue
+++ b/pages/users/order_list/index.vue
@@ -422,36 +422,25 @@
limit: 20,
domain: HTTP_REQUEST_URL,
payMode: [{
- name: "微信支付",
- icon: "icon-weixinzhifu",
- value: 'wechat',
- title: '微信快捷支付',
- payStatus: 1
- },
- {
- name: "支付宝支付",
- icon: "icon-zhifubao",
- value: 'alipay',
- title: '支付宝支付',
- payStatus: this.$store.getters.globalData.alipay_open
- },
- {
- name: "余额支付",
- icon: "icon-yuezhifu",
- value: 'balance',
- title: '可用余额:',
- number: 0,
- payStatus: this.$store.getters.globalData.yue_pay_status
- },
- {
- name: "对公转账",
- icon: "icon-yuezhifu",
- value: 'public',
- title: '对公转账',
- number: 0,
- payStatus: 1
- }
- ],
+ name: "微信支付",
+ icon: "icon-weixinzhifu",
+ value: 'wechat',
+ title: '微信快捷支付',
+ payStatus: 1
+ }, {
+ name: "支付宝支付",
+ icon: "icon-zhifubao",
+ value: 'alipay',
+ title: '支付宝支付',
+ payStatus: this.$store.getters.globalData.alipay_open
+ }, {
+ name: "余额支付",
+ icon: "icon-yuezhifu",
+ value: 'balance',
+ title: '可用余额:',
+ number: 0,
+ payStatus: this.$store.getters.globalData.yue_pay_status
+ }],
pay_close: false,
pay_order_id: '',
invoice_order_id: '',