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