From 925e2027e29ef3908ae71cb1436520a93c6e9bda Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Wed, 22 May 2024 15:06:09 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E8=81=94=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/api.js | 4 +
components/listitem.vue | 2 +-
pages/index/coupons/index.vue | 11 +-
pages/index/jtoday.vue | 16 ++-
pages/order/successful.vue | 53 ++++++---
pages/order_detail/order_detail.vue | 173 +++++++++++++++++++---------
6 files changed, 178 insertions(+), 81 deletions(-)
diff --git a/common/js/api.js b/common/js/api.js
index cfed27d..38207e2 100644
--- a/common/js/api.js
+++ b/common/js/api.js
@@ -67,6 +67,10 @@ export default {
paymodfiyOrderInfo(data) { //查询订单支付状态
return uni.api.post("/pay/modfiyOrderInfo", data);
},
+ // 获取余额
+ shopUserInfo(data) {
+ return uni.api.get("/user/shopUserInfo", data);
+ },
// 优惠加倍
yhqDouble(data) { //查询订单支付状态
return uni.api.post("/order/yhqDouble", data);
diff --git a/components/listitem.vue b/components/listitem.vue
index 2b25a01..a02be1a 100644
--- a/components/listitem.vue
+++ b/components/listitem.vue
@@ -15,7 +15,7 @@
- {{item.distances}}km
+ {{item.distances}}
diff --git a/pages/index/coupons/index.vue b/pages/index/coupons/index.vue
index fa30219..8abed28 100644
--- a/pages/index/coupons/index.vue
+++ b/pages/index/coupons/index.vue
@@ -32,7 +32,12 @@
- {{item.status == 0 ? '兑换积分':'已过期'}}
+
+ {{item.status == 0 ? '去使用':'无法使用'}}
+
+
+ {{item.status == 0 ? '兑换积分':'已过期'}}
+
@@ -141,7 +146,7 @@
uni.navigateBack()
} else {
uni.showToast({
- title: '此优惠卷不能用于目前订单',
+ title: '优惠券面值大于支付金额',
icon: "none",
})
}
@@ -156,7 +161,7 @@
uni.navigateBack()
} else {
uni.showToast({
- title: '此优惠卷不能用于目前订单',
+ title: '优惠券面值大于支付金额',
icon: "none",
})
}
diff --git a/pages/index/jtoday.vue b/pages/index/jtoday.vue
index 289dc2e..f53d377 100644
--- a/pages/index/jtoday.vue
+++ b/pages/index/jtoday.vue
@@ -23,8 +23,8 @@
{{item.shopName}}
-
- 龙首.{{item.distances}}km
+
+ {{item.distances}}
@@ -42,7 +42,7 @@
- {{item.productName}}
+ {{item.productName.length>7?item.productName.substring(0,7)+'...':item.productName}}
已抢{{item.realSalesNumber}}份
@@ -77,7 +77,7 @@
:hour="item.end_times.h" :minute="item.end_times.m"
:second="item.end_times.s" :indexs='index' color="#FFFFFF"
border-color="#00B26A" splitorColor="#FFFFFF"
- :font-size="7">
+ :font-size="10">
@@ -426,10 +426,14 @@
.indexboxitemlefttheretext {
// width: 100%;
margin-top: 12rpx;
- align-items: flex-end;
+ display: flex;
+ justify-content: center;
+ align-items: center;
.fivecontent_item_boxitemlefthere_one {
- align-items: flex-end;
+ display: flex;
+ justify-content: center;
+ align-items: center;
.flex_startone {
font-family: Source Han Sans CN, Source Han Sans CN;
diff --git a/pages/order/successful.vue b/pages/order/successful.vue
index b051014..405aefb 100644
--- a/pages/order/successful.vue
+++ b/pages/order/successful.vue
@@ -15,14 +15,14 @@
- ¥{{orderinfo.couponsPrice}}
+ ¥{{orderInfo.orderAmount}}
订单编号:
- {{orderinfo.orderId}}
+ {{orderInfo.orderNo}}
@@ -30,7 +30,7 @@
下单时间:
- {{orderinfo.createTime}}
+ {{orderInfo.createdAt|createdAtfiter}}
@@ -41,7 +41,7 @@
微信支付
-
+
恭喜获得优惠券
@@ -81,10 +81,24 @@
components: {
navseat
},
+ filters: {
+ createdAtfiter(d) {
+ const timestamp = d; // 待转换的时间戳
+ const date = new Date(timestamp); // 根据时间戳创建Date对象
+ const year = date.getFullYear(); // 获取年份
+ const month = date.getMonth() + 1; // 获取月份,需要加1
+ const day = date.getDate(); // 获取日期
+ const hour = date.getHours(); // 获取小时
+ const minute = date.getMinutes(); // 获取分钟
+ const second = date.getSeconds(); // 获取秒数
+ const formattedDate = `${year}-${month}-${day} ${hour}:${minute}:${second}`; // 拼接成格式化后的日期字符串
+ return formattedDate
+ }
+ },
data() {
return {
titlename: '支付详情',
- orderId:"",
+ orderId: "",
opacitys: false,
towcontentclickindex: 0,
windowHeight: '',
@@ -102,7 +116,7 @@
name: '饮品小吃'
}
],
- orderinfo:null,
+ orderinfo: null,
form: {
address: '', //地址
type: '', //品类
@@ -112,6 +126,7 @@
size: 10, //页容量
status: 'loadmore'
},
+ orderInfo: null
};
},
onPageScroll(e) {
@@ -127,12 +142,15 @@
}
},
onLoad(e) {
- console.log('调试',e)
this.orderId = e.orderId
setTimeout(() => {
this.GetTop()
}, 1000)
this.getinfo(e.orderId)
+ this.orderInfo = JSON.parse(e.orderInfo)
+ console.log('调试1', e)
+ console.log('调试2', JSON.parse(e.orderInfo))
+ console.log('调试3', this.orderInfo)
},
computed: {
HeighT() { //手机类型的尺寸
@@ -140,24 +158,27 @@
},
},
methods: {
- async getinfo(id){
+ async getinfo(id) {
let res = await this.api.getYhqDouble({
- orderId:id
+ // orderId: 420
+ orderId: id
})
- console.log('调试1',res)
- if(res.code==0){
- this.orderinfo= res.data
+ if (res.code == 0) {
+ this.orderinfo = res.data
}
},
- wantEvent(){
+ wantEvent() {
uni.redirectTo({
- url: '/pages/index/index'
+ url: '/pages/order/order_detail?orderId=' + this.orderId
});
},
- async DoublingEvent(){
+ async DoublingEvent() {
let res = await this.api.yhqDouble({
- conponsId: this.listinfoid
+ conponsId: this.orderinfo.id
})
+ if (res.code == 0) {
+ this.wantEvent()
+ }
},
//G滚动底部
loadMore(e) {
diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue
index dd58c81..3dee1c0 100644
--- a/pages/order_detail/order_detail.vue
+++ b/pages/order_detail/order_detail.vue
@@ -70,13 +70,23 @@
-
+
+
+
+
+ 红包/低佣券
+
+
+
+
@@ -107,8 +117,8 @@
-
- 会员卡余额{{ amountVIP}}
+ 会员卡余额{{ amountVIP.amount}} 去充值
@@ -144,28 +154,28 @@
-->
-
+
-
-
-
-
-
- 实付金额:
+
+
+
+
+
+ 实付金额:
+
+
+ ¥{{listinfo.amount}}
+
+
+ 以优惠¥{{emitorderfoodform.couponsPrice}}
+
-
- ¥{{listinfo.amount}}
+
+ 立即付款
-
- 以优惠¥{{emitorderfoodform.couponsPrice}}
-
-
-
- 立即付款
-