wangfei hace 6 años
padre
commit
9f51a4f78d

+ 21
- 21
.gitignore Ver fichero

@@ -1,21 +1,21 @@
1
-.DS_Store
2
-node_modules
3
-/dist
4
-
5
-# local env files
6
-.env.local
7
-.env.*.local
8
-
9
-# Log files
10
-npm-debug.log*
11
-yarn-debug.log*
12
-yarn-error.log*
13
-
14
-# Editor directories and files
15
-.idea
16
-.vscode
17
-*.suo
18
-*.ntvs*
19
-*.njsproj
20
-*.sln
21
-*.sw*
1
+.DS_Store
2
+node_modules
3
+/dist
4
+
5
+# local env files
6
+.env.local
7
+.env.*.local
8
+
9
+# Log files
10
+npm-debug.log*
11
+yarn-debug.log*
12
+yarn-error.log*
13
+
14
+# Editor directories and files
15
+.idea
16
+.vscode
17
+*.suo
18
+*.ntvs*
19
+*.njsproj
20
+*.sln
21
+*.sw*

+ 21
- 0
README.md Ver fichero

@@ -0,0 +1,21 @@
1
+# hello-world
2
+
3
+## Project setup
4
+```
5
+npm install
6
+```
7
+
8
+### Compiles and hot-reloads for development
9
+```
10
+npm run serve
11
+```
12
+
13
+### Compiles and minifies for production
14
+```
15
+npm run build
16
+```
17
+
18
+### Lints and fixes files
19
+```
20
+npm run lint
21
+```

+ 164
- 197
package-lock.json
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 14
- 13
package.json Ver fichero

@@ -1,5 +1,5 @@
1 1
 {
2
-  "name": "lottery",
2
+  "name": "hello-world",
3 3
   "version": "0.1.0",
4 4
   "private": true,
5 5
   "scripts": {
@@ -8,24 +8,23 @@
8 8
     "lint": "vue-cli-service lint"
9 9
   },
10 10
   "dependencies": {
11
-    "axios": "^0.18.0",
12
-    "lodash.get": "^4.4.2",
13
-    "vant": "^1.4.8",
14 11
     "vue": "^2.5.17",
15
-    "vue-headful": "^2.0.1",
16
-    "vue-router": "^3.0.2",
12
+    "vue-router": "^3.0.1",
17 13
     "vuex": "^3.0.1"
18 14
   },
19 15
   "devDependencies": {
20
-    "@vue/cli-plugin-babel": "^3.2.0",
21
-    "@vue/cli-plugin-eslint": "^3.2.0",
22
-    "@vue/cli-service": "^3.2.0",
16
+    "@vue/cli-plugin-babel": "^3.0.1",
17
+    "@vue/cli-plugin-eslint": "^3.0.1",
18
+    "@vue/cli-service": "^3.0.1",
19
+    "axios": "^0.18.0",
23 20
     "babel-eslint": "^10.0.1",
24 21
     "eslint": "^5.8.0",
25 22
     "eslint-plugin-vue": "^5.0.0-0",
26
-    "node-sass": "^4.11.0",
27
-    "sass-loader": "^7.1.0",
28
-    "vue-template-compiler": "^2.5.17"
23
+    "node-sass": "^4.9.0",
24
+    "sass-loader": "^7.0.1",
25
+    "vant": "^1.4.8",
26
+    "vue-template-compiler": "^2.5.17",
27
+    "weixin-js-sdk": "^1.4.0-test"
29 28
   },
30 29
   "eslintConfig": {
31 30
     "root": true,
@@ -36,7 +35,9 @@
36 35
       "plugin:vue/essential",
37 36
       "eslint:recommended"
38 37
     ],
39
-    "rules": {},
38
+    "rules": {
39
+      "no-console": "off"
40
+    },
40 41
     "parserOptions": {
41 42
       "parser": "babel-eslint"
42 43
     }

BIN
public/favicon.ico Ver fichero


+ 4
- 4
public/index.html Ver fichero

@@ -3,14 +3,14 @@
3 3
   <head>
4 4
     <meta charset="utf-8">
5 5
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
-    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
7
-    <link rel="stylesheet" href="//at.alicdn.com/t/font_666494_wkbofbp9xso.css"/>
6
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" charset="utf-8" />
8 7
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
9
-    <title>lottery</title>
8
+    <link rel="stylesheet" href="//at.alicdn.com/t/font_957047_8k5bffh7y09.css">
9
+    <title>投票活动</title>
10 10
   </head>
11 11
   <body>
12 12
     <noscript>
13
-      <strong>We're sorry but lottery doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
+      <strong>We're sorry but hello-world doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
14 14
     </noscript>
15 15
     <div id="app"></div>
16 16
     <!-- built files will be auto injected -->

+ 31
- 6
src/App.vue Ver fichero

@@ -1,21 +1,46 @@
1 1
 <template>
2
-  <div id="app">
3
-     <router-view></router-view>
2
+  <div id="app" v-if="showPage">
3
+    <router-view/>
4 4
   </div>
5 5
 </template>
6 6
 
7 7
 <script>
8
-import './common/css/reset.css'
8
+import './assets/css/reset.css'
9
+import { createNamespacedHelpers } from 'vuex'
10
+const { mapActions: mapIndexActions } = createNamespacedHelpers('main')
9 11
 export default {
10
-
12
+  data () {
13
+    return {
14
+      showPage: true
15
+    }
16
+  },
17
+  created () {
18
+    // if (location.search && this.toolClass.UrlSearch(location.search).code) {
19
+    //   this.code = this.toolClass.UrlSearch(location.search).code
20
+    //   let oldCode = localStorage.getItem('code')
21
+    //   if (this.code === oldCode) {
22
+    //     localStorage.setItem('code', this.code)
23
+    //     this.toolClass.getCode('wx32e2e8c81f66070e')
24
+    //   } else {
25
+    //     localStorage.setItem('code', this.code)
26
+    //     // this.customer(this.code).then(() => {
27
+    //     this.showPage = true
28
+    //     // })
29
+    //   }
30
+    // } else {
31
+    //   this.toolClass.getCode('wx32e2e8c81f66070e')
32
+    // }
33
+  },
34
+  methods: {
35
+  }
11 36
 }
12 37
 </script>
13 38
 
14
-<style>
39
+
40
+<style lang="scss">
15 41
 #app {
16 42
   width: 100%;
17 43
   height: 100%;
18 44
   position: relative;
19
-  /* background-color: rgba(240, 115, 126, 1); */
20 45
 }
21 46
 </style>

src/common/css/reset.css → src/assets/css/reset.css Ver fichero


src/common/icon/xin.png → src/assets/icon/yttj_icon_love.png Ver fichero


src/common/icon/yinyueoff.png → src/assets/icon/yttj_icon_music_close.png Ver fichero


src/common/icon/yinyueon.png → src/assets/icon/yttj_icon_music_open.png Ver fichero


src/common/icon/xiegenjin.png → src/assets/icon/yttj_icon_pen.png Ver fichero


src/common/icon/dianhua.png → src/assets/icon/yttj_icon_phone.png Ver fichero


src/common/icon/sousuo.png → src/assets/icon/yttj_icon_search.png Ver fichero


+ 0
- 38
src/config/apis.js Ver fichero

@@ -1,38 +0,0 @@
1
-import get from 'lodash.get'
2
-
3
-const apiList = {
4
-//投票信息
5
- homepage: {
6
-   //获取活动详情信息
7
-  getactivity: {
8
-    url: '/api/voting/:actid',
9
-    method: 'get',
10
-  },
11
-  getactivitylist:{
12
-    url: '/api/voting',
13
-    method: 'get',
14
-  }
15
-},
16
-}
17
-
18
-// user.update
19
-// { id: 123 }
20
-export default function getAPI(api, params) {
21
-  if (!api) {
22
-    return apiList;
23
-  }
24
-
25
-  const theAPI = get(apiList, api)
26
-  if (!params) {
27
-    return theAPI;
28
-  }
29
-
30
-  let url = theAPI.url;
31
-  Object.keys(params).forEach((key) => {
32
-    const val = params[key];
33
-
34
-    url = url.replace(new RegExp(':' + key), val)
35
-  })
36
-
37
-  return { ...theAPI, url }
38
-}

+ 7
- 0
src/config/index.js Ver fichero

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

BIN
src/images/BgImages.jpg Ver fichero


BIN
src/images/activityend.png Ver fichero


BIN
src/images/activityinformation.png Ver fichero


BIN
src/images/audio_pause.png Ver fichero


BIN
src/images/audio_play.png Ver fichero


BIN
src/images/banner.jpg Ver fichero


BIN
src/images/uploadimg.png Ver fichero


+ 9
- 10
src/main.js Ver fichero

@@ -1,20 +1,19 @@
1 1
 import Vue from 'vue'
2
-import Vant from 'vant'
3
-import 'vant/lib/index.css'
4 2
 import App from './App.vue'
5 3
 import router from './router'
6
-import store from './store'
7
-
8
-
9
-
10
-
11
-Vue.use(Vant);
4
+import store from './store/index.js'
5
+import Vant from 'vant'
6
+import 'vant/lib/index.css'
7
+import toolClass from '@/util/util'
8
+const Base64 = require('js-base64').Base64
12 9
 
10
+Vue.use(Vant)
11
+Vue.prototype.Base64 = Base64
12
+Vue.prototype.toolClass = toolClass
13 13
 Vue.config.productionTip = false
14 14
 
15 15
 new Vue({
16
-  el:'#app',
17 16
   router,
18 17
   store,
19 18
   render: h => h(App)
20
-})
19
+}).$mount('#app')

+ 0
- 153
src/pages/vote/myvote.vue Ver fichero

