Browse Source

修改测试环境域名

qmj 3 months ago
parent
commit
79e100eeda

+ 1 - 1
App.vue

@@ -20,7 +20,7 @@
 			sj: {},
 			iosfl: {},
 			baseImagurl: 'https://api.cityexpress168.com.vn', //生产环境
-			// baseImagurl:'https://api.amazeway.com.cn',//预发布
+			// baseImagurl:'https://cteapi.waimai-paotui.com',//预发布
 			token: '',
 			imViewOpen: false,
 			EXViewOpen: false,

+ 2 - 2
config/index.config.js

@@ -3,8 +3,8 @@ const CONFIG = {
 	development: {
 		assetsPath: '/static', // 静态资源路径
 		qqMapKey: '',
-		// baseUrl: 'https://api.amazeway.com.cn',
-		// hostUrl: 'https://api.amazeway.com.cn', // H5地址(前端运行地址)
+		// baseUrl: 'https://cteapi.waimai-paotui.com',
+		// hostUrl: 'https://cteapi.waimai-paotui.com', // H5地址(前端运行地址)
 		baseUrl: 'https://api.cityexpress168.com.vn', // 后台接口请求地址https://backend.cityexpress168.com.vn
 		hostUrl: 'https://api.cityexpress168.com.vn', // H5地址(前端运行地址)https://backend.cityexpress168.com.vn
 		websocketUrl: '', // websocket服务端地址

+ 21 - 1
locale/en.json

@@ -20,5 +20,25 @@
   "api.message": "Message",
   "schema.name": "Name",
   "schema.add": "Add",
-  "schema.add-success": "Add success"
+  "schema.add-success": "Add success",
+  "comp.quxiao": "Cancel",
+  "comp.queren": "Confirm",
+  "jiesuan.xiazapp": "Please download APP to get full functionality",
+  "jiesuan.xzios": "Download iOS version",
+  "jiesuan.xiazandriod": "Download Android version",
+  "download.downloading": "Downloading application...",
+  "download.downloading_progress": "Downloading {progress}%",
+  "download.download_failed": "Download failed, please try again",
+  "download.download_failed_manual": "Automatic download failed, do you want to download manually?",
+  "download.download_complete": "Download complete",
+  "download.install_confirm": "Application downloaded, do you want to install now?",
+  "download.install_success": "Installation successful",
+  "download.install_failed": "Installation failed",
+  "download.install_failed_manual": "Automatic installation failed, please install manually. Do you want to open file manager?",
+  "download.manual_install_hint": "Please click the downloaded file to install",
+  "download.app_store_success": "App Store opened successfully",
+  "download.app_store_failed": "Failed to open App Store, trying browser",
+  "download.app_opened_success": "App opened successfully",
+  "download.app_not_installed": "App not installed, starting download",
+  "order.xindd": "You have a new order"
 }

+ 21 - 1
locale/ja.json

@@ -19,5 +19,25 @@
   "index.language-change-confirm": "この設定を適用すると、アプリが再起動します",
   "api.message": "メッセージ",
   "schema.add": "追加",
-  "schema.add-success": "成功を追加"
+  "schema.add-success": "成功を追加",
+  "comp.quxiao": "キャンセル",
+  "comp.queren": "確認",
+  "jiesuan.xiazapp": "完全な機能を取得するにはAPPをダウンロードしてください",
+  "jiesuan.xzios": "iOS版をダウンロード",
+  "jiesuan.xiazandriod": "Android版をダウンロード",
+  "download.downloading": "アプリケーションをダウンロード中...",
+  "download.downloading_progress": "ダウンロード中 {progress}%",
+  "download.download_failed": "ダウンロードに失敗しました。再試行してください",
+  "download.download_failed_manual": "自動ダウンロードに失敗しました。手動でダウンロードしますか?",
+  "download.download_complete": "ダウンロード完了",
+  "download.install_confirm": "アプリケーションのダウンロードが完了しました。今すぐインストールしますか?",
+  "download.install_success": "インストール成功",
+  "download.install_failed": "インストール失敗",
+  "download.install_failed_manual": "自動インストールに失敗しました。手動でインストールしてください。ファイルマネージャーを開きますか?",
+  "download.manual_install_hint": "ダウンロードしたファイルをクリックしてインストールしてください",
+  "download.app_store_success": "App Storeを開きました",
+  "download.app_store_failed": "App Storeを開けませんでした。ブラウザで試行中",
+  "download.app_opened_success": "アプリを開きました",
+  "download.app_not_installed": "アプリがインストールされていません。ダウンロードを開始します",
+  "order.xindd": "新しい注文があります"
 }

+ 17 - 1
locale/yuenan.json

@@ -47,6 +47,7 @@
 	"comp.qiyegw": "Trang web chính thức của doanh nghiệp",
 	"comp.qiyejs": "Giới thiệu công ty",
 	"comp.qrscgg": "Bạn có muốn xóa danh mục tuỳ chọn cuối cùng không!",
+	"comp.quxiao": "Hủy bỏ",
 	"comp.queren": "Xác nhận",
 	"comp.qujiesuan": "Đi thanh toán ",
 	"comp.rementj": "Quán Ngon Đề Xuất",
@@ -360,6 +361,7 @@
 	"order.ziqu": "Tự đến lấy",
 	"order.zuofei": "Huỷ bỏ",
 	"order.xiadancg": "Đặt đơn thành công",
+	"order.xindd": "Bạn có đơn hàng mới",
 	"pinglun.nmpinglun": "Bình luận ẩn danh",
 	"pinglun.suoyoupingf": "Tất cả xếp hạng",
 	"pinglun.zxpinglun": "Bình luận mới nhất",
@@ -456,5 +458,19 @@
 	"mend.wuxiaofw": "Truy cập không hợp lệ",
 	"jiesuan.xiazapp": "Vui lòng tải xuống APP để sử dụng đầy đủ chức năng",
 	"jiesuan.xzios": "Tải xuống phiên bản iOS",
