Quellcode durchsuchen

feat: 订单开始、订单结束接口对接

chenjj vor 1 Monat
Ursprung
Commit
5791afc48f
9 geänderte Dateien mit 463 neuen und 45 gelöschten Zeilen
  1. 17 0
      api/volunteer.js
  2. 7 0
      pages.json
  3. 7 6
      pages/classify.vue
  4. 1 1
      pages/mine.vue
  5. 184 0
      pages/myCenter/appeal.vue
  6. 181 3
      pages/myCenter/bad.vue
  7. 23 16
      pages/order/handle.vue
  8. 1 1
      pages/order/list/listItem.vue
  9. 42 18
      pages/order/order.vue

+ 17 - 0
api/volunteer.js

@@ -45,4 +45,21 @@ export function getVolunteerOrderInfo(data) {
         method: 'get',
         params: data
     })
+}
+
+
+//志愿者滑动,开始订单
+export function getTimesByDate(secondOrderId) {
+    return request({
+        url: `/core/volunteer/orders/getTimesByDate/${secondOrderId}`,
+        method: 'get',
+    })
+}
+//志愿者点击结束订单
+export function getVolunteerFinishSecondOrder(data) {
+    return request({
+        url: `/core/volunteer/orders/volunteerFinishSecondOrder`,
+        method: 'post',
+        data: data
+    })
 }

+ 7 - 0
pages.json

@@ -106,6 +106,13 @@
 			{
 				"navigationBarTitleText" : "差评申诉"
 			}
+		},
+		{
+			"path" : "pages/myCenter/appeal",
+			"style" : 
+			{
+				"navigationBarTitleText" : "申诉"
+			}
 		}
 	    
         // ,{

+ 7 - 6
pages/classify.vue

@@ -13,7 +13,6 @@
 				<img src="/static/empty/订单为空.png" alt="">
 			</view>
 		</view>
-
 	</view>
 </template>
 
@@ -90,15 +89,17 @@ async function getList() {
 function btnClick(row,type) {
 	console.log('btnClick', type, row);
 	if (type === 1) {
+		
 		uni.navigateTo({
-			url: `/pages/order/order?orderId=${row.secondOrderId}`
-		});
-		return
-	}
-	uni.navigateTo({
 			url: `/pages/order/handle?orderId=${row.secondOrderId}`
 		});
+		// uni.navigateTo({
+		// 	url: `/pages/order/order?orderId=${row.secondOrderId}`
+		// });
 
+		return
+	}
+	
 }
 provide('onClick', btnClick);
 

+ 1 - 1
pages/mine.vue

