xiaohaizhao 1 anno fa
parent
commit
1e9a898c12

+ 57 - 4
pages/index/index.vue

@@ -9,7 +9,7 @@
 		<dataBank ref="资料库" v-show="page == '资料库'" />
 		<school ref="商学院" v-show="page == '商学院'" />
 		<product ref="单品" v-show="page == '单品'" />
-		
+
 		<bottom-suspension-frame ref="pages" @onChange="pageChange" />
 	</view>
 </template>
@@ -34,6 +34,62 @@ export default {
 			page: '首页'
 		}
 	},
+	onLoad(options) {
+		let user = {
+			wechatBindUserid: 0,
+			userName: ""
+		},
+			that = this;
+		if (options.wechatBindUserid) {
+			user.wechatBindUserid = options.wechatBindUserid;
+			user.userName = options.userName;
+		}
+		if (options.q) {
+			let params = this.getUrlParams(options.q);
+			user.wechatBindUserid = params.wechatBindUserid;
+			user.userName = params.userName;
+		}
+		if (user.wechatBindUserid) {
+			console.log("被邀请绑定账号", user);
+			uni.showModal({
+				title: '提醒',
+				content: `"${user.userName}"是否与当前微信号绑定`,
+				confirmText: '确定绑定',
+				success: function ({ confirm }) {
+					if (confirm) uni.login({
+						success(res) {
+							that.$Http.basic({
+								"id": 20240516090402,
+								"content": {
+									"wechat_code": res.code,
+									"isbinging": 1,
+									"wechatuserinfo": "",
+									"userid": user.wechatBindUserid
+								}
+							}).then(res => {
+								console.log("绑定账号", res)
+								uni.showModal({
+									title: '提示',
+									content: res.msg == '成功' ? '绑定成功' : res.msg,
+									showCancel: false,
+									success: function ({ confirm }) {
+										if (confirm) {
+											if (res.msg == '成功') that.$Login.wechatLogin().then(s => {
+												uni.reLaunch({
+													url: '/pages/index/index'
+												})
+											})
+										}
+									}
+								});
+								if (that.cutoff(res.msg, '绑定成功')) return;
+							})
+						}
+					})
+				}
+			});
+		}
+	},
 	onShow() {
 		const systemInitIsComplete = this.$Http.systemInitIsComplete;
 		if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
@@ -53,9 +109,6 @@ export default {
 	methods: {
 		updatePageData(itemId, page) {
 			if (this.$refs[this.page].updatePage) this.$refs.pages.onClick(itemId, page)
-		},
-		changePage(itemId, page, params) {
-
 		},
 		pageChange(detail) {
 			uni.setNavigationBarTitle({

+ 3 - 2
team/team/getInvite.vue

@@ -52,8 +52,6 @@ export default {
         }
     },
     onLoad(options) {
-        console.log("被邀请加入团队", options)
-        this.sys_enterpriseid = options.id;
         const systemInitIsComplete = this.$Http.systemInitIsComplete;
         if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
             this.$Http.HomePageStartRendering = render(this)
@@ -66,6 +64,9 @@ export default {
                     clearInterval(count)
                     let user = uni.getStorageSync('userMsg');
                     that.userid = user.userid;
+                    if (options.id) that.sys_enterpriseid = options.id;
+                    if (options.q) that.sys_enterpriseid = this.getUrlParams(options.q).id;
+                    console.log("that.sys_enterpriseid", that.sys_enterpriseid)
                     if (user.usertype == 99) {
                         that.init();
                     } else {

+ 1 - 1
team/userCenter/personal.vue

@@ -28,7 +28,7 @@
         <view style="height: 70px;" />
         <view class="footer">
             <navigator class="insert" v-if="detail.iswechatbind == 0"
-                :url="'/team/userCenter/wechatbind?id=' + detail.userid">
+                :url="'/team/userCenter/wechatbind?id=' + detail.userid + '&name=' + detail.name">
                 绑定微信
             </navigator>
             <navigator class="invite" style="flex: 1;" url="/team/team/InviteUser">

+ 5 - 2
team/userCenter/wechatbind.vue

@@ -16,7 +16,7 @@
                         css="width:180px;line-height:20px;height:20px;position: absolute;left:86px;top:55px;z-index:2;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-family: Source Han Sans SC, Source Han Sans SC;font-size: 14px;color: #666666;" />
                     <l-painter-text text="扫码绑定微信"
                         css="width:72px;line-height:17px;position: absolute;left:50%;bottom:269px;z-index:2;margin-left:-36px;font-size: 12px;color: #666666;font-family: PingFang SC, PingFang SC;" />
-                    <l-painter-qrcode :text="qrCode + 'wechatBind?wechatBindUserid=' + userid"
+                    <l-painter-qrcode :text="qrCode + 'wechatBind?wechatBindUserid=' + userid + '&userName=' + userName"
                         css="width: 200px; height: 200px;position: absolute;left:50%;bottom:55px;z-index:2;margin-left:-100px;" />
                 </l-painter>
             </view>
@@ -48,10 +48,13 @@ export default {
             qrCode: this.qrCodePrefix,
             name: "",
             userid: 0,
+            userName: ""
         }
     },
     onLoad(options) {
+        console.log(options)
         this.userid = options.id;
+        this.userName = options.name;
         uni.setNavigationBarTitle({
             title: '绑定微信'
         });
@@ -141,7 +144,7 @@ export default {
         getSheraDate() {
             return {
                 title: this.name, // 标题
-                path: "/pages/index/index?wechatBindUserid=" + this.userid, // 分享路径
+                path: "/pages/index/index?wechatBindUserid=" + this.userid + '&userName=' + this.userName, // 分享路径
                 imageUrl: ""// 分享图
             };
         }

+ 11 - 0
utils/tool.js

@@ -236,6 +236,17 @@ function mount() {
             enddate: Vue.prototype.formatTime(new Date(end)).split(' ')[0],
         }
     }
+    Vue.prototype.getUrlParams = urlStr => {
+        const url = decodeURIComponent(urlStr)
+        let obj = {}
+        let str = url.slice(url.indexOf('?') + 1)
+        let arr = str.split('&')
+        for (let j = arr.length, i = 0; i < j; i++) {
+            let arr_temp = arr[i].split('=')
+            obj[arr_temp[0]] = arr_temp[1]
+        }
+        return obj
+    }
 }
 
 module.exports = {