瀏覽代碼

feat: add manage all file & my file

wangyuan 2 年之前
父節點
當前提交
3685d6d6ac
共有 4 個文件被更改,包括 308 次插入0 次删除
  1. 129 0
      pages/handleFile/handleFile.js
  2. 3 0
      pages/handleFile/handleFile.json
  3. 44 0
      pages/handleFile/handleFile.wxml
  4. 132 0
      pages/handleFile/handleFile.wxss

+ 129 - 0
pages/handleFile/handleFile.js

@@ -0,0 +1,129 @@
+// pages/handleFile/handleFile.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    vanoverlayshow: false,
+    fileList: [
+      {
+        name: '范一岚',
+        date: '1995/12',
+        choseFlag: false
+      },
+      {
+        name: '汪渊',
+        date: '1993/02',
+        choseFlag: false
+      }
+    ],
+    delFileList: []
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    this.initDelList()
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 删除文档
+   */
+  handleDelFile() {
+    let flag = this.data.delFileList.find(item => {
+      return item == true
+    })
+    if (!flag) {
+      wx.showToast({
+        title: '请选择删除的档案!',
+        icon: 'error',
+        mask: true,
+        duration: 2000
+      })
+    } else {
+      this.setData({
+        vanoverlayshow: true
+      })
+    }
+  },
+
+  /**
+   * 取消
+   */
+  handleCancel() {
+    this.setData({
+      vanoverlayshow: false
+    })
+  },
+
+  /* 确定 */
+  handleConfirm () {
+    this.setData({
+      vanoverlayshow: false
+    }, () => {
+      wx.showLoading({
+        title: '加载中...',
+        mask: true
+      })
+      setTimeout(() => {
+        wx.hideLoading({
+          success: (res) => {},
+        })
+      }, 2000);
+    })
+  },
+
+  /**
+   * 用户点击 单选radio
+   */
+  handleRadio (e) {
+    var choseIndex = e.currentTarget.dataset.index
+    var currentList = this.data.fileList
+    currentList[choseIndex].choseFlag = !currentList[choseIndex].choseFlag
+    this.setData({
+      fileList: currentList
+    })
+    this.initDelList()
+  },
+  /* 处理删除的数据 */
+  initDelList () {
+    var currentList = this.data.fileList
+    var _a = []
+    currentList.map(item => {
+      _a.push(item.choseFlag)
+    })
+    this.setData({
+      delFileList: _a
+    })
+  }
+})

+ 3 - 0
pages/handleFile/handleFile.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "全部档案"
+}

+ 44 - 0
pages/handleFile/handleFile.wxml

@@ -0,0 +1,44 @@
+<!--pages/handleFile/handleFile.wxml-->
+<view class="handle-file-content">
+  <view class="main-content">
+    <view class="file-item ittflex-jcb" wx:for="{{fileList}}" wx:key="index">
+      <view class="f-left ittflex-jcs">
+      <view class="ittflex f-radio {{item.choseFlag ? 'f-radio-active' : ''}}" data-index="{{index}}" bindtap="handleRadio">
+        <van-icon name="success" color="#fff"/>
+      </view>
+        <view class="f-avatar"></view>
+        <view class="f-user">
+          <view class="fu-top ittflex-jcs">
+            <text class="fu-name">{{item.name}}</text>
+            <view class="suer-sex ittflex">
+              <image class="img" src="../../imaes/nan@2x.png"></image>
+            </view>
+          </view>
+          <view class="fu-bottom fu-date">{{item.date}}</view>
+        </view>
+        <view class="f-qrcode ittflex">
+          <image class="qrcode-item" src="../../imaes/erweima@2x.png"></image>
+        </view>
+      </view>
+    </view>
+    <view class="actions ittfle">
+      <view class="handle-btn itt-btn" bindtap="handleDelFile">删除</view>
+    </view>
+  </view>
+  <van-overlay show="{{ vanoverlayshow }}">
+      <view class="wrapper ittflex">
+        <view class="model">
+          <view class="top-title">
+            <view class="main-title">删除检测人</view>
+            <view class="sub-title">确定要删除关关的档案信息吗?</view>
+            <view class="sub-title">相对应的体检报告也会相应删除哦!</view>
+          </view>
+          <view class="bottom-action ittflex">
+            <view class="btn w-cancel-btn ittflex" bindtap="handleCancel">取消</view>
+            <view class="btn w-confirm-btn ittflex" bindtap="handleConfirm">确定</view>
+          </view>
+        </view>
+      </view>
+    </van-overlay>
+</view>
+

