Просмотр исходного кода

1. 货拉拉图标更换 2. 实现跑腿添加小费

shizhongqi 8 месяцев назад
Родитель
Сommit
36883a467c

+ 1 - 1
ghsApp/src/admin/delivery/allDelivery.vue

@@ -524,7 +524,7 @@ export default {
 
   .remark-input {
     flex-shrink: 0;
-    width: 200upx;
+    width: 500upx;
     input {
       width: 100%;
       height: 40upx;

+ 8 - 2
ghsApp/src/admin/delivery/components/PlatformItem.vue

@@ -3,7 +3,10 @@
 	<view class="card-body">
 		<view class="top-content">
 			<view class="left-info">
-				<text class="platform-logo">{{ platform.logo }}</text>
+				<view class="platform-logo">
+					<zui-svg-icon v-if="platform.id == 'huolala'" icon="general-huolala" :width="100" :height="100" />
+					<text v-else>{{ platform.logo }}</text>
+				</view>
 				<view class="info">
 					<view class="title-line">
 						<text class="platform-name">{{ platform.name }}</text>
@@ -29,7 +32,7 @@
 		<view class="bottom-content">
 			<view class="actions">
 				<template v-if="platform.is_authorized">
-					<button class="action-btn" @click="handleRecharge">充值</button>
+					<!-- <button class="action-btn" @click="handleRecharge">充值</button> -->
 					<button class="action-btn secondary-btn" @click="handleShop">门店</button>
 					<button class="action-btn secondary-btn" @click="handleCancelAuth">取消授权</button>
 				</template>
@@ -109,6 +112,9 @@ export default {
 	font-size: 72rpx;
 	text-align: center;
 	line-height: 96rpx;
+	display: flex;
+	align-items: center;
+	justify-content: center;
 }
 
 .info {

+ 13 - 6
ghsApp/src/admin/delivery/deliveryManage.vue

@@ -38,7 +38,10 @@
 						class="addable-platform-item"
 						@click="handleAuthorize(platform)"
 					>
-						<text class="platform-logo">{{ platform.logo }}</text>
+						<view class="platform-logo">
+							<zui-svg-icon v-if="platform.id == 'huolala'" icon="general-huolala" :width="90" :height="90" style="margin-top: 10rpx;" />
+							<text v-else>{{ platform.logo }}</text>
+						</view>
 						<text>{{ platform.name }}</text>
 					</view>
 				</scroll-view>
@@ -150,6 +153,8 @@ export default {
 				const res = await getAuthUrl(platform.id);
 				const authUrl = res.data.url;
 				uni.navigateTo({ url: `/common/webview?url=${encodeURIComponent(authUrl)}` });
+				// 关闭弹窗
+				this.closeAddAuthModal();
 			} catch (error) {
 				console.error('获取授权链接失败', error);
 				uni.showToast({
@@ -242,18 +247,20 @@ export default {
 		.addable-platform-item {
 			display: flex;
 			align-items: center;
-			padding: 24rpx 32rpx;
+			padding: 14rpx 32rpx;
             font-size: 30rpx;
 			&:active {
 				background-color: #f9f9f9;
 			}
 			.platform-logo {
-				width: 64rpx;
-				height: 64rpx;
+				width: 90rpx;
+				height: 90rpx;
 				margin-right: 24rpx;
 				font-size: 48rpx;
-				text-align: center;
-				line-height: 64rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				flex-shrink: 0;
 			}
 		}
 	}

+ 9 - 2
ghsApp/src/api/express/delivery.js

@@ -11,14 +11,14 @@ export const address = data => {
  * 获取配送平台报价
  */
 export const getDeliveryQuotes = data => {
-	return https.post('/delivery/all-delivery-quotes', data) //?XDEBUG_SESSION_START=PHPSTORM
+	return https.post('/delivery/all-delivery-quotes?XDEBUG_SESSION_START=PHPSTORM', data) //?XDEBUG_SESSION_START=PHPSTORM
 }
 
 /**
  * 创建配送单
  */
 export const createDeliveryOrder = data => {
-	return https.post('/delivery/create-order', data)
+	return https.post('/delivery/create-order?XDEBUG_SESSION_START=PHPSTORM', data)
 }
 
 /**
@@ -54,4 +54,11 @@ export const getAuthUrl = (platformId) => {
  */
 export const cancelAuth = data => {
 	return https.get('/delivery/cancel-auth', data)
+}
+
+/**
+ * 添加小费
+ */
+export const addTip = data => {
+	return https.post('/delivery/add-tip?XDEBUG_SESSION_START=PHPSTORM', data)
 }

+ 67 - 0
ghsApp/src/assets/svg-icons/general/huolala.svg

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 509.95 185.58" style="enable-background:new 0 0 509.95 185.58;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FF6600;}
+	.st1{fill:#FF6600;}
+</style>
+<g id="XMLID_432_">
+	<g>
+		<path id="XMLID_00000048492103898848022470000002636802640927616152_" class="st0" d="M368.68,119.61
+			c-5.31,0-10.62-0.01-15.93,0.01c-0.53,0-1.2-0.05-1.6,0.22c-0.56,0.37-1.24,1.05-1.31,1.55c-0.07,0.5,0.44,1.01,0.88,1.35
+			c0.25,0.2,0.85,0.1,1.3,0.1c10.53,0,21.07,0,31.61,0c0.25,0,0.5,0.01,0.74,0c1.19-0.06,2.16-0.75,2.37-1.67
+			c0.19-0.88-0.39-1.52-1.52-1.54c-3.17-0.03-6.33-0.01-9.5-0.01C373.37,119.61,371.02,119.61,368.68,119.61z"/>
+		<polygon id="XMLID_00000093146156082331567190000000583284178936127107_" class="st1" points="215.57,127.11 270.56,127.11 
+			268.22,133.7 213.23,133.69 		"/>
+		<polygon id="XMLID_00000044145819168257151990000008128597161069231515_" class="st1" points="302.48,127.11 350.4,127.11 
+			348.06,133.7 300.14,133.69 		"/>
+		<path id="XMLID_00000180365512816012061660000002459407464689100947_" class="st0" d="M193.37,141.57
+			c-0.66-0.22-1.37-0.38-1.98-0.67c-3.31-1.57-4.31-5.57-2.37-9.43c1.99-3.98,6.3-6.75,10.14-6.53c4.17,0.24,6.61,3.24,6,7.36
+			c-0.63,4.31-4.68,8.33-9.16,9.12c-0.16,0.03-0.33,0.1-0.49,0.15C194.79,141.57,194.09,141.57,193.37,141.57z M197.78,129.12
+			c-2.3,0.01-4.66,1.84-5.25,4.09c-0.62,2.31,0.73,4.2,3.01,4.2c2.3,0,4.68-1.88,5.27-4.18
+			C201.39,130.91,200.07,129.11,197.78,129.12z"/>
+		<path id="XMLID_00000140716724942046175930000000900059156748826041_" class="st0" d="M281.5,141.57
+			c-0.67-0.22-1.36-0.38-1.97-0.67c-3.31-1.57-4.31-5.57-2.37-9.43c2-3.98,6.3-6.75,10.14-6.53c4.16,0.24,6.61,3.24,6,7.36
+			c-0.64,4.31-4.69,8.33-9.16,9.12c-0.16,0.03-0.33,0.1-0.49,0.15C282.92,141.57,282.21,141.57,281.5,141.57z M285.9,129.12
+			c-2.3,0.01-4.65,1.84-5.25,4.09c-0.62,2.31,0.73,4.2,3.01,4.2c2.3,0,4.67-1.88,5.27-4.18
+			C289.52,130.91,288.19,129.11,285.9,129.12z"/>
+		<path id="XMLID_00000037651357784468350430000012874001864553225095_" class="st0" d="M372.89,102.38c4.12,0,8.24,0,12.36-0.01
+			c0.32,0,0.64-0.01,0.97-0.07c0.71-0.14,1.24-0.7,1.47-1.55c0.23-0.86,0.01-1.42-0.63-1.56c-0.29-0.07-0.62-0.08-0.93-0.08
+			c-8.29,0-16.59,0-24.88,0c-0.12,0-0.23,0-0.35,0c-1.08,0.05-1.8,0.63-2.06,1.69c-0.24,1,0.14,1.58,1.18,1.58
+			C364.31,102.38,368.6,102.38,372.89,102.38z"/>
+		<path id="XMLID_00000091013039996830199620000008275939798746763455_" class="st0" d="M387.77,68.2c3.82,0,7.64,0.01,11.46-0.01
+			c0.34,0,0.76,0.07,1.06-0.19c0.43-0.38,0.99-1.04,1.1-1.55c0.11-0.5-0.2-1.04-0.45-1.39c-0.15-0.21-0.54-0.12-0.83-0.12
+			c-7.61,0-15.23,0-22.85,0c-1.28,0-1.95,0.51-2.24,1.67c-0.27,1.11,0.14,1.58,1.37,1.58C380.18,68.2,383.98,68.2,387.77,68.2z"/>
+		<path id="XMLID_00000054224960888330107960000006299945070404939196_" class="st0" d="M387.13,80.8c-5.32,0-10.64,0-15.96,0
+			c-0.38,0.01-0.76,0.01-1.14,0.04c-0.95,0.08-1.66,0.62-1.94,1.52c-0.3,0.97,0.14,1.53,1.05,1.68c0.31,0.05,0.67,0.03,1.01,0.03
+			c10.75,0,21.51,0,32.27,0c0.19,0,0.38,0.01,0.57,0c1.22-0.06,2.1-0.66,2.37-1.63c0.27-0.97-0.25-1.62-1.46-1.63
+			c-3.13-0.03-6.27-0.01-9.4-0.01C392.04,80.8,389.59,80.8,387.13,80.8z"/>
+		<path id="XMLID_00000160900928355896556190000017681905224845258884_" class="st1" d="M116.76,88.44l4.96-13.96h-8.61l17.29-22.72
+			h19.57l-8.44,11.01h3.48l-9.12,25.67H116.76z M102.78,117.74h14.26l-17.86,9.62H94.4l-2.19,6.15l25.4,0l19.39-10.49l11.84,10.49
+			h31.58l2.19-6.16h-10.97l-11.01-9.62h14.35l9.62-27.05H112.4L102.78,117.74z M135.14,99.62l-3.7,10.4l-8.06,4.34l6.1-17.17l33.4,0
+			l-6.11,17.17l-4.98-4.34l3.7-10.4L135.14,99.62z M164.33,51.75l-6.07,17.08l-13.48,2.69l-2.34,6.59l13.48-2.68l-4.62,13.01h39.14
+			l2.34-6.59h-18.61l3.89-10.93l20.15-4.07l2.34-6.59l-20.15,4.08l4.47-12.58H164.33z"/>
+		<polygon id="XMLID_00000020368313016471440660000006079182077116345754_" class="st1" points="238.69,62.07 252,62.07 
+			255.45,52.36 276.85,52.36 273.39,62.07 286.61,62.07 284.27,68.66 236.35,68.66 		"/>
+		<polygon id="XMLID_00000032640222204412491080000010081856263758519936_" class="st1" points="252.66,74.39 238.21,122.85 
+			221.43,122.85 235.79,74.39 		"/>
+		<polygon id="XMLID_00000088826360638897065270000006817045567586200979_" class="st1" points="280.76,74.39 260.66,122.85 
+			243.87,122.85 263.89,74.39 		"/>
+		<polygon id="XMLID_00000181787296566684400510000010895106936971445695_" class="st1" points="325.6,62.07 338.91,62.07 
+			342.36,52.36 363.76,52.36 360.3,62.07 373.52,62.07 371.18,68.66 323.26,68.66 		"/>
+		<polygon id="XMLID_00000117651975536130126820000003932797446573212289_" class="st1" points="339.57,74.39 325.13,122.85 
+			308.34,122.85 322.7,74.39 		"/>
+		<polyline id="XMLID_00000052803916734376323210000003597828216140554626_" class="st1" points="347.56,122.85 330.78,122.85 
+			350.79,74.39 367.66,74.39 347.56,122.85 		"/>
+		<path id="XMLID_00000031925879865044634170000001011659252927894416_" class="st1" d="M318.19,74.04l2.38-6.67h-5.92l5.74-16.12
+			h-19.48l-5.73,16.12h-5.65l-2.38,6.67h5.66l-10.08,28.36l-6.05,1.12l-2.37,6.68l6.08-1.21l-5.55,15.61
+			c-0.49,1.39-2.37,2.52-4.11,2.52h-1.83l-2.34,6.59l8.18-0.11c0.2-0.82,0.5-1.65,0.91-2.48c2.39-4.77,7.56-8.1,12.17-7.84
+			c2.6,0.15,4.64,1.21,5.9,2.88c0.12-0.26,0.24-0.51,0.33-0.78l7.28-20.46l6.38-1.3l2.34-6.59l-6.38,1.3l8.63-24.28H318.19z"/>
+		<path id="XMLID_00000063594458554206983060000000737241602470939807_" class="st1" d="M231.37,74.04l2.38-6.67h-5.92l5.73-16.12
+			h-19.48l-5.74,16.12h-5.65l-5.81,6.67h9.09l-10.08,28.36l-6.05,1.12l-2.37,6.68l6.09-1.21L188,124.59
+			c-0.49,1.39-2.38,2.52-4.11,2.52l-1.92,0.26l-2.19,6.16l6.83,0c0.19-0.8,0.48-1.6,0.88-2.41c2.4-4.77,7.56-8.1,12.17-7.84
+			c3.14,0.18,5.46,1.67,6.58,3.98c0.4-0.6,0.73-1.23,0.95-1.88l7.28-20.46l6.37-1.3l2.35-6.59l-6.38,1.3l8.63-24.28H231.37z"/>
+	</g>
+</g>
+</svg>

+ 179 - 1
ghsApp/src/pagesOrder/detail.vue

@@ -37,6 +37,15 @@
 							<button class="admin-button-com mini-btn" v-if="detailInfo.sendStatus == '-1'" @click.stop="openExpressPage()">重叫跑腿</button>
 						</view>
 					</view>
+					<view class="msg-list express-progress-row">
+						<view class="label">小费:</view>
+						<view class="value">
+							{{ detailInfo.sendTip }}
+						</view>
+						<view class="express-actions">
+							<button class="admin-button-com mini-btn" v-if="canAddTip(detailInfo.sendStatus)" @click.stop="addTip(detailInfo.id, detailInfo.deliveryId)">添加小费</button>
+						</view>
+					</view>
 				</view>
 			</view>
 
@@ -543,6 +552,29 @@
 			</view>
 		</uni-popup>
 
+		<!-- 添加小费弹窗 -->
+		<uni-popup ref="tipModalRef" type="center" background-color="#fff" :animation="false" class="class-popup-style">
+			<view class="tip-modal-content">
+				<view class="tip-modal-title">添加小费</view>
+				<view class="tip-modal-body">
+					<view class="tip-input-group">
+						<text class="tip-label">小费金额 (元)</text>
+						<input
+							v-model.number="tipAmount"
+							type="digit"
+							class="tip-input"
+							placeholder="请输入整数金额"
+							@keyup="validateTipAmount"
+						/>
+					</view>
+				</view>
+				<view class="tip-modal-actions">
+					<button class="btn-cancel" @click="closeTipModal">取消</button>
+					<button class="btn-confirm" @click="confirmAddTip">确认</button>
+				</view>
+			</view>
+		</uni-popup>
+
 	</view>
 </template>
 <script>
@@ -565,7 +597,7 @@ import ModalModule from "@/components/plugin/modal"
 import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
 import { getCgExpressTrack,expressDetail } from "@/api/express"
 import { cancelCallExpressOrder,mockNotify } from '@/api/shop/shop-express'
-import { cancelDeliveryOrder, getCancelReason } from '@/api/express/delivery'
+import { cancelDeliveryOrder, getCancelReason, addTip as addTipApi } from '@/api/express/delivery'
 export default {
 	name: "orderDetail",
 	components: {
@@ -614,6 +646,11 @@ export default {
 			selectedCancelReasonCode: null,
 			otherCancelReason: '',
 			currentExpressInfo: {},
+			// 小费弹窗相关
+			showTipModal: false,
+			tipAmount: '',
+			tipOrderId: 0,
+			tipDeliveryId: '',
 			// 配送状态映射
 			sendStatusMap: {
 				'-4': { text: '没有叫跑腿', color: '#999' },
@@ -812,6 +849,54 @@ export default {
 		canCancelExpress(status) {
 			return ['0', '1', '2', '3', '4', '10', '20', '30'].includes(String(status));
 		},
+		//判断是否可以添加小费
+		canAddTip(status) {
+			return ['0', '1', '2', '10'].includes(String(status));
+		},
+		//添加小费 - 打开弹窗
+		addTip(orderId, deliveryId) {
+			this.tipOrderId = orderId;
+			this.tipDeliveryId = deliveryId;
+			this.tipAmount = '';
+			this.$refs.tipModalRef.open();
+		},
+		//关闭小费弹窗
+		closeTipModal() {
+			this.$refs.tipModalRef.close();
+			this.tipAmount = '';
+		},
+		//验证小费金额
+		validateTipAmount() {
+			// 只允许整数
+			if (this.tipAmount && !Number.isInteger(this.tipAmount)) {
+				this.tipAmount = Math.floor(this.tipAmount);
+			}
+		},
+		//确认添加小费
+		confirmAddTip() {
+			if (!this.tipAmount || this.tipAmount <= 0) {
+				this.$msg('请输入有效的小费金额');
+				return;
+			}
+			
+			// 调用API添加小费
+			addTipApi({
+				ghsOrderId: this.tipOrderId,
+				platform: this.tipDeliveryId,
+				tips: this.tipAmount
+			}).then(res => {
+				if (res.code === 1) {
+					this.$msg('添加小费成功');
+					this.closeTipModal();
+					this.init();
+				} else {
+					this.$msg(res.msg);
+				}
+			}).catch(err => {
+				console.error('添加小费失败', err);
+				this.$msg('添加小费失败');
+			});
+		},
 		//获取配送状态文本
 		getSendStatusText(status) {
 			const statusStr = String(status);
@@ -1983,4 +2068,97 @@ export default {
     background-color: #3385ff;
     color: #fff;
 }
+
+/* 小费弹窗样式 */
+.tip-modal-content {
+	width: 600rpx;
+	background-color: #fff;
+	border-radius: 12rpx;
+	padding: 0;
+	box-sizing: border-box;
+	overflow: hidden;
+}
+
+.tip-modal-title {
+	font-size: 32rpx;
+	font-weight: bold;
+	text-align: center;
+	padding: 30rpx;
+	border-bottom: 1rpx solid #eee;
+}
+
+.tip-modal-body {
+	padding: 30rpx;
+}
+
+.tip-input-group {
+	display: flex;
+	flex-direction: column;
+	gap: 12rpx;
+}
+
+.tip-label {
+	font-size: 28rpx;
+	color: #333;
+	font-weight: 500;
+}
+
+.tip-input {
+	width: 100%;
+	height: 80rpx;
+	border: 1rpx solid #ddd;
+	border-radius: 8rpx;
+	padding: 0 20rpx;
+	font-size: 28rpx;
+	box-sizing: border-box;
+	background-color: #f9f9f9;
+}
+
+.tip-input:focus {
+	border-color: #3385ff;
+	background-color: #fff;
+}
+
+.tip-modal-actions {
+	display: flex;
+	gap: 16rpx;
+	padding: 20rpx 30rpx 30rpx;
+	border-top: 1rpx solid #eee;
+}
+
+.btn-cancel {
+	flex: 1;
+	height: 70rpx;
+	line-height: 70rpx;
+	text-align: center;
+	border-radius: 8rpx;
+	font-size: 28rpx;
+	background-color: #f0f0f0;
+	color: #333;
+	border: none;
+	margin: 0;
+}
+
+.btn-confirm {
+	flex: 1;
+	height: 70rpx;
+	line-height: 70rpx;
+	text-align: center;
+	border-radius: 8rpx;
+	font-size: 28rpx;
+	background-color: #3385ff;
+	color: #fff;
+	border: none;
+	margin: 0;
+}
+
+.btn-confirm:active {
+	background-color: #0056b3;
+	transform: scale(0.98);
+}
+
+.btn-cancel:active {
+	background-color: #e0e0e0;
+	transform: scale(0.98);
+}
 </style>

Разница между файлами не показана из-за своего большого размера
+ 2 - 1
ghsApp/src/static/svg-icons-lib.js


Некоторые файлы не были показаны из-за большого количества измененных файлов