From 41bd8b2b50dc308ea3a5784efccd856c073b3f37 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 21 八月 2024 15:04:55 +0800
Subject: [PATCH] ll

---
 wechat_jiaxuan/pages/detailDis/product.js   |   11 +++--
 wechat_jiaxuan/pages/detailDis/product.wxml |    8 ++--
 wechat_staff/project.private.config.json    |    4 +-
 wechat_staff/pages/detailDis/product.js     |    3 +
 wechat_staff/pages/work/index.wxml          |    2 +
 wechat_staff/pages/work/index.js            |   61 ++++++++++++++++++++++--------
 wechat_jiaxuan/pages/index/index.js         |    2 
 wechat_staff/pages/detailDis/product.wxml   |    6 +-
 8 files changed, 67 insertions(+), 30 deletions(-)

diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index be08b05..2bc3305 100644
--- a/wechat_jiaxuan/pages/detailDis/product.js
+++ b/wechat_jiaxuan/pages/detailDis/product.js
@@ -15,6 +15,7 @@
     origin: '',
     isFold: false,
     info: {},
+    isCollection: false,
     member: {},
     showShare: false,
     options: {
@@ -77,8 +78,8 @@
   },
   handleAction(e) {
     const actionType = e.currentTarget.dataset.code
-    const {
-      info, member
+    let {
+      info, member, isCollection
     } = this.data
     if (!member.phone) {
       return wx.navigateTo({
@@ -90,8 +91,9 @@
       id: this.data.info.id
     }).then(res => {
       info.isCollection = !info.isCollection
+      isCollection = !isCollection
       this.setData({
-        info
+        isCollection
       })
       wx.showToast({
         title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
@@ -105,7 +107,8 @@
       salesId: userId || null
     }).then(res => {
       this.setData({
-        info: res.data
+        info: res.data,
+        isCollection: res.data.isCollection
       })
       wx.setNavigationBarTitle({
         title: res.data.title
diff --git a/wechat_jiaxuan/pages/detailDis/product.wxml b/wechat_jiaxuan/pages/detailDis/product.wxml
index 6fb6f4b..d4f8c42 100644
--- a/wechat_jiaxuan/pages/detailDis/product.wxml
+++ b/wechat_jiaxuan/pages/detailDis/product.wxml
@@ -49,8 +49,8 @@
   <view class="spaceList">
     <view class="item" wx:for="{{ info.spaceList }}">
       <!-- <view class="name">{{ item.spaceName }}</view> -->
-      <image data-url="{{ item.spaceImg }}" bindtap="priviewSpace" src="{{ item.spaceImg }}" mode="widthFix" class="img"></image>
-      <!-- <mp-html content="{{item.spaceContent}}"></mp-html> -->
+      <!-- <image data-url="{{ item.spaceImg }}" bindtap="priviewSpace" src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> -->
+      <mp-html content="{{item.spaceContent}}"></mp-html>
     </view>
   </view>
   <!-- footer -->
@@ -59,8 +59,8 @@
   </view>
   <view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;">
     <view class="btns">
-      <button hover-class="none" data-code="{{ info.isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn">
-        <image wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
+      <button hover-class="none" data-code="{{ isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn">
+        <image wx:if="{{ isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
         <image wx:else class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
         <view class="name">鏀惰棌</view>
       </button>
diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index 69f06e2..d590a95 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -78,7 +78,7 @@
           windowHeight: windowInfo.windowHeight
         })
       })
-    }, 2000)
+    }, 3000)
   },
   onShow() {
     const member = wx.getStorageSync('member')
diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index ca16234..7ffee42 100644
--- a/wechat_staff/pages/detailDis/product.js
+++ b/wechat_staff/pages/detailDis/product.js
@@ -14,6 +14,7 @@
     current: 0,
     id: '',
     info: {},
+    spaceList: [],
     member: {},
     showShare: false,
     isFold: false,
@@ -102,6 +103,7 @@
     this.setData({ current: e.detail.current })
   },
   priviewSpace(e) {
+    return
     const url = e.currentTarget.dataset.url
     const {
       info
@@ -121,6 +123,7 @@
     }).then(res => {
       const index = enjoyList.findIndex( i =>(res.data && i.id === res.data.id) )
       this.setData({
+        spaceList: res.data.spaceList || [],
         info: {
           ...res.data,
           isEnjoy: index > -1
diff --git a/wechat_staff/pages/detailDis/product.wxml b/wechat_staff/pages/detailDis/product.wxml
index 1c26f22..74f8ce9 100644
--- a/wechat_staff/pages/detailDis/product.wxml
+++ b/wechat_staff/pages/detailDis/product.wxml
@@ -46,10 +46,10 @@
     <mp-html content="{{info.content}}"></mp-html>
   </view>
   <view class="spaceList">
-    <view data-url="{{ item.spaceImg }}" bindtap="priviewSpace" class="item" wx:for="{{ info.spaceList }}">
+    <view data-url="{{ item.spaceImg }}" bindtap="priviewSpace" class="item" wx:for="{{ spaceList }}">
       <!-- <view class="name">{{ item.spaceName }}</view> -->
-      <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image>
-      <!-- <mp-html content="{{item.spaceContent}}"></mp-html> -->
+      <!-- <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> -->
+      <mp-html content="{{item.spaceContent}}"></mp-html>
     </view>
   </view>
 </view>
\ No newline at end of file
diff --git a/wechat_staff/pages/work/index.js b/wechat_staff/pages/work/index.js
index ef2a209..390702e 100644
--- a/wechat_staff/pages/work/index.js
+++ b/wechat_staff/pages/work/index.js
@@ -1,38 +1,66 @@
-import { getDictData, getMemberInfo } from '../../api/index'
+import {
+  getDictData,
+  getMemberInfo
+} from '../../api/index'
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    topimg:'',
+    topimg: '',
     clientHeight: 0,
-    clientTop: 0, 
+    clientTop: 0,
     showCard: false,
-    userInfo: {name:''}
+    userInfo: {
+      name: ''
+    }
   },
   onLoad(options) {
     const res = wx.getMenuButtonBoundingClientRect()
-    this.setData({clientHeight: res.height})
-    this.setData({clientTop: res.top})
+    this.setData({
+      clientHeight: res.height
+    })
+    this.setData({
+      clientTop: res.top
+    })
   },
   onShow() {
     this.initData()
   },
+  subscribeMessage: function () {
+    // 鏄剧ず鍔犺浇鎻愮ず
+    // 璋冪敤璁㈤槄娑堟伅鐨凙PI
+    wx.requestSubscribeMessage({
+      tmplIds: ['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'],
+      success: (res) => {
+        console.log('res', res);
+      },
+      fail: () => {
+        reject();
+      }
+    })
+  },
   showQrcode() {
-    this.setData({ showCard: true })
+    this.setData({
+      showCard: true
+    })
   },
   onClose() {
-    this.setData({ showCard: false })
+    this.setData({
+      showCard: false
+    })
   },
   changePath(e) {
-    const {userInfo} = this.data
+    const {
+      userInfo
+    } = this.data
     // 椤甸潰璺宠浆
     let temp = [
       '/pages/userinfo/index',
       '/pages/store/staff?userType=1',
       '/pages/userinfo/collect',
-      '/pages/store/index?shopId='+userInfo.departmentId,
+      '/pages/store/index?shopId=' + userInfo.departmentId,
       '/pages/sets/index'
     ]
     const index = e.currentTarget.dataset.index
@@ -44,18 +72,19 @@
     getMemberInfo().then(res => {
       this.setData({
         userInfo: res.data
-      }) 
-      wx.setStorageSync('member',res.data)
-    }) 
+      })
+      wx.setStorageSync('member', res.data)
+    })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
       label: 'STAFF_WORK_TOP_IMG'
     }).then(res => {
-      this.setData({ topimg: res.data.code })
+      this.setData({
+        topimg: res.data.code
+      })
     })
   },
