From 55f5543d41569f7c42f50799b2200393ffd5b31a Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期日, 04 八月 2024 10:55:29 +0800
Subject: [PATCH] addd 支持特殊二维码

---
 pages/user/supplier-user.vue |   81 ++++++++++++++++++++++++++++++++--------
 1 files changed, 64 insertions(+), 17 deletions(-)

diff --git a/pages/user/supplier-user.vue b/pages/user/supplier-user.vue
index c9da5b7..550037f 100644
--- a/pages/user/supplier-user.vue
+++ b/pages/user/supplier-user.vue
@@ -180,7 +180,7 @@
 					<uni-icons type="right"></uni-icons>
 				</view>
 			</view>
-		<!-- 	<view class="user-util m-t-12 flex" v-if="selftype==='partner'"
+			<!-- 	<view class="user-util m-t-12 flex" v-if="selftype==='partner'"
 				@click="goto('/sub_pages/partner/partner-info/partner-code-v2',true)">
 				<view class="title">测试二维码</view>
 				<view class="right-icon">
@@ -198,7 +198,14 @@
 				</view>
 			</view>
 			<!-- #endif -->
-
+			<view class="user-util m-t-12 flex"
+				v-if="selftype==='supplier'&&currentInfo&&currentInfo.id&&currentInfo.supplierDTO&&currentInfo.supplierDTO.status==='P'"
+				@click="goto('/sub_pages/supplier/supplier-info/supplier-info-update',true)">
+				<view class="title">信息维护</view>
+				<view class="right-icon">
+					<uni-icons type="right"></uni-icons>
+				</view>
+			</view>
 			<view class="user-util m-t-12 flex" v-if="selftype==='supplier'"
 				@click="goto('/sub_pages/supplier/supplier-info/supplier-info',true)">
 				<view class="title">店铺信息</view>
@@ -329,14 +336,51 @@
 				order_pendding_num: 0,
 
 			};
-		},
-		// watch: {
-		// 	currentInfo(nv, ov) {
-		// 		if (!cacheUserId) {
-
-		// 		}
-		// 	}
-		// },
+		},
+		// #ifndef PUB_CUSTOMER
+		onShareAppMessage() {
+			let that = this;
+			var name = that.currentInfo.customerDTO&&currentInfo.customerDTO.name || that.currentInfo.supplierDTO&&currentInfo.supplierDTO.name || that.currentInfo.partnerDTO&&currentInfo.partnerDTO.name || ''
+			var url =
+				`/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
+			return {
+				title: "花满芫",
+				path: url,
+			}
+		},
+		onShareTimeline() {
+			let that = this;
+			var name = that.currentInfo.customerDTO&&currentInfo.customerDTO.name || that.currentInfo.supplierDTO&&currentInfo.supplierDTO.name || that.currentInfo.partnerDTO&&currentInfo.partnerDTO.name || ''
+			var url =
+				`/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
+			return {
+				title: "花满芫",
+				path: url,
+			}
+		},
+		// #endif
+		// #ifdef PUB_CUSTOMER
+		onShareAppMessage() {
+			let that = this;
+			var name = that.currentInfo.customerDTO&&currentInfo.customerDTO.name || that.currentInfo.supplierDTO&&currentInfo.supplierDTO.name || that.currentInfo.partnerDTO&&currentInfo.partnerDTO.name || ''
+			var url =
+				`/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
+			return {
+				title: "花满芫",
+				path: url,
+			}
+		},
+		onShareTimeline() {
+			let that = this;
+			var name = that.currentInfo.customerDTO&&currentInfo.customerDTO.name || that.currentInfo.supplierDTO&&currentInfo.supplierDTO.name || that.currentInfo.partnerDTO&&currentInfo.partnerDTO.name || ''
+			var url =
+				`/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
+			return {
+				title: "花满芫",
+				path: url,
+			}
+		},
+		// #endif
 		onShow() {
 			this.getTj()
 		},
@@ -360,7 +404,7 @@
 		},
 		methods: {
 			async bindPartnerUser(userId, name) {
-				await this.$message.confirm(`确定要绑定${name}合伙人吗?`)
+				// await this.$message.confirm(`确定要绑定${name}合伙人吗?`)
 				//调用接口绑定
 				this.$message.showLoading()
 				const {
@@ -385,18 +429,20 @@
 						console.log('条码内容:' + res.result);
 						var dto = undefined
 						try {
-							if (res.result && res.result.startsWith('http://') && res.result.indexOf(
+							if (res.result && (res.result.startsWith('https://')||res.result.startsWith('http://')) && res.result.indexOf(
 									'partnerUserId') >= 0) {
-								var arr = res.result.split("?")[1].split("&")
+								var arr = res.result.split("?")[1].split("&")
 								dto = {}
 								for (var item of arr) {
-									var tarr = item.split("=")
+									var tarr = item.split("=")
+									// console.log('tarr',tarr)
 									if (tarr[1]) {
-										dto[tarr[0]] = dto[tarr[1]]
+										dto[tarr[0]] = tarr[1]
 									}
 								}
-								dto['name'] = dto['partnerUserName'] || dto['partnerUserId'] || '佚名'
+								dto['name'] = dto['partnerUserName'] || ''
 								dto['userId'] = dto['partnerUserId'] || ''
+								// console.log('tmp arr',arr,dto)
 
 							} else {
 								dto = JSON.parse(res.result)
@@ -410,7 +456,8 @@
 							} else {
 								that.$message.showToast('二维码格式不正确扫码失败')
 							}
-						} catch (e) {
+						} catch (e) {
+							console.log('e',e)
 							that.$message.showToast('二维码扫码错误')
 						}
 					},

--
Gitblit v1.9.3