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
48eaf8d7
Commit
48eaf8d7
authored
May 22, 2020
by
郝聪敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增摇奖动画;新增分享、推送授权
parent
9265aac3
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
311 additions
and
190 deletions
+311
-190
openAnimation.wpy
src/components/custom/openAnimation.wpy
+232
-140
sign.wpy
src/components/custom/sign.wpy
+15
-16
videolist.wpy
src/components/custom/videolist.wpy
+7
-5
index.wpy
src/pages/index.wpy
+57
-29
No files found.
src/components/custom/openAnimation.wpy
View file @
48eaf8d7
This diff is collapsed.
Click to expand it.
src/components/custom/sign.wpy
View file @
48eaf8d7
<template>
<div class="icon-container">
<div class="sign" v-if="type === 'sign'" @tap="signIn">
<image class="sign-in" :src="signNotCompletedUrl" v-if="!signComplete" :class="{'jump': !sign
ing, 'fly': signing
}" ></image>
<image class="sign-in" :src="signNotCompletedUrl" v-if="!signComplete" :class="{'jump': !sign
, 'fly': sign
}" ></image>
<image class="sign-comlete" :src="signCompletedUrl" v-if="sign"></image>
<div class="sign-shine" v-if="!sign"></div>
<div class="sign-shadow" v-if="!signComplete"></div>
...
...
@@ -33,7 +33,7 @@
</template>
<script>
import wepy from '@wepy/core';
let timeout = null;
let timeout = null
, timeout1 = null
;
const images = {
sign: {
notComplete: '/static/images/sign@2x.png',
...
...
@@ -56,8 +56,6 @@
showAnimation: false,
addGold: false,
addsunshine: false,
signNot: true,
signing: false,
signComplete: false,
signNotCompletedUrl: '/static/images/sign@2x.png',
signCompletedUrl: '/static/images/sign-completed@2x-70_70px.png',
...
...
@@ -116,24 +114,24 @@
},
watch: {
gold(v) {
console.log('gold', v, this.addsunshine);
if (!v) {
this.addsunshine = false;
if (v) {
setTimeout(() => {
timeout1 = null;
} else {
timeout1 = setTimeout(() => {
this.addsunshine = true;
console.log('addsunshine', this.addsunshine);
}, 1500);
}
},
sign(v) {
this.signNot = false;
this.signing = v;
if (!v) {
this.signComplete = false;
console.log(v, this.signComplete);
if (!v) {
timeout = null;
} else {
timeout = setTimeout(() => {
this.signComplete = true;
console.log('signComplete');
}, 1300);
}
}
...
...
@@ -148,7 +146,6 @@
},
showAnimation: function() {
this.addGold = !this.addGold;
// this.addsunshine = !this.addsunshine;
}
},
created() {
...
...
@@ -372,11 +369,13 @@
.sunshine {
position: absolute;
top: 20rpx;
box-shadow: 0 0 30rpx 66rpx yellow;
background: yellow;
border-radius: 50%;
width:
10
rpx;
height:
1
5rpx;
z-index:
2
;
width:
5
rpx;
height:
7.
5rpx;
z-index:
1
;
animation: addsunshine 2s linear forwards;
}
...
...
src/components/custom/videolist.wpy
View file @
48eaf8d7
...
...
@@ -44,6 +44,8 @@
height:100%;
background-color: #FF5D15;
}
.images {
width: 100%;
}
</style>
<template>
...
...
@@ -60,7 +62,7 @@
<!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
<swiper-item wx:for="{{curQueue}}" wx:key="index">
<view class="video-wrapper">
<video
<
!-- <
video
id="video_{{index}}"
class="video_item"
loop
...
...
@@ -77,7 +79,7 @@
@tap="videoTap"
>
<video-pause :pause="pause"></video-pause>
</video>
</video>
< !-->
<view class="rightcont">
<view class="info">奖品库存: 1/8</view>
<view class="info">中奖概率: {{item.id}}/3000</view>
...
...
@@ -86,7 +88,9 @@
<view class="orange" style="{{progressStyle}}"></view>
</view>
</view>
<video-loading v-if="item.time === 0"/>
<!-- <video-loading v-if="item.time === 0"/> -->
<image class="images" :src="item.url" mode="widthFix"></image>
<slot></slot>
</view>
</swiper-item>
</swiper>
...
...
@@ -165,8 +169,6 @@
this.circular = false;
setTimeout(() => {
const direction = diff === 1 || diff === -2 ? 'up' : 'down';
if (direction === 'up') {
if (this._invalidDown === 0) {
...
...
src/pages/index.wpy
View file @
48eaf8d7
...
...
@@ -441,30 +441,49 @@
}
},
signIn: function(v) {
// wx.requestSubscribeMessage({
// tmplIds: [
// 'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',
// '_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',
// '7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'
// ],
// success (res) {
// console.log('requestSubscribeMessage', res);
// }
// });
this.sign = v;
if (!this.sign) {
this.showAnimation = false;
let that = this;
const tmplIds = [
'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',
'_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',
'7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'
];
wx.requestSubscribeMessage({
tmplIds: [
'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',
'_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',
'7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'
],
success (res) {
console.log('requestSubscribeMessage success', res);
if (res.errMsg === 'requestSubscribeMessage:ok') {
const rs = tmplIds.some(v => res[v] === 'accept');
if (rs) {
that.sign = v;
if (!that.sign) {
that.showAnimation = false;
timeout = null;
timeout1 = null;
} else {
timeout = setTimeout(() => {
this.showAnimation = this
.sign;
that.showAnimation = that
.sign;
timeout1 = setTimeout(() => {
const num = [1, 2, 4, 501, 2501, 5001];
this
.goldNum = num[Math.floor(Math.random() * 6)];
that
.goldNum = num[Math.floor(Math.random() * 6)];
}, 1000);
}, 1300);
}
} else {
Dialog.alert({
title: '订阅通知',
message: '签到必须同意推送提醒!'
});
}
}
},
fail (res) {
console.log('requestSubscribeMessage fail', res);
}
});
},
onShareAppMessage: function(res) {
if (res.from === 'button') {
...
...
@@ -519,15 +538,24 @@
{value: 10, text: '白色条纹马克杯,马克吐温同款10', imgsrc:'/static/images/peo2.jpg', price:'¥1399.67',people:2200,sku:'100004549235'}
];
let urls = [
'https://www.apple.com/105/media/us/iphone-x/2017/01df5b43-28e4-4848-bf20-490c34a926a7/films/feature/iphone-x-feature-tpl-cc-us-20170912_1920x1080h.mp4',
'https://xyqblogo.lkbang.net/VID_20200508_171710.mp4',
'https://xyqblogo.lkbang.net/VID_20200508_171710.mp4',
'https://xyqblogo.lkbang.net/VID_20200508_171710.mp4'
// 'https://www.apple.com/105/media/us/iphone-x/2017/01df5b43-28e4-4848-bf20-490c34a926a7/films/feature/iphone-x-feature-tpl-cc-us-20170912_1920x1080h.mp4',
// 'https://xyqblogo.lkbang.net/VID_20200508_171710.mp4',
// 'https://xyqblogo.lkbang.net/VID_20200508_171710.mp4',
// 'https://xyqblogo.lkbang.net/VID_20200508_171710.mp4'
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1590151556813&di=44964ab823b5fb5f3fadcf9ceb87553b&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201503%2F07%2F20150307113019_FSEFE.thumb.700_0.png',
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2944016076,351466175&fm=26&gp=0.jpg',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1590151520979&di=beba310e6bc314f7dd7ede841d068f68&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201610%2F05%2F20161005092600_jCmSx.thumb.700_0.jpeg'
];
this.videoList = urls.map((url, index) => ({ id: index + 1, url }));
this.videoList = urls.map((url, index) => ({ id: index + 1, url
, type: 'image'
}));
},
onLoad (options) {
let that = this;
if (options.openid) {
Dialog.alert({
title: 'openidShared',
message: options.openid
});
}
this.adlist = [
{imgsrc: '/static/images/test1.jpg', text: '小明刚刚参与了抽奖'},
{imgsrc: '/static/images/test1.jpg', text: '小2刚刚参与了抽奖'},
...
...
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