|
@@ -14,9 +14,12 @@ Page({
|
|
noResult: false,
|
|
noResult: false,
|
|
noMore: false,
|
|
noMore: false,
|
|
isLogin: false,
|
|
isLogin: false,
|
|
|
|
+ hidden1: false,
|
|
|
|
+ hidden2: false,
|
|
mobileTop: 'TONY WU',
|
|
mobileTop: 'TONY WU',
|
|
couponNum: 0,
|
|
couponNum: 0,
|
|
productNum: 0,
|
|
productNum: 0,
|
|
|
|
+ goodsType: 1,
|
|
goodsItemList: []
|
|
goodsItemList: []
|
|
|
|
|
|
},
|
|
},
|
|
@@ -29,7 +32,11 @@ Page({
|
|
isLogin: getMobileCache() != ''
|
|
isLogin: getMobileCache() != ''
|
|
})
|
|
})
|
|
if(this.data.isLogin){
|
|
if(this.data.isLogin){
|
|
- this.getUserPrizeList(1);
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ hidden1: false,
|
|
|
|
+ hidden2: true,
|
|
|
|
+ })
|
|
|
|
+ this.getUserPrizeList();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -74,12 +81,12 @@ Page({
|
|
onShareAppMessage: function () {
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
},
|
|
},
|
|
- getUserPrizeList: function(sum) {
|
|
|
|
|
|
+ getUserPrizeList: function() {
|
|
LuckDraw.getUserPrizeList({
|
|
LuckDraw.getUserPrizeList({
|
|
page: this.data.page,
|
|
page: this.data.page,
|
|
pageSize: this.data.pageSize,
|
|
pageSize: this.data.pageSize,
|
|
- mobile: "13205528979",
|
|
|
|
- goodsType: sum
|
|
|
|
|
|
+ mobile: getMobileCache(),
|
|
|
|
+ goodsType: this.data.goodsType
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.uaerPrizeListView(res.data)
|
|
this.uaerPrizeListView(res.data)
|
|
@@ -93,7 +100,7 @@ Page({
|
|
|
|
|
|
uaerPrizeListView: function(data) {
|
|
uaerPrizeListView: function(data) {
|
|
if (!Array.isArray(data.goodsItemList) || data.goodsItemList.length == 0) {
|
|
if (!Array.isArray(data.goodsItemList) || data.goodsItemList.length == 0) {
|
|
- console.log("优惠券数据为空");
|
|
|
|
|
|
+ console.log("数据为空");
|
|
if (this.data.page == 1) {
|
|
if (this.data.page == 1) {
|
|
this.setData({
|
|
this.setData({
|
|
mobileTop:getMobileCache(),
|
|
mobileTop:getMobileCache(),
|
|
@@ -114,12 +121,12 @@ Page({
|
|
let endTime = v.couponEndTimestamp
|
|
let endTime = v.couponEndTimestamp
|
|
v.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
|
|
v.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
|
|
v.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
|
|
v.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
|
|
- /**if(v.couponType == 'D' && v.discount >0){
|
|
|
|
|
|
+ if(v.couponType == 'D' && v.discount >0){
|
|
v.discount /= 10
|
|
v.discount /= 10
|
|
}
|
|
}
|
|
if(v.couponType == 'C' && v.discount >0){
|
|
if(v.couponType == 'C' && v.discount >0){
|
|
v.reduceCost /= 100
|
|
v.reduceCost /= 100
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
if (this.data.page == 1) {
|
|
if (this.data.page == 1) {
|
|
@@ -144,7 +151,7 @@ Page({
|
|
}
|
|
}
|
|
this.data.lock = true
|
|
this.data.lock = true
|
|
this.data.page++
|
|
this.data.page++
|
|
- this.getUserPrizeList(1)
|
|
|
|
|
|
+ this.getUserPrizeList()
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -155,10 +162,29 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getProfile(e) {
|
|
getProfile(e) {
|
|
- this.getUserPrizeList(1)
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ hidden1: false,
|
|
|
|
+ hidden2: true,
|
|
|
|
+ page: 1,
|
|
|
|
+ goodsType: 1,
|
|
|
|
+ noMore: false,
|
|
|
|
+ noResult: false
|
|
|
|
+ })
|
|
|
|
+ this.data.goodsItemList = [];
|
|
|
|
+ this.getUserPrizeList()
|
|
},
|
|
},
|
|
getPrize(e) {
|
|
getPrize(e) {
|
|
- this.getUserPrizeList(2)
|
|
|
|
|
|
+
|
|
|
|
+ this.setData({
|
|
|
|
+ hidden1: true,
|
|
|
|
+ hidden2: false,
|
|
|
|
+ page: 1,
|
|
|
|
+ goodsType: 2,
|
|
|
|
+ noMore: false,
|
|
|
|
+ noResult: false
|
|
|
|
+ })
|
|
|
|
+ this.data.goodsItemList = [];
|
|
|
|
+ this.getUserPrizeList()
|
|
},
|
|
},
|
|
turnPrize: function() {
|
|
turnPrize: function() {
|
|
console.log("开始查看")
|
|
console.log("开始查看")
|
|
@@ -172,10 +198,12 @@ Page({
|
|
getPhoneNumberSync(e, _ => {
|
|
getPhoneNumberSync(e, _ => {
|
|
this.setData({
|
|
this.setData({
|
|
isLogin: true,
|
|
isLogin: true,
|
|
- mobileTop:getMobileCache(),
|
|
|
|
|
|
+ mobileTop: getMobileCache(),
|
|
|
|
+ hidden1: false,
|
|
|
|
+ hidden2: true,
|
|
})
|
|
})
|
|
console.log(this.data.mobileTop)
|
|
console.log(this.data.mobileTop)
|
|
- this.getUserPrizeList(1)
|
|
|
|
|
|
+ this.getUserPrizeList()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toRecordPrize(e) {
|
|
toRecordPrize(e) {
|