Explorar o código

第一版发布

徐志豪 %!s(int64=5) %!d(string=hai) anos
pai
achega
b08d06b1aa
Modificáronse 71 ficheiros con 797 adicións e 333 borrados
  1. BIN=BIN
      admin.rar
  2. 1 0
      admin/package.json
  3. 1 1
      admin/src/api/company.js
  4. 4 0
      admin/src/api/guide.js
  5. 5 1
      admin/src/api/index.js
  6. 1 1
      admin/src/api/upload.js
  7. 1 1
      admin/src/components/LoginForm.vue
  8. 1 4
      admin/src/components/Modal/index.vue
  9. 105 19
      admin/src/components/quillEditor/index.vue
  10. 1 1
      admin/src/components/tables/tables.vue
  11. 2 2
      admin/src/components/upload/index.vue
  12. 2 2
      admin/src/components/upload/video.vue
  13. 9 9
      admin/src/config/agency.js
  14. 1 1
      admin/src/layout/index/index.vue
  15. 3 3
      admin/src/layout/login/login.vue
  16. 49 48
      admin/src/router/index.js
  17. 1 1
      admin/src/views/activity/enterpriseList.vue
  18. 47 19
      admin/src/views/enterprise/components/baseForm.vue
  19. 45 11
      admin/src/views/enterprise/index.vue
  20. 7 3
      admin/src/views/system/commentator/list.vue
  21. 3 2
      admin/src/views/system/commentator/userList.vue
  22. 31 11
      admin/src/views/system/user/list.vue
  23. 2 2
      admin/vue.config.js
  24. 4 2
      miniprogram/apis/fetcher/request.js
  25. 3 3
      miniprogram/apis/im.js
  26. 4 0
      miniprogram/app.js
  27. 6 6
      miniprogram/components/business-card/index.wxml
  28. 3 0
      miniprogram/components/login-pannel/login-pannel.js
  29. 1 1
      miniprogram/components/login-pannel/login-pannel.wxss
  30. 3 0
      miniprogram/components/search-bar/search-bar.wxml
  31. 4 4
      miniprogram/config/config.js
  32. 1 1
      miniprogram/delegate/app-im-delegate.js
  33. BIN=BIN
      miniprogram/image/4Dage/login-logo.png
  34. 25 4
      miniprogram/pages/business-card/business-card.js
  35. 1 0
      miniprogram/pages/business-card/business-card.wxml
  36. 1 0
      miniprogram/pages/business-card/detail/business-card-detail.js
  37. 6 0
      miniprogram/pages/business-card/detail/business-card-detail.wxss
  38. 9 0
      miniprogram/pages/business-card/scan-result/scan-result.wxss
  39. 8 2
      miniprogram/pages/chat/msg-type/vrcard-manager.js
  40. 3 8
      miniprogram/pages/collect-goods/collect-goods.js
  41. 2 1
      miniprogram/pages/collect-goods/collect-goods.json
  42. 1 1
      miniprogram/pages/collect-goods/collect-goods.wxml
  43. 1 1
      miniprogram/pages/exhibition-detail/exhibition-detail.json
  44. 3 2
      miniprogram/pages/exhibition-enterprise/exhibition-enterprise.js
  45. 2 1
      miniprogram/pages/exhibition-enterprise/exhibition-enterprise.json
  46. 10 0
      miniprogram/pages/exhibition-enterprise/exhibition-enterprise.wxss
  47. 130 48
      miniprogram/pages/find/find.js
  48. 5 2
      miniprogram/pages/find/find.wxml
  49. 30 17
      miniprogram/pages/goods-detail/goods-detail.js
  50. 2 1
      miniprogram/pages/goods-detail/goods-detail.json
  51. 6 6
      miniprogram/pages/goods-detail/goods-detail.wxml
  52. 1 0
      miniprogram/pages/goods-detail/goods-detail.wxss
  53. 11 5
      miniprogram/pages/index/index.js
  54. 8 5
      miniprogram/pages/index/index.wxml
  55. 30 1
      miniprogram/pages/index/index.wxss
  56. 2 2
      miniprogram/pages/login/login.wxml
  57. 1 1
      miniprogram/pages/login/login.wxss
  58. 2 2
      miniprogram/pages/logout/logout.wxml
  59. 24 12
      miniprogram/pages/my/my.js
  60. 6 1
      miniprogram/pages/search/search.js
  61. 25 15
      miniprogram/pages/shared/shared.js
  62. 9 3
      miniprogram/pages/user-info/user-info.js
  63. 4 1
      miniprogram/pages/user-info/user-info.wxml
  64. 4 0
      miniprogram/pages/user-info/user-info.wxss
  65. 31 16
      miniprogram/pages/web/web.js
  66. 1 1
      miniprogram/pages/web/web.json
  67. 3 3
      miniprogram/project.config.json
  68. 1 1
      miniprogram/utils/imSend.js
  69. 1 1
      miniprogram/utils/socket-handle.js
  70. 24 1
      miniprogram/utils/storage.js
  71. 13 9
      miniprogram/utils/utils.js

BIN=BIN
admin.rar


+ 1 - 0
admin/package.json

@@ -24,6 +24,7 @@
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
+    "quill-image-extend-module": "^1.1.2",
     "view-design": "^4.2.0",
     "vue": "2.6.10",
     "vue-i18n": "^8.17.7",

+ 1 - 1
admin/src/api/company.js

