瀏覽代碼

no message

py 1 年之前
父節點
當前提交
f56de8f684

+ 15 - 7
pages-my/my-balance.vue

@@ -23,7 +23,8 @@
 		</view>
 		<view class="plr-24 box-border-box">
 			<view class="p-24 box-border-box bgc-f sx-box">
-				<picker mode="date" :value="tiem" :start="startDate" :end="endDate" @change="bindDateChange">
+				<picker mode="date" fields="month" :value="tiem" :start="startDate" :end="endDate"
+					@change="bindDateChange">
 					<view class="align-items-center">
 						<view class=" fs-28 fc-0 fw-400 align-items-center mr-8">
 							{{tiem}}
@@ -76,14 +77,14 @@
 			EnBlank
 		},
 		data() {
-			const currentDate = this.getDate({
-				format: true
-			})
+			// const currentDate = this.getDate({
+			// 	format: true
+			// })
 			return {
 				titleId: "0",
 				titleData: [],
 				listData: [],
-				tiem: currentDate,
+				tiem: '',
 				page: 1,
 				total: 0,
 				moneyNum: ''
@@ -98,15 +99,22 @@
 			}
 		},
 		onLoad(data) {
-			if(data) {
+			if (data) {
 				this.moneyNum = data.money
 			}
 		},
 		mounted() {
 			this.moneyStatus()
 			this.moneyList()
+			this.getTime()
 		},
 		methods: {
+			getTime() {
+				const now = new Date();
+				const year = now.getFullYear();
+				const month = now.getMonth() + 1; // 月份从 0 开始,需要加 1
+				this.tiem = `${year}-${month < 10 ? "0" + month : month}`; // 格式化为 YYYY-MM
+			},
 			moneyList() {
 				moneyList({
 					status: this.titleId,
@@ -199,7 +207,7 @@
 	}
 
 	.title-box {
-		min-width: 33.3%;
+		min-width: 28.3%;
 		display: inline-block;
 		height: 70rpx;
 		line-height: 70rpx;

+ 3 - 3
pages-my/my-team.vue

@@ -192,11 +192,11 @@
 				this.listData = [];
 				this.memberClanList();
 			},
-			titleBut(item) {
-				if (item.water_key === this.titleId) {
+			titleBut(num) {
+				if (num === this.titleId) {
 					return
 				}
-				this.titleId = item.water_key
+				this.titleId = num
 				this.page = 1;
 				this.listData = [];
 				this.memberClanList();

+ 93 - 29
pages-order/express-info.vue

@@ -156,7 +156,7 @@
 						配送地址
 					</view>
 					<view class="fs-28 fc-3 w-480 text-align-right">
-						{{infoData.school_name}}{{infoData.dorm_name}}{{infoData.address}}{{infoData.consignee}}{{infoData.consignee_tel}}
+						{{infoData.school_name}}{{infoData.dorm_name}}{{infoData.address}}{{infoData.consignee}}{{infoData.phone}}
 					</view>
 				</view>
 				<!-- 				<view class="display-flex flex-justify-space mb-26">
@@ -230,11 +230,36 @@
 				</view>
 			</view>
 		</scroll-view>
+		<uni-popup ref="popupReason" type="bottom" :is-mask-click="false" background-color="#fff" border-radius="10px 10px 0 0">
+			<view class="popup-reason-box flex-direction">
+				<view class="text-align-center fs-38 fw-600 fc-3 mb-18">
+					选择取消原因
+				</view>
+				<picker-view @change="bindChange" class="picker-view flex-1" :immediate-change='true'>
+					<picker-view-column>
+						<view class="picker-view-item" v-for="(item,index) in refundReason" :key="index">
+							{{item.refund_msg}}
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<view class="align-items-center flex-justify-space plr-24 box-border-box">
+					<view class="flex-1 mr-20 pop-b text-align-center fs-36 b-r-ccc" @click="popCancel">
+						取消
+					</view>
+					<view class="flex-1 pop-b text-align-center bgc-41ABF5 fc-f fs-36" @click="popSure">
+						确定
+					</view>
+				</view>
+			</view>
+		</uni-popup>
 		<SelectAddress ref="selectAddress" @giveAddress='giveAddress'></SelectAddress>
 	</view>
 </template>
 
 <script>
+	import {
+		commonRefundReason
+	} from "@/api/common.js"
 	import {
 		expressOrderInfo,
 		expressOrderCancel,
@@ -265,7 +290,9 @@
 					s: '',
 				},
 				isAJAX: false,
-				address_id: ''
+				address_id: '',
+				refund_msg: '', // 退款理由
+				refundReason: [] //退款原因
 			};
 		},
 		onLoad(data) {
@@ -365,36 +392,46 @@
 					}
 				})
 			},
+			popCancel() {
+				// 退款取消
+				this.$refs.popupReason.close()
+			},
+			popSure() {
+				// 退款确认
+				if (this.isAJAX) {
+					return
+				}
+				this.isAJAX = true;
+				expressOrderCancel({
+					order_id: this.infoData.id,
+					refund_msg: this.refund_msg
+				}).then((res) => {
+					if (res.code == 1) {
+						tools.success(res.msg)
+						this.$refs.popupReason.close()
+						setTimeout(() => {
+							this.expressOrderInfo(this.infoData.id)
+						}, 1500)
+						this.isAJAX = false;
+					} else {
+						tools.error(res.msg)
+						this.isAJAX = false;
+					}
+				})
+			},
+			bindChange(e) {
+				let num = e.detail.value[0]
+				this.refund_msg = this.refundReason[num].refund_msg
+			},
 			cancelOrder() {
 				// 代取取消订单
-				uni.showModal({
-					title: '提示',
-					content: '是否取消订单?',
-					confirmText: '确定',
-					confirmColor: '#FB3D03',
-					success: (res) => {
-						if (res.confirm === true) {
-							if (this.isAJAX) {
-								return
-							}
-							this.isAJAX = true;
-							expressOrderCancel({
-								order_id: this.infoData.id
-							}).then((res) => {
-								if (res.code == 1) {
-									tools.success(res.msg)
-									setTimeout(() => {
-										this.expressOrderInfo(this.infoData.id)
-									}, 1500)
-									this.isAJAX = false;
-								} else {
-									tools.error(res.msg)
-									this.isAJAX = false;
-								}
-							})
-						}
+				commonRefundReason().then((res) => {
+					if (res.code === 1) {
+						this.refundReason = res.data
+						this.refund_msg = res.data[0].refund_msg
 					}
-				});
+				})
+				this.$refs.popupReason.open()
 			},
 			openGoods() {
 				this.goodsShow = !this.goodsShow
@@ -450,6 +487,33 @@
 </script>
 
 <style lang="scss" scoped>
+	.popup-reason-box {
+		width: 100%;
+		height: 45vh;
+		overflow: auto;
+		border-radius: 20rpx 20rpx 0 0;
+		background: #fff;
+		padding: 24rpx 0 0;
+		box-sizing: border-box;
+	}
+	
+	.picker-view {
+		width: 100%;
+		// height: 70%;
+	}
+	
+	.picker-view-item {
+		// height: 90rpx;
+		line-height: 68rpx;
+		text-align: center;
+		background: #F5F5F5;
+	}
+	
+	.pop-b {
+		height: 80rpx;
+		line-height: 80rpx;
+		border-radius: 20rpx;
+	}
 	.finish_image {
 		width: 34rpx;
 		height: 34rpx;

+ 1 - 0
pages-order/run-errands-info.vue

@@ -377,6 +377,7 @@
 				commonRefundReason().then((res) => {
 					if (res.code === 1) {
 						this.refundReason = res.data
+						this.refund_msg = res.data[0].refund_msg
 					}
 				})
 				this.$refs.popupReason.open()

+ 13 - 1
pages-takeout/run-errands-mod/pay-page.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="flex-common-css iPhone-bottom flex-common-css box-border-box">
+	<view class="flex-common-css iPhone-bottom flex-common-css box-border-box" v-if="isShow">
 		<Nav title="订单支付" bgckgroundBox='transparent'></Nav>
 		<scroll-view :scroll-y="true" class="box-sizing-border scroll-view-css plr-30 box-border-box">
 			<view class="fs-28 fc-121212 mb-20 p-t-40 text-align-center">
@@ -51,6 +51,8 @@
 				立即支付¥{{Number(payData.pay_money).toFixed(2) || '0.00'}}
 			</view>
 		</scroll-view>
+		<page-container :show="isShow" :overlay="false" @beforeleave="onBeforeLeave">
+		</page-container>
 	</view>
 </template>
 
@@ -74,6 +76,7 @@
 					m: '',
 					s: '',
 				},
+				isShow: true
 			}
 		},
 		onLoad(data) {
@@ -82,8 +85,17 @@
 				this.errandsOrderPayInfo()
 			}
 		},
+		onUnload() {
+			console.log('onUnloadonUnloadonUnloadonUnload');
+		},
 		mounted() {},
 		methods: {
+			onBeforeLeave() {
+				this.isShow = false;
+				uni.switchTab({
+					url: "/pages/order/index",
+				});
+			},
 			errandsOrderPayInfo() {
 				errandsOrderPayInfo({
 					order_id: this.order_id

+ 25 - 2
pages-takeout/run-errands.vue

@@ -129,7 +129,7 @@
 					</view>
 					<view class="">
 						<input v-model="formData.reward_money" type="digit" cursor-spacing='20' class="uni-input"
-							placeholder="自定义金额 0~1000" @blur="amountNum" />
+							placeholder="自定义金额 0~1000" @blur="amountNum" @input="handleInput" />
 					</view>
 				</view>
 			</view>
@@ -287,7 +287,7 @@
 		methods: {
 			goToUrl() {
 				errandsCreate(this.formData).then((res) => {
-					if(res.code === 1) {
+					if (res.code === 1) {
 						uni.redirectTo({
 							url: `/pages-takeout/run-errands-mod/pay-page?orderId=${res.data.order_id}`
 						});
@@ -298,6 +298,29 @@
 				this.formData.is_up = num
 				this.amountNum()
 			},
+			handleInput(event) {
+				let value = event.detail.value;
+				// 只允许数字和小数点
+				value = value.replace(/[^0-9.]/g, '');
+				// 禁止输入多个小数点
+				const parts = value.split('.'); // 按小数点分割字符串
+				if (parts.length > 2) { // 如果小数点数量超过1个
+					value = parts[0] + '.' + parts.slice(1).join(''); // 只保留第一个小数点
+				}
+				// 限制小数位数最多为1位
+				if (parts.length === 2 && parts[1].length > 1) {
+					value = parts[0] + '.' + parts[1].charAt(0); // 只保留第一位小数
+					tools.error('金额只会保留一位小数')
+				}
+				// 禁止以0开头的多个0(例如:001 -> 1)
+				value = value.replace(/^0+(\d+)/, '$1');
+				// 更新输入框的值
+				this.formData.reward_money = value;
+				// 手动触发 input 事件,确保 v-model 更新
+				this.$nextTick(() => {
+					event.target.value = value; // 更新输入框的实际值
+				});
+			},
 			amountNum() {
 				this.amount = 0
 				if (this.errandsData.price) {

+ 6 - 0
pages/index/search-list.vue

@@ -123,6 +123,12 @@
 			this.getList()
 		},
 		methods: {
+			goFeedback() {
+				// 问题反馈
+				uni.navigateTo({
+					url: '/pages-my/feedback'
+				})
+			},
 			search() {
 				this.fromData.page = 1;
 				this.list = [];