@@ -88,7 +88,7 @@ const serviceList = ref([
 	{
 		name: '差评申述',
 		iconName: 'edit-pen',
-		// page: '/pages/myCenter/bad'
+		page: '/pages/myCenter/bad'
 	},
 	{
 		name: '钱包',

+ 184 - 0
pages/myCenter/appeal.vue

@@ -0,0 +1,184 @@
+<template>
+    <view class="appeal-main">
+        <view v-for="item in list" :key="item.key" class="appeal-item">
+            <view class="appeal-user-box">
+                <view class="appeal-user">
+                    <up-avatar :src="item.avatar" shape="square"></up-avatar>
+                    <view class="user-name">{{ item.name }}</view>
+                </view>
+            </view>
+            <view class="appeal-text">
+                {{ item.value }}
+            </view>
+            <view class="appeal-image">
+                <view class="appeal-image-item" v-for="(baseListItem, baseListIndex) in [{}, {}, {}, {}, {}, {}, {}, {}]" :key="baseListIndex">
+                    1
+                </view>
+            </view>
+
+            <view class="appeal-order">
+                <view class="appeal-avatar">
+                    <up-avatar :src="item.avatar" shape="square"></up-avatar>
+                </view>
+                <view class="appeal-order-box">
+                    <view class="appeal-order-text">标题:订单</view>
+                    <view class="appeal-order-text">简介:订单详情撒大师大师的十大</view>
+                    <view class="appeal-order-text">价格:200</view>
+                </view>
+            </view>
+
+            <view class="appeal-text-box">
+                <view class="font-title">申诉内容</view>
+                <up-textarea v-model="textareaValue" placeholder="请输入申述内容" count ></up-textarea>
+            </view>
+
+    
+            
+
+            <view class="appeal-btn-box">
+                <up-button type="primary" text="提交申述" @click="onAppeal"></up-button>
+            </view>
+
+        </view>
+    </view>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+
+const list = [
+    {
+        name: '张三',
+        avatar: '/static/img/报事报修@6x.png',
+        status: 1,
+        key: 1,
+        value: '浔阳江头夜送客,枫叶荻花秋瑟瑟。主人下马客在船,举酒欲饮无管弦。醉不成欢惨将别,别时茫茫江浸月。',
+
+    }
+]
+
+const textareaValue = ref('');
+
+const load = () => {
+
+}
+
+const onAppeal = () => {
+   console.log('提交申述',textareaValue.value);
+   
+}
+
+</script>
+
+<style lang="scss" scoped>
+.appeal-main {
+    position: fixed;
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    bottom: 0px;
+    background: rgba(245, 245, 245, 1);
+    padding: 12px;
+    overflow: auto;
+
+    .appeal-item {
+        border-radius: 8px;
+        background: rgba(255, 255, 255, 1);
+        padding: 12px;
+        margin-bottom: 12px;
+
+        .appeal-user-box {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .appeal-user {
+                display: flex;
+                align-items: center;
+            }
+
+            .user-name {
+                margin-left: 8px;
+
+                font-size: 18px;
+                font-weight: 700;
+                line-height: 21.09px;
+                color: rgba(51, 51, 51, 1);
+                margin-left: 12px;
+            }
+
+            .appeal-status {
+                font-size: 14px;
+            }
+        }
+
+        .appeal-text {
+            font-size: 14px;
+            font-weight: 500;
+            line-height: 20.27px;
+            color: rgba(51, 51, 51, 1);
+            padding: 12px 0;
+        }
+
+        .appeal-image {
+            margin: 12px 0;
+            display: grid;
+            grid-template-columns: repeat(3, 1fr); // 4列布局
+            gap: 12px; // 网格间距
+
+            .appeal-image-item {
+                background: #f9f9f9;
+                height: 80px;
+                width: 100px;
+            }
+        }
+
+        .appeal-order {
+            border-radius: 8px;
+            background: #f9f9f9;
+            margin: 12px 0;
+            padding: 12px;
+
+            display: flex;
+            align-content: center;
+
+            .appeal-avatar {
+                margin-right: 12px;
+            }
+
+            .appeal-order-box {
+                flex: 1;
+
+                .appeal-order-text {
+                    font-size: 14px;
+                    font-weight: 500;
+                    line-height: 20.27px;
+                    color: rgba(153, 153, 153, 1);
+                }
+
+            }
+        }
+        .appeal-text-box {
+            margin: 12px 0;
+            .font-title {
+                margin-bottom: 12px;
+            }
+        }
+
+        .appeal-btn-box {
+            display: flex;
+            align-items: center;
+            justify-content: flex-end;
+
+            .appeal-btn {
+                color: rgba(255, 87, 4, 1);
+                font-size: 14px;
+                width: 100%;
+                height: 45px;
+                border-radius: 16px;
+                border: 1px solid rgba(255, 87, 4, 1);
+            }
+        }
+    }
+}
+</style>

+ 181 - 3
pages/myCenter/bad.vue

@@ -1,12 +1,73 @@
 <template>
     <view class="bad-main">
-       11
+        <view v-for="item in list" :key="item.key" class="bad-item">
+            <view class="bad-user-box">
+                <view class="bad-user">
+                    <up-avatar :src="item.avatar" shape="square"></up-avatar>
+                    <view class="user-name">{{ item.name }}</view>
+                </view>
+                <view class="bad-status">申述中</view>
+            </view>
+            <view class="bad-text">
+                {{ item.value }}
+            </view>
+            <view class="bad-image">
+                <view class="bad-image-item" v-for="(baseListItem, baseListIndex) in [{}, {}, {}, {}, {}, {}, {}, {}]" :key="baseListIndex">
+                    1
+                </view>
+            </view>
+
+            <view class="bad-order">
+                <view class="bad-avatar">
+                    <up-avatar :src="item.avatar" shape="square"></up-avatar>
+                </view>
+                <view class="bad-order-box">
+                    <view class="bad-order-text">标题:订单</view>
+                    <view class="bad-order-text">简介:订单详情撒大师大师的十大</view>
+                    <view class="bad-order-text">价格:200</view>
+                </view>
+            </view>
+
+            <view class="bad-status-box">
+                <up-icon name="checkmark-circle-fill" color="rgba(0, 168, 112, 1)" size="18"></up-icon>
+                <view class="bad-status-title">申述成功</view>
+                <view class="bad-status-text">改评价为非志愿者原因改评价为非志愿者原因改评价为非志愿者原因改评价为非志愿者原因</view>
+            </view>
+            
+
+            <view class="bad-btn-box">
+                <view class="bad-btn flex-center" @click="onAppeal(item)">申述</view>
+            </view>
+
+        </view>
     </view>
 </template>
 
 <script setup>
 import { ref } from 'vue';
 
+const list = [
+    {
+        name: '张三',
+        avatar: '/static/img/报事报修@6x.png',
+        status: 1,
+        key: 1,
+        value: '浔阳江头夜送客,枫叶荻花秋瑟瑟。主人下马客在船,举酒欲饮无管弦。醉不成欢惨将别,别时茫茫江浸月。',
+
+    }
+]
+
+
+const load = () => {
+
+}
+
+const onAppeal = (record) => {
+    uni.navigateTo({
+        url: `/pages/myCenter/appeal?id=${record.key}`
+    })
+}
+
 </script>
 
 <style lang="scss" scoped>
@@ -16,7 +77,124 @@ import { ref } from 'vue';
     left: 0px;
     right: 0px;
     bottom: 0px;
-    background-color: #fff;
-    padding: 0 12px;
+    background: rgba(245, 245, 245, 1);
+    padding: 12px;
+    overflow: auto;
+
+    .bad-item {
+        border-radius: 8px;
+        background: rgba(255, 255, 255, 1);
+        padding: 12px;
+        margin-bottom: 12px;
+
+        .bad-user-box {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .bad-user {
+                display: flex;
+                align-items: center;
+            }
+
+            .user-name {
+                margin-left: 8px;
+
+                font-size: 18px;
+                font-weight: 700;
+                line-height: 21.09px;
+                color: rgba(51, 51, 51, 1);
+                margin-left: 12px;
+            }
+
+            .bad-status {
+                font-size: 14px;
+            }
+        }
+
+        .bad-text {
+            font-size: 14px;
+            font-weight: 500;
+            line-height: 20.27px;
+            color: rgba(51, 51, 51, 1);
+            padding: 12px 0;
+        }
+
+        .bad-image {
+            margin: 12px 0;
+            display: grid;
+            grid-template-columns: repeat(3, 1fr); // 4列布局
+            gap: 12px; // 网格间距
+
+            .bad-image-item {
+                background: #f9f9f9;
+                height: 80px;
+                width: 100px;
+            }
+        }
+
+        .bad-order {
+            border-radius: 8px;
+            background: #f9f9f9;
+            margin: 12px 0;
+            padding: 12px;
+
+            display: flex;
+            align-content: center;
+
+            .bad-avatar {
+                margin-right: 12px;
+            }
+
+            .bad-order-box {
+                flex: 1;
+
+                .bad-order-text {
+                    font-size: 14px;
+                    font-weight: 500;
+                    line-height: 20.27px;
+                    color: rgba(153, 153, 153, 1);
+                }
+
+            }
+        }
+        .bad-status-box {
+            border-radius: 8px;
+            background: #e5fff6;
+            margin: 12px 0;
+            padding: 18px 12px;
+            display: flex;
+            align-items: center;
+            .bad-status-title{
+                margin-left: 8px;
+                font-size: 14px;
+                font-weight: 500;
+                color: rgba(0, 168, 112, 1);
+            }
+            .bad-status-text {
+                margin-left: 12px;
+                font-size: 12px;
+                font-weight: 500;
+                line-height: 17.38px;
+                flex: 1;
+            }
+
+        }
+
+        .bad-btn-box {
+            display: flex;
+            align-items: center;
+            justify-content: flex-end;
+
+            .bad-btn {
+                color: rgba(255, 87, 4, 1);
+                font-size: 14px;
+                width: 72px;
+                height: 31px;
+                border-radius: 16px;
+                border: 1px solid rgba(255, 87, 4, 1);
+            }
+        }
+    }
 }
 </style>

+ 23 - 16
pages/order/handle.vue

@@ -25,7 +25,7 @@
 <script setup>
 import { ref } from 'vue';
 import { onLoad } from '@dcloudio/uni-app';
-import { getVolunteerOrderInfo } from '@/api/volunteer.js'
+import { getVolunteerOrderInfo,getTimesByDate, } from '@/api/volunteer.js'
 import { getAddress } from '@/api/address.js'
 import PositioningMap from '@/components//PositioningMap/index.vue'
 import Slide from '@/components/Slide/index.vue'
@@ -58,12 +58,19 @@ const getOrderDetail = async () => {
         });
         const res = await getVolunteerOrderInfo({ orderId: orderId.value });
         const ad_res = await getAddress(res.data.addressId);
-        detaile.value = {
-            ...res.data,
-            address: ad_res.data.address,
-            name: ad_res.data.name,
-            telephone: ad_res.data.telephone
-        };
+
+        let data = res.data;
+        if (ad_res.data) {
+            data = {
+                ...data,
+                address: ad_res.data.address,
+                name: ad_res.data.name,
+                telephone: ad_res.data.telephone
+            }
+        }
+        detaile.value = data;
+        console.log('xxxx', detaile.value);
+
     } catch (error) {
         console.log('error', error);
         uni.showToast({
@@ -80,21 +87,21 @@ const change = (e) => {
     console.log('验证是否成功:' + e.state)
     console.log('验证次数:' + e.verification)
     if (e.state && !orderStatus.value) {
-        setTimeout(() => {
-            verify.value.initialization();
-            // 验证成功
-            orderStatus.value = true;
-        }, 1000)
+
+        getTimesByDate(orderId.value).then(res =>{
+            if(res.code === 200){
+                verify.value.initialization();
+                // 验证成功
+                orderStatus.value = true;
+            }
+        })
+
     }
     if (e.state && orderStatus.value) {
         console.log('完成任务')
         uni.redirectTo({ url: `/pages/order/order?orderId=${orderId.value}` });
     }
 }
-const onSubmit = () => {
-    console.log('submit', fileList.value);
-
-}
 
 onLoad((options) => {
     console.log('options', options);

+ 1 - 1
pages/order/list/listItem.vue

@@ -20,7 +20,7 @@
                 <view class="item-btns">
                     <up-button type="error" text="查看" size="mini" :custom-style="btn_style"
                         @click="onClick(1)"></up-button>
-                   <up-button type="error" text="沟通" size="mini" :custom-style="btn_style" @click="onClick(2)"></up-button>
+                   <!-- <up-button type="error" text="沟通" size="mini" :custom-style="btn_style" @click="onClick(2)"></up-button> -->
                          <!-- <up-button type="error" text="上传照片" size="mini" :custom-style="btn_style" @click="onClick(3)"></up-button> -->
                 </view>
             </view>

+ 42 - 18
pages/order/order.vue

@@ -38,15 +38,15 @@
 </template>
 
 <script setup>
-import { ref } from 'vue';
+import { ref, toRaw } from 'vue';
 import { onLoad } from '@dcloudio/uni-app';
-import { getVolunteerOrderInfo } from '@/api/volunteer.js'
+import { getVolunteerOrderInfo, getVolunteerFinishSecondOrder } from '@/api/volunteer.js'
 import { getAddress } from '@/api/address.js'
 
 import { wxUploadFile, wxMakePhoneCall } from '@/utils/wxRequest.js'
 
 const fileList = ref([]);
-const orderId  =ref('');
+const orderId = ref('');
 const detaile = ref({});
 
 // 删除图片
@@ -57,26 +57,32 @@ const deletePic = (index) => {
 
 const uploadClick = async (type) => {
 	const res = await wxUploadFile(type);
-	fileList.value = [...fileList.value, res];
-	console.log('文件上传', res);
+	fileList.value = [...fileList.value, ...res];
+	console.log('xxxxres', res, fileList.value);
 }
-const onPhone=(phone)=>{
+const onPhone = (phone) => {
 	wxMakePhoneCall(phone)
 }
 
-const getOrderDetail = async() => {
+const getOrderDetail = async () => {
 	try {
 		uni.showLoading({
 			title: '数据加载中...'
 		});
-		const res = await getVolunteerOrderInfo({orderId: orderId.value});
+		const res = await getVolunteerOrderInfo({ orderId: orderId.value });
 		const ad_res = await getAddress(res.data.addressId);
-		detaile.value = {
-			...res.data,
-			address:ad_res.data.address,
-			name:ad_res.data.name,
-			telephone:ad_res.data.telephone
-		};
+		let data = res.data;
+		if (ad_res.data) {
+			data = {
+				...data,
+				address: ad_res.data.address,
+				name: ad_res.data.name,
+				telephone: ad_res.data.telephone
+			}
+		}
+		detaile.value = data;
+		console.log('detaile.value', detaile.value);
+
 	} catch (error) {
 		console.log('error', error);
 		uni.showToast({
@@ -89,13 +95,30 @@ const getOrderDetail = async() => {
 }
 
 const onSubmit = () => {
-	console.log('submit',fileList.value);
-	
+	const  img_urls = fileList.value.map(item => item.url).join(',');
+	console.log('submit', fileList.value,img_urls);
+
+	getVolunteerFinishSecondOrder({
+		secondOrderId:orderId.value,
+		serviceLog:img_urls,
+		volunteerId: detaile.value.volunteerId
+	}).then(res=> {
+		if(res.code === 200){
+			uni.switchTab({
+			url: '/pages/classify'
+		});	
+		}
+
+	})
+
 }
 
 onLoad((options) => {
-	console.log('options',options);
-	orderId.value = options.orderId;
+	console.log('options', options);
+	// orderId.value = options.orderId;
+	orderId.value = '1911685346559660034';
+
+	
 	getOrderDetail();
 
 })
@@ -196,6 +219,7 @@ onLoad((options) => {
 			}
 		}
 	}
+
 	.phone {
 		color: #3c9cff;
 	}