|
@@ -1,70 +1,30 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
- <view class="topBgline plr20">
|
|
|
|
- <view class="justify-start p30 bgcolf radius12">
|
|
|
|
- <u-avatar :src='detailUser.avatar'></u-avatar>
|
|
|
|
- <view class="ml16">
|
|
|
|
- <view class="bold fs28">{{detailUser.name}}</view>
|
|
|
|
- <view class="fs24 base-color-3">备注:{{detailUser.remark}}</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="bgf p20">
|
|
|
|
- <view class="justify-between align-center">
|
|
|
|
- <view>会员资料</view>
|
|
|
|
- <view class="fs24 u-border plr20 ptb6 radius40 base-color-6"
|
|
|
|
- @click="changeuser()">修改用户信息</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-between">
|
|
|
|
- <view class="justify-start align-center fs24 mt20 widthpath" >
|
|
|
|
- <view class="base-color-6 mr40">性别</view>
|
|
|
|
- <view>{{moreInfo.sex?moreInfo.sex:'未知'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24 mt20 widthpath" >
|
|
|
|
- <view class="base-color-6 mr40">年龄</view>
|
|
|
|
- <view>{{moreInfo.age?moreInfo.age:'未知'}}</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24 mtb20">
|
|
|
|
- <view class="base-color-6 mr40">行为习惯</view>
|
|
|
|
- <view>{{moreInfo.habits?moreInfo.habits:'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24">
|
|
|
|
- <view class="base-color-6 mr40">患病时间</view>
|
|
|
|
- <view>{{moreInfo.illnessTime?moreInfo.illnessTime:'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24 mt20" >
|
|
|
|
- <view class="base-color-6 mr40">疾病</view>
|
|
|
|
- <view>{{moreInfo.disease?moreInfo.disease:'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24 mt20" >
|
|
|
|
- <view class="base-color-6 mr40">家人的疾病</view>
|
|
|
|
- <view>{{moreInfo.familyDisease?moreInfo.familyDisease:'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-between align-center">
|
|
|
|
- <view class="justify-start align-center fs24 mt20 widthpath">
|
|
|
|
- <view class="base-color-6 mr40">是否线下就诊</view>
|
|
|
|
- <view>{{moreInfo.isLine?'已线下就诊':'无'}}</view>
|
|
|
|
|
|
+ <view class="bgf center ptb20">客户详情</view>
|
|
|
|
+ <view class="topBgline plr20 column justify-center">
|
|
|
|
+ <view class="justify-between align-center radius12">
|
|
|
|
+ <view class="justify-start align-center">
|
|
|
|
+ <u-avatar :src='user.avatar' size="60"></u-avatar>
|
|
|
|
+ <view class="ml16 colorf">
|
|
|
|
+ <view class="bold fs28 ">{{user.name?user.name:'用户信息加载中...'}}</view>
|
|
|
|
+ <view class="fs24 mt20">备注:{{user.remark}}</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view class="justify-start align-center fs24 mt20 widthpath" >
|
|
|
|
- <view class="base-color-6 mr40 ">体质</view>
|
|
|
|
- <view>{{moreInfo.constitution?moreInfo.constitution:'无'}}</view>
|
|
|
|
|
|
+ <view class="ml90">
|
|
|
|
+ <view @click="clearhuan()" class=" bgcolf fs24 w160 center radius40 colorf ptb10"
|
|
|
|
+ >清除缓存</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="justify-start align-center fs24 mt20" >
|
|
|
|
- <view class="base-color-6 mr40">使用药品</view>
|
|
|
|
- <view>{{moreInfo.medicine?moreInfo.medicine:'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24 mt20" >
|
|
|
|
- <view class="base-color-6 mr40">咨询产品</view>
|
|
|
|
- <view>{{moreInfo.consultProduct?moreInfo.consultProduct:'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="justify-start align-center fs24 mt20" >
|
|
|
|
- <view class="base-color-6 mr40">是否已经购买产品</view>
|
|
|
|
- <view>{{moreInfo.isBuy?'已购买':'无'}}</view>
|
|
|
|
- </view>
|
|
|
|
</view>
|
|
</view>
|
|
- <view class="center bgf fs28">看课记录</view>
|
|
|
|
|
|
+ <view class="justify-between align-center bgf newsbox plr20">
|
|
|
|
+ <view class="fs28 pt20 fs32 bold" >看课记录</view>
|
|
|
|
+ <view class="lh45 plr20 fs24 radius40 h50 justify-between align-center" style="color: #999;"
|
|
|
|
+ @click="todetail">
|
|
|
|
+ <view> {{typestate==0?'更多详情':'点击收起'}}</view>
|
|
|
|
+ <image src="/static/arrow_up.png" class="w30 h30 ml10" v-if='typestate==1'></image>
|
|
|
|
+ <image src="/static/arrow_down.png" class="w30 h30 ml10" v-else></image>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
<view class="bgf p20">
|
|
<view class="bgf p20">
|
|
<view class="justify-start ">
|
|
<view class="justify-start ">
|
|
<view v-for="(item,index) in titname" :key="index" class="justify-start align-center ml28">
|
|
<view v-for="(item,index) in titname" :key="index" class="justify-start align-center ml28">
|
|
@@ -75,7 +35,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="fs24 mt20 base-color-6" >近{{typestate==0?'7':'30'}}天看课记录</view>
|
|
<view class="fs24 mt20 base-color-6" >近{{typestate==0?'7':'30'}}天看课记录</view>
|
|
<view class="justify-between mt20">
|
|
<view class="justify-between mt20">
|
|
- <view class="justify-start align-center mt12 " style="width: 80%;flex-wrap: wrap">
|
|
|
|
|
|
+ <view class="justify-start align-center mt12 " style="width: 100%;flex-wrap: wrap">
|
|
<view class="w54 h54 mr20 radius4 mb12" v-for="(item,index) in answerlist" :key="index"
|
|
<view class="w54 h54 mr20 radius4 mb12" v-for="(item,index) in answerlist" :key="index"
|
|
>
|
|
>
|
|
<view class="fs24 base-color-6">{{item.date.slice(-2)}}</view>
|
|
<view class="fs24 base-color-6">{{item.date.slice(-2)}}</view>
|
|
@@ -83,20 +43,80 @@
|
|
class="w30 h30 radius4"></view>
|
|
class="w30 h30 radius4"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="u-border lh45 plr20 fs24 radius40 base-color-3 h50"
|
|
|
|
- @click="todetail">{{typestate==0?'详情':'收起'}}</view>
|
|
|
|
</view>
|
|
</view>
|
|
- <view class="pt120"></view>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="bgf p20 mt20">
|
|
|
|
+ <view class="justify-between align-center">
|
|
|
|
+ <view class="bold fs32">用户信息</view>
|
|
|
|
+ <view @click="changeuser()" class="plr20 ptb6 radius40 justify-between align-center editbox">
|
|
|
|
+ <image src="/static/services_edit.png " class="w28 h28"></image>
|
|
|
|
+ <view class="fs24 ml10">修改用户信息</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt20 " >
|
|
|
|
+ <view class="base-color-9 mr40">性别</view>
|
|
|
|
+ <view>{{moreInfo.sex?moreInfo.sex:'未知'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28 " >
|
|
|
|
+ <view class="base-color-9 mr40">年龄</view>
|
|
|
|
+ <view>{{moreInfo.age?moreInfo.age:'未知'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28">
|
|
|
|
+ <view class="base-color-9 mr40">行为习惯</view>
|
|
|
|
+ <view>{{moreInfo.habits?moreInfo.habits:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28">
|
|
|
|
+ <view class="base-color-9 mr40">患病时间</view>
|
|
|
|
+ <view>{{moreInfo.illnessTime?moreInfo.illnessTime:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28" >
|
|
|
|
+ <view class="base-color-9 mr40">疾病</view>
|
|
|
|
+ <view>{{moreInfo.disease?moreInfo.disease:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28" >
|
|
|
|
+ <view class="base-color-9 mr40">家人的疾病</view>
|
|
|
|
+ <view>{{moreInfo.familyDisease?moreInfo.familyDisease:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28 ">
|
|
|
|
+ <view class="base-color-9 mr40">是否线下就诊</view>
|
|
|
|
+ <view>{{moreInfo.isLine?'已线下就诊':'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28 " >
|
|
|
|
+ <view class="base-color-9 mr40 ">体质</view>
|
|
|
|
+ <view>{{moreInfo.constitution?moreInfo.constitution:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28" >
|
|
|
|
+ <view class="base-color-9 mr40">使用药品</view>
|
|
|
|
+ <view>{{moreInfo.medicine?moreInfo.medicine:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28" >
|
|
|
|
+ <view class="base-color-9 mr40">咨询产品</view>
|
|
|
|
+ <view>{{moreInfo.consultProduct?moreInfo.consultProduct:'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="justify-between align-center fs24 mt28" >
|
|
|
|
+ <view class="base-color-9 mr40">是否已经购买产品</view>
|
|
|
|
+ <view class="prodcutbox ">{{moreInfo.isBuy?'已购买':'无'}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <!-- <view>首次进入接口{{msg122}}</view>
|
|
|
|
+ <view>验签接口{{msg123}}</view>
|
|
|
|
+ <view>获取详情接口{{msg124}}</view>
|
|
|
|
+ <view>获取用户信息接口{{msg125}}</view> -->
|
|
|
|
+ <view class="pt120"></view>
|
|
<view class="justify-around botfun bgf">
|
|
<view class="justify-around botfun bgf">
|
|
- <view class="justify-start align-center bottom-btns base-bg"
|
|
|
|
|
|
+ <view class="justify-start align-center bottom-btns"
|
|
|
|
+ style="background: linear-gradient( 90deg, #348ff0 0%, #267EF0 100%);"
|
|
@click="navTo('/pages/user/courseManage?userId='+userId)" >
|
|
@click="navTo('/pages/user/courseManage?userId='+userId)" >
|
|
<view class="colorf ml12">课程管理</view>
|
|
<view class="colorf ml12">课程管理</view>
|
|
</view>
|
|
</view>
|
|
- <view class="justify-start align-center bottom-btns base-bg"
|
|
|
|
- @click="navTo('/pages/user/UrgeClasses?userId='+userId)">
|
|
|
|
|
|
+ <view class="justify-start align-center bottom-btns"
|
|
|
|
+ style="background: linear-gradient( 90deg, #FE8227 0%, #FE4E12 100%);"
|
|
|
|
+ @click="navTo('/pages/user/UrgeClasses?userId='+userId+'&corpId='+corpId)">
|
|
<view class="colorf ml12" >催课管理</view>
|
|
<view class="colorf ml12" >催课管理</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ <u-loading-page :loading='loadingimg' bg-color="rgba(0,0,0,0.6)" loading-mode="semicircle"></u-loading-page>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -157,49 +177,173 @@
|
|
],
|
|
],
|
|
typestate:0,
|
|
typestate:0,
|
|
externalUserId:'',
|
|
externalUserId:'',
|
|
- userId:''
|
|
|
|
|
|
+ userId:null,
|
|
|
|
+ qwUserExternalId:'',
|
|
|
|
+ loadingimg:true,
|
|
|
|
+ msg122:'',
|
|
|
|
+ msg123:'',
|
|
|
|
+ msg124:'',
|
|
|
|
+ msg125:'',
|
|
|
|
+ timer: null, // 定时器ID
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- this.getuser()
|
|
|
|
|
|
+ // this.getuser()
|
|
// this.detailUser =uni.getStorageSync('detailUser')
|
|
// this.detailUser =uni.getStorageSync('detailUser')
|
|
// if(this.detailUser.status==0){
|
|
// if(this.detailUser.status==0){
|
|
// this.answerText='取消禁用'
|
|
// this.answerText='取消禁用'
|
|
// }
|
|
// }
|
|
this.qwUserId=uni.getStorageSync('qwUserId')
|
|
this.qwUserId=uni.getStorageSync('qwUserId')
|
|
- this.$nextTick(()=>{
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- this.getAnswerlists()
|
|
|
|
- },200)
|
|
|
|
- })
|
|
|
|
|
|
+ if(this.qwUserExternalId){
|
|
|
|
+ this.getuser()
|
|
|
|
+ this.getAnswerlists()
|
|
|
|
+ }
|
|
|
|
+ // this.$nextTick(()=>{
|
|
|
|
+ // setTimeout(()=>{
|
|
|
|
+ // console.log(12121212121)
|
|
|
|
+ // })
|
|
|
|
+ // },100)
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
|
},
|
|
},
|
|
- onLoad(option) {
|
|
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ // 组件销毁时清除定时器
|
|
|
|
+ clearTimeout(this.timer);
|
|
|
|
+ },
|
|
|
|
+ onLoad(options) {
|
|
|
|
+ // 启动超时计时器(10秒)
|
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
|
+ if (!this.requestCompleted) {
|
|
|
|
+ this.loadingimg = false;
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请求超时,请清除缓存!',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }, 10000);
|
|
// this.id=option.id
|
|
// this.id=option.id
|
|
this.url=window.location.href;
|
|
this.url=window.location.href;
|
|
this.code=options.code;
|
|
this.code=options.code;
|
|
this.corpId=options.corpId;
|
|
this.corpId=options.corpId;
|
|
uni.setStorageSync("corpId",this.corpId);
|
|
uni.setStorageSync("corpId",this.corpId);
|
|
this.externalUserId=uni.getStorageSync("externalUserId");
|
|
this.externalUserId=uni.getStorageSync("externalUserId");
|
|
- var userId=uni.getStorageSync("qwUserId");
|
|
|
|
- if(userId!=null&&userId!=undefined&&userId!=""){
|
|
|
|
- this.userId=userId;
|
|
|
|
- }
|
|
|
|
|
|
+ // var userId=uni.getStorageSync("qwUserId");
|
|
|
|
+ // if(userId!=null&&userId!=undefined&&userId!=""){
|
|
|
|
+ // this.userId=userId;
|
|
|
|
+ // }
|
|
|
|
+ // if(uni.getStorageSync("qwUserId")){
|
|
|
|
+ // this.userId=uni.getStorageSync("qwUserId");
|
|
|
|
+ // }
|
|
|
|
+ this.msg122=uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
|
|
this.getConfigSignature()
|
|
this.getConfigSignature()
|
|
- if(this.externalUserId!=null&&this.externalUserId!=undefined&&this.userId!=null&&this.userId!=undefined){
|
|
|
|
- console.log("获取外部联系人")
|
|
|
|
- this.getQwExternalContactDetails()
|
|
|
|
- }
|
|
|
|
|
|
+ uni.$on('urgeUser', (data) => {
|
|
|
|
+ console.log(data)
|
|
|
|
+ this.urgetoUser(data);
|
|
|
|
+ });
|
|
|
|
+ // uni.$on('urgeUser', this.urgetoUser(data));
|
|
|
|
+ uni.$on('course', (data) => {
|
|
|
|
+ this.sendInput(data);
|
|
|
|
+ });
|
|
|
|
+ // uni.$on('course', this.sendInput(data));
|
|
|
|
+ // if(this.externalUserId!=null&&this.externalUserId!=undefined&&this.userId!=null&&this.userId!=undefined){
|
|
|
|
+ // this.getQwExternalContactDetails()
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
|
|
+ onUnload() {
|
|
|
|
+ // 移除事件监听(避免内存泄漏)
|
|
|
|
+ uni.$off('course', this.sendInput());
|
|
|
|
+ uni.$off('urgeUser', this.urgetoUser());
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ clearhuan(){
|
|
|
|
+ uni.removeStorageSync('qwarrid')
|
|
|
|
+ uni.removeStorageSync('fsUserId')
|
|
|
|
+ uni.removeStorageSync('externalUserId')
|
|
|
|
+ uni.removeStorageSync('corpId')
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请退出页面后重新进入",
|
|
|
|
+ icon: 'none',
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ urgetoUser(data){
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:data.pageurl
|
|
|
|
+ })
|
|
|
|
+ console.log(data)
|
|
|
|
+ },200);
|
|
|
|
+ this.loadingimg=false
|
|
|
|
+ clearTimeout(this.timer);
|
|
|
|
+ jWeixin.openEnterpriseChat({
|
|
|
|
+ // 注意:userIds和externalUserIds至少选填一个。内部群最多2000人;外部群最多500人;如果有微信联系人,最多40人
|
|
|
|
+ externalUserIds: data.nextExternalUserIds, // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
|
|
|
|
+ groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
|
|
|
|
+ chatId: "", // 若要打开已有会话,需指定此参数。如果是新建会话,chatId必须为空串
|
|
|
|
+ success: function(res) {
|
|
|
|
+ console.log(res);
|
|
|
|
+ console.log("切换成功")
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "切换成功",
|
|
|
|
+ icon: 'none',
|
|
|
|
+ });
|
|
|
|
+ var data={cmd:"switchPage"};
|
|
|
|
+ uni.$emit('sendMsg',data);
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ fail: function(res) {
|
|
|
|
+ console.log(res);
|
|
|
|
+ console.log("切换失败")
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "切换失败",
|
|
|
|
+ icon: 'none',
|
|
|
|
+ });
|
|
|
|
+ var data={cmd:"switchPage"};
|
|
|
|
+ uni.$emit('sendMsg',data);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ sendInput(data){
|
|
|
|
+ this.loadingimg=false
|
|
|
|
+ clearTimeout(this.timer);
|
|
|
|
+ jWeixin.invoke('sendChatMessage', {
|
|
|
|
+ msgtype:"news", //消息类型,必填
|
|
|
|
+ enterChat: true,
|
|
|
|
+ news:
|
|
|
|
+ {
|
|
|
|
+ desc: data.linkDescribe,
|
|
|
|
+ title: data.linkTitle,
|
|
|
|
+ imgUrl: data.linkImageUrl,
|
|
|
|
+ link: data.linkUrl
|
|
|
|
+ }
|
|
|
|
+ }, function(res) {
|
|
|
|
+ console.log("发送成功")
|
|
|
|
+ console.log(res)
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "发送成功",
|
|
|
|
+ });
|
|
|
|
+ jWeixin.invoke('closeWindow',{
|
|
|
|
+ },function(res){
|
|
|
|
+ // alert('关闭窗口')
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
changeuser(){
|
|
changeuser(){
|
|
|
|
+ if(!this.qwUserExternalId){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '用户信息加载中...'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url:'/pages/user/editUser?externalUserId='+this.externalUserId
|
|
|
|
|
|
+ url:'/pages/user/editUser?externalUserId='+this.qwUserExternalId
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getQwExternalContactDetails(){
|
|
getQwExternalContactDetails(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中..."
|
|
|
|
+ })
|
|
var that=this
|
|
var that=this
|
|
var data = {
|
|
var data = {
|
|
corpId: this.corpId,
|
|
corpId: this.corpId,
|
|
@@ -208,35 +352,39 @@
|
|
};
|
|
};
|
|
getQwExternalContactDetails(data).then(res => {
|
|
getQwExternalContactDetails(data).then(res => {
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
|
|
+ uni.hideLoading()
|
|
this.user=res.data;
|
|
this.user=res.data;
|
|
-
|
|
|
|
|
|
+ this.qwUserExternalId=res.data.id
|
|
|
|
+ uni.setStorageSync('qwarrid',res.data.id)
|
|
|
|
+ uni.setStorageSync('fsUserId',res.data.fsUserId)
|
|
|
|
+ console.log("获取外部联系人详情接口",res)
|
|
|
|
+ this.msg124=uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
|
|
|
|
+ this.getuser()
|
|
|
|
+ this.getAnswerlists()
|
|
}else{
|
|
}else{
|
|
-
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
getConfigSignature(){
|
|
getConfigSignature(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中..."
|
|
|
|
+ })
|
|
|
|
+
|
|
var data = {
|
|
var data = {
|
|
corpId: this.corpId,
|
|
corpId: this.corpId,
|
|
url: this.url,
|
|
url: this.url,
|
|
code: this.code
|
|
code: this.code
|
|
};
|
|
};
|
|
- if(this.userId!=null){
|
|
|
|
- data.isGetUserId=0;
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
|
|
+ // if(this.userId==null || this.userId==""){
|
|
data.isGetUserId=1;
|
|
data.isGetUserId=1;
|
|
- }
|
|
|
|
- var that=this;
|
|
|
|
- // var obj={cmd:"log",data:"getConfigSignature开始"};
|
|
|
|
- // uni.$emit('sendMsg',obj);
|
|
|
|
|
|
+ // }
|
|
|
|
+ // else{
|
|
|
|
+ // data.isGetUserId=0;
|
|
|
|
+ // }
|
|
getConfigSignature(data).then(
|
|
getConfigSignature(data).then(
|
|
- res => {
|
|
|
|
- console.log(res)
|
|
|
|
- // var obj={cmd:"log",data:JSON.stringify(res)};
|
|
|
|
- // uni.$emit('sendMsg',obj);
|
|
|
|
|
|
+ res => {
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
- that.isConfig=true;
|
|
|
|
|
|
+ this.isConfig=true;
|
|
const agentConfigSignature = res.config.agentConfigSignature;
|
|
const agentConfigSignature = res.config.agentConfigSignature;
|
|
const configSignature = res.config.configSignature;
|
|
const configSignature = res.config.configSignature;
|
|
const corpId = res.config.corpId;
|
|
const corpId = res.config.corpId;
|
|
@@ -244,15 +392,16 @@
|
|
const timestamp = res.config.timestamp;
|
|
const timestamp = res.config.timestamp;
|
|
const agentId = res.config.agentId;
|
|
const agentId = res.config.agentId;
|
|
|
|
|
|
- if(res.config.userid!=null&&res.config.userid!=''){
|
|
|
|
- that.userId = res.config.userid;//当前员工ID
|
|
|
|
- uni.setStorageSync("qwUserId",that.userId);
|
|
|
|
- console.log("获取到USERID")
|
|
|
|
|
|
+ if(res.config.userid!=null || res.config.userid!=''){
|
|
|
|
+ this.userId = res.config.userid;//当前员工ID
|
|
|
|
+ uni.setStorageSync("qwUserId",this.userId);
|
|
|
|
+ // console.log("获取到USERID")
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- console.log("不需要获取USERID")
|
|
|
|
|
|
+ // console.log("不需要获取USERID")
|
|
}
|
|
}
|
|
- console.log(this.userId)
|
|
|
|
|
|
+ // console.log(this.userId)
|
|
|
|
+ var that=this;
|
|
jWeixin.config({
|
|
jWeixin.config({
|
|
beta: true,
|
|
beta: true,
|
|
debug: false,
|
|
debug: false,
|
|
@@ -260,18 +409,8 @@
|
|
timestamp: timestamp,
|
|
timestamp: timestamp,
|
|
nonceStr: nonceStr,
|
|
nonceStr: nonceStr,
|
|
signature: configSignature,
|
|
signature: configSignature,
|
|
- jsApiList: ['getCurExternalContact','sendChatMessage','openEnterpriseChat']
|
|
|
|
|
|
+ jsApiList: ['getCurExternalContact','sendChatMessage','openEnterpriseChat','shareToExternalContact','closeWindow']
|
|
});
|
|
});
|
|
- // const newSignature={
|
|
|
|
- // 'timestamp':timestamp,
|
|
|
|
- // 'nonceStr':nonceStr,
|
|
|
|
- // 'signature':configSignature,
|
|
|
|
- // }
|
|
|
|
- // ww.register({
|
|
|
|
- // corpId: corpId, // 必填,当前用户企业所属企业ID
|
|
|
|
- // jsApiList: ['openEnterpriseChat'], // 必填,需要使用的JSAPI列表
|
|
|
|
- // newSignature // 必填,根据url生成企业签名的回调函数
|
|
|
|
- // })
|
|
|
|
jWeixin.ready(() => {
|
|
jWeixin.ready(() => {
|
|
jWeixin.agentConfig({
|
|
jWeixin.agentConfig({
|
|
corpid: corpId,
|
|
corpid: corpId,
|
|
@@ -279,70 +418,20 @@
|
|
timestamp: timestamp,
|
|
timestamp: timestamp,
|
|
nonceStr: nonceStr,
|
|
nonceStr: nonceStr,
|
|
signature: agentConfigSignature,
|
|
signature: agentConfigSignature,
|
|
- jsApiList: ['getCurExternalContact','sendChatMessage','openEnterpriseChat'],
|
|
|
|
|
|
+ jsApiList: ['getCurExternalContact','sendChatMessage','openEnterpriseChat','shareToExternalContact','closeWindow'],
|
|
success: (res) => {
|
|
success: (res) => {
|
|
jWeixin.invoke('getCurExternalContact', {}, async (res) => {
|
|
jWeixin.invoke('getCurExternalContact', {}, async (res) => {
|
|
if (res.err_msg === "getCurExternalContact:ok") {
|
|
if (res.err_msg === "getCurExternalContact:ok") {
|
|
|
|
+ this.msg123=uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
|
|
|
|
+ uni.hideLoading()
|
|
that.externalUserId = res.userId;
|
|
that.externalUserId = res.userId;
|
|
uni.setStorageSync("externalUserId",res.userId)
|
|
uni.setStorageSync("externalUserId",res.userId)
|
|
that.getQwExternalContactDetails()
|
|
that.getQwExternalContactDetails()
|
|
- // that.initInterval=setInterval(function(){
|
|
|
|
- // if(that.isInit){
|
|
|
|
- // clearInterval(that.initInterval);
|
|
|
|
- // that.getQwSopLogsByJsApi();
|
|
|
|
- // }
|
|
|
|
- // },200)
|
|
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
// 错误处理
|
|
// 错误处理
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- // jWeixin.openEnterpriseChat({
|
|
|
|
- // // 注意:userIds和externalUserIds至少选填一个。内部群最多2000人;外部群最多500人;如果有微信联系人,最多40人
|
|
|
|
- // externalUserIds: 'wmfFKfDQAAhvgwhJr9fqkRWjvN0CzFcA', // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
|
|
|
|
- // groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
|
|
|
|
- // chatId: "", // 若要打开已有会话,需指定此参数。如果是新建会话,chatId必须为空串
|
|
|
|
- // success: function(res) {
|
|
|
|
- // var chatId = res.chatId; //返回当前群聊ID,仅当使用agentConfig注入该接口权限时才返回chatId
|
|
|
|
- // // 回调
|
|
|
|
- // that.externalUserId=res.chatId;
|
|
|
|
- // console.log(res)
|
|
|
|
- // setTimeout(function(){
|
|
|
|
- // jWeixin.invoke('sendChatMessage', {
|
|
|
|
- // msgtype:"news", //消息类型,必填
|
|
|
|
- // enterChat: true,
|
|
|
|
- // text: {
|
|
|
|
- // content:"你好11111111111111111", //文本内容
|
|
|
|
- // },
|
|
|
|
- // news:
|
|
|
|
- // {
|
|
|
|
- // link: "https://www.baidu.com/", //H5消息页面url 必填
|
|
|
|
- // title: "百度一下", //H5消息标题
|
|
|
|
- // desc: "百度一下你就知道", //H5消息摘要
|
|
|
|
- // imgUrl: "https://cos.his.cdwjyyh.com/fs/20240914/efc6995ee755489b8a3e0c8413846a4e.jpg", //H5消息封面图片URL
|
|
|
|
- // },
|
|
|
|
- // }, function(res) {
|
|
|
|
-
|
|
|
|
- // if (res.err_msg == 'sendChatMessage:ok') {
|
|
|
|
- // //发送成功
|
|
|
|
- // uni.showToast({
|
|
|
|
- // title: "回车发送",
|
|
|
|
- // icon: 'none',
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },500);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // },
|
|
|
|
- // fail: function(res) {
|
|
|
|
- // if(res.errMsg.indexOf('function not exist') > -1){
|
|
|
|
- // alert('版本过低请升级')
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
fail: (res) => {
|
|
fail: (res) => {
|
|
console.error('agentConfig fail:', res);
|
|
console.error('agentConfig fail:', res);
|
|
@@ -350,13 +439,12 @@
|
|
});
|
|
});
|
|
});
|
|
});
|
|
jWeixin.error((res) => {
|
|
jWeixin.error((res) => {
|
|
-
|
|
|
|
console.error('wx.error:', res);
|
|
console.error('wx.error:', res);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
// uni.setStorageSync("qwUserId",null);
|
|
// uni.setStorageSync("qwUserId",null);
|
|
- console.log("获取USERID失败")
|
|
|
|
|
|
+ // console.log("获取USERID失败")
|
|
// setTimeout(function(){
|
|
// setTimeout(function(){
|
|
// window.location.reload();
|
|
// window.location.reload();
|
|
// },5000);
|
|
// },5000);
|
|
@@ -365,7 +453,7 @@
|
|
rej => {
|
|
rej => {
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
window.location.reload();
|
|
window.location.reload();
|
|
- },5000);
|
|
|
|
|
|
+ },500);
|
|
}
|
|
}
|
|
);
|
|
);
|
|
},
|
|
},
|
|
@@ -378,13 +466,20 @@
|
|
this.getAnswerlists()
|
|
this.getAnswerlists()
|
|
},
|
|
},
|
|
getuser(){
|
|
getuser(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中..."
|
|
|
|
+ })
|
|
const data={
|
|
const data={
|
|
- qwExternalContactId:this.externalUserId
|
|
|
|
|
|
+ qwExternalContactId:this.qwUserExternalId
|
|
}
|
|
}
|
|
getcustomer(data).then(res=>{
|
|
getcustomer(data).then(res=>{
|
|
|
|
+ console.log('获取客户详情记录接口',res)
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.detailUser=res.data
|
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ this.msg125=uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
|
|
|
|
+ console.log('用户详情',this.detailUser)
|
|
this.moreInfo=res.moreInfo
|
|
this.moreInfo=res.moreInfo
|
|
|
|
+ console.log('用户的ai信息详情',this.moreInfo)
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -394,13 +489,27 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getAnswerlists() {
|
|
getAnswerlists() {
|
|
|
|
+ if(!this.qwUserExternalId){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '用户信息加载中...'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中..."
|
|
|
|
+ })
|
|
const params = {
|
|
const params = {
|
|
type:this.typestate,
|
|
type:this.typestate,
|
|
- qwExternalContactId:this.externalUserId
|
|
|
|
|
|
+ qwExternalContactId:this.qwUserExternalId
|
|
}
|
|
}
|
|
getcustomerlist(params).then(res => {
|
|
getcustomerlist(params).then(res => {
|
|
|
|
+ uni.hideLoading()
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
|
+ clearTimeout(this.timer);
|
|
|
|
+ this.loadingimg=false
|
|
this.answerlist=res.data.data
|
|
this.answerlist=res.data.data
|
|
|
|
+ console.log('看课记录内容',this.answerlist)
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -419,17 +528,28 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
- .widthpath {
|
|
|
|
- width: 50%;
|
|
|
|
|
|
+ page{
|
|
|
|
+ background-color: #F5F7FA;
|
|
|
|
+ }
|
|
|
|
+ .prodcutbox{
|
|
|
|
+ max-width: 60%;
|
|
|
|
+ word-wrap: break-word;
|
|
|
|
+ }
|
|
|
|
+ .editbox{
|
|
|
|
+ border: 2rpx #ECECEC solid;
|
|
|
|
+ color: #757575;
|
|
}
|
|
}
|
|
-
|
|
|
|
.topBgline {
|
|
.topBgline {
|
|
- background: linear-gradient(to right, rgba(225, 238, 255, 1), rgba(223, 224, 254, 1));
|
|
|
|
- padding-top: 40rpx;
|
|
|
|
|
|
+ background:#3975C6;
|
|
|
|
+ // padding-top: 40rpx;
|
|
|
|
+ height: 220rpx;
|
|
|
|
+ }
|
|
|
|
+ .newsbox{
|
|
|
|
+ margin-top: -20rpx;
|
|
|
|
+ border-radius: 24rpx 24rpx 0 0;
|
|
}
|
|
}
|
|
-
|
|
|
|
.bgcolf {
|
|
.bgcolf {
|
|
- background: rgba(255, 255, 255, 0.4);
|
|
|
|
|
|
+ background: rgba(255, 255, 255, 0.3);
|
|
}
|
|
}
|
|
|
|
|
|
.actsel {
|
|
.actsel {
|
|
@@ -457,7 +577,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
.bottom-btns {
|
|
.bottom-btns {
|
|
- padding: 10rpx 40rpx;
|
|
|
|
|
|
+ padding: 16rpx 80rpx;
|
|
border-radius: 50rpx;
|
|
border-radius: 50rpx;
|
|
}
|
|
}
|
|
|
|
|