Commit 276a64cb577fd6e79e616983b4e8b6f34c6e3f12
1 parent
48be9bf1
Exists in
master
feat: 埋、扫一扫
Showing
7 changed files
with
113 additions
and
80 deletions
Show diff stats
package.json
1 | 1 | { |
2 | - "name": "sxh_personal_center", | |
3 | - "version": "0.1.0", | |
4 | - "private": true, | |
5 | - "scripts": { | |
6 | - "serve": "vue-cli-service serve", | |
7 | - "dev": "vue-cli-service serve", | |
8 | - "build": "vue-cli-service build" | |
9 | - }, | |
10 | - "dependencies": { | |
11 | - "@aligov/jssdk-mgop": "^3.1.7", | |
12 | - "axios": "^0.19.2", | |
13 | - "core-js": "^3.6.4", | |
14 | - "dayjs": "^1.10.7", | |
15 | - "html2canvas": "^1.3.2", | |
16 | - "js-base64": "^3.6.0", | |
17 | - "less-loader": "^6.1.2", | |
18 | - "moment": "^2.29.1", | |
19 | - "node-sass": "^4.14.1", | |
20 | - "postcss-px-to-viewport": "^1.1.1", | |
21 | - "qrcodejs2": "0.0.2", | |
22 | - "qs": "^6.9.3", | |
23 | - "sass-loader": "^8.0.0", | |
24 | - "vant": "^2.12.26", | |
25 | - "vconsole": "^3.6.1", | |
26 | - "vue": "^2.6.11", | |
27 | - "vue-imgcut": "^1.0.8", | |
28 | - "vue-router": "^3.1.6", | |
29 | - "vuex": "^3.1.3", | |
30 | - "weixin-js-sdk": "^1.6.0" | |
31 | - }, | |
32 | - "devDependencies": { | |
33 | - "@vue/cli-plugin-babel": "^4.3.0", | |
34 | - "@vue/cli-service": "^4.3.0", | |
35 | - "babel-plugin-import": "^1.13.3", | |
36 | - "postcss-import": "^11.0.0", | |
37 | - "postcss-loader": "^2.0.8", | |
38 | - "postcss-url": "^7.2.1", | |
39 | - "style-loader": "^2.0.0", | |
40 | - "vue-template-compiler": "^2.6.11" | |
41 | - }, | |
42 | - "browserslist": [ | |
43 | - "> 1%", | |
44 | - "last 2 versions", | |
45 | - "not dead" | |
46 | - ] | |
47 | -} | |
2 | + "name": "sxh_personal_center", | |
3 | + "version": "0.1.0", | |
4 | + "private": true, | |
5 | + "scripts": { | |
6 | + "serve": "vue-cli-service serve", | |
7 | + "dev": "vue-cli-service serve", | |
8 | + "build": "vue-cli-service build" | |
9 | + }, | |
10 | + "dependencies": { | |
11 | + "@aligov/jssdk-mgop": "^3.1.7", | |
12 | + "axios": "^0.19.2", | |
13 | + "core-js": "^3.6.4", | |
14 | + "dayjs": "^1.10.7", | |
15 | + "html2canvas": "^1.3.2", | |
16 | + "js-base64": "^3.6.0", | |
17 | + "less-loader": "^6.1.2", | |
18 | + "moment": "^2.29.1", | |
19 | + "node-sass": "^4.14.1", | |
20 | + "postcss-px-to-viewport": "^1.1.1", | |
21 | + "qrcodejs2": "0.0.2", | |
22 | + "qs": "^6.9.3", | |
23 | + "sass-loader": "^8.0.0", | |
24 | + "vant": "^2.12.26", | |
25 | + "vconsole": "^3.6.1", | |
26 | + "vue": "^2.6.11", | |
27 | + "vue-imgcut": "^1.0.8", | |
28 | + "vue-router": "^3.1.6", | |
29 | + "vuex": "^3.1.3", | |
30 | + "weixin-js-sdk": "^1.6.0" | |
31 | + }, | |
32 | + "devDependencies": { | |
33 | + "@vue/cli-plugin-babel": "^4.3.0", | |
34 | + "@vue/cli-service": "^4.3.0", | |
35 | + "babel-plugin-import": "^1.13.3", | |
36 | + "postcss-import": "^11.0.0", | |
37 | + "postcss-loader": "^2.0.8", | |
38 | + "postcss-url": "^7.2.1", | |
39 | + "style-loader": "^2.0.0", | |
40 | + "vue-template-compiler": "^2.6.11" | |
41 | + }, | |
42 | + "browserslist": [ | |
43 | + "> 1%", | |
44 | + "last 2 versions", | |
45 | + "not dead" | |
46 | + ] | |
47 | +} | |
48 | 48 | \ No newline at end of file | ... | ... |
public/index.html
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html lang="en"> |
3 | - <head> | |
3 | + | |
4 | +<head> | |
4 | 5 | <meta charset="utf-8"> |
5 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
6 | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> |
7 | - <meta name="format-detection" content="telephone=yes"/> | |
8 | + <meta name="format-detection" content="telephone=yes" /> | |
8 | 9 | <link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
9 | 10 | <title></title> |
10 | - </head> | |
11 | - <body> | |
11 | + <!-- 埋点 --> | |
12 | + <script src="https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085"></script> | |
13 | + <script> | |
14 | + (function(w, d, s, q, i) { | |
15 | + w[q] = w[q] || []; | |
16 | + var f = d.getElementsByTagName(s)[0], | |
17 | + j = d.createElement(s); | |
18 | + j.async = true; | |
19 | + j.id = 'beacon-aplus'; | |
20 | + j.src = 'https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085'; | |
21 | + f.parentNode.insertBefore(j, f); | |
22 | + })(window, document, 'script', 'aplus_queue') | |
23 | + </script> | |
24 | +</head> | |
25 | + | |
26 | +<body> | |
12 | 27 | <noscript> |
13 | - <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | |
14 | - </noscript> | |
28 | + <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. | |
29 | + Please enable it to continue.</strong> | |
30 | + </noscript> | |
15 | 31 | <div id="app"></div> |
16 | - <script src="https://webapi.amap.com/maps?v=1.4.15&key=61af1988b71a634a59a0de29409baeb8"></script> | |
32 | + <!-- 地图 --> | |
33 | + <script src="https://webapi.amap.com/maps?v=1.4.15&key=61af1988b71a634a59a0de29409baeb8"></script> | |
34 | + <!-- 政务中台JSAPI --> | |
35 | + <script src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.0.1/zwjsbridge.js"></script> | |
36 | + | |
17 | 37 | </body> |
18 | -</html> | |
38 | + | |
39 | +</html> | |
19 | 40 | \ No newline at end of file | ... | ... |
src/App.vue
src/main.js
... | ... | @@ -7,8 +7,6 @@ import store from './store' |
7 | 7 | import Moment from 'moment' |
8 | 8 | Vue.prototype.Moment = Moment; |
9 | 9 | |
10 | -import yxAxios from '@/https/yxAxios' | |
11 | -Vue.prototype.yxAxios = yxAxios; | |
12 | 10 | |
13 | 11 | import { mgop } from '@aligov/jssdk-mgop'; |
14 | 12 | Vue.prototype.mgop = mgop; | ... | ... |
src/views/Home/Home.vue
src/views/Home/component/HomeScan.vue
... | ... | @@ -8,25 +8,19 @@ |
8 | 8 | export default { |
9 | 9 | methods: { |
10 | 10 | saoYiSao () { |
11 | - let isLogin = this.checkLogin() | |
12 | - if (!isLogin) return; | |
13 | - if (process.env.NODE_ENV === "production" && this.common.isWeiXin()) { | |
14 | - location.href = `http://sao315.com/w/api/saoyisao?redirect_uri=https://payment.myjxt.com/center/%23/MyClassList`; | |
15 | - } else { | |
16 | - this.$router.push({ name: 'MyClassList', query: { qrresult: '188' } }) | |
17 | - } | |
18 | - }, | |
19 | - // 判断是否已登录 | |
20 | - checkLogin () { | |
21 | - if (process.env.NODE_ENV != "production") return true; | |
22 | - const userInfo = JSON.parse(sessionStorage.getItem('userInfo')) | |
23 | - if (!userInfo?.phone) { | |
24 | - sessionStorage.setItem('prePage', 'Home' + sessionStorage.getItem('publicName')); | |
25 | - sessionStorage.setItem('prePageQuery', JSON.stringify({ showTab: this.$route.query.showTab })); | |
26 | - this.$router.push({ name: 'LoginPublic', query: { publicName: sessionStorage.getItem('publicName') } }) | |
27 | - return false; | |
28 | - } | |
29 | - return true; | |
11 | + ZWJSBridge.scan({ | |
12 | + "type": "qrCode" | |
13 | + }).then(res => { | |
14 | + console.log(res) | |
15 | + const qrcode = res.qrcode | |
16 | + if(qrcode.length>10){ | |
17 | + this.$toast.fail('请扫描正确的基地码') | |
18 | + return; | |
19 | + } | |
20 | + this.$router.push({ name: 'MyClassList', query: { qrresult: res.qrcode } }) | |
21 | + }).catch(err => { | |
22 | + console.log(err) | |
23 | + }) | |
30 | 24 | }, |
31 | 25 | } |
32 | 26 | } | ... | ... |
src/views/Service/ServiceKQ.vue
... | ... | @@ -14,6 +14,12 @@ export default { |
14 | 14 | |
15 | 15 | mounted () { |
16 | 16 | console.log('xst mounted') |
17 | + aplus_queue.push({ | |
18 | + 'action': 'aplus.sendPV', | |
19 | + 'arguments': [{ | |
20 | + is_auto: false | |
21 | + }] | |
22 | + }) | |
17 | 23 | this.checkAuth() |
18 | 24 | |
19 | 25 | }, |
... | ... | @@ -27,14 +33,20 @@ export default { |
27 | 33 | if (centerNo) { |
28 | 34 | this.centerNo = centerNo |
29 | 35 | sessionStorage.setItem('centerNo', centerNo); |
36 | + console.log(111) | |
30 | 37 | this.getUserInfo() |
31 | 38 | } else { |
39 | + console.log(222) | |
32 | 40 | const sUserAgent = window.navigator.userAgent.toLowerCase() |
33 | 41 | const dtdreamweb = sUserAgent.indexOf("dtdreamweb") > -1 |
34 | 42 | const miniprogram = sUserAgent.indexOf("miniprogram") > -1 && sUserAgent.indexOf("alipay") > -1 |
35 | 43 | if (dtdreamweb) { |
44 | + console.log(333) | |
36 | 45 | alert('浙里办') |
37 | - window.location.href = `https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=hswsy`; | |
46 | + // window.location.href = `https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=hswsy`; | |
47 | + this.centerNo = '20210930160466993660' | |
48 | + sessionStorage.setItem('centerNo', '20210930160466993660'); | |
49 | + this.getUserInfo() | |
38 | 50 | } |
39 | 51 | // else if (miniprogram) { |
40 | 52 | // alert('支付宝') |
... | ... | @@ -52,9 +64,9 @@ export default { |
52 | 64 | getUserInfo: function () { |
53 | 65 | this.mgop({ |
54 | 66 | api: 'mgop.sz.hswsy.getPortalUserByNum', // 必须 |
55 | - host: 'https://mapi.zjzwfw.gov.cn/', | |
56 | - dataType: 'JSON', | |
57 | - type: 'GET', | |
67 | + // host: 'https://mapi.zjzwfw.gov.cn/', | |
68 | + // dataType: 'JSON', | |
69 | + // type: 'GET', | |
58 | 70 | appKey: 'fuxgnukl+2001895516+edccpx', // 必须 |
59 | 71 | headers: { |
60 | 72 | // 'isTestUrl': '1' | ... | ... |