Browse Source

Merge branch 'dev-1.1.0' of http://1.95.212.35:13000/root/leromro-mini into dev-1.1.0

jiayubo 3 days ago
parent
commit
958ad0e4bf

+ 1 - 1
components/CustomTabBar/index.vue

@@ -235,7 +235,7 @@ color: #000000;
 
 .menuIcon {
     position: relative;
-    top: 16rpx;
+   
 }
 
 .message-style {

+ 2 - 2
config.js

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

+ 6 - 4
pages/chat.vue

@@ -15,7 +15,7 @@
                             收到{{kf_count}}条客服对话
                             <view class="chat-num sys-ab" v-if="kf_count > 0">{{ kf_count }}</view>
                         </view>
-                        <view class="chat-sys-btn">去查看</view>
+                        <view class="chat-sys-btn" @click="onKf">去查看</view>
                     </view>
                     <view class="chat-sys-item">
                         <view class="chat-sys-title">收到{{xt_count}}条系统提醒
@@ -37,14 +37,16 @@
                         ]" @click="handleDelete(item)">
                             <template #default>
                                 <view class="chat-item" @click="onClick(item)">
+                                    <img src="/static/serverImg/mine/system.png" alt="" class="chat-img" v-if="item.conversationType === '1'" />
+                                    <img src="/static/serverImg/mine/customer.png" alt="" class="chat-img" v-else-if="item.conversationType === '3'" />
 
-                                    <img v-if="item.conversationAvatar" :src="item.conversationAvatar" alt=""
+                                    <img v-else :src="item.conversationAvatar" alt=""
                                         class="chat-img" />
