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

Merge branch 'feature/animation' into 'master'

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

See merge request !32
parents dbbe6040 c0cf6d89
......@@ -28,7 +28,10 @@
<span class="title">{{des}}</span>
</div>
<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>
</div>
</div>
......@@ -88,6 +91,10 @@
isReceive: {
type: Boolean,
default: false
},
authmodal: {
type: Boolean,
default: false
}
},
computed: {
......@@ -153,6 +160,13 @@
signIn: function() {
if (this.sign) return;
this.$emit('sign-in', true);
},
getUserInfo: function(params) {
if (this.authmodal) {
this.$emit('getUserInfo', params, true);
} else {
this.$emit('getAwards');
}
}
},
created() {
......@@ -168,6 +182,17 @@
position: absolute;
top: 469rpx;
right: 32rpx;
.lottery-button {
width: 78rpx;
height: 78rpx;
padding: 0;
border: none;
.lottery-button-image {
display: flex;
width: 78rpx;
height: 78rpx;
}
}
.lottery-image {
display: flex;
width: 78rpx;
......
......@@ -20,6 +20,22 @@
top:100rpx;
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{
width: 80rpx;
height: 80rpx;
......@@ -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>
</view>
<view class="userInfo" style="{{userImgStyle}}" @tap="showMenu(!showMenus)">
<image src="{{userInfo.avatarUrl || '/static/images/user@2x.png'}}" mode="cover" class="userimage"></image>
<view class="userInfo" style="{{userImgStyle}}">
<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>
<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-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>
</view>
<view class="content">
......@@ -235,12 +254,12 @@
</swiper-item>
</swiper>
</view> -->
<view class="authmodal" v-show="authmodal">
<!-- <view class="authmodal" v-show="authmodal">
<view class="wrap">
<view class="text">来到luckii,再平凡的人,<br>也有幸运的权利!</view>
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo">授权并进入</button>
</view>
</view>
</view> -->
<network v-if="isConnected === false"></network>
<open-animation v-if="showAwardsModal" :joinRecord="mainInfo && mainInfo.joinRecord"></open-animation>
<shared-popup v-if="showShareModal" :inviteinfo="mainInfo && mainInfo.inviteRecord" @getSharedGold="getSharedGold"></shared-popup>
......@@ -421,11 +440,14 @@
// console.log("手势未触发=====");
}
},
async getUserInfo (e) {
async getUserInfo (e, isFromLottery) {
if (e.$wx.detail.userInfo) {
this.setUserInfo(e.$wx.detail.userInfo);
this.authmodal = false;
this.registUser(e.$wx.detail.userInfo);
await this.registUser(e.$wx.detail.userInfo);
if (isFromLottery) {
this.getAwards();
}
}
},
changeVideo(e) {
......@@ -535,7 +557,7 @@
}
const openid = wx.getStorageSync('openId');
return {
title: `${this.$wepy.userInfo.nickName || '您的好朋友'}邀请您来抽奖啦~`,
title: `${this.$wepy.userInfo || this.$wepy.userInfo.nickName || '您的好朋友'}邀请您来抽奖啦~`,
path: `/pages/index?openid=${openid}`,
imageUrl: this.$wepy.awardsInfo.photoUrl,
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