From b44e169dd8a6e0f15d3788970176922e96aec6e1 Mon Sep 17 00:00:00 2001
From: zhao_js <349234519@qq.com>
Date: 星期三, 15 十一月 2023 09:55:33 +0800
Subject: [PATCH] no message

---
 uniapp/App.vue |   73 ++++++++++++++++++++++++------------
 1 files changed, 49 insertions(+), 24 deletions(-)

diff --git a/uniapp/App.vue b/uniapp/App.vue
index eb34b83..d385ab8 100644
--- a/uniapp/App.vue
+++ b/uniapp/App.vue
@@ -33,11 +33,12 @@
 					} else { //APP鍦ㄧ嚎锛屾敹鍒版秷鎭笉浼氬寘鍚玹ype灞炴��,杩欐椂鐨刾ayload鏄疛SON瀛楃涓诧紝闇�瑕佽浆涓篔SON瀵硅薄  
 						payload = JSON.parse(msg.payload);
 					}
-					console.log(payload);
+
 					if (payload != null || payload != undefined) {
 						// var messageType = payload.messageType; 
 						// onLaunch 鐢熷懡鍛ㄦ湡閲岋紝椤甸潰璺宠浆鏈夐棶棰�,璺充笉杩囧幓
 						// 搴旇鏄〉闈㈣繕娌″姞杞斤紝鍔犱笂瀹氭椂鍚庯紝灏卞彲浠ヤ簡锛�
+						console.log(payload);
 						setTimeout(() => {
 							uni.navigateTo({
 								url: payload
@@ -46,6 +47,7 @@
 					}
 				} else { // Android
 					var payload = msg.payload;
+					console.log(payload);
 					if (payload != null || payload != undefined) {
 						// onLaunch 鐢熷懡鍛ㄦ湡閲岋紝椤甸潰璺宠浆鏈夐棶棰�,璺充笉杩囧幓
 						// 搴旇鏄〉闈㈣繕娌″姞杞斤紝鍔犱笂瀹氭椂鍚庯紝灏卞彲浠ヤ簡锛� 
@@ -74,12 +76,18 @@
 						});
 					}
 				} else { // Android
-					var payload = JSON.parse(msg.content);
+					console.log(msg.content);
+					plus.push.createMessage(msg.content, msg.payload, {
+						title: messageTitle
+						//icon:'/static/images/app/pushlogo.png'
+					});
+					/* var payload = JSON.parse(msg.content);
+					
 					var messageTitle = payload.title;
 					var messageContent = payload.content;
 					plus.push.createMessage(messageContent, payload, {
 						title: messageTitle
-					})
+					}) */
 				}
 			}, false);
 			//娑堟伅鎺ㄩ�佺粨鏉�
@@ -130,9 +138,11 @@
 						this.globalData.systemLevel = e.system;
 						this.globalData.equipmentNumber = idfa.value()
 					};
+					this.getArgument(true);
 					// #endif
 				}
 			})
+
 
 		},
 		globalData: {
@@ -149,8 +159,12 @@
 			argumentStr: ''
 
 		},
-		onShow: function() {
+		data() {
+			return {
 
+			}
+		},
+		onShow: function() {
 			var that = this;
 			uni.getNetworkType({
 				success: function(res) {
@@ -184,7 +198,7 @@
 				'pages/rankinglist/compareprice') {
 				getClipboard()
 			}
-			this.getArgument();
+			that.getArgument();
 			// #endif
 		},
 		onHide: function() {},
@@ -192,7 +206,8 @@
 			...mapMutations(['login']),
 			bcInit: function() {
 				var that = this;
-				if (uni.getSystemInfoSync().platform == 'ios') {
+				//uni.getSystemInfoSync().platform == 'ios'
+				if (true) {
 					const plug = uni.requireNativePlugin('xiguazhu-baichuan');
 					plug.init({}, result => {
 						//console.log('1111111111111111111');
@@ -205,30 +220,39 @@
 					that.globalData.hasbcinit = true;
 				}
 			},
-			getArgument() {
+			targetArgument(args) {
+				var toarg = args.replace('dafanguan://', '');
+				uni.navigateTo({
+					url: toarg
+				});
+				/* var argObj = JSON.parse(decodeURIComponent(toarg));
+				switch (argObj.totype) {
+					case "0": //鍐呴摼
+						if (argObj.url) {
+							uni.navigateTo({
+								url: argObj.url
+							});
+						}
+						break;
+					default:
+						break;
+				} */
+			},
+			getArgument(isload = false) {
+				if (this.globalData.argumentStr && this.globalData.argumentStr.length > 0) {
+					return;
+				}
 				try {
 					var args = plus.runtime.arguments;
+					console.log(args);
 					if (args) {
-						/* if (this.globalData.argumentStr == args) {
+						if (isload) {
+							this.globalData.argumentStr = args;
 							return;
 						}
-						this.globalData.argumentStr = args; */
 						plus.runtime.arguments = "";
 						plus.runtime.arguments = null;
-						var toarg = args.replace('dafanguan://', '');
-						var argObj = JSON.parse(decodeURIComponent(toarg));
-						switch (argObj.totype) {
-							case "0": //鍐呴摼
-								if(argObj.url)
-								{
-									uni.navigateTo({
-										url: argObj.url
-									});
-								}
-								break;
-							default:
-								break;
-						}
+						this.targetArgument(args);
 					}
 				} catch (es) {
 					console.log(es)
@@ -252,7 +276,7 @@
 			updatePushCid: function() {
 				let clientInfo = uni.getStorageSync('clientInfo');
 				if (clientInfo && clientInfo != 'null' && clientInfo.clientid) {
-					console.log('寮�濮嬫洿鏂�:'+clientInfo.clientid);
+					console.log('寮�濮嬫洿鏂�:' + clientInfo.clientid);
 					this.$u.api.updateCid({
 						pushcid: clientInfo.clientid
 					}).then(e => {}).catch(function(err) {})
@@ -299,6 +323,7 @@
 							that.globalData.ifwt = 0
 						}
 					}
+
 					// #endif
 				}).catch(function(err) {
 					that.globalData.hasinit = false;

--
Gitblit v1.9.3