-	"jiesuan.xiazandriod": "Tải xuống phiên bản Android"
+	"jiesuan.xiazandriod": "Tải xuống phiên bản Android",
+	"download.downloading": "Đang tải xuống ứng dụng...",
+	"download.downloading_progress": "Đang tải xuống {progress}%",
+	"download.download_failed": "Tải xuống thất bại, vui lòng thử lại",
+	"download.download_failed_manual": "Tải xuống tự động thất bại, bạn có muốn tải xuống thủ công không?",
+	"download.download_complete": "Tải xuống hoàn tất",
+	"download.install_confirm": "Ứng dụng đã tải xuống xong, bạn có muốn cài đặt ngay không?",
+	"download.install_success": "Cài đặt thành công",
+	"download.install_failed": "Cài đặt thất bại",
+	"download.install_failed_manual": "Cài đặt tự động thất bại, vui lòng cài đặt thủ công. Bạn có muốn mở trình quản lý tệp không?",
+	"download.manual_install_hint": "Vui lòng nhấp vào tệp đã tải xuống để cài đặt",
+	"download.app_store_success": "Mở App Store thành công",
+	"download.app_store_failed": "Mở App Store thất bại, thử mở bằng trình duyệt",
+	"download.app_opened_success": "Ứng dụng mở thành công",
+	"download.app_not_installed": "Ứng dụng chưa được cài đặt, bắt đầu tải xuống"
 }

+ 17 - 1
locale/zh-Hans.json

@@ -47,6 +47,7 @@
 	"comp.qiyegw": "企业官网",
 	"comp.qiyejs": "企业介绍",
 	"comp.qrscgg": "是否删除最后一组规格!",
+	"comp.quxiao": "取消",
 	"comp.queren": "确认",
 	"comp.qujiesuan": "去结算",
 	"comp.rementj": "热门推荐",
@@ -360,6 +361,7 @@
 	"order.ziqu": "自取",
 	"order.zuofei": "作废",
 	"order.xiadancg": "下单成功",
+	"order.xindd": "您有新订单了",
 	"pinglun.nmpinglun": "匿名评论",
 	"pinglun.suoyoupingf": "所有评分",
 	"pinglun.zxpinglun": "最新评论",
@@ -457,6 +459,20 @@
 	"mend.wuxiaofw": "无效访问",
 	"jiesuan.xiazapp": "请下载APP以获取完整功能",
 	"jiesuan.xzios": "下载iOS版",
-	"jiesuan.xiazandriod": "下载Android版"
+	"jiesuan.xiazandriod": "下载Android版",
+	"download.downloading": "正在下载应用...",
+	"download.downloading_progress": "下载中 {progress}%",
+	"download.download_failed": "下载失败,请重试",
+	"download.download_failed_manual": "自动下载失败,是否手动下载?",
+	"download.download_complete": "下载完成",
+	"download.install_confirm": "应用已下载完成,是否立即安装?",
+	"download.install_success": "安装成功",
+	"download.install_failed": "安装失败",
+	"download.install_failed_manual": "自动安装失败,请手动安装。是否打开文件管理器?",
+	"download.manual_install_hint": "请点击下载的文件进行安装",
+	"download.app_store_success": "打开 App Store 成功",
+	"download.app_store_failed": "打开 App Store 失败,尝试浏览器打开",
+	"download.app_opened_success": "应用打开成功",
+	"download.app_not_installed": "应用未安装,开始下载"
 
 }

+ 17 - 1
locale/zh-Hant.json

@@ -47,6 +47,7 @@
 	"comp.qiyegw": "企業官網",
 	"comp.qiyejs": "企業介紹",
 	"comp.qrscgg": "是否刪除最後一組規格!",
+	"comp.quxiao": "取消",
 	"comp.queren": "確認",
 	"comp.qujiesuan": "去結算",
 	"comp.rementj": "熱門推薦",
@@ -360,6 +361,7 @@
 	"order.ziqu": "自取",
 	"order.zuofei": "作廢",
 	"order.xiadancg": "下單成功",
+	"order.xindd": "您有新訂單了",
 	"pinglun.nmpinglun": "匿名評論",
 	"pinglun.suoyoupingf": "所有評分",
 	"pinglun.zxpinglun": "最新評論",
@@ -456,5 +458,19 @@
 	"mend.wuxiaofw": "無效連線",
 	"jiesuan.xiazapp": "請下載APP以取得完整功能",
 	"jiesuan.xzios": "下載iOS版",
-	"jiesuan.xiazandriod": "下載Android版"
+	"jiesuan.xiazandriod": "下載Android版",
+	"download.downloading": "正在下載應用...",
+	"download.downloading_progress": "下載中 {progress}%",
+	"download.download_failed": "下載失敗,請重試",
+	"download.download_failed_manual": "自動下載失敗,是否手動下載?",
+	"download.download_complete": "下載完成",
+	"download.install_confirm": "應用已下載完成,是否立即安裝?",
+	"download.install_success": "安裝成功",
+	"download.install_failed": "安裝失敗",
+	"download.install_failed_manual": "自動安裝失敗,請手動安裝。是否打開文件管理器?",
+	"download.manual_install_hint": "請點擊下載的文件進行安裝",
+	"download.app_store_success": "打開 App Store 成功",
+	"download.app_store_failed": "打開 App Store 失敗,嘗試瀏覽器打開",
+	"download.app_opened_success": "應用打開成功",
+	"download.app_not_installed": "應用未安裝,開始下載"
 }

+ 1 - 1
main.js

