Bläddra i källkod

gxx

tags/2.2.4
batman 6 år sedan
förälder
incheckning
ef804dee68
3 ändrade filer med 32 tillägg och 45 borttagningar
  1. +29
    -23
      pages/coupons/index/index.js
  2. +1
    -2
      pages/coupons/index/index.json
  3. +2
    -20
      pages/coupons/index/index.wxml

+ 29
- 23
pages/coupons/index/index.js Visa fil

@@ -1,44 +1,49 @@
let Http = require('../../../utils/http.js')
let format = require('../../../utils/util.js')
let app = getApp()

//1535126400000
Page({ Page({
data: { data: {
tabs: [{ tabs: [{
key: 1,
key: 0,
name: "未使用" name: "未使用"
}, },
{ {
key: 2,
key: 1,
name: "已使用" name: "已使用"
}, },
{ {
key: 3,
key: 2,
name: "已过期" name: "已过期"
}, },
{ {
key: 4,
key: 3,
name: "已退款" name: "已退款"
} }
], ],
list: [{
key: '1',
data: [{
name: '111'
}]
},
{
key: '2',
data: [{
name: '222'
}]
},
{
key: '3',
data: [{
name: '333'
}]
}
],
list: [],
current: '', current: '',
current_scroll: '1' current_scroll: '1'
}, },
onLoad() {
this.getList(0)
},
getList(key) {
Http.getResquest('/api/couponOrder/list', app.globalData.token, '加载中', {
pageNum: 1,
pageSize: 10,
orderStatus: key
}, (res) => {
res.data.list.map(file => {
file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss')
})
this.setData({
list: res.data.list
})
console.log(res)
})
},
handleChange({ handleChange({
detail detail
}) { }) {
@@ -49,6 +54,7 @@ Page({
handleChangeScroll({ handleChangeScroll({
detail detail
}) { }) {
this.getList(detail.key)
this.setData({ this.setData({
current_scroll: detail.key current_scroll: detail.key
}); });


+ 1
- 2
pages/coupons/index/index.json Visa fil

@@ -1,8 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"i-tab": "../../../dist/tab/index", "i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index",
"c-coupons": "../../../components/coupons/index"
"i-tabs": "../../../dist/tabs/index"
}, },
"navigationBarTitleText": "我的优惠劵" "navigationBarTitleText": "我的优惠劵"
} }

+ 2
- 20
pages/coupons/index/index.wxml Visa fil

@@ -2,7 +2,7 @@
<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>
@@ -12,25 +12,7 @@
<text>黑椒牛排</text> <text>黑椒牛排</text>
</view> </view>
<view> <view>
<text>有效期至:</text>2018-07-10 11:30</view>
<view>
<text></text>
<text>立即使用</text>
</view>
</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>
</view>
<view>
<text>有效期至:</text>2018-07-10 11:30</view>
<text>有效期至:</text>{{item.expiredTime}}</view>
<view> <view>
<text></text> <text></text>
<text>立即使用</text> <text>立即使用</text>


Laddar…
Avbryt
Spara