dev01 1 year ago
parent
commit
b4981fd645

+ 5 - 4
project.config.json

@@ -7,7 +7,7 @@
         "urlCheck": false,
         "es6": false,
         "enhance": true,
-        "postcss": false,
+        "postcss": true,
         "preloadBackgroundData": false,
         "minified": true,
         "newFeature": false,
@@ -23,8 +23,8 @@
         "compileHotReLoad": false,
         "lazyloadPlaceholderEnable": false,
         "useMultiFrameRuntime": false,
-        "useApiHook": false,
-        "useApiHostProcess": false,
+        "useApiHook": true,
+        "useApiHostProcess": true,
         "babelSetting": {
             "ignore": [],
             "disablePlugins": [],
@@ -40,7 +40,8 @@
         "minifyWXML": true,
         "showES6CompileOption": false,
         "useCompilerPlugins": false,
-        "useStaticServer": true
+        "useStaticServer": true,
+        "condition": false
     },
     "compileType": "miniprogram",
     "condition": {},

+ 2 - 1
project.private.config.json

@@ -3,5 +3,6 @@
     "projectname": "kede-bill-weapp",
     "setting": {
         "compileHotReLoad": false
-    }
+    },
+    "libVersion": "3.0.0"
 }

+ 2 - 1
src/app.config.js

@@ -57,5 +57,6 @@ export default {
     navigationBarTitleText: 'WeChat',
     navigationBarTextStyle: 'black',
   },
-  "lazyCodeLoading": "requiredComponents"
+  "lazyCodeLoading": "requiredComponents",
+  "__usePrivacyCheck__": true,
 }

+ 2 - 2
src/app.jsx

@@ -85,11 +85,11 @@ class App extends Component {
         'token': token,
       },
       // 生产
-      // url: 'wss://bm.jishutao.com/webSocketServer',
+      url: 'wss://bm.jishutao.com/webSocketServer',
       // 本地
       // url: 'wss://172.16.0.255:8080/webSocketServer'
       // 测试
-      url: 'wss://uat.jishutao.com/webSocketServer'
+      // url: 'wss://uat.jishutao.com/webSocketServer'
     })
 
     //连接成功

+ 56 - 0
src/components/common/privacy/privacy.js

@@ -0,0 +1,56 @@
+Component({
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    privacyContractName: '',
+    showPrivacy: false
+  },
+  /**
+   * 组件的生命周期
+   */
+  lifetimes: {
+    attached() {
+      const _ = this
+      wx.getPrivacySetting({
+        success(res) {
+          if (res.errMsg == "getPrivacySetting:ok") {
+            _.setData({
+              privacyContractName: res.privacyContractName,
+              showPrivacy: res.needAuthorization
+            })
+          }
+        }
+      })
+    },
+  },
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    // 打开隐私协议页面
+    openPrivacyContract() {
+      const _ = this
+      wx.openPrivacyContract({
+        fail: () => {
+          wx.showToast({
+            title: '遇到错误',
+            icon: 'error'
+          })
+        }
+      })
+    },
+    // 拒绝隐私协议
+    exitMiniProgram() {
+      // 直接退出小程序
+      wx.exitMiniProgram()
+    },
+    // 同意隐私协议
+    handleAgreePrivacyAuthorization() {
+      const _ = this
+      _.setData({
+        showPrivacy: false
+      })
+    },
+  },
+})

+ 4 - 0
src/components/common/privacy/privacy.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 13 - 0
src/components/common/privacy/privacy.wxml

@@ -0,0 +1,13 @@
+<!--component/privacy/privacy.wxml-->
+<view class="privacy" wx:if="{{showPrivacy}}">
+    <view class="content">
+        <view class="title">隐私保护指引</view>
+        <view class="des">
+            在使用当前小程序服务之前,请仔细阅读<text class="link" bind:tap="openPrivacyContract">{{privacyContractName}}</text>。如你同意{{privacyContractName}},请点击“同意”开始使用。
+        </view>
+        <view class="btns">
+            <button class="item reject" bind:tap="exitMiniProgram">拒绝</button>
+            <button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
+        </view>
+    </view>
+</view>

+ 68 - 0
src/components/common/privacy/privacy.wxss

@@ -0,0 +1,68 @@
+/* component/privacy/privacy.wxss */
+.privacy {
+    position: fixed;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    background: rgba(0, 0, 0, .5);
+    z-index: 9999999;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.content {
+    width: 632rpx;
+    padding: 48rpx;
+    box-sizing: border-box;
+    background: #fff;
+    border-radius: 16rpx;
+}
+
+.content .title {
+    text-align: center;
+    color: #333;
+    font-weight: bold;
+    font-size: 32rpx;
+}
+
+.content .des {
+    font-size: 26rpx;
+    color: #666;
+    margin-top: 40rpx;
+    text-align: justify;
+    line-height: 1.6;
+}
+
+.content .des .link {
+    color: #07c160;
+    text-decoration: underline;
+}
+
+.btns {
+    margin-top: 48rpx;
+    display: flex;
+}
+
+.btns .item {
+    justify-content: space-between;
+    width: 244rpx;
+    height: 80rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border-radius: 16rpx;
+    box-sizing: border-box;
+    border: none;
+}
+
+.btns .reject {
+    background: #f4f4f5;
+    color: #909399;
+}
+
+.btns .agree {
+    background: #07c160;
+    color: #fff;
+}

+ 4 - 1
src/pages/login/index.config.js

@@ -1,4 +1,7 @@
 export default {
   navigationBarTitleText: '登录',
-  navigationStyle:'custom'
+  navigationStyle:'custom',
+  usingComponents: {
+    privacy: '../../components/common/privacy/privacy'
+  }
 }

+ 1 - 0
src/pages/login/index.jsx

@@ -252,6 +252,7 @@ class Login extends Component {
           <View className='welcomeTitle'>科德研发服务流程管理系统</View>
           <View className='welcomeTitle'>欢迎您!</View>
         </View>
+        <privacy />
         <View className='loginContent'>
           <View className='loginItem'>
             <AtIcon value='user' size='20' color='#999999' />

+ 2 - 2
src/utils/config.js

@@ -1,7 +1,7 @@
 // 本地
 // export const resourceAddress = 'http://172.16.0.255:3000/upload';
 // 生产
-// export const resourceAddress = 'https://s.jishutao.com/upload';
+export const resourceAddress = 'https://s.jishutao.com/upload';
 // 测试
-export const resourceAddress = 'https://static.jishutao.com/upload';
+// export const resourceAddress = 'https://static.jishutao.com/upload';
 

+ 2 - 2
src/utils/servers/baseUrl.js

@@ -8,8 +8,8 @@ const getBaseUrl = (url) => {
   } else {
     // 生产环境
     // BASE_URL = 'http://172.16.0.255:8080'
-    BASE_URL = 'https://uat.jishutao.com'
-    // BASE_URL = 'https://bm.jishutao.com'
+    // BASE_URL = 'https://uat.jishutao.com'
+    BASE_URL = 'https://bm.jishutao.com'
   }
   return BASE_URL
 }