diff --git a/package-lock.json b/package-lock.json
index f405087..8cf40a9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,7 +10,8 @@
"license": "ISC",
"dependencies": {
"@dcloudio/uni-ui": "^1.5.12",
- "vuex": "^4.1.0"
+ "vuex": "^4.1.0",
+ "weixin-js-sdk": "^1.6.5"
}
},
"node_modules/@babel/helper-string-parser": {
@@ -326,6 +327,12 @@
"peerDependencies": {
"vue": "^3.2.0"
}
+ },
+ "node_modules/weixin-js-sdk": {
+ "version": "1.6.5",
+ "resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.5.tgz",
+ "integrity": "sha512-Gph1WAWB2YN/lMOFB/ymb+hbU/wYazzJgu6PMMktCy9cSCeW5wA6Zwt0dpahJbJ+RJEwtTv2x9iIu0U4enuVSQ==",
+ "license": "MIT"
}
}
}
diff --git a/package.json b/package.json
index 29dc54f..b74dc91 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"type": "commonjs",
"dependencies": {
"@dcloudio/uni-ui": "^1.5.12",
- "vuex": "^4.1.0"
+ "vuex": "^4.1.0",
+ "weixin-js-sdk": "^1.6.5"
}
}
diff --git a/pages.json b/pages.json
index 79cc5c1..20a020c 100644
--- a/pages.json
+++ b/pages.json
@@ -84,6 +84,13 @@
"navigationBarTitleText": "授权"
}
},
+ {
+ "path": "pages/auth/help",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "授权帮助"
+ }
+ },
{
"path": "pages/activity/activity",
"style": {
diff --git a/pages/auth/auth.vue b/pages/auth/auth.vue
index d412f0e..8b983ad 100644
--- a/pages/auth/auth.vue
+++ b/pages/auth/auth.vue
@@ -41,6 +41,10 @@
+
+
+ 授权帮助流程
+
@@ -48,6 +52,7 @@
import { getEnvironment } from '@/utils/env.js';
import http from '@/request/request.js';
import pagesConfig from '@/pages.json';
+import wx from 'weixin-js-sdk';
export default {
data() {
@@ -275,6 +280,30 @@ export default {
const baseUrl = this.getBaseUrl();
return baseUrl + '/affiliate-activity/pages/auth/auth';
},
+
+ goAuthHelp() {
+ const env = getEnvironment();
+ if (env.isWechatMiniProgram) {
+ console.log('微信/小程序环境跳转淘宝授权帮助页');
+ wx.miniProgram.navigateTo({
+ url: '/pages/users/tbdesc/index',
+ success: (res) => {
+ console.log('跳转淘宝授权帮助页成功:', res);
+ },
+ fail: (err) => {
+ // 兜底方案,跳转小程序失败后跳本项目中的授权帮助页
+ uni.navigateTo({
+ url: '/pages/auth/help'
+ });
+ }
+ });
+ } else {
+ console.log('其他平台默认跳转授权帮助页');
+ uni.navigateTo({
+ url: '/pages/auth/help'
+ });
+ }
+ },
}
}
@@ -376,4 +405,11 @@ export default {
font-size: 30rpx;
font-weight: 500;
}
+
+.auth-help {
+ margin-top: 48rpx;
+ font-size: 32rpx;
+ color: #868C97;
+ text-align: center;
+}
diff --git a/pages/auth/help.vue b/pages/auth/help.vue
new file mode 100644
index 0000000..5e02579
--- /dev/null
+++ b/pages/auth/help.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
diff --git a/unpackage/dist/cache/.vite/deps/_metadata.json b/unpackage/dist/cache/.vite/deps/_metadata.json
index b492e34..e4bb661 100644
--- a/unpackage/dist/cache/.vite/deps/_metadata.json
+++ b/unpackage/dist/cache/.vite/deps/_metadata.json
@@ -1,8 +1,15 @@
{
- "hash": "aee3647b",
+ "hash": "d2066d53",
"configHash": "43aa957d",
- "lockfileHash": "32773baf",
- "browserHash": "732cb9f3",
- "optimized": {},
+ "lockfileHash": "82969c70",
+ "browserHash": "9269f26f",
+ "optimized": {
+ "weixin-js-sdk": {
+ "src": "../../../../../node_modules/weixin-js-sdk/index.js",
+ "file": "weixin-js-sdk.js",
+ "fileHash": "9d4cff9a",
+ "needsInterop": true
+ }
+ },
"chunks": {}
}
\ No newline at end of file