提交 23435e13 authored 作者: lihuihui's avatar lihuihui

用户触达编辑页

上级 eb90213a
module.exports = {
domain: 'dev.ezijing.com',
url: 'https://x-training2.ezijing.com/api',
url: 'https://test-microservices-x-operation-admin.ezijing.com/api',
isEnableToIphoneDebugger: false,
// apiBaseURL: '//demo-login.ezijing.com/',
webpack: {
externals: {
CKEDITOR: 'window.CKEDITOR',
Base64: 'window.Base64',
md5: 'window.md5',
regeneratorRuntime: 'window.regeneratorRuntime',
wx: 'window.wx',
WeixinJSBridge: 'window.WeixinJSBridge'
'CKEDITOR': 'window.CKEDITOR',
'Base64': 'window.Base64',
'md5': 'window.md5',
'regeneratorRuntime': 'window.regeneratorRuntime'
},
devServer: {
proxy: {
/* 多个代理 */
// '/api': {
// target: $GLOBAL.webConf.url,
// selfHandleResponse: false,
// // selfHandleResponse: true, // 自定义 响应结构
// secure: false, // 如果是https接口,需要配置这个参数
// changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
// followRedirects: true, // 由于重定向307,所以跟随重定向直接返回一个接口
// logLevel: 'info', // 日志打印级别
// headers: {
// 'Referer': $GLOBAL.webConf.url
// },
// pathRewrite: {
// '^/api': '/' // 需要rewrite重写的
// }
// }
'/api/opera/': {
target: 'https://test-microservices-x-operation-admin.ezijing.com',
selfHandleResponse: false,
// selfHandleResponse: true, // 自定义 响应结构
secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
followRedirects: true, // 由于重定向307,所以跟随重定向直接返回一个接口
logLevel: 'info', // 日志打印级别
// headers: {
// 'Referer': $GLOBAL.webConf.url
// },
// pathRewrite: {
// '^/api': '/' // 需要rewrite重写的
// }
}
}
}
},
ProvidePlugin: {},
ProvidePlugin: {
},
others: {
loginUrl: 'https://login2.ezijing.com/xtraining/login/index'
}
}
import httpRequest from '@/utils/axios'
// 绑定微信
export function bindWechat(data) {
return httpRequest.post('/api/passport/rest/wechat/bind-unionid', data)
}
// 获取用户信息
export function getTriggerList() {
return httpRequest.get('/api/opera/v1/oprations/reach/ways')
}
......@@ -35,7 +35,7 @@ export default {
// // { title: '用户群分析', path: '/yhfq/yhqfx' }
// ]
},
{ title: '案例分析', icon: '', path: '/' },
{ title: '用户触达编辑', icon: '', path: '/triggerEditor' },
{ title: '用户群分析', icon: '', path: '/' },
{ title: '用户触达', icon: '', path: '/' }
]
......
<template>
<app-container title="用户触达编辑">
<el-row>
<el-col :span="12">
<div class="title">触达方式</div>
<ul class="trigger-add">
<li v-for="(item, index) in triggerMode" :key="index">
<el-row :gutter="10" type="flex" align="middle">
<el-col :span="16">
<el-input v-model="item.context" placeholder="请输入内容"></el-input>
</el-col>
<el-col :span="2">
<i class="el-icon-circle-plus-outline" @click="inputAdd('triggerMode', index)"></i>
</el-col>
<el-col :span="2">
<i class="el-icon-remove-outline" @click="inputRemove('triggerMode', index)"></i>
</el-col>
</el-row>
</li>
</ul>
</el-col>
<el-col :span="12">
<div class="title">触达时间点</div>
<ul class="trigger-add">
<li v-for="(item, index) in triggerTime" :key="index">
<el-row :gutter="10" type="flex" align="middle">
<el-col :span="16">
<el-input v-model="item.context" placeholder="请输入内容"></el-input>
</el-col>
<el-col :span="2">
<i class="el-icon-circle-plus-outline" @click="inputAdd('triggerTime', index)"></i>
</el-col>
<el-col :span="2">
<i class="el-icon-remove-outline" @click="inputRemove('triggerTime', index)"></i>
</el-col>
</el-row>
</li>
</ul>
</el-col>
</el-row>
<template #footer>
<div class="app-container-ft">
<el-button type="primary" size="mini">确定</el-button>
</div>
</template>
</app-container>
</template>
<script>
import * as api from '@/api/triggerEdit'
import AppContainer from '@/components/AppContainer'
export default {
components: { AppContainer },
data() {
return {
triggerMode: [
{ option: 'A', context: '11' }
],
triggerTime: [
{ option: 'A', context: '' }
],
AZkey: []
}
},
mounted() {
this.AZkey = this.A_Z()
this.getList()
},
methods: {
inputAdd(arr, index) {
const getKey = this.triggerMode[this.triggerMode.length - 1].option
const getIndex = this.AZkey.findIndex(item => { return item === getKey })
this[arr].push({ option: this.AZkey[getIndex + 1], context: '' })
},
inputRemove(arr, index) {
if (this[arr].length > 1) {
this[arr].splice(index, 1)
this.setKey(arr)
}
},
setKey(arr) {
this[arr].map((item, index) => {
item.option = this.AZkey[index]
})
console.log(this[arr])
},
A_Z() {
const result = []
for (let i = 0; i < 26; i++) {
result.push(String.fromCharCode(65 + i))
}
return result
},
getList() {
api
.getTriggerList()
.then(response => {
if (response.data.length !== 0) {
this.triggerMode = response.data
}
})
.finally(() => {
this.submitLoading = false
})
}
}
}
</script>
<style scoped lang="scss">
.trigger-add{
li{
margin-top: 10px;
}
i{
font-size: 24px;
}
}
</style>
......@@ -24,6 +24,10 @@ export default [
path: '/account/password',
component: () => import(/* webpackChunkName: "account" */ '@/pages/account/password')
},
{
path: '/triggerEditor',
component: () => import(/* webpackChunkName: "triggerEditor" */ '@/pages/triggerEditor/index')
},
...userGroup
]
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论