Ver código fonte

用户列表

chenjj 1 semana atrás
pai
commit
16bb7b789a

+ 2 - 2
config.js

@@ -2,9 +2,9 @@
 const config = {
 	// baseUrl: 'https://vue.ruoyi.vip/prod-api',
 	//cloud后台网关地址
-	baseUrl: 'http://192.168.100.95:9527',//嵘哥
+	// baseUrl: 'http://192.168.100.95:9527',//嵘哥
 	// baseUrl: 'http://192.168.100.121:9527',//龙哥
-	// baseUrl: 'https://zybooks.tech/prod-api',
+	baseUrl: 'https://zybooks.tech/prod-api',
 	mapKey:'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
 	appName: '金邻助家',
 	// 应用信息

+ 64 - 22
pages/classify.vue

@@ -1,7 +1,8 @@
 <template>
   <view>
     <!-- 志愿者 -->
-    <view class="classify-main" v-if="userType == '2'">
+    <!-- v-if="userType == '2'" -->
+    <view class="classify-main" >
       <up-tabs
         :list="column"
         :scrollable="false"
@@ -12,30 +13,30 @@
           transform: 'scale(1.05)',
         }"
         lineColor="rgba(221, 94, 69, 1)"
-        :current="tabKey"
+        v-model:current="tabKey"
       >
       </up-tabs>
       <view class="list">
-        <List :data="data" v-if="data.length > 0" />
+        <List :data="data" v-if="data.length > 0" @refresh="getList" ref="listRef"/>
         <view v-else>
           <NoneView value="您还没有相关订单" />
         </view>
       </view>
     </view>
     <!-- 用户 -->
-    <OrderList
+    <!-- <OrderList
       :dataList="dataList"
       :dictSort="dictData"
       @fetchData="getListData"
       v-else
-    />
+    /> -->
 
     <custom-tab-bar :page="2" />
   </view>
 </template>
 
 <script setup>
-import { ref } from 'vue'
+import { ref,computed } from 'vue'
 import List from '@/pages/common/orderList/index.vue'
 import { provide } from 'vue'
 import { getVolunteerOrderList } from '@/api/volunteer.js'
@@ -66,10 +67,11 @@ const dataList = ref([]) //用户
 const data = ref([]) //志愿者
 // 定义存储字典数据的响应式变量
 const dictData = ref([])
+const listRef =ref(null)
 /**
  * 	0待支付 1已支付 2支付超时或取消 3进行中 4已完成 5申请退款中 6已退款 7部分退款 8 待确认
  */
