Переглянути джерело

1、修改组织机构的点击进入编辑
2、增加点击广告跳转链接

zhoux 1 рік тому
батько
коміт
c70cd2c166

+ 1 - 0
mixins/index.js

@@ -1061,6 +1061,7 @@ module.exports = {
     // 获取当前页面的路由
     var pages = getCurrentPages();
     var currentPage = pages[pages.length - 1];
+    if(!currentPage)return;
     let route = currentPage.route;
     console.log('formData',formData);
     if (formData && formData != '{}') {

+ 1 - 1
package-basic-data/pages/org/org.wxml

@@ -24,7 +24,7 @@
     <view style="display: flex;padding:3vw;   border-radius: 15rpx 15rpx 0 0 " class="tile-class" data-open="{{item.open}}" data-item="{{item}}" data-index="{{index}}" bindtap="onchange">
         <view style="display: flex;flex: 1;">
             <van-image round width="39rpx" height="39rpx" fit="fill" src="/static/image/ghxk.png" />
-            <view style="margin-left:5vw;font-size: 16px;font-weight: 500;">{{item.orgName}}</view>
+            <view style="margin-left:5vw;font-size: 16px;font-weight: 500;" data-item="{{item}}" bindtap="clickName">{{item.orgName}}</view>
         </view>
         <view style=" text-align: right;">
             <van-icon wx:if="{{ item.open }}" color="#bdb7b7" name="arrow-down" style="font-size: 16px;" />

+ 0 - 1
pages/company/company.js

@@ -93,7 +93,6 @@ Page({
     clickCompany(e) {
         // 点击企业时候反写当前公司
         let item = e.currentTarget.dataset.item
-        console.log('item', item, app.globalData.openid,app.globalData.user_social);
         if (item.cpId == 2 || item.cpId == 3) {
             this.freeClick(item)
         } else {

+ 17 - 0
pages/home-page/home-page.js

@@ -151,6 +151,23 @@ Page({
     })
   },
   /**
+  * @desc : 点击跳转到对应的链接
+  * @author : 周兴
+  * @date : 2024/4/1
+  */
+  handClickImage(e){
+    console.log('eee',e);
+    let url = e.currentTarget.dataset.item.activityUrl
+    if(url){
+      wx.navigateTo({
+        url: '/pages/product/product',
+        success: function (res) {
+          res.eventChannel.emit('url', url);
+        }
+      })
+    }
+  },
+  /**
   * @desc : 查询应收和收款
   * @author : 周兴
   * @date : 2024/4/3

+ 1 - 1
pages/home-page/home-page.wxml

@@ -65,7 +65,7 @@
     <swiper indicator-dots="{{true}}" autoplay="true" interval="3000">
       <block wx:for="{{advertisementList}}" wx:key="{{index}}" wx:for-item="item">
         <swiper-item>
-          <image src="{{item.adPath}}" mode="aspectFill" />
+          <image src="{{item.adPath}}" mode="aspectFill" data-item="{{item}}" catchtap="handClickImage" />
         </swiper-item>
       </block>
     </swiper>

+ 1 - 1
pages/login/login.js

@@ -87,7 +87,7 @@ Page({
   */
   freeClick(e) {
     // 测试的openid
-    app.globalData.openid = 'dktest'
+    app.globalData.openid = Constants.testCpCodes.std_test
     let _this = this
     //  调用接口
     _this.getTokenPromise().then(res => {

+ 18 - 2
pages/product/product.js

@@ -3,6 +3,22 @@ Page({
      * 页面的初始数据
      */
     data: {
-        webUrl:'http://www.dongkesoft.com/public/'
-    }, 
+        webUrl: 'http://www.dongkesoft.com/public/'
+    },
+    /**
+   * 生命周期函数--监听页面加载
+   */
+    onLoad(options) {
+        // 接收父页面传递的参数
+        const eventChannel = this.getOpenerEventChannel();
+        if (eventChannel && JSON.stringify(eventChannel) !== '{}') {
+            let that = this;
+            // 指定类型
+            eventChannel.once('url', function (data) {
+                that.setData({
+                    webUrl: data
+                })
+            })
+        }
+    },
 })

+ 1 - 1
pages/product/product.json

@@ -1,4 +1,4 @@
 {
     "usingComponents": {},
-    "navigationBarTitleText": "产品介绍"
+    "navigationBarTitleText": ""
 }