xiaohaizhao hai 6 meses
pai
achega
6c66011f02
Modificáronse 6 ficheiros con 191 adicións e 1 borrados
  1. 1 1
      manifest.json
  2. 3 0
      pages.json
  3. 5 0
      pages/index/home.vue
  4. 1 0
      pages/workOrder/detail.vue
  5. 181 0
      pages/workOrder/snatchingOrders.vue
  6. BIN=BIN
      static/image/logo1.png

+ 1 - 1
manifest.json

@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxe89d8c8225f75d79",
+        "appid" : "wxaae80a5bab4652f8",
         "mergeVirtualHostAttributes" : true,
         "setting" : {
             "urlCheck" : false,

+ 3 - 0
pages.json

@@ -18,6 +18,9 @@
 		{
 			"path": "pages/workOrder/index"
 		},
+		{
+			"path": "pages/workOrder/snatchingOrders"
+		},
 		{
 			"path": "pages/workOrder/detail",
 			"style": {

+ 5 - 0
pages/index/home.vue

@@ -124,6 +124,11 @@ function onClickSwiper(e) {
 	}
 }
 const itemList = ref([{
+	label: '抢单中心',
+	icon: '/static/image/djd.png',
+	text: "专业守护",
+	path: "/pages/workOrder/snatchingOrders",
+},{
 	label: '待接单',
 	icon: '/static/image/djd.png',
 	text: "故障维修排除",

+ 1 - 0
pages/workOrder/detail.vue

@@ -414,6 +414,7 @@ defineExpose({ detail })
             box-sizing: border-box;
             flex-shrink: 0;
             margin-right: 30rpx;
+            white-space: nowrap;
         }
 
         .label::after {

+ 181 - 0
pages/workOrder/snatchingOrders.vue

@@ -0,0 +1,181 @@
+<template>
+    <My_listbox ref="listBox" :empty="!list.length" @getlist="getList">
+        <view style="height: 18rpx;" />
+        <navigator class="item" v-for="item in list" :key="item.sa_workorderid"
+            :url="'/pages/workOrder/detail?id=' + item.sa_workorderid" hover-class="navigator-hover">
+            <view class="head">
+                <view class="tag"
+                    :style="{ 'background': { '安装': '#70B603', '维修': '#D9001B', '清洁': '#3874F6', '清洗': '#3874F6' }[item.type] || '#999999' }">
+                    {{ item.type }}
+                </view>
+                <view class="time">
+                    {{ item.createdate }}
+                </view>
+            </view>
+            <view class="address">
+                {{ item.address }}
+            </view>
+            <view class="user">
+                {{ item.customername + ' ' + item.customerphonenumber }}
+            </view>
+            <view v-if="content.where.status != '已完结'" class="but-box" @click.stop>
+                <view class="but-box-item" @click="openModel(item)">
+                    <My-button :customStyle="{
+                        height: '70rpx',
+                    }" frontIcon="icon-jiedan" text="抢单" />
+                </view>
+            </view>
+        </navigator>
+    </My_listbox>
+
+    <up-modal negativeTop="100" :show="takeOrderShow" title="是否确认抢单?" showCancelButton @confirm="takeOrders"
+        @cancel="takeOrderShow = false" ref="uModal" :asyncClose="true"></up-modal>
+</template>
+
+<script setup>
+import { ref, reactive, getCurrentInstance } from 'vue';
+const { $Http } = getCurrentInstance().proxy;
+import { onLoad, onShow } from '@dcloudio/uni-app';
+
+const listBox = ref(null);
+const content = reactive({
+    loading: false,
+    isadmin: 0,
+    "pageNumber": 1,
+    "pageSize": 20,
+    "where": {
+        // ispublic: 1,
+        "status": '进行中',
+        "condition": ""
+    }
+});
+const list = ref([])
+
+onLoad((options) => {
+    getList();
+});
+
+onShow(() => {
+    if (content.pageNumber != 1) $Http.updateList(content, getList)
+})
+
+function getList(init = false) {
+    if (content.loading) return;
+    if (init) content.pageNumber = 1;
+    content.loading = true;
+    $Http.basic({
+        "id": "20230208140203",
+        content
+    }).then(res => {
+        console.log("获取列表", res)
+        content.loading = false;
+        listBox.value.refreshToComplete();
+        listBox.value.setHeight();
+        if (res.code == 1) {
+            list.value = reactive(res.firstPage ? res.data : list.value.concat(res.data));
+            content.pageTotal = res.pageTotal;
+            content.pageNumber = res.pageNumber;
+        } else {
+            if (res.msg) uni.showToast({
+                title: res.msg,
+                icon: 'none'
+            });
+        }
+    })
+}
+
+let takeOrderShow = ref(false);
+let takeItem = null;
+
+function openModel(item) {
+    takeItem = item;
+    takeOrderShow.value = true;
+}
+
+function takeOrders() {
+    $Http.basic({
+        id: 20230210101103,
+        "content": {
+            "sa_workorderid": takeItem.sa_workorderid
+        }
+    }).then(res => {
+        console.log("接单结果", res)
+        if (res.code == 1) {
+            takeOrderShow.value = false;
+            uni.navigateTo({
+                url: '/pages/workOrder/detail?id=' + takeItem.sa_workorderid,
+                success: (result) => {
+                    uni.showToast({
+                        title: '接单成功',
+                        icon: 'none'
+                    });
+                },
+            })
+            $Http.updateList(content, getList)
+        } else {
+            if (res.msg) uni.showToast({
+                title: res.msg,
+                icon: 'none'
+            });
+        }
+    })
+}
+
+</script>
+
+<style lang="scss" scoped>
+.item {
+    width: 690rpx;
+    background: #FFFFFF;
+    box-shadow: 0rpx 4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    margin: 0 auto 20rpx;
+    padding: 20rpx 40rpx;
+    box-sizing: border-box;
+
+    .head {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+
+        .tag {
+            font-family: PingFang SC, PingFang SC;
+            font-size: 24rpx;
+            color: #FFFFFF;
+            padding: 8rpx 20rpx;
+        }
+
+        .time {
+            font-family: Microsoft YaHei, Microsoft YaHei;
+            font-size: 24rpx;
+            color: #999999;
+        }
+    }
+
+    .address {
+        line-height: 38rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 28rpx;
+        color: #333333;
+        margin-top: 20rpx;
+    }
+
+    .user {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+        margin-top: 20rpx;
+    }
+
+    .but-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-around;
+        margin-top: 20rpx;
+
+        .but-box-item {
+            width: 40%;
+        }
+    }
+}
+</style>

BIN=BIN
static/image/logo1.png