7bea0642 by simon

no message

1 parent 43c3bb1e
1 # root = true
2
3 # [*]
4 # charset = utf-8
5 # indent_style = space
6 # indent_size = 4
7 # end_of_line = lf
8 # insert_final_newline = true
9 # trim_trailing_whitespace = true
10
11
12 root = true;
13
14 [*]
15 # indent_style = tab
16 indent_style = space
17 # indent_size = 4
18 indent_size = 2
19 tab_width = 2
20 end_of_line = lf
21 trim_trailing_whitespace = true
22 insert_final_newline = true
23
24 [*.{json,yml,wxml,html,vue,js}]
25 indent_style = tab
26 indent_size = 2
27 tab_width = 2
28
29
30 [README.md]
31 trim_trailing_whitespace = ignore
...@@ -970,9 +970,9 @@ ...@@ -970,9 +970,9 @@
970 "dev": true 970 "dev": true
971 }, 971 },
972 "@vant/icons": { 972 "@vant/icons": {
973 "version": "1.1.7", 973 "version": "1.1.13",
974 "resolved": "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.1.7.tgz", 974 "resolved": "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.1.13.tgz",
975 "integrity": "sha1-KVYa3/+mp1DSedzNvpppt0OTTz8=" 975 "integrity": "sha1-6ncpj08rGczHYQBQaKLHQ2CY5NQ="
976 }, 976 },
977 "@vue/babel-helper-vue-jsx-merge-props": { 977 "@vue/babel-helper-vue-jsx-merge-props": {
978 "version": "1.0.0", 978 "version": "1.0.0",
...@@ -1942,13 +1942,6 @@ ...@@ -1942,13 +1942,6 @@
1942 "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", 1942 "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
1943 "dev": true 1943 "dev": true
1944 }, 1944 },
1945 "asap": {
1946 "version": "2.0.6",
1947 "resolved": "https://registry.npm.taobao.org/asap/download/asap-2.0.6.tgz",
1948 "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
1949 "dev": true,
1950 "optional": true
1951 },
1952 "asn1": { 1945 "asn1": {
1953 "version": "0.2.4", 1946 "version": "0.2.4",
1954 "resolved": "http://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", 1947 "resolved": "http://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
...@@ -6699,13 +6692,6 @@ ...@@ -6699,13 +6692,6 @@
6699 "integrity": "sha1-Cpf7h2mG6AgcYxFg+PnziRV/AEM=", 6692 "integrity": "sha1-Cpf7h2mG6AgcYxFg+PnziRV/AEM=",
6700 "dev": true 6693 "dev": true
6701 }, 6694 },
6702 "image-size": {
6703 "version": "0.5.5",
6704 "resolved": "https://registry.npm.taobao.org/image-size/download/image-size-0.5.5.tgz",
6705 "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
6706 "dev": true,
6707 "optional": true
6708 },
6709 "import-cwd": { 6695 "import-cwd": {
6710 "version": "2.1.0", 6696 "version": "2.1.0",
6711 "resolved": "https://registry.npm.taobao.org/import-cwd/download/import-cwd-2.1.0.tgz", 6697 "resolved": "https://registry.npm.taobao.org/import-cwd/download/import-cwd-2.1.0.tgz",
...@@ -7244,6 +7230,11 @@ ...@@ -7244,6 +7230,11 @@
7244 "resolved": "http://registry.npm.taobao.org/js-base64/download/js-base64-2.5.1.tgz", 7230 "resolved": "http://registry.npm.taobao.org/js-base64/download/js-base64-2.5.1.tgz",
7245 "integrity": "sha1-Hvo57yxfeYC7F4St5KivLeMpESE=" 7231 "integrity": "sha1-Hvo57yxfeYC7F4St5KivLeMpESE="
7246 }, 7232 },
7233 "js-cookie": {
7234 "version": "2.2.1",
7235 "resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz",
7236 "integrity": "sha1-aeEG3F1YBolFYpAqpbrsN0Tpsrg="
7237 },
7247 "js-levenshtein": { 7238 "js-levenshtein": {
7248 "version": "1.1.6", 7239 "version": "1.1.6",
7249 "resolved": "https://registry.npm.taobao.org/js-levenshtein/download/js-levenshtein-1.1.6.tgz", 7240 "resolved": "https://registry.npm.taobao.org/js-levenshtein/download/js-levenshtein-1.1.6.tgz",
...@@ -7418,64 +7409,6 @@ ...@@ -7418,64 +7409,6 @@
7418 "invert-kv": "^2.0.0" 7409 "invert-kv": "^2.0.0"
7419 } 7410 }
7420 }, 7411 },
7421 "less": {
7422 "version": "3.9.0",
7423 "resolved": "https://registry.npm.taobao.org/less/download/less-3.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fless%2Fdownload%2Fless-3.9.0.tgz",
7424 "integrity": "sha1-t1EcQ/N89X3Iff/ZiD7BISibFHQ=",
7425 "dev": true,
7426 "requires": {
7427 "clone": "^2.1.2",
7428 "errno": "^0.1.1",
7429 "graceful-fs": "^4.1.2",
7430 "image-size": "~0.5.0",
7431 "mime": "^1.4.1",
7432 "mkdirp": "^0.5.0",
7433 "promise": "^7.1.1",
7434 "request": "^2.83.0",
7435 "source-map": "~0.6.0"
7436 },
7437 "dependencies": {
7438 "clone": {
7439 "version": "2.1.2",
7440 "resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
7441 "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
7442 "dev": true
7443 },
7444 "mime": {
7445 "version": "1.6.0",
7446 "resolved": "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz?cache=0&sync_timestamp=1560034758817&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime%2Fdownload%2Fmime-1.6.0.tgz",
7447 "integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=",
7448 "dev": true,
7449 "optional": true
7450 },
7451 "source-map": {
7452 "version": "0.6.1",
7453 "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
7454 "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
7455 "dev": true,
7456 "optional": true
7457 }
7458 }
7459 },
7460 "less-loader": {
7461 "version": "5.0.0",
7462 "resolved": "https://registry.npm.taobao.org/less-loader/download/less-loader-5.0.0.tgz",
7463 "integrity": "sha1-SY3eOmxsT4h0WO6e0/CGoSrRtGY=",
7464 "dev": true,
7465 "requires": {
7466 "clone": "^2.1.1",
7467 "loader-utils": "^1.1.0",
7468 "pify": "^4.0.1"
7469 },
7470 "dependencies": {
7471 "clone": {
7472 "version": "2.1.2",
7473 "resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
7474 "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
7475 "dev": true
7476 }
7477 }
7478 },
7479 "levn": { 7412 "levn": {
7480 "version": "0.3.0", 7413 "version": "0.3.0",
7481 "resolved": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz", 7414 "resolved": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz",
...@@ -9824,16 +9757,6 @@ ...@@ -9824,16 +9757,6 @@
9824 "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=", 9757 "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=",
9825 "dev": true 9758 "dev": true
9826 }, 9759 },
9827 "promise": {
9828 "version": "7.3.1",
9829 "resolved": "https://registry.npm.taobao.org/promise/download/promise-7.3.1.tgz",
9830 "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=",
9831 "dev": true,
9832 "optional": true,
9833 "requires": {
9834 "asap": "~2.0.3"
9835 }
9836 },
9837 "promise-inflight": { 9760 "promise-inflight": {
9838 "version": "1.0.1", 9761 "version": "1.0.1",
9839 "resolved": "https://registry.npm.taobao.org/promise-inflight/download/promise-inflight-1.0.1.tgz", 9762 "resolved": "https://registry.npm.taobao.org/promise-inflight/download/promise-inflight-1.0.1.tgz",
...@@ -12516,13 +12439,13 @@ ...@@ -12516,13 +12439,13 @@
12516 } 12439 }
12517 }, 12440 },
12518 "vant": { 12441 "vant": {
12519 "version": "1.6.21", 12442 "version": "2.1.7",
12520 "resolved": "https://registry.npm.taobao.org/vant/download/vant-1.6.21.tgz", 12443 "resolved": "https://registry.npm.taobao.org/vant/download/vant-2.1.7.tgz",
12521 "integrity": "sha1-7MdP1p/ND6EeQX5Q9XaEsFPgyzw=", 12444 "integrity": "sha1-/lgbzo/yixP3pyc0OG+VRu2mtvs=",
12522 "requires": { 12445 "requires": {
12523 "@babel/runtime": "^7.4.3", 12446 "@babel/runtime": "7.x",
12524 "@vant/icons": "1.1.7", 12447 "@vant/icons": "1.1.13",
12525 "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", 12448 "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
12526 "vue-lazyload": "1.2.3" 12449 "vue-lazyload": "1.2.3"
12527 } 12450 }
12528 }, 12451 },
...@@ -12609,7 +12532,7 @@ ...@@ -12609,7 +12532,7 @@
12609 }, 12532 },
12610 "vue-lazyload": { 12533 "vue-lazyload": {
12611 "version": "1.2.3", 12534 "version": "1.2.3",
12612 "resolved": "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz", 12535 "resolved": "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz?cache=0&sync_timestamp=1565348603567&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-lazyload%2Fdownload%2Fvue-lazyload-1.2.3.tgz",
12613 "integrity": "sha1-kB+ewVx+bKeHgaK65KNDaGve2yw=" 12536 "integrity": "sha1-kB+ewVx+bKeHgaK65KNDaGve2yw="
12614 }, 12537 },
12615 "vue-loader": { 12538 "vue-loader": {
......
...@@ -18,10 +18,11 @@ ...@@ -18,10 +18,11 @@
18 "co": "^4.6.0", 18 "co": "^4.6.0",
19 "core-js": "^2.6.5", 19 "core-js": "^2.6.5",
20 "glob": "^7.1.4", 20 "glob": "^7.1.4",
21 "js-cookie": "^2.2.1",
21 "mockjs": "^1.0.1-beta3", 22 "mockjs": "^1.0.1-beta3",
22 "postcss-px2rem": "^0.3.0", 23 "postcss-px2rem": "^0.3.0",
23 "postcss-pxtorem": "^4.0.1", 24 "postcss-pxtorem": "^4.0.1",
24 "vant": "^1.6.21", 25 "vant": "^2.1.7",
25 "vue": "^2.6.10", 26 "vue": "^2.6.10",
26 "vue-router": "^3.0.3", 27 "vue-router": "^3.0.3",
27 "vuex": "^3.0.1" 28 "vuex": "^3.0.1"
...@@ -34,8 +35,6 @@ ...@@ -34,8 +35,6 @@
34 "babel-plugin-import": "^1.12.0", 35 "babel-plugin-import": "^1.12.0",
35 "eslint": "^5.16.0", 36 "eslint": "^5.16.0",
36 "eslint-plugin-vue": "^5.0.0", 37 "eslint-plugin-vue": "^5.0.0",
37 "less": "^3.9.0",
38 "less-loader": "^5.0.0",
39 "node-sass": "^4.12.0", 38 "node-sass": "^4.12.0",
40 "sass-loader": "^7.1.0", 39 "sass-loader": "^7.1.0",
41 "vue-template-compiler": "^2.6.10" 40 "vue-template-compiler": "^2.6.10"
......
...@@ -4,7 +4,7 @@ module.exports = ({ ...@@ -4,7 +4,7 @@ module.exports = ({
4 file 4 file
5 }) => { 5 }) => {
6 let remUnit; 6 let remUnit;
7 // file.dirname是绝对地址,所以项目名,文件目录不能带 'vant' 7 // file.dirname是绝对地址,所以项目名,文件目录不能带 'vant'
8 if (file && file.dirname && file.dirname.indexOf("vant") > -1) { 8 if (file && file.dirname && file.dirname.indexOf("vant") > -1) {
9 remUnit = 37.5; 9 remUnit = 37.5;
10 } else { 10 } else {
...@@ -17,4 +17,4 @@ module.exports = ({ ...@@ -17,4 +17,4 @@ module.exports = ({
17 browsers: ["last 20 versions", "android >= 4.0"] 17 browsers: ["last 20 versions", "android >= 4.0"]
18 })] 18 })]
19 }; 19 };
20 };
...\ No newline at end of file ...\ No newline at end of file
20 };
......
1 <template> 1 <template>
2 <div class="home"> 2 <div class="home">
3 <!-- <div class="title"></div> 3 <!-- <div class="title"></div>
4 <div class="sys-btn btn-margin">我要报名</div> 4 <div class="sys-btn btn-margin">我要报名</div>
5 <div class="rule"></div> 5 <div class="rule"></div>
6 <div class="prize"></div> 6 <div class="prize"></div>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <div class="leap-03"></div> 9 <div class="leap-03"></div>
10 <div class="remain"></div> 10 <div class="remain"></div>
11 <bottom-tool v-model="activityIndex"></bottom-tool>--> 11 <bottom-tool v-model="activityIndex"></bottom-tool>-->
12 </div> 12 </div>
13 </template> 13 </template>
14 14
15 <script> 15 <script>
...@@ -40,12 +40,29 @@ export default { ...@@ -40,12 +40,29 @@ export default {
40 return; 40 return;
41 } 41 }
42 42
43 // SimonFungC 检测是否跳转中奖表单页
44 let from = params["f"];
45 if (from == "award") {
46 let data = {
47 route: "/award",
48 params: {}
49 };
50 localStorage.setItem(
51 "_jiajia_childrenhost_redirect",
52 JSON.stringify(data)
53 );
54 let link = location.origin + location.pathname;
55 location.href = link;
56 return;
57 }
58
43 if (store.getSession()) { 59 if (store.getSession()) {
44 this.toNextPath(); 60 this.toNextPath();
45 } else { 61 } else {
46 if (params["openId"]) { 62 if (params["openId"]) {
47 this.loginParam.openid = params["openId"]; 63 this.loginParam.openid = params["openId"];
48 this.loginParam.accessToken = params["access_token"]; 64 this.loginParam.accessToken = params["access_token"];
65 console.log("this.loginParam:",this.loginParam)
49 this.login(); 66 this.login();
50 } else { 67 } else {
51 store.toWxLogin(); 68 store.toWxLogin();
......
1 import api from '../../api/api'
2 import {
3 httpGet,
4 httpPost
5 } from '../../api/fetch-api.js'
6 import {
7 Toast,
8 Dialog
9 } from 'vant';
10 import {
11 checkMobile
12 } from "../../utils/utils";
13
14 let urls = {
15 index: "/jiajiaCHApi/app/index"
16 };
17
18 export default {
19 data() {
20 return {
21 key: 'value',
22 form: {
23 username: "",
24 mobile: "",
25 address: "",
26 },
27 userInfo: {},
28 rank: 0,
29 }
30 },
31 components: {},
32 computed: {
33 isAward() {
34 let rank = this.rank;
35 return rank > 0 && rank <= 80;
36 }
37 },
38 methods: {
39 initData() {
40 let link = location.origin + location.pathname;
41 link += "?f=award";
42 as.setShare(link, "", "", "");
43 this.toSign().then((result) => {
44 this.getUserInfo();
45 })
46 },
47 getUserInfo() {
48 return new Promise((resolve, reject) => {
49 as.queryFunV2('queryUserInfo', {
50 openid: this.userInfo.openid || ""
51 }, res => {
52 if (res && res[0] && res[0][0] && res[0][0].openid) {
53 // console.log("this.userInfo:",this.userInfo);
54 this.userInfo.hdp_id = res[0][0].hdp_id;
55 }
56 })
57 })
58 },
59 toRule() {
60 this.$router.push({
61 path: "/"
62 })
63 },
64 checkSubmit() {
65 return new Promise((resolve, reject) => {
66 let {
67 username,
68 mobile,
69 address
70 } = this.form;
71 let rank = this.rank;
72 if (this.isAward) {
73 Dialog.alert({
74 message: `您的排行是${rank}名,非获奖用户`
75 }).then(() => {
76 // on close
77 });
78 reject();
79 return;
80 }
81 if (!username) {
82 Toast("请填写真实姓名");
83 reject();
84 return;
85 }
86 if (!mobile) {
87 Toast("请填写手机号码");
88 reject();
89 return;
90 }
91 if (!checkMobile(mobile)) {
92 Toast("请填写有效手机号码");
93 reject();
94 return;
95 }
96 if (!address) {
97 Toast("请填写真实收件地址");
98 reject();
99 return;
100 }
101 resolve();
102 })
103
104 },
105 onSubmitHandler() {
106 this.checkSubmit().then((result) => {
107 Dialog.confirm({
108 message: '确认提交?'
109 }).then(() => {
110 Toast.loading({
111 mask: true,
112 message: '加载中...'
113 });
114 let data = this.form;
115 let userInfo = this.userInfo;
116 data.rank = this.rank;
117 data.id = userInfo && userInfo.hdp_id || "";
118 data.openid = userInfo && userInfo.openid || "";
119 data.avatar = userInfo && userInfo.avatar || "";
120 data.nickname = userInfo && userInfo.nickname || "";
121 data.unionid = userInfo && userInfo.unionid || "";
122 data.userid = userInfo && userInfo.userId || "";
123 console.log("data:", data);
124 as.saveTable('user', data, res => {
125 console.log("saveTable:", res);
126 Toast.clear();
127 if (res && res.id) {
128 if (!this.userInfo.hdp_id) {
129 this.userInfo.hdp_id = res.id
130 }
131 Dialog.alert({
132 title: '提交成功',
133 message: '提交成功后,我们将尽快与您联系'
134 }).then(() => {});
135 } else {
136 Toast("网络异常,提交失败");
137 }
138 })
139 }).catch(() => {
140 // on cancel
141 });
142 });
143 },
144 toSign() {
145 return new Promise((resolve, reject) => {
146 Toast.loading({
147 mask: true,
148 message: "请稍等..."
149 });
150
151 httpGet({
152 url: urls.index
153 }).then(res => {
154 Toast.clear();
155 this.rank = res.rank;
156 // this.rank = 30;
157 this.userInfo = res.dto;
158 this.form.username = this.userInfo && this.userInfo.userName || "";
159 this.form.mobile = this.userInfo && this.userInfo.mobile || "";
160 resolve();
161 });
162 })
163 }
164 },
165 mounted() {},
166 created() {
167 this.initData();
168 }
169 }
1 @import './../../styles/support.scss';
2 @import './../../styles/utils.scss';
3
4 $contentWidth:620px;
5
6 .page {
7
8 color: #303531;
9
10 .main {
11 .top-space {
12 height: 120px;
13 }
14
15 .content {
16
17 .table {
18 width: $contentWidth;
19 // min-height: 800px;
20 border-radius: 30px;
21 background-color: #fff;
22 margin: 0 auto;
23 padding: 38px 0 48px;
24
25 .tit {
26 text-align: center;
27 font-size: 40px;
28 font-weight: 500;
29 // padding: 38px 0 0;
30
31 .t1 {
32 font-size: 24px;
33 }
34 }
35
36 .prize {
37 position: relative;
38 background-color: #ffdf1a;
39 width: 210px;
40 height: 210px;
41 border-radius: 105px;
42 margin: 20px auto 0;
43 @extend .fcc;
44 text-align: center;
45
46 .img {
47 height: 164px;
48 }
49 }
50
51 .form {
52 margin: 36px auto 0;
53
54 &-item {
55 display: flex;
56 justify-content: space-between;
57 align-items: center;
58 @extend .bb;
59 padding: 0 32px;
60 font-size: 24px;
61 margin: 32px 0;
62
63 .label {
64 width: 132px;
65 }
66
67 .label2 {
68 align-self: flex-start;
69 }
70
71 .ipt {
72 flex: 1;
73 height: 52px;
74 border: 1px solid #82acae;
75 background-color: #addfe1;
76 border-radius: 26px;
77 line-height: 52px;
78 display: flex;
79 align-items: center;
80 @extend .bb;
81 padding: 0 16px;
82
83 }
84
85 .textarea {
86 min-height: 120px;
87 }
88
89 }
90
91 .btn-wrap {
92 margin: 60px auto 0;
93 position: relative;
94 z-index: 101;
95
96 .tips{
97 text-align: center;
98 font-size: 22px;
99 padding: 12px 0;
100 color: #333333;
101 .rule-btn{
102 color: $colorBlue;
103 text-decoration: underline;
104 }
105 }
106
107 .submit-btn {
108 width: 342px;
109 height: 110px;
110 line-height: 100px;
111 background-image: url("../../assets/imgs/btn2.png");
112 @extend .bis;
113 text-align: center;
114 color: #fff;
115 font-size: 40px;
116 font-weight: 600;
117 margin: 0 auto;
118 }
119
120 .disable {
121 border-radius: 55px;
122 line-height: 110px;
123 background-image: none;
124 color: #ffffff;
125 background: #c9c9c9;
126 }
127 }
128
129
130 }
131 }
132 }
133 }
134
135 .top {
136 background-image: url('../../assets/imgs/head-leap.png');
137 @extend .bis;
138 width: 750px;
139 height: 231px;
140 position: absolute;
141 top: 0;
142 left: 0;
143 }
144
145 .bottom {
146 background-image: url('../../assets/imgs/award-c1.png');
147 @extend .bis;
148 width: 750px;
149 height: 565px;
150 position: fixed;
151 bottom: 0;
152 left: 0;
153 }
154
155
156 }
1
2 <template>
3 <div class="page">
4 <!-- <div class="app__bgc bgc"></div> -->
5 <div class="app__bg bg"></div>
6 <div class="app__content main">
7 <div class="top"></div>
8 <div class="top-space"></div>
9 <div class="content">
10 <div class="table">
11 <div class="tit">
12 <div class="t1">亲爱的{{userInfo.nickname}}</div>
13 <div class="t2">恭喜获奖</div>
14 </div>
15
16 <div class="prize">
17 <img class="img" src="../../assets/imgs/award-c2.png">
18 </div>
19
20 <div class="form">
21 <div class="form-item">
22 <div class="label">收件人:</div>
23 <input v-model="form.username" class="ipt" type="text" placeholder="请填写真实姓名">
24 </div>
25 <div class="form-item">
26 <div class="label">联系方式:</div>
27 <input v-model="form.mobile" class="ipt" type="text" placeholder="请填写手机号码">
28 </div>
29 <div class="form-item">
30 <div class="label label2">收件地址:</div>
31 <textarea v-model="form.address" class="ipt textarea" placeholder="请填写真实收件地址"></textarea>
32 </div>
33
34 <div class="btn-wrap">
35 <template v-if="!isAward">
36 <div class="tips">您的排行是{{rank}}名,非获奖用户,详情见
37 <span @click="toRule" class="rule-btn">大赛介绍</span>
38 </div>
39 <div class="submit-btn disable">确认提交</div>
40 </template>
41 <template v-else>
42 <div @click="onSubmitHandler" class="submit-btn">确认提交</div>
43 </template>
44 </div>
45
46 </div>
47 </div>
48 </div>
49 <div class="bottom"></div>
50 </div>
51 </div>
52 </template>
53
54 <script src="./award.js"></script>
55 <style lang="scss" scoped>
56 @import "./award.scss";
57 </style>
1 import api from '../../api/api'
2 import {
3 httpGet,
4 httpPost
5 } from '../../api/fetch-api.js'
6
7 export default {
8 data() {
9 return {
10 key: 'value'
11 }
12 },
13 components: {},
14 methods: {
15 initData() {}
16 },
17 mounted() {},
18 created() {
19 console.log("demo created");
20 }
21 }
...\ No newline at end of file ...\ No newline at end of file
1 @import './../../styles/support';
1
2 <template>
3 <div class="page">
4 <div class="app__bgc bgc"></div>
5 <div class="app__bg bg"></div>
6 <div class="app__content main">
7 <div class="top-space"></div>
8 <div class="content">
9 <span class="iconfont iconclose">demo</span>
10 </div>
11 </div>
12 </div>
13 </template>
14
15 <script src="./demo.js"></script>
16 <style lang="scss" scoped>
17 @import "./demo.scss";
18 </style>
...@@ -5,80 +5,88 @@ import Home from './pages/Home.vue' ...@@ -5,80 +5,88 @@ import Home from './pages/Home.vue'
5 Vue.use(Router) 5 Vue.use(Router)
6 6
7 const routes = [{ 7 const routes = [{
8 path: '/', 8 path: '/',
9 name: 'home', 9 name: 'home',
10 component: Home, 10 component: Home,
11 meta: { 11 meta: {
12 title: '加载中...' 12 title: '加载中...'
13 } 13 }
14 }, 14 },
15 { 15 {
16 path: '/index', 16 path: '/index',
17 name: 'index', 17 name: 'index',
18 component: () => import('./pages/index/index.vue'), 18 component: () => import('./pages/index/index.vue'),
19 meta: { 19 meta: {
20 title: '大赛介绍' 20 title: '大赛介绍'
21 } 21 }
22 }, 22 },
23 { 23 {
24 path: '/sign', 24 path: '/award',
25 name: 'sign', 25 name: 'award',
26 component: () => import('./pages/sign/index.vue'), 26 component: () => import('./pages/award/award.vue'),
27 meta: { 27 meta: {
28 title: '我要报名' 28 title: '表单填写'
29 } 29 }
30 }, 30 },
31 { 31 {
32 path: '/list', 32 path: '/sign',
33 name: 'list', 33 name: 'sign',
34 component: () => import('./pages/list/index.vue'), 34 component: () => import('./pages/sign/index.vue'),
35 meta: { 35 meta: {
36 title: '人气评选' 36 title: '我要报名'
37 } 37 }
38 }, 38 },
39 { 39 {
40 path: '/welfare', 40 path: '/list',
41 name: 'welfare', 41 name: 'list',
42 component: () => import('./pages/welfare/index.vue'), 42 component: () => import('./pages/list/index.vue'),
43 meta: { 43 meta: {
44 title: '更多福利' 44 title: '人气评选'
45 } 45 }
46 }, 46 },
47 { 47 {
48 path: '/draw', 48 path: '/welfare',
49 name: 'draw', 49 name: 'welfare',
50 component: () => import('./pages/draw/index.vue'), 50 component: () => import('./pages/welfare/index.vue'),
51 meta: { 51 meta: {
52 title: '幸运抽奖' 52 title: '更多福利'
53 } 53 }
54 }, 54 },
55 { 55 {
56 path: '/prize', 56 path: '/draw',
57 name: 'prize', 57 name: 'draw',
58 component: () => import('./pages/prize/index.vue'), 58 component: () => import('./pages/draw/index.vue'),
59 meta: { 59 meta: {
60 title: '我的奖品' 60 title: '幸运抽奖'
61 } 61 }
62 } 62 },
63 {
64 path: '/prize',
65 name: 'prize',
66 component: () => import('./pages/prize/index.vue'),
67 meta: {
68 title: '我的奖品'
69 }
70 }
63 ] 71 ]
64 72
65 // add route path 73 // add route path
66 routes.forEach(route => { 74 routes.forEach(route => {
67 route.path = route.path || '/' + (route.name || ''); 75 route.path = route.path || '/' + (route.name || '');
68 }); 76 });
69 77
70 const router = new Router({ 78 const router = new Router({
71 routes 79 routes
72 }); 80 });
73 81
74 router.beforeEach((to, from, next) => { 82 router.beforeEach((to, from, next) => {
75 let link = location.origin + location.pathname; 83 let link = location.origin + location.pathname;
76 as.setShare(link, "", "", ""); 84 as.setShare(link, "", "", "");
77 const title = to.meta && to.meta.title; 85 const title = to.meta && to.meta.title;
78 if (title) { 86 if (title) {
79 document.title = title; 87 document.title = title;
80 } 88 }
81 next(); 89 next();
82 }); 90 });
83 91
84 export default router;
...\ No newline at end of file ...\ No newline at end of file
92 export default router;
......
...@@ -203,3 +203,39 @@ ...@@ -203,3 +203,39 @@
203 } 203 }
204 } 204 }
205 205
206
207
208 .bis {
209 background-repeat: no-repeat;
210 background-size: 100% 100%;
211 }
212
213
214 //flex 布局和 子元素 对其方式
215 .fl {
216 display: flex;
217 }
218
219 .fj {
220 display: flex;
221 justify-content: space-between;
222 }
223
224 //水平和垂直居中
225 .fcc {
226 display: flex;
227 justify-content: center;
228 align-items: center;
229 }
230
231 // 为元素设定的宽度和高度决定了元素的边框盒。
232 .bb {
233 box-sizing: border-box;
234 }
235
236 // 满屏
237 .fullp {
238 width: 100%;
239 height: 100%;
240 }
241
......
1 1 // const merge = require("webpack-merge");
2 const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 const Timestamp = new Date().getTime(); 3 // 打包目录
4
5 // 打包目录
6 let webpack_public_path = 'dist' 4 let webpack_public_path = 'dist'
7 if (process.env.NODE_ENV === 'production') { 5 if (process.env.NODE_ENV === 'production') {
8 webpack_public_path = process.env.VUE_APP_TITLE 6 webpack_public_path = process.env.VUE_APP_TITLE
9 } 7 }
8 const Timestamp = new Date().getTime();
10 module.exports = { 9 module.exports = {
11 // 部署生产环境和开发环境下的URL。 10 configureWebpack: { // webpack 配置
12 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 11 // 修改打包后js文件名
13 //例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。 12 output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
14 //baseUrl 从 Vue CLI 3.3 起已弃用,请使用publicPath 13 filename: `static/js/[name].${Timestamp}.js`,
15 //baseUrl: process.env.NODE_ENV === "production" ? "./" : "/", 14 chunkFilename: `static/js/[name].${Timestamp}.js`
16 configureWebpack: { // webpack 配置 15 },
17 // 修改打包后js文件名 16 // 修改打包后css文件名
18 output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】 17 plugins: [
19 filename: `static/js/[name].${Timestamp}.js`, 18 new MiniCssExtractPlugin({
20 chunkFilename: `static/js/[name].${Timestamp}.js` 19 filename: `static/css/[name].${Timestamp}.css`,
21 }, 20 chunkFilename: `static/css/[name].${Timestamp}.css`
22 // 修改打包后css文件名 21 })
23 plugins: [ 22 ]
24 new MiniCssExtractPlugin({ 23 },
25 filename: `static/css/[name].${Timestamp}.css`, 24 // 修改打包后img文件名
26 chunkFilename: `static/css/[name].${Timestamp}.css` 25 // chainWebpack: config => {
27 }) 26 // config.module
28 ] 27 // .rule('images')
29 }, 28 // .use('url-loader')
29 // .tap(options => {
30 // return {
31 // limit: 4096,
32 // fallback: {
33 // loader: 'file-loader',
34 // options: {
35 // name: `img/[name].${Timestamp}.[ext]`
36 // }
37 // }
38 // };
39 // })
40 // },
30 41
31 publicPath: process.env.NODE_ENV === "dev" ? "/" : "https://kd.cdn.xyiyang.com/app/f2mb/", 42 // 部署生产环境和开发环境下的URL。
32 // publicPath: process.env.NODE_ENV === "dev" ? "/" : "./", 43 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
44 //例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。
45 //baseUrl 从 Vue CLI 3.3 起已弃用,请使用publicPath
46 //baseUrl: process.env.NODE_ENV === "production" ? "./" : "/",
47 publicPath: process.env.NODE_ENV === "dev" ? "/" : "./",
33 48
34 // outputDir: 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致) 49 // outputDir: 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)
35 outputDir: webpack_public_path, 50 outputDir: webpack_public_path,
36 //用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) 51 //用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
37 assetsDir: "assets", 52 assetsDir: "static",
38 //指定生成的 index.html 的输出路径 (打包之后,改变系统默认的index.html的文件名) 53 //指定生成的 index.html 的输出路径 (打包之后,改变系统默认的index.html的文件名)
39 // indexPath: "myIndex.html", 54 // indexPath: "myIndex.html",
40 //默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存。你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) 55 //默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存。你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变)
41 filenameHashing: false, 56 filenameHashing: false,
42 57
43 // lintOnSave:{ type:Boolean default:true } 问你是否使用eslint 58 // lintOnSave:{ type:Boolean default:true } 问你是否使用eslint
44 lintOnSave: true, 59 lintOnSave: true,
45 //如果你想要在生产构建时禁用 eslint-loader,你可以用如下配置 60 //如果你想要在生产构建时禁用 eslint-loader,你可以用如下配置
46 // lintOnSave: process.env.NODE_ENV !== 'production', 61 // lintOnSave: process.env.NODE_ENV !== 'production',
47 62
48 //是否使用包含运行时编译器的 Vue 构建版本。设置为 true 后你就可以在 Vue 组件中使用 template 选项了,但是这会让你的应用额外增加 10kb 左右。(默认false) 63 //是否使用包含运行时编译器的 Vue 构建版本。设置为 true 后你就可以在 Vue 组件中使用 template 选项了,但是这会让你的应用额外增加 10kb 左右。(默认false)
49 // runtimeCompiler: false, 64 // runtimeCompiler: false,
50 65
51 /** 66 /**
52 * 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 67 * 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
53 * 打包之后发现map文件过大,项目文件体积很大,设置为false就可以不输出map文件 68 * 打包之后发现map文件过大,项目文件体积很大,设置为false就可以不输出map文件
54 * map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。 69 * map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。
55 * 有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。 70 * 有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。
56 * */ 71 * */
57 productionSourceMap: false, 72 productionSourceMap: false,
58 73
59 // 它支持webPack-dev-server的所有选项
60 devServer: {
61 // host: "192.168.0.101",
62 host: "localhost",
63 port: 9001, // 端口号
64 https: false, // https:{type:Boolean}
65 open: true, //配置自动启动浏览器
66 // proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
67 }
68 };
...\ No newline at end of file ...\ No newline at end of file
74 // 它支持webPack-dev-server的所有选项
75 devServer: {
76 // host: "localhost",
77 port: 9001, // 端口号
78 https: false, // https:{type:Boolean}
79 open: true, //配置自动启动浏览器
80 // proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
81 }
82 };
......