+ 132 - 0
pages/handleFile/handleFile.wxss

@@ -0,0 +1,132 @@
+/* pages/handleFile/handleFile.wxss */
+.handle-file-content {
+  width: 100%;
+  height: 100%;
+  background-color: #f7f7f7;
+  overflow-y: auto;
+  position: relative;
+}
+.main-content {
+  width: 690rpx;
+  /* min-height: 100%; */
+  margin: 0 auto;
+  padding-bottom: 180rpx;
+}
+.file-item {
+  width: 100%;
+  height: 160rpx;
+  background: #FFFFFF;
+  border-radius: 20rpx;
+  margin-top: 20rpx;
+}
+.f-left {
+  width: 100%;
+  height: 100%;
+}
+.f-radio {
+  width: 40rpx;
+  height: 40rpx;
+  border: 2rpx solid #DDDDDD;
+  border-radius: 50%;
+  margin-left: 20rpx;
+}
+.f-radio-active {
+  background-color: var(--maincolor);
+  border-color: var(--maincolor);
+}
+.f-avatar {
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 50%;
+  background-color: var(--maincolor);
+  margin: 0 14rpx 0 20rpx;
+}
+.report-text {
+  padding: 20rpx;
+  font-size: 26rpx;
+  font-weight: 400;
+  color: var(--maincolor);
+}
+
+.fu-name {
+  font-size: 30rpx;
+  font-weight: 600;
+  color: #333333;
+  margin-right: 12rpx;
+}
+.suer-sex {
+  width: 30rpx;
+  height: 30rpx;
+}
+.img {
+  width: 30rpx;
+  height: 30rpx;
+}
+.fu-date {
+  font-size: 26rpx;
+  font-weight: 400;
+  color: #999999;
+}
+.f-qrcode {
+  width: 80rpx;
+  height: 80rpx;
+  margin-left: 20rpx;
+}
+.qrcode-item {
+  width: 60rpx;
+  height: 60rpx;
+}
+.actions {
+  width: 690rpx;
+  height: 80rpx;
+  position: fixed;
+  bottom: 80rpx;
+  background-color: #f7f7f7;
+}
+.handle-btn {
+  width: 100%;
+  height: 80rpx;
+  border-radius: 10rpx;
+}
+.wrapper {
+  height: 100%;
+}
+.model {
+  width: 540rpx;
+  height: 280rpx;
+  background: #FFFFFF;
+  border-radius: 24rpx;
+}
+.top-title {
+  height: 190rpx;
+  border-bottom: 1rpx solid #DDDDDD;
+  box-sizing:border-box;
+  padding-top: 1rpx;
+}
+.main-title {
+  font-size: 34rpx;
+  font-weight: 600;
+  color: #333333;
+  text-align: center;
+  margin-top: 37rpx;
+}
+.sub-title {
+  font-size: 26rpx;
+  text-align: center;
+  font-weight: 400;
+  color: #333333;
+}
+.btn {
+  width: 270rpx;
+  height: 90rpx;
+  box-sizing: border-box;
+  font-size: 34rpx;
+  color: #333333;
+}
+.w-cancel-btn {
+  font-weight: 400;
+}
+.w-confirm-btn {
+  border-left: 1rpx solid #DDDDDD;
+  font-weight: 600;
+}