|
@@ -468,6 +468,7 @@
|
|
|
httpUrl: '',
|
|
httpUrl: '',
|
|
|
bId: null,
|
|
bId: null,
|
|
|
env: '',
|
|
env: '',
|
|
|
|
|
+ h5Type: null,
|
|
|
albumData: null,
|
|
albumData: null,
|
|
|
memberId: null,
|
|
memberId: null,
|
|
|
tenancyId: null,
|
|
tenancyId: null,
|
|
@@ -527,12 +528,6 @@
|
|
|
created() {
|
|
created() {
|
|
|
this.bId = this.getQueryParam('bId')
|
|
this.bId = this.getQueryParam('bId')
|
|
|
this.env = this.getQueryParam('env')
|
|
this.env = this.getQueryParam('env')
|
|
|
- if (this.getQueryParam('contentType')) {
|
|
|
|
|
- this.contentType = Number(this.getQueryParam('contentType'))
|
|
|
|
|
- this.albumData = {
|
|
|
|
|
- id: this.getQueryParam('groupId')
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
if (!this.env || this.env === 'prod') {
|
|
if (!this.env || this.env === 'prod') {
|
|
|
this.httpUrl = 'https://wlapi.wefanbot.com'
|
|
this.httpUrl = 'https://wlapi.wefanbot.com'
|
|
|
} else {
|
|
} else {
|
|
@@ -541,6 +536,7 @@
|
|
|
if (this.getQueryParam('memberId')) {
|
|
if (this.getQueryParam('memberId')) {
|
|
|
// 已授权
|
|
// 已授权
|
|
|
this.memberId = this.getQueryParam('memberId')
|
|
this.memberId = this.getQueryParam('memberId')
|
|
|
|
|
+ this.h5Type = Number(this.getQueryParam('h5Type'))
|
|
|
this.getCpH5Login()
|
|
this.getCpH5Login()
|
|
|
} else {
|
|
} else {
|
|
|
// 授权
|
|
// 授权
|
|
@@ -557,10 +553,7 @@
|
|
|
if (code === 1) {
|
|
if (code === 1) {
|
|
|
window.location.replace(data)
|
|
window.location.replace(data)
|
|
|
} else {
|
|
} else {
|
|
|
- this.$message({
|
|
|
|
|
- message: msg,
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ vant.Toast.fail(msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -580,13 +573,36 @@
|
|
|
let { data, code, msg } = result
|
|
let { data, code, msg } = result
|
|
|
if (code === 1) {
|
|
if (code === 1) {
|
|
|
this.tenancyId = data.tenancyId
|
|
this.tenancyId = data.tenancyId
|
|
|
- this.getTreeData()
|
|
|
|
|
this.getQyWxSign()
|
|
this.getQyWxSign()
|
|
|
|
|
+ if (this.h5Type === 48) {
|
|
|
|
|
+ this.getBiz()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.getTreeData()
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
vant.Toast.fail(msg)
|
|
vant.Toast.fail(msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 获取特定的contentType和id
|
|
|
|
|
+ getBiz() {
|
|
|
|
|
+ fetch(this.httpUrl + `/p/insuite/p/getBiz?bid=${this.bId}`)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ return res.json()
|
|
|
|
|
+ }).then(result => {
|
|
|
|
|
+ let { data, code, msg } = result
|
|
|
|
|
+ if (code === 1) {
|
|
|
|
|
+ this.contentType = data.raffleType
|
|
|
|
|
+ this.albumData = {
|
|
|
|
|
+ id: data.businessId
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ vant.Toast.fail(msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.getTreeData()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
getQyWxSign() {
|
|
getQyWxSign() {
|
|
|
fetch(this.httpUrl + '/scrm/v1/wxcp-corp/p/getJsSDK', {
|
|
fetch(this.httpUrl + '/scrm/v1/wxcp-corp/p/getJsSDK', {
|
|
|
method: 'post',
|
|
method: 'post',
|
|
@@ -663,7 +679,7 @@
|
|
|
let { data, code, msg } = result
|
|
let { data, code, msg } = result
|
|
|
if (code === 1) {
|
|
if (code === 1) {
|
|
|
this.allTreeData = this.flattenTreeData(data, true)
|
|
this.allTreeData = this.flattenTreeData(data, true)
|
|
|
- if (this.getQueryParam('contentType')) {
|
|
|
|
|
|
|
+ if (this.h5Type === 48) {
|
|
|
this.getMaterData(this.albumData)
|
|
this.getMaterData(this.albumData)
|
|
|
} else {
|
|
} else {
|
|
|
this.treeData = data || []
|
|
this.treeData = data || []
|
|
@@ -673,11 +689,12 @@
|
|
|
}
|
|
}
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
|
|
+ this.h5Type = null // 重置h5Type
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handlePathClick (item) {
|
|
handlePathClick (item) {
|
|
|
// 找到目标元素的索引
|
|
// 找到目标元素的索引
|
|
|
- const index = this.pathList.findIndex(arr => arr.id === item.id)
|
|
|
|
|
|
|
+ const index = this.pathList.findIndex(arr => arr.id == item.id)
|
|
|
// 如果找到了该元素
|
|
// 如果找到了该元素
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
// 从该索引位置开始删除到数组末尾
|
|
// 从该索引位置开始删除到数组末尾
|
|
@@ -725,8 +742,8 @@
|
|
|
let { data, code, msg } = result
|
|
let { data, code, msg } = result
|
|
|
if (code === 1) {
|
|
if (code === 1) {
|
|
|
this.itemList = data.records || []
|
|
this.itemList = data.records || []
|
|
|
- if (this.keyword === '' && this.allTreeData.filter(all => all.id === item.id)[0] && this.allTreeData.filter(all => all.id === item.id)[0].children) {
|
|
|
|
|
- this.treeData = this.allTreeData.filter(all => all.id === item.id)[0].children
|
|
|
|
|
|
|
+ if (this.keyword === '' && this.allTreeData.filter(all => all.id == item.id)[0] && this.allTreeData.filter(all => all.id == item.id)[0].children) {
|
|
|
|
|
+ this.treeData = this.allTreeData.filter(all => all.id == item.id)[0].children
|
|
|
} else {
|
|
} else {
|
|
|
this.treeData = []
|
|
this.treeData = []
|
|
|
}
|
|
}
|
|
@@ -781,7 +798,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleVideoType () {
|
|
handleVideoType () {
|
|
|
- let obj = this.itemList.filter(item => item.id === this.materialData)[0]
|
|
|
|
|
|
|
+ let obj = this.itemList.filter(item => item.id == this.materialData)[0]
|
|
|
if (this.filterIndex === 0) {
|
|
if (this.filterIndex === 0) {
|
|
|
// 发送视频链接
|
|
// 发送视频链接
|
|
|
this.sendNews(obj)
|
|
this.sendNews(obj)
|
|
@@ -792,7 +809,7 @@
|
|
|
// 勾选图集项图片
|
|
// 勾选图集项图片
|
|
|
handleSelect(data) {
|
|
handleSelect(data) {
|
|
|
this.imgList.forEach(item => {
|
|
this.imgList.forEach(item => {
|
|
|
- if (item.id === data.id) {
|
|
|
|
|
|
|
+ if (item.id == data.id) {
|
|
|
this.$set(item, 'selected', true)
|
|
this.$set(item, 'selected', true)
|
|
|
} else {
|
|
} else {
|
|
|
this.$set(item, 'selected', false)
|
|
this.$set(item, 'selected', false)
|
|
@@ -807,7 +824,7 @@
|
|
|
},
|
|
},
|
|
|
// 点击图集类型
|
|
// 点击图集类型
|
|
|
handleImgType() {
|
|
handleImgType() {
|
|
|
- let obj = this.itemList.filter(item => item.id === this.materialData)[0]
|
|
|
|
|
|
|
+ let obj = this.itemList.filter(item => item.id == this.materialData)[0]
|
|
|
if (this.filterIndex === 0) {
|
|
if (this.filterIndex === 0) {
|
|
|
this.sendNews(obj)
|
|
this.sendNews(obj)
|
|
|
} else {
|
|
} else {
|
|
@@ -908,7 +925,7 @@
|
|
|
},
|
|
},
|
|
|
handleConfirm() {
|
|
handleConfirm() {
|
|
|
let obj = {}
|
|
let obj = {}
|
|
|
- obj = this.itemList.filter(item => item.id === this.materialData)[0]
|
|
|
|
|
|
|
+ obj = this.itemList.filter(item => item.id == this.materialData)[0]
|
|
|
// 文章,表单,外部链接, 视频链接
|
|
// 文章,表单,外部链接, 视频链接
|
|
|
if (this.contentType === 0 || this.contentType === 2 || this.contentType === 4 || this.contentType === 15) {
|
|
if (this.contentType === 0 || this.contentType === 2 || this.contentType === 4 || this.contentType === 15) {
|
|
|
this.sendNews(obj)
|
|
this.sendNews(obj)
|