Explorar el Código

feat:修改隐私合规问题,修改下单默认一小时内下单失败问题,修改只能识别地址问题

颜琼丽 hace 23 horas
padre
commit
9020022653

+ 1 - 3
jd_logistics-app/App.vue

@@ -1,12 +1,10 @@
 <script setup>
 import { onShow, onLaunch, onHide } from "@dcloudio/uni-app"
-import { getLocation, getNavbarHeight, uniLogin, getUserInfo } from "@/utils/util.js";
+import { getNavbarHeight, getUserInfo } from "@/utils/util.js";
 onLaunch((e)=>{
 	console.log('App1 Launch',e)
 	// 获取系统信息
  	getNavbarHeight();
-	// getLocation(false);
-	// uniLogin();
 	getUserInfo();
 });
 onShow(()=>{

+ 22 - 14
jd_logistics-app/pages/address/edit.vue

@@ -7,10 +7,14 @@
 			</view>
 
 			<view class="form-item">
-				<view class="search-btn" @click="handleSearch">
+				<view class="search-btn" v-if='!textArea' @click="handleSearch(1)">
 					粘贴并识别
 				</view>
+				<view class="search-btn" v-else @click="handleSearch(2)">
+					识别
+				</view>
 			</view>
+			<text>识别后,请检查拆分地址信息是否准确,如有遗漏请及时补充</text>
 		</view>
 
 		<!-- 物品信息 -->
@@ -118,8 +122,9 @@
 		getAddressList()
 	});
 
+
 	// 粘贴并识别功能
-	const handleSearch = async () => {
+	const handleSearch = async (type) => {
 		try {
 			// 1. 读取剪贴板内容
 			const clipboardText = await new Promise((resolve, reject) => {
@@ -129,16 +134,18 @@
 				});
 			});
 
-			if (!clipboardText) {
-				uni.showToast({
-					title: '剪贴板内容为空',
-					icon: 'none'
-				});
-				return;
-			}
+			if (type == 1) {
+				if (!clipboardText) {
+					uni.showToast({
+						title: '剪贴板内容为空',
+						icon: 'none'
+					});
+					return;
+				}
 
-			// 可选:将剪贴板内容显示到文本域中,方便用户查看
-			textArea.value = clipboardText;
+				// 可选:将剪贴板内容显示到文本域中,方便用户查看
+				textArea.value = clipboardText;
+			}
 
 			uni.showLoading({
 				title: '识别中...',
@@ -147,7 +154,7 @@
 
 			// 2. 调用接口解析地址
 			const params = {
-				param: clipboardText
+				param: textArea.value
 			}; // 根据后端接口要求调整参数格式
 			const res = await getAddressInfo(params);
 			uni.hideLoading();
@@ -195,7 +202,7 @@
 				}
 
 				uni.showToast({
-					title: '识别成功',
+					title: '识别成功,请核对地址信息',
 					icon: 'success'
 				});
 			} else {
@@ -430,7 +437,7 @@
 	}
 
 	.input-field-textarea {
-		height: 200rpx;
+		height: 150rpx;
 		line-height: 48rpx;
 		font-size: 28rpx;
 		color: #333;
@@ -449,6 +456,7 @@
 
 		.placeholder {
 			color: #999;
+		line-height: 48rpx;
 		}
 	}
 

+ 177 - 14
jd_logistics-app/pages/index/index.vue

@@ -22,11 +22,9 @@
 					搜索
 				</view>
 			</view>
-
 		</view>
 
 		<view class="btn-container">
-
 			<view class="btn-item" @click="handleExpress('1')">
 				<image class="button-icon" src="/static/img/index-un-time.png" />
 				<view class="button-right">
@@ -35,29 +33,41 @@
 				</view>
 			</view>
 
-			<!-- 		<view class="btn-item" @click="handleExpress('2')">
-				<image class="button-icon" src="/static/img/index-time.png" />
-				<view class="button-right">
-					<view class="button-title">瑞鲸速达(顺丰)</view>
-					<view class="button-desc">一小时下单取件</view>
-				</view>
-
-			</view> -->
-
 			<view class="btn-item" @click="showExpressDialog">
 				<image class="button-icon" src="/static/img/index-personal.png" />
 				<view class="button-right">
 					<view class="button-title">个人寄件</view>
 					<view class="button-desc">支持顺丰和京东</view>
 				</view>
-
 			</view>
-
 		</view>
 
-		<!-- 使用 u-popup 弹框组件 -->
+		<!-- 使用 u-popup 弹框组件(个人寄件) -->
 		<PersonalExpressDialog :visible="showDialog" @update:visible="showDialog = $event"
 			@select="handleExpressSelect" />
+
+		<!-- ========== 新增:隐私协议弹框 ========== -->
+		<u-popup :show="showPrivacyDialog" mode="center" :round="10" :closeable="false" :safeAreaInsetBottom="false">
+			<view class="privacy-dialog">
+				<view class="title">温馨提示</view>
+				<view class="content">
+					欢迎使用本小程序。在使用我们的服务前,请您仔细阅读并同意以下协议:
+				</view>
+				<view class="protocol-links">
+					<text class="link" @click="goToProtocol('user')">《用户协议》</text>
+					<text class="and">与</text>
+					<text class="link" @click="goToProtocol('privacy')">《隐私协议》</text>
+				</view>
+				<view class="content">
+					点击“同意”即表示您已阅读并同意上述协议的全部条款。
+				</view>
+				<view class="btn-group">
+					<button class="btn reject" @click="onReject">拒绝</button>
+					<button class="btn agree" @click="onAgree">同意</button>
+				</view>
+			</view>
+		</u-popup>
+		<!-- ========== 新增结束 ========== -->
 	</view>
 </template>
 
@@ -79,6 +89,77 @@
 		quickLogin
 	} from "@/utils/util.js";
 
