From 4f30734588eb34ea2d7c27856f72ce40da8ab365 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期六, 28 二月 2026 12:01:10 +0800
Subject: [PATCH] 小程序   接口开发

---
 mini-program/App.vue |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/mini-program/App.vue b/mini-program/App.vue
index 3898567..78e2b7c 100644
--- a/mini-program/App.vue
+++ b/mini-program/App.vue
@@ -5,7 +5,8 @@
 		computed: {
 			...mapState(['userInfo', 'token'])
 		},
-		onLaunch: async function() {
+		onLaunch: async function(options) {
+			// this.dealRecShopUserBiz(options) 
 			// 鐧诲綍
 			var that = this;
 			if (!this.token) {
@@ -44,13 +45,65 @@
 				await that.checkLocationAuth()
 			}
 		},
-		onShow: function() {
-			console.log('App Show')
+		onShow:async function(options) {
+			this.dealRecShopUserBiz(options) 
+			this.getBackgroundImg()
 		},
 		onHide: function() {
 			console.log('App Hide')
 		},
 		methods: {
+			getBackgroundImg() {
+				this.$u.api.getPlatformAboutUs({})
+					.then(res => {
+						if (res.code === 200) {
+							let obj = {
+								shopIntegralBg: res.data.shopIntegralBg,
+								userInviteBg: res.data.userInviteBg,
+								userShareBg: res.data.userShareBg,
+								centerInviteBg: res.data.centerInviteBg
+							}
+							uni.setStorageSync('backgroundImage', obj);
+						}
+					})
+			},
+			async dealRecShopUserBiz(options){
+				if(options.query && options.query.userId){
+					if(!this.userInfo || !this.userInfo.id){
+						await this.$store.commit('setRecUserId',options.query.userId)
+					}
+				}
+				if(options.query && options.query.scene &&  options.query.scene.length){
+					if(options.query.scene.indexOf("sid_")>=0){
+						 let s = options.query.scene.indexOf("sid_")+4;
+						 var shopId = '';
+						 let e = options.query.scene.length
+						 let ts =  options.query.scene.slice(s, e)
+						 e = ts.length
+						 if(ts.indexOf("&")>0){
+							 e =ts.indexOf("&")
+						 }
+						 if(e>0){
+							shopId =ts.slice(0, e)
+						 } 
+						 if(shopId){
+							 if(this.userInfo&& this.userInfo.id){
+								 try{
+									 let res = await this.$u.api.bindShopInfo({ code })
+									 if(res.code != 200){
+										 await this.$store.commit('setRecShopId',shopId)
+									 }
+								 }catch(e){
+									  await this.$store.commit('setRecShopId',shopId)
+								 }
+							 }else{
+								 await this.$store.commit('setRecShopId',shopId)
+							 }
+							 
+						 }
+					}
+				}
+			},
 			checkLocationAuth() {
 			    uni.getSetting({
 			        success: (res) => {

--
Gitblit v1.9.3