Browse Source

用户端

jiayubo 1 week ago
parent
commit
89ebdbbb05

+ 19 - 0
api/personaInforMation.js

@@ -0,0 +1,19 @@
+import request from '../utils/request'
+
+// 新增用户
+export function updateUserInfo(data) {
+  return request({
+    url: `/system/user/updateUserInfo`,
+    method: 'post',
+    data: data,
+  })
+}
+
+// 编辑个人用户信息
+export function userUserInfoEdit(params) {
+  return request({
+    url: `/system/user/userInfo`,
+    method: 'get',
+    params: params,
+  })
+}

+ 8 - 8
api/userList.js

@@ -21,14 +21,14 @@ export function orderInfomainOrderId(mainOrderId) {
 //获取用户订单列表状态
 export function systemDictdaTalist() {
 	return request({
-    url: `/system/dict/data/list`,
-    method: 'get',
-    params: {
-      pageNum: 1,
-      pageSize: 10,
-      dictType: 'lrr_service_status',
-    },
-  })
+		url: `/system/dict/data/list`,
+		method: 'get',
+		params: {
+			pageNum: 1,
+			pageSize: 10,
+			dictType: 'order_status'
+		}
+	})
 }
 
 // 用户评价小订单

+ 82 - 71
pages.json

@@ -145,77 +145,82 @@
 		{
 			"root": "pages_mine",
 			"pages": [
-				{
-					"path": "pages/wallet/index",
-					"style": {
-						"navigationBarTitleText": "钱包"
-					}
-				},
-				{
-					"path": "pages/bad/index",
-					"style": {
-						"navigationBarTitleText": "差评申述"
-					}
-				},
-				{
-					"path": "pages/withdrawal/index",
-					"style": {
-						"navigationBarTitleText": "提现"
-					}
-				},
-				{
-					"path": "pages/income/index",
-					"style": {
-						"navigationBarTitleText": "收入明细"
-					}
-				},
-				{
-					"path": "pages/addBankCard/index",
-					"style": {
-						"navigationBarTitleText": "添加银行卡"
-					}
-				},
-				{
-					"path": "pages/bankCardDetails/index",
-					"style": {
-						"navigationBarTitleText": "银行卡详情"
-					}
-				},
-				{
-					"path": "pages/appeal/index",
-					"style": {
-						"navigationBarTitleText": "银行卡详情"
-					}
-				},
-				{
-					"path": "pages/setupUser/index",
-					"style": {
-						"navigationBarTitleText": "设置"
-					}
-				},
-				{
-					"path": "pages/setupUser/Address",
-					"style": {
-						"navigationBarTitleText": "新增地址"
-					}
-				},
-				{
-					"path": "pages/selectAddress/index",
-					"style": {
-						"navigationBarTitleText": "服务地址"
-					}
-				},
-				{
-					"path": "pages/selectAddress/edit",
-					"style": {
-						"navigationBarTitleText": "服务地址修改"
-					}
-				},
-				{
-					"path": "components/pickerAddress/pickerAddress"
-				}
-				
-			]
+        {
+          "path": "pages/wallet/index",
+          "style": {
+            "navigationBarTitleText": "钱包"
+          }
+        },
+        {
+          "path": "pages/bad/index",
+          "style": {
+            "navigationBarTitleText": "差评申述"
+          }
+        },
+        {
+          "path": "pages/withdrawal/index",
+          "style": {
+            "navigationBarTitleText": "提现"
+          }
+        },
+        {
+          "path": "pages/income/index",
+          "style": {
+            "navigationBarTitleText": "收入明细"
+          }
+        },
+        {
+          "path": "pages/addBankCard/index",
+          "style": {
+            "navigationBarTitleText": "添加银行卡"
+          }
+        },
+        {
+          "path": "pages/bankCardDetails/index",
+          "style": {
+            "navigationBarTitleText": "银行卡详情"
+          }
+        },
+        {
+          "path": "pages/appeal/index",
+          "style": {
+            "navigationBarTitleText": "银行卡详情"
+          }
+        },
+        {
+          "path": "pages/setupUser/index",
+          "style": {
+            "navigationBarTitleText": "设置"
+          }
+        },
+        {
+          "path": "pages/setupUser/Address",
+          "style": {
+            "navigationBarTitleText": "新增地址"
+          }
+        },
+        {
+          "path": "pages/selectAddress/index",
+          "style": {
+            "navigationBarTitleText": "服务地址"
+          }
+        },
+        {
+          "path": "pages/selectAddress/edit",
+          "style": {
+            "navigationBarTitleText": "服务地址修改"
+          }
+        },
+        {
+          "path": "components/pickerAddress/pickerAddress"
+        },
+        {
+          "path": "pages/setupUser/personalInfo",
+          "style": {
+            "navigationBarTitleText": "个人信息"
+          }
+        }
+      ]
 		},
 		{
 			"root": "pages_template/",
@@ -311,6 +316,12 @@
 					"style": {
 						"navigationBarTitleText": "申请退款"
 					}
+				},
+				{
+					"path": "pages/cancelationOforder/cancelationOforder",
+					"style": {
+						"navigationBarTitleText": "取消订单"
+					}
 				}
 			]
 		}

+ 196 - 208
pages/classify.vue

@@ -1,221 +1,209 @@
 <template>
-	<view>
-		<!-- 志愿者 -->
-		<view class="classify-main" v-if="userType == '2'">
-			<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)" :current="tabKey">
-			</up-tabs>
-			<view class="list">
-				<List :data="data" v-if="data.length > 0" />
-				<view v-else>
-					 <NoneView value="您还没有相关订单"/>
-				</view>
-			</view>
-		</view>
-		<!-- 用户 -->
-		<OrderList :dataList="dataList" :dictSort="dictData" @fetchData="getListData" v-else />
-
-		<custom-tab-bar :page="2"/>
-	</view>
+  <view>
+    <!-- 志愿者 -->
+    <view class="classify-main" v-if="userType == '2'">
+      <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)"
+        :current="tabKey"
+      >
+      </up-tabs>
+      <view class="list">
+        <List :data="data" v-if="data.length > 0" />
+        <view v-else>
+          <NoneView value="您还没有相关订单" />
+        </view>
+      </view>
+    </view>
+    <!-- 用户 -->
+    <OrderList
+      :dataList="dataList"
+      :dictSort="dictData"
+      @fetchData="getListData"
+      v-else
+    />
+
+    <custom-tab-bar :page="2" />
+  </view>
 </template>
 
 <script setup>
-	import {
-		ref
-	} from 'vue';
-	import List from '@/pages/common/orderList/index.vue';
-	import {
-		provide
-	} from 'vue';
-	import {
-		getVolunteerOrderList
-	} from '@/api/volunteer.js'
-	import {
-		onMounted
-	} from 'vue';
-	import {
-		useDict
-	} from '@/utils/dict.js';
-	import {
-		onLoad,
-		onShow
-	} from '@dcloudio/uni-app';
-	import OrderList from '@/pages/common/classify/orderlist.vue'
-	import NoneView from '@/components/NoneView/index.vue'
-	import {
-		userMainOrderList,
-		systemDictdaTalist
-	} from "@/api/userList.js"
-	import CustomTabBar from '@/components/CustomTabBar/index.vue'
-	import { wxMakePhoneCall } from '@/utils/wxRequest.js'
-	const {
-		order_status,
-		// lrr_service_status
-	} = useDict('order_status', 'lrr_service_status');
-
-	provide('order_status', order_status); //订单/服务状态
-	// provide('lrr_service_status', lrr_service_status); //订单/服务状态
-
-
-	const userType = uni.getStorageSync('userType') //读取本地存储
-
-	// 用户/志愿者 识别标识
-	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
-
-	const tab = ref('');
-	const tabKey = ref(0);
-	const dataList = ref([]) //用户
-	const data = ref([]); //志愿者
-	// 定义存储字典数据的响应式变量
-	const dictData = ref([]);
-	/**
-	 * 	0待支付 1已支付 2支付超时或取消 3进行中 4已完成 5申请退款中 6已退款 7部分退款 8 待确认
-	 */
-	const column = [{
-			name: "全部",
-			value: "",
-		},
-		{
-			name: "待服务",
-			value: "1",
-		},
-		{
-			name: "进行中",
-			value: "3",
-		},
-		{
-			name: "已完成",
-			value: "4",
-		},
-		{
-			name: "已取消",
-			value: "2",
-		}
-	]
-
-
-	//获取用户订单列表状态
-	async function getData() {
-  console.log('进入');
+import { ref } from 'vue'
+import List from '@/pages/common/orderList/index.vue'
+import { provide } from 'vue'
+import { getVolunteerOrderList } from '@/api/volunteer.js'
+import { onMounted } from 'vue'
+import { useDict } from '@/utils/dict.js'
+import { onLoad, onShow } from '@dcloudio/uni-app'
+import OrderList from '@/pages/common/classify/orderlist.vue'
+import NoneView from '@/components/NoneView/index.vue'
+import { userMainOrderList, systemDictdaTalist } from '@/api/userList.js'
+import CustomTabBar from '@/components/CustomTabBar/index.vue'
+import { wxMakePhoneCall } from '@/utils/wxRequest.js'
+const {
+  order_status,
+  // lrr_service_status
+} = useDict('order_status', 'lrr_service_status')
+
+provide('order_status', order_status) //订单/服务状态
+// provide('lrr_service_status', lrr_service_status); //订单/服务状态
+
+const userType = uni.getStorageSync('userType') //读取本地存储
+
+// 用户/志愿者 识别标识
+const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
+
+const tab = ref('')
+const tabKey = ref(0)
+const dataList = ref([]) //用户
+const data = ref([]) //志愿者
+// 定义存储字典数据的响应式变量
+const dictData = ref([])
+/**
+ * 	0待支付 1已支付 2支付超时或取消 3进行中 4已完成 5申请退款中 6已退款 7部分退款 8 待确认
+ */
+const column = [
+  {
+    name: '全部',
+    value: '',
+  },
+  {
+    name: '待服务',
+    value: '1',
+  },
+  {
+    name: '进行中',
+    value: '3',
+  },
+  {
+    name: '已完成',
+    value: '4',
+  },
+  {
+    name: '已取消',
+    value: '2',
+  },
+]
+
+//获取用户订单列表状态
+async function getData() {
+  console.log('进入')
   try {
-    const res = await systemDictdaTalist().catch(err => {
-      throw err; // 重新抛出以进入 catch 块
-    });
-    console.log(res, '用户状态获取成功');
-    dictData.value = res.rows;
-    console.log(dictData.value, 'dictData.value');
+    const res = await systemDictdaTalist().catch((err) => {
+      throw err // 重新抛出以进入 catch 块
+    })
+    console.log(res, '用户状态获取成功')
+    dictData.value = res.rows
+    console.log(dictData.value, 'dictData.value')
   } catch (e) {
-    console.error('获取数据异常:', e); // 确保这里打印错误
+    console.error('获取数据异常:', e) // 确保这里打印错误
   }
 }
 
-	async function getList() {
-		try {
-			uni.hideLoading();
-			uni.showLoading({
-				title: '数据加载中...'
-			});
-
-			// 判断 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;
-			}
-
-		} catch (error) {
-			console.log('error', error);
-			uni.showToast({
-				title: error.msg,
-				icon: 'error',
-			});
-		} finally {
-			uni.hideLoading();
-		}
-	}
-	const getListData = async (orderStatus = tab.value) => {
-		const res = await userMainOrderList({
-			orderStatus: orderStatus
-		});
-		dataList.value = res.data
-	}
-	/**
-	 * 1: 查看
-	 * 2:沟通
-	 * 3:上传照片
-	 */
-	function btnClick(row, type) {
-		if (type === 1 && row.orderStatus === '2') {
-			uni.navigateTo({
-				url: `/pages_classify/pages/order/index?orderId=${row.secondOrderId}`
-			});
-			return;
-		}
-		if (type === 1) {
-
-			uni.navigateTo({
-				url: `/pages_classify/pages/handle/index?orderId=${row.secondOrderId}`
-			});
-			return
-			console.log('res==>',res);
-			
-			data.value = res.data;
-		}
-
-		//前往沟通
-
-		// wxMakePhoneCall(phone)
-		// uni.navigateTo({
-		// 	url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.secondOrderId}`
-		// });
-
-	}
-	provide('onClick', btnClick);
-
-
-	function onChange(tabItem) {
-		tab.value = tabItem.value;
-		getList();
-	}
-
-
-
-	onMounted(() => {
-		getList()
-		getListData()
-		getData()
-	})
-
-
-	onShow(() => {
-		const params = getApp().globalData.switchTabParams || {};
-		tabKey.value = params.tabKey || 0;
-		onChange(column[tabKey.value])
-		// 使用后建议清除参数,避免重复读取 
-		getApp().globalData.switchTabParams = null;
-
-	})
+async function getList() {
+  try {
+    uni.hideLoading()
+    uni.showLoading({
+      title: '数据加载中...',
+    })
+
+    // 判断 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
+    }
+  } catch (error) {
+    console.log('error', error)
+    uni.showToast({
+      title: error.msg,
+      icon: 'error',
+    })
+  } finally {
+    uni.hideLoading()
+  }
+}
+
+const getListData = async (orderStatus = tab.value) => {
+  const res = await userMainOrderList({
+    orderStatus: orderStatus
+  })
+  dataList.value = res.data
+}
+/**
+ * 1: 查看
+ * 2:沟通
+ * 3:上传照片
+ */
+function btnClick(row, type) {
+  if (type === 1 && row.orderStatus === '2') {
+    uni.navigateTo({
+      url: `/pages_classify/pages/order/index?orderId=${row.secondOrderId}`,
+    })
+    return
+  }
+  if (type === 1) {
+    uni.navigateTo({
+      url: `/pages_classify/pages/handle/index?orderId=${row.secondOrderId}`,
+    })
+    return
+    console.log('res==>', res)
+
+    data.value = res.data
+  }
+
+  //前往沟通
+
+  // wxMakePhoneCall(phone)
+  // uni.navigateTo({
+  // 	url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.secondOrderId}`
+  // });
+}
+provide('onClick', btnClick)
+
+function onChange(tabItem) {
+  tab.value = tabItem.value
+  getList()
+}
+
+onMounted(() => {
+  getList()
+  getListData()
+  getData()
+})
+
+onShow(() => {
+  const params = getApp().globalData.switchTabParams || {}
+  tabKey.value = params.tabKey || 0
+  onChange(column[tabKey.value])
+  // 使用后建议清除参数,避免重复读取
+  getApp().globalData.switchTabParams = null
+})
 </script>
 
 <style lang="scss" scoped>
-	.classify-main {
-		height: 100vh;
-
-		.list {
-			position: fixed;
-			top: 50px;
-			bottom: 150rpx;
-			left: 0px;
-			right: 0px;
-		}
-	}
+.classify-main {
+  height: 100vh;
+
+  .list {
+    position: fixed;
+    top: 50px;
+    bottom: 150rpx;
+    left: 0px;
+    right: 0px;
+  }
+}
 </style>

+ 6 - 16
pages/common/classify/orderlist.vue

@@ -74,7 +74,7 @@
 
 
 	const userType = uni.getStorageSync('userType') //读取本地存储
-
+  const afterSaleStatusArr = ref([])
 	// 用户/志愿者 识别标识
 	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
 	const orderStatus = ref(0)
@@ -100,7 +100,7 @@
 		},
 		{
 			name: "售后",
-			value: "2",
+			value: afterSaleStatusArr.value,
 		}
 	]
 
@@ -156,20 +156,10 @@
 
 	// 取消订单
 	const handleCancel = (item) => {
-		const mainOrderId = item.mainOrderId;
-		uni.showModal({
-			title: '提示',
-			content: '确定要取消该订单吗?',
-			success: function(res) {
-				if (res.confirm) {
-					// TODO: 调用取消订单接口
-					uni.showToast({
-						title: '订单已取消',
-						icon: 'success'
-					});
-				}
-			}
-		});
+    const mainOrderId = item.mainOrderId;
+    uni.navigateTo({
+      url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
+    });
 	};
 </script>
 

+ 152 - 0
pages_classify/pages/cancelationOforder/cancelationOforder.vue

@@ -0,0 +1,152 @@
+<template>
+  <view>
+    <!-- 志愿者信息 -->
+    <view class="volunteer-info">
+      <image :src="dataList.volunteerPicture" class="volunteer-image"></image>
+      <view class="volunteer-details">
+        <view
+          style="display: flex; justify-content: space-between; width: 100%"
+        >
+          <view>
+            <view>{{ dataList.volunteerName }}</view>
+            <view>{{ dataList.businessTierName }}</view>
+          </view>
+          <view>可退:{{ dataList.refundAmount }}</view>
+        </view>
+      </view>
+    </view>
+
+    <!-- 申请类型 -->
+    <view class="application-type"> 申请类型:取消订单 </view>
+
+    <!-- 展开全部按钮 -->
+    <view class="expand-all">
+      <text @click="toggleExpand">展开全部</text>
+      <image
+        :src="expanded ? '/path/to/up-icon.png' : '/path/to/down-icon.png'"
+        class="expand-icon"
+      ></image>
+    </view>
+
+    <!-- 申请说明 -->
+    <view class="application-note">
+      <up-textarea
+        v-model="refundReason"
+        placeholder="请详细填写申请申请说明"
+      ></up-textarea>
+    </view>
+
+    <!-- 提交申请按钮 -->
+    <view class="submit-button">
+      <up-button type="error" text="提交申请" @click="handlClick"></up-button>
+    </view>
+  </view>
+</template>
+<script setup>
+import { onMounted, ref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import { userdictOrderInfo, refunDnewOrderRefund } from '@/api/userList.js'
+
+const dataList = ref([])
+const mainOrderId = ref('') //志愿者ID
+const refundReason = ref('')
+const expanded = ref(false)
+
+onLoad(async (options) => {
+  mainOrderId.value = options.mainOrderId
+  const res = await userdictOrderInfo(mainOrderId.value)
+  dataList.value = res.data
+})
+
+const toggleExpand = () => {
+  expanded.value = !expanded.value
+}
+
+const handlClick = async () => {
+  const params = {
+    mainOrderId: mainOrderId.value,
+    volunteerPicture: dataList.value.volunteerPicture,
+    refundReason: refundReason.value,
+  }
+  const res = await refunDnewOrderRefund(params)
+  if (res.status === 200) {
+    uni.showToast({
+      title: '退款成功',
+      icon: 'success', // 或者 'none'
+      duration: 1500, // 显示时间,单位毫秒,默认1500
+      mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
+    })
+    uni.navigateBack({
+      delta: 1,
+    })
+  }
+}
+</script>
+
+<style scoped>
+.volunteer-info {
+  display: flex;
+  align-items: center;
+  border-bottom: 1rpx solid #ccc;
+  padding: 20rpx;
+}
+
+.volunteer-image {
+  width: 80rpx;
+  height: 120rpx;
+  margin-right: 20rpx;
+  border-radius: 8rpx;
+}
+
+.volunteer-details {
+  flex: 1;
+}
+
+.application-type {
+  padding: 20rpx;
+  border-bottom: 1rpx solid #ccc;
+}
+
+.volunteer-detail-section {
+  padding: 20rpx;
+  border-bottom: 1rpx solid #ccc;
+}
+
+.volunteer-detail {
+  display: flex;
+  align-items: center;
+}
+
+.volunteer-data {
+  flex: 1;
+  margin-left: 20rpx;
+}
+
+.refund-amount {
+  color: red;
+  font-weight: bold;
+}
+
+.expand-all {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 20rpx;
+  cursor: pointer;
+}
+
+.expand-icon {
+  width: 40rpx;
+  height: 40rpx;
+  margin-left: 10rpx;
+}
+
+.application-note {
+  padding: 20rpx;
+}
+
+.submit-button {
+  padding: 20rpx;
+  text-align: center;
+}
+</style>

+ 6 - 13
pages_classify/pages/requestaRefund/requestaRefund.vue

@@ -32,15 +32,9 @@
 			</view>
 		</view>
 
-		<!-- 展开全部按钮 -->
-		<view class="expand-all">
-			<text @click="toggleExpand">展开全部</text>
-			<image :src="expanded ? '/path/to/up-icon.png' : '/path/to/down-icon.png'" class="expand-icon"></image>
-		</view>
-
 		<!-- 申请说明 -->
 		<view class="application-note">
-			<up-textarea v-model="value1" placeholder="请详细填写申请申请说明"></up-textarea>
+			<up-textarea v-model="volunteerPicture" placeholder="请详细填写申请申请说明"></up-textarea>
 		</view>
 
 		<!-- 提交申请按钮 -->
@@ -66,24 +60,23 @@
 	const mainOrderId = ref(''); //志愿者ID
 	const value1 = ref('');
 	const expanded = ref(false);
-
+  const refundReason = ref('');
+  
 	onLoad(async (options) => {
 		mainOrderId.value = options.mainOrderId;
 		const res = await userdictOrderInfo(mainOrderId.value)
 		dataList.value = res.data;
 	});
 
-	const toggleExpand = () => {
-		expanded.value = !expanded.value;
-	};
 
 	const handlClick = async () => {
 		const params = {
 			mainOrderId: mainOrderId.value,
-			volunteerPicture: dataList.value.volunteerPicture
+      volunteerPicture: dataList.value.volunteerPicture,
+      refundReason: refundReason.value
 		};
 		const res = await refunDnewOrderRefund(params);
-		if (res.status === 200) {
+		if (res.data && res.code === 200) {
 			uni.showToast({
 				title: '提交成功',
 				icon: 'success', // 或者 'none'

+ 81 - 66
pages_home/pages/setupUser/Address.vue

@@ -1,78 +1,93 @@
 <template>
-	<view>
-		<template v-for="(item, index) in addInfoArr" :key="index">
-			<add-component ref="addComponentRef"></add-component>
-		</template>
-		<view class="Wrapper-Btn">
-			<up-button @click="handleQux" type="error" :plain="true" :hairline="true" text="取消" :customStyle="hadlClickEdit"></up-button>
-			<up-button type="error" text="确定" @click="handlOk" :customStyle="hadlClickEdit"></up-button>
-		</view>
-	</view>
+  <view>
+    <template v-for="(item, index) in addInfoArr" :key="index">
+      <add-component ref="addComponentRef"></add-component>
+    </template>
+    <view class="Wrapper-Btn">
+      <up-button
+        @click="handleQux"
+        type="error"
+        :plain="true"
+        :hairline="true"
+        text="取消"
+        :customStyle="hadlClickEdit"
+      ></up-button>
+      <up-button
+        type="error"
+        text="确定"
+        @click="handlOk(item)"
+        :customStyle="hadlClickEdit"
+      ></up-button>
+    </view>
+  </view>
 </template>
 
 <script setup>
-	import {
-		ref,
-		reactive
-	} from 'vue';
-	import {
-		useraDdressData
-	} from "@/api/userSettings.js"
-	import pickerAddress from '@/pages_home/components/pickerAddress/pickerAddress.vue' // 地区选择器组件
-	import addComponent from '@/pages_home/components/setupUserCopy/Add.vue'
+import { ref, reactive } from 'vue'
+import { useraDdressData } from '@/api/userSettings.js'
+import pickerAddress from '@/pages_home/components/pickerAddress/pickerAddress.vue' // 地区选择器组件
+import addComponent from '@/pages_home/components/setupUserCopy/Add.vue'
 
+const addComponentRef = ref(null)
 
-	const addComponentRef = ref(null)
+const addInfoArr = ref([{}])
 
-	const addInfoArr = ref([{}])
+function handleAdd() {
+  if (addInfoArr.value.length < 4) addInfoArr.value.push({})
+}
 
-	function handleAdd() {
-		if (addInfoArr.value.length < 4) addInfoArr.value.push({})
-	}
+const handlOk = async (item) => {
+  const params = []
+  const paramsData = {
+    volunteerId: item.volunteerId, // 获取 volunteerId
+    serviceCategory: item.serviceCategory, // 获取 serviceCategory
+    businessManagementId: item.businessManagementId, //获取 businessManagementId
+  }
+  const data = encodeURIComponent(JSON.stringify(paramsData))
+  addInfoArr.value.forEach((item, index) => {
+    params.push(addComponentRef.value[index].modelForm)
+  })
 
+  params.forEach(async (obj) => {
+    const res = await useraDdressData(obj)
+    if (res.code == 200) {
+      uni.showToast({
+        title: '新增成功',
+        icon: 'success', // 或者 'none'
+        duration: 1500, // 显示时间,单位毫秒,默认1500
+        mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
+      })
+      setTimeout(() => {
+        // uni.navigateBack({
+        // 	delta: 2
+        // })
+        wx.reLaunch({
+          url: `/pages_home/pages/Volunteerside/goodsDetails?paramsData=${data}`,
+        })
+      }, 1500)
+    }
+  })
+}
 
-	const handlOk = async () => {
-		const params = []
-		addInfoArr.value.forEach((item, index) => {
-			params.push(addComponentRef.value[index].modelForm)
-		})
-
-		params.forEach(async (obj) => {
-			const res = await useraDdressData(obj)
-			if (res.code == 200) {
-				uni.showToast({
-					title: '新增成功',
-					icon: 'success', // 或者 'none'
-					duration: 1500, // 显示时间,单位毫秒,默认1500
-					mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
-				});
-				setTimeout(() => {
-					uni.navigateBack({
-						delta: 2
-          })
-				}, 1500)
-			}
-		})
-	}
-	
-	const handleQux = () =>{
-		uni.navigateBack({
-			delta:2
-		})
-	}
-	const hadlClickEdit = {
-		width: '240rpx',
-		marginTop: '30rpx'
-	}
+const handleQux = () => {
+  uni.navigateBack({
+    delta: 2,
+  })
+}
+const hadlClickEdit = {
+  width: '240rpx',
+  marginTop: '30rpx',
+}
 </script>
 <style scoped lang="scss">
-	.address-inp {
-		color: #929292;
-	}
-	
-	.Wrapper-Btn{
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
-</style>
+.address-inp {
+  color: #929292;
+}
+
+.Wrapper-Btn {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>
+

+ 8 - 2
pages_mine/pages/setupUser/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view class="wrapper">
+		<view class="wrapper" @click="handlePersonalInfo">
 			<text class="text">个人信息</text>
 			<up-icon name="arrow-right" class="icon"></up-icon>
 			<up-divider></up-divider>
@@ -27,7 +27,13 @@
 		uni.navigateTo({
 			url: '/pages_mine/pages/setupUser/Address'
 		})
-	}
+}
+
+const handlePersonalInfo = () => {
+	uni.navigateTo({
+		url: '/pages_mine/pages/setupUser/personalInfo'
+	})
+}
 </script>
 
 <style scoped>

+ 188 - 0
pages_mine/pages/setupUser/personalInfo.vue

@@ -0,0 +1,188 @@
+<template>
+  <view>
+    <up-form labelPosition="left" :model="modelForm" :rules="rulesForm" ref="formRef">
+			<up-form-item label="姓名" prop="nickName" borderBottom labelWidth="70">
+				<up-input v-model="modelForm.nickName" border="none" placeholder="请输入姓名" :disabled="loading"></up-input>
+			</up-form-item>
+			<up-form-item label="性别" prop="sex" borderBottom @click="() => !loading && (sexFlag = true)" labelWidth="70">
+				<up-input v-model="displaySex" disabled disabledColor="#ffffff" placeholder="请选择性别"
+					border="none"></up-input>
+				<template #right>
+					<up-icon name="arrow-right"></up-icon>
+				</template>
+			</up-form-item>
+			
+			<up-form-item label="年龄" prop="age" borderBottom labelWidth="70">
+				<up-input v-model="modelForm.age" border="none" placeholder="请输入年龄" :disabled="loading"></up-input>
+			</up-form-item>
+			<up-form-item label="手机号" prop="phonenumber" borderBottom labelWidth="70">
+				<up-input v-model="modelForm.phonenumber" border="none" placeholder="请输入手机号" :disabled="loading"></up-input>
+			</up-form-item>
+		</up-form>
+
+		<up-action-sheet :show="sexFlag" :actions="sexOptions" @select="sexSelect"
+			@close="sexFlag = false"></up-action-sheet>
+
+			<view class="Wrapper-Btn">
+				<up-button @click="handleQux" type="error" :plain="true" :hairline="true" text="取消"
+					:customStyle="hadlClickEdit" :disabled="loading"></up-button>
+				<up-button type="error" @click="handleSubmit" :text="isEdit ? '编辑' : '新增'" :customStyle="hadlClickEdit" :loading="loading" :disabled="loading" />
+			</view>
+		</view>
+</template>
+
+<script setup>
+import { ref, computed, onMounted } from 'vue'
+import { updateUserInfo, userUserInfoEdit } from '@/api/personaInforMation.js'
+
+const formRef = ref(null)
+const sexFlag = ref(false)
+const sexOptions = ref([
+  { name: '男', value: 0 },
+  { name: '女', value: 1 }
+])
+const modelForm = ref({
+  nickName: '',
+  sex: '',
+  age: '',
+  phonenumber: ''
+})
+const isEdit = ref(false)
+const loading = ref(false)
+
+const rulesForm = ref({
+  nickName: {
+    type: 'string',
+    required: true,
+    message: '请输入姓名',
+    trigger: ['blur', 'change']
+  },
+  sex: {
+    type: 'number',
+    required: true,
+    message: '请选择性别',
+    trigger: ['change']
+  },
+  age: {
+    type: 'string',
+    required: true,
+    message: '请输入年龄',
+    trigger: ['blur', 'change']
+  },
+  phonenumber: {
+    type: 'string',
+    required: true,
+    message: '请输入手机号',
+    trigger: ['blur', 'change']
+  }
+})
+
+onMounted(async () => {
+  loading.value = true
+  try {
+    const res = await userUserInfoEdit({})
+    if (res && res.code === 200 && res.data) {
+      modelForm.value = {
+        nickName: res.data.nickName || '',
+        sex: res.data.sex !== undefined ? res.data.sex : '',
+        age: res.data.age || '',
+        phonenumber: res.data.phonenumber || ''
+      }
+      isEdit.value = true
+    } else {
+      isEdit.value = false
+      modelForm.value = {
+        nickName: '',
+        sex: '',
+        age: '',
+        phonenumber: ''
+      }
+    }
+  } catch (e) {
+    console.error('获取用户信息失败:', e)
+    uni.showToast({
+      title: '获取用户信息失败',
+      icon: 'none'
+    })
+    isEdit.value = false
+  } finally {
+    loading.value = false
+  }
+})
+
+const handleQux = () => {
+  uni.navigateBack({
+    delta: 1
+  })
+}
+
+const handleSubmit = async () => {
+  try {
+    // 表单验证
+    if (!formRef.value) {
+      console.error('表单引用不存在')
+      return
+    }
+    
+    const valid = await formRef.value.validate()
+    if (!valid) return
+
+    loading.value = true
+    const params = {
+      nickName: modelForm.value.nickName,
+      sex: modelForm.value.sex,
+      age: modelForm.value.age,
+      phonenumber: modelForm.value.phonenumber
+    }
+    const res = await updateUserInfo(params)
+    if (res && res.code === 200) {
+      uni.showToast({ 
+        title: isEdit.value ? '编辑成功' : '新增成功', 
+        icon: 'success' 
+      })
+      uni.navigateBack({ delta: 1 })
+    } else {
+      uni.showToast({ 
+        title: res.msg || (isEdit.value ? '编辑失败' : '新增失败'), 
+        icon: 'none' 
+      })
+    }
+  } catch (e) {
+    console.error('提交失败:', e)
+    uni.showToast({ 
+      title: '请求异常', 
+      icon: 'none' 
+    })
+  } finally {
+    loading.value = false
+  }
+}
+const displaySex = computed({
+  get() {
+    const option = sexOptions.value.find(item => item.value === modelForm.value.sex)
+    return option ? option.name : ''
+  },
+  set(newValue) {
+    const option = sexOptions.value.find(item => item.name === newValue)
+    if (option) {
+      modelForm.value.sex = option.value
+    }
+  }
+})
+function sexSelect(e) {
+  modelForm.value.sex = Number(e.value)
+  sexFlag.value = false
+}
+const hadlClickEdit = {
+		width: '240rpx',
+		marginTop: '30rpx'
+	}
+</script>
+
+<style scoped>
+	.Wrapper-Btn {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+</style>