@@ -26,7 +26,7 @@ export function updateCompany (data) {
 export function fetchAllScene (data) {
   const defaultParams = {
     page_num: 1,
-    page_size: 10,
+    page_size: 999,
     searchKey: '',
     token: getToken()
   }

+ 4 - 0
admin/src/api/guide.js

@@ -8,4 +8,8 @@ export function getGuideList (data) {
     keyword: ''
   }
   return request.get('viewer/queryGuidList', {params: Object.assign(defaultOpt, data)})
+}
+
+export function getGuideById (guideId) {
+  return request.get('viewer/getGuideById', {params: { viewerId: guideId }})
 }

+ 5 - 1
admin/src/api/index.js

@@ -29,7 +29,7 @@ export function fetchUserList (params= {}) {
 // 获取讲解员列表
 export function fetchViewerList (params= {}) {
   const defaultParams = {
-    registerType: 1,
+    registerType: '',
     keyword: params.searchKey,
     pageSize: 10,
     pageNum: 1
@@ -72,3 +72,7 @@ export function upadteActivity (data) {
 export function getActivityDetail () {
   return request.get('activity/getLatest')
 }
+
+export function refreshAdminerInfo (adminId) {
+  return request.get('getAdminById', { params: { adminId } })
+}

+ 1 - 1
admin/src/api/upload.js

@@ -31,7 +31,7 @@ export function uploadVideo (file) {
   let formData = new FormData()
 
   formData.append('file', file)
-  return request.post(`${UploadUrl}/upLoadVideo`, formData)
+  return request.post(`../node-upload/upLoadVideo`, formData)
 }
 
 export function getVideoFirstImage (object_name) {

+ 1 - 1
admin/src/components/LoginForm.vue

@@ -60,7 +60,7 @@ export default {
       loginModel: {
         type: 'login',
         handle: 'handleLogin',
-        title: '后台登录',
+        title: '登录',
         buttonText: '登录',
         item: [{
           name: '账号',

+ 1 - 4
admin/src/components/Modal/index.vue

@@ -1,11 +1,8 @@
 <template>
-  <Modal :width="width" v-model="show" footer-hide :mask-closable="false">
+  <Modal :width="width" v-model="show" footer-hide >
     <div slot="header" class="modal-header">
       {{ title }}
     </div>
-    <div class="close" slot="close">
-      <Icon custom="iconfont iconform_close" @click="close" />
-    </div>
     <div class="content">
       <slot />
       <div  class="btn-w">

+ 105 - 19
admin/src/components/quillEditor/index.vue

@@ -17,7 +17,10 @@
 import "quill/dist/quill.core.css";
 import "quill/dist/quill.snow.css";
 import "quill/dist/quill.bubble.css";
-import { quillEditor } from "vue-quill-editor";
+import { quillEditor, Quill } from "vue-quill-editor";
+import { uploadPic } from "@/api/upload";
+import { container, ImageExtend, QuillWatch } from "quill-image-extend-module";
+Quill.register('modules/ImageExtend', ImageExtend)
 
 const titleConfig = [
   { Choice: ".ql-bold", title: "加粗" },
@@ -79,21 +82,73 @@ export default {
     value: String
   },
   model: {
-    prop: 'value',
-    event: 'input'
+    prop: "value",
+    event: "input"
   },
   data() {
     return {
-      editorOption: {}
+      editorOption: {
+        modules: {
+          ImageExtend: {
+            // 如果不作设置,即{}  则依然开启复制粘贴功能且以base64插入
+            name: "file", // 图片参数名
+            size: 3, // 可选参数 图片大小,单位为M,1M = 1024kb
+            action: "/node-upload/uploadfile", // 服务器地址, 如果action为空,则采用base64插入图片
+            // response 为一个函数用来获取服务器返回的具体图片地址
+            // 例如服务器返回{code: 200; data:{ url: 'baidu.com'}}
+            // 则 return res.data.url
+            response: res => {
+              return res.data.url;
+            },
+            sizeError: () => {}, // 图片超过大小的回调
+            start: () => {}, // 可选参数 自定义开始上传触发事件
+            end: () => {}, // 可选参数 自定义上传结束触发的事件,无论成功或者失败
+            error: () => {}, // 可选参数 上传失败触发的事件
+            success: () => {}, // 可选参数  上传成功触发的事件
+            change: (xhr, formData) => {
+              // xhr.setRequestHeader('myHeader','myValue')
+              // formData.append('token', 'myToken')
+            } // 可选参数 每次选择图片触发,也可用来设置头部,但比headers多了一个参数,可设置formData
+          },
+
+          toolbar: {
+            // 如果不上传图片到服务器,此处不必配置
+            container: [
+              ["bold", "italic", "underline", "strike"], // toggled buttons
+              ["blockquote", "code-block"],
+
+              [{ header: 1 }, { header: 2 }], // custom button values
+              [{ list: "ordered" }, { list: "bullet" }],
+              [{ script: "sub" }, { script: "super" }], // superscript/subscript
+              [{ indent: "-1" }, { indent: "+1" }], // outdent/indent
+              [{ direction: "rtl" }], // text direction
+
+              [{ size: ["small", false, "large", "huge"] }], // custom dropdown
+              [{ header: [1, 2, 3, 4, 5, 6, false] }],
+
+              [{ color: [] }, { background: [] }], // dropdown with defaults from theme
+              [{ font: [] }],
+              [{ align: [] }],
+              ["image"] //去除video即可
+            ], // container为工具栏,此次引入了全部工具栏,也可自行配置
+            handlers: {
+              image: function() {
+                // 劫持原来的图片点击按钮事件
+                QuillWatch.emit(this.quill.id);
+              }
+            }
+          }
+        }
+      }
     };
   },
   computed: {
     content: {
-      set (val) {
-        this.$emit('input', val)
+      set(val) {
+        this.$emit("input", val);
       },
-      get () {
-        return this.value
+      get() {
+        return this.value;
       }
     },
     editor() {
@@ -108,30 +163,61 @@ export default {
     //   this.$emit('input', e)
     // },
     onEditorBlur(quill) {
-      console.log("editor blur!", quill);
+      // console.log("editor blur!", quill);
     },
     onEditorFocus(quill) {
-      console.log("editor focus!", quill);
+      // console.log("editor focus!", quill);
     },
     onEditorReady(quill) {
-      console.log("editor ready!", quill);
+      // console.log("editor ready!", quill);
     },
     onEditorChange({ quill, html, text }) {
-      console.log("editor change!", quill, html, text);
+      // console.log("editor change!", quill, html, text);
       this.content = html;
     },
-    autotip (){
-      document.getElementsByClassName('ql-editor')[0].dataset.placeholder=''
-      for(let item of titleConfig){
-          let tip = document.querySelector('.quill-editor '+ item.Choice)
-          if (!tip) continue
-          tip.setAttribute('title',item.title)
+    autotip() {
+      document.getElementsByClassName("ql-editor")[0].dataset.placeholder = "";
+      for (let item of titleConfig) {
+        let tip = document.querySelector(".quill-editor " + item.Choice);
+        if (!tip) continue;
+        tip.setAttribute("title", item.title);
       }
     }
   },
   mounted() {
     console.log("this is current quill instance object", this.editor);
-    this.autotip()
+    this.autotip();
+    this.editor.root.addEventListener(
+      "paste",
+      evt => {
+        if (
+          evt.clipboardData &&
+          evt.clipboardData.files &&
+          evt.clipboardData.files.length
+        ) {
+          evt.preventDefault();
+          [].forEach.call(evt.clipboardData.files, file => {
+            if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
+              return;
+            }
+            uploadPic(blob)(file, res => {
+              var range = this.editor.getSelection();
+              if (range) {
+                //  在当前光标位置插入图片
+                this.editor.insertEmbed(
+                  range.index,
+                  "image",
+                  this.$ajax.defaults.baseURL + res.file.path
+                );
+                //  将光标移动到图片后面
+                this.editor.setSelection(range.index + 1);
+              }
+            });
+          });
+        }
+      },
+      false
+    );
   }
 };
 </script>

+ 1 - 1
admin/src/components/tables/tables.vue

@@ -99,7 +99,7 @@ export default {
     },
     placeholder: {
       type: String,
-      default: '房源ID/名称/经纪人'
+      default: '房源ID/名称/讲解员'
     }
   },
   data() {

+ 2 - 2
admin/src/components/upload/index.vue

@@ -28,7 +28,7 @@
           @click="handleCancleClick(uploadfiles, 'hasUploads')"
           v-if="!hideUpload"
         >
-          <Icon type="ios-close" class="close" />
+          <Icon type="md-close-circle" size="16" class="close" />
         </div>
         <div
           class="tip "
@@ -50,7 +50,7 @@
           @click="handleCancleClick(uploadfiles, 'preUploads')"
           v-if="!hideUpload"
         >
-          <Icon type="ios-close" class="close" />
+          <Icon type="md-close-circle" size="16" class="close" />
         </div>
         <div
           class="tip "

+ 2 - 2
admin/src/components/upload/video.vue

@@ -27,7 +27,7 @@
           @click.stop="handleCancleClick(uploadfiles, 'hasUploads')"
           v-if="!hideUpload"
         >
-          <Icon type="ios-close" />
+          <Icon type="md-close-circle"  size="16" />
         </div>
       </div>
       <div
@@ -42,7 +42,7 @@
           @click.stop="handleCancleClick(uploadfiles, 'preUploads')"
           v-if="!hideUpload"
         >
-          <Icon type="ios-close" />
+          <Icon type="md-close-circle"  size="16" />
         </div>
     </div>
     <p class="tips">{{ tips }}</p>

+ 9 - 9
admin/src/config/agency.js

@@ -1,20 +1,20 @@
 export const agency_type = [
   {
-    label: '钻石经纪人',
-    value: '钻石经纪人'
+    label: '钻石讲解员',
+    value: '钻石讲解员'
   },
   {
-    label: '金牌经纪人',
-    value: '金牌经纪人'
+    label: '金牌讲解员',
+    value: '金牌讲解员'
   },
   {
-    label: '资深经纪人',
-    value: '资深经纪人'
+    label: '资深讲解员',
+    value: '资深讲解员'
   }
 ]
 
 export const agency_icon = {
-  '钻石经纪人': 'http://houseoss.4dkankan.com/4dHouse/admin/icon/diamond.svg',
-  '金牌经纪人': 'http://houseoss.4dkankan.com/4dHouse/admin/icon/gold.svg',
-  '资深经纪人': 'http://houseoss.4dkankan.com/4dHouse/admin/icon/senior.svg',
+  '钻石讲解员': 'http://houseoss.4dkankan.com/4dHouse/admin/icon/diamond.svg',
+  '金牌讲解员': 'http://houseoss.4dkankan.com/4dHouse/admin/icon/gold.svg',
+  '资深讲解员': 'http://houseoss.4dkankan.com/4dHouse/admin/icon/senior.svg',
 }

+ 1 - 1
admin/src/layout/index/index.vue

@@ -110,7 +110,7 @@ export default {
       })
     },
     changeEditShow (show) {
-      this.show = show
+      window.open('https://4dkankan.com')
     }
   }
 }

+ 3 - 3
admin/src/layout/login/login.vue

@@ -8,11 +8,11 @@
         <div class="login-banner">
           <div class="login-container-text">
             <div class="login-con-header">
-              <span>在线语音带看  足不出户看实况</span>
+              <span>三维数字化技术助力内循环</span>
             </div>
-            <div class="login-con-desc">
+            <!-- <div class="login-con-desc">
               <span>让你的房产交易更加便捷</span>
-            </div>
+            </div> -->
           </div>
         </div>
         <login-form />

+ 49 - 48
admin/src/router/index.js

@@ -1,9 +1,9 @@
 import Vue from 'vue'
 import Router from 'vue-router'
-// import ViewUI from 'view-design'
-// import store from 'store'
+import ViewUI from 'view-design'
+import store from 'store'
 
-// import { getToken, setToken } from 'libs/token'
+import { getToken, setToken } from 'libs/token'
 // import { turnTo } from 'libs/tools'
 
 import routes from './routes'
@@ -16,58 +16,59 @@ const router = new Router({
 })
 
 // 定义登录页面路由name
-// const LOGIN_PAGE_NAME = 'login'
+const LOGIN_PAGE_NAME = 'login'
 // // 定义首页页面路由name
 // const GUIDE_PAGE_NAME = 'guide'
 
-// const needVerify = true
+const needVerify = true
 
 // 添加路由钩子
-// router.beforeEach((to, form, next) => {
-//   ViewUI.LoadingBar.start()
+router.beforeEach((to, form, next) => {
+  ViewUI.LoadingBar.start()
 
-//   const token = getToken()
-//   next()
-//   if (!needVerify || to.name === 'test') {
-//     next()
-//   } else if (!token && to.name !== LOGIN_PAGE_NAME) {
-//     // 未登录且要跳转的页面不是登录页
-//     next({
-//       name: LOGIN_PAGE_NAME // 跳转到登录页
-//     })
-//   } else if (!token && to.name === LOGIN_PAGE_NAME) {
-//     // 未登录且要跳转登录页,直接跳转
-//     next()
-//   } else if (token && to.name === LOGIN_PAGE_NAME) {
-//     // 已登录且要跳转登录页,此时需要重定向到首页
-//     next({
-//       name: GUIDE_PAGE_NAME
-//     })
-//   } else {
-//     // 这里做鉴权处理
-//     // 从状态管理仓库获取登录用户信息,access必须是一个数组,如:['super_admin'] ['super_admin', 'admin']
-//     if (store.state.user.hasAccess) {
-//       turnTo(to, store.state.user.access, next)
-//     } else {
-//       // 拉取用户信息,通过用户权限和跳转的页面的name来判断是否有权限访问;
-//       store.dispatch('checkRole').then(user => {
-//         turnTo(to, user.access, next)
-//       }).catch(() => {
-//         setToken('')
-//         next({
-//           name: 'login'
-//         })
-//       })
+  const token = getToken()
+  next()
+  if (!needVerify || to.name === 'test') {
+    next()
+  } else if (!token && to.name !== LOGIN_PAGE_NAME) {
+    // 未登录且要跳转的页面不是登录页
+    next({
+      name: LOGIN_PAGE_NAME // 跳转到登录页
+    })
+  } else if (!token && to.name === LOGIN_PAGE_NAME) {
+    // 未登录且要跳转登录页,直接跳转
+    next()
+  } else if (token && to.name === LOGIN_PAGE_NAME) {
+    // 已登录且要跳转登录页,此时需要重定向到首页
+    next({
+      name: GUIDE_PAGE_NAME
+    })
+  } else {
+    next()
+    // 这里做鉴权处理
+    // 从状态管理仓库获取登录用户信息,access必须是一个数组,如:['super_admin'] ['super_admin', 'admin']
+    // if (store.state.user.hasAccess) {
+    //   turnTo(to, store.state.user.access, next)
+    // } else {
+    //   // 拉取用户信息,通过用户权限和跳转的页面的name来判断是否有权限访问;
+    //   store.dispatch('checkRole').then(user => {
+    //     turnTo(to, user.access, next)
+    //   }).catch(() => {
+    //     setToken('')
+    //     next({
+    //       name: 'login'
+    //     })
+    //   })
 
-//       store.dispatch('userGetRole')
-//     }
-//   }
-// })
+    //   store.dispatch('userGetRole')
+    // }
+  }
+})
 
-// router.afterEach(
-//   to => {
-//     ViewUI.LoadingBar.finish()
-//   }
-// )
+router.afterEach(
+  to => {
+    ViewUI.LoadingBar.finish()
+  }
+)
 
 export default router

+ 1 - 1
admin/src/views/activity/enterpriseList.vue

@@ -43,7 +43,7 @@ export default {
         },
         {
           title: '成立时间',
-          key: 'createTime',
+          key: 'registerDate',
           align: 'center'
         },
         {

+ 47 - 19
admin/src/views/enterprise/components/baseForm.vue

@@ -9,16 +9,16 @@
             </FormItem>
           </i-col>
           <i-col :span="12" class="">
-            <FormItem label="所属行业" prop="companyType">
-              <i-select size="large" v-model="form.companyType" @on-change="changeCompanyType" :disabled="isDetail">
+            <FormItem label="所属行业" prop="tradeName">
+              <i-select size="large" v-model="form.tradeName" @on-change="changeCompanyType" :disabled="isDetail">
                 <i-option v-for="item in industryList" :key="item.id" :value="item.name">{{ item.name }}</i-option>
               </i-select>
               <!-- <Input type="text" size="large" v-model="form.companyType" :disabled="isDetail" /> -->
             </FormItem>
           </i-col>
           <i-col :span="12" class="">
-            <FormItem label="成立时间" prop="registerDate">
-              <Date-picker v-model="form.registerDate" type="year" size="large" placeholder=""  :disabled="isDetail" @on-change="changeDate"></Date-picker>
+            <FormItem label="成立时间" prop="registerDate1">
+              <Date-picker v-model="form.registerDate1" type="year" size="large" placeholder=""  :disabled="isDetail" @on-change="changeDate"></Date-picker>
             </FormItem>
           </i-col>
           <i-col :span="12" class="">
@@ -57,8 +57,8 @@
           </i-col>
           <i-col :span="24" class="">
             <FormItem label="公司logo">
-              <picUpload  ref="logoUpload" tips="只能上传jpg/png文件,且不超过500kb" :multiple="false" :limit="1" :preUploads="preLogoUploads" :hasUploads="hasLogoUploads" v-if="!isDetail" />
-              <img style="width: 100px;height:100px;" :src="form.companyLogo" v-else>
+              <picUpload  ref="logoUpload" tips="只能上传jpg/png文件,且不超过500kb" :multiple="false" :limit="1" :preUploads="preLogoUploads" :hasUploads="hasLogoUploads" :hideUpload="isDetail" />
+              <!-- <img style="width: 100px;height:100px;" :src="form.companyLogo" v-else> -->
             </FormItem>
           </i-col>
           <!-- <i-col :span="12" class="">
@@ -69,9 +69,9 @@
           <i-col :span="24" class="">
             <FormItem label="场景地址">
               <template>
-                <Input type="text" size="large" v-model="form.vrLink" :disabled="isDetail" />
+                <Input type="text" size="large" v-model="vrLink" :disabled="isDetail" />
                 <Button type="primary" size="large" class="input-btn" @click="modalShow=true" v-if="!isDetail">选择场景</Button>
-                <Button type="primary" size="large" class="input-btn">编辑场景</Button>
+                <Button type="primary" size="large" :class="`input-btn ${form.sceneNum ? '' : 'not-allow'}`" @click="toEditScene">编辑场景</Button>
               </template>
             </FormItem>
           </i-col>
@@ -106,7 +106,7 @@
         <tables 
           :data-api="getGuideList"
           :columns="guideTableColumns"
-          placeholder="经纪人"
+          placeholder="讲解员"
           ref="guideTable"
         />
         <div style="height:20px"></div>
@@ -120,9 +120,11 @@ import picUpload from '@/components/upload'
 import cModal from '@/components/Modal'
 import tables from 'components/tables'
 import * as CompanyApi from '@/api/company'
-import { getGuideList } from '@/api/guide'
+import { getGuideList, getGuideById } from '@/api/guide'
 import { searchPlaceByKeyword } from '@/api/qqmap'
 import qqMap from '@/components/map'
+import { getToken } from '@/libs/token'
+
 export default {
   props: {
     form: Object,
@@ -136,9 +138,9 @@ export default {
       select_guide_id: '',
       select_guide: {},
       rules: {
-        name: [{ required: true, message: '请填写公司名', trigger: 'blur' }],
-        companyType: [{ required: true, message: '请选择所属行业', trigger: 'change'}],
-        registerDate: [{ required: true, message: '请填写成立时间', trigger: 'blur'}],
+        companyName: [{ required: true, message: '请填写公司名', trigger: 'blur' }],
+        tradeName: [{ required: true, message: '请选择所属行业', trigger: 'change'}],
+        registerDate1: [{ required: true, message: '请填写成立时间', trigger: 'blur', type: 'date'}],
         staffNum: [{ required: true, message: '请填写员工人数', trigger: 'blur' }],
         registerFund: [{ required: true, message: '请填写注册资金', trigger: 'blur' }],
         mainProduct: [{ required: true, message: '请填写主要产品描述', trigger: 'blur' }],
@@ -241,8 +243,18 @@ export default {
     tables,
     qqMap
   },
-  mounted () {
-    this.getIndustryList()
+  computed: {
+    vrLink: {
+      set (val) {
+        this.form.vrLink = encodeURIComponent(val)
+      },
+      get () {
+        return decodeURIComponent(this.form.vrLink)
+      }
+    }
+  },
+  async mounted () {
+    await this.getIndustryList()
     this.$watch('form.companyLogo', function (newVal) {
       if (this.isDetail) {
         this.hasLogoUploads = [{img: newVal}]
@@ -250,6 +262,12 @@ export default {
     }, {
       immediate: true
     })
+    this.$watch('form.guideId', async (newVal) => {
+      if (this.isDetail) {
+        let res = await getGuideById(this.form.guideId)
+        this.select_guide = res.data || {}
+      }
+    })
   },
   methods: {
     async validate () {
@@ -261,16 +279,19 @@ export default {
     },
     async submit () {
       let res = await this.$refs['logoUpload'].uploadfiles()
+      console.log(this.hasLogoUploads)
       this.form.companyLogo = res[0]
+      this.form.registerDate = new Date(this.form.registerDate).getFullYear()
+      console.log(this.hasLogoUploads)
     },
     changeScene () {
-      this.vrLink = this.select_scene_num ? `${process.env.VUE_APP_4DKANKAN_URL}/vrHouse.html?m=${this.select_scene_num}&appname=vrhouse` : ''
-      this.form.vrLink = this.select_scene_num ? encodeURIComponent(`${process.env.VUE_APP_4DKANKAN_URL}/vrHouse.html?m=${this.select_scene_num}&appname=vrhouse`) : ''
+      this.vrLink = this.select_scene_num ? `${process.env.VUE_APP_4DKANKAN_URL}/kanzhan.html?m=${this.select_scene_num}` : ''
+      this.form.vrLink = this.select_scene_num ? encodeURIComponent(`${process.env.VUE_APP_4DKANKAN_URL}/kanzhan.html?m=${this.select_scene_num}`) : ''
       this.form.sceneNum = this.select_scene_num || ''
       this.modalShow = false
     },
     changeGuide () {
-      this.select_guide = this.$refs['guideTable'].tableData.find(item => item.viewerId === this.select_guide_id)
+      this.select_guide = this.$refs['guideTable'].tableData.find(item => item.viewerId === this.select_guide_id) || {}
       this.form.guideId = this.select_guide.viewerId
       this.guideModalShow = false
     },
@@ -280,7 +301,7 @@ export default {
       })
     },
     changeCompanyType (value) {
-      this.form.companyType = value
+      this.form.tradeName = value
     },
     searchAddress () {
       searchPlaceByKeyword({keyword: this.form.companyAddress}).then(res => {
@@ -310,6 +331,13 @@ export default {
         }
       })
     },
+    toEditScene () {
+      if (this.form.sceneNum) {
+        let kankan = process.env.ENV === 'production' ? `https://4dkankan.com/epc.html?m=${this.form.sceneNum}` : `https://test.4dkankan.com/epc.html?m=${this.form.sceneNum}`
+        kankan = `${kankan}&token=${getToken()}`
+        window.open(kankan)
+      }
+    }
   }
 }
 </script>

+ 45 - 11
admin/src/views/enterprise/index.vue

@@ -3,7 +3,7 @@
     <div class="header-title">公司概况
       <Button type="primary" size="large" class="fr" @click="isDetail=false" v-if="companyId">修改信息</Button>
     </div>
-    <baseForm :form="form" ref="base-form" :isDetail="isDetail" />
+    <baseForm key="base" :form="form" ref="base-form" :isDetail="isDetail" />
     <div class="header-title">视频介绍</div>
     <videoForm :form="form" ref="video-form" :isDetail="isDetail" />
     <div class="header-title">图片介绍</div>
@@ -21,18 +21,20 @@ import * as CompanyApi from '@/api/company'
 import baseForm from './components/baseForm'
 import videoForm from './components/videoForm'
 import introPicForm from './components/introPicForm'
-import { getAdmin } from '@/libs/token'
+import { getAdmin, setAdmin } from '@/libs/token'
+import { refreshAdminerInfo } from '@/api/index'
+// import { getGuideById } from '@/api/guide'
 
 export default {
   data () {
     return {
       isDetail: false,
       form: {
-        companyName: '111',
+        companyName: '',
         companyType: '',
-        sceneNum: 't-jpLXfXA',
-        vrLink: 'http%3A%2F%2F192.168.0.98%3A8080%2Fkanzhan.html%3Fm%3Dt-jpLXfXA',
-        registerDate: new Date()
+        sceneNum: '',
+        vrLink: '',
+        registerDate: ''
       },
       
     }
@@ -46,6 +48,9 @@ export default {
     companyId () {
       let admin = getAdmin().admin
       return this.$route.query.companyId || admin.belongCompanyId
+    },
+    adminId () {
+      return getAdmin().admin.adminId
     }
   },
   mounted () {
@@ -68,21 +73,36 @@ export default {
       await Promise.all([this.$refs['base-form'].submit(), this.$refs['video-form'].submit(), this.$refs['intro-form'].submit()])
       let api = this.form.companyId ? CompanyApi.updateCompany : CompanyApi.addCompany
       return api(this.form).then(() => {
-        this.$Message.success('修改成功')
+        this.$Message.success(this.form.companyId ? '修改成功' : '新增成功')
+        this.isDetail = true
+        setTimeout(() => {
+          this.refreshAdminerInfo()
+        }, 500)
       })
     },
     cancle () {
       window.location.reload()
     },
-    getCompanyDetail () {
-      if (!this.companyId) return
-      CompanyApi.getCompanyDetail(this.companyId).then(res => {
+    getCompanyDetail (companyId) {
+      let id = companyId || this.companyId
+      if (!id) return
+      CompanyApi.getCompanyDetail(id).then(res => {
         this.isDetail = true
-        res.data.company.registerDate = new Date(res.data.company.registerDate)
+        res.data.company.registerDate1 = new Date(res.data.company.registerDate)
         
         this.form = res.data.company
         console.log(this.form)
       })
+    },
+    refreshAdminerInfo () {
+      return refreshAdminerInfo(this.adminId).then(res => {
+        this.$router.push({
+          path: '/enterprise',
+          query: {
+            companyId: res.data.belongCompanyId
+          }
+        })
+      })
     }
   }
 }
@@ -119,6 +139,20 @@ export default {
   }
   .input-btn {
     margin: 0 0 0 15px;
+    position: relative;
+    &.not-allow {
+      &::after {
+        width: calc(100% + 2px);
+        height: calc(100% + 2px);
+        content: '';
+        display: block;
+        background: rgba(0,0,0,0.5);
+        position: absolute;
+        top: -1px;
+        left: -1px;
+        cursor: not-allowed;
+      }
+    }
   }
   .actions-w {
     padding-left: 86px;

+ 7 - 3
admin/src/views/system/commentator/list.vue

@@ -48,7 +48,7 @@ import CModal from 'components/Modal'
 const roleMap = {
   0: '超级管理员',
   1: '普通管理员',
-  2: '经纪人',
+  2: '讲解员',
 }
 export default {
   data() {
@@ -110,7 +110,8 @@ export default {
         {
           title: '创建时间',
           key: 'createTime',
-          align: 'center'
+          align: 'center',
+          render: (h, params) => h('p', params.row.createTime.replace('T', ' '))
         },
         {
           title: '操作',
@@ -157,7 +158,9 @@ export default {
     },
     async updateUser() {
       await this.changeUser()
-      this.$refs['table'].handleTableData()
+      setTimeout(() => {
+        this.$refs['table'].handleTableData()
+      }, 200)
     },
     toEdit (row) {
       this.form = JSON.parse(JSON.stringify(row))
@@ -165,6 +168,7 @@ export default {
       this.show = true
     },
     toDel(row) {
+      row[0].enable = 0
       this.toEdit(row[0])
       this.show = false
       this.enable = 0

+ 3 - 2
admin/src/views/system/commentator/userList.vue

@@ -17,7 +17,7 @@ import { fetchViewerList, updateGuide } from 'api/'
 const roleMap = {
   0: '超级管理员',
   1: '普通管理员',
-  2: '经纪人',
+  2: '讲解员',
 }
 export default {
   data() {
@@ -58,7 +58,8 @@ export default {
         {
           title: '授权时间',
           key: 'createTime',
-          align: 'center'
+          align: 'center',
+          render: (h, params) => h('p', params.row.createTime.replace('T', ' '))
         }
       ],
       selecteds: []

+ 31 - 11
admin/src/views/system/user/list.vue

@@ -8,19 +8,22 @@
       ref="table"
     />
     <CModal :show="show" title="用户信息" :width="420" @submit="changeUser" @close="closeModal">
-      <Form :label-width="75">
+      <Form :label-width="85">
         <FormItem label="用户名称">
           <Input size="large" v-model="form.name" disabled />
         </FormItem>
         <FormItem label="用户角色">
           <Select v-model="form.type" size="large">
-            <Option :value="-1">未分配</Option>
-            <Option :value="item.roleType" v-for="item in roleList" :key="item.roleId">{{ item.remark }}</Option>
+            <!-- <Option :value="-1">未分配</Option> -->
+            <Option :value="item.roleId" v-for="item in roleList" :key="item.roleId">{{ item.remark }}</Option>
           </Select>
         </FormItem>
         <FormItem label="手机号码">
           <Input size="large" v-model="form.phone" disabled />
         </FormItem>
+        <FormItem label="公司代号">
+          <Input size="large" v-model="form.deptId" placeholder="请填写公司代号" />
+        </FormItem>
       </Form>
     </CModal>
   </div>
@@ -30,20 +33,35 @@
 import tables from 'components/tables'
 import { fetchUserList, updateUser } from 'api/'
 import CModal from 'components/Modal'
+import { getAdmin } from '@/libs/token'
 
 const roleMap = {
-  0: '超级管理员',
-  1: '普通管理员',
-  2: '经纪人',
+  1: '超级管理员',
+  2: '主账号管理员',
+  3: '二级管理员',
+  4: '游客'
+}
+
+const roleType = getAdmin().admin.type
+
+const accessRole = {
+  1: [2,3,4],
+  2: [3,4],
+  3: [],
+  4: []
 }
+
+console.log(accessRole[roleType])
 export default {
   data() {
     return {
       show: false,
-      form: {},
+      form: {
+        type: 1
+      },
       // 传递给tables的表格列数据
-      dataApi: fetchUserList,
-      roleList: [],
+      dataApi: (roleType == 1 || roleType=== 2) ? fetchUserList : function(){},
+      roleList: accessRole[roleType].map(item => { return { roleId: item, remark: roleMap[item] } }),
       columns: [
         {
           type: 'index',
@@ -53,7 +71,7 @@ export default {
         },
         {
           title: '账号ID',
-          key: 'admin_id',
+          key: 'adminId',
           align: 'center'
         },
         {
@@ -99,7 +117,8 @@ export default {
         {
           title: '创建时间',
           key: 'createTime',
-          align: 'center'
+          align: 'center',
+          render: (h, params) => h('p', params.row.createTime.replace('T', ' '))
         },
         {
           title: '操作',
@@ -127,6 +146,7 @@ export default {
     },
     toEdit (row) {
       this.form = JSON.parse(JSON.stringify(row))
+      console.log(this.form)
       this.show = true
     },
     closeModal () {

+ 2 - 2
admin/vue.config.js

@@ -26,10 +26,10 @@ module.exports = {
       '/admin': {
         // target: 'http://120.24.85.77:8087', // 正式环境
         // target: 'http://192.168.0.83:8075'  // 伟玉本地环境
-        target: 'http://120.25.146.52:8075'    // 测试环境
+        target: 'http://haowantest.4dkankan.com'    // 测试环境
       },
       '/node-upload': {
-        target: 'http://vrhouse2.4dkankan.com',
+        target: 'http://haowantest.4dkankan.com',
       },
     }
     // before: require('./mock/mock-server.js')

+ 4 - 2
miniprogram/apis/fetcher/request.js

@@ -2,7 +2,7 @@ import ERROR_CODE from '../../config/error_code'
 import { API_BASE_URL } from './../../config/config'
 const BASE_URL = `${API_BASE_URL}/app/`
 // 需要登录的错误码
-const needLoginErrorCode = [3004, 3005, 3006]
+const needLoginErrorCode = [3018, 3019]
 
 Promise.prototype.finally = function (callback) {
   var Promise = this.constructor;
@@ -35,6 +35,7 @@ function request (url, options) {
       //   token: app.globalData.token
       // },
       success (res) {
+        console.log(res.data, '请求成功')
         if (res.data.code == 0 || res.data.code == 200 || res.data.errno === 0) {
           resolve(res.data)
         } else if (needLoginErrorCode.indexOf(Number(res.data.code)) !== -1) {
@@ -47,6 +48,7 @@ function request (url, options) {
         }
       },
       fail (err) {
+        console.log(err, '请求失败')
         reject(err)
       }
     }, options))
@@ -64,7 +66,7 @@ function post (url, data = {}, options = {}) {
   options.method = 'POST'
   // token和user_ID放在url上, 后续后端再做优化
   const app = getApp();
-  url += `?token=${app.globalData.token || ''}&viewerId=${app.globalData.userinfo.user_id}`
+  url += `?token=${getApp().globalData.token || ''}&viewerId=${getApp().globalData.userinfo.viewerId}`
   options.data = Object.assign({
     user_id: app.globalData.userinfo.user_id
   }, data)

+ 3 - 3
miniprogram/apis/im.js

@@ -8,7 +8,7 @@ export default {
   },
   getContacts () {
     const app = getApp()
-    return request.get(`${API_BASE_URL}/im/getContacts/${app.globalData.userinfo.user_id}`, {user_id: app.globalData.userinfo.user_id})
+    return request.get(`${API_BASE_URL}/im/getContacts/${app.globalData.userinfo.viewerId}`, {user_id: app.globalData.userinfo.viewerId})
   },
   upload () {
     const formData = new FormData()
@@ -16,10 +16,10 @@ export default {
     return request.post(`${API_BASE_URL}/im/upload`, formData)
   },
   addFriend (friend_id) {
-    return request.get(`${API_BASE_URL}/im/addFriend/${friend_id}/${getApp().globalData.userinfo.user_id}`)
+    return request.get(`${API_BASE_URL}/im/addFriend/${friend_id}/${getApp().globalData.userinfo.viewerId}`)
   },
 
   getMsgHistory (friend_id, offset=0) {
-    return request.get(`${API_BASE_URL}/im/getMsgHistory/${friend_id}/${getApp().globalData.userinfo.user_id}/${offset}`)
+    return request.get(`${API_BASE_URL}/im/getMsgHistory/${friend_id}/${getApp().globalData.userinfo.viewerId}/${offset}`)
   }
 }

+ 4 - 0
miniprogram/app.js

@@ -5,6 +5,7 @@ import {
 } from './utils/storage'
 
 import ImApi from './apis/im'
+import UserApi from './apis/user'
 import AppIMDelegate from "./delegate/app-im-delegate";
 import { fotmatDate } from './utils/date'
 
@@ -33,6 +34,9 @@ App({
       wx.getUserInfo({
         complete: (res) => {console.log(res, 'userinfo')},
       })
+      UserApi.getUserInfoById(this.globalData.userinfo.viewerId).then(res => {
+        this.globalData.userinfo = res.data
+      })
     }, 1000)
   },
   SetProvinceCity(province, city, district) {

+ 6 - 6
miniprogram/components/business-card/index.wxml

@@ -2,24 +2,24 @@
     <image class="card-bg" src="https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/domain/exhibition/demo/img_cardbg%402x.png"  mode="widthFix"></image>
     <view class="card-content">
       <view class="card-header">
-      <image class="avatar" src="{{info.avatar || 'https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/domain/exhibition/demo/avatar_default%402x.png'}}"></image>
+      <image class="avatar" src="{{info.avatar || 'https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/domain/exhibition/demo/avatar_default.svg'}}"></image>
       <view class="card-header-info">
-        <view class="card-name">{{info.name}}<text>{{info.companyPosition}}</text></view>
-        <view class="company">{{info.companyName}}</view>
+        <view class="card-name">{{info.name || ''}}<text>{{info.companyPosition || ''}}</text></view>
+        <view class="company">{{info.companyName || ''}}</view>
       </view>
     </view>
     <view class="card-body">
       <view class="info-item">
         <icon icon="maps_call"></icon>
-        <text class="value">{{info.phoneNum}}</text>
+        <text class="value">{{info.phoneNum || ''}}</text>
       </view>
       <view class="info-item">
         <icon icon="card_mail"></icon>
-        <text class="value">{{info.email}}</text>
+        <text class="value">{{info.email || ''}}</text>
       </view>
       <view class="info-item">
         <icon icon="card_address"></icon>
-        <text class="value">{{info.companyAddress}}</text>
+        <text class="value">{{info.companyAddress || ''}}</text>
       </view>
     </view>
     </view>

+ 3 - 0
miniprogram/components/login-pannel/login-pannel.js

@@ -26,6 +26,9 @@ Component({
    */
   methods: {
     bindgetuserinfo (e) {
+      if (!e.detail.userInfo) {
+        return
+      }
       loginByUserInfo(e.detail, this.wx_code).then(res => {
         this.triggerEvent('loginSuccess')
       })

+ 1 - 1
miniprogram/components/login-pannel/login-pannel.wxss

@@ -31,7 +31,7 @@
   transform: translateY(315px);
 }
 .login-logo {
-  width: 181.45rpx;
+  width: 120rpx;
   height: 120rpx;
   margin: 0 auto;
 }

+ 3 - 0
miniprogram/components/search-bar/search-bar.wxml

@@ -1,4 +1,7 @@
 <view class="search-bar">
   <icon icon="home_search" class="icon"   />
   <input disabled="{{ disabled }}" bindinput="bindinput" value="{{value}}" placeholder="{{ placeholder || '请输入关键字' }}" confirm-type="search" bindconfirm="bindconfirm"></input>
+  <view class="recommend-list">
+    <view class="recommend-item"></view>
+  </view>
 </view>

+ 4 - 4
miniprogram/config/config.js

@@ -1,5 +1,5 @@
-export const IM_HOST = 'ws://haowantest.4dkankan.com'
-export const API_BASE_URL = 'http://haowantest.4dkankan.com'
+// export const IM_HOST = 'ws://haowantest.4dkankan.com'
+// export const API_BASE_URL = 'http://haowantest.4dkankan.com'
 
 
 // export const IM_HOST = 'ws://192.168.0.83:8075'
@@ -7,5 +7,5 @@ export const API_BASE_URL = 'http://haowantest.4dkankan.com'
 // export const API_BASE_URL = 'http://192.168.0.83:8075'
 
 
-// export const IM_HOST = 'wss://vrhouse.4dkankan.com'
-// export const API_BASE_URL = 'https://vrhouse.4dkankan.com'
+export const IM_HOST = 'wss://haowan.4dkankan.com'
+export const API_BASE_URL = 'https://haowan.4dkankan.com'

+ 1 - 1
miniprogram/delegate/app-im-delegate.js

@@ -30,7 +30,7 @@ export default class AppIMDelegate {
     connectSocket () {
         const app = getApp()
         if (app.globalData.token) {
-            this.iIMHandler.createConnection({options: {url: `${IM_HOST}/im/${app.globalData.userinfo.user_id}`}});
+            this.iIMHandler.createConnection({options: {url: `${IM_HOST}/im/${app.globalData.userinfo.viewerId}`}});
         }
     }
 }

BIN=BIN
miniprogram/image/4Dage/login-logo.png


+ 25 - 4
miniprogram/pages/business-card/business-card.js

@@ -10,11 +10,16 @@ VueLikePage([], {
   },
   methods: {
     onShow () {
-      
       this.getBusinessCardList()
       this.getBusinessCardList(1)
-      this.setData({
-        my_info: getApp().globalData.userinfo
+      this.getMyCardInfo()
+    },
+    getMyCardInfo () {
+      return UserApi.getVisitCardDetail(getApp().globalData.userinfo.viewerId).then(res => {
+        console.log(res, )
+        this.setData({
+          my_info: res.data
+        })
       })
     },
     getBusinessCardList (type=0) {
@@ -36,8 +41,24 @@ VueLikePage([], {
     },
     bindinput (e) {
       const value = e.detail
+      let { business_0, business_1, activeType } = this.data
+      let noData = false
+      let business_list = business_0.filter(item => item.name.indexOf(value) > -1)
+      activeType = 0
+      if (business_list.length === 0) {
+        business_list = business_1.filter(item => item.name.indexOf(value) > -1)
+        if (business_list.length > 0) {
+          activeType = 1
+        }
+      }
+      if (business_list.length === 0 && value) {
+        noData = true
+      }
+
       this.setData({
-        business_list: this.origin_list.filter(item => item.name.indexOf(value) > -1)
+        business_list,
+        activeType,
+        noData
       })
     },
     toBusinessCard (e) {

+ 1 - 0
miniprogram/pages/business-card/business-card.wxml

@@ -37,6 +37,7 @@
           </view>
         </view>
       </view>
+      <view class="no-data" wx:if="{{ noData }}" >无符合条件的数据</view>
     </view>
   </view>
 </view>

+ 1 - 0
miniprogram/pages/business-card/detail/business-card-detail.js

@@ -1,5 +1,6 @@
 import { VueLikePage } from '../../../utils/page'
 import UserApi from '../../../apis/user'
+import Router from '../../../utils/routes'
 VueLikePage([], {
   data: {
     

+ 6 - 0
miniprogram/pages/business-card/detail/business-card-detail.wxss

@@ -17,6 +17,12 @@
 }
 .value {
   text-align: right;
+  flex: 1;
+  margin-left: 30rpx;
+}
+
+.value input {
+  width: 100%;
 }
 
 .action-btn {

+ 9 - 0
miniprogram/pages/business-card/scan-result/scan-result.wxss

@@ -57,6 +57,12 @@
 }
 .value {
   text-align: right;
+  flex: 1;
+  margin-left: 30rpx;
+}
+
+.value input {
+  width: 100%;
 }
 
 .action-btn {
@@ -75,4 +81,7 @@
   color: #131D34;
   font-size: 34rpx;
   text-align: center;
+}
+input {
+  text-align: right;
 }

+ 8 - 2
miniprogram/pages/chat/msg-type/vrcard-manager.js

@@ -1,11 +1,17 @@
+import Router from './../../../utils/routes'
+
 export default class VrCardManager {
     constructor(page) {
         this._page = page
         this._page.vrCardClickEvent = function (e) {
           const { vrlink, house } = e.currentTarget.dataset
           if (vrlink) {
-            wx.navigateTo({
-              url: `/pages/scene/scene?house_id=${house}&vr_link=${vrlink}&is_auto=1`,
+            Router.push({
+              url: 'scene',
+              query: {
+                vr_link: vrlink,
+                is_auto: 1
+              }
             })
           } else {
             wx.navigateTo({

+ 3 - 8
miniprogram/pages/collect-goods/collect-goods.js

@@ -1,6 +1,8 @@
 import { VueLikePage } from '../../utils/page'
 import GoodsApi from '../../apis/goods'
 import Router from '../../utils/routes'
+import { loadCollectHistory } from '../../utils/storage'
+
 VueLikePage([], {
   data: {
     items: [],
@@ -17,18 +19,11 @@ VueLikePage([], {
       })
     },
     getGoodsList () {
-      GoodsApi.getCollectedGoods().then(res => {
-        const list = res.data.list.map(item => {
-          item.img_url = item.listPicUrl,
-          item.title = item.name
-          item.desc = item.specifications
-          return item
-        })
+      const list = loadCollectHistory()
         this.setData({
           items: list,
           itemsShowList: list
         })
-      })
     },
     search (e) {
       const value = e.detail

+ 2 - 1
miniprogram/pages/collect-goods/collect-goods.json

@@ -3,5 +3,6 @@
     "search-bar": "/components/search-bar/search-bar",
     "list-item": "/components/list-item/list-item",
     "no-more-bar": "/components/no-more-bar/no-more-bar"
-  }
+  },
+  "navigationBarTitleText": "我的收藏"
 }

+ 1 - 1
miniprogram/pages/collect-goods/collect-goods.wxml

@@ -2,7 +2,7 @@
   <search-bar bind:search="search" bindinput="bindinput" />
   <view class="tips">产品({{itemsShowList.length}})</view>
   <view>
-    <list-item wx:for="{{ itemsShowList }}" wx:kes="{{ index }}" item="{{ item }}" data-id="{{ item.goodsId }}" bindtap="toDetail" />
+    <list-item wx:for="{{ itemsShowList }}" wx:kes="{{ index }}" item="{{ item }}" data-id="{{ item.id }}" bindtap="toDetail" />
   </view>
 </view>
 <no-more-bar wx:if="{{ itemsShowList.length > 0}}" />

+ 1 - 1
miniprogram/pages/exhibition-detail/exhibition-detail.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "展会概况"
+  "navigationBarTitleText": "科技珠海"
 }

+ 3 - 2
miniprogram/pages/exhibition-enterprise/exhibition-enterprise.js

@@ -10,7 +10,8 @@ VueLikePage([], {
   methods: {
     async onLoad () {
       let tabs = await this.getCompanyHalls()
-      this.selectHall = tabs[0].name
+      tabs.unshift({name: '全部', id: ''})
+      this.selectHall = tabs[0].name === '全部' ? '' : tabs[0].name
       let companyList = await this.getCompanyByHall()
       tabs[0].list = companyList.data.list
       this.setData({
@@ -35,7 +36,7 @@ VueLikePage([], {
       Router.push('search')
     },
     async onChange (e) {
-      this.selectHall = e.detail.title
+      this.selectHall =e.detail.title === '全部' ? '' : e.detail.title
       let res = await this.getCompanyByHall()
       let tabs = this.data.tabs
       tabs[e.detail.index].list = res.data.list

+ 2 - 1
miniprogram/pages/exhibition-enterprise/exhibition-enterprise.json

@@ -4,5 +4,6 @@
     "van-tabs": "/components/vant-ui/tabs/index",
     "no-more-bar": "/components/no-more-bar/no-more-bar",
     "search-bar": "./../../components/search-bar/search-bar"
-  }
+  },
+  "navigationBarTitleText": "企业名录"
 }

+ 10 - 0
miniprogram/pages/exhibition-enterprise/exhibition-enterprise.wxss

@@ -45,4 +45,14 @@
   transform: translateY(-50%);
   color: #909090;
   font-size: 24rpx;
+}
+
+.van-tabs__wrap--scrollable .van-tab {
+  flex:none;
+  flex-basis: auto !important;
+  /* width: 100px; */
+  padding: 0 30rpx;
+}
+.van-ellipsis {
+  /* width: 100px; */
 }

+ 130 - 48
miniprogram/pages/find/find.js

@@ -1,70 +1,152 @@
-// pages/find/find.js
+import * as SocketHandle from '../../utils/socket-handle'
+import { getQueryString } from './../../utils/tools'
+import ImSend from './../../utils/imSend'
+import ImApi from './../../apis/im'
+import CompanyApi from './../../apis/company'
+// pages/web/web.js
+const app = getApp()
+
+function randomString(e) {
+  for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
+    t += i.charAt(Math.floor(Math.random() * i.length));
+  return t
+}
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    show: false
+    url: "",
+    pullUrl: [],
+    pushUrl: '',
+    live_base_url: "rtmp://120.24.85.77:1935/hls",
+    socketOpts: {},
+    room_id: '',
+    hasBeLogin: false,
+    vr_link: '',
+    showWebView: true
   },
-
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
-    setTimeout(() => {
+  onLoad: async function (options) {
+    let vr_link = 'https://test.4dkankan.com/shipin.html?'
+    this.vrLink = vr_link
+    this.companyDetail = {}
+    this.role = this.companyDetail.guideId === (getApp().globalData.userinfo ? getApp().globalData.userinfo.viewerId : null) ? 'agent' : 'customer'
+    let opts = {
+      roomId: randomString(18),
+      userId: getApp().globalData.userinfo.viewerId,
+      role: 'customer',
+      scene_num: getQueryString(vr_link, 'm') || ''
+    }
+    this.originUrl = `${vr_link}&room_id=${opts.roomId}${options.is_auto? `&vr=1` : ''}`
+    this.setData({
+      socketOpts: opts,
+      url: this.originUrl,
+      room_id: opts.roomId,
+      house_id: options.house_id || '',
+      vr_link: vr_link
+    })
+    
+    this.socket = SocketHandle.initSocket(this, opts)
+    if (app.globalData.token && !getQueryString(this.data.url, 'user_id') && this.role) {
       this.setData({
-        show: true
+        url: `${this.originUrl}&user_id=${app.globalData.userinfo.viewerId}${this.data.hasBeLogin ? `&vr=1` : ''}`
       })
-    }, 2000)
+    }
   },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
+  onShow() {
+    if (app.globalData.token && !getQueryString(this.data.url, 'user_id') && this.role) {
+      this.setData({
+        url: `${this.originUrl}&role=${this.role}&user_id=${app.globalData.userinfo.viewerId}${this.data.hasBeLogin ? `&vr=1` : ''}`
+      })
+    }
   },
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
+  onUnload () {
+    this.socket.disconnect()
   },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
+  countLiveUrl(user_id) {
+    return `${this.data.live_base_url}/${this.data.room_id}_${user_id}`
   },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
+  startPlay(data) {
+    console.log(data)
+    if (!app.globalData.token) {
+      wx.showToast({
+        title: '未登录',
+      })
+      this.setData({
+        hasBeLogin: true,
+        showLogin: true
+      })
+      return
+    }
+    if (!this.hasSend) {
+      // this.scene = data.user.scene_num
+      this.sendVrCard()
+      this.hasSend = true
+    }
+    this.setData({
+      pushUrl: this.countLiveUrl(getApp().globalData.userinfo.user_id)
+    })
   },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
+  createLivePull({persons, roomId}) {
+    let arr = []
+    persons.forEach(item => {
+      arr.push(this.countLiveUrl(item.userId))
+    })
+    
+    this.setData({
+      pullUrl: arr
+    })
   },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
+  someoneLeave() {
+    this.setData({
+      pullUrl: [],
+      pushUrl: ''
+    })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
+  sendVrCard () {
+    if (this.companyDetail.guideId === getApp().globalData.userinfo.viewerId) {
+      return
+    }
+    ImApi.addFriend(this.companyDetail.guideId).finally(() => {
+      ImSend.sendVrMsg({title: '带看', detail_images: [this.companyDetail.vrImg], vrLink: encodeURIComponent(this.vrLink)}, this.data.room_id, this.companyDetail.guideId, true)
+    })
+  },
+  getHouseDetail (scene) {
+    return CompanyApi.getCompanyDetailByScene(scene).then(res => {
+      res.data.vrImg = JSON.parse(res.data.introduceImage)[0].img
+      this.companyDetail = res.data
+      // house.detail_images = JSON.parse(house.detail_images)
+      // this.setData({
+      //   house
+      // })
+      // return res
+    })
+  },
+  onShareAppMessage: function (res) {
+    var path = '/pages/find/find'
+    return {
+        title: '三维数字化技术助力内循环',
+        path: path,
+        imageUrl: 'https://houseoss.4dkankan.com/domain/exhibition/demo/hwzff.jpg', // 分享的封面图
+    }
+},
+  bindmessage (e) {
+    const img_url = e.detail.data[0]
+    getApp().globalData.shared_img = img_url
+  },
+  loginSuccess () {
+    this.onShow()
+    this.hideLogin()
+  },
+  hideLogin () {
+    this.setData({
+        showLogin: false
+    })
+},
 })

+ 5 - 2
miniprogram/pages/find/find.wxml

@@ -1,3 +1,6 @@
-<web-view src="https://test.4dkankan.com/showList.html"></web-view>
+<web-view src="{{ url }}"></web-view>
 
-<cover-view class="test" wx:if="{{ show }}" >测试cover-view</cover-view>
+<live-pusher mode="RTC" wx:if="{{pushUrl}}" autopush url="{{pushUrl}}" enable-ans="{{true}}" bindstatechange="statechange"  enable-camera="{{false}}"></live-pusher>
+<live-player mode="RTC" wx:for="{{pullUrl}}" wx:key="index" autoplay="{{true}}" src="{{item}}" min-cache="{{0.2}}" max-cache="{{0.8}}"></live-player>
+
+<login-pannel wx:if="{{showLogin}}" bindloginSuccess="loginSuccess" bindhide="hideLogin" />

+ 30 - 17
miniprogram/pages/goods-detail/goods-detail.js

@@ -4,13 +4,16 @@ import Router from '../../utils/routes'
 import ImSend from '../../utils/imSend'
 import CenSus from '../../apis/census'
 import CompanyApi from '../../apis/company'
+import { saveCollectHistory, loadCollectHistory, removeCollect } from '../../utils/storage'
+
 VueLikePage([], {
   data: {
     detail: {}
   },
   methods: {
     async onLoad (options) {
-      const { goods_id, companyId } = options
+      console.log(options)
+      const { goods_id, company_id } = options
       this.goods_id = goods_id
       const goodsDetail = await this.getGoodsDetail()
       // this.getGuide()
@@ -18,32 +21,42 @@ VueLikePage([], {
       this.setData({
         detail: goodsDetail
       })
-      const companyRes = await CompanyApi.getCompanyDetail(companyId)
+      const companyRes = await CompanyApi.getCompanyDetail(company_id)
+      console.log(companyRes)
       this.company = companyRes.data
     },
     async getGoodsDetail () {
       let res = await GoodsApi.getShopGoodsDetail(this.goods_id)
-      console.log(res, 'res')
       let goodsDetail = res.data
       goodsDetail.banner = goodsDetail.gallery.map(item => item.img_url)
       return goodsDetail
     },
     getGoodsCollectStatus () {
-      return GoodsApi.getGoodsCollectStatus(this.goods_id).then(res => {
-        this.setData({
-          collectStatus: res.data
-        })
+      const status = loadCollectHistory(this.goods_id)
+      this.setData({
+        collectStatus: Boolean(status) ? 1 : 0
       })
     },
     changeCollect () {
       const collectStatus = this.data.collectStatus
-      const apiFn = collectStatus === 1 ? GoodsApi.cancleCollect : GoodsApi.collectGoods
-      return apiFn(this.goods_id).then(res => {
-        wx.showToast({
-          title: `${collectStatus === 1 ? '取消' : '收藏'}成功`,
-        })
-        this.getGoodsCollectStatus()
+      let data = '', apiFn
+      if (collectStatus === 1) {
+        data = this.goods_id
+        apiFn = removeCollect
+      } else {
+        apiFn = saveCollectHistory
+        data = {
+          img_url: this.data.detail.banner[0],
+          title: this.data.detail.info.name,
+          id: this.goods_id
+        }
+      }
+      
+      apiFn(data)
+      wx.showToast({
+        title: `${collectStatus === 1 ? '取消' : '收藏'}成功`,
       })
+      this.getGoodsCollectStatus()
     },
     getGuide () {
       GoodsApi.getGuideByGoods(this.goods_id).then(res => {
@@ -56,10 +69,10 @@ VueLikePage([], {
         Router.push('login')
         return
       }
-      CenSus.addGoodsQueryNum({
-        goodsId: this.goods_id,
-        sceneNum: this.company.sceneNum
-      })
+      // CenSus.addGoodsQueryNum({
+      //   goodsId: this.goods_id,
+      //   sceneNum: this.company.sceneNum
+      // })
       ImSend.sendMsg({content:'你好', msgType:'text', toId:this.company.guideId}).then(() => {
         Router.push({
           url: 'chat',

+ 2 - 1
miniprogram/pages/goods-detail/goods-detail.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "产品详情"
 }

+ 6 - 6
miniprogram/pages/goods-detail/goods-detail.wxml

@@ -31,11 +31,11 @@
     </view>
 	</view>
 
-  <view class="actions-w ">
-    <view class="is-iphoneX">
+  
+</scroll-view>
+<view class="actions-w ">
+    <view class="">
       <view class="button" bindtap="changeCollect">{{ collectStatus === 1 ? '取消收藏' : '收藏'}}</view>
-      <view class="button submit" bindtap="toChat">询盘</view>
+      <view class="button submit" bindtap="toChat">询</view>
     </view>
-    
-  </view>
-</scroll-view>
+  </view>

+ 1 - 0
miniprogram/pages/goods-detail/goods-detail.wxss

@@ -52,6 +52,7 @@
   padding: 28rpx 46rpx;
   background: #fff;
   box-shadow:0px -2px 8px rgba(0,0,0,0.05);
+  z-index: 100;
 }
 .actions-w>view {
   display: flex;

+ 11 - 5
miniprogram/pages/index/index.js

@@ -13,6 +13,7 @@ VueLikePage([], {
         detail: {},
         categoryList: [],
         companyList: [],
+        currentIndex: 0,
         tabList: [{
                 label: '科技珠海',
                 route: 'exhibitionDetail',
@@ -44,9 +45,9 @@ VueLikePage([], {
         onShareAppMessage: function (res) {
             var path = '/pages/index/index'
             return {
-                title: '四维看看,海量复刻真房源',
+                title: '三维数字化技术助力内循环',
                 path: path,
-                imageUrl: 'https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/4dHouse/share.png', // 分享的封面图
+                imageUrl: 'https://houseoss.4dkankan.com/domain/exhibition/demo/hwzff.jpg', // 分享的封面图
             }
         },
         toGoodsTab(e) {
@@ -85,7 +86,7 @@ VueLikePage([], {
             })
         },
         getCompanyList () {
-            Api.getCompanyList().then(res => {
+            Api.getCompanyList({ pageSize: 12 }).then(res => {
                 this.setData({
                     companyList: res.data.list
                 })
@@ -109,8 +110,8 @@ VueLikePage([], {
             var $width=e.detail.width, //获取图片真实宽度
             $height=e.detail.height,
             ratio=$width/$height; //图片的真实宽高比例
-            var viewWidth=e.detail.width, //设置图片显示宽度,左右留有16rpx边距
-            viewHeight=e.detail.height; //计算的高度值
+            var viewWidth=88 * ratio, //设置图片显示宽度,左右留有16rpx边距
+            viewHeight = 88; //计算的高度值
             var image=this.data.images;
             //将图片的datadata-index作为image对象的key,然后存储图片的宽高值
             image[e.target.dataset.index]={
@@ -120,6 +121,11 @@ VueLikePage([], {
             this.setData({
                 images:image
             })
+        },
+        changeCurrentIndex (e) {
+            this.setData({
+                currentIndex: e.detail.current
+            })
         }
     }
 })

+ 8 - 5
miniprogram/pages/index/index.wxml

@@ -4,7 +4,7 @@
     </view>
 
     <view class="content">
-        <view class="advertise" >
+        <view class="advertise"  data-route="exhibitionDetail" bindtap="toTabDetail">
             <image src="{{detail.logoUrl}}"></image>
         </view>
         <view class="tab-w">
@@ -14,11 +14,14 @@
             </view>
         </view>
         <view class="banner">
-            <swiper>
-                <swiper-item wx:for="{{ detail.firstPageContent }}" wx:key="index"  data-vr_link="{{item.link}}" bindtap="toScene">
+            <swiper autoplay interval="2000"   bindchange="changeCurrentIndex">
+                <swiper-item wx:for="{{ detail.firstPageContent }}" wx:key="{{index}}"  data-vr_link="{{item.link}}" bindtap="toScene" >
                     <image src="{{ item.img }}"></image>
                 </swiper-item>
             </swiper>
+            <view class="banner-diots">
+                <view wx:for="{{ detail.firstPageContent }}" wx:key="{{index}}" class="banner-diot-item {{ currentIndex===index ? 'is-active' : '' }}"></view>
+            </view>
         </view>
         <!-- 展会产品 -->
         <!-- <view class="category-w">
@@ -39,7 +42,7 @@
         <!-- 参展企业 -->
         <view class="enterprise-w">
             <view class="enterprise-header clearfix">
-                <view class="category-title fl">参展企业</view>
+                <view class="category-title fl">企业名录</view>
                 <view class="more fr" bindtap="toExhibitionList">更多></view>
             </view>
             <view class="enterprise-list">
@@ -47,7 +50,7 @@
                     <view class="enterprise-logo">
                         <image  src="{{ item.companyLogo }}" bindload="imageLoad" data-index="{{ index }}"  style="width:{{ images[index].width }}rpx; height:{{ images[index].height }}rpx;visibility: {{ images[index].width ? 'visible' : 'hidden' }}"></image>
                     </view>
-                    <view>{{ item.companyName }}</view>
+                    <view class="enterprise-name">{{ item.companyName }}</view>
                 </view>
             </view>
         </view>

+ 30 - 1
miniprogram/pages/index/index.wxss

@@ -21,7 +21,33 @@
   background-position: center center;
   /* background-image: url(../../image/4Dage/index/b-banner.png); */
 }
-
+.banner {
+  position: relative;
+  margin-bottom: 32rpx;
+}
+.banner swiper {
+  height: 254rpx;
+}
+.banner-diots {
+  position: absolute;
+  bottom: 10rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  display: flex;
+  justify-content: center;
+  align-items: flex-end;
+}
+.banner-diot-item {
+  width: 8rpx;
+  height: 8rpx;
+  background: #fff;
+  border-radius: 4rpx;
+  margin-right: 8rpx;
+}
+.banner-diot-item.is-active {
+  background: #17D2D2;
+  height: 18rpx;
+}
 .banner image {
   width: 100%;
   height: 254rpx;
@@ -104,6 +130,9 @@
   align-items: center;
   justify-content: center;
 }
+.enterprise-name {
+  text-align: center;
+}
 .enterprise-item:nth-child(3n-2) {
   border-right: 2rpx solid #F7F7F7;
 }

+ 2 - 2
miniprogram/pages/login/login.wxml

@@ -6,14 +6,14 @@
   <view class='login_text'>
     <image src='{{login_logo}}'></image>
     <view>好玩展</view>
-    <view>在线云看展,足不户逛展会、询展品。</view>
+    <view>三维数字化技术助力内循环</view>
   </view>
   <view class="quanxian">
     <view>四维时代网络科技有限公司申请获得以下权限</view>
     <view>· 获得您的公开信息(昵称、头像等)</view>
   </view>
   <button  wx:if="{{canIUse}}" class='btn_login' open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo">授权登录</button>
-  <button  wx:if="{{canIUse}}" class='btn_jiangjie_login' open-type="getPhoneNumber" bindgetphonenumber="bindgetphonenumber">讲解员登录</button>
+  <!-- <button  wx:if="{{canIUse}}" class='btn_jiangjie_login' open-type="getPhoneNumber" bindgetphonenumber="bindgetphonenumber">讲解员登录</button> -->
 </view>
 
 <login-pannel />

+ 1 - 1
miniprogram/pages/login/login.wxss

@@ -53,7 +53,7 @@ page {
   color: #111;
   border: none;
   position: absolute;
-  bottom: 15%;
+  bottom: 10%;
   margin: 0 10%;
   text-align: center;
   width: 80%;

+ 2 - 2
miniprogram/pages/logout/logout.wxml

@@ -1,7 +1,7 @@
 <view class="user-info-w">
   <view class="phone-w">
-    <view class="label">手机号</view>
-    <view class="value">{{ userinfo.phoneNum }}</view>
+    <view class="label">昵称</view>
+    <view class="value">{{ userinfo.name }}</view>
   </view>
   <view class="logout-btn" bindtap="logout">退出登录</view>
 </view>

+ 24 - 12
miniprogram/pages/my/my.js

@@ -15,7 +15,7 @@ VueLikePage([], {
                 needLogin: true
             },
             {
-                title: '已收藏产品',
+                title: '我的收藏',
                 icon: 'my_product',
                 value: 'collectGoods',
                 needLogin: true
@@ -59,7 +59,10 @@ VueLikePage([], {
                 return
             }
             if (value === 'message') {
-                subcribe()
+                subcribe().then((res) => {
+                    console.log(res, 'res')
+                    this.onShow()
+                })
                 return
             }
             Router.push(value)
@@ -88,17 +91,23 @@ VueLikePage([], {
         onShow: function () {
             let cu_items = this.data.cu_items
             this.isCustomer = getApp().globalData.userinfo ? getApp().globalData.userinfo.type !== 'guide' : false
-            cu_items.forEach(item => {
-                if (item.hiddenKey) {
-                    item.hidden = this[item.hiddenKey]
-                }
+            autoSubcrebe().then(res => {
+                cu_items.forEach(item => {
+                    if (item.hiddenKey) {
+                        item.hidden = this[item.hiddenKey]
+                    }
+                    if (item.hiddenKey === 'isCustomer' && !this.isCustomer) {
+                        item.hidden = res
+                    }
+                })
+                this.setData({
+                    cu_items,
+                    isLogined: getApp().globalData.token ? true : false,
+                    userinfo: getApp().globalData.userinfo,
+                    showLogin: false
+                });
             })
-            this.setData({
-                cu_items,
-                isLogined: getApp().globalData.token ? true : false,
-                userinfo: getApp().globalData.userinfo,
-                showLogin: false
-            });
+            
             wx.login({
                 success: (res) => {
                   if (res.code) {
@@ -108,6 +117,9 @@ VueLikePage([], {
               })
         },
         bindgetuserinfo (e) {
+            if (!e.detail.userInfo) {
+                return
+              }
             wx.showLoading({
               title: '登陆中',
             })

+ 6 - 1
miniprogram/pages/search/search.js

@@ -75,7 +75,12 @@ VueLikePage([], {
           showResult: true,
           resultList: res.data.list.map(item => {
             console.log(item[img_key], 'item[img_key]')
-          let img = JSON.parse(item[img_key])
+          let img = []
+          try {
+            img = JSON.parse(item[img_key])
+          } catch (err) {
+            console.log(err, '解析图片列表出错')
+          }
           console.log(img)
             item.name = item[name_key]
             item.id = item[id_key]

+ 25 - 15
miniprogram/pages/shared/shared.js

@@ -11,8 +11,11 @@ VueLikePage([], {
   },
   methods: {
     onLoad: async function (options) {
-      const { img_url, companyId } = options
+      console.log(options)
+      const { img_url, companyId, vrLink, shareImg } = options
       this.companyId = companyId
+      this.vrLink = vrLink
+      this.shareCodeImg = decodeURIComponent(shareImg)
       this.setData({
         shared_img: decodeURIComponent(img_url)
       })
@@ -53,12 +56,14 @@ VueLikePage([], {
     },
     onShareAppMessage () {
       return {
+        title: this.data.company.companyName,
+        path:  `/pages/web/web?vr_link=${this.vrLink}`,
         imageUrl: this.data.shared_img + '?x-oss-process=image/resize,m_fill,h_510,w_510'
       }
     },
     copyLink () {
       wx.setClipboardData({
-        data: 'data',
+        data: decodeURIComponent(this.vrLink),
         success (res) {
           wx.showToast({
             title: '复制成功',
@@ -84,23 +89,22 @@ VueLikePage([], {
         }
       })
     },
-    drawImage(recommend_text) {
+    async drawImage(recommend_text) {
       this.context = wx.createCanvasContext('content')
       this.context.lineJoin = 'miter'
       this.context.font = '15px bold'
       this.context.setFillStyle('#fff')
       this.context.fillRect(0, 0, this.canvas_width, this.canvas_height)
       const dpr = wx.getSystemInfoSync().pixelRatio
-      wx.downloadFile({
-        url: this.data.shared_img + '?x-oss-process=image/resize,m_fill,h_510,w_510',
-        success: res => {
-          const img_width = this.canvas_width * 0.8644,
+      let cover = await this.downloadFile(this.data.shared_img + '?x-oss-process=image/resize,m_fill,h_510,w_510')
+      let shareCode = await this.downloadFile(this.shareCodeImg)
+      const img_width = this.canvas_width * 0.8644,
             img_height = this.canvas_width * 0.8644
           const left = (this.canvas_width - img_width) / 2
           // 画圆弧矩形
           this.strokeRoundRect((this.canvas_width - img_width) / 2, (this.canvas_width - img_width) / 2, img_width, img_height, 4)
           this.context.clip()
-          this.context.drawImage(res.tempFilePath, 0, 0, img_width, img_height)
+          this.context.drawImage(cover, 0, 0, img_width, img_height)
           this.context.restore()
           this.context.fillStyle = '#131D34'
           this.context.font = '15px bold'
@@ -120,9 +124,10 @@ VueLikePage([], {
           
           this.context.font = '12px bold'
           this.context.fillStyle = '#000'
+          this.context.drawImage(shareCode, left, img_width + left + this.canvas_height * 92 / 460 + 10, 60, 60)
           this.context.fillText('3D实景拍摄', left + 80, img_width + left + this.canvas_height * 92 / 460 + 20)
-          this.context.fillText('语音与带看,专人在线答疑', left + 80, img_width + left + this.canvas_height * 92 / 460 + 40)
-          this.context.fillText('长按识别二维码进入房源', left + 80, img_width + left + this.canvas_height * 140 / 460 + 17)
+          this.context.fillText('掌上全方位了解企业', left + 80, img_width + left + this.canvas_height * 92 / 460 + 40)
+          this.context.fillText('长按识别二维码进入展厅', left + 80, img_width + left + this.canvas_height * 140 / 460 + 17)
 
           this.context.draw(false, () => {
             wx.canvasToTempFilePath({
@@ -140,11 +145,6 @@ VueLikePage([], {
           })
           this.context.fill()
           this.context.restore()
-        },
-        fail: err => {
-          console.log(err)
-        }
-      })
     },
     submitRecommend() {
       this.drawImage(this.data.recommend_text)
@@ -191,6 +191,16 @@ VueLikePage([], {
       //右边线  
       this.context.lineTo(width, height - radius);
       this.context.closePath();
+    },
+    downloadFile (url) {
+      return new Promise(resolve => {
+        wx.downloadFile({
+          url: url,
+          success (res) {
+            resolve(res.tempFilePath)
+          }
+        })
+      })
     }
   }
 })

+ 9 - 3
miniprogram/pages/user-info/user-info.js

@@ -11,11 +11,17 @@ VueLikePage([], {
   methods: {
     onLoad () {
       this.getAllTrade()
+      let userInfo = Object.assign({}, getApp().globalData.userinfo)
+      UserApi.getUserInfoById(userInfo.viewerId).then(res => {
+        this.setData({
+          userInfo: res.data
+        })
+        getApp().globalData.userinfo = res.data
+      })
     },
     onShow () {
-      this.setData({
-        userInfo: Object.assign({}, getApp().globalData.userinfo)
-      })
+      
+      
     },
     chooseImage () {
       return wx.chooseImage({

+ 4 - 1
miniprogram/pages/user-info/user-info.wxml

@@ -25,7 +25,10 @@
   </view>
   <view class="info-item">
     <view class="label">手机号码</view>
-    <view class="content disabled">15919136555</view>
+    <view class="content">
+      <input value="{{ userInfo.phoneNum }}" data-key="phoneNum" bindinput="bindInput" placeholder="请输入手机号码" />
+    </view>
+     
   </view>
   <view class="info-item">
     <view class="label">邮箱</view>

+ 4 - 0
miniprogram/pages/user-info/user-info.wxss

@@ -26,6 +26,10 @@
   display: flex;
   justify-content: flex-end;
   align-items: center;
+  margin-left: 30rpx;
+}
+.content input {
+  width: 100%;
 }
 .disabled {
   color: #A3A4A5;

+ 31 - 16
miniprogram/pages/web/web.js

@@ -22,7 +22,7 @@ Page({
     pushUrl: '',
     live_base_url: "rtmp://120.24.85.77:1935/hls",
     socketOpts: {},
-    room_id: 'test',
+    room_id: '',
     hasBeLogin: false,
     vr_link: '',
     showWebView: true
@@ -30,32 +30,41 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  onLoad: async function (options) {
     let { vr_link } = options
     vr_link = decodeURIComponent(vr_link)
     this.vrLink = vr_link
+    this.isGuide = false
+    this.scene = getQueryString(vr_link, 'm')
+    await this.getHouseDetail(this.scene)
+    this.role = this.companyDetail.guideId === (getApp().globalData.userinfo ? getApp().globalData.userinfo.viewerId : null) ? 'agent' : 'customer'
     let opts = {
       roomId: options.room_id || getQueryString(vr_link, 'room_id') || randomString(18),
       userId: getApp().globalData.userinfo.viewerId,
-      role: 'customer',
+      role: this.role,
       scene_num: getQueryString(vr_link, 'm')
     }
+    this.originUrl = `${vr_link}&room_id=${opts.roomId}${options.is_auto? `&vr=1` : ''}`
     this.setData({
       socketOpts: opts,
-      url: `${vr_link}&room_id=${opts.roomId}${options.is_auto? `&vr=1` : ''}`,
+      url: this.originUrl,
       room_id: opts.roomId,
       house_id: options.house_id || '',
       vr_link: vr_link
     })
-    this.scene = getQueryString(vr_link, 'm')
-    this.getHouseDetail(this.scene)
+    
     this.socket = SocketHandle.initSocket(this, opts)
+    if (app.globalData.token && !getQueryString(this.data.url, 'user_id') && this.role) {
+      this.setData({
+        url: `${this.originUrl}&role=${this.role}&user_id=${app.globalData.userinfo.viewerId}${this.data.hasBeLogin ? `&vr=1` : ''}`
+      })
+    }
   },
 
   onShow() {
-    if (app.globalData.token && !getQueryString(this.data.url, 'user_id')) {
+    if (app.globalData.token && !getQueryString(this.data.url, 'user_id') && this.role) {
       this.setData({
-        url: `${this.data.url}&role=${app.globalData.userinfo.type === 'guide' ? 'agent' : 'customer'}&user_id=${app.globalData.userinfo.viewerId}${this.data.hasBeLogin ? `&vr=1` : ''}`
+        url: `${this.originUrl}&role=${this.role}&user_id=${app.globalData.userinfo.viewerId}${this.data.hasBeLogin ? `&vr=1` : ''}`
       })
     }
   },
@@ -83,13 +92,15 @@ Page({
       this.hasSend = true
     }
     this.setData({
-      pushUrl: this.countLiveUrl(getApp().globalData.userinfo.user_id)
+      pushUrl: this.countLiveUrl(getApp().globalData.userinfo.viewerId)
     })
   },
   createLivePull({persons, roomId}) {
     let arr = []
     persons.forEach(item => {
-      arr.push(this.countLiveUrl(item.userId))
+      if (item.userId !== getApp().globalData.userinfo.viewerId) {
+        arr.push(this.countLiveUrl(item.userId))
+      }
     })
     
     this.setData({
@@ -103,14 +114,19 @@ Page({
     })
   },
   sendVrCard () {
-    ImApi.addFriend('1000fe7fc7dfd202f9c1594690399935').finally(() => {
-      ImSend.sendVrMsg({title: '带看', detail_images: [this.companyDetail.vrImg], vrLink: encodeURIComponent(this.vrLink)}, this.data.room_id, this.companyDetail.guideId, true)
+    if (this.companyDetail.guideId === getApp().globalData.userinfo.viewerId) {
+      return
+    }
+    ImApi.addFriend(this.companyDetail.guideId).finally(() => {
+      ImSend.sendVrMsg({title: `${this.companyDetail.companyName}`, detail_images: [this.companyDetail.vrImg], vrLink: encodeURIComponent(this.vrLink)}, this.data.room_id, this.companyDetail.guideId, true)
     })
   },
   getHouseDetail (scene) {
     return CompanyApi.getCompanyDetailByScene(scene).then(res => {
+      console.log(JSON.parse(res.data.introduceImage), 'JSON.parse(res.data.introduceImage)[')
       res.data.vrImg = JSON.parse(res.data.introduceImage)[0].img
       this.companyDetail = res.data
+      console.log(this.companyDetail)
       // house.detail_images = JSON.parse(house.detail_images)
       // this.setData({
       //   house
@@ -119,11 +135,10 @@ Page({
     })
   },
   onShareAppMessage: function (res) {
-    var path =`/pages/web/web?house_id=${this.data.house_id}&vr_link=${encodeURIComponent(this.data.vr_link)}`;
-    var arr = this.data.house.detail_images;
-    var imageurl = arr[0];
+    var path =`/pages/web/web?vr_link=${encodeURIComponent(this.data.vr_link)}`;
+    var imageurl = this.companyDetail.vrImg;
     return {
-      title: this.data.house.title,
+      title: this.companyDetail.companyName,
       path: path,
       imageUrl: imageurl, // 分享的封面图
       success: () => {

+ 1 - 1
miniprogram/pages/web/web.json

@@ -2,6 +2,6 @@
   "usingComponents": {
     "login-pannel": "/components/login-pannel/login-pannel"
   },
-  "navigationBarTitleText": "好玩展",
+  "navigationBarTitleText": "VR企业秀",
   "pageOrientation": "auto"
 }

+ 3 - 3
miniprogram/project.config.json

@@ -4,7 +4,7 @@
 		"ignore": []
 	},
 	"setting": {
-		"urlCheck": false,
+		"urlCheck": true,
 		"es6": true,
 		"enhance": true,
 		"postcss": true,
@@ -27,7 +27,7 @@
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.10.4",
-	"appid": "wxb4c0527aa20a6e9a",
+	"appid": "wxd55ee54235e90359",
 	"projectname": "%E7%9C%8B%E5%B1%95%E5%B0%8F%E7%A8%8B%E5%BA%8F",
 	"debugOptions": {
 		"hidedInDevtools": []
@@ -273,7 +273,7 @@
 					"id": 30,
 					"name": "pages/shared/shared",
 					"pathName": "pages/shared/shared",
-					"query": "img_url=https%3A%2F%2Fhouseoss.4dkankan.com%2F4dHouse%2Fadmin%2Fupload%2F202006221933_324.jpg",
+					"query": "shareImg=https%3A%2F%2Fhouseoss.4dkankan.com%2Fdomain%2F4dshow%2Fnull_QRCode.png&img_url=https%3A%2F%2Fhouseoss.4dkankan.com%2F4dHouse%2Fadmin%2Fupload%2F202006221933_324.jpg",
 					"scene": null
 				},
 				{

+ 1 - 1
miniprogram/utils/imSend.js

@@ -20,7 +20,7 @@ export default {
   },
   sendMsg ({content, msgType, toId}) {
     let defaultContent = {
-      fromId: getApp().globalData.userinfo.user_id,
+      fromId: getApp().globalData.userinfo.viewerId,
       fromName: getApp().globalData.userinfo.phone,
       toId: toId,
       toName: 'xu',

+ 1 - 1
miniprogram/utils/socket-handle.js

@@ -12,7 +12,7 @@ export function initSocket(page, options) {
     isClient: true
   }
   
-  io = socket_io('https://vrhouse2.4dkankan.com', {
+  io = socket_io(IM_HOST, {
     path: '/vr-node',
     query: Object.assign(defaultOpts, options)
   })

+ 24 - 1
miniprogram/utils/storage.js

@@ -2,6 +2,7 @@
 const USER_INFO_KEY = 'wx_user_info'
 const TOKEN_KEY = 'wx_token'
 const SEARCH_HISTORY_KEY = 'search_history'
+const Collect_HISTORY_KEY = 'collect_goods_key'
 
 function saveStorage (key, value, expired = 0) {
   const storage = {
@@ -77,4 +78,26 @@ export function loadSearchHistory () {
 
 export function removeSearchHistory () {
   return removeStorage(SEARCH_HISTORY_KEY)
-}
+}
+
+export function saveCollectHistory (goods) {
+  let historys = loadCollectHistory() || []
+  historys = historys.filter(item => item.id !== goods.id)
+  historys.unshift(goods)
+  return saveStorage(Collect_HISTORY_KEY, historys)
+}
+
+export function loadCollectHistory (goods_id) {
+  let arr = loadStorage(Collect_HISTORY_KEY) ? loadStorage(Collect_HISTORY_KEY) : []
+  let result = arr
+  if (goods_id) {
+    result = arr.find(item => item.id == goods_id)
+  }
+  return result
+}
+
+export function removeCollect (goods_id) {
+  let historys = loadCollectHistory() || []
+  historys = historys.filter(item => item.id !== goods_id)
+  return saveStorage(Collect_HISTORY_KEY, historys)
+}

+ 13 - 9
miniprogram/utils/utils.js

@@ -7,7 +7,7 @@ export function bindInput(event) {
 }
 
 let hasAuth = false
-const subId = 'wCMX3Jieyeq376SYjdmub85ANWlFHHghTGshmRORv0Y'
+const subId = 'yDycTlNKWUr_cDztZXLXqc4Nfe2TlKy5hrQdwj0yoUs'
 export function subcribe() {
   
   return new Promise((resolve, reject) => {
@@ -28,14 +28,18 @@ export function subcribe() {
 }
 
 export function autoSubcrebe() {
-  wx.getSetting({
-    withSubscriptions: true,
-    success: (setting) => {
-      if (setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings[subId]) {
-        subcribe()
-        return
+  return new Promise(resolve => {
+    wx.getSetting({
+      withSubscriptions: true,
+      success: (setting) => {
+        let hasAuto = false
+        if (setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings[subId]) {
+          subcribe()
+          hasAuto = true
+        }
+        resolve(hasAuto)
       }
-      console.log('not')
-    }
+    })
   })
+  
 }