|
@@ -1,6 +1,7 @@
|
|
// pages/signIn/record/record.js
|
|
// pages/signIn/record/record.js
|
|
import SignIn from '../../../api/signIn'
|
|
import SignIn from '../../../api/signIn'
|
|
import { parseTime } from '../../../utils/util'
|
|
import { parseTime } from '../../../utils/util'
|
|
|
|
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
|
|
Page({
|
|
Page({
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -27,7 +28,17 @@ Page({
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
- this.getUserAwardCouponList();
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ isLogin: getMobileCache() != ''
|
|
|
|
+ })
|
|
|
|
+ if(this.data.isLogin){
|
|
|
|
+ this.setData({
|
|
|
|
+ hidden1: false,
|
|
|
|
+ hidden2: true,
|
|
|
|
+ })
|
|
|
|
+ this.getUserAwardCouponList();
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
getUserAwardCouponList: function() {
|
|
getUserAwardCouponList: function() {
|
|
@@ -52,12 +63,12 @@ Page({
|
|
console.log("优惠券数据为空");
|
|
console.log("优惠券数据为空");
|
|
if (this.data.page == 1) {
|
|
if (this.data.page == 1) {
|
|
this.setData({
|
|
this.setData({
|
|
- // mobileTop:getMobileCache(),
|
|
|
|
|
|
+ mobileTop:getMobileCache(),
|
|
noResult: true
|
|
noResult: true
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.setData({
|
|
this.setData({
|
|
- // mobileTop:getMobileCache(),
|
|
|
|
|
|
+ mobileTop:getMobileCache(),
|
|
noMore: true
|
|
noMore: true
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -72,11 +83,24 @@ Page({
|
|
|
|
|
|
this.data.couponList = this.data.couponList.concat(...data)
|
|
this.data.couponList = this.data.couponList.concat(...data)
|
|
this.setData({
|
|
this.setData({
|
|
- // mobileTop:getMobileCache(),
|
|
|
|
|
|
+ mobileTop:getMobileCache(),
|
|
couponList: this.data.couponList
|
|
couponList: this.data.couponList
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 授权手机号
|
|
|
|
+ getPhoneNumber(e) {
|
|
|
|
+ getPhoneNumberSync(e, _ => {
|
|
|
|
+ this.setData({
|
|
|
|
+ isLogin: true,
|
|
|
|
+ mobileTop: getMobileCache(),
|
|
|
|
+ hidden1: false,
|
|
|
|
+ hidden2: true,
|
|
|
|
+ })
|
|
|
|
+ this.getUserAwardCouponList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
*/
|
|
@@ -116,7 +140,12 @@ Page({
|
|
* 页面上拉触底事件的处理函数
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
*/
|
|
onReachBottom: function () {
|
|
onReachBottom: function () {
|
|
-
|
|
|
|
|
|
+ if (this.data.lock || this.data.noMore) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.data.lock = true
|
|
|
|
+ this.data.page++
|
|
|
|
+ this.getUserAwardCouponList()
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|