@@ -54,8 +54,7 @@ | |||||
"backgroundTextStyle": "red", | "backgroundTextStyle": "red", | ||||
"navigationBarBackgroundColor": "#02C0FF", | "navigationBarBackgroundColor": "#02C0FF", | ||||
"navigationBarTitleText": "WeChat", | "navigationBarTitleText": "WeChat", | ||||
"navigationBarTextStyle": "white", | |||||
"enablePullDownRefresh": true | |||||
"navigationBarTextStyle": "white" | |||||
}, | }, | ||||
"networkTimeout": { | "networkTimeout": { | ||||
"request": 10000, | "request": 10000, | ||||
@@ -70,6 +70,8 @@ Page({ | |||||
res.data.list.map(file => { | res.data.list.map(file => { | ||||
file.expiredTime = util.fmtDate(file.expiredTime); | file.expiredTime = util.fmtDate(file.expiredTime); | ||||
}); | }); | ||||
setTimeout(function () { | setTimeout(function () { | ||||
that.setData({ | that.setData({ | ||||
loading: false | loading: false | ||||
@@ -21,6 +21,7 @@ Page({ | |||||
var that = this; | var that = this; | ||||
var scene = decodeURIComponent(options.scene); | var scene = decodeURIComponent(options.scene); | ||||
app.getLocation(); | app.getLocation(); | ||||
that.userLogin(); | |||||
}, | }, | ||||
/** | /** | ||||
* 下拉刷新 | * 下拉刷新 | ||||
@@ -38,9 +39,6 @@ Page({ | |||||
wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
}; | }; | ||||
}, | }, | ||||
onShow: function () { | |||||
this.userLogin(); | |||||
}, | |||||
onGetCode: function (e) { | onGetCode: function (e) { | ||||
//子组件传递给父组件的值 | //子组件传递给父组件的值 | ||||
@@ -5,7 +5,5 @@ | |||||
"c-coupons": "./coupons/index" | "c-coupons": "./coupons/index" | ||||
}, | }, | ||||
"navigationBarTitleText": "首页", | "navigationBarTitleText": "首页", | ||||
"window": { | |||||
"enablePullDownRefresh": true | |||||
} | |||||
"enablePullDownRefresh": true | |||||
} | } |
@@ -2,5 +2,5 @@ | |||||
"usingComponents": { | "usingComponents": { | ||||
"i-button": "../../dist/button/index" | "i-button": "../../dist/button/index" | ||||
}, | }, | ||||
"navigationBarTitleText": "登陆" | |||||
"navigationBarTitleText": "登录" | |||||
} | } |
@@ -77,7 +77,7 @@ Page({ | |||||
}); | }); | ||||
//createDate 创建时间 | //createDate 创建时间 | ||||
var createDate = util.fmtDate(res.data.createDate); | |||||
var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dddd hh:mm:ss"); | |||||
console.log(createDate); | console.log(createDate); | ||||
that.setData({ | that.setData({ | ||||
createDate: createDate | createDate: createDate | ||||
@@ -97,10 +97,23 @@ Page({ | |||||
that.setData({ | that.setData({ | ||||
list: tmpArr | list: tmpArr | ||||
}) | }) | ||||
// for (let i = 0; i < that.data.list.length; i++) { | |||||
// that.setData({ | |||||
// createDate: util.formatTime(that.data.list[i].createDate, "201y-M-d h:m:s") | |||||
// }) | |||||
// } | |||||
for (let i = 0; i < that.data.list.length; i++) { | for (let i = 0; i < that.data.list.length; i++) { | ||||
var createDate1 = util.formatTime(that.data.list[i].createDate, "yyyy-MM-dddd hh:mm:ss"); | |||||
/** | |||||
* 修改list的endtime | |||||
* 渲染到页面 | |||||
*/ | |||||
var createDate = 'list[' + i + '].createDate' | |||||
that.setData({ | that.setData({ | ||||
createDate: util.fmtDate(that.data.list[i].createDate) | |||||
}) | |||||
[createDate]: createDate1 | |||||
}); | |||||
} | } | ||||
}); | }); | ||||
} else { | } else { | ||||
@@ -130,7 +143,7 @@ Page({ | |||||
list: [], | list: [], | ||||
allow_load: true, | allow_load: true, | ||||
current_scroll: detail.key, | current_scroll: detail.key, | ||||
page:1 | |||||
page: 1 | |||||
}) | }) | ||||
this.getList(detail.key, 1); | this.getList(detail.key, 1); | ||||
}, | }, | ||||
@@ -12,14 +12,16 @@ | |||||
<view> | <view> | ||||
<text>{{item.title}}</text> | <text>{{item.title}}</text> | ||||
<text wx:if="{{item.orderStatus==0}}">待付款</text> | <text wx:if="{{item.orderStatus==0}}">待付款</text> | ||||
<text wx:if="{{item.orderStatus==3}}">已退款</text> | |||||
<text wx:if="{{item.orderStatus==3}}">待退款</text> | |||||
<text wx:if="{{item.orderStatus==2}}">已取消</text> | |||||
<text wx:if="{{item.orderStatus==4}}">已退款</text> | |||||
<text wx:if="{{item.orderStatus==5}}">退款失败</text> | |||||
<text wx:if="{{item.orderStatus==1&&item.salePrice==0}}">免费领取</text> | <text wx:if="{{item.orderStatus==1&&item.salePrice==0}}">免费领取</text> | ||||
<text wx:if="{{item.orderStatus==1&&item.salePrice!=0}}">已付款</text> | <text wx:if="{{item.orderStatus==1&&item.salePrice!=0}}">已付款</text> | ||||
<text wx:if="{{item.orderStatus==2}}">已过期</text> | |||||
</view> | </view> | ||||
<view>{{item.subTitle}}</view> | <view>{{item.subTitle}}</view> | ||||
<view> | <view> | ||||
<text>下单时间:</text>{{createDate}} | |||||
<text>下单时间:</text>{{item.createDate}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -38,14 +40,20 @@ | |||||
<text>查看详情</text> | <text>查看详情</text> | ||||
</view> | </view> | ||||
<view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | <view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | ||||
<text>支付</text> | |||||
<text>去支付</text> | |||||
</view> | </view> | ||||
<view wx:if="{{item.orderStatus==2}}" style="background:#999;opacity: .6;" class="btn"> | <view wx:if="{{item.orderStatus==2}}" style="background:#999;opacity: .6;" class="btn"> | ||||
<text>已过期</text> | |||||
<text>已取消</text> | |||||
</view> | </view> | ||||
<view wx:if="{{item.orderStatus==3}}" style="background:#999;opacity: .6;" class="btn"> | <view wx:if="{{item.orderStatus==3}}" style="background:#999;opacity: .6;" class="btn"> | ||||
<text>待退款</text> | |||||
</view> | |||||
<view wx:if="{{item.orderStatus==4}}" style="background:#999;opacity: .6;" class="btn"> | |||||
<text>已退款</text> | <text>已退款</text> | ||||
</view> | </view> | ||||
<view wx:if="{{item.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn"> | |||||
<text>退款失败</text> | |||||
</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="dingdan" wx:if="{{list.length==0}}"> | <view class="dingdan" wx:if="{{list.length==0}}"> | ||||
@@ -52,38 +52,38 @@ Page({ | |||||
loading: false, | loading: false, | ||||
}) | }) | ||||
}, 1400); | }, 1400); | ||||
} else { | |||||
setTimeout(function () { | |||||
that.setData({ | |||||
loading: false, | |||||
}) | |||||
}, 1400); | |||||
console.log(pageNum); | |||||
if (pageNum == 1) { | |||||
that.setData({ | |||||
list: [] | |||||
}) | |||||
} | |||||
var tmpArr = that.data.list; | |||||
tmpArr.push.apply(tmpArr, res.data.list); | |||||
} | |||||
setTimeout(function () { | |||||
that.setData({ | that.setData({ | ||||
list: tmpArr | |||||
loading: false, | |||||
}) | }) | ||||
console.log(tmpArr); | |||||
for (let i = 0; i < that.data.list.length; i++) { | |||||
var startTime = util.fmtDate(that.data.list[i].endTime); | |||||
util.timechuo(startTime); | |||||
console.log(util.timechuo(startTime)); | |||||
/** | |||||
* 修改list的endtime | |||||
* 渲染到页面 | |||||
*/ | |||||
var endtime = 'list[' + i + '].endtime' | |||||
that.setData({ | |||||
[endtime]: util.timechuo(startTime) | |||||
}); | |||||
} | |||||
}, 1400); | |||||
// if (pageNum == 2) { | |||||
// that.setData({ | |||||
// list: [] | |||||
// }) | |||||
// } | |||||
var tmpArr = that.data.list; | |||||
tmpArr.push.apply(tmpArr, res.data.list); | |||||
that.setData({ | |||||
list: tmpArr | |||||
}) | |||||
console.log(tmpArr); | |||||
for (let i = 0; i < that.data.list.length; i++) { | |||||
var startTime = util.fmtDate(that.data.list[i].endTime); | |||||
util.timechuo(startTime); | |||||
console.log(util.timechuo(startTime)); | |||||
/** | |||||
* 修改list的endtime | |||||
* 渲染到页面 | |||||
*/ | |||||
var endtime = 'list[' + i + '].endtime' | |||||
that.setData({ | |||||
[endtime]: util.timechuo(startTime) | |||||
}); | |||||
} | } | ||||
}); | }); | ||||
} else { | } else { | ||||
console.info("allow_load==false 已禁止加载"); | console.info("allow_load==false 已禁止加载"); | ||||
@@ -1,7 +1,5 @@ | |||||
{ | { | ||||
"usingComponents": { | |||||
"usingComponents": { | |||||
}, | }, | ||||
"navigationBarTitleText": "限时抢购" | "navigationBarTitleText": "限时抢购" | ||||
} | } |