|
@@ -1,15 +1,16 @@
|
|
|
<template>
|
|
|
- <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%;">
|
|
|
+ <div :style="{backgroundColor: '#f0f2f5', paddingBottom: !extend && '20px', minHeight: '100%'}">
|
|
|
<!-- 客户详情 -->
|
|
|
<div v-if="showDetail">
|
|
|
- <div style="padding: 20px; background-color: #fff;">
|
|
|
+ <div v-if="!extend" style="padding: 20px; background-color: #fff;">
|
|
|
客户详情
|
|
|
</div>
|
|
|
<!-- 基本信息 -->
|
|
|
- <el-descriptions class="detail-description" title="基本信息" :column="3" size="medium" border>
|
|
|
+ <el-descriptions :class="extend ? 'detail-description-extend' : 'detail-description'" title="基本信息" :column="extend ? 2 : 3" size="medium" border>
|
|
|
<template slot="extra">
|
|
|
<el-button size="mini" round @click="updateQwDetail">修改用户信息</el-button>
|
|
|
</template>
|
|
|
+ <el-descriptions-item label="姓名">{{qwUserInfo.name || '未知'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label="性别">{{qwUserDetail.sex || '未知'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label="年龄">{{qwUserDetail.age || '未知'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label="行为习惯">{{qwUserDetail.habits || '无'}}</el-descriptions-item>
|
|
@@ -20,11 +21,11 @@
|
|
|
<el-descriptions-item label="体质">{{qwUserDetail.constitution || '无'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label="使用药品">{{qwUserDetail.medicine || '无'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label="咨询产品">{{qwUserDetail.consultProduct || '无'}}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="是否已经购买产品">{{qwUserDetail.isBuy || '无'}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="是否已购产品">{{qwUserDetail.isBuy || '无'}}</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
|
|
|
<!-- 看课记录 -->
|
|
|
- <div style="background-color: #FFF;margin: 10px">
|
|
|
+ <div :style="{backgroundColor: '#FFF',margin: !extend ? '10px' : '5px 0'}">
|
|
|
<div style="padding: 10px;font-weight: bold">
|
|
|
看课记录
|
|
|
</div>
|
|
@@ -71,7 +72,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 购买记录 -->
|
|
|
- <div style="background-color: #FFF;margin: 10px" v-if="qwUserInfo.fsUserId">
|
|
|
+ <div :style="{backgroundColor: '#FFF',margin: !extend ? '10px' : '5px 0'}" v-if="qwUserInfo.fsUserId">
|
|
|
<div style="padding: 10px;font-weight: bold">
|
|
|
用户订单
|
|
|
</div>
|
|
@@ -79,7 +80,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 已看过课程 -->
|
|
|
- <div style="background-color: #FFF;margin: 10px" v-if="qwUserInfo.fsUserId">
|
|
|
+ <div :style="{backgroundColor: '#FFF',margin: extend ? '5px 0' : '10px'}" v-if="qwUserInfo.fsUserId">
|
|
|
<div style="padding: 10px;font-weight: bold">
|
|
|
用户看课记录
|
|
|
</div>
|
|
@@ -99,6 +100,7 @@
|
|
|
<!-- 课程管理 -->
|
|
|
<course-manage
|
|
|
v-if="showCourseManage"
|
|
|
+ :extend="extend"
|
|
|
:userId="qwUserInfo.id"
|
|
|
@back="handleBack"
|
|
|
/>
|
|
@@ -114,6 +116,16 @@ import {getQwExternalContactDetails, getQwUserInfo, queryCourseWatchStatistics}
|
|
|
|
|
|
export default {
|
|
|
name: "userDetail",
|
|
|
+ props: {
|
|
|
+ extId: {
|
|
|
+ type: String,
|
|
|
+ default: null
|
|
|
+ },
|
|
|
+ extend: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
components: {
|
|
|
userStorerDetails,
|
|
|
userCourseWatchLog,
|
|
@@ -131,7 +143,7 @@ export default {
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
- extId: null,
|
|
|
+ localExtId: this.extId,
|
|
|
qwUserInfo: {},
|
|
|
qwUserDetail: {},
|
|
|
showDetail: true,
|
|
@@ -149,9 +161,21 @@ export default {
|
|
|
showCourseManage: false,
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ if (this.extId) {
|
|
|
+ this.getDetail(this.extId)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ extId(newVal) {
|
|
|
+ if (newVal) {
|
|
|
+ this.getDetail(newVal);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
getDetail(extId) {
|
|
|
- this.extId = extId
|
|
|
+ this.localExtId = extId
|
|
|
this.getQwExternalContactDetails()
|
|
|
this.getQwUserInfo()
|
|
|
this.queryCourseWatchStatistics()
|
|
@@ -159,7 +183,7 @@ export default {
|
|
|
queryCourseWatchStatistics() {
|
|
|
const data = {
|
|
|
type: 0,
|
|
|
- qwExternalContactId: this.extId
|
|
|
+ qwExternalContactId: this.localExtId
|
|
|
}
|
|
|
queryCourseWatchStatistics(data).then(response => {
|
|
|
this.courseWatch7day = response.data.data
|
|
@@ -167,7 +191,7 @@ export default {
|
|
|
},
|
|
|
getQwExternalContactDetails() {
|
|
|
const query = {
|
|
|
- qwExternalContactId: this.extId
|
|
|
+ qwExternalContactId: this.localExtId
|
|
|
}
|
|
|
getQwExternalContactDetails(query).then(response => {
|
|
|
this.qwUserInfo = response.data
|
|
@@ -181,7 +205,7 @@ export default {
|
|
|
},
|
|
|
getQwUserInfo() {
|
|
|
const query = {
|
|
|
- qwExternalContactId: this.extId
|
|
|
+ qwExternalContactId: this.localExtId
|
|
|
}
|
|
|
getQwUserInfo(query).then(response => {
|
|
|
this.qwUserDetail = response.moreInfo
|
|
@@ -192,7 +216,7 @@ export default {
|
|
|
this.showUpdate = true
|
|
|
},
|
|
|
handleBack() {
|
|
|
- this.getQwUserInfo()
|
|
|
+ this.getDetail(this.localExtId)
|
|
|
this.showDetail = true
|
|
|
this.showUpdate = false
|
|
|
this.showCourseManage = false
|
|
@@ -301,4 +325,11 @@ export default {
|
|
|
padding: 10px;
|
|
|
background-color: #FFF;
|
|
|
}
|
|
|
+.detail-description-extend {
|
|
|
+ padding: 10px;
|
|
|
+ background-color: #FFF;
|
|
|
+}
|
|
|
+::v-deep .detail-description-extend .el-descriptions__title {
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
</style>
|