Commit 42d468b4 by chenxin

fix:ecm 营销通知-小程序卡片-自定义页面,下拉支持模糊查询滚动加载

parent 2e769e1d
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/fonts/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link rel=stylesheet href=//web-1251519181.file.myqcloud.com/components/element.2.12.0.css><link href=/marketing/static/css/main.ea2239588780cf57609a3594e1974b70.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/element.2.12.0.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.36.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/store.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.2.16.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.18.js></script><script src=//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.42.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.2.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script type=text/javascript src=/marketing/static/js/manifest.194ab2506cda0c7fc395.js></script><script type=text/javascript src=/marketing/static/js/vendor.cbb380c2053ab598e892.js></script><script type=text/javascript src=/marketing/static/js/main.9be40b8568322326f793.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/fonts/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link rel=stylesheet href=//web-1251519181.file.myqcloud.com/components/element.2.12.0.css><link href=/marketing/static/css/main.d95883ddcf45eacf024f766537830ce9.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/element.2.12.0.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.36.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/store.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.2.16.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.18.js></script><script src=//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.42.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.2.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script type=text/javascript src=/marketing/static/js/manifest.aed06d60a88e85873471.js></script><script type=text/javascript src=/marketing/static/js/vendor.cbb380c2053ab598e892.js></script><script type=text/javascript src=/marketing/static/js/main.9be40b8568322326f793.js></script></body></html>
\ No newline at end of file \ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var i,d,f,u=0,s=[];u<t.length;u++)d=t[u],n[d]&&s.push(n[d][0]),n[d]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(r&&r(t,c,a);s.length;)s.shift()();if(a)for(u=0;u<a.length;u++)f=o(o.s=a[u]);return f};var t={},n={13:0};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var r=n[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var t=new Promise(function(t,o){r=n[e]=[t,o]});r[2]=t;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"message",4:"ewash",5:"evaluation",6:"ecm",7:"activity",8:"recharge",9:"msg",10:"calllog"}[e]||e)+"."+{0:"08323db46eebfee39d0b",1:"a91bdcf8d1cfdd6114a5",2:"60c666b3c98a6e488994",3:"817c2fce5d629049941d",4:"17d5d8e8e5023c0ef4dd",5:"0c17680da1cc0f794988",6:"6b391ade87c87169300b",7:"520a54176361c7b4f5f4",8:"1ff302476a871dc141c7",9:"ed6ba5a1645f90d782a1",10:"012adc27d4425d824c4b"}[e]+".js";var i=setTimeout(d,12e4);function d(){a.onerror=a.onload=null,clearTimeout(i);var r=n[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return a.onerror=a.onload=d,c.appendChild(a),t},o.m=e,o.c=t,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(t,o,a){for(var f,i,u,d=0,s=[];d<t.length;d++)i=t[d],n[i]&&s.push(n[i][0]),n[i]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(r&&r(t,o,a);s.length;)s.shift()();if(a)for(d=0;d<a.length;d++)u=c(c.s=a[d]);return u};var t={},n={13:0};function c(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var r=n[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var t=new Promise(function(t,c){r=n[e]=[t,c]});r[2]=t;var o=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,c.nc&&a.setAttribute("nonce",c.nc),a.src=c.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"message",4:"ewash",5:"evaluation",6:"ecm",7:"activity",8:"recharge",9:"msg",10:"calllog"}[e]||e)+"."+{0:"24141c5fcc4ed1fef5f5",1:"4a545bd230fff7cdce74",2:"c353acbd4806c018d832",3:"817c2fce5d629049941d",4:"17d5d8e8e5023c0ef4dd",5:"0c17680da1cc0f794988",6:"cfac61704ac008583a65",7:"520a54176361c7b4f5f4",8:"1ff302476a871dc141c7",9:"ed6ba5a1645f90d782a1",10:"012adc27d4425d824c4b"}[e]+".js";var f=setTimeout(i,12e4);function i(){a.onerror=a.onload=null,clearTimeout(f);var r=n[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return a.onerror=a.onload=i,o.appendChild(a),t},c.m=e,c.c=t,c.d=function(e,r,t){c.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},c.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(r,"a",r),r},c.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},c.p="/marketing/",c.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
<template> <template>
<el-select popper-class="c-filterable" :disabled="disabled" v-loadmore="getMore" remote filterable clearable :remote-method="remoteMethod" @change="updateCId" size="small" v-model="cardId" placeholder="请输入卡券名称选择卡券"> <el-select popper-class="c-filterable" :disabled="disabled" v-loadmore="getMore" remote filterable clearable :remote-method="remoteMethod" @change="updateCId" size="small" v-model="cardId" placeholder="请输入卡券名称选择卡券">
<el-option v-for="(item, idx) in tableList" showNewOption :key="idx" :label="`${item.cardName}(${item.coupCardId.slice(-6)})`" :value="item.coupCardId"> <el-option v-for="(item, idx) in tableList" showNewOption :key="idx" :label="`${item.cardName}(${item.coupCardId.slice(-6)})`" :value="item.coupCardId">
<div>{{ `${item.cardName}(${item.coupCardId.slice(-6)}` }}</div> <div>{{ `${item.cardName}(${item.coupCardId.slice(-6)})` }}</div>
<div style="color: #909399; font-size: 12px">{{ item.subName || '--' }}</div> <div style="color: #909399; font-size: 12px">{{ item.subName || '--' }}</div>
</el-option> </el-option>
</el-select> </el-select>
......
...@@ -17,13 +17,19 @@ ...@@ -17,13 +17,19 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="链接类型" class="url-link-wrap" style="margin-bottom: 0"> <el-form-item label="链接类型" class="url-link-wrap">
<el-select @change="changePreValue" v-model="preValue" class="w200" placeholder="请选择" style="margin-right: 6px;"> <div v-loading="linkLoading">
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value"> </el-option> <el-select @change="changePreValue" v-model="preValue" class="w200" placeholder="请选择" style="margin-right: 6px;">
</el-select> <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value"> </el-option>
<el-select v-if="preValue" @change="changeNextValue" class="w200" v-model="nextValue" placeholder="请选择"> </el-select>
<el-option v-for="item in options2" :key="item.linkId" :label="item.name" :value="item.linkId"> </el-option> <el-select v-show="preValue == 5" v-loadmore="getMore" remote filterable clearable :remote-method="remoteMethod" @change="changeNextValue" v-model="nextValue" class="w200" placeholder="请选择(支持模糊查询)">
</el-select> <!-- <el-select v-loadmore="getMore" filterable clearable @change="changeNextValue" remote :remote-method="remoteMethod" class="w200" v-model="nextValue" placeholder="请选择"> -->
<el-option v-for="item in options2" :key="item.linkId" :label="item.name" :value="item.linkId"> </el-option>
</el-select>
<el-select v-show="preValue && preValue != 5" filterable clearable @change="changeNextValue" class="w200" v-model="nextValue" placeholder="请选择">
<el-option v-for="item in options2" :key="item.linkId" :label="item.name" :value="item.linkId"> </el-option>
</el-select>
</div>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -81,9 +87,31 @@ export default { ...@@ -81,9 +87,31 @@ export default {
} }
], ],
options2: [], options2: [],
wechatContent: {} wechatContent: {},
listParams: {
pageSize: 10,
currentPage: 1,
search: '',
requestProject: 'gic-web'
},
nomore: false,
linkLoading: false
}; };
}, },
directives: {
loadmore: {
inserted(el, binding) {
// 获取element-ui定义好的scroll盒子
const SELECTDOWN_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
SELECTDOWN_DOM.addEventListener('scroll', function() {
const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (CONDITION) {
binding.value();
}
});
}
}
},
watch: { watch: {
show(val) { show(val) {
this.form = { this.form = {
...@@ -108,9 +136,8 @@ export default { ...@@ -108,9 +136,8 @@ export default {
if (pagePath.pageType === 5) { if (pagePath.pageType === 5) {
// 自定义链接 // 自定义链接
this.getCustonList().then(res => { // 获取pageName
this.nextValue = pagePath.pageId; this.getPageName(pagePath.pageId);
});
} else { } else {
this.getNextList(this.preValue).then(res => { this.getNextList(this.preValue).then(res => {
this.nextValue = pagePath.type; this.nextValue = pagePath.type;
...@@ -161,11 +188,54 @@ export default { ...@@ -161,11 +188,54 @@ export default {
this.nextValue = ''; this.nextValue = '';
this.options2 = []; this.options2 = [];
if (val === 5) { if (val === 5) {
this.getCustonList(); this.remoteMethod('');
} else { } else {
this.getNextList(val); this.getNextList(val);
} }
}, },
// 获取页面名称
getPageName(pageId) {
this.axios
.post(
'/api-admin/get-custom-page-entity',
qs.stringify({
pageId,
requestProject: 'gic-web'
})
)
.then(res => {
var data = res.data;
if (data.errorCode == 0) {
this.listParams.search = data.result.title;
this.getCustonList().then(res => {
this.nextValue = pageId;
});
} else {
this.loading = false;
this.$message({
type: 'error',
message: data.message
});
}
});
},
// 模糊搜索
remoteMethod(search) {
this.listParams.search = search;
this.listParams.currentPage = 1;
this.options2 = [];
this.nomore = false;
this.getCustonList();
},
// 下一页
getMore() {
console.log(this.nomore);
if (this.nomore) {
return;
}
this.listParams.currentPage = this.listParams.currentPage * 1 + 1;
this.getCustonList();
},
changeNextValue(val) { changeNextValue(val) {
if (val) { if (val) {
let obj = {}; let obj = {};
...@@ -181,35 +251,34 @@ export default { ...@@ -181,35 +251,34 @@ export default {
// 获取自定义链接list // 获取自定义链接list
getCustonList() { getCustonList() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.loading = true; this.linkLoading = true;
this.axios this.axios.post('/api-admin/list-custom-page-for-link', qs.stringify(this.listParams)).then(res => {
.post( this.linkLoading = false;
'/api-admin/list-custom-page', //成功后回调
qs.stringify({ var data = res.data;
requestProject: 'gic-web' if (data.errorCode == 0) {
}) const options2 =
) data.result.result.map(v => {
.then(res => {
this.loading = false;
//成功后回调
var data = res.data;
if (data.errorCode == 0) {
this.options2 = data.result.map(v => {
return { return {
linkId: v.pageId, linkId: v.pageId,
name: v.name, name: v.name,
url: v.url url: v.url
}; };
}); }) || [];
resolve(); const tableList = options2 ? this.options2.concat(options2) : [];
} else { const total = data.result.totalCount;
this.loading = false; this.options2 = tableList;
this.$message({ this.total = total;
type: 'error', this.nomore = total <= tableList.length || total - tableList.length < this.listParams.pagesize; // 没有下一页了
message: data.message resolve();
}); } else {
} this.linkLoading = false;
}); this.$message({
type: 'error',
message: data.message
});
}
});
}); });
}, },
// 获得链接类型的二级 // 获得链接类型的二级
...@@ -228,6 +297,8 @@ export default { ...@@ -228,6 +297,8 @@ export default {
var data = res.data; var data = res.data;
if (data.errorCode == 0) { if (data.errorCode == 0) {
this.options2 = data.result; this.options2 = data.result;
this.total = data.result.length;
this.nomore = false; // 没有下一页了
resolve(); resolve();
} else { } else {
this.$message({ this.$message({
...@@ -245,18 +316,6 @@ export default { ...@@ -245,18 +316,6 @@ export default {
title: this.form.title, title: this.form.title,
mediaId: this.form.mediaId mediaId: this.form.mediaId
}; };
// 自定义链接
if (this.preValue === 5) {
sendData.pagePath = JSON.stringify({
customUrl: this.options2.find(v => {
return v.linkId === this.nextValue;
}).url,
pageId: this.nextValue,
pageType: 5
});
} else {
sendData.pagePath = JSON.stringify(this.wechatContent);
}
if (!sendData.title) { if (!sendData.title) {
this.$message({ type: 'warning', message: '简介未填写' }); this.$message({ type: 'warning', message: '简介未填写' });
...@@ -271,10 +330,26 @@ export default { ...@@ -271,10 +330,26 @@ export default {
return; return;
} }
// 自定义链接
if (this.preValue === 5) {
sendData.pagePath = JSON.stringify({
customUrl: this.options2.find(v => {
return v.linkId === this.nextValue;
}).url,
pageId: this.nextValue,
pageType: 5
});
} else {
sendData.pagePath = JSON.stringify(this.wechatContent);
}
this.$emit('sendItem', sendData); this.$emit('sendItem', sendData);
this.close(); this.close();
}, },
close() { close() {
this.listParams.currentPage = 1;
this.listParams.search = '';
this.listParams.nomore = false;
this.options2 = [];
this.$emit('update:show', false); this.$emit('update:show', false);
} }
} }
......
...@@ -149,8 +149,8 @@ ...@@ -149,8 +149,8 @@
</div> </div>
<template v-if="!isAdd && scope.row.prizeReferType == 2"> <template v-if="!isAdd && scope.row.prizeReferType == 2">
<!-- 卡券 且不是新增表单 --> <!-- 卡券 且不是新增表单 -->
<span v-if="scope.row.status == 0" class="dm-tags warning">已删除</span> <span v-if="scope.row.card.status == 0" class="dm-tags warning">已删除</span>
<span v-else-if="scope.row.cardStock <= 0" class="dm-tags error">无库存</span> <span v-else-if="scope.row.card.couponStock <= 0" class="dm-tags error">无库存</span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -499,7 +499,7 @@ export default { ...@@ -499,7 +499,7 @@ export default {
v.card = { cardName: '', coupCardId: '' }; v.card = { cardName: '', coupCardId: '' };
} else if (v.prizeReferType === 2) { } else if (v.prizeReferType === 2) {
v.proGift = { mainPic: { imgUrl: '', code: '' } }; v.proGift = { mainPic: { imgUrl: '', code: '' } };
v.card = { cardName: v.card.cardName, coupCardId: v.card.coupCardId }; v.card = { cardName: v.card.cardName, coupCardId: v.card.coupCardId, status: v.card.status, couponStock: v.card.couponStock };
} }
}); });
} }
......
<template> <template>
<ul class="w-tips"> <ul class="w-tips">
<li> <li>
<div>Q:微信图文发送时为什么会出现不合法媒体ID的提示?</div> <div>Q:微信图文编辑保存时为什么会出现不合法媒体ID的提示?</div>
<div>A:所选择的微信图文,原图文中的头图在微信原生后台被删除,与GIC端的图文内容不一致,导致无法发送,如需发送,需在GIC侧重新编辑图文,从素材库或本地文件重新上传头图即可。</div> <div>A:图文在GIC侧编辑保存时,图文中的封面图与原图文(微信侧)中不一致,将会导致无法发送。如需发送,需在GIC侧重新编辑图文,从素材库或本地文件重新上传封面图即可。</div>
</li> </li>
<li> <li>
<div>Q:图文在编辑保存时,校验失败是怎么回事?</div> <div>Q:图文在编辑保存时,校验失败是怎么回事?</div>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</li> </li>
<li> <li>
<div>Q:为什么我发的图文出现了别人的内容?</div> <div>Q:为什么我发的图文出现了别人的内容?</div>
<div>A:由于微信平台拥有原创保护监测机制,如果所发送的图文中,图文内容与已申请原创申明的图文内容高度相似时,图文发送后,微信会将图文链接换为原创内容的链接,请注意保证图文的原创性。</div> <div>A:由于微信平台拥有原创保护监测机制,如果所发送的图文中,图文内容与已申请原创申明的图文内容高度相似时,图文发送后,微信会将图文链接换为原创内容的链接,请注意保证图文的原创性。</div>
</li> </li>
<li style="margin-top:20px"> <li style="margin-top:20px">
<a target="_blank" href="https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1463730026&version=1&lang=zh_CN&platform=2&token=1734190417"><i class="el-icon-question mr5"></i>微信公众平台原创声明及相关功能使用条款</a> <a target="_blank" href="https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1463730026&version=1&lang=zh_CN&platform=2&token=1734190417"><i class="el-icon-question mr5"></i>微信公众平台原创声明及相关功能使用条款</a>
......
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