Commit adc166d2 by xinla

调试客户画像

1 parent 8433f437
......@@ -28,13 +28,15 @@ export default {
let code = query.code
this.corpId = query.corpId
this.agentId = query.agentId
this.$toast('agentId:' + this.agentId)
if (!code) {
this.$toast('未获得授权')
return
}
let { data } = await getUserInfo(code, this.agentId)
this.$store.state.userId = data.userId
// this.$toast('userId:' + this.$store.state.userId)
this.$toast('userId:' + this.$store.state.userId)
},
watch: {
// 通过config接口注入权限验证配置
......@@ -49,7 +51,7 @@ export default {
reload() {
this.isRouterAlive = false
this.$nextTick(function() {
this.isRouterAlive = true
// this.isRouterAlive = true
})
},
wxConfig() {
......
/**
* 请求路径参数转为对象
* query请求路径参数转为对象
* @param {*} url
*/
export function param2Obj(url) {
const search = decodeURIComponent(url)
.split('?')[1]
.split('#')[0]
let search = decodeURIComponent(url).split('?')[1]
search = search && search.split('#')[0]
if (!search) {
return {}
}
......
......@@ -22,7 +22,7 @@
>
<van-tab :title="'添加的员工(' + staff.length + ')'">
<van-list v-model="loading" :finished="finished" @load="onLoad">
<van-cell v-for="(item,index) in staff" :key="index">
<van-cell v-for="(item, index) in staff" :key="index">
<div class="details">
<div class="detail">
<div class="left">
......@@ -56,7 +56,7 @@
</div>
<div class="right">
<div>
{{ item.groupName + "(" + item.groupMemberNum + ")" }}
{{ item.groupName + '(' + item.groupMemberNum + ')' }}
</div>
<div>
<span class="c9">群主:</span>
......@@ -82,7 +82,7 @@
</template>
<script>
import { findAddaddEmployes, findAddGroupNum } from "@/api/portrait";
import { findAddaddEmployes, findAddGroupNum } from '@/api/portrait'
export default {
data() {
return {
......@@ -95,43 +95,45 @@ export default {
groupChat: [], // 添加的群聊
commonGroup: [], // 共同的群聊
// externalUserid: "wmiGuBCgAAIH-T9ekaE-Q52N2lKWeInw",
externalUserid: "FengJuZhuDeJieDao",
userid: "45DuXiangShangQingXie", // 员工Id
};
externalUserid: '',
userid: this.$store.state.userId, // 员工Id
}
},
created() {
this.findAddaddEmployes();
this.findAddGroupNum();
this.externalUserid = this.$route.query.customerId
this.findAddaddEmployes()
this.findAddGroupNum()
},
methods: {
conGroup() {
this.groupChat = this.commonGroup
// console.log(123);
this.groupChat = this.commonGroup
// console.log(123);
},
onLoad() {
setTimeout(() => {
for (let i = 0; i < 2; i++) {
this.list.push(this.list.length + 1);
this.list.push(this.list.length + 1)
}
// 加载状态结束
this.loading = false;
this.loading = false
// 数据全部加载完成
if (this.list.length >= 2) {
this.finished = true;
this.finished = true
}
}, 1000);
}, 1000)
},
findAddaddEmployes() {
findAddaddEmployes(this.externalUserid)
.then(({ data }) => {
// console.log(data);
this.staff = data;
this.staff = data
})
.catch((err) => {
console.log(err);
});
console.log(err)
})
},
findAddGroupNum() {
findAddGroupNum({
......@@ -140,36 +142,36 @@ export default {
})
.then(({ data }) => {
// console.log(data);
// debugger
this.groupChat = data;
// debugger
this.groupChat = data
this.commonGroup = this.groupChat.filter((ele) => {
// debugger
return ele.groupMemberNum == 1;
});
return ele.groupMemberNum == 1
})
})
.catch((err) => {
console.log(err);
});
console.log(err)
})
},
// 时间处理器
getTime(data) {
const date = new Date(data);
const date = new Date(data)
// console.log(timer.getFullYear());
var Y = date.getFullYear() + "-";
var Y = date.getFullYear() + '-'
var M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
? '0' + (date.getMonth() + 1)
: date.getMonth() + 1) + '-'
var D =
date.getDate() < 10 ? "0" + date.getDate() : date.getDate() + " ";
date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + ' '
var h =
(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
var m =
date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
return Y + M + D + h + m;
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return Y + M + D + h + m
},
},
};
}
</script>
<style lang="less" scoped>
......
......@@ -101,8 +101,8 @@
</div>
</template>
<script>
import { getCustomerInfo, getWeCustomerInfo } from "@/api/portrait";
import { getUserInfo } from "@/api/common";
import { getCustomerInfo, getWeCustomerInfo } from '@/api/portrait'
import { getUserInfo } from '@/api/common'
export default {
data() {
return {
......@@ -110,57 +110,58 @@ export default {
// 接口开始
// 表单数据
form: {
externalUserid: "wm2H-nDQAACG5x4XjsM1OoW8UVfpbn3A", // 客户Id
userId: "45DuXiangShangQingXie", // 员工Id
name: "", // 昵称
remarkMobiles: "", // 手机号
birthday: "", // 客户生日
age:'',// 年龄
email: "", // 邮箱
address: "", // 地址
qq: "", // qq
position: "", // 职业
remarkCorpName: "", // 公司
description: "", // 其他描述
externalUserid: '', // 客户Id
userId: this.$store.state.userId, // 员工Id
name: '', // 昵称
remarkMobiles: '', // 手机号
birthday: '', // 客户生日
age: '', // 年龄
email: '', // 邮箱
address: '', // 地址
qq: '', // qq
position: '', // 职业
remarkCorpName: '', // 公司
description: '', // 其他描述
},
};
}
},
computed: {
// 获取客户年龄
},
created() {
this.form.externalUserid = this.$route.query.customerId
// 获取客户详细信息
getCustomerInfo({
externalUserid: this.form.externalUserid,
userId: this.form.userId,
})
.then(({ data }) => {
console.log(data);
this.form = data;
console.log(this.form);
console.log(data)
this.form = data
console.log(this.form)
})
.catch((err) => {
console.log(err);
});
console.log(err)
})
},
methods: {
edit() {
this.flage = !this.flage;
this.flage = !this.flage
},
// 点击保存按钮提交表单
saveUserInformation() {
this.flage = !this.flage;
this.flage = !this.flage
getWeCustomerInfo(this.form)
.then((data)=> {
console.log(data);
.then((data) => {
console.log(data)
})
.catch((err) => {
console.log(err);
});
console.log(err)
})
},
},
};
}
</script>
<style lang="less" scoped>
......
......@@ -26,7 +26,7 @@
</div>
</div>
</div>
<div class="data" @click="goRoute">详细资料></div>
<div class="data" @click="goRoute('/detail')">详细资料></div>
</div>
<div class="detail">
<div class="c9">手机号</div>
......@@ -123,7 +123,7 @@
<div class="realationship">
<div class="detail">
<div>社交关系</div>
<div class="data" @click="detailGoRoute()">详情</div>
<div class="data" @click="goRoute('/community')">详情</div>
</div>
<div class="detail">
<div class="boxnumber">
......@@ -387,7 +387,7 @@ export default {
// externalUserid: "wm2H-nDQAACG5x4XjsM1OoW8UVfpbn3A", // 客户Id
// externalUserid: "wmiGuBCgAAgeijfvvpJ62cBfwrB-c4kw",
externalUserid: 'FengJuZhuDeJieDao',
userid: '45DuXiangShangQingXie', // 员工Id
userid: this.$store.state.userId, // 员工Id
form: {
name: '', // 昵称
remarkMobiles: '', // 手机号
......@@ -490,7 +490,8 @@ export default {
this.styleActive4 = ''
},
activity() {
;(this.trajectoryType = 3), this.findTrajectory()
this.trajectoryType = 3
this.findTrajectory()
this.styleActive1 = ''
this.styleActive2 = ''
this.styleActive3 = 'background:#1989fa;color:#fff'
......@@ -562,18 +563,11 @@ export default {
// 点击删除按钮
deltodoshow() {},
goRoute() {
this.$router.push({
path: '/detail',
query: {
// type
},
})
},
detailGoRoute() {
goRoute(path) {
this.$router.push({
path: '/community',
path,
query: {
customerId: this.externalUserid,
// type
},
})
......@@ -695,20 +689,45 @@ export default {
},
},
created() {
// 获取客户信息
let _this = this
_this.findAddaddEmployes(),
_this.findAddGroupNum(),
_this.getCustomerInfo(),
_this.findTrajectory(),
getAllTags()
.then(({ data }) => {
// console.log(data);
this.alllabel = data
})
.catch((err) => {
console.log(err)
wx.invoke('getContext', {}, function(res) {
if (res.err_msg == 'getContext:ok') {
entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools
if (
![
'single_chat_tools',
'group_chat_tools',
'contact_profile',
].includes(entry)
) {
// _this.$toast.clear()
_this.$toast('入口错误:' + entry)
return
}
wx.invoke('getCurExternalContact', {}, (res) => {
if (res.err_msg == 'getCurExternalContact:ok') {
_this.externalUserid = res.userId //返回当前外部联系人userId
// 获取客户信息
_this.findAddaddEmployes(),
_this.findAddGroupNum(),
_this.getCustomerInfo(),
_this.findTrajectory(),
getAllTags()
.then(({ data }) => {
// console.log(data);
_this.alllabel = data
})
.catch((err) => {
console.log(err)
})
} else {
//错误处理
}
})
} else {
//错误处理
}
})
},
components: {
StepList,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!