Commit 1ffdfc78 by crushh

udpate: dist

parent 351c2881
......@@ -35,3 +35,6 @@ export const getTransferLink = params => requests(GOODS_PREFIX + '/get-transfer-
// 获取短信签名和剩余条数
export const getSign = params => requests(MARKET_PREFIX + 'getEnterpriseSetting', params);
//企业列表
export const getEntepriseList = params => requests(MARKET_PREFIX + 'list-qywx-enteprise', params);
......@@ -78,3 +78,9 @@ export const checkEcmSendCount = params => requests(PREFIX + 'check-ecm-send-cou
// 短信群发-删除前查询是否关联活动
export const queryBusiCommonCheck = params => requests('/api-plug/query-busi-common-check', params, true, false, 'get');
//引流链接列表
export const hmList = params => requests(PREFIX + '/list-hm-link', params);
//创建引流活码链接
export const hmLink = params => requests(PREFIX + '/build-hm-link', params);
......@@ -116,16 +116,46 @@
</el-dialog>
<!-- 插入小程序链接 -->
<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 :label="1">小程序链接</el-radio>
<el-radio :label="2">引流链接</el-radio>
</el-radio-group>
</el-form-item>
<div v-if="linkType == 1" class="mt12">
<div class="layout--tips" style="margin:0 0 20px 20px;width:750px;display:inline-block;">
<i class="el-icon-info"></i> 因微信小程序规则调整(2022年4月11日已调整),影响如下。为了准确使用该功能,请仔细阅读该提示:<br />
1、链接有效期为永久;<br />
2、单个小程序每天生成链接数上限为 50 万条,建议使用该方式 触达的用户数小于50/天。
</div>
<el-form label-width="110px">
<el-form-item label="链接类型:">
<el-form-item label="选择链接:">
<el-button @click="selectLink.show = true">{{ selectLink.linkData.name || '设置小程序链接' }}</el-button>
</el-form-item>
</div>
<div v-else class="mt12">
<div class="layout--tips" style="margin:0 0 20px 20px;width:750px;display:inline-block;">
<i class="el-icon-info"></i>“引流链接”取自【好办后台-活码管理-引流链接】中所创建的“链接”。客户收到短信后点击链接,可一键呼起微信,引导客户添加企微好友,转化私域流量。<br />
在短信模板中,为确保添加成功率,系统会默认在此链接后拼接变量参数,请勿删除(特殊标注下)。否则,若是POS会员,会导致无法正确添加到相应的专属导购。<br />
</div>
<el-form-item label="选择链接:">
<div class="flex">
<el-select class="w160" v-model="link.wxEnterpriseId" @change="getlinkOptions()" v-show="entepriseList.length > 1">
<el-option v-for="el in entepriseList" :key="el.wxEnterpriseId" :value="el.wxEnterpriseId" :label="el.corpName"></el-option>
</el-select>
<el-select class="w160" v-model="link.linkType" @change="getlinkOptions()">
<el-option label="通用链接" :value="1"></el-option>
<el-option label="专用链接" :value="2"></el-option>
</el-select>
<el-select class="w160" v-model="link.hmLinkId" filterable placeholder="请选择" remote :remote-method="getlinkOptions" :loading="linkOptionsLoading">
<el-option v-for="item in linkOptions" :key="item.shortCode" :label="item.name" :value="item.shortCode"> </el-option>
</el-select>
</div>
</el-form-item>
</div>
</el-form>
<template slot="footer">
<el-button @click="transferLink.show = false">取消</el-button>
<el-button type="primary" @click="onTransferLink">生成链接</el-button>
......@@ -147,8 +177,8 @@
<script>
import linktools from '@/components/linktools-fulls/index';
import { _debounce } from '@/utils/index';
import { saveTempService, LoadTempInfo, checkSmsContext } from '@/service/api/messageApi.js';
import { compressLink, getTransferLink, getUserLogin, getSign } from '@/service/api/commonApi.js';
import { saveTempService, LoadTempInfo, checkSmsContext, hmList, hmLink } from '@/service/api/messageApi.js';
import { compressLink, getTransferLink, getUserLogin, getSign, getEntepriseList } from '@/service/api/commonApi.js';
export default {
name: 'add-temp',
components: { linktools },
......@@ -175,7 +205,10 @@ export default {
const urlReg = /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;]+[-A-Za-z0-9+&@#\/%=~_|]/g;
let validate = false;
value.replace(urlReg, (str, $1, index) => {
console.log(str);
if (!validate) {
console.log(value[index - 1]);
console.log(value[index + str.length]);
validate = value[index - 1] != ' ' || value[index + str.length] != ' ';
}
});
......@@ -186,6 +219,15 @@ export default {
};
return {
loading: false,
linkOptionsLoading: false,
linkType: 1,
linkOptions: [],
entepriseList: [],
link: {
wxEnterpriseId: '',
linkType: 1,
hmLinkId: ''
},
form: {
sign: '',
smsRecordlateId: '',
......@@ -261,7 +303,8 @@ export default {
26: '最高单笔消费',
27: '最近消费门店名称',
28: '最近消费品牌名称',
29: '入会后的生日次数'
29: '入会后的生日次数',
30: '客户的手机号'
},
validateStatus: null, // 校验状态 null未校验 0失败 1成功
showMoreFlag: false, // 展示更多文案flag
......@@ -297,8 +340,40 @@ export default {
this.form.sign = sign.result.signText ? `【${sign.result.signText}】` : '';
}
this.getUserData();
this.getEntepriseList();
},
methods: {
getlinkOptions(searchName) {
const { linkType, wxEnterpriseId } = this.link;
this.link.hmLinkId = '';
this.linkOptionsLoading = true;
hmList({ searchName: searchName ? searchName : undefined, linkType, wxEnterpriseId })
.then(res => {
if (res.errorCode === 0) {
this.linkOptions = res.result || [];
} else {
this.$message({ message: res.message, type: 'error' });
}
})
.finally(_ => {
this.linkOptionsLoading = false;
});
},
getEntepriseList() {
getEntepriseList()
.then(res => {
if (res.errorCode === 0) {
this.entepriseList = res.result || [];
this.link.wxEnterpriseId = this.entepriseList[0].wxEnterpriseId;
this.getlinkOptions();
} else {
this.$message({ message: res.message, type: 'error' });
}
})
.catch(err => {
this.$message({ message: err.data.message, type: 'error' });
});
},
submit: _debounce(function(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
......@@ -371,9 +446,26 @@ 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 = '';
},
// 将小程序链接转换成中转页链接
onTransferLink() {
if (this.linkType == 2) {
if (!this.link.hmLinkId) {
return this.$tips({ type: 'error', message: '请选择链接' });
}
this.loading = true;
const { hmLinkId, linkType } = this.link;
hmLink({ hmLinkId, linkType })
.then(res => {
this.insertLink.link = res.result;
this.insertLink.show = true;
})
.finally(() => (this.loading = false));
} else {
if (!this.selectLink.linkData.id) {
return this.$tips({ type: 'error', message: '请选择小程序链接' });
}
......@@ -386,6 +478,7 @@ export default {
this.insertLink.show = true;
})
.finally(() => (this.loading = 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