Commit 03e05b40 by 前端

Merge branch 'develop' into 'master'

v2.1.0线索管理代码合并

See merge request !3
2 parents 48274733 eb6bcf3b
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %> <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
......
const url = '/rop-scrm-entmicro/router' const url = '/rop-scrm-wwbench/router'
// const url = 'http://192.168.1.78:8064/rop-scrm-entmicro/router' // const url = 'http://192.168.1.78:8064/rop-scrm-entmicro/router'
export default { export default {
/** 侧边栏-客户跟进 */ /** 工作台-线索管理列表 */
getCustomerDetail(data) { getClueList(data) {
data.method = 'entmicro.api.customer.detail' data.method = 'scrm.api.wwbench.clue.listByUser'
return window.$HTTP({ return window.$HTTP({
url, url,
data data,
returnAll: true
}) })
}, },
/** 侧边栏-群客户跟进-群基本信息 */ /** 工作台-线索管理-详情 */
getCustomerBaseDetail(data) { getClueDetail(data) {
data.method = 'entmicro.api.customer.base.detail' data.method = 'scrm.api.wwbench.clue.updateTaskStatus'
return window.$HTTP({ return window.$HTTP({
url, url,
data data,
returnAll: true
}) })
}, },
/** 侧边栏-群客户跟进-统计接口 */ /** 工作台-线索管理-添加跟进记录 */
getCustomerBaseDetailStatics(data) { addFollow(data) {
data.method = 'entmicro.api.customer.base.detail.statics' data.method = 'scrm.api.wwbench.clue.follow.insertOrUpdate'
return window.$HTTP({ return window.$HTTP({
url, url,
data data,
}) returnAll: true
},
/** 侧边栏-群客户跟进-群客户列表 */
getCustomerCustList(data) {
data.method = 'entmicro.api.customer.base.cust.list'
return window.$HTTP({
url,
data
})
},
/** 侧边栏-群客户跟进-群员工列表 */
getCustomerStaffList(data) {
data.method = 'entmicro.api.customer.base.staff.list'
return window.$HTTP({
url,
data
}) })
} }
} }
@import './normalize.scss'; @import './normalize.scss';
@import './sprite.scss'; @import './sprite.scss';
*{ * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
...@@ -8,7 +8,7 @@ html, ...@@ -8,7 +8,7 @@ html,
body .app { body .app {
color: #333333; color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif; font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #fff; background-color: #F7F7F7;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
height: 100%; height: 100%;
// overflow: hidden; // overflow: hidden;
...@@ -25,6 +25,9 @@ img { ...@@ -25,6 +25,9 @@ img {
align-items: center; align-items: center;
} }
.center{
text-align:center;
}
.text-hide { .text-hide {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -45,6 +48,16 @@ img { ...@@ -45,6 +48,16 @@ img {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.text-space {
display: flex;
align-items: center;
justify-content: space-between;
}
.text-start {
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.x-center { .x-center {
position: absolute; position: absolute;
...@@ -61,47 +74,75 @@ img { ...@@ -61,47 +74,75 @@ img {
.sticky { .sticky {
position: static; position: static;
} }
.text-12{ .text-12 {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #FFFFFF;
} }
.text-20{ .text-14 {
font-size: 14px;
font-weight: 400;
}
.text-17 {
font-size: 14px;
}
.text-20 {
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
}
.text-16 {
font-size: 16px;
}
.color-3 {
color: #333333;
} }
.line-28{ .color-6 {
color: #666666;
}
.color-32 {
color: #323232;
}
.color-9 {
color: #999999;
}
.line-28 {
line-height: 28px; line-height: 28px;
} }
.line-17{ .line-17 {
line-height: 17px; line-height: 17px;
} }
.text-14{ .line-22 {
font-size: 14px; line-height: 22px;
}
.line-60{
line-height: 60px;
}
.weight-6 {
font-weight: 600;
}
.weight-5 {
font-weight: 500;
}
.weight-4 {
font-weight: 400; font-weight: 400;
color: #333333;
line-height: 20px;
} }
.hg{ .hg {
height: 28px; height: 28px;
} }
.button{ .button {
width: 343px; width: 343px;
height: 42px; height: 42px;
background: #3975C6; background: #3975c6;
border-radius: 21px; border-radius: 21px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
line-height: 42px; line-height: 42px;
text-align: center; text-align: center;
margin:0 auto; margin: 0 auto;
} }
.bottom{ .bottom {
vertical-align:bottom; vertical-align: bottom;
} }
.sprite-icon { background-image: url(../images/sprite.png);background-size: 44px 44px;}
.icon-avatar { width: 44px; height: 44px; background-position: 0px 0px;}
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 103px 49px;}
.icon-avatar { width: 44px; height: 44px; background-position: -59px 0px;}
.icon-success { width: 49px; height: 49px; background-position: 0px 0px;}
\ No newline at end of file \ No newline at end of file

980 Bytes | W: | H:

3.44 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<van-empty class="custom-image" :image="empty" :description="description" /> <van-empty class="custom-image" :description="description" />
</template> </template>
<script> <script>
export default { export default {
name: 'empty', name: 'empty',
data() { data() {
return { return {
empty: require('../assets/images/empty.png') // empty: require('../assets/images/empty.png')
} }
}, },
props: { props: {
...@@ -22,8 +22,8 @@ export default { ...@@ -22,8 +22,8 @@ export default {
padding-top: 79px; padding-top: 79px;
} }
.custom-image /deep/ .van-empty__image { // .custom-image /deep/ .van-empty__image {
width: 88px; // width: 88px;
height: 56px; // height: 56px;
} // }
</style> </style>
<template> <template>
<div :class="['scroll-view', ScrollViewclass]" id="van-list" > <div :class="['scroll-view', ScrollViewclass]" id="van-list">
<van-list v-model="loading" :finished="finished" finished-text="到底啦!!" @load="onLoad" offset="100" :immediate-check="false"> <van-list v-model="loading" :finished="finished" finished-text="到底啦!!" @load="onLoad" offset="100" :immediate-check="false">
<slot></slot> <slot></slot>
</van-list> </van-list>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'ScrollView', name: 'ScrollView',
data() { data() {
...@@ -28,12 +28,12 @@ export default { ...@@ -28,12 +28,12 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.scroll-view { .scroll-view {
overflow-y: scroll; overflow-y: scroll;
box-sizing: border-box; box-sizing: border-box;
} }
.van-list { .van-list {
background-color: #ffffff; // background-color: #ffffff;
} }
</style> </style>
...@@ -15,7 +15,8 @@ export const fetchConfig = function(isEnv = true) { ...@@ -15,7 +15,8 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(config) return Promise.resolve(config)
} }
return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-customer-config', {}).then(res => res.json()) // return window.fetch('https://oss-config.dev.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-clew-config', {}).then(res => res.json())
return window.fetch('https://oss-config.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-clew-config', {}).then(res => res.json())
} }
export const cfg = { export const cfg = {
install(vue, config) { install(vue, config) {
......
...@@ -5,14 +5,15 @@ const pages = { ...@@ -5,14 +5,15 @@ const pages = {
meta: { meta: {
title: '线索管理', title: '线索管理',
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
keepAlive: true keepAlive: false
} }
}, },
{ {
name: 'detail', name: 'detail',
meta: { meta: {
title: '详情', title: '详情',
keepAlive: true keepAlive: false,
backgroundColor: '#F7F7F7'
} }
} }
] ]
......
...@@ -128,7 +128,7 @@ const actions = { ...@@ -128,7 +128,7 @@ const actions = {
} }
}, },
navigation({ dispatch }) { navigation({ dispatch }) {
let { sessionId, corpId } = getParams() let { sessionId, corpId, taskId } = getParams()
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
if (!corpId) corpId = storage_corpId && storage_corpId.corpId if (!corpId) corpId = storage_corpId && storage_corpId.corpId
if (corpId && storage_corpId) { if (corpId && storage_corpId) {
...@@ -138,6 +138,9 @@ const actions = { ...@@ -138,6 +138,9 @@ const actions = {
} }
} }
util.setLocalStorage('dj_scrm_corpId', { corpId }) util.setLocalStorage('dj_scrm_corpId', { corpId })
if (taskId) {
util.setLocalStorage('dj_scrm_taskId', { taskId })
}
const storage_sessionId = util.getSessionId() const storage_sessionId = util.getSessionId()
if (sessionId || storage_sessionId) { if (sessionId || storage_sessionId) {
state.showWindow = true state.showWindow = true
......
<template> <template>
<div> <div class="layoutIndex">
线索详情 <tab class="tabber-wrap" :list="list" :index="tabIndex" @change="changeTab" v-if="initShow"></tab>
<template v-if="flag">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-if="clewList.length > 0">
<template v-for="item in clewList">
<div class="content-item" :key="item.id" @click="gotoDetail(item)">
<div class="content-item-des text-space">
<div class="content-item-name weight-6 text-16 color-3 line-22 text-hide">{{ item.name }}</div>
<div class="content-item-phone text-12 color-9 line-17">{{ item.phone }}</div>
</div>
<div class="content-item-info">
<span class="text-12 color-9 weight-4 line-17">
线索类型
<label>{{ item.type == 1 ? '客户意见' : item.type == 2 ? '卖车询价' : item.type == 3 ? '救援服务' : item.type == 4 ? '新车询价' : item.type == 5 ? '试驾预约' : '维保预约' }}</label>
</span>
<span class="text-12 color-9 weight-4 line-17">
创建时间
<label>{{ item.createdDate }}</label>
</span>
</div>
</div>
</template>
</template>
<template v-else>
<empty description="暂无数据" />
</template>
</scroll-view>
</template>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { Notify } from 'vant'
import { clewApi } from '@/api'
export default { export default {
name: '', name: '',
data() { data() {
return { return {
flag: false,
list: ['跟进中', '已完成'],
tabIndex: 0,
clewList: [],
initShow: false,
page: {
pageNum: 1,
pageSize: 10
}
} }
}, },
props: { props: {},
watch: {},
created() {
this.getClueList()
}, },
watch: { mounted() {},
methods: {
gotoDetail(data) {
this.$router.push({ name: 'clew.detail', query: { taskId: data.id } })
}, },
created() { getClueList() {
const status = this.tabIndex === 0 ? 1 : 2
const params = {
...this.page,
status
}
const clewList = this.clewList
this.showLoading()
clewApi.getClueList({ ...params }).then(({ code, data, message }) => {
this.hideLoading()
if (code === '0') {
if (status === 1) {
this.list = [`跟进中(${data.total})`, '已完成']
this.initShow = true
}
this.flag = true
if (data.list.length > 0) {
this.clewList = [...clewList, ...data.list]
this.page.pageNum > 1 ? (this.$refs.scrollView.loading = false) : ''
} else {
this.page.pageNum > 1 ? (this.$refs.scrollView.finished = true) : ''
this.page.pageNum > 1 ? (this.$refs.scrollView.loading = false) : ''
}
} else {
Notify(message)
}
})
}, },
mounted() { changeTab(index) {
this.flag = false
this.clewList = []
this.page.pageNum = 1
this.tabIndex = index
this.getClueList()
}, },
methods: { onReachBottom() {
console.log('触底')
this.page.pageNum = this.page.pageNum + 1
this.getClueList()
}
} }
} }
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss">
.layoutIndex {
height: 100vh;
overflow: hidden;
.content {
height: calc(100vh - 82px);
margin: 16px 15px;
box-sizing: border-box;
&-item {
width: 100%;
height: 118px;
background: #ffffff;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
border-radius: 4px;
margin-bottom: 11px;
&-des {
height: 47px;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
// width:100%;
padding: 16px 16px 9px 16px;
box-sizing: border-box;
.content-item-name{
width: calc(100% - 100px);
}
}
&-info {
padding: 10px 16px 16px 16px;
box-sizing: border-box;
span {
display: block;
label {
margin-left: 20px;
}
}
}
&-info :nth-child(1) {
margin-bottom: 10px;
}
}
}
}
</style>
...@@ -4,48 +4,50 @@ const defaultSettings = require('./src/config/conf.js') ...@@ -4,48 +4,50 @@ const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
// page title // page title
const name = defaultSettings.title || 'vue mobile template' const name = defaultSettings.title || '嘀加企微助手'
// 生产环境,测试和正式 // 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
// externals // externals
// const externals = { // const externals = {
// vue: 'Vue', // vue: 'Vue',
// 'vue-router': 'VueRouter', // 'vue-router': 'VueRouter',
// vuex: 'Vuex', // vuex: 'Vuex',
// vant: 'vant', // vant: 'vant',
// axios: 'axios' // axios: 'axios'
// } // }
// CDN外链,会插入到index.html中 // CDN外链,会插入到index.html中
// const cdn = { // const cdn = {
// // 开发环境 // // 开发环境
// dev: { // dev: {
// css: [], // css: [],
// js: [] // js: []
// }, // },
// // 生产环境 // // 生产环境
// build: { // build: {
// css: ['https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.css'], // css: ['https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.css'],
// js: [ // js: [
// 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', // 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
// 'https://cdn.jsdelivr.net/npm/vue-router@3.1.5/dist/vue-router.min.js', // 'https://cdn.jsdelivr.net/npm/vue-router@3.1.5/dist/vue-router.min.js',
// 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', // 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
// 'https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js', // 'https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js',
// 'https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.min.js' // 'https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.min.js'
// ] // ]
// } // }
// } // }
/** /**
* 雪碧图插件 * 雪碧图插件
*/ */
const SpritesmithPlugin = require('webpack-spritesmith') const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => { const spritesmithFunction = data => {
let { spritesheet, sprites } = data let { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}` let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}`
let perSprite = sprites.map(sprite => { let perSprite = sprites
.map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite let { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}` return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
}).join('\n') })
.join('\n')
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
module.exports = { module.exports = {
...@@ -106,13 +108,16 @@ module.exports = { ...@@ -106,13 +108,16 @@ module.exports = {
image: path.resolve(__dirname, './src/assets/images/sprite.png'), image: path.resolve(__dirname, './src/assets/images/sprite.png'),
// 生成SCSS // 生成SCSS
css: [ css: [
[path.resolve(__dirname, './src/assets/css/sprite.scss'), { [
path.resolve(__dirname, './src/assets/css/sprite.scss'),
{
format: 'function_based_template' format: 'function_based_template'
}] }
]
] ]
}, },
customTemplates: { customTemplates: {
'function_based_template': spritesmithFunction, function_based_template: spritesmithFunction
}, },
//background引用路径 //background引用路径
apiOptions: { apiOptions: {
...@@ -174,9 +179,11 @@ module.exports = { ...@@ -174,9 +179,11 @@ module.exports = {
* 打包分析 * 打包分析
*/ */
if (IS_PROD) { if (IS_PROD) {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [{ config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
{
analyzerMode: 'static' analyzerMode: 'static'
}]) }
])
} }
config config
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
...@@ -186,10 +193,12 @@ module.exports = { ...@@ -186,10 +193,12 @@ module.exports = {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
.after('html') .after('html')
.use('script-ext-html-webpack-plugin', [{ .use('script-ext-html-webpack-plugin', [
{
// 将 runtime 作为内联引入不单独存在 // 将 runtime 作为内联引入不单独存在
inline: /runtime\..*\.js$/ inline: /runtime\..*\.js$/
}]) }
])
.end() .end()
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: 'all', chunks: 'all',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!