-const column = [
+const admin = [
   {
     name: '全部',
     value: '',
@@ -91,6 +93,36 @@ const column = [
     value: '2',
   },
 ]
+const user = [
+{
+			name: "全部",
+			value: "",
+		},
+		{
+			name: "待支付",
+			value: "0",
+		},
+		{
+			name: "待服务",
+			value: "1",
+		},
+		{
+			name: "进行中",
+			value: "3",
+		},
+		{
+			name: "已完成",
+			value: "4",
+		},
+		{
+			name: "售后",
+			value: ['2','5','6','7'],
+		}
+]
+
+const column = computed(() => {
+  return userType === 1 ? user : admin
+})
 
 //获取用户订单列表状态
 async function getData() {
@@ -109,23 +141,32 @@ async function getData() {
 
 async function getList() {
   try {
-    uni.hideLoading()
     uni.showLoading({
       title: '数据加载中...',
     })
 
+    const listApi = userType === 1 ? userMainOrderList : getVolunteerOrderList
+
+    const res = await listApi({
+      orderStatus: tab.value,
+    })
+    data.value = res.data
+
     // 判断 userType 来决定调用哪个接口
-    let res
-    if (userType === 1) {
-      // 如果 userType 是 1,调用 userMainOrderList 接口
-      res = await getListData()
-    } else if (userType === 2) {
-      // 如果 userType 是 2,调用 getVolunteerOrderList 接口
-      res = await getVolunteerOrderList({
-        orderStatus: tab.value,
-      })
-      data.value = res.data
-    }
+    // let res
+    // if (userType === 1) {
+    //   // 如果 userType 是 1,调用 userMainOrderList 接口
+    //   // res = await getListData()
+    //    res = await userMainOrderList({
+    //     orderStatus:  tab.value
+    //   })
+    // } else if (userType === 2) {
+    //   // 如果 userType 是 2,调用 getVolunteerOrderList 接口
+    //   res = await getVolunteerOrderList({
+    //     orderStatus: tab.value,
+    //   })
+    // }
+    // data.value = res.data
   } catch (error) {
     console.log('error', error)
     uni.showToast({
@@ -133,6 +174,9 @@ async function getList() {
       icon: 'error',
     })
   } finally {
+    if(listRef.value && listRef.value.handleRefreshing){
+      listRef.value.handleRefreshing(false)
+    }
     uni.hideLoading()
   }
 }
@@ -171,9 +215,6 @@ function btnClick(row, type) {
       url: `/pages_classify/pages/handle/index?orderId=${row.secondOrderId}`,
     })
     return
-    console.log('res==>', res)
-
-    data.value = res.data
   }
 
   //前往沟通
@@ -214,6 +255,7 @@ onShow(() => {
     bottom: 150rpx;
     left: 0px;
     right: 0px;
+    background: rgba(245, 245, 245, 1);
   }
 }
 </style>

+ 2 - 1
pages/common/classify/orderlist.vue

@@ -72,7 +72,8 @@
 	// 用户/志愿者 识别标识
 	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
 	const orderStatus = ref(0)
-	const column2 = [{
+	const column2 = [
+		{
 			name: "全部",
 			value: "",
 		},

+ 35 - 18
pages/common/orderList/index.vue

@@ -1,23 +1,20 @@
 <template>
-    <view class="list-page">
-        <up-list @scrolltolower="scrolltolower" style="height: 100%;">
-            <up-list-item v-for="(item, index) in data" :key="index" >
-                <ListItem :data="item" />
-            </up-list-item>
-            <up-loadmore
-					:line="true"
-					status="nomore"
-				></up-loadmore>
-        </up-list>
-
-    
-      
-    </view>
+    <scroll-view refresher-enabled :refresher-triggered="isRefreshing" @refresherrefresh="onCustomRefresh"
+        class="scroll-view-class" scroll-y>
+        <view class="list-page">
+            <view v-for="(item, index) in data" :key="index">
+                    <ListItem :data="item" v-if="userType === 2"/>
+                    <UserItem :data="item" v-else/>
+                </view>
+                <up-loadmore :line="true" status="nomore"></up-loadmore>
+        </view>
+    </scroll-view>
 </template>
 
 <script setup>
 import ListItem from './listItem.vue';
-
+import UserItem from './userItem.vue';
+import { ref, defineExpose, defineProps, defineEmits } from 'vue';
 
 const props = defineProps({
     data: {
@@ -26,11 +23,13 @@ const props = defineProps({
     },
     type: {
         type: String,
-        default: 'ordinary' , // ordinary: 普通 ranking: 排行
+        default: 'ordinary', // ordinary: 普通 ranking: 排行
     }
 });
 
 const emit = defineEmits(['refresh']);
+const userType = uni.getStorageSync('userType') //读取本地存储
+const isRefreshing = ref(false)
 
 
 const scrolltolower = () => {
@@ -38,6 +37,19 @@ const scrolltolower = () => {
     // emit('refresh');
 };
 
+const onCustomRefresh = () => {
+    console.log('下拉刷新');
+    isRefreshing.value = true;
+    emit('refresh');
+};
+
+const handleRefreshing = (status) => {
+    isRefreshing.value = status;
+}
+defineExpose({
+    handleRefreshing
+});
+
 </script>
 
 <style lang="scss" scoped>
@@ -45,8 +57,9 @@ const scrolltolower = () => {
 
     background: rgba(245, 245, 245, 1);
     padding: 12px;
-    height: 100%;
-    overflow-y: auto;
+    // height: 100%;
+    // overflow-y: auto;
+
     .item {
         height: 120px;
         border-radius: 10px;
@@ -54,4 +67,8 @@ const scrolltolower = () => {
         padding: 12px;
     }
 }
+
+.scroll-view-class {
+    height: 100%;
+}
 </style>

+ 223 - 0
pages/common/orderList/userItem.vue

@@ -0,0 +1,223 @@
+<template>
+    <view class="item">
+        <view class="item-img">
+            <up-image :show-loading="true" :src="data.volunteerPicture" width="112rpx" height="112rpx"></up-image>
+        </view>
+        <view class="item-info">
+            <view class="item-title-box">
+                <view class="item-title">
+                    <view class="item-name">
+                        姓名:{{ data.name }}
+                    </view>
+                    <dict-tag :options="order_status" :value="String(data.orderStatus)" />
+                </view>
+                <view class="item-de">
+                    类别:{{data.businessTierName}}
+                </view>
+                <view class="item-time skill-description">
+                    技能介绍:{{ data.skillDescribe }}
+                </view>
+            </view>
+            <view class="item-box">
+                <view class="item-btns">
+                    <view v-for="item in btns" :key="item.name">
+                        <view class="btn-m" v-if="item.show ? item.show(data) : true" :type="item.type" text="取消"
+                            @click="item.onClick(data)">
+                            {{item.name}}
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script setup>
+import { inject } from 'vue';
+import DictTag from '@/components/DictTag/index.vue'
+
+const props = defineProps({
+    data: {
+        type: Object,
+        default: () => {
+            return {}
+        }
+    },
+});
+console.log('datadata', props.data);
+
+
+const order_status = inject('order_status');
+
+const btns = [
+    {
+        name: '沟通',
+        onClick: () => { },
+        type: 'primary'
+    },
+    {
+        name: '退款',
+        onClick: (e)=>handleRefund(e),
+        show: (item) => ['3'].includes(item.orderStatus),
+        type: 'error'
+    },
+    {
+        name: '取消',
+        onClick: (e)=>handleCancel(e),
+        show: (item) => ['1'].includes(item.orderStatus),
+        type: 'warning'
+    },
+    {
+        name: '查看',
+        onClick: (e)=>handlClick(e),
+        show: (item) => item.orderStatus !== '1',
+        type: 'info'
+    },
+]
+
+//申请退款 
+const handleRefund = (item) => {
+    const mainOrderId = item.mainOrderId; // 获取详情id
+    uni.navigateTo({
+        url: `/pages_classify/pages/requestaRefund/requestaRefund?mainOrderId=${mainOrderId}`
+    });
+};
+// 取消订单
+const handleCancel = (item) => {
+    const mainOrderId = item.mainOrderId;
+    uni.navigateTo({
+        url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
+    });
+};
+//查看
+const handlClick = (item) => {
+    const mainOrderId = item.mainOrderId; // 获取详情id
+    uni.navigateTo({
+        url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
+    });
+}
+</script>
+
+<style lang="scss" scoped>
+.item {
+    border-radius: 24rpx;
+    background: rgba(255, 255, 255, 1);
+    margin-bottom: 24rpx;
+    padding: 32rpx;
+    display: flex;
+    align-items: flex-start;
+
+    .item-img {
+        margin-right: 32rpx;
+    }
+
+    .item-info {
+        display: flex;
+        flex-direction: column;
+        flex: 1;
+        justify-content: space-between;
+        height: 100%;
+
+        .item-title-box {
+            .item-title {
+                font-size: 30rpx;
+                font-weight: 400;
+                line-height: 45rpx;
+                color: rgba(26, 26, 26, 1);
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                margin-bottom: 15rpx;
+            }
+        }
+
+        .item-de {
+            display: flex;
+            font-size: 26rpx;
+            font-weight: 400;
+            line-height: 39rpx;
+            color: rgba(153, 153, 153, 1);
+            display: flex;
+            align-items: center;
+            justify-content: flex-start;
+        }
+
+        .item-time {
+            font-size: 26rpx;
+            font-weight: 400;
+            letter-spacing: 0rpx;
+            line-height: 39rpx;
+            color: rgba(153, 153, 153, 1);
+            margin-bottom: 20rpx;
+        }
+
+        .item-price {
+            font-size: 30rpx;
+            font-weight: 400;
+            letter-spacing: 0rpx;
+            line-height: 45rpx;
+            color: rgba(203, 26, 28, 1);
+            margin-bottom: 16rpx;
+        }
+
+        .item-box {
+            display: flex;
+            align-items: center;
+            justify-content: flex-end;
+
+
+            .item-btns {
+                display: flex;
+                align-items: center;
+                justify-content: center;
+
+                .btn-s {
+                    font-size: 26rpx;
+                    font-weight: 400;
+                    color: rgba(221, 94, 69, 1);
+                    text-align: center;
+                    padding: 16rpx 0;
+                    width: 156.03rpx;
+                    border-radius: 8rpx;
+                    background: rgba(0, 0, 0, 0);
+                    display: flex;
+                    justify-content: center;
+                    border: 0rpx solid rgba(221, 94, 69, 1);
+                }
+
+                .btn-m {
+                    border-radius: 59rpx;
+                    font-size: 26rpx;
+                    text-align: left;
+                    margin-left: 24rpx;
+                    display: flex;
+                    justify-content: center;
+                    color: #dd5e45;
+                    padding: 12rpx 32rpx;
+                    border: 1px solid;
+                    border-radius: 59rpx;
+                }
+
+
+            }
+        }
+    }
+}
+
+.item-time-text {
+    color: #dd5e45;
+}
+
+.skill-description {
+		display: -webkit-box;
+		-webkit-line-clamp: 2;
+		/* 限制两行 */
+		-webkit-box-orient: vertical;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		line-height: 1.4;
+		min-height: 2.8em;
+		/* 两行高度 */
+	}
+
+</style>

+ 2 - 1
pages/index.vue

@@ -293,7 +293,7 @@ onUnload(() => {
 <style scoped lang="scss">
 .main-content {
 	background: rgba(255, 255, 255, 1);
-
+	
 	.home-banner {
 		display: flex;
 		align-items: flex-end;
@@ -314,6 +314,7 @@ onUnload(() => {
 
 	.home-box {
 		padding-bottom: 150rpx;
+		
 	}
 
 	.home-banner-left {

+ 1 - 1
pages/mine.vue

@@ -276,7 +276,7 @@ onShow(() => {
 
 const init = async () => {
 	try {
-		uni.hideLoading();
+		// uni.hideLoading();
 		uni.showLoading({
 			title: '数据加载中...'
 		});

+ 2 - 32
pages_classify/pages/handle/index.vue

@@ -6,20 +6,6 @@
                 <PositioningMap :address="detaile.address" />
             </view>
             <view class="user-info order-card">
-                <!-- <view class="user-box">
-                <view class="info-list">
-                    <view>被服务人员:{{ detaile.name }}</view>
-                    <view style="display: flex;">服务类别: <dict-tag :options="lrr_service_category"
-                            :value="detaile.serviceCategory" /></view>
-                    <view @click="onPhone">电话号码:<label class="phone">{{ detaile.telephone }}</label></view>
-                    <view>地址:{{ detaile.address }}</view>
-                    <view>是否有传染疾病:{{ detaile.isContagion === 1 ? '是' : '否' }}</view>
-                    <view v-if="detaile.isContagion === 1">疾病备注:{{ detaile.haveContagion }}</view>
-                    <view>备注信息:{{ detaile.remark }}</view>
-
-                </view>
-            </view> -->
-
                 <view class="handle-user">
                     <view class="handle-user-left">
                         <img src='/static/serverImg/mine/user.png' alt=""
@@ -59,19 +45,15 @@
 import { ref } from 'vue';
 import { onLoad, onUnload } from '@dcloudio/uni-app';
 import { getVolunteerOrderInfo, getTimesByDate, } from '@/api/volunteer.js'
-import { getAddress } from '@/api/address.js'
 import PositioningMap from '@/pages_classify/components/PositioningMap/index.vue'
 import Slide from '@/pages_classify/components/Slide/index.vue'
 import { useDict } from '@/utils/dict.js';
 import DictTag from '@/components/DictTag/index.vue'
 import { wxMakePhoneCall } from '@/utils/wxRequest.js'
 import { computed } from 'vue';
-import dayjs from 'dayjs'
-const fileList = ref([]);
 const orderId = ref('');
 const detaile = ref({});
 const verify = ref(null);
-const rateValue = ref(3)
 const {
     lrr_service_category
 } = useDict('lrr_service_category');
@@ -85,9 +67,6 @@ const onPhone = (phone) => {
 
 const dateData = ref('00:00:00');
 let timer = null;
-// const dateData = computed(()=>{
-//     return dayjs(new Date()).format("hh:mm:ss")
-// })
 
 const slideData = computed(() => {
     //服务已开始,待上传图片
@@ -113,7 +92,6 @@ const getOrderDetail = async () => {
         }
         if (res.data.secondOrder.updateTime) {
             timer = setInterval(() => {
-                console.log('time', res.data.secondOrder.updateTime);
                 const timeDiff = Math.abs(new Date() - new Date(res.data.secondOrder.updateTime));
                 const units = {
                     day: Math.floor(timeDiff / (1000 * 60 * 60 * 24)),
@@ -131,7 +109,6 @@ const getOrderDetail = async () => {
 
 
 
-        console.log('xxxx', detaile.value);
 
     } catch (error) {
         console.log('error', error);
@@ -145,9 +122,6 @@ const getOrderDetail = async () => {
 }
 
 const change = (e) => {
-    console.log('验证信息:', e)
-    console.log('验证是否成功:' + e.state)
-    console.log('验证次数:' + e.verification)
     if (e.state && !orderStatus.value) {
 
         getTimesByDate(orderId.value).then(res => {
@@ -182,14 +156,13 @@ const change = (e) => {
 
 
 onLoad((options) => {
-    console.log('options', options);
     orderId.value = options.orderId;
     getOrderDetail();
 
 })
 onUnload(() => {
+    clearInterval(timer);
     timer = null;
-
 })
 </script>
 <style lang="scss" scoped>
@@ -200,10 +173,7 @@ onUnload(() => {
     right: 0;
     bottom: 280rpx;
     overflow-y: auto;
-    // padding: 12px 12px 24px;
-    // background: rgba(245, 245, 245, 1);
-
-
+    
     .order-card {
         border-radius: 8px;
         background: rgba(255, 255, 255, 1);

+ 2 - 2
pages_home/pages/register/index.vue

@@ -102,8 +102,8 @@ const userImg = ref(null);
 const zsImg = ref(null);
 
 const min_max_price = ref({
-	minPrice: 10,
-	maxPrice: 100
+	minPrice: undefined,
+	maxPrice: undefined
 })