|
@@ -172,6 +172,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ hasLogin: false,
|
|
|
userData: {},
|
|
|
focus: false,
|
|
|
animateUp: false,
|
|
@@ -442,15 +443,29 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
onShow() {
|
|
|
- // 查询免费抽奖次数
|
|
|
- this.getCustomerTimes()
|
|
|
- // 查询亦获奖列表
|
|
|
- this.getDrawList()
|
|
|
+ if(this.hasLogin){
|
|
|
+ // 查询免费抽奖次数
|
|
|
+ this.getCustomerTimes()
|
|
|
+ // 查询亦获奖列表
|
|
|
+ this.getDrawList()
|
|
|
+ }
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.luckDraw = this.$store.state.vuex_LuckDraw
|
|
|
- // 请求奖品数据
|
|
|
- this.getPrizeList();
|
|
|
+
|
|
|
+ // 判断是否登录
|
|
|
+ checkLogin().then(res => {
|
|
|
+ console.log(res,'checkLogin')
|
|
|
+ this.hasLogin = res.status == 200
|
|
|
+ if(!this.hasLogin){
|
|
|
+ uni.redirectTo({
|
|
|
+ url:"/pages/login/login"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 请求奖品数据
|
|
|
+ this.getPrizeList();
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
// 计算转盘宽度和高度
|
|
|
const res = uni.getSystemInfoSync();
|