From f3c0a5f16f8c8d718f138772a349ea129ff509ec Mon Sep 17 00:00:00 2001
From: ltlzx <942659938@qq.com>
Date: Fri, 15 Jul 2022 17:53:04 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=91=E7=9A=84=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E5=92=8C=E5=AF=B9=E6=8E=A5=E8=AE=A2=E5=8D=95=E8=AF=84?=
=?UTF-8?q?=E8=AE=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.hbuilderx/launch.json | 4 +
api/index.js | 5 +-
api/request.js | 6 +-
pages/account/addAddress.vue | 2 +-
pages/account/myOrders.vue | 399 ++++++++++++++++++--------------
pages/order/confirmation.vue | 6 +-
pages/order/details.vue | 59 ++++-
pages/order/refund.vue | 8 +-
pages/productDetails/index.vue | 10 +-
pages/productDetails/review.vue | 114 ++++++++-
10 files changed, 409 insertions(+), 204 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 582561b..a97fd25 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
+ "h5" :
+ {
+ "launchtype" : "local"
+ },
"type" : "uniCloud"
}
]
diff --git a/api/index.js b/api/index.js
index e81de6a..2878f6b 100644
--- a/api/index.js
+++ b/api/index.js
@@ -38,7 +38,7 @@ export const defaultRequest2 =query=>{
})
}
//默认请求地址 只用cookies请求数据 对里面的对象进行加密
-export const defaultRequest3 =query=>{
+export const defaultRequest3 =(query,key)=>{
return httpRequest({
url:'mapi/api_v2011.php?appcode=DOPE+',
method:'post',
@@ -46,7 +46,8 @@ export const defaultRequest3 =query=>{
errMsg:true,
isCookies:true,
isEncryption:true,
- isLoad:true
+ isLoad:true,
+ key:key
})
}
//默认请求地址 不显示等待加载
diff --git a/api/request.js b/api/request.js
index 4cd3440..b204f1e 100644
--- a/api/request.js
+++ b/api/request.js
@@ -22,13 +22,13 @@ const httpRequest = (params) => {
}
let data=Object.assign(json_data,params.data)
console.info(data)
- let consignee
+ let key=params.key
if(params.isEncryption){
// console.info(JSON.parse(JSON.stringify(data.consignee)))
- consignee=encryption(JSON.parse(JSON.stringify(data.consignee)))
+ key=encryption(JSON.parse(JSON.stringify(data[params.key])))
// console.info(consignee)
data=encryption(data)
- data.consignee=consignee
+ data[params.key]=key
}else{
data=encryption(data)
}
diff --git a/pages/account/addAddress.vue b/pages/account/addAddress.vue
index ef3006a..71e548b 100644
--- a/pages/account/addAddress.vue
+++ b/pages/account/addAddress.vue
@@ -249,7 +249,7 @@
return
}
console.info(this.query)
- defaultRequest3(this.query).then(res=>{
+ defaultRequest3(this.query,'consignee').then(res=>{
console.info(res)
if(res.error==0){
uni.showToast({
diff --git a/pages/account/myOrders.vue b/pages/account/myOrders.vue
index 5b5dd47..7fa91b2 100644
--- a/pages/account/myOrders.vue
+++ b/pages/account/myOrders.vue
@@ -6,6 +6,7 @@
+
@@ -82,52 +83,106 @@
-
+
-
-
-
-
+
+
+
- cancelled
+ Waiting for payment
order#{{item.order_sn}}
-
-
-
-
+
+
+
+
+
+
+
+ {{item1.goods_name}}
+
+
+ {{item1.goods_attr |goodsAttr}}
+
+
+ ×{{item1.goods_number}}
+
+
-
- {{item.order_goods.length}} ltems
-
+
+
+
+
+
+
+
+
+
+ {{item.order_goods.length}} ltems
+
+
-
+
total:US${{item.total_fee_o}}
+
+
+ Reward 10 points
+
-
+
+
- -->
+
-
-
+
+
+
+ To be shipped
+
+ order#{{item.order_sn}}
+
-
-
+
+
+
+
+
+
+
+
+
+ {{item1.goods_name}}
+
+
+ {{item1.goods_attr |goodsAttr}}
+
+
+ ×{{item1.goods_number}}
+
+
+
+
+
+
+
@@ -138,20 +193,23 @@
- total:US${{item.total_fee_o}}
-
- -->
-
-
-
+
+
+
+ Shipped
+
+ order#{{item.order_sn}}
+
-
+
+
+
@@ -169,26 +227,11 @@
- total:US${{item.total_fee_o}}
-
-
-
-
-
- -->
-
-
-
-
-
+
+
+
+ Completed
+
+ order#{{item.order_sn}}
+
-
+
+
+
-
+
+
+ {{item1.goods_name}}
+
+
+ {{item1.goods_attr |goodsAttr}}
+
+
+ ×{{item1.goods_number}}
+
+
+
+
+
+
+
+
+
+
+
{{item.order_goods.length}} ltems
- total:US${{item.total_fee_o}}
-
-
-
+
+ total:US${{item.total_fee_o}}
+
+
+
- -->
-
+
-
-
-
-
-
-
-
-
- Waiting for payment
-
- order#{{item.order_sn}}
-
-
+
+
+
+
+ Return and exchange
+
+ order#{{item.order_sn}}
+
-
-
-
-
-
-
-
-
- {{item1.goods_name}}
-
-
- {{item1.goods_attr |goodsAttr}}
-
-
- ×{{item1.goods_number}}
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+ {{item1.goods_name}}
+
+
+ {{item1.goods_attr |goodsAttr}}
+
+
+ ×{{item1.goods_number}}
-
- {{item.order_goods.length}} ltems
-
-
-
- total:US${{item.total_fee_o}}
-
-
- Reward 10 points
-
-
-
-
-
-
-
-
-
-
-
-
-
- Waiting for payment
-
- order#20245512141212
-
-
-
-
-
+
+
+
-
+
+
+
- 4 ltems
+ {{item.order_goods.length}} ltems
- total:US$12.5
-
-
-
-
+
+ total:US${{item.total_fee_o}}
+
+
-
-
+
+
+
+
+
- Waiting for payment
+ cancelled
- order#20245512141212
+ order#{{item.order_sn}}
-
-
-
+
+
+
+
+
+
+
+ {{item1.goods_name}}
+
+
+ {{item1.goods_attr |goodsAttr}}
+
+
+ ×{{item1.goods_number}}
+
+
+
-
- 4 ltems
-
+
+
+
+
+
+
+
+
+
+ {{item.order_goods.length}} ltems
+
+
-
- total:US$12.5
+
+ total:US${{item.total_fee_o}}
-
-
+
-
@@ -475,6 +524,12 @@
}
},
methods:{
+ // 跳转评论页面
+ goComment(item){
+ uni.navigateTo({
+ url:'../productDetails/review?data='+JSON.stringify(item)
+ })
+ },
showGoods(goodsList,type){
this.isShow=true
this.showType=type
@@ -529,7 +584,7 @@
orderInfo: res.data.prepay_data.order_info, //支付宝订单数据
success: function (res) {
console.log('success:' + JSON.stringify(res));
- uni.redirectTo({
+ uni.navigateTo({
url: 'paySuccess?order_id='+this.payQuery.order_id
});
},
@@ -601,7 +656,7 @@
// this.getList()
},
},
- onLoad() {
+ onShow() {
this.getList()
},
filters:{
diff --git a/pages/order/confirmation.vue b/pages/order/confirmation.vue
index f809279..5a8d618 100644
--- a/pages/order/confirmation.vue
+++ b/pages/order/confirmation.vue
@@ -272,7 +272,7 @@
shipping_id:this.order.shipping_id,
directshopping:0,
}
- defaultRequest3(data).then(res=>{
+ defaultRequest3(data,'consignee').then(res=>{
console.info(res)
if(res.error==0){
this.getPayDate(res.data.order.order_id,res.data.will_get_integral)
@@ -282,7 +282,7 @@
// 变更配送方式
cartselectshipping(id){
let data={_action:'cartselectshipping',shipping_id:id,consignee:this.address}
- defaultRequest3(data).then(res=>{
+ defaultRequest3(data,'consignee').then(res=>{
console.info(res)
if(res.error==0){
this.total=res.data.total
@@ -291,7 +291,7 @@
})
},
getList(){
- defaultRequest3(this.query).then(res=>{
+ defaultRequest3(this.query,'consignee').then(res=>{
console.info(res)
if(res.error==0){
this.orderDate=res.data
diff --git a/pages/order/details.vue b/pages/order/details.vue
index 33da575..3650aed 100644
--- a/pages/order/details.vue
+++ b/pages/order/details.vue
@@ -171,13 +171,13 @@
@@ -225,6 +225,10 @@
+
+
+
+
@@ -251,10 +255,54 @@
payment_method:'alipay.native'
},
pay_index:0,
- logisticsinfo:{}
+ logisticsinfo:{},
+ // 弹出提示框的状态 0:取消订单 1、删除订单 2、确认收货
+ tipsType:0,
+ tipsInfo:'',
+ tipsBut:'',
+ cancelQuery:{
+ _action:'cancelorder',
+ order_id:''
+ },
}
},
methods:{
+ // 跳转评论页面
+ goComment(){
+ let data=this.goodsDate
+ data.order_goods=this.goods_list
+ uni.navigateTo({
+ url:'../productDetails/review?data='+JSON.stringify(data)
+ })
+ },
+ // 淡出提示
+ openTips(type){
+ this.tipsType=type
+ if(type==0){
+ this.tipsInfo='Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation'
+ this.tipsBut='CancelOrder'
+ this.cancelQuery._action='cancelorder'
+ }else if(type==1){
+ this.tipsInfo='Are you sure you want to delete this order?'
+ this.tipsBut='DeleteOrder'
+ this.cancelQuery._action='deleteorder'
+ }else if(type==2){
+ this.tipsInfo='Are you sure you have received the products?'
+ this.tipsBut='Confirm'
+ this.cancelQuery._action='affirmorder'
+ }
+ this.$refs.alertDialog.open()
+
+ },
+ // 提示框点击确操作 取消订单、删除订单
+ dialogConfirm(){
+ defaultRequest2(this.cancelQuery).then(res=>{
+ console.info(res)
+ if(res.error==0){
+ this.getList()
+ }
+ })
+ },
goLogistics(){
uni.navigateTo({
url:'./logisticsDetails?order_id='+this.goodsDate.order_id
@@ -321,6 +369,7 @@
console.info(e)
this.details_index=e.details_index
this.query.order_id=e.id
+ this.cancelQuery.order_id=e.id
this.getDate()
},
diff --git a/pages/order/refund.vue b/pages/order/refund.vue
index a357986..34d8e61 100644
--- a/pages/order/refund.vue
+++ b/pages/order/refund.vue
@@ -39,7 +39,7 @@
- Refund amount:
+ Refund amount
US$6.5
@@ -82,11 +82,15 @@
export default {
data() {
return {
-
+ orderDate:{}
}
},
methods:{
+ },
+ onLoad(e) {
+ this.orderDate=JSON.parse(e.data)
+ console.info(this.orderDate)
}
}
diff --git a/pages/productDetails/index.vue b/pages/productDetails/index.vue
index 86fc5b5..63b86bc 100644
--- a/pages/productDetails/index.vue
+++ b/pages/productDetails/index.vue
@@ -189,16 +189,16 @@
No comment yet
-
+
- e***8
+ {{item.user_name}}
- 07/03/2022
+ {{item.add_time}}
- Color:Multicolor
- So unique! Can’t wait to wear these.
+ {{item.commentlabels}}
+ {{item.content}}
diff --git a/pages/productDetails/review.vue b/pages/productDetails/review.vue
index bfd094d..954eecf 100644
--- a/pages/productDetails/review.vue
+++ b/pages/productDetails/review.vue
@@ -3,37 +3,39 @@
-
+
-
+