Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
zhwy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dadb1e91
authored
Jan 17, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改问卷红包
1 parent
1e158eb2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
56 deletions
api/module/questionnaire.js
api/module/solitaire.js
packageActivity/pages/solitaire/components/solitairePopup/solitairePopup.wxml
packageActivity/pages/solitaire/index/index.js
packageMine/pages/questionnaire/components/Finish/Finish.js
api/module/questionnaire.js
View file @
dadb1e9
...
@@ -24,7 +24,8 @@ module.exports = {
...
@@ -24,7 +24,8 @@ module.exports = {
*/
*/
receiveQuestionnaireRedEnvelope
(
data
=
{})
{
receiveQuestionnaireRedEnvelope
(
data
=
{})
{
return
api
.
post
({
return
api
.
post
({
method
:
'marketing.api.activityRedEnvelope.questionnaire.binding'
,
// method: 'marketing.api.activityRedEnvelope.questionnaire.binding',
method
:
'marketing.api.self.red.envelope.banding.link'
,
projectName
,
projectName
,
...
data
...
data
})
})
...
...
api/module/solitaire.js
View file @
dadb1e9
...
@@ -37,7 +37,7 @@ module.exports = {
...
@@ -37,7 +37,7 @@ module.exports = {
method
:
'marketing.api.activityRedEnvelope.relay.lottery.user.commit'
,
method
:
'marketing.api.activityRedEnvelope.relay.lottery.user.commit'
,
projectName
,
projectName
,
...
data
...
data
})
}
,
true
)
},
},
/**分页获取用户红包中奖记录 */
/**分页获取用户红包中奖记录 */
...
@@ -65,5 +65,13 @@ module.exports = {
...
@@ -65,5 +65,13 @@ module.exports = {
projectName
,
projectName
,
...
data
...
data
},
true
)
},
true
)
}
},
getActivityRedEnvelopeDetail
(
data
=
{})
{
return
api
.
post
({
method
:
'marketing.api.activityRedEnvelope.findOne'
,
projectName
,
...
data
})
},
//
}
}
\ No newline at end of file
\ No newline at end of file
packageActivity/pages/solitaire/components/solitairePopup/solitairePopup.wxml
View file @
dadb1e9
...
@@ -4,19 +4,23 @@
...
@@ -4,19 +4,23 @@
<view class="bg">
<view class="bg">
<glsx-image src="activity/{{popupConfig.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="{{popupConfig.t
ype == 1
}}">
<block wx:if="{{popupConfig.t
itle
}}">
<view class="title">{{popupConfig.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="{{popupConfig.
type == 1
}}">
<block wx:if="{{popupConfig.
showDefault
}}">
<view class="text">很遗憾您未参加此次接龙!敬请期待下次活动!</view>
<view class="text">很遗憾您未参加此次接龙!敬请期待下次活动!</view>
</block>
</block>
<block wx:else>
<block wx:else>
<block wx:if="{{popupConfig.numWin}}">
<view class="text">本次开奖数字为:{{popupConfig.numWin}}</view>
<view class="text">本次开奖数字为:{{popupConfig.numWin}}</view>
</block>
<block wx:if="{{popupConfig.relayContent}}">
<view class="text">您选择的数字为:{{popupConfig.relayContent}}</view>
<view class="text">您选择的数字为:{{popupConfig.relayContent}}</view>
</block>
</block>
</block>
<view class="btn" bindtap="close">好的</view>
<view class="btn" bindtap="close">好的</view>
</view>
</view>
</view>
</view>
...
...
packageActivity/pages/solitaire/index/index.js
View file @
dadb1e9
...
@@ -18,11 +18,7 @@ Page({
...
@@ -18,11 +18,7 @@ Page({
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{},
this
.
setData
({
popupTitle
:
'接龙时间已截止!'
})
},
/**
/**
...
@@ -100,41 +96,37 @@ Page({
...
@@ -100,41 +96,37 @@ Page({
openId
,
openId
,
unionId
unionId
})
})
if
(
code
==
0
)
{
this
.
getSolitaireDetail
(
params
)
this
.
getSolitaireDetail
(
params
)
if
(
code
==
0
)
{
if
(
data
)
{
if
(
data
)
{
/**
/**
* stateCode 状态码 -1.未参与 0.已参加 1.未中奖 2.已中奖
* stateCode 状态码 -1.未参与 0.已参加 1.未中奖 2.已中奖
* relayContent 接龙内容
* relayContent 接龙内容
*/
*/
if
(
data
.
stateCode
==
1
)
this
.
setData
({
const
{
stateCode
,
stateName
,
relayContent
}
=
data
if
(
stateCode
==
0
)
this
.
setData
({
[
'popupConfig.type'
]:
1
,
[
'popupConfig.title'
]:
stateName
,
[
'popupConfig.relayContent'
]:
relayContent
,
})
if
(
stateCode
==
1
)
this
.
setData
({
[
'popupConfig.type'
]:
2
,
[
'popupConfig.type'
]:
2
,
[
'popupConfig.relayContent'
]:
data
.
relayContent
,
[
'popupConfig.relayContent'
]:
relayContent
,
show
:
true
,
})
disabled
:
true
,
if
(
stateCode
==
0
||
stateCode
==
1
)
this
.
setData
({
show
:
true
})
if
(
stateCode
==
1
||
stateCode
==
2
)
this
.
setData
({
disabled
:
true
})
})
// const {
// relayContent,
// stateCode,
// stateName
// } = data
// this.setData({
// finishObject: data
// })
}
}
}
else
throw
message
}
else
throw
message
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
this
.
showGroupNoAccess
(
error
)
wx
.
showModal
({
title
:
'温馨提示'
,
content
:
error
,
showCancel
:
false
,
confirmText
:
'返回首页'
,
confirmColor
:
'#3772EC'
,
complete
:
(
res
)
=>
{
if
(
res
.
confirm
)
wx
.
p
.
router
.
goHome
()
}
})
}
}
},
},
async
getSolitaireDetail
(
params
)
{
async
getSolitaireDetail
(
params
)
{
...
@@ -145,18 +137,15 @@ Page({
...
@@ -145,18 +137,15 @@ Page({
const
{
const
{
chatId
chatId
}
=
this
.
options
}
=
this
.
options
if
(
!
chatId
)
this
.
showGroupNoAccess
()
if
(
!
chatId
)
this
.
showGroupNoAccess
(
'此群无法参加接龙游戏'
)
else
{
// res.groupLimitList.map(e => {
// // if () this.showGroupNoAccess()
// })
}
}
}
this
.
setData
({
this
.
setData
({
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
,
})
if
(
new
Date
(
wx
.
p
.
format
.
iosTimeFormat
(
res
.
lotteryTime
)).
getTime
()
<=
Date
.
now
())
this
.
setData
({
[
'popupConfig.numWin'
]:
res
.
numWin
[
'popupConfig.numWin'
]:
res
.
numWin
})
})
wx
.
p
.
wxApi
.
hideLoading
()
wx
.
p
.
wxApi
.
hideLoading
()
...
@@ -171,10 +160,11 @@ Page({
...
@@ -171,10 +160,11 @@ Page({
if
(
error
)
wx
.
p
.
wxApi
.
showToast
(
error
)
if
(
error
)
wx
.
p
.
wxApi
.
showToast
(
error
)
}
}
},
},
showGroupNoAccess
()
{
showGroupNoAccess
(
title
)
{
this
.
setData
({
this
.
setData
({
[
'popupConfig.type'
]:
1
,
[
'popupConfig.type'
]:
1
,
[
'popupConfig.title'
]:
'此群无法进行接龙游戏!'
,
[
'popupConfig.title'
]:
title
,
[
'popupConfig.showDefault'
]:
true
,
show
:
true
,
show
:
true
,
disabled
:
true
disabled
:
true
})
})
...
@@ -208,19 +198,28 @@ Page({
...
@@ -208,19 +198,28 @@ Page({
if
(
!
params
.
name
)
throw
'请输入名称!'
if
(
!
params
.
name
)
throw
'请输入名称!'
if
(
!
params
.
num
)
throw
'请选择数字!'
if
(
!
params
.
num
)
throw
'请选择数字!'
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
const
res
=
await
wx
.
p
.
api
.
solitaireApi
.
commitSolitaire
({
const
{
code
,
data
,
message
}
=
await
wx
.
p
.
api
.
solitaireApi
.
commitSolitaire
({
relayLotteryId
,
relayLotteryId
,
name
:
params
.
name
,
name
:
params
.
name
,
phone
:
userInfo
.
phone
,
openId
:
userInfo
.
openId
,
unionId
:
userInfo
.
unionId
,
relayContent
:
params
.
num
,
relayContent
:
params
.
num
,
chatId
})
})
wx
.
hideLoading
()
if
(
code
==
0
)
{
if
(
data
)
{
wx
.
p
.
wxApi
.
showToast
(
'提交成功!'
)
wx
.
p
.
wxApi
.
showToast
(
'提交成功!'
)
// this.getSolitaireDetail()
this
.
getSolitaireDetail
({
console
.
log
(
res
)
relayLotteryId
})
}
else
throw
message
}
else
this
.
setData
({
show
:
true
})
}
catch
(
error
)
{
}
catch
(
error
)
{
wx
.
hideLoading
()
if
(
error
)
wx
.
p
.
wxApi
.
showToast
(
error
)
if
(
error
)
wx
.
p
.
wxApi
.
showToast
(
error
)
}
}
},
},
...
...
packageMine/pages/questionnaire/components/Finish/Finish.js
View file @
dadb1e9
...
@@ -27,21 +27,42 @@ Component({
...
@@ -27,21 +27,42 @@ Component({
}
}
if
(
data
.
activityType
==
3
)
{
if
(
data
.
activityType
==
3
)
{
const
{
const
{
sourceType
}
=
await
wx
.
p
.
api
.
solitaireApi
.
getActivityRedEnvelopeDetail
({
id
:
data
.
activityId
})
/**sourceType 0-自研,1-外采 */
if
(
sourceType
==
1
)
{
const
{
userInfo
userInfo
}
=
wx
.
p
.
router
.
getPageInstance
().
data
}
=
wx
.
p
.
router
.
getPageInstance
().
data
,
const
res
=
await
wx
.
p
.
api
.
questionnaireApi
.
receiveQuestionnaireRedEnvelope
({
res
=
await
wx
.
p
.
api
.
questionnaireApi
.
receiveQuestionnaireRedEnvelope
({
questionnaireId
:
data
.
id
,
activityId
:
data
.
activityId
,
activityRedEnvelopeId
:
data
.
activityId
,
bindingSource
:
1
,
nickName
:
userInfo
.
nickName
wechatName
:
userInfo
.
nickName
,
businessId
:
data
.
id
})
})
if
(
res
.
isActivityRedEnvelopeFlag
&&
!
res
.
isReceiveFlag
)
this
.
setData
({
this
.
setData
({
jumpOption
:
{
jumpOption
:
{
url
:
res
.
activityRedEnvelopeL
ink
,
url
:
res
.
l
ink
,
type
:
data
.
activityType
type
:
data
.
activityType
}
}
})
})
this
.
countDown
()
this
.
countDown
()
}
else
{
}
else
{
this
.
setData
({
jumpOption
:
{
url
:
'/packageActivity/pages/redEnvelope/index/index'
,
type
:
1
,
options
:
{
activityId
:
data
.
activityId
,
merchantId
:
data
.
merchantId
}
}
})
this
.
countDown
()
}
}
else
{
if
(
data
.
activityType
==
2
)
{
if
(
data
.
activityType
==
2
)
{
options
.
couponId
=
data
.
activityId
options
.
couponId
=
data
.
activityId
url
=
'/packageMall/pages/coupon/coupon'
url
=
'/packageMall/pages/coupon/coupon'
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment