Authored by huangyCode

修改订单业务

import api from './checkstoreService';
import event from '../../utils/event.js'
const storeApi = new api();
Component({
... ... @@ -34,9 +35,9 @@ Component({
this.dialog = this.selectComponent("#dialog");
wx.getLocation({
success: (res) => {
param.user_latitude = '32.049999';
param.user_longitude = '118.790001';
param.store_id = this.properties.storeId;
param.user_latitude = res.latitude;
param.user_longitude = res.longitude;
param.store_id = this.properties.storeId
storeApi.checkStore(param, () => {
wx.hideLoading();
}).then(r => {
... ...
... ... @@ -21,6 +21,10 @@ Component({
realPrice: String,
orderCode:String,
productId:String,
isStore:{
type:Boolean,
value: false
}
},
/**
... ... @@ -33,7 +37,7 @@ Component({
},
lifetimes: {
},
attached: function () {
... ... @@ -44,14 +48,14 @@ attached: function () {
console.log("lastIndex===" + lastIndex);
that.setData({ lastIndex: lastIndex });
}
if (that.data.timer) {
let leftTime = that.data.lefttime;
let timer = that.data.timer;
if(timer > 0){
let interval = setInterval(() => {
timer = timer - 1;
timer = timer - 1;
leftTime = formatTimeByMin(timer, 'm:s');
if (timer <= 0) {
leftTime = '00:00'
... ... @@ -63,7 +67,7 @@ attached: function () {
}, 1000);
that.setData({ interval: interval});
}
}
},
... ... @@ -74,7 +78,7 @@ detached: function () {
}
},
/**
* 组件的方法列表
... ... @@ -85,14 +89,13 @@ detached: function () {
let actionCode = e.currentTarget.dataset.buttonCode;
let orderCode = e.currentTarget.dataset.orderCode;
let productId = e.currentTarget.dataset.productId;
if (actionCode == BUY_AGAIN) {
let params = {
id: productId
}
router.go('productDetail', params);
} else if (actionCode == NOW_BUY){
console.log("== 去支付页面===")
prePay(productId, orderCode, 1);
} else if (actionCode == SHOW_DETAIL) {
let params = {
... ... @@ -107,9 +110,9 @@ detached: function () {
} else {
showDialog(orderCode, actionCode, 0);
}
},
}
... ...
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
}
... ...
... ... @@ -10,10 +10,10 @@
<text class='order-daction-pay-amount-title-txt'>{{lefttime}}</text>
</view>
</view>
<view class='order-action-bottom-button-view'>
<block wx:for="{{buttons}}" wx:key="{{index}}">
<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>
</block>
</block>
</view>
</view>
... ...
// src/components/order/orderproductinfo.js
Component({
/**
* 组件的属性列表
*/
... ... @@ -8,6 +8,10 @@ Component({
productInfo: Object,
statuStr:String,
fromPage: Number,
isStore:{
type:Boolean,
value: false
}
},
/**
... ...
... ... @@ -9,6 +9,8 @@
</view>
<text class='component-order-product-name-txt'>{{productInfo.productName}}</text>
</view>
<text class='component-order-size-color-txt'>{{productInfo.colorName}},{{productInfo.sizeName}}</text>
<text class='component-order-size-color-txt' wx:if="{{isStore}}">{{productInfo.colorName}},{{productInfo.sizeName}},{{productInfo.skup}}</text>
<text class='component-order-size-color-txt' wx:else>{{productInfo.colorName}},{{productInfo.sizeName}},{{productInfo.skup}}</text>
</view>
</view>
... ...
... ... @@ -38,7 +38,7 @@
<text class='order-detail-sum-grey-txt'>商品金额:</text>
<text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.goodPrice}}</text>
</view>
<view class='order-detail-count-view'>
<view class='order-detail-count-view' wx:if="{{data.isOffline !== 'Y'}}">
<text class='order-detail-sum-grey-txt'>运费:</text>
<text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.feePrice}}</text>
</view>
... ... @@ -53,7 +53,8 @@
</view>
<view class='order-detail-order-code-view'>
<text class='order-detail-create-time-txt'>订单编号:</text>
<text class='order-detail-create-time-txt'>{{data.orderCode}}</text>
<text class='order-detail-create-time-txt' wx:if="{{data.isOffline !== 'Y'}}">{{data.orderCode}}</text>
<text class='order-detail-create-time-txt' wx:else>{{data.orderCode}} (门店订单)</text>
<image class='order-detail-order-copy-image' bindtap='onCopyOrderCode' src='../../assets/images/copyordercode@3x.png'></image>
</view>
<view wx:if='{{data.payment}}' class='order-detail-pay-mode-view'>
... ...
... ... @@ -197,4 +197,4 @@ Page({
}
})
\ No newline at end of file
})
... ...
... ... @@ -4,4 +4,4 @@
"orderlistcell":"./orderlistcell",
"no-data-show-view": "../../../components/no-data-show-view/no-data-show-view"
}
}
\ No newline at end of file
}
... ...
... ... @@ -20,13 +20,13 @@
</block>
<view class="load_more_view" wx:if="{{tab.showLoadMoreView}}">加载中...</view>
</scroll-view>
</block>
</block>
<block wx:else>
<view class='empty'>
<no-data-show-view></no-data-show-view>
</view>
</block>
</swiper-item>
</swiper>
</swiper>
</view>
</view>
\ No newline at end of file
</view>
... ...
... ... @@ -4,4 +4,4 @@
"orderproductinfo": "../../components/order/orderproductinfo",
"orderaction": "../../components/order/orderaction"
}
}
\ No newline at end of file
}
... ...
<!--src/pages/orderList/orderlistcell.wxml-->
<view class='orderlistcell-root-container' data-order-code='{{item.orderCode}}' bindtap='onItemClick'>
<orderproductinfo id="orderproductinfo" product-info="{{item.goodsInfo}}" statu-str="{{item.statuStr}}">
<orderproductinfo id="orderproductinfo" product-info="{{item.goodsInfo}}" statu-str="{{item.statuStr}}" isStore="{{item.isOffline === 'Y'}}">
</orderproductinfo>
<view class='space-view'></view>
<orderaction id="orderaction" buttons="{{item.buttons}}" timer='{{item.leftTime}}' order-code="{{item.orderCode}}" product-id='{{item.goodsInfo.productId}}'/>
<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'}}"/>
<view class='orderlistcell-root-split-line'></view>
</view>
... ...