Authored by huangyCode

修改订单业务

... ... @@ -29,15 +29,20 @@ Component({
* 更新属性和数据的方法与更新页面数据的方法类似
*/
methods: {
init() {
init(storeId,productId) {
if(productId){
this.setData({
productId
})
}
return new Promise((resolve) => {
let param = {};
this.dialog = this.selectComponent("#dialog");
wx.getLocation({
success: (res) => {
param.user_latitude = res.latitude;
param.user_longitude = res.longitude;
param.store_id = this.properties.storeId
param.user_latitude = '32.049999';
param.user_longitude = '118.790001';
param.store_id = this.properties.storeId || storeId;
storeApi.checkStore(param, () => {
wx.hideLoading();
}).then(r => {
... ...
... ... @@ -7,7 +7,7 @@ const BUY_AGAIN = 'buy_again';
const NOW_BUY = 'now_buy';
const SHOW_DETAIL = 'show_detail';
const SHOW_EXPRESS = 'show_express';
import event from '../../utils/event'
Component({
/**
... ... @@ -59,6 +59,7 @@ attached: function () {
leftTime = formatTimeByMin(timer, 'm:s');
if (timer <= 0) {
leftTime = '00:00'
event.emit('refresh-order');
}
that.setData({
lefttime: leftTime,
... ...
... ... @@ -29,7 +29,7 @@ Page({
let orderCode = options.orderCode
let api = new OrderDetailService();
let orderActionApi = new OrderActionService();
this.setData({ detailApi: api,
this.setData({ detailApi: api,
orderActionApi: orderActionApi});
if(orderCode){
this.fetchOrderDetail(orderCode);
... ... @@ -105,7 +105,7 @@ Page({
if (data && data.buttons && data.buttons.length > 0) {
lastIndex = data.buttons.length - 1;
}
that.setData({
that.setData({
data,
lastIndex: lastIndex
});
... ... @@ -119,6 +119,7 @@ Page({
timer = formatTimeByMin(leftTime, 'm:s');
if (timer <= 0) {
timer = '00:00'
this.fetchOrderDetail(code);
}
that.setData({
timer: timer,
... ... @@ -126,10 +127,10 @@ Page({
}, 1000);
}
}
})
},
//
onButtonClick: function (e) {
... ... @@ -160,6 +161,7 @@ Page({
let params = {
id: productId
}
if(this.data.data.isOffline === 'Y') return;
router.go('productDetail', params);
},
... ... @@ -176,8 +178,8 @@ Page({
wx.setClipboardData({
data: orderCode,
success (res) {
}
})
}
})
\ No newline at end of file
})
... ...