dev01 1 yıl önce
ebeveyn
işleme
00ec14b3cc

+ 1 - 1
src/app.config.js

@@ -57,5 +57,5 @@ export default {
   //   }
   // },
   "lazyCodeLoading": "requiredComponents",
-  "__usePrivacyCheck__": true,
+  // "__usePrivacyCheck__": true,
 }

+ 1 - 2
src/components/common/imagePicker/index.jsx

@@ -82,8 +82,6 @@ class ImagePicker extends Component {
           if (res.progress === 100) {
             let num = this.state.speedProgress + 1;
             let speed = num / arr.length * 100;
-            //console.log(num,arr.length)
-            //console.log(num/arr.length)
             this.setState({
               speedProgress: num,
             }, () => {
@@ -108,6 +106,7 @@ class ImagePicker extends Component {
 
   }
   onImageClick(index) {
+    console.log("***")
     let arr = [];
     for (let i of this.state.files) {
       arr.push(i.url)

+ 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

@@ -250,6 +250,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' />

+ 9 - 2
src/pages/punchClock/punchClocks.jsx

@@ -211,7 +211,8 @@ class PunchClocks extends Component {
                   <View className='items'>
                     <View className='ititle'>研发工时:
                       <Input value={this.state.duration} type='digit' className='input' placeholder='请输入'
-                        style={{ textAlign: "center", border: "1px solid #d6e4ef", background: "#D7D7D7", borderRadius: "10px", }}
+                        style={{ textAlign: "center", background: "#D7D7D7", borderRadius: "10px", }}
+                        // border: "1px solid #d6e4ef",
                         onInput={e => {
                           this.setState({
                             duration: e.detail.value
@@ -242,7 +243,7 @@ class PunchClocks extends Component {
                       <Textarea
                         value={this.state.remark}
                         placeholder="请填写研发过程记录"
-                        style='background:#D7D7D7;width:66%;min-height:70px;border:1px solid #d6e4ef;padding:10px;border-radius: 10px'
+                        style='background:#D7D7D7;width:66%;min-height:70px;padding:10px;border-radius: 10px'
                         autoHeight
                         onInput={e => {
                           this.setState({
@@ -252,6 +253,12 @@ class PunchClocks extends Component {
                       />
                     </View>
                   </View>
+                  {/* <ImagePicker
+                      showAddBtn
+                      ref={(ref) => (this.imagePickerRef = ref)}
+                      url="/api/project/upload"
+                      onChange={this.onChange}
+                    /> */}
                   <View className='items'>
                     <View className='ititles'>上传附件:</View>
                     <ImagePicker