zhaoxiaohai 3 years ago
parent
commit
423221cdb2

+ 31 - 7
pages/login/modules/agreement.js

@@ -12,13 +12,6 @@ Component({
         }
     },
 
-    /**
-     * 组件的初始数据
-     */
-    data: {
-
-    },
-
     /**
      * 组件的方法列表
      */
@@ -30,6 +23,37 @@ Component({
                 isAgree
             })
             this.triggerEvent("callBack", isAgree)
+        },
+        checkTheAgreement() {
+            wx.showLoading({
+                title: '加载中...',
+            })
+            wx.downloadFile({
+                url: 'https://mdyossys.obs.cn-east-3.myhuaweicloud.com/resources/%E7%BE%8E%E5%A4%A7CRM%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%9A%90%E7%A7%81%E4%BF%9D%E6%8A%A4%E6%8C%87%E5%BC%95.docx',
+                success: (res) => {
+                    wx.openDocument({
+                        filePath: res.tempFilePath,
+                        success:(s)=>{
+                            wx.hideLoading();
+
+                        },
+                        fail: (err) => {
+                            wx.hideLoading();
+                            wx.showToast({
+                                title: '读取失败,请稍后再试',
+                                icon: "none"
+                            })
+                        }
+                    })
+                },
+                fail: (err) => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        title: '读取失败,请稍后再试',
+                        icon: "none"
+                    })
+                }
+            })
         }
     }
 })

+ 1 - 2
pages/login/modules/agreement.scss

@@ -10,8 +10,7 @@
         font-size: 24rpx !important;
         font-family: PingFang SC-Regular, PingFang SC;
         color: #666666 !important;
-        padding-top: 40rpx;
-        margin-left: -10rpx;
+        margin-left: -20rpx;
 
         text {
             color: #3874F6;

+ 1 - 1
pages/login/modules/agreement.wxml

@@ -1,3 +1,3 @@
 <view class="agreement">
-    <van-checkbox icon-size="28rpx" label-class='con' value="{{ isAgree }}" bind:change="isAgreeChange">登录代表您已同意 <text>用户服务协议</text>、<text>隐私协议</text></van-checkbox>
+    <van-checkbox icon-size="28rpx" label-class='con' value="{{ isAgree }}" bind:change="isAgreeChange">登录代表您已同意<text catchtap="checkTheAgreement">《隐私协议》</text></van-checkbox>
 </view>