DESKTOP-70VPDLK\Administrator 1 жил өмнө
parent
commit
8cd9ca5f26
2 өөрчлөгдсөн 101 нэмэгдсэн , 24 устгасан
  1. 72 24
      page_task/draft/index.vue
  2. 29 0
      qodana.yaml

+ 72 - 24
page_task/draft/index.vue

@@ -1,33 +1,34 @@
 <template>
   <view class="total-page page-box page-env-20 scroll_content task-bg">
-    <Nav :title="'任务'" :genre="1" :back="false" is_fixed></Nav>
+    <Nav :title="'草稿箱'" :genre="1" :back="true" is_fixed></Nav>
     <view>
       <Search :placeholder="'客户姓名或电话'"></Search>
 
     </view>
     <EnScroll ref="scroll" :navHeight="105" is_tabHeight @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
-      <view class="draft-item r-40 sys-background-fff">
+      <view class="draft-item r-40 sys-background-fff" v-for="item in  list">
         <view class="item-left">
           <view class="left-top left-item">
-            <view class="top-name sys-weight-600 size-30 text-color-12">张三</view>
-            <view class="top-product sys-weight-400 size-24 text-color-009 r-10">中油消费</view>
+            <view class="top-name sys-weight-600 size-30 text-color-12">{{item.name}}</view>
+            <view class="top-product sys-weight-400 size-24 text-color-009 r-10">{{item.product_name}}</view>
           </view>
           <view class="left-content left-item">
             <view class="sys-weight-400 size-24 text-color-12">身份证:</view>
-            <view class="sys-weight-600 sys-size-28 text-color-12">中油消费</view>
+            <view class="sys-weight-600 sys-size-28 text-color-12">{{item.id_number}}</view>
           </view>
           <view class="left-bottom left-item">
-            <view class=" size-24 text-color-999">身份证:</view>
-            <view class=" size-24 text-color-999">中油消费</view>
+            <view class=" size-24 text-color-999">保存时间:</view>
+            <view class=" size-24 text-color-999">{{item.created_at}}</view>
           </view>
 
         </view>
         <view class="item-right">
-          <view class="but-item but-edit size-28 sys-weight-500 text-color-fff button-background">编辑</view>
+          <view class="but-item but-edit size-28 sys-weight-500 text-color-fff button-background sys-radius-100">编辑</view>
           <view class="but-item but-del  size-28 sys-weight-500 text-color-666 ">删除</view>
         </view>
 
       </view>
+      <en-blank v-if="list.length<=0"></en-blank>
 
     </EnScroll>
   </view>
@@ -35,12 +36,69 @@
 
 <script>
 
+import {getDraftList} from "@/api/task";
+import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
+
 export default {
-  components: {},
+  components: {EnBlank},
   data() {
-    return {};
+    return {
+      list: [],
+      page: 1,
+      total: null,
+      isAjax: false,
+    };
+  },
+  mounted(){
+    uni.$on('setNewDraft',()=>{
+      if(this.$refs.draftRef){
+        this.startList()
+      }
+    })
+    this.startList()
   },
   methods: {
+    startList() {
+      this.total = 999;
+      this.list = [];
+      this.page = 1;
+      this.isAjax = false;
+      this.getDraftList();
+
+    },
+    delDraft(draftId,index){
+      uni.showModal({
+        title: '警告',
+        content: '是否删除当前草稿!',
+        success:  (res) =>{
+          if (res.confirm) {
+            delDraft({'draftId':draftId}).then((res)=>{
+              this.$refs.draftRef.list.splice(index,1)
+            })
+          }
+        }
+      });
+
+    },
+    editDraft(id){
+      // uni.navigateTo({
+      //   url: '/pages-task/add-client/new-add?draftId='+id
+      // });
+    },
+    getDraftList(){
+      if (this.isAjax || (this.total <= this.list.length)) {
+        return;
+      }
+      this.isAjax = true;
+      getDraftList({'page':this.page}).then((res)=>{
+        if(res.code===1){
+          this.list.push(...res.data.items)
+          this.total = res.data.total
+          this.isAjax = false
+          ++this.page;
+        }
+      })
+    },
     // 下拉刷新
     onRefresh() {
       // uni.showLoading({
@@ -58,20 +116,9 @@ export default {
     },
     // 滚动到底部
     onScrollBottom() {
-      // uni.showLoading({
-      // 	title: '数据加载中'
-      // })
-      if (this.current === 1) {
-        this.getDayBacklogList()
-      } else {
-        this.getTaskReceiving();
-      }
-      // setTimeout(() => {
-      // 	uni.showToast({
-      // 		title: '加载完成',
-      // 		icon: 'none'
-      // 	})
-      // }, 1000)
+
+      this.getDraftList();
+
       console.log("到底部了");
     },
   },
@@ -80,6 +127,7 @@ export default {
 
 <style lang="scss">
 .draft-item{
+  margin: 20rpx 32rpx 0;
   padding: 25rpx 30rpx;
   display: flex;
   justify-content: space-between;

+ 29 - 0
qodana.yaml

@@ -0,0 +1,29 @@
+#-------------------------------------------------------------------------------#
+#               Qodana analysis is configured by qodana.yaml file               #
+#             https://www.jetbrains.com/help/qodana/qodana-yaml.html            #
+#-------------------------------------------------------------------------------#
+version: "1.0"
+
+#Specify inspection profile for code analysis
+profile:
+  name: qodana.starter
+
+#Enable inspections
+#include:
+#  - name: <SomeEnabledInspectionId>
+
+#Disable inspections
+#exclude:
+#  - name: <SomeDisabledInspectionId>
+#    paths:
+#      - <path/where/not/run/inspection>
+
+#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
+#bootstrap: sh ./prepare-qodana.sh
+
+#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
+#plugins:
+#  - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
+
+#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
+linter: jetbrains/qodana-js:latest