徐志豪 пре 5 година
родитељ
комит
781b94a047

+ 1 - 1
miniprogram/apis/goods.js

@@ -66,6 +66,6 @@ export default {
   },
 
   getShopGoodsDetail (goodsId) {
-    return request.post('https://testshop.4dkankan.com/platform-framework/api/goods/detail', {id: Number(goodsId)}, { header: {'Content-Type': 'application/x-www-form-urlencoded'}})
+    return request.post('https://shop.4dkankan.com/platform-framework/api/goods/detail', {id: Number(goodsId)}, { header: {'Content-Type': 'application/x-www-form-urlencoded'}})
   }
 }

+ 1 - 0
miniprogram/apis/im.js

@@ -16,6 +16,7 @@ export default {
     return request.post(`${API_BASE_URL}/im/upload`, formData)
   },
   addFriend (friend_id) {
+    if (friend_id === getApp().globalData.userinfo.viewerId) return
     return request.get(`${API_BASE_URL}/im/addFriend/${friend_id}/${getApp().globalData.userinfo.viewerId}`)
   },
 

+ 67 - 32
miniprogram/app.js

@@ -7,13 +7,40 @@ import {
 import ImApi from './apis/im'
 import UserApi from './apis/user'
 import AppIMDelegate from "./delegate/app-im-delegate";
-import { fotmatDate } from './utils/date'
+import {
+  fotmatDate
+} from './utils/date'
 
 var QQMapWX = require('/utils/qqmap-wx-jssdk.min.js')
 var timer = null
 App({
   onLaunch: function (options) {
     //检查是否存在新版本
+    const updateManager = wx.getUpdateManager()
+    updateManager.onCheckForUpdate(function (res) {
+      // 请求完新版本信息的回调
+      if (res.hasUpdate) {
+        updateManager.onUpdateReady(function () {
+          wx.showModal({
+            title: '更新提示',
+            content: '新版本已经准备好,是否重启应用?',
+            success: function (res) {
+              if (res.confirm) {
+                // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+                updateManager.applyUpdate()
+              }
+            }
+          })
+        })
+        updateManager.onUpdateFailed(function () {
+          // 新的版本下载失败
+          wx.showModal({
+            title: '已经有新版本了哟~',
+            content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
+          })
+        })
+      }
+    })
     this.appIMDelegate = new AppIMDelegate(this);
     this.appIMDelegate.onLaunch(options);
     this.globalData.qqmapsdk = new QQMapWX({
@@ -32,7 +59,9 @@ App({
     setTimeout(() => {
       this.appIMDelegate.onShow()
       wx.getUserInfo({
-        complete: (res) => {console.log(res, 'userinfo')},
+        complete: (res) => {
+          console.log(res, 'userinfo')
+        },
       })
       UserApi.getUserInfoById(this.globalData.userinfo.viewerId).then(res => {
         this.globalData.userinfo = res.data
@@ -92,37 +121,41 @@ App({
   getIMHandler() {
     return this.appIMDelegate.getIMHandlerDelegate();
   },
-  async getNewMessage (msg) {
-    const { conversations } = this.globalData
+  async getNewMessage(msg) {
+    const {
+      conversations
+    } = this.globalData
     let item = conversations.find(item => item.id === msg.fromId)
     if (item) {
-        item.latestMsgContent = msg.content
-        item.latestMsgTime = msg.sendTime
-        item.unReadNum ? item.unReadNum++ : item.unReadNum = 1
-        this.globalData.conversations = this.dealConversations(conversations)
+      item.latestMsgContent = msg.content
+      item.latestMsgTime = msg.sendTime
+      item.unReadNum ? item.unReadNum++ : item.unReadNum = 1
+      this.globalData.conversations = this.dealConversations(conversations)
     } else {
-        await this.getContact()
+      await this.getContact()
     }
-},
-getContact(isNewMsg) {
-  return ImApi.getContacts().then(res => {
-    const friends = res.data.friends
-    const {
-      conversations
-    } = this.globalData
-    this.globalData.unViewMsg = 0
-    this.globalData.conversations = this.dealConversations(friends.map(item => {
-      const con = conversations.find(con => con.id === item.id)
-      if (con) {
-        item = Object.assign(con, item)
-      } else if (isNewMsg){
-        item.unReadNum = 1
-      }
-      this.globalData.unViewMsg += item.unReadNum
-      return item
-    }))
-  })
-},
+  },
+  getContact(isNewMsg) {
+    return ImApi.getContacts().then(res => {
+      const friends = res.data.friends
+      const {
+        conversations
+      } = this.globalData
+      this.globalData.unViewMsg = 0
+      this.globalData.conversations = this.dealConversations(friends.map(item => {
+        if (conversations) {
+          const con = conversations.find(con => con.id === item.id)
+          if (con) {
+            item = Object.assign(con, item)
+          } else if (isNewMsg) {
+            item.unReadNum = 1
+          }
+          this.globalData.unViewMsg += item.unReadNum
+        }
+        return item
+      }))
+    })
+  },
   dealConversations(conversations) {
     return conversations.map(item => {
       let content = item.latestMsgContent
@@ -139,12 +172,14 @@ getContact(isNewMsg) {
       } catch (err) {}
       item.latestMsgContent = content
       const now = new Date()
-      if (now.getMonth() === new Date(item.latestMsgTime).getMonth() && now.getDate() === new Date(item.latestMsgTime).getDate()) {
+      if (item.latestMsgTime && now.getMonth() === new Date(item.latestMsgTime).getMonth() && now.getDate() === new Date(item.latestMsgTime).getDate()) {
         item.timeStr = fotmatDate(item.latestMsgTime, 'hh:mm')
-      } else {
+      } else if (item.latestMsgTime) {
         item.timeStr = fotmatDate(item.latestMsgTime, 'MM/dd')
+      } else {
+        item.timeStr = ''
       }
-      
+
       return item
     }).sort((a, b) => new Date(b.latestMsgTime) - new Date(a.latestMsgTime))
   },

+ 0 - 3
miniprogram/app.json

@@ -3,14 +3,11 @@
     "pages/index/index",
     "pages/my/my",
     "pages/chat-list/chat-list",
-    "pages/exhibition-detail/exhibition-detail",
-    "pages/exhibition-register/exhibition-register",
     "pages/exhibition-enterprise/exhibition-enterprise",
     "pages/goods-tabs/goods-tabs",
     "pages/search/search",
     "pages/user-info/user-info",
     "pages/collect-goods/collect-goods",
-    "pages/collect-enterprise/collect-enterprise",
     "pages/business-card/business-card",
     "pages/shared/shared",
     "pages/goods-detail/goods-detail",

+ 1 - 1
miniprogram/pages/chat-list/view/chat-item.wxml

@@ -8,7 +8,7 @@
                     <text>{{item.name}}</text>
                     <text class="organ" wx:if="{{item.store}}">{{ item.store }}</text>
                 </view>
-                <text class="chat-item-content-style">{{item.latestMsgContent}}</text>
+                <text class="chat-item-content-style">{{item.latestMsgContent || ''}}</text>
             </view>
             <view class="chat-item-status-super-style">
                 <view class="chat-item-time-style">{{item.timeStr}}</view>

+ 2 - 2
miniprogram/pages/chat/chat.js

@@ -63,7 +63,7 @@ Page({
     },
     onSendMessageEvent(e) {
         let content = e.detail.value;
-        this.msgManager.sendMsg({type: 'TYPE_ONE', msgType: IMOperator.TextType, content,  toId: this.data.toId, fromId: getApp().globalData.userinfo.user_id});
+        this.msgManager.sendMsg({type: 'TYPE_ONE', msgType: IMOperator.TextType, content,  toId: this.data.toId, fromId: getApp().globalData.userinfo.viewerId});
     },
     onVoiceRecordEvent(e) {
         const {detail: {recordStatus, duration, tempFilePath, fileSize,}} = e;
@@ -175,7 +175,7 @@ Page({
         return ImApi.getMsgHistory(friend_id).then(res => {
             res.data.reverse().forEach(item => {
                 if (item.content) {
-                    item.isMy = item.fromId === getApp().globalData.userinfo.user_id;
+                    item.isMy = item.fromId === getApp().globalData.userinfo.viewerId;
                     this.msgManager.showMsg({msg: this.imOperator.createNormalChatItem(item)})
                 }
             })

+ 2 - 2
miniprogram/pages/chat/im-operator.js

@@ -24,7 +24,7 @@ export default class IMOperator {
             if (!msg) {
                 return;
             }
-            msg.isMy = msg.fromId === getApp().globalData.userinfo.user_id;
+            msg.isMy = msg.fromId === getApp().globalData.userinfo.viewerId;
             const item = this.createNormalChatItem(msg);
             this._latestTImestamp = item.timestamp;
             //这里是收到好友消息的回调函数,建议传入的item是 由 createNormalChatItem 方法生成的。
@@ -70,7 +70,7 @@ export default class IMOperator {
             type,
             toId,
             conversationId: 0,//会话id,目前未用到
-            fromId: getApp().globalData.userinfo.user_id,
+            fromId: getApp().globalData.userinfo.viewerId,
             duration
         };
     }

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

@@ -31,7 +31,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: async function (options) {
-    let vr_link = 'https://test.4dkankan.com/shipin.html?'
+    let vr_link = 'https://www.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'

+ 3 - 2
miniprogram/pages/goods-detail/goods-detail.js

@@ -16,11 +16,12 @@ VueLikePage([], {
       const { goods_id, company_id } = options
       this.goods_id = goods_id
       const goodsDetail = await this.getGoodsDetail()
-      // this.getGuide()
-      this.getGoodsCollectStatus()
       this.setData({
         detail: goodsDetail
       })
+      // this.getGuide()
+      this.getGoodsCollectStatus()
+      
       const companyRes = await CompanyApi.getCompanyDetail(company_id)
       console.log(companyRes)
       this.company = companyRes.data

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

@@ -8,7 +8,7 @@
 	<view class="container">
 		<view class="goods-name-w">
 			<view class="goods-name">{{ detail.info.name }}</view>
-			<view class="goods-price">¥{{ detail.info.retail_price || '' }}</view>
+			<!-- <view class="goods-price">¥{{ detail.info.retail_price || '' }}</view> -->
 		</view>
 
 		<view class="goods-info-w" >

+ 21 - 1
miniprogram/pages/index/index.js

@@ -6,6 +6,8 @@ import {
 } from './../../utils/tools'
 import Router from '../../utils/routes'
 import Api from '../../apis/index'
+import ImApi from '../../apis/im'
+
 const app = getApp();
 VueLikePage([], {
     data: {
@@ -33,6 +35,7 @@ VueLikePage([], {
     },
     methods: {
         onLoad: function (options) {
+            this.notAdd = true
             this.getActivityDetail()
             this.getCategoryList()
             this.getCompanyList()
@@ -42,6 +45,16 @@ VueLikePage([], {
                 })
             })
         },
+        onShow () {
+            if (this.notAdd && getApp().globalData.token && this.data.companyList.length > 0) {
+                this.notAdd = false
+                this.data.companyList.forEach(item => {
+                    if (item.guideId) {
+                        ImApi.addFriend(item.guideId)
+                    }
+                })
+            }   
+        },
         onShareAppMessage: function (res) {
             var path = '/pages/index/index'
             return {
@@ -90,13 +103,20 @@ VueLikePage([], {
                 this.setData({
                     companyList: res.data.list
                 })
+                if (this.notAdd && getApp().globalData.token) {
+                    this.notAdd = false
+                    res.data.list.forEach(item => {
+                        if (item.guideId) {
+                            ImApi.addFriend(item.guideId)
+                        }
+                    })
+                }   
             })
         },
         toScene (e) {
             const { vr_link, companyid } = e.currentTarget.dataset
             Api.postApiData({ companyId: companyid }).then((res) => {
                 console.log(res)
-                
             })
             Router.push({
                 url: 'scene',

+ 13 - 56
miniprogram/pages/index/index.wxml

@@ -1,59 +1,16 @@
-<scroll-view class="index">
-    <view class="search-w" >
-        <search-bar disabled="{{ true }}" bindtap="toSearch" />
-    </view>
-
-    <view class="content">
-        <view class="advertise"  data-route="exhibitionDetail" bindtap="toTabDetail">
-            <image src="{{detail.logoUrl}}"></image>
-        </view>
-        <view class="tab-w">
-            <view class="tab" wx:for="{{ tabList }}" wx:key="index" data-route="{{item.route}}" bindtap="toTabDetail">
-                <image src="{{item.icon}}"></image>
-                <view>{{item.label}}</view>
-            </view>
-        </view>
-        <view class="banner">
-            <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">
-            <view class="category-header clearfix">
-                <view class="category-title fl">展会产品</view>
-                <view class="more fr" bindtap="toGoodsTab">更多></view>
-            </view>
-            <view class="category-list">
-                <view class="category-item" bindtap="toGoodsTab" data-index="{{index}}" wx:for="{{ categoryList }}" wx:key="{{ index }}">
-                    <image src="{{item.coverImageUrl}}"></image>
-                    <view class="goods-name">{{item.name}}</view>
-                    <view class="desc">{{item.translateOne}}</view>
-                    <view class="desc">{{item.translateTwo}}</view>
-                </view>
-            </view>
-        </view> -->
 
-        <!-- 参展企业 -->
-        <view class="enterprise-w">
-            <view class="enterprise-header clearfix">
-                <view class="category-title fl">企业名录</view>
-                <view class="more fr" bindtap="toExhibitionList">更多></view>
-            </view>
-            <view class="enterprise-list">
-                <view class="enterprise-item" wx:for="{{companyList}}" wx:key="{{index}}" data-vr_link="{{ item.vrLink }}" data-companyId="{{ item.companyId }}" bindtap="toScene">
-                    <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 class="enterprise-name">{{ item.companyName }}</view>
-                </view>
-            </view>
-        </view>
+<view class="body" id="tab-con">
+  <view class="title">企业名录
+    <!-- <view class="more">更多></view> -->
+  </view>
+  <view class="ul">
+    <view data-vr_link="{{ item.vrLink }}" data-companyId="{{ item.companyId }}" bindtap="toScene" data-id="{{item.companyId}}" class="li" wx:for='{{companyList}}' wx:key="{{item.companyId}}">
+      <image class="company-img"  mode="aspectFill" src="{{item.companyLogo}}"></image>
+      <view class="b-title">
+        <text>{{item.companyName}}</text>
+      </view>
     </view>
-</scroll-view>
+  </view>
+</view>
+
 <tab-bar />

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

@@ -157,4 +157,80 @@
 .enterprise-name {
   padding: 0 30rpx;
   text-align: center;
-}
+}
+
+
+
+page,.container{
+  /* background: #231815; */
+ 
+}
+
+.title {
+  color: #131D34;
+  font-size: 34rpx;
+  margin-bottom: 26rpx;
+  font-weight: bold;
+  line-height: 44rpx;
+  display: flex;
+  justify-content: space-between;
+}
+.title .more {
+  
+}
+
+.c-body{
+  width: 100%;
+  background: #231815;
+  z-index: 11;
+  position: relative;
+}
+
+.body{
+  width: 100%;
+  font-size: 0;
+  padding-bottom: 150rpx;
+  padding: 24rpx 46rpx 204rpx;
+}
+
+.body::-webkit-scrollbar {display:none}
+
+.body .ul {
+  position: relative;
+  width: 100%;
+  font-size: 0;
+  z-index: 1;
+  margin: 0 auto;
+}
+
+.body .li {
+  position: relative;
+  width: 100%;
+  overflow: hidden;
+  margin: 0 auto 20rpx;
+}
+
+
+.body .li image{
+  width: 100%;
+  height: 332rpx;
+}
+
+
+
+.body .li .b-title{
+  background: rgba(0,0,0,0.3);
+  position: absolute;
+  left: 0%;
+  bottom: 0;
+  padding-left: 24rpx;
+  font-size: 26rpx;
+  width: 100%;
+  height: 56rpx;
+  color: #fff;
+  line-height: 56rpx;
+}
+
+.body .li .b-title text{
+  color: #fff;
+}

+ 59 - 0
miniprogram/pages/index/originindex.wxml

@@ -0,0 +1,59 @@
+<scroll-view class="index">
+    <view class="search-w" >
+        <search-bar disabled="{{ true }}" bindtap="toSearch" />
+    </view>
+
+    <view class="content">
+        <view class="advertise"  data-route="exhibitionDetail" bindtap="toTabDetail">
+            <image src="{{detail.logoUrl}}"></image>
+        </view>
+        <view class="tab-w">
+            <view class="tab" wx:for="{{ tabList }}" wx:key="index" data-route="{{item.route}}" bindtap="toTabDetail">
+                <image src="{{item.icon}}"></image>
+                <view>{{item.label}}</view>
+            </view>
+        </view>
+        <view class="banner">
+            <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">
+            <view class="category-header clearfix">
+                <view class="category-title fl">展会产品</view>
+                <view class="more fr" bindtap="toGoodsTab">更多></view>
+            </view>
+            <view class="category-list">
+                <view class="category-item" bindtap="toGoodsTab" data-index="{{index}}" wx:for="{{ categoryList }}" wx:key="{{ index }}">
+                    <image src="{{item.coverImageUrl}}"></image>
+                    <view class="goods-name">{{item.name}}</view>
+                    <view class="desc">{{item.translateOne}}</view>
+                    <view class="desc">{{item.translateTwo}}</view>
+                </view>
+            </view>
+        </view> -->
+
+        <!-- 参展企业 -->
+        <view class="enterprise-w">
+            <view class="enterprise-header clearfix">
+                <view class="category-title fl">企业名录</view>
+                <view class="more fr" bindtap="toExhibitionList">更多></view>
+            </view>
+            <view class="enterprise-list">
+                <view class="enterprise-item" wx:for="{{companyList}}" wx:key="{{index}}" data-vr_link="{{ item.vrLink }}" data-companyId="{{ item.companyId }}" bindtap="toScene">
+                    <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 class="enterprise-name">{{ item.companyName }}</view>
+                </view>
+            </view>
+        </view>
+    </view>
+</scroll-view>
+<tab-bar />

+ 19 - 18
miniprogram/pages/my/my.js

@@ -43,7 +43,7 @@ VueLikePage([], {
                 value: 'message',
                 needLogin: true,
                 hiddenKey: 'isCustomer',
-                hidden: getApp().globalData.userinfo ? getApp().globalData.userinfo.type==='guide' : false
+                hidden: true
             },
         ],
         user_code: '',
@@ -79,7 +79,7 @@ VueLikePage([], {
          * 生命周期函数--监听页面加载
          */
         onLoad: function (e) {
-
+            this.isCustomer = true
             wx.login({
                 success: (res) => {
                     this.setData({
@@ -90,23 +90,24 @@ VueLikePage([], {
         },
         onShow: function () {
             let cu_items = this.data.cu_items
-            this.isCustomer = getApp().globalData.userinfo ? getApp().globalData.userinfo.type !== 'guide' : false
-            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.isCustomer = getApp().globalData.userinfo ? getApp().globalData.userinfo.type !== 'guide' : true
+                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) => {

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

@@ -6,8 +6,8 @@
     </view>
     <view wx:else class="login-text"  >
         点击注册 / 登录
-        <button class="login-text" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo" ></button>
     </view>
+    <button class="login-btn" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo" ></button>
     <!-- <view class="setting-icon"></view> -->
     <!-- <button wx:if="{{ !isLogined }}" open-type="getPhoneNumber" bindgetphonenumber="bindgetphonenumber">获取手机号</button> -->
     <!-- <image src="/image/4Dage/my/my-header-bg.png" class="header-bg"></image> -->

+ 8 - 1
miniprogram/pages/my/my.wxss

@@ -20,7 +20,14 @@
   position: relative;
   display: block;
 }
-
+.login-btn {
+  display: block;
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+}
 .avatar {
   width: 120rpx;
   height: 120rpx;

+ 7 - 7
miniprogram/pages/search/search.js

@@ -76,15 +76,15 @@ VueLikePage([], {
           resultList: res.data.list.map(item => {
             console.log(item[img_key], 'item[img_key]')
           let img = []
-          try {
-            img = JSON.parse(item[img_key])
-          } catch (err) {
-            console.log(err, '解析图片列表出错')
-          }
-          console.log(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]
-            item.img = img[0].img
+            item.img = item.companyLogo
             return item
           }),
           history: loadSearchHistory(),

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

@@ -113,7 +113,7 @@ page {
   margin-bottom: 12rpx;
   background-repeat: no-repeat;
   background-position: center center;
-  background-size: cover;
+  background-size: contain;
 }
 
 .result-name {

+ 7 - 1
miniprogram/pages/shared/shared.js

@@ -7,7 +7,8 @@ VueLikePage([], {
   data: {
     shared_img: '',
     recommend_text: '',
-    editShowStatus: false
+    editShowStatus: false,
+    imgLoaded: false
   },
   methods: {
     onLoad: async function (options) {
@@ -140,6 +141,11 @@ VueLikePage([], {
                 this.setData({
                   img_url: res.tempFilePath
                 })
+                setTimeout(() => {
+                  this.setData({
+                    imgLoaded: true
+                  }, 200)
+                })
               }
             })
           })

+ 1 - 1
miniprogram/pages/shared/shared.wxml

@@ -3,7 +3,7 @@
   <view class="shared-content">
     <image class="canvas-img" src="{{img_url}}"></image>
     <canvas class="canvas"  canvas-id="content"></canvas>
-    <view class="dingzhi" bindtap="showEdit">定制推荐语</view>
+    <view class="dingzhi" bindtap="showEdit" wx:if="{{ imgLoaded }}">定制推荐语</view>
   </view>
   <view class="tools-w">
     <view class="tools-title">分享到</view>

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

@@ -37,7 +37,7 @@
 .dingzhi {
   position: absolute;
   right: 40rpx;
-  top: 588rpx;
+  top: 638rpx;
   font-size: 22rpx;
   background: #1FE4DC;
   border-radius: 4rpx;

+ 1 - 1
miniprogram/project.config.json

@@ -4,7 +4,7 @@
 		"ignore": []
 	},
 	"setting": {
-		"urlCheck": true,
+		"urlCheck": false,
 		"es6": true,
 		"enhance": true,
 		"postcss": true,

+ 13 - 1
miniprogram/utils/storage.js

@@ -3,7 +3,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'
-
+const HasAddFriend = 'has_add_guide'
 function saveStorage (key, value, expired = 0) {
   const storage = {
     value
@@ -101,3 +101,15 @@ export function removeCollect (goods_id) {
   historys = historys.filter(item => item.id !== goods_id)
   return saveStorage(Collect_HISTORY_KEY, historys)
 }
+
+export function saveHasAddFriend () {
+  return saveStorage(HasAddFriend, true)
+}
+
+export function loadHasAddFriend () {
+  return loadStorage(HasAddFriend)
+}
+
+export function removeHasAddFriend () {
+  return removeStorage(HasAddFriend)
+}

+ 1 - 1
miniprogram/utils/utils.js

@@ -33,7 +33,7 @@ export function autoSubcrebe() {
       withSubscriptions: true,
       success: (setting) => {
         let hasAuto = false
-        if (setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings[subId]) {
+        if (setting && setting.subscriptionsSetting && setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings[subId]) {
           subcribe()
           hasAuto = true
         }