shish 5 سال پیش
والد
کامیت
c2e5aff9c2

+ 1 - 1
mallApp/src/api/common/index.js

@@ -9,7 +9,7 @@ export const uploadPic = data => https.post('/upload/save-img', data)
 export const getMerchantInfo = param => https.get('/merchant/get-info', param)
 
 // M 端用户信息
-export const getShopUserApi = param => https.get('/user/my-profile', param)
+export const getCustomApi = param => https.get('/custom/init-custom', param)
 
 // 商户信息
 export const getUserApi = param => https.get('/merchant/detail', param)

+ 9 - 8
mallApp/src/mixins/globalMixins.js

@@ -27,17 +27,18 @@ export default {
 		}
 		if (option.account) {
 
-			//let oldAccount = uni.getStorageSync('account')
 			//切换门店,需要先确认有没生成客户id
-			//if(oldAccount != option.account){
-				// initCustom().then(res => {
-				// 	if(res.code == 1){
-				// 		uni.setStorageSync('customId', res.data.custom.id)
-				// 	}
-				// })
-			//}
+			// let oldAccount = uni.getStorageSync('account')
+			// if(oldAccount != option.account){
+			// 	getShopUser(true).then(res => {
+			// 		if(res.code == 1){
+			// 			uni.setStorageSync('customId', res.data.custom.id)
+			// 		}
+			// 	})
+			// }
 
 			uni.setStorageSync('account', option.account)
+
 		}
 		if (constant.source == 'mall') {
 			if (option.shopId) {

+ 3 - 18
mallApp/src/pages/goods/detail.vue

@@ -126,34 +126,19 @@ export default {
   },
   methods: {
     init() {
-      // #ifdef H5
-      // 微信二次分享
-      let href = window.location.href;
-      if (href.indexOf("from=singlemessage") > 0) {
-        location.href = `${
-          this.$constant.formal
-        }/#/pages/interest/invite${this.$util.parse(this.option)}`;
-        return false;
-      }
-      // #endif
-
+      let account = uni.getStorageSync('account')
       this._getDetail().then(() => {
         // 设置分享
         let shareParams = {
           title: `${this.data.goodsName}`, // 分享标题
           desc: "这束花不错推荐给你", // 分享内容
           imgUrl: this.data.smallImgList[0],
-          // #ifdef H5
-          pagePath: `${window.location.protocol}//mall.${this.$constant.firstHost}.com/#/pages/goods/detail?id=${this.data.id}`,
-          // #endif
           // #ifndef H5
-          pagePath: `/pages/goods/detail?id=${this.data.id}`
+          pagePath: `/pages/goods/detail?id=${this.data.id}&account=${account}`
           // #endif
         };
         this.jweixinFn(shareParams);
-      });
-
-      getShopUser(true);
+      })
     },
     async _getDetail() {
       await getDetail({ id: this.option.id }).then(res => {

+ 9 - 14
mallApp/src/pages/home/index.vue

@@ -69,28 +69,23 @@ export default {
   methods: {
     init () {
       getOrderShop().then(res => {
-        // uni.setNavigationBarTitle({
-        //   title: `${res.merchant.name}`
-        // });
-      });
-      this._detail();
-
+      })
+      this._detail()
+      let account = uni.getStorageSync('account')
+      
       getShopUser().then(res => {
         // 设置分享
         let shareParams = {
           title: `${res.name}`, // 分享标题
           desc: "", // 分享内容
           imgUrl: '',
-          // #ifdef H5
-          pagePath: `${window.location.protocol}//mall.${this.$constant.firstHost}.com/#/pages/home/index?account=${res.merchantId}&fromUserId=${res.id}`,
-          // #endif
           // #ifndef H5
-          pagePath: `/pages/home/index?fromUserId=${res.id}`
+          pagePath: `/pages/home/index?fromUserId=${res.id}&account=${account}`
           // #endif
-        };
-        this.jweixinFn(shareParams);
-      });
-
+        }
+        this.jweixinFn(shareParams)
+        console.log('分享地址',`/pages/home/index?fromUserId=${res.id}&account=${account}`)
+      })
     },
     _detail () {
       getMainIndex().then(res => {

+ 13 - 19
mallApp/src/pages/pay/index.vue

@@ -71,12 +71,10 @@
 	import ModalModule from '@/components/plugin/modal'
 	import AppCouponSel from '@/components/app-coupon-sel'
 	import AlertModule from '@/components/plugin/alert'
-	import { isLogin } from '@/utils/util'
 	import { isWxMiniapp } from '@/utils/common'
 	import { share } from '@/mixins'
 	import { fastPay } from '@/api/pay'
 	import { recharge } from '@/api/member'
-	import { getShopUser } from '@/utils/auth'
 	import { getOrderShop } from '@/utils/config'
 	export default {
 		name: 'pay',
@@ -159,24 +157,20 @@
 						this.discountArr = status
 					})
 				})
-				if (isLogin()) {
-					getShopUser(true).then(res => {
-						console.log('shopUser', res)
-						// 设置分享
-						let shareParams = {
-							title: `点我付款`, // 分享标题
-							desc: '享随机优惠,最高20元', // 分享内容
-							imgUrl: `${this.$constant.imgUrl}/retail/pay.jpg`,
-							// #ifdef H5
-							pagePath: `${this.$constant.formal}/#/pages/pay/index?account=${res.merchantId}&store=0&sourceType=3`,
-							// #endif
-							// #ifndef H5
-							pagePath: `/pages/pay/index?account=${res.merchantId}&store=0&sourceType=3`
-							// #endif
-						}
-						this.jweixinFn(shareParams)
-					})
+
+				// 设置分享
+				let shareParams = {
+					title: `点我付款`, // 分享标题
+					desc: '享随机优惠,最高20元', // 分享内容
+					imgUrl: `${this.$constant.imgUrl}/retail/pay.jpg`,
+					// #ifdef H5
+					pagePath: `${this.$constant.formal}/#/pages/pay/index?account=${res.merchantId}&store=0&sourceType=3`,
+					// #endif
+					// #ifndef H5
+					pagePath: `/pages/pay/index?account=${res.merchantId}&store=0&sourceType=3`
+					// #endif
 				}
+				this.jweixinFn(shareParams)
 			},
 			_pay() {
 				if (!this.amount) {

+ 0 - 7
mallApp/src/store/modules/user.js

@@ -1,5 +1,4 @@
 import { getState, setState } from '@/store/modules/vuexStorange'
-import { getSelfInfo } from '@/utils/auth'
 
 /** 员工用户信息 */
 const state = {
@@ -12,12 +11,6 @@ const getters = {
 	// 员工用户信息
 	getSelfInfo: (state) => {
 		getState(state, 'selfInfo', 'selfInfo')
-		// if (state.selfInfo) return state.selfInfo
-		// let data = {}
-		// getSelfInfo().then(res => {
-		// 	data = res
-		// })
-		// return data
 		return state.selfInfo
 	},
 	// 用户信息

+ 2 - 6
mallApp/src/utils/auth.js

@@ -1,7 +1,4 @@
 import store from '@/store'
-// #ifdef H5
-// import jweixin from 'jweixin-module'
-// #endif
 // import { share } from '@/mixins'
 import CONSTANT from '@/constant'
 import UTIL from '@/utils/util'
@@ -9,8 +6,7 @@ import UTIL from '@/utils/util'
 import {
 	getStaffApi,
 	getUserApi,
-	getShopUserApi
-	// checkLogin,
+	getCustomApi
 } from '@/api/common'
 import { postWxCode } from '@/api/mini'
 
@@ -24,7 +20,7 @@ export async function getShopUser(update) {
 	if (!UTIL.isEmpty(userInfo) && !update) {
 		return userInfo
 	}
-	await getShopUserApi().then((res) => {
+	await getCustomApi().then((res) => {
 		userInfo = res.data
 		store.dispatch('setShopUser', userInfo)
 	}).catch(() => {