├── .gitignore ├── .vscode ├── css.code-snippets ├── exegesis.code-snippets ├── js.code-snippets ├── settings.json └── vue-html.code-snippets ├── README.md ├── babel.config.js ├── package.json ├── postcss.config.js ├── public └── index.html ├── src ├── App.vue ├── README.md ├── common │ ├── http-client.js │ └── utils │ │ ├── base.js │ │ ├── debounce.js │ │ ├── helper.js │ │ └── math.js ├── components │ ├── back-top.vue │ ├── empty-data.vue │ ├── load-more.vue │ ├── wkiwi-lazy-img.vue │ └── wkiwi-loading.vue ├── config │ ├── api.config.js │ └── app.config.js ├── main.js ├── manifest.json ├── mixins │ ├── base.js │ ├── loadMore.js │ └── shareTimeline.js ├── pages.json ├── pages │ ├── demo │ │ └── demo.vue │ ├── index │ │ ├── components │ │ │ └── child.vue │ │ └── index.vue │ └── mine │ │ └── mine.vue ├── plugins │ ├── vue-bus │ │ ├── index.js │ │ └── vue-bus.js │ └── vue-logger │ │ ├── index.js │ │ └── vue-logger.js ├── services │ ├── api-clinet.js │ ├── api.service.js │ └── auth.service.js ├── static │ └── img │ │ ├── home.png │ │ ├── homeHL.png │ │ ├── qq.png │ │ ├── sinaweibo.png │ │ ├── user.png │ │ ├── userHL.png │ │ └── weixin.png ├── store │ ├── index.js │ └── modules │ │ ├── app.js │ │ ├── auth.js │ │ └── index.js └── styles │ ├── aliicon.css │ ├── base.css │ ├── border.css │ └── common.css └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | unpackage/ 4 | dist/ 5 | docs/jsdoc/ 6 | 7 | # local env files 8 | .env.local 9 | .env.*.local 10 | 11 | # Log files 12 | npm-debug.log* 13 | yarn-debug.log* 14 | yarn-error.log* 15 | 16 | # Editor directories and files 17 | .project 18 | .idea 19 | # .vscode 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw* 25 | -------------------------------------------------------------------------------- /.vscode/css.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "#ifdef": { 3 | "body": [ 4 | "/* #ifdef ${1|APP-PLUS,MP,MP-ALIPAY,MP-BAIDU,MP-WEIXIN,MP-QQ,H5|} */", 5 | "$0", 6 | "/* #endif */" 7 | ], 8 | "prefix": "ifdef", 9 | "project": "uni-app", 10 | "scope": "css" 11 | }, 12 | "#ifndef": { 13 | "body": [ 14 | "/* #ifndef ${1|APP-PLUS,MP,MP-ALIPAY,MP-BAIDU,MP-WEIXIN,MP-QQ,H5|} */", 15 | "$0", 16 | "/* #endif */" 17 | ], 18 | "prefix": "ifndef", 19 | "project": "uni-app", 20 | "scope": "css" 21 | }, 22 | "-moz-": { 23 | "body": [ 24 | "-moz-" 25 | ], 26 | "prefix": "moz", 27 | "scope": "css", 28 | "triggerAssist": true 29 | }, 30 | "-ms-": { 31 | "body": [ 32 | "-ms-" 33 | ], 34 | "prefix": "ms", 35 | "scope": "css", 36 | "triggerAssist": true 37 | }, 38 | "-webkit-": { 39 | "body": [ 40 | "-webkit-" 41 | ], 42 | "prefix": "webkit", 43 | "scope": "css", 44 | "triggerAssist": true 45 | }, 46 | "@-moz-keyframes": { 47 | "body": [ 48 | "@-moz-keyframes ${1:name}{", 49 | "\tfrom{$2}", 50 | "\tto{$3}", 51 | "}" 52 | ], 53 | "prefix": "@keyframes", 54 | "scope": "CSS_OUTRULE" 55 | }, 56 | "@-ms-keyframes": { 57 | "body": [ 58 | "@-ms-keyframes ${1:name}{", 59 | "\tfrom{$2}", 60 | "\tto{$3}", 61 | "}" 62 | ], 63 | "prefix": "@keyframes", 64 | "scope": "CSS_OUTRULE" 65 | }, 66 | "@-webkit-keyframes": { 67 | "body": [ 68 | "@-webkit-keyframes ${1:name}{", 69 | "\tfrom{$2}", 70 | "\tto{$3}", 71 | "}" 72 | ], 73 | "prefix": "@keyframes", 74 | "scope": "CSS_OUTRULE" 75 | }, 76 | "@charset": { 77 | "body": [ 78 | "@charset \"${1:utf-8}\";" 79 | ], 80 | "prefix": "@charset", 81 | "scope": "CSS_OUTRULE" 82 | }, 83 | "@document": { 84 | "body": [ 85 | "@document ${1:url}(\"$2\") {", 86 | "\t$3", 87 | "}" 88 | ], 89 | "prefix": "@document", 90 | "scope": "CSS_OUTRULE" 91 | }, 92 | "@font-face": { 93 | "body": [ 94 | "@font-face {", 95 | "\tfont-family:$1;", 96 | "\tsrc: url($2);", 97 | "}" 98 | ], 99 | "prefix": "@fontface", 100 | "scope": "CSS_OUTRULE" 101 | }, 102 | "@import": { 103 | "body": [ 104 | "@import url(\"$1\");" 105 | ], 106 | "prefix": "@import", 107 | "scope": "CSS_OUTRULE", 108 | "triggerAssist": true 109 | }, 110 | "@keyframes": { 111 | "body": [ 112 | "@keyframes ${1:name}{", 113 | "\tfrom{$2}", 114 | "\tto{$3}", 115 | "}" 116 | ], 117 | "prefix": "@keyframes", 118 | "scope": "CSS_OUTRULE" 119 | }, 120 | "@media": { 121 | "body": [ 122 | "@media $1 {", 123 | "\t$2", 124 | "}" 125 | ], 126 | "prefix": "@media", 127 | "scope": "CSS_OUTRULE" 128 | }, 129 | "@namespace": { 130 | "body": [ 131 | "@namespace ${1:prefix} \"$2\";" 132 | ], 133 | "prefix": "@namespace", 134 | "scope": "CSS_OUTRULE" 135 | }, 136 | "@page": { 137 | "body": [ 138 | "@page:${1:first}{", 139 | "\t", 140 | "}" 141 | ], 142 | "prefix": "@page", 143 | "scope": "CSS_OUTRULE" 144 | }, 145 | "@supports": { 146 | "body": [ 147 | "@supports(${1:prop}:${2:value}) {", 148 | "\t$3", 149 | "}" 150 | ], 151 | "prefix": "@supports", 152 | "scope": "CSS_OUTRULE" 153 | }, 154 | "background-color": { 155 | "body": [ 156 | "background-color: $1" 157 | ], 158 | "prefix": "bc", 159 | "scope": "css", 160 | "triggerAssist": true 161 | }, 162 | "background-color: #": { 163 | "body": [ 164 | "background-color: #$1" 165 | ], 166 | "prefix": "bch", 167 | "scope": "css", 168 | "triggerAssist": true 169 | }, 170 | "background-color: rgb": { 171 | "body": [ 172 | "background-color: rgb(${1:255},${2:255},${3:255})" 173 | ], 174 | "prefix": "bcr", 175 | "scope": "css" 176 | }, 177 | "background-image": { 178 | "body": [ 179 | "background-image: $1" 180 | ], 181 | "prefix": "bi", 182 | "scope": "css", 183 | "triggerAssist": true 184 | }, 185 | "background-image: url": { 186 | "body": [ 187 | "background-image: url($1)" 188 | ], 189 | "prefix": "biu", 190 | "scope": "css", 191 | "triggerAssist": true 192 | }, 193 | "background-position": { 194 | "body": [ 195 | "background-position: $1" 196 | ], 197 | "prefix": "bp", 198 | "scope": "css", 199 | "triggerAssist": true 200 | }, 201 | "background: image repeat attachment position": { 202 | "body": [ 203 | "background: url($1) ${2:repeat} ${3:fixed} ${4:center};$0" 204 | ], 205 | "prefix": "bg", 206 | "scope": "css", 207 | "triggerAssist": true 208 | }, 209 | "border-color": { 210 | "body": [ 211 | "border-color: $1" 212 | ], 213 | "prefix": "boc", 214 | "scope": "css", 215 | "triggerAssist": true 216 | }, 217 | "border-style": { 218 | "body": [ 219 | "border-style: $1" 220 | ], 221 | "prefix": "bs", 222 | "scope": "css", 223 | "triggerAssist": true 224 | }, 225 | "border-width": { 226 | "body": [ 227 | "border-width: $1" 228 | ], 229 | "prefix": "bw", 230 | "scope": "css", 231 | "triggerAssist": true 232 | }, 233 | "display: block": { 234 | "body": [ 235 | "display: block;" 236 | ], 237 | "prefix": "db", 238 | "scope": "css" 239 | }, 240 | "display: flex": { 241 | "body": [ 242 | "display: flex;" 243 | ], 244 | "prefix": "df", 245 | "scope": "css" 246 | }, 247 | "display: none": { 248 | "body": [ 249 | "display: none;" 250 | ], 251 | "prefix": "dn", 252 | "scope": "css" 253 | }, 254 | "flex-direction: row": { 255 | "body": [ 256 | "flex-direction: row;" 257 | ], 258 | "prefix": "fdr", 259 | "scope": "css" 260 | }, 261 | "font-family: family": { 262 | "body": [ 263 | "font-family: $1" 264 | ], 265 | "prefix": "ff", 266 | "scope": "css", 267 | "triggerAssist": true 268 | }, 269 | "font-size: size": { 270 | "body": [ 271 | "font-size: $1" 272 | ], 273 | "prefix": "fsize", 274 | "scope": "css", 275 | "triggerAssist": true 276 | }, 277 | "height --status-bar-height": { 278 | "body": [ 279 | "height: var(--status-bar-height);" 280 | ], 281 | "prefix": "heightstatusbar", 282 | "project": "uni-app", 283 | "scope": "css" 284 | }, 285 | "height --window-bottom": { 286 | "body": [ 287 | "height: var(--window-bottom);" 288 | ], 289 | "prefix": "heightwindowbottom", 290 | "project": "uni-app", 291 | "scope": "css" 292 | }, 293 | "height --window-top": { 294 | "body": [ 295 | "height: var(--window-top);" 296 | ], 297 | "prefix": "heightwindowtop", 298 | "project": "uni-app", 299 | "scope": "css" 300 | }, 301 | "height px": { 302 | "body": [ 303 | "height: ${1}px;$0" 304 | ], 305 | "prefix": "hpx", 306 | "scope": "css" 307 | }, 308 | "justify-content: center": { 309 | "body": [ 310 | "justify-content: center;" 311 | ], 312 | "prefix": "jcc", 313 | "scope": "css" 314 | }, 315 | "list-style-image: url": { 316 | "body": [ 317 | "list-style-image: url($1);" 318 | ], 319 | "prefix": "lsi", 320 | "scope": "css", 321 | "triggerAssist": true 322 | }, 323 | "scrollbar": { 324 | "body": [ 325 | "scrollbar-base-color: ${1:#CCCCCC};", 326 | "scrollbar-arrow-color: ${2:#000000};", 327 | "scrollbar-track-color: ${3:#999999};", 328 | "scrollbar-3dlight-color: ${4:#EEEEEE};", 329 | "scrollbar-highlight-color: ${5:#FFFFFF};", 330 | "scrollbar-face-color: ${6:#CCCCCC};", 331 | "scrollbar-shadow-color: ${7:#999999};", 332 | "scrollbar-darkshadow-color: ${8:#666666};" 333 | ], 334 | "prefix": "scrollbarr", 335 | "scope": "css" 336 | }, 337 | "text-align: center": { 338 | "body": [ 339 | "text-align: center;" 340 | ], 341 | "prefix": "tac", 342 | "scope": "css" 343 | }, 344 | "text-align: left": { 345 | "body": [ 346 | "text-align: left;" 347 | ], 348 | "prefix": "tal", 349 | "scope": "css" 350 | }, 351 | "text-align: right": { 352 | "body": [ 353 | "text-align: right;" 354 | ], 355 | "prefix": "tar", 356 | "scope": "css" 357 | }, 358 | "text-transform": { 359 | "body": [ 360 | "text-transform: $1" 361 | ], 362 | "prefix": "tt", 363 | "scope": "css", 364 | "triggerAssist": true 365 | }, 366 | "userselect:none": { 367 | "body": [ 368 | "-webkit-user-select: none;", 369 | "-moz-user-select: none;", 370 | "-ms-user-select: none;", 371 | "user-select: none;" 372 | ], 373 | "prefix": "usn", 374 | "scope": "css" 375 | }, 376 | "width length": { 377 | "body": [ 378 | "width: ${1}px;$0" 379 | ], 380 | "prefix": "widthlength", 381 | "scope": "css" 382 | }, 383 | "width upx": { 384 | "body": [ 385 | "width: ${1}upx;$0" 386 | ], 387 | "prefix": "wupx", 388 | "project": "uni-app", 389 | "scope": "css" 390 | }, 391 | "width_length": { 392 | "body": [ 393 | "width: ${1}px;$0" 394 | ], 395 | "prefix": "wlength", 396 | "scope": "css" 397 | } 398 | } 399 | -------------------------------------------------------------------------------- /.vscode/exegesis.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Print to consoleLog": { 3 | "prefix": "lg", 4 | "body": [ 5 | "console.log('$1');", 6 | "$2" 7 | ], 8 | "description": "console.log()" 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /.vscode/js.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "#ifdef": { 3 | "body": [ 4 | "// #ifdef ${1|APP-PLUS,APP-PLUS-NVUE,MP,MP-ALIPAY,MP-BAIDU,MP-WEIXIN,MP-QQ,H5|}", 5 | "$0", 6 | "// #endif" 7 | ], 8 | "prefix": "ifdef", 9 | "project": "uni-app", 10 | "scope": "typescript,javascript" 11 | }, 12 | "#ifndef": { 13 | "body": [ 14 | "// #ifndef ${1|APP-PLUS,APP-PLUS-NVUE,MP,MP-ALIPAY,MP-BAIDU,MP-WEIXIN,MP-QQ,H5|}", 15 | "$0", 16 | "// #endif" 17 | ], 18 | "prefix": "ifndef", 19 | "project": "uni-app", 20 | "scope": "typescript,javascript" 21 | }, 22 | "$ (document.getElementById)": { 23 | "body": [ 24 | "document.getElementById(\"$1\")" 25 | ], 26 | "prefix": "$$$", 27 | "project": "Web,App,Wap2App", 28 | "scope": "typescript,javascript", 29 | "triggerAssist": true 30 | }, 31 | "$(\"\")": { 32 | "body": [ 33 | "$(\"$1\")" 34 | ], 35 | "prefix": "dl", 36 | "scope": "typescript,javascript", 37 | "triggerAssist": true 38 | }, 39 | "$(\"#\")": { 40 | "body": [ 41 | "$(\"#$1\")" 42 | ], 43 | "prefix": "dlid", 44 | "scope": "typescript,javascript", 45 | "triggerAssist": true 46 | }, 47 | "$(\".\")": { 48 | "body": [ 49 | "$(\".$1\")" 50 | ], 51 | "prefix": "dlclass", 52 | "project": "Web,App,Wap2App", 53 | "scope": "typescript,javascript", 54 | "triggerAssist": true 55 | }, 56 | "@alias": { 57 | "body": [ 58 | "@alias $0" 59 | ], 60 | "prefix": "@alias", 61 | "scope": "comment.block.js" 62 | }, 63 | "@description": { 64 | "body": [ 65 | "@description $0" 66 | ], 67 | "prefix": "@description", 68 | "scope": "comment.block.js" 69 | }, 70 | "@event": { 71 | "body": [ 72 | "@event {Function(${1})} ${2:name} $0" 73 | ], 74 | "prefix": "@event", 75 | "scope": "comment.block.js" 76 | }, 77 | "@example": { 78 | "body": [ 79 | "@example $0" 80 | ], 81 | "prefix": "@example", 82 | "scope": "comment.block.js" 83 | }, 84 | "@extends": { 85 | "body": [ 86 | "@extends {${1:parent_type}}" 87 | ], 88 | "prefix": "@extends", 89 | "scope": "comment.block.js" 90 | }, 91 | "@param": { 92 | "body": [ 93 | "@param {${1:type}} ${2:$FN_PARAMS} $0" 94 | ], 95 | "prefix": "@param", 96 | "scope": "comment.block.js" 97 | }, 98 | "@param with values": { 99 | "body": [ 100 | "@param {${1:type}} ${2:$FN_PARAMS} = [${3:value}] $0" 101 | ], 102 | "prefix": "@paramvalues", 103 | "scope": "comment.block.js" 104 | }, 105 | "@property": { 106 | "body": [ 107 | "@property {${1:type}} ${2:prop_name} $0" 108 | ], 109 | "prefix": "@property", 110 | "scope": "comment.block.js" 111 | }, 112 | "@property with values": { 113 | "body": [ 114 | "@property {${1:type}} ${2:prop_name} = [${3:value}] $0" 115 | ], 116 | "prefix": "@propertyvalues", 117 | "scope": "comment.block.js" 118 | }, 119 | "@return": { 120 | "body": [ 121 | "@return {${1:type}}" 122 | ], 123 | "prefix": "@return", 124 | "scope": "comment.block.js" 125 | }, 126 | "@tutorial": { 127 | "body": [ 128 | "@tutorial ${1:url}" 129 | ], 130 | "prefix": "@tutorial", 131 | "scope": "comment.block.js" 132 | }, 133 | "@type": { 134 | "body": [ 135 | "@type {${1:type}}" 136 | ], 137 | "prefix": "@type", 138 | "scope": "comment.doc.js" 139 | }, 140 | "Arrow function": { 141 | "body": [ 142 | "($1) => {", 143 | "\t$0", 144 | "}" 145 | ], 146 | "prefix": "arrow", 147 | "scope": "typescript,javascript" 148 | }, 149 | "Class": { 150 | "body": [ 151 | "class ${1:name} {", 152 | "\tconstructor(${2:arg}) {", 153 | "\t\t$0", 154 | "\t}", 155 | "\t", 156 | "}" 157 | ], 158 | "prefix": "class", 159 | "scope": "typescript,javascript" 160 | }, 161 | "Class Extends": { 162 | "body": [ 163 | "class ${1:name} extends ${2:AnotherClass} {", 164 | "\tconstructor(${3:arg}) {", 165 | "\t\t$0", 166 | "\t}", 167 | "\t", 168 | "}" 169 | ], 170 | "prefix": "classextends", 171 | "scope": "typescript,javascript" 172 | }, 173 | "Decrementer": { 174 | "body": [ 175 | "return ${1:this.num} -= ${2:1}" 176 | ], 177 | "description": "decrement", 178 | "prefix": "vdec", 179 | "scope": "typescript,javascript" 180 | }, 181 | "Export": { 182 | "body": [ 183 | "export ${1:default} ${2:bar}" 184 | ], 185 | "prefix": "export", 186 | "scope": "typescript,javascript" 187 | }, 188 | "Export Class": { 189 | "body": [ 190 | "export class ${1:name} {", 191 | "\t$0", 192 | "}" 193 | ], 194 | "prefix": "exportclass", 195 | "scope": "typescript,javascript" 196 | }, 197 | "Getter": { 198 | "body": [ 199 | "get ${1:name}() {", 200 | "\t$0", 201 | "}" 202 | ], 203 | "prefix": "getter", 204 | "scope": "JS_INCLASSBODY" 205 | }, 206 | "Import": { 207 | "body": [ 208 | "import ${1:foo} from \"${2:bar}\"" 209 | ], 210 | "prefix": "imfrom", 211 | "scope": "typescript,javascript" 212 | }, 213 | "Incrementer": { 214 | "body": [ 215 | "return ${1:this.num} += ${2:1}" 216 | ], 217 | "description": "increment", 218 | "prefix": "vinc", 219 | "scope": "typescript,javascript" 220 | }, 221 | // "Key:Value": { 222 | // "body": [ 223 | // "${1:key} : ${2:value}," 224 | // ], 225 | // "prefix": "kv", 226 | // "scope": "object.property.js" 227 | // }, 228 | // "Object Method": { 229 | // "body": [ 230 | // "${1:method_name}: function(${2:attribute}){", 231 | // "\t$0", 232 | // "}${3:,}" 233 | // ], 234 | // "prefix": ":f", 235 | // "scope": "typescript,javascript" 236 | // }, 237 | // "Object Method String": { 238 | // "body": [ 239 | // "'${1:${2:#thing}:${3:click}}': function(element){", 240 | // "\t$0", 241 | // "}${4:,}" 242 | // ], 243 | // "prefix": ":f", 244 | // "scope": "typescript,javascript" 245 | // }, 246 | // "Object Value JS": { 247 | // "body": [ 248 | // "${1:value_name}:${0:value}," 249 | // ], 250 | // "prefix": ":,", 251 | // "scope": "typescript,javascript" 252 | // }, 253 | // "Object key - key: \"value\"": { 254 | // "body": [ 255 | // "${1:key}: ${2:\"${3:value}\"}${4:, }" 256 | // ], 257 | // "prefix": ":", 258 | // "scope": "typescript,javascript" 259 | // }, 260 | "Prototype": { 261 | "body": [ 262 | "${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {", 263 | "\t${0|,, body...|}", 264 | "};" 265 | ], 266 | "prefix": "proto", 267 | "scope": "typescript,javascript" 268 | }, 269 | "Setter": { 270 | "body": [ 271 | "set ${1:property}(${2:value}) {", 272 | "\t$0", 273 | "}" 274 | ], 275 | "prefix": "setter", 276 | "scope": "class.body.js" 277 | }, 278 | "Unit Test": { 279 | "body": [ 280 | "import Vue from 'vue'", 281 | "import ${1|HelloWorld|} from '.,components,${1:HelloWorld}'", 282 | "", 283 | "describe('${1:HelloWorld}.vue', () => {", 284 | "\tit('${2:should render correct contents}', () => {", 285 | "\t\tconst Constructor = Vue.extend(${1:HelloWorld})", 286 | "\t\tconst vm = new Constructor().$mount()", 287 | "\t\texpect(vm.$el.querySelector('.hello h1').textContent)", 288 | "\t\t\t.to.equal(${3:'Welcome to Your Vue.js App'})", 289 | "\t})", 290 | "})" 291 | ], 292 | "description": "unit test component", 293 | "prefix": "vtest", 294 | "scope": "typescript,javascript" 295 | }, 296 | "Vue Commit Vuex Store in Methods": { 297 | "body": [ 298 | "${1:mutationName}() {", 299 | "\tthis.\\$store.commit('${1:mutationName}', ${2:payload})", 300 | "}" 301 | ], 302 | "description": "commit to vuex store in methods for mutation", 303 | "prefix": "vcommit", 304 | "scope": "vue.property.js" 305 | }, 306 | "Vue Components": { 307 | "body": [ 308 | "components: {", 309 | "\t$1", 310 | "}," 311 | ], 312 | "description": "注册vue组件", 313 | "prefix": "vcomponents", 314 | "scope": "vue.property.js" 315 | }, 316 | "Vue Computed": { 317 | "body": [ 318 | "computed: {", 319 | "\t${1:name}() {", 320 | "\t\treturn this.${2:data} ${0}", 321 | "\t}", 322 | "}," 323 | ], 324 | "description": "computed value", 325 | "prefix": "vcomputed", 326 | "scope": "vue.property.js" 327 | }, 328 | "Vue Custom Directive": { 329 | "body": [ 330 | "Vue.directive('${1:directiveName}', {", 331 | "\tbind(el, binding, vnode) {", 332 | "\t\tel.style.${2:arg} = binding.value.${2:arg};", 333 | "\t}", 334 | "});" 335 | ], 336 | "description": "vue custom directive", 337 | "prefix": "vc-direct", 338 | "scope": "typescript,javascript" 339 | }, 340 | "Vue Data": { 341 | "body": [ 342 | "data() {", 343 | "\treturn {", 344 | "\t\t${1:key}: ${2:value}", 345 | "\t}", 346 | "}," 347 | ], 348 | "description": "Vue Component Data", 349 | "prefix": "vdata", 350 | "scope": "vue.property.js" 351 | }, 352 | "Vue Dispatch Vuex Store in Methods": { 353 | "body": [ 354 | "${1:actionName}() {", 355 | "\tthis.\\$store.dispatch('${1:actionName}', ${2:payload})", 356 | "}" 357 | ], 358 | "description": "dispatch to vuex store in methods for action", 359 | "prefix": "vdispatch", 360 | "scope": "vue.property.js" 361 | }, 362 | "Vue Filter": { 363 | "body": [ 364 | "filters: {", 365 | "\t${1:fnName}: function(${2:value}) {", 366 | "\t\treturn ${2:value}${0};", 367 | "\t}", 368 | "}" 369 | ], 370 | "description": "vue filter", 371 | "prefix": "vfilter", 372 | "scope": "vue.property.js" 373 | }, 374 | "Vue Import Export": { 375 | "body": [ 376 | "import ${1|Name|} from '.,components,${1:Name}.vue'", 377 | "", 378 | "export default {", 379 | "\tcomponents: {", 380 | "\t\t${1:Name}", 381 | "\t},", 382 | "}" 383 | ], 384 | "description": "import a component and include it in export default", 385 | "prefix": "vimport-export", 386 | "scope": "typescript,javascript" 387 | }, 388 | "Vue Import File": { 389 | "body": [ 390 | "import ${1|New|} from ',components,${1:New}.vue';" 391 | ], 392 | "description": "Import one component into another", 393 | "prefix": "vimport", 394 | "scope": "typescript,javascript" 395 | }, 396 | "Vue Import GSAP": { 397 | "body": [ 398 | "import { TimelineMax, ${1:Ease} } from 'gsap'" 399 | ], 400 | "description": "component methods options that dispatch an action from vuex store.", 401 | "prefix": "vimport-gsap", 402 | "scope": "typescript,javascript" 403 | }, 404 | "Vue Import Library": { 405 | "body": [ 406 | "import { ${1:libName} } from '${1:libName}'" 407 | ], 408 | "description": "import a library", 409 | "prefix": "vimport-lib", 410 | "scope": "typescript,javascript" 411 | }, 412 | "Vue Import into the Component": { 413 | "body": [ 414 | "components: {", 415 | "\t${1:New},", 416 | "}" 417 | ], 418 | "description": "Import one component into another, within export statement", 419 | "prefix": "vcomponents", 420 | "scope": "typescript,javascript" 421 | }, 422 | "Vue Methods": { 423 | "body": [ 424 | "methods: {", 425 | "\t${1:name}() {", 426 | "\t\t${0}", 427 | "\t}", 428 | "}," 429 | ], 430 | "description": "vue method", 431 | "prefix": "vmethod", 432 | "scope": "vue.property.js" 433 | }, 434 | "Vue Mixin": { 435 | "body": [ 436 | "const ${1:mixinName} = {", 437 | "\tmounted() {", 438 | "\t\tconsole.log('hello from mixin!')", 439 | "\t},", 440 | "}" 441 | ], 442 | "description": "vue mixin", 443 | "prefix": "vmixin", 444 | "scope": "typescript,javascript" 445 | }, 446 | "Vue Props with Default": { 447 | "body": [ 448 | "props: {", 449 | "\t${1:propName}: {", 450 | "\t\ttype: ${2:Number},", 451 | "\t\tdefault: ${0}", 452 | "\t},", 453 | "}," 454 | ], 455 | "description": "Vue Props with Default", 456 | "prefix": "vprops", 457 | "scope": "vue.property.js" 458 | }, 459 | "Vue Transition Methods with JavaScript Hooks": { 460 | "body": [ 461 | "beforeEnter(el) {", 462 | "\tconsole.log('beforeEnter');", 463 | "},", 464 | "enter(el, done) {", 465 | "\tconsole.log('enter');", 466 | "\tdone();", 467 | "},", 468 | "beforeLeave(el) {", 469 | "\tconsole.log('beforeLeave');", 470 | "},", 471 | "leave(el, done) {", 472 | "\tconsole.log('leave');", 473 | "\tdone();", 474 | "}," 475 | ], 476 | "description": "transition component js hooks", 477 | "prefix": "vanimhook-js", 478 | "scope": "typescript,javascript" 479 | }, 480 | "Vue Use Mixin": { 481 | "body": [ 482 | "mixins: [${1:mixinName}]" 483 | ], 484 | "description": "vue use mixin", 485 | "prefix": "vmixin-use", 486 | "scope": "typescript,javascript" 487 | }, 488 | "Vue Watchers": { 489 | "body": [ 490 | "watch: {", 491 | "\t${1:data}(${2:newValue}, ${3:oldValue}) {", 492 | "\t\t${0}", 493 | "\t}", 494 | "}," 495 | ], 496 | "description": "vue watcher", 497 | "prefix": "vwatcher", 498 | "scope": "vue.property.js" 499 | }, 500 | "clog": { 501 | "body": [ 502 | "console.log($1);" 503 | ], 504 | "description": "打印变量", 505 | "prefix": "clog", 506 | "scope": "typescript,javascript" 507 | }, 508 | "clogios": { 509 | "body": [ 510 | "console.log(JSON.stringify(${1:e}));", 511 | "console.log('${2:e}');" 512 | ], 513 | "prefix": "cloios", 514 | "project": "Web,App,Wap2App", 515 | "scope": "typescript,javascript", 516 | "triggerAssist": true 517 | }, 518 | "clogjson": { 519 | "body": [ 520 | "console.log(\"$1: \" + JSON.stringify($1));" 521 | ], 522 | "description": "打印JSON字符串", 523 | "prefix": "clogjson", 524 | "scope": "typescript,javascript" 525 | }, 526 | "clogvar": { 527 | "body": [ 528 | "console.log(\"$1: \" + $1);" 529 | ], 530 | "description": "打印变量", 531 | "prefix": "clogvar", 532 | "scope": "typescript,javascript" 533 | }, 534 | "console.dir": { 535 | "body": [ 536 | "console.dir($1)" 537 | ], 538 | "prefix": "cdir", 539 | "scope": "typescript,javascript", 540 | "triggerAssist": true 541 | }, 542 | "console.log();": { 543 | "body": [ 544 | "console.log($1);" 545 | ], 546 | "prefix": "clog", 547 | "project": "Web,App,Wap2App", 548 | "scope": "typescript,javascript" 549 | }, 550 | "constructor": { 551 | "body": [ 552 | "constructor(${1:arg}) {", 553 | " $0", 554 | "}" 555 | ], 556 | "prefix": "cons", 557 | "scope": "class.body.js" 558 | }, 559 | "document.getElementById": { 560 | "body": [ 561 | "document.getElementById(\"$1\")" 562 | ], 563 | "prefix": "dg", 564 | "scope": "typescript,javascript", 565 | "triggerAssist": true 566 | }, 567 | "document.querySelectorAll": { 568 | "body": [ 569 | "document.querySelectorAll(\"$1\")" 570 | ], 571 | "prefix": "dqs", 572 | "scope": "typescript,javascript", 573 | "triggerAssist": true 574 | }, 575 | "document.write": { 576 | "body": [ 577 | "document.write(\"$1\")" 578 | ], 579 | "prefix": "dw", 580 | "scope": "typescript,javascript" 581 | }, 582 | "documentaddEventListener": { 583 | "body": [ 584 | "document.addEventListener('${1:scroll}',function ($2) {", 585 | " $0", 586 | "})" 587 | ], 588 | "prefix": "dad", 589 | "project": "Web,App,Wap2App", 590 | "scope": "typescript,javascript", 591 | "triggerAssist": true 592 | }, 593 | "export default": { 594 | "body": [ 595 | "export default {", 596 | "\t$0", 597 | "}" 598 | ], 599 | "prefix": "edefault", 600 | "scope": "typescript,javascript" 601 | }, 602 | "for (...) {...}": { 603 | "body": [ 604 | "for ($1) {", 605 | "\t$0", 606 | "}" 607 | ], 608 | "prefix": "forr", 609 | "scope": "typescript,javascript" 610 | }, 611 | "for let": { 612 | "body": [ 613 | "for (let i = 0; i < ${1:Things}.length; i++) {", 614 | "\t${1:Things}[i]", 615 | "}" 616 | ], 617 | "prefix": "forl", 618 | "scope": "typescript,javascript" 619 | }, 620 | "for let in": { 621 | "body": [ 622 | "for (let ${1:var1} in ${2:var2}) {", 623 | "\t$0", 624 | "}" 625 | ], 626 | "prefix": "forli", 627 | "scope": "typescript,javascript" 628 | }, 629 | "for...of": { 630 | "body": [ 631 | "for (let ${1:s} of ${2:sequence}) {", 632 | "\t$0", 633 | "}" 634 | ], 635 | "prefix": "forof", 636 | "scope": "typescript,javascript" 637 | }, 638 | "fori": { 639 | "body": [ 640 | "for (var i = 0; i < ${1:Things}.length; i++) {", 641 | "\t${1:Things}[i]", 642 | "}" 643 | ], 644 | "prefix": "fori", 645 | "scope": "typescript,javascript" 646 | }, 647 | "function": { 648 | "body": [ 649 | "function ${1:function_name} ($2) {", 650 | "\t$0", 651 | "}" 652 | ], 653 | "prefix": "funn", 654 | "scope": "typescript,javascript" 655 | }, 656 | "function*": { 657 | "body": [ 658 | "function* ${1:name}($2) {", 659 | "\tyield $0;", 660 | "}" 661 | ], 662 | "prefix": "fung", 663 | "scope": "typescript,javascript" 664 | }, 665 | "function_anonymous": { 666 | "body": [ 667 | "function ($1) {", 668 | "\t$0", 669 | "}" 670 | ], 671 | "prefix": "funan", 672 | "scope": "typescript,javascript" 673 | }, 674 | "function_closures": { 675 | "body": [ 676 | "(function ($1) {", 677 | "\t$0", 678 | "})($2)" 679 | ], 680 | "prefix": "funcl", 681 | "scope": "typescript,javascript" 682 | }, 683 | "getElementByIdaddEventListener": { 684 | "body": [ 685 | "document.getElementById('$1').addEventListener('${2:tap}',function ($3) {", 686 | " $0", 687 | "})" 688 | ], 689 | "prefix": "dga", 690 | "project": "Web,App,Wap2App", 691 | "scope": "typescript,javascript", 692 | "triggerAssist": true 693 | }, 694 | "if": { 695 | "body": [ 696 | "if ($1) {", 697 | "\t$0", 698 | "}" 699 | ], 700 | "prefix": "iff", 701 | "scope": "typescript,javascript" 702 | }, 703 | "if ... else": { 704 | "body": [ 705 | "if ($1) {", 706 | "\t$0", 707 | "} else{", 708 | "\t", 709 | "}" 710 | ], 711 | "prefix": "ife", 712 | "scope": "typescript,javascript" 713 | }, 714 | "ifAndroid": { 715 | "body": [ 716 | "if (uni.getSystemInfoSync().platform == \"android\") {", 717 | "\t$1", 718 | "}" 719 | ], 720 | "prefix": "ifandroid", 721 | "project": "uni-app", 722 | "scope": "typescript,javascript" 723 | }, 724 | "if_compare": { 725 | "body": [ 726 | "if ($1 == ${2:true}) {", 727 | "\t$0", 728 | "} else{", 729 | "\t", 730 | "}" 731 | ], 732 | "prefix": "ifc", 733 | "scope": "typescript,javascript" 734 | }, 735 | "ifiOS": { 736 | "body": [ 737 | "if (uni.getSystemInfoSync().platform == \"ios\") {", 738 | "\t$1", 739 | "}" 740 | ], 741 | "prefix": "ifios", 742 | "project": "uni-app", 743 | "scope": "typescript,javascript" 744 | }, 745 | "module.exports": { 746 | "body": [ 747 | "module.exports = {", 748 | "\t$0", 749 | "}" 750 | ], 751 | "prefix": "mexports", 752 | "scope": "typescript,javascript" 753 | }, 754 | "mui": { 755 | "body": [ 756 | "mui." 757 | ], 758 | "prefix": "mui", 759 | "project": "Web,App,Wap2App", 760 | "scope": "typescript,javascript", 761 | "triggerAssist": true 762 | }, 763 | "mui('').pullRefresh": { 764 | "body": [ 765 | "mui('#${1:refreshContainer}').pullRefresh().$2" 766 | ], 767 | "prefix": "mmpullrefresh", 768 | "project": "Web,App,Wap2App", 769 | "scope": "typescript,javascript", 770 | "triggerAssist": true 771 | }, 772 | "mui('').scroll": { 773 | "body": [ 774 | "mui('.${1:mui-scroll-wrapper}').scroll({$2})$0" 775 | ], 776 | "prefix": "mmscroll", 777 | "project": "Web,App,Wap2App", 778 | "scope": "typescript,javascript", 779 | "triggerAssist": true 780 | }, 781 | "mui('').slider": { 782 | "body": [ 783 | "mui('.${1:mui-slider}').slider({$2})$0" 784 | ], 785 | "prefix": "mmslider", 786 | "project": "Web,App,Wap2App", 787 | "scope": "typescript,javascript", 788 | "triggerAssist": true 789 | }, 790 | "mui()": { 791 | "body": [ 792 | "mui('$1')" 793 | ], 794 | "prefix": "mmui", 795 | "project": "Web,App,Wap2App", 796 | "scope": "typescript,javascript", 797 | "triggerAssist": true 798 | }, 799 | "mui().each()": { 800 | "body": [ 801 | "mui('$1').each(function (${3:index},${4:element}) {", 802 | "\t$0", 803 | "})" 804 | ], 805 | "prefix": "mmeach", 806 | "project": "Web,App,Wap2App", 807 | "scope": "typescript,javascript" 808 | }, 809 | "mui.ajax()": { 810 | "body": [ 811 | "mui.ajax('$1',{", 812 | "\tdata:{", 813 | "\t\t$2", 814 | "\t},", 815 | "\tdataType:'${3:json}',//服务器返回json格式数据", 816 | "\ttype:'${4:post}',//HTTP请求类型", 817 | "\ttimeout:${5:10000},//超时时间设置为10秒;", 818 | "\tsuccess:function(${6:data}){", 819 | "\t\t$7", 820 | "\t},", 821 | "\terror:function(${8:xhr,type,errorThrown}){", 822 | "\t\t$9", 823 | "\t}", 824 | "});$0" 825 | ], 826 | "prefix": "majax", 827 | "project": "Web,App,Wap2App", 828 | "scope": "typescript,javascript", 829 | "triggerAssist": true 830 | }, 831 | "mui.alert()": { 832 | "body": [ 833 | "mui.alert('${1:message}','${2:title}','${3:btnValue}',function (${4:e}) {", 834 | " ${4:e}.index$0", 835 | "}${5:,'div'})" 836 | ], 837 | "prefix": "mdalert", 838 | "project": "Web,App,Wap2App", 839 | "scope": "typescript,javascript" 840 | }, 841 | "mui.back()(返回上级页面)": { 842 | "body": [ 843 | "mui.back()$0" 844 | ], 845 | "prefix": "mback", 846 | "project": "Web,App,Wap2App", 847 | "scope": "typescript,javascript" 848 | }, 849 | "mui.backDouble(双击退出应用)": { 850 | "body": [ 851 | "//首页返回键处理", 852 | "//处理逻辑:1秒内,连续两次按返回键,则退出应用;", 853 | "var first = null;", 854 | "mui.back = function() {", 855 | "\t//首次按键,提示‘再按一次退出应用’", 856 | "\tif (!first) {", 857 | "\t\tfirst = new Date().getTime();", 858 | "\t\tmui.toast('再按一次退出应用');", 859 | "\t\tsetTimeout(function() {", 860 | "\t\t\tfirst = null;", 861 | "\t\t}, 1000);", 862 | "\t} else {", 863 | "\t\tif (new Date().getTime() - first < 1000) {", 864 | "\t\t\tplus.runtime.quit();", 865 | "\t\t}", 866 | "\t}", 867 | "};" 868 | ], 869 | "prefix": "mbackDouble", 870 | "project": "Web,App,Wap2App", 871 | "scope": "typescript,javascript" 872 | }, 873 | "mui.backFunction(重写返回逻辑)": { 874 | "body": [ 875 | "mui.back=function () {", 876 | " $0\t", 877 | "}" 878 | ], 879 | "prefix": "mbackfunction", 880 | "project": "Web,App,Wap2App", 881 | "scope": "typescript,javascript" 882 | }, 883 | "mui.backTask(双击进入后台)": { 884 | "body": [ 885 | "//首页返回键处理", 886 | "//处理逻辑:1秒内,连续两次按返回键,则进入后台;", 887 | "var first = null;", 888 | "mui.back = function() {", 889 | "\t//首次按键,提示‘再按一次退出应用’", 890 | "\tif (!first) {", 891 | "\t\tfirst = new Date().getTime();", 892 | "\t\tmui.toast('再按一次退出应用');", 893 | "\t\tsetTimeout(function() {", 894 | "\t\t\tfirst = null;", 895 | "\t\t}, 1000);", 896 | "\t} else {", 897 | "\t\tif (new Date().getTime() - first < 1000) {", 898 | "\t\t\tvar main = plus.android.runtimeMainActivity();", 899 | " main.moveTaskToBack(false);", 900 | "\t\t}", 901 | "\t}", 902 | "};" 903 | ], 904 | "prefix": "mbackMoveTaskToBack", 905 | "project": "Web,App,Wap2App", 906 | "scope": "typescript,javascript" 907 | }, 908 | "mui.closePopup()": { 909 | "body": [ 910 | "mui.closePopup()$0" 911 | ], 912 | "prefix": "mdclosePopup", 913 | "project": "Web,App,Wap2App", 914 | "scope": "typescript,javascript" 915 | }, 916 | "mui.closePopups()": { 917 | "body": [ 918 | "mui.closePopups()$0" 919 | ], 920 | "prefix": "mdclosePopups", 921 | "project": "Web,App,Wap2App", 922 | "scope": "typescript,javascript" 923 | }, 924 | "mui.confirm()": { 925 | "body": [ 926 | "mui.confirm('${1:message}','${2:title}',['${3:取消}','${4:确认}'],function (${5:e}) {", 927 | "\t${5:e}.index$0", 928 | "}${6:,'div'})" 929 | ], 930 | "prefix": "mdconfirm", 931 | "project": "Web,App,Wap2App", 932 | "scope": "typescript,javascript" 933 | }, 934 | "mui.currentWebview": { 935 | "body": [ 936 | "mui.currentWebview." 937 | ], 938 | "prefix": "mcurrent", 939 | "project": "Web,App,Wap2App", 940 | "scope": "typescript,javascript", 941 | "triggerAssist": true 942 | }, 943 | "mui.each()": { 944 | "body": [ 945 | "mui.each(${1:obj},function (${2:index},${3:element}) {", 946 | "\t$0", 947 | "})" 948 | ], 949 | "prefix": "meach", 950 | "project": "Web,App,Wap2App", 951 | "scope": "typescript,javascript" 952 | }, 953 | "mui.extend()": { 954 | "body": [ 955 | "mui.extend(${1|'target'|},${2:'source'},${3:'deep',true,false})" 956 | ], 957 | "prefix": "mextend", 958 | "project": "Web,App,Wap2App", 959 | "scope": "typescript,javascript" 960 | }, 961 | "mui.fire()": { 962 | "body": [ 963 | "mui.fire(${1:targetWebviewObj},'${2:event}',{${3:data}})" 964 | ], 965 | "prefix": "mfire", 966 | "project": "Web,App,Wap2App", 967 | "scope": "typescript,javascript", 968 | "triggerAssist": true 969 | }, 970 | "mui.get()": { 971 | "body": [ 972 | "mui.get('$1',{", 973 | "\t\t$2", 974 | "\t},function(${3:data}){", 975 | "\t\t$0", 976 | "\t},'${4:json}'", 977 | ");" 978 | ], 979 | "prefix": "mget", 980 | "project": "Web,App,Wap2App", 981 | "scope": "typescript,javascript", 982 | "triggerAssist": true 983 | }, 984 | "mui.getJSON()": { 985 | "body": [ 986 | "mui.getJSON('$1',{$2},function($3){", 987 | "\t\t$4", 988 | "\t}", 989 | ");$0" 990 | ], 991 | "prefix": "mjson", 992 | "project": "Web,App,Wap2App", 993 | "scope": "typescript,javascript", 994 | "triggerAssist": true 995 | }, 996 | "mui.init": { 997 | "body": [ 998 | "mui.init({$0})" 999 | ], 1000 | "prefix": "minit", 1001 | "project": "Web,App,Wap2App", 1002 | "scope": "typescript,javascript" 1003 | }, 1004 | "mui.init({侧滑返回})": { 1005 | "body": [ 1006 | "mui.init({", 1007 | "\tswipeBack:${1|true,false|} ", 1008 | ");$0" 1009 | ], 1010 | "prefix": "minswipeback", 1011 | "project": "Web,App,Wap2App", 1012 | "scope": "typescript,javascript" 1013 | }, 1014 | "mui.init({刷新组件})": { 1015 | "body": [ 1016 | "mui.init({", 1017 | " pullRefresh : {", 1018 | " container:'#${1:refreshContainer}',", 1019 | " down : {", 1020 | " callback :${2:pullfresh}", 1021 | " },", 1022 | " up : {", 1023 | " callback :${3:pullfresh} ", 1024 | " }", 1025 | " }", 1026 | "});$0" 1027 | ], 1028 | "prefix": "minpullRefresh", 1029 | "project": "Web,App,Wap2App", 1030 | "scope": "typescript,javascript", 1031 | "triggerAssist": true 1032 | }, 1033 | "mui.init({子页面})": { 1034 | "body": [ 1035 | "mui.init({", 1036 | "\tsubpages:[{", 1037 | "\t url:'${1:url}',", 1038 | " id:'${2:id}',", 1039 | " styles:{", 1040 | " $3", 1041 | " },", 1042 | " extras:{$4}", 1043 | "\t}]", 1044 | "})$0" 1045 | ], 1046 | "prefix": "minsubpage", 1047 | "project": "Web,App,Wap2App", 1048 | "scope": "typescript,javascript", 1049 | "triggerAssist": true 1050 | }, 1051 | "mui.init({手势事件})": { 1052 | "body": [ 1053 | "mui.init({", 1054 | " \tgestureConfig:{", 1055 | "\t tap: ${1|true,false|}, ", 1056 | "\t doubletap: ${2|true,false|}, ", 1057 | "\t longtap: ${3|true,false|}, ", 1058 | "\t swipe: ${4|true,false|}, ", 1059 | "\t drag: ${5|true,false|}, ", 1060 | "\t hold:${6|false,true|},", 1061 | "\t release:${7|false,true|}", 1062 | " \t}", 1063 | "});$0" 1064 | ], 1065 | "prefix": "mingesture", 1066 | "project": "Web,App,Wap2App", 1067 | "scope": "typescript,javascript" 1068 | }, 1069 | "mui.init({按键绑定})": { 1070 | "body": [ 1071 | "mui.init({", 1072 | "\tkeyEventBind: {", 1073 | "\t\tbackbutton: ${1|true,false|}, ", 1074 | "\t\tmenubutton: ${2|true,false|} ", 1075 | "\t},", 1076 | "})" 1077 | ], 1078 | "prefix": "minkeyevent", 1079 | "project": "Web,App,Wap2App", 1080 | "scope": "typescript,javascript" 1081 | }, 1082 | "mui.init({设置状态栏颜色})": { 1083 | "body": [ 1084 | "mui.init({", 1085 | "\tstatusBarBackground:'#${1:FFFFFF}'", 1086 | "})" 1087 | ], 1088 | "prefix": "minstatusbar", 1089 | "project": "Web,App,Wap2App", 1090 | "scope": "typescript,javascript", 1091 | "triggerAssist": true 1092 | }, 1093 | "mui.init({重写窗口关闭逻辑})": { 1094 | "body": [ 1095 | "mui.init({", 1096 | "\tbeforeback:function () {", 1097 | "\t\t$0", 1098 | "\t}", 1099 | "})" 1100 | ], 1101 | "prefix": "minbeforeback", 1102 | "project": "Web,App,Wap2App", 1103 | "scope": "typescript,javascript" 1104 | }, 1105 | "mui.init({预加载})": { 1106 | "body": [ 1107 | "mui.init({", 1108 | "\tpreloadPages:[{", 1109 | "\t url:'${1:url}',", 1110 | " id:'${2:id}',", 1111 | " styles:{", 1112 | " $3", 1113 | " },", 1114 | " extras:{$4}", 1115 | "\t}]", 1116 | "})$0" 1117 | ], 1118 | "prefix": "minpreload", 1119 | "project": "Web,App,Wap2App", 1120 | "scope": "typescript,javascript", 1121 | "triggerAssist": true 1122 | }, 1123 | "mui.init({预加载数量})": { 1124 | "body": [ 1125 | "preloadLimit:${1:5}" 1126 | ], 1127 | "prefix": "minprelimit", 1128 | "project": "Web,App,Wap2App", 1129 | "scope": "typescript,javascript", 1130 | "triggerAssist": true 1131 | }, 1132 | "mui.later()": { 1133 | "body": [ 1134 | "mui.later(function(){", 1135 | "\t$2 ", 1136 | "},${1|500,1000,1500,2000|})" 1137 | ], 1138 | "prefix": "mlater", 1139 | "project": "Web,App,Wap2App", 1140 | "scope": "typescript,javascript" 1141 | }, 1142 | "mui.mask": { 1143 | "body": [ 1144 | "var ${1:mask} = mui.createMask(function () {", 1145 | "\t$2", 1146 | "})", 1147 | "${1:mask}.show()" 1148 | ], 1149 | "prefix": "mmask", 1150 | "project": "Web,App,Wap2App", 1151 | "scope": "typescript,javascript" 1152 | }, 1153 | "mui.off": { 1154 | "body": [ 1155 | "mui('$1').off('${2:tap}','$3',function($4){", 1156 | " $0", 1157 | "}) " 1158 | ], 1159 | "prefix": "mmoff", 1160 | "project": "Web,App,Wap2App", 1161 | "scope": "typescript,javascript", 1162 | "triggerAssist": true 1163 | }, 1164 | "mui.on": { 1165 | "body": [ 1166 | "mui('$1').on('${2:tap}','$3',function($4){", 1167 | " $0", 1168 | "}) " 1169 | ], 1170 | "prefix": "mmon", 1171 | "project": "Web,App,Wap2App", 1172 | "scope": "typescript,javascript", 1173 | "triggerAssist": true 1174 | }, 1175 | "mui.open": { 1176 | "body": [ 1177 | "mui.openWindow('${1:url}','${2:id}',{$3})" 1178 | ], 1179 | "prefix": "mopen", 1180 | "project": "Web,App,Wap2App", 1181 | "scope": "typescript,javascript", 1182 | "triggerAssist": true 1183 | }, 1184 | "mui.os": { 1185 | "body": [ 1186 | "mui.os." 1187 | ], 1188 | "prefix": "mos", 1189 | "project": "Web,App,Wap2App", 1190 | "scope": "typescript,javascript", 1191 | "triggerAssist": true 1192 | }, 1193 | "mui.plusReady()": { 1194 | "body": [ 1195 | "mui.plusReady(function () {", 1196 | " $1", 1197 | "})$0" 1198 | ], 1199 | "prefix": "mplusready", 1200 | "project": "Web,App,Wap2App", 1201 | "scope": "typescript,javascript" 1202 | }, 1203 | "mui.post()": { 1204 | "body": [ 1205 | "mui.post('$1',{", 1206 | "\t\t$2", 1207 | "\t},function(${3:data}){", 1208 | "\t\t$0", 1209 | "\t},'${4:json}'", 1210 | ");" 1211 | ], 1212 | "prefix": "mpost", 1213 | "project": "Web,App,Wap2App", 1214 | "scope": "typescript,javascript", 1215 | "triggerAssist": true 1216 | }, 1217 | "mui.preload()": { 1218 | "body": [ 1219 | "mui.preload({", 1220 | "\turl:'${1:url}',", 1221 | "\tid:'${2:id}',", 1222 | "\tstyles:{$3},//窗口参数", 1223 | "\textras:{$4}//自定义扩展参数", 1224 | "})$0" 1225 | ], 1226 | "prefix": "mpreload", 1227 | "project": "Web,App,Wap2App", 1228 | "scope": "typescript,javascript", 1229 | "triggerAssist": true 1230 | }, 1231 | "mui.prompt()": { 1232 | "body": [ 1233 | " mui.prompt('${1:text}','${2:defaultText}','${3:title}',['${4:取消}','${5:确认}'],function (${6:e}) {", 1234 | " ${6:e}.index$0", 1235 | "}${7:,'div'})" 1236 | ], 1237 | "prefix": "mdprompt", 1238 | "project": "Web,App,Wap2App", 1239 | "scope": "typescript,javascript" 1240 | }, 1241 | "mui.ready": { 1242 | "body": [ 1243 | "mui.ready(function () {", 1244 | "\t$0", 1245 | "})" 1246 | ], 1247 | "prefix": "mready", 1248 | "project": "Web,App,Wap2App", 1249 | "scope": "typescript,javascript" 1250 | }, 1251 | "mui.scrollTo()": { 1252 | "body": [ 1253 | "mui.scrollTo(${1:ypos},${2:duration},${3:/function () {", 1254 | " \t", 1255 | "}}$0" 1256 | ], 1257 | "prefix": "mscrollto", 1258 | "project": "Web,App,Wap2App", 1259 | "scope": "typescript,javascript" 1260 | }, 1261 | "mui.toast()": { 1262 | "body": [ 1263 | "mui.toast('${1:message}')$0" 1264 | ], 1265 | "prefix": "mdtoast", 1266 | "project": "Web,App,Wap2App", 1267 | "scope": "typescript,javascript" 1268 | }, 1269 | "mui.trigger()": { 1270 | "body": [ 1271 | "mui.trigger(${1:dom},'${3:tap}'${4:,{a:'as'}})" 1272 | ], 1273 | "prefix": "mtrigger", 1274 | "project": "Web,App,Wap2App", 1275 | "scope": "typescript,javascript" 1276 | }, 1277 | "navigator.userAgent;": { 1278 | "body": [ 1279 | "navigator.userAgent" 1280 | ], 1281 | "prefix": "nuser", 1282 | "scope": "typescript,javascript" 1283 | }, 1284 | "plus.Screen": { 1285 | "body": [ 1286 | "plus.Screen." 1287 | ], 1288 | "prefix": "pScreen", 1289 | "project": "Web,App,Wap2App", 1290 | "scope": "typescript,javascript", 1291 | "triggerAssist": true 1292 | }, 1293 | "plus.accelerometer": { 1294 | "body": [ 1295 | "plus.accelerometer." 1296 | ], 1297 | "prefix": "pacce", 1298 | "project": "Web,App,Wap2App", 1299 | "scope": "typescript,javascript", 1300 | "triggerAssist": true 1301 | }, 1302 | "plus.android": { 1303 | "body": [ 1304 | "plus.android." 1305 | ], 1306 | "prefix": "pandroid", 1307 | "project": "Web,App,Wap2App", 1308 | "scope": "typescript,javascript", 1309 | "triggerAssist": true 1310 | }, 1311 | "plus.audio": { 1312 | "body": [ 1313 | "plus.audio." 1314 | ], 1315 | "prefix": "paudio", 1316 | "project": "Web,App,Wap2App", 1317 | "scope": "typescript,javascript", 1318 | "triggerAssist": true 1319 | }, 1320 | "plus.barcode": { 1321 | "body": [ 1322 | "plus.barcode." 1323 | ], 1324 | "prefix": "pbarcode", 1325 | "project": "Web,App,Wap2App", 1326 | "scope": "typescript,javascript", 1327 | "triggerAssist": true 1328 | }, 1329 | "plus.camera": { 1330 | "body": [ 1331 | "plus.camera." 1332 | ], 1333 | "prefix": "pcamera", 1334 | "project": "Web,App,Wap2App", 1335 | "scope": "typescript,javascript", 1336 | "triggerAssist": true 1337 | }, 1338 | "plus.contacts": { 1339 | "body": [ 1340 | "plus.contacts." 1341 | ], 1342 | "prefix": "pcontacts", 1343 | "project": "Web,App,Wap2App", 1344 | "scope": "typescript,javascript", 1345 | "triggerAssist": true 1346 | }, 1347 | "plus.device": { 1348 | "body": [ 1349 | "plus.device." 1350 | ], 1351 | "prefix": "pdevice", 1352 | "project": "Web,App,Wap2App", 1353 | "scope": "typescript,javascript", 1354 | "triggerAssist": true 1355 | }, 1356 | "plus.display": { 1357 | "body": [ 1358 | "plus.display." 1359 | ], 1360 | "prefix": "pdisplay", 1361 | "project": "Web,App,Wap2App", 1362 | "scope": "typescript,javascript", 1363 | "triggerAssist": true 1364 | }, 1365 | "plus.downloader": { 1366 | "body": [ 1367 | "plus.downloader." 1368 | ], 1369 | "prefix": "pdown", 1370 | "project": "Web,App,Wap2App", 1371 | "scope": "typescript,javascript", 1372 | "triggerAssist": true 1373 | }, 1374 | "plus.gallery": { 1375 | "body": [ 1376 | "plus.gallery." 1377 | ], 1378 | "prefix": "pgallery", 1379 | "project": "Web,App,Wap2App", 1380 | "scope": "typescript,javascript", 1381 | "triggerAssist": true 1382 | }, 1383 | "plus.geolocation": { 1384 | "body": [ 1385 | "plus.geolocation." 1386 | ], 1387 | "prefix": "pgeolocation", 1388 | "project": "Web,App,Wap2App", 1389 | "scope": "typescript,javascript", 1390 | "triggerAssist": true 1391 | }, 1392 | "plus.io": { 1393 | "body": [ 1394 | "plus.io." 1395 | ], 1396 | "prefix": "pio", 1397 | "project": "Web,App,Wap2App", 1398 | "scope": "typescript,javascript", 1399 | "triggerAssist": true 1400 | }, 1401 | "plus.ios": { 1402 | "body": [ 1403 | "plus.ios." 1404 | ], 1405 | "prefix": "pios", 1406 | "project": "Web,App,Wap2App", 1407 | "scope": "typescript,javascript", 1408 | "triggerAssist": true 1409 | }, 1410 | "plus.key": { 1411 | "body": [ 1412 | "plus.key." 1413 | ], 1414 | "prefix": "pkey", 1415 | "project": "Web,App,Wap2App", 1416 | "scope": "typescript,javascript", 1417 | "triggerAssist": true 1418 | }, 1419 | "plus.maps": { 1420 | "body": [ 1421 | "plus.maps." 1422 | ], 1423 | "prefix": "pmaps", 1424 | "project": "Web,App,Wap2App", 1425 | "scope": "typescript,javascript", 1426 | "triggerAssist": true 1427 | }, 1428 | "plus.messaging": { 1429 | "body": [ 1430 | "plus.messaging." 1431 | ], 1432 | "prefix": "pmessaging", 1433 | "project": "Web,App,Wap2App", 1434 | "scope": "typescript,javascript", 1435 | "triggerAssist": true 1436 | }, 1437 | "plus.nativeObj": { 1438 | "body": [ 1439 | "plus.nativeObj." 1440 | ], 1441 | "prefix": "pnativeObj", 1442 | "project": "Web,App,Wap2App", 1443 | "scope": "typescript,javascript", 1444 | "triggerAssist": true 1445 | }, 1446 | "plus.nativeUI": { 1447 | "body": [ 1448 | "plus.nativeUI." 1449 | ], 1450 | "prefix": "pnativeUI", 1451 | "project": "Web,App,Wap2App", 1452 | "scope": "typescript,javascript", 1453 | "triggerAssist": true 1454 | }, 1455 | "plus.nativeUI.alert": { 1456 | "body": [ 1457 | "plus.nativeUI.alert($1)" 1458 | ], 1459 | "prefix": "pnalert", 1460 | "project": "uni-app,App,Wap2App", 1461 | "scope": "typescript,javascript" 1462 | }, 1463 | "plus.navigator": { 1464 | "body": [ 1465 | "plus.navigatorsc." 1466 | ], 1467 | "prefix": "pnavigator", 1468 | "project": "Web,App,Wap2App", 1469 | "scope": "typescript,javascript", 1470 | "triggerAssist": true 1471 | }, 1472 | "plus.net": { 1473 | "body": [ 1474 | "plus.net." 1475 | ], 1476 | "prefix": "pnet", 1477 | "project": "Web,App,Wap2App", 1478 | "scope": "typescript,javascript", 1479 | "triggerAssist": true 1480 | }, 1481 | "plus.networkinfo": { 1482 | "body": [ 1483 | "plus.networkinfo." 1484 | ], 1485 | "prefix": "pnetworkinfo", 1486 | "project": "Web,App,Wap2App", 1487 | "scope": "typescript,javascript", 1488 | "triggerAssist": true 1489 | }, 1490 | "plus.oauth": { 1491 | "body": [ 1492 | "plus.oauth." 1493 | ], 1494 | "prefix": "poauth", 1495 | "project": "Web,App,Wap2App", 1496 | "scope": "typescript,javascript", 1497 | "triggerAssist": true 1498 | }, 1499 | "plus.orientation": { 1500 | "body": [ 1501 | "plus.orientation." 1502 | ], 1503 | "prefix": "porientation", 1504 | "project": "Web,App,Wap2App", 1505 | "scope": "typescript,javascript", 1506 | "triggerAssist": true 1507 | }, 1508 | "plus.os": { 1509 | "body": [ 1510 | "plus.os." 1511 | ], 1512 | "prefix": "pos", 1513 | "project": "Web,App,Wap2App", 1514 | "scope": "typescript,javascript", 1515 | "triggerAssist": true 1516 | }, 1517 | "plus.payment": { 1518 | "body": [ 1519 | "plus.payment." 1520 | ], 1521 | "prefix": "ppayment", 1522 | "project": "Web,App,Wap2App", 1523 | "scope": "typescript,javascript", 1524 | "triggerAssist": true 1525 | }, 1526 | "plus.proximity": { 1527 | "body": [ 1528 | "plus.proximity." 1529 | ], 1530 | "prefix": "pproximity", 1531 | "project": "Web,App,Wap2App", 1532 | "scope": "typescript,javascript", 1533 | "triggerAssist": true 1534 | }, 1535 | "plus.push": { 1536 | "body": [ 1537 | "plus.push." 1538 | ], 1539 | "prefix": "ppush", 1540 | "project": "Web,App,Wap2App", 1541 | "scope": "typescript,javascript", 1542 | "triggerAssist": true 1543 | }, 1544 | "plus.runtime": { 1545 | "body": [ 1546 | "plus.runtime." 1547 | ], 1548 | "prefix": "pruntime", 1549 | "project": "Web,App,Wap2App", 1550 | "scope": "typescript,javascript", 1551 | "triggerAssist": true 1552 | }, 1553 | "plus.share": { 1554 | "body": [ 1555 | "plus.share." 1556 | ], 1557 | "prefix": "pshare", 1558 | "project": "Web,App,Wap2App", 1559 | "scope": "typescript,javascript", 1560 | "triggerAssist": true 1561 | }, 1562 | "plus.speech": { 1563 | "body": [ 1564 | "plus.speech.$0" 1565 | ], 1566 | "prefix": "pspeech", 1567 | "project": "Web,App,Wap2App", 1568 | "scope": "typescript,javascript", 1569 | "triggerAssist": true 1570 | }, 1571 | "plus.statistic": { 1572 | "body": [ 1573 | "plus.statistic." 1574 | ], 1575 | "prefix": "pstatistic", 1576 | "project": "Web,App,Wap2App", 1577 | "scope": "typescript,javascript", 1578 | "triggerAssist": true 1579 | }, 1580 | "plus.storage": { 1581 | "body": [ 1582 | "plus.storage." 1583 | ], 1584 | "prefix": "pstorage", 1585 | "project": "Web,App,Wap2App", 1586 | "scope": "typescript,javascript", 1587 | "triggerAssist": true 1588 | }, 1589 | "plus.uploader": { 1590 | "body": [ 1591 | "plus.uploader." 1592 | ], 1593 | "prefix": "puploader", 1594 | "project": "Web,App,Wap2App", 1595 | "scope": "typescript,javascript", 1596 | "triggerAssist": true 1597 | }, 1598 | "plus.webview": { 1599 | "body": [ 1600 | "plus.webview." 1601 | ], 1602 | "prefix": "pweb", 1603 | "project": "uni-app,App,Wap2App", 1604 | "scope": "typescript,javascript", 1605 | "triggerAssist": true 1606 | }, 1607 | "plus.zip": { 1608 | "body": [ 1609 | "plus.zip." 1610 | ], 1611 | "prefix": "pzip", 1612 | "project": "Web,App,Wap2App", 1613 | "scope": "typescript,javascript", 1614 | "triggerAssist": true 1615 | }, 1616 | "plusReady": { 1617 | "body": [ 1618 | "function plusReady(){", 1619 | " $0", 1620 | "}", 1621 | "if (window.plus) {", 1622 | " plusReady()", 1623 | "} else{", 1624 | " document.addEventListener('plusready',plusReady,false);", 1625 | "}" 1626 | ], 1627 | "prefix": "pready", 1628 | "project": "Web,App,Wap2App", 1629 | "scope": "typescript,javascript", 1630 | "triggerAssist": true 1631 | }, 1632 | "querySelector": { 1633 | "body": [ 1634 | "document.querySelector('$1').$0" 1635 | ], 1636 | "prefix": "ds", 1637 | "project": "Web,App,Wap2App", 1638 | "scope": "typescript,javascript", 1639 | "triggerAssist": true 1640 | }, 1641 | "querySelectoraddEventListener": { 1642 | "body": [ 1643 | "document.querySelector('$1').addEventListener('${2:tap}',function ($3) {", 1644 | " $0", 1645 | "})" 1646 | ], 1647 | "prefix": "dsa", 1648 | "project": "Web,App,Wap2App", 1649 | "scope": "typescript,javascript", 1650 | "triggerAssist": true 1651 | }, 1652 | "redirectTo({...})": { 1653 | "body": [ 1654 | "redirectTo({", 1655 | "\turl: '$1'", 1656 | "});$0" 1657 | ], 1658 | "prefix": "redirectTo", 1659 | "scope": "uni.method.js" 1660 | }, 1661 | "return false": { 1662 | "body": [ 1663 | "return false;" 1664 | ], 1665 | "prefix": "rfalse", 1666 | "scope": "typescript,javascript" 1667 | }, 1668 | "return false;": { 1669 | "body": [ 1670 | "return false;" 1671 | ], 1672 | "prefix": "rfalse", 1673 | "project": "Web,App,Wap2App", 1674 | "scope": "typescript,javascript" 1675 | }, 1676 | "return true": { 1677 | "body": [ 1678 | "return true;" 1679 | ], 1680 | "prefix": "rtrue", 1681 | "scope": "typescript,javascript" 1682 | }, 1683 | "return true;": { 1684 | "body": [ 1685 | "return true;" 1686 | ], 1687 | "prefix": "rtrue", 1688 | "project": "Web,App,Wap2App", 1689 | "scope": "typescript,javascript" 1690 | }, 1691 | "setTimeout function": { 1692 | "body": [ 1693 | "setTimeout(function() {$0}, ${1:10});" 1694 | ], 1695 | "prefix": "settimeout", 1696 | "scope": "typescript,javascript" 1697 | }, 1698 | "switch_case": { 1699 | "body": [ 1700 | "switch (${1}){", 1701 | "\tcase ${2:value}:", 1702 | "\t\tbreak;", 1703 | "\tdefault:", 1704 | "\t\tbreak;", 1705 | "}" 1706 | ], 1707 | "prefix": "switchcase", 1708 | "scope": "typescript,javascript" 1709 | }, 1710 | "try{}catch(e)": { 1711 | "body": [ 1712 | "try{", 1713 | "\t$0", 1714 | "}catch(e){", 1715 | "\t//TODO handle the exception", 1716 | "}" 1717 | ], 1718 | "prefix": "trycatch", 1719 | "scope": "typescript,javascript" 1720 | }, 1721 | "typeof": { 1722 | "body": [ 1723 | "typeof($1)==\"${2:undefined}\"" 1724 | ], 1725 | "prefix": "typeoff", 1726 | "scope": "typescript,javascript" 1727 | }, 1728 | "typeof!": { 1729 | "body": [ 1730 | "typeof($1)!=\"${2:undefined}\"" 1731 | ], 1732 | "prefix": "typeof!", 1733 | "scope": "typescript,javascript" 1734 | }, 1735 | "uAlert": { 1736 | "body": [ 1737 | "uni.showModal({", 1738 | "\tcontent: '$1',", 1739 | "\tshowCancel: false", 1740 | "});" 1741 | ], 1742 | "prefix": "ualert", 1743 | "project": "uni-app", 1744 | "scope": "typescript,javascript" 1745 | }, 1746 | "uConfirm": { 1747 | "body": [ 1748 | "uni.showModal({", 1749 | "\tcontent: '$1',", 1750 | "\tsuccess: function (res) {", 1751 | "\t\tif (res.confirm) {", 1752 | "\t\t\t$2", 1753 | "\t\t} else if (res.cancel) {", 1754 | "\t\t\t$3", 1755 | "\t\t}", 1756 | "\t}", 1757 | "});" 1758 | ], 1759 | "prefix": "uconfirm", 1760 | "project": "uni-app", 1761 | "scope": "typescript,javascript" 1762 | }, 1763 | "uGetLocation": { 1764 | "body": [ 1765 | "uni.getLocation({", 1766 | "\ttype: 'wgs84',", 1767 | "\tsuccess: res => {$0}", 1768 | "\tfail: () => {},", 1769 | "\tcomplete: () => {}", 1770 | "});" 1771 | ], 1772 | "prefix": "ugetlocation", 1773 | "project": "uni-app", 1774 | "scope": "typescript,javascript" 1775 | }, 1776 | "uLogin": { 1777 | "body": [ 1778 | "uni.login({", 1779 | "\tprovider: '$1',", 1780 | "\tsuccess: res => {},", 1781 | "\tfail: () => {},", 1782 | "\tcomplete: () => {}", 1783 | "});" 1784 | ], 1785 | "prefix": "ulogin", 1786 | "project": "uni-app", 1787 | "scope": "typescript,javascript" 1788 | }, 1789 | "uNavigateBack": { 1790 | "body": [ 1791 | "uni.navigateBack({", 1792 | "\tdelta: $1", 1793 | "});" 1794 | ], 1795 | "prefix": "unavigateback", 1796 | "project": "uni-app", 1797 | "scope": "typescript,javascript" 1798 | }, 1799 | "uNavigateTo": { 1800 | "body": [ 1801 | "uni.navigateTo({", 1802 | "\turl: '$1',", 1803 | "\tsuccess: res => {},", 1804 | "\tfail: () => {},", 1805 | "\tcomplete: () => {}", 1806 | "});" 1807 | ], 1808 | "prefix": "unavigateto", 1809 | "project": "uni-app", 1810 | "scope": "typescript,javascript" 1811 | }, 1812 | "uPay": { 1813 | "body": [ 1814 | "uni.requestPayment({", 1815 | "\tprovider: '$1',", 1816 | "\torderInfo: '$2',", 1817 | "\tsuccess: res => {},", 1818 | "\tfail: () => {},", 1819 | "\tcomplete: () => {}", 1820 | "});" 1821 | ], 1822 | "prefix": "upay", 1823 | "project": "uni-app", 1824 | "scope": "typescript,javascript" 1825 | }, 1826 | "uRedirectTo": { 1827 | "body": [ 1828 | "uni.redirectTo({", 1829 | "\turl: '$1',", 1830 | "\tsuccess: res => {},", 1831 | "\tfail: () => {},", 1832 | "\tcomplete: () => {}", 1833 | "});" 1834 | ], 1835 | "prefix": "uredirectto", 1836 | "project": "uni-app", 1837 | "scope": "typescript,javascript" 1838 | }, 1839 | "uRequest": { 1840 | "body": [ 1841 | "uni.request({", 1842 | "\turl: '$1',", 1843 | "\tmethod: 'GET$2',", 1844 | "\tdata: {$3},", 1845 | "\tsuccess: res => {$0},", 1846 | "\tfail: () => {},", 1847 | "\tcomplete: () => {}", 1848 | "});" 1849 | ], 1850 | "prefix": "urequest", 1851 | "project": "uni-app", 1852 | "scope": "typescript,javascript" 1853 | }, 1854 | "uRequestPayment": { 1855 | "body": [ 1856 | "uni.requestPayment({", 1857 | "\tprovider: '$1',", 1858 | "\torderInfo: '$2',", 1859 | "\tsuccess: res => {},", 1860 | "\tfail: () => {},", 1861 | "\tcomplete: () => {}", 1862 | "});" 1863 | ], 1864 | "prefix": "urequestpayment", 1865 | "project": "uni-app", 1866 | "scope": "typescript,javascript" 1867 | }, 1868 | "uShare": { 1869 | "body": [ 1870 | "uni.share({", 1871 | "\tprovider: '$1',", 1872 | "\ttype: 0$2,", 1873 | "\ttitle: '$3',", 1874 | "\thref: '$4',", 1875 | "\timageUrl: '$5',", 1876 | "\tsuccess: res => {},", 1877 | "\tfail: () => {},", 1878 | "\tcomplete: () => {}", 1879 | "});" 1880 | ], 1881 | "prefix": "ushare", 1882 | "project": "uni-app", 1883 | "scope": "typescript,javascript" 1884 | }, 1885 | "uShowActionSheet": { 1886 | "body": [ 1887 | "uni.showActionSheet({", 1888 | "\titemList: $1,", 1889 | "\tsuccess: res => {},", 1890 | "\tfail: () => {},", 1891 | "\tcomplete: () => {}", 1892 | "});" 1893 | ], 1894 | "prefix": "ushowactionsheet", 1895 | "project": "uni-app", 1896 | "scope": "typescript,javascript" 1897 | }, 1898 | "uShowLoading": { 1899 | "body": [ 1900 | "uni.showLoading({", 1901 | "\ttitle: '$1',", 1902 | "\tmask: false", 1903 | "});" 1904 | ], 1905 | "prefix": "ushowloading", 1906 | "project": "uni-app", 1907 | "scope": "typescript,javascript" 1908 | }, 1909 | "uShowModal": { 1910 | "body": [ 1911 | "uni.showModal({", 1912 | "\ttitle: '$1',", 1913 | "\tcontent: '$2',", 1914 | "\tshowCancel: false$3,", 1915 | "\tcancelText: '$4',", 1916 | "\tconfirmText: '$5',", 1917 | "\tsuccess: res => {$0},", 1918 | "\tfail: () => {},", 1919 | "\tcomplete: () => {}", 1920 | "});" 1921 | ], 1922 | "prefix": "ushowmodal", 1923 | "project": "uni-app", 1924 | "scope": "typescript,javascript" 1925 | }, 1926 | "uShowToast": { 1927 | "body": [ 1928 | "uni.showToast({", 1929 | "\ttitle: '$1'", 1930 | "});" 1931 | ], 1932 | "prefix": "ushowtoast", 1933 | "project": "uni-app", 1934 | "scope": "typescript,javascript" 1935 | }, 1936 | "uShowToastNoIcon": { 1937 | "body": [ 1938 | "uni.showToast({", 1939 | "\ttitle: '$1',", 1940 | "\ticon: 'none'", 1941 | "});" 1942 | ], 1943 | "prefix": "ushowtoastnoicon", 1944 | "project": "uni-app", 1945 | "scope": "typescript,javascript" 1946 | }, 1947 | "uStartPullDownRefresh": { 1948 | "body": [ 1949 | "uni.startPullDownRefresh({", 1950 | "\tsuccess: res => {},", 1951 | "\tfail: () => {},", 1952 | "\tcomplete: () => {}", 1953 | "});" 1954 | ], 1955 | "prefix": "ustartpulldownrefresh", 1956 | "project": "uni-app", 1957 | "scope": "typescript,javascript" 1958 | }, 1959 | "uStopPullDownRefresh": { 1960 | "body": [ 1961 | "uni.stopPullDownRefresh();" 1962 | ], 1963 | "prefix": "ustoppulldownrefresh", 1964 | "project": "uni-app", 1965 | "scope": "typescript,javascript" 1966 | }, 1967 | "use strict": { 1968 | "body": [ 1969 | "\"use strict\"" 1970 | ], 1971 | "prefix": "use", 1972 | "scope": "typescript,javascript" 1973 | }, 1974 | "var a=[];": { 1975 | "body": [ 1976 | "var ${1:a}=[$2];" 1977 | ], 1978 | "prefix": "vara", 1979 | "scope": "typescript,javascript" 1980 | }, 1981 | "var c = canvas": { 1982 | "body": [ 1983 | "var ${2:c} = document.getElementById(\"$1\").getContext(\"2d\");" 1984 | ], 1985 | "prefix": "varc", 1986 | "scope": "typescript,javascript", 1987 | "triggerAssist": true 1988 | }, 1989 | "var currentWebview": { 1990 | "body": [ 1991 | "var currentWebview = this.\\$mp.page.\\$getAppWebview()" 1992 | ], 1993 | "prefix": "varcw", 1994 | "project": "uni-app", 1995 | "scope": "typescript,javascript" 1996 | }, 1997 | "var i=0;": { 1998 | "body": [ 1999 | "var ${1:i}=${2:0};" 2000 | ], 2001 | "prefix": "vari", 2002 | "scope": "typescript,javascript" 2003 | }, 2004 | "var l=a.length;": { 2005 | "body": [ 2006 | "var ${1:l}=${2:a}.length;" 2007 | ], 2008 | "prefix": "varl", 2009 | "scope": "typescript,javascript" 2010 | }, 2011 | "var s=\"\";": { 2012 | "body": [ 2013 | "var ${1:s}=\"$2\";" 2014 | ], 2015 | "prefix": "vars", 2016 | "scope": "typescript,javascript" 2017 | }, 2018 | "var xhr": { 2019 | "body": [ 2020 | "var ${1:xhr} = new XMLHttpRequest();", 2021 | "xhr.open(\"${2:POST}\",\"$3\",${4:true});" 2022 | ], 2023 | "prefix": "varxhr", 2024 | "scope": "typescript,javascript" 2025 | }, 2026 | "while": { 2027 | "body": [ 2028 | "while (${1:condition}){", 2029 | "\t$0", 2030 | "}" 2031 | ], 2032 | "prefix": "whilee", 2033 | "scope": "typescript,javascript" 2034 | }, 2035 | "windowaddEventListener": { 2036 | "body": [ 2037 | "window.addEventListener('${1:scroll}',function ($2) {", 2038 | " $0", 2039 | "})" 2040 | ], 2041 | "prefix": "wad", 2042 | "project": "Web,App,Wap2App", 2043 | "scope": "typescript,javascript", 2044 | "triggerAssist": true 2045 | }, 2046 | "with": { 2047 | "body": [ 2048 | "with ($1){", 2049 | "\t$0", 2050 | "}" 2051 | ], 2052 | "prefix": "withh", 2053 | "scope": "typescript,javascript" 2054 | } 2055 | } 2056 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "css.styleSheets": [ 3 | "/src/styles/base.css", 4 | "/src/styles/aliicon.css", 5 | "/src/styles/border.css", 6 | "/src/styles/common.css", 7 | ] 8 | } -------------------------------------------------------------------------------- /.vscode/vue-html.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "#ifdef": { 3 | "body": [ 4 | "", 5 | "$0", 6 | "" 7 | ], 8 | "prefix": "ifdef", 9 | "project": "uni-app", 10 | "scope": "vue-html" 11 | }, 12 | "#ifndef": { 13 | "body": [ 14 | "", 15 | "$0", 16 | "" 17 | ], 18 | "prefix": "ifndef", 19 | "project": "uni-app", 20 | "scope": "vue-html" 21 | }, 22 | "Vue Base": { 23 | "body": [ 24 | "", 29 | "", 30 | "", 35 | "", 36 | "" 39 | ], 40 | "description": "Base for Vue File", 41 | "prefix": "vbase", 42 | "scope": "vue-html" 43 | }, 44 | "Vue Class Binding": { 45 | "body": [ 46 | "<${1|div|} :class=\"{ ${2:className}: ${3:data} }\"><,${1:div}>" 47 | ], 48 | "description": "vue class binding", 49 | "prefix": "vclass", 50 | "scope": "vue-html" 51 | }, 52 | "Vue Class Binding Object": { 53 | "body": [ 54 | "<${1|div|} :class=\"[${2:classNameA}, ${3:classNameB}]\"><,${1:div}>" 55 | ], 56 | "description": "vue class binding", 57 | "prefix": "vclass-obj", 58 | "scope": "vue-html" 59 | }, 60 | "Vue Component with Props Binding": { 61 | "body": [ 62 | "<${1|component|} :${1:propName}=\"${0}\"><,${1:component}>" 63 | ], 64 | "description": "component element with props", 65 | "prefix": "vel-props", 66 | "scope": "vue-html" 67 | }, 68 | "Vue Image Source Binding": { 69 | "body": [ 70 | "\"${2:altText}\"/" 71 | ], 72 | "description": "image source binding", 73 | "prefix": "vsrc", 74 | "scope": "vue-html" 75 | }, 76 | "Vue Multiple Conditional Class Bindings": { 77 | "body": [ 78 | "<${1|div|} :class=\"[${2:classNameA}, {${3:classNameB} : ${4:condition}}]\"><,${1:div}>" 79 | ], 80 | "description": "vue multiple conditional class bindings", 81 | "prefix": "vclass-obj-mult", 82 | "scope": "vue-html" 83 | }, 84 | "Vue Nuxt Routing Link": { 85 | "body": [ 86 | "${1:page}" 87 | ], 88 | "description": "nuxt routing link", 89 | "prefix": "vnuxtl", 90 | "scope": "vue-html" 91 | }, 92 | "Vue Style Binding": { 93 | "body": [ 94 | "<${1|div|} :style=\"{ fontSize: ${2:data} + 'px' }\"><,${1:div}>" 95 | ], 96 | "description": "vue inline style binding", 97 | "prefix": "vstyle", 98 | "scope": "vue-html" 99 | }, 100 | "Vue Style Binding Object": { 101 | "body": [ 102 | "<${1|div|} :style=\"[${2:styleObjectA}, ${3:styleObjectB]}\"><,${1:div}>" 103 | ], 104 | "description": "vue inline style binding, objects", 105 | "prefix": "vstyle-obj", 106 | "scope": "vue-html" 107 | }, 108 | "Vue Transition Component with JavaScript Hooks": { 109 | "body": [ 110 | "", 118 | "", 119 | "" 120 | ], 121 | "description": "transition component js hooks", 122 | "prefix": "vanim", 123 | "scope": "vue-html" 124 | }, 125 | "Vue v-for": { 126 | "body": [ 127 | "<${1:div} v-for=\"${2:item} in ${2:item}s\" :key=\"${2:item}.id\">", 128 | "\t{{ ${2:item} }}", 129 | "" 130 | ], 131 | "description": "vfor statement", 132 | "prefix": "vfor", 133 | "scope": "vue-html" 134 | }, 135 | "Vue v-model Directive": { 136 | "body": [ 137 | "" 138 | ], 139 | "description": "v-model directive", 140 | "prefix": "vmodel", 141 | "scope": "vue-html" 142 | }, 143 | "Vue v-model Number Directive": { 144 | "body": [ 145 | "" 146 | ], 147 | "description": "v-model directive number input", 148 | "prefix": "vmodel-num", 149 | "scope": "vue-html" 150 | }, 151 | "Vue v-on Shortcut Directive": { 152 | "body": [ 153 | "@click=\"${1:handler}(${2:arg}, $event)\"" 154 | ], 155 | "description": "v-on click handler with arguments", 156 | "prefix": "von", 157 | "scope": "vue-html" 158 | }, 159 | "uAccordion": { 160 | "body": [ 161 | "", 162 | "\t", 163 | "\t\t", 164 | "\t\t\t折叠面板{{index}}", 165 | "\t\t", 166 | "\t\t", 167 | "\t\t\t", 168 | "\t\t\t\thello uni-app", 169 | "\t\t\t\thello uni-app", 170 | "\t\t\t\thello uni-app", 171 | "\t\t\t", 172 | "\t\t", 173 | "\t", 174 | "" 175 | ], 176 | "prefix": "uaccordion", 177 | "project": "uni-app", 178 | "scope": "vue-html" 179 | }, 180 | "uAudio": { 181 | "body": [ 182 | "" 183 | ], 184 | "prefix": "uaudio", 185 | "project": "uni-app", 186 | "scope": "vue-html" 187 | }, 188 | "uBadge": { 189 | "body": [ 190 | "" 191 | ], 192 | "prefix": "ubadge", 193 | "project": "uni-app", 194 | "scope": "vue-html" 195 | }, 196 | "uButton": { 197 | "body": [ 198 | "" 199 | ], 200 | "prefix": "ubutton", 201 | "project": "uni-app", 202 | "scope": "vue-html" 203 | }, 204 | "uCalendar": { 205 | "body": [ 206 | "" 207 | ], 208 | "prefix": "ucalendar", 209 | "project": "uni-app", 210 | "scope": "vue-html" 211 | }, 212 | "uCard": { 213 | "body": [ 214 | "", 215 | "\t内容主体,可自定义内容及样式$4", 216 | "" 217 | ], 218 | "prefix": "ucard", 219 | "project": "uni-app", 220 | "scope": "vue-html" 221 | }, 222 | "uCheckbox": { 223 | "body": [ 224 | "" 227 | ], 228 | "prefix": "ucheckbox", 229 | "project": "uni-app", 230 | "scope": "vue-html" 231 | }, 232 | "uCollapse": { 233 | "body": [ 234 | "", 235 | "\t", 236 | "\t\t内容$3", 237 | "\t", 238 | "" 239 | ], 240 | "prefix": "uCollapse", 241 | "project": "uni-app", 242 | "scope": "vue-html" 243 | }, 244 | "uCountDown": { 245 | "body": [ 246 | "" 247 | ], 248 | "prefix": "ucountdown", 249 | "project": "uni-app", 250 | "scope": "vue-html" 251 | }, 252 | "uDrawer": { 253 | "body": [ 254 | "", 255 | "\t", 256 | "\t\t$2", 257 | "\t", 258 | "" 259 | ], 260 | "prefix": "uDrawer", 261 | "project": "uni-app", 262 | "scope": "vue-html" 263 | }, 264 | "uEditor": { 265 | "body": [ 266 | "" 267 | ], 268 | "prefix": "uEditor", 269 | "project": "uni-app", 270 | "scope": "vue-html" 271 | }, 272 | "uForm": { 273 | "body": [ 274 | "
", 275 | "\t", 276 | "\t\tswitch$1", 277 | "\t\t", 278 | "\t", 279 | "\t", 280 | "\t\tslider", 281 | "\t\t", 282 | "\t", 283 | "\t", 284 | "\t\tinput", 285 | "\t\t", 286 | "\t", 287 | "\t", 288 | "\t\tradio", 289 | "\t\t", 290 | "\t\t", 292 | "\t\t", 294 | "\t\t", 295 | "\t", 296 | "\t", 297 | "\t\tcheckbox", 298 | "\t\t", 299 | "\t\t\t", 301 | "\t\t\t", 303 | "\t\t", 304 | "\t", 305 | "\t", 306 | "\t\t", 307 | "\t\t", 308 | "\t", 309 | "
" 310 | ], 311 | "prefix": "uform", 312 | "project": "uni-app", 313 | "scope": "vue-html" 314 | }, 315 | "uGrid": { 316 | "body": [ 317 | "" 318 | ], 319 | "prefix": "ugrid", 320 | "project": "uni-app", 321 | "scope": "vue-html" 322 | }, 323 | "uIcon": { 324 | "body": [ 325 | "" 326 | ], 327 | "prefix": "uicon", 328 | "project": "uni-app", 329 | "scope": "vue-html" 330 | }, 331 | "uImage": { 332 | "body": [ 333 | "$0" 334 | ], 335 | "prefix": "uimage", 336 | "project": "uni-app", 337 | "scope": "vue-html" 338 | }, 339 | "uInput": { 340 | "body": [ 341 | "" 342 | ], 343 | "prefix": "uinput", 344 | "project": "uni-app", 345 | "scope": "vue-html" 346 | }, 347 | "uList": { 348 | "body": [ 349 | "", 350 | "\t", 351 | "\t", 352 | "" 353 | ], 354 | "prefix": "ulist", 355 | "project": "uni-app", 356 | "scope": "vue-html" 357 | }, 358 | "uListMedia": { 359 | "body": [ 360 | "", 361 | "\t", 362 | "\t\t", 363 | "\t\t\t", 364 | "\t\t\t", 365 | "\t\t\t\t{{item.title$3}}", 366 | "\t\t\t\t{{item.content$4}}", 367 | "\t\t\t", 368 | "\t\t", 369 | "\t", 370 | "" 371 | ], 372 | "prefix": "ulistmedia", 373 | "project": "uni-app", 374 | "scope": "vue-html" 375 | }, 376 | "uLoadMore": { 377 | "body": [ 378 | "" 379 | ], 380 | "prefix": "uloadmore", 381 | "project": "uni-app", 382 | "scope": "vue-html" 383 | }, 384 | "uMap": { 385 | "body": [ 386 | "" 387 | ], 388 | "prefix": "umap", 389 | "project": "uni-app", 390 | "scope": "vue-html" 391 | }, 392 | "uNavBar": { 393 | "body": [ 394 | "" 395 | ], 396 | "prefix": "unavbar", 397 | "project": "uni-app", 398 | "scope": "vue-html" 399 | }, 400 | "uNavigator": { 401 | "body": [ 402 | "$0" 403 | ], 404 | "prefix": "unavigator", 405 | "project": "uni-app", 406 | "scope": "vue-html" 407 | }, 408 | "uNoticeBar": { 409 | "body": [ 410 | "" 411 | ], 412 | "prefix": "uNoticeBar", 413 | "project": "uni-app", 414 | "scope": "vue-html" 415 | }, 416 | "uNumberBox": { 417 | "body": [ 418 | "" 419 | ], 420 | "prefix": "unumberbox", 421 | "project": "uni-app", 422 | "scope": "vue-html" 423 | }, 424 | "uPagination": { 425 | "body": [ 426 | "" 427 | ], 428 | "prefix": "uPagination", 429 | "project": "uni-app", 430 | "scope": "vue-html" 431 | }, 432 | "uPicker": { 433 | "body": [ 434 | "", 435 | "\tpicker组件", 436 | "" 437 | ], 438 | "prefix": "upicker", 439 | "project": "uni-app", 440 | "scope": "vue-html" 441 | }, 442 | "uPickerView": { 443 | "body": [ 444 | "", 445 | "\t", 446 | "\t\t$0", 447 | "\t", 448 | "\t", 449 | "\t\t$2", 450 | "\t", 451 | "\t", 452 | "\t\t", 453 | "\t", 454 | "" 455 | ], 456 | "prefix": "upickerview", 457 | "project": "uni-app", 458 | "scope": "vue-html" 459 | }, 460 | "uPopup": { 461 | "body": [ 462 | "" 463 | ], 464 | "prefix": "upopup", 465 | "project": "uni-app", 466 | "scope": "vue-html" 467 | }, 468 | "uProductList": { 469 | "body": [ 470 | "", 471 | "\t", 472 | "\t\t", 473 | "\t\t\t", 474 | "\t\t", 475 | "\t\t{{product.title}}", 476 | "\t\t", 477 | "\t\t\t¥{{product.originalPrice}}", 478 | "\t\t\t¥{{product.favourPrice}}", 479 | "\t\t\t{{product.tip}}", 480 | "\t\t", 481 | "\t", 482 | "" 483 | ], 484 | "prefix": "uproductlist", 485 | "project": "uni-app", 486 | "scope": "vue-html" 487 | }, 488 | "uProgress": { 489 | "body": [ 490 | " " 491 | ], 492 | "prefix": "uprogress", 493 | "project": "uni-app", 494 | "scope": "vue-html" 495 | }, 496 | "uRadio": { 497 | "body": [ 498 | "" 501 | ], 502 | "prefix": "uradio", 503 | "project": "uni-app", 504 | "scope": "vue-html" 505 | }, 506 | "uRate": { 507 | "body": [ 508 | "" 509 | ], 510 | "prefix": "uRate", 511 | "project": "uni-app", 512 | "scope": "vue-html" 513 | }, 514 | "uRichText": { 515 | "body": [ 516 | "" 517 | ], 518 | "prefix": "urichtext", 519 | "project": "uni-app", 520 | "scope": "vue-html" 521 | }, 522 | "uScrollView": { 523 | "body": [ 524 | "", 525 | "\t$0", 526 | "\t", 527 | "\t", 528 | "\t", 529 | "" 530 | ], 531 | "prefix": "uscrollview", 532 | "project": "uni-app", 533 | "scope": "vue-html" 534 | }, 535 | "uSegmentedControl": { 536 | "body": [ 537 | "", 538 | "", 539 | "\t", 540 | "\t\t选项卡1的内容", 541 | "\t", 542 | "\t", 543 | "\t\t选项卡2的内容", 544 | "\t", 545 | "\t", 546 | "\t\t选项卡3的内容", 547 | "\t", 548 | "" 549 | ], 550 | "prefix": "usegmentedcontrol", 551 | "project": "uni-app", 552 | "scope": "vue-html" 553 | }, 554 | "uSlider": { 555 | "body": [ 556 | "" 557 | ], 558 | "prefix": "uslider", 559 | "project": "uni-app", 560 | "scope": "vue-html" 561 | }, 562 | "uSteps": { 563 | "body": [ 564 | "" 565 | ], 566 | "prefix": "usteps", 567 | "project": "uni-app", 568 | "scope": "vue-html" 569 | }, 570 | "uSwipeAction": { 571 | "body": [ 572 | "", 573 | "\t$2", 574 | "" 575 | ], 576 | "prefix": "uSwipeAction", 577 | "project": "uni-app", 578 | "scope": "vue-html" 579 | }, 580 | "uSwiper": { 581 | "body": [ 582 | "", 583 | "\t", 584 | "\t\t$1", 585 | "\t", 586 | "\t", 587 | "\t\t$2", 588 | "\t", 589 | "\t", 590 | "\t\t$0", 591 | "\t", 592 | "" 593 | ], 594 | "prefix": "uswiper", 595 | "project": "uni-app", 596 | "scope": "vue-html" 597 | }, 598 | "uSwipermsg": { 599 | "body": [ 600 | "", 601 | "\t", 602 | "\t\t", 603 | "\t", 604 | "\t", 605 | "\t\t", 606 | "\t\t\t消息1", 607 | "\t\t", 608 | "\t\t", 609 | "\t\t\t消息2", 610 | "\t\t", 611 | "\t\t", 612 | "\t\t\t消息3", 613 | "\t\t", 614 | "\t", 615 | "" 616 | ], 617 | "prefix": "uswipermsg", 618 | "project": "uni-app", 619 | "scope": "vue-html" 620 | }, 621 | "uSwitch": { 622 | "body": [ 623 | "" 624 | ], 625 | "prefix": "uswitch", 626 | "project": "uni-app", 627 | "scope": "vue-html" 628 | }, 629 | "uTag": { 630 | "body": [ 631 | "" 632 | ], 633 | "prefix": "utag", 634 | "project": "uni-app", 635 | "scope": "vue-html" 636 | }, 637 | "uTemplate": { 638 | "body": [ 639 | "" 642 | ], 643 | "prefix": "utemplate", 644 | "project": "uni-app", 645 | "scope": "vue-html" 646 | }, 647 | "uText": { 648 | "body": [ 649 | "$0" 650 | ], 651 | "prefix": "utext", 652 | "project": "uni-app", 653 | "scope": "vue-html" 654 | }, 655 | "uTextarea": { 656 | "body": [ 657 | " 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 107 | 108 | -------------------------------------------------------------------------------- /src/pages/index/components/child.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /src/pages/index/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 42 | 43 | 49 | -------------------------------------------------------------------------------- /src/pages/mine/mine.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 91 | 92 | 100 | -------------------------------------------------------------------------------- /src/plugins/vue-bus/index.js: -------------------------------------------------------------------------------- 1 | export { default as VueBus } from './vue-bus'; -------------------------------------------------------------------------------- /src/plugins/vue-bus/vue-bus.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | const bus = new Vue(); 4 | 5 | /** 6 | * 使用方式 7 | * Vue.use(Bus) 8 | * this.$bus('eventName', id); 9 | * 10 | * bus: { 11 | * eventName(id) { 12 | * console.log(id); 13 | * } 14 | * } 15 | */ 16 | export default { 17 | install(Vue) { 18 | Vue.prototype.$bus = (type, ...args) => { 19 | bus.$emit(type, ...args); 20 | }; 21 | 22 | Vue.mixin({ 23 | beforeCreate() { 24 | const busOptions = this.$options.bus; 25 | if (busOptions) { 26 | this.$_bus = []; 27 | 28 | const addListeners = (map) => { 29 | for (const event in map) { 30 | const handler = map[event].bind(this); 31 | bus.$on(event, handler); 32 | this.$_bus.push({ event, handler }); 33 | } 34 | }; 35 | 36 | if (Array.isArray(busOptions)) { 37 | busOptions.forEach(addListeners); 38 | } else { 39 | addListeners(busOptions); 40 | } 41 | } 42 | }, 43 | beforeDestroy() { 44 | if (this.$_bus) { 45 | for (const listener of this.$_bus) { 46 | bus.$off(listener.event, listener.handler); 47 | } 48 | } 49 | } 50 | }); 51 | 52 | Vue.config.optionMergeStrategies.bus = (parent, child, vm) => { 53 | if (Array.isArray(parent)) { 54 | if (Array.isArray(child)) { 55 | return parent.concat(child); 56 | } else { 57 | parent.push(child); 58 | return parent; 59 | } 60 | } else if (Array.isArray(child)) { 61 | child.push(parent); 62 | return child; 63 | } else if (parent && child) { 64 | return [parent, child]; 65 | } else if (parent) { 66 | return parent; 67 | } 68 | return child; 69 | }; 70 | } 71 | }; -------------------------------------------------------------------------------- /src/plugins/vue-logger/index.js: -------------------------------------------------------------------------------- 1 | export { default as createLogger } from './vue-logger'; -------------------------------------------------------------------------------- /src/plugins/vue-logger/vue-logger.js: -------------------------------------------------------------------------------- 1 | // Credits: borrowed code from fcomb/redux-logger 2 | 3 | import { deepCopy } from '../../common/utils/helper' 4 | 5 | export default function createLogger ({ 6 | collapsed = true, 7 | filter = (mutation, stateBefore, stateAfter) => true, 8 | transformer = state => state, 9 | mutationTransformer = mut => mut, 10 | logger = console 11 | } = {}) { 12 | return store => { 13 | let prevState = deepCopy(store.state) 14 | 15 | store.subscribe((mutation, state) => { 16 | if (typeof logger === 'undefined') { 17 | return 18 | } 19 | const nextState = deepCopy(state) 20 | 21 | if (filter(mutation, prevState, nextState)) { 22 | const time = new Date() 23 | const formattedTime = ` @ ${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}` 24 | const formattedMutation = mutationTransformer(mutation) 25 | const message = `mutation ${mutation.type}${formattedTime}` 26 | const startMessage = collapsed 27 | ? logger.groupCollapsed 28 | : logger.group 29 | 30 | // render 31 | try { 32 | startMessage.call(logger, message) 33 | } catch (e) { 34 | console.log(message) 35 | } 36 | 37 | logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState)) 38 | logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation) 39 | logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState)) 40 | 41 | try { 42 | logger.groupEnd() 43 | } catch (e) { 44 | logger.log('—— log end ——') 45 | } 46 | } 47 | 48 | prevState = nextState 49 | }) 50 | } 51 | } 52 | 53 | function repeat (str, times) { 54 | return (new Array(times + 1)).join(str) 55 | } 56 | 57 | function pad (num, maxLength) { 58 | return repeat('0', maxLength - num.toString().length) + num 59 | } -------------------------------------------------------------------------------- /src/services/api-clinet.js: -------------------------------------------------------------------------------- 1 | import HttpClient from '../common/http-client'; 2 | import AuthService from './auth.service'; 3 | import store from "../store/index.js"; 4 | 5 | class ApiClient { 6 | /** 7 | * Create a new instance of ApiClient. 8 | */ 9 | constructor() { 10 | 11 | this.http = new HttpClient(); 12 | 13 | this.http.interceptors.request.push((options) => { 14 | let nextOptions = options; 15 | // console.log('拦截HTTP请求处理结果: ', nextOptions); 16 | if (AuthService.auth) { 17 | nextOptions.header.Authorization = `Bearer ${AuthService.auth}`; 18 | } 19 | 20 | // nextOptions.header['X-USER-APP-VERSION'] = `${AuthService.auth.version}`; 21 | return { 22 | options: nextOptions, 23 | }; 24 | }); 25 | 26 | this.http.interceptors.response.push((response) => { 27 | // console.log('拦截HTTP响应处理结果: ', response); 28 | response 29 | .then((res) => { 30 | return res; 31 | }) 32 | .catch((error) => { 33 | let err = error; 34 | if (err) { 35 | switch (err.statusCode) { 36 | case 200: 37 | err.message = err.data.message; 38 | break; 39 | case 400: 40 | err.message = "请求错误(400)"; 41 | break; 42 | case 401: 43 | // 401: 未登录或Token过期 对用户进行提示 44 | // 未登录则跳转登录页面,并携带当前页面的路径 45 | // 在登录成功后返回当前页面,这一步需要在登录页操作。 46 | // uni.navigateTo({ 47 | // url: 'login' 48 | // }); 49 | err.message = "未授权,请重新登录(401)"; 50 | break; 51 | case 403: 52 | err.message = "拒绝访问(403)"; 53 | break; 54 | case 404: 55 | err.message = "请求错误(404)"; 56 | break; 57 | case 500: 58 | err.message = "服务器错误(500)"; 59 | break; 60 | case 501: 61 | err.message = "服务器未实现服务(501)"; 62 | break; 63 | case 502: 64 | err.message = "网络错误(502)"; 65 | break; 66 | case 503: 67 | err.message = "服务不可用(503)"; 68 | break; 69 | case 504: 70 | err.message = "网络超时(504)"; 71 | break; 72 | case 505: 73 | err.message = "HTTP版本不受支持(505)"; 74 | break; 75 | default: 76 | err.message = `错误类型[${err.statusCode ? err.statusCode : "未知"}]`; 77 | } 78 | } else { 79 | err.message = "连接到服务器失败"; 80 | } 81 | uni.showToast({ 82 | title: err.message, 83 | duration: 2000, 84 | icon: "none", 85 | }); 86 | return err; 87 | }); 88 | return response; 89 | }); 90 | } 91 | 92 | request(options) { 93 | if(!store.getters['app/getIsConnected']){ 94 | uni.showToast({ 95 | title: '请检查网络', 96 | duration: 2000, 97 | icon: "none", 98 | }); 99 | return new Promise((resolve, reject) => { 100 | reject('请检查网络') 101 | }) 102 | } 103 | 104 | return this.http.sendRequest(options); 105 | } 106 | 107 | /** 108 | * get方法,对应get请求 109 | * @param {String} url [请求的url地址] 110 | * @param {Object} data [请求时携带的参数] 对于 GET 方法,会将数据自动转换为 query string 111 | */ 112 | get(url, data, options) { 113 | if (!options) { 114 | options = {}; 115 | } 116 | options.url = url; 117 | options.data = data; 118 | options.method = 'GET'; 119 | return this.request(options); 120 | } 121 | 122 | /** 123 | * post方法,对应post请求 124 | * @param {String} url [请求的url地址] 125 | * @param {Object} data [请求时携带的参数] 126 | */ 127 | post(url, data, options) { 128 | if (!options) { 129 | options = {}; 130 | } 131 | options.url = url; 132 | options.data = data; 133 | options.method = 'POST'; 134 | return this.request(options); 135 | } 136 | 137 | put(url, data, options) { 138 | if (!options) { 139 | options = {}; 140 | } 141 | options.url = url; 142 | options.data = data; 143 | options.method = 'PUT'; 144 | return this.request(options); 145 | } 146 | 147 | delete(url, data, options) { 148 | if (!options) { 149 | options = {}; 150 | } 151 | options.url = url; 152 | options.data = data; 153 | options.method = 'DELETE'; 154 | return this.request(options); 155 | } 156 | } 157 | 158 | const getApiClient = () => { 159 | return new ApiClient(); 160 | }; 161 | 162 | export { getApiClient }; 163 | export default new ApiClient(); 164 | -------------------------------------------------------------------------------- /src/services/api.service.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wkiwi 3 | * @Email: w_kiwi@163.com 4 | * @Date: 2019-05-31 09:47:48 5 | * @LastEditors: wkiwi 6 | * @LastEditTime: 2023-05-17 10:03:58 7 | */ 8 | import ApiClinet from './api-clinet'; 9 | import ApiConfig from '../config/api.config'; 10 | import AppConfig from '../config/app.config' 11 | const ApiService = { 12 | get(url, data, options) { 13 | return ApiClinet.get(url, data, options); 14 | }, 15 | post(url, data, options) { 16 | return ApiClinet.post(url, data, options); 17 | }, 18 | put(url, data, options) { 19 | return ApiClinet.put(url, data, options); 20 | }, 21 | delete(url, data, options) { 22 | return ApiClinet.delete(url, data, options); 23 | } 24 | }; 25 | 26 | export default ApiService; 27 | 28 | const HeaderTypr = { 29 | header: { 30 | Accept: '*/*', 31 | 'Content-Type': 'multipart/form-data; charset=utf-8' 32 | }, 33 | }; 34 | 35 | // 用户管理服务 36 | export const UserService = { 37 | // 用户登录 38 | login(params) { 39 | if (['weixin','qq'].includes(AppConfig.PROVIDER)) { 40 | //微信或QQ登陆 41 | return new Promise((resolve, reject) => { 42 | uni.login({ 43 | provider: AppConfig.PROVIDER, 44 | success: result=> { 45 | console.log(result) 46 | ApiClinet.post(ApiConfig.APP_BASE_API.LOGIN_URL, { 47 | code: result.code 48 | }) 49 | .then(res=>{ 50 | resolve(res); 51 | }) 52 | .catch(err=>{ 53 | resolve(err); 54 | }) 55 | }, 56 | fail:err=>{ 57 | console.log(err); 58 | } 59 | }); 60 | }); 61 | } else { 62 | //其他登陆方式 63 | return ApiClinet.post(ApiConfig.APP_BASE_API.LOGIN_URL, params); 64 | } 65 | }, 66 | // 查询用户 67 | get(params) { 68 | return ApiClinet.get(ApiConfig.APP_BASE_API.USER_INFO_URL, params); 69 | } 70 | /* 71 | // 找回密码 72 | findPassword(params) { 73 | return ApiClinet.post(ApiConfig.APP_BASE_API.FIND_PASSWORD_URL, params); 74 | }, 75 | // 修改密码 76 | modifyPassword(params) { 77 | return ApiClinet.post(ApiConfig.APP_BASE_API.MODIFY_PASSWORD_URL, params); 78 | }, 79 | // 用户注册 80 | signup(params) { 81 | return ApiClinet.post(ApiConfig.APP_BASE_API.SIGNUP_URL, params); 82 | }, 83 | 84 | */ 85 | }; 86 | 87 | //其他服务模块 88 | export const AppOtherService = { 89 | getMessageList(params) { 90 | return ApiClinet.get(ApiConfig.APP_BASE_API.OTHER, params, HeaderType); //更改header类型 91 | }, 92 | getQnyToken(params){ 93 | return ApiClinet.get(ApiConfig.APP_BASE_API.QNY_TOKEN,params); 94 | } 95 | }; 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/services/auth.service.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wkiwi 3 | * @Email: w_kiwi@163.com 4 | * @Date: 2020-09-17 13:47:48 5 | * @LastEditors: wkiwi 6 | * @LastEditTime: 2023-05-15 14:46:57 7 | */ 8 | /* eslint-disable */ 9 | 10 | class AuthService { 11 | constructor() { 12 | this.auth = this.get(); 13 | } 14 | 15 | set(auth) { 16 | try { 17 | uni.setStorageSync('auth', auth); 18 | } catch (error) { 19 | console.log(`setStorageSync调用失败`); 20 | } 21 | } 22 | 23 | setToken(token) { 24 | try { 25 | uni.setStorageSync('token', token); 26 | } catch (error) { 27 | console.log(`setStorageSync调用失败`); 28 | } 29 | } 30 | 31 | get() { 32 | try { 33 | const auth = uni.getStorageSync('auth'); 34 | return auth || {}; 35 | } catch (error) { 36 | console.log(`getStorageSync调用失败`); 37 | } 38 | } 39 | 40 | getToken(){ 41 | try { 42 | const token = uni.getStorageSync('token'); 43 | return token || ''; 44 | } catch (error) { 45 | console.log(`getStorageSync调用失败`); 46 | } 47 | } 48 | 49 | clear() { 50 | try { 51 | this.auth = {}; 52 | uni.removeStorageSync('auth'); 53 | uni.removeStorageSync('token'); 54 | } catch (error) { 55 | console.log(`getStorageSync调用失败`); 56 | } 57 | } 58 | 59 | index() { 60 | // 跳转到首页页面 61 | 62 | } 63 | 64 | logout() { 65 | this.clear(); 66 | // 用户注销 67 | 68 | // 跳转到登录页面 69 | 70 | } 71 | } 72 | 73 | export default new AuthService(); 74 | -------------------------------------------------------------------------------- /src/static/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/home.png -------------------------------------------------------------------------------- /src/static/img/homeHL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/homeHL.png -------------------------------------------------------------------------------- /src/static/img/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/qq.png -------------------------------------------------------------------------------- /src/static/img/sinaweibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/sinaweibo.png -------------------------------------------------------------------------------- /src/static/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/user.png -------------------------------------------------------------------------------- /src/static/img/userHL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/userHL.png -------------------------------------------------------------------------------- /src/static/img/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkiwi/uniapp-base/af4d5c056f03dfbc1d88a718288309085ee610d0/src/static/img/weixin.png -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuex from 'vuex'; 3 | import modules from './modules'; 4 | import { createLogger } from '../plugins/vue-logger'; 5 | 6 | Vue.use(Vuex); 7 | 8 | const debug = process.env.NODE_ENV !== 'production'; 9 | 10 | export default new Vuex.Store({ 11 | modules, 12 | strict: debug, 13 | plugins: debug ? [createLogger()] : [] 14 | }); 15 | -------------------------------------------------------------------------------- /src/store/modules/app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wkiwi 3 | * @Email: w_kiwi@163.com 4 | * @Date: 2020-09-17 13:47:48 5 | * @LastEditors: wkiwi 6 | * @LastEditTime: 2023-05-17 10:03:36 7 | */ 8 | import ApiService from '../../services/api.service'; 9 | 10 | // action types 11 | const TYPES = { 12 | SET_ERROR: 'SET_ERROR', // 错误 13 | SET_THEME: 'SET_THEME', // 设置皮肤 14 | SET_NETWORK: "SET_NETWORK", //设置网络状态 15 | }; 16 | 17 | // initial state 18 | const state = { 19 | theme: null, 20 | networkType:'wifi', 21 | isConnected:true 22 | }; 23 | 24 | // getters 25 | const getters = { 26 | getTheme(state) { 27 | return state.theme; 28 | }, 29 | getIsConnected(state) { 30 | return state.isConnected; 31 | }, 32 | }; 33 | 34 | // actions 35 | const actions = { 36 | // 获取当前主题 37 | async changeTheme({ commit }, theme) { 38 | await ApiService.get('app/theme') 39 | .then((res) => { 40 | commit(TYPES.SET_THEME, res.data.theme); 41 | }) 42 | .catch((error) => { 43 | commit(TYPES.SET_ERROR, error.message); 44 | }); 45 | }, 46 | // 设置设备网络信息 47 | setNetWork({ commit }, data) { 48 | commit(TYPES.SET_NETWORK, data); 49 | }, 50 | }; 51 | 52 | // mutations 53 | const mutations = { 54 | [TYPES.SET_ERROR](state, error) { 55 | state.errors = error; 56 | }, 57 | [TYPES.SET_THEME](state, theme) { 58 | state.theme = theme; 59 | }, 60 | [TYPES.SET_NETWORK](state, data) { 61 | state.networkType = data.networkType; 62 | state.isConnected = data.isConnected; 63 | }, 64 | }; 65 | 66 | export default { 67 | namespaced: true, 68 | state, 69 | getters, 70 | actions, 71 | mutations 72 | }; 73 | -------------------------------------------------------------------------------- /src/store/modules/auth.js: -------------------------------------------------------------------------------- 1 | import { UserService } from '../../services/api.service'; 2 | import AuthService from '../../services/auth.service'; 3 | 4 | // action types 5 | const TYPES = { 6 | SET_ERROR: 'SET_ERROR', // 错误 7 | SET_AUTH: 'SET_AUTH', // 用户认证信息 8 | CLEAR_AUTH: 'CLEAR_AUTH' ,// 清除认证信息 9 | TOKEN: ''//token 10 | }; 11 | 12 | // initial state 13 | const state = { 14 | isAuthenticated: false, 15 | user: {}, 16 | errors: null 17 | }; 18 | 19 | // getters 20 | const getters = { 21 | currentUser(state) { 22 | return state.user; 23 | }, 24 | isAuthenticated(state) { 25 | return state.isAuthenticated; 26 | } 27 | }; 28 | 29 | // actions 30 | const actions = { 31 | // 用户登录 32 | login({ commit }, user = {}) { 33 | return new Promise((resolve, reject) => { 34 | UserService.login(user) 35 | .then((res) => { 36 | if(res&&res.data){ 37 | commit(TYPES.SET_AUTH, res.data.data); 38 | } 39 | resolve(res); 40 | }).catch((res) => { 41 | if(res&&res.data){ 42 | commit(TYPES.SET_ERROR, `${res.data.msg}`); 43 | } 44 | reject(res); 45 | }); 46 | }); 47 | }, 48 | // 注销 49 | logout({ commit }) { 50 | commit(TYPES.CLEAR_AUTH); 51 | }, 52 | // 注册 53 | async signup({ commit }, user = {}) { 54 | await UserService.signup(user) 55 | .then((res) => { 56 | commit(TYPES.SET_AUTH, res.data.user); 57 | }) 58 | .catch((error) => { 59 | commit(TYPES.SET_ERROR, error.message); 60 | }); 61 | }, 62 | // 验证Token是否有效 63 | 64 | // 验证Token是否有效 65 | async check_auth({ commit }) { 66 | if(Object.keys(AuthService.get()).length == 0) { 67 | commit(TYPES.CLEAR_AUTH); 68 | } else { 69 | try { 70 | const user = await AuthService.get(); 71 | if(user.token) { 72 | commit(TYPES.SET_AUTH, user); 73 | } 74 | } catch (e) { 75 | commit(TYPES.SET_ERROR, 'Token认证失效~'); 76 | } 77 | } 78 | } 79 | }; 80 | 81 | // mutations 82 | const mutations = { 83 | [TYPES.SET_ERROR](state, error) { 84 | state.errors = error; 85 | }, 86 | [TYPES.SET_AUTH](state, user) { 87 | state.isAuthenticated = true; 88 | state.user = user; 89 | state.errors = {}; 90 | AuthService.set(state.user); 91 | }, 92 | [TYPES.CLEAR_AUTH](state) { 93 | state.isAuthenticated = false; 94 | state.user = {}; 95 | state.errors = {}; 96 | AuthService.logout(); 97 | } 98 | }; 99 | 100 | export default { 101 | namespaced: true, 102 | state, 103 | getters, 104 | actions, 105 | mutations 106 | }; 107 | -------------------------------------------------------------------------------- /src/store/modules/index.js: -------------------------------------------------------------------------------- 1 | import app from './app'; 2 | import auth from './auth'; 3 | 4 | export default { 5 | app, 6 | auth 7 | }; 8 | -------------------------------------------------------------------------------- /src/styles/aliicon.css: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wkiwi 3 | * @Email: w_kiwi@163.com 4 | * @Date: 2019-10-15 14:03:41 5 | * @LastEditors: wkiwi 6 | * @LastEditTime: 2022-04-10 10:21:27 7 | */ 8 | 9 | /* ----------------------------------------------------------------------------- 10 | 阿里icon 注意所有url必须为https: 11 | ----------------------------------------------------------------------------- */ 12 | 13 | @font-face {font-family: "number"; 14 | src: url('https://at.alicdn.com/t/font_1848198_u0z3y8ug82.eot?t=1590649110654'); /* IE9 */ 15 | src: url('https://at.alicdn.com/t/font_1848198_u0z3y8ug82.eot?t=1590649110654#iefix') format('embedded-opentype'), /* IE6-IE8 */ 16 | url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAScAAsAAAAACzgAAARNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCECgqISIcjATYCJAM0CxwABCAFhFUHZhutCciegW0bm4zNSJfqbxrfjY9YBNQwt1fTatfpLipCBbryCItjPEJlPI4+vnQL6n8+z3pD3ta/K5QaGNGkUSf9Xek2WSFdyEdJdwFEtm3wXxA1tGq12kzVBrQ4zH792q/ufWmGWCg7nd7O9sQXtSai7388MZRChEgU8cqQEqFQakcBdrbAI8EvE9BqkvGEneWX1kKsTHYCJjxnmS6IDVTLGYVBc1ATbszlB1Ga4xt+DcAL6/fDTzAai6gk5AtvHuaRkPkFPiREPP9pNQD05l4HBQnrgEx4mth8J8LpXSdC66c50nG2kzHjS8L//3wBQxusiuFRkpXvv7wmzVq0atNOqMhuO9a9DNR8AY2FD4FFEFgCgWUQWAGBVRBYEwisGQTWAgJrBYG1gUADi3fcMArYB/wnvAU5dWd8FRVlg920yd1RyEk6oTZXhh5PCqgGhTUojCxfdjck1zU2NNQ3CjUttbXYqajsbakeVlefWDutIey0BdQCDpXKtQ1JWm6u7HVEZEBVclsa26Qh1mxnk66coqSNjd2bjW9sK7+V0GLOFGFNjfG1UzRJ+NKBN1tCpX2hUCHTkXqtT9Uo+Y7PSNmipl3TtBo/V9f+iVA0ymimPfUad1RRB21VQf9vyvIM27hvQ/qjnllDN7XwRNpjqKV2amHZ0/tdrC7JK8mtLMkpObtcqsnb8R125M3WUJlSrNJjjbJVTb3WP5E77dRypIym29NaKuxTB1/3eiNPpT9asmHYRsaT7Rna4dX97zRUFFXU11cUVjzeO2xTi9C6t7/GI0OFdEfaNUVFyv1NEudU1StucNPdY97hwaa+ml/HVwG2fOXoix1rm+avnVvxa3bZztWpt0lWs8zBdqbdhvUtL2lKxvY8xxJoAyg7uVyjI8+Zz7lw4i04JnifcvRE8tHou9nWEOheSD1/UT0cZv2DhiRGTMfupd6I2UEZvpyUnJqsTVb6k0i/DVTFjl8F/Y8YNr0Mf+O9zvelI8X9dawAPn+dm9XVkKH5MZpFCuu3/l65CIDMGXJNR5ZWSfOum5yjwywx3FqsVWmnQbb38qIbf6BwN0EN6CxGTcYwqWalnFzGos2mXRX/BNhqjYzb2/ThEyHkCavMIDBo9wqjTq8xaXcv5eQbLAZ5jFW7v9jq1u8Htlm0Kj5HprowRaLuKYglJJFWb8LxYlDopuRqignyXbKkG1Y9OSfASiIyaPWhhgJK1I2qlwQmMkaMaUTLkoDya3kdxfMS8suSjyKwtgdjv1Ono5O+SUtIAsQ7JaN0wSgkRLcpECyCREQbhVj8YUGCbhRZNXEwI4jXRf4u89x6sjmArb4/woAWfaZU4IqOsOvpARMxjGClkYa0RplEtiLyB2NTn9E8CcKffJwPhYBp6anQ7edEp2xGF3W1k/KF/WxDHvLHO0KzG6bl5nC6uzw8vQjb4XqDCkYwgRksYAUb2I92RBESL4kRpIQBAAAAAA==') format('woff2'), 17 | url('https://at.alicdn.com/t/font_1848198_u0z3y8ug82.woff?t=1590649110654') format('woff'), 18 | url('https://at.alicdn.com/t/font_1848198_u0z3y8ug82.ttf?t=1590649110654') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ 19 | url('https://at.alicdn.com/t/font_1848198_u0z3y8ug82.svg?t=1590649110654#number') format('svg'); /* iOS 4.1- */ 20 | } 21 | 22 | .number { 23 | font-family: "number" !important; 24 | font-size: 16px; 25 | font-style: normal; 26 | -webkit-font-smoothing: antialiased; 27 | -moz-osx-font-smoothing: grayscale; 28 | } 29 | 30 | .ic_0:before { 31 | content: "\e600"; 32 | } 33 | 34 | .ic_01:before { 35 | content: "\e601"; 36 | } 37 | 38 | .ic_02:before { 39 | content: "\e602"; 40 | } 41 | 42 | .ic_03:before { 43 | content: "\e603"; 44 | } 45 | 46 | .ic_04:before { 47 | content: "\e604"; 48 | } 49 | 50 | .ic_05:before { 51 | content: "\e605"; 52 | } 53 | 54 | .ic_06:before { 55 | content: "\e606"; 56 | } 57 | 58 | .ic_07:before { 59 | content: "\e607"; 60 | } 61 | 62 | .ic_08:before { 63 | content: "\e608"; 64 | } 65 | 66 | .ic_09:before { 67 | content: "\e609"; 68 | } 69 | 70 | .ic_colon:before { 71 | content: "\e60a"; 72 | } 73 | 74 | .ic_dot:before { 75 | content: "\e60b"; 76 | } 77 | -------------------------------------------------------------------------------- /src/styles/border.css: -------------------------------------------------------------------------------- 1 | .border, 2 | .border-top, 3 | .border-right, 4 | .border-bottom, 5 | .border-left, 6 | .border-topbottom, 7 | .border-rightleft, 8 | .border-topleft, 9 | .border-rightbottom, 10 | .border-topright, 11 | .border-bottomleft { 12 | position: relative; 13 | } 14 | .border::before, 15 | .border-top::before, 16 | .border-right::before, 17 | .border-bottom::before, 18 | .border-left::before, 19 | .border-topbottom::before, 20 | .border-topbottom::after, 21 | .border-rightleft::before, 22 | .border-rightleft::after, 23 | .border-topleft::before, 24 | .border-topleft::after, 25 | .border-rightbottom::before, 26 | .border-rightbottom::after, 27 | .border-topright::before, 28 | .border-topright::after, 29 | .border-bottomleft::before, 30 | .border-bottomleft::after { 31 | content: "\0020"; 32 | overflow: hidden; 33 | position: absolute; 34 | } 35 | .border::before { 36 | box-sizing: border-box; 37 | top: 0; 38 | left: 0; 39 | height: 100%; 40 | width: 100%; 41 | border: 1px solid #eaeaea; 42 | transform-origin: 0 0; 43 | } 44 | .border-top::before, 45 | .border-bottom::before, 46 | .border-topbottom::before, 47 | .border-topbottom::after, 48 | .border-topleft::before, 49 | .border-rightbottom::after, 50 | .border-topright::before, 51 | .border-bottomleft::before { 52 | left: 0; 53 | width: 100%; 54 | height: 1px; 55 | } 56 | .border-right::before, 57 | .border-left::before, 58 | .border-rightleft::before, 59 | .border-rightleft::after, 60 | .border-topleft::after, 61 | .border-rightbottom::before, 62 | .border-topright::after, 63 | .border-bottomleft::after { 64 | top: 0; 65 | width: 1px; 66 | height: 100%; 67 | } 68 | .border-top::before, 69 | .border-topbottom::before, 70 | .border-topleft::before, 71 | .border-topright::before { 72 | border-top: 1px solid #eaeaea; 73 | transform-origin: 0 0; 74 | } 75 | .border-right::before, 76 | .border-rightbottom::before, 77 | .border-rightleft::before, 78 | .border-topright::after { 79 | border-right: 1px solid #eaeaea; 80 | transform-origin: 100% 0; 81 | } 82 | .border-bottom::before, 83 | .border-topbottom::after, 84 | .border-rightbottom::after, 85 | .border-bottomleft::before { 86 | border-bottom: 1px solid #eaeaea; 87 | transform-origin: 0 100%; 88 | } 89 | .border-left::before, 90 | .border-topleft::after, 91 | .border-rightleft::after, 92 | .border-bottomleft::after { 93 | border-left: 1px solid #eaeaea; 94 | transform-origin: 0 0; 95 | } 96 | .border-top::before, 97 | .border-topbottom::before, 98 | .border-topleft::before, 99 | .border-topright::before { 100 | top: 0; 101 | } 102 | .border-right::before, 103 | .border-rightleft::after, 104 | .border-rightbottom::before, 105 | .border-topright::after { 106 | right: 0; 107 | } 108 | .border-bottom::before, 109 | .border-topbottom::after, 110 | .border-rightbottom::after, 111 | .border-bottomleft::after { 112 | bottom: 0; 113 | } 114 | .border-left::before, 115 | .border-rightleft::before, 116 | .border-topleft::after, 117 | .border-bottomleft::before { 118 | left: 0; 119 | } 120 | .border::before { 121 | width: 200%; 122 | height: 200%; 123 | transform: scale(.5); 124 | } 125 | .border-top::before, 126 | .border-bottom::before, 127 | .border-topbottom::before, 128 | .border-topbottom::after, 129 | .border-topleft::before, 130 | .border-rightbottom::after, 131 | .border-topright::before, 132 | .border-bottomleft::before { 133 | transform: scaleY(.5); 134 | } 135 | .border-right::before, 136 | .border-left::before, 137 | .border-rightleft::before, 138 | .border-rightleft::after, 139 | .border-topleft::after, 140 | .border-rightbottom::before, 141 | .border-topright::after, 142 | .border-bottomleft::after { 143 | transform: scaleX(.5); 144 | } -------------------------------------------------------------------------------- /src/styles/common.css: -------------------------------------------------------------------------------- 1 | ::-webkit-scrollbar { 2 | width: 0; 3 | height: 0; 4 | color: transparent; 5 | } 6 | 7 | /* css 滤镜 控制黑白底色gif的 */ 8 | .gif-black { 9 | mix-blend-mode: screen; 10 | } 11 | .gif-white { 12 | mix-blend-mode: multiply; 13 | } 14 | 15 | .skeleton { 16 | /* 宽度和高度根据要展示元素大小设定 */ 17 | /* 以下代码实现背景动画效果 */ 18 | animation: skeletonLoading 1.4s ease infinite; 19 | -webkit-animation: skeletonLoading 1.4s ease infinite; 20 | background-image: -webkit-gradient( 21 | linear, 22 | left top, 23 | right top, 24 | color-stop(25%, #f1f1f1), 25 | color-stop(37%, #ffffff), 26 | color-stop(63%, #f1f1f1) 27 | ); 28 | background-image: -o-linear-gradient( 29 | left, 30 | #f1f1f1 25%, 31 | #ffffff 37%, 32 | #f1f1f1 63% 33 | ); 34 | background-image: linear-gradient( 35 | 90deg, 36 | #f1f1f1 25%, 37 | #ffffff 37%, 38 | #f1f1f1 63% 39 | ); 40 | background-size: 400% 100%; 41 | } 42 | 43 | @-webkit-keyframes skeletonLoading { 44 | 0% { 45 | background-position: 100% 50%; 46 | } 47 | 48 | to { 49 | background-position: 0 50%; 50 | } 51 | } 52 | 53 | @keyframes skeletonLoading { 54 | 0% { 55 | background-position: 100% 50%; 56 | } 57 | 58 | to { 59 | background-position: 0 50%; 60 | } 61 | } 62 | 63 | /* 弹出式一次性弹窗 */ 64 | .popups { 65 | position: fixed; 66 | left: 50%; 67 | top: 45%; 68 | width: 85vw; 69 | z-index: 999; 70 | background: #fff; 71 | border-radius: 10rpx; 72 | transform: translate(-50%, -50%); 73 | transform-origin: 0% 0%; 74 | animation: windowScale 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s 1; 75 | } 76 | .popups .close { 77 | position: absolute; 78 | right: 25upx; 79 | top: 25upx; 80 | color: #ccc; 81 | font-size: 32upx; 82 | } 83 | 84 | @keyframes windowScale { 85 | 0% { 86 | transform: scale(0.4, 0.4) translate(-50%, -50%); 87 | } 88 | 89 | 60% { 90 | transform: scale(1.05, 1.05) translate(-50%, -50%); 91 | } 92 | 93 | 80% { 94 | transform: scale(0.98, 0.98) translate(-50%, -50%); 95 | } 96 | 97 | 100% { 98 | transform: scale(1, 1) translate(-50%, -50%); 99 | } 100 | } 101 | 102 | @keyframes slideUp { 103 | from { 104 | transform: translate3d(0, 100%, 0); 105 | } 106 | 107 | to { 108 | transform: translate3d(0, 0, 0); 109 | } 110 | } 111 | 112 | .animate-slide-up { 113 | animation: slideUp ease 0.3s forwards; 114 | } 115 | 116 | @keyframes slideDown { 117 | from { 118 | transform: translate3d(0, 0, 0); 119 | } 120 | 121 | to { 122 | transform: translate3d(0, 100%, 0); 123 | } 124 | } 125 | 126 | .animate-slide-down { 127 | animation: slideDown ease 0.3s forwards; 128 | } 129 | 130 | @keyframes fadeIn { 131 | from { 132 | opacity: 0; 133 | } 134 | to { 135 | opacity: 1; 136 | } 137 | } 138 | 139 | .animate-fade-in { 140 | animation: fadeIn ease 0.3s forwards; 141 | } 142 | 143 | @keyframes fadeOut { 144 | from { 145 | opacity: 1; 146 | } 147 | to { 148 | opacity: 0; 149 | } 150 | } 151 | 152 | .animate-fade-out { 153 | animation: fadeOut ease 0.3s forwards; 154 | } 155 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "uni-app", 5 | "html5plus", 6 | "miniprogram-api-typings/types/lib.wx.api.d.ts", 7 | "mini-types/types/api" 8 | ] 9 | } 10 | } --------------------------------------------------------------------------------