Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
6530db68
Commit
6530db68
authored
May 29, 2020
by
郝聪敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/animation' into 'master'
默认不授权,点击头像或抽奖可授权 See merge request
!32
parents
dbbe6040
c0cf6d89
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
9 deletions
+56
-9
sign.wpy
src/components/custom/sign.wpy
+26
-1
index.wpy
src/pages/index.wpy
+30
-8
No files found.
src/components/custom/sign.wpy
View file @
6530db68
...
...
@@ -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;
...
...
src/pages/index.wpy
View file @
6530db68
...
...
@@ -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) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment