Przeglądaj źródła

用户订单退款交互优化

jiayubo 1 tydzień temu
rodzic
commit
b1d24e5926

+ 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: '金邻助家',
 	// 应用信息

+ 6 - 0
pages.json

@@ -128,6 +128,12 @@
           "style": {
             "navigationBarTitleText": "地址列表"
           }
+        },
+        {
+          "path": "pages/selectAddress/edit",
+          "style": {
+            "navigationBarTitleText": "地址编辑"
+          }
         }
 			]
 		},

+ 6 - 4
pages_classify/pages/orderItem/userComment.vue

@@ -118,13 +118,15 @@
 			console.log(params, 'params>>>')
 			const res = await usersUserFinishOrder(params)
 			if (res.code == 200) {
-				uni.navigateTo({
-					url: '/pages/classify'
-				})
 				uni.showToast({
 					title: '评价提交成功',
 					icon: 'success'
-				});
+        });
+       setTimeout(() => {
+        uni.navigateBack({
+          delta: 1
+        })
+       }, 2000)
 			} else {
 				console.log('提交失败')
 			}

+ 147 - 154
pages_classify/pages/requestaRefund/requestaRefund.vue

@@ -1,160 +1,153 @@
 <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="volunteer-detail-section">
-			<view class="volunteer-detail">
-				<image :src="dataList.volunteerPicture" class="volunteer-image"></image>
-				<view class="volunteer-data">
-					<view>姓名:{{dataList.volunteerName}}</view>
-					<view>类别:{{dataList.businessTierName}}</view>
-					<view>技能简介:</view>
-				</view>
-				<view class="refund-amount">¥{{dataList.refundAmount}}</view>
-			</view>
-		</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>
+  <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="volunteer-detail-section">
+      <view class="volunteer-detail">
+        <image :src="dataList.volunteerPicture" class="volunteer-image"></image>
+        <view class="volunteer-data">
+          <view>姓名:{{ dataList.volunteerName }}</view>
+          <view>类别:{{ dataList.businessTierName }}</view>
+          <view>技能简介:</view>
+        </view>
+        <view class="refund-amount">¥{{ dataList.refundAmount }}</view>
+      </view>
+    </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('');
-  
-	onLoad(async (options) => {
-		mainOrderId.value = options.mainOrderId;
-		const res = await userdictOrderInfo(mainOrderId.value)
-		dataList.value = res.data;
-	});
-
-
-	const handlClick = async () => {
-		const params = {
-			mainOrderId: mainOrderId.value,
-      volunteerPicture: dataList.value.volunteerPicture,
-      refundReason: refundReason.value
-		};
-		const res = await refunDnewOrderRefund(params);
-		if (res.code == 200) {
-			uni.showModal({
-				title: '退款成功',
-				content: '钱款将在三个工作日内返回到您的钱包中',
-				showCancel: false,
-				success: function () {
-					setTimeout(() => {
-						uni.navigateBack({
-							delta: 1
-						});
-					}, 1500);
-				}
-			});
-		}
-	}
+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('')
+
+onLoad(async (options) => {
+  mainOrderId.value = options.mainOrderId
+  const res = await userdictOrderInfo(mainOrderId.value)
+  dataList.value = res.data
+})
+
+const handlClick = async () => {
+  const params = {
+    mainOrderId: mainOrderId.value,
+    volunteerPicture: dataList.value.volunteerPicture,
+    refundReason: refundReason.value,
+  }
+  const res = await refunDnewOrderRefund(params)
+  if (res.code == 200) {
+    uni.showToast({
+      title: '已提交申请',
+      icon: 'success',
+      duration: 1500,
+      mask: true,
+    })
+    setTimeout(() => {
+      uni.navigateBack({
+        delta: 1,
+      })
+    }, 1500)
+  }
+}
 </script>
 
 <style scoped>
-	.volunteer-info {
-		display: flex;
-		align-items: center;
-		border-bottom: 1rpx solid #ccc;
-		padding: 20rpx;
-	}
-	
-	.volunteer-image {
-		width: 120rpx;
-		height: 140rpx;
-		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>
+.volunteer-info {
+  display: flex;
+  align-items: center;
+  border-bottom: 1rpx solid #ccc;
+  padding: 20rpx;
+}
+
+.volunteer-image {
+  width: 120rpx;
+  height: 140rpx;
+  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>

+ 70 - 4
pages_home/components/volunteerSide/adresss.vue

@@ -31,9 +31,12 @@
           </view>
 
           <!-- 右侧编辑图标(固定宽度) -->
-          <view class="edit-icon" @click="hadlClickTo(item)">
-            <up-icon name="edit-pen" size="16"></up-icon>
-          </view>
+           <view class="edit-icon" @click="hadlClickTo(item)">
+          <up-icon name="edit-pen" size="16"></up-icon>
+        </view>
+        <view class="edit-icon" @click="hadlClickEdit(item)">
+          <up-icon name="trash" size="16"></up-icon>
+        </view>
         </view>
       </up-radio-group>
     </view>
@@ -52,7 +55,8 @@ import { ref ,onMounted} from 'vue'
 	import {
 		onShow
 	} from "@dcloudio/uni-app";
-import { addressList } from '@/api/userSettings.js'
+import { addressList,addressAddressIds } from '@/api/userSettings.js'
+
 const radioValue = ref(null)
 const dataList = ref([])
 const total = ref(0)
@@ -73,6 +77,26 @@ const props = defineProps({
     default: () => {},
   },
 })
+
+const hadlClickEdit = async (item) => {
+  try {
+    const res = await addressAddressIds(item.addressId) // 使用 addressId
+   if (res.code == 200) {
+      uni.showToast({
+      title: '删除成功',
+      icon: 'success',
+    })
+   }
+    await getListData()
+  } catch (error) {
+    console.error('删除失败', error)
+    uni.showToast({
+      title: '删除失败',
+      icon: 'error',
+    })
+  }
+}
+
 const emits = defineEmits(['update:modelValue', 'update:addressInfo'])
 
 function handleChane(addressId, item) {
@@ -83,6 +107,48 @@ function handleChane(addressId, item) {
   emits('update:addressInfo', selectedItem)
 }
 
+
+  const hadlClickTo = (item) => {
+  console.log(item)
+  const {
+    address,
+    addressId,
+    age,
+    cityName,
+    districtName,
+    label,
+    name,
+    provinceName,
+    sex,
+    telephone,
+    cityCode,
+    districtCode,
+    provinceCode,
+  } = item
+
+  const params = `address=${encodeURIComponent(
+    address
+  )}&addressId=${encodeURIComponent(addressId)}&age=${encodeURIComponent(
+    age
+  )}&cityName=${encodeURIComponent(cityName)}&districtName=${encodeURIComponent(
+    districtName
+  )}&label=${encodeURIComponent(label)}&name=${encodeURIComponent(
+    name
+  )}&provinceName=${encodeURIComponent(provinceName)}&sex=${encodeURIComponent(
+    sex
+  )}&telephone=${encodeURIComponent(telephone)}&cityCode=${encodeURIComponent(
+    cityCode
+  )}&districtCode=${encodeURIComponent(
+    districtCode
+  )}&provinceCode=${encodeURIComponent(provinceCode)}`
+
+  // 使用拼接的查询参数进行页面跳转
+  uni.navigateTo({
+    url: `/pages_home/pages/selectAddress/edit?${params}`,
+  })
+}
+
+
 const getListData = async () => {
   const res = await addressList()
   dataList.value = res.rows

+ 0 - 23
pages_home/components/volunteerSide/openAddress.vue

@@ -1,23 +0,0 @@
-<template>
-  <view class="open-address">
-    地址数据
-  </view>
-</template>
-
-<script setup>
-</script>
-
-<style scoped>
-.open-address{
-  	height: 100vh;
-			width: 100vw;
-			position: fixed;
-			top: 0;
-			left: 0;
-			z-index: 999999;
-			/* background: #f0f0f0; */
-			background: red;
-			display: flex;
-			flex-direction: column;
-}
-</style>

+ 2 - 5
pages_home/pages/Volunteerside/goodsDetails.vue

@@ -595,13 +595,10 @@ const proceedToPayment = async () => {
     // 定义要发送的数据
     const orderData = {
       orders: {
-        serviceOnePrice: businessPrice.value,
-        serviceTotalPrice: computeMoney.value,
+        // serviceOnePrice: businessPrice.value,
+        // serviceTotalPrice: computeMoney.value,
         serviceCategory: serviceCategory.value,
         totalTimes: totalTimes.value,
-        serviceStartDate: '2025-04-18',
-        startTime: '8:00',
-        serviceDuration: 4,
         paymentMethod: paymentMethod.value,
         volunteerId: volunteerId.value,
         remark: remark.value,

+ 0 - 12
pages_home/pages/Volunteerside/paymentDetails.vue

@@ -1,12 +0,0 @@
-<template>
-  <view>
-    
-  </view>
-</template>
-<script setup>
-
-</script>
-<style scoped>
-
-</style>
-

+ 1 - 1
pages_home/pages/selectAddress/edit.vue

@@ -318,7 +318,7 @@
 
 				// 7. 跳转页面
 				uni.navigateTo({
-					url: '/pages_mine/pages/selectAddress/index'
+					url: '/pages_home/components/volunteerSide/adresss'
 				});
 			} else {
 				uni.showToast({