Quellcode durchsuchen

[券包:我的优惠券][增加]:券包我的优惠券不同状态的优惠券详情页面不同时间对应的名称不同

tags/2.2.4
meo vor 6 Jahren
Ursprung
Commit
734e482310
5 geänderte Dateien mit 78 neuen und 32 gelöschten Zeilen
  1. +3
    -1
      pages/couponorder/detail/index.js
  2. +9
    -3
      pages/couponorder/detail/index.wxml
  3. +58
    -20
      pages/couponorder/index/index.js
  4. +4
    -4
      pages/index/coupons/index.js
  5. +4
    -4
      pages/rushToBuy/index.js

+ 3
- 1
pages/couponorder/detail/index.js Datei anzeigen

@@ -8,7 +8,8 @@ Page({
code: "",
data: {},
createDate: "",
expiredTime: ""
expiredTime: "",
updateDate:''
},
onLoad: function(options) {
console.log(options);
@@ -34,6 +35,7 @@ Page({
});
that.setData({
expiredTime: util.fmtDate(that.data.data.expiredTime),
updateDate: util.fmtDate(that.data.data.updateDate),
createDate: util.fmtDate(that.data.data.createDate)
});
});


+ 9
- 3
pages/couponorder/detail/index.wxml Datei anzeigen

@@ -7,7 +7,8 @@
<view class="money">
<text>¥{{data.salePrice/100}}</text>
<del>¥{{data.price/100}}</del>
<text wx:if="data.usePrice=='undefined'" class="manjian">满{{data.usePrice/100}}元可用</text>
<text wx:if="{{data.usePrice!=undefined}}" class="manjian">满{{data.usePrice/100}}元可用</text>
<text wx:if="{{data.usePrice==undefined}}" class="manjian">仅限本店使用</text>
</view>
</view>
</view>
@@ -49,9 +50,14 @@
</view>
</view>
<view class='note'>
<view><text>下单时间</text><text>{{createDate}}</text></view>

<view wx:if="{{data.couponOrderStatus==0}}"><text>下单时间</text><text>{{createDate}}</text></view>
<view wx:if="{{data.couponOrderStatus==1}}"><text>核销时间</text><text>{{updateDate}}</text></view>
<view wx:if="{{data.couponOrderStatus==2}}"><text>过期时间</text><text>{{updateDate}}</text></view>
<view wx:if="{{data.couponOrderStatus==3}}"><text>退款时间</text><text>{{updateDate}}</text></view>

<view><text>订单编号</text><text>{{data.orderId}}</text></view>
<!-- <view><text>手机号</text><text>2018.05.25</text></view> -->
<view><text>手机号</text><text>2018.05.25</text></view>
<view><text>实付金额</text><text>{{data.couponPrice/100}}元</text></view>
</view>
<view class='notes' style="border-bottom:0">


+ 58
- 20
pages/couponorder/index/index.js Datei anzeigen

@@ -24,7 +24,9 @@ Page({
],
list: [],
current: "0",
current_scroll: "0"
current_scroll: "0",
page: 1,
allow_load: true
},
onLoad() {
this.getList(0, 0);
@@ -54,25 +56,47 @@ Page({
var that = this;
console.log(key);
console.log(pageNum);
Http.get({
url: config.api.couponOrderList,
data: {
pageNum: pageNum,
pageSize: 10,
couponOrderStatus: key
}
}).then(res => {
console.log(res);
res.data.list.map(file => {
file.expiredTime = format.formatTime(
file.expiredTime,
"yyyy-MM-dddd hh:mm:ss"
);
if (that.data.allow_load) {
wx.showLoading({
title: "加载中"
});
that.setData({
list: res.data.list
Http.get({
url: config.api.couponOrderList,
data: {
pageNum: pageNum,
pageSize: 8,
couponOrderStatus: key
}
}).then(res => {
console.log(res);
res.data.list.map(file => {
file.expiredTime = format.formatTime(
file.expiredTime,
"yyyy-MM-dddd hh:mm:ss"
);
});
console.log("姐姐的订单列表");
setTimeout(function() {
wx.hideLoading();
}, 1200);
if (pageNum >= res.data.pages) {
that.setData({
allow_load: false
});
}
/**
* 先赋值后渲染页面
* concat 不会改变原数组值
* push 会改变原数组值,但不会一条一条插入,而是整个数组插入
*/
that.data.list = that.data.list.concat(res.data.list);
that.setData({
list: that.data.list
});
});
});
} else {
console.log("加载完成allow_load设置成false");
}
},
handleChange({ detail }) {
console.log(detail);
@@ -81,11 +105,25 @@ Page({
});
},
handleChangeScroll({ detail }) {
console.log(detail.key);
console.log("0000");
this.setData({
list: [],
allow_load: true,
current_scroll: detail.key
});
this.getList(detail.key, 1);
this.setData({
current_scroll: detail.key
});
},
onReachBottom: function() {
var that = this;
console.log(that.data.page);
that.data.page++;
console.log(that.data.page);
that.setData({
page: that.data.page
});
console.info("after++ " + that.data.page);
that.getList(that.data.current_scroll, that.data.page);
}
});

+ 4
- 4
pages/index/coupons/index.js Datei anzeigen

@@ -93,10 +93,10 @@ Component({
}).then(res => {
console.log(res);
if (pageNum >= res.data.pages) {
wx.showToast({
title: "加载完成喽",
icon: "success"
});
// wx.showToast({
// title: "加载完成喽",
// icon: "success"
// });
that.setData({
allow_load: false
});


+ 4
- 4
pages/rushToBuy/index.js Datei anzeigen

@@ -49,10 +49,10 @@ Page({

console.log(that.data.day);
if (page >= res.data.pages) {
wx.showToast({
title: "加载完成喽",
icon: "success"
});
// wx.showToast({
// title: "加载完成喽",
// icon: "success"
// });
that.setData({
allow_load: false
});


Laden…
Abbrechen
Speichern