@@ -1,153 +0,0 @@
1
-<template>
2
-  <div class="context">
3
-    <div class="ContextbBox">
4
-      <span class="personnumber">NO.20000</span>
5
-      <span class="votelist">投票列表</span>
6
-      <img :src="AudioPlay">
7
-      <div class="detailinformation">
8
-        <div class="nameinformation">
9
-          <span class="information">璐璐</span>
10
-          <span class="information">姓名</span>
11
-        </div>
12
-        <span class="line"></span>
13
-        <div class="nameinformation">
14
-          <span class="informationnum">221800</span>
15
-          <span class="information">当前票数</span>
16
-        </div>
17
-        <span class="line"></span>
18
-        <div class="nameinformation">
19
-          <span class="information">120名</span>
20
-          <span class="information">排名</span>
21
-        </div>
22
-      </div>
23
-    </div>
24
-    <div class="showorhide">
25
-      <span class="dashedline"></span>
26
-      <span class="writeword">寄语:加油!非常有爱的一个家庭,希望能抽中大奖! 希望大家多多支持,多多投票~希望能抽中大奖!</span>
27
-    </div>
28
-  </div>
29
-</template>
30
-<script>
31
-import AudioPlay from "../../images/audio_play.png";
32
-export default {
33
-  name: "votingdetails",
34
-  data() {
35
-    return {
36
-      AudioPlay
37
-    };
38
-  }
39
-};
40
-</script>
41
-<style lang="scss" scoped>
42
-.context {
43
-  width: 100%;
44
-  height: 100%;
45
-  background-color: rgba(220,229,236,1);;
46
-  display: flex;
47
-  flex-direction: column;
48
-  align-items: center;
49
-
50
-  .ContextbBox {
51
-    width: 93.6%;
52
-    height: 4.05rem;
53
-    background-color: rgba(255, 255, 255, 1);
54
-    border-radius: 0.02rem;
55
-    margin-top: 0.7rem;
56
-    display: flex;
57
-    flex-direction: column;
58
-    align-items: center;
59
-    position: relative;
60
-
61
-    .personnumber {
62
-      position: absolute;
63
-      top: 0;
64
-      background-color:rgba(255,255,255,1);
65
-      border-radius: 0 0 0.12rem 0.12rem;
66
-      padding: 0.01rem 0.25rem;
67
-      font-size: 0.18rem;
68
-      font-family: PingFangSC-Medium;
69
-      font-weight: 500;
70
-      color:rgba(70,86,101,1);
71
-      line-height: 0.25rem;
72
-    }
73
-
74
-    .votelist {
75
-      position: absolute;
76
-      top: 0.43rem;
77
-      right: 0;
78
-      background-color: rgba(84, 84, 84, 0.8);
79
-      border-radius: 0.23rem 0 0 0.23rem;
80
-      padding: 0.05rem 0.05rem 0.05rem 0.16rem;
81
-      font-size: 0.18rem;
82
-      font-family: PingFangSC-Medium;
83
-      font-weight: 500;
84
-      color: rgba(255, 255, 255, 1);
85
-      line-height: 0.25rem;
86
-    }
87
-
88
-    img {
89
-      width: 93%;
90
-      height: 3.16rem;
91
-      margin: 0.1rem 0;
92
-    }
93
-    .detailinformation {
94
-      width: 82%;
95
-      display: flex;
96
-      flex-direction: row;
97
-      justify-content: space-between;
98
-
99
-      .line {
100
-        width: 0.01rem;
101
-        border: 1px solid rgba(166,184,201,1);
102
-        background-color: rgba(166,184,201,1);
103
-      }
104
-      .nameinformation {
105
-        display: flex;
106
-        flex-direction: column;
107
-        align-items: center;
108
-
109
-        .information {
110
-          font-size: 0.16rem;
111
-          font-family: JQLaoSongJT;
112
-          color:rgba(112,125,138,1);
113
-          line-height: 0.28rem;
114
-          font-weight: 400;
115
-        }
116
-        .informationnum {
117
-          font-size: 0.24rem;
118
-          font-family: JQLaoSongJT;
119
-          color:rgba(112,125,138,1);
120
-          line-height: 0.28rem;
121
-        }
122
-      }
123
-    }
124
-  }
125
-  .showorhide {
126
-    width: 100%;
127
-    display: flex;
128
-    flex-direction: column;
129
-    justify-content: center;
130
-    align-items: center;
131
-    margin-top: 0.18rem;
132
-
133
-    .dashedline {
134
-      width: 100%;
135
-      border-bottom: 1px dashed rgba(166,184,201,1);
136
-      text-decoration: none;
137
-    }
138
-    .writeword {
139
-      width: 90%;
140
-      padding-top: 0.18rem;
141
-      word-wrap: break-word;
142
-      word-break: normal;
143
-      font-size: 0.14rem;
144
-      font-family: PingFangSC-Regular;
145
-      font-weight: 400;
146
-      color: rgba(77,87,97,1);
147
-      line-height: 0.2rem;
148
-    }
149
-  }
150
-}
151
-</style>
152
-
153
-

+ 29
- 0
src/router.js Ver fichero

@@ -0,0 +1,29 @@
1
+import Vue from 'vue'
2
+import Router from 'vue-router'
3
+
4
+Vue.use(Router)
5
+
6
+export default new Router({
7
+  routes: [
8
+    {
9
+      path: '/',
10
+      name: 'vote',
11
+      component: () => import('./views/vote/index.vue')
12
+    },
13
+    {
14
+      path: '/vote/:actid',
15
+      name: 'voteList',
16
+      component: () => import('./views/vote/list.vue')
17
+    },
18
+    {
19
+      path: '/detail/:id',
20
+      name: 'voteDetail',
21
+      component: () => import('./views/vote/detail.vue')
22
+    },
23
+    {
24
+      path: '/vote/signup/:id',
25
+      name: 'signUp',
26
+      component: () => import('./views/vote/signup.vue')
27
+    }
28
+  ]
29
+})

+ 0
- 11
src/router/index.js Ver fichero

@@ -1,11 +0,0 @@
1
-import Vue from 'vue'
2
-import VueRouter from 'vue-router'
3
-import routes from './routes'
4
-
5
-Vue.use(VueRouter)
6
-
7
-const router = new VueRouter({routes})
8
-
9
-
10
-
11
-export default router

+ 0
- 29
src/router/routes.js Ver fichero

@@ -1,29 +0,0 @@
1
-
2
-import Index from '../pages/index.vue'
3
-import LotteryList from '../pages/vote/lotterylist.vue'
4
-import SignUp from '../pages/vote/signup.vue'
5
-import VotingDetails from '../pages/vote/votingdetails.vue'
6
-
7
-export default [
8
-      {
9
-        path: '/',
10
-        name: 'index',
11
-        component: Index
12
-      },
13
-      {
14
-        path: '/lotterylist',
15
-        name: 'lotterylist',
16
-        component: LotteryList
17
-      },
18
-      {
19
-        path: '/signup',
20
-        name: 'signup',
21
-        component: SignUp
22
-      },
23
-      {
24
-        path: '/votingdetails',
25
-        name: 'votingdetails',
26
-        component: VotingDetails
27
-      },
28
-  
29
-]

+ 0
- 39
src/store/activitylist.js Ver fichero

@@ -1,39 +0,0 @@
1
-import request from '../utils/request'
2
-import getAPI from '../config/apis'
3
-export default {
4
-    namespaced: true,
5
-      state: {
6
-        detail: {},
7
-      },
8
-      mutations: {
9
-        updateActivityList(state, detail) {
10
-          state.detail = detail;
11
-        },
12
-      },
13
-      actions: {
14
-          
15
-        getActivityList({ commit }, params) {
16
-          return new Promise((resolve, reject) => {
17
-            request({ ...getAPI('homepage.getactivitylist'),params}).then((data) => {
18
-              commit('updateActivityList', data)
19
-              resolve()            
20
-            }).catch(reject)
21
-          });
22
-        },
23
-        // getActivityList (context, payload) { // 获取附近课程
24
-        //     return new Promise((resolve, reject) => {
25
-        //       Ajax(api.homepage.getactivity.url, {
26
-        //         method: api.homepage.getactivity.method,
27
-        //         queryData: { ...payload }
28
-        //       }).then(res => {
29
-        //         context.commit('updateActivityList', res)
30
-        //         resolve(res)
31
-        //       }).catch((err) => {
32
-        //         reject(err)
33
-        //       })
34
-        //     })
35
-        //   },
36
-      }
37
-
38
-      
39
-    }

+ 0
- 23
src/store/homepage.js Ver fichero

@@ -1,23 +0,0 @@
1
-import request from '../utils/request'
2
-import getAPI from '../config/apis'
3
-export default {
4
-    namespaced: true,
5
-      state: {
6
-        activitydetail: {},
7
-      },
8
-      mutations: {
9
-        updateActivity(state, activitydetail) {
10
-          state.activitydetail = activitydetail;
11
-        },
12
-      },
13
-      actions: {
14
-        getActivity({ commit }, params) {
15
-          return new Promise((resolve, reject) => {
16
-            request({...getAPI('homepage.getactivity', params)}).then((data) => {
17
-              commit('updateActivity', data)
18
-              resolve()            
19
-            }).catch(reject)
20
-          });
21
-        },
22
-      }
23
-    }

+ 22
- 13
src/store/index.js Ver fichero

@@ -1,13 +1,22 @@
1
-import Vue from 'vue'
2
-import Vuex from 'vuex'
3
-
4
-Vue.use(Vuex)
5
-
6
-const store = new Vuex.Store({
7
-  modules: {
8
-    homepage: require('./homepage.js').default,
9
-    activitylist: require('./activitylist.js').default,
10
-  }
11
-});
12
-
13
-export default store;
1
+import Vue from 'vue'
2
+import Vuex from 'vuex'
3
+
4
+Vue.use(Vuex)
5
+
6
+const store = new Vuex.Store({
7
+  state: {
8
+    loadding: false,
9
+    pageSize: 10,
10
+  }
11
+})
12
+export const modules = {
13
+  vote: () => require('./vote').default,
14
+}
15
+
16
+Object.keys(modules).forEach((modKey) => {
17
+  const modNS = modKey.split('/')
18
+  const getMod = modules[modKey]
19
+  store.registerModule(...modNS, getMod())
20
+})
21
+
22
+export default store

+ 29
- 0
src/store/vote.js Ver fichero

@@ -0,0 +1,29 @@
1
+import ajax from '../util/ajax'
2
+import api from '../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    activity: {},
8
+  },
9
+  mutations: {
10
+    updateActivity (state, data) {
11
+      state.activity = data || {}
12
+    },
13
+  },
14
+  actions: {
15
+    getActivity (context, {actid}) {
16
+      return new Promise((resolve, reject) => {
17
+        ajax({
18
+          ...api.getactivity,
19
+          urlData: {
20
+            actid: actid,
21
+          }
22
+        }).then((res) => {
23
+          context.commit('updateActivity', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+  }
29
+}

+ 117
- 0
src/util/ajax.js Ver fichero

@@ -0,0 +1,117 @@
1
+import axios from 'axios'
2
+import qs from 'qs'
3
+import toolClass from './util'
4
+import router from '@/router'
5
+import { Toast } from 'vant';
6
+
7
+const token = function (headers) {
8
+  let JWT = ''
9
+  if (headers) {
10
+    localStorage.setItem('JWT', headers.authorization)
11
+    JWT = headers.authorization
12
+  }
13
+  const token = JWT ? JWT : localStorage.getItem('JWT') // eslint-disable-line
14
+
15
+  return !token ? '' : token
16
+}
17
+
18
+const Axios = axios.create({
19
+  timeout: 60000,
20
+  responseType: 'json',
21
+  withCredentials: true,
22
+  queryData: {},
23
+  urlData: {},
24
+  headerData: '',
25
+  headers: {
26
+    'Content-Type': 'multipart/form-data',
27
+    'authorization': token()
28
+  }
29
+})
30
+
31
+Axios.interceptors.request.use((config) => {
32
+  config.headers.authorization = token()
33
+  config.headers['Content-Type'] = config.headerData ? config.headerData : 'multipart/form-data'
34
+  // config.urlData = { ...config.urlData,  }
35
+  // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
36
+  let urlData = qs.stringify(config.urlData)
37
+  let queryData = qs.stringify(config.queryData)
38
+  // 判断是通过斜杠传参
39
+  if (config.url.indexOf(':') > -1) {
40
+    if (typeof config.urlData === 'object') {
41
+      config.url = replaceURLParams(config.url, config.urlData)
42
+    } else {
43
+      config.url = config.url.slice(0, config.url.indexOf(':')) + urlData
44
+    }
45
+  }
46
+  if (queryData) {
47
+    config.url += '?' + queryData
48
+  }
49
+  if (config.headerData) {
50
+    return config
51
+  } else {
52
+    let fm = new FormData()
53
+    for (let k in config.data) {
54
+      if (Array.isArray(config.data[k])) {
55
+        config.data[k].forEach((v) => {
56
+          fm.append(k, v)
57
+        })
58
+      } else {
59
+        fm.append(k, config.data[k])
60
+      }
61
+    }
62
+    config.data = fm
63
+    return config
64
+  }
65
+}, (error) => {
66
+  console.log(error)
67
+})
68
+
69
+const ajax = (...args) => {
70
+  return new Promise((resolve, reject) => {
71
+    Axios(...args).then(({ data, headers }) => {
72
+      if (headers.authorization) {
73
+        token(headers)
74
+      }
75
+      const { code, message, result } = data
76
+      if (code === 200) {
77
+        resolve(result)
78
+      } else if (code === 401) {
79
+        // console.log(result)
80
+        // reject(code)
81
+        toolClass.getCode(result.appid)
82
+      } else if (code === 406) {
83
+        // console.log(router.history.current.name)
84
+        if (router.history.current.name !== 'bindMobile') {
85
+          router.push({ name: 'bindMobile' })
86
+        }
87
+      } else if (code === 405) {
88
+        // console.log(router.history.current.name)
89
+        // if (router.history.current.name !== 'bindMobile') {
90
+        router.push({ name: 'login' })
91
+        // }
92
+      } else {
93
+        if (message.indexOf("log-error") != -1) {
94
+          console.log(message)
95
+        } else {
96
+          Toast.fail({
97
+            duration: 2000, // 持续展示 toast
98
+            forbidClick: true, // 禁用背景点击
99
+            message: message
100
+          })
101
+        }
102
+        reject(message)
103
+      }
104
+    }).catch(reject)
105
+  })
106
+}
107
+
108
+export default ajax
109
+
110
+export function replaceURLParams (url, params) {
111
+  const args = { ...(params || {}), org: 'MQ' }
112
+
113
+  return Object.keys(args).reduce((acc, k) => { // 此方法对每个元素进行处理
114
+    const re = new RegExp(`:${k}(?!w)`, 'i')
115
+    return acc.replace(re, args[k])
116
+  }, url)
117
+}

+ 14
- 0
src/util/api.js Ver fichero

@@ -0,0 +1,14 @@
1
+const baseUrl = '/api'
2
+const common = ''
3
+
4
+const $api = {
5
+  getactivity: {
6
+    url: '/api/voting/:actid',
7
+    method: 'get',
8
+  },
9
+  getactivitylist:{
10
+    url: '/api/voting',
11
+    method: 'get',
12
+  }
13
+}
14
+export default $api

src/utils/share.js → src/util/share.js Ver fichero

@@ -1,50 +1,80 @@
1
-import Ajax from './ajax'
2
-import api from './api'
3
-
4
-function wxsdk (params, config) {
5
-  const wx = require('weixin-js-sdk')
6
-  window.console.log(config)
7
-  const shareData = {
8
-    title: config.title, // 分享标题
9
-    desc: config.desc, // 分享标题
10
-    link: config.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
11
-    imgUrl: config.thu_image // 分享图标
12
-  }
13
-  // 初始化
14
-  return new Promise(function (resolve, reject) {
15
-    Ajax(api.share.share.url, {
16
-      method: api.share.share.method,
17
-      queryData: {
18
-        ...params
19
-      }
20
-    }).then(result => {
21
-      window.console.log(result)
22
-      let time = parseInt(result.timestamp)
23
-      wx.config({
24
-        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
25
-        appId: result.appId, // 必填,公众号的唯一标识
26
-        timestamp: time, // 必填,生成签名的时间戳
27
-        nonceStr: result.noncestr, // 必填,生成签名的随机串
28
-        signature: result.signature, // 必填,签名,见附录1
29
-        jsApiList: [
30
-          'onMenuShareTimeline',
31
-          'onMenuShareAppMessage',
32
-          'onMenuShareQQ',
33
-          'onMenuShareWeibo',
34
-          'onMenuShareQZone',
35
-          'openLocation',
36
-          'getLocation'
37
-        ]
38
-      })
39
-      wx.ready(function () {
40
-        wx.onMenuShareTimeline(shareData)
41
-        wx.onMenuShareAppMessage(shareData)
42
-        resolve('success')
43
-      })
44
-    }).catch((err) => {
45
-      reject(err)
46
-    })
47
-  })
48
-}
49
-
50
-export default wxsdk
1
+import Ajax from './ajax'
2
+import api from './api'
3
+
4
+function wxsdk (params, config) {
5
+  const wx = require('weixin-js-sdk')
6
+  console.log(config)
7
+  const shareData = {
8
+    title: config.title, // 分享标题
9
+    desc: config.desc, // 分享标题
10
+    link: config.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
11
+    imgUrl: config.thu_image // 分享图标
12
+  }
13
+  // 初始化
14
+  return new Promise(function (resolve, reject) {
15
+    Ajax({
16
+      ...api.share,
17
+      queryData: {
18
+        ...params
19
+      }
20
+    }).then(result => {
21
+      console.log(result)
22
+      let time = parseInt(result.timestamp)
23
+      wx.config({
24
+        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
25
+        appId: result.appId, // 必填,公众号的唯一标识
26
+        timestamp: time, // 必填,生成签名的时间戳
27
+        nonceStr: result.noncestr, // 必填,生成签名的随机串
28
+        signature: result.signature, // 必填,签名,见附录1
29
+        jsApiList: [
30
+          'onMenuShareTimeline',
31
+          'onMenuShareAppMessage',
32
+          'onMenuShareQQ',
33
+          'onMenuShareWeibo',
34
+          'onMenuShareQZone',
35
+          'openLocation',
36
+          'getLocation'
37
+        ]
38
+      })
39
+      wx.ready(function () {
40
+        // 此console.log不要删除,删除后可能会出错
41
+        console.log('share', shareData)
42
+        wx.onMenuShareTimeline(shareData)
43
+        wx.onMenuShareAppMessage(shareData)
44
+        resolve('success')
45
+      })
46
+    }).catch((err) => {
47
+      reject(err)
48
+    })
49
+
50
+    // axios.post(api.share.share.url + '?url=' + params.url)
51
+    //   .then(function (res) {
52
+    //     let result = JSON.parse(res.data)
53
+    //     wx.config({
54
+    //       debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
55
+    //       appId: result.appId, // 必填,公众号的唯一标识
56
+    //       timestamp: result.timestamp, // 必填,生成签名的时间戳
57
+    //       nonceStr: result.noncestr, // 必填,生成签名的随机串
58
+    //       signature: result.signature, // 必填,签名,见附录1
59
+    //       jsApiList: [
60
+    //         'onMenuShareTimeline',
61
+    //         'onMenuShareAppMessage',
62
+    //         'onMenuShareQQ',
63
+    //         'onMenuShareWeibo',
64
+    //         'onMenuShareQZone',
65
+    //         'openLocation'
66
+    //       ]
67
+    //     })
68
+    //     wx.ready(function () {
69
+    //       wx.onMenuShareTimeline(shareData)
70
+    //       wx.onMenuShareAppMessage(shareData)
71
+    //       // resolve()
72
+    //     })
73
+    //   })
74
+    //   .catch(function (error) {
75
+    //     console.log(error)
76
+    //   })
77
+  })
78
+}
79
+
80
+export default wxsdk

+ 81
- 0
src/util/util.js Ver fichero

@@ -0,0 +1,81 @@
1
+import Ajax from './ajax'
2
+import api from './api'
3
+import wechatConfig from '@/config/index'
4
+const toolClass = {
5
+  dateFormat: (timestamp, fmt) => {
6
+    if (!fmt) {
7
+      fmt = 'yyyy-MM-dd hh:mm'
8
+    }
9
+
10
+    let date = new Date(timestamp)
11
+    var o = {
12
+      'M+': date.getMonth() + 1,
13
+      'd+': date.getDate(),
14
+      'h+': date.getHours(),
15
+      'm+': date.getMinutes(),
16
+      's+': date.getSeconds(),
17
+      'q+': Math.floor((date.getMonth() + 3) / 3),
18
+      'S': date.getMilliseconds()
19
+    }
20
+    if (/(y+)/.test(fmt)) {
21
+      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
22
+    }
23
+    for (var k in o) {
24
+      if (new RegExp('(' + k + ')').test(fmt)) {
25
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
26
+      }
27
+    }
28
+    return fmt
29
+  },
30
+  UrlSearch: (urls) => {
31
+    let url = urls // 获取url中"?"符后的字串
32
+    let theRequest = {}
33
+    if (url.indexOf('?') !== -1) {
34
+      let str = url.substr(1)
35
+      let strs = str.split('&')
36
+      for (var i = 0; i < strs.length; i++) {
37
+        theRequest[strs[i].split('=')[0]] = unescape(strs[i].split('=')[1])
38
+      }
39
+    }
40
+    return theRequest
41
+  },
42
+  getCode: (appid) => {
43
+    let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(window.location.href)}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
44
+    window.location.href = url
45
+  },
46
+  upload (item) {
47
+    return new Promise((resolve, reject) => {
48
+      Ajax({
49
+        ...api.file.image,
50
+        data: { file: item.file },
51
+      }).then((res) => {
52
+        let result = {
53
+          result: res
54
+        }
55
+        if (item.onSuccess) {
56
+          item.onSuccess(result, item.file)
57
+        }
58
+        // console.log(result)
59
+        resolve(result)
60
+      }).catch(reject)
61
+    })
62
+  },
63
+  uploadBase64 (base64) {
64
+    return new Promise((resolve, reject) => {
65
+      Ajax({
66
+        ...api.file.base64,
67
+        queryData: {
68
+          namestr: base64.namestr
69
+        },
70
+        data: { base64str: base64.base64str },
71
+      }).then((res) => {
72
+        let result = {
73
+          result: res
74
+        }
75
+        resolve(result)
76
+      }).catch(reject)
77
+    })
78
+  }
79
+}
80
+
81
+export default toolClass

+ 0
- 52
src/utils/request.js Ver fichero

@@ -1,52 +0,0 @@
1
-import axios from 'axios'
2
-
3
-const Axios = axios.create({
4
-  timeout: 60000,
5
-  responseType: 'json',
6
-  withCredentials: true,
7
-  queryData: {},
8
-  urlData: {},
9
-  headers: {
10
-    'Content-Type': 'multipart/form-data'
11
-  }
12
-})
13
-export default function request(config) {
14
-  return new Promise((resolve, reject) => {
15
-    const { query, data, ...conf } = config;
16
-    const params = query;
17
-    const formHead = { 'content-type': "multipart/form-data;charset=UTF-8" }
18
-    const fmtData = new FormData()
19
-
20
-    if (data) {
21
-      Object.keys(data).forEach((k) => {
22
-        const val = data[k]
23
-
24
-        if (Array.isArray(val)) {
25
-          val.forEach((v) => {
26
-            fmtData.append(k, v)
27
-          })
28
-        } else {
29
-          fmtData.append(k, val)
30
-        }
31
-      })
32
-    }
33
-    Axios({
34
-      params,
35
-      data: !data ? undefined : fmtData,
36
-      headers: {
37
-        ...formHead
38
-      },
39
-      ...conf,
40
-      withCredentials: true,
41
-    }).then((response) => {
42
-      const data = response.data;
43
-      if (data.code === 200) {
44
-        resolve(data.result);
45
-      } else {
46
-        reject('请求数据失败');
47
-      }
48
-    }).catch((error) => {
49
-      reject(error.message);
50
-    });
51
-  });
52
-}

src/pages/vote/votingdetails.vue → src/views/vote/detail.vue Ver fichero

@@ -1,168 +1,167 @@
1
-<template>
2
-  <div class="context">
3
-    <div class="ContextbBox">
4
-      <span class="personnumber">NO.20000</span>
5
-      <span class="votelist">投票列表</span>
6
-      <img :src="AudioPlay">
7
-      <div class="detailinformation">
8
-        <div class="nameinformation">
9
-          <span class="information">璐璐</span>
10
-          <span class="information">姓名</span>
11
-        </div>
12
-        <span class="line"></span>
13
-        <div class="nameinformation">
14
-          <span class="informationnum">221800</span>
15
-          <span class="information">当前票数</span>
16
-        </div>
17
-        <span class="line"></span>
18
-        <div class="nameinformation">
19
-          <span class="information">120名</span>
20
-          <span class="information">排名</span>
21
-        </div>
22
-      </div>
23
-    </div>
24
-    <button class="votebtn">投TA一票</button>
25
-    <div class="showorhide">
26
-      <span class="dashedline"></span>
27
-      <span class="writeword">寄语:加油!非常有爱的一个家庭,希望能抽中大奖! 希望大家多多支持,多多投票~希望能抽中大奖!</span>
28
-    </div>
29
-  </div>
30
-</template>
31
-<script>
32
-import AudioPlay from "../../images/audio_play.png";
33
-export default {
34
-  name: "votingdetails",
35
-  data() {
36
-    return {
37
-      AudioPlay
38
-    };
39
-  }
40
-};
41
-</script>
42
-<style lang="scss" scoped>
43
-.context {
44
-  width: 100%;
45
-  height: 100%;
46
-  background-color: rgba(220,229,236,1);;
47
-  display: flex;
48
-  flex-direction: column;
49
-  align-items: center;
50
-
51
-  .ContextbBox {
52
-    width: 93.6%;
53
-    height: 4.05rem;
54
-    background-color: rgba(255, 255, 255, 1);
55
-    border-radius: 0.02rem;
56
-    margin-top: 0.7rem;
57
-    display: flex;
58
-    flex-direction: column;
59
-    align-items: center;
60
-    position: relative;
61
-
62
-    .personnumber {
63
-      position: absolute;
64
-      top: 0;
65
-      background-color:rgba(255,255,255,1);
66
-      border-radius: 0 0 0.12rem 0.12rem;
67
-      padding: 0.01rem 0.25rem;
68
-      font-size: 0.18rem;
69
-      font-family: PingFangSC-Medium;
70
-      font-weight: 500;
71
-      color:rgba(70,86,101,1);
72
-      line-height: 0.25rem;
73
-    }
74
-
75
-    .votelist {
76
-      position: absolute;
77
-      top: 0.43rem;
78
-      right: 0;
79
-      background-color: rgba(84, 84, 84, 0.8);
80
-      border-radius: 0.23rem 0 0 0.23rem;
81
-      padding: 0.05rem 0.05rem 0.05rem 0.16rem;
82
-      font-size: 0.18rem;
83
-      font-family: PingFangSC-Medium;
84
-      font-weight: 500;
85
-      color: rgba(255, 255, 255, 1);
86
-      line-height: 0.25rem;
87
-    }
88
-
89
-    img {
90
-      width: 93%;
91
-      height: 3.16rem;
92
-      margin: 0.1rem 0;
93
-    }
94
-    .detailinformation {
95
-      width: 82%;
96
-      display: flex;
97
-      flex-direction: row;
98
-      justify-content: space-between;
99
-
100
-      .line {
101
-        width: 0.01rem;
102
-        border: 1px solid rgba(166,184,201,1);
103
-        background-color: rgba(166,184,201,1);
104
-      }
105
-      .nameinformation {
106
-        display: flex;
107
-        flex-direction: column;
108
-        align-items: center;
109
-
110
-        .information {
111
-          font-size: 0.16rem;
112
-          font-family: JQLaoSongJT;
113
-          color:rgba(112,125,138,1);
114
-          line-height: 0.28rem;
115
-          font-weight: 400;
116
-        }
117
-        .informationnum {
118
-          font-size: 0.24rem;
119
-          font-family: JQLaoSongJT;
120
-          color:rgba(112,125,138,1);
121
-          line-height: 0.28rem;
122
-        }
123
-      }
124
-    }
125
-  }
126
-
127
-  .votebtn {
128
-    width: 59%;
129
-    height: 0.42rem;
130
-    background: rgba(166,184,201,1);
131
-    border-radius: 0.23rem;
132
-    font-size: 0.2rem;
133
-    font-family: PingFangSC-Medium;
134
-    font-weight: 500;
135
-    color: rgba(255, 255, 255, 1);
136
-    line-height: 0.28rem;
137
-    border: none;
138
-    margin-top: 0.18rem;
139
-  }
140
-  .showorhide {
141
-    width: 100%;
142
-    display: flex;
143
-    flex-direction: column;
144
-    justify-content: center;
145
-    align-items: center;
146
-    margin-top: 0.18rem;
147
-
148
-    .dashedline {
149
-      width: 100%;
150
-      border-bottom: 1px dashed rgba(166,184,201,1);
151
-      text-decoration: none;
152
-    }
153
-    .writeword {
154
-      width: 90%;
155
-      padding-top: 0.18rem;
156
-      word-wrap: break-word;
157
-      word-break: normal;
158
-      font-size: 0.14rem;
159
-      font-family: PingFangSC-Regular;
160
-      font-weight: 400;
161
-      color: rgba(77,87,97,1);
162
-      line-height: 0.2rem;
163
-    }
164
-  }
165
-}
166
-</style>
167
-
168
-
1
+<template>
2
+  <div class="context">
3
+    <div class="ContextbBox">
4
+      <span class="personnumber">NO.20000</span>
5
+      <span class="votelist">投票列表</span>
6
+      <img :src="AudioPlay">
7
+      <div class="detailinformation">
8
+        <div class="nameinformation">
9
+          <span class="information">璐璐</span>
10
+          <span class="information">姓名</span>
11
+        </div>
12
+        <span class="line"></span>
13
+        <div class="nameinformation">
14
+          <span class="informationnum">221800</span>
15
+          <span class="information">当前票数</span>
16
+        </div>
17
+        <span class="line"></span>
18
+        <div class="nameinformation">
19
+          <span class="information">120名</span>
20
+          <span class="information">排名</span>
21
+        </div>
22
+      </div>
23
+    </div>
24
+    <button class="votebtn">投TA一票</button>
25
+    <div class="showorhide">
26
+      <span class="dashedline"></span>
27
+      <span class="writeword">寄语:加油!非常有爱的一个家庭,希望能抽中大奖! 希望大家多多支持,多多投票~希望能抽中大奖!</span>
28
+    </div>
29
+  </div>
30
+</template>
31
+<script>
32
+// import AudioPlay from "../../images/audio_play.png";
33
+export default {
34
+  name: "votingdetails",
35
+  data() {
36
+    return {
37
+    };
38
+  }
39
+};
40
+</script>
41
+<style lang="scss" scoped>
42
+.context {
43
+  width: 100%;
44
+  height: 100%;
45
+  background-color: rgba(220,229,236,1);;
46
+  display: flex;
47
+  flex-direction: column;
48
+  align-items: center;
49
+
50
+  .ContextbBox {
51
+    width: 93.6%;
52
+    height: 4.05rem;
53
+    background-color: rgba(255, 255, 255, 1);
54
+    border-radius: 0.02rem;
55
+    margin-top: 0.7rem;
56
+    display: flex;
57
+    flex-direction: column;
58
+    align-items: center;
59
+    position: relative;
60
+
61
+    .personnumber {
62
+      position: absolute;
63
+      top: 0;
64
+      background-color:rgba(255,255,255,1);
65
+      border-radius: 0 0 0.12rem 0.12rem;
66
+      padding: 0.01rem 0.25rem;
67
+      font-size: 0.18rem;
68
+      font-family: PingFangSC-Medium;
69
+      font-weight: 500;
70
+      color:rgba(70,86,101,1);
71
+      line-height: 0.25rem;
72
+    }
73
+
74
+    .votelist {
75
+      position: absolute;
76
+      top: 0.43rem;
77
+      right: 0;
78
+      background-color: rgba(84, 84, 84, 0.8);
79
+      border-radius: 0.23rem 0 0 0.23rem;
80
+      padding: 0.05rem 0.05rem 0.05rem 0.16rem;
81
+      font-size: 0.18rem;
82
+      font-family: PingFangSC-Medium;
83
+      font-weight: 500;
84
+      color: rgba(255, 255, 255, 1);
85
+      line-height: 0.25rem;
86
+    }
87
+
88
+    img {
89
+      width: 93%;
90
+      height: 3.16rem;
91
+      margin: 0.1rem 0;
92
+    }
93
+    .detailinformation {
94
+      width: 82%;
95
+      display: flex;
96
+      flex-direction: row;
97
+      justify-content: space-between;
98
+
99
+      .line {
100
+        width: 0.01rem;
101
+        border: 1px solid rgba(166,184,201,1);
102
+        background-color: rgba(166,184,201,1);
103
+      }
104
+      .nameinformation {
105
+        display: flex;
106
+        flex-direction: column;
107
+        align-items: center;
108
+
109
+        .information {
110
+          font-size: 0.16rem;
111
+          font-family: JQLaoSongJT;
112
+          color:rgba(112,125,138,1);
113
+          line-height: 0.28rem;
114
+          font-weight: 400;
115
+        }
116
+        .informationnum {
117
+          font-size: 0.24rem;
118
+          font-family: JQLaoSongJT;
119
+          color:rgba(112,125,138,1);
120
+          line-height: 0.28rem;
121
+        }
122
+      }
123
+    }
124
+  }
125
+
126
+  .votebtn {
127
+    width: 59%;
128
+    height: 0.42rem;
129
+    background: rgba(166,184,201,1);
130
+    border-radius: 0.23rem;
131
+    font-size: 0.2rem;
132
+    font-family: PingFangSC-Medium;
133
+    font-weight: 500;
134
+    color: rgba(255, 255, 255, 1);
135
+    line-height: 0.28rem;
136
+    border: none;
137
+    margin-top: 0.18rem;
138
+  }
139
+  .showorhide {
140
+    width: 100%;
141
+    display: flex;
142
+    flex-direction: column;
143
+    justify-content: center;
144
+    align-items: center;
145
+    margin-top: 0.18rem;
146
+
147
+    .dashedline {
148
+      width: 100%;
149
+      border-bottom: 1px dashed rgba(166,184,201,1);
150
+      text-decoration: none;
151
+    }
152
+    .writeword {
153
+      width: 90%;
154
+      padding-top: 0.18rem;
155
+      word-wrap: break-word;
156
+      word-break: normal;
157
+      font-size: 0.14rem;
158
+      font-family: PingFangSC-Regular;
159
+      font-weight: 400;
160
+      color: rgba(77,87,97,1);
161
+      line-height: 0.2rem;
162
+    }
163
+  }
164
+}
165
+</style>
166
+
167
+

src/pages/index.vue → src/views/vote/index.vue Ver fichero

@@ -1,77 +1,71 @@
1
-<template>
2
-  <div class="indexpage">
3
-    <img class="bgimg" :src="activitydetail.Thumb">
4
-    <!-- <img v-if="type === 2" class="bgimg" :src="AudioPlay"> -->
5
-    <button class="EnterActivity" @click="gotoactivity">进入活动</button>
6
-  </div>
7
-</template>
8
-
9
-<script>
10
-import { createNamespacedHelpers } from "vuex";
11
-const {
12
-  mapState: mapvoteState,
13
-  mapActions: mapvoteActions
14
-} = createNamespacedHelpers("homepage");
15
-import BgIndex from "../images/BgImages.jpg";
16
-import AudioPlay from '../images/audio_play.png';
17
-export default {
18
-  name: "index",
19
-  data() {
20
-    return {
21
-      BgIndex,
22
-      AudioPlay,
23
-      type: this.$route.query.type
24
-    };
25
-  },
26
-  //     components: {
27
-  //     "vue-headful": () => import("vue-headful"),
28
-  //   },
29
-  computed: {
30
-    ...mapvoteState({
31
-      activitydetail: s => s.activitydetail
32
-    })
33
-  },
34
-  created(){
35
-    this.getActivity({actid: this.type})
36
-  },
37
-  methods: {
38
-     ...mapvoteActions(["getActivity"]),
39
-      gotoactivity() {
40
-      this.$router.push({
41
-        name: "lotterylist",
42
-        query: { actid: this.type}
43
-      });
44
-    },
45
-  }
46
-};
47
-</script>
48
-
49
-<style lang="scss" scoped>
50
-.indexpage {
51
-  width: 100%;
52
-  height: 100%;
53
-  position: relative;
54
-
55
-  .bgimg {
56
-    width: 100%;
57
-    height: 100%;
58
-  }
59
-  .EnterActivity {
60
-    position: absolute;
61
-    top: 5.86rem;
62
-    left: 0.45rem;
63
-    width: 75%;
64
-    height: 0.5rem;
65
-    border-radius: 0.25rem;
66
-    background-color: rgba(166,184,201,1);
67
-    border: none;
68
-    font-size: 0.2rem;
69
-    font-family: PingFangSC-Medium;
70
-    font-weight: bold;
71
-    color: rgba(255, 255, 255, 1);
72
-    line-height: 0.28rem;
73
-  }
74
-}
75
-</style>
76
-
77
-
1
+<template>
2
+  <div class="indexpage">
3
+    <img class="bgimg" :src="activity.Thumb">
4
+    <button class="EnterActivity" @click="gotoactivity">进入活动</button>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import { createNamespacedHelpers } from "vuex";
10
+const {
11
+  mapState: mapvoteState,
12
+  mapActions: mapvoteActions
13
+} = createNamespacedHelpers("vote");
14
+
15
+export default {
16
+  name: "index",
17
+  data() {
18
+    return {
19
+      actid: this.$route.query.actid
20
+    };
21
+  },
22
+  created() {
23
+    this.getActivity({
24
+      actid: this.actid,
25
+    })
26
+  },
27
+  computed: {
28
+    ...mapvoteState({
29
+      activity: s => s.activity || {}
30
+    })
31
+  },
32
+  methods: {
33
+    ...mapvoteActions(["getActivity"]),
34
+    gotoactivity() {
35
+      this.$router.push({
36
+        path: `/vote/${this.actid}`
37
+      });
38
+    },
39
+  }
40
+};
41
+</script>
42
+
43
+<style lang="scss" scoped>
44
+.indexpage {
45
+  width: 100%;
46
+  height: 100%;
47
+  position: relative;
48
+
49
+  .bgimg {
50
+    width: 100%;
51
+    height: 100%;
52
+  }
53
+  .EnterActivity {
54
+    position: absolute;
55
+    top: 5.86rem;
56
+    left: 0.45rem;
57
+    width: 75%;
58
+    height: 0.5rem;
59
+    border-radius: 0.25rem;
60
+    background-color: rgba(166,184,201,1);
61
+    border: none;
62
+    font-size: 0.2rem;
63
+    font-family: PingFangSC-Medium;
64
+    font-weight: bold;
65
+    color: rgba(255, 255, 255, 1);
66
+    line-height: 0.28rem;
67
+  }
68
+}
69
+</style>
70
+
71
+

src/pages/vote/lotterylist.vue → src/views/vote/list.vue Ver fichero

@@ -1,363 +1,359 @@
1
-<template>
2
-  <div class="context">
3
-    <img class="BannerImage" :src="Banner">
4
-    <div class="search">
5
-      <input placeholder="输入编号或姓名">
6
-      <img class="IconSearch" :src="IconSearch">
7
-      <!-- <i class="iconfont icon-sousuo3 IconSearch"></i> -->
8
-    </div>
9
-    <img class="informationimg" :src="ActivityInformation">
10
-    <span class="box"></span>
11
-    <div class="VoteListBox">
12
-      <div class="VoteList">
13
-        <van-tabs type="card">
14
-          <van-tab title="最新上传">
15
-            <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
16
-              <div class="LatestUpload">
17
-                <div class="LatestUploadList">
18
-                  <div class="ActivePersonnelBox">
19
-                    <img :src="AudioPlay">
20
-                  </div>
21
-                  <span class="ballot">NO.20000</span>
22
-                  <span class="ActivePersonnelName">王璐璐</span>
23
-                  <button class="VoteBtn" @click="gotovotingdetails">投TA一票</button>
24
-                  <div class="VoteNumber">
25
-                    <span>已获投票数:</span>
26
-                    <p>1314票</p>
27
-                  </div>
28
-                </div>
29
-              </div>
30
-            </van-list>
31
-          </van-tab>
32
-          <van-tab title="TOP50">
33
-            <div class="LatestUpload">
34
-              <div class="LatestUploadList">
35
-                <div class="ActivePersonnelBox">
36
-                  <img :src="AudioPlay">
37
-                </div>
38
-                <span class="ballot">NO.20000</span>
39
-                <span class="ActivePersonnelName">王璐</span>
40
-                <button class="VoteBtn" @click="gotovotingdetails">投TA一票</button>
41
-                <div class="VoteNumber">
42
-                  <span>已获投票数:</span>
43
-                  <p>1314票</p>
44
-                </div>
45
-              </div>
46
-            </div>
47
-          </van-tab>
48
-        </van-tabs>
49
-      </div>
50
-    </div>
51
-    <button class="signupBtn" @click="signup">我要报名</button>
52
-    <!-- <toast-box v-if="showtoast" @close='showtoast=false'></toast-box>
53
-    <common-toast v-if="showcommontiast" @close='showcommontiast=false'></common-toast>-->
54
-  </div>
55
-</template>
56
-
57
-<script>
58
-import Banner from "../../images/banner.jpg";
59
-import ActivityInformation from "../../images/activityinformation.png";
60
-import AudioPlay from "../../images/audio_play.png";
61
-import IconSearch from "../../common/icon/sousuo.png";
62
-// import ToastBox from '../../components/toast.vue'
63
-// import CommonToast from '../../components/commontoast.vue'
64
-import { createNamespacedHelpers } from "vuex";
65
-const {
66
-  mapState: mapactivityState,
67
-  mapActions: mapactivityActions
68
-} = createNamespacedHelpers("activitylist");
69
-export default {
70
-  name: "lotterylist",
71
-  data() {
72
-    return {
73
-      Banner,
74
-      ActivityInformation,
75
-      AudioPlay,
76
-      IconSearch,
77
-      tab:'',
78
-      page:1,
79
-      q:'',
80
-      // showtoast:false,
81
-      // showcommontiast:false,
82
-      //   list:[],
83
-      loading: false,
84
-      finished: false
85
-    };
86
-  },
87
-  components: {
88
-    // "vue-headful": () => import("vue-headful"),
89
-    // 'ToastBox':ToastBox,
90
-    // 'CommonToast':CommonToast,
91
-  },
92
-  computed: {
93
-    ...mapactivityState({
94
-      detail: s => s.detail
95
-    })
96
-  },
97
-  created() {
98
-    this.getActivityList().then(() => {
99
-      
100
-    })
101
-  },
102
-  methods: {
103
-    ...mapactivityActions(["getActivityList"]),
104
-    onLoad() {
105
-      // 异步更新数据
106
-      setTimeout(() => {
107
-        for (let i = 0; i < 10; i++) {
108
-          this.list.push(this.list.length + 1);
109
-        }
110
-        // 加载状态结束
111
-        this.loading = false;
112
-
113
-        // 数据全部加载完成
114
-        if (this.list.length >= 40) {
115
-          this.finished = true;
116
-        }
117
-      }, 2000);
118
-    },
119
-    signup() {
120
-      this.$router.push({
121
-        name: "signup"
122
-      });
123
-    },
124
-    gotovotingdetails() {
125
-      // this.showtoast =true;
126
-      this.$router.push({
127
-        name: "votingdetails"
128
-      });
129
-    }
130
-  }
131
-};
132
-</script>
133
-
134
-<style>
135
-.van-tabs--card {
136
-  width: 100%;
137
-}
138
-.van-tabs__nav--card {
139
-  height: 100%;
140
-  border: none;
141
-  margin: 0;
142
-}
143
-.van-tabs__wrap {
144
-  width: 100%;
145
-  z-index: 1;
146
-}
147
-.van-tabs__nav--card .van-tab.van-tab--active {
148
-  background-color: rgba(166, 184, 201, 1);
149
-  border-radius: 0.06rem;
150
-}
151
-.van-tabs--card .van-tabs__wrap {
152
-  height: 0.4rem;
153
-}
154
-.van-tabs__nav--card .van-tab {
155
-  border-right: none;
156
-  background-color: rgba(217, 226, 233, 1);
157
-  border-radius: 0.06rem;
158
-  width: 100%;
159
-  margin: 0 0.075rem;
160
-  display: flex;
161
-  justify-content: center;
162
-  align-items: center;
163
-}
164
-.van-ellipsis {
165
-  font-size: 0.16rem;
166
-  font-family: PingFangSC-Medium;
167
-  font-weight: bold;
168
-  color: rgba(255, 255, 255, 1);
169
-  line-height: 0.22rem;
170
-  text-align: center;
171
-}
172
-</style>
173
-
174
-
175
-<style lang="scss" scoped>
176
-.context {
177
-  width: 100%;
178
-  background-color: rgba(209, 220, 228, 1);
179
-  display: flex;
180
-  flex-direction: column;
181
-  justify-content: center;
182
-  align-items: center;
183
-
184
-  .BannerImage {
185
-    width: 100%;
186
-    height: 2rem;
187
-    margin-bottom: 0.2rem;
188
-  }
189
-
190
-  .search {
191
-    width: 93%;
192
-    height: 0.44rem;
193
-    background-color: rgba(201, 214, 224, 1);
194
-    border-radius: 6px;
195
-    border: 0.01rem solid rgba(255, 255, 255, 1);
196
-    display: flex;
197
-    flex-direction: row;
198
-    justify-content: space-between;
199
-    align-items: center;
200
-    margin-bottom: 0.19rem;
201
-
202
-    input {
203
-      // padding: 0.11rem 1.2rem 0.11rem 0.13rem;
204
-      background-color: rgba(255, 255, 255, 0);
205
-      color: rgba(255, 255, 255, 1);
206
-      font-size: 0.16rem;
207
-      font-family: PingFangSC-Regular;
208
-      font-weight: 400;
209
-      line-height: 0.22rem;
210
-      width: 5rem;
211
-      text-indent: 0.1rem;
212
-    }
213
-    input::-webkit-input-placeholder {
214
-      color: rgba(255, 255, 255, 1);
215
-      font-size: 0.16rem;
216
-      font-family: PingFangSC-Regular;
217
-      font-weight: 400;
218
-      line-height: 0.22rem;
219
-    }
220
-
221
-    .IconSearch {
222
-      width: 0.2rem;
223
-      height: 0.2rem;
224
-      margin-right: 0.1rem;
225
-      //   font-size: 0.3rem !important;
226
-      //   color: rgba(255, 255, 255, 1) !important;
227
-      //   padding-right: 0.1rem;
228
-    }
229
-  }
230
-  .informationimg {
231
-    width: 97%;
232
-    height: 6.24rem;
233
-    margin: 0 0.1rem 0.35rem 0;
234
-  }
235
-
236
-  .box {
237
-    width: 89%;
238
-    height: 0.12rem;
239
-    background-color: rgba(255, 255, 255, 0.29);
240
-    border-radius: 0.06rem 0.06rem 0 0;
241
-  }
242
-  .VoteListBox {
243
-    width: 93.6%;
244
-    background-color: rgba(255, 255, 255, 1);
245
-    border-radius: 0.06rem;
246
-    display: flex;
247
-    flex-direction: column;
248
-    align-items: center;
249
-    margin-bottom: 0.19rem;
250
-
251
-    .VoteList {
252
-      margin: 0.26rem 0;
253
-      width: 90%;
254
-
255
-      .LatestUpload {
256
-        width: 100%;
257
-        display: flex;
258
-        flex-direction: row;
259
-        justify-content: space-between;
260
-        flex-wrap: wrap;
261
-        margin-top: 0.28rem;
262
-
263
-        .LatestUploadList {
264
-          width: 48%;
265
-          height: 3.1rem;
266
-          background: rgba(255, 255, 255, 1);
267
-          box-shadow: 0px 4px 8px 0px rgba(166, 184, 201, 0.18);
268
-          border-radius: 0.08rem;
269
-          margin-bottom: 0.25rem;
270
-          display: flex;
271
-          flex-direction: column;
272
-          align-items: center;
273
-          position: relative;
274
-
275
-          .ActivePersonnelBox {
276
-            width: 90%;
277
-            height: 1.83rem;
278
-            border-radius: 0.15rem;
279
-            margin-bottom: 0.11rem;
280
-            border: 0.04rem solid rgba(166, 184, 201, 1);
281
-
282
-            img {
283
-              width: 100%;
284
-              height: 100%;
285
-              border-radius: 0.1rem;
286
-            }
287
-          }
288
-          .ballot {
289
-            position: absolute;
290
-            top: 0;
291
-            background: rgba(166, 184, 201, 1);
292
-            border-radius: 0 0 0.08rem 0.08rem;
293
-            padding: 0.02rem 0.12rem;
294
-            font-size: 0.14rem;
295
-            font-family: PingFangSC-Medium;
296
-            font-weight: bold;
297
-            color: rgba(255, 255, 255, 1);
298
-            line-height: 0.2rem;
299
-          }
300
-
301
-          .ActivePersonnelName {
302
-            font-size: 0.16rem;
303
-            font-family: PingFangSC-Regular;
304
-            font-weight: 400;
305
-            color: rgba(0, 0, 0, 1);
306
-            line-height: 0.22rem;
307
-            padding-bottom: 0.11rem;
308
-          }
309
-
310
-          .VoteBtn {
311
-            width: 56%;
312
-            height: 0.23rem;
313
-            border-radius: 0.25rem;
314
-            background-color: rgba(166, 184, 201, 1);
315
-            border: none;
316
-            font-size: 0.14rem;
317
-            font-family: PingFangSC-Medium;
318
-            font-weight: bold;
319
-            color: rgba(255, 255, 255, 1);
320
-            line-height: 0.2rem;
321
-            margin-bottom: 0.14rem;
322
-          }
323
-
324
-          .VoteNumber {
325
-            display: flex;
326
-            flex-direction: row;
327
-
328
-            span {
329
-              font-size: 0.12rem;
330
-              font-family: PingFangSC-Medium;
331
-              font-weight: bold;
332
-              color: rgba(0, 0, 0, 1);
333
-              line-height: 0.17rem;
334
-            }
335
-            p {
336
-              font-size: 0.12rem;
337
-              font-family: PingFangSC-Medium;
338
-              font-weight: bold;
339
-              color: #f0737e;
340
-              line-height: 0.17rem;
341
-            }
342
-          }
343
-        }
344
-      }
345
-    }
346
-  }
347
-  .signupBtn {
348
-    width: 91%;
349
-    height: 0.5rem;
350
-    border-radius: 0.25rem;
351
-    background: rgba(166, 184, 201, 1);
352
-    border: none;
353
-    font-size: 0.2rem;
354
-    font-family: PingFangSC-Medium;
355
-    font-weight: bold;
356
-    color: rgba(255, 255, 255, 1);
357
-    line-height: 0.28rem;
358
-    margin-bottom: 0.19rem;
359
-  }
360
-}
361
-</style>
362
-
363
-
1
+<template>
2
+  <div class="context">
3
+    <img class="BannerImage" :src="activity.Banner">
4
+    <div class="search">
5
+      <input placeholder="输入编号或姓名">
6
+      <img class="IconSearch" :src="IconSearch">
7
+      <!-- <i class="iconfont icon-sousuo3 IconSearch"></i> -->
8
+    </div>
9
+    <img class="informationimg" :src="activity.Desc">
10
+    <span class="box"></span>
11
+    <div class="VoteListBox">
12
+      <div class="VoteList">
13
+        <van-tabs type="card">
14
+          <van-tab title="最新上传">
15
+            <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
16
+              <div class="LatestUpload">
17
+                <div class="LatestUploadList">
18
+                  <div class="ActivePersonnelBox">
19
+                    <img :src="AudioPlay">
20
+                  </div>
21
+                  <span class="ballot">NO.20000</span>
22
+                  <span class="ActivePersonnelName">王璐璐</span>
23
+                  <button class="VoteBtn" @click="gotovotingdetails">投TA一票</button>
24
+                  <div class="VoteNumber">
25
+                    <span>已获投票数:</span>
26
+                    <p>1314票</p>
27
+                  </div>
28
+                </div>
29
+              </div>
30
+            </van-list>
31
+          </van-tab>
32
+          <van-tab title="TOP50">
33
+            <div class="LatestUpload">
34
+              <div class="LatestUploadList">
35
+                <div class="ActivePersonnelBox">
36
+                  <img :src="AudioPlay">
37
+                </div>
38
+                <span class="ballot">NO.20000</span>
39
+                <span class="ActivePersonnelName">王璐</span>
40
+                <button class="VoteBtn" @click="gotovotingdetails">投TA一票</button>
41
+                <div class="VoteNumber">
42
+                  <span>已获投票数:</span>
43
+                  <p>1314票</p>
44
+                </div>
45
+              </div>
46
+            </div>
47
+          </van-tab>
48
+        </van-tabs>
49
+      </div>
50
+    </div>
51
+    <button class="signupBtn" @click="signup">我要报名</button>
52
+    <!-- <toast-box v-if="showtoast" @close='showtoast=false'></toast-box>
53
+    <common-toast v-if="showcommontiast" @close='showcommontiast=false'></common-toast>-->
54
+  </div>
55
+</template>
56
+
57
+<script>
58
+// import AudioPlay from "../../images/audio_play.png";
59
+import { createNamespacedHelpers } from "vuex";
60
+const {
61
+  mapState: mapactivityState,
62
+  mapActions: mapactivityActions
63
+} = createNamespacedHelpers("vote");
64
+export default {
65
+  name: "lotterylist",
66
+  data() {
67
+    return {
68
+      // AudioPlay: '',
69
+      IconSearch: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_icon_search.png',
70
+      tab:'',
71
+      page:1,
72
+      q:'',
73
+      loading: false,
74
+      finished: false,
75
+      actid: '',
76
+    };
77
+  },
78
+  components: {
79
+  },
80
+  computed: {
81
+    ...mapactivityState({
82
+      activity: s => s.activity || {}
83
+    })
84
+  },
85
+  created() {
86
+    this.actid = this.$route.params.actid
87
+    this.getActivity({
88
+      actid: this.actid,
89
+    })
90
+    // this.getActivityList()
91
+  },
92
+  methods: {
93
+    ...mapactivityActions([
94
+      "getActivityList",
95
+      "getActivity",
96
+    ]),
97
+    onLoad() {
98
+      // 异步更新数据
99
+      setTimeout(() => {
100
+        for (let i = 0; i < 10; i++) {
101
+          this.list.push(this.list.length + 1);
102
+        }
103
+        // 加载状态结束
104
+        this.loading = false;
105
+
106
+        // 数据全部加载完成
107
+        if (this.list.length >= 40) {
108
+          this.finished = true;
109
+        }
110
+      }, 2000);
111
+    },
112
+    signup() {
113
+      this.$router.push({
114
+        name: "signup",
115
+        query: {
116
+          actid: this.$route.query.actid,
117
+        }
118
+      });
119
+    },
120
+    gotovotingdetails() {
121
+      // this.showtoast =true;
122
+      this.$router.push({
123
+        name: "votingdetails"
124
+      });
125
+    }
126
+  }
127
+};
128
+</script>
129
+
130
+<style>
131
+.van-tabs--card {
132
+  width: 100%;
133
+}
134
+.van-tabs__nav--card {
135
+  height: 100%;
136
+  border: none;
137
+  margin: 0;
138
+}
139
+.van-tabs__wrap {
140
+  width: 100%;
141
+  z-index: 1;
142
+}
143
+.van-tabs__nav--card .van-tab.van-tab--active {
144
+  background-color: rgba(166, 184, 201, 1);
145
+  border-radius: 0.06rem;
146
+}
147
+.van-tabs--card .van-tabs__wrap {
148
+  height: 0.4rem;
149
+}
150
+.van-tabs__nav--card .van-tab {
151
+  border-right: none;
152
+  background-color: rgba(217, 226, 233, 1);
153
+  border-radius: 0.06rem;
154
+  width: 100%;
155
+  margin: 0 0.075rem;
156
+  display: flex;
157
+  justify-content: center;
158
+  align-items: center;
159
+}
160
+.van-ellipsis {
161
+  font-size: 0.16rem;
162
+  font-family: PingFangSC-Medium;
163
+  font-weight: bold;
164
+  color: rgba(255, 255, 255, 1);
165
+  line-height: 0.22rem;
166
+  text-align: center;
167
+}
168
+</style>
169
+
170
+
171
+<style lang="scss" scoped>
172
+.context {
173
+  width: 100%;
174
+  background-color: rgba(209, 220, 228, 1);
175
+  display: flex;
176
+  flex-direction: column;
177
+  justify-content: center;
178
+  align-items: center;
179
+
180
+  .BannerImage {
181
+    width: 100%;
182
+    height: 2rem;
183
+    margin-bottom: 0.2rem;
184
+  }
185
+
186
+  .search {
187
+    width: 93%;
188
+    height: 0.44rem;
189
+    background-color: rgba(201, 214, 224, 1);
190
+    border-radius: 6px;
191
+    border: 0.01rem solid rgba(255, 255, 255, 1);
192
+    display: flex;
193
+    flex-direction: row;
194
+    justify-content: space-between;
195
+    align-items: center;
196
+    margin-bottom: 0.19rem;
197
+
198
+    input {
199
+      // padding: 0.11rem 1.2rem 0.11rem 0.13rem;
200
+      background-color: rgba(255, 255, 255, 0);
201
+      color: rgba(255, 255, 255, 1);
202
+      font-size: 0.16rem;
203
+      font-family: PingFangSC-Regular;
204
+      font-weight: 400;
205
+      line-height: 0.22rem;
206
+      width: 5rem;
207
+      text-indent: 0.1rem;
208
+    }
209
+    input::-webkit-input-placeholder {
210
+      color: rgba(255, 255, 255, 1);
211
+      font-size: 0.16rem;
212
+      font-family: PingFangSC-Regular;
213
+      font-weight: 400;
214
+      line-height: 0.22rem;
215
+    }
216
+
217
+    .IconSearch {
218
+      width: 0.2rem;
219
+      height: 0.2rem;
220
+      margin-right: 0.1rem;
221
+      //   font-size: 0.3rem !important;
222
+      //   color: rgba(255, 255, 255, 1) !important;
223
+      //   padding-right: 0.1rem;
224
+    }
225
+  }
226
+  .informationimg {
227
+    width: 97%;
228
+    height: 6.24rem;
229
+    margin: 0 0.1rem 0.35rem 0;
230
+  }
231
+
232
+  .box {
233
+    width: 89%;
234
+    height: 0.12rem;
235
+    background-color: rgba(255, 255, 255, 0.29);
236
+    border-radius: 0.06rem 0.06rem 0 0;
237
+  }
238
+  .VoteListBox {
239
+    width: 93.6%;
240
+    background-color: rgba(255, 255, 255, 1);
241
+    border-radius: 0.06rem;
242
+    display: flex;
243
+    flex-direction: column;
244
+    align-items: center;
245
+    margin-bottom: 0.19rem;
246
+
247
+    .VoteList {
248
+      margin: 0.26rem 0;
249
+      width: 90%;
250
+
251
+      .LatestUpload {
252
+        width: 100%;
253
+        display: flex;
254
+        flex-direction: row;
255
+        justify-content: space-between;
256
+        flex-wrap: wrap;
257
+        margin-top: 0.28rem;
258
+
259
+        .LatestUploadList {
260
+          width: 48%;
261
+          height: 3.1rem;
262
+          background: rgba(255, 255, 255, 1);
263
+          box-shadow: 0px 4px 8px 0px rgba(166, 184, 201, 0.18);
264
+          border-radius: 0.08rem;
265
+          margin-bottom: 0.25rem;
266
+          display: flex;
267
+          flex-direction: column;
268
+          align-items: center;
269
+          position: relative;
270
+
271
+          .ActivePersonnelBox {
272
+            width: 90%;
273
+            height: 1.83rem;
274
+            border-radius: 0.15rem;
275
+            margin-bottom: 0.11rem;
276
+            border: 0.04rem solid rgba(166, 184, 201, 1);
277
+
278
+            img {
279
+              width: 100%;
280
+              height: 100%;
281
+              border-radius: 0.1rem;
282
+            }
283
+          }
284
+          .ballot {
285
+            position: absolute;
286
+            top: 0;
287
+            background: rgba(166, 184, 201, 1);
288
+            border-radius: 0 0 0.08rem 0.08rem;
289
+            padding: 0.02rem 0.12rem;
290
+            font-size: 0.14rem;
291
+            font-family: PingFangSC-Medium;
292
+            font-weight: bold;
293
+            color: rgba(255, 255, 255, 1);
294
+            line-height: 0.2rem;
295
+          }
296
+
297
+          .ActivePersonnelName {
298
+            font-size: 0.16rem;
299
+            font-family: PingFangSC-Regular;
300
+            font-weight: 400;
301
+            color: rgba(0, 0, 0, 1);
302
+            line-height: 0.22rem;
303
+            padding-bottom: 0.11rem;
304
+          }
305
+
306
+          .VoteBtn {
307
+            width: 56%;
308
+            height: 0.23rem;
309
+            border-radius: 0.25rem;
310
+            background-color: rgba(166, 184, 201, 1);
311
+            border: none;
312
+            font-size: 0.14rem;
313
+            font-family: PingFangSC-Medium;
314
+            font-weight: bold;
315
+            color: rgba(255, 255, 255, 1);
316
+            line-height: 0.2rem;
317
+            margin-bottom: 0.14rem;
318
+          }
319
+
320
+          .VoteNumber {
321
+            display: flex;
322
+            flex-direction: row;
323
+
324
+            span {
325
+              font-size: 0.12rem;
326
+              font-family: PingFangSC-Medium;
327
+              font-weight: bold;
328
+              color: rgba(0, 0, 0, 1);
329
+              line-height: 0.17rem;
330
+            }
331
+            p {
332
+              font-size: 0.12rem;
333
+              font-family: PingFangSC-Medium;
334
+              font-weight: bold;
335
+              color: #f0737e;
336
+              line-height: 0.17rem;
337
+            }
338
+          }
339
+        }
340
+      }
341
+    }
342
+  }
343
+  .signupBtn {
344
+    width: 91%;
345
+    height: 0.5rem;
346
+    border-radius: 0.25rem;
347
+    background: rgba(166, 184, 201, 1);
348
+    border: none;
349
+    font-size: 0.2rem;
350
+    font-family: PingFangSC-Medium;
351
+    font-weight: bold;
352
+    color: rgba(255, 255, 255, 1);
353
+    line-height: 0.28rem;
354
+    margin-bottom: 0.19rem;
355
+  }
356
+}
357
+</style>
358
+
359
+

src/pages/vote/signup.vue → src/views/vote/signup.vue Ver fichero

@@ -1,232 +1,232 @@
1
-<template>
2
-  <div class="context">
3
-    <div class="ContextBox">
4
-      <div class="uploadimg">
5
-        <img :src="FamilyPortraitIcon">
6
-        <span>上传您认为最美的全家福照片</span>
7
-      </div>
8
-      <img class="uploadimgbox" :src="uploadimg">
9
-      <div class="WriteWord">
10
-        <img :src="WriteWordIcon">
11
-        <span>寄语</span>
12
-      </div>
13
-      <div class="input_content">
14
-        <textarea id="textArea" class="content_txt" maxlength="200"></textarea>
15
-        <span class="number">
16
-          <span id="textNum">0</span>
17
-          <span class="totalnum" >/200</span>
18
-        </span>
19
-      </div>
20
-      <div class="ContactInformation">
21
-          <img :src="ContactInformationIcon"/>
22
-          <span>联系方式</span>
23
-      </div>
24
-      <input placeholder="输入手机号"/>
25
-      <input placeholder="输入姓名"/>
26
-      <!-- <textarea class="addressarea" placeholder="所在社区"></textarea> -->
27
-      <div class="btn">
28
-          <button class="SubmitBtn">提交</button>
29
-      </div>
30
-      
31
-    </div>
32
-  </div>
33
-</template>
34
-
35
-<script>
36
-import FamilyPortraitIcon from "../../common/icon/xin.png";
37
-import WriteWordIcon from "../../common/icon/xiegenjin.png";
38
-import ContactInformationIcon from "../../common/icon/dianhua.png"
39
-import uploadimg from "../../images/uploadimg.png";
40
-export default {
41
-  name: "signup",
42
-  data() {
43
-    return {
44
-      FamilyPortraitIcon,
45
-      WriteWordIcon,
46
-      uploadimg,
47
-      ContactInformationIcon
48
-    };
49
-  }
50
-};
51
-</script>
52
-
53
-<style lang="scss" scoped>
54
-.context {
55
-  width: 100%;
56
-  height: 100%;
57
-  background-color: rgba(209,220,228,1);
58
-  display: flex;
59
-  justify-content: center;
60
-
61
-  .ContextBox {
62
-    width: 94%;
63
-    height: 5.85rem;
64
-    border-radius: 0.06rem;
65
-    background-color: rgba(255, 255, 255, 1);
66
-    margin-top: 0.7rem;
67
-
68
-    .uploadimg {
69
-      display: flex;
70
-      flex-direction: row;
71
-      padding: 0.3rem 0 0.16rem 0.08rem;
72
-
73
-      img {
74
-        width: 0.22rem;
75
-        height: 0.2rem;
76
-      }
77
-
78
-      span {
79
-        font-size: 0.16rem;
80
-        font-family: PingFangSC-Medium;
81
-        font-weight: bold;
82
-        color:rgba(112,125,138,1);
83
-        line-height: 0.22rem;
84
-        padding-left: 0.03rem;
85
-      }
86
-    }
87
-
88
-    .uploadimgbox {
89
-      width: 1.1rem;
90
-      height: 1.1rem;
91
-      margin-left: 0.23rem;
92
-    }
93
-
94
-    .WriteWord {
95
-      display: flex;
96
-      flex-direction: row;
97
-      padding: 0.17rem 0 0.08rem 0.1rem;
98
-
99
-      img {
100
-        width: 0.22rem;
101
-        height: 0.2rem;
102
-      }
103
-      span {
104
-        font-size: 0.16rem;
105
-        font-family: PingFangSC-Medium;
106
-        font-weight: bold;
107
-        color:rgba(112,125,138,1);
108
-        line-height: 0.22rem;
109
-        padding-left: 0.03rem;
110
-      }
111
-    }
112
-
113
-    .input_content {
114
-      width: 90%;
115
-      height: 1.17rem;
116
-      position: relative;
117
-
118
-      .content_txt {
119
-        width: 95%;
120
-        height: 100%;
121
-        padding: 2% 3% 0 3%;
122
-        margin-left: 5%;
123
-        border: none;
124
-        font-size: 0.16rem;
125
-        font-weight: 400;
126
-        background:rgba(220,229,236,0.63);
127
-        line-height: 0.22rem;
128
-        border-radius: 0.06rem;
129
-        font-weight:bold;
130
-color:rgba(112,125,138,1);
131
-      }
132
-      .number {
133
-        position: absolute;
134
-        bottom: 0;
135
-        right: -0.1rem;
136
-
137
-        #textNum{
138
-color:#707D8A;
139
-font-size:0.14rem;
140
-font-family:PingFangSC-Medium;
141
-font-weight:bold;
142
-line-height:0.2rem;
143
-        }
144
-
145
-        .totalnum{
146
-color:#B8C2CB;
147
-font-size:0.14rem;
148
-font-family:PingFangSC-Medium;
149
-font-weight:bold;
150
-line-height:0.2rem;
151
-        }
152
-      }
153
-    }
154
-
155
-    .ContactInformation{
156
-        display: flex;
157
-      flex-direction: row;
158
-      padding: 0.15rem 0 0.08rem 0.1rem;
159
-
160
-      img{
161
-          width: 0.22rem;
162
-        height: 0.2rem;
163
-      }
164
-      span{
165
-          font-size: 0.16rem;
166
-        font-family: PingFangSC-Medium;
167
-        font-weight: bold;
168
-        color:rgba(112,125,138,1);
169
-        line-height: 0.22rem;
170
-        padding-left: 0.03rem;
171
-      }
172
-    }
173
-    input{
174
-        width: 84%;
175
-        height: 0.4rem;
176
-        background-color:rgba(220,229,236,0.63);
177
-border-radius:0.06rem;
178
-padding: 0.02rem 0.1rem;
179
-    margin: 0 0 2% 5%;
180
-    }
181
-
182
-    input::-webkit-input-placeholder {
183
-     font-size:0.16rem;
184
-font-family:PingFangSC-Medium;
185
-font-weight:bold;
186
-color:rgba(117,132,146,1);
187
-line-height:0.22rem;
188
-    }
189
-
190
-    .addressarea{
191
-         width: 84%;
192
-        height: 0.8rem;
193
-        background-color:rgba(255,241,241,1);;
194
-border-radius:0.06rem;
195
-padding: 0.02rem 0.1rem;
196
-    margin: 0 0 2% 5%;
197
-    }
198
-     textarea::-webkit-input-placeholder {
199
-     font-size:0.16rem;
200
-font-family:PingFangSC-Medium;
201
-font-weight:bold;
202
-color:rgba(112,125,138,1);
203
-line-height:0.22rem;
204
-    }
205
-.btn{
206
-    width: 100%;
207
-    display: flex;
208
-    align-items: center;
209
-    justify-content: center;
210
-    margin-top: 0.2rem;
211
-
212
-       .SubmitBtn{
213
-        width: 44%;
214
-    height: 0.5rem;
215
-    border-radius: 0.23rem;
216
-   background:rgba(166,184,201,1);
217
-box-shadow:0px 2px 10px 0px rgba(207,217,227,1);
218
-    border: none;
219
-    font-size: 0.2rem;
220
-    font-family: PingFangSC-Medium;
221
-    font-weight: bold;
222
-    color: rgba(255, 255, 255, 1);
223
-    line-height: 0.28rem;
224
-    }
225
-
226
-}
227
- 
228
-  }
229
-}
230
-</style>
231
-
232
-
1
+<template>
2
+  <div class="context">
3
+    <div class="ContextBox">
4
+      <div class="uploadimg">
5
+        <img :src="FamilyPortraitIcon">
6
+        <span>上传您认为最美的全家福照片</span>
7
+      </div>
8
+      <img class="uploadimgbox" :src="uploadimg">
9
+      <div class="WriteWord">
10
+        <img :src="WriteWordIcon">
11
+        <span>寄语</span>
12
+      </div>
13
+      <div class="input_content">
14
+        <textarea id="textArea" class="content_txt" maxlength="200"></textarea>
15
+        <span class="number">
16
+          <span id="textNum">0</span>
17
+          <span class="totalnum" >/200</span>
18
+        </span>
19
+      </div>
20
+      <div class="ContactInformation">
21
+          <img :src="ContactInformationIcon"/>
22
+          <span>联系方式</span>
23
+      </div>
24
+      <input placeholder="输入手机号"/>
25
+      <input placeholder="输入姓名"/>
26
+      <!-- <textarea class="addressarea" placeholder="所在社区"></textarea> -->
27
+      <div class="btn">
28
+          <button class="SubmitBtn">提交</button>
29
+      </div>
30
+      
31
+    </div>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+// import FamilyPortraitIcon from "../../common/icon/xin.png";
37
+// import WriteWordIcon from "../../common/icon/xiegenjin.png";
38
+// import ContactInformationIcon from "../../common/icon/dianhua.png"
39
+// import uploadimg from "../../images/uploadimg.png";
40
+export default {
41
+  name: "signup",
42
+  data() {
43
+    return {
44
+      // FamilyPortraitIcon,
45
+      // WriteWordIcon,
46
+      // uploadimg,
47
+      // ContactInformationIcon,
48
+    };
49
+  }
50
+};
51
+</script>
52
+
53
+<style lang="scss" scoped>
54
+.context {
55
+  width: 100%;
56
+  height: 100%;
57
+  background-color: rgba(209,220,228,1);
58
+  display: flex;
59
+  justify-content: center;
60
+
61
+  .ContextBox {
62
+    width: 94%;
63
+    height: 5.85rem;
64
+    border-radius: 0.06rem;
65
+    background-color: rgba(255, 255, 255, 1);
66
+    margin-top: 0.7rem;
67
+
68
+    .uploadimg {
69
+      display: flex;
70
+      flex-direction: row;
71
+      padding: 0.3rem 0 0.16rem 0.08rem;
72
+
73
+      img {
74
+        width: 0.22rem;
75
+        height: 0.2rem;
76
+      }
77
+
78
+      span {
79
+        font-size: 0.16rem;
80
+        font-family: PingFangSC-Medium;
81
+        font-weight: bold;
82
+        color:rgba(112,125,138,1);
83
+        line-height: 0.22rem;
84
+        padding-left: 0.03rem;
85
+      }
86
+    }
87
+
88
+    .uploadimgbox {
89
+      width: 1.1rem;
90
+      height: 1.1rem;
91
+      margin-left: 0.23rem;
92
+    }
93
+
94
+    .WriteWord {
95
+      display: flex;
96
+      flex-direction: row;
97
+      padding: 0.17rem 0 0.08rem 0.1rem;
98
+
99
+      img {
100
+        width: 0.22rem;
101
+        height: 0.2rem;
102
+      }
103
+      span {
104
+        font-size: 0.16rem;
105
+        font-family: PingFangSC-Medium;
106
+        font-weight: bold;
107
+        color:rgba(112,125,138,1);
108
+        line-height: 0.22rem;
109
+        padding-left: 0.03rem;
110
+      }
111
+    }
112
+
113
+    .input_content {
114
+      width: 90%;
115
+      height: 1.17rem;
116
+      position: relative;
117
+
118
+      .content_txt {
119
+        width: 95%;
120
+        height: 100%;
121
+        padding: 2% 3% 0 3%;
122
+        margin-left: 5%;
123
+        border: none;
124
+        font-size: 0.16rem;
125
+        font-weight: 400;
126
+        background:rgba(220,229,236,0.63);
127
+        line-height: 0.22rem;
128
+        border-radius: 0.06rem;
129
+        font-weight:bold;
130
+color:rgba(112,125,138,1);
131
+      }
132
+      .number {
133
+        position: absolute;
134
+        bottom: 0;
135
+        right: -0.1rem;
136
+
137
+        #textNum{
138
+color:#707D8A;
139
+font-size:0.14rem;
140
+font-family:PingFangSC-Medium;
141
+font-weight:bold;
142
+line-height:0.2rem;
143
+        }
144
+
145
+        .totalnum{
146
+color:#B8C2CB;
147
+font-size:0.14rem;
148
+font-family:PingFangSC-Medium;
149
+font-weight:bold;
150
+line-height:0.2rem;
151
+        }
152
+      }
153
+    }
154
+
155
+    .ContactInformation{
156
+        display: flex;
157
+      flex-direction: row;
158
+      padding: 0.15rem 0 0.08rem 0.1rem;
159
+
160
+      img{
161
+          width: 0.22rem;
162
+        height: 0.2rem;
163
+      }
164
+      span{
165
+          font-size: 0.16rem;
166
+        font-family: PingFangSC-Medium;
167
+        font-weight: bold;
168
+        color:rgba(112,125,138,1);
169
+        line-height: 0.22rem;
170
+        padding-left: 0.03rem;
171
+      }
172
+    }
173
+    input{
174
+        width: 84%;
175
+        height: 0.4rem;
176
+        background-color:rgba(220,229,236,0.63);
177
+border-radius:0.06rem;
178
+padding: 0.02rem 0.1rem;
179
+    margin: 0 0 2% 5%;
180
+    }
181
+
182
+    input::-webkit-input-placeholder {
183
+     font-size:0.16rem;
184
+font-family:PingFangSC-Medium;
185
+font-weight:bold;
186
+color:rgba(117,132,146,1);
187
+line-height:0.22rem;
188
+    }
189
+
190
+    .addressarea{
191
+         width: 84%;
192
+        height: 0.8rem;
193
+        background-color:rgba(255,241,241,1);;
194
+border-radius:0.06rem;
195
+padding: 0.02rem 0.1rem;
196
+    margin: 0 0 2% 5%;
197
+    }
198
+     textarea::-webkit-input-placeholder {
199
+     font-size:0.16rem;
200
+font-family:PingFangSC-Medium;
201
+font-weight:bold;
202
+color:rgba(112,125,138,1);
203
+line-height:0.22rem;
204
+    }
205
+.btn{
206
+    width: 100%;
207
+    display: flex;
208
+    align-items: center;
209
+    justify-content: center;
210
+    margin-top: 0.2rem;
211
+
212
+       .SubmitBtn{
213
+        width: 44%;
214
+    height: 0.5rem;
215
+    border-radius: 0.23rem;
216
+   background:rgba(166,184,201,1);
217
+box-shadow:0px 2px 10px 0px rgba(207,217,227,1);
218
+    border: none;
219
+    font-size: 0.2rem;
220
+    font-family: PingFangSC-Medium;
221
+    font-weight: bold;
222
+    color: rgba(255, 255, 255, 1);
223
+    line-height: 0.28rem;
224
+    }
225
+
226
+}
227
+ 
228
+  }
229
+}
230
+</style>
231
+
232
+

+ 23
- 18
vue.config.js Ver fichero

@@ -1,18 +1,23 @@
1
-module.exports = {
2
-    baseUrl: './',
3
-    devServer: {
4
-      proxy: {
5
-        '/api': {
6
-          target: 'http://192.168.0.62:8080', // wf
7
-          // target: 'http://127.0.0.1:8082/hj_wechat', // wf
8
-          changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
9
-          // pathRewrite: {
10
-          //   '^/api': '/api-v2/api'
11
-          // },
12
-        },
13
-      },
14
-      // compress: true,
15
-      disableHostCheck: true,   // That solved it
16
-    },
17
-  }
18
-  
1
+module.exports = {
2
+  baseUrl: './',
3
+  // 生产环境是否生成 sourceMap 文件
4
+  productionSourceMap: true,
5
+  chainWebpack: config => config.plugins.delete('named-chunks'),
6
+  devServer: {
7
+    proxy: {
8
+      '/api': {
9
+        // target: 'http://wechatconfigdev.ycjcjy.com',
10
+        target: 'http://192.168.0.62:8080', // wf
11
+        // target: 'http://192.168.0.102:8080', // hyq
12
+        // target: 'http://192.168.0.11', // zys
13
+        // target: 'http://dev.ycjcjy.com', // frp
14
+        changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
15
+        // pathRewrite: {
16
+        //   '^/api': '/api-v2/api'
17
+        // },
18
+      },
19
+    },
20
+    // compress: true,
21
+    disableHostCheck: true,   // That solved it
22
+  }
23
+}