Browse Source

企微聊天及详情

Long 3 weeks ago
parent
commit
0c2911eac7

+ 59 - 0
src/api/store/userAddress.js

@@ -0,0 +1,59 @@
+import request from '@/utils/request'
+
+// 查询用户地址列表
+export function listUserAddress(query) {
+  return request({
+    url: '/store/userAddress/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户地址详细
+export function getUserAddress(addressId) {
+  return request({
+    url: '/store/userAddress/' + addressId,
+    method: 'get'
+  })
+}
+export function getAddress(address) {
+  return request({
+    url: '/store/userAddress/getAddress/' + address,
+    method: 'get'
+  })
+}
+
+// 新增用户地址
+export function addUserAddress(data) {
+  return request({
+    url: '/store/userAddress',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户地址
+export function updateUserAddress(data) {
+  return request({
+    url: '/store/userAddress',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户地址
+export function delUserAddress(addressId) {
+  return request({
+    url: '/store/userAddress/' + addressId,
+    method: 'delete'
+  })
+}
+
+// 导出用户地址
+export function exportUserAddress(query) {
+  return request({
+    url: '/store/userAddress/export',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
src/api/users/user.js

@@ -88,3 +88,12 @@ export function enabledUsers(data) {
     data: data
   })
 }
+
+// 根据sessionId获取用户信息
+export function getUserInfoBySessionId(query) {
+  return request({
+    url: '/users/user/getUserInfoBySessionId',
+    method: 'get',
+    params: query
+  })
+}

BIN
src/assets/image/qw-im.png


+ 34 - 1
src/layout/index.vue

@@ -45,7 +45,16 @@
         </div>
       </div>
 
+      <div class="qw-im">
+        <img alt="" class="qw-im-img" @click="() => {this.qw.open = !this.qw.open}" src="../assets/image/qw-im.png"/>
+      </div>
     </div>
+
+    <el-dialog append-to-body width="1200px" :visible.sync="qw.open" :title="qw.title" :show-close="false">
+      <div class="qw-im-content">
+        <QwIM/>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -54,6 +63,7 @@ import RightPanel from '@/components/RightPanel'
 import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
 import ResizeMixin from './mixin/ResizeHandler'
 import { mapState } from 'vuex'
+import QwIM from '@/views/qw/qwChat/qq.vue'
 
 
 export default {
@@ -64,7 +74,8 @@ export default {
     RightPanel,
     Settings,
     Sidebar,
-    TagsView
+    TagsView,
+    QwIM
   },
   mixins: [ResizeMixin],
   computed: {
@@ -94,6 +105,10 @@ export default {
         open:false,
         title:'呼叫'
       },
+      qw: {
+        open: false,
+        title: ''
+      }
     }
   },
   created() {
@@ -302,4 +317,22 @@ export default {
 
 }
 
+.qw-im {
+  z-index: 2000;
+  position: fixed;
+  right: 30px;
+  bottom: 30px;
+  width: 50px;
+  height: 50px;
+  .qw-im-img {
+    border-radius: 30px;
+    width: 100%;
+  }
+}
+
+.qw-im-content {
+  width: 100%;
+  height: 730px;
+}
+
 </style>

+ 2 - 2
src/main.js

@@ -51,8 +51,8 @@ Vue.prototype.callMobile = callMobile
 import LemonIMUI from '@/components/LemonUI';
 Vue.use(LemonIMUI);
 
-import qwIm  from "@/utils/webSocket";
-Vue.prototype.qwIm = qwIm
+// import qwIm  from "@/utils/webSocket";
+// Vue.prototype.qwIm = qwIm
 
 // Vue.prototype.callOffMobile = callOffMobile
 // Vue.prototype.getSipAccount = getSipAccount

+ 26 - 354
src/views/qw/qwChat/qq.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div style="width: 100%;height: 100%">
 
     <el-tabs type="card" v-model="appKey" @tab-click="qwUserChange">
       <el-tab-pane
@@ -13,7 +13,7 @@
       <lemon-imui  class="lemon-slot"
                    :width="windowWidth"
                    :height="windowHeight"
-                   :user="UserData"
+                   :user="userData"
                    ref="IMUI"
                    :contact-contextmenu="contactContextmenu"
                    :theme="theme"
@@ -31,81 +31,26 @@
                    @pick-image="handleImageClick"
                    @send="handleSend">
         <template #cover>
-          <div class="cover">
-            <!-- <i class="lemon-icon-message"></i>
-            <p>
-                <b>自定义封面 Lemon</b>IMUI
-            </p> -->
+          <div>
           </div>
         </template>
         <template #message-title="contact">
           <div>
-            <div style="display:flex;justify-content:space-between">
-              <span>{{contact.displayName}}</span>
-              <span style="font-size:12px;">
-                <el-button size="mini" @click="showDetail">详情</el-button>
-<!--                      <el-button size="mini"  @click="openDrawer('right')">侧边栏</el-button>-->
-                <!--                      <span style="cursor:pointer;"  @click="openDrawer('right')">-->
-                <!--                        右侧  |-->
-                <!--                      </span>-->
-                <!--                      <span style="cursor:pointer;" @click="openDrawer('rightInside')">-->
-                <!--                        右侧内部  |-->
-                <!--                      </span>-->
-                <!--                      <span style="cursor:pointer;" @click="openDrawer('center')">-->
-                <!--                        居中-->
-                <!--                      </span>-->
-                    </span>
-            </div>
-            <div v-if="contact.isGroup" class="slot-group-menu">
-              <span>聊天</span>
-              <span>公告</span>
-              <span>相册</span>
-              <span>文件</span>
-              <span>活动</span>
-              <span>设置(左键弹出菜单)</span>
-            </div>
           </div>
         </template>
 
         <template #sidebar-contact-fixedtop="contact">
-          <div class="slot-contact-fixedtop">
-            <el-input size="mini" class="slot-search" placeholder="搜索通讯录" />
+          <div>
           </div>
         </template>
 
         <template #sidebar-message-fixedtop="message">
-          <div class="slot-message-fixedtop">
-            <el-input size="mini" v-model="contactName" class="slot-search" placeholder="搜索" />
+          <div>
           </div>
         </template>
 
         <template #message-side="contact">
-          <div v-if="contact.isGroup" class="slot-group">
-            <div class="slot-group-title">群通知</div>
-            <div class="slot-group-notice">
-              进群请改备注,格式,工作地点-姓名,请大家配合谢谢
-            </div>
-            <div class="slot-group-title">群成员</div>
-            <div class="slot-group-panel">
-              <input class="slot-search" placeholder="搜索群成员" />
-              <div class="slot-group-member">
-                <div class="avatar"><img src="https://p.qqan.com/up/2020-2/2020022821001845128.jpg"></div>
-                <div class="name">像梦一样自由</div>
-              </div>
-              <div class="slot-group-member">
-                <div class="avatar"><img src="https://p.qqan.com/up/2018-4/15244505348390471.jpg"></div>
-                <div class="name">野火</div>
-              </div>
-              <div class="slot-group-member">
-                <div class="avatar"><img src="https://p.qqan.com/up/2021-1/20211411391666.jpg"></div>
-                <div class="name">霸王花</div>
-              </div>
-              <div class="slot-group-member">
-                <div class="avatar"><img src="https://p.qqan.com/up/2021-1/2021113104111220.jpg"></div>
-                <div class="name">森系Style</div>
-              </div>
-
-            </div>
+          <div>
           </div>
         </template>
       </lemon-imui>
@@ -128,6 +73,7 @@
 
     <!-- 用户详情 -->
     <el-drawer
+      append-to-body
       :with-header="false"
       size="75%"
       :title="detail.title" :visible.sync="detail.open">
@@ -139,9 +85,7 @@
 
 <script>
 
-import store from "@/store";
-import LemonMessageVoice from "@/components/LemonUI/components/message/voice.vue";
-import { getContactsByUser,getConversations,getMessageList,getConversation,sendMsg,getQwUserList} from '@/api/qw/im';
+import {getConversations,getMessageList,getConversation,sendMsg,getQwUserList} from '@/api/qw/im';
 import Conversations from "@/components/LemonUI/database/conversations";
 import EmojiData from "@/components/LemonUI/database/emoji";
 import '@/components/LemonUI/index.css';
@@ -163,64 +107,14 @@ export default {
       qwUserList:[],
       theme: "default",
       IMUI:null,
-      contactContextmenu: [
-        {
-          text: "删除该聊天",
-          click: (e, instance, hide) => {
-            const { IMUI, contact } = instance;
-            IMUI.updateContact({
-              id: contact.id,
-              lastContent: null,
-            });
-            if (IMUI.currentContactId == contact.id) IMUI.changeContact(null);
-            hide();
-          },
-        },
-        {
-          text: "设置备注和标签",
-        },
-        {
-          text: "投诉",
-        },
-        {
-          icon: "lemon-icon-message",
-          text: "加入黑名单",
-          render: (h, instance, hide) => {
-            return (
-              <div style="display:flex;justify-content:space-between;align-items:center;width:130px">
-                <span>加入黑名单</span>
-                <span>
-                  <input type="checkbox" id="switch" />
-                  <label id="switch-label" for="switch">
-                    Toggle
-                  </label>
-                </span>
-              </div>
-            );
-          },
-        },
-        {
-          click(e, instance, hide) {
-            const { IMUI, contact } = instance;
-            IMUI.removeContact(contact.id);
-            if (IMUI.currentContactId == contact.id) IMUI.changeContact(null);
-            hide();
-          },
-          color: "red",
-          text: "删除好友",
-        },
-      ],
+      contactContextmenu: [],
       hideMenuAvatar: false,
       hideMenu: false,
       hideMessageName: false,
       hideMessageTime: true,
       qwUser:{},
       showQW:false,
-      UserData: {
-        // id: "1000",
-        // displayName: "June",
-        // avatar: "https://p.qqan.com/up/2018-4/15244505348390471.jpg",
-      },
+      userData: {},
       contactData:null,
       conversationData:Conversations,
       dialogImageUrl: '',
@@ -251,7 +145,6 @@ export default {
         conversationId: null,
         userId:null
       },
-      sessionId: null,
       detail: {
         title: '',
         open: false
@@ -275,164 +168,26 @@ export default {
   mounted() {
     this.$watch('appKey', (newValue, oldValue) => {
       if (newValue) {
-        if (!this.qwIm.hasLogin) {
-          this.initSocket(this.appKey);
-          console.log("appkey====",this.appKey);
-        }
+        console.log("appkey====",newValue);
       }
     });
-    // this.UserData.id=this.qwUser.userId;
-    // this.UserData.displayName=this.qwUser.qwUserName;
-    // this.UserData.avatar="https://cos.his.cdwjyyh.com/fs/20241231/22a765a96da247d1b83ea94fef438a41.png";
     this.showQW=true;
-
-    const contactData1 = {
-      id: "contact-1",
-      displayName: "工作协作群",
-      avatar: "http://upload.qqbodys.com/img/weixin/20170804/ji5qxg1am5ztm.jpg",
-      index: "[1]群组",
-      unread: 0,
-      lastSendTime: 1566047865417,
-      lastContent: "2",
-    };
-    const contactData2 = {
-      id: "contact-2",
-      displayName: "自定义内容",
-      avatar: "http://upload.qqbodys.com/img/weixin/20170807/jibfvfd00npin.jpg",
-      //index: "Z",
-      click(next) {
-        next();
-      },
-      renderContainer: () => {
-        return <h1 style="text-indent:20px">自定义页面</h1>;
-      },
-      lastSendTime: 1345209465000,
-      lastContent: "12312",
-      unread: 2,
-    };
-    const contactData3 = {
-      id: "contact-3",
-      displayName: "铁牛",
-      avatar: "http://upload.qqbodys.com/img/weixin/20170803/jiq4nzrkrnd0e.jpg",
-      index: "T",
-      unread: 32,
-      lastSendTime: 3,
-      lastContent: "你好123",
-    };
     const IMUI = this.$refs.IMUI;
 
-    var conversationData = Conversations.filter(item => item.conversationId<=1);
+    const conversationData = Conversations.filter(item => item.conversationId <= 1);
     conversationData.sort((a1, a2) => {
       return a2.lastSendTime - a1.lastSendTime;
     });
-    // this.getContacts();  //获取联系人信息
-    // this.getConversation();   //获取会话信息
 
     IMUI.initMenus([
       {
         name: "messages",
-      },
-      {
-        name: "contacts",
-      },
-      // {
-      //   name: "custom1",
-      //   title: "自定义按钮1",
-      //   unread: 0,
-      //   render: menu => {
-      //     return <i class="lemon-icon-attah" />;
-      //   },
-      //   renderContainer: () => {
-      //     return (
-      //       <div class="article">
-      //         <ul>
-      //         </ul>
-      //         <lemon-contact  props={{  }} style="margin:20px"/>
-      //         <lemon-contact props={{  }} style="margin:20px" />
-      //       </div>
-      //     );
-      //   },
-      //   isBottom: true,
-      // },
-      // {
-      //   name: "custom2",
-      //   title: "自定义按钮2",
-      //   unread: 0,
-      //   click: () => {
-      //     alert("拦截导航点击事件");
-      //   },
-      //   render: menu => {
-      //     return <i class="lemon-icon-group" />;
-      //   },
-      //   isBottom: true,
-      // },
+      }
     ]);
     IMUI.initEmoji(EmojiData);
 
   },
-
   methods: {
-    initSocket(appKey) {
-      let that=this;
-      if(!!this.qwIm.socket){
-        this.qwIm.initSocket(appKey,true);
-        // 监听socket连接
-        this.qwIm.socket.onopen = function() {
-          console.log("socket 连接成功...");
-        };
-        this.qwIm.socket.onerror = function() {
-          console.log("连接错误")
-        };
-        // 监听socket消息
-        const IMUI = this.$refs.IMUI;
-        this.qwIm.socket.onmessage = function(res) {
-          var data=JSON.parse(res.data);
-          console.log("收到服务端内容", JSON.stringify(data));
-          if(data.cmd=="heartbeat"){ //收到心跳数据不处理
-            console.log("heartbeat");
-          }
-          //接收消息
-          if(data.cmd=="receiveMsg"){
-            var msgData=JSON.parse(data.data);
-            console.log("收到消息:>>>>>",msgData)
-            if(!IMUI.hasConversation(msgData.toContactId)){  //收到新消息时是最新的会话,添加该会话
-              let queryParams={conversationId:msgData.toContactId,userId:that.qwUser.userId};
-              getConversation(queryParams).then(response => {
-                if(response.code==200){
-                  var conversation=response.data;
-                  IMUI.appendConversation(conversation);
-                  that.appendMessageAction(msgData);
-                }
-              });
-            }else{
-              that.appendMessageAction(msgData);
-              let conversation=IMUI.findConversation(msgData.toContactId);
-              IMUI.topPopConversations(conversation);
-              let queryParams={conversationId:msgData.toContactId,userId:that.qwUser.id};
-              // getConversation(queryParams).then(response => {
-              //       if(response.code==200){
-              //           var conversation=response.data;
-              //           var unread=conversation.unread;
-              //           if(!unread){
-              //              conversation.unread=1;
-              //           }else{
-              //             conversation.unread+=1;
-              //           }
-              //           IMUI.topPopConversations(conversation);
-              //
-              //       }
-              //  });
-            }
-          }
-        };
-        //监听socket重连
-        this.qwIm.socket.onreconnect = function(res) {
-          console.log("socket 断线重连...")
-        };
-      }
-
-
-    },
     // 切换企微账号
     qwUserChange(tab, event){
       this.appKey = tab.name;
@@ -440,48 +195,27 @@ export default {
       this.qwUser=this.qwUserList[index];
       this.getConversation();   //获取会话信息
       this.setQwUserInfo();
-      this.initSocket(this.qwUser.appKey);
     },
 
     setQwUserInfo(){
-      this.UserData.id=this.qwUser.id;
-      this.UserData.displayName=this.qwUser.qwUserName;
-      this.UserData.avatar="https://cos.his.cdwjyyh.com/fs/20241231/22a765a96da247d1b83ea94fef438a41.png";
-    },
-
-    getContacts(){
-      getContactsByUser(this.qwUser.id).then(response => {
-        this.contactData = response.data;
-        this.$refs.IMUI.initContacts(this.contactData);
-        //console.log("qxj request contactData:"+JSON.stringify(this.contactData));
-      });
+      this.userData.id=this.qwUser.id;
+      this.userData.displayName=this.qwUser.qwUserName;
+      this.userData.avatar="https://cos.his.cdwjyyh.com/fs/20241231/22a765a96da247d1b83ea94fef438a41.png";
     },
     getConversation(){
-      let that=this;
       const IMUI = this.$refs.IMUI;
       getConversations(this.qwUser.id).then(response => {
         this.conversationData = response.data;
         IMUI.initConversations(response.data);
-        var fstConversation=this.conversationData[0];
-        // console.log("qxj fstConversation:"+JSON.stringify(fstConversation));
+        const fstConversation = this.conversationData[0];
         if(fstConversation) {
           IMUI.changeContact(fstConversation.conversationId);
-          // setTimeout(() => {
-          //      IMUI.changeContact(1688856679458971);
-          // }, 500);
         }
-        //console.log("qxj request conversation:"+JSON.stringify(response.data));
       });
     },
     messageTimeFormat(time) {
       return this.friendlyDate(time);
     },
-    changeTheme() {
-      this.theme = this.theme == "default" ? "blue" : "default";
-    },
-    scrollToTop() {
-      document.body.scrollIntoView();
-    },
     openDrawer(position) {
       const IMUI = this.$refs.IMUI;
       const params = {
@@ -495,13 +229,6 @@ export default {
           );
         },
       };
-      // if (position == "center") {
-      //   params.width = "50%";
-      //   params.height = "50%";
-      // } else if (position == "rightInside") {
-      //   params.height = "90%";
-      //   params.offsetY = "10%";
-      // }
       IMUI.openDrawer(params);
     },
     handlePullMessages(contact, next,instance) {
@@ -518,15 +245,8 @@ export default {
           }
         }
       });
-      // setTimeout(() => {
-      //       let isEnd = true;
-      //       next(MessagesData[contact.conversationId], isEnd);
-      // }, 2000);
-
     },
     handleChangeConversation(conversation, instance) {
-      //console.log("qxj ChangeConversation:"+JSON.stringify(conversation));
-      this.sessionId = conversation.conversationId
       if (!pages[conversation.conversationId]){
         pages[conversation.conversationId] =1;
       }
@@ -537,7 +257,6 @@ export default {
         conversation.unread=0;
         instance.updateContact(conversation);
       }
-      // instance.closeDrawer();
     },
     handleChangeContact(contact, instance) {
       console.log("ChangeContact:", contact, instance)
@@ -588,6 +307,8 @@ export default {
     },
     //发送消息
     handleSend(message, next, file) {
+      this.$message.info("暂不支持")
+      return
       const IMUI = this.$refs.IMUI;
       var params={};
       if(message.type=="text"){  //text   image   voice   video
@@ -602,21 +323,6 @@ export default {
           }
         });
       }
-      // if(message.type=="image"){
-      //     params={"conversationId":message.toContactId,"deviceId":this.qwUser.deviceId,"userId":this.qwUser.userId,"materialId":this.pickUploadImgData.id};
-      //     sendImageMsg(params).then(response => {
-      //         if(response.code==200){
-      //             var conversation=IMUI.findConversation(message.toContactId);
-      //             conversation.lastSendTime=message.sendTime;
-      //             conversation.lastContent="[图片]";
-      //             IMUI.topPopConversations(conversation);
-      //             next();
-      //         }
-      //     });
-      // }
-      // setTimeout(() => {
-      //   next();
-      // }, 1000);
     },
     handleMenuAvatarClick() {
       console.log("Event:menu-avatar-click");
@@ -641,8 +347,11 @@ export default {
       player && player.play()
     },
     handleMessageClick(e, key, message, instance) {
-      // console.log("点击了消息", e, key, message);
-      //console.log("qxj message:"+JSON.stringify(message));
+      if (key === 'avatar') {
+        this.qwUser.id !== message.fromUser.id && this.showDetail(message.toContactId)
+        return
+      }
+
       if(message.type=="image"){
         var url=!!message.url?message.url:message.content;
         this.handlePicturePreview(url);
@@ -668,7 +377,6 @@ export default {
         }, 2000);
       }
     },
-
     changeMenuAvatarVisible() {
       this.hideMenuAvatar = !this.hideMenuAvatar;
     },
@@ -734,56 +442,22 @@ export default {
       IMUI.appendMessage(message, true);
       console.log("🚀 ~ file: App.vue ~ line 1508 ~ appendMessage ~ message", message)
     },
-    appendEventMessage() {
-      const { IMUI } = this.$refs;
-      const message = {
-        id: generateRandId(),
-        type: "event",
-        content: (
-          <span>
-            邀请你加入群聊{" "}
-            <span
-              style="color:#333;cursor:pointer"
-              on-click={() => alert("OK")}
-            >
-              接受
-            </span>
-          </span>
-        ),
-        toContactId: "contact-3",
-        sendTime: getTime(),
-      };
-      IMUI.appendMessage(message, true);
-    },
     appendRemoteMessage(message) {  //从服务端返回的消息
       const { IMUI } = this.$refs;
       IMUI.appendMessage(message, true);
     },
-    updateContact() {
-      this.$refs.IMUI.updateContact({
-        id: "contact-3",
-        unread: 10,
-        displayName: generateRandWord(),
-        lastSendTime: getTime(),
-        lastContent: "修改昵称为随机字母",
-      });
-    },
     handleChangeMenu() {
       console.log("Event:change-menu");
-    },
-    openCustomContainer() {
-
     },
     handlePicturePreview(url) {
       this.dialogImageUrl = url;
       this.dialogVisible = true;
     },
     // 详情
-    showDetail() {
-      console.log("Event:show-userDetail", this.sessionId)
+    showDetail(sessionId) {
       this.detail.open = true
       setTimeout(() => {
-        this.$refs.userDetail.getDetail(this.sessionId);
+        this.$refs.userDetail.getDetail(sessionId);
       }, 1);
     }
   },
@@ -792,10 +466,8 @@ export default {
 
 <style lang="scss" scoped>
 .imui-center{
-  margin-top:30px;
   align-items: center;
   justify-content: center;
-  height: 80vh;
 }
 .lemon-wrapper{
   border:1px solid #ddd;

+ 54 - 134
src/views/qw/qwChat/userDetail/index.vue

@@ -5,17 +5,17 @@
       用户详情
     </div>
 
-    <div class="contentx" v-if="item!=null" >
+    <div class="contentx">
       <div class="desct">
         基本信息
       </div>
       <el-descriptions title="" :column="3" border>
 
         <el-descriptions-item label="会员id" >
-          <span v-if="item!=null">{{item.userId}}</span>
+          <span>{{item.userId}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="用户昵称" >
-          <span v-if="item!=null">{{item.nickName}}</span>
+          <span>{{item.nickname}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="用户头像" >
           <el-image v-if="item.avatar!=null"
@@ -24,192 +24,112 @@
           </el-image>
         </el-descriptions-item>
         <el-descriptions-item label="手机号码" >
-          <span v-if="item!=null">{{item.phone}}</span>
+          <span>{{item.phone}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="用户积分" >
-          <span v-if="item!=null">{{item.integral}}</span>
+          <span>{{item.integral}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="状态" >
-             <span v-if="item!=null">
+             <span>
                    <dict-tag :options="userOptions" :value="item.status"/>
              </span>
         </el-descriptions-item>
 
         <el-descriptions-item label="上级昵称" >
-          <span v-if="item!=null">{{item.tuiName}}</span>
+          <span>{{item.tuiName}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="上级手机号码" >
-          <span v-if="item!=null">{{item.tuiPhone}}</span>
+          <span>{{item.tuiPhone}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="推广员关联时间" >
-          <span v-if="item!=null">{{item.tuiTime}}</span>
+          <span>{{item.tuiTime}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="下级人数" >
-          <span v-if="item!=null">{{item.tuiUserCount}}</span>
+          <span>{{item.tuiUserCount}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="最后一次登录ip" >
-          <span v-if="item!=null">{{item.lastIp}}</span>
+          <span>{{item.lastIp}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="余额" >
-          <span v-if="item!=null">{{item.balance}}</span>
+          <span>{{item.balance}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="创建时间" >
-          <span v-if="item!=null">{{item.createTime}}</span>
+          <span>{{item.createTime}}</span>
         </el-descriptions-item>
 
         <el-descriptions-item label="更新时间" >
-          <span v-if="item!=null">{{item.updateTime}}</span>
+          <span>{{item.updateTime}}</span>
         </el-descriptions-item>
       </el-descriptions>
     </div>
 
-    <div class="contentx" v-if="item!=null">
-      <div class="desct"> 优惠劵领取信息</div>
-      <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
-        <el-tab-pane label="全部" name="10"></el-tab-pane>
-        <el-tab-pane v-for="(item,index) in couponStatusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
-      </el-tabs>
-      <el-table v-loading="loading" :data="userCouponList">
-        <el-table-column label="优惠劵标题" align="center" prop="title" />
-        <el-table-column label="券号" align="center" prop="couponCode" />
-        <el-table-column label="会员昵称" align="center" prop="nickName" />
-        <el-table-column label="会员电话" align="center" prop="phone" />
-        <el-table-column label="关联订单ID" align="center" prop="businessId" />
-        <el-table-column label="订单类型" align="center" prop="businessType">
-          <template slot-scope="scope">
-            <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
-          </template>
-        </el-table-column>
-        <el-table-column label="状态" align="center" prop="status">
-          <template slot-scope="scope">
-            <dict-tag :options="couponStatusOptions" :value="scope.row.status"/>
-          </template>
-        </el-table-column>
-        <el-table-column label="领取时间" align="center" prop="createTime" width="180"/>
-        <el-table-column label="使用时间" align="center" prop="useTime" width="180"/>
-      </el-table>
-      <pagination
-        v-show="total>0"
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="getList"
-      />
-    </div>
-
-
-
-    <div class="contentx" v-if="item!=null">
-      <div class="desct">
-        患者信息
-      </div>
-      <userPatietDetails  ref="userPatietDetail" />
-
-    </div>
-
-    <div class="contentx" v-if="item!=null" >
+    <div class="contentx" v-if="item.userId != null" >
       <div class="desct">
         用户地址
       </div>
       <userAddDetails  ref="userAddDetail" />
-
     </div>
-    <div class="contentx" v-if="item!=null" >
+
+    <div class="contentx" v-if="item.userId != null" >
       <div class="desct">
-        用户药品订单
+        用户订单
       </div>
       <userStorerDetails  ref="userDetails" />
     </div>
-    <div class="contentx" v-if="item!=null" >
+
+    <div class="contentx" v-if="item.userId != null" >
       <div class="desct">
-        用户问诊订单
+        用户看客记录
       </div>
-      <userInquiryOrderDetails  ref="InquiryDetails" />
+      <userCourseWatchLog  ref="userWatchLog" />
     </div>
   </div>
 </template>
 
-
-
 <script>
+import {getUserInfoBySessionId} from "@/api/users/user";
+import userAddDetails from "@/views/qw/qwChat/userDetail/userAddDetails.vue";
+import userStorerDetails from "@/views/qw/qwChat/userDetail/userStorerDetails.vue"
+import userCourseWatchLog from "@/views/qw/qwChat/userDetail/userCourseWatchLog.vue";
+
 export default {
   name: "userDetail",
+  components: {
+    userAddDetails,
+    userStorerDetails,
+    userCourseWatchLog
+  },
   data() {
     return {
-      addr:[],
-      patient:[],
       userOptions: [],
-      statusOptions: [],
-      sexOptions: [],
-      pOptions: [],
-      item:null,
-      total: 0,
-      loading: true,
-      // 会员优惠券表格数据
-      userCouponList: [],
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        userId: null,
-        couponId: null,
-      },
-      actName:"10",
-      businessTypeOptions:[],
-      couponStatusOptions:[],
+      item: {},
     }
   },
   created() {
-
+    this.getDicts("sys_user_status").then(response => {
+      this.userOptions = response.data;
+    });
   },
   methods: {
-    handleClickX(tab, event) {
-      if(tab.name=="10"){
-        this.queryParams.status=null;
-      }else{
-        this.queryParams.status=tab.name;
-      }
-      this.queryParams.pageNum = 1;
-      this.getList();
-
-    },
-    getList() {
-      this.loading = true;
-      getListUserCoupon(this.queryParams).then(response => {
-        this.userCouponList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-
     getDetail(sessionId) {
-      console.log("sessionId",sessionId)
-      // this.item=null;
-      // getUser(orderId).then(response => {
-      //   this.item = response.data;
-      //   setTimeout(() => {
-      //     this.$refs.userDetails.getUserDetails(orderId);
-      //   }, 1);
-      //   setTimeout(() => {
-      //     this.$refs.InquiryDetails.getInquiryDetails(orderId,1);
-      //   }, 1);
-      //   setTimeout(() => {
-      //     this.$refs.userPatietDetail.getPatList(orderId);
-      //   }, 1);
-      //   setTimeout(() => {
-      //     this.$refs.userAddDetail.getAddList(orderId);
-      //   }, 1);
-      //
-      // });
-      // this.patient=null;
-      // getPatientByUserId(orderId).then(response => {
-      //   this.patient = response.data;
-      // });
-      // getUserAddr(orderId).then(response => {
-      //   this.addr = response.data;
-      // });
-      // this.queryParams.userId=orderId;
-      // this.getList();
-
+      this.item = {}
+      const params = {
+        sessionId: sessionId
+      }
+      getUserInfoBySessionId(params).then(response => {
+        this.item = response.data;
+        if (this.item.userId != null) {
+            setTimeout(() => {
+              this.$refs.userAddDetail.getAddList(this.item.userId);
+            }, 1);
+            setTimeout(() => {
+              this.$refs.userDetails.getUserDetails(this.item.userId);
+            }, 1);
+          setTimeout(() => {
+            this.$refs.userWatchLog.getUserWatchLog(this.item.userId);
+          }, 1);
+        }
+      })
     },
   }
 }

+ 374 - 0
src/views/qw/qwChat/userDetail/userAddDetails.vue

@@ -0,0 +1,374 @@
+<template>
+  <div >
+    <el-row :gutter="10" class="mb8" style="float: right; top: -30px;">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['store:userAddress:add']"
+        >新增</el-button>
+      </el-col>
+    </el-row>
+
+    <el-table v-loading="loading" border="" :data="userAddressList" @selection-change="handleSelectionChange" style="top: -30px;">
+      <el-table-column label="收货人姓名" align="center" prop="realName" />
+      <el-table-column label="收货人电话" align="center" prop="phone" />
+      <el-table-column label="收货人所在省" align="center" prop="province" />
+      <el-table-column label="收货人所在市" align="center" prop="city" />
+      <el-table-column label="收货人所在区" align="center" prop="district" />
+      <el-table-column label="收货人详细地址" align="center" prop="detail" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['store:userAddress:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['store:userAddress:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改用户地址对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
+      <el-form-item label="智能识别" prop="address">
+        <el-input v-model="address" placeholder="输入需要识别的地址" >  <el-button slot="append" icon="el-icon-search" @click="sAddress"></el-button></el-input>
+      </el-form-item>
+        <el-form-item label="收货人姓名" prop="realName">
+          <el-input v-model="form.realName" placeholder="请输入收货人姓名" />
+        </el-form-item>
+        <el-form-item label="收货人电话" prop="phone">
+          <el-input v-model="form.phone" placeholder="请输入收货人电话" />
+        </el-form-item>
+        <el-form-item label="省市区" >
+          <el-cascader
+          ref="citySelect"
+          v-model="cityIds"
+          :options="citys"
+          @change="handleCityChange">
+          </el-cascader>
+        </el-form-item>
+        <el-form-item label="详细地址" prop="detail">
+          <el-input v-model="form.detail" placeholder="请输入收货人详细地址" />
+        </el-form-item>
+        <el-form-item label="是否默认地址" prop="isDefault">
+          <el-radio-group v-model="form.isDefault">
+            <el-radio :label="item.dictValue" v-for="item in orOptions" >{{item.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getAddress,listUserAddress, getUserAddress, delUserAddress, addUserAddress, updateUserAddress, exportUserAddress } from "@/api/store/userAddress";
+import {getCitys} from "@/api/store/city";
+export default {
+  name: "UserAddress",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      orOptions: [],
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户地址表格数据
+      userAddressList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      cityIds:null,
+      address:null,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        realName: null,
+        phone: null,
+        province: null,
+        city: null,
+        district: null,
+        cityIds: null,
+        detail: null,
+        postCode: null,
+        longitude: null,
+        latitude: null,
+        isDefault: null,
+        isDel: 0,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        userId: [
+          { required: true, message: "用户id不能为空", trigger: "blur" }
+        ],
+        realName: [
+          { required: true, message: "收货人姓名不能为空", trigger: "blur" }
+        ],
+        phone: [
+          { required: true, message: "收货人电话不能为空", trigger: "blur" },
+          {
+                      pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+                      message: "请输入正确的手机号码",
+                      trigger: "blur"
+                    }
+        ],
+        province: [
+          { required: true, message: "收货人所在省不能为空", trigger: "blur" }
+        ],
+        city: [
+          { required: true, message: "收货人所在市不能为空", trigger: "blur" }
+        ],
+        district: [
+          { required: true, message: "收货人所在区不能为空", trigger: "blur" }
+        ],
+        detail: [
+          { required: true, message: "收货人详细地址不能为空", trigger: "blur" }
+        ],
+        isDefault: [
+          { required: true, message: "是否默认不能为空", trigger: "blur" }
+        ],
+        cityIds: [
+          { required: true, message: "不能为空", trigger: "blur" }
+        ],
+      },
+      citys: []
+    };
+  },
+  created() {
+    this.getCitys();
+    this.getDicts("sys_company_or").then(response => {
+      this.orOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询用户地址列表 */
+    getList() {
+      this.loading = true;
+      listUserAddress(this.queryParams).then(response => {
+        this.userAddressList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+
+      });
+    },
+    getAddList(id) {
+      this.queryParams.userId=id;
+      this.loading = true;
+      listUserAddress(this.queryParams).then(response => {
+        this.userAddressList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+
+      });
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        userId: null,
+        realName: null,
+        phone: null,
+        province: null,
+        city: null,
+        district: null,
+        cityIds: null,
+        detail: null,
+        postCode: null,
+        longitude: null,
+        latitude: null,
+        isDefault: null,
+        isDel: null,
+        createTime: null,
+        updateTime: null
+      };
+      this.address=null;
+      this.cityIds=[];
+      this.resetForm("form");
+    },
+    getCitys(){
+        getCitys().then(res => {
+          this.citys=res.data;
+        })
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    handleCityChange(value) {
+      var nodes=this.$refs.citySelect.getCheckedNodes();
+      this.cityIds=value.toString();
+      this.form.province=nodes[0].pathLabels[0];
+      this.form.city=nodes[0].pathLabels[1];
+      this.form.district=nodes[0].pathLabels[2];
+    },
+
+    sAddress(){
+
+      getAddress(this.address).then(response => {
+
+        var addressJson = response.data;
+        this.msgSuccess(addressJson.reason);
+        this.form.province=addressJson.data.provinceName;
+        this.form.city=addressJson.data.cityName;
+        this.form.district=addressJson.data.expAreaName;
+        this.form.detail=addressJson.data.streetName+addressJson.data.address;
+        this.form.realName=addressJson.data.name;
+        this.form.phone=addressJson.data.mobile;
+
+        var province= this.citys.find(function(o) {
+           return o.label ==addressJson.data.provinceName ;
+         });
+         var city= province.children.find(function(o) {
+            return o.label == addressJson.data.cityName;
+          });
+        var district= city.children.find(function(o) {
+             return o.label == addressJson.data.expAreaName;
+           });
+        this.cityIds=[province.value,city.value,district.value]
+
+      });
+    },
+
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加用户地址";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const addressId = row.id || this.ids
+      getUserAddress(addressId).then(response => {
+        this.form = response.data;
+        var province= this.citys.find(function(o) {
+           return o.label ==response.data.province ;
+         });
+         var city= province.children.find(function(o) {
+            return o.label == response.data.city;
+          });
+          var district= city.children.find(function(o) {
+             return o.label == response.data.district;
+           });
+        if(this.form.isDefault!=null){
+           this.form.isDefault = String(this.form.isDefault)
+        }
+        this.cityIds=[province.value,city.value,district.value]
+        this.open = true;
+        this.title = "修改用户地址";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if(this.form.city==null||this.form.province==null||this.form.district==null){
+           return this.msgSuccess("省市区不能为空");
+          }
+          if (this.form.id != null) {
+            updateUserAddress(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            this.form.userId=this.queryParams.userId
+            addUserAddress(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const addressIds = row.id || this.ids;
+      this.$confirm('是否确认删除用户地址编号为"' + addressIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delUserAddress(addressIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有用户地址数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportUserAddress(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 332 - 0
src/views/qw/qwChat/userDetail/userCourseWatchLog.vue

@@ -0,0 +1,332 @@
+<template>
+  <div class="apcontainer">
+
+    <el-tabs type="card" v-model="activeName" @tab-click="handleClickX">
+      <el-tab-pane label="全部" name="00"></el-tab-pane>
+      <el-tab-pane v-for="(item,index) in logTypeOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
+    </el-tabs>
+    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="记录编号" align="center" prop="logId" />
+      <el-table-column label="用户账号" align="center" prop="userName" />
+      <el-table-column label="企微客户" align="center" prop="externalUserName" v-if="queryParams.sourceType == 2"/>
+      <el-table-column label="会员昵称" align="center" prop="fsNickName">
+        <template slot-scope="scope">
+          <div style="display: flex;white-space: nowrap">
+            <div style="margin: auto">
+              {{scope.row.fsNickName}}
+            </div>
+            <el-popover
+              placement="right"
+              title=""
+              trigger="hover">
+              <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
+              <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
+            </el-popover>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="项目" align="center" prop="projectName" />
+      <el-table-column label="课程名称" align="center" prop="courseName" />
+      <el-table-column label="小节名称" align="center" prop="videoName" />
+      <el-table-column label="企微员工名称" align="center" prop="qwUserName" v-if="queryParams.sourceType == 2"/>
+      <el-table-column label="记录类型" align="center" prop="logType">
+        <template slot-scope="scope">
+          <dict-tag :options="logTypeOptions" :value="scope.row.logType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="播放时长" align="center" prop="duration" />
+      <el-table-column label="所属销售" align="center" prop="companyUserName" />
+      <!--      <el-table-column label="所属公司" align="center" prop="companyName" />-->
+      <!--      <el-table-column label="企微员工名称" align="center" prop="qwUserName" />-->
+      <el-table-column label="所属发送方式" align="center" prop="sendType" />
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="更新时间" align="center" prop="updateTime" />
+      <el-table-column label="完课时间" align="center" prop="finishTime" />
+      <el-table-column label="营期时间" align="center" prop="campPeriodTime" />
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+  </div>
+</template>
+
+<script>
+import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog } from "@/api/course/courseWatchLog";
+import {allList}from "@/api/company/company";
+import { courseList,videoList } from '@/api/course/courseRedPacketLog'
+import {getUserList} from "@/api/company/companyUser";
+import {getFsUserList} from "@/api/users/user";
+export default {
+  name: "CourseWatchLog",
+  data() {
+    return {
+      userSourceTypeOptions: [],
+      activeName:"00",
+      createTime:null,
+      updateTime:null,
+      courseLists:[],
+      videoList:[],
+      logTypeOptions:[],
+      queryUserLoading: false,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      companyUserList: [],
+      // 短链课程看课记录表格数据
+      courseWatchLogList: [],
+      fsUserList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        nickName: null,
+        videoId: null,
+        logType: null,
+        qwExternalContactId: null,
+        externalUserName:null,
+        duration: null,
+        qwUserId: null,
+        companyUserId: null,
+        companyId: null,
+        courseId: null,
+        sTime:null,
+        eTime:null,
+        upSTime:null,
+        upETime:null,
+        scheduleStartTime: null,
+        scheduleEndTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      scheduleTime: null,
+    };
+  },
+  created() {
+    courseList().then(response => {
+      this.courseLists = response.list;
+    });
+    this.getList();
+    this.getDicts("sys_course_watch_log_type").then(response => {
+      this.logTypeOptions = response.data;
+    });
+    getUserList().then(res=>{
+      if(res.code === 200) {
+        this.companyUserList = res.data
+      }
+    })
+
+    getFsUserList({}).then(res=>{
+      if(res.code === 200) {
+        this.fsUserList = res.data
+      }
+    })
+
+    this.getDicts('user_source_type').then(response => {
+      this.userSourceTypeOptions = response.data;
+    })
+
+  },
+  computed: {
+    sourceTypeModel: {
+      get() {
+        return this.queryParams.sourceType !== null && this.queryParams.sourceType !== undefined ? this.queryParams.sourceType.toString() : null;
+      },
+      set(newVal) {
+        this.queryParams.sourceType = newVal;
+      }
+    }
+  },
+  methods: {
+    getUserWatchLog(id) {
+      this.queryParams.userId = id
+      this.getList()
+    },
+    courseChange(row){
+      this.queryParams.videoId=null;
+      if(row === ''){
+        this.videoList=[];
+        return
+      }
+      videoList(row).then(response => {
+        this.videoList=response.list
+      });
+    },
+    handleClickX(tab,event){
+      this.activeName=tab.name;
+      if(tab.name=="00"){
+        this.queryParams.logType=null;
+      }else{
+        this.queryParams.logType=tab.name;
+      }
+      this.getList()
+    },
+    /** 查询短链课程看课记录列表 */
+    getList() {
+      this.loading = true;
+      if(this.queryParams.logType == "10"){
+        this.queryParams.logType = null;
+      }
+
+      listCourseWatchLog(this.queryParams).then(response => {
+        this.courseWatchLogList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        logId: null,
+        userId: null,
+        videoId: null,
+        logType: null,
+        createTime: null,
+        updateTime: null,
+        qwExternalContactId: null,
+        externalUserName:null,
+        duration: null,
+        qwUserId: null,
+        companyUserId: null,
+        companyId: null,
+        courseId: null,
+        scheduleStartTime: null,
+        scheduleEndTime: null,
+      };
+      this.scheduleTime=null;
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.createTime = null;
+      this.scheduleTime = null;
+      this.queryParams.sTime = null;
+      this.queryParams.eTime = null;
+      this.queryParams.upSTime = null;
+      this.queryParams.upETime = null;
+      this.queryParams.scheduleStartTime = null;
+      this.queryParams.scheduleEndTime = null;
+      this.scheduleTime=null;
+      this.updateTime=null;
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.logId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加短链课程看课记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const logId = row.logId || this.ids
+      getCourseWatchLog(logId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改短链课程看课记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.logId != null) {
+            updateCourseWatchLog(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCourseWatchLog(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const logIds = row.logId || this.ids;
+      this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delCourseWatchLog(logIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportCourseWatchLog(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    },
+    handleScheduleTimeChange(val) {
+      if (val) {
+        this.queryParams.scheduleStartTime = val[0];
+        this.queryParams.scheduleEndTime = val[1];
+      } else {
+        this.queryParams.scheduleStartTime = null;
+        this.queryParams.scheduleEndTime = null;
+      }
+    },
+  }
+};
+</script>

+ 395 - 0
src/views/qw/qwChat/userDetail/userStorerDetails.vue

@@ -0,0 +1,395 @@
+<template>
+  <div class="aacontainer">
+
+    <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
+      <el-tab-pane label="全部订单" name="10"></el-tab-pane>
+      <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
+    </el-tabs>
+    <el-table v-loading="loading" :data="orderList" >
+      <el-table-column label="订单号" align="center" prop="orderCode" width="180px"/>
+      <el-table-column label="所属店铺" align="center" prop="storeName" width="180px"/>
+      <el-table-column label="用户昵称" align="center" prop="nickName" show-overflow-tooltip width="100px"/>
+      <el-table-column label="收货人" align="center" prop="userName" />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" />
+      <el-table-column label="患者姓名" align="center" prop="patientName" />
+      <el-table-column label="订单总价" align="center" prop="totalPrice" />
+      <el-table-column label="应付金额" align="center" prop="payPrice" />
+      <el-table-column label="实付金额" align="center" prop="payMoney" />
+      <el-table-column label="订单状态" align="center" prop="status" >
+        <template slot-scope="scope">
+              <dict-tag :options="orderOptions" :value="scope.row.status"/>
+         </template>
+      </el-table-column>
+      <el-table-column label="支付状态 " align="center" prop="isPay" >
+        <template slot-scope="scope">
+              <dict-tag :options="payStatusOptions" :value="scope.row.isPay"/>
+            </template>
+      </el-table-column>
+      <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
+      <el-table-column label="支付方式" align="center" prop="payType" >
+        <template slot-scope="scope">
+              <dict-tag :options="PayOptions" :value="scope.row.payType"/>
+         </template>
+      </el-table-column>
+      <el-table-column label="订单类型" align="center" prop="orderType" >
+        <template slot-scope="scope">
+              <dict-tag :options="orderTypeOptions" :value="scope.row.orderType"/>
+         </template>
+      </el-table-column>
+      <el-table-column label="退款状态" align="center" prop="refundStatus" >
+        <template slot-scope="scope">
+              <dict-tag :options="refundOptions" :value="scope.row.refundStatus"/>
+         </template>
+      </el-table-column>
+      <el-table-column label="快递名称" align="center" prop="deliveryName" />
+      <el-table-column label="快递单号" align="center" prop="deliverySn" />
+      <el-table-column label="是否开处方" align="center" prop="isPrescribe" >
+        <template slot-scope="scope">
+              <dict-tag :options="orOptions" :value="scope.row.isPrescribe"/>
+         </template>
+      </el-table-column>
+      <el-table-column label="处方编号" align="center" prop="prescribeCode" width="170px"/>
+      <el-table-column label="发货时间" align="center" prop="deliveryTime" />
+      <el-table-column label="推广佣金" align="center" prop="tuiMoney" />
+      <el-table-column label="推广佣金状态" align="center" prop="tuiMoneyStatus" >
+        <template slot-scope="scope">
+              <dict-tag :options="tuiOptions" :value="scope.row.tuiMoneyStatus"/>
+         </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime"  width="150px"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"  width="150px"/>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+
+
+  </div>
+</template>
+
+<script>
+import {
+  listStoreOrder,
+  getStoreOrder,
+  delStoreOrder,
+  addStoreOrder,
+  updateStoreOrder,
+  exportStoreOrder,
+} from "@/api/store/storeOrder";
+export default {
+  name: "userInquir",
+  props:["data"],
+  data() {
+    return {
+      actName:"10",
+      show:{
+              title:"订单详情",
+              open:false,
+            },
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      orderList: [],
+      // 弹出层标题
+      title: "",
+      createTime:null,
+      payTime:null,
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        storeId: null,
+        orderCode: null,
+        userId: null,
+        userName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        totalNum: null,
+        totalPrice: null,
+        payPrice: null,
+        payMoney: null,
+        isPay: null,
+        payTime: null,
+        payType: null,
+        status: null,
+        refundStatus: null,
+        refundImg: null,
+        refundExplain: null,
+        refundTime: null,
+        refundReason: null,
+        refundMoney: null,
+        deliveryCode: null,
+        deliveryName: null,
+        deliverySn: null,
+        isDel: null,
+        costPrice: null,
+        verifyCode: null,
+        shippingType: null,
+        isChannel: null,
+        isPrescribe: null,
+        prescribeId: null,
+        finishTime: null,
+        patientName: null,
+        doctorName: null,
+        sTime:null,
+        eTime:null,
+        paysTime:null,
+        payeTime:null,
+        deliveryTime: null,
+        tuiMoney: null,
+        tuiMoneyStatus: null,
+        tuiUserId: null,
+        orderCreateType: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+       PayOptions:[],
+       orderOptions:[],
+       payStatusOptions:[],
+       refundOptions:[],
+       channelOptions:[],
+       orderTypeOptions:[],
+       tuiOptions:[],
+       orOptions:[],
+       storeOPtions:[],
+    };
+  },
+  created() {
+    this.getDicts("sys_inquiry_pay").then(response => {
+        this.PayOptions = response.data;
+      });
+    this.getDicts("store_order_type").then(response => {
+        this.orderTypeOptions = response.data;
+      });
+    this.getDicts("sys_order_status").then(response => {
+        this.orderOptions = response.data;
+      });
+    this.getDicts("sys_order_pay").then(response => {
+        this.payStatusOptions = response.data;
+      });
+    this.getDicts("sys_refund_status").then(response => {
+        this.refundOptions = response.data;
+      });
+    this.getDicts("sys_channel").then(response => {
+        this.channelOptions = response.data;
+      });
+    this.getDicts("sys_tui_money_status").then(response => {
+          this.tuiOptions = response.data;
+        });
+    this.getDicts("sys_company_or").then(response => {
+          this.orOptions = response.data;
+        });
+  },
+  methods: {
+    getUserDetails(id){
+      this.queryParams.userId=id
+      this.getList();
+    },
+
+
+    /** 查询订单列表 */
+    getList() {
+      this.loading = true;
+      listStoreOrder(this.queryParams).then(response => {
+        this.orderList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        orderId: null,
+        storeId: null,
+        orderCode: null,
+        userId: null,
+        userName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        totalNum: null,
+        totalPrice: null,
+        payPrice: null,
+        payMoney: null,
+        isPay: null,
+        payTime: null,
+        payType: null,
+        createTime: null,
+        updateTime: null,
+        status: null,
+        refundStatus: "0",
+        refundImg: null,
+        refundExplain: null,
+        refundTime: null,
+        refundReason: null,
+        refundMoney: null,
+        deliveryCode: null,
+        deliveryName: null,
+        deliverySn: null,
+        remark: null,
+        isDel: null,
+        costPrice: null,
+        verifyCode: null,
+        shippingType: null,
+        isChannel: null,
+        isPrescribe: null,
+        prescribeId: null,
+        finishTime: null,
+        deliveryTime: null,
+        tuiMoney: null,
+        tuiMoneyStatus: 0,
+        tuiUserId: null,
+        orderCreateType: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+   handleClickX(tab, event) {
+    if(tab.name=="10"){
+      this.queryParams.status=null;
+    }else{
+      this.queryParams.status=tab.name;
+    }
+     this.handleQuery();
+   },
+  changeTime(){
+        if(this.createTime!=null){
+          this.queryParams.sTime=this.createTime[0];
+          this.queryParams.eTime=this.createTime[1];
+        }else{
+          this.queryParams.sTime=null;
+          this.queryParams.eTime=null;
+        }
+
+      },
+  changePayTime(){
+      if(this.payTime!=null){
+        this.queryParams.sTime=this.payTime[0];
+        this.queryParams.eTime=this.payTime[1];
+      }else{
+        this.queryParams.paysTime=null;
+        this.queryParams.payeTime=null;
+      }
+
+    },
+
+
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+       this.createTime=null;
+      this.queryParams.sTime=null;
+      this.queryParams.eTime=null;
+       this.payTime=null;
+      this.queryParams.paysTime=null;
+      this.queryParams.payeTime=null;
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.orderId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加订单";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const orderId = row.orderId || this.ids
+      getStoreOrder(orderId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.orderId != null) {
+            updateStoreOrder(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addStoreOrder(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const orderIds = row.orderId || this.ids;
+      this.$confirm('是否确认删除订单编号为"' + orderIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delStoreOrder(orderIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有订单数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportStoreOrder(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>