Commit 1e158eb2 by 李伟康

提交

1 parent 978c07ef
......@@ -6,11 +6,9 @@ Component({
*/
properties: {
show: Boolean,
type: {
type: Number,
value: 2
},
title: String
popupConfig: {
type: Object
}
},
/**
......
......@@ -2,22 +2,22 @@
<view class="box">
<view class="content">
<view class="bg">
<glsx-image src="activity/{{type == 1?'default-bg':'expire-bg'}}.png"></glsx-image>
<glsx-image src="activity/{{popupConfig.type == 1?'default-bg':'expire-bg'}}.png"></glsx-image>
</view>
<block wx:if="{{type == 1}}">
<view class="title">{{title}}</view>
<block wx:if="{{popupConfig.type == 1}}">
<view class="title">{{popupConfig.title}}</view>
</block>
<block wx:else>
<view class="title"> 很遗憾您未中奖!敬请期待下次活动!</view>
</block>
<block wx:if="{{type == 1}}">
<block wx:if="{{popupConfig.type == 1}}">
<view class="text">很遗憾您未参加此次接龙!敬请期待下次活动!</view>
</block>
<block wx:else>
<view class="text">本次开奖数字为:3</view>
<view class="text">您选择的数字为:4</view>
<view class="text">本次开奖数字为:{{popupConfig.numWin}}</view>
<view class="text">您选择的数字为:{{popupConfig.relayContent}}</view>
</block>
<view class="btn" bindtap="close">好的</view>
<view class="btn" bindtap="close">好的</view>
</view>
</view>
</block>
\ No newline at end of file
......@@ -107,10 +107,11 @@ Page({
* stateCode 状态码 -1.未参与 0.已参加 1.未中奖 2.已中奖
* relayContent 接龙内容
*/
if(data.stateCode == 1) this.setData({
popupType: 2,
if (data.stateCode == 1) this.setData({
['popupConfig.type']: 2,
['popupConfig.relayContent']: data.relayContent,
show: true,
disabled: true
disabled: true,
})
// const {
// relayContent,
......@@ -140,20 +141,14 @@ Page({
try {
wx.p.wxApi.showLoading()
const res = await wx.p.api.solitaireApi.getSolitaireDetail(params)
res.groupLimitOpen = true
if (res.groupLimitOpen) {
const {
chatId
} = this.options
if (!chatId) this.setData({
popupType: 1,
popupTitle: '此群无法进行接龙游戏!',
show: true,
disabled: true
})
if (!chatId) this.showGroupNoAccess()
else {
// res.groupLimitList.map(e => {
// // if ()
// // if () this.showGroupNoAccess()
// })
}
}
......@@ -161,7 +156,8 @@ Page({
activityDetail: decodeURIComponent(res.description),
title: res.title,
array: generateOptionsArray(res.numLimit),
loading: true
loading: true,
['popupConfig.numWin']: res.numWin
})
wx.p.wxApi.hideLoading()
const {
......@@ -175,6 +171,14 @@ Page({
if (error) wx.p.wxApi.showToast(error)
}
},
showGroupNoAccess() {
this.setData({
['popupConfig.type']: 1,
['popupConfig.title']: '此群无法进行接龙游戏!',
show: true,
disabled: true
})
},
bindPickerChange(e) {
this.setData({
'params.num': this.data.array[e.detail.value]
......
......@@ -53,4 +53,4 @@
</view>
</block>
<solitaire-popup title="{{popupTitle}}" type="{{popupType}}" model:show="{{show}}"></solitaire-popup>
\ No newline at end of file
<solitaire-popup popupConfig="{{popupConfig}}" model:show="{{show}}"></solitaire-popup>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!