|
@@ -1,6 +1,7 @@
|
|
// pages/luckDraw/prize.js
|
|
// pages/luckDraw/prize.js
|
|
import LuckDraw from '../../api/luck-draw'
|
|
import LuckDraw from '../../api/luck-draw'
|
|
import { parseTime } from '../../utils/util';
|
|
import { parseTime } from '../../utils/util';
|
|
|
|
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../utils/user'
|
|
Page({
|
|
Page({
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -12,6 +13,7 @@ Page({
|
|
lock: false,
|
|
lock: false,
|
|
noResult: false,
|
|
noResult: false,
|
|
noMore: false,
|
|
noMore: false,
|
|
|
|
+ isLogin: false,
|
|
couponNum: 0,
|
|
couponNum: 0,
|
|
productNum: 0,
|
|
productNum: 0,
|
|
goodsItemList: []
|
|
goodsItemList: []
|
|
@@ -22,7 +24,10 @@ Page({
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
-
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ isLogin: getMobileCache() != ''
|
|
|
|
+ })
|
|
|
|
+ this.getUserPrizeList();
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -36,7 +41,7 @@ Page({
|
|
* 生命周期函数--监听页面显示
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
*/
|
|
onShow: function () {
|
|
onShow: function () {
|
|
- this.getUserPrizeList();
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -61,13 +66,6 @@ Page({
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 页面上拉触底事件的处理函数
|
|
|
|
- */
|
|
|
|
- onReachBottom: function () {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
* 用户点击右上角分享
|
|
* 用户点击右上角分享
|
|
*/
|
|
*/
|
|
onShareAppMessage: function () {
|
|
onShareAppMessage: function () {
|
|
@@ -77,7 +75,7 @@ Page({
|
|
LuckDraw.getUserPrizeList({
|
|
LuckDraw.getUserPrizeList({
|
|
page: this.data.page,
|
|
page: this.data.page,
|
|
pageSize: this.data.pageSize,
|
|
pageSize: this.data.pageSize,
|
|
- mobile:'16602120168',
|
|
|
|
|
|
+ mobile: getMobileCache(),
|
|
goodsType: 2
|
|
goodsType: 2
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -114,7 +112,7 @@ Page({
|
|
|
|
|
|
/**
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
* 页面上拉触底事件的处理函数
|
|
- */
|
|
|
|
|
|
+
|
|
onReachBottom: function () {
|
|
onReachBottom: function () {
|
|
if (this.data.lock || this.data.noMore) {
|
|
if (this.data.lock || this.data.noMore) {
|
|
return
|
|
return
|
|
@@ -122,12 +120,24 @@ Page({
|
|
this.data.lock = true
|
|
this.data.lock = true
|
|
this.data.page++
|
|
this.data.page++
|
|
this.getUserPrizeList()
|
|
this.getUserPrizeList()
|
|
- },
|
|
|
|
|
|
+ },*/
|
|
|
|
|
|
toProfile(e) {
|
|
toProfile(e) {
|
|
const url = "profile?id=" + e.currentTarget.dataset.id
|
|
const url = "profile?id=" + e.currentTarget.dataset.id
|
|
wx.redirectTo({
|
|
wx.redirectTo({
|
|
url
|
|
url
|
|
})
|
|
})
|
|
-}
|
|
|
|
|
|
+ },
|
|
|
|
+ turnPrize: function() {
|
|
|
|
+ console.log("开始查看")
|
|
|
|
+ if (this.isLock || !this.data.isLogin) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 授权手机号
|
|
|
|
+ getPhoneNumber(e) {
|
|
|
|
+ getPhoneNumberSync(e, _ => {
|
|
|
|
+ this.getUserPrizeList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
})
|
|
})
|