From fecca933bbbc3cb925d070def665e8b2ad1bfc10 Mon Sep 17 00:00:00 2001 From: mactj Date: Tue, 19 Jan 2021 14:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mini-app/src/apis/orderApis.js | 9 +- mini-app/src/app.wpy | 2 +- mini-app/src/appManager.js | 7 +- .../mall/order/order-detail-body.wpy | 108 ++++++++++++++ .../components/mall/order/order-list-body.wpy | 103 ++++++++++--- .../mall/shopping-car/shopping-car-item.wpy | 64 --------- .../src/components/mall/tab/mall-shopping.wpy | 23 +-- .../pages/mall/{ => goods}/goods-detail.wpy | 97 +++++++++---- mini-app/src/pages/mall/index.wpy | 4 +- mini-app/src/pages/mall/order/order-check.wpy | 133 +++++++++-------- mini-app/src/pages/mall/order/order-list.wpy | 17 +-- .../mall/shopping-car/shopping-car-list.wpy | 57 +++++--- .../src/pages/mall/user/user-address-list.wpy | 2 +- mini-app/src/store/constant/nav/pages.js | 1 + mini-app/src/store/constant/orderDefine.js | 11 -- mini-app/src/store/index.js | 14 +- mini-app/src/vant/card/index.wxss | 135 +++++++++++++++++- 17 files changed, 551 insertions(+), 236 deletions(-) create mode 100644 mini-app/src/components/mall/order/order-detail-body.wpy delete mode 100644 mini-app/src/components/mall/shopping-car/shopping-car-item.wpy rename mini-app/src/pages/mall/{ => goods}/goods-detail.wpy (66%) diff --git a/mini-app/src/apis/orderApis.js b/mini-app/src/apis/orderApis.js index f9222cb54..6416fd640 100644 --- a/mini-app/src/apis/orderApis.js +++ b/mini-app/src/apis/orderApis.js @@ -6,8 +6,6 @@ import { baseUrl } from '../baseDefine' * 订单相关接口 */ class OrderApis { - - /** * 创建订单 * @param data @@ -22,11 +20,16 @@ class OrderApis { getOrderList(data) { return request.get({ - url: baseUrl + 'winery/user_orders/list', + url: baseUrl + 'winery/order/list', data: data }) } + refundOrder(id) { + return request.post({ + url: baseUrl + 'winery/detail/refund/' + id + }) + } } export default new OrderApis() diff --git a/mini-app/src/app.wpy b/mini-app/src/app.wpy index 791aa0502..c340fa289 100644 --- a/mini-app/src/app.wpy +++ b/mini-app/src/app.wpy @@ -102,7 +102,7 @@ pages: [ 'pages/form5', 'pages/form6', -'pages/mall/goods-detail', +'pages/mall/goods/goods-detail', 'pages/mall/user/user-address', 'pages/mall/user/user-address-list', 'pages/mall/order/order-list', diff --git a/mini-app/src/appManager.js b/mini-app/src/appManager.js index 5fb296719..94ca4f0b8 100644 --- a/mini-app/src/appManager.js +++ b/mini-app/src/appManager.js @@ -44,7 +44,7 @@ class AppManager { } saveOpenid(openid) { - console.log('saveOpenid:' + openid) + // console.log('saveOpenid:' + openid) store.dispatch('setOpenidAction', openid) } @@ -56,10 +56,12 @@ class AppManager { const mobile = wx.getStorageSync('mobile') const openid = wx.getStorageSync('openid') const userInfo = wx.getStorageSync('userInfo') + const shoppingCar = wx.getStorageSync('shoppingCar') console.log('setCacheInfo:', mobile) console.log('setCacheInfo:', openid) console.log('setCacheInfo:', userInfo) + console.log('shoppingCar:', shoppingCar) if (mobile) { store.dispatch('setMobileAction', mobile) @@ -72,6 +74,9 @@ class AppManager { if (userInfo) { store.dispatch('setUserInfoAction', userInfo) } + if (shoppingCar) { + store.dispatch('setShoppingCarAction', shoppingCar) + } } navigateTo(path) { diff --git a/mini-app/src/components/mall/order/order-detail-body.wpy b/mini-app/src/components/mall/order/order-detail-body.wpy new file mode 100644 index 000000000..b64aba3b7 --- /dev/null +++ b/mini-app/src/components/mall/order/order-detail-body.wpy @@ -0,0 +1,108 @@ + + + +const parseImage = (imageKey) => { +return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey +} +module.exports.parseImage = parseImage; + + + + + +{ +navigationBarTitleText: '' +} + diff --git a/mini-app/src/components/mall/order/order-list-body.wpy b/mini-app/src/components/mall/order/order-list-body.wpy index 7ae35e157..29074714c 100644 --- a/mini-app/src/components/mall/order/order-list-body.wpy +++ b/mini-app/src/components/mall/order/order-list-body.wpy @@ -1,5 +1,22 @@ @@ -7,7 +24,39 @@ const parseImage = (imageKey) => { return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey } +const parseOrderStatus = (status) => { + +let result = '未知状态' +switch(status) { +case 0: +result = '未支付' +break +case 1: +result = '已取消' +break +case 2: +result = '已支付' +break +case 3: +result = '待收货' +break +case 4: +result = '交易完成' +break +default: +break + +} +console.log("123:",status) +console.log("123:",result) +return result + + + +} + module.exports.parseImage = parseImage; +module.exports.parseOrderStatus = parseOrderStatus;