Quellcode durchsuchen

审核通过/审核拒绝样式 无功能和权限判断

XuZinan vor 3 Jahren
Ursprung
Commit
b532a3cd12
1 geänderte Dateien mit 42 neuen und 1 gelöschten Zeilen
  1. 42 1
      pages/Project/detail.vue

+ 42 - 1
pages/Project/detail.vue

@@ -51,17 +51,43 @@
         </span>
       </view>
     </view>
+
+    <view class="group">
+      <button
+        v-if="canAuth()"
+        @click="onHandleAudit(1)"
+        type="primary"
+        class="commit"
+      >
+        审核通过
+      </button>
+      <button v-if="canAuth()" @click="onHandleAudit(0)" class="commit">
+        审核拒绝
+      </button>
+    </view>
   </view>
 </template>
 
 <script>
 import { mapState } from "vuex";
 export default {
+  data() {
+    return { auth: false };
+  },
   computed: {
     ...mapState(["currentProject"]),
   },
   onLoad(options) {
-    options.auth;
+    this.auth = Boolean(options.auth);
+  },
+  methods: {
+    canAuth() {
+      return this.auth;
+    },
+    onHandleAudit(value) {
+      if (value) console.log("审核通过");
+      else console.log("审核拒绝");
+    },
   },
 };
 </script>
@@ -94,4 +120,19 @@ export default {
     width: 70%;
   }
 }
+
+.group {
+  width: 100%;
+  display: flex;
+  position: fixed;
+  flex-wrap: wrap;
+  justify-content: flex-start;
+  bottom: 0;
+  left: 0;
+  .commit {
+    width: 50%;
+    border-radius: 0;
+    margin: inherit;
+  }
+}
 </style>