-                                    <img src="/static/serverImg/mine/user.png" alt="" class="chat-img" v-else />
+                                   
                                     <view class="chat-box">
                                         <view class="chat-top">
                                             <text class="chat-name">{{['1','3'].includes(item.conversationType) ? 
-                                           item.conversationType ==='1'?'系统消息' :'客服'
+                                           item.conversationType ==='1'?'系统消息' :'客服消息'
                                             :
                                                 type ? item.volunteerName : item.userName }}</text>
                                             <text class="chat-time">{{ handlerData(item.newestMsgTime ||

+ 66 - 71
pages/classify.vue

@@ -1,21 +1,15 @@
 <template>
   <view>
-    <view class="classify-main" >
-      <up-tabs
-        :list="column"
-        :scrollable="false"
-        @change="onChange"
-        :activeStyle="{
-          color: 'rgba(221, 94, 69, 1)',
-          fontWeight: 'bold',
-          transform: 'scale(1.05)',
-        }"
-        lineColor="rgba(221, 94, 69, 1)"
-        v-model:current="tabKey"
-      >
+    <view class="classify-main">
+      <up-tabs :list="column" :scrollable="false" @change="onChange" :activeStyle="{
+        color: 'rgba(221, 94, 69, 1)',
+        fontWeight: 'bold',
+        transform: 'scale(1.05)',
+      }" lineColor="rgba(221, 94, 69, 1)" v-model:current="tabKey">
       </up-tabs>
+  
       <view class="list">
-        <List :data="data" v-if="data && data.length > 0 " @refresh="getList" ref="listRef" :total="pages.total"/>
+        <List :data="data" v-if="data && data.length > 0" @refresh="getList" ref="listRef" :total="pages.total" />
         <view v-else>
           <NoneView value="您还没有相关订单" />
         </view>
@@ -26,9 +20,9 @@
 </template>
 
 <script setup>
-import { ref,computed } from 'vue'
+import { ref, computed } from 'vue'
 import List from '@/pages/common/orderList/index.vue'
-import { provide } from 'vue'
+import { provide,inject } from 'vue'
 import { getVolunteerOrderList } from '@/api/volunteer.js'
 import { onMounted } from 'vue'
 import { useDict } from '@/utils/dict.js'
@@ -42,7 +36,7 @@ const userType = uni.getStorageSync('userType') //读取本地存储
 const tab = ref('')
 const tabKey = ref(0)
 const data = ref([]) //志愿者
-const listRef =ref(null)
+const listRef = ref(null)
 /**
  * 	0待支付 1已支付 2支付超时或取消 3进行中 4已完成 5申请退款中 6已退款 7部分退款 8 待确认
  */
@@ -69,30 +63,30 @@ const admin = [
   },
 ]
 const user = [
-{
-			name: "全部",
-			value: "",
-		},
-		{
-			name: "待支付",
-			value: "0",
-		},
-		{
-			name: "待服务",
-			value: "1",
-		},
-		{
-			name: "进行中",
-			value: "3",
-		},
-		{
-			name: "已完成",
-			value: "4",
-		},
-		{
-			name: "售后",
-			value: '2,5,6,7',
-		}
+  {
+    name: "全部",
+    value: "",
+  },
+  {
+    name: "待支付",
+    value: "0",
+  },
+  {
+    name: "待服务",
+    value: "1",
+  },
+  {
+    name: "进行中",
+    value: "3",
+  },
+  {
+    name: "已完成",
+    value: "4",
+  },
+  {
+    name: "售后",
+    value: '2,5,6,7',
+  }
 ]
 
 const column = computed(() => {
@@ -100,46 +94,46 @@ const column = computed(() => {
 })
 
 const pages = ref({
-	current: 1,
-	pageSize: 10,
-	total: null,
+  current: 1,
+  pageSize: 10,
+  total: null,
 })
 async function getList(type) {
-	console.log("TCL: getList -> type", type)
+  console.log("TCL: getList -> type", type)
   try {
-  
+
     console.log(data.value.length, pages.value.total);
-    if(type === 'top'){
+    if (type === 'top') {
       data.value = [];
       pages.value.total = 0;
     }
-    if(type ==='bottom'  ){
-      if(data.value.length < pages.value.total){
+    if (type === 'bottom') {
+      if (data.value.length < pages.value.total) {
         listRef.value && listRef.value.handleBottom(true);
         pages.value.current++;
-      }else {
+      } else {
         listRef.value && listRef.value.handleBottom(false)
         return;
       }
-    }else{
+    } else {
       uni.showLoading({
         title: '数据加载中...',
       })
     }
-  
-    
+
+
     const listApi = userType === 1 ? userMainOrderList : getVolunteerOrderList
     const res = await listApi({
       orderStatus: tab.value,
       pageNum: pages.value.current,
-			pageSize: pages.value.pageSize,
+      pageSize: pages.value.pageSize,
     })
-    data.value =[...data.value,...res.rows];
+    data.value = [...data.value, ...res.rows];
     pages.value.total = res.total;
 
-    type ==='bottom'&& listRef.value && listRef.value.handleBottom(false);
+    type === 'bottom' && listRef.value && listRef.value.handleBottom(false);
+
 
- 
   } catch (error) {
     console.log('error', error)
     uni.showToast({
@@ -147,7 +141,7 @@ async function getList(type) {
       icon: 'error',
     })
   } finally {
-    if(listRef.value && listRef.value.handleRefreshing && type ==='top'){
+    if (listRef.value && listRef.value.handleRefreshing && type === 'top') {
       listRef.value.handleRefreshing(false)
     }
 
@@ -157,8 +151,8 @@ async function getList(type) {
         listRef.value && listRef.value.handleBottom(false)
       }
     }, 500)
-  
-    type !=='bottom' && uni.hideLoading()
+
+    type !== 'bottom' && uni.hideLoading()
   }
 }
 
@@ -183,11 +177,10 @@ function btnClick(row, type) {
 
   //前往沟通
   uni.navigateTo({
-  	url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.mainOrderId}`
+    url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.mainOrderId}`
   });
 }
 provide('onClick', btnClick)
-
 function onChange(tabItem) {
   tab.value = tabItem.value;
   pages.value.current = 1;
@@ -195,25 +188,27 @@ function onChange(tabItem) {
   getList()
 }
 onMounted(() => {
-  const token  = getToken();
-  if(token){
-    const {
-      order_status,
-    } = useDict('order_status', 'lrr_service_status')
-    provide('order_status', order_status) //订单/服务状态
-  }
+
 
 })
 
 onShow(() => {
-  
-  const initIndex = userType === 1? 2:1;//默认选中待服务
+
+  const initIndex = userType === 1 ? 2 : 1;//默认选中待服务
 
   const params = getApp().globalData.switchTabParams || {}
   tabKey.value = params.tabKey || initIndex;
   onChange(column.value[tabKey.value])
   // 使用后建议清除参数,避免重复读取
   getApp().globalData.switchTabParams = null
+
+  const token = getToken();
+  if (token) {
+    const {
+      order_status,
+    } = useDict('order_status', 'lrr_service_status')
+    provide('order_status', order_status) //订单/服务状态
+  }
 })
 </script>
 

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

@@ -57,6 +57,7 @@ const props = defineProps({
 });
 
 const order_status = inject('order_status');
+console.log("TCL: order_status", order_status)
 
 const btns = [
   {

+ 13 - 10
pages/login.vue

@@ -40,7 +40,9 @@ import { ref, reactive, onMounted } from 'vue'
 import { useRouter } from 'vue-router' // 根据实际情况选择路由库
 import store from '@/store'
 import { onShow, onLoad } from '@dcloudio/uni-app'
-
+import {
+	userOrWorker
+} from '@/api/login';
 const imagePath = '/static/9efd1.png' // Path to the logo image (red tree)
 
 // 获取全局配置
@@ -199,17 +201,18 @@ const loginSuccess = () => {
   store.dispatch('GetInfo').then((res) => {
     console.log("TCL: loginSuccess -> res", res)
     console.log(store.state.user.userOrWorker, '>>>>99')
-    // if (store.state.user.userOrWorker == 0) {
-    //   uni.reLaunch({
-    //     url: '/pages/UserSelection',
-    //   })
-    //   return
-    // }
     uni.setStorageSync('userType', store.state.user.userOrWorker)
     uni.setStorageSync('userId', res.user.userId)
-    uni.switchTab({
-      url: '/pages/index',
-    })
+    userOrWorker({userType: store.state.user.userOrWorker})
+		.then(res => {
+			console.log("TCL: loginSuccess -> res", res)
+				uni.switchTab({
+          url: '/pages/index',
+        })
+		})
+		.catch(err => {
+			console.error('设置失败:', err);
+		});
   })
 }
 

+ 46 - 36
pages/mine/index.vue

@@ -11,14 +11,17 @@
                                 <view class="info-name" @click="onLogin">{{
                                     userInfo.nickName
                                 }}</view>
-                                <view class="info-tag flex_c_c" v-if="userType">{{userType === 1 ? '用户':'志愿者' }}</view>
+                                <view class="info-tag flex_c_c" v-if="userType">{{ userType === 1 ? '用户' : '志愿者' }}
+                                </view>
                             </view>
                             <view class="info-real-name flex_c_c">
-                                <view class="real-name">{{authentication?'已实名':'暂未实名'}}</view>
-                                <img src="/static/serverImg/mine/suce.png" alt="" style="width: 24rpx; height: 24rpx;" v-if="authentication">
-                                <img src="/static/serverImg/mine/left.png" alt="" style="width: 24rpx; height: 24rpx;" v-else>
-                                
-                                
+                                <view class="real-name">{{ authentication ? '已实名' : '暂未实名' }}</view>
+                                <img src="/static/serverImg/mine/suce.png" alt="" style="width: 24rpx; height: 24rpx;"
+                                    v-if="authentication">
+                                <img src="/static/serverImg/mine/left.png" alt="" style="width: 24rpx; height: 24rpx;"
+                                    v-else>
+
+
                             </view>
                         </view>
                         <img src="/static/serverImg/mine/setting.png" alt="" style="width: 40rpx; height: 40rpx;"
@@ -64,7 +67,7 @@
 
             <view class="list-main">
                 <view class="list-box">
-                    <view v-for="item in list" :key="item.key" class="list-item flex_c_s"  @click="onClick(item)">
+                    <view v-for="item in list" :key="item.key" class="list-item flex_c_s" @click="onClick(item)">
                         <view class="list-left flex_c_l">
                             <img :src="item.img" alt="" style="width: 56rpx;height: 56rpx;">
                             <view class="list-name">{{ item.name }}</view>
@@ -93,13 +96,15 @@
 import { onMounted, ref, computed } from 'vue'
 import { onLoad, onShow } from '@dcloudio/uni-app'
 import store from '@/store'
-import { getVolunteerAccountInfo, volunteerOrderStatistics,getAccountInfo } from '@/api/mine'
+import { getVolunteerAccountInfo, volunteerOrderStatistics, getAccountInfo } from '@/api/mine'
 import CustomTabBar from '@/components/CustomTabBar/index.vue'
 import QRCode from '@/components/QRCode/index.vue'
 import { getNavBarHeight } from '@/utils/index.js'
 import { getToken } from '@/utils/auth'
 import { showConfirm } from '@/utils/common'
-
+import {
+    userOrWorker
+} from '@/api/login';
 const show = ref(false); // 是否显示二维码
 const userInfo = ref({
     avatar: '/static/serverImg/mine/user.png',
@@ -121,9 +126,9 @@ const data = ref({
     orderCount: 0,
     orderFrozenBalance: 0,
 
-    browsing:0,
-    collect:0,
-    comment:0
+    browsing: 0,
+    collect: 0,
+    comment: 0
 })
 const rateValue = ref(5)
 
@@ -202,7 +207,7 @@ const adminList = [
             uni.navigateTo({
                 url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
             })
-      },
+        },
     },
     {
         name: '我的评论',
@@ -227,14 +232,8 @@ const adminList = [
         key: 'map',
         text: '切换身份',
         operate: () => {
-            uni.setStorageSync('userType', 1)
-            store.dispatch('GetInfo').then((res) => {
-                userInfo.value = store.state.user
-                uni.reLaunch({
-                url: '/pages/index',
-                })
-            })
-            },
+            switchUserType(1)
+        },
     },
 
 ]
@@ -255,7 +254,7 @@ const userList = [
             uni.navigateTo({
                 url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
             })
-      },
+        },
     },
     {
         name: '邀请二维码',
@@ -281,18 +280,29 @@ const userList = [
         key: 'map',
         text: '切换身份',
         operate: () => {
-            uni.setStorageSync('userType', 2)
-            store.dispatch('GetInfo').then((res) => {
-                userInfo.value = store.state.user
-                uni.reLaunch({
-                url: '/pages/index',
-                })
-            })
-            },
+            switchUserType(2)
+        },
     },
 ]
 
 
+const switchUserType = (userType) => {
+    uni.setStorageSync('userType', userType)
+    store.dispatch('GetInfo').then((res) => {
+        userInfo.value = store.state.user
+        userOrWorker({ userType: userType })
+            .then(res => {
+                console.log("TCL: loginSuccess -> res", res)
+                uni.reLaunch({
+                    url: '/pages/index',
+                })
+            })
+    })
+        .catch(err => {
+            console.error('设置失败:', err);
+        });
+}
+
 const list = computed(() => {
     if (userType === 1) {
         return userList
@@ -383,7 +393,7 @@ const geUserInfo = () => {
 
 onShow(() => {
     const token = getToken()
-	// console.log("TCL: token", token)
+    // console.log("TCL: token", token)
     if (token) {
         geUserInfo()
         init()
@@ -405,16 +415,16 @@ const init = async () => {
                 ...res1.data,
                 ...res2.data,
             }
-            console.log(11, res1, res2, data.value,userType)
+            console.log(11, res1, res2, data.value, userType)
         }
-        if(userType === 1){
+        if (userType === 1) {
             const res = await getAccountInfo();
-            data.value ={
+            data.value = {
                 ...data.value,
                 ...res.data,
-            };	
+            };
         }
- 
+
     } catch (error) {
         console.log('error', error)
         uni.showToast({

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

@@ -234,11 +234,11 @@ const validatePriceInput = (value) => {
 	console.log("TCL: validatePriceInput -> value", value)
 	// 确保输入是纯数字
 	if (!/^\d*$/.test(value)) {
-		serviceKeys.price = value.replace(/\D/g, ''); // 移除非数字字符
+		serviceKeys.price = value.replace(/[^0-9.]/g,  '');// 移除非数字字符
 		return;
 	}
 
-	const price = parseInt(serviceKeys.price, 10);
+	const price = parseFloat(serviceKeys.price, 10);
 
 	// 检查是否在允许的范围之内
 	if (min_max_price.value.minPrice !== undefined && min_max_price.value.maxPrice !== undefined) {

+ 2 - 2
pages_mine/components/setupUser/Add.vue

@@ -31,7 +31,7 @@
           <up-icon name="arrow-right"></up-icon>
         </template>
       </up-form-item>
-      <up-form-item
+      <!-- <up-form-item
         label="关系"
         prop="label"
         borderBottom
@@ -48,7 +48,7 @@
         <template #right>
           <up-icon name="arrow-right"></up-icon>
         </template>
-      </up-form-item>
+      </up-form-item> -->
       <up-form-item label="年龄" prop="age" borderBottom labelWidth="70">
         <up-input
           v-model="modelForm.age"

+ 5 - 3
pages_mine/pages/wallet/index.vue

@@ -73,9 +73,11 @@ const data = ref({
 const onWithdrawal = () => {
     getWithdrawStatus().then(res => {
         if(res.code === 200){
-        uni.navigateTo({
-                url: '/pages_mine/pages/withdrawal/index'
-            })
+        // uni.navigateTo({
+        //         url: '/pages_mine/pages/withdrawal/index'
+        //     })
+
+            uni.redirectTo({ url: `/pages_mine/pages/withdrawal/index` });
         }
     })
   

BIN
static/serverImg/mine/customer.png


BIN
static/serverImg/mine/system.png