yuantianjiao 6 vuotta sitten
vanhempi
commit
ec97245fe7

+ 1
- 0
build/webpack.dev.conf.js Näytä tiedosto

23
   // these devServer options should be customized in /config/index.js
23
   // these devServer options should be customized in /config/index.js
24
   devServer: {
24
   devServer: {
25
     clientLogLevel: 'warning',
25
     clientLogLevel: 'warning',
26
+    disableHostCheck: true,
26
     historyApiFallback: {
27
     historyApiFallback: {
27
       rewrites: [
28
       rewrites: [
28
         { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29
         { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },

+ 1
- 1
config/index.js Näytä tiedosto

8
   dev: {
8
   dev: {
9
     // Paths
9
     // Paths
10
     assetsSubDirectory: 'static',
10
     assetsSubDirectory: 'static',
11
-    assetsPublicPath: '/',
11
+    assetsPublicPath: '/game/luckdraw/',
12
     proxyTable: {
12
     proxyTable: {
13
       '/check-api': {
13
       '/check-api': {
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',

+ 1
- 1
dist/index.html Näytä tiedosto

1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>城的空间抽奖</title><link href=./static/css/app.56fd39569a46625134b8c88add3763e1.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7b08adbe29df9913b077.js></script><script type=text/javascript src=./static/js/app.0e1ca6a038c6299e9a54.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>城的空间抽奖</title><link href=./static/css/app.6477706d60e7d5b53195b59405338e1f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.2a96777d0d5038fab28c.js></script><script type=text/javascript src=./static/js/app.5baff17cc3f4a4c75437.js></script></body></html>

+ 0
- 2
dist/static/css/app.56fd39569a46625134b8c88add3763e1.css
File diff suppressed because it is too large
Näytä tiedosto


+ 0
- 1
dist/static/css/app.56fd39569a46625134b8c88add3763e1.css.map
File diff suppressed because it is too large
Näytä tiedosto


+ 2
- 0
dist/static/css/app.6477706d60e7d5b53195b59405338e1f.css
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 0
dist/static/css/app.6477706d60e7d5b53195b59405338e1f.css.map
File diff suppressed because it is too large
Näytä tiedosto


+ 0
- 2
dist/static/js/app.0e1ca6a038c6299e9a54.js
File diff suppressed because it is too large
Näytä tiedosto


+ 0
- 1
dist/static/js/app.0e1ca6a038c6299e9a54.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 2
- 0
dist/static/js/app.5baff17cc3f4a4c75437.js
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 0
dist/static/js/app.5baff17cc3f4a4c75437.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map Näytä tiedosto

1
-{"version":3,"sources":["webpack:///webpack/bootstrap f4d0c172a364d4c0e622"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f4d0c172a364d4c0e622"],"sourceRoot":""}
1
+{"version":3,"sources":["webpack:///webpack/bootstrap 678f89f049567daa201d"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 678f89f049567daa201d"],"sourceRoot":""}

+ 26
- 0
dist/static/js/vendor.2a96777d0d5038fab28c.js
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 0
dist/static/js/vendor.2a96777d0d5038fab28c.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 0
- 26
dist/static/js/vendor.7b08adbe29df9913b077.js
File diff suppressed because it is too large
Näytä tiedosto


+ 0
- 1
dist/static/js/vendor.7b08adbe29df9913b077.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
package.json Näytä tiedosto

31
     "babel-preset-stage-2": "^6.22.0",
31
     "babel-preset-stage-2": "^6.22.0",
32
     "chalk": "^2.0.1",
32
     "chalk": "^2.0.1",
33
     "copy-webpack-plugin": "^4.0.1",
33
     "copy-webpack-plugin": "^4.0.1",
34
-    "css-loader": "^0.28.0",
34
+    "css-loader": "^0.28.11",
35
     "eslint": "^4.15.0",
35
     "eslint": "^4.15.0",
36
     "eslint-config-standard": "^10.2.1",
36
     "eslint-config-standard": "^10.2.1",
37
     "eslint-friendly-formatter": "^3.0.0",
37
     "eslint-friendly-formatter": "^3.0.0",

+ 1
- 1
src/components/qrCodeCard/qrCodeCard.vue Näytä tiedosto

32
       for (var Key in this.lessonType
32
       for (var Key in this.lessonType
33
       ) {
33
       ) {
34
         if (parseInt(Key) === this.msg.course_type) {
34
         if (parseInt(Key) === this.msg.course_type) {
35
-          codeText = this.lessonType[Key] + '-1'
35
+          codeText = `${this.lessonType[Key]}-${this.msg.record_id}-${this.msg.luckydraw_id}-1`
36
         }
36
         }
37
       }
37
       }
38
       const ele = document.querySelector('#QRcode')
38
       const ele = document.querySelector('#QRcode')

+ 3
- 1
src/main.js Näytä tiedosto

18
 Vue.prototype.$ajax = Ajax
18
 Vue.prototype.$ajax = Ajax
19
 Vue.prototype.toolClass = toolClass
19
 Vue.prototype.toolClass = toolClass
20
 // router.beforeEach((to, from, next) => {
20
 // router.beforeEach((to, from, next) => {
21
+//   console.log(to)
22
+//   console.log(from)
21
 //   let userInfo = localStorage.getItem('userInfo')
23
 //   let userInfo = localStorage.getItem('userInfo')
22
 //   if (userInfo) {
24
 //   if (userInfo) {
23
 //     next()
25
 //     next()
24
 //   } else if (to.name === 'getCode') {
26
 //   } else if (to.name === 'getCode') {
25
 //     next()
27
 //     next()
26
 //   } else {
28
 //   } else {
27
-//     next({ name: 'getCode' })
29
+//     next({ name: 'getCode', query: { toName: to.name } })
28
 //   }
30
 //   }
29
 // })
31
 // })
30
 /* eslint-disable no-new */
32
 /* eslint-disable no-new */

+ 15
- 13
src/page/getCode/getCode.vue Näytä tiedosto

15
   created () {
15
   created () {
16
     let redirect = encodeURIComponent(window.location.href)
16
     let redirect = encodeURIComponent(window.location.href)
17
     if (location.search) {
17
     if (location.search) {
18
-      this.code = this.toolClass.UrlSearch(location.search).code
19
-      this.getUserInfo({ code: this.code, luckdrawid: this.lotteryId }).then((res) => {
20
-        localStorage.setItem('userInfo', JSON.stringify(res))
21
-        this.$router.push({ name: this.name })
22
-      }).catch(() => {
18
+      if (this.toolClass.UrlSearch(location.search).code) {
19
+        this.code = this.toolClass.UrlSearch(location.search).code
20
+        this.getUserInfo({ code: this.code, luckdrawid: this.lotteryId }).then((res) => {
21
+          localStorage.setItem('userInfo', JSON.stringify(res))
22
+          if (this.$route.query.toName) {
23
+            this.$router.replace({ name: this.$route.query.toName })
24
+          } else {
25
+            this.$router.replace({ name: this.name })
26
+          }
27
+        }).catch(() => {
28
+          let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatConfig.appid}&redirect_uri=${redirect}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
29
+          window.location.href = url
30
+        })
31
+      } else {
23
         let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatConfig.appid}&redirect_uri=${redirect}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
32
         let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatConfig.appid}&redirect_uri=${redirect}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
24
         window.location.href = url
33
         window.location.href = url
25
-      })
34
+      }
26
     } else {
35
     } else {
27
       let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatConfig.appid}&redirect_uri=${redirect}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
36
       let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatConfig.appid}&redirect_uri=${redirect}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
28
       window.location.href = url
37
       window.location.href = url
29
     }
38
     }
30
   },
39
   },
31
-  beforeRouteEnter (to, from, next) {
32
-    next(vm => {
33
-      if (from.name) {
34
-        vm.name = from.name
35
-      }
36
-    })
37
-  },
38
   computed: {
40
   computed: {
39
     ...mapState({
41
     ...mapState({
40
       userInfo: x => x.app.userInfo
42
       userInfo: x => x.app.userInfo

+ 24
- 5
src/page/index/index.vue Näytä tiedosto

170
     }
170
     }
171
   },
171
   },
172
   created () {
172
   created () {
173
-    this.data.userInfo = JSON.parse(localStorage.getItem('userInfo'))
174
-    this.getData()
173
+    if (location.search && this.toolClass.UrlSearch(location.search).code) {
174
+      this.code = this.toolClass.UrlSearch(location.search).code
175
+    } else {
176
+      this.code = null
177
+    }
178
+    this.getUserInfo({ code: this.code, luckdrawid: this.lotteryId }).then((res) => {
179
+      if (typeof (res) === 'string') {
180
+        console.log('isString')
181
+        if (res.indexOf('401-') > -1) {
182
+          this.toolClass.getCode(res.substring(4, res.length))
183
+        }
184
+      } else {
185
+        this.data.userInfo = this.userInfo
186
+        this.getData()
187
+      }
188
+    }).catch((err) => {
189
+      console.log(err)
190
+    })
175
   },
191
   },
176
   computed: {
192
   computed: {
177
     ...mapState({
193
     ...mapState({
182
     })
198
     })
183
   },
199
   },
184
   methods: {
200
   methods: {
185
-    ...mapAppActions(['getUserInfo', 'getPrize', 'setPrize', 'getRecord']),
201
+    ...mapAppActions(['getUserInfo', 'getPrize', 'setPrize', 'getRecord', 'setUser']),
186
     getData () {
202
     getData () {
203
+      if (this.$route.params.id) {
204
+        this.setUser({ toId: this.data.userInfo.user.Id, fromId: this.$route.params.id })
205
+      }
187
       if (this.data.userInfo.record) {
206
       if (this.data.userInfo.record) {
188
         this.winning = this.data.userInfo.record.PrizeName
207
         this.winning = this.data.userInfo.record.PrizeName
189
         this.showDialog = true
208
         this.showDialog = true
209
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
228
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
210
         title: '城的空间抽奖',
229
         title: '城的空间抽奖',
211
         desc: '抽奖小游戏',
230
         desc: '抽奖小游戏',
212
-        link: window.location.href.split('?')[0],
231
+        link: `${window.location.origin}${window.location.pathname}/#/from/${this.data.userInfo.user.Id}`,
213
         thu_image: this.logo
232
         thu_image: this.logo
214
       })
233
       })
215
     },
234
     },
287
 <style lang="scss" scoped>
306
 <style lang="scss" scoped>
288
 @font-face {
307
 @font-face {
289
   font-family: myFont;
308
   font-family: myFont;
290
-  src: url("../../assets/hkhb.ttf");
309
+  src: url("https://spaceofcheng.oss-cn-beijing.aliyuncs.com/hkhb.ttf");
291
 }
310
 }
292
 @import "page.scss";
311
 @import "page.scss";
293
 </style>
312
 </style>

+ 5
- 1
src/page/lotteryDetail/index.vue Näytä tiedosto

23
         detail: {}
23
         detail: {}
24
       },
24
       },
25
       msg: {
25
       msg: {
26
-        course_type: 777
26
+        course_type: 777,
27
+        record_id: '',
28
+        luckydraw_id: ''
27
       },
29
       },
28
       bottomMsg
30
       bottomMsg
29
     }
31
     }
39
   created () {
41
   created () {
40
     this.getLotteryDetail({ id: this.$route.query.id }).then((res) => {
42
     this.getLotteryDetail({ id: this.$route.query.id }).then((res) => {
41
       this.data.detail = this.detail
43
       this.data.detail = this.detail
44
+      this.mag.luckydraw_id = this.data.detail.LuckdrawId
45
+      this.mag.record_id = this.data.detail.PrizeId
42
     })
46
     })
43
   },
47
   },
44
   methods: {
48
   methods: {

+ 19
- 3
src/page/lotteryList/index.vue Näytä tiedosto

32
     })
32
     })
33
   },
33
   },
34
   mounted () {
34
   mounted () {
35
-    this.data.userInfo = JSON.parse(localStorage.getItem('userInfo'))
36
-    this.getLotteryList({ userid: this.data.userInfo.user.Id }).then((res) => {
37
-      this.data.list = this.list
35
+    if (location.search && this.toolClass.UrlSearch(location.search).code) {
36
+      this.code = this.toolClass.UrlSearch(location.search).code
37
+    } else {
38
+      this.code = null
39
+    }
40
+    this.getUserInfo({ code: this.code, luckdrawid: this.lotteryId }).then((res) => {
41
+      if (typeof (res) === 'string') {
42
+        console.log('isString')
43
+        if (res.indexOf('401-') > -1) {
44
+          this.toolClass.getCode(res.substring(4, res.length))
45
+        }
46
+      } else {
47
+        this.data.userInfo = this.userInfo
48
+        this.getLotteryList({ userid: this.data.userInfo.user.Id }).then((res) => {
49
+          this.data.list = this.list
50
+        })
51
+      }
52
+    }).catch((err) => {
53
+      console.log(err)
38
     })
54
     })
39
   },
55
   },
40
   methods: {
56
   methods: {

+ 11
- 5
src/router/index.js Näytä tiedosto

1
 import Vue from 'vue'
1
 import Vue from 'vue'
2
 import Router from 'vue-router'
2
 import Router from 'vue-router'
3
-import getCode from '@/page/getCode/getCode'
3
+// import getCode from '@/page/getCode/getCode'
4
 import index from '@/page/index'
4
 import index from '@/page/index'
5
 import lotteryList from '@/page/lotteryList'
5
 import lotteryList from '@/page/lotteryList'
6
 import lotteryDetail from '@/page/lotteryDetail'
6
 import lotteryDetail from '@/page/lotteryDetail'
8
 Vue.use(Router)
8
 Vue.use(Router)
9
 
9
 
10
 export default new Router({
10
 export default new Router({
11
+  // mode: 'history',
11
   routes: [
12
   routes: [
13
+    // {
14
+    //   path: '/',
15
+    //   name: 'getCode',
16
+    //   component: getCode
17
+    // },
12
     {
18
     {
13
       path: '/',
19
       path: '/',
14
-      name: 'getCode',
15
-      component: getCode
20
+      name: 'index',
21
+      component: index
16
     },
22
     },
17
     {
23
     {
18
-      path: '/index',
19
-      name: 'index',
24
+      path: '/from/:id',
25
+      name: 'share',
20
       component: index
26
       component: index
21
     },
27
     },
22
     {
28
     {

+ 38
- 5
src/store/app.js Näytä tiedosto

4
 
4
 
5
 // 请求数据
5
 // 请求数据
6
 http.getUserInfo = (data) => {
6
 http.getUserInfo = (data) => {
7
+  let queryData = {}
8
+  if (data.code) {
9
+    queryData = data
10
+  } else {
11
+    queryData = {
12
+      luckdrawid: data.luckdrawid
13
+    }
14
+  }
7
   return new Promise((resolve, reject) => {
15
   return new Promise((resolve, reject) => {
8
     Ajax(api.lottery.userInfo.url, {
16
     Ajax(api.lottery.userInfo.url, {
9
       method: api.lottery.userInfo.method,
17
       method: api.lottery.userInfo.method,
10
-      queryData: {
11
-        code: data.code,
12
-        luckdrawid: data.luckdrawid
13
-      }
18
+      queryData: queryData
14
     }).then(res => {
19
     }).then(res => {
15
       resolve(res)
20
       resolve(res)
16
     }).catch((err) => {
21
     }).catch((err) => {
68
   })
73
   })
69
 }
74
 }
70
 
75
 
76
+http.setUser = (data) => {
77
+  console.log('hjxzchvuisdhuvfhiskdzhvudsh')
78
+  return new Promise((resolve, reject) => {
79
+    Ajax(api.lottery.setUser.url, {
80
+      method: api.lottery.setUser.method,
81
+      urlData: {
82
+        id: data.toId
83
+      },
84
+      data: {
85
+        from: data.fromId
86
+      }
87
+    }).then(res => {
88
+      resolve(res)
89
+    }).catch((err) => {
90
+      reject(err)
91
+    })
92
+  })
93
+}
94
+
71
 export default {
95
 export default {
72
   namespaced: true,
96
   namespaced: true,
73
   state: {
97
   state: {
74
     lotteryId: '1',
98
     lotteryId: '1',
75
-    userInfo: localStorage.getItem('userInfo') || {}, // 用户信息
99
+    userInfo: {}, // 用户信息
76
     prize: {}, // 抽奖信息
100
     prize: {}, // 抽奖信息
77
     record: [] // 中奖列表
101
     record: [] // 中奖列表
78
   },
102
   },
121
           resolve(res)
145
           resolve(res)
122
         })
146
         })
123
       })
147
       })
148
+    },
149
+
150
+    setUser (context, data) {
151
+      console.log(data)
152
+      return new Promise((resolve) => {
153
+        http.setUser(data).then((res) => {
154
+          resolve(res)
155
+        })
156
+      })
124
     }
157
     }
125
   }
158
   }
126
 }
159
 }

+ 7
- 2
src/util/ajax.js Näytä tiedosto

48
     Axios(...args).then(({ data }) => {
48
     Axios(...args).then(({ data }) => {
49
       const { Message, Status } = data
49
       const { Message, Status } = data
50
       if (Status) {
50
       if (Status) {
51
-        if (Message === 401) {
51
+        if (Message === 406) {
52
           window.location.href = 'http://dev.ycjcjy.com/c/#?isLottery=1'
52
           window.location.href = 'http://dev.ycjcjy.com/c/#?isLottery=1'
53
         } else {
53
         } else {
54
           resolve(Message)
54
           resolve(Message)
55
         }
55
         }
56
       } else {
56
       } else {
57
         console.log(data)
57
         console.log(data)
58
-        Toast.fail(Message)
58
+        if (typeof (Message) === 'string' && Message.indexOf('401-') > -1) {
59
+          resolve(Message)
60
+        } else if (typeof (Message) === 'string' && Message.indexOf('没有找到') > -1) {
61
+        } else {
62
+          Toast.fail(Message)
63
+        }
59
       }
64
       }
60
     }).catch(reject)
65
     }).catch(reject)
61
   })
66
   })

+ 4
- 0
src/util/api.js Näytä tiedosto

32
     userRecordDetail: { // 用户中奖记录详情
32
     userRecordDetail: { // 用户中奖记录详情
33
       method: 'get',
33
       method: 'get',
34
       url: `${baseUrl}${wechat}/user/record/:id`
34
       url: `${baseUrl}${wechat}/user/record/:id`
35
+    },
36
+    setUser: { // 分享发送userId
37
+      method: 'post',
38
+      url: `${baseUrl}${wechat}/luckdraw/:id/share`
35
     }
39
     }
36
   }
40
   }
37
 }
41
 }

+ 2
- 1
src/util/share.js Näytä tiedosto

11
     imgUrl: config.thu_image // 分享图标
11
     imgUrl: config.thu_image // 分享图标
12
   }
12
   }
13
   // 初始化
13
   // 初始化
14
+  console.log(shareData)
14
   return new Promise(function (resolve) {
15
   return new Promise(function (resolve) {
15
     axios.post(api.common.shareWx.url + '?url=' + params.url)
16
     axios.post(api.common.shareWx.url + '?url=' + params.url)
16
       .then(function (res) {
17
       .then(function (res) {
17
         let result = JSON.parse(res.data)
18
         let result = JSON.parse(res.data)
18
         wx.config({
19
         wx.config({
19
-          debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
20
+          debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
20
           appId: result.appId, // 必填,公众号的唯一标识
21
           appId: result.appId, // 必填,公众号的唯一标识
21
           timestamp: result.timestamp, // 必填,生成签名的时间戳
22
           timestamp: result.timestamp, // 必填,生成签名的时间戳
22
           nonceStr: result.noncestr, // 必填,生成签名的随机串
23
           nonceStr: result.noncestr, // 必填,生成签名的随机串

+ 2
- 2
src/util/util.js Näytä tiedosto

33
     }
33
     }
34
     return theRequest
34
     return theRequest
35
   },
35
   },
36
-  getCode: () => {
37
-    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechatConfig.appid}&redirect_uri=${wechatConfig.redirect_uri}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
36
+  getCode: (appid) => {
37
+    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${wechatConfig.redirect_uri}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
38
     window.location.href = url
38
     window.location.href = url
39
   }
39
   }
40
 }
40
 }