|
|
@@ -142,7 +142,6 @@
|
|
|
.award_ac {
|
|
|
width: 58px;
|
|
|
height: 58px;
|
|
|
- background: #F5E3D4;
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
|
|
|
@@ -242,11 +241,11 @@
|
|
|
<div id="box" class="box">
|
|
|
<div class="page6">
|
|
|
<img class="wl_no" v-if="!lightData.wxcpLightenClientList.length" src="./img/wl_no.png" />
|
|
|
- <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 1" src="./img/light_one.png" />
|
|
|
- <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 2" src="./img/light_two.png" />
|
|
|
- <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 3" src="./img/light_three.png" />
|
|
|
- <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 4" src="./img/light_four.png" />
|
|
|
- <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 5" src="./img/light_five.png" />
|
|
|
+ <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length === 1" src="./img/light_one.png" />
|
|
|
+ <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length === 2" src="./img/light_two.png" />
|
|
|
+ <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length === 3" src="./img/light_three.png" />
|
|
|
+ <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length === 4" src="./img/light_four.png" />
|
|
|
+ <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length === 5" src="./img/light_five.png" />
|
|
|
<div class="wl_btn" @click="handleAsk">
|
|
|
<div class="image_wrapper">
|
|
|
<img class="btn_img" src="./img/wl_btn.png" />
|
|
|
@@ -263,16 +262,16 @@
|
|
|
<span>3.完成任务</span>
|
|
|
</div>
|
|
|
<div class="ask_btn">
|
|
|
- <img v-for="(item, index) in lightData.wxcpLightenClientList" :key="index" :src="item.head || require('img/ask_btn.png')" />
|
|
|
+ <img v-for="item in lightData.wxcpLightenClientList" :key="item.head.id" :src="item.head || require('img/ask_btn.png')" />
|
|
|
<img v-for="i in (5-lightData.wxcpLightenClientList.length)" :key="i" src="img/ask_btn.png" />
|
|
|
</div>
|
|
|
<div class="activity_box">
|
|
|
<div class="lottery">
|
|
|
<div class="award">
|
|
|
- <div class="award_ac"></div>
|
|
|
+ <img class="award_ac" src="img/lottery1.png" />
|
|
|
<div class="award_tip">
|
|
|
<div class="award_title">好运抽奖</div>
|
|
|
- <div>每邀请1人点亮即可抽奖1次</div>
|
|
|
+ <div>每邀请{{lightData.wxcpLighten.raffle1ClientNum}}人点亮即可抽奖{{lightData.wxcpLighten.raffle1NumMax}}次</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div :class="lightData.raffle1Num ? 'award_btn_ac' : 'award_btn'" @click="handleLottery(lightData.raffle1BizId, lightData.raffle1Num)">{{lightData.raffle1Num ? '去抽奖' : '未完成'}}
|
|
|
@@ -280,7 +279,7 @@
|
|
|
</div>
|
|
|
<div class="lottery">
|
|
|
<div class="award">
|
|
|
- <div class="award_ac"></div>
|
|
|
+ <img class="award_ac" src="img/lottery2.png" />
|
|
|
<div class="award_tip">
|
|
|
<div class="award_title">终极大奖</div>
|
|
|
<div>完全点亮即可抽取终极大奖!</div>
|
|
|
@@ -297,7 +296,7 @@
|
|
|
<div class="prize_dialog" v-if="showAskDialog">
|
|
|
<div class="dialog_body">
|
|
|
<img class="dialog_bg" :src="lightData.urlPost" />
|
|
|
- <div class="save_btn" @click="saveImage">保存图片</div>
|
|
|
+ <div class="save_btn" @click="showAskDialog = false">长按图片保存</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -316,6 +315,8 @@
|
|
|
wxcpLightenClientList: [],
|
|
|
wxcpLighten: {
|
|
|
activityInfo: '',
|
|
|
+ raffle1ClientNum: null,
|
|
|
+ raffle1NumMax: null,
|
|
|
},
|
|
|
raffle1Num: 0,
|
|
|
raffle2Num: 0,
|
|
|
@@ -352,15 +353,18 @@
|
|
|
// 获取url上的code
|
|
|
let code = this.getQueryParam('code')
|
|
|
if (code) {
|
|
|
- fetch(this.httpUrl + `/scrm/v1/mp-client/p/getInfoByh5Code?code=${code}&bId=${this.bId}`)
|
|
|
+ // 判断业务id是否生产环境业务id
|
|
|
+ fetch(this.httpUrl + `/p/insuite/p/isProdId?id=${this.bId}`)
|
|
|
.then(res => {
|
|
|
return res.json()
|
|
|
}).then(result => {
|
|
|
- let { data, code, msg } = result
|
|
|
- if (code === 1) {
|
|
|
- localStorage.setItem('openId', data.openId)
|
|
|
- this.ifH5Type()
|
|
|
+ let { data, msg } = result
|
|
|
+ if (typeof data === 'boolean' && data) {
|
|
|
+ this.httpUrl = 'https://wlapi.wefanbot.com'
|
|
|
+ } else {
|
|
|
+ this.httpUrl = 'http://test.wefanbot.com:18993'
|
|
|
}
|
|
|
+ this.getInfoByh5Code(this.getQueryParam('code'))
|
|
|
})
|
|
|
} else {
|
|
|
let redirect_uri = window.location.href
|
|
|
@@ -369,6 +373,18 @@
|
|
|
window.location.replace(url)
|
|
|
}
|
|
|
},
|
|
|
+ getInfoByh5Code(code) {
|
|
|
+ fetch(this.httpUrl + `/scrm/v1/mp-client/p/getInfoByh5Code?code=${code}&bId=${this.bId}`)
|
|
|
+ .then(res => {
|
|
|
+ return res.json()
|
|
|
+ }).then(result => {
|
|
|
+ let { data, code, msg } = result
|
|
|
+ if (code === 1) {
|
|
|
+ localStorage.setItem('openId', data.openId)
|
|
|
+ this.ifH5Type()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 企微授权
|
|
|
gerQwAuth (bId) {
|
|
|
let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
|
|
|
@@ -401,7 +417,7 @@
|
|
|
}).then(result => {
|
|
|
let { data, code, msg } = result
|
|
|
if (code === 1) {
|
|
|
- this.lightData = data
|
|
|
+ this.lightData = data
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: msg,
|
|
|
@@ -418,23 +434,13 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- // 保存图片
|
|
|
- saveImage () {
|
|
|
- const link = document.createElement('a')
|
|
|
- link.href = this.lightData.urlPost
|
|
|
- link.download = 'urlPost.jpg'
|
|
|
- document.body.appendChild(link);
|
|
|
- link.click();
|
|
|
- document.body.removeChild(link);
|
|
|
- this.showAskDialog = false
|
|
|
- },
|
|
|
handleLottery (bizId, status) {
|
|
|
if (status) {
|
|
|
let url = ''
|
|
|
if (!this.env || this.env === 'prod') {
|
|
|
- url = `https://lottery.camlook.cn/?bId=${bizId}&env=dev&h5Type=30`
|
|
|
- } else {
|
|
|
url = `https://lottery.camlook.cn/?bId=${bizId}&h5Type=30`
|
|
|
+ } else {
|
|
|
+ url = `https://lottery.camlook.cn/?bId=${bizId}&env=dev&h5Type=30`
|
|
|
}
|
|
|
window.location.replace(url)
|
|
|
} else {
|