+	// ========== 新增:隐私协议相关常量和方法 ==========
+	// 协议远程地址(请替换为实际线上地址)
+	const USER_PROTOCOL_URL = 'https://rjsd.mychery.com/user_agreement.html'
+	const PRIVACY_PROTOCOL_URL = 'https://rjsd.mychery.com/privacy_policy.html'
+
+	// 控制协议弹框显示
+	const showPrivacyDialog = ref(false)
+
+	/**
+	 * 显示协议弹框
+	 */
+	function showPrivacyModal() {
+		showPrivacyDialog.value = true
+	}
+
+	/**
+	 * 关闭弹框
+	 */
+	function closeDialog() {
+		showPrivacyDialog.value = false
+	}
+
+	/**
+	 * 跳转到协议详情页(使用 WebView)
+	 * @param {string} type 'user' 或 'privacy'
+	 */
+	function goToProtocol(type) {
+		const url = type === 'user' ? USER_PROTOCOL_URL : PRIVACY_PROTOCOL_URL
+		uni.navigateTo({
+			url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
+		})
+	}
+
+	/**
+	 * 用户点击“同意”
+	 */
+	function onAgree() {
+		try {
+			uni.setStorageSync('privacyAgreed', true)
+			closeDialog()
+		} catch (e) {
+			console.error('存储失败', e)
+			uni.showToast({ title: '操作失败,请重试', icon: 'none' })
+		}
+	}
+
+	/**
+	 * 用户点击“拒绝”
+	 */
+	function onReject() {
+		closeDialog()
+		uni.exitMiniProgram({
+			success: function() {
+				console.log('退出小程序成功');
+			},
+			fail: function(err) {
+				console.log('退出小程序失败', err);
+				uni.showToast({
+					title: '无法退出,请同意协议',
+					icon: 'none'
+				})
+				// 重新弹出协议框
+				setTimeout(() => {
+					showPrivacyModal()
+				}, 300)
+			}
+		})
+	
+	}
+	// ========== 新增结束 ==========
+
 	const showDialog = ref(false)
 
 	// 轮播图数据
@@ -90,6 +171,19 @@
 
 	onShow(() => {
 		getBannerList()
+
+		// ========== 新增:每次显示首页时检查协议状态 ==========
+		try {
+			const agreed = uni.getStorageSync('privacyAgreed')
+			if (!agreed) {
+				// 首次使用或未同意,显示协议弹框
+				showPrivacyModal()
+			}
+		} catch (error) {
+			console.error('读取存储失败', error)
+			showPrivacyModal()
+		}
+		// ========== 新增结束 ==========
 	})
 
 	const getBannerList = () => {
@@ -367,4 +461,73 @@
 
 
 	}
+
+	.privacy-dialog {
+		width: 600rpx;
+		padding: 40rpx 30rpx;
+		background-color: #fff;
+		border-radius: 20rpx;
+		box-sizing: border-box;
+
+		.title {
+			font-size: 36rpx;
+			font-weight: bold;
+			text-align: center;
+			margin-bottom: 30rpx;
+			color: #333;
+		}
+
+		.content {
+			font-size: 28rpx;
+			color: #666;
+			line-height: 1.6;
+			margin-bottom: 20rpx;
+		}
+
+		.protocol-links {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			margin: 20rpx 0;
+			font-size: 30rpx;
+
+			.link {
+				color: #1B64F0;
+				// text-decoration: underline;
+				padding: 0 10rpx;
+			}
+
+			.and {
+				color: #666;
+			}
+		}
+
+		.btn-group {
+			display: flex;
+			justify-content: space-between;
+			margin-top: 40rpx;
+
+			.btn {
+				flex: 1;
+				height: 80rpx;
+				line-height: 80rpx;
+				text-align: center;
+				border-radius: 40rpx;
+				font-size: 30rpx;
+				margin: 0 15rpx;
+
+				&.reject {
+					background-color: #f5f5f5;
+					color: #999;
+					border: 1px solid #ddd;
+				}
+
+				&.agree {
+					background-color: #1B64F0;
+					color: #fff;
+					border: none;
+				}
+			}
+		}
+	}
 </style>

+ 15 - 1
jd_logistics-app/pages/mine/mine.vue

@@ -164,8 +164,22 @@ const dept = computed(() => {
 	return appStore.userInfo?.dept?.deptName || "";
 });
 
+// 修改 userAccount 脱敏展示
 const userAccount = computed(() => {
-	return  appStore.userInfo?.userName || appStore.userInfo?.phonenumber || '';
+    const raw = appStore.userInfo?.userName || appStore.userInfo?.phonenumber || '';
+    if (!raw) return '';
+    // 脱敏处理
+    if (/^\d{11}$/.test(raw)) {
+        // 手机号:前3后4
+        return raw.slice(0, 3) + '****' + raw.slice(-4);
+    } else {
+        // 其他字符串
+        if (raw.length <= 4) {
+            return raw;
+        } else {
+            return raw.charAt(0) + '****' + raw.charAt(raw.length - 1);
+        }
+    }
 });
 
 onShareAppMessage((res) => {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 441 - 580
jd_logistics-app/pages/order/create_order.vue