Commit a9b2fab3 by 王志慧
2 parents 45d0a925 260d699e
......@@ -26,15 +26,15 @@ Vue.prototype.api = api
Vue.prototype.bus = bus
Vue.prototype.tools = tools
Vue.prototype.local = local
Vue.prototype.to = function(name, params) {
if (name === -1) {
router.go(-1)
return
}
router.push({ name, params })
Vue.prototype.to = function (name, params) {
if (name === -1) {
router.go(-1)
return
}
// 移动端适配 rem
// import 'lib-flexible/flexible.js'
router.push({ name, params })
}
// 移动端适配 rem
// import 'lib-flexible/flexible.js'
Vue.config.productionTip = false
......@@ -47,7 +47,7 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn
Vue.use(cfg)
window.$fetchConfig = res
/**登录过期 重新登录 */
/**登录过期 重新登录 */
window.reLogin = () => {
console.log('重新登录')
util.clearSessionId()
......@@ -59,4 +59,4 @@ fetchConfig(!isMock).then(res => {
store,
render: h => h(App)
})
})
\ No newline at end of file
})
const pages = {
customerGroup: [{
name: 'index',
name: 'index'
},
{ name: 'mass' }
],
......@@ -37,6 +37,12 @@ const pages = {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
}
}, {
name: 'editDetail',
meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
}
}]
......
<template>
<div style="padding-bottom: 30px">
<div class="detail-bg detail-first">
<div class="detail-customer">
<div class="sprite-icon icon-avatar"></div>
<div class="detail-customer-name">
<span class="name">小晶</span>
<span class="wechat">@微信</span>
<div>女</div>
</div>
</div>
<div class="detail-member">
<span class="name">所属成员</span>
<span>陈晓凯、熬浓</span>
</div>
</div>
<div class="detail-second">
<van-cell-group :class="[isMore ? '' : 'more-hidden']" inset>
<van-cell title="添加时间" value="内容" />
<van-cell title="添加渠道" value="内容" />
<van-cell title="联系电话" value="2324" is-link @click="toEdit('设置联系电话')" />
<van-cell title="身份证号码" value="123412412" is-link @click="toEdit('设置身份证号码')" />
<van-cell title="购车日期" :value="date" @click="show = true" is-link />
<van-cell title="近期保养日期" :value="date" @click="show = true" is-link />
<van-cell title="近期到店日期" :value="date" @click="show = true" is-link />
<van-cell title="商业险到期日期" :value="date" @click="show = true" is-link />
<van-cell title="车系" value="123412412" is-link @click="toEdit('设置车系')" />
<van-cell title="车型" value="123412412" is-link @click="toEdit('设置车型')" />
<van-calendar v-model="show" color="#6760ff" @confirm="onConfirm" />
</van-cell-group>
<div class="detail-more" @click="moreInfo">{{ isMore ? '收起' : '更多信息' }}</div>
</div>
<div class="detail-bg detail-third">
<div class="title">客户标签</div>
<div class="detail-label">
<div v-if="labelist.length == 0" class="no-label">
<div class="btn">
<van-icon name="plus" />
<span>标签</span>
</div>
</div>
<div class="has-label" v-else>
<div>
<div v-for="item in labelist" :key="item.id" class="label-text">{{ item.name }}</div>
</div>
<div class="btn-box">
<div class="btn">
<van-icon name="plus" />
<span>标签</span>
</div>
</div>
</div>
</div>
</div>
<div class="detail-bg detail-fourth">
<div class="title">所属群聊</div>
<div class="detail-group">
<div v-if="groupList.length == 0" class="no-data">暂无数据</div>
<div v-else>
<div v-for="itm in groupList" :key="itm.id" class="group-item">
<div class="group-avatar"></div>
<div class="name">{{ itm.groupName }}({{ itm.num }})</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
show: false,
date: '',
value: '',
isMore: false,
labelist: [
{
id: 1,
name: '即将离开'
},
{
id: 2,
name: '大四'
},
{
id: 3,
name: '大四'
},
{
id: 4,
name: '大四'
},
{
id: 5,
name: '大四'
},
{
id: 6,
name: '大四'
}
],
groupList: [
{
id: 1,
groupName: '发发呆',
num: 2
},
{
id: 2,
groupName: '烦的还是挺好的发挥地方',
num: 4
},
{
id: 3,
groupName: '和任何人聚',
num: 6
}
]
}
},
methods: {
onConfirm(date) {
console.log(date)
// const [start, end] = date
this.show = false
this.date = date
// this.date = `${this.formatDate(start)} - ${this.formatDate(end)}`
},
moreInfo() {
this.isMore = !this.isMore
},
toEdit(title, value) {
this.$router.push({
name: 'customer.editDetail',
params: { title }
})
}
}
}
</script>
<style lang="scss" scope>
.detail-bg {
background-color: #fff;
border-radius: 4px;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
}
.detail-first {
padding: 22px 10px 0;
margin: 10px 16px;
.detail-customer {
display: flex;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
padding: 0 10px 21px;
&-name {
font-size: 16px;
margin-left: 16px;
color: #333;
.name {
font-weight: 600;
margin-right: 6px;
}
.wechat {
color: #6760ff;
}
div {
font-size: 14px;
}
}
}
.detail-member {
display: flex;
align-items: center;
font-size: 14px;
height: 42px;
color: #333;
.name {
color: #999;
padding: 0 10px;
// border-right: 1px solid #999;
margin-right: 10px;
position: relative;
&::after {
content: '';
display: block;
width: 1px;
height: 14px;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
background-color: #999;
}
}
}
}
.detail-second {
.van-cell-group {
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
}
.more-hidden {
max-height: 132px;
overflow: hidden;
}
.detail-more {
background-color: #ededed;
border-radius: 0 0 4px 4px;
color: #999;
font-size: 12px;
text-align: center;
line-height: 18px;
padding: 5px 0;
margin: 0 16px;
}
}
.detail-third {
margin: 10px 16px;
padding: 10px 16px;
.title {
font-size: 16px;
color: #333;
font-weight: 600;
}
.detail-label {
position: relative;
min-height: 65px;
.no-label {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn {
width: 60px;
height: 20px;
background-color: #5850ff;
color: #fff;
font-size: 12px;
text-align: center;
border-radius: 11px;
padding: 4px;
}
.has-label {
// display: flex;
margin-top: 20px;
.btn-box {
display: flex;
justify-content: flex-end;
}
}
.label-text {
display: inline-block;
margin: 0 4px 4px 0;
max-width: 66px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
border-radius: 14px;
background-color: rgba(88, 80, 255, 0.15);
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 4px 12px;
text-align: center;
box-sizing: border-box;
}
}
}
.detail-fourth {
margin: 10px 16px;
padding: 10px 16px 0;
.detail-group {
min-height: 81px;
position: relative;
margin-top: 4px;
.no-data {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 12px;
color: #999;
}
.group-item {
display: flex;
align-items: center;
padding: 17px 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
&:last-child {
border-bottom: none;
}
.group-avatar {
width: 44px;
height: 44px;
background-color: #e1e1e1;
}
.name {
font-size: 16px;
color: #333;
font-weight: 500;
margin-left: 10px;
}
}
}
}
</style>
<template>
<div class="edit-wrapper">
<van-field v-model="value" placeholder="请输入" />
<div class="submit">保存</div>
</div>
</template>
<script>
export default {
data() {
return {
value: ''
}
},
created() {
document.title = this.$route.params.title
}
}
</script>
<style lang="scss" scope>
.edit-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.submit {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 16px;
left: 50%;
transform: translateX(-50%);
width: 343px;
height: 42px;
background-color: #5859ff;
border-radius: 21px;
font-size: 14px;
color: #fff;
}
</style>
\ No newline at end of file
......@@ -118,13 +118,12 @@ export default {
methods: {
// 创建群聊or进入群聊
addGroup() {
window.$wx.openEnterpriseChat(this.addGroupParams).then(res => {
this.insertParams.chatId = res.chatId
this.insertParams.externalUserId = this.userId
this.insertParams.templateId = this.templateId
// console.log(this.insertParams, '99999999')
if (this.addGroupParams.chatId == '') {
console.log(this.addGroupParams, '-----')
if (this.addGroupParams.chatId == '') {
window.$wx.openEnterpriseChat(this.addGroupParams).then(res => {
this.insertParams.chatId = res.chatId
this.insertParams.externalUserId = this.userId
this.insertParams.templateId = this.templateId
//保存新群
groupChat.addChat(this.insertParams).then(res => {
console.log(res, '???')
......@@ -133,16 +132,21 @@ export default {
console.log(this.addGroupParams.chatId, '55555')
})
})
}
})
})
} else {
window.$wx.openExistedChatWithMsg({ chatId: this.addGroupParams.chatId }).then(res => {
console.log(this.addGroupParams.chatId, '55555')
})
}
},
showDialog(item) {
this.dialogMessage = item.userList
this.show = true
this.addGroupParams.externalUserIds.push(this.userId)
let arr = []
for (var i = 0; i < item.userList.length; i++) {
this.addGroupParams.userIds.push(item.userList[i].id)
arr.push(item.userList[i].userId)
}
this.addGroupParams.userIds = arr
this.addGroupParams.groupName = item.groupName
if (item.chatId == null) {
this.addGroupParams.chatId = ''
......@@ -161,6 +165,7 @@ export default {
console.log(res, '11111')
this.userId = res
let externalUserId = this.userId
this.addGroupParams.externalUserIds.push(this.userId)
//获取客户信息
groupChat.getDetail({ externalUserId }).then(res => {
console.log(res.data, 'data')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!