Commit 1e158eb2 by 李伟康

提交

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