ZaiZai 1 year ago
parent
commit
00eb7e7c75
4 changed files with 87 additions and 1 deletions
  1. 7 0
      pages.json
  2. 70 0
      pages/work-order/add.vue
  3. 6 1
      pages/work-order/index.vue
  4. 4 0
      style/work-order/index.scss

+ 7 - 0
pages.json

@@ -157,6 +157,13 @@
             "style": {
                 "navigationBarTitleText": "消息动态圈"
             }
+        },
+        {
+            "path": "pages/work-order/add",
+            "style": {
+                "navigationBarTitleText": "发起工单动态",
+                "navigationStyle": "default"
+            }
         }
     ],
     "globalStyle": {

+ 70 - 0
pages/work-order/add.vue

@@ -0,0 +1,70 @@
+<template>
+    <hc-sys class="hc-add-work-order-page" :isNavBar="false">
+        <uni-section title="请选择您需要反馈的问题类型" type="line" class="mt-0.5">
+            <view class="p-3 pt-0" v-if="typeData.length > 0">
+                <uni-segmented-control :current="typeKey" :values="typeData" @clickItem="typeItemChange" />
+            </view>
+        </uni-section>
+
+        <!--底部操作栏-->
+        <HcTabbarBlock :height="70"/>
+        <hc-tabbars class="flex items-center">
+            <button hover-class="none" class="cu-btn flex-1 bg-blue-5 text-white">提交工单</button>
+        </hc-tabbars>
+    </hc-sys>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import mainApi from '~api/other/work-order';
+import {onLoad} from '@dcloudio/uni-app'
+import {errorToast, successToast} from "@/utils/tools";
+import {getArrValue, getObjValue} from "js-fast-way";
+import {useAppStore} from "@/store";
+
+//初始变量
+const store = useAppStore()
+const projectId = ref(store.projectId);
+const contractId = ref(store.contractId);
+
+onLoad(() => {
+    queryDictBizList()
+})
+
+//获取字典信息
+const typeDataBiz = ref([])
+const queryDictBizList = async () => {
+    const {error, code, data} = await mainApi.queryDictBizList()
+    if (!error && code === 200) {
+        let newArr = [], arr = getArrValue(data);
+        for (let i = 0; i < arr.length; i++) {
+            newArr.push(arr[i].dictValue)
+        }
+        typeKey.value = 0
+        typeData.value = newArr
+        typeDataBiz.value = arr
+    } else {
+        typeKey.value = 0
+        typeData.value = []
+        typeDataBiz.value = []
+    }
+    console.log(typeData.value)
+}
+
+//问题类型
+const typeKey = ref(0)
+const typeData = ref([])
+const typeItemChange = ({currentIndex}) => {
+    typeKey.value = currentIndex
+}
+</script>
+
+<style lang="scss" scoped>
+page {
+    background: #EFEFF4;
+}
+</style>
+
+<style lang="scss">
+@import "@/style/work-order/index.scss";
+</style>

+ 6 - 1
pages/work-order/index.vue

@@ -2,7 +2,7 @@
     <hc-sys id="app-sys" class="hc-work-order-page" navBarUi='work-order-nav-bar'>
         <template #navBar>
             <hc-nav-back-bar ui='work-order-nav' title="消息动态圈">
-                <text class="i-ri-add-circle-fill text-40 mr-1"/>
+                <text class="i-ri-add-circle-fill text-40 mr-1" @click="toPageClick('/pages/work-order/add')"/>
                 <text class="i-ri-message-3-fill text-40 ml-2"/>
             </hc-nav-back-bar>
         </template>
@@ -228,6 +228,11 @@ const goodLikeClick = async (item) => {
         }
     }
 }
+
+//跳转到其他页面
+const toPageClick = (url) => {
+    uni.navigateTo({url: url});
+}
 </script>
 
 <style lang="scss">

+ 4 - 0
style/work-order/index.scss

@@ -31,3 +31,7 @@
         border-radius: 6rpx;
     }
 }
+
+.hc-add-work-order-page {
+
+}