Authored by 李奇

Merge branch 'release/6.8.6' into 'master'

Release/6.8.6



See merge request !12
... ... @@ -19,7 +19,7 @@ Component({
},
num: {
type: Number,
value: 2
value: 0
},
shareUid: {
type: Number,
... ...
... ... @@ -40,6 +40,17 @@
<block wx:elif="{{status === 6}}">
<view class="action-item over">活动已结束</view>
</block>
<block wx:elif="{{status === 7}}">
<block wx:if="{{num > 0}}">
<view class="action-item confirm" bindtap="goMyList">
我的抽奖码({{num}})
</view>
</block>
<block wx:else>
<view class="action-item over">活动已结束</view>
</block>
</block>
</view>
<new-lucky-alert wx:if="{{show}}" bindhiddenalert="hiddenAlert">
... ... @@ -54,16 +65,6 @@
</form>
<view class="share-desc">1个好友参加=1个抽奖码=中奖几率UP!</view>
</view>
<!-- <form bindsubmit='submitFormId' report-submit='true'>
<view class="foot">
<button class="foot-item info" plain="true" hover-class="none" form-type="submit" bindtap="goShare">去分享</button>
<button class="foot-item" plain="true" hover-class="none" form-type="submit" bindtap="cancelAlert">取消</button>
</view>
</form> -->
<!-- <view class="foot-item info" bindtap="goShare">去分享</view>
<view class="foot-item" bindtap="cancelAlert">取消</view> -->
</new-lucky-alert>
<zero-alert wx:if="{{error}}">
... ...
// page/subPackage/pages/zeroSell/components/head-counter.js
Component({
/**
* 组件的属性列表
*/
properties: {
count: {
type: Number
},
num: {
type: Number
},
status: {
type: Number
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--page/subPackage/pages/zeroSell/components/head-counter.wxml-->
<wxs src="./helper.wxs" module="helper" />
<!-- <view class="head-counter"> -->
<!-- <view class="title">
<view class="txt">已有</view>
<block wx:for="{{helper.formatN('000000', count)}}">
<view class="num-wrapper">
<text>{{item}}</text>
<view class="mask"></view>
</view>
</block>
<view class="txt">参与</view>
</view>
<view style="font-size: 28rpx;" wx:if="{{status === 0}}"> 活动结束 </view>
<view style="font-size: 28rpx;" wx:elif="{{status === 1 || status === 2}}"> 达到{{num}}人开奖 </view>
<view style="font-size: 28rpx;" wx:elif="{{status === 3}}"> 等待开奖中 </view>
<view style="font-size: 28rpx;" wx:elif="{{status === 4}}"> 已开奖 </view>
<view style="font-size: 28rpx;" wx:elif="{{status === 5}}"> 人数不足 活动结束 </view> -->
<!-- </view> -->
<view class="container">
<view class="text">
已有{{count}}人参加,
<text wx:if="{{status === 0}}"> 活动结束 </text>
<text wx:elif="{{status === 1 || status === 2}}"> 达到{{num}}人开奖 </text>
<text wx:elif="{{status === 3}}"> 等待开奖中 </text>
<text wx:elif="{{status === 4}}"> 已开奖 </text>
<text wx:elif="{{status === 5}}"> 人数不足 活动结束 </text>
</view>
</view>
/* page/subPackage/pages/zeroSell/components/head-counter.wxss */
.head-counter {
margin-bottom: 60rpx;
text-align: center;
}
.title {
margin-bottom: 20rpx;
}
.txt {
display: inline-block;
width: 90rpx;
height: 72rpx;
font-size: 28rpx;
line-height: 72rpx;
vertical-align: top;
}
.num-wrapper {
display: inline-block;
position: relative;
width: 56rpx;
height: 72rpx;
font-size: 56rpx;
line-height: 72rpx;
background: black;
color: white;
font-weight: bolder;
}
.num-wrapper + .num-wrapper {
margin-left: 10rpx;
}
.mask {
position: absolute;
width: 100%;
height: 50%;
top: 0;
left: 0;
opacity: 0.4;
background-color: black;
}
.text {
font-family: PingFang-SC-Medium;
font-size: 28rpx;
color: #FFFFFF;
letter-spacing: -0.36rpx;
text-align: center;
display: inline-block;
margin-top: 15rpx;
}
.container {
width: 600rpx;
height: 64rpx;
background-color: #222;
text-align: center;
margin: 0 auto;
}
\ No newline at end of file
... ... @@ -13,11 +13,11 @@
</block>
<block wx:elif="{{item.status === 3}}">
<view class="btn">等待开奖中</view>
<view class="btn">待开奖</view>
</block>
<block wx:elif="{{item.status === 5}}">
<view class="btn">人数不足 活动结束</view>
<view class="btn">待开奖</view>
</block>
<block wx:else>
... ...
<view>
<block wx:if="{{product.status === 0}}">
<view class="btn cancel" >活动结束</view>
<view class="btn cancel" >活动结束</view>
</block>
<block wx:elif="{{product.status === 1}}">
... ... @@ -11,12 +11,16 @@
<view class="btn ok" catchtap="onClick">参加抽奖</view>
</block>
<block wx:elif="{{product.status === 3 || product.status === 4}}">
<view class="btn cancel">活动结束</view>
<block wx:elif="{{product.status === 3}}">
<view class="btn cancel">待开奖</view>
</block>
<block wx:elif="{{product.status === 4}}">
<view class="btn cancel">活动已结束</view>
</block>
<block wx:elif="{{product.status === 5}}">
<view class="btn cancel">人数不足 活动结束</view>
<view class="btn cancel">待开奖</view>
</block>
<block wx:else>
... ...
// page/subPackage/pages/zeroSell/detail.js
import ZeroSellService from './service/zero-sell'
import CommonService from './service/common'
import {
... ... @@ -31,18 +29,10 @@ const ACTIVITY = {
READY: 1, // 活动未开始
START: 2, // 活动开始
END: 3, // 活动结束
LUCK: 4, // 抽奖结束
LUCK: 4, // 活动已开奖、抽奖结束
END_LESS_PEOPLE: 5 // 人数不足
}
const STEP = {
ZERO: 0,
FIRST: 1,
SECOND: 2,
THIRD: 3,
FOURTH: 4,
}
const ACTION_BAR_STATUS = {
UNKNOWN: 0,
READY: 1, // 未开始
... ... @@ -51,6 +41,7 @@ const ACTION_BAR_STATUS = {
WAIT: 4, // 等待抽奖中
LUCK: 5, // 抽奖结束
END: 6, // 活动结束
PEOPLE_LIMIT_WAIT: 7 // 人数达到活动限制、已满员、人数不足统一为待开奖状态
}
let app = getApp();
... ... @@ -66,12 +57,10 @@ Page(Object.assign({
actPrizeId: '',
shareUid: 0,
scene: '',
participantCount: 0,
myPrizeCount: 0,
product: {},
avatars: [],
recommends: [],
step: STEP.ZERO,
actionStatus: ACTION_BAR_STATUS.UNKNOWN,
snapData: {},
hasUnionID: false,
... ... @@ -346,8 +335,6 @@ Page(Object.assign({
product_qrCode: qrcode
};
let participantCount = r1.code === 200 ? r1.data.joinNum : 0;
this.setData({
product: product,
recommends: r2.code === 200 ? r2.data : [],
... ... @@ -358,14 +345,12 @@ Page(Object.assign({
}),
myPrizeCount: r1.code === 200 ? r1.data.myCodeNum : 0,
participantCount,
snapData,
notice: JSON.parse(product.notice || '{}'),
lottery: JSON.parse(product.lottery_info || '{}')
});
this._setActionStatus();
this._setStep();
} else {
return Promise.reject();
}
... ... @@ -383,40 +368,6 @@ Page(Object.assign({
})
})
},
_setStep() {
let step = STEP.ZERO;
let activityStatus = this.data.product.status;
let myPrizeCount = this.data.myPrizeCount;
if (myPrizeCount === 0) {
step = STEP.ZERO
} else {
if (activityStatus === ACTIVITY.START) {
let myPrizeCount = this.data.myPrizeCount;
if (myPrizeCount === 0) {
step = STEP.ZERO;
} else if (myPrizeCount === 1) {
step = STEP.FIRST;
} else if (myPrizeCount >= 2) {
step = STEP.SECOND;
} else {
step = STEP.ZERO;
}
} else if (activityStatus === ACTIVITY.END || activityStatus === ACTIVITY.LUCK) {
step = STEP.THIRD;
} else if (activityStatus === ACTIVITY.END_LESS_PEOPLE) {
step = STEP.FOURTH;
} else {
step = STEP.ZERO;
}
}
this.setData({
step: step
});
},
_setActionStatus() {
let status = ACTION_BAR_STATUS.START;
let activityStatus = this.data.product.status;
... ... @@ -425,15 +376,25 @@ Page(Object.assign({
status = ACTION_BAR_STATUS.END;
} else if (activityStatus === ACTIVITY.READY) {
status = ACTION_BAR_STATUS.READY;
} else if (activityStatus >= ACTIVITY.END) {
}
else if (activityStatus >= ACTIVITY.END) {
if (this._isInActivity()) {
if (activityStatus === ACTIVITY.LUCK) {
status = ACTION_BAR_STATUS.LUCK;
} else {
}
else if (activityStatus === ACTIVITY.END_LESS_PEOPLE || activityStatus === ACTIVITY.END) {
status = ACTION_BAR_STATUS.WAIT;
}
else {
status = ACTION_BAR_STATUS.WAIT;
}
} else {
status = ACTION_BAR_STATUS.END;
if (activityStatus === ACTIVITY.END_LESS_PEOPLE || activityStatus === ACTIVITY.END) {
status = ACTION_BAR_STATUS.PEOPLE_LIMIT_WAIT;
} else {
status = ACTION_BAR_STATUS.END;
}
}
} else {
if (this._isInActivity()) {
... ... @@ -586,7 +547,6 @@ Page(Object.assign({
var that = this;
if (e.detail.errMsg === 'getPhoneNumber:ok') {
decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) {
// console.log('!!!!result',result)
if (result.code != 200) {
that.wetoast.toast({
title: result.message,
... ...
... ... @@ -4,7 +4,6 @@
"usingComponents": {
"product-item": "./components/product-item",
"product-header": "./components/product-detail-header",
"counter": "./components/head-counter",
"prize-progress": "./components/prize-progress",
"more": "./components/more",
"desc": "./components/desc",
... ...
... ... @@ -2,10 +2,6 @@
<product-header product="{{product}}" shareFlag="{{shareFlag}}" avatars="{{avatars}}"></product-header>
</view>
<block wx:if="{{false}}">
<counter count="{{participantCount}}" num="{{product.limit}}" status="{{product.status}}"></counter>
<prize-progress step="{{step}}"></prize-progress>
</block>
<view class="machine {{shareFlag ? 'machine-t-m' : 'machine-t-l'}}">
<view class="open-shadow"></view>
<view class="code-list" animation="{{animation}}">
... ... @@ -64,16 +60,20 @@
<view class="action-item action-list" bindtap="goList">
<image class="action-image" src="./images/list_icon@2x.png"></image>
</view>
<block wx:if="{{product.status === 1 || product.status === 2}}">
<block wx:if="{{product.status === 1}}">
<button class="action-item over" bindtap="goLogin">即将开始</button>
</block>
<block wx:if="{{product.status === 2}}">
<button class="action-item confirm" bindtap="goLogin">0元参加抽奖</button>
</block>
</block>
<block wx:else>
<view class="action-item over">活动已结束</view>
<block wx:if="{{product.status === 1}}">
<button class="action-item over" bindtap="goLogin">即将开始</button>
</block>
<block wx:if="{{product.status === 2}}">
<button class="action-item confirm" bindtap="goLogin">0元参加抽奖</button>
</block>
<block wx:if="{{product.status === 3}}">
<button class="action-item over" bindtap="goLogin">待开奖</button>
</block>
<block wx:if="{{product.status === 4}}">
<button class="action-item over" bindtap="goLogin">活动已结束</button>
</block>
<block wx:if="{{product.status === 5}}">
<button class="action-item over" bindtap="goLogin">待开奖</button>
</block>
</view>
</block>
... ...
... ... @@ -312,6 +312,7 @@ Page(Object.assign({
let oldData = my_zero_list[type].data;
let key = `my_zero_list[${type}].data`;
let keyPage = `my_zero_list[${type}].page`;
page = page + 1;
this.service.getMyList({type, page}).then(res => {
let data = []
if (res && res.code === 200) {
... ... @@ -319,7 +320,7 @@ Page(Object.assign({
}
this.setData({
[key]: oldData.concat(data),
[keyPage]: ++page
[keyPage]: page
})
if (data.length === 0) {
this.setData({
... ...