|
@@ -33,8 +33,7 @@
|
|
|
.page6 {
|
|
.page6 {
|
|
|
width: 100vw;
|
|
width: 100vw;
|
|
|
height: 100vh;
|
|
height: 100vh;
|
|
|
- background: #FFD0D0;
|
|
|
|
|
- background-size: 100vw 100vh;
|
|
|
|
|
|
|
+ background-size: 100vw 200px;
|
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
@@ -271,7 +270,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="page6" v-else>
|
|
|
|
|
|
|
+ <div class="page6" :style="{'background-image': 'url('+toshopData.banner+')'}" v-else-if="step === 1 || step === 2">
|
|
|
<div class="activity_content" v-if="step === 1">
|
|
<div class="activity_content" v-if="step === 1">
|
|
|
<div class="activity_item">
|
|
<div class="activity_item">
|
|
|
<div class="item_title">活动主题:</div>
|
|
<div class="item_title">活动主题:</div>
|
|
@@ -300,6 +299,7 @@
|
|
|
<el-date-picker v-if="item.type === 5" v-model="item.value" type="date" placeholder="选择日期">
|
|
<el-date-picker v-if="item.type === 5" v-model="item.value" type="date" placeholder="选择日期">
|
|
|
<el-time-picker v-if="item.type === 6" v-model="item.value" placeholder="请选择"></el-time-picker>
|
|
<el-time-picker v-if="item.type === 6" v-model="item.value" placeholder="请选择"></el-time-picker>
|
|
|
<el-date-picker v-if="item.type === 7" v-model="item.value" type="datetime" placeholder="选择日期时间"></el-date-picker>
|
|
<el-date-picker v-if="item.type === 7" v-model="item.value" type="datetime" placeholder="选择日期时间"></el-date-picker>
|
|
|
|
|
+ <el-cascader v-if="item.type === 10" v-model="item.value" :options="transformedData"></el-cascader>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
@@ -317,8 +317,8 @@
|
|
|
httpUrl: '',
|
|
httpUrl: '',
|
|
|
bId: null,
|
|
bId: null,
|
|
|
env: '',
|
|
env: '',
|
|
|
- openId: '',
|
|
|
|
|
toshopData: {
|
|
toshopData: {
|
|
|
|
|
+ banner: '',
|
|
|
name: '',
|
|
name: '',
|
|
|
target: '',
|
|
target: '',
|
|
|
startTime: '',
|
|
startTime: '',
|
|
@@ -328,6 +328,7 @@
|
|
|
},
|
|
},
|
|
|
step: 2,
|
|
step: 2,
|
|
|
verificationCode: '',
|
|
verificationCode: '',
|
|
|
|
|
+ transformedData: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -346,6 +347,7 @@
|
|
|
if (!this.getQueryParam('externalUserid')) {
|
|
if (!this.getQueryParam('externalUserid')) {
|
|
|
this.gerQwAuth(this.bId);
|
|
this.gerQwAuth(this.bId);
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ this.getCityLevel()
|
|
|
this.lightenShare()
|
|
this.lightenShare()
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -357,16 +359,18 @@
|
|
|
// 获取url上的code
|
|
// 获取url上的code
|
|
|
let code = this.getQueryParam('code')
|
|
let code = this.getQueryParam('code')
|
|
|
if (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 => {
|
|
.then(res => {
|
|
|
return res.json()
|
|
return res.json()
|
|
|
}).then(result => {
|
|
}).then(result => {
|
|
|
- let { data, code, msg } = result
|
|
|
|
|
- if (code === 1) {
|
|
|
|
|
- this.openId = data.openId
|
|
|
|
|
- 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 {
|
|
} else {
|
|
|
let redirect_uri = window.location.href
|
|
let redirect_uri = window.location.href
|
|
@@ -375,6 +379,18 @@
|
|
|
window.location.replace(url)
|
|
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) {
|
|
gerQwAuth(bId) {
|
|
|
let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
|
|
let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
|
|
@@ -393,6 +409,33 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 获取城市数据
|
|
|
|
|
+ getCityLevel() {
|
|
|
|
|
+ fetch('https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/1000/1720161853377/pc-code.json')
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ return res.json()
|
|
|
|
|
+ }).then(result => {
|
|
|
|
|
+ this.transformedData = this.transformData(result)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 省市数据做转换
|
|
|
|
|
+ transformData(data) {
|
|
|
|
|
+ return data.map(item => {
|
|
|
|
|
+ // 创建一个新对象,避免直接修改原始对象
|
|
|
|
|
+ const newItem = { ...item };
|
|
|
|
|
+ // 重命名 text 为 label
|
|
|
|
|
+ if (newItem.text) {
|
|
|
|
|
+ newItem.label = newItem.text;
|
|
|
|
|
+ newItem.value = newItem.text;
|
|
|
|
|
+ delete newItem.text;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果存在 children 数组,则递归处理每个子项
|
|
|
|
|
+ if (newItem.children && Array.isArray(newItem.children)) {
|
|
|
|
|
+ newItem.children = this.transformData(newItem.children);
|
|
|
|
|
+ }
|
|
|
|
|
+ return newItem;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
lightenShare() {
|
|
lightenShare() {
|
|
|
let externalUserid = this.getQueryParam('externalUserid')
|
|
let externalUserid = this.getQueryParam('externalUserid')
|
|
|
let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
|
|
let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
|
|
@@ -433,6 +476,15 @@
|
|
|
if (this.step === 1) {
|
|
if (this.step === 1) {
|
|
|
this.step = 2
|
|
this.step = 2
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ this.toshopData.formProList.forEach(item => {
|
|
|
|
|
+ if (item.isNeed && !item.value) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: '必填项不能为空',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ })
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
let cols = []
|
|
let cols = []
|
|
|
cols = this.toshopData.formProList.map(item => {
|
|
cols = this.toshopData.formProList.map(item => {
|
|
|
return {
|
|
return {
|
|
@@ -441,7 +493,8 @@
|
|
|
value: [item.value]
|
|
value: [item.value]
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- fetch(this.httpUrl + `/scrm/v1/wxcp-toshop-share/p/formData?openId=${this.openId}`, {
|
|
|
|
|
|
|
+ let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
|
|
|
|
|
+ fetch(this.httpUrl + `/scrm/v1/wxcp-toshop-share/p/formData?openId=${openId}`, {
|
|
|
method: 'post',
|
|
method: 'post',
|
|
|
body: JSON.stringify({
|
|
body: JSON.stringify({
|
|
|
bid: this.bId,
|
|
bid: this.bId,
|