@@ -38,7 +38,7 @@ Vue.prototype.$formPr = function(price) {
 
 // Vue.prototype.$baseImagurl = 'https://backend.cityexpress168.com.vn/prod-api';//生产环境
 // Vue.prototype.$upImagurl = 'https://api.cityexpress168.com.vn/utils/Upload';//生产环境
-Vue.prototype.$baseImagurl = 'https://backend.amazeway.com.cn/prod-api'; //预发布
+Vue.prototype.$baseImagurl = 'https://ctebackend.waimai-paotui.com/prod-api'; //预发布
 Vue.prototype.$upImagurl = 'https://api.amazeway.com.cn/utils/Upload'; //预发布
 
 const goEasy = GoEasy.getInstance({

+ 1 - 1
pages/OrderList/OrderDetail.nvue

@@ -962,7 +962,7 @@ import api from "@/pages/api/api.js"
 				 		console.log('-----',tempFilePaths)
 				 		uni.uploadFile({
 				 			url:'https://api.cityexpress168.com.vn/utils/Upload', //上传图片api
-							// url:'https://api.amazeway.com.cn/utils/Upload', //上传图片api
+							// url:'https://cteapi.waimai-paotui.com/utils/Upload', //上传图片api
 							
 				 			filePath: tempFilePaths[0],
 				 			name: 'file',

+ 304 - 66
pages/OrderList/buy/jiesuanYe.vue

@@ -299,6 +299,7 @@
 			}
 		},
 		onLoad(option) {
+			console.log(option)
 			this.foodlist = uni.getStorageSync("JSfoodlist");
 			uni.setStorageSync('JSfoodlist', '');
 			this.mendid = option.mendid;
@@ -342,72 +343,289 @@
 				const ua = navigator.userAgent.toLowerCase();
 				return ua.indexOf('android') > -1;
 				// #endif
-				
+
 				// 在App环境中检测
 				// #ifdef APP-PLUS
 				return plus.os.name === 'Android';
 				// #endif
-				
+
 				// 其他环境默认返回false
 				return false;
 			},
-			
+
 			// 安卓设备自动下载并安装APK
 			downloadAndInstallAndroid(androidUrl) {
 				const that = this;
-				
+
+				// 先尝试打开已安装的应用
+				this.tryOpenInstalledApp();
+			},
+
+			// 尝试打开已安装的应用
+			tryOpenInstalledApp() {
+				const that = this;
+				const appSchema = 'cityexpressuser://';
+
+				// 在App环境中使用plus.runtime.openURL
+				// #ifdef APP-PLUS
+				plus.runtime.openURL(appSchema, function() {
+					console.log(that.$t('download.app_opened_success'));
+				}, function(e) {
+					console.log(that.$t('download.app_not_installed'));
+					// 应用未安装,继续下载流程
+					that.startDownloadProcess();
+				});
+				// #endif
+
+				// 在H5环境中尝试打开应用
+				// #ifdef H5
+				this.tryOpenAppInH5(appSchema);
+				// #endif
+			},
+
+			// 在H5环境中尝试打开应用
+			tryOpenAppInH5(appSchema) {
+				const that = this;
+
+				// 检测是否为iOS设备
+				const isIOS = this.isIOSDevice();
+
+				if (isIOS) {
+					// iOS设备使用特殊处理
+					this.tryOpenIOSApp(appSchema);
+				} else {
+					// 安卓设备使用iframe方式
+					this.tryOpenAndroidApp(appSchema);
+				}
+			},
+
+			// 尝试打开iOS应用
+			tryOpenIOSApp(appSchema) {
+				const that = this;
+
+				// 记录开始时间
+				const startTime = Date.now();
+				let hasApp = false;
+
+				// 监听页面可见性变化
+				const handleVisibilityChange = () => {
+					if (document.hidden) {
+						hasApp = true;
+						clearTimeout(timeout);
+						document.removeEventListener('visibilitychange', handleVisibilityChange);
+						document.removeEventListener('pagehide', handlePageHide);
+						document.removeEventListener('blur', handleBlur);
+					}
+				};
+
+				// 监听页面隐藏事件
+				const handlePageHide = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 监听窗口失焦事件
+				const handleBlur = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 设置超时检测
+				const timeout = setTimeout(() => {
+					if (!hasApp) {
+						// 应用未安装,继续下载流程
+						that.startDownloadProcess();
+					}
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				}, 1500); // 缩短超时时间
+
+				// 添加事件监听器
+				document.addEventListener('visibilitychange', handleVisibilityChange);
+				document.addEventListener('pagehide', handlePageHide);
+				window.addEventListener('blur', handleBlur);
+
+				// 尝试打开应用
+				try {
+					// 方法1: 直接使用window.location
+					window.location.href = appSchema;
+				} catch (e) {
+					// 方法2: 使用iframe
+					const iframe = document.createElement('iframe');
+					iframe.style.display = 'none';
+					iframe.style.width = '1px';
+					iframe.style.height = '1px';
+					iframe.src = appSchema;
+					document.body.appendChild(iframe);
+
+					// 清理iframe
+					setTimeout(() => {
+						if (document.body.contains(iframe)) {
+							document.body.removeChild(iframe);
+						}
+					}, 1000);
+				}
+			},
+
+			// 尝试打开安卓应用
+			tryOpenAndroidApp(appSchema) {
+				const that = this;
+
+				let hasApp = false;
+
+				// 监听页面可见性变化
+				const handleVisibilityChange = () => {
+					if (document.hidden) {
+						hasApp = true;
+						clearTimeout(timeout);
+						document.removeEventListener('visibilitychange', handleVisibilityChange);
+						document.removeEventListener('pagehide', handlePageHide);
+						document.removeEventListener('blur', handleBlur);
+					}
+				};
+
+				// 监听页面隐藏事件
+				const handlePageHide = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 监听窗口失焦事件
+				const handleBlur = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 设置超时检测
+				const timeout = setTimeout(() => {
+					if (!hasApp) {
+						// 应用未安装,继续下载流程
+						that.startDownloadProcess();
+					}
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				}, 1500); // 缩短超时时间
+
+				// 添加事件监听器
+				document.addEventListener('visibilitychange', handleVisibilityChange);
+				document.addEventListener('pagehide', handlePageHide);
+				window.addEventListener('blur', handleBlur);
+
+				// 尝试打开应用
+				try {
+					// 方法1: 直接使用window.location
+					window.location.href = appSchema;
+				} catch (e) {
+					// 方法2: 使用iframe
+					const iframe = document.createElement('iframe');
+					iframe.style.display = 'none';
+					iframe.style.width = '1px';
+					iframe.style.height = '1px';
+					iframe.src = appSchema;
+					document.body.appendChild(iframe);
+
+					// 清理iframe
+					setTimeout(() => {
+						if (document.body.contains(iframe)) {
+							document.body.removeChild(iframe);
+						}
+					}, 1000);
+				}
+			},
+
+			// 开始下载流程
+			startDownloadProcess() {
+				const that = this;
+
 				// 显示下载提示
 				uni.showLoading({
-					title: '正在下载应用...',
+					title: this.$t('download.downloading'),
 					mask: true
 				});
-				
+
+				// 获取下载链接
+				api('getAppDownload', {}, r => {
+					console.log(r);
+
+					// 检测是否为安卓设备
+					const isAndroid = this.isAndroidDevice();
+
+					if (isAndroid) {
+						// 安卓设备下载APK
+						that.downloadAndroidAPK(r.data.data.androidUrl);
+					} else {
+						// iOS设备打开App Store
+						that.openAppStore(r.data.data.iosUrl);
+					}
+				});
+			},
+
+			// 下载安卓APK
+			downloadAndroidAPK(androidUrl) {
+				const that = this;
+
 				// 在App环境中使用plus.downloader
 				// #ifdef APP-PLUS
 				const appDownloadTask = plus.downloader.createDownload(androidUrl, {
 					filename: '_downloads/CTE.apk'
 				}, function(download, status) {
 					uni.hideLoading();
-					
+
 					if (status === 200) {
 						// 下载成功,尝试安装
 						that.installAndroidApp(download.filename);
 					} else {
 						uni.showToast({
-							title: '下载失败,请重试',
+							title: that.$t('download.download_failed'),
 							icon: 'none',
 							duration: 2000
 						});
 					}
 				});
-				
+
 				// 监听下载进度
 				appDownloadTask.addEventListener('statechanged', function(download, status) {
 					if (status === 200) {
 						const progress = Math.round((download.downloadedSize / download.totalSize) * 100);
 						uni.showLoading({
-							title: `下载中 ${progress}%`,
+							title: that.$t('download.downloading_progress', {
+								progress: progress
+							}),
 							mask: true
 						});
 					}
 				});
-				
+
 				appDownloadTask.start();
 				// #endif
-				
+
 				// 在H5环境中使用uni.downloadFile
 				// #ifdef H5
 				const h5DownloadTask = uni.downloadFile({
 					url: androidUrl,
 					success: function(res) {
 						uni.hideLoading();
-						
+
 						if (res.statusCode === 200) {
 							// 下载成功,尝试安装
 							that.installAndroidApp(res.tempFilePath);
 						} else {
 							uni.showToast({
-								title: '下载失败,请重试',
+								title: that.$t('download.download_failed'),
 								icon: 'none',
 								duration: 2000
 							});
@@ -416,11 +634,14 @@
 					fail: function(err) {
 						uni.hideLoading();
 						console.log('下载失败:', err);
-						
+
 						// 下载失败时,提供手动下载选项
 						uni.showModal({
-							title: '下载失败',
-							content: '自动下载失败,是否手动下载?',
+							title: that.$t('download.download_failed'),
+							content: that.$t('download.download_failed_manual'),
+							showCancel: true,
+							cancelText: that.$t('comp.quxiao'),
+							confirmText: that.$t('comp.queren'),
 							success: function(res) {
 								if (res.confirm) {
 									// 使用浏览器打开下载链接
@@ -430,27 +651,61 @@
 						});
 					}
 				});
-				
+
 				// 监听下载进度
 				h5DownloadTask.onProgressUpdate(function(res) {
 					const progress = Math.round(res.progress);
 					uni.showLoading({
-						title: `下载中 ${progress}%`,
+						title: that.$t('download.downloading_progress', {
+							progress: progress
+						}),
 						mask: true
 					});
 				});
 				// #endif
 			},
-			
+
+			// 打开App Store
+			openAppStore(iosUrl) {
+				const that = this;
+
+				// 在App环境中使用plus.runtime.openURL
+				// #ifdef APP-PLUS
+				plus.runtime.openURL(
+					'itms-apps://itunes.apple.com/cn/app/cte/id6468907188',
+					(res) => {
+						console.log(that.$t('download.app_store_success'))
+					},
+					(err) => {
+						console.log(that.$t('download.app_store_failed'))
+						// 如果 itms-apps:// 失败,回退到浏览器打开
+						plus.runtime.openURL('https://apps.apple.com/cn/app/cte/id6468907188')
+					}
+				);
+				// #endif
+
+				// 在H5环境中,针对iOS设备优化
+				// #ifdef H5
+				// 先尝试直接打开App Store链接
+				const appStoreUrl = 'https://apps.apple.com/cn/app/cte/id6468907188';
+
+				// 尝试多种方式打开App Store
+				that.tryOpenAppStore(appStoreUrl);
+				// #endif
+			},
+
 			// 安装安卓应用
 			installAndroidApp(filePath) {
 				const that = this;
-				
+
 				// 在App环境中,直接尝试安装APK
 				// #ifdef APP-PLUS
 				uni.showModal({
-					title: '下载完成',
-					content: '应用已下载完成,是否立即安装?',
+					title: that.$t('download.download_complete'),
+					content: that.$t('download.install_confirm'),
+					showCancel: true,
+					cancelText: that.$t('comp.quxiao'),
+					confirmText: that.$t('comp.queren'),
 					success: function(res) {
 						if (res.confirm) {
 							// 使用plus.runtime.install安装APK
@@ -458,15 +713,18 @@
 								force: false
 							}, function() {
 								uni.showToast({
-									title: '安装成功',
+									title: that.$t('download.install_success'),
 									icon: 'success',
 									duration: 2000
 								});
 							}, function(e) {
 								console.log('安装失败:', e);
 								uni.showModal({
-									title: '安装失败',
-									content: '自动安装失败,请手动安装。是否打开文件管理器?',
+									title: that.$t('download.install_failed'),
+									content: that.$t('download.install_failed_manual'),
+									showCancel: true,
+									cancelText: that.$t('comp.quxiao'),
+									confirmText: that.$t('comp.queren'),
 									success: function(res) {
 										if (res.confirm) {
 											// 打开文件管理器
@@ -479,13 +737,14 @@
 					}
 				});
 				// #endif
-				
+
 				// 在H5环境中,提示用户手动安装
 				// #ifdef H5
 				uni.showModal({
-					title: '下载完成',
-					content: '应用已下载完成,请点击下载的文件进行安装',
+					title: that.$t('download.download_complete'),
+					content: that.$t('download.manual_install_hint'),
 					showCancel: false,
+					confirmText: that.$t('comp.queren'),
 					success: function(res) {
 						if (res.confirm) {
 							// 尝试打开下载链接,让用户手动下载
@@ -495,73 +754,52 @@
 				});
 				// #endif
 			},
-			
+
 			// 下载iOS应用
 			downloadIOSApp(iosUrl) {
 				// 检测是否为iOS设备
 				const isIOS = this.isIOSDevice();
-				
+
 				if (!isIOS) {
 					// 非iOS设备直接打开浏览器链接
 					window.open('https://apps.apple.com/cn/app/cte/id6468907188', '_blank');
 					return;
 				}
-				
-				// 在App环境中使用plus.runtime.openURL
-				// #ifdef APP-PLUS
-				plus.runtime.openURL(
-					'itms-apps://itunes.apple.com/cn/app/cte/id6468907188',
-					(res) => {
-						console.log('打开 App Store 成功')
-					},
-					(err) => {
-						console.log('打开 App Store 失败,尝试浏览器打开')
-						// 如果 itms-apps:// 失败,回退到浏览器打开
-						plus.runtime.openURL('https://apps.apple.com/cn/app/cte/id6468907188')
-					}
-				);
-				// #endif
-				
-				// 在H5环境中,针对iOS设备优化
-				// #ifdef H5
-				// 先尝试直接打开App Store链接
-				const appStoreUrl = 'https://apps.apple.com/cn/app/cte/id6468907188';
-				
-				// 尝试多种方式打开App Store
-				this.tryOpenAppStore(appStoreUrl);
-				// #endif
+
+				// 先尝试打开已安装的应用
+				this.tryOpenInstalledApp();
 			},
-			
+
 			// 检测是否为iOS设备
 			isIOSDevice() {
 				// #ifdef H5
 				const ua = navigator.userAgent.toLowerCase();
 				return /iphone|ipad|ipod/.test(ua);
 				// #endif
-				
+
 				// #ifdef APP-PLUS
 				return plus.os.name === 'iOS';
 				// #endif
-				
+
 				return false;
 			},
-			
+
 			// 尝试打开App Store的多种方式
 			tryOpenAppStore(appStoreUrl) {
 				// 方法1: 直接使用window.open
 				const newWindow = window.open(appStoreUrl, '_blank');
-				
+
 				// 如果新窗口被阻止,尝试其他方法
 				if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') {
 					// 方法2: 尝试使用itms-apps协议
 					this.tryItmsProtocol();
 				}
 			},
-			
+
 			// 尝试使用itms-apps协议
 			tryItmsProtocol() {
 				const itmsUrl = 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188';
-				
+
 				// 创建一个隐藏的iframe来尝试打开itms-apps协议
 				const iframe = document.createElement('iframe');
 				iframe.style.display = 'none';
@@ -569,7 +807,7 @@
 				iframe.style.height = '1px';
 				iframe.src = itmsUrl;
 				document.body.appendChild(iframe);
-				
+
 				// 设置超时,如果App Store没有打开,则回退到浏览器
 				setTimeout(() => {
 					if (document.body.contains(iframe)) {
@@ -579,7 +817,7 @@
 					window.location.href = 'https://apps.apple.com/cn/app/cte/id6468907188';
 				}, 1500);
 			},
-			
+
 			//促销
 			cuxiaoList() {
 				this.youyh = false;
@@ -1475,7 +1713,7 @@
 						this.zhixianyuanfei(lat, lng);
 						console.log('路径计算距离失败!');
 						uni.showToast({
-							title: '计算距离失败!',
+							title: this.$t('api.wangluoshibai'),
 							icon: 'none',
 							duration: 3500
 						})
@@ -1801,7 +2039,7 @@
 			pushMsg(cid, orderId) { //消息推送
 				api('pushMsgSJ', {
 					cid: cid,
-					title: '您有新订单了',
+					title: this.$t('order.xindd'),
 					content: orderId,
 					payload: ''
 				}, res => {

+ 1 - 1
pages/api/api.js

@@ -1,5 +1,5 @@
 // const ApiUrl = 'https://api.cityexpress168.com.vn'
-const ApiUrl = 'https://api.amazeway.com.cn' //预发布
+const ApiUrl = 'https://cteapi.waimai-paotui.com' //预发布
 // const ApiUrl = 'http://192.168.1.250:8080'
 const getdata = function(api, data, successc, failc) {
 

+ 1 - 1
pages/kehufuwu/updataKefuMsg.vue

@@ -241,7 +241,7 @@
 						})
 				 		uni.uploadFile({
 				 			url:'https://api.cityexpress168.com.vn/utils/Upload', //上传图片api
-							// url:'https://api.amazeway.com.cn/utils/Upload', //上传图片api
+							// url:'https://cteapi.waimai-paotui.com/utils/Upload', //上传图片api
 				 			filePath: tempFilePaths[0],
 				 			name: 'file',
 				 			header:{

+ 632 - 82
pages/shanpinxungou/shangjia/shangjiaView.vue

@@ -177,6 +177,32 @@
 				<view style="height: 80rpx;"></view>
 			</view>
 		</popViewGG>
+
+		<!-- 下载app弹窗 -->
+		<uni-popup ref="downloadPopup" type="center" :mask-click="true">
+			<view class="download-popup-content">
+				<!-- 标题栏 -->
+				<view class="download-popup-header">
+					<text class="download-popup-title">{{$t('api.message')}}</text>
+					<view class="download-popup-close" @click="closeDownloadPopup">
+						<text class="close-icon">×</text>
+					</view>
+				</view>
+				<!-- 内容 -->
+				<view class="download-popup-body">
+					<text class="download-popup-text">{{$t('jiesuan.xiazapp')}}</text>
+				</view>
+				<!-- 按钮 -->
+				<view class="download-popup-buttons">
+					<view class="download-popup-btn download-popup-btn-ios" @click="downloadIOS">
+						<text class="download-popup-btn-text">{{$t('jiesuan.xzios')}}</text>
+					</view>
+					<view class="download-popup-btn download-popup-btn-android" @click="downloadAndroid">
+						<text class="download-popup-btn-text">{{$t('jiesuan.xiazandriod')}}</text>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -218,7 +244,10 @@
 				startY: 0,
 				lang: '0',
 				dailinghb: [],
-				hongbkqs: false
+				hongbkqs: false,
+				downloadUrls: {},
+				isShangjia: 0,
+				id: 0,
 			}
 		},
 		onShow() {
@@ -257,6 +286,9 @@
 				});
 				return
 			}
+			this.isShangjia = option.isShangjia
+			this.id = option.id
+
 			var code = option.language
 			console.log(code)
 			uni.setStorageSync('language', code);
@@ -310,6 +342,495 @@
 			}
 		},
 		methods: {
+			// 检测是否为安卓设备
+			isAndroidDevice() {
+				// 在H5环境中检测
+				// #ifdef H5
+				const ua = navigator.userAgent.toLowerCase();
+				return ua.indexOf('android') > -1;
+				// #endif
+
+				// 在App环境中检测
+				// #ifdef APP-PLUS
+				return plus.os.name === 'Android';
+				// #endif
+
+				// 其他环境默认返回false
+				return false;
+			},
+
+			// 检测是否为iOS设备
+			isIOSDevice() {
+				// #ifdef H5
+				const ua = navigator.userAgent.toLowerCase();
+				return /iphone|ipad|ipod/.test(ua);
+				// #endif
+
+				// #ifdef APP-PLUS
+				return plus.os.name === 'iOS';
+				// #endif
+
+				return false;
+			},
+
+			// 显示下载app提示
+			showDownloadAppModal() {
+				api('getAppDownload', {}, r => {
+					console.log(r)
+					this.downloadUrls = r.data.data;
+					this.$refs.downloadPopup.open();
+				});
+			},
+
+			// 关闭下载app弹窗
+			closeDownloadPopup() {
+				this.$refs.downloadPopup.close();
+			},
+
+			// 下载iOS版本
+			downloadIOS() {
+				// 先尝试打开已安装的应用
+				this.tryOpenInstalledApp();
+				this.closeDownloadPopup();
+			},
+
+			// 下载Android版本
+			downloadAndroid() {
+				// 先尝试打开已安装的应用
+				this.tryOpenInstalledApp();
+				this.closeDownloadPopup();
+			},
+
+			// 尝试打开已安装的应用
+			tryOpenInstalledApp() {
+				const that = this;
+
+				const appSchema = 'cityexpressuser://pages/shanpinxungou/shangjia/shangjiaView?id=' + this.id +
+					'&isShangjia=' + this.isShangjia;
+
+				// 在App环境中使用plus.runtime.openURL
+				// #ifdef APP-PLUS
+				plus.runtime.openURL(appSchema, function() {
+					console.log(that.$t('download.app_opened_success'));
+				}, function(e) {
+					console.log(that.$t('download.app_not_installed'));
+					// 应用未安装,继续下载流程
+					that.startDownloadProcess();
+				});
+				// #endif
+
+				// 在H5环境中尝试打开应用
+				// #ifdef H5
+				this.tryOpenAppInH5(appSchema);
+				// #endif
+			},
+
+			// 在H5环境中尝试打开应用
+			tryOpenAppInH5(appSchema) {
+				const that = this;
+
+				// 检测是否为iOS设备
+				const isIOS = this.isIOSDevice();
+
+				if (isIOS) {
+					// iOS设备使用特殊处理
+					this.tryOpenIOSApp(appSchema);
+				} else {
+					// 安卓设备使用iframe方式
+					this.tryOpenAndroidApp(appSchema);
+				}
+			},
+
+			// 尝试打开iOS应用
+			tryOpenIOSApp(appSchema) {
+				const that = this;
+
+				// 记录开始时间
+				const startTime = Date.now();
+				let hasApp = false;
+
+				// 监听页面可见性变化
+				const handleVisibilityChange = () => {
+					if (document.hidden) {
+						hasApp = true;
+						clearTimeout(timeout);
+						document.removeEventListener('visibilitychange', handleVisibilityChange);
+						document.removeEventListener('pagehide', handlePageHide);
+						document.removeEventListener('blur', handleBlur);
+					}
+				};
+
+				// 监听页面隐藏事件
+				const handlePageHide = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 监听窗口失焦事件
+				const handleBlur = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 设置超时检测
+				const timeout = setTimeout(() => {
+					if (!hasApp) {
+						// 应用未安装,继续下载流程
+						that.startDownloadProcess();
+					}
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				}, 1500); // 缩短超时时间
+
+				// 添加事件监听器
+				document.addEventListener('visibilitychange', handleVisibilityChange);
+				document.addEventListener('pagehide', handlePageHide);
+				window.addEventListener('blur', handleBlur);
+
+				// 尝试打开应用
+				try {
+					// 方法1: 直接使用window.location
+					window.location.href = appSchema;
+				} catch (e) {
+					// 方法2: 使用iframe
+					const iframe = document.createElement('iframe');
+					iframe.style.display = 'none';
+					iframe.style.width = '1px';
+					iframe.style.height = '1px';
+					iframe.src = appSchema;
+					document.body.appendChild(iframe);
+
+					// 清理iframe
+					setTimeout(() => {
+						if (document.body.contains(iframe)) {
+							document.body.removeChild(iframe);
+						}
+					}, 1000);
+				}
+			},
+
+			// 尝试打开安卓应用
+			tryOpenAndroidApp(appSchema) {
+				const that = this;
+
+				let hasApp = false;
+
+				// 监听页面可见性变化
+				const handleVisibilityChange = () => {
+					if (document.hidden) {
+						hasApp = true;
+						clearTimeout(timeout);
+						document.removeEventListener('visibilitychange', handleVisibilityChange);
+						document.removeEventListener('pagehide', handlePageHide);
+						document.removeEventListener('blur', handleBlur);
+					}
+				};
+
+				// 监听页面隐藏事件
+				const handlePageHide = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 监听窗口失焦事件
+				const handleBlur = () => {
+					hasApp = true;
+					clearTimeout(timeout);
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				};
+
+				// 设置超时检测
+				const timeout = setTimeout(() => {
+					if (!hasApp) {
+						// 应用未安装,继续下载流程
+						that.startDownloadProcess();
+					}
+					document.removeEventListener('visibilitychange', handleVisibilityChange);
+					document.removeEventListener('pagehide', handlePageHide);
+					document.removeEventListener('blur', handleBlur);
+				}, 1500); // 缩短超时时间
+
+				// 添加事件监听器
+				document.addEventListener('visibilitychange', handleVisibilityChange);
+				document.addEventListener('pagehide', handlePageHide);
+				window.addEventListener('blur', handleBlur);
+
+				// 尝试打开应用
+				try {
+					// 方法1: 直接使用window.location
+					window.location.href = appSchema;
+				} catch (e) {
+					// 方法2: 使用iframe
+					const iframe = document.createElement('iframe');
+					iframe.style.display = 'none';
+					iframe.style.width = '1px';
+					iframe.style.height = '1px';
+					iframe.src = appSchema;
+					document.body.appendChild(iframe);
+
+					// 清理iframe
+					setTimeout(() => {
+						if (document.body.contains(iframe)) {
+							document.body.removeChild(iframe);
+						}
+					}, 1000);
+				}
+			},
+
+			// 开始下载流程
+			startDownloadProcess() {
+				const that = this;
+
+				// 显示下载提示
+				uni.showLoading({
+					title: this.$t('download.downloading'),
+					mask: true
+				});
+
+				// 获取下载链接
+				api('getAppDownload', {}, r => {
+					console.log(r);
+
+					// 检测是否为安卓设备
+					const isAndroid = this.isAndroidDevice();
+
+					if (isAndroid) {
+						// 安卓设备下载APK
+						that.downloadAndroidAPK(r.data.data.androidUrl);
+					} else {
+						// iOS设备打开App Store
+						that.openAppStore(r.data.data.iosUrl);
+					}
+				});
+			},
+
+			// 下载安卓APK
+			downloadAndroidAPK(androidUrl) {
+				const that = this;
+
+				// 在App环境中使用plus.downloader
+				// #ifdef APP-PLUS
+				const appDownloadTask = plus.downloader.createDownload(androidUrl, {
+					filename: '_downloads/CTE.apk'
+				}, function(download, status) {
+					uni.hideLoading();
+
+					if (status === 200) {
+						// 下载成功,尝试安装
+						that.installAndroidApp(download.filename);
+					} else {
+						uni.showToast({
+							title: that.$t('download.download_failed'),
+							icon: 'none',
+							duration: 2000
+						});
+					}
+				});
+
+				// 监听下载进度
+				appDownloadTask.addEventListener('statechanged', function(download, status) {
+					if (status === 200) {
+						const progress = Math.round((download.downloadedSize / download.totalSize) * 100);
+						uni.showLoading({
+							title: that.$t('download.downloading_progress', {
+								progress: progress
+							}),
+							mask: true
+						});
+					}
+				});
+
+				appDownloadTask.start();
+				// #endif
+
+				// 在H5环境中使用uni.downloadFile
+				// #ifdef H5
+				const h5DownloadTask = uni.downloadFile({
+					url: androidUrl,
+					success: function(res) {
+						uni.hideLoading();
+
+						if (res.statusCode === 200) {
+							// 下载成功,尝试安装
+							that.installAndroidApp(res.tempFilePath);
+						} else {
+							uni.showToast({
+								title: that.$t('download.download_failed'),
+								icon: 'none',
+								duration: 2000
+							});
+						}
+					},
+					fail: function(err) {
+						uni.hideLoading();
+						console.log('下载失败:', err);
+
+						// 下载失败时,提供手动下载选项
+						uni.showModal({
+							title: that.$t('download.download_failed'),
+							content: that.$t('download.download_failed_manual'),
+							showCancel: true,
+							cancelText: that.$t('comp.quxiao'),
+							confirmText: that.$t('comp.queren'),
+							success: function(res) {
+								if (res.confirm) {
+									// 使用浏览器打开下载链接
+									window.open(androidUrl, '_blank');
+								}
+							}
+						});
+					}
+				});
+
+				// 监听下载进度
+				h5DownloadTask.onProgressUpdate(function(res) {
+					const progress = Math.round(res.progress);
+					uni.showLoading({
+						title: that.$t('download.downloading_progress', {
+							progress: progress
+						}),
+						mask: true
+					});
+				});
+				// #endif
+			},
+
+			// 打开App Store
+			openAppStore(iosUrl) {
+				const that = this;
+
+				// 在App环境中使用plus.runtime.openURL
+				// #ifdef APP-PLUS
+				plus.runtime.openURL(
+					'itms-apps://itunes.apple.com/cn/app/cte/id6468907188',
+					(res) => {
+						console.log(that.$t('download.app_store_success'))
+					},
+					(err) => {
+						console.log(that.$t('download.app_store_failed'))
+						// 如果 itms-apps:// 失败,回退到浏览器打开
+						plus.runtime.openURL('https://apps.apple.com/cn/app/cte/id6468907188')
+					}
+				);
+				// #endif
+
+				// 在H5环境中,针对iOS设备优化
+				// #ifdef H5
+				// 先尝试直接打开App Store链接
+				const appStoreUrl = 'https://apps.apple.com/cn/app/cte/id6468907188';
+
+				// 尝试多种方式打开App Store
+				that.tryOpenAppStore(appStoreUrl);
+				// #endif
+			},
+
+			// 安装安卓应用
+			installAndroidApp(filePath) {
+				const that = this;
+
+				// 在App环境中,直接尝试安装APK
+				// #ifdef APP-PLUS
+				uni.showModal({
+					title: that.$t('download.download_complete'),
+					content: that.$t('download.install_confirm'),
+					showCancel: true,
+					cancelText: that.$t('comp.quxiao'),
+					confirmText: that.$t('comp.queren'),
+					success: function(res) {
+						if (res.confirm) {
+							// 使用plus.runtime.install安装APK
+							plus.runtime.install(filePath, {
+								force: false
+							}, function() {
+								uni.showToast({
+									title: that.$t('download.install_success'),
+									icon: 'success',
+									duration: 2000
+								});
+							}, function(e) {
+								console.log('安装失败:', e);
+								uni.showModal({
+									title: that.$t('download.install_failed'),
+									content: that.$t('download.install_failed_manual'),
+									showCancel: true,
+									cancelText: that.$t('comp.quxiao'),
+									confirmText: that.$t('comp.queren'),
+									success: function(res) {
+										if (res.confirm) {
+											// 打开文件管理器
+											plus.runtime.openFile(filePath);
+										}
+									}
+								});
+							});
+						}
+					}
+				});
+				// #endif
+
+				// 在H5环境中,提示用户手动安装
+				// #ifdef H5
+				uni.showModal({
+					title: that.$t('download.download_complete'),
+					content: that.$t('download.manual_install_hint'),
+					showCancel: false,
+					confirmText: that.$t('comp.queren'),
+					success: function(res) {
+						if (res.confirm) {
+							// 尝试打开下载链接,让用户手动下载
+							window.open(filePath, '_blank');
+						}
+					}
+				});
+				// #endif
+			},
+
+			// 尝试打开App Store的多种方式
+			tryOpenAppStore(appStoreUrl) {
+				// 方法1: 直接使用window.open
+				const newWindow = window.open(appStoreUrl, '_blank');
+
+				// 如果新窗口被阻止,尝试其他方法
+				if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') {
+					// 方法2: 尝试使用itms-apps协议
+					this.tryItmsProtocol();
+				}
+			},
+
+			// 尝试使用itms-apps协议
+			tryItmsProtocol() {
+				const itmsUrl = 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188';
+
+				// 创建一个隐藏的iframe来尝试打开itms-apps协议
+				const iframe = document.createElement('iframe');
+				iframe.style.display = 'none';
+				iframe.style.width = '1px';
+				iframe.style.height = '1px';
+				iframe.src = itmsUrl;
+				document.body.appendChild(iframe);
+
+				// 设置超时,如果App Store没有打开,则回退到浏览器
+				setTimeout(() => {
+					if (document.body.contains(iframe)) {
+						document.body.removeChild(iframe);
+					}
+					// 最后回退到浏览器打开
+					window.location.href = 'https://apps.apple.com/cn/app/cte/id6468907188';
+				}, 1500);
+			},
+
 			//选择和领取红包卡券
 			getHbkaq() {
 				console.log('1212------------------')
@@ -479,34 +1000,16 @@
 				this.$refs.draw.share_qrcode(this.option);
 			},
 			shouchang() {
-				this.addcollect();
+				this.showDownloadAppModal();
 			},
 			callPhone() {
-				var that = this;
-				uni.showModal({
-					title: that.$t('api.message'),
-					content: that.$t('api.nqdbddh'),
-					cancelText: that.$t('order.quxiao'),
-					confirmText: that.$t('comp.queren'),
-					success: function(res) {
-						if (res.confirm) { //这里是点击了确定以后
-							console.log(that.mendianMs.telephone)
-							plus.device.dial(that.mendianMs.telephone, false);
-						} else { //这里是点击了取消以后
-							console.log('用户点击取消')
-						}
-					}
-				})
+				this.showDownloadAppModal();
 			},
 			gengduozx() {
-				uni.navigateTo({
-					url: '/pages/shanpinxungou/shangjia/gengduozhixun?mendid=' + this.id
-				})
+				this.showDownloadAppModal();
 			},
 			pinglunList() {
-				uni.navigateTo({
-					url: '/pages/pinglun/pingLunList?mendid=' + this.id
-				})
+				this.showDownloadAppModal();
 			},
 			fenleiSel(e) {
 				console.log(e);
@@ -516,59 +1019,13 @@
 			},
 			shangpinsl(id) {
 				//选择商品
-				uni.navigateTo({
-					url: '/pages/shanpinxungou/shangpin/shangpinxiangqing?id=' + id + '&isShangjia=' +
-						this
-						.isShangjia
-				})
+				this.showDownloadAppModal();
 			},
 			gotoGouwuche() {
-				if (!this.showbt) {
-					uni.showToast({
-						title: this.$t('comp.qingxzsp'),
-						icon: 'none',
-						duration: 2500
-					})
-					return;
-				}
-				uni.navigateTo({
-					url: '/pages/OrderList/buy/gouwuche'
-				})
+				this.showDownloadAppModal();
 			},
 			gotojiesuan() {
-				if (this.mendianMs.state == 1) {
-					uni.showToast({
-						title: this.$t('mend.statedy'),
-						icon: 'none',
-						duration: 2500
-					})
-					return;
-				}
-				if (!this.showbt) {
-					uni.showToast({
-						title: this.$t('comp.qingxzsp'),
-						icon: 'none',
-						duration: 2500
-					})
-					return;
-				}
-				var token = uni.getStorageSync("token");
-				//console.log('2222',token)
-				// if (token == '' || token == undefined || token == null) {
-				// 	uni.navigateTo({
-				// 		url: '/pages/UserCenter/LoginView'
-				// 	})
-				// 	return;
-				// }
-
-				//不需要登录给userId默认值0
-				if (!this.userid) {
-					this.userid = 0
-				}
-				uni.setStorageSync('JSfoodlist', this.gouwuche.foodlist);
-				uni.navigateTo({
-					url: '/pages/OrderList/buy/jiesuanYe?mendid=' + this.id + '&userid=' + this.userid
-				})
+				this.showDownloadAppModal();
 			},
 			//pop------------------------------------------
 			popfenlei() {
@@ -752,9 +1209,7 @@
 			},
 			jiangouwuche(e) {
 				//跳转购物车
-				uni.navigateTo({
-					url: '/pages/OrderList/buy/gouwuche'
-				})
+				this.showDownloadAppModal();
 			},
 
 			jiagouwuche(e) {
@@ -799,13 +1254,7 @@
 				}
 			},
 			editSKU(index) {
-				this.spindex = index;
-				var sp = this.shangpingoumaiS[this.current][index];
-				//this.skuGuige=sp.shangpin.sku;
-				this.spindexSP = sp;
-				this.showpop = true;
-				console.log('<<<<<<', this.shangpinlist[index]);
-				//this.$refs.popup.open();
+				this.showDownloadAppModal();
 			},
 			gettempSKU(foodSku) {
 				var selectsku = [];
@@ -1089,4 +1538,105 @@
 	.withpophbkq {
 		width: 80%;
 	}
+
+	/* 下载app弹窗样式 */
+	.download-popup-content {
+		width: 600rpx;
+		background-color: white;
+		border-radius: 16rpx;
+		overflow: hidden;
+	}
+
+	.download-popup-header {
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+		align-items: center;
+		padding: 40rpx 40rpx 20rpx 40rpx;
+		position: relative;
+	}
+
+	.download-popup-title {
+		font-size: 36rpx;
+		font-weight: bold;
+		color: #333;
+		text-align: center;
+		flex: 1;
+	}
+
+	.download-popup-close {
+		position: absolute;
+		right: 0;
+		top: 0;
+		width: 60rpx;
+		height: 60rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		border-radius: 0 16rpx 0 8rpx;
+		background-color: #ff4444;
+	}
+
+	.close-icon {
+		font-size: 40rpx;
+		color: white;
+		line-height: 1;
+	}
+
+	.download-popup-body {
+		padding: 20rpx 40rpx 40rpx 40rpx;
+		text-align: center;
+	}
+
+	.download-popup-text {
+		font-size: 30rpx;
+		color: #666;
+		line-height: 1.5;
+	}
+
+	.download-popup-buttons {
+		display: flex;
+		flex-direction: row;
+		border-top: 1rpx solid #f0f0f0;
+	}
+
+	.download-popup-btn {
+		flex: 1;
+		height: 100rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+	}
+
+	.download-popup-btn:not(:last-child)::after {
+		content: '';
+		position: absolute;
+		right: 0;
+		top: 0;
+		bottom: 0;
+		width: 1rpx;
+		background-color: #f0f0f0;
+	}
+
+	.download-popup-btn-ios {
+		background-color: white;
+	}
+
+	.download-popup-btn-android {
+		background-color: white;
+	}
+
+	.download-popup-btn-text {
+		font-size: 32rpx;
+	}
+
+	.download-popup-btn-ios .download-popup-btn-text {
+		color: #666;
+	}
+
+	.download-popup-btn-android .download-popup-btn-text {
+		color: #007AFF;
+		font-weight: 500;
+	}
 </style>