Commit 222b8d49 authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/animation' into 'master'

Feature/animation

See merge request !15
parents 43e1d87e 353f78d4
......@@ -3744,6 +3744,14 @@
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
},
"dependencies": {
"qs": {
"version": "6.5.2",
"resolved": "http://npmprivate.quantgroups.com/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true
}
}
}
}
......@@ -5113,10 +5121,9 @@
"dev": true
},
"qs": {
"version": "6.5.2",
"resolved": "http://npmprivate.quantgroups.com/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true
"version": "6.9.4",
"resolved": "http://npmprivate.quantgroups.com/qs/-/qs-6.9.4.tgz",
"integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ=="
},
"rc": {
"version": "1.2.8",
......@@ -5343,6 +5350,12 @@
"uuid": "^3.3.2"
},
"dependencies": {
"qs": {
"version": "6.5.2",
"resolved": "http://npmprivate.quantgroups.com/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "http://npmprivate.quantgroups.com/tough-cookie/-/tough-cookie-2.5.0.tgz",
......
......@@ -19,7 +19,8 @@
"dependencies": {
"@wepy/core": "^2.0.0-alpha.16",
"@wepy/use-promisify": "^2.0.6",
"@wepy/x": "^2.0.2"
"@wepy/x": "^2.0.2",
"qs": "^6.9.4"
},
"devDependencies": {
"@wepy/cli": "^2.0.0-alpha.28",
......
......@@ -35,8 +35,8 @@ wepy.app({
if (!wx.getStorageSync('openId')) {
const { code } = await wepy.wx.login();
const userInfo = await login(code);
wx.setStorageSync('openId', userInfo.openId);
wx.setStorageSync('isRegister', userInfo.isRegister);
wx.setStorageSync('openId', userInfo.openid);
wx.setStorageSync('isRegister', userInfo.register);
}
// wx.checkSession({
// success () {
......
import http from './wxRequest';
import qs from 'qs';
module.exports = {
login(code) {
return http.post(`/api/user/login?code=1235`);
return http.post(`/api/user/login?code=${code}`);
},
register(params) {
return http.post('/api/user/register', params, { 'content-type': 'application/json' });
......@@ -14,10 +15,10 @@ module.exports = {
return http.post('/api/prize/list', params);
},
getAwardsDetail(params) {
return http.post('/api/prize/batch', params);
return http.post('/api/prize/batch', qs.stringify(params));
},
getActivityFeed(params) {
return http.post('/api/activity/feed', params);
return http.post('/api/prize/feed', qs.stringify(params));
},
addGold(params) {
return http.post('/api/user/book', params);
......@@ -32,18 +33,18 @@ module.exports = {
return http.post('/api/user/join/list');
},
getOneRaffle(params) {
return http.post('/api/user/join/list',params);
return http.post('/api/user/join/list', params);
},
getUserPhone() {
return http.post('/api/user/get/phone');
},
confirmRaffle(params) {
return http.post('/api/user/join/confirm',params);
return http.post('/api/user/join/confirm', params);
},
updateUserPhone(params) {
return http.post('/api/user/update/phone',params);
return http.post('/api/user/update/phone', params);
},
getPrize(params){
return http.post('/api/user/price/receive',params);
return http.post('/api/user/price/receive', params);
}
};
......@@ -8,7 +8,7 @@ const request = async (url, options) => {
const safeAreaInsetTop = pages && pages.length > 0 ? pages[pages.length - 1].route === 'pages/index' : false;
const defaultOptions = {
method: 'post',
header: { 'content-type': 'applicction/x-www-form-urlencoded' }
header: { 'content-type': 'application/x-www-form-urlencoded' }
};
options = { ...defaultOptions, ...options };
options.header = {
......
......@@ -57,7 +57,6 @@
},
computed: {
isWin() {
if (!this.joinRecord.id) return false;
return +this.joinRecord.status.value === 3;
}
},
......@@ -83,17 +82,16 @@
}, 500);
}, 2000);
},
hideAnimation (){
hideAnimation() {
this.showAnimation = false;
},
go() {
this.showAnimation = false;
//如果得奖了走
if(this.isWin) {
let id = 7;
wx.navigateTo({url:'/pages/prize?joinRecordId='+id})
// 如果得奖了去领奖,否则去我的抽奖页面
if (this.isWin) {
wx.navigateTo({url: '/pages/prize?joinRecordId=' + this.joinRecord.id});
} else {
wx.navigateTo({url:'/pages/myraffles'})
wx.navigateTo({url: '/pages/myraffles'});
}
}
},
......@@ -318,6 +316,9 @@
border: 1rpx solid #FF5D15;
z-index: 11;
border-radius: 10rpx;
&:after {
border: none;
};
&:nth-child(1) {
background: #fff;
color: #FF5D15;
......
......@@ -13,7 +13,7 @@
<image class="add-gold-image" :src="addGoldUrl"></image>
<span class="add-gold-num">+{{addGoldNum}}</span>
</div>
<div class="show-gold" @tap="showAnimation">
<div class="show-gold">
<div class="sunshine" v-if="addsunshine"></div>
<image class="show-gold-image" :class="{'gold-scale': addsunshine}" :src="goldUrl"></image>
<span class="show-gold-num">
......@@ -35,7 +35,6 @@
</template>
<script>
import wepy from '@wepy/core';
let timeout = null, timeout1 = null;
const images = {
sign: {
notComplete: '/static/images/sign@2x.png',
......@@ -96,9 +95,6 @@
}
},
computed: {
signUrl() {
return this.sign ? images['sign'].completed : images['sign'].notComplete;
},
goldUrl() {
let result = images['gold'].goldOne;
if (this.des === 2) {
......@@ -152,23 +148,18 @@
}
if (v) {
setTimeout(() => {
this.signComplete = true;
this.flyAnimation = true;
}, 1100);
setTimeout(() => {
this.signComplete = true;
}, 50);
}, 1000);
}
}
},
methods: {
handleTaps: function() {
this.showAnimation = !this.showAnimation;
[this.bgColor, this.fontColor] = [this.fontColor, this.bgColor];
},
signIn: function() {
if (this.sign) return;
this.$emit('sign-in', true);
},
showAnimation: function() {
this.addGold = !this.addGold;
}
},
created() {
......@@ -238,7 +229,7 @@
position: absolute;
width: 78rpx;
height: 78rpx;
z-index: 1;
z-index: 3;
}
.jump {
animation: jump 1.2s infinite ease;
......
......@@ -36,23 +36,23 @@
height: 0;
// border: 2rpx solid #000;
z-index: 10;
transform: rotateZ(-2deg)
// transform: rotateZ(-2deg)
}
.star {
position: absolute;
left: -3rpx;
left: -8rpx;
// bottom: -220rpx;
top: -4rpx;
top: -12rpx;
// left: -43%;
height: 10rpx;
width: 150rpx;
// width: 100rpx;
background: linear-gradient(-45deg,rgba(255,255,255,0),yellow);
transform: translateX(605rpx);
// background: -webkit-linear-gradient(-45deg,rgba(255,255,255,0),yellow);
/*此处为下一步的添加动画*/
// -webkit-animation: tail 1s ease-in forwards, shooting 1s ease-in forwards;
// -o-animation: tail 1s ease-in forwards, shooting 1s ease-in forwards;
animation: tail .6s ease-in forwards, shooting .6s ease-in forwards;
animation: tail .7s .1s ease-in forwards, shooting .7s .1s ease-in forwards;
}
.star::before{
content: "";
......@@ -61,6 +61,7 @@
left: -52rpx;
width: 78rpx;
height: 78rpx;
// transform: scale(0.5);
// top: calc(100% - 1px);
// left: 100%;
background: url('http://activitystatic.xyqb.com/sign@2x.png') 0 0/contain no-repeat;
......@@ -68,10 +69,10 @@
/*此处为下一步的添加动画*/
// -webkit-animation: shining 3s ease-in-out infinite;
// -o-animation: shining 3s ease-in-out infinite;
animation: shining .6s ease-in-out forwards;
animation: shining .7s .1s ease-in-out forwards;
}
.star:before {
transform: rotateZ(-2deg);
// transform: rotateZ(-2deg);
// transform: -webkit-translateX(-50%) -webkit-rotateZ(-45deg);
}
.star:after {
......@@ -85,9 +86,9 @@
// 100% {width: 0;}
// }
@keyframes shining {
0% {transform: scale(1);}
0% {transform: scale(1);top: -29rpx;}
// 50% {transform: scale(0.8);}
99% {transform: scale(0.3);}
99% {transform: scale(0.5);top: -33rpx;}
100% {transform: scale(0);}
}
// @-webkit-keyframes tail {
......@@ -97,9 +98,10 @@
// }
@keyframes tail {
0% {width: 0;}
10% {width: 0;}
50% {width: 150rpx;}
65% {width: 50rpx;}
// 10% {width: 0;}
20% {width: 100rpx;}
40% {width: 150rpx;}
60% {width: 100rpx;}
80% {width: 150rpx;}
100% {width: 0;}
}
......
......@@ -43,7 +43,7 @@
.orange {
width: 0;
height:100%;
transition:all 1s;
transition:all .6s;
background-color: #FF5D15;
}
}
......@@ -179,7 +179,7 @@
this.prevQueue = [...this.prevQueue];
},
async getProgress(id) {
const detail = await getAwardsDetail();
const detail = await getAwardsDetail({ prizeId: id });
const progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.nextQueue.forEach(v => {
if (v.id === id) {
......
This diff is collapsed.
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