-  onReady() { 
-  },
+  onReady() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
diff --git a/wechat_staff/pages/work/index.wxml b/wechat_staff/pages/work/index.wxml
index db266d2..1ac0c29 100644
--- a/wechat_staff/pages/work/index.wxml
+++ b/wechat_staff/pages/work/index.wxml
@@ -35,6 +35,8 @@
         <image class="icon" src="../../static/icon/mine_ic_ar.png" mode="widthFix"></image>
       </view>
     </view>
+    <!-- index.wxml -->
+    <button bindtap="subscribeMessage">璁㈤槄娑堟伅</button>
   </view>
   <!-- 璇︽儏 -->
   <van-popup show="{{ showCard }}" closeable round bind:close="onClose">
diff --git a/wechat_staff/project.private.config.json b/wechat_staff/project.private.config.json
index 8bd54e7..a8ff755 100644
--- a/wechat_staff/project.private.config.json
+++ b/wechat_staff/project.private.config.json
@@ -31,8 +31,8 @@
         },
         {
           "name": "",
-          "pathName": "pages/productVideo/index",
-          "query": "id=1813372914895843329",
+          "pathName": "pages/detailDis/product",
+          "query": "id=1823671456940113921",
           "launchMode": "default",
           "scene": null
         },

--
Gitblit v1.9.3