默认提交
0 parents
Showing
96 changed files
with
5274 additions
and
0 deletions
.browserslistrc
0 → 100644
.editorconfig
0 → 100644
| 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 | root = true | ||
| 12 | |||
| 13 | [*] | ||
| 14 | # indent_style = tab | ||
| 15 | indent_style = space | ||
| 16 | # indent_size = 4 | ||
| 17 | indent_size = 2 | ||
| 18 | tab_width = 2 | ||
| 19 | end_of_line = lf | ||
| 20 | trim_trailing_whitespace = true | ||
| 21 | insert_final_newline = true | ||
| 22 | |||
| 23 | [*.{json,yml,wxml,html,vue,js}] | ||
| 24 | indent_style = tab | ||
| 25 | indent_size = 2 | ||
| 26 | tab_width = 2 | ||
| 27 | |||
| 28 | [README.md] | ||
| 29 | trim_trailing_whitespace = ignore |
.env.build
0 → 100644
.env.fev
0 → 100644
.eslintrc.js
0 → 100644
| 1 | module.exports = { | ||
| 2 | root: true, | ||
| 3 | env: { | ||
| 4 | node: true | ||
| 5 | }, | ||
| 6 | 'extends': [ | ||
| 7 | 'plugin:vue/essential', | ||
| 8 | // 'eslint:recommended' | ||
| 9 | ], | ||
| 10 | rules: { | ||
| 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
| 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
| 13 | "no-unused-vars": 'off' | ||
| 14 | }, | ||
| 15 | parserOptions: { | ||
| 16 | parser: 'babel-eslint' | ||
| 17 | } | ||
| 18 | } |
.gitignore
0 → 100644
README.md
0 → 100644
| 1 | # vue-cli3-framework | ||
| 2 | |||
| 3 | ## Project setup | ||
| 4 | ``` | ||
| 5 | npm install | ||
| 6 | ``` | ||
| 7 | |||
| 8 | ### Compiles and hot-reloads for development | ||
| 9 | ``` | ||
| 10 | npm run dev | ||
| 11 | ``` | ||
| 12 | |||
| 13 | ### Compiles and minifies for production | ||
| 14 | ``` | ||
| 15 | npm run build | ||
| 16 | ``` | ||
| 17 | |||
| 18 | ### Run your tests | ||
| 19 | ``` | ||
| 20 | npm run test | ||
| 21 | ``` | ||
| 22 | |||
| 23 | ### Lints and fixes files | ||
| 24 | ``` | ||
| 25 | npm run lint | ||
| 26 | ``` | ||
| 27 | |||
| 28 | ### Customize configuration | ||
| 29 | See [Configuration Reference](https://cli.vuejs.org/config/). |
build/oss-released.js
0 → 100644
| 1 | /** | ||
| 2 | * Created by pc on 2018/5/11. | ||
| 3 | * 需要的库为(co, ali-oss, glob) | ||
| 4 | * npm i co ali-oss glob --save | ||
| 5 | * ossConfig.json格式如下 | ||
| 6 | { | ||
| 7 | "region": "oss-cn-shanghai", //OSS region | ||
| 8 | "accessKeyId": "XXXXXXXX", //OSS accessKeyId | ||
| 9 | "accessKeySecret": "XXXXXXXX", //OSS accessKeySecret | ||
| 10 | "bucket": "ogo", //OSS bucket | ||
| 11 | "localPath": "./dist/**", //本地需要上传的文件目录,(/**)为遍历根号后所有目录 | ||
| 12 | "ossPath": "/mobile/", //oss线上文件目录(不能为根目录,避免误操作,最后加上'/') | ||
| 13 | "callbackUrl": "http://nodejs.org/dist/index.json" //预留请求服务器更新缓存的API | ||
| 14 | } | ||
| 15 | * | ||
| 16 | * | ||
| 17 | */ | ||
| 18 | |||
| 19 | let co = require('co') | ||
| 20 | let OSS = require('ali-oss') | ||
| 21 | let glob = require('glob') | ||
| 22 | let http = require('http') | ||
| 23 | let Config = require('./ossConfig.json') | ||
| 24 | |||
| 25 | // 配置oss信息 | ||
| 26 | let client = new OSS({ | ||
| 27 | region: Config.region, | ||
| 28 | accessKeyId: Config.accessKeyId, | ||
| 29 | accessKeySecret: Config.accessKeySecret, | ||
| 30 | bucket: Config.bucket | ||
| 31 | }) | ||
| 32 | |||
| 33 | // 删除线上目录 | ||
| 34 | function deleteFiles() { | ||
| 35 | if (Config.ossPath !== '' && Config.ossPath !== '/') { | ||
| 36 | co(function* () { | ||
| 37 | let result = yield client.list({ | ||
| 38 | prefix: Config.ossPath.slice(1, -1), | ||
| 39 | marker: Config.ossPath.slice(0, -1) | ||
| 40 | }) | ||
| 41 | let index = 0 | ||
| 42 | if (result.objects !== undefined) { | ||
| 43 | yield result.objects.map(i => { | ||
| 44 | co(function* () { | ||
| 45 | yield client.delete(i.name) | ||
| 46 | index += 1 | ||
| 47 | if (index === result.objects.length) { | ||
| 48 | console.log(`全部删除成功~,总共${result.objects.length}个文件`) | ||
| 49 | uploadFiles() | ||
| 50 | } | ||
| 51 | }) | ||
| 52 | }) | ||
| 53 | } else { | ||
| 54 | uploadFiles() | ||
| 55 | } | ||
| 56 | }).catch(function (err) { | ||
| 57 | console.log(err) | ||
| 58 | }) | ||
| 59 | } else { | ||
| 60 | console.error('上传失败,线上路径为根目录~') | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | function uploadFiles() { | ||
| 65 | // 遍历目录树之后上传 | ||
| 66 | glob(Config.localPath, { | ||
| 67 | nodir: true | ||
| 68 | }, (er, files) => { | ||
| 69 | let index = 0 | ||
| 70 | files.map(i => { | ||
| 71 | co(function* () { | ||
| 72 | let ossPath = Config.ossPath.substr(Config.ossPath.length - 1, 1) === '/' ? Config.ossPath.slice(0, -1) : Config.ossPath | ||
| 73 | yield client.put(ossPath + i.slice(6), i) | ||
| 74 | index += 1 | ||
| 75 | if (index === files.length) { | ||
| 76 | consoleStr(files.length) | ||
| 77 | } | ||
| 78 | }).catch(function (err) { | ||
| 79 | console.error(err.params.object) | ||
| 80 | }) | ||
| 81 | }) | ||
| 82 | }) | ||
| 83 | } | ||
| 84 | |||
| 85 | function consoleStr(length) { | ||
| 86 | console.log(`全部上传成功~,总共${length}个文件`) | ||
| 87 | // http.get(Config.callbackUrl, () => { | ||
| 88 | // console.log('更新缓存成功~') | ||
| 89 | // }).on('error', (e) => { | ||
| 90 | // console.error(`错误: ${e.message}`) | ||
| 91 | // }) | ||
| 92 | } | ||
| 93 | |||
| 94 | // 清空目录后上传 | ||
| 95 | // deleteFiles() | ||
| 96 | |||
| 97 | // 增量上传 | ||
| 98 | uploadFiles() | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
build/ossConfig.json
0 → 100644
| 1 | |||
| 2 | { | ||
| 3 | "region": "oss-cn-shenzhen", | ||
| 4 | "accessKeyId": "LTAIhDZsL5yCN90c", | ||
| 5 | "accessKeySecret": "LIj3OEJ8cMCQeRlUVVznJpMek2dPD2", | ||
| 6 | "bucket": "kdcdn", | ||
| 7 | "localPath": "./dist/**", | ||
| 8 | "ossPath": "/app/rtdn/", | ||
| 9 | "callbackUrl": "http://nodejs.org/dist/index.json" | ||
| 10 | } | ||
| 11 | |||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
git.sh
0 → 100755
package-lock.json
0 → 100644
This diff could not be displayed because it is too large.
package.json
0 → 100644
| 1 | { | ||
| 2 | "name": "vue-cli3-framework", | ||
| 3 | "version": "0.1.0", | ||
| 4 | "private": true, | ||
| 5 | "scripts": { | ||
| 6 | "serve": "vue-cli-service serve", | ||
| 7 | "dev": "vue-cli-service serve", | ||
| 8 | "build": "vue-cli-service build --no clean", | ||
| 9 | "fev": "vue-cli-service build --mode fev", | ||
| 10 | "lint": "vue-cli-service lint", | ||
| 11 | "oss": "node build/oss-released.js" | ||
| 12 | }, | ||
| 13 | "dependencies": { | ||
| 14 | "ali-oss": "^6.1.1", | ||
| 15 | "amfe-flexible": "^2.2.1", | ||
| 16 | "axios": "^0.19.0", | ||
| 17 | "axios-mock-adapter": "^1.16.0", | ||
| 18 | "co": "^4.6.0", | ||
| 19 | "core-js": "^2.6.5", | ||
| 20 | "glob": "^7.1.4", | ||
| 21 | "mockjs": "^1.0.1-beta3", | ||
| 22 | "postcss-pxtorem": "^4.0.1", | ||
| 23 | "ua-device": "^0.1.10", | ||
| 24 | "vue": "^2.6.10", | ||
| 25 | "vue-awesome-swiper": "^3.1.3", | ||
| 26 | "vue-i18n": "^8.15.0", | ||
| 27 | "vue-router": "^3.0.3", | ||
| 28 | "vuex": "^3.0.1" | ||
| 29 | }, | ||
| 30 | "devDependencies": { | ||
| 31 | "@vue/cli-plugin-babel": "^3.8.0", | ||
| 32 | "@vue/cli-plugin-eslint": "^3.8.0", | ||
| 33 | "@vue/cli-service": "^3.8.0", | ||
| 34 | "babel-eslint": "^10.0.1", | ||
| 35 | "babel-plugin-component": "^1.1.1", | ||
| 36 | "eslint": "^5.16.0", | ||
| 37 | "eslint-plugin-vue": "^5.0.0", | ||
| 38 | "node-sass": "^4.12.0", | ||
| 39 | "prerender-spa-plugin": "^3.4.0", | ||
| 40 | "sass-loader": "^7.1.0", | ||
| 41 | "vue-template-compiler": "^2.6.10" | ||
| 42 | } | ||
| 43 | } |
postcss.config.js
0 → 100644
public/favicon.ico
0 → 100644
No preview for this file type
public/index.html
0 → 100644
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="en"> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta charset="utf-8"> | ||
| 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| 7 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
| 8 | <link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
| 9 | <title>平安人寿保险官网</title> | ||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <noscript> | ||
| 14 | <strong>We're sorry but website doesn't work properly without JavaScript enabled. Please enable it to | ||
| 15 | continue.</strong> | ||
| 16 | </noscript> | ||
| 17 | <div id="app"></div> | ||
| 18 | <!-- built files will be auto injected --> | ||
| 19 | </body> | ||
| 20 | |||
| 21 | </html> |
src/App.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div id="app"> | ||
| 3 | <v-header></v-header> | ||
| 4 | <main ref="container" class="main-container"> | ||
| 5 | <router-view/> | ||
| 6 | </main> | ||
| 7 | <v-footer></v-footer> | ||
| 8 | </div> | ||
| 9 | </template> | ||
| 10 | |||
| 11 | |||
| 12 | <script> | ||
| 13 | import { mapGetters, mapActions, mapState } from "vuex"; | ||
| 14 | import VHeader from "@components/home/header/header.vue"; | ||
| 15 | import VFooter from "@components/home/footer/footer.vue"; | ||
| 16 | var UA = require("ua-device"); | ||
| 17 | |||
| 18 | export default { | ||
| 19 | name: "app", | ||
| 20 | components: { | ||
| 21 | VHeader, | ||
| 22 | VFooter | ||
| 23 | }, | ||
| 24 | computed: { | ||
| 25 | ...mapState({ | ||
| 26 | isMobile: state => state.isMobile | ||
| 27 | }) | ||
| 28 | }, | ||
| 29 | methods: { | ||
| 30 | ...mapActions(["pcorphone"]) | ||
| 31 | }, | ||
| 32 | created() { | ||
| 33 | let _this = this; | ||
| 34 | // 设置UA | ||
| 35 | let output = new UA(navigator.userAgent); | ||
| 36 | let deviceType = output.device.type; | ||
| 37 | let isMobile = deviceType == "mobile"; | ||
| 38 | this.$store.commit("IS_MOBILE", isMobile); | ||
| 39 | } | ||
| 40 | }; | ||
| 41 | </script> | ||
| 42 | |||
| 43 | <style lang="scss"> | ||
| 44 | @import "@/styles/_support"; | ||
| 45 | |||
| 46 | html { | ||
| 47 | font-family: SourceHanSansCN, -apple-system, PingFang SC, Hiragino Sans GB, | ||
| 48 | Microsoft YaHei, Helvetica Neue, Arial, sans-serif; | ||
| 49 | font-size: 12px; | ||
| 50 | word-spacing: 1px; | ||
| 51 | word-break: break-word; | ||
| 52 | text-rendering: optimizeLegibility; | ||
| 53 | color: #333; | ||
| 54 | background-color: #ffffff; | ||
| 55 | -ms-text-size-adjust: 100%; | ||
| 56 | -webkit-text-size-adjust: 100%; | ||
| 57 | -moz-osx-font-smoothing: grayscale; | ||
| 58 | -webkit-font-smoothing: antialiased; | ||
| 59 | box-sizing: border-box; | ||
| 60 | } | ||
| 61 | |||
| 62 | body, | ||
| 63 | div { | ||
| 64 | border: 0; | ||
| 65 | margin: 0; | ||
| 66 | padding: 0; | ||
| 67 | } | ||
| 68 | |||
| 69 | *, | ||
| 70 | *:before, | ||
| 71 | *:after { | ||
| 72 | box-sizing: border-box; | ||
| 73 | margin: 0; | ||
| 74 | } | ||
| 75 | |||
| 76 | body, | ||
| 77 | h1, | ||
| 78 | h2, | ||
| 79 | h3, | ||
| 80 | h4, | ||
| 81 | h5, | ||
| 82 | h6, | ||
| 83 | hr, | ||
| 84 | p, | ||
| 85 | blockquote, | ||
| 86 | dl, | ||
| 87 | dt, | ||
| 88 | dd, | ||
| 89 | ul, | ||
| 90 | ol, | ||
| 91 | li, | ||
| 92 | pre, | ||
| 93 | form, | ||
| 94 | fieldset, | ||
| 95 | legend, | ||
| 96 | button, | ||
| 97 | input, | ||
| 98 | textarea, | ||
| 99 | th, | ||
| 100 | td, | ||
| 101 | iframe { | ||
| 102 | margin: 0; | ||
| 103 | padding: 0; | ||
| 104 | } | ||
| 105 | |||
| 106 | img, | ||
| 107 | article, | ||
| 108 | aside, | ||
| 109 | details, | ||
| 110 | figcaption, | ||
| 111 | figure, | ||
| 112 | footer, | ||
| 113 | header, | ||
| 114 | menu, | ||
| 115 | nav, | ||
| 116 | section, | ||
| 117 | summary, | ||
| 118 | time, | ||
| 119 | mark, | ||
| 120 | audio, | ||
| 121 | video { | ||
| 122 | display: block; | ||
| 123 | margin: 0; | ||
| 124 | padding: 0; | ||
| 125 | } | ||
| 126 | |||
| 127 | h1, | ||
| 128 | h2, | ||
| 129 | h3, | ||
| 130 | h4, | ||
| 131 | h5, | ||
| 132 | h6 { | ||
| 133 | font-size: 100%; | ||
| 134 | } | ||
| 135 | |||
| 136 | fieldset, | ||
| 137 | img { | ||
| 138 | border: 0; | ||
| 139 | } | ||
| 140 | |||
| 141 | address, | ||
| 142 | caption, | ||
| 143 | cite, | ||
| 144 | dfn, | ||
| 145 | em, | ||
| 146 | th, | ||
| 147 | var, | ||
| 148 | i, | ||
| 149 | em { | ||
| 150 | font-style: normal; | ||
| 151 | font-weight: normal; | ||
| 152 | } | ||
| 153 | |||
| 154 | ol, | ||
| 155 | ul { | ||
| 156 | list-style: none; | ||
| 157 | } | ||
| 158 | |||
| 159 | a { | ||
| 160 | text-decoration: none; | ||
| 161 | color: inherit; | ||
| 162 | &:hover { | ||
| 163 | text-decoration: none; | ||
| 164 | } | ||
| 165 | } | ||
| 166 | |||
| 167 | a, | ||
| 168 | label, | ||
| 169 | button, | ||
| 170 | input, | ||
| 171 | select { | ||
| 172 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
| 173 | } | ||
| 174 | |||
| 175 | input, | ||
| 176 | select, | ||
| 177 | button { | ||
| 178 | font: 100% tahoma, "\5b8b\4f53", arial; | ||
| 179 | vertical-align: baseline; | ||
| 180 | border-radius: 0; | ||
| 181 | background-color: transparent; | ||
| 182 | } | ||
| 183 | |||
| 184 | select { | ||
| 185 | -webkit-appearance: none; | ||
| 186 | -moz-appearance: none; | ||
| 187 | } | ||
| 188 | |||
| 189 | button::-moz-focus-inner, | ||
| 190 | input, | ||
| 191 | input[type="reset"]::-moz-focus-inner, | ||
| 192 | input[type="button"]::-moz-focus-inner, | ||
| 193 | input[type="submit"]::-moz-focus-inner, | ||
| 194 | input[type="file"] > input[type="button"]::-moz-focus-inner { | ||
| 195 | border: none; | ||
| 196 | } | ||
| 197 | |||
| 198 | input[type="checkbox"], | ||
| 199 | input[type="radio"] { | ||
| 200 | vertical-align: middle; | ||
| 201 | } | ||
| 202 | |||
| 203 | input[type="number"]::-webkit-outer-spin-button, | ||
| 204 | input[type="number"]::-webkit-inner-spin-button { | ||
| 205 | -webkit-appearance: none !important; | ||
| 206 | -moz-appearance: none !important; | ||
| 207 | margin: 0; | ||
| 208 | } | ||
| 209 | |||
| 210 | input:-webkit-autofill { | ||
| 211 | -webkit-box-shadow: 0 0 0 1000px white inset; | ||
| 212 | } | ||
| 213 | |||
| 214 | input[type="search"], | ||
| 215 | input[type="tel"], | ||
| 216 | input[type="text"], | ||
| 217 | input { | ||
| 218 | -webkit-appearance: none; /*去除系统默认的样式*/ | ||
| 219 | -webkit-box-sizing: content-box; | ||
| 220 | font-family: inherit; | ||
| 221 | font-size: 100%; | ||
| 222 | box-sizing: border-box; | ||
| 223 | } | ||
| 224 | input::-webkit-search-decoration, | ||
| 225 | input::-webkit-search-cancel-button { | ||
| 226 | display: none; | ||
| 227 | } | ||
| 228 | |||
| 229 | textarea { | ||
| 230 | outline: none; | ||
| 231 | border-radius: 0; | ||
| 232 | -webkit-appearance: none; | ||
| 233 | -moz-appearance: none; | ||
| 234 | overflow: auto; | ||
| 235 | resize: none; | ||
| 236 | font: 100% tahoma, "\5b8b\4f53", arial; | ||
| 237 | } | ||
| 238 | |||
| 239 | #app { | ||
| 240 | border: 0; | ||
| 241 | margin: 0; | ||
| 242 | padding: 0; | ||
| 243 | } | ||
| 244 | |||
| 245 | .main-container { | ||
| 246 | position: relative; | ||
| 247 | margin: 0 auto; | ||
| 248 | width: 100%; | ||
| 249 | // max-width: 1024px; // 设计稿宽度 | ||
| 250 | min-height: 40rem; | ||
| 251 | |||
| 252 | &::after { | ||
| 253 | display: table; | ||
| 254 | content: ""; | ||
| 255 | clear: both; | ||
| 256 | } | ||
| 257 | } | ||
| 258 | |||
| 259 | .content { | ||
| 260 | // width: 1024px; | ||
| 261 | max-width: 1024px; | ||
| 262 | width: 100%; | ||
| 263 | margin: 0 auto; | ||
| 264 | } | ||
| 265 | |||
| 266 | .box-w { | ||
| 267 | // width: 1024px; | ||
| 268 | max-width: 1024px; | ||
| 269 | width: 100%; | ||
| 270 | margin: 0 auto; | ||
| 271 | } | ||
| 272 | |||
| 273 | .box { | ||
| 274 | // width: 950px; | ||
| 275 | max-width: 950px; | ||
| 276 | width: 100%; | ||
| 277 | margin: 0 auto; | ||
| 278 | } | ||
| 279 | |||
| 280 | .app__width { | ||
| 281 | width: 750px; | ||
| 282 | } | ||
| 283 | |||
| 284 | .app__width { | ||
| 285 | width: 750px; | ||
| 286 | } | ||
| 287 | |||
| 288 | .app__inner { | ||
| 289 | margin: 20px; | ||
| 290 | } | ||
| 291 | |||
| 292 | .app__title { | ||
| 293 | font-size: $fontSize; | ||
| 294 | line-height: $fontSize + 4px; | ||
| 295 | font-weight: bold; | ||
| 296 | padding-bottom: 10px; | ||
| 297 | margin-bottom: 20px; | ||
| 298 | border-bottom: 0.5px solid #eeeeee; | ||
| 299 | } | ||
| 300 | |||
| 301 | .app__desc { | ||
| 302 | font-size: $fontSizeSmaller; | ||
| 303 | line-height: $fontSizeSmaller + 2px; | ||
| 304 | margin-bottom: 20px; | ||
| 305 | color: $colorGray; | ||
| 306 | } | ||
| 307 | |||
| 308 | .app__bgc { | ||
| 309 | position: fixed; | ||
| 310 | background-color: #ffffff; | ||
| 311 | width: 100%; | ||
| 312 | height: 100%; | ||
| 313 | } | ||
| 314 | |||
| 315 | .app__bg { | ||
| 316 | position: absolute; | ||
| 317 | width: 100%; | ||
| 318 | height: 100%; | ||
| 319 | } | ||
| 320 | |||
| 321 | .app__top-shadow { | ||
| 322 | position: fixed; | ||
| 323 | width: 750px; | ||
| 324 | height: 1px; | ||
| 325 | box-shadow: 0px 4px 0.9px 0.1px rgba(6, 0, 1, 0.07); | ||
| 326 | background-color: #ffffff; | ||
| 327 | } | ||
| 328 | |||
| 329 | .app__content { | ||
| 330 | position: relative; | ||
| 331 | } | ||
| 332 | |||
| 333 | .btn { | ||
| 334 | cursor: pointer; | ||
| 335 | } | ||
| 336 | |||
| 337 | .swiper-pagination-bullet { | ||
| 338 | width: 1rem !important; | ||
| 339 | height: 1rem !important; | ||
| 340 | } | ||
| 341 | |||
| 342 | .swiper-pagination-bullet-active { | ||
| 343 | background: #f05a23 !important; | ||
| 344 | } | ||
| 345 | </style> |
src/api/api.js
0 → 100644
src/api/fetch-api.js
0 → 100644
| 1 | import axios from 'axios'; | ||
| 2 | // import { | ||
| 3 | // Toast | ||
| 4 | // } from 'vant'; | ||
| 5 | |||
| 6 | function Toast(msg) { | ||
| 7 | console.log("msg:", msg); | ||
| 8 | } | ||
| 9 | |||
| 10 | // axios的默认url | ||
| 11 | // axios.defaults.baseURL = "" | ||
| 12 | |||
| 13 | // 服务器地址 | ||
| 14 | let base = "https://ow.go.qudone.com"; | ||
| 15 | if (location.href.indexOf("//k.wxpai.cn") > 0) { | ||
| 16 | base = "https://api.k.wxpai.cn/bizproxy" | ||
| 17 | } | ||
| 18 | // let base = COM.baseUrl; | ||
| 19 | |||
| 20 | // 请求拦截器 | ||
| 21 | // axios.interceptors.request.use( | ||
| 22 | // config => { | ||
| 23 | // // 每次发送请求之前判断是否存在token,如果存在,则统一在http请求的header都加上token,不用每次请求都手动添加了 | ||
| 24 | // // 即使本地存在token,也有可能token是过期的,所以在响应拦截器中要对返回状态进行判断 | ||
| 25 | // const token = "token"; //这里写入token | ||
| 26 | // token && (config.headers.Authorization = token); | ||
| 27 | // return config; | ||
| 28 | // }, | ||
| 29 | // error => { | ||
| 30 | // return Promise.error(error); | ||
| 31 | // }) | ||
| 32 | |||
| 33 | // 响应拦截器 | ||
| 34 | axios.interceptors.response.use( | ||
| 35 | response => { | ||
| 36 | if (response.status === 200) { | ||
| 37 | if (response.data.code === 200) { | ||
| 38 | return Promise.resolve(response); | ||
| 39 | } else { | ||
| 40 | Toast(response.data.bizMsg); | ||
| 41 | return Promise.reject(response); | ||
| 42 | } | ||
| 43 | } else { | ||
| 44 | return Promise.reject(response); | ||
| 45 | } | ||
| 46 | }, | ||
| 47 | // 服务器状态码不是200的情况 | ||
| 48 | error => { | ||
| 49 | if (error.response.status) { | ||
| 50 | switch (error.response.status) { | ||
| 51 | // 401: 未登录 | ||
| 52 | // 未登录则跳转登录页面,并携带当前页面的路径 | ||
| 53 | // 在登录成功后返回当前页面,这一步需要在登录页操作。 | ||
| 54 | case 401: | ||
| 55 | router.replace({ | ||
| 56 | path: '/login', | ||
| 57 | query: { | ||
| 58 | redirect: router.currentRoute.fullPath | ||
| 59 | } | ||
| 60 | }); | ||
| 61 | break; | ||
| 62 | // 403 token过期 | ||
| 63 | // 登录过期对用户进行提示 | ||
| 64 | // 清除本地token和清空vuex中token对象 | ||
| 65 | // 跳转登录页面 | ||
| 66 | case 403: | ||
| 67 | Toast({ | ||
| 68 | message: '登录过期,请重新登录', | ||
| 69 | duration: 1000, | ||
| 70 | forbidClick: true | ||
| 71 | }); | ||
| 72 | // 清除token | ||
| 73 | localStorage.removeItem('token'); | ||
| 74 | store.commit('loginSuccess', null); | ||
| 75 | // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 | ||
| 76 | setTimeout(() => { | ||
| 77 | router.replace({ | ||
| 78 | path: '/login', | ||
| 79 | query: { | ||
| 80 | redirect: router.currentRoute.fullPath | ||
| 81 | } | ||
| 82 | }); | ||
| 83 | }, 1000); | ||
| 84 | break; | ||
| 85 | // 404请求不存在 | ||
| 86 | case 404: | ||
| 87 | Toast({ | ||
| 88 | message: '网络请求不存在', | ||
| 89 | duration: 1500, | ||
| 90 | forbidClick: true | ||
| 91 | }); | ||
| 92 | break; | ||
| 93 | // 其他错误,直接抛出错误提示 | ||
| 94 | default: | ||
| 95 | Toast({ | ||
| 96 | message: error.response.data.message, | ||
| 97 | duration: 1500, | ||
| 98 | forbidClick: true | ||
| 99 | }); | ||
| 100 | } | ||
| 101 | return Promise.reject(error.response); | ||
| 102 | } | ||
| 103 | } | ||
| 104 | ); | ||
| 105 | |||
| 106 | //formDataHeaders设置 | ||
| 107 | let formDataHeaders = { | ||
| 108 | headers: { | ||
| 109 | "Content-Type": "multipart/form-data" | ||
| 110 | } | ||
| 111 | } | ||
| 112 | |||
| 113 | /** | ||
| 114 | * 封装get方法 | ||
| 115 | * @param {*} params | ||
| 116 | */ | ||
| 117 | export const httpGet = params => { | ||
| 118 | let { | ||
| 119 | url, | ||
| 120 | data | ||
| 121 | } = params; | ||
| 122 | return axios.get(`${base}${url}`, { | ||
| 123 | params: data | ||
| 124 | }).then(res => res.data.content); | ||
| 125 | } | ||
| 126 | |||
| 127 | /** | ||
| 128 | * 封装post方法 | ||
| 129 | * @param {*} params | ||
| 130 | */ | ||
| 131 | export const httpPost = params => { | ||
| 132 | let { | ||
| 133 | url, | ||
| 134 | data | ||
| 135 | } = params; | ||
| 136 | return axios.post(`${base}${url}`, data).then(res => res.data.content); | ||
| 137 | } | ||
| 138 | |||
| 139 | |||
| 140 | /** | ||
| 141 | * 封装post方法 | ||
| 142 | * @param {*} params | ||
| 143 | * data数据是 formdata格式 | ||
| 144 | * 例如: | ||
| 145 | * this.file = file | ||
| 146 | let data = new FormData() //使用formData对象 | ||
| 147 | data.append('path', '/pro/mzczcradmin/') | ||
| 148 | data.append('file', file.file) | ||
| 149 | */ | ||
| 150 | export const formdata = params => { | ||
| 151 | let { | ||
| 152 | url, | ||
| 153 | data | ||
| 154 | } = params; | ||
| 155 | return axios.post(`${base}${url}`, data, formDataHeaders).then(res => res.data); | ||
| 156 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/api/index.js
0 → 100644
src/assets/fonts/font.scss
0 → 100644
| 1 | // @font-face { | ||
| 2 | // font-family: 'vivo-BoldExtended'; | ||
| 3 | // src: url('./vivo-BoldExtended.ttf'); | ||
| 4 | // font-weight: normal; | ||
| 5 | // font-style: normal; | ||
| 6 | // } | ||
| 7 | // @font-face { | ||
| 8 | // font-family: 'vivo-Regular'; | ||
| 9 | // src: url('./vivo-Regular.ttf'); | ||
| 10 | // font-weight: normal; | ||
| 11 | // font-style: normal; | ||
| 12 | // } | ||
| 13 | // @font-face { | ||
| 14 | // font-family: 'regular2'; | ||
| 15 | // src: url('./regular2.otf'); | ||
| 16 | // font-weight: normal; | ||
| 17 | // font-style: normal; | ||
| 18 | // } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/assets/images/common/button-next.png
0 → 100644
260 Bytes
src/assets/images/common/button-prev.png
0 → 100644
234 Bytes
src/assets/images/home/footer-logo.png
0 → 100644
9.69 KB
src/assets/images/home/header-logo.png
0 → 100644
3.36 KB
src/assets/images/home/icon-lang.png
0 → 100644
359 Bytes
src/assets/images/home/icon-user.png
0 → 100644
284 Bytes
src/assets/images/home/qrcode-focus.png
0 → 100644
10.4 KB
src/assets/images/index/banner.png
0 → 100644
52.1 KB
src/assets/images/index/linear.png
0 → 100644
834 Bytes
src/assets/images/index/more-1.png
0 → 100644
463 KB
src/assets/images/index/recommend-1.png
0 → 100644
107 KB
src/assets/images/index/recommend-2.png
0 → 100644
71.8 KB
src/assets/images/index/recommend-3.png
0 → 100644
68.5 KB
src/assets/images/news-detail/icon-clock.png
0 → 100644
362 Bytes
src/common/lang/en.js
0 → 100644
src/common/lang/tc.js
0 → 100644
src/common/lang/zh.js
0 → 100644
src/components/bottom-tips/bottom-tips.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="bottom-tips" v-if="visb"> | ||
| 3 | <div class="line"></div> | ||
| 4 | <div class="tips-wrap"> | ||
| 5 | <div class="tips">{{innerText ? innerText :'我是有底线的'}}</div> | ||
| 6 | </div> | ||
| 7 | </div> | ||
| 8 | </template> | ||
| 9 | |||
| 10 | <script> | ||
| 11 | export default { | ||
| 12 | props: ['visb', 'innerText'], | ||
| 13 | data() { | ||
| 14 | return { | ||
| 15 | key: 'value' | ||
| 16 | } | ||
| 17 | }, | ||
| 18 | created() { | ||
| 19 | console.log('visb:', this.visb) | ||
| 20 | } | ||
| 21 | } | ||
| 22 | </script> | ||
| 23 | |||
| 24 | <style lang="less" scoped> | ||
| 25 | /// 底线 | ||
| 26 | .bottom-tips { | ||
| 27 | position: relative; | ||
| 28 | padding: 40px 0; | ||
| 29 | width: 100%; | ||
| 30 | text-align: center; | ||
| 31 | color: #666666; | ||
| 32 | |||
| 33 | .line { | ||
| 34 | border-bottom: dashed 1px #cccccc; | ||
| 35 | width: 80%; | ||
| 36 | position: absolute; | ||
| 37 | top: 50%; | ||
| 38 | left: 0; | ||
| 39 | right: 0; | ||
| 40 | margin: 0 auto; | ||
| 41 | } | ||
| 42 | |||
| 43 | .tips-wrap { | ||
| 44 | font-size: 28px; | ||
| 45 | display: flex; | ||
| 46 | justify-content: center; | ||
| 47 | .tips { | ||
| 48 | position: relative; | ||
| 49 | padding: 0 20px; | ||
| 50 | background-color: #ffffff; | ||
| 51 | } | ||
| 52 | } | ||
| 53 | } | ||
| 54 | </style> |
src/components/demo-item/demo-item.js
0 → 100644
| 1 | import api from '@/api/api' | ||
| 2 | import { | ||
| 3 | httpGet, | ||
| 4 | httpPost | ||
| 5 | } from '@/api/fetch-api.js' | ||
| 6 | |||
| 7 | |||
| 8 | export default { | ||
| 9 | data() { | ||
| 10 | return { | ||
| 11 | key: 'value' | ||
| 12 | } | ||
| 13 | }, | ||
| 14 | components: {}, | ||
| 15 | methods: { | ||
| 16 | initData() {} | ||
| 17 | }, | ||
| 18 | mounted() {}, | ||
| 19 | created() { | ||
| 20 | } | ||
| 21 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/demo-item/demo-item.scss
0 → 100644
| 1 | @import '@/styles/_support'; |
src/components/demo-item/demo-item.vue
0 → 100644
src/components/empty-tips/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="empty-tips" v-if="visb"> | ||
| 3 | <div class="tips"> | ||
| 4 | <span class="iconfont iconempty"></span> | ||
| 5 | <div class="tips">{{innerText ? innerText :'这里空空如也~'}}</div> | ||
| 6 | </div> | ||
| 7 | </div> | ||
| 8 | </template> | ||
| 9 | |||
| 10 | <script> | ||
| 11 | export default { | ||
| 12 | props: ['visb', 'innerText'], | ||
| 13 | data() { | ||
| 14 | return { | ||
| 15 | key: 'value' | ||
| 16 | } | ||
| 17 | } | ||
| 18 | } | ||
| 19 | </script> | ||
| 20 | |||
| 21 | <style lang="scss" scoped> | ||
| 22 | .empty-tips { | ||
| 23 | box-sizing: border-box; | ||
| 24 | position: fixed; | ||
| 25 | text-align: center; | ||
| 26 | color: #666666; | ||
| 27 | font-size: 32px; | ||
| 28 | width: 100%; | ||
| 29 | height: 100%; | ||
| 30 | display: flex; | ||
| 31 | justify-content: center; | ||
| 32 | top: 35%; | ||
| 33 | |||
| 34 | .iconfont { | ||
| 35 | font-size: 100px; | ||
| 36 | } | ||
| 37 | |||
| 38 | .tips { | ||
| 39 | position: relative; | ||
| 40 | padding: 20px; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | </style> |
src/components/home/dropdown/dropdown.js
0 → 100644
| 1 | import { | ||
| 2 | mapState | ||
| 3 | } from 'vuex' | ||
| 4 | |||
| 5 | export default { | ||
| 6 | name: "DropDownList", | ||
| 7 | data() { | ||
| 8 | return { | ||
| 9 | activeIndex: 0, | ||
| 10 | sTitle: this.title, | ||
| 11 | }; | ||
| 12 | }, | ||
| 13 | props: { | ||
| 14 | type: { | ||
| 15 | type: String, | ||
| 16 | default () { | ||
| 17 | return "nav"; | ||
| 18 | } | ||
| 19 | }, | ||
| 20 | title: { | ||
| 21 | type: String, | ||
| 22 | default () { | ||
| 23 | return ""; | ||
| 24 | } | ||
| 25 | }, | ||
| 26 | dataList: { | ||
| 27 | type: Array, | ||
| 28 | default () { | ||
| 29 | return []; | ||
| 30 | } | ||
| 31 | }, | ||
| 32 | labelProperty: { | ||
| 33 | type: String, | ||
| 34 | default () { | ||
| 35 | return "name"; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | }, | ||
| 39 | directives: { | ||
| 40 | dpl: { | ||
| 41 | bind(el) { | ||
| 42 | el.style.display = "none"; | ||
| 43 | } | ||
| 44 | } | ||
| 45 | }, | ||
| 46 | methods: { | ||
| 47 | onOverHandler(event) { | ||
| 48 | let ul = event.currentTarget.childNodes[1].childNodes[1]; | ||
| 49 | ul.style.display = "block"; | ||
| 50 | }, | ||
| 51 | onOutHandler(event) { | ||
| 52 | let ul = event.currentTarget.childNodes[1].childNodes[1]; | ||
| 53 | ul.style.display = "none"; | ||
| 54 | }, | ||
| 55 | onClickHandler(index) { | ||
| 56 | // 隐藏其他 | ||
| 57 | let path = event.path || (event.composedPath && event.composedPath()); //兼容火狐和safari | ||
| 58 | path[1].style.display = "none"; | ||
| 59 | // 选择item | ||
| 60 | this.activeIndex = index; | ||
| 61 | let curData = this.dataList[index]; | ||
| 62 | if (this.type == "lang") { | ||
| 63 | // 如果是语言设置,则设置语言 | ||
| 64 | let lang = curData.value; | ||
| 65 | this.$i18n.locale = lang; | ||
| 66 | localStorage.setItem("lang", lang); | ||
| 67 | this.sTitle = curData.name; | ||
| 68 | } else { | ||
| 69 | // 不是的话,跳转页面 | ||
| 70 | this.$router.push({ | ||
| 71 | path: curData.path | ||
| 72 | }) | ||
| 73 | } | ||
| 74 | // console.log("name:", this.dataList[index].name); | ||
| 75 | // this.$emit("change", { | ||
| 76 | // index: index, | ||
| 77 | // value: this.dataList[index] | ||
| 78 | // }); | ||
| 79 | } | ||
| 80 | }, | ||
| 81 | computed: { | ||
| 82 | dplLable() { | ||
| 83 | return this.dataList[this.activeIndex][this.labelProperty]; | ||
| 84 | } | ||
| 85 | }, | ||
| 86 | created() { | ||
| 87 | // this. | ||
| 88 | }, | ||
| 89 | }; |
src/components/home/dropdown/dropdown.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .drop-list { | ||
| 4 | display: inline-block; | ||
| 5 | min-width: 6.25rem; | ||
| 6 | position: relative; | ||
| 7 | margin: 0 1rem; | ||
| 8 | |||
| 9 | .list { | ||
| 10 | position: absolute; | ||
| 11 | width: 100%; | ||
| 12 | |||
| 13 | .space { | ||
| 14 | height: 1.5rem; | ||
| 15 | } | ||
| 16 | } | ||
| 17 | |||
| 18 | span { | ||
| 19 | display: block; | ||
| 20 | text-align: center; | ||
| 21 | } | ||
| 22 | |||
| 23 | span:hover { | ||
| 24 | // background: #f6f6f6; | ||
| 25 | // color: #ec6429; | ||
| 26 | } | ||
| 27 | |||
| 28 | ul { | ||
| 29 | display: none; | ||
| 30 | overflow: hidden; | ||
| 31 | box-shadow: 0 0 1.5rem 0 rgba(255, 87, 0, 0.15); | ||
| 32 | border-radius: .5rem; | ||
| 33 | |||
| 34 | |||
| 35 | li { | ||
| 36 | border-bottom: solid 1px #f1f1f1; | ||
| 37 | background: #ffffff; | ||
| 38 | height: 4.25rem; | ||
| 39 | line-height: 4.25rem; | ||
| 40 | text-align: center; | ||
| 41 | } | ||
| 42 | |||
| 43 | li:last-child { | ||
| 44 | border-bottom: none; | ||
| 45 | } | ||
| 46 | |||
| 47 | li:hover { | ||
| 48 | // background: #f6f6f6; | ||
| 49 | color: #ec6429; | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | } | ||
| 54 | } |
src/components/home/dropdown/dropdown.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div> | ||
| 3 | <div class="drop-list" @mouseover="onOverHandler($event)" @mouseout="onOutHandler($event)"> | ||
| 4 | <span> | ||
| 5 | {{sTitle}} | ||
| 6 | <i></i> | ||
| 7 | </span> | ||
| 8 | <div class="list"> | ||
| 9 | <div class="space"></div> | ||
| 10 | <ul v-dpl> | ||
| 11 | <li v-for="(item, index) in dataList" :key="index" @click="onClickHandler(index, $event)">{{item[labelProperty]}}</li> | ||
| 12 | </ul> | ||
| 13 | </div> | ||
| 14 | </div> | ||
| 15 | </div> | ||
| 16 | </template> | ||
| 17 | |||
| 18 | <script src="./dropdown.js"></script> | ||
| 19 | <style lang="scss" scoped> | ||
| 20 | @import "./dropdown.scss"; | ||
| 21 | </style> |
src/components/home/footer/footer.js
0 → 100644
| 1 | import api from '@/api/api' | ||
| 2 | import { | ||
| 3 | httpGet, | ||
| 4 | httpPost | ||
| 5 | } from '@/api/fetch-api.js' | ||
| 6 | |||
| 7 | |||
| 8 | export default { | ||
| 9 | data() { | ||
| 10 | return { | ||
| 11 | key: 'value' | ||
| 12 | } | ||
| 13 | }, | ||
| 14 | components: {}, | ||
| 15 | methods: { | ||
| 16 | toPage(name) { | ||
| 17 | this.$router.push({ | ||
| 18 | name: name | ||
| 19 | }) | ||
| 20 | }, | ||
| 21 | initData() {} | ||
| 22 | }, | ||
| 23 | mounted() {}, | ||
| 24 | created() {} | ||
| 25 | } |
src/components/home/footer/footer.scss
0 → 100644
| 1 | // @import '@/styles/_support'; | ||
| 2 | @import '@/styles/_utils'; | ||
| 3 | |||
| 4 | .v-footer { | ||
| 5 | font-family: MicrosoftYaHei; | ||
| 6 | color: #ffffff; | ||
| 7 | background-color: #2e2b2a; | ||
| 8 | |||
| 9 | .footer-containter { | ||
| 10 | margin: 0 auto; | ||
| 11 | max-width: 950px; | ||
| 12 | |||
| 13 | .cont { | ||
| 14 | margin-left: 3.166667rem; | ||
| 15 | |||
| 16 | .logo-wrap { | ||
| 17 | padding: 1.75rem 0; | ||
| 18 | |||
| 19 | .logo-img { | ||
| 20 | cursor: pointer; | ||
| 21 | } | ||
| 22 | } | ||
| 23 | |||
| 24 | .line { | ||
| 25 | width: 100%; | ||
| 26 | height: 1px; | ||
| 27 | opacity: 0.2; | ||
| 28 | background-color: #ffffff; | ||
| 29 | } | ||
| 30 | |||
| 31 | // 信息 | ||
| 32 | .info { | ||
| 33 | padding: 1.25rem 0 1.5rem; | ||
| 34 | display: flex; | ||
| 35 | |||
| 36 | // 热线 | ||
| 37 | .hotline { | ||
| 38 | margin-right: 4.2rem; | ||
| 39 | |||
| 40 | .contact { | ||
| 41 | .n-item { | ||
| 42 | margin-bottom: 0.6rem; | ||
| 43 | } | ||
| 44 | |||
| 45 | .phone { | ||
| 46 | font-family: Arial; | ||
| 47 | color: #ea5a26; | ||
| 48 | font-size: 1.666667rem; | ||
| 49 | font-weight: bold; | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | &:first-child { | ||
| 54 | margin-bottom: 2rem; | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | } | ||
| 59 | |||
| 60 | // 导航 | ||
| 61 | .nav { | ||
| 62 | flex: 1; | ||
| 63 | display: flex; | ||
| 64 | |||
| 65 | .nav-v { | ||
| 66 | margin: 0 5.2rem; | ||
| 67 | } | ||
| 68 | |||
| 69 | .n-item { | ||
| 70 | cursor: pointer; | ||
| 71 | } | ||
| 72 | } | ||
| 73 | |||
| 74 | .focus { | ||
| 75 | width: 6.25rem; | ||
| 76 | text-align: center; | ||
| 77 | margin-right: 3rem; | ||
| 78 | |||
| 79 | .qrcode { | ||
| 80 | margin-top: .75rem; | ||
| 81 | } | ||
| 82 | |||
| 83 | } | ||
| 84 | |||
| 85 | // 公共组件 | ||
| 86 | .n-item { | ||
| 87 | margin-bottom: 1.416667rem; | ||
| 88 | color: rgba(179, 177, 168, 0.5); | ||
| 89 | |||
| 90 | &:first-child { | ||
| 91 | color: #ffffff; | ||
| 92 | margin-bottom: 2rem; | ||
| 93 | } | ||
| 94 | |||
| 95 | &:last-child { | ||
| 96 | margin-bottom: 0; | ||
| 97 | } | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | // 版权 | ||
| 102 | .copyright { | ||
| 103 | color: rgba(179, 177, 168, 0.5); | ||
| 104 | padding: 1.5rem 0; | ||
| 105 | line-height: 1.58; | ||
| 106 | } | ||
| 107 | } | ||
| 108 | |||
| 109 | } | ||
| 110 | } | ||
| 111 | |||
| 112 | @media (max-width: 950px) { | ||
| 113 | .v-footer { | ||
| 114 | .footer-containter { | ||
| 115 | .cont { | ||
| 116 | .info { | ||
| 117 | display: block; | ||
| 118 | |||
| 119 | .nav { | ||
| 120 | margin-top: 2rem; | ||
| 121 | |||
| 122 | .nav-v { | ||
| 123 | margin: 0 1.6rem 0 0; | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | .focus { | ||
| 128 | margin-top: 2rem; | ||
| 129 | text-align: left; | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | .copyright { | ||
| 134 | box-sizing: border-box; | ||
| 135 | padding-right: 2rem; | ||
| 136 | } | ||
| 137 | |||
| 138 | } | ||
| 139 | } | ||
| 140 | } | ||
| 141 | |||
| 142 | } |
src/components/home/footer/footer.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <footer class="v-footer"> | ||
| 4 | <div class="footer-containter"> | ||
| 5 | <div class="cont"> | ||
| 6 | <div class="logo-wrap"> | ||
| 7 | <img class="logo-img" src="@/assets/images/home/footer-logo.png" alt="中国平安人寿保险"> | ||
| 8 | </div> | ||
| 9 | <div class="line"></div> | ||
| 10 | <!-- 信息 --> | ||
| 11 | <div class="info"> | ||
| 12 | <div class="hotline"> | ||
| 13 | <div class="contact"> | ||
| 14 | <div class="n-item">香港号码</div> | ||
| 15 | <div class="phone">(852)2983 8866</div> | ||
| 16 | </div> | ||
| 17 | <div class="contact"> | ||
| 18 | <div class="n-item">内地号码</div> | ||
| 19 | <div class="phone">(86)40078 95511</div> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | <div class="nav"> | ||
| 23 | <div class="nav-v"> | ||
| 24 | <div class="n-item">關於我們</div> | ||
| 25 | <div class="n-item">集团介绍</div> | ||
| 26 | <div class="n-item">新聞資訊</div> | ||
| 27 | <div class="n-item">加入我們</div> | ||
| 28 | </div> | ||
| 29 | <div class="nav-v"> | ||
| 30 | <div class="n-item">幫助中心</div> | ||
| 31 | <div @click="toPage('privacy')" class="n-item">隱私政策</div> | ||
| 32 | <div @click="toPage('terms')" class="n-item">使用條款</div> | ||
| 33 | <div class="n-item">网站地图</div> | ||
| 34 | </div> | ||
| 35 | <div class="nav-v"> | ||
| 36 | <div class="n-item">聯絡我們</div> | ||
| 37 | <div class="n-item">联系方式</div> | ||
| 38 | <div class="n-item">服务网点</div> | ||
| 39 | </div> | ||
| 40 | |||
| 41 | </div> | ||
| 42 | <div class="focus"> | ||
| 43 | <div class="tit">官方公眾號</div> | ||
| 44 | <img class="qrcode" src="@/assets/images/home/qrcode-focus.png" alt=""> | ||
| 45 | </div> | ||
| 46 | |||
| 47 | </div> | ||
| 48 | <div class="line"></div> | ||
| 49 | <!-- 版权 --> | ||
| 50 | <div class="copyright"> | ||
| 51 | 版權所有 © 中國平安保險(集團)股份有限公司未經許可不得復制、轉載或摘編,違者必究! | ||
| 52 | <br>Copyright © PING AN INSURANCE (GROUP) COMPANY OF CHINA ,LTD. All Rights Reserved | ||
| 53 | </div> | ||
| 54 | </div> | ||
| 55 | </div> | ||
| 56 | </footer> | ||
| 57 | </template> | ||
| 58 | |||
| 59 | <script src="./footer.js"></script> | ||
| 60 | <style lang="scss" scoped> | ||
| 61 | @import "./footer.scss"; | ||
| 62 | </style> |
src/components/home/header/header.js
0 → 100644
| 1 | import { | ||
| 2 | mapState | ||
| 3 | } from 'vuex' | ||
| 4 | import VDropdown from '@components/home/dropdown/dropdown.vue' | ||
| 5 | |||
| 6 | export default { | ||
| 7 | name: 'VHeader', | ||
| 8 | components: { | ||
| 9 | VDropdown | ||
| 10 | }, | ||
| 11 | data() { | ||
| 12 | return { | ||
| 13 | maxClientWidth: 950, | ||
| 14 | navList: [{ | ||
| 15 | name: "產品介紹", | ||
| 16 | list: [] | ||
| 17 | }, | ||
| 18 | { | ||
| 19 | name: "客戶服務", | ||
| 20 | list: [{ | ||
| 21 | name: "保單查詢", | ||
| 22 | path: "" | ||
| 23 | }, | ||
| 24 | { | ||
| 25 | name: "理賠報案", | ||
| 26 | path: "" | ||
| 27 | }, | ||
| 28 | { | ||
| 29 | name: "客戶投訴", | ||
| 30 | path: "" | ||
| 31 | }, | ||
| 32 | { | ||
| 33 | name: "保全變更", | ||
| 34 | path: "" | ||
| 35 | }, | ||
| 36 | { | ||
| 37 | name: "聯繫方式", | ||
| 38 | path: "" | ||
| 39 | }, | ||
| 40 | { | ||
| 41 | name: "續期繳費", | ||
| 42 | path: "" | ||
| 43 | }, | ||
| 44 | { | ||
| 45 | name: "預約服務", | ||
| 46 | path: "" | ||
| 47 | } | ||
| 48 | ] | ||
| 49 | }, | ||
| 50 | { | ||
| 51 | name: "新聞資訊", | ||
| 52 | list: [] | ||
| 53 | }, | ||
| 54 | { | ||
| 55 | name: "關於平安人壽", | ||
| 56 | list: [{ | ||
| 57 | name: "公司簡介", | ||
| 58 | path: "/profile" | ||
| 59 | }, | ||
| 60 | { | ||
| 61 | name: "領導人概況", | ||
| 62 | path: "" | ||
| 63 | }, | ||
| 64 | ] | ||
| 65 | }, | ||
| 66 | ], | ||
| 67 | langData: { | ||
| 68 | name: "繁", | ||
| 69 | list: [{ | ||
| 70 | name: "繁", | ||
| 71 | path: "", | ||
| 72 | value: "tc" | ||
| 73 | }, | ||
| 74 | { | ||
| 75 | name: "简", | ||
| 76 | path: "", | ||
| 77 | value: "zh" | ||
| 78 | }, | ||
| 79 | { | ||
| 80 | name: "EN", | ||
| 81 | path: "", | ||
| 82 | value: "en" | ||
| 83 | }, | ||
| 84 | ] | ||
| 85 | } | ||
| 86 | } | ||
| 87 | }, | ||
| 88 | computed: { | ||
| 89 | ...mapState({ | ||
| 90 | isSmallScreen: state => state.isSmallScreen | ||
| 91 | }) | ||
| 92 | }, | ||
| 93 | methods: { | ||
| 94 | toIndex() { | ||
| 95 | this.$router.push({ | ||
| 96 | path: "/" | ||
| 97 | }) | ||
| 98 | }, | ||
| 99 | checkIsSmallScreen() { | ||
| 100 | const self = this; | ||
| 101 | if (document.body.clientWidth > self.maxClientWidth) { | ||
| 102 | self.$store.commit('IS_SMALL_SCREEN', false) | ||
| 103 | } else { | ||
| 104 | self.$store.commit('IS_SMALL_SCREEN', true) | ||
| 105 | } | ||
| 106 | } | ||
| 107 | }, | ||
| 108 | mounted() { | ||
| 109 | const self = this; | ||
| 110 | self.checkIsSmallScreen(); | ||
| 111 | document.body.onresize = () => { | ||
| 112 | self.checkIsSmallScreen(); | ||
| 113 | } | ||
| 114 | } | ||
| 115 | } |
src/components/home/header/header.scss
0 → 100644
| 1 | .v-header { | ||
| 2 | font-family: SourceHanSansCN; | ||
| 3 | height: 5.833333rem; | ||
| 4 | background-color: #fff; | ||
| 5 | color: #4c4948; | ||
| 6 | position: relative; | ||
| 7 | z-index: 11; | ||
| 8 | |||
| 9 | .header-container { | ||
| 10 | max-width: 950px; | ||
| 11 | height: 100%; | ||
| 12 | margin: auto; | ||
| 13 | display: flex; | ||
| 14 | align-items: center; | ||
| 15 | position: relative; | ||
| 16 | } | ||
| 17 | |||
| 18 | .main-nav { | ||
| 19 | height: 100%; | ||
| 20 | flex: 1 0 auto; | ||
| 21 | } | ||
| 22 | |||
| 23 | .logo-img { | ||
| 24 | margin-right: 2rem; | ||
| 25 | cursor: pointer; | ||
| 26 | } | ||
| 27 | |||
| 28 | .nav-list { | ||
| 29 | height: 100%; | ||
| 30 | display: flex; | ||
| 31 | align-items: center; | ||
| 32 | justify-content: flex-end; | ||
| 33 | position: relative; | ||
| 34 | } | ||
| 35 | |||
| 36 | .nav-item { | ||
| 37 | display: flex; | ||
| 38 | align-items: center; | ||
| 39 | height: 100%; | ||
| 40 | margin: 0; | ||
| 41 | font-size: 1rem; | ||
| 42 | // padding: 0 4.166667rem; | ||
| 43 | -ms-flex-pack: center; | ||
| 44 | justify-content: center; | ||
| 45 | position: relative; | ||
| 46 | cursor: pointer; | ||
| 47 | } | ||
| 48 | |||
| 49 | .main-nav-list { | ||
| 50 | display: flex; | ||
| 51 | cursor: pointer; | ||
| 52 | } | ||
| 53 | |||
| 54 | .nav-item.link-item { | ||
| 55 | padding: 0 50px; | ||
| 56 | height: 5rem; | ||
| 57 | } | ||
| 58 | |||
| 59 | .nav-item.search { | ||
| 60 | -webkit-box-flex: 1; | ||
| 61 | -ms-flex: 1 1 auto; | ||
| 62 | flex: 1 1 auto; | ||
| 63 | -webkit-box-pack: end; | ||
| 64 | -ms-flex-pack: end; | ||
| 65 | justify-content: flex-end; | ||
| 66 | cursor: auto; | ||
| 67 | } | ||
| 68 | |||
| 69 | |||
| 70 | |||
| 71 | .nav-item.submit {} | ||
| 72 | |||
| 73 | .nav-item.auth { | ||
| 74 | |||
| 75 | color: #ffffff; | ||
| 76 | |||
| 77 | .user { | ||
| 78 | width: 7.333333rem; | ||
| 79 | height: 2.25rem; | ||
| 80 | background-color: #f05a23; | ||
| 81 | border-radius: 1.333333rem; | ||
| 82 | display: flex; | ||
| 83 | align-items: center; | ||
| 84 | justify-content: center; | ||
| 85 | // margin-right: 2rem; | ||
| 86 | |||
| 87 | .icon-img { | ||
| 88 | margin: 0 .5rem; | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | .lang { | ||
| 93 | color: #f05a23; | ||
| 94 | |||
| 95 | } | ||
| 96 | } | ||
| 97 | } | ||
| 98 | |||
| 99 | |||
| 100 | @media (max-width: 950px) { | ||
| 101 | .v-header { | ||
| 102 | .header-container { | ||
| 103 | width: 96%; | ||
| 104 | } | ||
| 105 | } | ||
| 106 | } | ||
| 107 | |||
| 108 | @media (max-width: 800px) { | ||
| 109 | .v-header { | ||
| 110 | .main-nav-list { | ||
| 111 | display: none; | ||
| 112 | } | ||
| 113 | } | ||
| 114 | } |
src/components/home/header/header.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <header class="v-header"> | ||
| 4 | <div class="header-container"> | ||
| 5 | <img @click="toIndex" src="@/assets/images/home/header-logo.png" alt="中国平安人寿保险" class="logo-img"> | ||
| 6 | <div class="main-nav"> | ||
| 7 | <div class="nav-list"> | ||
| 8 | <div class="main-nav-list"> | ||
| 9 | <v-dropdown v-for="item in navList" :key="item.id" :title="item.name" :data-list="item.list"> | ||
| 10 | </v-dropdown> | ||
| 11 | </div> | ||
| 12 | <div class="nav-item search"> | ||
| 13 | </div> | ||
| 14 | <div class="nav-item submit"> | ||
| 15 | </div> | ||
| 16 | <div class="nav-item auth"> | ||
| 17 | <div class="user"> | ||
| 18 | <img class="icon-img" src="@/assets/images/home/icon-user.png"> 登入 | ||
| 19 | </div> | ||
| 20 | <v-dropdown class="lang" :type="'lang'" :title="langData.name" :data-list="langData.list"></v-dropdown> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | </div> | ||
| 25 | </header> | ||
| 26 | </template> | ||
| 27 | |||
| 28 | <script src="./header.js"></script> | ||
| 29 | <style lang="scss" scoped> | ||
| 30 | @import "./header.scss"; | ||
| 31 | </style> |
src/const/EVT.js
0 → 100644
| 1 | // 全局事件 | ||
| 2 | module.exports = { | ||
| 3 | NAV_FILTER: '_nav_filter', // 导航菜单过滤,触发请求 | ||
| 4 | TAB_SELECT: '_tab_select', // 选择tab ,主题 classify | ||
| 5 | EVT_SET_TAB_INDEX: '_evt_set_tab_index', // 选择tab ,主题 classify | ||
| 6 | EVT_TAB_INDEX_CHANGE: '_evt_tab_index_change', // 从navbar发至index 点击头部导航 index | ||
| 7 | } | ||
| 8 | |||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/main.js
0 → 100644
| 1 | import Vue from 'vue'; | ||
| 2 | import VueI18n from 'vue-i18n'; | ||
| 3 | import App from './App.vue'; | ||
| 4 | import router from './router'; | ||
| 5 | import store from './store/index'; | ||
| 6 | |||
| 7 | import VueAwesomeSwiper from 'vue-awesome-swiper' | ||
| 8 | // require styles | ||
| 9 | import 'swiper/dist/css/swiper.css' | ||
| 10 | Vue.use(VueAwesomeSwiper, /* { default global options } */) | ||
| 11 | |||
| 12 | |||
| 13 | import Mock from './mock' | ||
| 14 | Mock.bootstrap(); | ||
| 15 | |||
| 16 | // import 'amfe-flexible'; | ||
| 17 | |||
| 18 | Vue.config.productionTip = false | ||
| 19 | |||
| 20 | Vue.use(VueI18n) | ||
| 21 | const i18n = new VueI18n({ | ||
| 22 | locale: localStorage.getItem("lang") || 'zh', // 语言标识 | ||
| 23 | //this.$i18n.locale // 通过切换locale的值来实现语言切换 | ||
| 24 | messages: { | ||
| 25 | 'zh': require('@/common/lang/zh'), // 中文语言包 | ||
| 26 | 'en': require('@/common/lang/en') // 英文语言包 | ||
| 27 | } | ||
| 28 | }) | ||
| 29 | |||
| 30 | |||
| 31 | new Vue({ | ||
| 32 | i18n, | ||
| 33 | router, | ||
| 34 | store, | ||
| 35 | render: h => h(App), | ||
| 36 | mounted: () => { | ||
| 37 | document.dispatchEvent(new Event('render-event')); | ||
| 38 | } | ||
| 39 | }).$mount('#app') |
src/mock/data/user.js
0 → 100755
| 1 | import Mock from 'mockjs'; | ||
| 2 | const LoginUsers = [ | ||
| 3 | { | ||
| 4 | id: 1, | ||
| 5 | username: 'admin', | ||
| 6 | password: 'admin', | ||
| 7 | avatar: 'https://raw.githubusercontent.com/taylorchen709/markdown-images/master/vueadmin/user.png', | ||
| 8 | name: '张某某' | ||
| 9 | } | ||
| 10 | ]; | ||
| 11 | |||
| 12 | const Users = []; | ||
| 13 | |||
| 14 | for (let i = 0; i < 5; i++) { | ||
| 15 | Users.push(Mock.mock({ | ||
| 16 | id: Mock.Random.guid(), | ||
| 17 | province: Mock.Random.province(), | ||
| 18 | city: Mock.Random.city(), | ||
| 19 | fieldName: Mock.Random.cname(), | ||
| 20 | address: Mock.mock('@county(true)'), | ||
| 21 | 'age|18-60': 1, | ||
| 22 | birth: Mock.Random.date(), | ||
| 23 | sex: Mock.Random.integer(0, 1) | ||
| 24 | })); | ||
| 25 | } | ||
| 26 | |||
| 27 | export { LoginUsers, Users }; |
src/mock/index.js
0 → 100755
src/mock/mock.js
0 → 100755
| 1 | import axios from 'axios'; | ||
| 2 | import MockAdapter from 'axios-mock-adapter'; | ||
| 3 | import { | ||
| 4 | LoginUsers, | ||
| 5 | Users | ||
| 6 | } from './data/user'; | ||
| 7 | let _Users = Users; | ||
| 8 | |||
| 9 | export default { | ||
| 10 | /** | ||
| 11 | * mock bootstrap | ||
| 12 | */ | ||
| 13 | bootstrap() { | ||
| 14 | return; | ||
| 15 | // 紧在dev环境下使用 | ||
| 16 | if (process.env.NODE_ENV !== "development") { | ||
| 17 | return; | ||
| 18 | } | ||
| 19 | let mock = new MockAdapter(axios); | ||
| 20 | |||
| 21 | // mock success request | ||
| 22 | mock.onGet('/success').reply(200, { | ||
| 23 | msg: 'success' | ||
| 24 | }); | ||
| 25 | |||
| 26 | // mock error request | ||
| 27 | mock.onGet('/error').reply(500, { | ||
| 28 | msg: 'failure' | ||
| 29 | }); | ||
| 30 | |||
| 31 | // 拦截 get方法demo | ||
| 32 | mock.onGet('/path1/path2/getdemo').reply(config => { | ||
| 33 | // 拦截参数 | ||
| 34 | let { | ||
| 35 | params1, | ||
| 36 | params2 | ||
| 37 | } = config.params; | ||
| 38 | return new Promise((resolve, reject) => { | ||
| 39 | let content = {}; | ||
| 40 | let success = true; | ||
| 41 | resolve([200, { | ||
| 42 | code: 2000, | ||
| 43 | msg: '请求成功', | ||
| 44 | success, | ||
| 45 | content | ||
| 46 | }]); | ||
| 47 | }); | ||
| 48 | }); | ||
| 49 | |||
| 50 | // 拦截post方法demo | ||
| 51 | mock.onPost('/path1/path2/postdemo').reply(config => { | ||
| 52 | let { | ||
| 53 | params1, | ||
| 54 | params2 | ||
| 55 | } = JSON.parse(config.data); | ||
| 56 | return new Promise((resolve, reject) => { | ||
| 57 | let content = {}; | ||
| 58 | let success = true; | ||
| 59 | resolve([200, { | ||
| 60 | code: 2000, | ||
| 61 | msg: '请求成功', | ||
| 62 | success, | ||
| 63 | content | ||
| 64 | }]); | ||
| 65 | }); | ||
| 66 | }); | ||
| 67 | |||
| 68 | } | ||
| 69 | }; |
src/pages/About.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="about"> | ||
| 3 | <h1>This is an about page</h1> | ||
| 4 | <div class="cc"> | ||
| 5 | about | ||
| 6 | <div class="ddd">123about3</div> | ||
| 7 | </div> | ||
| 8 | </div> | ||
| 9 | </template> | ||
| 10 | |||
| 11 | <style lang="scss" scoped> | ||
| 12 | .cc { | ||
| 13 | .ddd { | ||
| 14 | width: 746px; | ||
| 15 | height: 300px; | ||
| 16 | background-color: wheat; | ||
| 17 | } | ||
| 18 | } | ||
| 19 | </style> | ||
| 20 |
src/pages/Home.vue
0 → 100644
src/pages/demo/index.js
0 → 100644
src/pages/demo/index.scss
0 → 100644
src/pages/demo/index.vue
0 → 100644
src/pages/index/index.js
0 → 100644
| 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 | swiperOption: { | ||
| 12 | navigation: { | ||
| 13 | nextEl: '.swiper-button-next', | ||
| 14 | prevEl: '.swiper-button-prev' | ||
| 15 | }, | ||
| 16 | pagination: { | ||
| 17 | el: '.swiper-pagination', | ||
| 18 | // renderBullet(index, className) { | ||
| 19 | // return `<span class="${className} swiper-pagination-bullet-custom">${index + 1}</span>` | ||
| 20 | // } | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
| 24 | }, | ||
| 25 | components: {}, | ||
| 26 | methods: { | ||
| 27 | toNewsDetail(){ | ||
| 28 | this.$router.push({ | ||
| 29 | path:'/news/detail' | ||
| 30 | }) | ||
| 31 | }, | ||
| 32 | chn(val) { | ||
| 33 | if (val == 1) { | ||
| 34 | this.$i18n.locale = 'en' | ||
| 35 | localStorage.setItem("lang", "en"); | ||
| 36 | } else { | ||
| 37 | this.$i18n.locale = 'zh' | ||
| 38 | localStorage.setItem("lang", "zh"); | ||
| 39 | } | ||
| 40 | }, | ||
| 41 | initData() {} | ||
| 42 | }, | ||
| 43 | mounted() {}, | ||
| 44 | created() {} | ||
| 45 | } |
src/pages/index/index.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .content { | ||
| 4 | padding-bottom: 2.25rem; | ||
| 5 | } | ||
| 6 | |||
| 7 | .top-space { | ||
| 8 | height: 2.25rem; | ||
| 9 | } | ||
| 10 | |||
| 11 | .box { | ||
| 12 | position: relative; | ||
| 13 | } | ||
| 14 | |||
| 15 | // banner 轮播 | ||
| 16 | .banner { | ||
| 17 | box-shadow: 0 0 1.75rem 0 rgba(255, 87, 0, 0.1); | ||
| 18 | } | ||
| 19 | |||
| 20 | // 推荐产品 | ||
| 21 | .recommend { | ||
| 22 | display: flex; | ||
| 23 | justify-content: space-between; | ||
| 24 | margin-top: 2.25rem; | ||
| 25 | |||
| 26 | &-item { | ||
| 27 | position: relative; | ||
| 28 | width: 25.833333rem; | ||
| 29 | border-radius: .75rem; | ||
| 30 | box-shadow: 0 0 1.5rem 0 rgba(255, 87, 0, 0.15); | ||
| 31 | background-color: #fbfbfb; | ||
| 32 | |||
| 33 | .btn { | ||
| 34 | position: absolute; | ||
| 35 | // width: 13.5rem; | ||
| 36 | // height: 4.1rem; | ||
| 37 | // top: 30.2rem; | ||
| 38 | width: 52%; | ||
| 39 | height: 11%; | ||
| 40 | top: 81%; | ||
| 41 | left: 0; | ||
| 42 | right: 0; | ||
| 43 | margin: 0 auto; | ||
| 44 | cursor: pointer; | ||
| 45 | } | ||
| 46 | |||
| 47 | img { | ||
| 48 | width: 100%; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | // 了解我们 | ||
| 54 | .more { | ||
| 55 | margin: 3.5rem auto 0; | ||
| 56 | position: relative; | ||
| 57 | |||
| 58 | .btn { | ||
| 59 | position: absolute; | ||
| 60 | width: 26%; | ||
| 61 | height: 8%; | ||
| 62 | top: 83%; | ||
| 63 | left: 69%; | ||
| 64 | z-index: 1; | ||
| 65 | } | ||
| 66 | |||
| 67 | .cont { | ||
| 68 | position: relative; | ||
| 69 | margin: 0 auto; | ||
| 70 | // @extend .fcc; | ||
| 71 | width: 85%; | ||
| 72 | |||
| 73 | img { | ||
| 74 | width: 100%; | ||
| 75 | } | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 | // 新闻资讯 | ||
| 80 | .news { | ||
| 81 | margin: 4.25rem auto 0; | ||
| 82 | |||
| 83 | .linear { | ||
| 84 | width: 100%; | ||
| 85 | height: 2.04rem; | ||
| 86 | background-image: url('~@/assets/images/index/linear.png'); | ||
| 87 | } | ||
| 88 | |||
| 89 | .tit { | ||
| 90 | font-family: MicrosoftYaHei; | ||
| 91 | text-align: center; | ||
| 92 | color: #f05a23; | ||
| 93 | font-size: 18px; | ||
| 94 | font-weight: bold; | ||
| 95 | letter-spacing: 1.8px; | ||
| 96 | } | ||
| 97 | |||
| 98 | .under-line { | ||
| 99 | margin: .75rem auto 0; | ||
| 100 | width: 4rem; | ||
| 101 | height: .25rem; | ||
| 102 | background-color: #275d40; | ||
| 103 | } | ||
| 104 | |||
| 105 | .news-wrap { | ||
| 106 | margin: 3.2rem auto 0; | ||
| 107 | max-width: 66.75rem; | ||
| 108 | |||
| 109 | .more { | ||
| 110 | text-align: right; | ||
| 111 | margin-bottom: .5rem; | ||
| 112 | } | ||
| 113 | |||
| 114 | .news-item { | ||
| 115 | height: 4.25rem; | ||
| 116 | color: #4c4948; | ||
| 117 | display: flex; | ||
| 118 | justify-content: space-between; | ||
| 119 | align-items: center; | ||
| 120 | border-top: solid 1px #dcdddd; | ||
| 121 | |||
| 122 | &-tit { | ||
| 123 | cursor: pointer; | ||
| 124 | } | ||
| 125 | |||
| 126 | &-date {} | ||
| 127 | |||
| 128 | &:last-child { | ||
| 129 | border-bottom: solid 1px #dcdddd; | ||
| 130 | } | ||
| 131 | } | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 135 | |||
| 136 | .swiper-button-prev { | ||
| 137 | background-image: url('~@/assets/images/common/button-prev.png'); | ||
| 138 | } | ||
| 139 | |||
| 140 | .swiper-button-next { | ||
| 141 | background-image: url('~@/assets/images/common/button-next.png'); | ||
| 142 | } | ||
| 143 | |||
| 144 | @media (max-width: 950px) { | ||
| 145 | .box { | ||
| 146 | width: 96%; | ||
| 147 | } | ||
| 148 | } |
src/pages/index/index.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="content"> | ||
| 4 | <div class="top-space"></div> | ||
| 5 | <!-- banner 轮播 --> | ||
| 6 | <div class="box-w banner"> | ||
| 7 | <swiper :options="swiperOption"> | ||
| 8 | <swiper-slide> | ||
| 9 | <img src="@/assets/images/index/banner.png"> | ||
| 10 | </swiper-slide> | ||
| 11 | <div class="swiper-button-prev" slot="button-prev"></div> | ||
| 12 | <div class="swiper-button-next" slot="button-next"></div> | ||
| 13 | <div class="swiper-pagination" slot="pagination"></div> | ||
| 14 | </swiper> | ||
| 15 | </div> | ||
| 16 | <!-- 推荐产品 --> | ||
| 17 | <div class="box recommend"> | ||
| 18 | <div class="recommend-item"> | ||
| 19 | <div class="btn"></div> | ||
| 20 | <img src="@/assets/images/index/recommend-1.png"> | ||
| 21 | </div> | ||
| 22 | <div class="recommend-item"> | ||
| 23 | <div class="btn"></div> | ||
| 24 | <img src="@/assets/images/index/recommend-2.png"> | ||
| 25 | </div> | ||
| 26 | <div class="recommend-item"> | ||
| 27 | <!-- {{t}} --> | ||
| 28 | <div class="btn"></div> | ||
| 29 | <img src="@/assets/images/index/recommend-3.png"> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | <!-- 了解我们 --> | ||
| 33 | <div class="box more"> | ||
| 34 | <div class="cont"> | ||
| 35 | <div class="btn"></div> | ||
| 36 | <img src="@/assets/images/index/more-1.png"> | ||
| 37 | </div> | ||
| 38 | </div> | ||
| 39 | <!-- 新闻资讯 --> | ||
| 40 | <div class="box news"> | ||
| 41 | <div class="linear"></div> | ||
| 42 | <div class="tit">新聞資訊</div> | ||
| 43 | <div class="under-line"></div> | ||
| 44 | <div class="news-wrap"> | ||
| 45 | <div class="more"> | ||
| 46 | 查看更多 > | ||
| 47 | </div> | ||
| 48 | <div @click="toNewsDetail()" class="news-item"> | ||
| 49 | <div class="news-item-tit">平安人壽2019年2季度保險消費報告出爐!</div> | ||
| 50 | <div class="news-item-date">2019-09-27</div> | ||
| 51 | </div> | ||
| 52 | <div @click="toNewsDetail()" class="news-item"> | ||
| 53 | <div class="news-item-tit">公益獻禮華誕年,創新開拓扶貧路</div> | ||
| 54 | <div class="news-item-date">2019-09-27</div> | ||
| 55 | </div> | ||
| 56 | <div @click="toNewsDetail()" class="news-item"> | ||
| 57 | <div class="news-item-tit">平安920要放大招啦!內含超強攻略!</div> | ||
| 58 | <div class="news-item-date">2019-09-27</div> | ||
| 59 | </div> | ||
| 60 | <div @click="toNewsDetail()" class="news-item"> | ||
| 61 | <div class="news-item-tit">突發!平安人壽迅速應對廣東陽江大巴交通事故</div> | ||
| 62 | <div class="news-item-date">2019-09-27</div> | ||
| 63 | </div> | ||
| 64 | <div @click="toNewsDetail()" class="news-item"> | ||
| 65 | <div class="news-item-tit">伴成長、助扶貧,平安人壽客服節給家庭“AI”的力量</div> | ||
| 66 | <div class="news-item-date">2019-09-27</div> | ||
| 67 | </div> | ||
| 68 | </div> | ||
| 69 | |||
| 70 | </div> | ||
| 71 | </div> | ||
| 72 | </template> | ||
| 73 | |||
| 74 | <script src="./index.js"></script> | ||
| 75 | <style lang="scss" scoped> | ||
| 76 | @import "./index.scss"; | ||
| 77 | </style> |
src/pages/news-detail/news-detail.js
0 → 100644
| 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 | toNewsList() { | ||
| 16 | // this.$router.push({ | ||
| 17 | // path: "/news/list" | ||
| 18 | // }) | ||
| 19 | this.$router.go(-1); | ||
| 20 | }, | ||
| 21 | initData() {} | ||
| 22 | }, | ||
| 23 | mounted() {}, | ||
| 24 | created() { | ||
| 25 | document.documentElement.scrollTop = 0; | ||
| 26 | document.body.scrollTop = 0; | ||
| 27 | } | ||
| 28 | } |
src/pages/news-detail/news-detail.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .content { | ||
| 4 | font-family: MicrosoftYaHei; | ||
| 5 | color: #4c4948; | ||
| 6 | padding-bottom: 8.5rem; | ||
| 7 | } | ||
| 8 | |||
| 9 | .box { | ||
| 10 | position: relative; | ||
| 11 | max-width: 64rem; | ||
| 12 | } | ||
| 13 | |||
| 14 | .top-space { | ||
| 15 | height: 5rem; | ||
| 16 | } | ||
| 17 | |||
| 18 | .tit { | ||
| 19 | text-align: center; | ||
| 20 | font-size: 18px; | ||
| 21 | font-weight: bold; | ||
| 22 | letter-spacing: 1.8px; | ||
| 23 | } | ||
| 24 | |||
| 25 | .back { | ||
| 26 | text-align: right; | ||
| 27 | margin-top: .75rem; | ||
| 28 | cursor: pointer; | ||
| 29 | } | ||
| 30 | |||
| 31 | .dat { | ||
| 32 | margin-top: 2.5rem; | ||
| 33 | display: flex; | ||
| 34 | |||
| 35 | .date { | ||
| 36 | display: flex; | ||
| 37 | margin-right: 4rem; | ||
| 38 | |||
| 39 | .icon-clock { | ||
| 40 | height: 1.25rem; | ||
| 41 | margin-right: .5rem; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | .desc { | ||
| 47 | max-width: 64rem; | ||
| 48 | margin-top: 2.5rem; | ||
| 49 | line-height: 2; | ||
| 50 | letter-spacing: 1.2px; | ||
| 51 | } | ||
| 52 | |||
| 53 | @media (max-width: 950px) { | ||
| 54 | .box { | ||
| 55 | width: 96%; | ||
| 56 | } | ||
| 57 | } |
src/pages/news-detail/news-detail.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="content"> | ||
| 4 | <div class="top-space"></div> | ||
| 5 | <h2 class="tit">中國平安,與時代同行!</h2> | ||
| 6 | <div @click="toNewsList" class="box back">返回列表頁 ></div> | ||
| 7 | <div class="box dat"> | ||
| 8 | <div class="date"> <img class="icon-clock" src="@/assets/images/news-detail/icon-clock.png" alt=""> 發布時間:2019-09-27</div> | ||
| 9 | <div class="pv">閱讀人數:256人</div> | ||
| 10 | </div> | ||
| 11 | <div class="box desc"> | ||
| 12 | |||
| 13 | 中國平安的發展,與改革開放同步。1988年,中國平安在深圳應運而生,壹路走來,實現了收入、市值、納稅等指標年均逾20%的復合增長,為2億多客戶提供服務。從國內首家股份制保險公司、首個綜合金融集團到全球上市保險公司市值第壹……平安的每壹次突破,都得益於改革開放的政策推動。 | ||
| 14 | <br><br> 新中國成立70周年之際,我們為企業的成就感到自豪,更感恩時代的機遇。服務國計民生是平安的初心與使命,進入新時代,我們進壹步開發“金融+科技”潛能,強化創新驅動;我們發揮企業資源優勢,開展精準扶貧,助力脫貧攻堅。 | ||
| 15 | |||
| 16 | <br><br><br> | ||
| 17 | <strong>打造智慧城市,提供多維度技術支撐</strong> | ||
| 18 | <br><br> 近十年來,平安從參與智慧城市建設入手,構建可覆蓋財政、衛健、交通、司法、農業等21個功能板塊的“1+N”智慧城市壹體化平臺體系,助力各省市克服“城市病”,實現“優政、興業、惠民”的目標。 | ||
| 19 | <br><br> 優政,助力政府提升運轉效率、效能。平安的智慧財政系統已被財政部PPP中心和幾十個省市推廣應用,管理約萬億元資產。這項技術幫地方政府解決負債管理難、融資難、融資貴等問題,提升資產運營效率超50%。平安的智慧司法壹體化平臺與法院系統合作,促進司法體制改革、提高審判效率質量,提升整體司法水平,優化法治營商環境。 | ||
| 20 | <br><br> 興業,服務實體經濟,改善營商環境。我們利用區塊鏈技術,構建了金融貿易供應鏈壹體化平臺,鏈接數百家銀行、上萬個貿易機構和供應鏈企業,支持粵港澳大灣區實現人流、物流、資金流、信息流的互聯互通,促進實體經濟發展,助力深圳中國特色社會主義先行示範區建設。 | ||
| 21 | <br><br> 惠民,提高政府服務效率,優化市民體驗。平安在深圳、廣州等20多個城市落地智慧交通,提供出行暢通、交通安全、運輸監控與交管服務,實施區域平均車速提升12.4%,交通事故率下降10%,重點路段擁堵時間縮短30%。平安的智慧衛健壹體化平臺,集成智能診斷、智能醫保等功能,在近200個城市覆蓋12000多家醫療機構,幫助患者節省問診時間和醫療費用。 | ||
| 22 | |||
| 23 | <br><br><br> | ||
| 24 | <strong>發力精準扶貧,開展全方位資源保障</strong> | ||
| 25 | <br><br> 近年來,平安積極投身扶貧事業,緊扣“精準”二字,聚焦產業扶貧、健康扶貧、教育扶貧,構建並實施“村官、村醫、村教”三村扶貧工程。在集團黨委和全公司1000多個基層黨組織的號召下,累計80多萬平安人參與扶貧工作。 | ||
| 26 | <br><br> 村官工程,幫助鄉村產業升級。平安從種植、養殖業入手,為偏遠貧困地區提供全面的生產、技術和資金支持。在種植業前端,我們首創“平安扶貧保”產業扶貧模式,撬動扶貧貸款,為貧困戶免費提供優種、合作種植、保護性回購等壹條龍服務;在中端,提供遙感、智能識別等技術,提高農業生產力;在後端,提供電銷平臺服務。截至目前,集團及平安銀行為內蒙古、貴州等9省份貧困地區提供扶貧貸款余額逾800億元,集團協銷扶貧產品總額數千萬元,帶動數十萬貧困人口加速脫貧。 | ||
| 27 | <br><br> 村醫工程,幫助打造健康鄉村。平安通過遠程醫療、智能讀片等技術,連接村民與城市的優質醫療資源,提升鄉村醫療服務水平。近兩年來,我們累計升級鄉村衛生所近800所,購置多臺移動醫院設備,組織名醫專家,深入貧困地區壹線開展村民體檢義診活動。通過創新的雲端平臺,實時上傳檢查報告至後方數據中心,及時向村民警示疾病風險,向地方衛生機構通報重大疾病情況,降低因病致貧、因病返貧風險。平安的移動醫院現已行駛數十萬公裏,為近百個鄉村提供免費診療服務。 | ||
| 28 | <br><br> 村教工程,幫助村娃享受智慧教育。平安以雲技術為橋梁,建成“雙師課堂”平臺,將城市優質教育資源引入貧困地區。平安掛牌的智慧小學現有700多所,培訓村小教師近3000名。 | ||
| 29 | <br><br> 不忘初心,久久為功。我們堅信,中國發展的背後,必有壹批屹立全球的優秀民族企業作為支撐,平安有信心、有信念繼續為中華民族偉大復興上下求索、奮發努力。 | ||
| 30 | |||
| 31 | </div> | ||
| 32 | </div> | ||
| 33 | </template> | ||
| 34 | |||
| 35 | <script src="./news-detail.js"></script> | ||
| 36 | <style lang="scss" scoped> | ||
| 37 | @import "./news-detail.scss"; | ||
| 38 | </style> |
src/pages/privacy/privacy.js
0 → 100644
src/pages/privacy/privacy.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .content { | ||
| 4 | font-family: MicrosoftYaHei; | ||
| 5 | color: #4c4948; | ||
| 6 | padding-bottom: 8.5rem; | ||
| 7 | } | ||
| 8 | |||
| 9 | .box { | ||
| 10 | position: relative; | ||
| 11 | } | ||
| 12 | |||
| 13 | .top-space { | ||
| 14 | height: 5rem; | ||
| 15 | } | ||
| 16 | |||
| 17 | .tit { | ||
| 18 | text-align: center; | ||
| 19 | font-size: 18px; | ||
| 20 | font-weight: bold; | ||
| 21 | letter-spacing: 1.8px; | ||
| 22 | } | ||
| 23 | |||
| 24 | .desc { | ||
| 25 | max-width: 64rem; | ||
| 26 | margin-top: 4.25rem; | ||
| 27 | line-height: 2; | ||
| 28 | letter-spacing: 1.2px; | ||
| 29 | } | ||
| 30 | |||
| 31 | |||
| 32 | @media (max-width: 950px) { | ||
| 33 | .box { | ||
| 34 | width: 96%; | ||
| 35 | } | ||
| 36 | } |
src/pages/privacy/privacy.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="content"> | ||
| 4 | <div class="top-space"></div> | ||
| 5 | <h2 class="tit">隱私聲明</h2> | ||
| 6 | <div class="box desc"> | ||
| 7 | |||
| 8 | 中國平安人壽保險(香港)有限公司(以下簡稱“平安”)其中壹項最重要的資產,就是對我們能妥善處理資料而給予的信任和信賴。客戶與潛在客戶期望我們能準確保存他們的資料、保障資料免被操縱和免受錯誤影響、防止被盜用和在未經授權下被公開。我們遵行《個人資料(私隱)條例》和所有相關本地法律,以期為客戶和潛在客戶的資料提供安全保障,並確保員工遵守嚴格保安和保密標準。 | ||
| 9 | <br><br> 本聲明旨在向閣下通知收集閣下個人資料的原因、資料的擬定用途、可能獲轉移閣下個人資料的有關方,以及有關查閱、檢視和修訂閣下個人資料的方法,我們直接促銷和使用“Cookies”的政策。使用本網站即表示閣下接受本隱私聲明的慣例和政策。若閣下反對本聲明的任何慣例和政策,請不要使用本網站提交個人資料予平安。 | ||
| 10 | <br><br> 本網站只為提供壹般資料而設。雖然我們已盡合理努力,確保本網站的資料準確,平安概不保證資料絕對準確,亦概不為資料不準確或由任何錯漏所產生的任何損失或損害而承擔任何責任。如未得平安事前準許,不得復制(作為私人用途例外)或轉發本網站所載的任何資料。 | ||
| 11 | <br><br> 平安確認其就收集、保存、處理或使用個人資料需負上的責任。閣下提供個人資料,純屬自願性質。閣下可選擇不向我們提供所需的個人資料,惟這樣可能導致我們不能與閣下洽商業務或為閣下提供服務。平安不會透過本網站收集任何可識別閣下身份的資料,除非直到閣下購買我們的產品或服務,登記成為會員或基於申請職位而提供個人資料起為始。 | ||
| 12 | <br><br> 本網站和我們的社交媒體平臺不擬供身處限制我們分發資料或使用有關社交媒體平臺的司法管轄區內的人士使用。若此規定適用於閣下,我們建議閣下自行了解和遵從有關限制,平安概不因此而承擔任何責任。 | ||
| 13 | |||
| 14 | <br><br><br> | ||
| 15 | <strong>收集資料的方法</strong> | ||
| 16 | <br><br> 我們將會收集和儲存閣下在本網站輸入的資料,或通過其他渠道向我們提供的資料。我們亦會從聯屬實體、商業夥伴和其他獨立第三方資料源,獲取與閣下有關並合法收集的個人或非個人資料。在閣下到訪本網站時,我們亦收集與閣下所用計算機或其他裝置有關的某些資料。 | ||
| 17 | <br><br> 若閣下在本網站、我們所提供的應用程序或另行通過社交媒體供貨商使用任何社交媒體功能或平臺,我們可能通過有關社交媒體供貨商,按照其有關政策查閱和收集與閣下有關的資料。在使用社交媒體功能時,我們可能會查閱和收集閣下在閣下的社交媒體個人簡述或賬戶選擇提供並列入在內的資料,有關資料包括(但不限於)閣下的姓名、性別、出生日期、電子郵箱、地址、地點等。根據閣下在有關社交媒體供貨商所作的隱私設定,將可限制或封鎖我們對有關資料的查閱。 | ||
| 18 | |||
| 19 | <br><br><br> | ||
| 20 | <strong>收集閣下個人資料的原因和擬定用途</strong> | ||
| 21 | <br><br>收集個人資料乃作以下用途: | ||
| 22 | <li> | ||
| 23 | 處理、實施、執行和實行在本網站上所提供的表格中或閣下可能不時呈交予我們的任何其他文件項下的要求或交易; | ||
| 24 | </li> | ||
| 25 | <li> | ||
| 26 | 設計全新或加強現時我們所提供的產品和服務; | ||
| 27 | </li> | ||
| 28 | <li> | ||
| 29 | 與閣下保持聯系,包括向閣下寄發有關閣下在我們公司任何賬戶或本隱私聲明日後變動的管理通訊; | ||
| 30 | </li> | ||
| 31 | <li> | ||
| 32 | 供平安、金融服務業或我們的相關監管機構作統計或精算研究之用; | ||
| 33 | </li> | ||
| 34 | <li> | ||
| 35 | 供我們作資料配對,內部業務和行政之用; | ||
| 36 | </li> | ||
| 37 | <li> | ||
| 38 | 協助執行法例、警方或其他政府或監管機構調查,以及遵守適用法律和規例所施行的規定,或其他向政府或監管機構承諾之義務; | ||
| 39 | </li> | ||
| 40 | <li> | ||
| 41 | 將我們網站的外觀個人化,提供相關產品的建議,以及在本網站或通過其他渠道進行目標廣告活動; | ||
| 42 | </li> | ||
| 43 | <li> | ||
| 44 | 在收集之時所通知的其他用途;以及與上述任何項目直接有關的其他用途。 | ||
| 45 | </li> | ||
| 46 | <br><br> 若閣下向我們提供個人資料,即表示閣下接受,平安將可因應所需期限留存資料以履行有關用途,而就該等用途而言,有關資料乃在遵守適用法例及規例的情況下收集。平安采用合理保安措施,包括限制親身查閱平安系統內的資料和在轉移敏感資料時進行加密處理,以防止未經許可或意外的查閱、處理、刪除、丟失或使用情況。若不再需要作上述任何用途,將會采取合理程序刪除或銷毀有關資料。 | ||
| 47 | <br><br> 有關我們使用閣下個人資料作宣傳或市場推廣用途的政策,請參閱“使用個人資料作直接促銷用途”壹節。 | ||
| 48 | |||
| 49 | <br><br><br> | ||
| 50 | <strong>誰會取得閣下的個人資料?</strong> | ||
| 51 | |||
| 52 | <br><br>個人資料將保密處理,惟倘法律許可且就符合收集個人資料用途或直接相關用途而披露屬必須時,則可向以下各方提供相關個人資料(有關我們分發閣下個人資料作宣傳或市場推廣用途的政策,請參閱“使用個人資料作直接促銷用途”壹節。): | ||
| 53 | |||
| 54 | <li> | ||
| 55 | 獲授權擔任平安代理且與分銷平安所提供之產品和服務有關的任何人士; | ||
| 56 | </li> | ||
| 57 | <li> | ||
| 58 | 就平安營運以及平安向閣下提供服務相關而提供管理、資料處理、電信、計算機、付款、收債或證券結算、技術外判、電話中心服務、郵寄和印刷服務的任何代理、承包商或第三方服務供貨商(無論在平安內或外); | ||
| 59 | </li> | ||
| 60 | <li> | ||
| 61 | 與提供或促銷保險服務有關的平安任何成員公司; | ||
| 62 | </li> | ||
| 63 | <li> | ||
| 64 | 任何代理、承包商或第三方服務供貨商(無論在平安內或外),包括協助提供服務的公司,例如再保險公司、投資管理公司、索賠調查公司、業界協會或聯盟; | ||
| 65 | </li> | ||
| 66 | <li> | ||
| 67 | |||
| 68 | 協助收集閣下資料或與閣下聯系的其他公司,例如研究調查公司和信貸評級機構,藉以加強我們向閣下所提供的服務;以及 | ||
| 69 | </li> | ||
| 70 | <li> | ||
| 71 | 政府或監管機構或平安公司:(a)根據在該司法管轄區適用於該平安公司的法律和監管義務而必須對其披露的任何人士;或(b)依據該平安公司與相關政府、監管機構或其他人士協議必須對其披露的任何人士。 | ||
| 72 | </li> | ||
| 73 | |||
| 74 | <br><br>就我們因在提供強積金集成信托計劃服務而收集的個人資料,該等個人資料將只會提供予上述人士作提供相關強積金服務的用途。 我們可不時購買業務或出售我們壹項或多項業務(或其部分),而在法律許可的情況下,閣下的個人資料可作為該買賣或建議買賣的壹部分予以轉讓或披露。倘我們購買壹項業務,就該業務所獲得的個人資料將在其可行和允許的情況下根據本隱私聲明處理。 | ||
| 75 | <br><br> | ||
| 76 | <strong>若法例許可,可將閣下的個人資料提供予上述任何壹方,有關各方可位於香港境內或境外。</strong>閣下的資料,將可轉移往香港或任何平安公司所在的司法管轄區,或第三方承包商所在的司法管轄區或第三方承包商在該處為我們提供服務的司法管轄區,並在香港或有關司法管轄區儲存和處理。若閣下向我們提供個人資料,或使用我們的服務或本網站或應用程序,即表示閣下同意將有關資料從閣下的司法管轄區轉移到我們在其之外的設施,或如上文所載轉移到我們與其分享有關資料的第三方。 | ||
| 77 | |||
| 78 | <br><br><br> | ||
| 79 | <strong>查閱個人資料的權利</strong> | ||
| 80 | <br><br>閣下有權: | ||
| 81 | |||
| 82 | <li> | ||
| 83 | 核實平安是否持有閣下的個人資料,並查閱任何該等資料; | ||
| 84 | </li> | ||
| 85 | <li> | ||
| 86 | 要求平安更正任何有關閣下的錯誤個人資料;以及 | ||
| 87 | </li> | ||
| 88 | <li> | ||
| 89 | 就平安有關個人資料的政策和慣例作出查詢。 | ||
| 90 | </li> | ||
| 91 | |||
| 92 | <br>如欲查閱、更正閣下個人資料或有相關的其他要求,可致函到以下地址: | ||
| 93 | <br> 待补充 | ||
| 94 | <br>電子郵箱: | ||
| 95 | <br> 待补充 | ||
| 96 | <br><br>平安有權就因處理任何查閱個人資料的要求收取需要和直接相關的費用。 | ||
| 97 | |||
| 98 | <br><br><br> | ||
| 99 | <strong>使用個人資料作直接促銷用途</strong> | ||
| 100 | <br><br> 除上述用途外,在法律許可的情況下,平安可使用閣下的姓名和聯系資料作宣傳或市場推廣用途,包括向閣下寄發宣傳資料和就產品、服務、建議作直接促銷。 | ||
| 101 | <br><br> 鑒於直接促銷的用途,在法律許可的情況下,我們或會將閣下的個人資料提供予任何上述描述的促銷目標類別、電話中心、市場推廣或研究服務的提供商(無論在平安內或外),從而他們可就其所提供的產品和服務向閣下寄發宣傳資料和進行直接促銷,有關資料可透過郵寄、電子郵件或其他方式送達予閣下。在法律許可的情況下,我們或會將閣下的個人資料提供予任何以上描述的促銷目標類別的提供商(無論在平安內或外)而得益。 | ||
| 102 | <br><br> 就本節用途使用或向本部分受讓方提供閣下的個人資料前,我們可能受法律所規定要取得閣下的書面同意,且在該等情況下,僅會在取得有關書面同意後方就任何宣傳或市場推廣用途使用或提供閣下的個人資料。 | ||
| 103 | <br><br> 平安會使用及提供作上述直接促銷用途的個人資料為閣下的姓名和相關聯系資料;然而,我們可管有更多的個人資料。 | ||
| 104 | <br><br> 如要求閣下同意,而閣下有給予該等同意,閣下可在其後撤回對平安使用並向第三者提供閣下的個人資料作直接促銷用途的同意;此後,平安須停止使用或提供該等資料作直接促銷之用。 | ||
| 105 | <br><br> 如閣下已給予同意但又欲將其撤回,請以書面或電子郵件方式通知我們,書面通知可郵寄到“查閱個人資料的權利”壹節所載地址。任何有關請求應清楚列明該要求相關的個人資料詳情。 | ||
| 106 | |||
| 107 | <br><br><br> | ||
| 108 | <strong>使用Cookies</strong> | ||
| 109 | <br><br> Cookies乃網絡服務器放置在閣下的計算機或其他裝置的獨壹無二標識符,其載有資料,可在其後由向閣下發Cookies的服務器解讀。平安亦可在其維持的網站使用Cookies。所收集的資料(包括但不限於閣下的IP地址(和域名)、瀏覽器軟件、瀏覽器的類別和配置,語言設定、地理位置、操作系統、轉介網站、所瀏覽網頁和內容和到訪期間)將用作編制訪客怎樣到達和瀏覽我們網站的總體統計數字,協助我們了解如何改善閣下到訪我們網站的體驗。有關資料將會以不具名方式收集,並不能識別閣下的身份,除非閣下以會員身份登入,則作別論。我們只會使用有關資料作增進和優化網站。Cookies亦讓我們的網站就閣下和閣下的喜好留下記錄,讓我們可按閣下的需要,為閣下度身設定網站。廣告Cookies亦可讓我們的網站提供與閣下盡可能有關的廣告,如為閣下甄選以興趣為主的廣告,或阻止不斷向閣下展現同壹廣告等。 | ||
| 110 | <br><br> 大部份網頁瀏覽器在最初已設定為可接受Cookies。若閣下不願接收Cookies,可在閣下的瀏覽器設定中關閉有關功能。然而,如關閉功能,閣下將不能盡享我們網站的優點,而若幹功能可能不可以正常運作。 | ||
| 111 | |||
| 112 | <br><br><br> | ||
| 113 | <strong>外部連結</strong> | ||
| 114 | <br><br> 若本網站任何部分載有連接其他網站的連結,有關網站可能並非根據本隱私聲明運作。現建議閣下查閱有關網站的隱私聲明,藉以了解其收集、使用、轉移和披露個人資料的政策。 | ||
| 115 | |||
| 116 | <br><br><br> | ||
| 117 | <strong>本隱私聲明的修訂</strong> | ||
| 118 | <br><br> 平安保留權利可隨時且在無須通知的情況下僅憑知會閣下有關修改、更新或修訂,而增添、修改、更新或修訂本隱私聲明。倘我們決定修改我們的個人資料政策,我們將在我們的網站知會閣下有關修改,從而讓閣下能得悉我們所收集的資料、我們如何使用該資料和在何種情況下會披露該資料。任何有關修改、更新或修訂將在刊登後實時生效。 | ||
| 119 | |||
| 120 | <br><br><br> | ||
| 121 | <strong>其他資料</strong> | ||
| 122 | <br><br> 如閣下對本隱私聲明的任何部分有任何疑問或如欲知悉有關平安的資料保密慣例的更多資料,請隨時循上述聯系途徑與我們聯系。 | ||
| 123 | </div> | ||
| 124 | </div> | ||
| 125 | </template> | ||
| 126 | |||
| 127 | <script src="./privacy.js"></script> | ||
| 128 | <style lang="scss" scoped> | ||
| 129 | @import "./privacy.scss"; | ||
| 130 | </style> |
src/pages/profile/profile.js
0 → 100644
src/pages/profile/profile.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .content { | ||
| 4 | font-family: MicrosoftYaHei; | ||
| 5 | color: #4c4948; | ||
| 6 | padding-bottom: 8.5rem; | ||
| 7 | } | ||
| 8 | |||
| 9 | .box { | ||
| 10 | position: relative; | ||
| 11 | } | ||
| 12 | |||
| 13 | .top-space { | ||
| 14 | height: 5rem; | ||
| 15 | } | ||
| 16 | |||
| 17 | .tit { | ||
| 18 | text-align: center; | ||
| 19 | font-size: 18px; | ||
| 20 | font-weight: bold; | ||
| 21 | letter-spacing: 1.8px; | ||
| 22 | } | ||
| 23 | |||
| 24 | .desc { | ||
| 25 | max-width: 64rem; | ||
| 26 | margin-top: 4.25rem; | ||
| 27 | line-height: 2; | ||
| 28 | letter-spacing: 1.2px; | ||
| 29 | } | ||
| 30 | |||
| 31 | @media (max-width: 950px) { | ||
| 32 | .box { | ||
| 33 | width: 96%; | ||
| 34 | } | ||
| 35 | } |
src/pages/profile/profile.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="content"> | ||
| 4 | <div class="top-space"></div> | ||
| 5 | <h2 class="tit">公司簡介</h2> | ||
| 6 | <div class="box desc"> | ||
| 7 | 中國平安人壽保險股份有限公司成立於2002年,是中國平安保險(集團)股份有限公司旗下的重要成員。截至2017年12月31日,平安人壽註冊資本為338億元,在全國擁有42家分公司(含7家電話銷售中心)及超過3,300個營業網點,壽險代理人達138.6萬名。公司個險、銀保、電銷、互聯網多渠道齊頭並進,實現協同發展,運營管理水平及客戶體驗領先市場,並依托集團“金融+科技”雙驅動戰略,在合規經營、防範風險的前提下,開啟平臺經營新時代,持續提升產品、科技兩大核心競爭力,推動內含價值及規模持續、健康、穩定增長。 | ||
| 8 | <br><br> 公司秉承“保險姓保”理念,聚焦“產品+”戰略,延伸壽險產品邊界。2017年對主力保障型產品“平安福”進行優化升級,提升保障額度;細分客群,開發具有癌癥多次給付、長期殘疾護理、高端終身壽險等保障功能的產品,構建多元化保障供給體系;依托集團資源推出就醫360服務,為客戶提供“診斷- 治療- 康復”全流程解決方案和服務支持,並結合平安RUN健康行項目,打造“上遊健康預防,中遊經濟補償,下遊醫療服務”的健康閉環,滿足客戶全方位的健康風險管理需求。 | ||
| 9 | <br><br> 面對互聯網和新科技帶來的挑戰與機遇,平安人壽運用領先科技,打造未來發展新引擎,升級創新業務模式。以“金管家”APP為核心的移動金融生活平臺,連通線上、線下多場景客戶經營。截至2017年12月31日,“金管家”APP為1.36億註冊用戶提供保險保單、財富增值、豐富活動和健康管理等全方位的金融生活服務。在客戶服務方面,平安人壽以科技創造極致客戶體驗。業內首創“智慧客服”, 依托集團海量客戶數據和AI技術, 構建業務甄別、風險定位、在線自助、空中門店四大能力, 大幅提升保全、理賠、核保的服務時效。70%的理賠客戶可以實現30分鐘內賠付,96%的投保可以實時承保。推出兩個月後,”智慧客服”即累計受理空中業務超2.8萬件,日均受理約400件,最快用時3分鐘。 | ||
| 10 | <br><br> 平安人壽以慈善文化為公司企業文化 , 堅持“執善心,築大業”理念, 以“最受尊敬公司”為願景。百年善業,責任為先。平安人壽始終懷抱感恩之心反哺社會,壹直把企業社會責任作為推動公司可持續發展的動力,聚焦“慈善”文化,弘揚“大愛與責任”。通過開展以“健步行”與“閱讀”為主體的“新生活運動”及教育、扶貧、環境、災難救助等公益事業,專註創造美好明天。 | ||
| 11 | </div> | ||
| 12 | </div> | ||
| 13 | </template> | ||
| 14 | |||
| 15 | <script src="./profile.js"></script> | ||
| 16 | <style lang="scss" scoped> | ||
| 17 | @import "./profile.scss"; | ||
| 18 | </style> |
src/pages/protocol/protocol.js
0 → 100644
src/pages/protocol/protocol.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .content { | ||
| 4 | font-family: MicrosoftYaHei; | ||
| 5 | color: #4c4948; | ||
| 6 | padding-bottom: 8.5rem; | ||
| 7 | } | ||
| 8 | |||
| 9 | .box { | ||
| 10 | position: relative; | ||
| 11 | } | ||
| 12 | |||
| 13 | .top-space { | ||
| 14 | height: 5rem; | ||
| 15 | } | ||
| 16 | |||
| 17 | .tit { | ||
| 18 | text-align: center; | ||
| 19 | font-size: 18px; | ||
| 20 | font-weight: bold; | ||
| 21 | letter-spacing: 1.8px; | ||
| 22 | } | ||
| 23 | |||
| 24 | .desc { | ||
| 25 | max-width: 64rem; | ||
| 26 | margin-top: 4.25rem; | ||
| 27 | line-height: 2; | ||
| 28 | letter-spacing: 1.2px; | ||
| 29 | } | ||
| 30 | |||
| 31 | |||
| 32 | @media (max-width: 950px) { | ||
| 33 | .box { | ||
| 34 | width: 96%; | ||
| 35 | } | ||
| 36 | } |
src/pages/protocol/protocol.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="content"> | ||
| 4 | <div class="top-space"></div> | ||
| 5 | <h2 class="tit">平安壹賬通會員服務協議</h2> | ||
| 6 | <div class="box desc"> | ||
| 7 | <strong>歡迎您使用平安壹賬通服務!</strong> | ||
| 8 | <br><br> “平安壹賬通”是平安集團旗下網絡綜合資產賬戶管理工具,整合了平安及其他金融、非金融機構網上賬戶。用戶只需壹個賬戶、壹套密碼、壹次登錄,即可輕松實現銀行、投資、保險等個人賬戶管理與資產管理的多種需求,提供壹站式便捷服務。 | ||
| 9 | <br><br> 下述“平安壹賬通”的表述,既包括指代平安壹賬通服務,也包括指代平安壹賬通服務的提供者。“用戶”或“會員”是指使用平安壹賬通相關服務的使用人,在本協議中更多地稱為“您”。 | ||
| 10 | |||
| 11 | <br><br> 在使用平安壹賬通服務之前,請您務必審慎閱讀、充分理解《平安壹賬通會員服務協議》(以下簡稱“本協議”),特別是限制或免除責任的相應條款、法律適用和爭議解決條款。限制或免除責任的相應條款以加粗形式提示您註意。未成年人應在法定監護人的陪同下閱讀。您點擊“閱讀並同意註冊協議”按鈕即表示您確認對本協議全部條款含義已充分理解並完全接受。 | ||
| 12 | |||
| 13 | <br><br> 您同意,平安壹賬通有權在必要時修改本協議條款並按法律規定公示,您可以在相關服務頁面查閱最新版本的協議條款。 | ||
| 14 | <br><br> | ||
| 15 | <li>第壹條 協議的範圍</li> | ||
| 16 | <li>第二條 賬戶使用規則</li> | ||
| 17 | <li>第三條 會員的禁止行為</li> | ||
| 18 | <li>第四條 服務的變更、中斷或終止</li> | ||
| 19 | <li>第五條 授權條款</li> | ||
| 20 | <li>第六條 免責條款</li> | ||
| 21 | <li>第七條 知識產權聲明</li> | ||
| 22 | <li>第八條 隱私權保護規則</li> | ||
| 23 | <li>第九條 法律效力</li> | ||
| 24 | <li>第十條 法律適用和爭議解決</li> | ||
| 25 | <br><br> 第壹條 協議的範圍 | ||
| 26 | <br><br> 本協議是您與平安壹賬通服務的提供者深圳平安綜合金融服務有限公司(以下簡稱“平安金服”)之間關於您註冊、登錄、使用平安壹賬通服務(包括但不限於PC端、移動端設備等方式登錄並使用平安壹賬通服務)所訂立的協議。 | ||
| 27 | |||
| 28 | </div> | ||
| 29 | </div> | ||
| 30 | </template> | ||
| 31 | |||
| 32 | <script src="./protocol.js"></script> | ||
| 33 | <style lang="scss" scoped> | ||
| 34 | @import "./protocol.scss"; | ||
| 35 | </style> |
src/pages/terms/terms.js
0 → 100644
src/pages/terms/terms.scss
0 → 100644
| 1 | @import '@/styles/_support'; | ||
| 2 | |||
| 3 | .content { | ||
| 4 | font-family: MicrosoftYaHei; | ||
| 5 | color: #4c4948; | ||
| 6 | padding-bottom: 8.5rem; | ||
| 7 | } | ||
| 8 | |||
| 9 | .box { | ||
| 10 | position: relative; | ||
| 11 | } | ||
| 12 | |||
| 13 | .top-space { | ||
| 14 | height: 5rem; | ||
| 15 | } | ||
| 16 | |||
| 17 | .tit { | ||
| 18 | text-align: center; | ||
| 19 | font-size: 18px; | ||
| 20 | font-weight: bold; | ||
| 21 | letter-spacing: 1.8px; | ||
| 22 | } | ||
| 23 | |||
| 24 | .desc { | ||
| 25 | max-width: 64rem; | ||
| 26 | margin-top: 4.25rem; | ||
| 27 | line-height: 2; | ||
| 28 | letter-spacing: 1.2px; | ||
| 29 | } | ||
| 30 | |||
| 31 | |||
| 32 | @media (max-width: 950px) { | ||
| 33 | .box { | ||
| 34 | width: 96%; | ||
| 35 | } | ||
| 36 | } |
src/pages/terms/terms.vue
0 → 100644
| 1 | |||
| 2 | <template> | ||
| 3 | <div class="content"> | ||
| 4 | <div class="top-space"></div> | ||
| 5 | <h2 class="tit">使用條款</h2> | ||
| 6 | <div class="box desc"> | ||
| 7 | |||
| 8 | <strong>使用條件</strong> | ||
| 9 | <br><br> 如閣下使用本網站,即表示閣下完全同意以下的使用條款,並不附加其他限制或規條。在使用本網站前,請先仔細閱讀各條款。有關條款可能隨時作出更改,並在本頁刊登。閣下須遵從有關更改,因此閣下應該定期參閱本頁,以得知相關的最新條款。 | ||
| 10 | |||
| 11 | <br><br><br> | ||
| 12 | <strong>免責聲明</strong> | ||
| 13 | <br><br> 本網站所載資料是在允許的範圍內盡量依據適用之法律,(1)以“現狀”形式提供,且並不帶有任何明示或隱含的保證,中國平安人壽保險(香港)有限公司(以下簡稱“平安”) 就所有明示或隱含保證作出免責聲明,而此等保證範圍包括但不限於隱含的可銷售性和特殊用途合適性保證 ; (2) 平安並不保證網站或所載資料的功能不會中斷或不含錯誤,也不保證不妥當之處必被更正,或本網站所設之服務器不受病毒或其他有害成份影響 ; 以及(3) 平安不會就使用本網站內資料、或因使用此等資料之正確性、準確性、可靠性或其他方面所導致的後果作出保證或其他聲明。在此所載的資料和說明只可作壹般性參考資料,並非完全旨在提供適用於各產品和服務的所有條款和不適用範圍。詳細資料請參閱實際保單或有關產品或服務之協議。 | ||
| 14 | <br><br> 本網站可能會接駁到不屬於平安所運作的其他網站。平安不會就第三者網站的有效性、內容或準確性承擔任何責任; 並且不會就使用第三者連結作出任何保證,包括明示或暗示。接駁到此等網站並不代表平安已批核或贊同此等網站或其內容。接駁到此等網站並不代表平安已批核或贊同此等網站或其內容。閣下知道和同意瀏覽這些網站時自己所承受的風險。 | ||
| 15 | |||
| 16 | <br><br><br> | ||
| 17 | <strong>法律責任的限制</strong> | ||
| 18 | <br><br> 平安会在合理的情况下尽力在本网站刊载准确和最新的资料,但亦有可能出现错误或遗漏。平安在允许的范围内尽量依据适用法律,均不会就本网站内容的准确性在任何情况下,作出保证或声明。平安或任何参与本网站创作、制作或发放网内信息的人士也不会因使用或不能使用本网站内资料而引起的直接、附带、随之发生的、间接或惩罚性赔偿而要向阁下负责,即使平安或平安的授权代表已被通知此等赔偿的可能性。在允许的范围内尽量依据适用之法律,无论在任何情况下,平安就所有赔偿、损失和其他行动对阁下所需负上的整体责任不会超出任何阁下可能曾就连接本网站所付出的金额。 | ||
| 19 | <br><br> 平安并不会就阁下连接、使用或浏览本网站、或由本网站下载任何资料、数据、文字、影像、视像或音效而对阁下的计算机设备或其他财产造成的损害或受病毒的影响而负上任何责任。 | ||
| 20 | |||
| 21 | <br><br><br> | ||
| 22 | <strong>使用資料的限制</strong> | ||
| 23 | <br><br> 本網站由平安擁有和運作。除非獲得平安明確允許,否則不得將本網站或任何平安擁有、運作、許可或控制的網站所載的資料以任何方式復印、復制、出版、更改、儲存在恢復系統、用於創作衍生作品、上載、刊登、傳送(透過任何形式或透過任何渠道)、發放或在任何情況用於公眾或商業用途。閣下可以下載本網站所顯示資料供閣下使用,惟閣下必須保留資料內所有版權和其他擁有權通知。未經平安書面批準,閣下不可發放、更改、傳送、再使用、再刊登或使用本網站的內容(包括文字、影像、音效和視像)作公眾或商業用途。 | ||
| 24 | <br><br> 平安並不保證或聲明閣下使用顯示於本網站的資料不會侵犯第三者權利。 | ||
| 25 | |||
| 26 | <br><br><br> | ||
| 27 | <strong>司法事項</strong> | ||
| 28 | <br><br> 除非在此明確說明,否則平安並未就本網址所載資料是否適合於或可供使用於任何地方作出聲明。選擇連接本網站人士是其本身采取主動進行連接,並負有責任遵守當地法律。 | ||
| 29 | <br><br> 除非在此明確說明,否則本網站所載資料並不代表平安銳意推售平安所提供之任何證券、任何保險產品或其他產品或服務的銷售要約或購買建議。如果在某司法 管轄範圍下,證券、保險產品或其他產品或服務的要約或建議、購買或銷售觸犯證券法、保險法或其他法例,此等產品和服務不會在該司法範圍由平安提供,即使 由平安提供也不會生效。某些產品和服務可能不會在所有司法範圍提供。 | ||
| 30 | |||
| 31 | <br><br><br> | ||
| 32 | <strong>資料擁有權</strong> | ||
| 33 | <br><br> 任何數據,除了個人資料外,其他經電子郵件或其他途徑透過本網站傳送至平安的資料,包括數據、查詢、意見或建議,會被當作非機密性和非專利的資料,並成為平安擁有的財產。這些資料可能會被用作任何用途,包括但不限於再制作、建議、公開、傳送、出版、廣播和刊登。平安可自由使用任何利用其他途徑透過本網 站傳送至平安的訊息,包括意念、概念、知識或技術用作任何用途,包括但不限於產品之開發和市場拓展。作為本部分的條款,閣下透過本網站或其他網站傳送資料(個人資料以外)至 平安,閣下將放棄所有可能適用於閣下對有關資料的權利。 | ||
| 34 | |||
| 35 | <br><br><br> | ||
| 36 | <strong>知識產權</strong> | ||
| 37 | <br><br> 所有商标、服务标志、商品名称、标识和功能标志拥有权均属平安所有。除非在这些条款明确说明和在适用的法例允许下,否则未得平安的书面批准,本网站所载 任何内容均不应诠释为无论是以暗示、不容反悔法或其他形式之准予、任何特许或权利以使用平安的知识产权,包括但不限于本网站上显示的任何商标或标签。除在此网站列明可行的情况外,阁下绝对不得使用本网站上所显示的商标或卷标,或本网站上任何其他内容。 | ||
| 38 | |||
| 39 | <br><br><br> | ||
| 40 | <strong>軟件使用權</strong> | ||
| 41 | <br><br> 此網站所有或提供予閣下的任何軟件,平安給予閣下非全部、有限和個人許可,並只可在個人和非商業的情況下下載和使用有關軟件。我們不賦予軟件的其他權利。所有的權利,包括軟件的知識產權屬平安的財產、相關持牌者或軟件的擁有者。除非法律允許,否則閣下不能對軟件作出機械顛倒、程序逆轉、更改或損害。 | ||
| 42 | |||
| 43 | <br><br><br> | ||
| 44 | <strong>保安提示</strong> | ||
| 45 | <br><br> 平安非常重視使用本網站人士資料的安全和保密問題。雖然在公開媒介如互聯網進行商業活動時固然存在風險,我們已實行了措施以減低這些風險。為保護和保障閣下的隱私,本網站采用先進的保安系統,使用Netscape Navigator version 4.0 或 Microsoft Internet Explorer version 4.0 或更先進的版本。 | ||
| 46 | |||
| 47 | <br><br><br> | ||
| 48 | <strong>受監管的法例和管轄權</strong> | ||
| 49 | <br><br> 此使用條款受中華人民共和國香港特別行政區(簡稱“香港”)法律監管,而各方同意提交予香港法院作為專有管轄。 | ||
| 50 | |||
| 51 | </div> | ||
| 52 | </div> | ||
| 53 | </template> | ||
| 54 | |||
| 55 | |||
| 56 | <script src="./terms.js"></script> | ||
| 57 | <style lang="scss" scoped> | ||
| 58 | @import "./terms.scss"; | ||
| 59 | </style> |
src/router.js
0 → 100644
| 1 | import Vue from 'vue' | ||
| 2 | import Router from 'vue-router' | ||
| 3 | import Index from './pages/index/index.vue' | ||
| 4 | |||
| 5 | Vue.use(Router) | ||
| 6 | |||
| 7 | /** | ||
| 8 | * 重写路由的push方法 | ||
| 9 | */ | ||
| 10 | const routerPush = Router.prototype.push | ||
| 11 | Router.prototype.push = function push(location) { | ||
| 12 | return routerPush.call(this, location).catch(error => error) | ||
| 13 | } | ||
| 14 | |||
| 15 | const routes = [ | ||
| 16 | |||
| 17 | { | ||
| 18 | path: '/', | ||
| 19 | name: 'index', | ||
| 20 | component: Index, | ||
| 21 | meta: { | ||
| 22 | title: '平安人寿保险官网' | ||
| 23 | } | ||
| 24 | }, | ||
| 25 | { | ||
| 26 | path: '/profile', | ||
| 27 | name: 'profile', | ||
| 28 | component: () => import('./pages/profile/profile.vue'), | ||
| 29 | meta: { | ||
| 30 | title: '公司简介' | ||
| 31 | } | ||
| 32 | }, | ||
| 33 | { | ||
| 34 | path: '/terms', | ||
| 35 | name: 'terms', | ||
| 36 | component: () => import('./pages/terms/terms.vue'), | ||
| 37 | meta: { | ||
| 38 | title: '使用条款' | ||
| 39 | } | ||
| 40 | }, | ||
| 41 | { | ||
| 42 | path: '/privacy', | ||
| 43 | name: 'privacy', | ||
| 44 | component: () => import('./pages/privacy/privacy.vue'), | ||
| 45 | meta: { | ||
| 46 | title: '隐私政策' | ||
| 47 | } | ||
| 48 | }, | ||
| 49 | { | ||
| 50 | path: '/protocol', | ||
| 51 | name: 'protocol', | ||
| 52 | component: () => import('./pages/protocol/protocol.vue'), | ||
| 53 | meta: { | ||
| 54 | title: '平安壹賬通會員服務協議' | ||
| 55 | } | ||
| 56 | }, | ||
| 57 | |||
| 58 | { | ||
| 59 | path: '/news/detail', | ||
| 60 | name: 'newsDetail', | ||
| 61 | component: () => import('./pages/news-detail/news-detail.vue'), | ||
| 62 | meta: { | ||
| 63 | title: '' | ||
| 64 | } | ||
| 65 | }, | ||
| 66 | |||
| 67 | |||
| 68 | { | ||
| 69 | path: '/demo', | ||
| 70 | name: 'demo', | ||
| 71 | component: () => import('./pages/demo/index.vue'), | ||
| 72 | meta: { | ||
| 73 | title: '' | ||
| 74 | } | ||
| 75 | }, | ||
| 76 | { | ||
| 77 | path: '/about', | ||
| 78 | name: 'about', | ||
| 79 | component: () => import('./pages/About.vue'), | ||
| 80 | meta: { | ||
| 81 | title: '' | ||
| 82 | } | ||
| 83 | }, | ||
| 84 | // 404页面 | ||
| 85 | { | ||
| 86 | path: '*', // * 表示上面路径匹配不到的都显示这个页面 | ||
| 87 | name: '404', | ||
| 88 | component: Index | ||
| 89 | }, | ||
| 90 | ] | ||
| 91 | |||
| 92 | // add route path | ||
| 93 | routes.forEach(route => { | ||
| 94 | route.path = route.path || '/' + (route.name || ''); | ||
| 95 | }); | ||
| 96 | |||
| 97 | const router = new Router({ | ||
| 98 | routes, | ||
| 99 | // mode: 'history', | ||
| 100 | }); | ||
| 101 | |||
| 102 | router.beforeEach((to, from, next) => { | ||
| 103 | const title = to.meta && to.meta.title; | ||
| 104 | if (title) { | ||
| 105 | document.title = title; | ||
| 106 | } | ||
| 107 | next(); | ||
| 108 | }); | ||
| 109 | |||
| 110 | export default router; |
src/store/actions.js
0 → 100644
| 1 | // import request from '@/service' | ||
| 2 | |||
| 3 | // export const banner = async (store, params) => { | ||
| 4 | // return await request.get('/api/v1/get_banner', { params: params }) | ||
| 5 | // } | ||
| 6 | |||
| 7 | // export const categories = async (store, params) => { | ||
| 8 | // return await request.get('/japi/v1/categories', { params: params }) | ||
| 9 | // } | ||
| 10 | |||
| 11 | // export const recommend = async (store, params) => { | ||
| 12 | // return await request.post('/wapi/v1/query', params) | ||
| 13 | // } | ||
| 14 | |||
| 15 | // export const entries = async (store, params) => { | ||
| 16 | // return await request.get('/tapi/v1/get_entry_by_rank', { params: params }) | ||
| 17 | // } | ||
| 18 | |||
| 19 | // export const getListByLastTime = async (store, params) => { | ||
| 20 | // return await request.get('/xapi/v1/getListByLastTime', { params: params }) | ||
| 21 | // } | ||
| 22 | |||
| 23 | |||
| 24 | // export const increment = ({ | ||
| 25 | // commit | ||
| 26 | // }) => { | ||
| 27 | // commit('INCREMENT') | ||
| 28 | // } | ||
| 29 | |||
| 30 | // export const pcorphone = ({ | ||
| 31 | // commit | ||
| 32 | // }) => { | ||
| 33 | // commit('PCORPHONE') | ||
| 34 | // } |
src/store/index.js
0 → 100644
src/store/mutations.js
0 → 100644
src/store/state.js
0 → 100644
src/styles/_fonticon.scss
0 → 100644
| 1 | /* 图片字体 */ | ||
| 2 | @font-face { | ||
| 3 | font-family: 'iconfont'; | ||
| 4 | src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAASEAAsAAAAACSAAAAQ3AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDSAqFGIQnATYCJAMYCw4ABCAFhG0HVBvZBxGVnNvIfhzYDV+BAe9wtJiGONTGYuHBZ/Oh77Q3OxupItOeFFTcQjpRXwK+AIbn08ne766XppsiwRKPksQTj7AO4xAOv3fOAdsJc0KNZO3Io89Lf8K9BkY+ce+4df4Dms+yXMacNNbEAOOAAtrbF1mBxAlqy/Dq8uqwrgMBiPGAD4g6dbgGQhSseQRAKstK8iFMmFAVBMHSdsFWFpkNHhYzhbkEYJb3efIGQUQIDCaFtXQ0l1KEhOfKV+G019Ary7GgbzgHAGEXUIAPABZIZ6GrGTSI+oBia7/A4gVAioWBeq58vvHlkJeNr8INBhIyy0dwwV8esJg4MBAgfGCVlKUNj/HguZIawGrqjZgLPHg5xACK1Y2YCwy8Cpdclo4/YIMIcBLANZh9YGkIPHta2NorTKxUSlUNV7Koz2zswo0mRfNNRs9fbFq8YJr5uEXLWo7cEd+6pbl9W3v3rj4g7tzRpU+7HauR0YbmJ2+dalLELZy6ude0uGh+75Zp5iXFCxZMW2Q+0IQOKsa7SMJIKH18h3y9hWY+mN4tEtW0bYT2memWpk1db7L81tQ7dgs3isUbt1rrl0kU0yy1Sza7ZCw0m4lCIzFMF2ww15+Qp1u43sRk/hJT7YJN5uaLluolPZSTvq1m4vmbgR7veM116OjBGp2K21oMbkRGnvqglnCLVharuAM6gl+toTNYPZs5doyZDXyHbx/RSvZMt6tNtx7RlzkWlcysWQySV2I+Pio008Np8mQvL/j0CEVLLIItloiEIPIFnCBDN7ZpC6n3i/erE0uXICT/t+269rVrjx4de+wrwynfjo1BaN/tXQmzJ3wIF9krghUHqN1eFB4fMvuCROrnvVwdkUeWLff2k70IiO8fs2yOabXpHHdlvX+A5rmK6dx4piXlbHunib+iNeVM+UnXFvWZjR2uleVF/jsbK12wo8OWDpY+TRH0jP8syLs0WIlOAIDhFHOP+gIA1TF3kCOBOcbaj9FjgYCJ97CEFvwt35GfKZ2Yq4j5JiGUsAC+Juu7saSZavDK1Wgs/jeaagB/Q0WUsuYutTOdIKDlmTLhATa03MskN0+G0t1vcjyETCMMArY4CLmQiuaDSSIETSgem7dBu0/G6o2REgGeJiAQSrvAkDsKSukyiaU9Bo+Zd+BTZgwxXdZHSrjFro4ZoqKlgj+VSe4UsdaVX3iDfgeR41KP8UIuNkCBfgHpxBUd8hArGj760FgVcZkjpaLbEAJTbWYHWTeltfaNvz9X9KJNIcfBSrIMhApapMAfKSOxjnJ6V6vM+29AewuEXNFR432BrLCDk0B+AhqQrqquUceljG7woR00qhQ7i5OxiKRiBwSIMlJbPMkBqdoo7RDuNfyZblxT1WZ6TbzLfbBZ53QYQglLeIRPBBB9hPTHH9oLMhQ5r5ipDFwwMRwxRezrfzAAAA==') | ||
| 5 | format('woff2'); | ||
| 6 | } | ||
| 7 | |||
| 8 | .iconfont { | ||
| 9 | font-family: 'iconfont' !important; | ||
| 10 | font-size: 16px; | ||
| 11 | font-style: normal; | ||
| 12 | -webkit-font-smoothing: antialiased; | ||
| 13 | -moz-osx-font-smoothing: grayscale; | ||
| 14 | } | ||
| 15 | |||
| 16 | .iconrefresh:before { | ||
| 17 | content: '\e874'; | ||
| 18 | } | ||
| 19 | |||
| 20 | .iconempty:before { | ||
| 21 | content: '\e6a6'; | ||
| 22 | } | ||
| 23 | .iconclose:before { | ||
| 24 | content: '\e849'; | ||
| 25 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/styles/_mixins.scss
0 → 100755
| 1 | /** | ||
| 2 | * ------------------------------------------------------------------ | ||
| 3 | * Sass Minxins | ||
| 4 | * | ||
| 5 | * 参考收集: | ||
| 6 | * https://github.com/twbs/bootstrap-sass/tree/master/assets/stylesheets/bootstrap/mixins | ||
| 7 | * ------------------------------------------------------------------ | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | // 文字截取 | ||
| 12 | @mixin text-overflow() { | ||
| 13 | overflow: hidden; | ||
| 14 | white-space: normal; | ||
| 15 | text-overflow: ellipsis; | ||
| 16 | word-break: break-all; | ||
| 17 | word-wrap: normal; | ||
| 18 | } | ||
| 19 | |||
| 20 | @mixin word-break() { | ||
| 21 | word-break: break-all; | ||
| 22 | word-wrap: break-word; | ||
| 23 | white-space: normal; | ||
| 24 | } | ||
| 25 | |||
| 26 | // No wrap | ||
| 27 | @mixin no-wrap() { | ||
| 28 | word-break: normal; | ||
| 29 | word-wrap: normal; | ||
| 30 | white-space: nowrap; | ||
| 31 | } | ||
| 32 | |||
| 33 | // 清除浮动 | ||
| 34 | @mixin clearfix() { | ||
| 35 | &:before, | ||
| 36 | &:after { | ||
| 37 | content: " "; // 1 | ||
| 38 | display: table; // 2 | ||
| 39 | } | ||
| 40 | &:after { | ||
| 41 | clear: both; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | // Single side border-radius | ||
| 46 | @mixin border-top-radius($radius) { | ||
| 47 | border-top-right-radius: $radius; | ||
| 48 | border-top-left-radius: $radius; | ||
| 49 | } | ||
| 50 | |||
| 51 | @mixin border-right-radius($radius) { | ||
| 52 | border-bottom-right-radius: $radius; | ||
| 53 | border-top-right-radius: $radius; | ||
| 54 | } | ||
| 55 | |||
| 56 | @mixin border-bottom-radius($radius) { | ||
| 57 | border-bottom-right-radius: $radius; | ||
| 58 | border-bottom-left-radius: $radius; | ||
| 59 | } | ||
| 60 | |||
| 61 | @mixin border-left-radius($radius) { | ||
| 62 | border-bottom-left-radius: $radius; | ||
| 63 | border-top-left-radius: $radius; | ||
| 64 | } | ||
| 65 | |||
| 66 | // Center-align a block level element | ||
| 67 | @mixin center-block() { | ||
| 68 | display: block; | ||
| 69 | margin-left: auto; | ||
| 70 | margin-right: auto; | ||
| 71 | } | ||
| 72 | |||
| 73 | // CSS image replacement | ||
| 74 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 | ||
| 75 | @mixin hide-text() { | ||
| 76 | font-size: 0; | ||
| 77 | line-height: 0; | ||
| 78 | color: transparent; | ||
| 79 | text-shadow: none; | ||
| 80 | background-color: transparent; | ||
| 81 | border: 0; | ||
| 82 | } |
src/styles/_support.scss
0 → 100755
| 1 | /** | ||
| 2 | * ------------------------------------------------------------------ | ||
| 3 | * 支持文件 | ||
| 4 | * 需要引用的地方均需要加上这个支持文件 | ||
| 5 | * | ||
| 6 | * ------------------------------------------------------------------ | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | @import "mixins"; | ||
| 11 | |||
| 12 | @import "var"; | ||
| 13 | |||
| 14 | @import "utils"; | ||
| 15 | |||
| 16 | // 图标字体 | ||
| 17 | @import "fonticon"; | ||
| 18 | |||
| 19 | // 字体引入 | ||
| 20 | @import './../assets/fonts/font.scss' |
src/styles/_utils.scss
0 → 100755
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | .bis { | ||
| 5 | background-repeat: no-repeat; | ||
| 6 | background-size: 100% 100%; | ||
| 7 | } | ||
| 8 | |||
| 9 | |||
| 10 | //flex 布局和 子元素 对其方式 | ||
| 11 | .fl { | ||
| 12 | display: flex; | ||
| 13 | } | ||
| 14 | |||
| 15 | .fj { | ||
| 16 | display: flex; | ||
| 17 | justify-content: space-between; | ||
| 18 | } | ||
| 19 | |||
| 20 | //水平和垂直居中 | ||
| 21 | .fcc { | ||
| 22 | display: flex; | ||
| 23 | justify-content: center; | ||
| 24 | align-items: center; | ||
| 25 | } | ||
| 26 | |||
| 27 | // 为元素设定的宽度和高度决定了元素的边框盒。 | ||
| 28 | .bb { | ||
| 29 | box-sizing: border-box; | ||
| 30 | } | ||
| 31 | |||
| 32 | // 满屏 | ||
| 33 | .fullp { | ||
| 34 | width: 100%; | ||
| 35 | height: 100%; | ||
| 36 | } | ||
| 37 |
src/styles/_var.scss
0 → 100755
| 1 | /** | ||
| 2 | * ------------------------------------------------------------------ | ||
| 3 | * Sass 变量 | ||
| 4 | * | ||
| 5 | * ------------------------------------------------------------------ | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | |||
| 9 | // Margin | ||
| 10 | $marginTopSmaller: 20px; | ||
| 11 | $marginTopSmall: 30px; | ||
| 12 | $marginTopMedium: 40px; | ||
| 13 | $marginTopLarge: 60px; | ||
| 14 | $marginTopLarger: 80px; | ||
| 15 | |||
| 16 | // Padding | ||
| 17 | $paddingTopSmaller: 20px; | ||
| 18 | $paddingTopSmall: 30px; | ||
| 19 | $paddingTopMedium: 40px; | ||
| 20 | $paddingTopLarge: 60px; | ||
| 21 | $paddingTopLarger: 80px; | ||
| 22 | |||
| 23 | // Color | ||
| 24 | $colorBlue: #20A0FF; | ||
| 25 | $colorGreen: #13CE66; | ||
| 26 | $colorGray: #475669; | ||
| 27 | $colorBlack: #000; | ||
| 28 | $colorRed: #FF4949; | ||
| 29 | $colorYellow: #F7BA2A; | ||
| 30 | |||
| 31 | $color: #787878; | ||
| 32 | $colorLink: #1D8CE0; | ||
| 33 | |||
| 34 | $backGroundColor: #fff; | ||
| 35 | |||
| 36 | // Font | ||
| 37 | $fontSize: 32px; | ||
| 38 | $fontSizeSmall: 28px; | ||
| 39 | $fontSizeSmaller: 24px; | ||
| 40 | $fontSizeLarge: 36px; | ||
| 41 | $fontSizeLarger: 44px; |
src/utils/date.js
0 → 100755
| 1 | /** | ||
| 2 | * @version: 1.0 Alpha-1 | ||
| 3 | * @author: Coolite Inc. http://www.coolite.com/ | ||
| 4 | * @date: 2008-05-13 | ||
| 5 | * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved. | ||
| 6 | * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. | ||
| 7 | * @website: http://www.datejs.com/ | ||
| 8 | */ | ||
| 9 | |||
| 10 | Date.CultureInfo = { | ||
| 11 | name: "en-US", | ||
| 12 | englishName: "English (United States)", | ||
| 13 | nativeName: "English (United States)", | ||
| 14 | dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], | ||
| 15 | abbreviatedDayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], | ||
| 16 | shortestDayNames: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], | ||
| 17 | firstLetterDayNames: ["S", "M", "T", "W", "T", "F", "S"], | ||
| 18 | monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], | ||
| 19 | abbreviatedMonthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], | ||
| 20 | amDesignator: "AM", | ||
| 21 | pmDesignator: "PM", | ||
| 22 | firstDayOfWeek: 0, | ||
| 23 | twoDigitYearMax: 2029, | ||
| 24 | dateElementOrder: "mdy", | ||
| 25 | formatPatterns: { | ||
| 26 | shortDate: "M/d/yyyy", | ||
| 27 | longDate: "dddd, MMMM dd, yyyy", | ||
| 28 | shortTime: "h:mm tt", | ||
| 29 | longTime: "h:mm:ss tt", | ||
| 30 | fullDateTime: "dddd, MMMM dd, yyyy h:mm:ss tt", | ||
| 31 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", | ||
| 32 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", | ||
| 33 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", | ||
| 34 | monthDay: "MMMM dd", | ||
| 35 | yearMonth: "MMMM, yyyy" | ||
| 36 | }, | ||
| 37 | regexPatterns: { | ||
| 38 | jan: /^jan(uary)?/i, | ||
| 39 | feb: /^feb(ruary)?/i, | ||
| 40 | mar: /^mar(ch)?/i, | ||
| 41 | apr: /^apr(il)?/i, | ||
| 42 | may: /^may/i, | ||
| 43 | jun: /^jun(e)?/i, | ||
| 44 | jul: /^jul(y)?/i, | ||
| 45 | aug: /^aug(ust)?/i, | ||
| 46 | sep: /^sep(t(ember)?)?/i, | ||
| 47 | oct: /^oct(ober)?/i, | ||
| 48 | nov: /^nov(ember)?/i, | ||
| 49 | dec: /^dec(ember)?/i, | ||
| 50 | sun: /^su(n(day)?)?/i, | ||
| 51 | mon: /^mo(n(day)?)?/i, | ||
| 52 | tue: /^tu(e(s(day)?)?)?/i, | ||
| 53 | wed: /^we(d(nesday)?)?/i, | ||
| 54 | thu: /^th(u(r(s(day)?)?)?)?/i, | ||
| 55 | fri: /^fr(i(day)?)?/i, | ||
| 56 | sat: /^sa(t(urday)?)?/i, | ||
| 57 | future: /^next/i, | ||
| 58 | past: /^last|past|prev(ious)?/i, | ||
| 59 | add: /^(\+|aft(er)?|from|hence)/i, | ||
| 60 | subtract: /^(\-|bef(ore)?|ago)/i, | ||
| 61 | yesterday: /^yes(terday)?/i, | ||
| 62 | today: /^t(od(ay)?)?/i, | ||
| 63 | tomorrow: /^tom(orrow)?/i, | ||
| 64 | now: /^n(ow)?/i, | ||
| 65 | millisecond: /^ms|milli(second)?s?/i, | ||
| 66 | second: /^sec(ond)?s?/i, | ||
| 67 | minute: /^mn|min(ute)?s?/i, | ||
| 68 | hour: /^h(our)?s?/i, | ||
| 69 | week: /^w(eek)?s?/i, | ||
| 70 | month: /^m(onth)?s?/i, | ||
| 71 | day: /^d(ay)?s?/i, | ||
| 72 | year: /^y(ear)?s?/i, | ||
| 73 | shortMeridian: /^(a|p)/i, | ||
| 74 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, | ||
| 75 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, | ||
| 76 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, | ||
| 77 | timeContext: /^\s*(\:|a(?!u|p)|p)/i | ||
| 78 | }, | ||
| 79 | timezones: [{ | ||
| 80 | name: "UTC", | ||
| 81 | offset: "-000" | ||
| 82 | }, { | ||
| 83 | name: "GMT", | ||
| 84 | offset: "-000" | ||
| 85 | }, { | ||
| 86 | name: "EST", | ||
| 87 | offset: "-0500" | ||
| 88 | }, { | ||
| 89 | name: "EDT", | ||
| 90 | offset: "-0400" | ||
| 91 | }, { | ||
| 92 | name: "CST", | ||
| 93 | offset: "-0600" | ||
| 94 | }, { | ||
| 95 | name: "CDT", | ||
| 96 | offset: "-0500" | ||
| 97 | }, { | ||
| 98 | name: "MST", | ||
| 99 | offset: "-0700" | ||
| 100 | }, { | ||
| 101 | name: "MDT", | ||
| 102 | offset: "-0600" | ||
| 103 | }, { | ||
| 104 | name: "PST", | ||
| 105 | offset: "-0800" | ||
| 106 | }, { | ||
| 107 | name: "PDT", | ||
| 108 | offset: "-0700" | ||
| 109 | }] | ||
| 110 | }; | ||
| 111 | (function () { | ||
| 112 | var $D = Date, | ||
| 113 | $P = $D.prototype, | ||
| 114 | $C = $D.CultureInfo, | ||
| 115 | p = function (s, l) { | ||
| 116 | if (!l) { | ||
| 117 | l = 2; | ||
| 118 | } | ||
| 119 | return ("000" + s).slice(l * -1); | ||
| 120 | }; | ||
| 121 | $P.clearTime = function () { | ||
| 122 | this.setHours(0); | ||
| 123 | this.setMinutes(0); | ||
| 124 | this.setSeconds(0); | ||
| 125 | this.setMilliseconds(0); | ||
| 126 | return this; | ||
| 127 | }; | ||
| 128 | $P.setTimeToNow = function () { | ||
| 129 | var n = new Date(); | ||
| 130 | this.setHours(n.getHours()); | ||
| 131 | this.setMinutes(n.getMinutes()); | ||
| 132 | this.setSeconds(n.getSeconds()); | ||
| 133 | this.setMilliseconds(n.getMilliseconds()); | ||
| 134 | return this; | ||
| 135 | }; | ||
| 136 | $D.today = function () { | ||
| 137 | return new Date().clearTime(); | ||
| 138 | }; | ||
| 139 | $D.compare = function (date1, date2) { | ||
| 140 | if (isNaN(date1) || isNaN(date2)) { | ||
| 141 | throw new Error(date1 + " - " + date2); | ||
| 142 | } else if (date1 instanceof Date && date2 instanceof Date) { | ||
| 143 | return (date1 < date2) ? -1 : (date1 > date2) ? 1 : 0; | ||
| 144 | } else { | ||
| 145 | throw new TypeError(date1 + " - " + date2); | ||
| 146 | } | ||
| 147 | }; | ||
| 148 | $D.equals = function (date1, date2) { | ||
| 149 | return (date1.compareTo(date2) === 0); | ||
| 150 | }; | ||
| 151 | $D.getDayNumberFromName = function (name) { | ||
| 152 | var n = $C.dayNames, | ||
| 153 | m = $C.abbreviatedDayNames, | ||
| 154 | o = $C.shortestDayNames, | ||
| 155 | s = name.toLowerCase(); | ||
| 156 | for (var i = 0; i < n.length; i++) { | ||
| 157 | if (n[i].toLowerCase() == s || m[i].toLowerCase() == s || o[i].toLowerCase() == s) { | ||
| 158 | return i; | ||
| 159 | } | ||
| 160 | } | ||
| 161 | return -1; | ||
| 162 | }; | ||
| 163 | $D.getMonthNumberFromName = function (name) { | ||
| 164 | var n = $C.monthNames, | ||
| 165 | m = $C.abbreviatedMonthNames, | ||
| 166 | s = name.toLowerCase(); | ||
| 167 | for (var i = 0; i < n.length; i++) { | ||
| 168 | if (n[i].toLowerCase() == s || m[i].toLowerCase() == s) { | ||
| 169 | return i; | ||
| 170 | } | ||
| 171 | } | ||
| 172 | return -1; | ||
| 173 | }; | ||
| 174 | $D.isLeapYear = function (year) { | ||
| 175 | return ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0); | ||
| 176 | }; | ||
| 177 | $D.getDaysInMonth = function (year, month) { | ||
| 178 | return [31, ($D.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; | ||
| 179 | }; | ||
| 180 | $D.getTimezoneAbbreviation = function (offset) { | ||
| 181 | var z = $C.timezones, | ||
| 182 | p; | ||
| 183 | for (var i = 0; i < z.length; i++) { | ||
| 184 | if (z[i].offset === offset) { | ||
| 185 | return z[i].name; | ||
| 186 | } | ||
| 187 | } | ||
| 188 | return null; | ||
| 189 | }; | ||
| 190 | $D.getTimezoneOffset = function (name) { | ||
| 191 | var z = $C.timezones, | ||
| 192 | p; | ||
| 193 | for (var i = 0; i < z.length; i++) { | ||
| 194 | if (z[i].name === name.toUpperCase()) { | ||
| 195 | return z[i].offset; | ||
| 196 | } | ||
| 197 | } | ||
| 198 | return null; | ||
| 199 | }; | ||
| 200 | $P.clone = function () { | ||
| 201 | return new Date(this.getTime()); | ||
| 202 | }; | ||
| 203 | $P.compareTo = function (date) { | ||
| 204 | return Date.compare(this, date); | ||
| 205 | }; | ||
| 206 | $P.equals = function (date) { | ||
| 207 | return Date.equals(this, date || new Date()); | ||
| 208 | }; | ||
| 209 | $P.between = function (start, end) { | ||
| 210 | return this.getTime() >= start.getTime() && this.getTime() <= end.getTime(); | ||
| 211 | }; | ||
| 212 | $P.isAfter = function (date) { | ||
| 213 | return this.compareTo(date || new Date()) === 1; | ||
| 214 | }; | ||
| 215 | $P.isBefore = function (date) { | ||
| 216 | return (this.compareTo(date || new Date()) === -1); | ||
| 217 | }; | ||
| 218 | $P.isToday = function () { | ||
| 219 | return this.isSameDay(new Date()); | ||
| 220 | }; | ||
| 221 | $P.isSameDay = function (date) { | ||
| 222 | return this.clone().clearTime().equals(date.clone().clearTime()); | ||
| 223 | }; | ||
| 224 | $P.addMilliseconds = function (value) { | ||
| 225 | this.setMilliseconds(this.getMilliseconds() + value); | ||
| 226 | return this; | ||
| 227 | }; | ||
| 228 | $P.addSeconds = function (value) { | ||
| 229 | return this.addMilliseconds(value * 1000); | ||
| 230 | }; | ||
| 231 | $P.addMinutes = function (value) { | ||
| 232 | return this.addMilliseconds(value * 60000); | ||
| 233 | }; | ||
| 234 | $P.addHours = function (value) { | ||
| 235 | return this.addMilliseconds(value * 3600000); | ||
| 236 | }; | ||
| 237 | $P.addDays = function (value) { | ||
| 238 | this.setDate(this.getDate() + value); | ||
| 239 | return this; | ||
| 240 | }; | ||
| 241 | $P.addWeeks = function (value) { | ||
| 242 | return this.addDays(value * 7); | ||
| 243 | }; | ||
| 244 | $P.addMonths = function (value) { | ||
| 245 | var n = this.getDate(); | ||
| 246 | this.setDate(1); | ||
| 247 | this.setMonth(this.getMonth() + value); | ||
| 248 | this.setDate(Math.min(n, $D.getDaysInMonth(this.getFullYear(), this.getMonth()))); | ||
| 249 | return this; | ||
| 250 | }; | ||
| 251 | $P.addYears = function (value) { | ||
| 252 | return this.addMonths(value * 12); | ||
| 253 | }; | ||
| 254 | $P.add = function (config) { | ||
| 255 | if (typeof config == "number") { | ||
| 256 | this._orient = config; | ||
| 257 | return this; | ||
| 258 | } | ||
| 259 | var x = config; | ||
| 260 | if (x.milliseconds) { | ||
| 261 | this.addMilliseconds(x.milliseconds); | ||
| 262 | } | ||
| 263 | if (x.seconds) { | ||
| 264 | this.addSeconds(x.seconds); | ||
| 265 | } | ||
| 266 | if (x.minutes) { | ||
| 267 | this.addMinutes(x.minutes); | ||
| 268 | } | ||
| 269 | if (x.hours) { | ||
| 270 | this.addHours(x.hours); | ||
| 271 | } | ||
| 272 | if (x.weeks) { | ||
| 273 | this.addWeeks(x.weeks); | ||
| 274 | } | ||
| 275 | if (x.months) { | ||
| 276 | this.addMonths(x.months); | ||
| 277 | } | ||
| 278 | if (x.years) { | ||
| 279 | this.addYears(x.years); | ||
| 280 | } | ||
| 281 | if (x.days) { | ||
| 282 | this.addDays(x.days); | ||
| 283 | } | ||
| 284 | return this; | ||
| 285 | }; | ||
| 286 | var $y, $m, $d; | ||
| 287 | $P.getWeek = function () { | ||
| 288 | var a, b, c, d, e, f, g, n, s, w; | ||
| 289 | $y = (!$y) ? this.getFullYear() : $y; | ||
| 290 | $m = (!$m) ? this.getMonth() + 1 : $m; | ||
| 291 | $d = (!$d) ? this.getDate() : $d; | ||
| 292 | if ($m <= 2) { | ||
| 293 | a = $y - 1; | ||
| 294 | b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0); | ||
| 295 | c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0); | ||
| 296 | s = b - c; | ||
| 297 | e = 0; | ||
| 298 | f = $d - 1 + (31 * ($m - 1)); | ||
| 299 | } else { | ||
| 300 | a = $y; | ||
| 301 | b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0); | ||
| 302 | c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0); | ||
| 303 | s = b - c; | ||
| 304 | e = s + 1; | ||
| 305 | f = $d + ((153 * ($m - 3) + 2) / 5) + 58 + s; | ||
| 306 | } | ||
| 307 | g = (a + b) % 7; | ||
| 308 | d = (f + g - e) % 7; | ||
| 309 | n = (f + 3 - d) | 0; | ||
| 310 | if (n < 0) { | ||
| 311 | w = 53 - ((g - s) / 5 | 0); | ||
| 312 | } else if (n > 364 + s) { | ||
| 313 | w = 1; | ||
| 314 | } else { | ||
| 315 | w = (n / 7 | 0) + 1; | ||
| 316 | } | ||
| 317 | $y = $m = $d = null; | ||
| 318 | return w; | ||
| 319 | }; | ||
| 320 | $P.getISOWeek = function () { | ||
| 321 | $y = this.getUTCFullYear(); | ||
| 322 | $m = this.getUTCMonth() + 1; | ||
| 323 | $d = this.getUTCDate(); | ||
| 324 | return p(this.getWeek()); | ||
| 325 | }; | ||
| 326 | $P.setWeek = function (n) { | ||
| 327 | return this.moveToDayOfWeek(1).addWeeks(n - this.getWeek()); | ||
| 328 | }; | ||
| 329 | $D._validate = function (n, min, max, name) { | ||
| 330 | if (typeof n == "undefined") { | ||
| 331 | return false; | ||
| 332 | } else if (typeof n != "number") { | ||
| 333 | throw new TypeError(n + " is not a Number."); | ||
| 334 | } else if (n < min || n > max) { | ||
| 335 | throw new RangeError(n + " is not a valid value for " + name + "."); | ||
| 336 | } | ||
| 337 | return true; | ||
| 338 | }; | ||
| 339 | $D.validateMillisecond = function (value) { | ||
| 340 | return $D._validate(value, 0, 999, "millisecond"); | ||
| 341 | }; | ||
| 342 | $D.validateSecond = function (value) { | ||
| 343 | return $D._validate(value, 0, 59, "second"); | ||
| 344 | }; | ||
| 345 | $D.validateMinute = function (value) { | ||
| 346 | return $D._validate(value, 0, 59, "minute"); | ||
| 347 | }; | ||
| 348 | $D.validateHour = function (value) { | ||
| 349 | return $D._validate(value, 0, 23, "hour"); | ||
| 350 | }; | ||
| 351 | $D.validateDay = function (value, year, month) { | ||
| 352 | return $D._validate(value, 1, $D.getDaysInMonth(year, month), "day"); | ||
| 353 | }; | ||
| 354 | $D.validateMonth = function (value) { | ||
| 355 | return $D._validate(value, 0, 11, "month"); | ||
| 356 | }; | ||
| 357 | $D.validateYear = function (value) { | ||
| 358 | return $D._validate(value, 0, 9999, "year"); | ||
| 359 | }; | ||
| 360 | $P.set = function (config) { | ||
| 361 | if ($D.validateMillisecond(config.millisecond)) { | ||
| 362 | this.addMilliseconds(config.millisecond - this.getMilliseconds()); | ||
| 363 | } | ||
| 364 | if ($D.validateSecond(config.second)) { | ||
| 365 | this.addSeconds(config.second - this.getSeconds()); | ||
| 366 | } | ||
| 367 | if ($D.validateMinute(config.minute)) { | ||
| 368 | this.addMinutes(config.minute - this.getMinutes()); | ||
| 369 | } | ||
| 370 | if ($D.validateHour(config.hour)) { | ||
| 371 | this.addHours(config.hour - this.getHours()); | ||
| 372 | } | ||
| 373 | if ($D.validateMonth(config.month)) { | ||
| 374 | this.addMonths(config.month - this.getMonth()); | ||
| 375 | } | ||
| 376 | if ($D.validateYear(config.year)) { | ||
| 377 | this.addYears(config.year - this.getFullYear()); | ||
| 378 | } | ||
| 379 | if ($D.validateDay(config.day, this.getFullYear(), this.getMonth())) { | ||
| 380 | this.addDays(config.day - this.getDate()); | ||
| 381 | } | ||
| 382 | if (config.timezone) { | ||
| 383 | this.setTimezone(config.timezone); | ||
| 384 | } | ||
| 385 | if (config.timezoneOffset) { | ||
| 386 | this.setTimezoneOffset(config.timezoneOffset); | ||
| 387 | } | ||
| 388 | if (config.week && $D._validate(config.week, 0, 53, "week")) { | ||
| 389 | this.setWeek(config.week); | ||
| 390 | } | ||
| 391 | return this; | ||
| 392 | }; | ||
| 393 | $P.moveToFirstDayOfMonth = function () { | ||
| 394 | return this.set({ | ||
| 395 | day: 1 | ||
| 396 | }); | ||
| 397 | }; | ||
| 398 | $P.moveToLastDayOfMonth = function () { | ||
| 399 | return this.set({ | ||
| 400 | day: $D.getDaysInMonth(this.getFullYear(), this.getMonth()) | ||
| 401 | }); | ||
| 402 | }; | ||
| 403 | $P.moveToNthOccurrence = function (dayOfWeek, occurrence) { | ||
| 404 | var shift = 0; | ||
| 405 | if (occurrence > 0) { | ||
| 406 | shift = occurrence - 1; | ||
| 407 | } else if (occurrence === -1) { | ||
| 408 | this.moveToLastDayOfMonth(); | ||
| 409 | if (this.getDay() !== dayOfWeek) { | ||
| 410 | this.moveToDayOfWeek(dayOfWeek, -1); | ||
| 411 | } | ||
| 412 | return this; | ||
| 413 | } | ||
| 414 | return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek, +1).addWeeks(shift); | ||
| 415 | }; | ||
| 416 | $P.moveToDayOfWeek = function (dayOfWeek, orient) { | ||
| 417 | var diff = (dayOfWeek - this.getDay() + 7 * (orient || +1)) % 7; | ||
| 418 | return this.addDays((diff === 0) ? diff += 7 * (orient || +1) : diff); | ||
| 419 | }; | ||
| 420 | $P.moveToMonth = function (month, orient) { | ||
| 421 | var diff = (month - this.getMonth() + 12 * (orient || +1)) % 12; | ||
| 422 | return this.addMonths((diff === 0) ? diff += 12 * (orient || +1) : diff); | ||
| 423 | }; | ||
| 424 | $P.getOrdinalNumber = function () { | ||
| 425 | return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1; | ||
| 426 | }; | ||
| 427 | $P.getTimezone = function () { | ||
| 428 | return $D.getTimezoneAbbreviation(this.getUTCOffset()); | ||
| 429 | }; | ||
| 430 | $P.setTimezoneOffset = function (offset) { | ||
| 431 | var here = this.getTimezoneOffset(), | ||
| 432 | there = Number(offset) * -6 / 10; | ||
| 433 | return this.addMinutes(there - here); | ||
| 434 | }; | ||
| 435 | $P.setTimezone = function (offset) { | ||
| 436 | return this.setTimezoneOffset($D.getTimezoneOffset(offset)); | ||
| 437 | }; | ||
| 438 | $P.hasDaylightSavingTime = function () { | ||
| 439 | return (Date.today().set({ | ||
| 440 | month: 0, | ||
| 441 | day: 1 | ||
| 442 | }).getTimezoneOffset() !== Date.today().set({ | ||
| 443 | month: 6, | ||
| 444 | day: 1 | ||
| 445 | }).getTimezoneOffset()); | ||
| 446 | }; | ||
| 447 | $P.isDaylightSavingTime = function () { | ||
| 448 | return (this.hasDaylightSavingTime() && new Date().getTimezoneOffset() === Date.today().set({ | ||
| 449 | month: 6, | ||
| 450 | day: 1 | ||
| 451 | }).getTimezoneOffset()); | ||
| 452 | }; | ||
| 453 | $P.getUTCOffset = function () { | ||
| 454 | var n = this.getTimezoneOffset() * -10 / 6, | ||
| 455 | r; | ||
| 456 | if (n < 0) { | ||
| 457 | r = (n - 10000).toString(); | ||
| 458 | return r.charAt(0) + r.substr(2); | ||
| 459 | } else { | ||
| 460 | r = (n + 10000).toString(); | ||
| 461 | return "+" + r.substr(1); | ||
| 462 | } | ||
| 463 | }; | ||
| 464 | $P.getElapsed = function (date) { | ||
| 465 | return (date || new Date()) - this; | ||
| 466 | }; | ||
| 467 | if (!$P.toISOString) { | ||
| 468 | $P.toISOString = function () { | ||
| 469 | function f(n) { | ||
| 470 | return n < 10 ? '0' + n : n; | ||
| 471 | } | ||
| 472 | return '"' + this.getUTCFullYear() + '-' + | ||
| 473 | f(this.getUTCMonth() + 1) + '-' + | ||
| 474 | f(this.getUTCDate()) + 'T' + | ||
| 475 | f(this.getUTCHours()) + ':' + | ||
| 476 | f(this.getUTCMinutes()) + ':' + | ||
| 477 | f(this.getUTCSeconds()) + 'Z"'; | ||
| 478 | }; | ||
| 479 | } | ||
| 480 | $P._toString = $P.toString; | ||
| 481 | $P.toString = function (format) { | ||
| 482 | var x = this; | ||
| 483 | if (format && format.length == 1) { | ||
| 484 | var c = $C.formatPatterns; | ||
| 485 | x.t = x.toString; | ||
| 486 | switch (format) { | ||
| 487 | case "d": | ||
| 488 | return x.t(c.shortDate); | ||
| 489 | case "D": | ||
| 490 | return x.t(c.longDate); | ||
| 491 | case "F": | ||
| 492 | return x.t(c.fullDateTime); | ||
| 493 | case "m": | ||
| 494 | return x.t(c.monthDay); | ||
| 495 | case "r": | ||
| 496 | return x.t(c.rfc1123); | ||
| 497 | case "s": | ||
| 498 | return x.t(c.sortableDateTime); | ||
| 499 | case "t": | ||
| 500 | return x.t(c.shortTime); | ||
| 501 | case "T": | ||
| 502 | return x.t(c.longTime); | ||
| 503 | case "u": | ||
| 504 | return x.t(c.universalSortableDateTime); | ||
| 505 | case "y": | ||
| 506 | return x.t(c.yearMonth); | ||
| 507 | } | ||
| 508 | } | ||
| 509 | var ord = function (n) { | ||
| 510 | switch (n * 1) { | ||
| 511 | case 1: | ||
| 512 | case 21: | ||
| 513 | case 31: | ||
| 514 | return "st"; | ||
| 515 | case 2: | ||
| 516 | case 22: | ||
| 517 | return "nd"; | ||
| 518 | case 3: | ||
| 519 | case 23: | ||
| 520 | return "rd"; | ||
| 521 | default: | ||
| 522 | return "th"; | ||
| 523 | } | ||
| 524 | }; | ||
| 525 | return format ? format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g, function (m) { | ||
| 526 | if (m.charAt(0) === "\\") { | ||
| 527 | return m.replace("\\", ""); | ||
| 528 | } | ||
| 529 | x.h = x.getHours; | ||
| 530 | switch (m) { | ||
| 531 | case "hh": | ||
| 532 | return p(x.h() < 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12)); | ||
| 533 | case "h": | ||
| 534 | return x.h() < 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12); | ||
| 535 | case "HH": | ||
| 536 | return p(x.h()); | ||
| 537 | case "H": | ||
| 538 | return x.h(); | ||
| 539 | case "mm": | ||
| 540 | return p(x.getMinutes()); | ||
| 541 | case "m": | ||
| 542 | return x.getMinutes(); | ||
| 543 | case "ss": | ||
| 544 | return p(x.getSeconds()); | ||
| 545 | case "s": | ||
| 546 | return x.getSeconds(); | ||
| 547 | case "yyyy": | ||
| 548 | return p(x.getFullYear(), 4); | ||
| 549 | case "yy": | ||
| 550 | return p(x.getFullYear()); | ||
| 551 | case "dddd": | ||
| 552 | return $C.dayNames[x.getDay()]; | ||
| 553 | case "ddd": | ||
| 554 | return $C.abbreviatedDayNames[x.getDay()]; | ||
| 555 | case "dd": | ||
| 556 | return p(x.getDate()); | ||
| 557 | case "d": | ||
| 558 | return x.getDate(); | ||
| 559 | case "MMMM": | ||
| 560 | return $C.monthNames[x.getMonth()]; | ||
| 561 | case "MMM": | ||
| 562 | return $C.abbreviatedMonthNames[x.getMonth()]; | ||
| 563 | case "MM": | ||
| 564 | return p((x.getMonth() + 1)); | ||
| 565 | case "M": | ||
| 566 | return x.getMonth() + 1; | ||
| 567 | case "t": | ||
| 568 | return x.h() < 12 ? $C.amDesignator.substring(0, 1) : $C.pmDesignator.substring(0, 1); | ||
| 569 | case "tt": | ||
| 570 | return x.h() < 12 ? $C.amDesignator : $C.pmDesignator; | ||
| 571 | case "S": | ||
| 572 | return ord(x.getDate()); | ||
| 573 | default: | ||
| 574 | return m; | ||
| 575 | } | ||
| 576 | }) : this._toString(); | ||
| 577 | }; | ||
| 578 | }()); | ||
| 579 | (function () { | ||
| 580 | var $D = Date, | ||
| 581 | $P = $D.prototype, | ||
| 582 | $C = $D.CultureInfo, | ||
| 583 | $N = Number.prototype; | ||
| 584 | $P._orient = +1; | ||
| 585 | $P._nth = null; | ||
| 586 | $P._is = false; | ||
| 587 | $P._same = false; | ||
| 588 | $P._isSecond = false; | ||
| 589 | $N._dateElement = "day"; | ||
| 590 | $P.next = function () { | ||
| 591 | this._orient = +1; | ||
| 592 | return this; | ||
| 593 | }; | ||
| 594 | $D.next = function () { | ||
| 595 | return $D.today().next(); | ||
| 596 | }; | ||
| 597 | $P.last = $P.prev = $P.previous = function () { | ||
| 598 | this._orient = -1; | ||
| 599 | return this; | ||
| 600 | }; | ||
| 601 | $D.last = $D.prev = $D.previous = function () { | ||
| 602 | return $D.today().last(); | ||
| 603 | }; | ||
| 604 | $P.is = function () { | ||
| 605 | this._is = true; | ||
| 606 | return this; | ||
| 607 | }; | ||
| 608 | $P.same = function () { | ||
| 609 | this._same = true; | ||
| 610 | this._isSecond = false; | ||
| 611 | return this; | ||
| 612 | }; | ||
| 613 | $P.today = function () { | ||
| 614 | return this.same().day(); | ||
| 615 | }; | ||
| 616 | $P.weekday = function () { | ||
| 617 | if (this._is) { | ||
| 618 | this._is = false; | ||
| 619 | return (!this.is().sat() && !this.is().sun()); | ||
| 620 | } | ||
| 621 | return false; | ||
| 622 | }; | ||
| 623 | $P.at = function (time) { | ||
| 624 | return (typeof time === "string") ? $D.parse(this.toString("d") + " " + time) : this.set(time); | ||
| 625 | }; | ||
| 626 | $N.fromNow = $N.after = function (date) { | ||
| 627 | var c = {}; | ||
| 628 | c[this._dateElement] = this; | ||
| 629 | return ((!date) ? new Date() : date.clone()).add(c); | ||
| 630 | }; | ||
| 631 | $N.ago = $N.before = function (date) { | ||
| 632 | var c = {}; | ||
| 633 | c[this._dateElement] = this * -1; | ||
| 634 | return ((!date) ? new Date() : date.clone()).add(c); | ||
| 635 | }; | ||
| 636 | var dx = ("sunday monday tuesday wednesday thursday friday saturday").split(/\s/), | ||
| 637 | mx = ("january february march april may june july august september october november december").split(/\s/), | ||
| 638 | px = ("Millisecond Second Minute Hour Day Week Month Year").split(/\s/), | ||
| 639 | pxf = ("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/), | ||
| 640 | nth = ("final first second third fourth fifth").split(/\s/), | ||
| 641 | de; | ||
| 642 | $P.toObject = function () { | ||
| 643 | var o = {}; | ||
| 644 | for (var i = 0; i < px.length; i++) { | ||
| 645 | o[px[i].toLowerCase()] = this["get" + pxf[i]](); | ||
| 646 | } | ||
| 647 | return o; | ||
| 648 | }; | ||
| 649 | $D.fromObject = function (config) { | ||
| 650 | config.week = null; | ||
| 651 | return Date.today().set(config); | ||
| 652 | }; | ||
| 653 | var df = function (n) { | ||
| 654 | return function () { | ||
| 655 | if (this._is) { | ||
| 656 | this._is = false; | ||
| 657 | return this.getDay() == n; | ||
| 658 | } | ||
| 659 | if (this._nth !== null) { | ||
| 660 | if (this._isSecond) { | ||
| 661 | this.addSeconds(this._orient * -1); | ||
| 662 | } | ||
| 663 | this._isSecond = false; | ||
| 664 | var ntemp = this._nth; | ||
| 665 | this._nth = null; | ||
| 666 | var temp = this.clone().moveToLastDayOfMonth(); | ||
| 667 | this.moveToNthOccurrence(n, ntemp); | ||
| 668 | if (this > temp) { | ||
| 669 | throw new RangeError($D.getDayName(n) + " does not occur " + ntemp + " times in the month of " + $D.getMonthName(temp.getMonth()) + " " + temp.getFullYear() + "."); | ||
| 670 | } | ||
| 671 | return this; | ||
| 672 | } | ||
| 673 | return this.moveToDayOfWeek(n, this._orient); | ||
| 674 | }; | ||
| 675 | }; | ||
| 676 | var sdf = function (n) { | ||
| 677 | return function () { | ||
| 678 | var t = $D.today(), | ||
| 679 | shift = n - t.getDay(); | ||
| 680 | if (n === 0 && $C.firstDayOfWeek === 1 && t.getDay() !== 0) { | ||
| 681 | shift = shift + 7; | ||
| 682 | } | ||
| 683 | return t.addDays(shift); | ||
| 684 | }; | ||
| 685 | }; | ||
| 686 | for (var i = 0; i < dx.length; i++) { | ||
| 687 | $D[dx[i].toUpperCase()] = $D[dx[i].toUpperCase().substring(0, 3)] = i; | ||
| 688 | $D[dx[i]] = $D[dx[i].substring(0, 3)] = sdf(i); | ||
| 689 | $P[dx[i]] = $P[dx[i].substring(0, 3)] = df(i); | ||
| 690 | } | ||
| 691 | var mf = function (n) { | ||
| 692 | return function () { | ||
| 693 | if (this._is) { | ||
| 694 | this._is = false; | ||
| 695 | return this.getMonth() === n; | ||
| 696 | } | ||
| 697 | return this.moveToMonth(n, this._orient); | ||
| 698 | }; | ||
| 699 | }; | ||
| 700 | var smf = function (n) { | ||
| 701 | return function () { | ||
| 702 | return $D.today().set({ | ||
| 703 | month: n, | ||
| 704 | day: 1 | ||
| 705 | }); | ||
| 706 | }; | ||
| 707 | }; | ||
| 708 | for (var j = 0; j < mx.length; j++) { | ||
| 709 | $D[mx[j].toUpperCase()] = $D[mx[j].toUpperCase().substring(0, 3)] = j; | ||
| 710 | $D[mx[j]] = $D[mx[j].substring(0, 3)] = smf(j); | ||
| 711 | $P[mx[j]] = $P[mx[j].substring(0, 3)] = mf(j); | ||
| 712 | } | ||
| 713 | var ef = function (j) { | ||
| 714 | return function () { | ||
| 715 | if (this._isSecond) { | ||
| 716 | this._isSecond = false; | ||
| 717 | return this; | ||
| 718 | } | ||
| 719 | if (this._same) { | ||
| 720 | this._same = this._is = false; | ||
| 721 | var o1 = this.toObject(), | ||
| 722 | o2 = (arguments[0] || new Date()).toObject(), | ||
| 723 | v = "", | ||
| 724 | k = j.toLowerCase(); | ||
| 725 | for (var m = (px.length - 1); m > -1; m--) { | ||
| 726 | v = px[m].toLowerCase(); | ||
| 727 | if (o1[v] != o2[v]) { | ||
| 728 | return false; | ||
| 729 | } | ||
| 730 | if (k == v) { | ||
| 731 | break; | ||
| 732 | } | ||
| 733 | } | ||
| 734 | return true; | ||
| 735 | } | ||
| 736 | if (j.substring(j.length - 1) != "s") { | ||
| 737 | j += "s"; | ||
| 738 | } | ||
| 739 | return this["add" + j](this._orient); | ||
| 740 | }; | ||
| 741 | }; | ||
| 742 | var nf = function (n) { | ||
| 743 | return function () { | ||
| 744 | this._dateElement = n; | ||
| 745 | return this; | ||
| 746 | }; | ||
| 747 | }; | ||
| 748 | for (var k = 0; k < px.length; k++) { | ||
| 749 | de = px[k].toLowerCase(); | ||
| 750 | $P[de] = $P[de + "s"] = ef(px[k]); | ||
| 751 | $N[de] = $N[de + "s"] = nf(de); | ||
| 752 | } | ||
| 753 | $P._ss = ef("Second"); | ||
| 754 | var nthfn = function (n) { | ||
| 755 | return function (dayOfWeek) { | ||
| 756 | if (this._same) { | ||
| 757 | return this._ss(arguments[0]); | ||
| 758 | } | ||
| 759 | if (dayOfWeek || dayOfWeek === 0) { | ||
| 760 | return this.moveToNthOccurrence(dayOfWeek, n); | ||
| 761 | } | ||
| 762 | this._nth = n; | ||
| 763 | if (n === 2 && (dayOfWeek === undefined || dayOfWeek === null)) { | ||
| 764 | this._isSecond = true; | ||
| 765 | return this.addSeconds(this._orient); | ||
| 766 | } | ||
| 767 | return this; | ||
| 768 | }; | ||
| 769 | }; | ||
| 770 | for (var l = 0; l < nth.length; l++) { | ||
| 771 | $P[nth[l]] = (l === 0) ? nthfn(-1) : nthfn(l); | ||
| 772 | } | ||
| 773 | }()); | ||
| 774 | (function () { | ||
| 775 | Date.Parsing = { | ||
| 776 | Exception: function (s) { | ||
| 777 | this.message = "Parse error at '" + s.substring(0, 10) + " ...'"; | ||
| 778 | } | ||
| 779 | }; | ||
| 780 | var $P = Date.Parsing; | ||
| 781 | var _ = $P.Operators = { | ||
| 782 | rtoken: function (r) { | ||
| 783 | return function (s) { | ||
| 784 | var mx = s.match(r); | ||
| 785 | if (mx) { | ||
| 786 | return ([mx[0], s.substring(mx[0].length)]); | ||
| 787 | } else { | ||
| 788 | throw new $P.Exception(s); | ||
| 789 | } | ||
| 790 | }; | ||
| 791 | }, | ||
| 792 | token: function (s) { | ||
| 793 | return function (s) { | ||
| 794 | return _.rtoken(new RegExp("^\s*" + s + "\s*"))(s); | ||
| 795 | }; | ||
| 796 | }, | ||
| 797 | stoken: function (s) { | ||
| 798 | return _.rtoken(new RegExp("^" + s)); | ||
| 799 | }, | ||
| 800 | until: function (p) { | ||
| 801 | return function (s) { | ||
| 802 | var qx = [], | ||
| 803 | rx = null; | ||
| 804 | while (s.length) { | ||
| 805 | try { | ||
| 806 | rx = p.call(this, s); | ||
| 807 | } catch (e) { | ||
| 808 | qx.push(rx[0]); | ||
| 809 | s = rx[1]; | ||
| 810 | continue; | ||
| 811 | } | ||
| 812 | break; | ||
| 813 | } | ||
| 814 | return [qx, s]; | ||
| 815 | }; | ||
| 816 | }, | ||
| 817 | many: function (p) { | ||
| 818 | return function (s) { | ||
| 819 | var rx = [], | ||
| 820 | r = null; | ||
| 821 | while (s.length) { | ||
| 822 | try { | ||
| 823 | r = p.call(this, s); | ||
| 824 | } catch (e) { | ||
| 825 | return [rx, s]; | ||
| 826 | } | ||
| 827 | rx.push(r[0]); | ||
| 828 | s = r[1]; | ||
| 829 | } | ||
| 830 | return [rx, s]; | ||
| 831 | }; | ||
| 832 | }, | ||
| 833 | optional: function (p) { | ||
| 834 | return function (s) { | ||
| 835 | var r = null; | ||
| 836 | try { | ||
| 837 | r = p.call(this, s); | ||
| 838 | } catch (e) { | ||
| 839 | return [null, s]; | ||
| 840 | } | ||
| 841 | return [r[0], r[1]]; | ||
| 842 | }; | ||
| 843 | }, | ||
| 844 | not: function (p) { | ||
| 845 | return function (s) { | ||
| 846 | try { | ||
| 847 | p.call(this, s); | ||
| 848 | } catch (e) { | ||
| 849 | return [null, s]; | ||
| 850 | } | ||
| 851 | throw new $P.Exception(s); | ||
| 852 | }; | ||
| 853 | }, | ||
| 854 | ignore: function (p) { | ||
| 855 | return p ? function (s) { | ||
| 856 | var r = null; | ||
| 857 | r = p.call(this, s); | ||
| 858 | return [null, r[1]]; | ||
| 859 | } : null; | ||
| 860 | }, | ||
| 861 | product: function () { | ||
| 862 | var px = arguments[0], | ||
| 863 | qx = Array.prototype.slice.call(arguments, 1), | ||
| 864 | rx = []; | ||
| 865 | for (var i = 0; i < px.length; i++) { | ||
| 866 | rx.push(_.each(px[i], qx)); | ||
| 867 | } | ||
| 868 | return rx; | ||
| 869 | }, | ||
| 870 | cache: function (rule) { | ||
| 871 | var cache = {}, | ||
| 872 | r = null; | ||
| 873 | return function (s) { | ||
| 874 | try { | ||
| 875 | r = cache[s] = (cache[s] || rule.call(this, s)); | ||
| 876 | } catch (e) { | ||
| 877 | r = cache[s] = e; | ||
| 878 | } | ||
| 879 | if (r instanceof $P.Exception) { | ||
| 880 | throw r; | ||
| 881 | } else { | ||
| 882 | return r; | ||
| 883 | } | ||
| 884 | }; | ||
| 885 | }, | ||
| 886 | any: function () { | ||
| 887 | var px = arguments; | ||
| 888 | return function (s) { | ||
| 889 | var r = null; | ||
| 890 | for (var i = 0; i < px.length; i++) { | ||
| 891 | if (px[i] == null) { | ||
| 892 | continue; | ||
| 893 | } | ||
| 894 | try { | ||
| 895 | r = (px[i].call(this, s)); | ||
| 896 | } catch (e) { | ||
| 897 | r = null; | ||
| 898 | } | ||
| 899 | if (r) { | ||
| 900 | return r; | ||
| 901 | } | ||
| 902 | } | ||
| 903 | throw new $P.Exception(s); | ||
| 904 | }; | ||
| 905 | }, | ||
| 906 | each: function () { | ||
| 907 | var px = arguments; | ||
| 908 | return function (s) { | ||
| 909 | var rx = [], | ||
| 910 | r = null; | ||
| 911 | for (var i = 0; i < px.length; i++) { | ||
| 912 | if (px[i] == null) { | ||
| 913 | continue; | ||
| 914 | } | ||
| 915 | try { | ||
| 916 | r = (px[i].call(this, s)); | ||
| 917 | } catch (e) { | ||
| 918 | throw new $P.Exception(s); | ||
| 919 | } | ||
| 920 | rx.push(r[0]); | ||
| 921 | s = r[1]; | ||
| 922 | } | ||
| 923 | return [rx, s]; | ||
| 924 | }; | ||
| 925 | }, | ||
| 926 | all: function () { | ||
| 927 | var px = arguments, | ||
| 928 | _ = _; | ||
| 929 | return _.each(_.optional(px)); | ||
| 930 | }, | ||
| 931 | sequence: function (px, d, c) { | ||
| 932 | d = d || _.rtoken(/^\s*/); | ||
| 933 | c = c || null; | ||
| 934 | if (px.length == 1) { | ||
| 935 | return px[0]; | ||
| 936 | } | ||
| 937 | return function (s) { | ||
| 938 | var r = null, | ||
| 939 | q = null; | ||
| 940 | var rx = []; | ||
| 941 | for (var i = 0; i < px.length; i++) { | ||
| 942 | try { | ||
| 943 | r = px[i].call(this, s); | ||
| 944 | } catch (e) { | ||
| 945 | break; | ||
| 946 | } | ||
| 947 | rx.push(r[0]); | ||
| 948 | try { | ||
| 949 | q = d.call(this, r[1]); | ||
| 950 | } catch (ex) { | ||
| 951 | q = null; | ||
| 952 | break; | ||
| 953 | } | ||
| 954 | s = q[1]; | ||
| 955 | } | ||
| 956 | if (!r) { | ||
| 957 | throw new $P.Exception(s); | ||
| 958 | } | ||
| 959 | if (q) { | ||
| 960 | throw new $P.Exception(q[1]); | ||
| 961 | } | ||
| 962 | if (c) { | ||
| 963 | try { | ||
| 964 | r = c.call(this, r[1]); | ||
| 965 | } catch (ey) { | ||
| 966 | throw new $P.Exception(r[1]); | ||
| 967 | } | ||
| 968 | } | ||
| 969 | return [rx, (r ? r[1] : s)]; | ||
| 970 | }; | ||
| 971 | }, | ||
| 972 | between: function (d1, p, d2) { | ||
| 973 | d2 = d2 || d1; | ||
| 974 | var _fn = _.each(_.ignore(d1), p, _.ignore(d2)); | ||
| 975 | return function (s) { | ||
| 976 | var rx = _fn.call(this, s); | ||
| 977 | return [ | ||
| 978 | [rx[0][0], r[0][2]], rx[1] | ||
| 979 | ]; | ||
| 980 | }; | ||
| 981 | }, | ||
| 982 | list: function (p, d, c) { | ||
| 983 | d = d || _.rtoken(/^\s*/); | ||
| 984 | c = c || null; | ||
| 985 | return (p instanceof Array ? _.each(_.product(p.slice(0, -1), _.ignore(d)), p.slice(-1), _.ignore(c)) : _.each(_.many(_.each(p, _.ignore(d))), px, _.ignore(c))); | ||
| 986 | }, | ||
| 987 | set: function (px, d, c) { | ||
| 988 | d = d || _.rtoken(/^\s*/); | ||
| 989 | c = c || null; | ||
| 990 | return function (s) { | ||
| 991 | var r = null, | ||
| 992 | p = null, | ||
| 993 | q = null, | ||
| 994 | rx = null, | ||
| 995 | best = [ | ||
| 996 | [], s | ||
| 997 | ], | ||
| 998 | last = false; | ||
| 999 | for (var i = 0; i < px.length; i++) { | ||
| 1000 | q = null; | ||
| 1001 | p = null; | ||
| 1002 | r = null; | ||
| 1003 | last = (px.length == 1); | ||
| 1004 | try { | ||
| 1005 | r = px[i].call(this, s); | ||
| 1006 | } catch (e) { | ||
| 1007 | continue; | ||
| 1008 | } | ||
| 1009 | rx = [ | ||
| 1010 | [r[0]], r[1] | ||
| 1011 | ]; | ||
| 1012 | if (r[1].length > 0 && !last) { | ||
| 1013 | try { | ||
| 1014 | q = d.call(this, r[1]); | ||
| 1015 | } catch (ex) { | ||
| 1016 | last = true; | ||
| 1017 | } | ||
| 1018 | } else { | ||
| 1019 | last = true; | ||
| 1020 | } | ||
| 1021 | if (!last && q[1].length === 0) { | ||
| 1022 | last = true; | ||
| 1023 | } | ||
| 1024 | if (!last) { | ||
| 1025 | var qx = []; | ||
| 1026 | for (var j = 0; j < px.length; j++) { | ||
| 1027 | if (i != j) { | ||
| 1028 | qx.push(px[j]); | ||
| 1029 | } | ||
| 1030 | } | ||
| 1031 | p = _.set(qx, d).call(this, q[1]); | ||
| 1032 | if (p[0].length > 0) { | ||
| 1033 | rx[0] = rx[0].concat(p[0]); | ||
| 1034 | rx[1] = p[1]; | ||
| 1035 | } | ||
| 1036 | } | ||
| 1037 | if (rx[1].length < best[1].length) { | ||
| 1038 | best = rx; | ||
| 1039 | } | ||
| 1040 | if (best[1].length === 0) { | ||
| 1041 | break; | ||
| 1042 | } | ||
| 1043 | } | ||
| 1044 | if (best[0].length === 0) { | ||
| 1045 | return best; | ||
| 1046 | } | ||
| 1047 | if (c) { | ||
| 1048 | try { | ||
| 1049 | q = c.call(this, best[1]); | ||
| 1050 | } catch (ey) { | ||
| 1051 | throw new $P.Exception(best[1]); | ||
| 1052 | } | ||
| 1053 | best[1] = q[1]; | ||
| 1054 | } | ||
| 1055 | return best; | ||
| 1056 | }; | ||
| 1057 | }, | ||
| 1058 | forward: function (gr, fname) { | ||
| 1059 | return function (s) { | ||
| 1060 | return gr[fname].call(this, s); | ||
| 1061 | }; | ||
| 1062 | }, | ||
| 1063 | replace: function (rule, repl) { | ||
| 1064 | return function (s) { | ||
| 1065 | var r = rule.call(this, s); | ||
| 1066 | return [repl, r[1]]; | ||
| 1067 | }; | ||
| 1068 | }, | ||
| 1069 | process: function (rule, fn) { | ||
| 1070 | return function (s) { | ||
| 1071 | var r = rule.call(this, s); | ||
| 1072 | return [fn.call(this, r[0]), r[1]]; | ||
| 1073 | }; | ||
| 1074 | }, | ||
| 1075 | min: function (min, rule) { | ||
| 1076 | return function (s) { | ||
| 1077 | var rx = rule.call(this, s); | ||
| 1078 | if (rx[0].length < min) { | ||
| 1079 | throw new $P.Exception(s); | ||
| 1080 | } | ||
| 1081 | return rx; | ||
| 1082 | }; | ||
| 1083 | } | ||
| 1084 | }; | ||
| 1085 | var _generator = function (op) { | ||
| 1086 | return function () { | ||
| 1087 | var args = null, | ||
| 1088 | rx = []; | ||
| 1089 | if (arguments.length > 1) { | ||
| 1090 | args = Array.prototype.slice.call(arguments); | ||
| 1091 | } else if (arguments[0] instanceof Array) { | ||
| 1092 | args = arguments[0]; | ||
| 1093 | } | ||
| 1094 | if (args) { | ||
| 1095 | for (var i = 0, px = args.shift(); i < px.length; i++) { | ||
| 1096 | args.unshift(px[i]); | ||
| 1097 | rx.push(op.apply(null, args)); | ||
| 1098 | args.shift(); | ||
| 1099 | return rx; | ||
| 1100 | } | ||
| 1101 | } else { | ||
| 1102 | return op.apply(null, arguments); | ||
| 1103 | } | ||
| 1104 | }; | ||
| 1105 | }; | ||
| 1106 | var gx = "optional not ignore cache".split(/\s/); | ||
| 1107 | for (var i = 0; i < gx.length; i++) { | ||
| 1108 | _[gx[i]] = _generator(_[gx[i]]); | ||
| 1109 | } | ||
| 1110 | var _vector = function (op) { | ||
| 1111 | return function () { | ||
| 1112 | if (arguments[0] instanceof Array) { | ||
| 1113 | return op.apply(null, arguments[0]); | ||
| 1114 | } else { | ||
| 1115 | return op.apply(null, arguments); | ||
| 1116 | } | ||
| 1117 | }; | ||
| 1118 | }; | ||
| 1119 | var vx = "each any all".split(/\s/); | ||
| 1120 | for (var j = 0; j < vx.length; j++) { | ||
| 1121 | _[vx[j]] = _vector(_[vx[j]]); | ||
| 1122 | } | ||
| 1123 | }()); | ||
| 1124 | (function () { | ||
| 1125 | var $D = Date, | ||
| 1126 | $P = $D.prototype, | ||
| 1127 | $C = $D.CultureInfo; | ||
| 1128 | var flattenAndCompact = function (ax) { | ||
| 1129 | var rx = []; | ||
| 1130 | for (var i = 0; i < ax.length; i++) { | ||
| 1131 | if (ax[i] instanceof Array) { | ||
| 1132 | rx = rx.concat(flattenAndCompact(ax[i])); | ||
| 1133 | } else { | ||
| 1134 | if (ax[i]) { | ||
| 1135 | rx.push(ax[i]); | ||
| 1136 | } | ||
| 1137 | } | ||
| 1138 | } | ||
| 1139 | return rx; | ||
| 1140 | }; | ||
| 1141 | $D.Grammar = {}; | ||
| 1142 | $D.Translator = { | ||
| 1143 | hour: function (s) { | ||
| 1144 | return function () { | ||
| 1145 | this.hour = Number(s); | ||
| 1146 | }; | ||
| 1147 | }, | ||
| 1148 | minute: function (s) { | ||
| 1149 | return function () { | ||
| 1150 | this.minute = Number(s); | ||
| 1151 | }; | ||
| 1152 | }, | ||
| 1153 | second: function (s) { | ||
| 1154 | return function () { | ||
| 1155 | this.second = Number(s); | ||
| 1156 | }; | ||
| 1157 | }, | ||
| 1158 | meridian: function (s) { | ||
| 1159 | return function () { | ||
| 1160 | this.meridian = s.slice(0, 1).toLowerCase(); | ||
| 1161 | }; | ||
| 1162 | }, | ||
| 1163 | timezone: function (s) { | ||
| 1164 | return function () { | ||
| 1165 | var n = s.replace(/[^\d\+\-]/g, ""); | ||
| 1166 | if (n.length) { | ||
| 1167 | this.timezoneOffset = Number(n); | ||
| 1168 | } else { | ||
| 1169 | this.timezone = s.toLowerCase(); | ||
| 1170 | } | ||
| 1171 | }; | ||
| 1172 | }, | ||
| 1173 | day: function (x) { | ||
| 1174 | var s = x[0]; | ||
| 1175 | return function () { | ||
| 1176 | this.day = Number(s.match(/\d+/)[0]); | ||
| 1177 | }; | ||
| 1178 | }, | ||
| 1179 | month: function (s) { | ||
| 1180 | return function () { | ||
| 1181 | this.month = (s.length == 3) ? "jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s) / 4 : Number(s) - 1; | ||
| 1182 | }; | ||
| 1183 | }, | ||
| 1184 | year: function (s) { | ||
| 1185 | return function () { | ||
| 1186 | var n = Number(s); | ||
| 1187 | this.year = ((s.length > 2) ? n : (n + (((n + 2000) < $C.twoDigitYearMax) ? 2000 : 1900))); | ||
| 1188 | }; | ||
| 1189 | }, | ||
| 1190 | rday: function (s) { | ||
| 1191 | return function () { | ||
| 1192 | switch (s) { | ||
| 1193 | case "yesterday": | ||
| 1194 | this.days = -1; | ||
| 1195 | break; | ||
| 1196 | case "tomorrow": | ||
| 1197 | this.days = 1; | ||
| 1198 | break; | ||
| 1199 | case "today": | ||
| 1200 | this.days = 0; | ||
| 1201 | break; | ||
| 1202 | case "now": | ||
| 1203 | this.days = 0; | ||
| 1204 | this.now = true; | ||
| 1205 | break; | ||
| 1206 | } | ||
| 1207 | }; | ||
| 1208 | }, | ||
| 1209 | finishExact: function (x) { | ||
| 1210 | x = (x instanceof Array) ? x : [x]; | ||
| 1211 | for (var i = 0; i < x.length; i++) { | ||
| 1212 | if (x[i]) { | ||
| 1213 | x[i].call(this); | ||
| 1214 | } | ||
| 1215 | } | ||
| 1216 | var now = new Date(); | ||
| 1217 | if ((this.hour || this.minute) && (!this.month && !this.year && !this.day)) { | ||
| 1218 | this.day = now.getDate(); | ||
| 1219 | } | ||
| 1220 | if (!this.year) { | ||
| 1221 | this.year = now.getFullYear(); | ||
| 1222 | } | ||
| 1223 | if (!this.month && this.month !== 0) { | ||
| 1224 | this.month = now.getMonth(); | ||
| 1225 | } | ||
| 1226 | if (!this.day) { | ||
| 1227 | this.day = 1; | ||
| 1228 | } | ||
| 1229 | if (!this.hour) { | ||
| 1230 | this.hour = 0; | ||
| 1231 | } | ||
| 1232 | if (!this.minute) { | ||
| 1233 | this.minute = 0; | ||
| 1234 | } | ||
| 1235 | if (!this.second) { | ||
| 1236 | this.second = 0; | ||
| 1237 | } | ||
| 1238 | if (this.meridian && this.hour) { | ||
| 1239 | if (this.meridian == "p" && this.hour < 12) { | ||
| 1240 | this.hour = this.hour + 12; | ||
| 1241 | } else if (this.meridian == "a" && this.hour == 12) { | ||
| 1242 | this.hour = 0; | ||
| 1243 | } | ||
| 1244 | } | ||
| 1245 | if (this.day > $D.getDaysInMonth(this.year, this.month)) { | ||
| 1246 | throw new RangeError(this.day + " is not a valid value for days."); | ||
| 1247 | } | ||
| 1248 | var r = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second); | ||
| 1249 | if (this.timezone) { | ||
| 1250 | r.set({ | ||
| 1251 | timezone: this.timezone | ||
| 1252 | }); | ||
| 1253 | } else if (this.timezoneOffset) { | ||
| 1254 | r.set({ | ||
| 1255 | timezoneOffset: this.timezoneOffset | ||
| 1256 | }); | ||
| 1257 | } | ||
| 1258 | return r; | ||
| 1259 | }, | ||
| 1260 | finish: function (x) { | ||
| 1261 | x = (x instanceof Array) ? flattenAndCompact(x) : [x]; | ||
| 1262 | if (x.length === 0) { | ||
| 1263 | return null; | ||
| 1264 | } | ||
| 1265 | for (var i = 0; i < x.length; i++) { | ||
| 1266 | if (typeof x[i] == "function") { | ||
| 1267 | x[i].call(this); | ||
| 1268 | } | ||
| 1269 | } | ||
| 1270 | var today = $D.today(); | ||
| 1271 | if (this.now && !this.unit && !this.operator) { | ||
| 1272 | return new Date(); | ||
| 1273 | } else if (this.now) { | ||
| 1274 | today = new Date(); | ||
| 1275 | } | ||
| 1276 | var expression = !!(this.days && this.days !== null || this.orient || this.operator); | ||
| 1277 | var gap, mod, orient; | ||
| 1278 | orient = ((this.orient == "past" || this.operator == "subtract") ? -1 : 1); | ||
| 1279 | if (!this.now && "hour minute second".indexOf(this.unit) != -1) { | ||
| 1280 | today.setTimeToNow(); | ||
| 1281 | } | ||
| 1282 | if (this.month || this.month === 0) { | ||
| 1283 | if ("year day hour minute second".indexOf(this.unit) != -1) { | ||
| 1284 | this.value = this.month + 1; | ||
| 1285 | this.month = null; | ||
| 1286 | expression = true; | ||
| 1287 | } | ||
| 1288 | } | ||
| 1289 | if (!expression && this.weekday && !this.day && !this.days) { | ||
| 1290 | var temp = Date[this.weekday](); | ||
| 1291 | this.day = temp.getDate(); | ||
| 1292 | if (!this.month) { | ||
| 1293 | this.month = temp.getMonth(); | ||
| 1294 | } | ||
| 1295 | this.year = temp.getFullYear(); | ||
| 1296 | } | ||
| 1297 | if (expression && this.weekday && this.unit != "month") { | ||
| 1298 | this.unit = "day"; | ||
| 1299 | gap = ($D.getDayNumberFromName(this.weekday) - today.getDay()); | ||
| 1300 | mod = 7; | ||
| 1301 | this.days = gap ? ((gap + (orient * mod)) % mod) : (orient * mod); | ||
| 1302 | } | ||
| 1303 | if (this.month && this.unit == "day" && this.operator) { | ||
| 1304 | this.value = (this.month + 1); | ||
| 1305 | this.month = null; | ||
| 1306 | } | ||
| 1307 | if (this.value != null && this.month != null && this.year != null) { | ||
| 1308 | this.day = this.value * 1; | ||
| 1309 | } | ||
| 1310 | if (this.month && !this.day && this.value) { | ||
| 1311 | today.set({ | ||
| 1312 | day: this.value * 1 | ||
| 1313 | }); | ||
| 1314 | if (!expression) { | ||
| 1315 | this.day = this.value * 1; | ||
| 1316 | } | ||
| 1317 | } | ||
| 1318 | if (!this.month && this.value && this.unit == "month" && !this.now) { | ||
| 1319 | this.month = this.value; | ||
| 1320 | expression = true; | ||
| 1321 | } | ||
| 1322 | if (expression && (this.month || this.month === 0) && this.unit != "year") { | ||
| 1323 | this.unit = "month"; | ||
| 1324 | gap = (this.month - today.getMonth()); | ||
| 1325 | mod = 12; | ||
| 1326 | this.months = gap ? ((gap + (orient * mod)) % mod) : (orient * mod); | ||
| 1327 | this.month = null; | ||
| 1328 | } | ||
| 1329 | if (!this.unit) { | ||
| 1330 | this.unit = "day"; | ||
| 1331 | } | ||
| 1332 | if (!this.value && this.operator && this.operator !== null && this[this.unit + "s"] && this[this.unit + "s"] !== null) { | ||
| 1333 | this[this.unit + "s"] = this[this.unit + "s"] + ((this.operator == "add") ? 1 : -1) + (this.value || 0) * orient; | ||
| 1334 | } else if (this[this.unit + "s"] == null || this.operator != null) { | ||
| 1335 | if (!this.value) { | ||
| 1336 | this.value = 1; | ||
| 1337 | } | ||
| 1338 | this[this.unit + "s"] = this.value * orient; | ||
| 1339 | } | ||
| 1340 | if (this.meridian && this.hour) { | ||
| 1341 | if (this.meridian == "p" && this.hour < 12) { | ||
| 1342 | this.hour = this.hour + 12; | ||
| 1343 | } else if (this.meridian == "a" && this.hour == 12) { | ||
| 1344 | this.hour = 0; | ||
| 1345 | } | ||
| 1346 | } | ||
| 1347 | if (this.weekday && !this.day && !this.days) { | ||
| 1348 | var temp = Date[this.weekday](); | ||
| 1349 | this.day = temp.getDate(); | ||
| 1350 | if (temp.getMonth() !== today.getMonth()) { | ||
| 1351 | this.month = temp.getMonth(); | ||
| 1352 | } | ||
| 1353 | } | ||
| 1354 | if ((this.month || this.month === 0) && !this.day) { | ||
| 1355 | this.day = 1; | ||
| 1356 | } | ||
| 1357 | if (!this.orient && !this.operator && this.unit == "week" && this.value && !this.day && !this.month) { | ||
| 1358 | return Date.today().setWeek(this.value); | ||
| 1359 | } | ||
| 1360 | if (expression && this.timezone && this.day && this.days) { | ||
| 1361 | this.day = this.days; | ||
| 1362 | } | ||
| 1363 | return (expression) ? today.add(this) : today.set(this); | ||
| 1364 | } | ||
| 1365 | }; | ||
| 1366 | var _ = $D.Parsing.Operators, | ||
| 1367 | g = $D.Grammar, | ||
| 1368 | t = $D.Translator, | ||
| 1369 | _fn; | ||
| 1370 | g.datePartDelimiter = _.rtoken(/^([\s\-\.\,\/\x27]+)/); | ||
| 1371 | g.timePartDelimiter = _.stoken(":"); | ||
| 1372 | g.whiteSpace = _.rtoken(/^\s*/); | ||
| 1373 | g.generalDelimiter = _.rtoken(/^(([\s\,]|at|@|on)+)/); | ||
| 1374 | var _C = {}; | ||
| 1375 | g.ctoken = function (keys) { | ||
| 1376 | var fn = _C[keys]; | ||
| 1377 | if (!fn) { | ||
| 1378 | var c = $C.regexPatterns; | ||
| 1379 | var kx = keys.split(/\s+/), | ||
| 1380 | px = []; | ||
| 1381 | for (var i = 0; i < kx.length; i++) { | ||
| 1382 | px.push(_.replace(_.rtoken(c[kx[i]]), kx[i])); | ||
| 1383 | } | ||
| 1384 | fn = _C[keys] = _.any.apply(null, px); | ||
| 1385 | } | ||
| 1386 | return fn; | ||
| 1387 | }; | ||
| 1388 | g.ctoken2 = function (key) { | ||
| 1389 | return _.rtoken($C.regexPatterns[key]); | ||
| 1390 | }; | ||
| 1391 | g.h = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour)); | ||
| 1392 | g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/), t.hour)); | ||
| 1393 | g.H = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour)); | ||
| 1394 | g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/), t.hour)); | ||
| 1395 | g.m = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.minute)); | ||
| 1396 | g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.minute)); | ||
| 1397 | g.s = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.second)); | ||
| 1398 | g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.second)); | ||
| 1399 | g.hms = _.cache(_.sequence([g.H, g.m, g.s], g.timePartDelimiter)); | ||
| 1400 | g.t = _.cache(_.process(g.ctoken2("shortMeridian"), t.meridian)); | ||
| 1401 | g.tt = _.cache(_.process(g.ctoken2("longMeridian"), t.meridian)); | ||
| 1402 | g.z = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone)); | ||
| 1403 | g.zz = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone)); | ||
| 1404 | g.zzz = _.cache(_.process(g.ctoken2("timezone"), t.timezone)); | ||
| 1405 | g.timeSuffix = _.each(_.ignore(g.whiteSpace), _.set([g.tt, g.zzz])); | ||
| 1406 | g.time = _.each(_.optional(_.ignore(_.stoken("T"))), g.hms, g.timeSuffix); | ||
| 1407 | g.d = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/), _.optional(g.ctoken2("ordinalSuffix"))), t.day)); | ||
| 1408 | g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/), _.optional(g.ctoken2("ordinalSuffix"))), t.day)); | ||
| 1409 | g.ddd = g.dddd = _.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"), function (s) { | ||
| 1410 | return function () { | ||
| 1411 | this.weekday = s; | ||
| 1412 | }; | ||
| 1413 | })); | ||
| 1414 | g.M = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month)); | ||
| 1415 | g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/), t.month)); | ||
| 1416 | g.MMM = g.MMMM = _.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"), t.month)); | ||
| 1417 | g.y = _.cache(_.process(_.rtoken(/^(\d\d?)/), t.year)); | ||
| 1418 | g.yy = _.cache(_.process(_.rtoken(/^(\d\d)/), t.year)); | ||
| 1419 | g.yyy = _.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/), t.year)); | ||
| 1420 | g.yyyy = _.cache(_.process(_.rtoken(/^(\d\d\d\d)/), t.year)); | ||
| 1421 | _fn = function () { | ||
| 1422 | return _.each(_.any.apply(null, arguments), _.not(g.ctoken2("timeContext"))); | ||
| 1423 | }; | ||
| 1424 | g.day = _fn(g.d, g.dd); | ||
| 1425 | g.month = _fn(g.M, g.MMM); | ||
| 1426 | g.year = _fn(g.yyyy, g.yy); | ||
| 1427 | g.orientation = _.process(g.ctoken("past future"), function (s) { | ||
| 1428 | return function () { | ||
| 1429 | this.orient = s; | ||
| 1430 | }; | ||
| 1431 | }); | ||
| 1432 | g.operator = _.process(g.ctoken("add subtract"), function (s) { | ||
| 1433 | return function () { | ||
| 1434 | this.operator = s; | ||
| 1435 | }; | ||
| 1436 | }); | ||
| 1437 | g.rday = _.process(g.ctoken("yesterday tomorrow today now"), t.rday); | ||
| 1438 | g.unit = _.process(g.ctoken("second minute hour day week month year"), function (s) { | ||
| 1439 | return function () { | ||
| 1440 | this.unit = s; | ||
| 1441 | }; | ||
| 1442 | }); | ||
| 1443 | g.value = _.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/), function (s) { | ||
| 1444 | return function () { | ||
| 1445 | this.value = s.replace(/\D/g, ""); | ||
| 1446 | }; | ||
| 1447 | }); | ||
| 1448 | g.expression = _.set([g.rday, g.operator, g.value, g.unit, g.orientation, g.ddd, g.MMM]); | ||
| 1449 | _fn = function () { | ||
| 1450 | return _.set(arguments, g.datePartDelimiter); | ||
| 1451 | }; | ||
| 1452 | g.mdy = _fn(g.ddd, g.month, g.day, g.year); | ||
| 1453 | g.ymd = _fn(g.ddd, g.year, g.month, g.day); | ||
| 1454 | g.dmy = _fn(g.ddd, g.day, g.month, g.year); | ||
| 1455 | g.date = function (s) { | ||
| 1456 | return ((g[$C.dateElementOrder] || g.mdy).call(this, s)); | ||
| 1457 | }; | ||
| 1458 | g.format = _.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/), function (fmt) { | ||
| 1459 | if (g[fmt]) { | ||
| 1460 | return g[fmt]; | ||
| 1461 | } else { | ||
| 1462 | throw $D.Parsing.Exception(fmt); | ||
| 1463 | } | ||
| 1464 | }), _.process(_.rtoken(/^[^dMyhHmstz]+/), function (s) { | ||
| 1465 | return _.ignore(_.stoken(s)); | ||
| 1466 | }))), function (rules) { | ||
| 1467 | return _.process(_.each.apply(null, rules), t.finishExact); | ||
| 1468 | }); | ||
| 1469 | var _F = {}; | ||
| 1470 | var _get = function (f) { | ||
| 1471 | return _F[f] = (_F[f] || g.format(f)[0]); | ||
| 1472 | }; | ||
| 1473 | g.formats = function (fx) { | ||
| 1474 | if (fx instanceof Array) { | ||
| 1475 | var rx = []; | ||
| 1476 | for (var i = 0; i < fx.length; i++) { | ||
| 1477 | rx.push(_get(fx[i])); | ||
| 1478 | } | ||
| 1479 | return _.any.apply(null, rx); | ||
| 1480 | } else { | ||
| 1481 | return _get(fx); | ||
| 1482 | } | ||
| 1483 | }; | ||
| 1484 | g._formats = g.formats(["\"yyyy-MM-ddTHH:mm:ssZ\"", "yyyy-MM-ddTHH:mm:ssZ", "yyyy-MM-ddTHH:mm:ssz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mmZ", "yyyy-MM-ddTHH:mmz", "yyyy-MM-ddTHH:mm", "ddd, MMM dd, yyyy H:mm:ss tt", "ddd MMM d yyyy HH:mm:ss zzz", "MMddyyyy", "ddMMyyyy", "Mddyyyy", "ddMyyyy", "Mdyyyy", "dMyyyy", "yyyy", "Mdyy", "dMyy", "d"]); | ||
| 1485 | g._start = _.process(_.set([g.date, g.time, g.expression], g.generalDelimiter, g.whiteSpace), t.finish); | ||
| 1486 | g.start = function (s) { | ||
| 1487 | try { | ||
| 1488 | var r = g._formats.call({}, s); | ||
| 1489 | if (r[1].length === 0) { | ||
| 1490 | return r; | ||
| 1491 | } | ||
| 1492 | } catch (e) {} | ||
| 1493 | return g._start.call({}, s); | ||
| 1494 | }; | ||
| 1495 | $D._parse = $D.parse; | ||
| 1496 | $D.parse = function (s) { | ||
| 1497 | var r = null; | ||
| 1498 | if (!s) { | ||
| 1499 | return null; | ||
| 1500 | } | ||
| 1501 | if (s instanceof Date) { | ||
| 1502 | return s; | ||
| 1503 | } | ||
| 1504 | try { | ||
| 1505 | r = $D.Grammar.start.call({}, s.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); | ||
| 1506 | } catch (e) { | ||
| 1507 | return null; | ||
| 1508 | } | ||
| 1509 | return ((r[1].length === 0) ? r[0] : null); | ||
| 1510 | }; | ||
| 1511 | $D.getParseFunction = function (fx) { | ||
| 1512 | var fn = $D.Grammar.formats(fx); | ||
| 1513 | return function (s) { | ||
| 1514 | var r = null; | ||
| 1515 | try { | ||
| 1516 | r = fn.call({}, s); | ||
| 1517 | } catch (e) { | ||
| 1518 | return null; | ||
| 1519 | } | ||
| 1520 | return ((r[1].length === 0) ? r[0] : null); | ||
| 1521 | }; | ||
| 1522 | }; | ||
| 1523 | $D.parseExact = function (s, fx) { | ||
| 1524 | return $D.getParseFunction(fx)(s); | ||
| 1525 | }; | ||
| 1526 | }()); | ||
| 1527 | |||
| 1528 | // module.exports = { | ||
| 1529 | // Date:Date | ||
| 1530 | // } | ||
| 1531 | |||
| 1532 | module.exports = Date; | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/utils/dom/clickoutside.js
0 → 100755
| 1 | import Vue from 'vue' | ||
| 2 | import { on } from './dom.js' | ||
| 3 | |||
| 4 | const nodeList = [] | ||
| 5 | const ctx = '@@clickoutsideContext' | ||
| 6 | |||
| 7 | !Vue.prototype.$isServer && on(document, 'click', e => { | ||
| 8 | nodeList.forEach(node => node[ctx].documentHandler(e)) | ||
| 9 | }) | ||
| 10 | /** | ||
| 11 | * v-clickoutside | ||
| 12 | * @desc 点击元素外面才会触发的事件 | ||
| 13 | * @example | ||
| 14 | * ```vue | ||
| 15 | * <div v-element-clickoutside="handleClose"> | ||
| 16 | * ``` | ||
| 17 | */ | ||
| 18 | export default { | ||
| 19 | bind (el, binding, vnode) { | ||
| 20 | const id = nodeList.push(el) - 1 | ||
| 21 | const documentHandler = function (e) { | ||
| 22 | if (!vnode.context || | ||
| 23 | el.contains(e.target) || | ||
| 24 | (vnode.context.popperElm && | ||
| 25 | vnode.context.popperElm.contains(e.target))) return | ||
| 26 | |||
| 27 | if (binding.expression && | ||
| 28 | el[ctx].methodName && | ||
| 29 | vnode.context[el[ctx].methodName]) { | ||
| 30 | vnode.context[el[ctx].methodName]() | ||
| 31 | } else { | ||
| 32 | el[ctx].bindingFn && el[ctx].bindingFn() | ||
| 33 | } | ||
| 34 | } | ||
| 35 | el[ctx] = { | ||
| 36 | id, | ||
| 37 | documentHandler, | ||
| 38 | methodName: binding.expression, | ||
| 39 | bindingFn: binding.value | ||
| 40 | } | ||
| 41 | }, | ||
| 42 | |||
| 43 | update (el, binding) { | ||
| 44 | el[ctx].methodName = binding.expression | ||
| 45 | el[ctx].bindingFn = binding.value | ||
| 46 | }, | ||
| 47 | |||
| 48 | unbind (el) { | ||
| 49 | const len = nodeList.length | ||
| 50 | |||
| 51 | for (let i = 0; i < len; i++) { | ||
| 52 | if (nodeList[i][ctx].id === el[ctx].id) { | ||
| 53 | nodeList.splice(i, 1) | ||
| 54 | break | ||
| 55 | } | ||
| 56 | } | ||
| 57 | } | ||
| 58 | } |
src/utils/dom/dom.js
0 → 100755
| 1 | /* eslint-disable */ | ||
| 2 | /* istanbul ignore next */ | ||
| 3 | import Vue from 'vue'; | ||
| 4 | |||
| 5 | const isServer = Vue.prototype.$isServer; | ||
| 6 | const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; | ||
| 7 | const MOZ_HACK_REGEXP = /^moz([A-Z])/; | ||
| 8 | const ieVersion = isServer ? 0 : Number(document.documentMode); | ||
| 9 | |||
| 10 | /* istanbul ignore next */ | ||
| 11 | const trim = function(string) { | ||
| 12 | return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ''); | ||
| 13 | }; | ||
| 14 | /* istanbul ignore next */ | ||
| 15 | const camelCase = function(name) { | ||
| 16 | return name.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { | ||
| 17 | return offset ? letter.toUpperCase() : letter; | ||
| 18 | }).replace(MOZ_HACK_REGEXP, 'Moz$1'); | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* istanbul ignore next */ | ||
| 22 | export const on = (function() { | ||
| 23 | if (!isServer && document.addEventListener) { | ||
| 24 | return function(element, event, handler) { | ||
| 25 | if (element && event && handler) { | ||
| 26 | element.addEventListener(event, handler, false); | ||
| 27 | } | ||
| 28 | }; | ||
| 29 | } else { | ||
| 30 | return function(element, event, handler) { | ||
| 31 | if (element && event && handler) { | ||
| 32 | element.attachEvent('on' + event, handler); | ||
| 33 | } | ||
| 34 | }; | ||
| 35 | } | ||
| 36 | })(); | ||
| 37 | |||
| 38 | /* istanbul ignore next */ | ||
| 39 | export const off = (function() { | ||
| 40 | if (!isServer && document.removeEventListener) { | ||
| 41 | return function(element, event, handler) { | ||
| 42 | if (element && event) { | ||
| 43 | element.removeEventListener(event, handler, false); | ||
| 44 | } | ||
| 45 | }; | ||
| 46 | } else { | ||
| 47 | return function(element, event, handler) { | ||
| 48 | if (element && event) { | ||
| 49 | element.detachEvent('on' + event, handler); | ||
| 50 | } | ||
| 51 | }; | ||
| 52 | } | ||
| 53 | })(); | ||
| 54 | |||
| 55 | /* istanbul ignore next */ | ||
| 56 | export const once = function(el, event, fn) { | ||
| 57 | var listener = function() { | ||
| 58 | if (fn) { | ||
| 59 | fn.apply(this, arguments); | ||
| 60 | } | ||
| 61 | off(el, event, listener); | ||
| 62 | }; | ||
| 63 | on(el, event, listener); | ||
| 64 | }; | ||
| 65 | |||
| 66 | /* istanbul ignore next */ | ||
| 67 | export function hasClass(el, cls) { | ||
| 68 | if (!el || !cls) return false; | ||
| 69 | if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.'); | ||
| 70 | if (el.classList) { | ||
| 71 | return el.classList.contains(cls); | ||
| 72 | } else { | ||
| 73 | return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1; | ||
| 74 | } | ||
| 75 | }; | ||
| 76 | |||
| 77 | /* istanbul ignore next */ | ||
| 78 | export function addClass(el, cls) { | ||
| 79 | if (!el) return; | ||
| 80 | var curClass = el.className; | ||
| 81 | var classes = (cls || '').split(' '); | ||
| 82 | |||
| 83 | for (var i = 0, j = classes.length; i < j; i++) { | ||
| 84 | var clsName = classes[i]; | ||
| 85 | if (!clsName) continue; | ||
| 86 | |||
| 87 | if (el.classList) { | ||
| 88 | el.classList.add(clsName); | ||
| 89 | } else { | ||
| 90 | if (!hasClass(el, clsName)) { | ||
| 91 | curClass += ' ' + clsName; | ||
| 92 | } | ||
| 93 | } | ||
| 94 | } | ||
| 95 | if (!el.classList) { | ||
| 96 | el.className = curClass; | ||
| 97 | } | ||
| 98 | }; | ||
| 99 | |||
| 100 | /* istanbul ignore next */ | ||
| 101 | export function removeClass(el, cls) { | ||
| 102 | if (!el || !cls) return; | ||
| 103 | var classes = cls.split(' '); | ||
| 104 | var curClass = ' ' + el.className + ' '; | ||
| 105 | |||
| 106 | for (var i = 0, j = classes.length; i < j; i++) { | ||
| 107 | var clsName = classes[i]; | ||
| 108 | if (!clsName) continue; | ||
| 109 | |||
| 110 | if (el.classList) { | ||
| 111 | el.classList.remove(clsName); | ||
| 112 | } else { | ||
| 113 | if (hasClass(el, clsName)) { | ||
| 114 | curClass = curClass.replace(' ' + clsName + ' ', ' '); | ||
| 115 | } | ||
| 116 | } | ||
| 117 | } | ||
| 118 | if (!el.classList) { | ||
| 119 | el.className = trim(curClass); | ||
| 120 | } | ||
| 121 | }; | ||
| 122 | |||
| 123 | /* istanbul ignore next */ | ||
| 124 | export const getStyle = ieVersion < 9 ? function(element, styleName) { | ||
| 125 | if (isServer) return; | ||
| 126 | if (!element || !styleName) return null; | ||
| 127 | styleName = camelCase(styleName); | ||
| 128 | if (styleName === 'float') { | ||
| 129 | styleName = 'styleFloat'; | ||
| 130 | } | ||
| 131 | try { | ||
| 132 | switch (styleName) { | ||
| 133 | case 'opacity': | ||
| 134 | try { | ||
| 135 | return element.filters.item('alpha').opacity / 100; | ||
| 136 | } catch (e) { | ||
| 137 | return 1.0; | ||
| 138 | } | ||
| 139 | default: | ||
| 140 | return (element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null); | ||
| 141 | } | ||
| 142 | } catch (e) { | ||
| 143 | return element.style[styleName]; | ||
| 144 | } | ||
| 145 | } : function(element, styleName) { | ||
| 146 | if (isServer) return; | ||
| 147 | if (!element || !styleName) return null; | ||
| 148 | styleName = camelCase(styleName); | ||
| 149 | if (styleName === 'float') { | ||
| 150 | styleName = 'cssFloat'; | ||
| 151 | } | ||
| 152 | try { | ||
| 153 | var computed = document.defaultView.getComputedStyle(element, ''); | ||
| 154 | return element.style[styleName] || computed ? computed[styleName] : null; | ||
| 155 | } catch (e) { | ||
| 156 | return element.style[styleName]; | ||
| 157 | } | ||
| 158 | }; | ||
| 159 | |||
| 160 | /* istanbul ignore next */ | ||
| 161 | export function setStyle(element, styleName, value) { | ||
| 162 | if (!element || !styleName) return; | ||
| 163 | |||
| 164 | if (typeof styleName === 'object') { | ||
| 165 | for (var prop in styleName) { | ||
| 166 | if (styleName.hasOwnProperty(prop)) { | ||
| 167 | setStyle(element, prop, styleName[prop]); | ||
| 168 | } | ||
| 169 | } | ||
| 170 | } else { | ||
| 171 | styleName = camelCase(styleName); | ||
| 172 | if (styleName === 'opacity' && ieVersion < 9) { | ||
| 173 | element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')'; | ||
| 174 | } else { | ||
| 175 | element.style[styleName] = value; | ||
| 176 | } | ||
| 177 | } | ||
| 178 | }; |
src/utils/utils.js
0 → 100644
| 1 | // 正在表达式 | ||
| 2 | export const REGEXPS = { | ||
| 3 | "mobile": /^1\d{10}$/ | ||
| 4 | } | ||
| 5 | |||
| 6 | // 验证手机 | ||
| 7 | export function checkMobile(str) { | ||
| 8 | return REGEXPS.mobile.test(str); | ||
| 9 | } | ||
| 10 | |||
| 11 | /** | ||
| 12 | * 链接参数转换为obj | ||
| 13 | * 入参 完整链接 | ||
| 14 | * @param {*} url | ||
| 15 | */ | ||
| 16 | export function param2Obj(url) { | ||
| 17 | const search = url.split('?')[1] | ||
| 18 | if (!search) { | ||
| 19 | return {} | ||
| 20 | } | ||
| 21 | return JSON.parse( | ||
| 22 | '{"' + | ||
| 23 | decodeURIComponent(search) | ||
| 24 | .replace(/"/g, '\\"') | ||
| 25 | .replace(/&/g, '","') | ||
| 26 | .replace(/=/g, '":"') + | ||
| 27 | '"}' | ||
| 28 | ) | ||
| 29 | } | ||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | //获取cookie、 | ||
| 34 | export function getCookie(name) { | ||
| 35 | var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); | ||
| 36 | if (arr = document.cookie.match(reg)) | ||
| 37 | return (arr[2]); | ||
| 38 | else | ||
| 39 | return null; | ||
| 40 | } | ||
| 41 | |||
| 42 | //设置cookie | ||
| 43 | export function setCookie(c_name, value, expiredays) { | ||
| 44 | var exdate = new Date(); | ||
| 45 | exdate.setDate(exdate.getDate() + expiredays); | ||
| 46 | document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); | ||
| 47 | }; | ||
| 48 | |||
| 49 | //删除cookie | ||
| 50 | export function delCookie(name) { | ||
| 51 | var exp = new Date(); | ||
| 52 | exp.setTime(exp.getTime() - 1); | ||
| 53 | var cval = getCookie(name); | ||
| 54 | if (cval != null) | ||
| 55 | document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); | ||
| 56 | }; | ||
| 57 | |||
| 58 | |||
| 59 | /** | ||
| 60 | * 获取环境信息 | ||
| 61 | * @return {Object} 环境信息对象 | ||
| 62 | */ | ||
| 63 | export function getEnv() { | ||
| 64 | var nav = window.navigator; | ||
| 65 | var env = { | ||
| 66 | "iphone": false, | ||
| 67 | "ipad": false, | ||
| 68 | "android": false, | ||
| 69 | "pc": false, | ||
| 70 | "ios": false, | ||
| 71 | "ver": "0" | ||
| 72 | }; | ||
| 73 | |||
| 74 | var ua = nav.userAgent; | ||
| 75 | var android = ua.match(/(Android)\s+([\d.]+)/); | ||
| 76 | var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); | ||
| 77 | var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); | ||
| 78 | if (ipad) { | ||
| 79 | env.ipad = ipad[1] && true || false; | ||
| 80 | env.ver = ipad[2] && ipad[2].replace(/-/g, ".") || ""; | ||
| 81 | env.ios = true; | ||
| 82 | } else if (iphone) { | ||
| 83 | env.iphone = iphone[1] && true || false; | ||
| 84 | env.ver = iphone[2] && iphone[2].replace(/-/g, ".") || ""; | ||
| 85 | env.ios = true; | ||
| 86 | } else if (android) { | ||
| 87 | env.android = android[1] && true || false; | ||
| 88 | env.ver = android[2]; | ||
| 89 | } else { | ||
| 90 | env.pc = true; | ||
| 91 | } | ||
| 92 | |||
| 93 | return env; | ||
| 94 | } | ||
| 95 | |||
| 96 | /** | ||
| 97 | * 设定页面 title | ||
| 98 | * @param {[type]} title [description] | ||
| 99 | */ | ||
| 100 | export function setTitle(title) { | ||
| 101 | if (!title) { | ||
| 102 | return; | ||
| 103 | } | ||
| 104 | document.title = title; | ||
| 105 | // if (ENV.ios && navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1) { | ||
| 106 | // 修复微信端IOS无法修改document.title的情况 | ||
| 107 | if (getEnv().ios && (navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1 || navigator.userAgent.toLowerCase().indexOf("alipay") !== -1)) { | ||
| 108 | //修复IOS微信端和支付宝无法修改document.title的情况 | ||
| 109 | var $iframe = document.createElement('iframe'); | ||
| 110 | $iframe.className = "C-hiddenIframe"; | ||
| 111 | $iframe.src = "/" + location.pathname.split('/')[1] + "/favicon.ico"; | ||
| 112 | $iframe.style.visibility = 'hidden'; | ||
| 113 | $iframe.style.width = '1px'; | ||
| 114 | $iframe.style.height = '1px'; | ||
| 115 | $iframe.onload = function onIframeLoad() { | ||
| 116 | setTimeout(function () { | ||
| 117 | $iframe.onload = null; | ||
| 118 | onIframeLoad = null; | ||
| 119 | document.body.removeChild($iframe); | ||
| 120 | $iframe = null; | ||
| 121 | }, 0); | ||
| 122 | }; | ||
| 123 | document.body.appendChild($iframe); | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | // 为链接添加参数 | ||
| 128 | export function addQuery(url, query) { | ||
| 129 | query = query || {} | ||
| 130 | query = (function (query) { | ||
| 131 | var q = [] | ||
| 132 | Object.keys(query).forEach(function (_q) { | ||
| 133 | q.push(_q + '=' + query[_q]) | ||
| 134 | }) | ||
| 135 | return q.join('&') | ||
| 136 | })(query) | ||
| 137 | if (url.indexOf('?') !== -1) { | ||
| 138 | url += '&' + query | ||
| 139 | } else { | ||
| 140 | url += '?' + query | ||
| 141 | } | ||
| 142 | return url | ||
| 143 | } | ||
| 144 | |||
| 145 | |||
| 146 | /** | ||
| 147 | * 获得当前页面的path | ||
| 148 | * @return {String} 页面path | ||
| 149 | */ | ||
| 150 | export function getPath() { | ||
| 151 | var path = window.location.hash; | ||
| 152 | path = path || "#/"; | ||
| 153 | path = path === "#/" ? "#/index" : path; | ||
| 154 | path = path.split("?"); | ||
| 155 | return path[0]; | ||
| 156 | } | ||
| 157 | |||
| 158 | // 获取 url 参数 | ||
| 159 | export function getQuery(name) { | ||
| 160 | return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null; | ||
| 161 | } | ||
| 162 | |||
| 163 | /** | ||
| 164 | * 把 \n换行符转换成<br> | ||
| 165 | * 转换后需要用 v-html渲染 | ||
| 166 | * 用{{}}会当成字符串把 html渲染出来 | ||
| 167 | */ | ||
| 168 | export function formatBr(str) { | ||
| 169 | str = str.replace(/\n/g, '<br/>') | ||
| 170 | return str | ||
| 171 | }; | ||
| 172 | |||
| 173 | |||
| 174 | /** | ||
| 175 | * @desc 函数防抖 | ||
| 176 | * @param func 函数 | ||
| 177 | * @param wait 延迟执行毫秒数 | ||
| 178 | * @param immediate true 表立即执行,false 表非立即执行 | ||
| 179 | */ | ||
| 180 | export function debounce(func, wait, immediate) { | ||
| 181 | let timeout; | ||
| 182 | |||
| 183 | return function () { | ||
| 184 | let context = this; | ||
| 185 | let args = arguments; | ||
| 186 | |||
| 187 | if (timeout) clearTimeout(timeout); | ||
| 188 | if (immediate) { | ||
| 189 | var callNow = !timeout; | ||
| 190 | timeout = setTimeout(() => { | ||
| 191 | timeout = null; | ||
| 192 | }, wait) | ||
| 193 | if (callNow) func.apply(context, args) | ||
| 194 | } else { | ||
| 195 | timeout = setTimeout(function () { | ||
| 196 | func.apply(context, args) | ||
| 197 | }, wait); | ||
| 198 | } | ||
| 199 | } | ||
| 200 | } | ||
| 201 | |||
| 202 | /** | ||
| 203 | * @desc 函数节流 | ||
| 204 | * @param func 函数 | ||
| 205 | * @param wait 延迟执行毫秒数 | ||
| 206 | * @param type 1 表时间戳版,2 表定时器版 | ||
| 207 | * 时间戳版的函数触发是在时间段内开始的时候,而定时器版的函数触发是在时间段内结束的时候。 | ||
| 208 | */ | ||
| 209 | export function throttle(func, wait, type) { | ||
| 210 | if (type === 1) { | ||
| 211 | var previous = 0; | ||
| 212 | } else if (type === 2) { | ||
| 213 | var timeout; | ||
| 214 | } | ||
| 215 | return function () { | ||
| 216 | let context = this; | ||
| 217 | let args = arguments; | ||
| 218 | if (type === 1) { | ||
| 219 | let now = Date.now(); | ||
| 220 | |||
| 221 | if (now - previous > wait) { | ||
| 222 | func.apply(context, args); | ||
| 223 | previous = now; | ||
| 224 | } | ||
| 225 | } else if (type === 2) { | ||
| 226 | if (!timeout) { | ||
| 227 | timeout = setTimeout(() => { | ||
| 228 | timeout = null; | ||
| 229 | func.apply(context, args) | ||
| 230 | }, wait) | ||
| 231 | } | ||
| 232 | } | ||
| 233 | } | ||
| 234 | } |
src/utils/wechat.js
0 → 100644
| 1 | import wx from 'weixin-js-sdk'; | ||
| 2 | |||
| 3 | wx.ready(function () { //通过ready接口处理成功验证 | ||
| 4 | // config信息验证成功后会执行ready方法 | ||
| 5 | wx.onMenuShareAppMessage({ // 分享给朋友 ,在config里面填写需要使用的JS接口列表,然后这个方法才可以用 | ||
| 6 | title: '这里是标题', // 分享标题 | ||
| 7 | desc: 'This is a test!', // 分享描述 | ||
| 8 | link: '链接', // 分享链接 | ||
| 9 | imgUrl: '图片', // 分享图标 | ||
| 10 | type: '', // 分享类型,music、video或link,不填默认为link | ||
| 11 | dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 | ||
| 12 | success: function () { | ||
| 13 | // 用户确认分享后执行的回调函数 | ||
| 14 | }, | ||
| 15 | cancel: function () { | ||
| 16 | // 用户取消分享后执行的回调函数 | ||
| 17 | } | ||
| 18 | }); | ||
| 19 | wx.onMenuShareTimeline({ //分享朋友圈 | ||
| 20 | title: '标题', // 分享标题 | ||
| 21 | link: '链接', | ||
| 22 | imgUrl: '图片', // 分享图标 | ||
| 23 | success: function () { | ||
| 24 | // 用户确认分享后执行的回调函数 | ||
| 25 | }, | ||
| 26 | cancel: function () { | ||
| 27 | // 用户取消分享后执行的回调函数 | ||
| 28 | } | ||
| 29 | }); | ||
| 30 | }); | ||
| 31 | wx.error(function (res) {//通过error接口处理失败验证 | ||
| 32 | // config信息验证失败会执行error函数 | ||
| 33 | }); | ||
| 34 | |||
| 35 | |||
| 36 | wx.config({ | ||
| 37 | debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 | ||
| 38 | appId: '', // 必填,公众号的唯一标识 | ||
| 39 | timestamp: '', // 必填,生成签名的时间戳 | ||
| 40 | nonceStr: '', // 必填,生成签名的随机串 | ||
| 41 | signature: '',// 必填,签名,见附录1 | ||
| 42 | jsApiList: [] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 | ||
| 43 | }); |
vue.config.js
0 → 100644
| 1 | const Timestamp = new Date().getTime(); | ||
| 2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
| 3 | // 打包目录 | ||
| 4 | let webpack_public_path = 'dist' | ||
| 5 | var path = require('path') | ||
| 6 | const PrerenderSPAPlugin = require('prerender-spa-plugin') | ||
| 7 | const Renderer = PrerenderSPAPlugin.PuppeteerRenderer | ||
| 8 | |||
| 9 | let plugins = [ | ||
| 10 | new MiniCssExtractPlugin({ | ||
| 11 | filename: `static/css/[name].${Timestamp}.css`, | ||
| 12 | chunkFilename: `static/css/[name].${Timestamp}.css` | ||
| 13 | }) | ||
| 14 | ]; | ||
| 15 | |||
| 16 | if (process.env.NODE_ENV === 'production') { | ||
| 17 | // 生产环境 | ||
| 18 | webpack_public_path = process.env.VUE_APP_TITLE | ||
| 19 | plugins.push( | ||
| 20 | new PrerenderSPAPlugin({ | ||
| 21 | staticDir: path.join(__dirname, 'dist'), | ||
| 22 | routes: ['/', '/demo', '/about'], | ||
| 23 | renderer: new Renderer({ | ||
| 24 | inject: { | ||
| 25 | foo: 'bar' | ||
| 26 | }, | ||
| 27 | headless: false, | ||
| 28 | renderAfterDocumentEvent: 'render-event', | ||
| 29 | //renderAfterTime: 5000, | ||
| 30 | //renderAfterElementExists: 'my-app-element' | ||
| 31 | }) | ||
| 32 | }) | ||
| 33 | ) | ||
| 34 | } else { | ||
| 35 | // 开发环境 | ||
| 36 | } | ||
| 37 | |||
| 38 | function resolve(dir) { | ||
| 39 | return path.join(__dirname, dir); | ||
| 40 | } | ||
| 41 | |||
| 42 | module.exports = { | ||
| 43 | lintOnSave: true, | ||
| 44 | chainWebpack: (config) => { | ||
| 45 | config.resolve.alias | ||
| 46 | .set('@', resolve('src')) | ||
| 47 | .set('@assets', resolve('src/assets')) | ||
| 48 | .set('@components', resolve('src/components')) | ||
| 49 | .set('@pages', resolve('src/pages')) | ||
| 50 | .set('@api', resolve('src/api')) | ||
| 51 | .set('@styles', resolve('src/styles')) | ||
| 52 | .set('@store', resolve('src/store')) | ||
| 53 | .set('@utils', resolve('src/utils')) | ||
| 54 | }, | ||
| 55 | configureWebpack: { // webpack 配置 | ||
| 56 | // 修改打包后js文件名 | ||
| 57 | output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】 | ||
| 58 | filename: `static/js/[name].${Timestamp}.js`, | ||
| 59 | chunkFilename: `static/js/[name].${Timestamp}.js` | ||
| 60 | }, | ||
| 61 | // 修改打包后css文件名 | ||
| 62 | plugins: plugins | ||
| 63 | }, | ||
| 64 | // 修改打包后img文件名 | ||
| 65 | // chainWebpack: config => { | ||
| 66 | // config.module | ||
| 67 | // .rule('images') | ||
| 68 | // .use('url-loader') | ||
| 69 | // .tap(options => { | ||
| 70 | // return { | ||
| 71 | // limit: 4096, | ||
| 72 | // fallback: { | ||
| 73 | // loader: 'file-loader', | ||
| 74 | // options: { | ||
| 75 | // name: `img/[name].${Timestamp}.[ext]` | ||
| 76 | // } | ||
| 77 | // } | ||
| 78 | // }; | ||
| 79 | // }) | ||
| 80 | // }, | ||
| 81 | // 部署生产环境和开发环境下的URL。 | ||
| 82 | // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 | ||
| 83 | //例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。 | ||
| 84 | //baseUrl 从 Vue CLI 3.3 起已弃用,请使用publicPath | ||
| 85 | //baseUrl: process.env.NODE_ENV === "production" ? "./" : "/", | ||
| 86 | publicPath: process.env.NODE_ENV === "dev" ? "/" : "./", | ||
| 87 | |||
| 88 | // outputDir: 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致) | ||
| 89 | outputDir: webpack_public_path, | ||
| 90 | //用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) | ||
| 91 | assetsDir: "assets", | ||
| 92 | //指定生成的 index.html 的输出路径 (打包之后,改变系统默认的index.html的文件名) | ||
| 93 | // indexPath: "myIndex.html", | ||
| 94 | //默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存。你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) | ||
| 95 | filenameHashing: false, | ||
| 96 | |||
| 97 | // lintOnSave:{ type:Boolean default:true } 问你是否使用eslint | ||
| 98 | lintOnSave: true, | ||
| 99 | //如果你想要在生产构建时禁用 eslint-loader,你可以用如下配置 | ||
| 100 | // lintOnSave: process.env.NODE_ENV !== 'production', | ||
| 101 | |||
| 102 | //是否使用包含运行时编译器的 Vue 构建版本。设置为 true 后你就可以在 Vue 组件中使用 template 选项了,但是这会让你的应用额外增加 10kb 左右。(默认false) | ||
| 103 | // runtimeCompiler: false, | ||
| 104 | |||
| 105 | /** | ||
| 106 | * 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 | ||
| 107 | * 打包之后发现map文件过大,项目文件体积很大,设置为false就可以不输出map文件 | ||
| 108 | * map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。 | ||
| 109 | * 有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。 | ||
| 110 | * */ | ||
| 111 | productionSourceMap: false, | ||
| 112 | |||
| 113 | // 它支持webPack-dev-server的所有选项 | ||
| 114 | // devServer: { | ||
| 115 | // host: "localhost", | ||
| 116 | // port: 9001, // 端口号 | ||
| 117 | // https: false, // https:{type:Boolean} | ||
| 118 | // open: true, //配置自动启动浏览器 | ||
| 119 | // // proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理 | ||
| 120 | // } | ||
| 121 | }; | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment