Commit 733d23ce by 李伟康

8月底需求

1 parent a8248294
const url = '/rop-scrm-datahub/router'
export default {
/**标签列表 */
getTagsList (labelTreeReq) {
const data = {
method: 'scrm.api.datahub.labelgroup.queryLabelTree',
labelTreeReq: {
labelGroupName: '',
pageNum: 1,
pageSize: 10000,
...labelTreeReq
}
}
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file
const url = '/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.163:8080/rop-scrm-entmicro/router'
export default {
/**客户列表 */
getCustomerList (data = {}) {
......
......@@ -11,11 +11,12 @@ import wwbenchApi from './wwbenchApi'
import wxConfig from './wxConfig'
import marketingApi from './marketingApi'
import entmicroApi from './entmicroApi'
import datahubApi from './datahubApi'
export {
ssoApi,
wwbenchApi,
wxConfig,
marketingApi,
entmicroApi
entmicroApi,
datahubApi
}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 311px 137px;}
.icon-arrow { width: 7px; height: 11px; background-position: 0px -126px;}
.icon-default-avatar { width: 44px; height: 44px; background-position: 0px -52px;}
.icon-down { width: 12px; height: 12px; background-position: -264px -52px;}
.icon-eye { width: 13px; height: 8px; background-position: -286px -52px;}
.icon-file { width: 26px; height: 26px; background-position: -138px -52px;}
.icon-filter { width: 16px; height: 16px; background-position: -238px -52px;}
.icon-index-tips { width: 23px; height: 23px; background-position: -174px -52px;}
.icon-link { width: 32px; height: 32px; background-position: -96px -52px;}
.icon-pdf { width: 32px; height: 34px; background-position: -54px -52px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -207px -52px;}
.icon-send { width: 10px; height: 10px; background-position: 0px -106px;}
.icon-steps { width: 311px; height: 42px; background-position: 0px 0px;}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 550px 140px;}
.icon-arrow { width: 7px; height: 11px; background-position: -239px -126px;}
.icon-default-avatar { width: 44px; height: 44px; background-position: -239px -52px;}
.icon-down { width: 12px; height: 12px; background-position: -503px -52px;}
.icon-eye { width: 13px; height: 8px; background-position: -525px -52px;}
.icon-file { width: 26px; height: 26px; background-position: -377px -52px;}
.icon-filter { width: 16px; height: 16px; background-position: -477px -52px;}
.icon-index-tips { width: 23px; height: 23px; background-position: -413px -52px;}
.icon-link { width: 32px; height: 32px; background-position: -335px -52px;}
.icon-pdf { width: 32px; height: 34px; background-position: -293px -52px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -446px -52px;}
.icon-send { width: 10px; height: 10px; background-position: -239px -106px;}
.icon-steps { width: 311px; height: 42px; background-position: -239px 0px;}
.icon-nothing { width: 229px; height: 140px; background-position: 0px 0px;}
\ No newline at end of file

12.3 KB | W: | H:

77.5 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
......@@ -66,7 +66,6 @@ export default {
}
},
mounted () {
console.log('searchValue', this.searchValue)
},
watch: {
'updata' (n) {
......
......@@ -7,39 +7,49 @@
@close="close"
>
<div class="tab-box">
<template v-for="(i,index) in tagGroup">
<div
:key="index"
:class="['tab-item',{'active':status == i.value}]"
@click="changeType(i.value)"
>
{{ i.text }}
</div>
<template v-for="(i,index) in tab">
<template>
<div
:key="index"
:class="['tab-item',{'active':tabIndex == index}]"
@click="changeType(index)"
>
{{ i }}
</div>
</template>
</template>
</div>
<van-search
v-model="keyword"
shape="round"
placeholder="输入关键词搜索"
@search="onEmit($event)"
@clear="onEmit('')"
@blur="onEmit(keyword)"
/>
<div class="tags-view">
<template v-for="(i,index) in 10">
<div
:key="index"
class="tags-box"
>
<div class="tags-title">嘿嘿</div>
<div class="tags-list">
<template v-for="(k,ind) in 10">
<div
:class="['tags-item text-center',{'active':ind == 0}]"
:key="ind"
>
哈哈{{ k }}
</div>
</template>
<template v-for="(i,index) in tagList[tabIndex]">
<template v-if="i.show">
<div
:key="index"
class="tags-box"
>
<div class="tags-title">{{ i.groupName }}</div>
<div class="tags-list">
<template v-for="(k,ind) in i.labelList">
<template v-if="k.show">
<div
:class="['tags-item text-center',{'active':labelIds.includes(k.id)}]"
:key="ind"
@click="chooseTag(k.id)"
>
{{ k.name }}
</div>
</template>
</template>
</div>
</div>
</div>
</template>
</template>
</div>
<div class="tags-buttons flex">
......@@ -47,20 +57,23 @@
block
round
class="tags-btn cancel"
@click="confirmDate"
>取消</van-button>
@click="reset"
>重置</van-button>
<van-button
block
round
color="#3975C6"
class="tags-btn"
@click="confirmDate"
@click="confirm"
>查询</van-button>
</div>
</van-popup>
</template>
<script type='text/ecmascript-6'>
import { datahubApi } from '@/api'
export default {
name: 'TagsPopup',
props: {
......@@ -69,22 +82,11 @@ export default {
data () {
return {
show: false,
status: '1',
keyword:'',
tagGroup: [
{
value: '1',
text: '群组标签'
},
{
value: '2',
text: '自店标签'
},
{
value: '3',
text: '系统标签'
}
]
keyword: '',
labelIds: [],
tab: [],
tagList: [],
tabIndex: 0,
}
},
watch: {
......@@ -93,19 +95,79 @@ export default {
}
},
mounted () {
/**
* merchantModel 1集团 2自店
*/
const { merchantModel, merchantId } = this.getLocalStorage('dj_scrm_userInfo')
datahubApi.getTagsList({
shopId: merchantId,
edition: merchantModel
}).then(({ labelTreeRets }) => {
const tab = [],
// 1 企业标签 2 自店标签 3 系统标签
arr = [[], [], []],
tagList = []
labelTreeRets.map(e => {
e.labelList.map(k => k.show = true)
arr[{
'企业标签': '0',
'自店标签': '1',
'系统标签': '2',
}[e.labelType]].push({
groupName: e.labelGroup.name,
labelList: e.labelList,
show: true
})
})
arr.map((e, index) => {
if (e.length) {
if (index == 0) tab.push(merchantModel == 1 ? '集团标签' : '企业标签')
if (index == 1) tab.push('自店标签')
if (index == 2) tab.push('系统标签')
tagList.push(e)
}
})
this.tagList = tagList
this.tab = tab
})
},
methods: {
changeType(e){
const {keyword} = this
if(keyword) return this.showToast('切换标签类型将重置查询条件')
this.status = e
changeType (tabIndex) {
const { labelIds ,keyword} = this
if (labelIds.length) return this.showToast('切换标签类型将重置查询条件')
this.tabIndex = tabIndex
this.reset()
this.onEmit(keyword)
},
onEmit (val) {
const { tagList, tabIndex } = this
tagList[tabIndex].map(e => {
e.show = !val
let name = [e.groupName]
e.labelList.map(i => {
i.show = !val
name.push(i.name)
if (i.name.indexOf(val) != -1) i.show = true
})
if (name.join('').indexOf(val) != -1) e.show = true
})
},
chooseTag (id) {
const { labelIds } = this,
tagIndex = labelIds.findIndex(e => e == id)
if (tagIndex == -1) labelIds.push(id)
else labelIds.splice(tagIndex, 1)
},
close () {
this.$emit('update:value', false)
},
confirmDate () {
let { dateValue } = this
this.$emit('confirm', dateValue)
reset () {
this.labelIds = []
},
confirm () {
let { labelIds } = this
this.$emit('confirm', labelIds)
this.close()
}
}
......@@ -114,7 +176,7 @@ export default {
<style scoped lang='scss'>
.tags-popup {
max-height: 95%;
height: 80%;
.van-search {
padding: 8px 16px;
.van-cell {
......@@ -155,7 +217,9 @@ export default {
}
}
.tags-view {
height: 240px;
// height: 240px;
height: calc(100% - 170px - var(--constantSafeAreaInsetBottom));
height: calc(100% - 170px - var(--envSafeAreaInsetBottom));
overflow-y: scroll;
padding: 8px 20px 25px;
box-sizing: border-box;
......@@ -190,7 +254,7 @@ export default {
padding: 10px 44px calc(var(--envSafeAreaInsetBottom) + 10px);
justify-content: space-between;
box-sizing: border-box;
box-shadow: 0 -0.5px 0 0 #E9E9E9;
box-shadow: 0 -0.5px 0 0 #e9e9e9;
.tags-btn {
width: 140px;
height: 36px;
......@@ -198,9 +262,9 @@ export default {
border-radius: 21px;
font-size: 14px;
}
.cancel{
.cancel {
color: #323233;
background: #FFFFFF;
background: #ffffff;
}
}
}
......
......@@ -48,7 +48,6 @@ fetchConfig(!isMock).then(res => {
if (res.vconsole) new VConsole()
/**登录过期 重新登录 */
window.reLogin = () => {
console.log('relogin')
util.removeLocalStorage('dj_scrm_userInfo')
util.clearSessionId()
store.dispatch('navigation')
......
......@@ -71,8 +71,6 @@ const actions = {
let [redirectUrl] = window.location.href.split('?')
const code = getParams('code')
if (code) {
console.log(code)
return
const { corpId, agentId } = util.getLocalStorage('dj_scrm_corpId')
ssoApi
.login({
......@@ -81,7 +79,6 @@ const actions = {
getUserInfoFlag: agentId ? true : false
})
.then(({ code, data }) => {
return
let url = `${redirectUrl.split('#')[0]}#/`
let route = state.lastPath == 'home' ? '' : state.lastPath
if (code == '0') {
......@@ -208,7 +205,7 @@ const login = ({ dispatch, to }) => {
state.showWindow = false
util.showLoading()
dispatch('login')
return
return
}
}
state.showWindow = true
......@@ -226,10 +223,10 @@ const getParams = name => {
return name ? obj[name] : obj
}
const removeStoreage = () => {
// util.removeLocalStorage('dj_scrm_userInfo')
// util.removeLocalStorage('dj_scrm_accountList')
// util.removeLocalStorage('dj_scrm_loginToken')
// util.clearSessionId()
util.removeLocalStorage('dj_scrm_userInfo')
util.removeLocalStorage('dj_scrm_accountList')
util.removeLocalStorage('dj_scrm_loginToken')
util.clearSessionId()
}
export default {
state,
......
......@@ -2,11 +2,9 @@
<div class="layout">
<div class="search">
<search-box
@search="search"
:keyword="keyword"
@search="search($event,'keyWord')"
:showDropdown="false"
placeholder="输入关键字搜索"
@focus="focus"
custom
>
<div
......@@ -17,41 +15,58 @@
</div>
</search-box>
</div>
<div class="customer-box">
<template v-for="(i,index) in 10">
<div
:key="index"
class="item"
@click="jump"
>
<div class="sprite-icon icon-arrow"></div>
<div class="info">
<div class="head">
<img src="">
</div>
<div class="text">
<div class="name">奥迪-张女士</div>
18888888888
</div>
</div>
<div class="tags flex">
<template v-for="(c,ind) in 10">
<template v-if="ind < 3">
<div
:key="ind"
class="tag text-center"
>
嘻嘻
<template v-if="flag">
<div class="customer-box">
<template v-if="customerList.length">
<template v-for="(i,index) in customerList">
<template>
<div
:key="index"
class="item"
@click="jump(i.userid)"
>
<div class="sprite-icon icon-arrow"></div>
<div class="info">
<div class="head">
<img :src="i.avatar">
</div>
<div class="text">
<div class="name text-hide">{{ i.customerName || '--' }}</div>
{{ i.customerPhone || '--' }}
</div>
</div>
</template>
</template>
<template v-if="i.labels && i.labels.length">
<div class="tags flex">
<template v-for="(c,ind) in i.labels">
<template v-if="ind < 3">
<div
:key="ind"
class="tag text-center"
>
{{c.labelValue}}
</div>
</template>
</template>
</div>
</template>
</div>
</template>
</template>
</template>
<template v-else>
<div class="nothing">
<div class="sprite-icon icon-nothing"></div>
暂无数据
</div>
</div>
</template>
</div>
<tags-popup :value.sync="showTagsPopup"></tags-popup>
</template>
</div>
</template>
<tags-popup
:value.sync="showTagsPopup"
@confirm="search($event,'labelIds')"
></tags-popup>
</div>
</template>
......@@ -63,25 +78,34 @@ export default {
data () {
return {
showTagsPopup: false,
keyword: ''
customerList: [],
labelIds: [],
keyWord: '',
flag: false
}
},
mounted () {
this.getCustomerList()
},
methods: {
search () {
},
focus () {
search (val, name) {
this[name] = val
this.flag = false
this.getCustomerList()
},
async getCustomerList () {
const res = await entmicroApi.getCustomerList({ keyWord: '', isMiniPro: true })
console.log(res)
try {
this.showLoading()
const { labelIds, keyWord } = this,
res = await entmicroApi.getCustomerList({ keyWord, labelIds, isMiniPro: true })
this.customerList = res
this.flag = true
this.hideLoading()
} catch (error) {
this.showToast(error)
}
},
jump () {
let id = 'wm_pmOEQAAN8pOfzzqZBO5ADHxOo9-cQ'
jump (id) {
window.location.href = `/dj-scrm-wx-work-main-lwk/#/customer/detail?id=${id}`
}
}
......@@ -107,7 +131,7 @@ export default {
padding-bottom: 21px;
.item {
width: 343px;
height: 102px;
max-height: 102px;
background: #ffffff;
border-radius: 4px;
margin: 10px auto 0;
......@@ -125,22 +149,27 @@ export default {
.head {
width: 48px;
height: 48px;
border-radius: 22px;
border-radius: 4px;
overflow: hidden;
margin-right: 8px;
}
.text {
font-size: 14px;
color: #333333;
flex: 1;
.name {
font-weight: 600;
margin: 2px 0 4px;
max-width: 90%;
}
}
}
.tags {
margin-top: 10px;
overflow: hidden;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
.tag {
height: 24px;
background: #eeeeee;
......@@ -149,8 +178,21 @@ export default {
font-size: 12px;
color: #858585;
margin-right: 4px;
white-space: nowrap;
}
}
}
.nothing {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 14px;
color: #999999;
.sprite-icon {
margin-bottom: 12px;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!