yuantianjiao 6 years ago
parent
commit
07666b889c

+ 1
- 1
dist/index.html View File

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.65922fa7f34553a5def67a62e4268138.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.713b613d8989c91af2b1.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.a0d7398f1fd31920c86e1abc3e13095b.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.408f5efbccfb8619a3cd.js></script><script type=text/javascript src=./static/js/app.119de0c762340ac550dc.js></script></body></html>

dist/static/css/app.a0d7398f1fd31920c86e1abc3e13095b.css
File diff suppressed because it is too large
View File


dist/static/css/app.a0d7398f1fd31920c86e1abc3e13095b.css.map
File diff suppressed because it is too large
View File


+ 2
- 0
dist/static/js/app.119de0c762340ac550dc.js
File diff suppressed because it is too large
View File


+ 1
- 0
dist/static/js/app.119de0c762340ac550dc.js.map
File diff suppressed because it is too large
View File


+ 0
- 2
dist/static/js/app.713b613d8989c91af2b1.js
File diff suppressed because it is too large
View File


+ 0
- 1
dist/static/js/app.713b613d8989c91af2b1.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map View File

1
-{"version":3,"sources":["webpack:///webpack/bootstrap 0110d78bc4c89bb88abc"],"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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AAsB,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 0110d78bc4c89bb88abc"],"sourceRoot":""}
1
+{"version":3,"sources":["webpack:///webpack/bootstrap 8cbcba104d642c353aef"],"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,OA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unction = 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 8cbcba104d642c353aef"],"sourceRoot":""}

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


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


+ 26
- 0
dist/static/js/vendor.408f5efbccfb8619a3cd.js
File diff suppressed because it is too large
View File


+ 1
- 0
dist/static/js/vendor.408f5efbccfb8619a3cd.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
src/config/index.js View File

1
 export default {
1
 export default {
2
   appid: 'wx7320287e057bbeee',
2
   appid: 'wx7320287e057bbeee',
3
-  redirect_uri: encodeURIComponent(window.location.href + '#/index'),
3
+  redirect_uri: encodeURIComponent(window.location.href),
4
   response_type: 'code',
4
   response_type: 'code',
5
   scope: 'snsapi_userinfo',
5
   scope: 'snsapi_userinfo',
6
   state: '12313'
6
   state: '12313'

+ 10
- 0
src/main.js View File

17
 Vue.prototype.$api = api
17
 Vue.prototype.$api = api
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) => {
21
+//   let userInfo = localStorage.getItem('userInfo')
22
+//   if (userInfo) {
23
+//     next()
24
+//   } else if (to.name === 'getCode') {
25
+//     next()
26
+//   } else {
27
+//     next({ name: 'getCode' })
28
+//   }
29
+// })
20
 /* eslint-disable no-new */
30
 /* eslint-disable no-new */
21
 new Vue({
31
 new Vue({
22
   el: '#app',
32
   el: '#app',

+ 49
- 0
src/page/getCode/getCode.vue View File

1
+<template>
2
+  <div></div>
3
+</template>
4
+
5
+<script>
6
+import wechatConfig from '@/config/index'
7
+import { mapState, createNamespacedHelpers } from 'vuex'
8
+const { mapActions: mapAppActions } = createNamespacedHelpers('app')
9
+export default {
10
+  data () {
11
+    return {
12
+      name: 'index'
13
+    }
14
+  },
15
+  created () {
16
+    let redirect = encodeURIComponent(window.location.href)
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(() => {
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`
24
+        window.location.href = url
25
+      })
26
+    } 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`
28
+      window.location.href = url
29
+    }
30
+  },
31
+  beforeRouteEnter (to, from, next) {
32
+    next(vm => {
33
+      if (from.name) {
34
+        vm.name = from.name
35
+      }
36
+    })
37
+  },
38
+  computed: {
39
+    ...mapState({
40
+      userInfo: x => x.app.userInfo
41
+    })
42
+  },
43
+  methods: {
44
+    ...mapAppActions(['getUserInfo'])
45
+  }
46
+}
47
+</script>
48
+ <style lang="scss" scoped>
49
+</style>

+ 0
- 15
src/page/getCode/index.vue View File

1
-<template>
2
-  <div></div>
3
-</template>
4
-
5
-<script>
6
-import wechatConfig from '@/config/index'
7
-export default {
8
-  created () {
9
-    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`
10
-    window.location.href = url
11
-  }
12
-}
13
-</script>
14
- <style lang="scss" scoped>
15
-</style>

+ 18
- 17
src/page/index/index.vue View File

170
     }
170
     }
171
   },
171
   },
172
   created () {
172
   created () {
173
-    this.code = this.toolClass.UrlSearch(location.search)
174
-    this.getUserInfo({ code: this.code, luckdrawid: this.lotteryId }).then((res) => {
175
-      localStorage.setItem('userInfo', this.userInfo)
173
+    console.log(window.location.href.split('/?')[0])
174
+    this.data.userInfo = JSON.parse(localStorage.getItem('userInfo'))
175
+    this.getData()
176
+  },
177
+  computed: {
178
+    ...mapState({
179
+      userInfo: x => x.app.userInfo,
180
+      prize: x => x.app.prize,
181
+      list: x => x.app.record,
182
+      lotteryId: x => x.app.lotteryId
183
+    })
184
+  },
185
+  methods: {
186
+    ...mapAppActions(['getUserInfo', 'getPrize', 'setPrize', 'getRecord']),
187
+    getData () {
176
       if (this.data.userInfo.record) {
188
       if (this.data.userInfo.record) {
177
         this.winning = this.data.userInfo.record.PrizeName
189
         this.winning = this.data.userInfo.record.PrizeName
178
         this.showDialog = true
190
         this.showDialog = true
195
           this.data.list = this.list
207
           this.data.list = this.list
196
         }
208
         }
197
       })
209
       })
198
-      wxsdk({ url: window.location.href.split('?')[0] }, {
210
+      wxsdk({ url: window.location.href.split('/?')[0] }, {
199
         title: '城的空间抽奖',
211
         title: '城的空间抽奖',
200
         desc: '抽奖小游戏',
212
         desc: '抽奖小游戏',
201
-        link: window.location.href.split('?')[0],
213
+        link: window.location.href.split('/?')[0],
202
         thu_image: this.logo
214
         thu_image: this.logo
203
       })
215
       })
204
-    })
205
-  },
206
-  computed: {
207
-    ...mapState({
208
-      userInfo: x => x.app.userInfo,
209
-      prize: x => x.app.prize,
210
-      list: x => x.app.record,
211
-      lotteryId: x => x.app.lotteryId
212
-    })
213
-  },
214
-  methods: {
215
-    ...mapAppActions(['getUserInfo', 'getPrize', 'setPrize', 'getRecord']),
216
+    },
216
     init () {
217
     init () {
217
       let lineList = [this.line1, this.line2, this.line3, this.line4, this.line5, this.line6, this.line7, this.line8, this.line9]
218
       let lineList = [this.line1, this.line2, this.line3, this.line4, this.line5, this.line6, this.line7, this.line8, this.line9]
218
       if (Math.ceil(this.data.prizeList.length / lineList.length) > 1) {
219
       if (Math.ceil(this.data.prizeList.length / lineList.length) > 1) {

+ 3
- 2
src/page/lotteryList/index.vue View File

19
   data () {
19
   data () {
20
     return {
20
     return {
21
       data: {
21
       data: {
22
-        list: []
22
+        list: [],
23
+        userInfo: {}
23
       }
24
       }
24
     }
25
     }
25
   },
26
   },
30
       userInfo: x => x.app.userInfo
31
       userInfo: x => x.app.userInfo
31
     })
32
     })
32
   },
33
   },
33
-  created () {
34
+  mounted () {
34
     this.data.userInfo = JSON.parse(localStorage.getItem('userInfo'))
35
     this.data.userInfo = JSON.parse(localStorage.getItem('userInfo'))
35
     this.getLotteryList({ userid: this.data.userInfo.user.Id }).then((res) => {
36
     this.getLotteryList({ userid: this.data.userInfo.user.Id }).then((res) => {
36
       this.data.list = this.list
37
       this.data.list = this.list

+ 1
- 1
src/router/index.js View File

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'
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'

+ 1
- 1
src/store/app.js View File

72
   namespaced: true,
72
   namespaced: true,
73
   state: {
73
   state: {
74
     lotteryId: '1',
74
     lotteryId: '1',
75
-    userInfo: {}, // 用户信息
75
+    userInfo: localStorage.getItem('userInfo') || {}, // 用户信息
76
     prize: {}, // 抽奖信息
76
     prize: {}, // 抽奖信息
77
     record: [] // 中奖列表
77
     record: [] // 中奖列表
78
   },
78
   },

+ 7
- 5
src/util/share.js View File

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