@@ -3,7 +3,8 @@ var app = getApp() | |||
Page({ | |||
data: { | |||
list:{}, | |||
couponId:null | |||
couponId:null, | |||
orderId:'' | |||
}, | |||
onLoad(e) { | |||
console.log(e.id) | |||
@@ -17,6 +18,7 @@ Page({ | |||
}) | |||
}, | |||
orderfunc() { | |||
var that = this | |||
/* | |||
var couponOrderId = '189631451703017472'; | |||
var orderId = '189631451640102912'; | |||
@@ -56,6 +58,9 @@ Page({ | |||
console.log(res) | |||
if (res.data.code == 200) { | |||
var orderId = '' + res.data.data.id; | |||
this.setData({ | |||
orderId: '' + res.data.data.id | |||
}) | |||
if (res.data.data.payment > 0) { | |||
return Common.payOrderCreate(orderId) | |||
} else { | |||
@@ -86,7 +91,7 @@ Page({ | |||
signType: 'MD5', | |||
paySign: res.data.data.paySign, | |||
'success': function(res) { | |||
Common.payOrderUpdate(orderId, payOrderId, 1); // 支付成功 | |||
Common.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | |||
console.log(res); | |||
console.log('支付成功'); | |||
wx.showToast({ | |||
@@ -1,53 +1,47 @@ | |||
let Http = require('../../utils/http.js') | |||
let app = getApp() | |||
Page({ | |||
data: { | |||
tabs: [{ | |||
key: 1, | |||
name: "全部" | |||
}, | |||
{ | |||
key: 2, | |||
key: 0, | |||
name: "待付款" | |||
}, | |||
{ | |||
key: 3, | |||
name: "已完成" | |||
} | |||
], | |||
list:[ | |||
{ | |||
key:'1', | |||
data:[ | |||
{ | |||
name:'111' | |||
} | |||
] | |||
}, | |||
{ | |||
key: '2', | |||
data: [ | |||
{ | |||
name: '222' | |||
} | |||
] | |||
key: 1, | |||
name: "已支付" | |||
}, | |||
{ | |||
key: '3', | |||
data: [ | |||
{ | |||
name: '333' | |||
} | |||
] | |||
key: 2, | |||
name: "已取消" | |||
} | |||
], | |||
list:[], | |||
current:'', | |||
current_scroll:'1' | |||
}, | |||
onLoad() { | |||
}, | |||
getList(key){ | |||
Http.getResquest('/api/order/list', app.globalData.token, '加载中', { | |||
pageNum: 1, | |||
pageSize: 10, | |||
orderStatus: key | |||
}, (res) => { | |||
this.setData({ | |||
list: res.data.list | |||
}) | |||
console.log(res) | |||
}) | |||
}, | |||
handleChange({detail}) { | |||
this.setData({ | |||
current: detail.key | |||
}); | |||
}, | |||
handleChangeScroll({detail}) { | |||
this.getList(detail.key) | |||
this.setData({ | |||
current_scroll: detail.key | |||
}); | |||
@@ -2,52 +2,26 @@ | |||
<i-tabs class='tabs' current="{{ current_scroll }}" scroll bindchange="handleChangeScroll"> | |||
<i-tab class='i-tab' wx:for="{{tabs}}" wx:key="unique" key="{{item.key}}" title="{{item.name}}"></i-tab> | |||
</i-tabs> | |||
<view class='section'> | |||
<view class='section' wx:for='{{list}}' wx:key='{{index}}'> | |||
<view class='detail_msg'> | |||
<view class='logo'> | |||
<image src='http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'></image> | |||
</view> | |||
<view class='info'> | |||
<view> | |||
<text>黑椒牛排</text> | |||
<text>{{item.detail}}</text> | |||
<text>等待付款</text> | |||
</view> | |||
<view> | |||
<text>购买数量:</text>1件</view> | |||
<text>购买数量:</text>{{item.tenantId}}件</view> | |||
<view> | |||
<text>下单时间:</text>2018-07-10 11:30</view> | |||
</view> | |||
</view> | |||
<view class='payment'> | |||
<view> | |||
<text>¥1.00</text> | |||
<text>¥59.00</text> | |||
</view> | |||
<view> | |||
<text>支付</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class='section'> | |||
<view class='detail_msg'> | |||
<view class='logo'> | |||
<image src='http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'></image> | |||
</view> | |||
<view class='info'> | |||
<view> | |||
<text>黑椒牛排</text> | |||
<text>等待付款</text> | |||
</view> | |||
<view> | |||
<text>购买数量:</text>1件</view> | |||
<view> | |||
<text>下单时间:</text>2018-07-10 11:30</view> | |||
</view> | |||
</view> | |||
<view class='payment'> | |||
<view> | |||
<text>¥1.00</text> | |||
<text>¥59.00</text> | |||
<text>¥{{item.payment}}.00</text> | |||
<text>¥{{item.paymentType}}.00</text> | |||
</view> | |||
<view> | |||
<text>支付</text> | |||