ソースを参照

gxx

tags/2.2.4
batman 6年前
コミット
ef804dee68
3個のファイルの変更32行の追加45行の削除
  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 ファイルの表示

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

//1535126400000
Page({
data: {
tabs: [{
key: 1,
key: 0,
name: "未使用"
},
{
key: 2,
key: 1,
name: "已使用"
},
{
key: 3,
key: 2,
name: "已过期"
},
{
key: 4,
key: 3,
name: "已退款"
}
],
list: [{
key: '1',
data: [{
name: '111'
}]
},
{
key: '2',
data: [{
name: '222'
}]
},
{
key: '3',
data: [{
name: '333'
}]
}
],
list: [],
current: '',
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({
detail
}) {
@@ -49,6 +54,7 @@ Page({
handleChangeScroll({
detail
}) {
this.getList(detail.key)
this.setData({
current_scroll: detail.key
});


+ 1
- 2
pages/coupons/index/index.json ファイルの表示

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

+ 2
- 20
pages/coupons/index/index.wxml ファイルの表示

@@ -2,7 +2,7 @@
<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>
@@ -12,25 +12,7 @@
<text>黑椒牛排</text>
</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>
<text></text>
<text>立即使用</text>


読み込み中…
キャンセル
保存