Commit 30cc90a2 by test

素材字段变更调整

1 parent 3affafe9
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
const titleMap = { const titleMap = {
4: '文本', 4: '文本',
0: '图片', 0: '图片',
7: '图文', 8: '图文',
8: '小程序' 9: '小程序'
} }
return titleMap[this.type] || '素材' return titleMap[this.type] || '素材'
}, },
......
...@@ -122,15 +122,21 @@ ...@@ -122,15 +122,21 @@
<el-table-column prop="materialUrl" v-if="type == 0" label="图片地址"></el-table-column> <el-table-column prop="materialUrl" v-if="type == 0" label="图片地址"></el-table-column>
<!-- 图文 --> <!-- 图文 -->
<template v-if="type == 7"> <!-- <template v-if="type == 7">
<el-table-column prop="materialName" label="图片标题"></el-table-column> <el-table-column prop="materialName" label="图文标题"></el-table-column>
<el-table-column prop="content" label="图文链接"></el-table-column> <el-table-column prop="materialUrl" label="图文链接"></el-table-column>
</template> -->
<!-- 链接 -->
<template v-if="type == 8">
<el-table-column prop="materialName" label="图文标题"></el-table-column>
<el-table-column prop="materialUrl" label="图文链接"></el-table-column>
</template> </template>
<!-- 小程序 --> <!-- 小程序 -->
<template v-if="type == 8"> <template v-if="type == 9">
<el-table-column prop="materialName" label="小程序标题"></el-table-column> <el-table-column prop="materialName" label="小程序标题"></el-table-column>
<el-table-column prop="materialUrl" label="小程序AppID"></el-table-column> <el-table-column prop="digest" label="小程序AppID"></el-table-column>
</template> </template>
<el-table-column prop="updateTime" label="最近更新时间"></el-table-column> <el-table-column prop="updateTime" label="最近更新时间"></el-table-column>
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</el-form-item> </el-form-item>
</div> </div>
<!-- 图文 --> <!-- 图文 -->
<div class="my-cord" v-else-if="item.msgType == '7'"> <div class="my-cord" v-else-if="item.msgType == '8'">
<div class="operation"> <div class="operation">
<div v-if="showMorMaterial" class="algin" @click="onChooseMaterial(item.msgType, index)"> <div v-if="showMorMaterial" class="algin" @click="onChooseMaterial(item.msgType, index)">
<img style="margin-right: 3px" :src="require('@/assets/drainageCode/code-add.png')" alt="" />从素材中选择 <img style="margin-right: 3px" :src="require('@/assets/drainageCode/code-add.png')" alt="" />从素材中选择
...@@ -73,15 +73,15 @@ ...@@ -73,15 +73,15 @@
<el-form-item label="图文标题" style="width: 50%" required :error="item.materialNameError"> <el-form-item label="图文标题" style="width: 50%" required :error="item.materialNameError">
<el-input v-model="item.materialName" placeholder="请输入图文标题" maxlength="64" show-word-limit clearable></el-input> <el-input v-model="item.materialName" placeholder="请输入图文标题" maxlength="64" show-word-limit clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图文链接" style="width: 50%" required :error="item.contentError"> <el-form-item label="图文链接" style="width: 50%" required :error="item.materialUrlError">
<el-input v-model="item.content" placeholder="请输入图文链接"></el-input> <el-input v-model="item.materialUrl" placeholder="请输入图文链接"></el-input>
<div class="sub-des"> <div class="sub-des">
仅支持公众号图文链接,且必须以 http://或 https://开头 仅支持公众号图文链接,且必须以 http://或 https://开头
</div> </div>
</el-form-item> </el-form-item>
</div> </div>
<!-- 小程序 --> <!-- 小程序 -->
<div class="my-cord" v-else-if="item.msgType == '8'"> <div class="my-cord" v-else-if="item.msgType == '9'">
<div class="operation"> <div class="operation">
<div v-if="showMorMaterial" class="algin" @click="onChooseMaterial(item.msgType, index)"> <div v-if="showMorMaterial" class="algin" @click="onChooseMaterial(item.msgType, index)">
<img style="margin-right: 3px" :src="require('@/assets/drainageCode/code-add.png')" alt="" />从素材中选择 <img style="margin-right: 3px" :src="require('@/assets/drainageCode/code-add.png')" alt="" />从素材中选择
...@@ -93,14 +93,14 @@ ...@@ -93,14 +93,14 @@
<el-form-item label="小程序标题" style="width: 50%" required :error="item.materialNameError"> <el-form-item label="小程序标题" style="width: 50%" required :error="item.materialNameError">
<el-input v-model="item.materialName" placeholder="请输入小程序标题" maxlength="64" show-word-limit clearable></el-input> <el-input v-model="item.materialName" placeholder="请输入小程序标题" maxlength="64" show-word-limit clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="小程序AppID" style="width: 50%" required :error="item.materialUrlError"> <el-form-item label="小程序AppID" style="width: 50%" required :error="item.digestError">
<el-input v-model="item.materialUrl" placeholder="请输入小程序AppID"></el-input> <el-input v-model="item.digest" placeholder="请输入小程序AppID"></el-input>
<div class="sub-des"> <div class="sub-des">
必须是审核通过,正常发布,且关联到企业的小程序应用 必须是审核通过,正常发布,且关联到企业的小程序应用
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="小程序路径" style="width: 50%" required :error="item.contentError"> <el-form-item label="小程序路径" style="width: 50%" required :error="item.materialUrlError">
<el-input v-model="item.content" placeholder="请输入小程序路径"></el-input> <el-input v-model="item.materialUrl" placeholder="请输入小程序路径"></el-input>
<div class="sub-des">必须以 html 作为后缀</div> <div class="sub-des">必须以 html 作为后缀</div>
</el-form-item> </el-form-item>
<el-form-item label="小程序封面" required :error="item.coverUrlError"> <el-form-item label="小程序封面" required :error="item.coverUrlError">
...@@ -122,10 +122,10 @@ ...@@ -122,10 +122,10 @@
<el-dropdown-item :command="'0'" v-if="showType('0')"> <el-dropdown-item :command="'0'" v-if="showType('0')">
<el-button type="text">图片</el-button> <el-button type="text">图片</el-button>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="'7'" v-if="showType('7')"> <el-dropdown-item :command="'8'" v-if="showType('8')">
<el-button type="text">图文</el-button> <el-button type="text">图文</el-button>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="'8'" v-if="showType('8')"> <el-dropdown-item :command="'9'" v-if="showType('9')">
<el-button type="text">小程序</el-button> <el-button type="text">小程序</el-button>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
...@@ -380,32 +380,32 @@ ...@@ -380,32 +380,32 @@
errorMsg: '请上传图片' errorMsg: '请上传图片'
} }
], ],
'7': [ '8': [
{ {
checkField: 'materialName', checkField: 'materialName',
errorField: 'materialNameError', errorField: 'materialNameError',
errorMsg: '请输入图文标题' errorMsg: '请输入图文标题'
}, },
{ {
checkField: 'content', checkField: 'materialUrl',
errorField: 'contentError', errorField: 'materialUrlError',
errorMsg: '请输入图文链接' errorMsg: '请输入图文链接'
} }
], ],
'8': [ '9': [
{ {
checkField: 'materialName', checkField: 'materialName',
errorField: 'materialNameError', errorField: 'materialNameError',
errorMsg: '请输入小程序标题' errorMsg: '请输入小程序标题'
}, },
{ {
checkField: 'materialUrl', checkField: 'digest',
errorField: 'materialUrlError', errorField: 'digestError',
errorMsg: '请输入小程序AppID' errorMsg: '请输入小程序AppID'
}, },
{ {
checkField: 'content', checkField: 'materialUrl',
errorField: 'contentError', errorField: 'materialUrlError',
errorMsg: '请输入小程序路径' errorMsg: '请输入小程序路径'
}, },
{ {
...@@ -455,18 +455,18 @@ ...@@ -455,18 +455,18 @@
if (checkMaterialResult) { if (checkMaterialResult) {
let goto = true let goto = true
this.form.materialMsgList.forEach((dd) => { this.form.materialMsgList.forEach((dd) => {
if (dd.msgType === '7') { if (dd.msgType === '8') {
let reUrl = /(http|https):\/\/([\w.]+\/?)\S*/ let reUrl = /(http|https):\/\/([\w.]+\/?)\S*/
if (!reUrl.test(dd.content)) { if (!reUrl.test(dd.materialUrl)) {
goto = false goto = false
dd.contentError = '必须以 http://或 https://开头' dd.materialUrlError = '必须以 http://或 https://开头'
} }
} }
if (dd.msgType === '8') { if (dd.msgType === '9') {
let htm = /^.*html$/ let htm = /^.*html$/
if (!htm.test(dd.content)) { if (!htm.test(dd.materialUrl)) {
goto = false goto = false
dd.contentError = '必须以 html 作为后缀' dd.materialUrlError = '必须以 html 作为后缀'
} }
} }
}) })
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
<img :src="data.materialUrl" /> <img :src="data.materialUrl" />
</div> </div>
</div> </div>
<div class="msg" v-if="data.msgType === '7'"> <div class="msg" v-if="data.msgType === '8'">
<div class="word-and-image"> <div class="word-and-image">
<div> <div>
{{data.materialName}} {{data.materialName}}
</div> </div>
<div class="sub-content"> <div class="sub-content">
<div> <div>
{{data.digest}} <!-- {{data.materialUrl}} -->
</div> </div>
<div> <div>
<img src="../assets/drainageCode/default_icon.png" /> <img src="../assets/drainageCode/default_icon.png" />
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="msg" v-if="data.msgType === '8'"> <div class="msg" v-if="data.msgType === '9'">
<div class="miniprogram"> <div class="miniprogram">
<div class="mini-header"> <div class="mini-header">
<img src="../assets/drainageCode/miniprogram-icon.png" alt=""> {{data.materialName}} <img src="../assets/drainageCode/miniprogram-icon.png" alt=""> {{data.materialName}}
......
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
} }
this.materialData = { this.materialData = {
welcomeMsg: base.qrAttachments ? base.qrAttachments[0].content : '', welcomeMsg: base.qrAttachments ? base.qrAttachments[0].content : '',
materialMsgList: base.qrAttachments ? this.setEditList(base.qrAttachments.slice(1)) : [] materialMsgList: base.qrAttachments ? this.setEditList(base.qrAttachments) : []
} }
// this.materialData.materialMsgList.forEach(ddd => { // this.materialData.materialMsgList.forEach(ddd => {
// ddd.msgType = Number(ddd.msgType) // ddd.msgType = Number(ddd.msgType)
...@@ -515,18 +515,18 @@ ...@@ -515,18 +515,18 @@
arr.push(obj) arr.push(obj)
} else if (dd.msgType === 'link') { } else if (dd.msgType === 'link') {
let ob = { let ob = {
msgType: '7', msgType: '8',
materialName: dd.title, materialName: dd.title,
content: dd.linkUrl materialUrl: dd.linkUrl
} }
arr.push(ob) arr.push(ob)
} else if (dd.msgType === 'miniprogram') { } else if (dd.msgType === 'miniprogram') {
let ff = { let ff = {
msgType: '8', msgType: '9',
materialUrl: dd.appId, digest: dd.appId,
materialName: dd.title, materialName: dd.title,
coverUrl: dd.picUrl, coverUrl: dd.picUrl,
content: dd.linkUrl materialUrl: dd.linkUrl
} }
arr.push(ff) arr.push(ff)
} }
...@@ -642,20 +642,20 @@ ...@@ -642,20 +642,20 @@
picUrl: dd.materialUrl picUrl: dd.materialUrl
} }
arr.push(obj) arr.push(obj)
} else if (dd.msgType === '7') { } else if (dd.msgType === '8') {
let ob = { let ob = {
msgType: 'link', msgType: 'link',
title: dd.materialName, title: dd.materialName,
linkUrl: dd.content linkUrl: dd.materialUrl
} }
arr.push(ob) arr.push(ob)
} else if (dd.msgType === '8') { } else if (dd.msgType === '9') {
let ff = { let ff = {
msgType: 'miniprogram', msgType: 'miniprogram',
appId: dd.materialUrl, appId: dd.digest,
title: dd.materialName, title: dd.materialName,
picUrl: dd.coverUrl, picUrl: dd.coverUrl,
linkUrl: dd.content linkUrl: dd.materialUrl
} }
arr.push(ff) arr.push(ff)
} }
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
this.form = res.data this.form = res.data
if (this.form.qrAttachments && this.form.qrAttachments.length) { if (this.form.qrAttachments && this.form.qrAttachments.length) {
this.form.welcomeMsg = this.form.qrAttachments[0].content this.form.welcomeMsg = this.form.qrAttachments[0].content
this.form.materialMsgList = this.setEditList(this.form.qrAttachments.slice(1)) this.form.materialMsgList = this.setEditList(this.form.qrAttachments)
} }
this.form.qrUserInfos.forEach(dd => { this.form.qrUserInfos.forEach(dd => {
if (dd.workCycle) { if (dd.workCycle) {
...@@ -268,18 +268,18 @@ ...@@ -268,18 +268,18 @@
arr.push(obj) arr.push(obj)
} else if (dd.msgType === 'link') { } else if (dd.msgType === 'link') {
let ob = { let ob = {
msgType: '7', msgType: '8',
materialName: dd.title, materialName: dd.title,
content: dd.linkUrl materialUrl: dd.linkUrl
} }
arr.push(ob) arr.push(ob)
} else if (dd.msgType === 'miniprogram') { } else if (dd.msgType === 'miniprogram') {
let ff = { let ff = {
msgType: '8', msgType: '9',
materialUrl: dd.appId, digest: dd.appId,
materialName: dd.title, materialName: dd.title,
coverUrl: dd.picUrl, coverUrl: dd.picUrl,
content: dd.linkUrl materialUrl: dd.linkUrl
} }
arr.push(ff) arr.push(ff)
} }
......
...@@ -66,18 +66,18 @@ ...@@ -66,18 +66,18 @@
if (unit.msgType === '0') { if (unit.msgType === '0') {
img.push(unit.materialUrl) img.push(unit.materialUrl)
} }
if (unit.msgType === '7') { if (unit.msgType === '8') {
let obj = { let obj = {
imageTextTile: unit.materialName, imageTextTile: unit.materialName,
imageTextUrl: unit.content imageTextUrl: unit.materialUrl
} }
imgText.push(obj) imgText.push(obj)
} }
if (unit.msgType === '8') { if (unit.msgType === '9') {
let oob = { let oob = {
appTile: unit.materialName, appTile: unit.materialName,
appId: unit.materialUrl, appId: unit.digest,
appPath: unit.content, appPath: unit.materialUrl,
appPic: unit.coverUrl appPic: unit.coverUrl
} }
applet.push(oob) applet.push(oob)
...@@ -108,7 +108,6 @@ ...@@ -108,7 +108,6 @@
getData () { getData () {
// getPreview(this.form.id).then(({ data }) => { // getPreview(this.form.id).then(({ data }) => {
this.materialData = this.form this.materialData = this.form
console.log(this.materialData)
this.materialData.users = [] this.materialData.users = []
if (this.materialData.userIds) { if (this.materialData.userIds) {
let name = this.materialData.userNames.split(',') let name = this.materialData.userNames.split(',')
...@@ -120,7 +119,6 @@ ...@@ -120,7 +119,6 @@
this.materialData.users.push(obj) this.materialData.users.push(obj)
}) })
} }
console.log(this.materialData.users)
this.materialData.materialMsgList = [] this.materialData.materialMsgList = []
let img = [] let img = []
let imgText = [] let imgText = []
...@@ -138,8 +136,8 @@ ...@@ -138,8 +136,8 @@
this.form.imageText.forEach(dd => { this.form.imageText.forEach(dd => {
let obj = { let obj = {
materialName: dd.imageTextTile, materialName: dd.imageTextTile,
content: dd.imageTextUrl, materialUrl: dd.imageTextUrl,
msgType: '7' msgType: '8'
} }
imgText.push(obj) imgText.push(obj)
}) })
...@@ -148,10 +146,10 @@ ...@@ -148,10 +146,10 @@
this.form.applet.forEach(cc => { this.form.applet.forEach(cc => {
let obj = { let obj = {
materialName: cc.appTile, materialName: cc.appTile,
materialUrl: cc.appId, digest: cc.appId,
content: cc.appPath, materialUrl: cc.appPath,
coverUrl: cc.appPic, coverUrl: cc.appPic,
msgType: '8' msgType: '9'
} }
applet.push(obj) applet.push(obj)
}) })
......
...@@ -181,8 +181,8 @@ ...@@ -181,8 +181,8 @@
data.imageText.forEach(dd => { data.imageText.forEach(dd => {
let obj = { let obj = {
materialName: dd.imageTextTile, materialName: dd.imageTextTile,
content: dd.imageTextUrl, materialUrl: dd.imageTextUrl,
msgType: '7' msgType: '8'
} }
imgText.push(obj) imgText.push(obj)
}) })
...@@ -191,10 +191,10 @@ ...@@ -191,10 +191,10 @@
data.applet.forEach(cc => { data.applet.forEach(cc => {
let obj = { let obj = {
materialName: cc.appTile, materialName: cc.appTile,
materialUrl: cc.appId, digest: cc.appId,
content: cc.appPath, materialUrl: cc.appPath,
coverUrl: cc.appPic, coverUrl: cc.appPic,
msgType: '8' msgType: '9'
} }
applet.push(obj) applet.push(obj)
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!