Commit 19bc7c7d by 李伟康

提交接龙

1 parent dadb1e91
...@@ -24,7 +24,14 @@ module.exports = { ...@@ -24,7 +24,14 @@ module.exports = {
*/ */
receiveQuestionnaireRedEnvelope(data = {}) { receiveQuestionnaireRedEnvelope(data = {}) {
return api.post({ return api.post({
// method: 'marketing.api.activityRedEnvelope.questionnaire.binding', method: 'marketing.api.activityRedEnvelope.questionnaire.binding',
projectName,
...data
})
},
/**绑定红包 */
bindRedEnvelopeLink(data = {}) {
return api.post({
method: 'marketing.api.self.red.envelope.banding.link', method: 'marketing.api.self.red.envelope.banding.link',
projectName, projectName,
...data ...data
......
...@@ -45,7 +45,8 @@ Page({ ...@@ -45,7 +45,8 @@ Page({
userInfo userInfo
} = this.data, { } = this.data, {
activityId, activityId,
merchantId merchantId,
linkId
} = this.options, { } = this.options, {
sessionId sessionId
} = wx.p.storage.get() } = wx.p.storage.get()
...@@ -63,10 +64,12 @@ Page({ ...@@ -63,10 +64,12 @@ Page({
unionId, unionId,
openid, openid,
phone phone
})) })),
query = `activityId=${activityId}&merchantId=${merchantId}&sessionId=${sessionId}&userInfo=${user}`
if(linkId) query += `&linkId=${linkId}`
this.setData({ this.setData({
// url: `${domain}/scrm-wx-red-packet/#/redEnvelope?activityId=${activityId}&merchantId=${merchantId}&sessionId=${sessionId}&userInfo=${user}` //测试、预发布、生产 // url: `${domain}/scrm-wx-red-packet/#/redEnvelope?activityId=${activityId}&merchantId=${merchantId}&sessionId=${sessionId}&userInfo=${user}` //测试、预发布、生产
url: `${domain}/dj-scrm-wx-work-main-lwk/#/?activityId=${activityId}&merchantId=${merchantId}&sessionId=${sessionId}&userInfo=${user}` //开发环境 url: `${domain}/dj-scrm-wx-work-main-lwk/#/?${query}` //开发环境
}) })
} }
}, },
......
...@@ -38,7 +38,13 @@ Page({ ...@@ -38,7 +38,13 @@ Page({
if (options.isLogin) this.getGroupEnterInfo(options) if (options.isLogin) this.getGroupEnterInfo(options)
else this.jumpLoading() //直接打开时跳转、防止sessionId失效 else this.jumpLoading() //直接打开时跳转、防止sessionId失效
}, },
getGroupEnterInfo(options) { async getGroupEnterInfo(options) {
const res = await wx.p.router.intercept()
if (!res) {
const {
userInfo
} = this.data
if (!userInfo.nickName) return this.getNickNameAndHeadUrl()
try { try {
const _this = this const _this = this
wx.getGroupEnterInfo({ wx.getGroupEnterInfo({
...@@ -73,6 +79,7 @@ Page({ ...@@ -73,6 +79,7 @@ Page({
} catch (error) { } catch (error) {
if (error) wx.p.wxApi.showToast(error) if (error) wx.p.wxApi.showToast(error)
} }
}
}, },
/**获取用户接龙信息 */ /**获取用户接龙信息 */
async getSolitaireUserInfo(params) { async getSolitaireUserInfo(params) {
......
...@@ -203,6 +203,13 @@ Page({ ...@@ -203,6 +203,13 @@ Page({
} else { } else {
if (!data.isReceiveFlag) { if (!data.isReceiveFlag) {
/**用户是否已添加福利官 true:是;false:否; */ /**用户是否已添加福利官 true:是;false:否; */
// const {
// sourceType
// } = await wx.p.api.solitaireApi.getActivityRedEnvelopeDetail({
// id: equityFreeCardId
// })
// console.log(sourceType)
// /**sourceType 0-自研,1-外采 */
if (!data.isAddWelfareOfficerFlag) { if (!data.isAddWelfareOfficerFlag) {
wx.p.router.switchTab('/pages/tab/mine/index', { wx.p.router.switchTab('/pages/tab/mine/index', {
isMemberShow: true, isMemberShow: true,
......
...@@ -27,41 +27,47 @@ Component({ ...@@ -27,41 +27,47 @@ Component({
} }
if (data.activityType == 3) { if (data.activityType == 3) {
const { const {
userInfo
} = wx.p.router.getPageInstance().data
// const response = await wx.p.api.questionnaireApi.receiveQuestionnaireRedEnvelope({
// questionnaireId: data.id,
// activityRedEnvelopeId: data.activityId,
// nickName: userInfo.nickName
// })
// if (response.isActivityRedEnvelopeFlag && !response.isReceiveFlag) {
const {
sourceType sourceType
} = await wx.p.api.solitaireApi.getActivityRedEnvelopeDetail({ } = await wx.p.api.solitaireApi.getActivityRedEnvelopeDetail({
id: data.activityId id: data.activityId
}) }),
/**sourceType 0-自研,1-外采 */ /**sourceType 0-自研,1-外采 */
if (sourceType == 1) { res = await wx.p.api.questionnaireApi.bindRedEnvelopeLink({
const {
userInfo
} = wx.p.router.getPageInstance().data,
res = await wx.p.api.questionnaireApi.receiveQuestionnaireRedEnvelope({
activityId: data.activityId, activityId: data.activityId,
bindingSource: 1, bindingSource: 1,
wechatName: userInfo.nickName, wechatName: userInfo.nickName,
businessId: data.id businessId: data.id
}) })
if (sourceType == 1) {
this.setData({ this.setData({
jumpOption: { jumpOption: {
url: res.link, url: res.link,
type: data.activityType type: data.activityType
} }
}) })
this.countDown() } else this.setData({
} else {
this.setData({
jumpOption: { jumpOption: {
url: '/packageActivity/pages/redEnvelope/index/index', url: '/packageActivity/pages/redEnvelope/index/index',
type: 1, type: 1,
options: { options: {
activityId: data.activityId, activityId: data.activityId,
merchantId: data.merchantId merchantId: data.merchantId,
linkId: res.id
} }
} }
}) })
this.countDown() this.countDown()
} // } else this.countDown()
} else { } else {
if (data.activityType == 2) { if (data.activityType == 2) {
options.couponId = data.activityId options.couponId = data.activityId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!