Commit 8a7d8c73 by crushh

update: dist

parent 1c3cab7b
......@@ -38,3 +38,6 @@ export const getSign = params => requests(MARKET_PREFIX + 'getEnterpriseSetting'
//企业列表
export const getEntepriseList = params => requests(MARKET_PREFIX + 'list-qywx-enteprise', params);
//短信模板-引流链接是否展示
export const needShowHmLink = params => requests(MARKET_PREFIX + '/need-show-hm-link', params);
......@@ -120,7 +120,7 @@
<el-form-item label="链接类型:" style="margin:0 0 6px 0">
<el-radio-group v-model="linkType" @change="handleLinkTypeChange">
<el-radio :label="1">小程序链接</el-radio>
<el-radio :label="2">引流链接</el-radio>
<el-radio :label="2" v-show="showHmLike">引流链接</el-radio>
</el-radio-group>
</el-form-item>
<div v-if="linkType == 1" class="mt12">
......@@ -161,7 +161,7 @@
<template slot="footer">
<el-button @click="transferLink.show = false">取消</el-button>
<el-button type="primary" v-if="linkType == 1" @click="onTransferLink">生成链接</el-button>
<el-button type="primary" :loading="btnLoading" v-if="linkType == 1" @click="onTransferLink">生成链接</el-button>
<el-button type="primary" v-else @click="onInsert" :loading="btnLoading">插入链接</el-button>
</template>
</el-dialog>
......@@ -182,7 +182,7 @@
import linktools from '@/components/linktools-fulls/index';
import { _debounce } from '@/utils/index';
import { saveTempService, LoadTempInfo, checkSmsContext, hmList, hmLink } from '@/service/api/messageApi.js';
import { compressLink, getTransferLink, getSign, getEntepriseList } from '@/service/api/commonApi.js';
import { compressLink, getTransferLink, getSign, getEntepriseList, needShowHmLink } from '@/service/api/commonApi.js';
export default {
name: 'add-temp',
components: { linktools },
......@@ -313,6 +313,7 @@ export default {
},
validateStatus: null, // 校验状态 null未校验 0失败 1成功
showMoreFlag: false, // 展示更多文案flag
showHmLike: false,
validaErrorMsg: '' // 校验失败内容
};
},
......@@ -346,9 +347,17 @@ export default {
}
},
mounted() {
this.getEntepriseList();
this.needShowHmLink();
},
methods: {
needShowHmLink() {
needShowHmLink({}).then(res => {
this.showHmLike = res.result;
if (this.showHmLike) {
this.getEntepriseList();
}
});
},
handleLinkTypeChange() {
if (this.linkType == 2) {
this.getlinkOptions();
......@@ -455,17 +464,19 @@ export default {
this.selectLink.linkData = {};
this.transferLink.type = '0';
this.transferLink.dayNum = 1;
this.linkType = 1;
this.link.wxEnterpriseId = this.entepriseList[0].wxEnterpriseId;
this.link.linkType = 1;
this.link.hmLinkId = '';
if (this.showHmLike) {
this.linkType = 1;
this.link.wxEnterpriseId = this.entepriseList[0].wxEnterpriseId;
this.link.linkType = 1;
this.link.hmLinkId = '';
}
},
// 将小程序链接转换成中转页链接
onTransferLink() {
if (!this.selectLink.linkData.id) {
return this.$tips({ type: 'error', message: '请选择小程序链接' });
}
this.loading = true;
this.btnLoading = true;
const { type, dayNum } = this.transferLink;
const requestData = { type, dayNum, pageLink: JSON.stringify(this.selectLink.linkData) };
getTransferLink(requestData, false, false, 'post')
......@@ -473,7 +484,7 @@ export default {
this.insertLink.link = res.result;
this.insertLink.show = true;
})
.finally(() => (this.loading = false));
.finally(() => (this.btnLoading = false));
},
onInsert() {
// 链接插入短信中需要前后有一个空格
......
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