lhl 2 vuotta sitten
vanhempi
commit
e944812078

+ 7 - 0
manifest.json

@@ -48,6 +48,13 @@
                         "appsecret" : "",
                         "UniversalLinks" : ""
                     }
+                },
+                "payment" : {
+                    "weixin" : {
+                        "__platform__" : [ "ios", "android" ],
+                        "appid" : "",
+                        "UniversalLinks" : ""
+                    }
                 }
             },
             "icons" : {

+ 142 - 152
pages/redirect/redirect.vue

@@ -1,153 +1,143 @@
-<template>
-	<view>
-	</view>
-</template>
-<script>
-import { getUserInfo } from '@/api/user.js';
-import { mapMutations,mapState } from 'vuex';
-// #ifdef H5
-import { wechatAuth } from '@/api/wx';
-// #endif
-// #ifdef MP-WEIXIN
-import { wechatMpAuth } from '@/api/wx';
-// #endif
-export default {
-	computed: {
-		...mapState(['urlFile'])
-	},
-	onLoad(option) {
-		let obj = this;
-		// 判断是否需要保存定向地址
-		// #ifdef H5
-		this.loadH5()
-		// #endif
-		// #ifdef MP-WEIXIN
-		this.loadMp(option)
-		// #endif
-	},
-	methods: {
-		...mapMutations('user',['login', 'setUserInfo']),
-		// #ifdef H5
-		loadH5() {
-			let obj = this;
-			let url = window.location.href;
-			let code = url.match(/code=([0-9]|[a-z]|[A-Z])*/g)[0].replace('code=', '');
-			let spread = uni.getStorageSync('spread') || ''
-			wechatAuth({
-				code: code,
-				spread: spread
-			}).then(({ data }) => {
-				obj.wchatAuth(data);
-			}).catch((e) => {
-				uni.showModal({
-					title: '错误',
-					content: JSON.stringify(e),
-					showCancel: false,
-				});
-			});;
-		},
-		// #endif
-		// #ifdef MP-WEIXIN
-		loadMp(option) {
-			let obj = this;
-			// 获取登录授权页数据
-			let user = obj.$api.prePage().userInfo;
-			// #ifndef MP
-			// 获取推广人id
-			let spread_spid = uni.getStorageSync('spread') || '';
-			// #endif
-			// #ifdef MP
-			// 小程序推广人
-			let spread_code = uni.getStorageSync('spread_code') || '';
-			// #endif
-			wechatMpAuth({
-				code: option.code,
-				iv: user.target.iv,
-				encryptedData: user.target.encryptedData,
-				// #ifndef MP
-				spread_spid: spread_spid,
-				// #endif
-				// #ifdef MP
-				spread_code:spread_code
-				// #endif
-			}).then(({ data }) => {
-				obj.wchatAuth(data);
-			}).catch((e) => {
-				uni.showModal({
-					title: '错误',
-					content: JSON.stringify(e),
-					showCancel: false,
-				});
-			});
-		},
-		// #endif
-		wchatAuth(data) {
-			let obj = this;
-			// 保存token
-			uni.setStorageSync('token', data.token);
-			// 获取用户基础信息
-			getUserInfo({}).then(e => {
-				obj.login();
-				// 保存返回用户数据
-				obj.setUserInfo(e.data);
-				let ur = uni.getStorageSync('present')|| '/pages/index/index';
-				// 用于处理缓存bug
-				if (ur=='pages/product/product') {
-					ur = '/pages/index/index'
-				}
-				// if (e.data.phone) {
-					uni.switchTab({
-						url: ur,
-						fail(e) {
-							console.log(e);
-							uni.navigateTo({
-								url: ur,
-								fail(e) {
-									console.log(e);
-									uni.switchTab({
-										url: '/pages/index/index'
-									});
-								}
-							});
-						}
-					});
-				// } else {
-				// 	uni.showModal({
-				// 		title: '提示',
-				// 		content: '请先绑定手机号',
-				// 		showCancel: false,
-				// 		success: res => {
-				// 			uni.navigateTo({
-				// 				url: '/pages/set/phone'
-				// 			});
-				// 		},
-				// 		fail(e) {
-				// 			console.log(e);
-				// 		}
-				// 	});
-				// }
-				// uni.switchTab({
-				// 	url: ur,
-				// 	fail(e) {
-				// 		uni.navigateTo({
-				// 			url: ur,
-				// 			fail(e) {
-				// 				uni.navigateTo({
-				// 					url: '/pages/index/index',
-				// 				});
-				// 			}
-				// 		});
-				// 	}
-				// });
-			}).catch((e) => {
-				uni.showModal({
-					title: '错误',
-					content: JSON.stringify(e),
-					showCancel: false,
-				});
-			});;
-		}
-	}
-};
-</script>
+<template>
+	<view>
+	</view>
+</template>
+<script>
+	import {
+		getUserInfo
+	} from '@/api/user.js';
+	import {
+		mapMutations,
+		mapState
+	} from 'vuex';
+	// #ifdef H5
+	import {
+		wechatAuth
+	} from '@/api/wx';
+	// #endif
+	// #ifdef MP-WEIXIN
+	import {
+		wechatMpAuth
+	} from '@/api/wx';
+	// #endif
+	export default {
+		computed: {
+			...mapState(['urlFile'])
+		},
+		onLoad(option) {
+			let obj = this;
+			// 判断是否需要保存定向地址
+			// #ifdef H5
+			this.loadH5()
+			// #endif
+			// #ifdef MP-WEIXIN
+			this.loadMp(option)
+			// #endif
+		},
+		methods: {
+			...mapMutations('user', ['login', 'setUserInfo']),
+			// #ifdef H5
+			loadH5() {
+				let obj = this;
+				let url = window.location.href;
+				let code = url.match(/code=([0-9]|[a-z]|[A-Z])*/g)[0].replace('code=', '');
+				let spread = uni.getStorageSync('spread') || ''
+				wechatAuth({
+					code: code,
+					spread: spread
+				}).then(({
+					data
+				}) => {
+					obj.wchatAuth(data);
+				}).catch((e) => {
+					uni.showModal({
+						title: '错误',
+						content: JSON.stringify(e),
+						showCancel: false,
+					});
+				});;
+			},
+			// #endif
+			// #ifdef MP-WEIXIN
+			loadMp(option) {
+				let obj = this;
+				// 获取登录授权页数据
+				let user = obj.$api.prePage().userInfo;
+				// #ifndef MP
+				// 获取推广人id
+				let spread_spid = uni.getStorageSync('spread') || '';
+				// #endif
+				// #ifdef MP
+				// 小程序推广人
+				let spread_code = uni.getStorageSync('spread_code') || '';
+				// #endif
+				wechatMpAuth({
+					code: option.code,
+					iv: user.target.iv,
+					encryptedData: user.target.encryptedData,
+					// #ifndef MP
+					spread_spid: spread_spid,
+					// #endif
+					// #ifdef MP
+					spread_code: spread_code
+					// #endif
+				}).then(({
+					data
+				}) => {
+					obj.wchatAuth(data);
+				}).catch((e) => {
+					uni.showModal({
+						title: '错误',
+						content: JSON.stringify(e),
+						showCancel: false,
+					});
+				});
+			},
+			// #endif
+			wchatAuth(data) {
+				let obj = this;
+				// 保存token
+				uni.setStorageSync('token', data.token);
+				// 获取用户基础信息
+				getUserInfo({}).then(e => {
+					obj.login();
+					// 保存返回用户数据
+					obj.setUserInfo(e.data);
+					let ur = uni.getStorageSync('present') || '/pages/index/index';
+					// 用于处理缓存bug
+					if (ur == 'pages/product/product') {
+						ur = '/pages/index/index'
+					}
+					// #ifdef H5
+					window.location.href = obj.$store.state.baseURL + obj.$store.state.urlFile + '/#' + ur
+					// #endif
+					// #ifdef MP
+					uni.switchTab({
+						url: ur,
+						fail(e) {
+							console.log(e);
+							uni.navigateTo({
+								url: ur,
+								fail(e) {
+									console.log(e);
+									uni.switchTab({
+										url: '/pages/index/index'
+									});
+								}
+							});
+						}
+					});
+					// #endif
+
+				}).catch((e) => {
+					uni.showModal({
+						title: '错误',
+						content: JSON.stringify(e),
+						showCancel: false,
+					});
+				});;
+			}
+		}
+	};
+</script>
 <style></style>

+ 2 - 4
pages/user/user.vue

@@ -289,10 +289,8 @@
 						},
 						fail() {
 							// obj.shao()
-							obj.$api.msg('系统繁忙请重新操作')
-							setTimeout(function() {
-								window.location.reload()
-							}, 300)
+							// window.location.href = obj.$store.state.baseURL + '/wap/#/pages/user/user'
+							// obj.shao()
 						}
 					});
 				});

BIN
unpackage/dist/build/h5/5-23-1.rar → unpackage/dist/build/h5/5-25-1.rar


+ 1 - 1
unpackage/dist/build/h5/index.html

@@ -1,2 +1,2 @@
 <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>想亮商城</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
-            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/wap/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/wap/static/js/chunk-vendors.58012eb0.js></script><script src=/wap/static/js/index.e1755007.js></script></body></html>
+            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/index/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/index/static/js/chunk-vendors.58012eb0.js></script><script src=/index/static/js/index.3385a52b.js></script></body></html>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
unpackage/dist/build/h5/static/js/index.3385a52b.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
unpackage/dist/build/h5/static/js/index.e1755007.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-redirect-redirect.7a5bc2e0.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-redirect-redirect.e998926e.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-user.5c8a4bea.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-user.5fba777d.js


+ 1 - 1
utils/wxAuthorized.js

@@ -118,7 +118,7 @@ export async function weixindata(config) {
 						appId = data.appId
 						// 微信信息配置
 						weixinObj.config({
-							debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+							debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
 							appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
 							timestamp: data.timestamp, // 必填,生成签名的时间戳
 							nonceStr: data.nonceStr, // 必填,生成签名的随机串

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä