Browse Source

feat:好玩展1.0.3

徐志豪 5 years ago
parent
commit
46d1577361

+ 2 - 2
admin/vue.config.js

@@ -25,8 +25,8 @@ module.exports = {
     proxy: {
       '/admin': {
         // target: 'http://120.24.85.77:8087', // 正式环境
-        // target: 'http://192.168.0.83:8075'  // 伟玉本地环境
-        target: 'http://haowantest.4dkankan.com'    // 测试环境
+        target: 'http://192.168.0.83:8165'  // 伟玉本地环境
+        // target: 'http://haowantest.4dkankan.com'    // 测试环境
       },
       '/node-upload': {
         target: 'http://haowantest.4dkankan.com',

+ 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://192.168.0.83:8075'
 
 
-export const IM_HOST = 'wss://haowan.4dkankan.com'
-export const API_BASE_URL = 'https://haowan.4dkankan.com'
+// export const IM_HOST = 'wss://haowan.4dkankan.com'
+// export const API_BASE_URL = 'https://haowan.4dkankan.com'

+ 1 - 1
miniprogram/config/error_code.js

@@ -1,5 +1,5 @@
 const ERROR_CODE = {
   3004: '无token,请先登录',
-  3005: '登陆验证过期,请重新登陆',
+  3005: '登录验证过期,请重新登录',
   3006: '用户信息有误,请重新登录'
 }

+ 8 - 19
miniprogram/dataReport/components/scene-report/scene-report.js

@@ -33,42 +33,31 @@ Component({
     dataNumList: [
       {
         value: 20,
-        label: '场景商品数',
+        label: '展位浏览量',
         key: 'goods_num',
         bgColor: 'rgba(115,142,254,0.1)',
         color: '#738EFE'
       },
       {
         value: 20,
-        label: '解说视频数',
+        label: '客户访问量',
         key: 'video_num',
         bgColor: 'rgba(77,174,255,0.1)',
         color: '#4DAEFF'
       },
       {
         value: 20,
-        label: '场景点位数',
-        bgColor: 'rgba(246,151,88,0.1)',
-        color: '#F69758'
-      },
-      {
-        value: 20,
-        label: '平均视频观看',
+        label: '商务询盘量',
         bgColor: 'rgba(23,210,210,0.1)',
         color: '#17D2D2'
       },
       {
         value: 20,
-        label: '平均页面停留',
-        bgColor: 'rgba(250,212,59,0.1)',
-        color: '#FAD43B'
-      },
-      {
-        value: 20,
-        label: '名片交换数',
-        bgColor: 'rgba(19,29,52,0.05)',
-        color: '#131D34'
-      },
+        label: '展位商品数',
+        bgColor: 'rgba(246,151,88,0.1)',
+        color: '#F69758'
+        
+      }
     ]
   },
 

+ 6 - 0
miniprogram/dataReport/components/scene-report/scene-report.wxml

@@ -1,3 +1,4 @@
+<view class="sub-title">综合数据</view>
 <view class="data-num-w">
   <view class="data-num" wx:for="{{ dataNumList }}" wx:key="{{index}}" >
     <view class="value" style="background-color: {{item.bgColor}}; color: {{ item.color }}">{{ item.value }}</view>
@@ -5,7 +6,12 @@
   </view>
 </view>
 
+<view class="sub-title">可视化视图</view>
 <view class="canvas-container">
   <ec-canvas id="mychart-dom-multi-line"  canvas-id="mychart-multi-line" ec="{{ ec }}" />
+</view>
+
+<view class="customer-report">
+  <view class="title">客户统计</view>
   
 </view>

+ 10 - 3
miniprogram/dataReport/components/scene-report/scene-report.wxss

@@ -1,14 +1,21 @@
+.sub-title {
+  font-size: 34rpx;
+  color: #131d34;
+  margin-bottom: 32rpx;
+  font-weight: bold;
+}
 .data-num-w {
   display: flex;
   width: 100%;
   justify-content: space-between;
-  margin: 42rpx 0 46rpx;
+  margin: 42rpx 0 32rpx;
   flex-wrap: wrap;
+  border-bottom: 2rpx solid #F7F7F7;
+  padding-bottom: 34rpx;
 }
 .data-num {
-  flex: 0 0 33%;
+  flex: 0 0 25%;
   text-align: center;
-  margin-bottom: 28rpx;
 }
 
 .data-num .value {

+ 0 - 29
miniprogram/dataReport/pages/data-report/data-report.js

@@ -6,40 +6,11 @@ Page({
    * 页面的初始数据
    */
   data: {
-    typeList: ['综合情况', '场景统计', '客户统计'],
-    active: 1,
-    date: fotmatDate(new Date(), 'yyyy-MM-dd')
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.getCompanyList()
-  },
-
-  changeActive (e) {
-    const { index } = e.currentTarget.dataset
-    this.setData({
-      active: index
-    })
-  },
-  getCompanyList () {
-    Api.getCompanyList().then(res => {
-      console.log(res)
-      this.companysList = res.data.list
-      this.setData({
-        companys: this.companysList.map(item => item.companyName),
-        companyIndex: 0,
-        sceneNum: this.companysList[0].sceneNum
-      })
-    })
-  },
-  bindCompanyChange (e) {
-    this.setData({
-      companys: this.companysList.map(item => item.companyName),
-      companyIndex: e.detail.value,
-      sceneNum: this.companysList[e.detail.value].sceneNum
-    })
   }
 })

+ 2 - 22
miniprogram/dataReport/pages/data-report/data-report.wxml

@@ -1,24 +1,4 @@
 <view class="container">
-  <view class="report-form">
-    <picker bindchange="bindCompanyChange" value="{{companyIndex}}" range="{{companys}}">
-      <view class="form-item">
-        {{companys[companyIndex]}}
-        <icon class="icon" size="10" icon="scene_tit_arrow"></icon>
-      </view>
-    </picker>
-    <picker mode="date" value="{{date}}" start="2020-07-01" bindchange="bindDateChange">
-      <view class="form-item">
-        {{date}}
-        <icon class="icon" size="10" icon="scene_tit_arrow"></icon>
-      </view>
-    </picker>
-  </view>
-
-  <view class="type-list">
-    <view bindtap="changeActive" data-index="{{index}}" class="type-item {{active === index ? 'active' : ''}}" wx:for="{{ typeList }}" wx:key="{{index}}">{{item}}</view>
-    
-  </view>
-  <summary wx:if="{{ active === 0 }}" />
-  <scene-report wx:if="{{ active === 1}}" date="{{date}}" sceneNum="{{sceneNum}}" />
-  <customer-report wx:if="{{ active === 2 }}" />
+  <view class="title">这里是展位名称</view>
+  <scene-report  />
 </view>

+ 4 - 52
miniprogram/dataReport/pages/data-report/data-report.wxss

@@ -6,58 +6,10 @@ page {
   padding: 0 46rpx 100rpx;
   margin-top: 16rpx;
 }
-.report-form {
-  display: flex;
-}
-.report-form picker {
-  flex: 1;
-}
-.report-form .icon {
-  position: absolute;
-  right: 20rpx;
-  color: rgba(0,0,0,0.3);
-  font-size: 20rpx;
-}
-.form-item {
-  height: 80rpx;
-  line-height: 76rpx;
-  border: 2rpx solid #e5e5e5;
-  padding-left: 22rpx;
-  flex: 1;
-  border-radius: 8rpx;
-  font-weight: bold;
-  position: relative;
-}
-.form-item:first-child {
-  margin-right: 20rpx;
-}
-
-.type-list {
-  display: flex;
-  width: 100%;
-  margin-top: 24rpx;
-  align-items: center;
-}
-.type-item {
-  flex: 1;
-  color: #909090;
-  font-size: 34rpx;
+.title {
+  font-size: 40rpx;
   text-align: center;
+  padding: 16rpx 0 22rpx;
   font-weight: bold;
-}
-.type-item.active {
-  color: #131D34;
-  font-size: 40rpx;
-  position: relative;
-}
-.type-item.active::after {
-  content: '';
-  display: block;
-  width: 20px;
-  height: 2px;
-  background: #17D2D2;
-  position: absolute;
-  bottom: -5px;
-  left: 50%;
-  margin-left: -10px;
+  line-height: 56rpx;
 }

+ 5 - 0
miniprogram/pages/goods-detail/goods-detail.js

@@ -30,6 +30,11 @@ VueLikePage([], {
       let res = await GoodsApi.getShopGoodsDetail(this.goods_id)
       let goodsDetail = res.data
       goodsDetail.banner = goodsDetail.gallery.map(item => item.img_url)
+      goodsDetail.info.goods_desc = goodsDetail.info.goods_desc && goodsDetail.info.goods_desc.replace(/(\<img)/gi, function ($0, $1) {
+        return {
+          "<img": '<img style="width:100%;height:auto;display:block;" '
+        }[$1];
+      })
       return goodsDetail
     },
     getGoodsCollectStatus () {

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

@@ -1,7 +1,7 @@
 <scroll-view class="goods-detail" scroll-y="true">
 	<swiper class="swiper" circular indicator-dots indicator-active-color="#17D2D2" autoplay indicator-color="#fff">
 		<swiper-item wx:for="{{ detail.banner }}" wx:key="{{index}}">
-			<image class="banner-img" src="{{item}}"></image>
+			<image class="banner-img" src="{{item}}" mode="heightFix"></image>
 		</swiper-item>
 	</swiper>
 

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

@@ -1,6 +1,9 @@
 .swiper {
   height: 470rpx;
 }
+swiper-item {
+  text-align: center;
+}
 .banner-img {
   width: 100%;
   height: 470rpx;
@@ -40,7 +43,6 @@
   padding-top: 40rpx;
 }
 .goods-detail-img image {
-  width: 100%;
   height: auto;
 }
 
@@ -75,4 +77,8 @@
 }
 .info-item {
   margin-bottom: 12rpx;
+}
+
+rich-text image {
+  margin: 0 auto;
 }

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

@@ -41,7 +41,7 @@ Page({
   },
   bindgetuserinfo (e) {
     wx.showLoading({
-      title: '登中',
+      title: '登中',
     })
     loginByUserInfo(e.detail, this.data.code).then(() => {
       wx.hideLoading({

+ 1 - 1
miniprogram/pages/my/my.js

@@ -122,7 +122,7 @@ VueLikePage([], {
                 return
               }
             wx.showLoading({
-              title: '登中',
+              title: '登中',
             })
             loginByUserInfo(e.detail, this.wx_code).then(() => {
               wx.hideLoading({

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

@@ -7,6 +7,7 @@ VueLikePage([], {
     showResult: false,
     selectShowStatus: false,
     resultList: [],
+    searchTips: [],
     searchTypes: [
       {
         text: '企业',
@@ -88,7 +89,8 @@ VueLikePage([], {
             return item
           }),
           history: loadSearchHistory(),
-          keyword: params.keyword
+          keyword: params.keyword,
+          searchTips: []
         })
       })
     },
@@ -110,6 +112,29 @@ VueLikePage([], {
           }
         })
       }
+    },
+    handleTipClick (e) {
+      e.detail = e.currentTarget.dataset.item
+      this.search(e)
+    },
+    handleInput (e) {
+      console.log(e)
+      const params = {
+        type: 'company',
+        keyword: e.detail
+      }
+      if (!e.detail) {
+        this.setData({
+          searchTips: []
+        })
+      }
+      GoodsApi.searchGoodsOrCompany(params).then(res => {
+        const name_key = 'companyName'
+        
+        this.setData({
+          searchTips: res.data.list.map(item => item[name_key]),
+        })
+      })
     }
   }
 })

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

@@ -15,7 +15,12 @@
 			<input placeholder="请输入关键字" value="{{ keyword }}" confirm-type="search" bindconfirm="search" ></input>
 		</view>
 	</view> -->
-	<search-bar bindsearch="search" value="{{ keyword }}" />
+	<view class="search-bar-w">
+		<search-bar bindsearch="search" value="{{ keyword }}" bindinput="handleInput" />
+		<view class="search-result-tips" wx:if="{{searchTips.length > 0}}">
+			<view wx:for="{{searchTips}}" wx:key="{{index}}" data-item="{{item}}" bindtap="handleTipClick">{{ item }}</view>
+		</view>
+	</view>
 	<view class="search-history" wx:if="{{!showResult}}">
 		<view class="history-header">
 			<text>历史搜索</text>

+ 23 - 0
miniprogram/pages/search/search.wxss

@@ -89,6 +89,8 @@ page {
   border-radius: 20rpx;
   font-size: 22rpx;
   margin: 0 20rpx 20rpx 0;
+  max-width: 100%;
+  overflow: hidden;
 }
 
 .search-tip {
@@ -120,4 +122,25 @@ page {
   font-size: 30rpx;
   font-weight: bold;
   line-height: 42rpx;
+}
+
+.search-bar-w {
+  position: relative;
+}
+.search-result-tips {
+  position: absolute;
+  bottom: 0;
+  transform: translateY(100%);
+  background: #fff;
+  z-index: 1;
+  width: 100%;
+  padding-bottom: 98rpx;
+}
+.search-result-tips view {
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 26rpx;
+  color: #909090;
+  border-bottom: 2rpx solid #E5E5E5;
+  overflow: hidden;
 }

+ 7 - 2
miniprogram/pages/web/web.js

@@ -32,12 +32,17 @@ Page({
    */
   onLoad: async function (options) {
     let { vr_link } = options
+    console.log(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'
+    this.role = 'customer'
+    if (this.scene) {
+      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,

+ 1 - 1
miniprogram/utils/login.js

@@ -79,7 +79,7 @@ export function loginFn(phone_data, code, isAgency) {
         })
       })
       .catch((err) => {
-        // 登失败可能是code失效,故重新wx.login重新获取code
+        // 登失败可能是code失效,故重新wx.login重新获取code
         tips(err)
         wxLogin().then((code) => {
           loginByPhone({ phone_num: encryptedData, iv, wx_code: code }, isAgency).then(res => {

+ 1 - 1
miniprogram/utils/storage.js

@@ -69,7 +69,7 @@ export function saveSearchHistory (value) {
   let historys = loadSearchHistory() || []
   historys = historys.filter(item => item !== value)
   historys.unshift(value)
-  return saveStorage(SEARCH_HISTORY_KEY, historys)
+  return saveStorage(SEARCH_HISTORY_KEY, historys.slice(0, 10))
 }
 
 export function loadSearchHistory () {