Authored by huangyCode

修改订单业务

1 import api from './checkstoreService'; 1 import api from './checkstoreService';
  2 +import event from '../../utils/event.js'
2 3
3 const storeApi = new api(); 4 const storeApi = new api();
4 Component({ 5 Component({
@@ -34,9 +35,9 @@ Component({ @@ -34,9 +35,9 @@ Component({
34 this.dialog = this.selectComponent("#dialog"); 35 this.dialog = this.selectComponent("#dialog");
35 wx.getLocation({ 36 wx.getLocation({
36 success: (res) => { 37 success: (res) => {
37 - param.user_latitude = '32.049999';  
38 - param.user_longitude = '118.790001';  
39 - param.store_id = this.properties.storeId; 38 + param.user_latitude = res.latitude;
  39 + param.user_longitude = res.longitude;
  40 + param.store_id = this.properties.storeId
40 storeApi.checkStore(param, () => { 41 storeApi.checkStore(param, () => {
41 wx.hideLoading(); 42 wx.hideLoading();
42 }).then(r => { 43 }).then(r => {
@@ -21,6 +21,10 @@ Component({ @@ -21,6 +21,10 @@ Component({
21 realPrice: String, 21 realPrice: String,
22 orderCode:String, 22 orderCode:String,
23 productId:String, 23 productId:String,
  24 + isStore:{
  25 + type:Boolean,
  26 + value: false
  27 + }
24 }, 28 },
25 29
26 /** 30 /**
@@ -33,7 +37,7 @@ Component({ @@ -33,7 +37,7 @@ Component({
33 }, 37 },
34 38
35 lifetimes: { 39 lifetimes: {
36 - 40 +
37 }, 41 },
38 42
39 attached: function () { 43 attached: function () {
@@ -44,14 +48,14 @@ attached: function () { @@ -44,14 +48,14 @@ attached: function () {
44 console.log("lastIndex===" + lastIndex); 48 console.log("lastIndex===" + lastIndex);
45 that.setData({ lastIndex: lastIndex }); 49 that.setData({ lastIndex: lastIndex });
46 } 50 }
47 - 51 +
48 if (that.data.timer) { 52 if (that.data.timer) {
49 let leftTime = that.data.lefttime; 53 let leftTime = that.data.lefttime;
50 let timer = that.data.timer; 54 let timer = that.data.timer;
51 - 55 +
52 if(timer > 0){ 56 if(timer > 0){
53 let interval = setInterval(() => { 57 let interval = setInterval(() => {
54 - timer = timer - 1; 58 + timer = timer - 1;
55 leftTime = formatTimeByMin(timer, 'm:s'); 59 leftTime = formatTimeByMin(timer, 'm:s');
56 if (timer <= 0) { 60 if (timer <= 0) {
57 leftTime = '00:00' 61 leftTime = '00:00'
@@ -63,7 +67,7 @@ attached: function () { @@ -63,7 +67,7 @@ attached: function () {
63 }, 1000); 67 }, 1000);
64 that.setData({ interval: interval}); 68 that.setData({ interval: interval});
65 } 69 }
66 - 70 +
67 } 71 }
68 }, 72 },
69 73
@@ -74,7 +78,7 @@ detached: function () { @@ -74,7 +78,7 @@ detached: function () {
74 } 78 }
75 }, 79 },
76 80
77 - 81 +
78 82
79 /** 83 /**
80 * 组件的方法列表 84 * 组件的方法列表
@@ -85,14 +89,13 @@ detached: function () { @@ -85,14 +89,13 @@ detached: function () {
85 let actionCode = e.currentTarget.dataset.buttonCode; 89 let actionCode = e.currentTarget.dataset.buttonCode;
86 let orderCode = e.currentTarget.dataset.orderCode; 90 let orderCode = e.currentTarget.dataset.orderCode;
87 let productId = e.currentTarget.dataset.productId; 91 let productId = e.currentTarget.dataset.productId;
88 - 92 +
89 if (actionCode == BUY_AGAIN) { 93 if (actionCode == BUY_AGAIN) {
90 let params = { 94 let params = {
91 id: productId 95 id: productId
92 } 96 }
93 router.go('productDetail', params); 97 router.go('productDetail', params);
94 } else if (actionCode == NOW_BUY){ 98 } else if (actionCode == NOW_BUY){
95 - console.log("== 去支付页面===")  
96 prePay(productId, orderCode, 1); 99 prePay(productId, orderCode, 1);
97 } else if (actionCode == SHOW_DETAIL) { 100 } else if (actionCode == SHOW_DETAIL) {
98 let params = { 101 let params = {
@@ -107,9 +110,9 @@ detached: function () { @@ -107,9 +110,9 @@ detached: function () {
107 } else { 110 } else {
108 showDialog(orderCode, actionCode, 0); 111 showDialog(orderCode, actionCode, 0);
109 } 112 }
110 - 113 +
111 }, 114 },
112 - 115 +
113 } 116 }
114 117
115 118
1 { 1 {
2 "component": true, 2 "component": true,
3 "usingComponents": { 3 "usingComponents": {
  4 +
4 } 5 }
5 -}  
  6 +}
@@ -10,10 +10,10 @@ @@ -10,10 +10,10 @@
10 <text class='order-daction-pay-amount-title-txt'>{{lefttime}}</text> 10 <text class='order-daction-pay-amount-title-txt'>{{lefttime}}</text>
11 </view> 11 </view>
12 </view> 12 </view>
13 - 13 +
14 <view class='order-action-bottom-button-view'> 14 <view class='order-action-bottom-button-view'>
15 <block wx:for="{{buttons}}" wx:key="{{index}}"> 15 <block wx:for="{{buttons}}" wx:key="{{index}}">
16 <button class='{{index == lastIndex ? "order-action-selected-button":"order-action-unselected-button"}}' catchtap='onButtonClick' data-button-code='{{item.code}}' data-order-code='{{orderCode}}' data-product-id='{{productId}}'>{{item.text}}</button> 16 <button class='{{index == lastIndex ? "order-action-selected-button":"order-action-unselected-button"}}' catchtap='onButtonClick' data-button-code='{{item.code}}' data-order-code='{{orderCode}}' data-product-id='{{productId}}'>{{item.text}}</button>
17 - </block> 17 + </block>
18 </view> 18 </view>
19 </view> 19 </view>
1 // src/components/order/orderproductinfo.js 1 // src/components/order/orderproductinfo.js
2 Component({ 2 Component({
3 - 3 +
4 /** 4 /**
5 * 组件的属性列表 5 * 组件的属性列表
6 */ 6 */
@@ -8,6 +8,10 @@ Component({ @@ -8,6 +8,10 @@ Component({
8 productInfo: Object, 8 productInfo: Object,
9 statuStr:String, 9 statuStr:String,
10 fromPage: Number, 10 fromPage: Number,
  11 + isStore:{
  12 + type:Boolean,
  13 + value: false
  14 + }
11 }, 15 },
12 16
13 /** 17 /**
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 </view> 9 </view>
10 <text class='component-order-product-name-txt'>{{productInfo.productName}}</text> 10 <text class='component-order-product-name-txt'>{{productInfo.productName}}</text>
11 </view> 11 </view>
12 - <text class='component-order-size-color-txt'>{{productInfo.colorName}},{{productInfo.sizeName}}</text> 12 + <text class='component-order-size-color-txt' wx:if="{{isStore}}">{{productInfo.colorName}},{{productInfo.sizeName}},{{productInfo.skup}}</text>
  13 + <text class='component-order-size-color-txt' wx:else>{{productInfo.colorName}},{{productInfo.sizeName}},{{productInfo.skup}}</text>
  14 +
13 </view> 15 </view>
14 </view> 16 </view>
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 <text class='order-detail-sum-grey-txt'>商品金额:</text> 38 <text class='order-detail-sum-grey-txt'>商品金额:</text>
39 <text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.goodPrice}}</text> 39 <text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.goodPrice}}</text>
40 </view> 40 </view>
41 - <view class='order-detail-count-view'> 41 + <view class='order-detail-count-view' wx:if="{{data.isOffline !== 'Y'}}">
42 <text class='order-detail-sum-grey-txt'>运费:</text> 42 <text class='order-detail-sum-grey-txt'>运费:</text>
43 <text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.feePrice}}</text> 43 <text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.feePrice}}</text>
44 </view> 44 </view>
@@ -53,7 +53,8 @@ @@ -53,7 +53,8 @@
53 </view> 53 </view>
54 <view class='order-detail-order-code-view'> 54 <view class='order-detail-order-code-view'>
55 <text class='order-detail-create-time-txt'>订单编号:</text> 55 <text class='order-detail-create-time-txt'>订单编号:</text>
56 - <text class='order-detail-create-time-txt'>{{data.orderCode}}</text> 56 + <text class='order-detail-create-time-txt' wx:if="{{data.isOffline !== 'Y'}}">{{data.orderCode}}</text>
  57 + <text class='order-detail-create-time-txt' wx:else>{{data.orderCode}} (门店订单)</text>
57 <image class='order-detail-order-copy-image' bindtap='onCopyOrderCode' src='../../assets/images/copyordercode@3x.png'></image> 58 <image class='order-detail-order-copy-image' bindtap='onCopyOrderCode' src='../../assets/images/copyordercode@3x.png'></image>
58 </view> 59 </view>
59 <view wx:if='{{data.payment}}' class='order-detail-pay-mode-view'> 60 <view wx:if='{{data.payment}}' class='order-detail-pay-mode-view'>
@@ -197,4 +197,4 @@ Page({ @@ -197,4 +197,4 @@ Page({
197 197
198 } 198 }
199 199
200 -})  
  200 +})
@@ -4,4 +4,4 @@ @@ -4,4 +4,4 @@
4 "orderlistcell":"./orderlistcell", 4 "orderlistcell":"./orderlistcell",
5 "no-data-show-view": "../../../components/no-data-show-view/no-data-show-view" 5 "no-data-show-view": "../../../components/no-data-show-view/no-data-show-view"
6 } 6 }
7 -}  
  7 +}
@@ -20,13 +20,13 @@ @@ -20,13 +20,13 @@
20 </block> 20 </block>
21 <view class="load_more_view" wx:if="{{tab.showLoadMoreView}}">加载中...</view> 21 <view class="load_more_view" wx:if="{{tab.showLoadMoreView}}">加载中...</view>
22 </scroll-view> 22 </scroll-view>
23 - </block> 23 + </block>
24 <block wx:else> 24 <block wx:else>
25 <view class='empty'> 25 <view class='empty'>
26 <no-data-show-view></no-data-show-view> 26 <no-data-show-view></no-data-show-view>
27 </view> 27 </view>
28 </block> 28 </block>
29 </swiper-item> 29 </swiper-item>
30 - </swiper> 30 + </swiper>
31 </view> 31 </view>
32 -</view>  
  32 +</view>
@@ -4,4 +4,4 @@ @@ -4,4 +4,4 @@
4 "orderproductinfo": "../../components/order/orderproductinfo", 4 "orderproductinfo": "../../components/order/orderproductinfo",
5 "orderaction": "../../components/order/orderaction" 5 "orderaction": "../../components/order/orderaction"
6 } 6 }
7 -}  
  7 +}
1 <!--src/pages/orderList/orderlistcell.wxml--> 1 <!--src/pages/orderList/orderlistcell.wxml-->
2 <view class='orderlistcell-root-container' data-order-code='{{item.orderCode}}' bindtap='onItemClick'> 2 <view class='orderlistcell-root-container' data-order-code='{{item.orderCode}}' bindtap='onItemClick'>
3 - <orderproductinfo id="orderproductinfo" product-info="{{item.goodsInfo}}" statu-str="{{item.statuStr}}"> 3 + <orderproductinfo id="orderproductinfo" product-info="{{item.goodsInfo}}" statu-str="{{item.statuStr}}" isStore="{{item.isOffline === 'Y'}}">
4 </orderproductinfo> 4 </orderproductinfo>
5 <view class='space-view'></view> 5 <view class='space-view'></view>
6 - <orderaction id="orderaction" buttons="{{item.buttons}}" timer='{{item.leftTime}}' order-code="{{item.orderCode}}" product-id='{{item.goodsInfo.productId}}'/> 6 + <orderaction id="orderaction" buttons="{{item.buttons}}" timer='{{item.leftTime}}' order-code="{{item.orderCode}}" product-id='{{item.goodsInfo.productId}}' storeId="{{item.storeId}}" isStore="{{item.isOffline === 'Y'}}"/>
7 <view class='orderlistcell-root-split-line'></view> 7 <view class='orderlistcell-root-split-line'></view>
8 </view> 8 </view>