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