Просмотр исходного кода

1、修改登录打开协议的方式

zhoux 1 год назад
Родитель
Сommit
773ce34f4e
3 измененных файлов с 13 добавлено и 72 удалено
  1. 3 3
      mixins/index.js
  2. 9 68
      pages/login/login.js
  3. 1 1
      pages/login/login.wxml

+ 3 - 3
mixins/index.js

@@ -833,9 +833,9 @@ module.exports = {
               wx.reLaunch({
                 url: '/pages/welcome/welcome',
               })
-              wx.navigateBack({
-                delta: 1
-              })
+              // wx.navigateBack({
+              //   delta: 1
+              // })
             }
           },
           'fail': function (res) {

+ 9 - 68
pages/login/login.js

@@ -76,73 +76,15 @@ Page({
   * @date : 2024/7/11 13:49
   * @author : 周兴
   */
-  openUserAgreement() {
-    let url = config.image_url + '/agreement/userAgreement.pdf'
-    let toUrl = null;
-    if (url) {
-      // 看下是否包括http,http就跳转到product页面
-      if (url.indexOf('http') >= 0) {
-        // toUrl = '/pages/product/product'
-        wx.downloadFile({
-          url: url,
-          success(e){
-            wx.openDocument({
-              filePath: e.tempFilePath,
-              showMenu: true,
-              fileType: 'pdf',
-              success(e) {
-                console.log('success', e);
-              },
-              fail(e){
-                console.log('fail', e);
-              }
-            })
-          }
-        })
-      } else {
-        // 说明是跳本产品
-        toUrl = url;
-        wx.navigateTo({
-          url: toUrl,
-          success: function (res) {
-            res.eventChannel.emit('url', url);
-          }
-        })
-      }
+  openAgreement(e) {
+    let url = ''
+    if(e.currentTarget.dataset.type == 'user'){
+      url = 'https://www.dongkesoft.com/public/index/changjian/news_info/id/101.html'
+    }else{
+      url = 'https://www.dongkesoft.com/public/index/changjian/news_info/id/102.html'
     }
-  },
-  /**
-  * @desc : 隐私协议
-  * @date : 2024/7/11 13:49
-  * @author : 周兴
-  */
- openPrivacyAgreement() {
-  let url = config.image_url + '/agreement/privacyAgreement.pdf'
-
-  let toUrl = null;
-  if (url) {
-    // 看下是否包括http,http就跳转到product页面
-    if (url.indexOf('http') >= 0) {
-      // toUrl = '/pages/product/product'
-      wx.downloadFile({
-        url: url,
-        success(e){
-          wx.openDocument({
-            filePath: e.tempFilePath,
-            showMenu: true,
-            fileType: 'pdf',
-            success(e) {
-              console.success('openFile', e);
-            },
-            fail(e){
-              console.fail('openFile', e);
-            }
-          })
-        }
-      })
-    } else {
-      // 说明是跳本产品
-      toUrl = url;
+    let toUrl = '/pages/product/product'
+    if (url) {
       wx.navigateTo({
         url: toUrl,
         success: function (res) {
@@ -150,8 +92,7 @@ Page({
         }
       })
     }
-  }
-},
+  },
   /**
   * @desc : 了解产品
   * @date : 2022/5/12 13:49

+ 1 - 1
pages/login/login.wxml

@@ -25,7 +25,7 @@
 
     <view class="foot-agreement-privacy">
       <van-checkbox custom-class="checkbox-class" shape="square" value="{{agreementPrivacy}}" bind:change="onCheckboxChange" />
-      <view style="padding-left: 10rpx;display: flex;"> {{$t['agreementPrivacy']}} <view style="text-decoration: underline;color: rgb(54, 153, 245);font-weight: bold;" catchtap="openUserAgreement">{{$t['userAgreement']}}</view>和<view style="text-decoration: underline;color: rgb(54, 153, 245);font-weight: bold;" catchtap="openPrivacyAgreement">{{$t['privacyAgreement']}}</view></view>
+      <view style="padding-left: 10rpx;display: flex;"> {{$t['agreementPrivacy']}} <view style="text-decoration: underline;color: rgb(54, 153, 245);font-weight: bold;" data-type="user" catchtap="openAgreement">{{$t['userAgreement']}}</view>和<view style="text-decoration: underline;color: rgb(54, 153, 245);font-weight: bold;" data-type="privacy" catchtap="openAgreement">{{$t['privacyAgreement']}}</view></view>
     </view>
   </view>
 </view>