Commit ad946ef8 by crushh

update: dist

parent 86f64531
......@@ -69,7 +69,7 @@
</el-popover>
<template v-if="wxaLinkFlag == 1">
<span class="line"></span>
<el-button type="text" @click="transferLink.show = true">插入小程序链接</el-button>
<el-button type="text" @click="transferLink.show = true">插入链接</el-button>
<!-- <el-button type="text" @click="reduceLink.show = true">压缩H5链接</el-button> -->
</template>
</div>
......@@ -118,7 +118,7 @@
<el-dialog :visible.sync="transferLink.show" title="插入小程序链接" width="878px" @closed="onTransferLinkClose">
<el-form label-width="90px">
<el-form-item label="链接类型:" style="margin:0 0 6px 0">
<el-radio-group v-model="linkType">
<el-radio-group v-model="linkType" @change="handleLinkTypeChange">
<el-radio :label="1">小程序链接</el-radio>
<el-radio :label="2">引流链接</el-radio>
</el-radio-group>
......@@ -161,7 +161,8 @@
<template slot="footer">
<el-button @click="transferLink.show = false">取消</el-button>
<el-button type="primary" @click="onTransferLink">生成链接</el-button>
<el-button type="primary" v-if="linkType == 1" @click="onTransferLink">生成链接</el-button>
<el-button type="primary" v-else @click="onInsert" :loading="btnLoading">插入链接</el-button>
</template>
</el-dialog>
<el-dialog :visible.sync="insertLink.show" title="链接生成">
......@@ -223,6 +224,7 @@ export default {
return {
loading: false,
linkOptionsLoading: false,
btnLoading: false,
linkType: 1,
linkOptions: [],
entepriseList: [],
......@@ -347,6 +349,11 @@ export default {
this.getEntepriseList();
},
methods: {
handleLinkTypeChange() {
if (this.linkType == 2) {
this.getlinkOptions();
}
},
createLink() {
window.open(`${window.location.origin}/api-auth/login-for-haoban?requestProject=1&hbPage=attractFlowLink`);
},
......@@ -455,41 +462,43 @@ export default {
},
// 将小程序链接转换成中转页链接
onTransferLink() {
if (!this.selectLink.linkData.id) {
return this.$tips({ type: 'error', message: '请选择小程序链接' });
}
this.loading = true;
const { type, dayNum } = this.transferLink;
const requestData = { type, dayNum, pageLink: JSON.stringify(this.selectLink.linkData) };
getTransferLink(requestData, false, false, 'post')
.then(res => {
this.insertLink.link = res.result;
this.insertLink.show = true;
})
.finally(() => (this.loading = false));
},
onInsert() {
// 链接插入短信中需要前后有一个空格
if (this.linkType == 2) {
if (!this.link.hmLinkId) {
return this.$tips({ type: 'error', message: '请选择链接' });
}
this.loading = true;
this.btnLoading = true;
const { hmLinkId, linkType } = this.link;
hmLink({ hmLinkId, linkType })
.then(res => {
this.insertLink.link = res.result;
this.insertLink.show = true;
this.form.content = `${this.form.content} ${this.insertLink.link} `;
this.insertLink.inserted.push(this.insertLink.link);
this.transferLink.show = false;
})
.finally(() => (this.loading = false));
.finally(() => (this.btnLoading = false));
} else {
if (!this.selectLink.linkData.id) {
return this.$tips({ type: 'error', message: '请选择小程序链接' });
}
this.loading = true;
const { type, dayNum } = this.transferLink;
const requestData = { type, dayNum, pageLink: JSON.stringify(this.selectLink.linkData) };
getTransferLink(requestData, false, false, 'post')
.then(res => {
this.insertLink.link = res.result;
this.insertLink.show = true;
})
.finally(() => (this.loading = false));
this.form.content = `${this.form.content} ${this.insertLink.link} `;
this.insertLink.show = false;
this.reduceLink.show = false;
this.transferLink.show = false;
this.insertLink.inserted.push(this.insertLink.link);
}
},
onInsert() {
// 链接插入短信中需要前后有一个空格
this.form.content = `${this.form.content} ${this.insertLink.link} `;
this.insertLink.show = false;
this.reduceLink.show = false;
this.transferLink.show = false;
this.insertLink.inserted.push(this.insertLink.link);
},
// 向短信内容中插入模板变量
addVar(key, val) {
const curPos = this.$refs['textarea'].$el.children[0].selectionStart;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment