Commit 6530db68 authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/animation' into 'master'

默认不授权,点击头像或抽奖可授权

See merge request !32
parents dbbe6040 c0cf6d89
...@@ -28,7 +28,10 @@ ...@@ -28,7 +28,10 @@
<span class="title">{{des}}</span> <span class="title">{{des}}</span>
</div> </div>
<div v-if="type === 'lottery'" class="lottery"> <div v-if="type === 'lottery'" class="lottery">
<image class="lottery-image" :src="lotteryUrl"></image> <button v-if="authmodal" open-type="getUserInfo" bindgetuserinfo="getUserInfo" plain="true" class="lottery-button">
<image class="lottery-button-image" :src="lotteryUrl"></image>
</button>
<image v-if="!authmodal" class="lottery-image" @tap="getUserInfo" :src="lotteryUrl"></image>
<span class="title">{{des}}</span> <span class="title">{{des}}</span>
</div> </div>
</div> </div>
...@@ -88,6 +91,10 @@ ...@@ -88,6 +91,10 @@
isReceive: { isReceive: {
type: Boolean, type: Boolean,
default: false default: false
},
authmodal: {
type: Boolean,
default: false
} }
}, },
computed: { computed: {
...@@ -153,6 +160,13 @@ ...@@ -153,6 +160,13 @@
signIn: function() { signIn: function() {
if (this.sign) return; if (this.sign) return;
this.$emit('sign-in', true); this.$emit('sign-in', true);
},
getUserInfo: function(params) {
if (this.authmodal) {
this.$emit('getUserInfo', params, true);
} else {
this.$emit('getAwards');
}
} }
}, },
created() { created() {
...@@ -168,6 +182,17 @@ ...@@ -168,6 +182,17 @@
position: absolute; position: absolute;
top: 469rpx; top: 469rpx;
right: 32rpx; right: 32rpx;
.lottery-button {
width: 78rpx;
height: 78rpx;
padding: 0;
border: none;
.lottery-button-image {
display: flex;
width: 78rpx;
height: 78rpx;
}
}
.lottery-image { .lottery-image {
display: flex; display: flex;
width: 78rpx; width: 78rpx;
......
...@@ -20,6 +20,22 @@ ...@@ -20,6 +20,22 @@
top:100rpx; top:100rpx;
left: 30rpx; left: 30rpx;
} }
.userinfo-button {
width: 80rpx;
height: 80rpx;
padding: 0;
border: none;
background-color: transparent;
&::after {
border: none;
};
.userinfo-image {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
}
.userimage{ .userimage{
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
...@@ -178,13 +194,16 @@ ...@@ -178,13 +194,16 @@
<video-list v-if="videoList && videoList.length" :videoList.sync="videoList" :userAccount="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :total="total" bindchange="changeVideo" @getAwardsInfo="getAwardsInfo"> <video-list v-if="videoList && videoList.length" :videoList.sync="videoList" :userAccount="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :total="total" bindchange="changeVideo" @getAwardsInfo="getAwardsInfo">
</video-list> </video-list>
</view> </view>
<view class="userInfo" style="{{userImgStyle}}" @tap="showMenu(!showMenus)"> <view class="userInfo" style="{{userImgStyle}}">
<image src="{{userInfo.avatarUrl || '/static/images/user@2x.png'}}" mode="cover" class="userimage"></image> <button v-if="authmodal" open-type="getUserInfo" bindgetuserinfo="getUserInfo" class="userinfo-button">
<image class="userinfo-image" src="{{userInfo.avatarUrl || '/static/images/user@2x.png'}}"></image>
</button>
<image v-if="!authmodal" @tap="showMenu(!showMenus)" src="{{userInfo.avatarUrl || '/static/images/user@2x.png'}}" mode="cover" class="userimage"></image>
</view> </view>
<view> <view>
<video-gold type="gold" :des="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :gold="sign" :isReceive="isReceive"></video-gold> <video-gold type="gold" :des="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :gold="sign" :isReceive="isReceive"></video-gold>
<video-sign type="sign" des="签到" :sign="sign" @sign-in="signIn"></video-sign> <video-sign type="sign" des="签到" :sign="sign" @sign-in="signIn"></video-sign>
<video-lottery type="lottery" des="抽奖" @tap="getAwards"></video-lottery> <video-lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></video-lottery>
<video-share type="share" des="分享"></video-share> <video-share type="share" des="分享"></video-share>
</view> </view>
<view class="content"> <view class="content">
...@@ -235,12 +254,12 @@ ...@@ -235,12 +254,12 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> --> </view> -->
<view class="authmodal" v-show="authmodal"> <!-- <view class="authmodal" v-show="authmodal">
<view class="wrap"> <view class="wrap">
<view class="text">来到luckii,再平凡的人,<br>也有幸运的权利!</view> <view class="text">来到luckii,再平凡的人,<br>也有幸运的权利!</view>
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo">授权并进入</button> <button open-type="getUserInfo" bindgetuserinfo="getUserInfo">授权并进入</button>
</view> </view>
</view> </view> -->
<network v-if="isConnected === false"></network> <network v-if="isConnected === false"></network>
<open-animation v-if="showAwardsModal" :joinRecord="mainInfo && mainInfo.joinRecord"></open-animation> <open-animation v-if="showAwardsModal" :joinRecord="mainInfo && mainInfo.joinRecord"></open-animation>
<shared-popup v-if="showShareModal" :inviteinfo="mainInfo && mainInfo.inviteRecord" @getSharedGold="getSharedGold"></shared-popup> <shared-popup v-if="showShareModal" :inviteinfo="mainInfo && mainInfo.inviteRecord" @getSharedGold="getSharedGold"></shared-popup>
...@@ -421,11 +440,14 @@ ...@@ -421,11 +440,14 @@
// console.log("手势未触发====="); // console.log("手势未触发=====");
} }
}, },
async getUserInfo (e) { async getUserInfo (e, isFromLottery) {
if (e.$wx.detail.userInfo) { if (e.$wx.detail.userInfo) {
this.setUserInfo(e.$wx.detail.userInfo); this.setUserInfo(e.$wx.detail.userInfo);
this.authmodal = false; this.authmodal = false;
this.registUser(e.$wx.detail.userInfo); await this.registUser(e.$wx.detail.userInfo);
if (isFromLottery) {
this.getAwards();
}
} }
}, },
changeVideo(e) { changeVideo(e) {
...@@ -535,7 +557,7 @@ ...@@ -535,7 +557,7 @@
} }
const openid = wx.getStorageSync('openId'); const openid = wx.getStorageSync('openId');
return { return {
title: `${this.$wepy.userInfo.nickName || '您的好朋友'}邀请您来抽奖啦~`, title: `${this.$wepy.userInfo || this.$wepy.userInfo.nickName || '您的好朋友'}邀请您来抽奖啦~`,
path: `/pages/index?openid=${openid}`, path: `/pages/index?openid=${openid}`,
imageUrl: this.$wepy.awardsInfo.photoUrl, imageUrl: this.$wepy.awardsInfo.photoUrl,
success: function(res) { success: function(res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment