diff --git a/babel.config.js b/babel.config.js index 3ea790843ef49fb21ca537a3a6959629c243745e..d4e62390b29addcb2a8479edc92b3d003b451886 100644 --- a/babel.config.js +++ b/babel.config.js @@ -29,6 +29,7 @@ if ( } process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']; + process.UNI_LIBRARIES.forEach(libraryName => { plugins.push([ 'import', diff --git a/index.js b/index.js index d7452c63d533dc4efa693f4bf4020ddfd875ceec..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/index.js +++ b/index.js @@ -1,6 +0,0 @@ -/* -* @Author: qinuoyun -* @Date: 2020-12-09 14:19:45 -* @Last Modified by: qinuoyun -* @Last Modified time: 2021-01-06 15:44:29 -*/ diff --git a/package-lock.json b/package-lock.json index 59f0dd010d5b9fd3a5a31cb4eec18bcd8840107b..99b64c56562cc7517aa49ac11233c5034943da3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3060,7 +3060,6 @@ "thread-loader": "^2.1.3", "url-loader": "^2.2.0", "vue-loader": "^15.9.2", - "vue-loader-v16": "npm:vue-loader@^16.0.0-beta.7", "vue-style-loader": "^4.1.2", "webpack": "^4.0.0", "webpack-bundle-analyzer": "^3.8.0", @@ -16164,104 +16163,6 @@ "vue-style-loader": "^4.1.0" } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.3.0", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.3.0.tgz", - "integrity": "sha512-UDgni/tUVSdwHuQo+vuBmEgamWx88SuSlEb5fgdvHrlJSPB9qMBRF6W7bfPWSqDns425Gt1wxAUif+f+h/rWjg==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, - "hash-sum": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", - "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", - "dev": true, - "optional": true - }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "vue-router": { "version": "3.4.9", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz", diff --git a/package.json b/package.json index ad83dc2e9205248c56533a7ab5696207dc651839..f64f705b183a336a9d4b850b35026e4105c2b644 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "regenerator-runtime": "^0.12.1", "sortablejs": "^1.13.0", "vue": "^2.6.11", + "vue-jsonp": "^2.0.0", "vue-lazyload": "^1.3.3", "vue-router": "^3.4.9", "vuex": "^3.6.0" diff --git a/public/index.html b/public/index.html index 60b1e07b03d1ff3a0b584b9ae754a7623a710e31..2398cf94816ee6e4b88234c69a54c02f2cd66fd4 100644 --- a/public/index.html +++ b/public/index.html @@ -1,67 +1,71 @@ - - - - - - - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - -
- - - - - \ No newline at end of file + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + +
+ + + + diff --git a/readme/images/1.png b/readme/images/1.png deleted file mode 100644 index 33b8f6bc5095473e9d243df8c07b5646151f44e8..0000000000000000000000000000000000000000 Binary files a/readme/images/1.png and /dev/null differ diff --git a/readme/images/10.png b/readme/images/10.png deleted file mode 100644 index 4f45e9e177db4d64aa69bda2f864ac891ec549fd..0000000000000000000000000000000000000000 Binary files a/readme/images/10.png and /dev/null differ diff --git a/readme/images/11.png b/readme/images/11.png deleted file mode 100644 index 7fd5379717b64100cab52815bb5488998d35f8ba..0000000000000000000000000000000000000000 Binary files a/readme/images/11.png and /dev/null differ diff --git a/readme/images/12.png b/readme/images/12.png deleted file mode 100644 index 6f9186506ff1c54b488668668fb9778959beebd4..0000000000000000000000000000000000000000 Binary files a/readme/images/12.png and /dev/null differ diff --git a/readme/images/13.png b/readme/images/13.png deleted file mode 100644 index bcc4e7228063b903dcbb3142ca4dad1261c8ea04..0000000000000000000000000000000000000000 Binary files a/readme/images/13.png and /dev/null differ diff --git a/readme/images/2.png b/readme/images/2.png deleted file mode 100644 index d97f455cca8e368ee4274fd0c928d3942ef60964..0000000000000000000000000000000000000000 Binary files a/readme/images/2.png and /dev/null differ diff --git a/readme/images/3.png b/readme/images/3.png deleted file mode 100644 index f8c76c5053cfef00492439db0d1bb16c572af879..0000000000000000000000000000000000000000 Binary files a/readme/images/3.png and /dev/null differ diff --git a/readme/images/4.png b/readme/images/4.png deleted file mode 100644 index 6bd2d10e8583c8e099a8050c9eeff9b5fa244bea..0000000000000000000000000000000000000000 Binary files a/readme/images/4.png and /dev/null differ diff --git a/readme/images/5.png b/readme/images/5.png deleted file mode 100644 index d57c376ca433c53c3a0fe3a8f8e309c0b18b0100..0000000000000000000000000000000000000000 Binary files a/readme/images/5.png and /dev/null differ diff --git a/readme/images/6.png b/readme/images/6.png deleted file mode 100644 index e5d0d3d980e20b33d430096f412cf61f7ea088c6..0000000000000000000000000000000000000000 Binary files a/readme/images/6.png and /dev/null differ diff --git a/readme/images/7.png b/readme/images/7.png deleted file mode 100644 index b05b11fcd2eee819d79b48b29ef5777f2ea69229..0000000000000000000000000000000000000000 Binary files a/readme/images/7.png and /dev/null differ diff --git a/readme/images/8.png b/readme/images/8.png deleted file mode 100644 index f7522850452a66caf2c81bc42aab8fbad0124dd9..0000000000000000000000000000000000000000 Binary files a/readme/images/8.png and /dev/null differ diff --git a/readme/images/9.png b/readme/images/9.png deleted file mode 100644 index fc632dd475ee781c5ce56d3799d141a1e6ae0f1c..0000000000000000000000000000000000000000 Binary files a/readme/images/9.png and /dev/null differ diff --git "a/readme/images/\345\212\250\345\233\2761.mp4" "b/readme/images/\345\212\250\345\233\2761.mp4" new file mode 100644 index 0000000000000000000000000000000000000000..1ee97038ca7071a60847d043cf1ae21cb93dff70 Binary files /dev/null and "b/readme/images/\345\212\250\345\233\2761.mp4" differ diff --git "a/readme/images/\345\212\250\345\233\2762.mp4" "b/readme/images/\345\212\250\345\233\2762.mp4" new file mode 100644 index 0000000000000000000000000000000000000000..aafbc0dbc3d6b55a6e60fd95c0981cb86ca0fb9a Binary files /dev/null and "b/readme/images/\345\212\250\345\233\2762.mp4" differ diff --git a/src/App.vue b/src/App.vue index 090a9a573ac2dd63d031d764e4c6835a233d66d4..19fedc8c715d0a7ec380d02e009df7f95544e94a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,14 +1,7 @@ - diff --git a/src/colorui/animation.css b/src/colorui/animation.css index 931bb513bf3431152acb6453d280500e316c5e18..956e22eee7c918c3b0d0ced33e2546f8df5c7c9f 100644 --- a/src/colorui/animation.css +++ b/src/colorui/animation.css @@ -1,184 +1,182 @@ -/* - Animation 微动画 +/* + Animation 微动画 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28 */ /* css 滤镜 控制黑白底色gif的 */ -.gif-black{ - mix-blend-mode: screen; +.gif-black { + mix-blend-mode: screen; } -.gif-white{ - mix-blend-mode: multiply; +.gif-white { + mix-blend-mode: multiply; } - /* Animation css */ -[class*=animation-] { - animation-duration: .5s; - animation-timing-function: ease-out; - animation-fill-mode: both +[class*='animation-'] { + animation-duration: 0.5s; + animation-timing-function: ease-out; + animation-fill-mode: both; } .animation-fade { - animation-name: fade; - animation-duration: .8s; - animation-timing-function: linear + animation-name: fade; + animation-duration: 0.8s; + animation-timing-function: linear; } .animation-scale-up { - animation-name: scale-up + animation-name: scale-up; } .animation-scale-down { - animation-name: scale-down + animation-name: scale-down; } .animation-slide-top { - animation-name: slide-top + animation-name: slide-top; } .animation-slide-bottom { - animation-name: slide-bottom + animation-name: slide-bottom; } .animation-slide-left { - animation-name: slide-left + animation-name: slide-left; } .animation-slide-right { - animation-name: slide-right + animation-name: slide-right; } .animation-shake { - animation-name: shake + animation-name: shake; } .animation-reverse { - animation-direction: reverse + animation-direction: reverse; } @keyframes fade { - 0% { - opacity: 0 - } + 0% { + opacity: 0; + } - 100% { - opacity: 1 - } + 100% { + opacity: 1; + } } @keyframes scale-up { - 0% { - opacity: 0; - transform: scale(.2) - } + 0% { + opacity: 0; + transform: scale(0.2); + } - 100% { - opacity: 1; - transform: scale(1) - } + 100% { + opacity: 1; + transform: scale(1); + } } @keyframes scale-down { - 0% { - opacity: 0; - transform: scale(1.8) - } + 0% { + opacity: 0; + transform: scale(1.8); + } - 100% { - opacity: 1; - transform: scale(1) - } + 100% { + opacity: 1; + transform: scale(1); + } } @keyframes slide-top { - 0% { - opacity: 0; - transform: translateY(-100%) - } + 0% { + opacity: 0; + transform: translateY(-100%); + } - 100% { - opacity: 1; - transform: translateY(0) - } + 100% { + opacity: 1; + transform: translateY(0); + } } @keyframes slide-bottom { - 0% { - opacity: 0; - transform: translateY(100%) - } + 0% { + opacity: 0; + transform: translateY(100%); + } - 100% { - opacity: 1; - transform: translateY(0) - } + 100% { + opacity: 1; + transform: translateY(0); + } } @keyframes shake { + 0%, + 100% { + transform: translateX(0); + } - 0%, - 100% { - transform: translateX(0) - } - - 10% { - transform: translateX(-9px) - } + 10% { + transform: translateX(-9px); + } - 20% { - transform: translateX(8px) - } + 20% { + transform: translateX(8px); + } - 30% { - transform: translateX(-7px) - } + 30% { + transform: translateX(-7px); + } - 40% { - transform: translateX(6px) - } + 40% { + transform: translateX(6px); + } - 50% { - transform: translateX(-5px) - } + 50% { + transform: translateX(-5px); + } - 60% { - transform: translateX(4px) - } + 60% { + transform: translateX(4px); + } - 70% { - transform: translateX(-3px) - } + 70% { + transform: translateX(-3px); + } - 80% { - transform: translateX(2px) - } + 80% { + transform: translateX(2px); + } - 90% { - transform: translateX(-1px) - } + 90% { + transform: translateX(-1px); + } } @keyframes slide-left { - 0% { - opacity: 0; - transform: translateX(-100%) - } + 0% { + opacity: 0; + transform: translateX(-100%); + } - 100% { - opacity: 1; - transform: translateX(0) - } + 100% { + opacity: 1; + transform: translateX(0); + } } @keyframes slide-right { - 0% { - opacity: 0; - transform: translateX(100%) - } - - 100% { - opacity: 1; - transform: translateX(0) - } -} \ No newline at end of file + 0% { + opacity: 0; + transform: translateX(100%); + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} diff --git a/src/colorui/icon.css b/src/colorui/icon.css index 59f503aa4afe2a072d3ad2631403e20c7e13e73f..ec2ad1e6da2f776038a41ae3e1ed7c1ee1671d74 100644 --- a/src/colorui/icon.css +++ b/src/colorui/icon.css @@ -1,296 +1,316 @@ @keyframes cuIcon-spin { - 0% { - -webkit-transform: rotate(0); - transform: rotate(0); - } + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } } .cuIconfont-spin { - -webkit-animation: cuIcon-spin 2s infinite linear; - animation: cuIcon-spin 2s infinite linear; - display: inline-block; + -webkit-animation: cuIcon-spin 2s infinite linear; + animation: cuIcon-spin 2s infinite linear; + display: inline-block; } .cuIconfont-pulse { - -webkit-animation: cuIcon-spin 1s infinite steps(8); - animation: cuIcon-spin 1s infinite steps(8); - display: inline-block; + -webkit-animation: cuIcon-spin 1s infinite steps(8); + animation: cuIcon-spin 1s infinite steps(8); + display: inline-block; } -[class*="cuIcon-"] { - font-family: "cuIcon"; - font-size: inherit; - font-style: normal; +[class*='cuIcon-'] { + font-family: 'cuIcon'; + font-size: inherit; + font-style: normal; } @font-face { - font-family: "iconfont"; /* Project id 2111115 */ - src: url('//at.alicdn.com/t/font_2111115_dpap8l2ayc8.woff2?t=1625016472123') format('woff2'), - url('//at.alicdn.com/t/font_2111115_dpap8l2ayc8.woff?t=1625016472123') format('woff'), - url('//at.alicdn.com/t/font_2111115_dpap8l2ayc8.ttf?t=1625016472123') format('truetype'); + font-family: 'iconfont'; /* Project id 2111115 */ + src: url('//at.alicdn.com/t/font_2111115_m114knhnos.woff2?t=1628656164424') format('woff2'), + url('//at.alicdn.com/t/font_2111115_m114knhnos.woff?t=1628656164424') format('woff'), + url('//at.alicdn.com/t/font_2111115_m114knhnos.ttf?t=1628656164424') format('truetype'); } .iconfont { - font-family: "iconfont" !important; + font-family: 'iconfont' !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } +.iconbaoguo:before { + content: '\e6db'; +} + +.icondynamic_release:before { + content: '\e6da'; +} + +.iconfold1:before { + content: '\e6d9'; +} + +.iconfenxiaozhuangshi:before { + content: '\e6d6'; +} + +.iconshuzishanchu:before { + content: '\e6d1'; +} + .iconpopup_close2:before { - content: "\e6d0"; + content: '\e6d0'; } .iconsuccess:before { - content: "\e6ce"; + content: '\e6ce'; } .iconwarning:before { - content: "\e6cf"; + content: '\e6cf'; } .iconfold:before { - content: "\e6cd"; + content: '\e6cd'; } .iconlike1:before { - content: "\e6cb"; + content: '\e6cb'; } .iconlike2:before { - content: "\e6cc"; + content: '\e6cc'; } .icondistribution_dynamic:before { - content: "\e6c9"; + content: '\e6c9'; } .icondistribution_list:before { - content: "\e6ca"; + content: '\e6ca'; } .icona-personalcenter_distribution:before { - content: "\e6c8"; + content: '\e6c8'; } .iconpersonalcenter_information:before { - content: "\e6c7"; + content: '\e6c7'; } .iconbofang:before { - content: "\e600"; + content: '\e600'; } .iconpersonalcenter_phone2:before { - content: "\e6c5"; + content: '\e6c5'; } .iconpersonalcenter_add:before { - content: "\e6c6"; + content: '\e6c6'; } .icontuijian:before { - content: "\e6b2"; + content: '\e6b2'; } .iconjifen:before { - content: "\e6ab"; + content: '\e6ab'; } .icongonggao:before { - content: "\e6a8"; + content: '\e6a8'; } .iconbtn_back:before { - content: "\e691"; + content: '\e691'; } .iconimago_loadingfail:before { - content: "\e690"; + content: '\e690'; } .iconpersonalcenter_phone:before { - content: "\e67a"; + content: '\e67a'; } .iconarrow-down:before { - content: "\e601"; + content: '\e601'; } .icontrash:before { - content: "\e61a"; + content: '\e61a'; } .iconarrow-top:before { - content: "\e62b"; + content: '\e62b'; } .iconcopy:before { - content: "\e63a"; + content: '\e63a'; } .iconproductlist_rank_second:before { - content: "\e69e"; + content: '\e69e'; } .iconproductlist_rank_first:before { - content: "\e69f"; + content: '\e69f'; } .iconnav_classification_normal:before { - content: "\e671"; + content: '\e671'; } .iconproductdetails_tab_customerservice:before { - content: "\e673"; + content: '\e673'; } .iconnav_personalcenter_normal:before { - content: "\e674"; + content: '\e674'; } .iconsearch_empty:before { - content: "\e675"; + content: '\e675'; } .iconproductdetails_goodsservices:before { - content: "\e676"; + content: '\e676'; } .iconproductdetails_tab_customerservice_online:before { - content: "\e677"; + content: '\e677'; } .iconproductdetails_popup_enlargethepicture:before { - content: "\e678"; + content: '\e678'; } .iconproductdetails_share:before { - content: "\e67c"; + content: '\e67c'; } .iconproductdetails_tab_customerservice_telephone:before { - content: "\e67d"; + content: '\e67d'; } .iconbtn_addtocart:before { - content: "\e67e"; + content: '\e67e'; } .iconimago_defaultproduct:before { - content: "\e67f"; + content: '\e67f'; } .iconsearchbar_search:before { - content: "\e680"; + content: '\e680'; } .iconaddress_wechataddress:before { - content: "\e685"; + content: '\e685'; } .iconpersonalcenter_address:before { - content: "\e686"; + content: '\e686'; } .iconpersonalcenter_contactus:before { - content: "\e688"; + content: '\e688'; } .iconorderdetails_logistics:before { - content: "\e689"; + content: '\e689'; } .iconshoppingcart_shopname:before { - content: "\e68a"; + content: '\e68a'; } .iconproductrecommendation_line:before { - content: "\e68b"; + content: '\e68b'; } .iconevaluate_uploadpictures_deleto:before { - content: "\e68c"; + content: '\e68c'; } .iconevaluate_uploadpictures:before { - content: "\e68d"; + content: '\e68d'; } .iconclassification_line:before { - content: "\e68e"; + content: '\e68e'; } .iconpersonalcenter_clearcache:before { - content: "\e68f"; + content: '\e68f'; } .iconaftersalesdetails-refund:before { - content: "\e692"; + content: '\e692'; } .iconaftersalesdetails-exchangegoods:before { - content: "\e694"; + content: '\e694'; } .iconaftersalesdetails-returngoods:before { - content: "\e696"; + content: '\e696'; } .iconbtn_subtract:before { - content: "\e697"; + content: '\e697'; } .iconbtn_add:before { - content: "\e698"; + content: '\e698'; } .iconpopup_close:before { - content: "\e699"; + content: '\e699'; } .iconevaluate_star:before { - content: "\e69a"; + content: '\e69a'; } .iconbtn_arrow:before { - content: "\e69b"; + content: '\e69b'; } .iconaddress_edit:before { - content: "\e69c"; + content: '\e69c'; } .iconbtn_select:before { - content: "\e69d"; + content: '\e69d'; } .iconnav_home_selected:before { - content: "\e66a"; + content: '\e66a'; } .iconnav_personalcenter_selected:before { - content: "\e66c"; + content: '\e66c'; } .iconnav_shoppingcart_normal:before { - content: "\e66d"; + content: '\e66d'; } .iconnav_home_normal:before { - content: "\e66e"; + content: '\e66e'; } .iconnav_classification_selected:before { - content: "\e66f"; + content: '\e66f'; } .iconnav_shoppingcart_selected:before { - content: "\e670"; + content: '\e670'; } diff --git a/src/colorui/main.css b/src/colorui/main.css index 1d16dac33adbae414b6bde75ed83105ac9d21c0b..b69111331624e6a7f8c9ff394357118f107d1695 100644 --- a/src/colorui/main.css +++ b/src/colorui/main.css @@ -1,20 +1,11 @@ -/* - ColorUi for uniApp v2.1.6 | by 文晓港 2019-05-31 10:44:24 - 仅供学习交流,如作它用所承受的法律责任一概与作者无关 - - *使用ColorUi开发扩展与插件时,请注明基于ColorUi开发 - - (QQ交流群:240787041) -*/ - /* ================== 初始化 ==================== */ body { - background-color: transparentl; - font-size: 28upx; - color: #333333; - font-family: Helvetica Neue, Helvetica, sans-serif; + background-color: transparentl; + font-size: 28upx; + color: #333333; + font-family: Helvetica Neue, Helvetica, sans-serif; } view, @@ -26,15 +17,15 @@ textarea, label, navigator, image { - box-sizing: border-box; + box-sizing: border-box; } .round { - border-radius: 5000upx; + border-radius: 5000upx; } .radius { - border-radius: 6upx; + border-radius: 6upx; } /* ================== @@ -42,44 +33,44 @@ image { ==================== */ image { - max-width: 100%; - display: inline-block; - position: relative; - z-index: 0; + max-width: 100%; + display: inline-block; + position: relative; + z-index: 0; } image.loading::before { - content: ""; - background-color: #f5f5f5; - display: block; - position: absolute; - width: 100%; - height: 100%; - z-index: -2; + content: ''; + background-color: #f5f5f5; + display: block; + position: absolute; + width: 100%; + height: 100%; + z-index: -2; } image.loading::after { - content: "\e7f1"; - font-family: "cuIcon"; - position: absolute; - top: 0; - left: 0; - width: 32upx; - height: 32upx; - line-height: 32upx; - right: 0; - bottom: 0; - z-index: -1; - font-size: 32upx; - margin: auto; - color: #ccc; - -webkit-animation: cuIcon-spin 2s infinite linear; - animation: cuIcon-spin 2s infinite linear; - display: block; + content: '\e7f1'; + font-family: 'cuIcon'; + position: absolute; + top: 0; + left: 0; + width: 32upx; + height: 32upx; + line-height: 32upx; + right: 0; + bottom: 0; + z-index: -1; + font-size: 32upx; + margin: auto; + color: #ccc; + -webkit-animation: cuIcon-spin 2s infinite linear; + animation: cuIcon-spin 2s infinite linear; + display: block; } .response { - width: 100%; + width: 100%; } /* ================== @@ -89,135 +80,133 @@ image.loading::after { switch, checkbox, radio { - position: relative; + position: relative; } switch::after, switch::before { - font-family: "cuIcon"; - content: "\e645"; - position: absolute; - color: #ffffff !important; - top: 0%; - left: 0upx; - font-size: 26upx; - line-height: 26px; - width: 50%; - text-align: center; - pointer-events: none; - transform: scale(0, 0); - transition: all 0.3s ease-in-out 0s; - z-index: 9; - bottom: 0; - height: 26px; - margin: auto; + font-family: 'cuIcon'; + content: '\e645'; + position: absolute; + color: #ffffff !important; + top: 0%; + left: 0upx; + font-size: 26upx; + line-height: 26px; + width: 50%; + text-align: center; + pointer-events: none; + transform: scale(0, 0); + transition: all 0.3s ease-in-out 0s; + z-index: 9; + bottom: 0; + height: 26px; + margin: auto; } switch::before { - content: "\e646"; - right: 0; - transform: scale(1, 1); - left: auto; + content: '\e646'; + right: 0; + transform: scale(1, 1); + left: auto; } switch[checked]::after, switch.checked::after { - transform: scale(1, 1); + transform: scale(1, 1); } switch[checked]::before, switch.checked::before { - transform: scale(0, 0); + transform: scale(0, 0); } /* #ifndef MP-ALIPAY */ radio::before, checkbox::before { - font-family: "cuIcon"; - content: "\e645"; - position: absolute; - color: #ffffff !important; - top: 50%; - margin-top: -8px; - right: 5px; - font-size: 32upx; - line-height: 16px; - pointer-events: none; - transform: scale(1, 1); - transition: all 0.3s ease-in-out 0s; - z-index: 9; + font-family: 'cuIcon'; + content: '\e645'; + position: absolute; + color: #ffffff !important; + top: 50%; + margin-top: -8px; + right: 5px; + font-size: 32upx; + line-height: 16px; + pointer-events: none; + transform: scale(1, 1); + transition: all 0.3s ease-in-out 0s; + z-index: 9; } radio .wx-radio-input, checkbox .wx-checkbox-input, radio .uni-radio-input, checkbox .uni-checkbox-input { - margin: 0; - width: 24px; - height: 24px; + margin: 0; + width: 24px; + height: 24px; } checkbox.round .wx-checkbox-input, checkbox.round .uni-checkbox-input { - border-radius: 100upx; + border-radius: 100upx; } /* #endif */ switch[checked]::before { - transform: scale(0, 0); + transform: scale(0, 0); } switch .wx-switch-input, switch .uni-switch-input { - border: none; - padding: 0 24px; - width: 48px; - height: 26px; - margin: 0; - border-radius: 100upx; + border: none; + padding: 0 24px; + width: 48px; + height: 26px; + margin: 0; + border-radius: 100upx; } -switch .wx-switch-input:not([class*="bg-"]), -switch .uni-switch-input:not([class*="bg-"]) { - background: #8799a3 !important; +switch .wx-switch-input:not([class*='bg-']), +switch .uni-switch-input:not([class*='bg-']) { + background: #8799a3 !important; } switch .wx-switch-input::after, switch .uni-switch-input::after { - margin: auto; - width: 26px; - height: 26px; - border-radius: 100upx; - left: 0upx; - top: 0upx; - bottom: 0upx; - position: absolute; - transform: scale(0.9, 0.9); - transition: all 0.1s ease-in-out 0s; + margin: auto; + width: 26px; + height: 26px; + border-radius: 100upx; + left: 0upx; + top: 0upx; + bottom: 0upx; + position: absolute; + transform: scale(0.9, 0.9); + transition: all 0.1s ease-in-out 0s; } switch .wx-switch-input.wx-switch-input-checked::after, switch .uni-switch-input.uni-switch-input-checked::after { - margin: auto; - left: 22px; - box-shadow: none; - transform: scale(0.9, 0.9); + margin: auto; + left: 22px; + box-shadow: none; + transform: scale(0.9, 0.9); } radio-group { - display: inline-block; + display: inline-block; } - - switch.radius .wx-switch-input::after, switch.radius .wx-switch-input, switch.radius .wx-switch-input::before, switch.radius .uni-switch-input::after, switch.radius .uni-switch-input, switch.radius .uni-switch-input::before { - border-radius: 10upx; + border-radius: 10upx; } switch .wx-switch-input::before, @@ -228,51 +217,51 @@ switch .uni-switch-input::before, radio.radio::before, checkbox .uni-checkbox-input::before, radio .uni-radio-input::before { - display: none; + display: none; } radio.radio[checked]::after, radio.radio .uni-radio-input-checked::after { - content: ""; - background-color: transparent; - display: block; - position: absolute; - width: 8px; - height: 8px; - z-index: 999; - top: 0upx; - left: 0upx; - right: 0; - bottom: 0; - margin: auto; - border-radius: 200upx; - /* #ifndef MP */ - border: 7px solid #ffffff !important; - /* #endif */ - - /* #ifdef MP */ - border: 8px solid #ffffff !important; - /* #endif */ + content: ''; + background-color: transparent; + display: block; + position: absolute; + width: 8px; + height: 8px; + z-index: 999; + top: 0upx; + left: 0upx; + right: 0; + bottom: 0; + margin: auto; + border-radius: 200upx; + /* #ifndef MP */ + border: 7px solid #ffffff !important; + /* #endif */ + + /* #ifdef MP */ + border: 8px solid #ffffff !important; + /* #endif */ } .switch-sex::after { - content: "\e71c"; + content: '\e71c'; } .switch-sex::before { - content: "\e71a"; + content: '\e71a'; } .switch-sex .wx-switch-input, .switch-sex .uni-switch-input { - background: #e54d42 !important; - border-color: #e54d42 !important; + background: #e54d42 !important; + border-color: #e54d42 !important; } .switch-sex[checked] .wx-switch-input, .switch-sex.checked .uni-switch-input { - background: #0081ff !important; - border-color: #0081ff !important; + background: #0081ff !important; + border-color: #0081ff !important; } switch.red[checked] .wx-switch-input.wx-switch-input-checked, @@ -281,9 +270,9 @@ radio.red[checked] .wx-radio-input, switch.red.checked .uni-switch-input.uni-switch-input-checked, checkbox.red.checked .uni-checkbox-input, radio.red.checked .uni-radio-input { - background-color: #e54d42 !important; - border-color: #e54d42 !important; - color: #ffffff !important; + background-color: #e54d42 !important; + border-color: #e54d42 !important; + color: #ffffff !important; } switch.orange[checked] .wx-switch-input, @@ -292,9 +281,9 @@ radio.orange[checked] .wx-radio-input, switch.orange.checked .uni-switch-input, checkbox.orange.checked .uni-checkbox-input, radio.orange.checked .uni-radio-input { - background-color: #f37b1d !important; - border-color: #f37b1d !important; - color: #ffffff !important; + background-color: #f37b1d !important; + border-color: #f37b1d !important; + color: #ffffff !important; } switch.yellow[checked] .wx-switch-input, @@ -303,9 +292,9 @@ radio.yellow[checked] .wx-radio-input, switch.yellow.checked .uni-switch-input, checkbox.yellow.checked .uni-checkbox-input, radio.yellow.checked .uni-radio-input { - background-color: #fbbd08 !important; - border-color: #fbbd08 !important; - color: #333333 !important; + background-color: #fbbd08 !important; + border-color: #fbbd08 !important; + color: #333333 !important; } switch.olive[checked] .wx-switch-input, @@ -314,9 +303,9 @@ radio.olive[checked] .wx-radio-input, switch.olive.checked .uni-switch-input, checkbox.olive.checked .uni-checkbox-input, radio.olive.checked .uni-radio-input { - background-color: #8dc63f !important; - border-color: #8dc63f !important; - color: #ffffff !important; + background-color: #8dc63f !important; + border-color: #8dc63f !important; + color: #ffffff !important; } switch.green[checked] .wx-switch-input, @@ -331,10 +320,10 @@ checkbox.green.checked .uni-checkbox-input, checkbox.checked .uni-checkbox-input, radio.green.checked .uni-radio-input, radio.checked .uni-radio-input { - background-color: #39b54a !important; - border-color: #39b54a !important; - color: #ffffff !important; - border-color: #39B54A !important; + background-color: #39b54a !important; + border-color: #39b54a !important; + color: #ffffff !important; + border-color: #39b54a !important; } switch.cyan[checked] .wx-switch-input, @@ -343,9 +332,9 @@ radio.cyan[checked] .wx-radio-input, switch.cyan.checked .uni-switch-input, checkbox.cyan.checked .uni-checkbox-input, radio.cyan.checked .uni-radio-input { - background-color: #1cbbb4 !important; - border-color: #1cbbb4 !important; - color: #ffffff !important; + background-color: #1cbbb4 !important; + border-color: #1cbbb4 !important; + color: #ffffff !important; } switch.blue[checked] .wx-switch-input, @@ -354,9 +343,9 @@ radio.blue[checked] .wx-radio-input, switch.blue.checked .uni-switch-input, checkbox.blue.checked .uni-checkbox-input, radio.blue.checked .uni-radio-input { - background-color: #0081ff !important; - border-color: #0081ff !important; - color: #ffffff !important; + background-color: #0081ff !important; + border-color: #0081ff !important; + color: #ffffff !important; } switch.purple[checked] .wx-switch-input, @@ -365,9 +354,9 @@ radio.purple[checked] .wx-radio-input, switch.purple.checked .uni-switch-input, checkbox.purple.checked .uni-checkbox-input, radio.purple.checked .uni-radio-input { - background-color: #6739b6 !important; - border-color: #6739b6 !important; - color: #ffffff !important; + background-color: #6739b6 !important; + border-color: #6739b6 !important; + color: #ffffff !important; } switch.mauve[checked] .wx-switch-input, @@ -376,9 +365,9 @@ radio.mauve[checked] .wx-radio-input, switch.mauve.checked .uni-switch-input, checkbox.mauve.checked .uni-checkbox-input, radio.mauve.checked .uni-radio-input { - background-color: #9c26b0 !important; - border-color: #9c26b0 !important; - color: #ffffff !important; + background-color: #9c26b0 !important; + border-color: #9c26b0 !important; + color: #ffffff !important; } switch.pink[checked] .wx-switch-input, @@ -387,9 +376,9 @@ radio.pink[checked] .wx-radio-input, switch.pink.checked .uni-switch-input, checkbox.pink.checked .uni-checkbox-input, radio.pink.checked .uni-radio-input { - background-color: #e03997 !important; - border-color: #e03997 !important; - color: #ffffff !important; + background-color: #e03997 !important; + border-color: #e03997 !important; + color: #ffffff !important; } switch.brown[checked] .wx-switch-input, @@ -398,9 +387,9 @@ radio.brown[checked] .wx-radio-input, switch.brown.checked .uni-switch-input, checkbox.brown.checked .uni-checkbox-input, radio.brown.checked .uni-radio-input { - background-color: #a5673f !important; - border-color: #a5673f !important; - color: #ffffff !important; + background-color: #a5673f !important; + border-color: #a5673f !important; + color: #ffffff !important; } switch.grey[checked] .wx-switch-input, @@ -409,9 +398,9 @@ radio.grey[checked] .wx-radio-input, switch.grey.checked .uni-switch-input, checkbox.grey.checked .uni-checkbox-input, radio.grey.checked .uni-radio-input { - background-color: #8799a3 !important; - border-color: #8799a3 !important; - color: #ffffff !important; + background-color: #8799a3 !important; + border-color: #8799a3 !important; + color: #ffffff !important; } switch.gray[checked] .wx-switch-input, @@ -420,9 +409,9 @@ radio.gray[checked] .wx-radio-input, switch.gray.checked .uni-switch-input, checkbox.gray.checked .uni-checkbox-input, radio.gray.checked .uni-radio-input { - background-color: #f0f0f0 !important; - border-color: #f0f0f0 !important; - color: #333333 !important; + background-color: #f0f0f0 !important; + border-color: #f0f0f0 !important; + color: #333333 !important; } switch.black[checked] .wx-switch-input, @@ -431,9 +420,9 @@ radio.black[checked] .wx-radio-input, switch.black.checked .uni-switch-input, checkbox.black.checked .uni-checkbox-input, radio.black.checked .uni-radio-input { - background-color: #333333 !important; - border-color: #333333 !important; - color: #ffffff !important; + background-color: #333333 !important; + border-color: #333333 !important; + color: #ffffff !important; } switch.white[checked] .wx-switch-input, @@ -442,9 +431,9 @@ radio.white[checked] .wx-radio-input, switch.white.checked .uni-switch-input, checkbox.white.checked .uni-checkbox-input, radio.white.checked .uni-radio-input { - background-color: #ffffff !important; - border-color: #ffffff !important; - color: #333333 !important; + background-color: #ffffff !important; + border-color: #ffffff !important; + color: #333333 !important; } /* ================== @@ -468,7 +457,7 @@ radio.white.checked .uni-radio-input { .dashed-right, .dashed-bottom, .dashed-left { - position: relative; + position: relative; } .solid::after, @@ -486,134 +475,134 @@ radio.white.checked .uni-radio-input { .dashed-right::after, .dashed-bottom::after, .dashed-left::after { - content: " "; - width: 200%; - height: 200%; - position: absolute; - top: 0; - left: 0; - border-radius: inherit; - transform: scale(0.5); - transform-origin: 0 0; - pointer-events: none; - box-sizing: border-box; + content: ' '; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border-radius: inherit; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; } .solid::after { - border: 1upx solid rgba(0, 0, 0, 0.1); + border: 1upx solid rgba(0, 0, 0, 0.1); } .solid-top::after { - border-top: 1upx solid rgba(0, 0, 0, 0.1); + border-top: 1upx solid rgba(0, 0, 0, 0.1); } .solid-right::after { - border-right: 1upx solid rgba(0, 0, 0, 0.1); + border-right: 1upx solid rgba(0, 0, 0, 0.1); } .solid-bottom::after { - border-bottom: 1upx solid rgba(0, 0, 0, 0.1); + border-bottom: 1upx solid rgba(0, 0, 0, 0.1); } .solid-left::after { - border-left: 1upx solid rgba(0, 0, 0, 0.1); + border-left: 1upx solid rgba(0, 0, 0, 0.1); } .solids::after { - border: 8upx solid #eee; + border: 8upx solid #eee; } .solids-top::after { - border-top: 8upx solid #eee; + border-top: 8upx solid #eee; } .solids-right::after { - border-right: 8upx solid #eee; + border-right: 8upx solid #eee; } .solids-bottom::after { - border-bottom: 8upx solid #eee; + border-bottom: 8upx solid #eee; } .solids-left::after { - border-left: 8upx solid #eee; + border-left: 8upx solid #eee; } /* -- 虚线 -- */ .dashed::after { - border: 1upx dashed #ddd; + border: 1upx dashed #ddd; } .dashed-top::after { - border-top: 1upx dashed #ddd; + border-top: 1upx dashed #ddd; } .dashed-right::after { - border-right: 1upx dashed #ddd; + border-right: 1upx dashed #ddd; } .dashed-bottom::after { - border-bottom: 1upx dashed #ddd; + border-bottom: 1upx dashed #ddd; } .dashed-left::after { - border-left: 1upx dashed #ddd; + border-left: 1upx dashed #ddd; } /* -- 阴影 -- */ .shadow[class*='white'] { - --ShadowSize: 0 1upx 6upx; + --ShadowSize: 0 1upx 6upx; } .shadow-lg { - --ShadowSize: 0upx 40upx 100upx 0upx; + --ShadowSize: 0upx 40upx 100upx 0upx; } .shadow-warp { - position: relative; - box-shadow: 0 0 10upx rgba(0, 0, 0, 0.1); + position: relative; + box-shadow: 0 0 10upx rgba(0, 0, 0, 0.1); } .shadow-warp:before, .shadow-warp:after { - position: absolute; - content: ""; - top: 20upx; - bottom: 30upx; - left: 20upx; - width: 50%; - box-shadow: 0 30upx 20upx rgba(0, 0, 0, 0.2); - transform: rotate(-3deg); - z-index: -1; + position: absolute; + content: ''; + top: 20upx; + bottom: 30upx; + left: 20upx; + width: 50%; + box-shadow: 0 30upx 20upx rgba(0, 0, 0, 0.2); + transform: rotate(-3deg); + z-index: -1; } .shadow-warp:after { - right: 20upx; - left: auto; - transform: rotate(3deg); + right: 20upx; + left: auto; + transform: rotate(3deg); } .shadow-blur { - position: relative; + position: relative; } .shadow-blur::before { - content: ""; - display: block; - background: inherit; - filter: blur(10upx); - position: absolute; - width: 100%; - height: 100%; - top: 10upx; - left: 10upx; - z-index: -1; - opacity: 0.4; - transform-origin: 0 0; - border-radius: inherit; - transform: scale(1, 1); + content: ''; + display: block; + background: inherit; + filter: blur(10upx); + position: absolute; + width: 100%; + height: 100%; + top: 10upx; + left: 10upx; + z-index: -1; + opacity: 0.4; + transform-origin: 0 0; + border-radius: inherit; + transform: scale(1, 1); } /* ================== @@ -621,116 +610,116 @@ radio.white.checked .uni-radio-input { ==================== */ .cu-btn { - position: relative; - border: 0upx; - display: inline-flex; - align-items: center; - justify-content: center; - box-sizing: border-box; - padding: 0 30upx; - font-size: 28upx; - height: 64upx; - line-height: 1; - text-align: center; - text-decoration: none; - overflow: visible; - margin-left: initial; - transform: translate(0upx, 0upx); - margin-right: initial; + position: relative; + border: 0upx; + display: inline-flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding: 0 30upx; + font-size: 28upx; + height: 64upx; + line-height: 1; + text-align: center; + text-decoration: none; + overflow: visible; + margin-left: initial; + transform: translate(0upx, 0upx); + margin-right: initial; } .cu-btn::after { - display: none; + display: none; } -.cu-btn:not([class*="bg-"]) { - background-color: #f0f0f0; +.cu-btn:not([class*='bg-']) { + background-color: #f0f0f0; } -.cu-btn[class*="line"] { - background-color: transparent; +.cu-btn[class*='line'] { + background-color: transparent; } -.cu-btn[class*="line"]::after { - content: " "; - display: block; - width: 200%; - height: 200%; - position: absolute; - top: 0; - left: 0; - border: 1upx solid currentColor; - transform: scale(0.5); - transform-origin: 0 0; - box-sizing: border-box; - border-radius: 12upx; - z-index: 1; - pointer-events: none; +.cu-btn[class*='line']::after { + content: ' '; + display: block; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border: 1upx solid currentColor; + transform: scale(0.5); + transform-origin: 0 0; + box-sizing: border-box; + border-radius: 12upx; + z-index: 1; + pointer-events: none; } -.cu-btn.round[class*="line"]::after { - border-radius: 1000upx; +.cu-btn.round[class*='line']::after { + border-radius: 1000upx; } -.cu-btn[class*="lines"]::after { - border: 6upx solid currentColor; +.cu-btn[class*='lines']::after { + border: 6upx solid currentColor; } -.cu-btn[class*="bg-"]::after { - display: none; +.cu-btn[class*='bg-']::after { + display: none; } .cu-btn.sm { - padding: 0 20upx; - font-size: 20upx; - height: 48upx; + padding: 0 20upx; + font-size: 20upx; + height: 48upx; } .cu-btn.lg { - padding: 0 40upx; - font-size: 32upx; - height: 80upx; + padding: 0 40upx; + font-size: 32upx; + height: 80upx; } .cu-btn.cuIcon.sm { - width: 48upx; - height: 48upx; + width: 48upx; + height: 48upx; } .cu-btn.cuIcon { - width: 64upx; - height: 64upx; - border-radius: 500upx; - padding: 0; + width: 64upx; + height: 64upx; + border-radius: 500upx; + padding: 0; } button.cuIcon.lg { - width: 80upx; - height: 80upx; + width: 80upx; + height: 80upx; } .cu-btn.shadow-blur::before { - top: 4upx; - left: 4upx; - filter: blur(6upx); - opacity: 0.6; + top: 4upx; + left: 4upx; + filter: blur(6upx); + opacity: 0.6; } .cu-btn.button-hover { - transform: translate(1upx, 1upx); + transform: translate(1upx, 1upx); } .block { - display: block; + display: block; } .cu-btn.block { - display: flex; + display: flex; } .cu-btn[disabled] { - opacity: 0.6; - color: #ffffff; + opacity: 0.6; + color: #ffffff; } /* ================== @@ -738,134 +727,134 @@ button.cuIcon.lg { ==================== */ .cu-tag { - font-size: 24upx; - vertical-align: middle; - position: relative; - display: inline-flex; - align-items: center; - justify-content: center; - box-sizing: border-box; - padding: 0upx 16upx; - height: 48upx; - font-family: Helvetica Neue, Helvetica, sans-serif; - white-space: nowrap; -} - -.cu-tag:not([class*="bg"]):not([class*="line"]) { - background-color: #f1f1f1; + font-size: 24upx; + vertical-align: middle; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding: 0upx 16upx; + height: 48upx; + font-family: Helvetica Neue, Helvetica, sans-serif; + white-space: nowrap; +} + +.cu-tag:not([class*='bg']):not([class*='line']) { + background-color: #f1f1f1; } -.cu-tag[class*="line-"]::after { - content: " "; - width: 200%; - height: 200%; - position: absolute; - top: 0; - left: 0; - border: 1upx solid currentColor; - transform: scale(0.5); - transform-origin: 0 0; - box-sizing: border-box; - border-radius: inherit; - z-index: 1; - pointer-events: none; +.cu-tag[class*='line-']::after { + content: ' '; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border: 1upx solid currentColor; + transform: scale(0.5); + transform-origin: 0 0; + box-sizing: border-box; + border-radius: inherit; + z-index: 1; + pointer-events: none; } -.cu-tag.radius[class*="line"]::after { - border-radius: 12upx; +.cu-tag.radius[class*='line']::after { + border-radius: 12upx; } -.cu-tag.round[class*="line"]::after { - border-radius: 1000upx; +.cu-tag.round[class*='line']::after { + border-radius: 1000upx; } -.cu-tag[class*="line-"]::after { - border-radius: 0; +.cu-tag[class*='line-']::after { + border-radius: 0; } -.cu-tag+.cu-tag { - margin-left: 10upx; +.cu-tag + .cu-tag { + margin-left: 10upx; } .cu-tag.sm { - font-size: 20upx; - padding: 0upx 12upx; - height: 32upx; + font-size: 20upx; + padding: 0upx 12upx; + height: 32upx; } .cu-capsule { - display: inline-flex; - vertical-align: middle; + display: inline-flex; + vertical-align: middle; } -.cu-capsule+.cu-capsule { - margin-left: 10upx; +.cu-capsule + .cu-capsule { + margin-left: 10upx; } .cu-capsule .cu-tag { - margin: 0; + margin: 0; } -.cu-capsule .cu-tag[class*="line-"]:last-child::after { - border-left: 0upx solid transparent; +.cu-capsule .cu-tag[class*='line-']:last-child::after { + border-left: 0upx solid transparent; } -.cu-capsule .cu-tag[class*="line-"]:first-child::after { - border-right: 0upx solid transparent; +.cu-capsule .cu-tag[class*='line-']:first-child::after { + border-right: 0upx solid transparent; } .cu-capsule.radius .cu-tag:first-child { - border-top-left-radius: 6upx; - border-bottom-left-radius: 6upx; + border-top-left-radius: 6upx; + border-bottom-left-radius: 6upx; } .cu-capsule.radius .cu-tag:last-child::after, -.cu-capsule.radius .cu-tag[class*="line-"] { - border-top-right-radius: 12upx; - border-bottom-right-radius: 12upx; +.cu-capsule.radius .cu-tag[class*='line-'] { + border-top-right-radius: 12upx; + border-bottom-right-radius: 12upx; } .cu-capsule.round .cu-tag:first-child { - border-top-left-radius: 200upx; - border-bottom-left-radius: 200upx; - text-indent: 4upx; + border-top-left-radius: 200upx; + border-bottom-left-radius: 200upx; + text-indent: 4upx; } .cu-capsule.round .cu-tag:last-child::after, .cu-capsule.round .cu-tag:last-child { - border-top-right-radius: 200upx; - border-bottom-right-radius: 200upx; - text-indent: -4upx; + border-top-right-radius: 200upx; + border-bottom-right-radius: 200upx; + text-indent: -4upx; } .cu-tag.badge { - border-radius: 200upx; - position: absolute; - top: -10upx; - right: -10upx; - font-size: 20upx; - padding: 0upx 10upx; - height: 28upx; - color: #ffffff; + border-radius: 200upx; + position: absolute; + top: -10upx; + right: -10upx; + font-size: 20upx; + padding: 0upx 10upx; + height: 28upx; + color: #ffffff; } -.cu-tag.badge:not([class*="bg-"]) { - background-color: #dd514c; +.cu-tag.badge:not([class*='bg-']) { + background-color: #dd514c; } -.cu-tag:empty:not([class*="cuIcon-"]) { - padding: 0upx; - width: 16upx; - height: 16upx; - top: -4upx; - right: -4upx; +.cu-tag:empty:not([class*='cuIcon-']) { + padding: 0upx; + width: 16upx; + height: 16upx; + top: -4upx; + right: -4upx; } -.cu-tag[class*="cuIcon-"] { - width: 32upx; - height: 32upx; - top: -4upx; - right: -4upx; +.cu-tag[class*='cuIcon-'] { + width: 32upx; + height: 32upx; + top: -4upx; + right: -4upx; } /* ================== @@ -873,63 +862,63 @@ button.cuIcon.lg { ==================== */ .cu-avatar { - font-variant: small-caps; - margin: 0; - padding: 0; - display: inline-flex; - text-align: center; - justify-content: center; - align-items: center; - background-color: #ccc; - color: #ffffff; - white-space: nowrap; - position: relative; - width: 64upx; - height: 64upx; - background-size: cover; - background-position: center; - vertical-align: middle; - font-size: 1.5em; + font-variant: small-caps; + margin: 0; + padding: 0; + display: inline-flex; + text-align: center; + justify-content: center; + align-items: center; + background-color: #ccc; + color: #ffffff; + white-space: nowrap; + position: relative; + width: 64upx; + height: 64upx; + background-size: cover; + background-position: center; + vertical-align: middle; + font-size: 1.5em; } .cu-avatar.sm { - width: 48upx; - height: 48upx; - font-size: 1em; + width: 48upx; + height: 48upx; + font-size: 1em; } .cu-avatar.lg { - width: 96upx; - height: 96upx; - font-size: 2em; + width: 96upx; + height: 96upx; + font-size: 2em; } .cu-avatar.xl { - width: 128upx; - height: 128upx; - font-size: 2.5em; + width: 128upx; + height: 128upx; + font-size: 2.5em; } .cu-avatar .avatar-text { - font-size: 0.4em; + font-size: 0.4em; } .cu-avatar-group { - direction: rtl; - unicode-bidi: bidi-override; - padding: 0 10upx 0 40upx; - display: inline-block; + direction: rtl; + unicode-bidi: bidi-override; + padding: 0 10upx 0 40upx; + display: inline-block; } .cu-avatar-group .cu-avatar { - margin-left: -30upx; - border: 4upx solid #f1f1f1; - vertical-align: middle; + margin-left: -30upx; + border: 4upx solid #f1f1f1; + vertical-align: middle; } .cu-avatar-group .cu-avatar.sm { - margin-left: -20upx; - border: 1upx solid #f1f1f1; + margin-left: -20upx; + border: 1upx solid #f1f1f1; } /* ================== @@ -937,68 +926,77 @@ button.cuIcon.lg { ==================== */ .cu-progress { - overflow: hidden; - height: 28upx; - background-color: #ebeef5; - display: inline-flex; - align-items: center; - width: 100%; + overflow: hidden; + height: 28upx; + background-color: #ebeef5; + display: inline-flex; + align-items: center; + width: 100%; } -.cu-progress+view, -.cu-progress+text { - line-height: 1; +.cu-progress + view, +.cu-progress + text { + line-height: 1; } .cu-progress.xs { - height: 10upx; + height: 10upx; } .cu-progress.sm { - height: 20upx; + height: 20upx; } .cu-progress view { - width: 0; - height: 100%; - align-items: center; - display: flex; - justify-items: flex-end; - justify-content: space-around; - font-size: 20upx; - color: #ffffff; - transition: width 0.6s ease; + width: 0; + height: 100%; + align-items: center; + display: flex; + justify-items: flex-end; + justify-content: space-around; + font-size: 20upx; + color: #ffffff; + transition: width 0.6s ease; } .cu-progress text { - align-items: center; - display: flex; - font-size: 20upx; - color: #333333; - text-indent: 10upx; + align-items: center; + display: flex; + font-size: 20upx; + color: #333333; + text-indent: 10upx; } .cu-progress.text-progress { - padding-right: 60upx; + padding-right: 60upx; } .cu-progress.striped view { - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-size: 72upx 72upx; + background-image: linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-size: 72upx 72upx; } .cu-progress.active view { - animation: progress-stripes 2s linear infinite; + animation: progress-stripes 2s linear infinite; } @keyframes progress-stripes { - from { - background-position: 72upx 0; - } + from { + background-position: 72upx 0; + } - to { - background-position: 0 0; - } + to { + background-position: 0 0; + } } /* ================== @@ -1006,934 +1004,933 @@ button.cuIcon.lg { ==================== */ .cu-load { - display: block; - line-height: 3em; - text-align: center; + display: block; + line-height: 3em; + text-align: center; } .cu-load::before { - font-family: "cuIcon"; - display: inline-block; - margin-right: 6upx; + font-family: 'cuIcon'; + display: inline-block; + margin-right: 6upx; } .cu-load.loading::before { - content: "\e67a"; - animation: cuIcon-spin 2s infinite linear; + content: '\e67a'; + animation: cuIcon-spin 2s infinite linear; } .cu-load.loading::after { - content: "加载中..."; + content: '加载中...'; } .cu-load.over::before { - content: "\e64a"; + content: '\e64a'; } .cu-load.over::after { - content: "没有更多了"; + content: '没有更多了'; } .cu-load.erro::before { - content: "\e658"; + content: '\e658'; } .cu-load.erro::after { - content: "加载失败"; + content: '加载失败'; } .cu-load.load-cuIcon::before { - font-size: 32upx; + font-size: 32upx; } .cu-load.load-cuIcon::after { - display: none; + display: none; } .cu-load.load-cuIcon.over { - display: none; + display: none; } .cu-load.load-modal { - position: fixed; - top: 0; - right: 0; - bottom: 140upx; - left: 0; - margin: auto; - width: 260upx; - height: 260upx; - background-color: #ffffff; - border-radius: 10upx; - box-shadow: 0 0 0upx 2000upx rgba(0, 0, 0, 0.5); - display: flex; - align-items: center; - flex-direction: column; - justify-content: center; - font-size: 28upx; - z-index: 9999; - line-height: 2.4em; -} - -.cu-load.load-modal [class*="cuIcon-"] { - font-size: 60upx; + position: fixed; + top: 0; + right: 0; + bottom: 140upx; + left: 0; + margin: auto; + width: 260upx; + height: 260upx; + background-color: #ffffff; + border-radius: 10upx; + box-shadow: 0 0 0upx 2000upx rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + font-size: 28upx; + z-index: 9999; + line-height: 2.4em; +} + +.cu-load.load-modal [class*='cuIcon-'] { + font-size: 60upx; } .cu-load.load-modal image { - width: 70upx; - height: 70upx; + width: 70upx; + height: 70upx; } .cu-load.load-modal::after { - content: ""; - position: absolute; - background-color: #ffffff; - border-radius: 50%; - width: 200upx; - height: 200upx; - font-size: 10px; - border-top: 6upx solid rgba(0, 0, 0, 0.05); - border-right: 6upx solid rgba(0, 0, 0, 0.05); - border-bottom: 6upx solid rgba(0, 0, 0, 0.05); - border-left: 6upx solid #f37b1d; - animation: cuIcon-spin 1s infinite linear; - z-index: -1; + content: ''; + position: absolute; + background-color: #ffffff; + border-radius: 50%; + width: 200upx; + height: 200upx; + font-size: 10px; + border-top: 6upx solid rgba(0, 0, 0, 0.05); + border-right: 6upx solid rgba(0, 0, 0, 0.05); + border-bottom: 6upx solid rgba(0, 0, 0, 0.05); + border-left: 6upx solid #f37b1d; + animation: cuIcon-spin 1s infinite linear; + z-index: -1; } .load-progress { - pointer-events: none; - top: 0; - position: fixed; - width: 100%; - left: 0; - z-index: 2000; + pointer-events: none; + top: 0; + position: fixed; + width: 100%; + left: 0; + z-index: 2000; } .load-progress.hide { - display: none; + display: none; } .load-progress .load-progress-bar { - position: relative; - width: 100%; - height: 4upx; - overflow: hidden; - transition: all 200ms ease 0s; + position: relative; + width: 100%; + height: 4upx; + overflow: hidden; + transition: all 200ms ease 0s; } .load-progress .load-progress-spinner { - position: absolute; - top: 10upx; - right: 10upx; - z-index: 2000; - display: block; + position: absolute; + top: 10upx; + right: 10upx; + z-index: 2000; + display: block; } .load-progress .load-progress-spinner::after { - content: ""; - display: block; - width: 24upx; - height: 24upx; - -webkit-box-sizing: border-box; - box-sizing: border-box; - border: solid 4upx transparent; - border-top-color: inherit; - border-left-color: inherit; - border-radius: 50%; - -webkit-animation: load-progress-spinner 0.4s linear infinite; - animation: load-progress-spinner 0.4s linear infinite; + content: ''; + display: block; + width: 24upx; + height: 24upx; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border: solid 4upx transparent; + border-top-color: inherit; + border-left-color: inherit; + border-radius: 50%; + -webkit-animation: load-progress-spinner 0.4s linear infinite; + animation: load-progress-spinner 0.4s linear infinite; } @-webkit-keyframes load-progress-spinner { - 0% { - -webkit-transform: rotate(0); - transform: rotate(0); - } + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } } @keyframes load-progress-spinner { - 0% { - -webkit-transform: rotate(0); - transform: rotate(0); - } + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } } /* ================== 列表 ==================== */ .grayscale { - filter: grayscale(1); + filter: grayscale(1); } -.cu-list+.cu-list { - margin-top: 30upx +.cu-list + .cu-list { + margin-top: 30upx; } -.cu-list>.cu-item { - transition: all .6s ease-in-out 0s; - transform: translateX(0upx) +.cu-list > .cu-item { + transition: all 0.6s ease-in-out 0s; + transform: translateX(0upx); } -.cu-list>.cu-item.move-cur { - transform: translateX(-260upx) +.cu-list > .cu-item.move-cur { + transform: translateX(-260upx); } -.cu-list>.cu-item .move { - position: absolute; - right: 0; - display: flex; - width: 260upx; - height: 100%; - transform: translateX(100%) +.cu-list > .cu-item .move { + position: absolute; + right: 0; + display: flex; + width: 260upx; + height: 100%; + transform: translateX(100%); } -.cu-list>.cu-item .move view { - display: flex; - flex: 1; - justify-content: center; - align-items: center +.cu-list > .cu-item .move view { + display: flex; + flex: 1; + justify-content: center; + align-items: center; } .cu-list.menu-avatar { - overflow: hidden; + overflow: hidden; } -.cu-list.menu-avatar>.cu-item { - position: relative; - display: flex; - padding-right: 10upx; - height: 140upx; - background-color: #ffffff; - justify-content: flex-end; - align-items: center +.cu-list.menu-avatar > .cu-item { + position: relative; + display: flex; + padding-right: 10upx; + height: 140upx; + background-color: #ffffff; + justify-content: flex-end; + align-items: center; } -.cu-list.menu-avatar>.cu-item>.cu-avatar { - position: absolute; - left: 30upx +.cu-list.menu-avatar > .cu-item > .cu-avatar { + position: absolute; + left: 30upx; } -.cu-list.menu-avatar>.cu-item .flex .text-cut { - max-width: 510upx +.cu-list.menu-avatar > .cu-item .flex .text-cut { + max-width: 510upx; } -.cu-list.menu-avatar>.cu-item .content { - position: absolute; - left: 146upx; - width: calc(100% - 96upx - 60upx - 120upx - 20upx); - line-height: 1.6em; +.cu-list.menu-avatar > .cu-item .content { + position: absolute; + left: 146upx; + width: calc(100% - 96upx - 60upx - 120upx - 20upx); + line-height: 1.6em; } -.cu-list.menu-avatar>.cu-item .content.flex-sub { - width: calc(100% - 96upx - 60upx - 20upx); +.cu-list.menu-avatar > .cu-item .content.flex-sub { + width: calc(100% - 96upx - 60upx - 20upx); } -.cu-list.menu-avatar>.cu-item .content>view:first-child { - font-size: 30upx; - display: flex; - align-items: center +.cu-list.menu-avatar > .cu-item .content > view:first-child { + font-size: 30upx; + display: flex; + align-items: center; } -.cu-list.menu-avatar>.cu-item .content .cu-tag.sm { - display: inline-block; - margin-left: 10upx; - height: 28upx; - font-size: 16upx; - line-height: 32upx +.cu-list.menu-avatar > .cu-item .content .cu-tag.sm { + display: inline-block; + margin-left: 10upx; + height: 28upx; + font-size: 16upx; + line-height: 32upx; } -.cu-list.menu-avatar>.cu-item .action { - width: 100upx; - text-align: center +.cu-list.menu-avatar > .cu-item .action { + width: 100upx; + text-align: center; } -.cu-list.menu-avatar>.cu-item .action view+view { - margin-top: 10upx +.cu-list.menu-avatar > .cu-item .action view + view { + margin-top: 10upx; } -.cu-list.menu-avatar.comment>.cu-item .content { - position: relative; - left: 0; - width: auto; - flex: 1; +.cu-list.menu-avatar.comment > .cu-item .content { + position: relative; + left: 0; + width: auto; + flex: 1; } -.cu-list.menu-avatar.comment>.cu-item { - padding: 30upx 30upx 30upx 120upx; - height: auto +.cu-list.menu-avatar.comment > .cu-item { + padding: 30upx 30upx 30upx 120upx; + height: auto; } .cu-list.menu-avatar.comment .cu-avatar { - align-self: flex-start + align-self: flex-start; } -.cu-list.menu>.cu-item { - position: relative; - display: flex; - padding: 0 30upx; - min-height: 100upx; - background-color: #ffffff; - justify-content: space-between; - align-items: center +.cu-list.menu > .cu-item { + position: relative; + display: flex; + padding: 0 30upx; + min-height: 100upx; + background-color: #ffffff; + justify-content: space-between; + align-items: center; } -.cu-list.menu>.cu-item:last-child:after { - border: none +.cu-list.menu > .cu-item:last-child:after { + border: none; } -.cu-list.menu-avatar>.cu-item:after, -.cu-list.menu>.cu-item:after { - position: absolute; - top: 0; - left: 0; - box-sizing: border-box; - width: 200%; - height: 200%; - border-bottom: 1upx solid #ddd; - border-radius: inherit; - content: " "; - transform: scale(.5); - transform-origin: 0 0; - pointer-events: none +.cu-list.menu-avatar > .cu-item:after, +.cu-list.menu > .cu-item:after { + position: absolute; + top: 0; + left: 0; + box-sizing: border-box; + width: 200%; + height: 200%; + border-bottom: 1upx solid #ddd; + border-radius: inherit; + content: ' '; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; } -.cu-list.menu>.cu-item.grayscale { - background-color: #f5f5f5 +.cu-list.menu > .cu-item.grayscale { + background-color: #f5f5f5; } -.cu-list.menu>.cu-item.cur { - background-color: #fcf7e9 +.cu-list.menu > .cu-item.cur { + background-color: #fcf7e9; } -.cu-list.menu>.cu-item.arrow { - padding-right: 90upx +.cu-list.menu > .cu-item.arrow { + padding-right: 90upx; } -.cu-list.menu>.cu-item.arrow:before { - position: absolute; - top: 0; - right: 30upx; - bottom: 0; - display: block; - margin: auto; - width: 30upx; - height: 30upx; - color: #8799a3; - content: "\e6a3"; - text-align: center; - font-size: 34upx; - font-family: cuIcon; - line-height: 30upx +.cu-list.menu > .cu-item.arrow:before { + position: absolute; + top: 0; + right: 30upx; + bottom: 0; + display: block; + margin: auto; + width: 30upx; + height: 30upx; + color: #8799a3; + content: '\e6a3'; + text-align: center; + font-size: 34upx; + font-family: cuIcon; + line-height: 30upx; } -.cu-list.menu>.cu-item button.content { - padding: 0; - background-color: transparent; - justify-content: flex-start +.cu-list.menu > .cu-item button.content { + padding: 0; + background-color: transparent; + justify-content: flex-start; } -.cu-list.menu>.cu-item button.content:after { - display: none +.cu-list.menu > .cu-item button.content:after { + display: none; } -.cu-list.menu>.cu-item .cu-avatar-group .cu-avatar { - border-color: #ffffff +.cu-list.menu > .cu-item .cu-avatar-group .cu-avatar { + border-color: #ffffff; } -.cu-list.menu>.cu-item .content>view:first-child { - display: flex; - align-items: center +.cu-list.menu > .cu-item .content > view:first-child { + display: flex; + align-items: center; } -.cu-list.menu>.cu-item .content>text[class*=cuIcon] { - display: inline-block; - margin-right: 10upx; - width: 1.6em; - text-align: center +.cu-list.menu > .cu-item .content > text[class*='cuIcon'] { + display: inline-block; + margin-right: 10upx; + width: 1.6em; + text-align: center; } -.cu-list.menu>.cu-item .content>image { - display: inline-block; - margin-right: 10upx; - width: 1.6em; - height: 1.6em; - vertical-align: middle +.cu-list.menu > .cu-item .content > image { + display: inline-block; + margin-right: 10upx; + width: 1.6em; + height: 1.6em; + vertical-align: middle; } -.cu-list.menu>.cu-item .content { - font-size: 30upx; - line-height: 1.6em; - flex: 1 +.cu-list.menu > .cu-item .content { + font-size: 30upx; + line-height: 1.6em; + flex: 1; } -.cu-list.menu>.cu-item .content .cu-tag.sm { - display: inline-block; - margin-left: 10upx; - height: 28upx; - font-size: 16upx; - line-height: 32upx +.cu-list.menu > .cu-item .content .cu-tag.sm { + display: inline-block; + margin-left: 10upx; + height: 28upx; + font-size: 16upx; + line-height: 32upx; } -.cu-list.menu>.cu-item .action .cu-tag:empty { - right: 10upx +.cu-list.menu > .cu-item .action .cu-tag:empty { + right: 10upx; } .cu-list.menu { - display: block; - overflow: hidden + display: block; + overflow: hidden; } -.cu-list.menu.sm-border>.cu-item:after { - left: 30upx; - width: calc(200% - 120upx) +.cu-list.menu.sm-border > .cu-item:after { + left: 30upx; + width: calc(200% - 120upx); } -.cu-list.grid>.cu-item { - position: relative; - display: flex; - padding: 20upx 0 30upx; - transition-duration: 0s; - flex-direction: column +.cu-list.grid > .cu-item { + position: relative; + display: flex; + padding: 20upx 0 30upx; + transition-duration: 0s; + flex-direction: column; } -.cu-list.grid>.cu-item:after { - position: absolute; - top: 0; - left: 0; - box-sizing: border-box; - width: 200%; - height: 200%; - border-right: 1px solid rgba(0, 0, 0, .1); - border-bottom: 1px solid rgba(0, 0, 0, .1); - border-radius: inherit; - content: " "; - transform: scale(.5); - transform-origin: 0 0; - pointer-events: none +.cu-list.grid > .cu-item:after { + position: absolute; + top: 0; + left: 0; + box-sizing: border-box; + width: 200%; + height: 200%; + border-right: 1px solid rgba(0, 0, 0, 0.1); + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + border-radius: inherit; + content: ' '; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; } -.cu-list.grid>.cu-item text { - display: block; - margin-top: 10upx; - color: #888; - font-size: 26upx; - line-height: 40upx +.cu-list.grid > .cu-item text { + display: block; + margin-top: 10upx; + color: #888; + font-size: 26upx; + line-height: 40upx; } -.cu-list.grid>.cu-item [class*=cuIcon] { - position: relative; - display: block; - margin-top: 20upx; - width: 100%; - font-size: 48upx +.cu-list.grid > .cu-item [class*='cuIcon'] { + position: relative; + display: block; + margin-top: 20upx; + width: 100%; + font-size: 48upx; } -.cu-list.grid>.cu-item .cu-tag { - right: auto; - left: 50%; - margin-left: 20upx +.cu-list.grid > .cu-item .cu-tag { + right: auto; + left: 50%; + margin-left: 20upx; } .cu-list.grid { - background-color: #ffffff; - text-align: center + background-color: #ffffff; + text-align: center; } -.cu-list.grid.no-border>.cu-item { - padding-top: 10upx; - padding-bottom: 20upx +.cu-list.grid.no-border > .cu-item { + padding-top: 10upx; + padding-bottom: 20upx; } -.cu-list.grid.no-border>.cu-item:after { - border: none +.cu-list.grid.no-border > .cu-item:after { + border: none; } .cu-list.grid.no-border { - padding: 20upx 10upx + padding: 20upx 10upx; } -.cu-list.grid.col-3>.cu-item:nth-child(3n):after, -.cu-list.grid.col-4>.cu-item:nth-child(4n):after, -.cu-list.grid.col-5>.cu-item:nth-child(5n):after { - border-right-width: 0 +.cu-list.grid.col-3 > .cu-item:nth-child(3n):after, +.cu-list.grid.col-4 > .cu-item:nth-child(4n):after, +.cu-list.grid.col-5 > .cu-item:nth-child(5n):after { + border-right-width: 0; } .cu-list.card-menu { - overflow: hidden; - margin-right: 30upx; - margin-left: 30upx; - border-radius: 20upx + overflow: hidden; + margin-right: 30upx; + margin-left: 30upx; + border-radius: 20upx; } - /* ================== 操作条 ==================== */ .cu-bar { - display: flex; - position: relative; - align-items: center; - min-height: 100upx; - justify-content: space-between; + display: flex; + position: relative; + align-items: center; + min-height: 100upx; + justify-content: space-between; } .cu-bar .action { - display: flex; - align-items: center; - height: 100%; - justify-content: center; - max-width: 100%; + display: flex; + align-items: center; + height: 100%; + justify-content: center; + max-width: 100%; } .cu-bar .action.border-title { - position: relative; - top: -10upx; + position: relative; + top: -10upx; } -.cu-bar .action.border-title text[class*="bg-"]:last-child { - position: absolute; - bottom: -0.5rem; - min-width: 2rem; - height: 6upx; - left: 0; +.cu-bar .action.border-title text[class*='bg-']:last-child { + position: absolute; + bottom: -0.5rem; + min-width: 2rem; + height: 6upx; + left: 0; } .cu-bar .action.sub-title { - position: relative; - top: -0.2rem; + position: relative; + top: -0.2rem; } .cu-bar .action.sub-title text { - position: relative; - z-index: 1; -} - -.cu-bar .action.sub-title text[class*="bg-"]:last-child { - position: absolute; - display: inline-block; - bottom: -0.2rem; - border-radius: 6upx; - width: 100%; - height: 0.6rem; - left: 0.6rem; - opacity: 0.3; - z-index: 0; -} - -.cu-bar .action.sub-title text[class*="text-"]:last-child { - position: absolute; - display: inline-block; - bottom: -0.7rem; - left: 0.5rem; - opacity: 0.2; - z-index: 0; - text-align: right; - font-weight: 900; - font-size: 36upx; + position: relative; + z-index: 1; +} + +.cu-bar .action.sub-title text[class*='bg-']:last-child { + position: absolute; + display: inline-block; + bottom: -0.2rem; + border-radius: 6upx; + width: 100%; + height: 0.6rem; + left: 0.6rem; + opacity: 0.3; + z-index: 0; +} + +.cu-bar .action.sub-title text[class*='text-']:last-child { + position: absolute; + display: inline-block; + bottom: -0.7rem; + left: 0.5rem; + opacity: 0.2; + z-index: 0; + text-align: right; + font-weight: 900; + font-size: 36upx; } .cu-bar.justify-center .action.border-title text:last-child, .cu-bar.justify-center .action.sub-title text:last-child { - left: 0; - right: 0; - margin: auto; - text-align: center; + left: 0; + right: 0; + margin: auto; + text-align: center; } .cu-bar .action:first-child { - margin-left: 30upx; - font-size: 30upx; + margin-left: 30upx; + font-size: 30upx; } .cu-bar .action text.text-cut { - text-align: left; - width: 100%; + text-align: left; + width: 100%; } .cu-bar .cu-avatar:first-child { - margin-left: 20upx; + margin-left: 20upx; } -.cu-bar .action:first-child>text[class*="cuIcon-"] { - margin-left: -0.3em; - margin-right: 0.3em; +.cu-bar .action:first-child > text[class*='cuIcon-'] { + margin-left: -0.3em; + margin-right: 0.3em; } .cu-bar .action:last-child { - margin-right: 30upx; + margin-right: 30upx; } -.cu-bar .action>text[class*="cuIcon-"], -.cu-bar .action>view[class*="cuIcon-"] { - font-size: 36upx; +.cu-bar .action > text[class*='cuIcon-'], +.cu-bar .action > view[class*='cuIcon-'] { + font-size: 36upx; } -.cu-bar .action>text[class*="cuIcon-"]+text[class*="cuIcon-"] { - margin-left: 0.5em; +.cu-bar .action > text[class*='cuIcon-'] + text[class*='cuIcon-'] { + margin-left: 0.5em; } .cu-bar .content { - position: absolute; - text-align: center; - width: calc(100% - 340upx); - left: 0; - right: 0; - bottom: 0; - top: 0; - margin: auto; - height: 60upx; - font-size: 32upx; - line-height: 60upx; - cursor: none; - pointer-events: none; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; + position: absolute; + text-align: center; + width: calc(100% - 340upx); + left: 0; + right: 0; + bottom: 0; + top: 0; + margin: auto; + height: 60upx; + font-size: 32upx; + line-height: 60upx; + cursor: none; + pointer-events: none; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } .cu-bar.ios .content { - bottom: 7px; - height: 30px; - font-size: 32upx; - line-height: 30px; + bottom: 7px; + height: 30px; + font-size: 32upx; + line-height: 30px; } .cu-bar.btn-group { - justify-content: space-around; + justify-content: space-around; } .cu-bar.btn-group button { - padding: 20upx 32upx; + padding: 20upx 32upx; } .cu-bar.btn-group button { - flex: 1; - margin: 0 20upx; - max-width: 50%; + flex: 1; + margin: 0 20upx; + max-width: 50%; } .cu-bar .search-form { - background-color: #f5f5f5; - line-height: 64upx; - height: 64upx; - font-size: 24upx; - color: #333333; - flex: 1; - display: flex; - align-items: center; - margin: 0 30upx; + background-color: #f5f5f5; + line-height: 64upx; + height: 64upx; + font-size: 24upx; + color: #333333; + flex: 1; + display: flex; + align-items: center; + margin: 0 30upx; } -.cu-bar .search-form+.action { - margin-right: 30upx; +.cu-bar .search-form + .action { + margin-right: 30upx; } .cu-bar .search-form input { - flex: 1; - padding-right: 30upx; - height: 64upx; - line-height: 64upx; - font-size: 26upx; - background-color: transparent; + flex: 1; + padding-right: 30upx; + height: 64upx; + line-height: 64upx; + font-size: 26upx; + background-color: transparent; } -.cu-bar .search-form [class*="cuIcon-"] { - margin: 0 0.5em 0 0.8em; +.cu-bar .search-form [class*='cuIcon-'] { + margin: 0 0.5em 0 0.8em; } -.cu-bar .search-form [class*="cuIcon-"]::before { - top: 0upx; +.cu-bar .search-form [class*='cuIcon-']::before { + top: 0upx; } .cu-bar.fixed, .nav.fixed { - position: fixed; - width: 100%; - top: 0; - z-index: 1024; - box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1); + position: fixed; + width: 100%; + top: 0; + z-index: 1024; + box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1); } .cu-bar.foot { - position: fixed; - width: 100%; - bottom: 0; - z-index: 1024; - box-shadow: 0 -1upx 6upx rgba(0, 0, 0, 0.1); + position: fixed; + width: 100%; + bottom: 0; + z-index: 1024; + box-shadow: 0 -1upx 6upx rgba(0, 0, 0, 0.1); } .cu-bar.tabbar { - padding: 0; - height: calc(100upx + env(safe-area-inset-bottom) / 2); - padding-bottom: calc(env(safe-area-inset-bottom) / 2); + padding: 0; + height: calc(100upx + env(safe-area-inset-bottom) / 2); + padding-bottom: calc(env(safe-area-inset-bottom) / 2); } .cu-tabbar-height { - min-height: 100upx; - height: calc(100upx + env(safe-area-inset-bottom) / 2); + min-height: 100upx; + height: calc(100upx + env(safe-area-inset-bottom) / 2); } .cu-bar.tabbar.shadow { - box-shadow: 0 -1upx 6upx rgba(0, 0, 0, 0.1); + box-shadow: 0 -1upx 6upx rgba(0, 0, 0, 0.1); } .cu-bar.tabbar .action { - font-size: 22upx; - position: relative; - flex: 1; - text-align: center; - padding: 0; - display: block; - height: auto; - line-height: 1; - margin: 0; - background-color: inherit; - overflow: initial; + font-size: 22upx; + position: relative; + flex: 1; + text-align: center; + padding: 0; + display: block; + height: auto; + line-height: 1; + margin: 0; + background-color: inherit; + overflow: initial; } .cu-bar.tabbar.shop .action { - width: 140upx; - flex: initial; + width: 140upx; + flex: initial; } .cu-bar.tabbar .action.add-action { - position: relative; - z-index: 2; - padding-top: 50upx; -} - -.cu-bar.tabbar .action.add-action [class*="cuIcon-"] { - position: absolute; - width: 70upx; - z-index: 2; - height: 70upx; - border-radius: 50%; - line-height: 70upx; - font-size: 50upx; - top: -35upx; - left: 0; - right: 0; - margin: auto; - padding: 0; + position: relative; + z-index: 2; + padding-top: 50upx; +} + +.cu-bar.tabbar .action.add-action [class*='cuIcon-'] { + position: absolute; + width: 70upx; + z-index: 2; + height: 70upx; + border-radius: 50%; + line-height: 70upx; + font-size: 50upx; + top: -35upx; + left: 0; + right: 0; + margin: auto; + padding: 0; } .cu-bar.tabbar .action.add-action::after { - content: ""; - position: absolute; - width: 100upx; - height: 100upx; - top: -50upx; - left: 0; - right: 0; - margin: auto; - box-shadow: 0 -3upx 8upx rgba(0, 0, 0, 0.08); - border-radius: 50upx; - background-color: inherit; - z-index: 0; + content: ''; + position: absolute; + width: 100upx; + height: 100upx; + top: -50upx; + left: 0; + right: 0; + margin: auto; + box-shadow: 0 -3upx 8upx rgba(0, 0, 0, 0.08); + border-radius: 50upx; + background-color: inherit; + z-index: 0; } .cu-bar.tabbar .action.add-action::before { - content: ""; - position: absolute; - width: 100upx; - height: 30upx; - bottom: 30upx; - left: 0; - right: 0; - margin: auto; - background-color: inherit; - z-index: 1; + content: ''; + position: absolute; + width: 100upx; + height: 30upx; + bottom: 30upx; + left: 0; + right: 0; + margin: auto; + background-color: inherit; + z-index: 1; } .cu-bar.tabbar .btn-group { - flex: 1; - display: flex; - justify-content: space-around; - align-items: center; - padding: 0 10upx; + flex: 1; + display: flex; + justify-content: space-around; + align-items: center; + padding: 0 10upx; } .cu-bar.tabbar button.action::after { - border: 0; + border: 0; } -.cu-bar.tabbar .action [class*="cuIcon-"] { - width: 100upx; - position: relative; - display: block; - height: auto; - margin: 0 auto 10upx; - text-align: center; - font-size: 40upx; +.cu-bar.tabbar .action [class*='cuIcon-'] { + width: 100upx; + position: relative; + display: block; + height: auto; + margin: 0 auto 10upx; + text-align: center; + font-size: 40upx; } .cu-bar.tabbar .action .cuIcon-cu-image { - margin: 0 auto; + margin: 0 auto; } .cu-bar.tabbar .action .cuIcon-cu-image image { - width: 50upx; - height: 50upx; - display: inline-block; + width: 50upx; + height: 50upx; + display: inline-block; } .cu-bar.tabbar .submit { - align-items: center; - display: flex; - justify-content: center; - text-align: center; - position: relative; - flex: 2; - align-self: stretch; + align-items: center; + display: flex; + justify-content: center; + text-align: center; + position: relative; + flex: 2; + align-self: stretch; } .cu-bar.tabbar .submit:last-child { - flex: 2.6; + flex: 2.6; } -.cu-bar.tabbar .submit+.submit { - flex: 2; +.cu-bar.tabbar .submit + .submit { + flex: 2; } .cu-bar.tabbar.border .action::before { - content: " "; - width: 200%; - height: 200%; - position: absolute; - top: 0; - left: 0; - transform: scale(0.5); - transform-origin: 0 0; - border-right: 1upx solid rgba(0, 0, 0, 0.1); - z-index: 3; + content: ' '; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + transform: scale(0.5); + transform-origin: 0 0; + border-right: 1upx solid rgba(0, 0, 0, 0.1); + z-index: 3; } .cu-bar.tabbar.border .action:last-child:before { - display: none; + display: none; } .cu-bar.input { - padding-right: 20upx; - background-color: #ffffff; + padding-right: 20upx; + background-color: #ffffff; } .cu-bar.input input { - overflow: initial; - line-height: 64upx; - height: 64upx; - min-height: 64upx; - flex: 1; - font-size: 30upx; - margin: 0 20upx; + overflow: initial; + line-height: 64upx; + height: 64upx; + min-height: 64upx; + flex: 1; + font-size: 30upx; + margin: 0 20upx; } .cu-bar.input .action { - margin-left: 20upx; + margin-left: 20upx; } -.cu-bar.input .action [class*="cuIcon-"] { - font-size: 48upx; +.cu-bar.input .action [class*='cuIcon-'] { + font-size: 48upx; } -.cu-bar.input input+.action { - margin-right: 20upx; - margin-left: 0upx; +.cu-bar.input input + .action { + margin-right: 20upx; + margin-left: 0upx; } -.cu-bar.input .action:first-child [class*="cuIcon-"] { - margin-left: 0upx; +.cu-bar.input .action:first-child [class*='cuIcon-'] { + margin-left: 0upx; } .cu-custom { - display: block; - position: relative; + display: block; + position: relative; } .cu-custom .cu-bar .content { - width: calc(100% - 440upx); + width: calc(100% - 440upx); } /* #ifdef MP-ALIPAY */ .cu-custom .cu-bar .action .cuIcon-back { - opacity: 0; + opacity: 0; } /* #endif */ .cu-custom .cu-bar .content image { - height: 60upx; - width: 240upx; + height: 60upx; + width: 240upx; } .cu-custom .cu-bar { - min-height: 0px; - /* #ifdef MP-WEIXIN */ - padding-right: 220upx; - /* #endif */ - /* #ifdef MP-ALIPAY */ - padding-right: 150upx; - /* #endif */ - box-shadow: 0upx 0upx 0upx; - z-index: 9999; + min-height: 0px; + /* #ifdef MP-WEIXIN */ + padding-right: 220upx; + /* #endif */ + /* #ifdef MP-ALIPAY */ + padding-right: 150upx; + /* #endif */ + box-shadow: 0upx 0upx 0upx; + z-index: 9999; } .cu-custom .cu-bar .border-custom { - position: relative; - background: rgba(0, 0, 0, 0.15); - border-radius: 1000upx; - height: 30px; + position: relative; + background: rgba(0, 0, 0, 0.15); + border-radius: 1000upx; + height: 30px; } .cu-custom .cu-bar .border-custom::after { - content: " "; - width: 200%; - height: 200%; - position: absolute; - top: 0; - left: 0; - border-radius: inherit; - transform: scale(0.5); - transform-origin: 0 0; - pointer-events: none; - box-sizing: border-box; - border: 1upx solid #ffffff; - opacity: 0.5; + content: ' '; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border-radius: inherit; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; + border: 1upx solid #ffffff; + opacity: 0.5; } .cu-custom .cu-bar .border-custom::before { - content: " "; - width: 1upx; - height: 110%; - position: absolute; - top: 22.5%; - left: 0; - right: 0; - margin: auto; - transform: scale(0.5); - transform-origin: 0 0; - pointer-events: none; - box-sizing: border-box; - opacity: 0.6; - background-color: #ffffff; + content: ' '; + width: 1upx; + height: 110%; + position: absolute; + top: 22.5%; + left: 0; + right: 0; + margin: auto; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; + opacity: 0.6; + background-color: #ffffff; } .cu-custom .cu-bar .border-custom text { - display: block; - flex: 1; - margin: auto !important; - text-align: center; - font-size: 34upx; + display: block; + flex: 1; + margin: auto !important; + text-align: center; + font-size: 34upx; } /* ================== @@ -1941,23 +1938,23 @@ button.cuIcon.lg { ==================== */ .nav { - white-space: nowrap; + white-space: nowrap; } ::-webkit-scrollbar { - display: none; + display: none; } .nav .cu-item { - height: 90upx; - display: inline-block; - line-height: 90upx; - margin: 0 10upx; - padding: 0 20upx; + height: 90upx; + display: inline-block; + line-height: 90upx; + margin: 0 10upx; + padding: 0 20upx; } .nav .cu-item.cur { - border-bottom: 4upx solid; + border-bottom: 4upx solid; } /* ================== @@ -1965,85 +1962,85 @@ button.cuIcon.lg { ==================== */ .cu-timeline { - display: block; - background-color: #ffffff; + display: block; + background-color: #ffffff; } .cu-timeline .cu-time { - width: 120upx; - text-align: center; - padding: 20upx 0; - font-size: 26upx; - color: #888; - display: block; -} - -.cu-timeline>.cu-item { - padding: 30upx 30upx 30upx 120upx; - position: relative; - display: block; - z-index: 0; -} - -.cu-timeline>.cu-item:not([class*="text-"]) { - color: #ccc; -} - -.cu-timeline>.cu-item::after { - content: ""; - display: block; - position: absolute; - width: 1upx; - background-color: #ddd; - left: 60upx; - height: 100%; - top: 0; - z-index: 8; -} - -.cu-timeline>.cu-item::before { - font-family: "cuIcon"; - display: block; - position: absolute; - top: 36upx; - z-index: 9; - background-color: #ffffff; - width: 50upx; - height: 50upx; - text-align: center; - border: none; - line-height: 50upx; - left: 36upx; -} - -.cu-timeline>.cu-item:not([class*="cuIcon-"])::before { - content: "\e763"; -} - -.cu-timeline>.cu-item[class*="cuIcon-"]::before { - background-color: #ffffff; - width: 50upx; - height: 50upx; - text-align: center; - border: none; - line-height: 50upx; - left: 36upx; -} - -.cu-timeline>.cu-item>.content { - padding: 30upx; - border-radius: 6upx; - display: block; - line-height: 1.6; + width: 120upx; + text-align: center; + padding: 20upx 0; + font-size: 26upx; + color: #888; + display: block; +} + +.cu-timeline > .cu-item { + padding: 30upx 30upx 30upx 120upx; + position: relative; + display: block; + z-index: 0; +} + +.cu-timeline > .cu-item:not([class*='text-']) { + color: #ccc; +} + +.cu-timeline > .cu-item::after { + content: ''; + display: block; + position: absolute; + width: 1upx; + background-color: #ddd; + left: 60upx; + height: 100%; + top: 0; + z-index: 8; +} + +.cu-timeline > .cu-item::before { + font-family: 'cuIcon'; + display: block; + position: absolute; + top: 36upx; + z-index: 9; + background-color: #ffffff; + width: 50upx; + height: 50upx; + text-align: center; + border: none; + line-height: 50upx; + left: 36upx; +} + +.cu-timeline > .cu-item:not([class*='cuIcon-'])::before { + content: '\e763'; +} + +.cu-timeline > .cu-item[class*='cuIcon-']::before { + background-color: #ffffff; + width: 50upx; + height: 50upx; + text-align: center; + border: none; + line-height: 50upx; + left: 36upx; +} + +.cu-timeline > .cu-item > .content { + padding: 30upx; + border-radius: 6upx; + display: block; + line-height: 1.6; } -.cu-timeline>.cu-item>.content:not([class*="bg-"]) { - background-color: #f1f1f1; - color: #333333; +.cu-timeline > .cu-item > .content:not([class*='bg-']) { + background-color: #f1f1f1; + color: #333333; } -.cu-timeline>.cu-item>.content+.content { - margin-top: 20upx; +.cu-timeline > .cu-item > .content + .content { + margin-top: 20upx; } /* ================== @@ -2051,127 +2048,127 @@ button.cuIcon.lg { ==================== */ .cu-chat { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; } .cu-chat .cu-item { - display: flex; - padding: 30upx 30upx 70upx; - position: relative; + display: flex; + padding: 30upx 30upx 70upx; + position: relative; } -.cu-chat .cu-item>.cu-avatar { - width: 80upx; - height: 80upx; +.cu-chat .cu-item > .cu-avatar { + width: 80upx; + height: 80upx; } -.cu-chat .cu-item>.main { - max-width: calc(100% - 260upx); - margin: 0 40upx; - display: flex; - align-items: center; +.cu-chat .cu-item > .main { + max-width: calc(100% - 260upx); + margin: 0 40upx; + display: flex; + align-items: center; } -.cu-chat .cu-item>image { - height: 320upx; +.cu-chat .cu-item > image { + height: 320upx; } -.cu-chat .cu-item>.main .content { - padding: 20upx; - border-radius: 6upx; - display: inline-flex; - max-width: 100%; - align-items: center; - font-size: 30upx; - position: relative; - min-height: 80upx; - line-height: 40upx; - text-align: left; +.cu-chat .cu-item > .main .content { + padding: 20upx; + border-radius: 6upx; + display: inline-flex; + max-width: 100%; + align-items: center; + font-size: 30upx; + position: relative; + min-height: 80upx; + line-height: 40upx; + text-align: left; } -.cu-chat .cu-item>.main .content:not([class*="bg-"]) { - background-color: #ffffff; - color: #333333; +.cu-chat .cu-item > .main .content:not([class*='bg-']) { + background-color: #ffffff; + color: #333333; } .cu-chat .cu-item .date { - position: absolute; - font-size: 24upx; - color: #8799a3; - width: calc(100% - 320upx); - bottom: 20upx; - left: 160upx; + position: absolute; + font-size: 24upx; + color: #8799a3; + width: calc(100% - 320upx); + bottom: 20upx; + left: 160upx; } .cu-chat .cu-item .action { - padding: 0 30upx; - display: flex; - align-items: center; -} - -.cu-chat .cu-item>.main .content::after { - content: ""; - top: 27upx; - transform: rotate(45deg); - position: absolute; - z-index: 100; - display: inline-block; - overflow: hidden; - width: 24upx; - height: 24upx; - left: -12upx; - right: initial; - background-color: inherit; -} - -.cu-chat .cu-item.self>.main .content::after { - left: auto; - right: -12upx; -} - -.cu-chat .cu-item>.main .content::before { - content: ""; - top: 30upx; - transform: rotate(45deg); - position: absolute; - z-index: -1; - display: inline-block; - overflow: hidden; - width: 24upx; - height: 24upx; - left: -12upx; - right: initial; - background-color: inherit; - filter: blur(5upx); - opacity: 0.3; -} - -.cu-chat .cu-item>.main .content:not([class*="bg-"])::before { - background-color: #333333; - opacity: 0.1; -} - -.cu-chat .cu-item.self>.main .content::before { - left: auto; - right: -12upx; + padding: 0 30upx; + display: flex; + align-items: center; +} + +.cu-chat .cu-item > .main .content::after { + content: ''; + top: 27upx; + transform: rotate(45deg); + position: absolute; + z-index: 100; + display: inline-block; + overflow: hidden; + width: 24upx; + height: 24upx; + left: -12upx; + right: initial; + background-color: inherit; +} + +.cu-chat .cu-item.self > .main .content::after { + left: auto; + right: -12upx; +} + +.cu-chat .cu-item > .main .content::before { + content: ''; + top: 30upx; + transform: rotate(45deg); + position: absolute; + z-index: -1; + display: inline-block; + overflow: hidden; + width: 24upx; + height: 24upx; + left: -12upx; + right: initial; + background-color: inherit; + filter: blur(5upx); + opacity: 0.3; +} + +.cu-chat .cu-item > .main .content:not([class*='bg-'])::before { + background-color: #333333; + opacity: 0.1; +} + +.cu-chat .cu-item.self > .main .content::before { + left: auto; + right: -12upx; } .cu-chat .cu-item.self { - justify-content: flex-end; - text-align: right; + justify-content: flex-end; + text-align: right; } .cu-chat .cu-info { - display: inline-block; - margin: 20upx auto; - font-size: 24upx; - padding: 8upx 12upx; - background-color: rgba(0, 0, 0, 0.2); - border-radius: 6upx; - color: #ffffff; - max-width: 400upx; - line-height: 1.4; + display: inline-block; + margin: 20upx auto; + font-size: 24upx; + padding: 8upx 12upx; + background-color: rgba(0, 0, 0, 0.2); + border-radius: 6upx; + color: #ffffff; + max-width: 400upx; + line-height: 1.4; } /* ================== @@ -2179,87 +2176,87 @@ button.cuIcon.lg { ==================== */ .cu-card { - display: block; - overflow: hidden; + display: block; + overflow: hidden; } -.cu-card>.cu-item { - display: block; - background-color: #ffffff; - overflow: hidden; - border-radius: 10upx; - margin: 30upx; +.cu-card > .cu-item { + display: block; + background-color: #ffffff; + overflow: hidden; + border-radius: 10upx; + margin: 30upx; } -.cu-card>.cu-item.shadow-blur { - overflow: initial; +.cu-card > .cu-item.shadow-blur { + overflow: initial; } -.cu-card.no-card>.cu-item { - margin: 0upx; - border-radius: 0upx; +.cu-card.no-card > .cu-item { + margin: 0upx; + border-radius: 0upx; } .cu-card .grid.grid-square { - margin-bottom: -20upx; + margin-bottom: -20upx; } .cu-card.case .image { - position: relative; + position: relative; } .cu-card.case .image image { - width: 100%; + width: 100%; } .cu-card.case .image .cu-tag { - position: absolute; - right: 0; - top: 0; + position: absolute; + right: 0; + top: 0; } .cu-card.case .image .cu-bar { - position: absolute; - bottom: 0; - width: 100%; - background-color: transparent; - padding: 0upx 30upx; + position: absolute; + bottom: 0; + width: 100%; + background-color: transparent; + padding: 0upx 30upx; } .cu-card.case.no-card .image { - margin: 30upx 30upx 0; - overflow: hidden; - border-radius: 10upx; + margin: 30upx 30upx 0; + overflow: hidden; + border-radius: 10upx; } .cu-card.dynamic { - display: block; + display: block; } -.cu-card.dynamic>.cu-item { - display: block; - background-color: #ffffff; - overflow: hidden; +.cu-card.dynamic > .cu-item { + display: block; + background-color: #ffffff; + overflow: hidden; } -.cu-card.dynamic>.cu-item>.text-content { - padding: 0 30upx 0; - max-height: 6.4em; - overflow: hidden; - font-size: 30upx; - margin-bottom: 20upx; +.cu-card.dynamic > .cu-item > .text-content { + padding: 0 30upx 0; + max-height: 6.4em; + overflow: hidden; + font-size: 30upx; + margin-bottom: 20upx; } -.cu-card.dynamic>.cu-item .square-img { - width: 100%; - height: 200upx; - border-radius: 6upx; +.cu-card.dynamic > .cu-item .square-img { + width: 100%; + height: 200upx; + border-radius: 6upx; } -.cu-card.dynamic>.cu-item .only-img { - width: 100%; - height: 320upx; - border-radius: 6upx; +.cu-card.dynamic > .cu-item .only-img { + width: 100%; + height: 320upx; + border-radius: 6upx; } /* card.dynamic>.cu-item .comment { @@ -2270,45 +2267,45 @@ button.cuIcon.lg { } */ .cu-card.article { - display: block; + display: block; } -.cu-card.article>.cu-item { - padding-bottom: 30upx; +.cu-card.article > .cu-item { + padding-bottom: 30upx; } -.cu-card.article>.cu-item .title { - font-size: 30upx; - font-weight: 900; - color: #333333; - line-height: 100upx; - padding: 0 30upx; +.cu-card.article > .cu-item .title { + font-size: 30upx; + font-weight: 900; + color: #333333; + line-height: 100upx; + padding: 0 30upx; } -.cu-card.article>.cu-item .content { - display: flex; - padding: 0 30upx; +.cu-card.article > .cu-item .content { + display: flex; + padding: 0 30upx; } -.cu-card.article>.cu-item .content>image { - width: 240upx; - height: 6.4em; - margin-right: 20upx; - border-radius: 6upx; +.cu-card.article > .cu-item .content > image { + width: 240upx; + height: 6.4em; + margin-right: 20upx; + border-radius: 6upx; } -.cu-card.article>.cu-item .content .desc { - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; +.cu-card.article > .cu-item .content .desc { + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-between; } -.cu-card.article>.cu-item .content .text-content { - font-size: 28upx; - color: #888; - height: 4.8em; - overflow: hidden; +.cu-card.article > .cu-item .content .text-content { + font-size: 28upx; + color: #888; + height: 4.8em; + overflow: hidden; } /* ================== @@ -2316,92 +2313,92 @@ button.cuIcon.lg { ==================== */ .cu-form-group { - background-color: #ffffff; - padding: 1upx 30upx; - display: flex; - align-items: center; - min-height: 100upx; - justify-content: space-between; + background-color: #ffffff; + padding: 1upx 30upx; + display: flex; + align-items: center; + min-height: 100upx; + justify-content: space-between; } -.cu-form-group+.cu-form-group { - border-top: 1upx solid #eee; +.cu-form-group + .cu-form-group { + border-top: 1upx solid #eee; } .cu-form-group .title { - text-align: justify; - padding-right: 30upx; - font-size: 30upx; - position: relative; - height: 60upx; - line-height: 60upx; + text-align: justify; + padding-right: 30upx; + font-size: 30upx; + position: relative; + height: 60upx; + line-height: 60upx; } .cu-form-group input { - flex: 1; - font-size: 30upx; - color: #555; - padding-right: 20upx; + flex: 1; + font-size: 30upx; + color: #555; + padding-right: 20upx; } -.cu-form-group>text[class*="cuIcon-"] { - font-size: 36upx; - padding: 0; - box-sizing: border-box; +.cu-form-group > text[class*='cuIcon-'] { + font-size: 36upx; + padding: 0; + box-sizing: border-box; } .cu-form-group textarea { - margin: 32upx 0 30upx; - height: 4.6em; - width: 100%; - line-height: 1.2em; - flex: 1; - font-size: 28upx; - padding: 0; + margin: 32upx 0 30upx; + height: 4.6em; + width: 100%; + line-height: 1.2em; + flex: 1; + font-size: 28upx; + padding: 0; } .cu-form-group.align-start .title { - height: 1em; - margin-top: 32upx; - line-height: 1em; + height: 1em; + margin-top: 32upx; + line-height: 1em; } .cu-form-group picker { - flex: 1; - padding-right: 40upx; - overflow: hidden; - position: relative; + flex: 1; + padding-right: 40upx; + overflow: hidden; + position: relative; } .cu-form-group picker .picker { - line-height: 100upx; - font-size: 28upx; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - width: 100%; - text-align: right; + line-height: 100upx; + font-size: 28upx; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + width: 100%; + text-align: right; } .cu-form-group picker::after { - font-family: cuIcon; - display: block; - content: "\e6a3"; - position: absolute; - font-size: 34upx; - color: #8799a3; - line-height: 100upx; - width: 60upx; - text-align: center; - top: 0; - bottom: 0; - right: -20upx; - margin: auto; + font-family: cuIcon; + display: block; + content: '\e6a3'; + position: absolute; + font-size: 34upx; + color: #8799a3; + line-height: 100upx; + width: 60upx; + text-align: center; + top: 0; + bottom: 0; + right: -20upx; + margin: auto; } .cu-form-group textarea[disabled], .cu-form-group textarea[disabled] .placeholder { - color: transparent; + color: transparent; } /* ================== @@ -2409,244 +2406,243 @@ button.cuIcon.lg { ==================== */ .cu-modal { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1110; - opacity: 0; - outline: 0; - text-align: center; - -ms-transform: scale(1.185); - transform: scale(1.185); - backface-visibility: hidden; - perspective: 2000upx; - background: rgba(0, 0, 0, 0.6); - transition: all 0.3s ease-in-out 0s; - pointer-events: none; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1110; + opacity: 0; + outline: 0; + text-align: center; + -ms-transform: scale(1.185); + transform: scale(1.185); + backface-visibility: hidden; + perspective: 2000upx; + background: rgba(0, 0, 0, 0.6); + transition: all 0.3s ease-in-out 0s; + pointer-events: none; } .cu-modal::before { - content: "\200B"; - display: inline-block; - height: 100%; - vertical-align: middle; + content: '\200B'; + display: inline-block; + height: 100%; + vertical-align: middle; } .cu-modal.show { - opacity: 1; - transition-duration: 0.3s; - -ms-transform: scale(1); - transform: scale(1); - overflow-x: hidden; - overflow-y: auto; - pointer-events: auto; + opacity: 1; + transition-duration: 0.3s; + -ms-transform: scale(1); + transform: scale(1); + overflow-x: hidden; + overflow-y: auto; + pointer-events: auto; } .cu-dialog { - position: relative; - display: inline-block; - vertical-align: middle; - margin-left: auto; - margin-right: auto; - width: 680upx; - max-width: 100%; - background-color: #f8f8f8; - border-radius: 10upx; - overflow: hidden; + position: relative; + display: inline-block; + vertical-align: middle; + margin-left: auto; + margin-right: auto; + width: 680upx; + max-width: 100%; + background-color: #f8f8f8; + border-radius: 10upx; + overflow: hidden; } .cu-modal.bottom-modal::before { - vertical-align: bottom; + vertical-align: bottom; } .cu-modal.bottom-modal .cu-dialog { - width: 100%; - border-radius: 0; + width: 100%; + border-radius: 0; } .cu-modal.bottom-modal { - margin-bottom: -1000upx; + margin-bottom: -1000upx; } .cu-modal.bottom-modal.show { - margin-bottom: 0; + margin-bottom: 0; } .cu-modal.drawer-modal { - transform: scale(1); - display: flex; + transform: scale(1); + display: flex; } .cu-modal.drawer-modal .cu-dialog { - height: 100%; - min-width: 200upx; - border-radius: 0; - margin: initial; - transition-duration: 0.3s; + height: 100%; + min-width: 200upx; + border-radius: 0; + margin: initial; + transition-duration: 0.3s; } .cu-modal.drawer-modal.justify-start .cu-dialog { - transform: translateX(-100%); + transform: translateX(-100%); } .cu-modal.drawer-modal.justify-end .cu-dialog { - transform: translateX(100%); + transform: translateX(100%); } .cu-modal.drawer-modal.show .cu-dialog { - transform: translateX(0%); + transform: translateX(0%); } -.cu-modal .cu-dialog>.cu-bar:first-child .action { - min-width: 100rpx; - margin-right: 0; - min-height: 100rpx; +.cu-modal .cu-dialog > .cu-bar:first-child .action { + min-width: 100rpx; + margin-right: 0; + min-height: 100rpx; } /* ================== 轮播 ==================== */ swiper .a-swiper-dot { - display: inline-block; - width: 16upx; - height: 16upx; - background: rgba(0, 0, 0, .3); - border-radius: 50%; - vertical-align: middle; + display: inline-block; + width: 16upx; + height: 16upx; + background: rgba(0, 0, 0, 0.3); + border-radius: 50%; + vertical-align: middle; } -swiper[class*="-dot"] .wx-swiper-dots, -swiper[class*="-dot"] .a-swiper-dots, -swiper[class*="-dot"] .uni-swiper-dots { - display: flex; - align-items: center; - width: 100%; - justify-content: center; +swiper[class*='-dot'] .wx-swiper-dots, +swiper[class*='-dot'] .a-swiper-dots, +swiper[class*='-dot'] .uni-swiper-dots { + display: flex; + align-items: center; + width: 100%; + justify-content: center; } swiper.square-dot .wx-swiper-dot, swiper.square-dot .a-swiper-dot, swiper.square-dot .uni-swiper-dot { - background-color: #ffffff; - opacity: 0.4; - width: 10upx; - height: 10upx; - border-radius: 20upx; - margin: 0 8upx !important; + background-color: #ffffff; + opacity: 0.4; + width: 10upx; + height: 10upx; + border-radius: 20upx; + margin: 0 8upx !important; } swiper.square-dot .wx-swiper-dot.wx-swiper-dot-active, swiper.square-dot .a-swiper-dot.a-swiper-dot-active, swiper.square-dot .uni-swiper-dot.uni-swiper-dot-active { - opacity: 1; - width: 30upx; + opacity: 1; + width: 30upx; } swiper.round-dot .wx-swiper-dot, swiper.round-dot .a-swiper-dot, swiper.round-dot .uni-swiper-dot { - width: 10upx; - height: 10upx; - position: relative; - margin: 4upx 8upx !important; + width: 10upx; + height: 10upx; + position: relative; + margin: 4upx 8upx !important; } swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active::after, swiper.round-dot .a-swiper-dot.a-swiper-dot-active::after, swiper.round-dot .uni-swiper-dot.uni-swiper-dot-active::after { - content: ""; - position: absolute; - width: 10upx; - height: 10upx; - top: 0upx; - left: 0upx; - right: 0; - bottom: 0; - margin: auto; - background-color: #ffffff; - border-radius: 20upx; + content: ''; + position: absolute; + width: 10upx; + height: 10upx; + top: 0upx; + left: 0upx; + right: 0; + bottom: 0; + margin: auto; + background-color: #ffffff; + border-radius: 20upx; } swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active, swiper.round-dot .a-swiper-dot.a-swiper-dot-active, swiper.round-dot .uni-swiper-dot.uni-swiper-dot-active { - width: 18upx; - height: 18upx; + width: 18upx; + height: 18upx; } .screen-swiper { - min-height: 375upx; + min-height: 375upx; } .screen-swiper image, .screen-swiper video, .swiper-item image, .swiper-item video { - width: 100%; - display: block; - height: 100%; - margin: 0; - pointer-events: none; + width: 100%; + display: block; + height: 100%; + margin: 0; + pointer-events: none; } .card-swiper { - height: 420upx !important; + height: 420upx !important; } .card-swiper swiper-item { - width: 610upx !important; - left: 70upx; - box-sizing: border-box; - padding: 40upx 0upx 70upx; - overflow: initial; + width: 610upx !important; + left: 70upx; + box-sizing: border-box; + padding: 40upx 0upx 70upx; + overflow: initial; } .card-swiper swiper-item .swiper-item { - width: 100%; - display: block; - height: 100%; - border-radius: 10upx; - transform: scale(0.9); - transition: all 0.2s ease-in 0s; - overflow: hidden; + width: 100%; + display: block; + height: 100%; + border-radius: 10upx; + transform: scale(0.9); + transition: all 0.2s ease-in 0s; + overflow: hidden; } .card-swiper swiper-item.cur .swiper-item { - transform: none; - transition: all 0.2s ease-in 0s; + transform: none; + transition: all 0.2s ease-in 0s; } - .tower-swiper { - height: 420upx; - position: relative; - max-width: 750upx; - overflow: hidden; + height: 420upx; + position: relative; + max-width: 750upx; + overflow: hidden; } .tower-swiper .tower-item { - position: absolute; - width: 300upx; - height: 380upx; - top: 0; - bottom: 0; - left: 50%; - margin: auto; - transition: all 0.2s ease-in 0s; - opacity: 1; + position: absolute; + width: 300upx; + height: 380upx; + top: 0; + bottom: 0; + left: 50%; + margin: auto; + transition: all 0.2s ease-in 0s; + opacity: 1; } .tower-swiper .tower-item.none { - opacity: 0; + opacity: 0; } .tower-swiper .tower-item .swiper-item { - width: 100%; - height: 100%; - border-radius: 6upx; - overflow: hidden; + width: 100%; + height: 100%; + border-radius: 6upx; + overflow: hidden; } /* ================== @@ -2654,135 +2650,135 @@ swiper.round-dot .uni-swiper-dot.uni-swiper-dot-active { ==================== */ .cu-steps { - display: flex; + display: flex; } scroll-view.cu-steps { - display: block; - white-space: nowrap; + display: block; + white-space: nowrap; } scroll-view.cu-steps .cu-item { - display: inline-block; + display: inline-block; } .cu-steps .cu-item { - flex: 1; - text-align: center; - position: relative; - min-width: 100upx; + flex: 1; + text-align: center; + position: relative; + min-width: 100upx; } -.cu-steps .cu-item:not([class*="text-"]) { - color: #8799a3; +.cu-steps .cu-item:not([class*='text-']) { + color: #8799a3; } -.cu-steps .cu-item [class*="cuIcon-"], +.cu-steps .cu-item [class*='cuIcon-'], .cu-steps .cu-item .num { - display: block; - font-size: 40upx; - line-height: 80upx; + display: block; + font-size: 40upx; + line-height: 80upx; } .cu-steps .cu-item::before, .cu-steps .cu-item::after, .cu-steps.steps-arrow .cu-item::before, .cu-steps.steps-arrow .cu-item::after { - content: ""; - display: block; - position: absolute; - height: 0px; - width: calc(100% - 80upx); - border-bottom: 1px solid #ccc; - left: calc(0px - (100% - 80upx) / 2); - top: 40upx; - z-index: 0; + content: ''; + display: block; + position: absolute; + height: 0px; + width: calc(100% - 80upx); + border-bottom: 1px solid #ccc; + left: calc(0px - (100% - 80upx) / 2); + top: 40upx; + z-index: 0; } .cu-steps.steps-arrow .cu-item::before, .cu-steps.steps-arrow .cu-item::after { - content: "\e6a3"; - font-family: 'cuIcon'; - height: 30upx; - border-bottom-width: 0px; - line-height: 30upx; - top: 0; - bottom: 0; - margin: auto; - color: #ccc; + content: '\e6a3'; + font-family: 'cuIcon'; + height: 30upx; + border-bottom-width: 0px; + line-height: 30upx; + top: 0; + bottom: 0; + margin: auto; + color: #ccc; } .cu-steps.steps-bottom .cu-item::before, .cu-steps.steps-bottom .cu-item::after { - bottom: 40upx; - top: initial; + bottom: 40upx; + top: initial; } .cu-steps .cu-item::after { - border-bottom: 1px solid currentColor; - width: 0px; - transition: all 0.3s ease-in-out 0s; + border-bottom: 1px solid currentColor; + width: 0px; + transition: all 0.3s ease-in-out 0s; } -.cu-steps .cu-item[class*="text-"]::after { - width: calc(100% - 80upx); - color: currentColor; +.cu-steps .cu-item[class*='text-']::after { + width: calc(100% - 80upx); + color: currentColor; } .cu-steps .cu-item:first-child::before, .cu-steps .cu-item:first-child::after { - display: none; + display: none; } .cu-steps .cu-item .num { - width: 40upx; - height: 40upx; - border-radius: 50%; - line-height: 40upx; - margin: 20upx auto; - font-size: 24upx; - border: 1px solid currentColor; - position: relative; - overflow: hidden; + width: 40upx; + height: 40upx; + border-radius: 50%; + line-height: 40upx; + margin: 20upx auto; + font-size: 24upx; + border: 1px solid currentColor; + position: relative; + overflow: hidden; } -.cu-steps .cu-item[class*="text-"] .num { - background-color: currentColor; +.cu-steps .cu-item[class*='text-'] .num { + background-color: currentColor; } .cu-steps .cu-item .num::before, .cu-steps .cu-item .num::after { - content: attr(data-index); - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - margin: auto; - transition: all 0.3s ease-in-out 0s; - transform: translateY(0upx); + content: attr(data-index); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + transition: all 0.3s ease-in-out 0s; + transform: translateY(0upx); } -.cu-steps .cu-item[class*="text-"] .num::before { - transform: translateY(-40upx); - color: #ffffff; +.cu-steps .cu-item[class*='text-'] .num::before { + transform: translateY(-40upx); + color: #ffffff; } .cu-steps .cu-item .num::after { - transform: translateY(40upx); - color: #ffffff; - transition: all 0.3s ease-in-out 0s; + transform: translateY(40upx); + color: #ffffff; + transition: all 0.3s ease-in-out 0s; } -.cu-steps .cu-item[class*="text-"] .num::after { - content: "\e645"; - font-family: 'cuIcon'; - color: #ffffff; - transform: translateY(0upx); +.cu-steps .cu-item[class*='text-'] .num::after { + content: '\e645'; + font-family: 'cuIcon'; + color: #ffffff; + transform: translateY(0upx); } -.cu-steps .cu-item[class*="text-"] .num.err::after { - content: "\e646"; +.cu-steps .cu-item[class*='text-'] .num.err::after { + content: '\e646'; } /* ================== @@ -2792,540 +2788,540 @@ scroll-view.cu-steps .cu-item { /* -- flex弹性布局 -- */ .flex { - display: flex; + display: flex; } .basis-xs { - flex-basis: 20%; + flex-basis: 20%; } .basis-sm { - flex-basis: 40%; + flex-basis: 40%; } .basis-df { - flex-basis: 50%; + flex-basis: 50%; } .basis-lg { - flex-basis: 60%; + flex-basis: 60%; } .basis-xl { - flex-basis: 80%; + flex-basis: 80%; } .flex-sub { - flex: 1; + flex: 1; } .flex-twice { - flex: 2; + flex: 2; } .flex-treble { - flex: 3; + flex: 3; } .flex-direction { - flex-direction: column; + flex-direction: column; } .flex-wrap { - flex-wrap: wrap; + flex-wrap: wrap; } .align-start { - align-items: flex-start; + align-items: flex-start; } .align-end { - align-items: flex-end; + align-items: flex-end; } .align-center { - align-items: center; + align-items: center; } .align-stretch { - align-items: stretch; + align-items: stretch; } .self-start { - align-self: flex-start; + align-self: flex-start; } .self-center { - align-self: flex-center; + align-self: flex-center; } .self-end { - align-self: flex-end; + align-self: flex-end; } .self-stretch { - align-self: stretch; + align-self: stretch; } .align-stretch { - align-items: stretch; + align-items: stretch; } .justify-start { - justify-content: flex-start; + justify-content: flex-start; } .justify-end { - justify-content: flex-end; + justify-content: flex-end; } .justify-center { - justify-content: center; + justify-content: center; } .justify-between { - justify-content: space-between; + justify-content: space-between; } .justify-around { - justify-content: space-around; + justify-content: space-around; } /* grid布局 */ .grid { - display: flex; - flex-wrap: wrap; + display: flex; + flex-wrap: wrap; } .grid.grid-square { - overflow: hidden; + overflow: hidden; } .grid.grid-square .cu-tag { - position: absolute; - right: 0; - top: 0; - border-bottom-left-radius: 6upx; - padding: 6upx 12upx; - height: auto; - background-color: rgba(0, 0, 0, 0.5); -} - -.grid.grid-square>view>text[class*="cuIcon-"] { - font-size: 52upx; - position: absolute; - color: #8799a3; - margin: auto; - top: 0; - bottom: 0; - left: 0; - right: 0; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; -} - -.grid.grid-square>view { - margin-right: 20upx; - margin-bottom: 20upx; - border-radius: 6upx; - position: relative; - overflow: hidden; + position: absolute; + right: 0; + top: 0; + border-bottom-left-radius: 6upx; + padding: 6upx 12upx; + height: auto; + background-color: rgba(0, 0, 0, 0.5); +} + +.grid.grid-square > view > text[class*='cuIcon-'] { + font-size: 52upx; + position: absolute; + color: #8799a3; + margin: auto; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.grid.grid-square > view { + margin-right: 20upx; + margin-bottom: 20upx; + border-radius: 6upx; + position: relative; + overflow: hidden; } -.grid.grid-square>view.bg-img image { - width: 100%; - height: 100%; - position: absolute; +.grid.grid-square > view.bg-img image { + width: 100%; + height: 100%; + position: absolute; } -.grid.col-1.grid-square>view { - padding-bottom: 100%; - height: 0; - margin-right: 0; +.grid.col-1.grid-square > view { + padding-bottom: 100%; + height: 0; + margin-right: 0; } -.grid.col-2.grid-square>view { - padding-bottom: calc((100% - 20upx)/2); - height: 0; - width: calc((100% - 20upx)/2); +.grid.col-2.grid-square > view { + padding-bottom: calc((100% - 20upx) / 2); + height: 0; + width: calc((100% - 20upx) / 2); } -.grid.col-3.grid-square>view { - padding-bottom: calc((100% - 40upx)/3); - height: 0; - width: calc((100% - 40upx)/3); +.grid.col-3.grid-square > view { + padding-bottom: calc((100% - 40upx) / 3); + height: 0; + width: calc((100% - 40upx) / 3); } -.grid.col-4.grid-square>view { - padding-bottom: calc((100% - 60upx)/4); - height: 0; - width: calc((100% - 60upx)/4); +.grid.col-4.grid-square > view { + padding-bottom: calc((100% - 60upx) / 4); + height: 0; + width: calc((100% - 60upx) / 4); } -.grid.col-5.grid-square>view { - padding-bottom: calc((100% - 80upx)/5); - height: 0; - width: calc((100% - 80upx)/5); +.grid.col-5.grid-square > view { + padding-bottom: calc((100% - 80upx) / 5); + height: 0; + width: calc((100% - 80upx) / 5); } -.grid.col-2.grid-square>view:nth-child(2n), -.grid.col-3.grid-square>view:nth-child(3n), -.grid.col-4.grid-square>view:nth-child(4n), -.grid.col-5.grid-square>view:nth-child(5n) { - margin-right: 0; +.grid.col-2.grid-square > view:nth-child(2n), +.grid.col-3.grid-square > view:nth-child(3n), +.grid.col-4.grid-square > view:nth-child(4n), +.grid.col-5.grid-square > view:nth-child(5n) { + margin-right: 0; } -.grid.col-1>view { - width: 100%; +.grid.col-1 > view { + width: 100%; } -.grid.col-2>view { - width: 50%; +.grid.col-2 > view { + width: 50%; } -.grid.col-3>view { - width: 33.33%; +.grid.col-3 > view { + width: 33.33%; } -.grid.col-4>view { - width: 25%; +.grid.col-4 > view { + width: 25%; } -.grid.col-5>view { - width: 20%; +.grid.col-5 > view { + width: 20%; } /* -- 内外边距 -- */ .margin-0 { - margin: 0; + margin: 0; } .margin-xs { - margin: 10upx; + margin: 10upx; } .margin-sm { - margin: 20upx; + margin: 20upx; } .margin { - margin: 30upx; + margin: 30upx; } .margin-lg { - margin: 40upx; + margin: 40upx; } .margin-xl { - margin: 50upx; + margin: 50upx; } .margin-top-xs { - margin-top: 10upx; + margin-top: 10upx; } .margin-top-sm { - margin-top: 20upx; + margin-top: 20upx; } .margin-top { - margin-top: 30upx; + margin-top: 30upx; } .margin-top-lg { - margin-top: 40upx; + margin-top: 40upx; } .margin-top-xl { - margin-top: 50upx; + margin-top: 50upx; } .margin-right-xs { - margin-right: 10upx; + margin-right: 10upx; } .margin-right-sm { - margin-right: 20upx; + margin-right: 20upx; } .margin-right { - margin-right: 30upx; + margin-right: 30upx; } .margin-right-lg { - margin-right: 40upx; + margin-right: 40upx; } .margin-right-xl { - margin-right: 50upx; + margin-right: 50upx; } .margin-bottom-xs { - margin-bottom: 10upx; + margin-bottom: 10upx; } .margin-bottom-sm { - margin-bottom: 20upx; + margin-bottom: 20upx; } .margin-bottom { - margin-bottom: 30upx; + margin-bottom: 30upx; } .margin-bottom-lg { - margin-bottom: 40upx; + margin-bottom: 40upx; } .margin-bottom-xl { - margin-bottom: 50upx; + margin-bottom: 50upx; } .margin-left-xs { - margin-left: 10upx; + margin-left: 10upx; } .margin-left-sm { - margin-left: 20upx; + margin-left: 20upx; } .margin-left { - margin-left: 30upx; + margin-left: 30upx; } .margin-left-lg { - margin-left: 40upx; + margin-left: 40upx; } .margin-left-xl { - margin-left: 50upx; + margin-left: 50upx; } .margin-lr-xs { - margin-left: 10upx; - margin-right: 10upx; + margin-left: 10upx; + margin-right: 10upx; } .margin-lr-sm { - margin-left: 20upx; - margin-right: 20upx; + margin-left: 20upx; + margin-right: 20upx; } .margin-lr { - margin-left: 30upx; - margin-right: 30upx; + margin-left: 30upx; + margin-right: 30upx; } .margin-lr-lg { - margin-left: 40upx; - margin-right: 40upx; + margin-left: 40upx; + margin-right: 40upx; } .margin-lr-xl { - margin-left: 50upx; - margin-right: 50upx; + margin-left: 50upx; + margin-right: 50upx; } .margin-tb-xs { - margin-top: 10upx; - margin-bottom: 10upx; + margin-top: 10upx; + margin-bottom: 10upx; } .margin-tb-sm { - margin-top: 20upx; - margin-bottom: 20upx; + margin-top: 20upx; + margin-bottom: 20upx; } .margin-tb { - margin-top: 30upx; - margin-bottom: 30upx; + margin-top: 30upx; + margin-bottom: 30upx; } .margin-tb-lg { - margin-top: 40upx; - margin-bottom: 40upx; + margin-top: 40upx; + margin-bottom: 40upx; } .margin-tb-xl { - margin-top: 50upx; - margin-bottom: 50upx; + margin-top: 50upx; + margin-bottom: 50upx; } .padding-0 { - padding: 0; + padding: 0; } .padding-xs { - padding: 10upx; + padding: 10upx; } .padding-sm { - padding: 20upx; + padding: 20upx; } .padding { - padding: 30upx; + padding: 30upx; } .padding-lg { - padding: 40upx; + padding: 40upx; } .padding-xl { - padding: 50upx; + padding: 50upx; } .padding-top-xs { - padding-top: 10upx; + padding-top: 10upx; } .padding-top-sm { - padding-top: 20upx; + padding-top: 20upx; } .padding-top { - padding-top: 30upx; + padding-top: 30upx; } .padding-top-lg { - padding-top: 40upx; + padding-top: 40upx; } .padding-top-xl { - padding-top: 50upx; + padding-top: 50upx; } .padding-right-xs { - padding-right: 10upx; + padding-right: 10upx; } .padding-right-sm { - padding-right: 20upx; + padding-right: 20upx; } .padding-right { - padding-right: 30upx; + padding-right: 30upx; } .padding-right-lg { - padding-right: 40upx; + padding-right: 40upx; } .padding-right-xl { - padding-right: 50upx; + padding-right: 50upx; } .padding-bottom-xs { - padding-bottom: 10upx; + padding-bottom: 10upx; } .padding-bottom-sm { - padding-bottom: 20upx; + padding-bottom: 20upx; } .padding-bottom { - padding-bottom: 30upx; + padding-bottom: 30upx; } .padding-bottom-lg { - padding-bottom: 40upx; + padding-bottom: 40upx; } .padding-bottom-xl { - padding-bottom: 50upx; + padding-bottom: 50upx; } .padding-left-xs { - padding-left: 10upx; + padding-left: 10upx; } .padding-left-sm { - padding-left: 20upx; + padding-left: 20upx; } .padding-left { - padding-left: 30upx; + padding-left: 30upx; } .padding-left-lg { - padding-left: 40upx; + padding-left: 40upx; } .padding-left-xl { - padding-left: 50upx; + padding-left: 50upx; } .padding-lr-xs { - padding-left: 10upx; - padding-right: 10upx; + padding-left: 10upx; + padding-right: 10upx; } .padding-lr-sm { - padding-left: 20upx; - padding-right: 20upx; + padding-left: 20upx; + padding-right: 20upx; } .padding-lr { - padding-left: 30upx; - padding-right: 30upx; + padding-left: 30upx; + padding-right: 30upx; } .padding-lr-lg { - padding-left: 40upx; - padding-right: 40upx; + padding-left: 40upx; + padding-right: 40upx; } .padding-lr-xl { - padding-left: 50upx; - padding-right: 50upx; + padding-left: 50upx; + padding-right: 50upx; } .padding-tb-xs { - padding-top: 10upx; - padding-bottom: 10upx; + padding-top: 10upx; + padding-bottom: 10upx; } .padding-tb-sm { - padding-top: 20upx; - padding-bottom: 20upx; + padding-top: 20upx; + padding-bottom: 20upx; } .padding-tb { - padding-top: 30upx; - padding-bottom: 30upx; + padding-top: 30upx; + padding-bottom: 30upx; } .padding-tb-lg { - padding-top: 40upx; - padding-bottom: 40upx; + padding-top: 40upx; + padding-bottom: 40upx; } .padding-tb-xl { - padding-top: 50upx; - padding-bottom: 50upx; + padding-top: 50upx; + padding-bottom: 50upx; } /* -- 浮动 -- */ .cf::after, .cf::before { - content: " "; - display: table; + content: ' '; + display: table; } .cf::after { - clear: both; + clear: both; } .fl { - float: left; + float: left; } .fr { - float: right; + float: right; } /* ================== @@ -3334,415 +3330,415 @@ scroll-view.cu-steps .cu-item { .line-red::after, .lines-red::after { - border-color: #e54d42; + border-color: #e54d42; } .line-orange::after, .lines-orange::after { - border-color: #f37b1d; + border-color: #f37b1d; } .line-yellow::after, .lines-yellow::after { - border-color: #fbbd08; + border-color: #fbbd08; } .line-olive::after, .lines-olive::after { - border-color: #8dc63f; + border-color: #8dc63f; } .line-green::after, .lines-green::after { - border-color: #39b54a; + border-color: #39b54a; } .line-cyan::after, .lines-cyan::after { - border-color: #1cbbb4; + border-color: #1cbbb4; } .line-blue::after, .lines-blue::after { - border-color: #0081ff; + border-color: #0081ff; } .line-purple::after, .lines-purple::after { - border-color: #6739b6; + border-color: #6739b6; } .line-mauve::after, .lines-mauve::after { - border-color: #9c26b0; + border-color: #9c26b0; } .line-pink::after, .lines-pink::after { - border-color: #e03997; + border-color: #e03997; } .line-brown::after, .lines-brown::after { - border-color: #a5673f; + border-color: #a5673f; } .line-grey::after, .lines-grey::after { - border-color: #8799a3; + border-color: #8799a3; } .line-gray::after, .lines-gray::after { - border-color: #aaaaaa; + border-color: #aaaaaa; } .line-black::after, .lines-black::after { - border-color: #333333; + border-color: #333333; } .line-white::after, .lines-white::after { - border-color: #ffffff; + border-color: #ffffff; } .bg-red { - background-color: #e54d42; - color: #ffffff; + background-color: #e54d42; + color: #ffffff; } .bg-orange { - background-color: #f37b1d; - color: #ffffff; + background-color: #f37b1d; + color: #ffffff; } .bg-yellow { - background-color: #fbbd08; - color: #333333; + background-color: #fbbd08; + color: #333333; } .bg-olive { - background-color: #8dc63f; - color: #ffffff; + background-color: #8dc63f; + color: #ffffff; } .bg-green { - background-color: #39b54a; - color: #ffffff; + background-color: #39b54a; + color: #ffffff; } .bg-cyan { - background-color: #1cbbb4; - color: #ffffff; + background-color: #1cbbb4; + color: #ffffff; } .bg-blue { - background-color: #0081ff; - color: #ffffff; + background-color: #0081ff; + color: #ffffff; } .bg-purple { - background-color: #6739b6; - color: #ffffff; + background-color: #6739b6; + color: #ffffff; } .bg-mauve { - background-color: #9c26b0; - color: #ffffff; + background-color: #9c26b0; + color: #ffffff; } .bg-pink { - background-color: #e03997; - color: #ffffff; + background-color: #e03997; + color: #ffffff; } .bg-brown { - background-color: #a5673f; - color: #ffffff; + background-color: #a5673f; + color: #ffffff; } .bg-grey { - background-color: #8799a3; - color: #ffffff; + background-color: #8799a3; + color: #ffffff; } .bg-gray { - background-color: #f0f0f0; - color: #333333; + background-color: #f0f0f0; + color: #333333; } .bg-black { - background-color: #333333; - color: #ffffff; + background-color: #333333; + color: #ffffff; } .bg-white { - background-color: #ffffff; - color: #666666; + background-color: #ffffff; + color: #666666; } .bg-shadeTop { - background-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.01)); - color: #ffffff; + background-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.01)); + color: #ffffff; } .bg-shadeBottom { - background-image: linear-gradient(rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 1)); - color: #ffffff; + background-image: linear-gradient(rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 1)); + color: #ffffff; } .bg-red.light { - color: #e54d42; - background-color: #fadbd9; + color: #e54d42; + background-color: #fadbd9; } .bg-orange.light { - color: #f37b1d; - background-color: #fde6d2; + color: #f37b1d; + background-color: #fde6d2; } .bg-yellow.light { - color: #fbbd08; - background-color: #fef2ced2; + color: #fbbd08; + background-color: #fef2ced2; } .bg-olive.light { - color: #8dc63f; - background-color: #e8f4d9; + color: #8dc63f; + background-color: #e8f4d9; } .bg-green.light { - color: #39b54a; - background-color: #d7f0dbff; + color: #39b54a; + background-color: #d7f0dbff; } .bg-cyan.light { - color: #1cbbb4; - background-color: #d2f1f0; + color: #1cbbb4; + background-color: #d2f1f0; } .bg-blue.light { - color: #0081ff; - background-color: #cce6ff; + color: #0081ff; + background-color: #cce6ff; } .bg-purple.light { - color: #6739b6; - background-color: #e1d7f0; + color: #6739b6; + background-color: #e1d7f0; } .bg-mauve.light { - color: #9c26b0; - background-color: #ebd4ef; + color: #9c26b0; + background-color: #ebd4ef; } .bg-pink.light { - color: #e03997; - background-color: #f9d7ea; + color: #e03997; + background-color: #f9d7ea; } .bg-brown.light { - color: #a5673f; - background-color: #ede1d9; + color: #a5673f; + background-color: #ede1d9; } .bg-grey.light { - color: #8799a3; - background-color: #e7ebed; + color: #8799a3; + background-color: #e7ebed; } .bg-gradual-red { - background-image: linear-gradient(45deg, #f43f3b, #ec008c); - color: #ffffff; + background-image: linear-gradient(45deg, #f43f3b, #ec008c); + color: #ffffff; } .bg-gradual-orange { - background-image: linear-gradient(45deg, #ff9700, #ed1c24); - color: #ffffff; + background-image: linear-gradient(45deg, #ff9700, #ed1c24); + color: #ffffff; } .bg-gradual-green { - background-image: linear-gradient(45deg, #39b54a, #8dc63f); - color: #ffffff; + background-image: linear-gradient(45deg, #39b54a, #8dc63f); + color: #ffffff; } .bg-gradual-purple { - background-image: linear-gradient(45deg, #9000ff, #5e00ff); - color: #ffffff; + background-image: linear-gradient(45deg, #9000ff, #5e00ff); + color: #ffffff; } .bg-gradual-pink { - background-image: linear-gradient(45deg, #ec008c, #6739b6); - color: #ffffff; + background-image: linear-gradient(45deg, #ec008c, #6739b6); + color: #ffffff; } .bg-gradual-blue { - background-image: linear-gradient(45deg, #0081ff, #1cbbb4); - color: #ffffff; + background-image: linear-gradient(45deg, #0081ff, #1cbbb4); + color: #ffffff; } -.shadow[class*="-red"] { - box-shadow: 6upx 6upx 8upx rgba(204, 69, 59, 0.2); +.shadow[class*='-red'] { + box-shadow: 6upx 6upx 8upx rgba(204, 69, 59, 0.2); } -.shadow[class*="-orange"] { - box-shadow: 6upx 6upx 8upx rgba(217, 109, 26, 0.2); +.shadow[class*='-orange'] { + box-shadow: 6upx 6upx 8upx rgba(217, 109, 26, 0.2); } -.shadow[class*="-yellow"] { - box-shadow: 6upx 6upx 8upx rgba(224, 170, 7, 0.2); +.shadow[class*='-yellow'] { + box-shadow: 6upx 6upx 8upx rgba(224, 170, 7, 0.2); } -.shadow[class*="-olive"] { - box-shadow: 6upx 6upx 8upx rgba(124, 173, 55, 0.2); +.shadow[class*='-olive'] { + box-shadow: 6upx 6upx 8upx rgba(124, 173, 55, 0.2); } -.shadow[class*="-green"] { - box-shadow: 6upx 6upx 8upx rgba(48, 156, 63, 0.2); +.shadow[class*='-green'] { + box-shadow: 6upx 6upx 8upx rgba(48, 156, 63, 0.2); } -.shadow[class*="-cyan"] { - box-shadow: 6upx 6upx 8upx rgba(28, 187, 180, 0.2); +.shadow[class*='-cyan'] { + box-shadow: 6upx 6upx 8upx rgba(28, 187, 180, 0.2); } -.shadow[class*="-blue"] { - box-shadow: 6upx 6upx 8upx rgba(0, 102, 204, 0.2); +.shadow[class*='-blue'] { + box-shadow: 6upx 6upx 8upx rgba(0, 102, 204, 0.2); } -.shadow[class*="-purple"] { - box-shadow: 6upx 6upx 8upx rgba(88, 48, 156, 0.2); +.shadow[class*='-purple'] { + box-shadow: 6upx 6upx 8upx rgba(88, 48, 156, 0.2); } -.shadow[class*="-mauve"] { - box-shadow: 6upx 6upx 8upx rgba(133, 33, 150, 0.2); +.shadow[class*='-mauve'] { + box-shadow: 6upx 6upx 8upx rgba(133, 33, 150, 0.2); } -.shadow[class*="-pink"] { - box-shadow: 6upx 6upx 8upx rgba(199, 50, 134, 0.2); +.shadow[class*='-pink'] { + box-shadow: 6upx 6upx 8upx rgba(199, 50, 134, 0.2); } -.shadow[class*="-brown"] { - box-shadow: 6upx 6upx 8upx rgba(140, 88, 53, 0.2); +.shadow[class*='-brown'] { + box-shadow: 6upx 6upx 8upx rgba(140, 88, 53, 0.2); } -.shadow[class*="-grey"] { - box-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); +.shadow[class*='-grey'] { + box-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); } -.shadow[class*="-gray"] { - box-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); +.shadow[class*='-gray'] { + box-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); } -.shadow[class*="-black"] { - box-shadow: 6upx 6upx 8upx rgba(26, 26, 26, 0.2); +.shadow[class*='-black'] { + box-shadow: 6upx 6upx 8upx rgba(26, 26, 26, 0.2); } -.shadow[class*="-white"] { - box-shadow: 6upx 6upx 8upx rgba(26, 26, 26, 0.2); +.shadow[class*='-white'] { + box-shadow: 6upx 6upx 8upx rgba(26, 26, 26, 0.2); } -.text-shadow[class*="-red"] { - text-shadow: 6upx 6upx 8upx rgba(204, 69, 59, 0.2); +.text-shadow[class*='-red'] { + text-shadow: 6upx 6upx 8upx rgba(204, 69, 59, 0.2); } -.text-shadow[class*="-orange"] { - text-shadow: 6upx 6upx 8upx rgba(217, 109, 26, 0.2); +.text-shadow[class*='-orange'] { + text-shadow: 6upx 6upx 8upx rgba(217, 109, 26, 0.2); } -.text-shadow[class*="-yellow"] { - text-shadow: 6upx 6upx 8upx rgba(224, 170, 7, 0.2); +.text-shadow[class*='-yellow'] { + text-shadow: 6upx 6upx 8upx rgba(224, 170, 7, 0.2); } -.text-shadow[class*="-olive"] { - text-shadow: 6upx 6upx 8upx rgba(124, 173, 55, 0.2); +.text-shadow[class*='-olive'] { + text-shadow: 6upx 6upx 8upx rgba(124, 173, 55, 0.2); } -.text-shadow[class*="-green"] { - text-shadow: 6upx 6upx 8upx rgba(48, 156, 63, 0.2); +.text-shadow[class*='-green'] { + text-shadow: 6upx 6upx 8upx rgba(48, 156, 63, 0.2); } -.text-shadow[class*="-cyan"] { - text-shadow: 6upx 6upx 8upx rgba(28, 187, 180, 0.2); +.text-shadow[class*='-cyan'] { + text-shadow: 6upx 6upx 8upx rgba(28, 187, 180, 0.2); } -.text-shadow[class*="-blue"] { - text-shadow: 6upx 6upx 8upx rgba(0, 102, 204, 0.2); +.text-shadow[class*='-blue'] { + text-shadow: 6upx 6upx 8upx rgba(0, 102, 204, 0.2); } -.text-shadow[class*="-purple"] { - text-shadow: 6upx 6upx 8upx rgba(88, 48, 156, 0.2); +.text-shadow[class*='-purple'] { + text-shadow: 6upx 6upx 8upx rgba(88, 48, 156, 0.2); } -.text-shadow[class*="-mauve"] { - text-shadow: 6upx 6upx 8upx rgba(133, 33, 150, 0.2); +.text-shadow[class*='-mauve'] { + text-shadow: 6upx 6upx 8upx rgba(133, 33, 150, 0.2); } -.text-shadow[class*="-pink"] { - text-shadow: 6upx 6upx 8upx rgba(199, 50, 134, 0.2); +.text-shadow[class*='-pink'] { + text-shadow: 6upx 6upx 8upx rgba(199, 50, 134, 0.2); } -.text-shadow[class*="-brown"] { - text-shadow: 6upx 6upx 8upx rgba(140, 88, 53, 0.2); +.text-shadow[class*='-brown'] { + text-shadow: 6upx 6upx 8upx rgba(140, 88, 53, 0.2); } -.text-shadow[class*="-grey"] { - text-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); +.text-shadow[class*='-grey'] { + text-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); } -.text-shadow[class*="-gray"] { - text-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); +.text-shadow[class*='-gray'] { + text-shadow: 6upx 6upx 8upx rgba(114, 130, 138, 0.2); } -.text-shadow[class*="-black"] { - text-shadow: 6upx 6upx 8upx rgba(26, 26, 26, 0.2); +.text-shadow[class*='-black'] { + text-shadow: 6upx 6upx 8upx rgba(26, 26, 26, 0.2); } .bg-img { - background-size: cover; - background-position: center; - background-repeat: no-repeat; + background-size: cover; + background-position: center; + background-repeat: no-repeat; } .bg-mask { - background-color: #333333; - position: relative; + background-color: #333333; + position: relative; } .bg-mask::after { - content: ""; - border-radius: inherit; - width: 100%; - height: 100%; - display: block; - background-color: rgba(0, 0, 0, 0.4); - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; + content: ''; + border-radius: inherit; + width: 100%; + height: 100%; + display: block; + background-color: rgba(0, 0, 0, 0.4); + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; } .bg-mask view, .bg-mask cover-view { - z-index: 5; - position: relative; + z-index: 5; + position: relative; } .bg-video { - position: relative; + position: relative; } .bg-video video { - display: block; - height: 100%; - width: 100%; - -o-object-fit: cover; - object-fit: cover; - position: absolute; - top: 0; - z-index: 0; - pointer-events: none; + display: block; + height: 100%; + width: 100%; + -o-object-fit: cover; + object-fit: cover; + position: absolute; + top: 0; + z-index: 0; + pointer-events: none; } /* ================== @@ -3750,167 +3746,167 @@ scroll-view.cu-steps .cu-item { ==================== */ .text-xs { - font-size: 20upx; + font-size: 20upx; } .text-sm { - font-size: 24upx; + font-size: 24upx; } .text-df { - font-size: 28upx; + font-size: 28upx; } .text-lg { - font-size: 32upx; + font-size: 32upx; } .text-xl { - font-size: 36upx; + font-size: 36upx; } .text-xxl { - font-size: 44upx; + font-size: 44upx; } .text-sl { - font-size: 80upx; + font-size: 80upx; } .text-xsl { - font-size: 120upx; + font-size: 120upx; } .text-Abc { - text-transform: Capitalize; + text-transform: Capitalize; } .text-ABC { - text-transform: Uppercase; + text-transform: Uppercase; } .text-abc { - text-transform: Lowercase; + text-transform: Lowercase; } .text-price::before { - content: "¥"; - font-size: 80%; - margin-right: 4upx; + content: '¥'; + font-size: 80%; + margin-right: 4upx; } .text-cut { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } .text-bold { - font-weight: bold; + font-weight: bold; } .text-center { - text-align: center; + text-align: center; } .text-content { - line-height: 1.6; + line-height: 1.6; } .text-left { - text-align: left; + text-align: left; } .text-right { - text-align: right; + text-align: right; } .text-red, .line-red, .lines-red { - color: #e54d42; + color: #e54d42; } .text-orange, .line-orange, .lines-orange { - color: #f37b1d; + color: #f37b1d; } .text-yellow, .line-yellow, .lines-yellow { - color: #fbbd08; + color: #fbbd08; } .text-olive, .line-olive, .lines-olive { - color: #8dc63f; + color: #8dc63f; } .text-green, .line-green, .lines-green { - color: #39b54a; + color: #39b54a; } .text-cyan, .line-cyan, .lines-cyan { - color: #1cbbb4; + color: #1cbbb4; } .text-blue, .line-blue, .lines-blue { - color: #0081ff; + color: #0081ff; } .text-purple, .line-purple, .lines-purple { - color: #6739b6; + color: #6739b6; } .text-mauve, .line-mauve, .lines-mauve { - color: #9c26b0; + color: #9c26b0; } .text-pink, .line-pink, .lines-pink { - color: #e03997; + color: #e03997; } .text-brown, .line-brown, .lines-brown { - color: #a5673f; + color: #a5673f; } .text-grey, .line-grey, .lines-grey { - color: #8799a3; + color: #8799a3; } .text-gray, .line-gray, .lines-gray { - color: #aaaaaa; + color: #aaaaaa; } .text-black, .line-black, .lines-black { - color: #333333; + color: #333333; } .text-white, .line-white, .lines-white { - color: #ffffff; + color: #ffffff; } diff --git a/src/components/e-picker/e-picker.vue b/src/components/e-picker/e-picker.vue index e1f15d31f82e7f538c729eba01c9e8c8e18f6553..b702f78313645c083b08444c586e0a227f826490 100644 --- a/src/components/e-picker/e-picker.vue +++ b/src/components/e-picker/e-picker.vue @@ -1,138 +1,139 @@ - - - + + + diff --git a/src/components/goods-list/list-A.vue b/src/components/goods-list/list-A.vue index 0f3b36e5e917ee72edcf5c4ae0ade32e67824d1d..0dcb97cb6c8ea9f2f66484d86c07fc844d7fa64e 100644 --- a/src/components/goods-list/list-A.vue +++ b/src/components/goods-list/list-A.vue @@ -1,111 +1,114 @@ diff --git a/src/components/goods-list/list-B.vue b/src/components/goods-list/list-B.vue index b7071580cffb7184517118e0f14f82e8d5736db3..97422cbb101ab76a62726124d1daff7b40582e8e 100644 --- a/src/components/goods-list/list-B.vue +++ b/src/components/goods-list/list-B.vue @@ -1,322 +1,327 @@ + diff --git a/src/components/goods-list/list-C.vue b/src/components/goods-list/list-C.vue index 26a1cf770ee37873df7d99dbca8a9e2fa54477f8..e883e899a716112a3024d3cfaf5b23c1538b2ea8 100644 --- a/src/components/goods-list/list-C.vue +++ b/src/components/goods-list/list-C.vue @@ -1,161 +1,164 @@ diff --git a/src/components/goods-list/list-D.vue b/src/components/goods-list/list-D.vue index 3a34045b52d39f6a7d129cdb30c50b0a80b4b855..31f7d427f649f0c33a6316c890540dfd6e77efaf 100644 --- a/src/components/goods-list/list-D.vue +++ b/src/components/goods-list/list-D.vue @@ -1,114 +1,116 @@ diff --git a/src/components/he-cart.vue b/src/components/he-cart.vue index af4fad62defb8940dc127f368639e92aff2aef62..bdde207765e2917a2cd751565917592ed6d28b14 100644 --- a/src/components/he-cart.vue +++ b/src/components/he-cart.vue @@ -28,25 +28,50 @@ {{ item.name }} - {{ value.value }} + value.is_select ? 'he-attr__select' : '' + ]" + :key="valueIndex" + >{{ value.value }} - + @@ -55,14 +80,28 @@ - 数量 + 数量 (限兑{{ limitTaskNum }}{{ goods.unit }}) - 数量 + 数量 ({{ minNumber }}{{ goods.unit }}起购) - - + + @@ -71,45 +110,35 @@ - + - + diff --git a/src/components/he-clear-storage.vue b/src/components/he-clear-storage.vue index aafa91d943c762a7622940f8b28a30924099621c..e1fb18a27c35b6d7962bc61c6c221a51e735d7c8 100644 --- a/src/components/he-clear-storage.vue +++ b/src/components/he-clear-storage.vue @@ -1,116 +1,122 @@ + \ No newline at end of file + diff --git a/src/components/he-empty-popup.vue b/src/components/he-empty-popup.vue index 47977b3c30652274a8634c23925825b563ea592d..fb3e645b1352a76d7b369ea32dd97b2b0f3e137e 100644 --- a/src/components/he-empty-popup.vue +++ b/src/components/he-empty-popup.vue @@ -1,101 +1,101 @@ \ No newline at end of file + diff --git a/src/components/he-html/he-html.vue b/src/components/he-html/he-html.vue index 1320d892693193b0ef3b63fde1ce766615721166..494cff804be059ec86207714802085e307fc2aef 100644 --- a/src/components/he-html/he-html.vue +++ b/src/components/he-html/he-html.vue @@ -1,11 +1,16 @@ @@ -34,13 +39,13 @@ * @event {Function} linkTap 链接被点击时触发 * @event {Function} error 媒体加载出错时触发 */ -const plugins=[] -const parser = require('./parser') +const plugins = []; +const parser = require('./parser'); // #ifndef APP-PLUS-NVUE -import node from './node/node' +import node from './node/node'; // #endif // #ifdef APP-PLUS-NVUE -const dom = weex.requireModule('dom') +const dom = weex.requireModule('dom'); // #endif export default { name: 'mp-html', @@ -50,7 +55,7 @@ export default { // #ifdef APP-PLUS-NVUE height: 0 // #endif - } + }; }, props: { // #ifdef APP-PLUS-NVUE @@ -84,7 +89,7 @@ export default { default: true }, tagStyle: Object, - useAnchor: null, + useAnchor: null }, // #ifndef APP-PLUS-NVUE components: { @@ -93,21 +98,19 @@ export default { // #endif watch: { content(content) { - this.setContent(content) + this.setContent(content); } }, created() { - this.plugins = [] - for (var i = plugins.length; i--;) - this.plugins.push(new plugins[i](this)) + this.plugins = []; + for (var i = plugins.length; i--; ) this.plugins.push(new plugins[i](this)); }, mounted() { - if (this.content && !this.nodes.length) - this.setContent(this.content); + if (this.content && !this.nodes.length) this.setContent(this.content); }, beforeDestroy() { - this._hook('onDetached') - clearInterval(this._timer) + this._hook('onDetached'); + clearInterval(this._timer); }, methods: { /** @@ -123,7 +126,7 @@ export default { page, selector, scrollTop - } + }; // #endif }, @@ -135,56 +138,56 @@ export default { */ navigateTo(id, offset) { return new Promise((resolve, reject) => { - if (!this.useAnchor) - return reject('Anchor is disabled') - offset = offset || parseInt(this.useAnchor) || 0 + if (!this.useAnchor) return reject('Anchor is disabled'); + offset = offset || parseInt(this.useAnchor) || 0; // #ifdef APP-PLUS-NVUE if (!id) { dom.scrollToElement(this.$refs.web, { offset - }) - resolve() + }); + resolve(); } else { this._navigateTo = { resolve, reject, offset - } - this.$refs.web.evalJs('uni.postMessage({data:{action:"getOffset",offset:(document.getElementById(' + id + ')||{}).offsetTop}})') + }; + this.$refs.web.evalJs( + 'uni.postMessage({data:{action:"getOffset",offset:(document.getElementById(' + id + ')||{}).offsetTop}})' + ); } // #endif // #ifndef APP-PLUS-NVUE - var deep = ' ' + var deep = ' '; // #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO - deep = '>>>' + deep = '>>>'; // #endif - var selector = uni.createSelectorQuery() + var selector = uni + .createSelectorQuery() // #ifndef MP-ALIPAY .in(this._in ? this._in.page : this) // #endif - .select((this._in ? this._in.selector : '._root') + (id ? `${deep}#${id}` : '')).boundingClientRect() - if (this._in) - selector.select(this._in.selector).scrollOffset() - .select(this._in.selector).boundingClientRect() // 获取 scroll-view 的位置和滚动距离 - else - selector.selectViewport().scrollOffset() // 获取窗口的滚动距离 + .select((this._in ? this._in.selector : '._root') + (id ? `${deep}#${id}` : '')) + .boundingClientRect(); + if (this._in) selector.select(this._in.selector).scrollOffset().select(this._in.selector).boundingClientRect(); + // 获取 scroll-view 的位置和滚动距离 + else selector.selectViewport().scrollOffset(); // 获取窗口的滚动距离 selector.exec(res => { - if (!res[0]) - return reject('Label not found') - var scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + offset + if (!res[0]) return reject('Label not found'); + var scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + offset; if (this._in) // scroll-view 跳转 - this._in.page[this._in.scrollTop] = scrollTop + this._in.page[this._in.scrollTop] = scrollTop; + // 页面跳转 else - // 页面跳转 uni.pageScrollTo({ scrollTop, duration: 300 - }) - resolve() - }) + }); + resolve(); + }); // #endif - }) + }); }, /** @@ -195,27 +198,26 @@ export default { var text = ''; (function traversal(nodes) { for (var i = 0; i < nodes.length; i++) { - var node = nodes[i] - if (node.type == 'text') - text += node.text.replace(/&/g, '&') - else if (node.name == 'br') - text += '\n' + var node = nodes[i]; + if (node.type == 'text') text += node.text.replace(/&/g, '&'); + else if (node.name == 'br') text += '\n'; else { // 块级标签前后加换行 - var isBlock = node.name == 'p' || node.name == 'div' || node.name == 'tr' || node.name == 'li' || (node.name[0] == 'h' && node.name[1] > '0' && node.name[1] < '7') - if (isBlock && text && text[text.length - 1] != '\n') - text += '\n' + var isBlock = + node.name == 'p' || + node.name == 'div' || + node.name == 'tr' || + node.name == 'li' || + (node.name[0] == 'h' && node.name[1] > '0' && node.name[1] < '7'); + if (isBlock && text && text[text.length - 1] != '\n') text += '\n'; // 递归获取子节点的文本 - if (node.children) - traversal(node.children) - if (isBlock && text[text.length - 1] != '\n') - text += '\n' - else if (node.name == 'td' || node.name == 'th') - text += '\t' + if (node.children) traversal(node.children); + if (isBlock && text[text.length - 1] != '\n') text += '\n'; + else if (node.name == 'td' || node.name == 'th') text += '\t'; } } - })(this.nodes) - return text + })(this.nodes); + return text; }, /** @@ -224,12 +226,15 @@ export default { */ getRect() { return new Promise((resolve, reject) => { - uni.createSelectorQuery() + uni + .createSelectorQuery() // #ifndef MP-ALIPAY .in(this) // #endif - .select('._root').boundingClientRect().exec(res => res[0] ? resolve(res[0]) : reject('Root label not found')) - }) + .select('._root') + .boundingClientRect() + .exec(res => (res[0] ? resolve(res[0]) : reject('Root label not found'))); + }); }, /** @@ -238,35 +243,35 @@ export default { * @param {Boolean} append 是否在尾部追加 */ setContent(content, append) { - if (!append || !this.imgList) - this.imgList = [] - var nodes = new parser(this).parse(content) + if (!append || !this.imgList) this.imgList = []; + var nodes = new parser(this).parse(content); // #ifdef APP-PLUS-NVUE - if (this._ready) - this._set(nodes, append) + if (this._ready) this._set(nodes, append); // #endif - this.$set(this, 'nodes', append ? (this.nodes || []).concat(nodes) : nodes) + this.$set(this, 'nodes', append ? (this.nodes || []).concat(nodes) : nodes); // #ifndef APP-PLUS-NVUE - this._videos = [] + this._videos = []; this.$nextTick(() => { - this._hook('onLoad') - this.$emit('load') - }) + this._hook('onLoad'); + this.$emit('load'); + }); // 等待图片加载完毕 - var height - clearInterval(this._timer) + var height; + clearInterval(this._timer); this._timer = setInterval(() => { - this.getRect().then(rect => { - // 350ms 总高度无变化就触发 ready 事件 - if (rect.height == height) { - this.$emit('ready', rect) - clearInterval(this._timer) - } - height = rect.height - }).catch(() => { }) - }, 350) + this.getRect() + .then(rect => { + // 350ms 总高度无变化就触发 ready 事件 + if (rect.height == height) { + this.$emit('ready', rect); + clearInterval(this._timer); + } + height = rect.height; + }) + .catch(() => {}); + }, 350); // #endif }, @@ -274,9 +279,7 @@ export default { * @description 调用插件钩子函数 */ _hook(name) { - for (var i = plugins.length; i--;) - if (this.plugins[i][name]) - this.plugins[i][name]() + for (var i = plugins.length; i--; ) if (this.plugins[i][name]) this.plugins[i][name](); }, // #ifdef APP-PLUS-NVUE @@ -284,99 +287,112 @@ export default { * @description 设置内容 */ _set(nodes, append) { - this.$refs.web.evalJs('setContent(' + JSON.stringify(nodes) + ',' + JSON.stringify([this.bgColor, this.errorImg, this.loadingImg, this.pauseVideo, this.scrollTable, this.selectable]) + ',' + append + ')') + this.$refs.web.evalJs( + 'setContent(' + + JSON.stringify(nodes) + + ',' + + JSON.stringify([ + this.bgColor, + this.errorImg, + this.loadingImg, + this.pauseVideo, + this.scrollTable, + this.selectable + ]) + + ',' + + append + + ')' + ); }, /** * @description 接收到 web-view 消息 */ _onMessage(e) { - var message = e.detail.data[0] + var message = e.detail.data[0]; switch (message.action) { // web-view 初始化完毕 case 'onJSBridgeReady': - this._ready = true - if (this.nodes) - this._set(this.nodes) - break + this._ready = true; + if (this.nodes) this._set(this.nodes); + break; // 内容 dom 加载完毕 case 'onLoad': - this.height = message.height - this._hook('onLoad') - this.$emit('load') - break + this.height = message.height; + this._hook('onLoad'); + this.$emit('load'); + break; // 所有图片加载完毕 case 'onReady': - this.getRect().then(res => { - this.$emit('ready', res) - }).catch(() => { }) - break + this.getRect() + .then(res => { + this.$emit('ready', res); + }) + .catch(() => {}); + break; // 总高度发生变化 case 'onHeightChange': - this.height = message.height - break + this.height = message.height; + break; // 图片点击 case 'onImgTap': - this.$emit('imgtap', message.attrs) + this.$emit('imgtap', message.attrs); if (this.previewImg) uni.previewImage({ current: parseInt(message.attrs.i), urls: this.imgList - }) - break + }); + break; // 链接点击 case 'onLinkTap': - var href = message.attrs.href - this.$emit('linktap', message.attrs) + var href = message.attrs.href; + this.$emit('linktap', message.attrs); if (href) { // 锚点跳转 if (href[0] == '#') { if (this.useAnchor) dom.scrollToElement(this.$refs.web, { offset: message.offset - }) + }); } // 打开外链 else if (href.includes('://')) { - if (this.copyLink) - plus.runtime.openWeb(href) - } - else + if (this.copyLink) plus.runtime.openWeb(href); + } else uni.navigateTo({ url: href, fail() { wx.switchTab({ url: href - }) + }); } - }) + }); } - break + break; // 获取到锚点的偏移量 case 'getOffset': if (typeof message.offset == 'number') { dom.scrollToElement(this.$refs.web, { offset: message.offset + this._navigateTo.offset - }) - this._navigateTo.resolve() - } else - this._navigateTo.reject('Label not found') - break + }); + this._navigateTo.resolve(); + } else this._navigateTo.reject('Label not found'); + break; // 点击 case 'onClick': - this.$emit('tap') - break + this.$emit('tap'); + break; // 出错 case 'onError': this.$emit('error', { source: message.source, attrs: message.attrs - }) + }); } } // #endif } -} +}; diff --git a/src/components/he-image.vue b/src/components/he-image.vue index d225cabe8eabf4ef5b9479d3c0c5808a47b5d2da..6dec93183575805b2a376006a662bfe3ce1a25f4 100644 --- a/src/components/he-image.vue +++ b/src/components/he-image.vue @@ -1,128 +1,138 @@ diff --git a/src/components/he-index-cart.vue b/src/components/he-index-cart.vue index 51989558e1d5e059a3f4f86a07c653859ceaea44..63abee5d769f3e288047ed61bd068e2f3b01aabe 100644 --- a/src/components/he-index-cart.vue +++ b/src/components/he-index-cart.vue @@ -1,57 +1,57 @@ \ No newline at end of file + } +}; + diff --git a/src/components/he-line.vue b/src/components/he-line.vue index 82514a16411543aecde99844fe82f9048a69c8eb..438da57b2f061dc09e6611548ddd4829f952b0db 100644 --- a/src/components/he-line.vue +++ b/src/components/he-line.vue @@ -1,70 +1,68 @@ diff --git a/src/components/he-load-more.vue b/src/components/he-load-more.vue index 6e48b28570c46b614a6b50e349aea9fbb22fb862..e482280b47b020105eb7d89988e378c3fcf043ca 100644 --- a/src/components/he-load-more.vue +++ b/src/components/he-load-more.vue @@ -1,200 +1,204 @@ diff --git a/src/components/he-loading.vue b/src/components/he-loading.vue index 6c3392c8cb862c2f818ea6eb9ec755465763ae96..9b80cf0bfe186c69275f0da74829d5bc43745760 100644 --- a/src/components/he-loading.vue +++ b/src/components/he-loading.vue @@ -1,93 +1,98 @@ diff --git a/src/components/he-login-layout.vue b/src/components/he-login-layout.vue new file mode 100644 index 0000000000000000000000000000000000000000..a0b8ad6d7d3ed33b07cbe5fd07fa785d0f73c790 --- /dev/null +++ b/src/components/he-login-layout.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/components/he-mask.vue b/src/components/he-mask.vue index 7116cdfe985fea4736d6ee6ad0dfe2ec9d1b4ea8..d0f6646aa7ce89aa0df649d23d2b536542390f46 100644 --- a/src/components/he-mask.vue +++ b/src/components/he-mask.vue @@ -1,10 +1,17 @@ diff --git a/src/components/he-navbar.vue b/src/components/he-navbar.vue index 389496560212b8540af4f08ada3976ecff1ce812..d2b7b87f7d0916870506042e341189d48f855d3e 100644 --- a/src/components/he-navbar.vue +++ b/src/components/he-navbar.vue @@ -1,34 +1,39 @@ diff --git a/src/components/he-no-content-yet.vue b/src/components/he-no-content-yet.vue index 6dd15e320850533f3f39da06adbf21fdfdb17aad..73f56a400aac1be48f2fd0b834599f120a9c4c9a 100644 --- a/src/components/he-no-content-yet.vue +++ b/src/components/he-no-content-yet.vue @@ -1,62 +1,63 @@ + \ No newline at end of file + diff --git a/src/components/he-number-box.vue b/src/components/he-number-box.vue index bd5a91470a4b0cea78fcc00f32cbb2599c3cc60e..649e028d7561259a8ba5b5463d853fd0db1338f9 100644 --- a/src/components/he-number-box.vue +++ b/src/components/he-number-box.vue @@ -1,309 +1,328 @@ - diff --git a/src/components/he-open-launch-weapp.vue b/src/components/he-open-launch-weapp.vue new file mode 100644 index 0000000000000000000000000000000000000000..9e396602d49deb42cb42242d2f2f1e0531b07a01 --- /dev/null +++ b/src/components/he-open-launch-weapp.vue @@ -0,0 +1,75 @@ + + + + diff --git a/src/components/he-open-subscribe.vue b/src/components/he-open-subscribe.vue index 24e6a5144007c81478a96809856147e77c115c6e..8b5c43e61601f627a899ce67d5d35041638ccafd 100644 --- a/src/components/he-open-subscribe.vue +++ b/src/components/he-open-subscribe.vue @@ -1,76 +1,77 @@ + + diff --git a/src/components/he-popup.vue b/src/components/he-popup.vue index 69d26a82f553103db1bc864829b9b8be97930246..00c3eb32792cc2f879719dc953f52988f4a6e626 100644 --- a/src/components/he-popup.vue +++ b/src/components/he-popup.vue @@ -1,48 +1,69 @@ diff --git a/src/components/he-poster.vue b/src/components/he-poster.vue index 89c5a32de1403a0846650869b3ea2712bd8aedbe..7818a133d4c351c10711f8b50556af509a462fff 100644 --- a/src/components/he-poster.vue +++ b/src/components/he-poster.vue @@ -1,211 +1,214 @@ + \ No newline at end of file + diff --git a/src/components/he-products-featured.vue b/src/components/he-products-featured.vue index 2ecb995492758854ef4a6768ad954761ed96aa2d..29cb53e5d40dacfd0b9518e76b0f324c95041cab 100644 --- a/src/components/he-products-featured.vue +++ b/src/components/he-products-featured.vue @@ -1,95 +1,99 @@ + + \ No newline at end of file + diff --git a/src/components/he-radio.vue b/src/components/he-radio.vue index ceda072f3313b676a62bae07f22cc7be42469300..4bfde8fd3aa3733c867a3cbbd122c13cd55a5bff 100644 --- a/src/components/he-radio.vue +++ b/src/components/he-radio.vue @@ -1,52 +1,52 @@ \ No newline at end of file + diff --git a/src/components/he-select-address.vue b/src/components/he-select-address.vue index 9b0ed2c1f29db9895e6800172577969291b50d49..54fab50c12a48f02e95c5edc9b84481be63fca15 100644 --- a/src/components/he-select-address.vue +++ b/src/components/he-select-address.vue @@ -1,217 +1,274 @@ + + \ No newline at end of file + diff --git a/src/components/he-share.vue b/src/components/he-share.vue index d6f06ce833f66e7242fccca665cf8c9c64469ac6..2f9f3c711d4bb48a4a60c0c9f6cbb39378a515ec 100644 --- a/src/components/he-share.vue +++ b/src/components/he-share.vue @@ -1,212 +1,208 @@ \ No newline at end of file + diff --git a/src/components/he-specs/he-specs.vue b/src/components/he-specs/he-specs.vue index ec96003ff23a4bd9a190e46957fba37eb52cd2e4..1ab9497e5f4b2ee10fe455e8a5e6b338f4d2121e 100644 --- a/src/components/he-specs/he-specs.vue +++ b/src/components/he-specs/he-specs.vue @@ -1,18 +1,20 @@ + + \ No newline at end of file + diff --git a/src/components/he-swipe-action.vue b/src/components/he-swipe-action.vue index 301f88819230331144abfb6b5f3158519473924c..4715bae5158834f6ab7fb84ed208867703d96449 100644 --- a/src/components/he-swipe-action.vue +++ b/src/components/he-swipe-action.vue @@ -1,37 +1,40 @@ diff --git a/src/components/he-switch.vue b/src/components/he-switch.vue index 6ee51ad99125cf7224780777fe16168a3b2a70af..a1309c27482193da93180bdd45a79a1b37c31e8d 100644 --- a/src/components/he-switch.vue +++ b/src/components/he-switch.vue @@ -1,95 +1,99 @@ diff --git a/src/components/he-tell.vue b/src/components/he-tell.vue index 25dec1399787914e1159a32072781465271bf45f..187011451a9bf6428e88a204ff95df2ef2f19200 100644 --- a/src/components/he-tell.vue +++ b/src/components/he-tell.vue @@ -15,16 +15,16 @@ @@ -85,7 +85,7 @@ export default { color: #666666; } .cu-btn.fr { - @include font_color("font_color"); + @include font_color('font_color'); } .he-line { height: 89px; @@ -96,4 +96,4 @@ export default { left: 50%; transform: translateX(-50%); } - \ No newline at end of file + diff --git a/src/components/he-toast.vue b/src/components/he-toast.vue index a45731dd2ba2154b60d4e57a7a402a7f92a38f81..90d53bd2699b84d9b983e8915812e4da0c34cf79 100644 --- a/src/components/he-toast.vue +++ b/src/components/he-toast.vue @@ -1,130 +1,130 @@ \ No newline at end of file + diff --git a/src/components/he-upload-image.vue b/src/components/he-upload-image.vue index 17b278f72280024c97e87345b5adc9b76ebc99ae..08267d1a31f5a467bfc943472f440daa08930773 100644 --- a/src/components/he-upload-image.vue +++ b/src/components/he-upload-image.vue @@ -1,10 +1,7 @@ diff --git a/src/components/pointer.less b/src/components/pointer.less index 40a64579cccfd46a13394ec20cb7dbf1211ea64a..d35b43c4d439877f2ec48b2aa1134c6b49d292ee 100644 --- a/src/components/pointer.less +++ b/src/components/pointer.less @@ -1,63 +1,58 @@ .pointer { - position: absolute; - bottom: 0; - display: -webkit-box; - display: -webkit-flex; - display: flex; + position: absolute; + bottom: 0; + display: -webkit-box; + display: -webkit-flex; + display: flex; + width: 100%; + + .circle .pointer-item { + display: inline-block; + width: 12px; + height: 12px; + background-color: rgba(0, 0, 0, 0.3); + border-radius: 100%; + } + + .strip .pointer-item { + display: inline-block; + width: 24px; + height: 4px; + background-color: #c5c5c5; + } + + .pointer-item + .pointer-item { + margin-left: 12px; + } + + .pointer-content { + margin: 0 40px; width: 100%; + box-sizing: border-box; + text-align: right; - - - .circle .pointer-item { - display: inline-block; - width: 12px; - height: 12px; - background-color: rgba(0, 0, 0, .3); - border-radius: 100%; - } - - .strip .pointer-item { - display: inline-block; - width: 24px; - height: 4px; - background-color: #c5c5c5; - } - - - .pointer-item+.pointer-item { - margin-left: 12px; + /deep/ .active { + background-color: #f44; + opacity: 1; } + } - - .pointer-content { - margin: 0 40px; - width: 100%; - box-sizing: border-box; - text-align: right; - - /deep/ .active { - background-color: #f44; - opacity: 1; - } - } - - .pointer-text { - margin: 0 40px; - width: 100%; - text-align: center; - - span { - display: inline-block; - min-width: 32px; - height: 32px; - padding: 0 10px; - color: #fff; - font-size: 24px; - line-height: 32px; - background: #000; - border-radius: 16px; - opacity: .3; - } + .pointer-text { + margin: 0 40px; + width: 100%; + text-align: center; + + span { + display: inline-block; + min-width: 32px; + height: 32px; + padding: 0 10px; + color: #fff; + font-size: 24px; + line-height: 32px; + background: #000; + border-radius: 16px; + opacity: 0.3; } - -} \ No newline at end of file + } +} diff --git a/src/components/pointer.vue b/src/components/pointer.vue index 35d9fabe7f21129d86d1d5cf09c305a401bc3406..15713cb3883ba7f2c8ca472422194d30e93f1268 100644 --- a/src/components/pointer.vue +++ b/src/components/pointer.vue @@ -1,60 +1,60 @@ + + \ No newline at end of file + diff --git a/src/components/u-index-list.vue b/src/components/u-index-list.vue index 462418a34644143a2825eca997b43e5d7da3b1e0..347d3b3d7cfe09f2d699c1c7746c9d29a4799e55 100644 --- a/src/components/u-index-list.vue +++ b/src/components/u-index-list.vue @@ -1,323 +1,319 @@ diff --git a/src/components/user-newuser-coupon.vue b/src/components/user-newuser-coupon.vue index aab085e21295a868da7e0192255c429218780c56..d855251ec1a074273919c957c635591dd8fa0511 100644 --- a/src/components/user-newuser-coupon.vue +++ b/src/components/user-newuser-coupon.vue @@ -5,35 +5,19 @@ * @LastEditTime: 2021-06-05 17:02:18 * @LastEditors: fjt --> - diff --git a/src/pages/categories/component/index-b.vue b/src/pages/categories/component/index-b.vue index 12bcc4a86b85fdc0068b2809612dd638f391cadd..c610a5f505c4eeb4d79cd34a0ed36dceccb82e14 100644 --- a/src/pages/categories/component/index-b.vue +++ b/src/pages/categories/component/index-b.vue @@ -52,7 +52,7 @@ export default { diff --git a/src/pages/fitment/advertising/advertising.vue b/src/pages/fitment/advertising/advertising.vue index 010047b695024b8c44af2cd55ffa43ee07fcbe63..511bf1532a0335aa55ae6dfb0bfd1be04df6cf58 100644 --- a/src/pages/fitment/advertising/advertising.vue +++ b/src/pages/fitment/advertising/advertising.vue @@ -1,270 +1,281 @@ + \ No newline at end of file + diff --git a/src/pages/fitment/banner/banner.vue b/src/pages/fitment/banner/banner.vue index 7f9f35de73c5fce59c9d78819be2106e4a668080..d9cf85fdd11f1e52631522a4b0179b3f5a94c5ad 100644 --- a/src/pages/fitment/banner/banner.vue +++ b/src/pages/fitment/banner/banner.vue @@ -1,93 +1,139 @@ + \ No newline at end of file + diff --git a/src/pages/fitment/banner/element.less b/src/pages/fitment/banner/element.less index f0afb8f994c3c8b0749e1a8bc4cb4722ce76170f..c4693bd4c128b4ce458819e4c37978d11f60ffd2 100644 --- a/src/pages/fitment/banner/element.less +++ b/src/pages/fitment/banner/element.less @@ -1,31 +1,29 @@ .banner { - box-sizing: content-box; + box-sizing: content-box; - .corner { - padding: 32px; + .corner { + padding: 32px; - .banner-item-cover { - box-sizing: content-box; - -webkit-appearance: none; - -webkit-border-radius: 16px; - -ms-border-radius: 16px; - -o-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; - overflow: hidden; - } + .banner-item-cover { + box-sizing: content-box; + -webkit-appearance: none; + -webkit-border-radius: 16px; + -ms-border-radius: 16px; + -o-border-radius: 16px; + -moz-border-radius: 16px; + border-radius: 16px; + overflow: hidden; } + } - .banner-item-image { - width: 100%; - height: 100%; - } + .banner-item-image { + width: 100%; + height: 100%; + } - .banner-item-photo { - position: relative; - width: 100%; - height: 100%; - box-sizing: content-box; - } - -} \ No newline at end of file + .banner-item-photo { + position: relative; + width: 750px; + box-sizing: content-box; + } +} diff --git a/src/pages/fitment/blank/blank.vue b/src/pages/fitment/blank/blank.vue index 9ae0d11b507196a553db91f0a663d8a41c80ada0..12e10488a3859e1c32e7ee0fe7ab00e7b2d3da1a 100644 --- a/src/pages/fitment/blank/blank.vue +++ b/src/pages/fitment/blank/blank.vue @@ -1,16 +1,16 @@ \ No newline at end of file + diff --git a/src/pages/fitment/common/covermask.vue b/src/pages/fitment/common/covermask.vue index 5bcb22c34e71f80160aafebb263d5fcdc439f53e..072bab99d3bfdb8a1a1dc113c00f5cbce1f90276 100644 --- a/src/pages/fitment/common/covermask.vue +++ b/src/pages/fitment/common/covermask.vue @@ -1,56 +1,57 @@ + + \ No newline at end of file + diff --git a/src/pages/fitment/common/index.vue b/src/pages/fitment/common/index.vue index d258c6cdf5b6640883faa3ffa93660f48b891c14..831368fc2e548e96d5a4782d6f02cbd55073e728 100644 --- a/src/pages/fitment/common/index.vue +++ b/src/pages/fitment/common/index.vue @@ -1,156 +1,208 @@ + + diff --git a/src/pages/fitment/common/vuedraggable-helper.js b/src/pages/fitment/common/vuedraggable-helper.js index e41406886b80dc82da5bee69b49a53888bfa4d09..11d2ad20020c43bfcbebc8a8710d3d8945e583d5 100644 --- a/src/pages/fitment/common/vuedraggable-helper.js +++ b/src/pages/fitment/common/vuedraggable-helper.js @@ -1,37 +1,33 @@ +const regex = /-(\w)/g; + function getConsole() { - if (typeof window !== "undefined") { - return window.console; - } - return global.console; + if (typeof window !== 'undefined') { + return window.console; + } + return global.console; } const console = getConsole(); function cached(fn) { - const cache = Object.create(null); - return function cachedFn(str) { - const hit = cache[str]; - return hit || (cache[str] = fn(str)); - }; + const cache = Object.create(null); + return function cachedFn(str) { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; } -const regex = /-(\w)/g; -const camelize = cached(str => - str.replace(regex, (_, c) => (c ? c.toUpperCase() : "")) -); +const camelize = cached(str => str.replace(regex, (_, c) => (c ? c.toUpperCase() : ''))); function removeNode(node) { - if (node.parentElement !== null) { - node.parentElement.removeChild(node); - } + if (node.parentElement !== null) { + node.parentElement.removeChild(node); + } } function insertNodeAt(fatherNode, node, position) { - const refNode = - position === 0 - ? fatherNode.children[0] - : fatherNode.children[position - 1].nextSibling; - fatherNode.insertBefore(node, refNode); + const refNode = position === 0 ? fatherNode.children[0] : fatherNode.children[position - 1].nextSibling; + fatherNode.insertBefore(node, refNode); } -export {insertNodeAt, camelize, console, removeNode}; +export { insertNodeAt, camelize, console, removeNode }; diff --git a/src/pages/fitment/common/vuedraggable.js b/src/pages/fitment/common/vuedraggable.js index 98c17ee78672eeb5fbd1e02838e396576c9aacb5..f479c80b0c6a3fce8dbdf622a6c3e297632f1c10 100644 --- a/src/pages/fitment/common/vuedraggable.js +++ b/src/pages/fitment/common/vuedraggable.js @@ -1,485 +1,462 @@ -import Sortable from "sortablejs"; -import {insertNodeAt, camelize, console, removeNode} from "./vuedraggable-helper"; +import Sortable from 'sortablejs'; +import { insertNodeAt, camelize, console, removeNode } from './vuedraggable-helper'; function buildAttribute(object, propName, value) { - if (value === undefined) { - return object; - } - object = object || {}; - object[propName] = value; + if (value === undefined) { return object; + } + object = object || {}; + object[propName] = value; + return object; } function computeVmIndex(vnodes, element) { - return vnodes.map(elt => elt.elm).indexOf(element); + return vnodes.map(elt => elt.elm).indexOf(element); } function computeIndexes(slots, children, isTransition, footerOffset) { - if (!slots) { - return []; - } - - const elmFromNodes = slots.map(elt => elt.elm); - const footerIndex = children.length - footerOffset; - const rawIndexes = [...children].map((elt, idx) => - idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt) - ); - return isTransition ? rawIndexes.filter(ind => ind !== -1) : rawIndexes; + if (!slots) { + return []; + } + + const elmFromNodes = slots.map(elt => elt.elm); + const footerIndex = children.length - footerOffset; + const rawIndexes = [...children].map((elt, idx) => + idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt) + ); + return isTransition ? rawIndexes.filter(ind => ind !== -1) : rawIndexes; } function emit(evtName, evtData) { - this.$nextTick(() => this.$emit(evtName.toLowerCase(), {...evtData})); + this.$nextTick(() => this.$emit(evtName.toLowerCase(), { ...evtData })); } function delegateAndEmit(evtName) { - return evtData => { - if (this.realList !== null) { - this["onDrag" + evtName](evtData); - } - emit.call(this, evtName, evtData); - }; + return evtData => { + if (this.realList !== null) { + this['onDrag' + evtName](evtData); + } + emit.call(this, evtName, evtData); + }; } function isTransitionName(name) { - return ["transition-group", "TransitionGroup"].includes(name); + return ['transition-group', 'TransitionGroup'].includes(name); } function isTransition(slots) { - if (!slots || slots.length !== 1) { - return false; - } - const [{componentOptions}] = slots; - if (!componentOptions) { - return false; - } - return isTransitionName(componentOptions.tag); + if (!slots || slots.length !== 1) { + return false; + } + const [{ componentOptions }] = slots; + if (!componentOptions) { + return false; + } + return isTransitionName(componentOptions.tag); } function getSlot(slot, scopedSlot, key) { - return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined); + return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined); } function computeChildrenAndOffsets(children, slot, scopedSlot) { - let headerOffset = 0; - let footerOffset = 0; - const header = getSlot(slot, scopedSlot, "header"); - if (header) { - headerOffset = header.length; - children = children ? [...header, ...children] : [...header]; - } - const footer = getSlot(slot, scopedSlot, "footer"); - if (footer) { - footerOffset = footer.length; - children = children ? [...children, ...footer] : [...footer]; - } - return {children, headerOffset, footerOffset}; + let headerOffset = 0; + let footerOffset = 0; + const header = getSlot(slot, scopedSlot, 'header'); + if (header) { + headerOffset = header.length; + children = children ? [...header, ...children] : [...header]; + } + const footer = getSlot(slot, scopedSlot, 'footer'); + if (footer) { + footerOffset = footer.length; + children = children ? [...children, ...footer] : [...footer]; + } + return { children, headerOffset, footerOffset }; } function getComponentAttributes($attrs, componentData) { - let attributes = null; - const update = (name, value) => { - attributes = buildAttribute(attributes, name, value); - }; - const attrs = Object.keys($attrs) - .filter(key => key === "id" || key.startsWith("data-")) - .reduce((res, key) => { - res[key] = $attrs[key]; - return res; - }, {}); - update("attrs", attrs); - - if (!componentData) { - return attributes; - } - const {on, props, attrs: componentDataAttrs} = componentData; - update("on", on); - update("props", props); - Object.assign(attributes.attrs, componentDataAttrs); + let attributes = null; + const update = (name, value) => { + attributes = buildAttribute(attributes, name, value); + }; + const attrs = Object.keys($attrs) + .filter(key => key === 'id' || key.startsWith('data-')) + .reduce((res, key) => { + res[key] = $attrs[key]; + return res; + }, {}); + update('attrs', attrs); + + if (!componentData) { return attributes; + } + const { on, props, attrs: componentDataAttrs } = componentData; + update('on', on); + update('props', props); + Object.assign(attributes.attrs, componentDataAttrs); + return attributes; } -const eventsListened = ["Start", "Add", "Remove", "Update", "End"]; -const eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"]; -const readonlyProperties = ["Move", ...eventsListened, ...eventsToEmit].map( - evt => "on" + evt -); +const eventsListened = ['Start', 'Add', 'Remove', 'Update', 'End']; +const eventsToEmit = ['Choose', 'Unchoose', 'Sort', 'Filter', 'Clone']; +const readonlyProperties = ['Move', ...eventsListened, ...eventsToEmit].map(evt => 'on' + evt); var draggingElement = null; const props = { - options: Object, - list: { - type: Array, - required: false, - default: null + options: Object, + list: { + type: Array, + required: false, + default: null + }, + value: { + type: Array, + required: false, + default: null + }, + noTransitionOnDrag: { + type: Boolean, + default: false + }, + clone: { + type: Function, + default: original => { + return original; + } + }, + element: { + type: String, + default: 'div' + }, + tag: { + type: String, + default: null + }, + move: { + type: Function, + default: null + }, + componentData: { + type: Object, + required: false, + default: null + } +}; + +const draggableComponent = { + name: 'draggable', + + inheritAttrs: false, + + props, + + data() { + return { + transitionMode: false, + noneFunctionalComponentMode: false + }; + }, + + render(h) { + const slots = this.$slots.default; + this.transitionMode = isTransition(slots); + const { children, headerOffset, footerOffset } = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots); + this.headerOffset = headerOffset; + this.footerOffset = footerOffset; + const attributes = getComponentAttributes(this.$attrs, this.componentData); + return h(this.getTag(), attributes, children); + }, + + created() { + if (this.list !== null && this.value !== null) { + console.error('Value and list props are mutually exclusive! Please set one or another.'); + } + + if (this.element !== 'div') { + console.warn( + 'Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props' + ); + } + + if (this.options !== undefined) { + console.warn( + 'Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props' + ); + } + }, + + mounted() { + this.noneFunctionalComponentMode = + this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional(); + if (this.noneFunctionalComponentMode && this.transitionMode) { + throw new Error( + `Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}` + ); + } + var optionsAdded = {}; + eventsListened.forEach(elt => { + optionsAdded['on' + elt] = delegateAndEmit.call(this, elt); + }); + + eventsToEmit.forEach(elt => { + optionsAdded['on' + elt] = emit.bind(this, elt); + }); + + const attributes = Object.keys(this.$attrs).reduce((res, key) => { + res[camelize(key)] = this.$attrs[key]; + return res; + }, {}); + + const options = Object.assign({}, this.options, attributes, optionsAdded, { + onMove: (evt, originalEvent) => { + return this.onDragMove(evt, originalEvent); + } + }); + !('draggable' in options) && (options.draggable = '>*'); + this._sortable = new Sortable(this.rootContainer, options); + this.computeIndexes(); + }, + + beforeDestroy() { + if (this._sortable !== undefined) this._sortable.destroy(); + }, + + computed: { + rootContainer() { + return this.transitionMode ? this.$el.children[0] : this.$el; }, - value: { - type: Array, - required: false, - default: null + + realList() { + return this.list ? this.list : this.value; + } + }, + + watch: { + options: { + handler(newOptionValue) { + this.updateOptions(newOptionValue); + }, + deep: true }, - noTransitionOnDrag: { - type: Boolean, - default: false + + $attrs: { + handler(newOptionValue) { + this.updateOptions(newOptionValue); + }, + deep: true }, - clone: { - type: Function, - default: original => { - return original; + + realList() { + this.computeIndexes(); + } + }, + + methods: { + getIsFunctional() { + const { fnOptions } = this._vnode; + return fnOptions && fnOptions.functional; + }, + + getTag() { + return this.tag || this.element; + }, + + updateOptions(newOptionValue) { + for (var property in newOptionValue) { + const value = camelize(property); + if (readonlyProperties.indexOf(value) === -1) { + this._sortable.option(value, newOptionValue[property]); } + } }, - element: { - type: String, - default: "div" + + getChildrenNodes() { + if (this.noneFunctionalComponentMode) { + return this.$children[0].$slots.default; + } + const rawNodes = this.$slots.default; + return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes; }, - tag: { - type: String, - default: null + + computeIndexes() { + this.$nextTick(() => { + this.visibleIndexes = computeIndexes( + this.getChildrenNodes(), + this.rootContainer.children, + this.transitionMode, + this.footerOffset + ); + }); }, - move: { - type: Function, - default: null + + getUnderlyingVm(htmlElt) { + const index = computeVmIndex(this.getChildrenNodes() || [], htmlElt); + if (index === -1) { + //Edge case during move callback: related element might be + //an element different from collection + return null; + } + const element = this.realList[index]; + return { index, element }; }, - componentData: { - type: Object, - required: false, - default: null - } -}; -const draggableComponent = { - name: "draggable", + getUnderlyingPotencialDraggableComponent({ __vue__: vue }) { + if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) { + if (!('realList' in vue) && vue.$children.length === 1 && 'realList' in vue.$children[0]) + return vue.$children[0]; - inheritAttrs: false, + return vue; + } + return vue.$parent; + }, - props, + emitChanges(evt) { + this.$nextTick(() => { + this.$emit('change', evt); + }); + }, - data() { - return { - transitionMode: false, - noneFunctionalComponentMode: false - }; + alterList(onList) { + if (this.list) { + onList(this.list); + return; + } + const newList = [...this.value]; + onList(newList); + this.$emit('input', newList); }, - render(h) { - const slots = this.$slots.default; - this.transitionMode = isTransition(slots); - const {children, headerOffset, footerOffset} = computeChildrenAndOffsets( - slots, - this.$slots, - this.$scopedSlots - ); - this.headerOffset = headerOffset; - this.footerOffset = footerOffset; - const attributes = getComponentAttributes(this.$attrs, this.componentData); - return h(this.getTag(), attributes, children); + spliceList() { + const spliceList = list => list.splice(...arguments); + this.alterList(spliceList); }, - created() { - if (this.list !== null && this.value !== null) { - console.error( - "Value and list props are mutually exclusive! Please set one or another." - ); - } + updatePosition(oldIndex, newIndex) { + const updatePosition = list => list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]); + this.alterList(updatePosition); + }, - if (this.element !== "div") { - console.warn( - "Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props" - ); + getRelatedContextFromMoveEvent({ to, related }) { + const component = this.getUnderlyingPotencialDraggableComponent(to); + if (!component) { + return { component }; + } + const list = component.realList; + const context = { list, component }; + if (to !== related && list && component.getUnderlyingVm) { + const destination = component.getUnderlyingVm(related); + if (destination) { + return Object.assign(destination, context); } + } + return context; + }, - if (this.options !== undefined) { - console.warn( - "Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props" - ); - } + getVmIndex(domIndex) { + const indexes = this.visibleIndexes; + const numberIndexes = indexes.length; + return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex]; }, - mounted() { - this.noneFunctionalComponentMode = - this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && - !this.getIsFunctional(); - if (this.noneFunctionalComponentMode && this.transitionMode) { - throw new Error( - `Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}` - ); - } - var optionsAdded = {}; - eventsListened.forEach(elt => { - optionsAdded["on" + elt] = delegateAndEmit.call(this, elt); - }); - - eventsToEmit.forEach(elt => { - optionsAdded["on" + elt] = emit.bind(this, elt); - }); - - const attributes = Object.keys(this.$attrs).reduce((res, key) => { - res[camelize(key)] = this.$attrs[key]; - return res; - }, {}); - - const options = Object.assign({}, this.options, attributes, optionsAdded, { - onMove: (evt, originalEvent) => { - return this.onDragMove(evt, originalEvent); - } - }); - !("draggable" in options) && (options.draggable = ">*"); - this._sortable = new Sortable(this.rootContainer, options); - this.computeIndexes(); + getComponent() { + return this.$slots.default[0].componentInstance; }, - beforeDestroy() { - if (this._sortable !== undefined) this._sortable.destroy(); + resetTransitionData(index) { + if (!this.noTransitionOnDrag || !this.transitionMode) { + return; + } + var nodes = this.getChildrenNodes(); + nodes[index].data = null; + const transitionContainer = this.getComponent(); + transitionContainer.children = []; + transitionContainer.kept = undefined; }, - computed: { - rootContainer() { - return this.transitionMode ? this.$el.children[0] : this.$el; - }, + onDragStart(evt) { + this.context = this.getUnderlyingVm(evt.item); + evt.item._underlying_vm_ = this.clone(this.context.element); + draggingElement = evt.item; + }, - realList() { - return this.list ? this.list : this.value; - } + onDragAdd(evt) { + const element = evt.item._underlying_vm_; + if (element === undefined) { + return; + } + removeNode(evt.item); + const newIndex = this.getVmIndex(evt.newIndex); + this.spliceList(newIndex, 0, element); + this.computeIndexes(); + const added = { element, newIndex }; + this.emitChanges({ added }); }, - watch: { - options: { - handler(newOptionValue) { - this.updateOptions(newOptionValue); - }, - deep: true - }, - - $attrs: { - handler(newOptionValue) { - this.updateOptions(newOptionValue); - }, - deep: true - }, - - realList() { - this.computeIndexes(); - } + onDragRemove(evt) { + insertNodeAt(this.rootContainer, evt.item, evt.oldIndex); + if (evt.pullMode === 'clone') { + removeNode(evt.clone); + return; + } + const oldIndex = this.context.index; + this.spliceList(oldIndex, 1); + const removed = { element: this.context.element, oldIndex }; + this.resetTransitionData(oldIndex); + this.emitChanges({ removed }); }, - methods: { - getIsFunctional() { - const {fnOptions} = this._vnode; - return fnOptions && fnOptions.functional; - }, - - getTag() { - return this.tag || this.element; - }, - - updateOptions(newOptionValue) { - for (var property in newOptionValue) { - const value = camelize(property); - if (readonlyProperties.indexOf(value) === -1) { - this._sortable.option(value, newOptionValue[property]); - } - } - }, - - getChildrenNodes() { - if (this.noneFunctionalComponentMode) { - return this.$children[0].$slots.default; - } - const rawNodes = this.$slots.default; - return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes; - }, - - computeIndexes() { - this.$nextTick(() => { - this.visibleIndexes = computeIndexes( - this.getChildrenNodes(), - this.rootContainer.children, - this.transitionMode, - this.footerOffset - ); - }); - }, - - getUnderlyingVm(htmlElt) { - const index = computeVmIndex(this.getChildrenNodes() || [], htmlElt); - if (index === -1) { - //Edge case during move callback: related element might be - //an element different from collection - return null; - } - const element = this.realList[index]; - return {index, element}; - }, - - getUnderlyingPotencialDraggableComponent({__vue__: vue}) { - if ( - !vue || - !vue.$options || - !isTransitionName(vue.$options._componentTag) - ) { - if ( - !("realList" in vue) && - vue.$children.length === 1 && - "realList" in vue.$children[0] - ) - return vue.$children[0]; - - return vue; - } - return vue.$parent; - }, - - emitChanges(evt) { - this.$nextTick(() => { - this.$emit("change", evt); - }); - }, - - alterList(onList) { - if (this.list) { - onList(this.list); - return; - } - const newList = [...this.value]; - onList(newList); - this.$emit("input", newList); - }, - - spliceList() { - const spliceList = list => list.splice(...arguments); - this.alterList(spliceList); - }, - - updatePosition(oldIndex, newIndex) { - const updatePosition = list => - list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]); - this.alterList(updatePosition); - }, - - getRelatedContextFromMoveEvent({to, related}) { - const component = this.getUnderlyingPotencialDraggableComponent(to); - if (!component) { - return {component}; - } - const list = component.realList; - const context = {list, component}; - if (to !== related && list && component.getUnderlyingVm) { - const destination = component.getUnderlyingVm(related); - if (destination) { - return Object.assign(destination, context); - } - } - return context; - }, - - getVmIndex(domIndex) { - const indexes = this.visibleIndexes; - const numberIndexes = indexes.length; - return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex]; - }, - - getComponent() { - return this.$slots.default[0].componentInstance; - }, - - resetTransitionData(index) { - if (!this.noTransitionOnDrag || !this.transitionMode) { - return; - } - var nodes = this.getChildrenNodes(); - nodes[index].data = null; - const transitionContainer = this.getComponent(); - transitionContainer.children = []; - transitionContainer.kept = undefined; - }, - - onDragStart(evt) { - this.context = this.getUnderlyingVm(evt.item); - evt.item._underlying_vm_ = this.clone(this.context.element); - draggingElement = evt.item; - }, - - onDragAdd(evt) { - const element = evt.item._underlying_vm_; - if (element === undefined) { - return; - } - removeNode(evt.item); - const newIndex = this.getVmIndex(evt.newIndex); - this.spliceList(newIndex, 0, element); - this.computeIndexes(); - const added = {element, newIndex}; - this.emitChanges({added}); - }, - - onDragRemove(evt) { - insertNodeAt(this.rootContainer, evt.item, evt.oldIndex); - if (evt.pullMode === "clone") { - removeNode(evt.clone); - return; - } - const oldIndex = this.context.index; - this.spliceList(oldIndex, 1); - const removed = {element: this.context.element, oldIndex}; - this.resetTransitionData(oldIndex); - this.emitChanges({removed}); - }, - - onDragUpdate(evt) { - removeNode(evt.item); - insertNodeAt(evt.from, evt.item, evt.oldIndex); - const oldIndex = this.context.index; - const newIndex = this.getVmIndex(evt.newIndex); - this.updatePosition(oldIndex, newIndex); - const moved = {element: this.context.element, oldIndex, newIndex}; - this.emitChanges({moved}); - }, - - updateProperty(evt, propertyName) { - evt.hasOwnProperty(propertyName) && - (evt[propertyName] += this.headerOffset); - }, - - computeFutureIndex(relatedContext, evt) { - if (!relatedContext.element) { - return 0; - } - const domChildren = [...evt.to.children].filter( - el => el.style["display"] !== "none" - ); - const currentDOMIndex = domChildren.indexOf(evt.related); - const currentIndex = relatedContext.component.getVmIndex(currentDOMIndex); - const draggedInList = domChildren.indexOf(draggingElement) !== -1; - return draggedInList || !evt.willInsertAfter - ? currentIndex - : currentIndex + 1; - }, - - onDragMove(evt, originalEvent) { - const onMove = this.move; - if (!onMove || !this.realList) { - return true; - } - - const relatedContext = this.getRelatedContextFromMoveEvent(evt); - const draggedContext = this.context; - const futureIndex = this.computeFutureIndex(relatedContext, evt); - Object.assign(draggedContext, {futureIndex}); - const sendEvt = Object.assign({}, evt, { - relatedContext, - draggedContext - }); - return onMove(sendEvt, originalEvent); - }, - - onDragEnd() { - this.computeIndexes(); - draggingElement = null; - } + onDragUpdate(evt) { + removeNode(evt.item); + insertNodeAt(evt.from, evt.item, evt.oldIndex); + const oldIndex = this.context.index; + const newIndex = this.getVmIndex(evt.newIndex); + this.updatePosition(oldIndex, newIndex); + const moved = { element: this.context.element, oldIndex, newIndex }; + this.emitChanges({ moved }); + }, + + updateProperty(evt, propertyName) { + evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset); + }, + + computeFutureIndex(relatedContext, evt) { + if (!relatedContext.element) { + return 0; + } + const domChildren = [...evt.to.children].filter(el => el.style['display'] !== 'none'); + const currentDOMIndex = domChildren.indexOf(evt.related); + const currentIndex = relatedContext.component.getVmIndex(currentDOMIndex); + const draggedInList = domChildren.indexOf(draggingElement) !== -1; + return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1; + }, + + onDragMove(evt, originalEvent) { + const onMove = this.move; + if (!onMove || !this.realList) { + return true; + } + + const relatedContext = this.getRelatedContextFromMoveEvent(evt); + const draggedContext = this.context; + const futureIndex = this.computeFutureIndex(relatedContext, evt); + Object.assign(draggedContext, { futureIndex }); + const sendEvt = Object.assign({}, evt, { + relatedContext, + draggedContext + }); + return onMove(sendEvt, originalEvent); + }, + + onDragEnd() { + this.computeIndexes(); + draggingElement = null; } + } }; -if (typeof window !== "undefined" && "Vue" in window) { - window.Vue.component("draggable", draggableComponent); +if (typeof window !== 'undefined' && 'Vue' in window) { + window.Vue.component('draggable', draggableComponent); } export default draggableComponent; diff --git a/src/pages/fitment/common/widget.vue b/src/pages/fitment/common/widget.vue index 09c9544bdd0a292432fc7b8b7ad39c4e6a42f225..bf8563d02c3f073860dedcbfbdc6406b5b2e6037 100644 --- a/src/pages/fitment/common/widget.vue +++ b/src/pages/fitment/common/widget.vue @@ -1,243 +1,243 @@ + + \ No newline at end of file + diff --git a/src/pages/fitment/coupon/coupon.vue b/src/pages/fitment/coupon/coupon.vue index 0d0d2bd7ab951f6514eec4bbdb3740aa9cf1a58d..69e023b0441c673ef77e80a9beb4df5db6082f5f 100644 --- a/src/pages/fitment/coupon/coupon.vue +++ b/src/pages/fitment/coupon/coupon.vue @@ -13,18 +13,8 @@ - - + + // #ifdef H5 -import heOpenSubscribe from "@/components/he-open-subscribe.vue"; +import heOpenSubscribe from '@/components/he-open-subscribe.vue'; // #endif -import item from "./item.vue"; +import item from './item.vue'; export default { components: { // #ifdef H5 heOpenSubscribe, // #endif - item, + item }, computed: { couponBox: function () { if (this.facade.list_style === 1) { - return ""; + return ''; } else if (this.facade.list_style === 2) { - return "flex flex-wrap"; + return 'flex flex-wrap'; } else if (this.facade.list_style === 3) { - return "flex"; + return 'flex'; } }, subTemplateId: function () { - return [this.$store.getters["setting/subscribe"].coupon_expire]; + return [this.$store.getters['setting/subscribe'].coupon_expire]; }, couponItem: function () { - let str = ""; + let str = ''; if (this.content.style === 3) { - str += " fillet "; + str += ' fillet '; } if (this.facade.list_style === 1) { - str += ""; + str += ''; } else if (this.facade.list_style === 2) { - str += "le-item-marginRight-odd "; + str += 'le-item-marginRight-odd '; } else if (this.facade.list_style === 3) { - str += "le-item-marginRight "; + str += 'le-item-marginRight '; } return str; }, @@ -83,29 +73,29 @@ export default { return () => { let style = {}; if (this.facade.list_style === 1) { - style.width = 710 + "rpx"; - style.marginBottom = 10 + "rpx"; + style.width = 710 + 'rpx'; + style.marginBottom = 10 + 'rpx'; } else if (this.facade.list_style === 2) { - style.width = 349 + "rpx"; - style.marginBottom = 10 + "rpx"; + style.width = 349 + 'rpx'; + style.marginBottom = 10 + 'rpx'; } else if (this.facade.list_style === 3) { - style.width = 280 + "rpx"; + style.width = 280 + 'rpx'; } return style; }; - }, + } }, props: { facade: { - type: [Object, Array], + type: [Object, Array] }, content: { - type: [Object, Array], - }, + type: [Object, Array] + } }, data() { return { - list: [], + list: [] }; }, methods: { @@ -119,22 +109,29 @@ export default { _array = data.map(function (item) { return item.id; }); - this.$heshop.coupon("get", { - behavior: "coupon", - coupon_id: _array, - }).then(function (response) { + this.$heshop + .coupon('get', { + behavior: 'coupon', + coupon_id: _array + }) + .then(function (response) { _this.list = response.data; - }).catch(function (error) { + }) + .catch(function (error) { _this.$toError(error); }); } } else if (autoplay === 1) { // 自动添加 - this.$heshop.coupon("get", { - behavior: "coupon", - }).page(1, number).then(function (response) { + this.$heshop + .coupon('get', { + behavior: 'coupon' + }) + .page(1, number) + .then(function (response) { _this.list = response.data; - }).catch(function (error) { + }) + .catch(function (error) { _this.$toError(error); }); } @@ -150,8 +147,8 @@ export default { fail: function () {}, complete: function () { _this.$heshop - .coupon("post", { - id: item.id, + .coupon('post', { + id: item.id }) .then(function () { item.can_obtain = false; @@ -160,13 +157,13 @@ export default { item.can_obtain = false; _this.$toError(error); }); - }, + } }); // #endif // #ifdef H5 _this.$heshop - .coupon("post", { - id: item.id, + .coupon('post', { + id: item.id }) .then(function () { item.can_obtain = false; @@ -177,27 +174,25 @@ export default { }); // #endif } else { - uni.navigateTo({ - url: "/pages/user/login", - }); + this.$store.commit('apply/setLoginModel', true); } } - }, + } }, watch: { - "content.data": { + 'content.data': { handler() { this.getList(); }, deep: true, - immediate: true, - }, - }, + immediate: true + } + } }; \ No newline at end of file +@import './element.less'; + diff --git a/src/pages/fitment/goods/element.less b/src/pages/fitment/goods/element.less index b7bd422211e5412a9bfbe0bff3062e93f6211a2d..69bd825aa7e21f94e30ccbf533f5aabafbad8d76 100644 --- a/src/pages/fitment/goods/element.less +++ b/src/pages/fitment/goods/element.less @@ -1,213 +1,205 @@ .goods { - overflow: hidden; - .clear { - clear: both; - } - - .chamfer { - .goods-item { - border-radius: 16px; - } - } + overflow: hidden; + .clear { + clear: both; + } - .white { + .chamfer { + .goods-item { + border-radius: 16px; } + } - .card { - .goods-item { - box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05); - } - } + .white { + } - .stroke { - .goods-item { - border: 1px solid rgba(50, 50, 51, .1); - } + .card { + .goods-item { + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05); } + } - .lucency { - .goods-item { - background-color: transparent; - } + .stroke { + .goods-item { + border: 1px solid rgba(50, 50, 51, 0.1); } + } + .lucency { .goods-item { - box-sizing: border-box; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - background: #FFFFFF; - overflow: hidden; + background-color: transparent; + } + } - .goods-item-photo { - position: relative; - - .goods-item-image { - position: relative; - max-height: 500px; - overflow: hidden; - padding-top: 50%; - } - - .goods-item-cover { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - width: 100%; - background-repeat: no-repeat; - background-position: 50%; - background: #F3F5F7; - background-size: cover; - } - } + .goods-item { + box-sizing: border-box; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + background: #ffffff; + overflow: hidden; - .goods-item-cover { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - width: 100%; - background-repeat: no-repeat; - background-position: 50%; - background-size: cover; - } + .goods-item-photo { + position: relative; - .goods-item-detail { - margin: 20px 20px 10px 20px; - position: relative; - - .goods-item-title { - font-size: 28px; - font-weight: 400; - color: #353535; - line-height: 1.4em; - min-height: 2.8em; - margin-bottom: 10px; - text-overflow: -o-ellipsis-lastline; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - line-clamp: 2; - -webkit-box-orient: vertical; - } - - .goods-item-info { - position: relative; - width: 100%; - line-height: 2em; - display: flex; - font-weight: 400; - justify-content: space-between - } - - .goods-item-price { - display: inline-block; - font-weight: 400; - - .goods-item-price__tag { - font-size: 24px; - padding-right: 4px; - - } - - .goods-item-price__val { - font-size: 32px; - } - } - - .goods-item-button { - display: inline-block; - - .le-icon { - vertical-align: 0; - } - - .iconfont { - font-size: 36px; - } - } - } + .goods-item-image { + position: relative; + max-height: 500px; + overflow: hidden; + padding-top: 50%; + } + + .goods-item-cover { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + background-repeat: no-repeat; + background-position: 50%; + background: #f3f5f7; + background-size: cover; + } } - .larger { - .goods-item-photo { - .goods-item-image { - height: 25%; - } - } + .goods-item-cover { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + background-repeat: no-repeat; + background-position: 50%; + background-size: cover; } + .goods-item-detail { + margin: 20px 20px 10px 20px; + position: relative; + + .goods-item-title { + font-size: 28px; + font-weight: 400; + color: #353535; + line-height: 1.4em; + min-height: 2.8em; + margin-bottom: 10px; + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; + } + + .goods-item-info { + position: relative; + width: 100%; + line-height: 2em; + display: flex; + font-weight: 400; + justify-content: space-between; + } - .small, - .list, - .swipe { - .goods-item-photo { - .goods-item-image { - padding-top: 100%; - } + .goods-item-price { + display: inline-block; + font-weight: 400; + .goods-item-price__tag { + font-size: 24px; + padding-right: 4px; } - } - - .small { - .goods-wrapper { - float: left; - width: 50%; + .goods-item-price__val { + font-size: 32px; } + } + .goods-item-button { + display: inline-block; - } - - .list { - .goods-item-photo { - float: left; - width: 240px; - height: 240px; - min-height: auto; - margin-right: 20px; + .le-icon { + vertical-align: 0; } - .goods-item-detail { - height: 240px; - box-sizing: border-box; - margin: 0 30px 0 240px; - overflow: hidden; - - .goods-item-title { - font-weight: 400; - margin: 28px 0 0; - } - - .goods-item-info { - position: absolute; - left: 0; - bottom: 10px; - } + .iconfont { + font-size: 36px; } + } } + } - .swipe { - display: -webkit-box; - display: -webkit-flex; - display: flex; - -webkit-flex-wrap: nowrap; - flex-wrap: nowrap; - margin-bottom: -20px; - padding-bottom: 20px; - overflow-x: auto; - overflow-y: hidden; - -webkit-overflow-scrolling: touch; - - .goods-wrapper { - flex: 0 0 30%; - float: none; - width: 30%; - } + .larger { + .goods-item-photo { + .goods-item-image { + height: 25%; + } + } + } + + .small, + .list, + .swipe { + .goods-item-photo { + .goods-item-image { + padding-top: 100%; + } + } + } + .small { + .goods-wrapper { + float: left; + width: 50%; + } + } + + .list { + .goods-item-photo { + float: left; + width: 240px; + height: 240px; + min-height: auto; + margin-right: 20px; } -} \ No newline at end of file + .goods-item-detail { + height: 240px; + box-sizing: border-box; + margin: 0 30px 0 240px; + overflow: hidden; + + .goods-item-title { + font-weight: 400; + margin: 28px 0 0; + } + + .goods-item-info { + position: absolute; + left: 0; + bottom: 10px; + } + } + } + + .swipe { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-flex-wrap: nowrap; + flex-wrap: nowrap; + margin-bottom: -20px; + padding-bottom: 20px; + overflow-x: auto; + overflow-y: hidden; + -webkit-overflow-scrolling: touch; + + .goods-wrapper { + flex: 0 0 30%; + float: none; + width: 30%; + } + } +} diff --git a/src/pages/fitment/goods/goods.vue b/src/pages/fitment/goods/goods.vue index ab6278f652583c30f3eee8f3a0f8662da8e99dca..2c1b9285ffab78d678be87b333737f9f652c26f0 100644 --- a/src/pages/fitment/goods/goods.vue +++ b/src/pages/fitment/goods/goods.vue @@ -1,196 +1,233 @@ + diff --git a/src/pages/fitment/navigation/element.less b/src/pages/fitment/navigation/element.less index d8ef22579b2e919cbcdf066f10d173ba84aa8cb6..5f293ab1f015d8aee94b41059f6dbd468398f311 100644 --- a/src/pages/fitment/navigation/element.less +++ b/src/pages/fitment/navigation/element.less @@ -1,104 +1,99 @@ .navigation { - background-color: #FFFFFF; - position: relative; - - ::-webkit-scrollbar { - display: none - } + background-color: #ffffff; + position: relative; + ::-webkit-scrollbar { + display: none; + } - .one { - white-space: nowrap; - overflow-x: auto; - overflow-y: hidden; - padding: 0 32px; + .one { + white-space: nowrap; + overflow-x: auto; + overflow-y: hidden; + padding: 0 32px; + } - } + .navigation-indicator { + position: absolute; + width: 100%; + height: 20px; + bottom: 10px; + } - .navigation-indicator { - position: absolute; - width: 100%; - height: 20px; - bottom: 10px; + .navigation-image-item { + display: inline-block; + vertical-align: middle; + margin-top: 16px; + margin-bottom: 10px; + .navigation-image-item__cover { + width: 100px; + height: 100px; + background-position: 50%; + background-size: cover; + display: block; + margin: 0 auto; + border: 0; } - .navigation-image-item { - display: inline-block; - vertical-align: middle; - margin-top: 16px; - margin-bottom: 10px; - - .navigation-image-item__cover { - width: 100px; - height: 100px; - background-position: 50%; - background-size: cover; - display: block; - margin: 0 auto; - border: 0; - } - - .navigation-image-item__title { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 100%; - font-size: 24px; - line-height: 40rpx; - text-align: center; - overflow: hidden; - /*超出部分隐藏*/ - white-space: nowrap; - /*不换行*/ - text-overflow: ellipsis; - /*超出部分文字以...显示*/ - - } + .navigation-image-item__title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 100%; + font-size: 24px; + line-height: 40px; + text-align: center; + overflow: hidden; + /*超出部分隐藏*/ + white-space: nowrap; + /*不换行*/ + text-overflow: ellipsis; + /*超出部分文字以...显示*/ } + } - .navigation-text-item { - display: inline-block; - padding: 16rpx 0; - color: #333; - width: 25%; - text-decoration: none; - box-sizing: border-box; - // background-color: rgb(255, 255, 255); + .navigation-text-item { + display: inline-block; + padding: 16px 0; + color: #333; + width: 25%; + text-decoration: none; + box-sizing: border-box; - .navigation-text-item__title { - display: block; - width: 100%; - position: relative; - height: 30px; - font-size: 24px; - line-height: 30rpx; - text-align: center; - overflow: hidden; - box-sizing: border-box; - /*超出部分隐藏*/ - white-space: nowrap; - /*不换行*/ - text-overflow: ellipsis; - /*超出部分文字以...显示*/ - padding: 0 20rpx; - border-right: 1px solid #eee; - } + .navigation-text-item__title { + display: block; + width: 100%; + position: relative; + height: 30px; + font-size: 24px; + line-height: 30px; + text-align: center; + overflow: hidden; + box-sizing: border-box; + /*超出部分隐藏*/ + white-space: nowrap; + /*不换行*/ + text-overflow: ellipsis; + /*超出部分文字以...显示*/ + padding: 0 20px; + border-right: 1px solid #eee; } + } - .one { - .navigation-text-item:last-child { - .navigation-text-item__title { - border-right: 0; - } - } + .one { + .navigation-text-item:last-child { + .navigation-text-item__title { + border-right: 0; + } } + } - .two { - .navigation-text-item:last-child { - .navigation-text-item__title { - border-right: 0; - } - } + .two { + .navigation-text-item:last-child { + .navigation-text-item__title { + border-right: 0; + } } -} \ No newline at end of file + } +} diff --git a/src/pages/fitment/navigation/navigation.vue b/src/pages/fitment/navigation/navigation.vue index a139d59c61a25527096d7b7f0327e64b9253f8a5..918314fba7c305cdaa59295e3fe71b2547633963 100644 --- a/src/pages/fitment/navigation/navigation.vue +++ b/src/pages/fitment/navigation/navigation.vue @@ -1,226 +1,401 @@ + \ No newline at end of file + diff --git a/src/pages/fitment/notice/item.vue b/src/pages/fitment/notice/item.vue index 7843a0c297906ab6a01184e3f4af7a9a2aabed40..11e4ff206bc13134443708654eaa3f80e57f6231 100644 --- a/src/pages/fitment/notice/item.vue +++ b/src/pages/fitment/notice/item.vue @@ -1,17 +1,54 @@ \ No newline at end of file + diff --git a/src/pages/fitment/notice/notice.vue b/src/pages/fitment/notice/notice.vue index fe372a04515bc630d935646abd7d828992c57a8e..f29d25fcf1aac6a1a21be0085c0c61f547e7dda2 100644 --- a/src/pages/fitment/notice/notice.vue +++ b/src/pages/fitment/notice/notice.vue @@ -1,27 +1,36 @@ \ No newline at end of file + diff --git a/src/pages/fitment/rubik/element.less b/src/pages/fitment/rubik/element.less index 18ce287cec3af6d19274140508e7f0d3584bc21a..73b84d083ab03cfd81997e526e15c1a3eb05f504 100644 --- a/src/pages/fitment/rubik/element.less +++ b/src/pages/fitment/rubik/element.less @@ -1,145 +1,135 @@ .rubik { - overflow: hidden; - position: relative; + overflow: hidden; + position: relative; } .rubik-cube { - position: relative; - width: 750rpx; - height: 750rpx; - font-size: 28rpx; - - - .rubik-cube__item { - position: absolute; - } + position: relative; + width: 750px; + height: 750px; + font-size: 28px; + + .rubik-cube__item { + position: absolute; + } } .advertising { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - font-size: 12rpx; - margin-bottom: -4rpx; - - .advertising-item-1 { - position: relative; - text-align: center; - font-weight: 400; - color: #8C8C8C; - width: 750rpx; - margin-bottom: -2rpx; - - .advertising-item-tips { - width: 750rpx; - height: 750rpx; - line-height: 750rpx; - background: #F7F5FE; - } - - img { - width: 100%; - height: auto; - } + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + font-size: 12px; + margin-bottom: -4px; + + .advertising-item-1 { + position: relative; + text-align: center; + font-weight: 400; + color: #8c8c8c; + width: 750px; + margin-bottom: -2px; + + .advertising-item-tips { + width: 750px; + height: 750px; + line-height: 750px; + background: #f7f5fe; } - .advertising-item-2 { - position: relative; - width: 100%; - display: flex; - - .advertising-item-image { - margin-bottom: -2rpx; - flex: 1 1 auto; - width: 375rpx; - - - &:first-child .advertising-item-tips { - border-right: 0; - } - - img { - width: 100%; - height: auto; - } + img { + width: 100%; + height: auto; + } + } - } + .advertising-item-2 { + position: relative; + width: 100%; + display: flex; + .advertising-item-image { + margin-bottom: -2px; + flex: 1 1 auto; + width: 375px; - } + &:first-child .advertising-item-tips { + border-right: 0; + } - .advertising-item-3 { - position: relative; + img { width: 100%; - display: flex; - - .advertising-item-image { - margin-bottom: -2rpx; - - flex: 1 1 1; - width: 250rpx; + height: auto; + } + } + } - img { - width: 100%; - height: auto; - } + .advertising-item-3 { + position: relative; + width: 100%; + display: flex; - } + .advertising-item-image { + margin-bottom: -2px; + flex: 1 1 1; + width: 250px; + img { + width: 100%; + height: auto; + } } + } - .advertising-item-4 { - position: relative; - width: 750rpx; - height: 375rpx; - - .advertising-item-image { - margin-bottom: -2rpx; - - position: absolute; - width: 100%; - height: 100%; + .advertising-item-4 { + position: relative; + width: 750px; + height: 375px; - img { - width: 100%; - height: 100%; - } + .advertising-item-image { + margin-bottom: -2px; - } - } + position: absolute; + width: 100%; + height: 100%; - .advertising-item-5 { - position: relative; + img { width: 100%; - display: flex; + height: 100%; + } + } + } - .advertising-item-image { - margin-bottom: -2rpx; - margin-right: -2rpx; - flex: 1; - width: 187.5rpx; + .advertising-item-5 { + position: relative; + width: 100%; + display: flex; - img { - width: 100%; - height: auto; - } + .advertising-item-image { + margin-bottom: -2px; + margin-right: -2px; + flex: 1; + width: 187.5px; - } + img { + width: 100%; + height: auto; + } } + } - .advertising-item-6 { - position: relative; - width: 100%; - height: 376rpx; + .advertising-item-6 { + position: relative; + width: 100%; + height: 376px; - .advertising-item-image { - margin-bottom: -2rpx; + .advertising-item-image { + margin-bottom: -2px; - position: absolute; - } + position: absolute; } -} \ No newline at end of file + } +} diff --git a/src/pages/fitment/rubik/rubik.vue b/src/pages/fitment/rubik/rubik.vue index 8fe04ff33d69f10bb7b46dc2e861e400711955a8..aa0749c9ced63ebf14f6e791dc0f85ff36f0ff2b 100644 --- a/src/pages/fitment/rubik/rubik.vue +++ b/src/pages/fitment/rubik/rubik.vue @@ -1,181 +1,854 @@ - + \ No newline at end of file + diff --git a/src/pages/fitment/search/element.less b/src/pages/fitment/search/element.less index 7a08893b6c6a43a4517ff82d0631a1d485493441..65adc1e490096188be9c89a288a1b3895cd5bfee 100644 --- a/src/pages/fitment/search/element.less +++ b/src/pages/fitment/search/element.less @@ -1,30 +1,29 @@ .search { - width: 100%; - box-sizing: border-box; - padding: 20px 30px; - background-color: RGBA(243, 240, 253, 1); + width: 100%; + box-sizing: border-box; + padding: 20px 30px; + background-color: RGBA(243, 240, 253, 1); - .angle { - border-radius: 32px; - } + .angle { + border-radius: 32px; + } - .iconsearchbar_search { - font-size: 24px; - } - - .search-content { - height: 64px; - line-height: 64px; - font-size: 28px; - box-sizing: border-box; - color: RGBA(156, 156, 156, 1); - background-color: #FFFFFF; - padding-left: 30px; + .iconsearchbar_search { + font-size: 24px; + } + .search-content { + height: 64px; + line-height: 64px; + font-size: 28px; + box-sizing: border-box; + color: RGBA(156, 156, 156, 1); + background-color: #ffffff; + padding-left: 30px; - span { - padding-left: 10px; - font-size: 24px; - } + span { + padding-left: 10px; + font-size: 24px; } -} \ No newline at end of file + } +} diff --git a/src/pages/fitment/search/search.vue b/src/pages/fitment/search/search.vue index ff041b68fa0f08a062428311872f522f58793ea9..75734299b8eedb93e452a73fe2187a06994c5a90 100644 --- a/src/pages/fitment/search/search.vue +++ b/src/pages/fitment/search/search.vue @@ -1,76 +1,87 @@ + + diff --git a/src/pages/fitment/separate/separate.vue b/src/pages/fitment/separate/separate.vue index ce7fb02945d6b75f8defe318c9898ad38100a6db..905518163e546216ec4fb52f36bce03ce04929f6 100644 --- a/src/pages/fitment/separate/separate.vue +++ b/src/pages/fitment/separate/separate.vue @@ -1,43 +1,40 @@ + diff --git a/src/pages/fitment/tabs/element.less b/src/pages/fitment/tabs/element.less index b8b510435c7b895315f6aaac05423c9d1e3273f0..6e98bde1ce5a5327332d41e8d9f40420b77aab49 100644 --- a/src/pages/fitment/tabs/element.less +++ b/src/pages/fitment/tabs/element.less @@ -1,54 +1,54 @@ .tabs { - .tabs-header { - position: -webkit-sticky; - position: sticky; - z-index: 1; - top: var(--window-top); - white-space: nowrap; - overflow: hidden; - padding-right: 20px; - width: 750px; - .he-scroll-box { - width: 750px; - height: 88px; - .he-tab-item { - font-size: 26px; - font-family: PingFang SC; - font-weight: 500; - color: #666666; - line-height: 88px; - padding: 0 30px; - position: relative; - .he-tab-line { - position: absolute; - width: 24px; - height: 4px; - background: #000000; - left: 50%; - bottom: 12px; - transform: translateX(-50%); - } - } - .he-tab-item.active { - color: #E60B30; - .he-tab-line { - position: absolute; - width: 24px; - height: 4px; - background: #E60B30; - left: 50%; - bottom: 12px; - } - } + .tabs-header { + position: -webkit-sticky; + position: sticky; + z-index: 1; + top: var(--window-top); + white-space: nowrap; + overflow: hidden; + padding-right: 20px; + width: 750px; + .he-scroll-box { + width: 750px; + height: 88px; + .he-tab-item { + font-size: 26px; + font-family: PingFang SC; + font-weight: 500; + color: #666666; + line-height: 88px; + padding: 0 30px; + position: relative; + .he-tab-line { + position: absolute; + width: 24px; + height: 4px; + background: #000000; + left: 50%; + bottom: 12px; + transform: translateX(-50%); + } + } + .he-tab-item.active { + color: #e60b30; + .he-tab-line { + position: absolute; + width: 24px; + height: 4px; + background: #e60b30; + left: 50%; + bottom: 12px; } + } } + } - .tabs-content-active { - position: relative; + .tabs-content-active { + position: relative; - .tabs-content-shade { - position: absolute; - display: block; - } + .tabs-content-shade { + position: absolute; + display: block; } -} \ No newline at end of file + } +} diff --git a/src/pages/fitment/tabs/tabs.vue b/src/pages/fitment/tabs/tabs.vue index c9b7a6cdfe9e49b408427617ee194abb20201892..4c3ee12f8914fab9d49f72c1682c6db3f9c52c3c 100644 --- a/src/pages/fitment/tabs/tabs.vue +++ b/src/pages/fitment/tabs/tabs.vue @@ -7,7 +7,7 @@ scroll-x="true" :style="{ top: top + 'px', - background: facade.background_color ? facade.background_color : '#fff', + background: facade.background_color ? facade.background_color : '#fff' }" > @@ -33,31 +33,31 @@ + \ No newline at end of file +@import './element.less'; + diff --git a/src/pages/fitment/task/element.less b/src/pages/fitment/task/element.less index 21e2ce4db569dfbff194b2191cccd78430a07a7d..2037dfe88586a78aebb2b852fd9dfe5474fc3ff6 100644 --- a/src/pages/fitment/task/element.less +++ b/src/pages/fitment/task/element.less @@ -4,15 +4,13 @@ .clear { clear: both; - - } .control-task { position: relative; width: 710px; height: 212px; - background: #FFFFFF; + background: #ffffff; margin: 0 auto; border-radius: 16px; margin-top: 20px; @@ -29,7 +27,7 @@ top: 72px; width: 710px; height: 140px; - background: #FFFFFF; + background: #ffffff; border-radius: 0px 0px 16px 16px; } @@ -39,12 +37,12 @@ top: 0; width: 710px; height: 72px; - background: #FFB525; + background: #ffb525; border-radius: 16px 16px 0px 0px; font-size: 28px; font-family: PingFang SC; font-weight: 500; - color: #FFFFFE; + color: #fffffe; line-height: 72px; padding-left: 23px; } @@ -63,12 +61,12 @@ top: 42px; width: 140px; height: 56px; - background: #FFB525; + background: #ffb525; border-radius: 28px; font-size: 24px; font-family: PingFang SC; font-weight: 500; - color: #FFFFFF; + color: #ffffff; line-height: 56px; text-align: center; } @@ -92,7 +90,6 @@ text-overflow: ellipsis; } - &_tips { font-size: 26px; font-family: PingFang SC; @@ -103,8 +100,6 @@ top: 70px; left: 120px; } - - } .chamfer { @@ -113,7 +108,8 @@ } } - .white {} + .white { + } .card { .goods-item { @@ -123,7 +119,7 @@ .stroke { .goods-item { - border: 1px solid rgba(50, 50, 51, .1); + border: 1px solid rgba(50, 50, 51, 0.1); } } @@ -137,7 +133,7 @@ box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; - background: #FFFFFF; + background: #ffffff; overflow: hidden; .goods-item-photo { @@ -159,7 +155,7 @@ width: 100%; background-repeat: no-repeat; background-position: 50%; - background: #F3F5F7; + background: #f3f5f7; background-size: cover; } } @@ -202,20 +198,18 @@ line-height: 2em; display: flex; font-weight: 400; - justify-content: space-between + justify-content: space-between; } - .goods-item-price { display: inline-block; font-weight: 400; - color: #E60B30; + color: #e60b30; height: 30px; display: inline-flex; align-items: center; margin-top: 10px; - .goods-item-price__icon { display: inline-block; font-size: 24px; @@ -223,7 +217,7 @@ width: 24px; height: 24px; padding-right: 5px; - color: #FBAD15; + color: #fbad15; position: relative; top: -3px; } @@ -236,12 +230,10 @@ .goods-item-price__tag { font-size: 24px; - } .goods-item-price__val { font-size: 24px; - } } @@ -249,12 +241,12 @@ display: inline-block; width: 30%; height: 56px; - background: #E60B30; + background: #e60b30; border-radius: 28px; font-size: 24px; font-family: PingFang SC; font-weight: 500; - color: #FFFFFF; + color: #ffffff; text-align: center; line-height: 56px; margin-bottom: 8px; @@ -276,25 +268,23 @@ text-overflow: ellipsis; overflow: hidden; white-space: nowrap; - } .goods-item-button { display: block; width: 100%; height: 56px; - background: #E60B30; + background: #e60b30; border-radius: 28px; font-size: 24px; font-family: PingFang SC; font-weight: 500; - color: #FFFFFF; + color: #ffffff; text-align: center; line-height: 56px; margin-bottom: 20px; } } - } .larger { @@ -305,7 +295,6 @@ } } - .small, .list, .swipe { @@ -313,18 +302,14 @@ .goods-item-image { padding-top: 100%; } - } } - .small { .goods-wrapper { float: left; width: 50%; } - - } .list { @@ -379,7 +364,5 @@ text-overflow: ellipsis; white-space: nowrap; } - } - } diff --git a/src/pages/fitment/task/task.vue b/src/pages/fitment/task/task.vue index 19fbc31b3636437209d7b54932da7197e4beb205..9dfc2984218b971afaa982424aafaa3b61540230 100644 --- a/src/pages/fitment/task/task.vue +++ b/src/pages/fitment/task/task.vue @@ -1,42 +1,71 @@ + diff --git a/src/pages/fitment/title/element.less b/src/pages/fitment/title/element.less index 2639472f415da12cc5a3e8b7b0bd8baae4661caa..d741813fc1f771ac5422f4953775d21304fe2f7f 100644 --- a/src/pages/fitment/title/element.less +++ b/src/pages/fitment/title/element.less @@ -1,98 +1,95 @@ .title { - background: #FFFFFF; + background: #ffffff; - .title-style1, - .title-style2, - .title-style3 { - width: 100%; - padding: 0 32px; - box-sizing: border-box; - position: relative; - } - - .title-style3 { - .title-content { - font-size: 32px; - font-weight: 500; - color: #333333; - } - - .title-more { - position: absolute; - font-size: 28px; - font-weight: 400; - color: #333333; - right: 16px; - top: 0; - height: 100%; - line-height: 100%; - display: flex; - align-items: center; - justify-content: center; - } + .title-style1, + .title-style2, + .title-style3 { + width: 100%; + padding: 0 32px; + box-sizing: border-box; + position: relative; + } - .title-subtitle { - margin-top: 8px; - font-size: 24px; - height: 40px; - font-weight: 400; - color: #333333; - } + .title-style3 { + .title-content { + font-size: 32px; + font-weight: 500; + color: #333333; } + .title-more { + position: absolute; + font-size: 28px; + font-weight: 400; + color: #333333; + right: 16px; + top: 0; + height: 100%; + line-height: 100%; + display: flex; + align-items: center; + justify-content: center; + } - .title-style1 { - text-align: center; + .title-subtitle { + margin-top: 8px; + font-size: 24px; + height: 40px; + font-weight: 400; + color: #333333; + } + } - .title-content-before { - display: inline-block; - content: ""; - width: 20%; - height: 10px; - border-top: 2px solid #898989; - margin-right: 20px; - } + .title-style1 { + text-align: center; - .title-content-after { - display: inline-block; - content: ""; - width: 20%; - height: 10px; - border-top: 2px solid #898989; - margin-left: 20px; - } + .title-content-before { + display: inline-block; + content: ''; + width: 20%; + height: 10px; + border-top: 2px solid #898989; + margin-right: 20px; } - .title-style2 { - width: 85%; - box-sizing: border-box; - text-align: center; - line-height: 40px; - position: relative; - margin: 0 auto; - - .title-content { - font-weight: 400; - } + .title-content-after { + display: inline-block; + content: ''; + width: 20%; + height: 10px; + border-top: 2px solid #898989; + margin-left: 20px; + } + } - .title-decorate-before { - position: absolute; - content: ""; - width: 45%; - border-bottom: 2px solid #898989; - right: 0; - top: 60px; - } + .title-style2 { + width: 85%; + box-sizing: border-box; + text-align: center; + line-height: 40px; + position: relative; + margin: 0 auto; - .title-decorate-after { - position: absolute; - content: ""; - width: 45%; - border-bottom: 2px solid #898989; - left: 0; - top: 60px; - } + .title-content { + font-weight: 400; } + .title-decorate-before { + position: absolute; + content: ''; + width: 45%; + border-bottom: 2px solid #898989; + right: 0; + top: 60px; + } -} \ No newline at end of file + .title-decorate-after { + position: absolute; + content: ''; + width: 45%; + border-bottom: 2px solid #898989; + left: 0; + top: 60px; + } + } +} diff --git a/src/pages/fitment/title/title.vue b/src/pages/fitment/title/title.vue index e49f7195c3bb9527ad69d57cf75a4e2af4c51fca..00257d71439d0e8ceebaf4e0d183fbdc713793dc 100644 --- a/src/pages/fitment/title/title.vue +++ b/src/pages/fitment/title/title.vue @@ -1,75 +1,104 @@ - + \ No newline at end of file + diff --git a/src/pages/fitment/video/video.vue b/src/pages/fitment/video/video.vue index a2dbf23762e370445c8de6e23a81b4a1341ab2c2..4c12bf80091301decd1f2602630ffe8d983170b8 100644 --- a/src/pages/fitment/video/video.vue +++ b/src/pages/fitment/video/video.vue @@ -1,9 +1,6 @@ + + \ No newline at end of file + diff --git a/src/pages/fitment/wechat/wechat.vue b/src/pages/fitment/wechat/wechat.vue index 8413158603e19663bd62c9bdfd04f1d75b6989f1..21edeb275e92d25cfe03a29ff77dfb837aff97fe 100644 --- a/src/pages/fitment/wechat/wechat.vue +++ b/src/pages/fitment/wechat/wechat.vue @@ -1,87 +1,86 @@ + + \ No newline at end of file + diff --git a/src/pages/fitment/wechatLive/wechatLive.vue b/src/pages/fitment/wechatLive/wechatLive.vue index 6e27d4f48b71bf8eaff4ffe456dcaa027ef06e5c..c9675215bcd0b9ac37e8bb47a2d40f76d6992848 100644 --- a/src/pages/fitment/wechatLive/wechatLive.vue +++ b/src/pages/fitment/wechatLive/wechatLive.vue @@ -1,77 +1,76 @@ - + + diff --git a/src/pages/goods/components/detail-banner.vue b/src/pages/goods/components/detail-banner.vue index 1f36f60ce7dcd27be65132c234b227046d254491..7034801dda5979d5bce245ea07f5af255f9f3379 100644 --- a/src/pages/goods/components/detail-banner.vue +++ b/src/pages/goods/components/detail-banner.vue @@ -1,278 +1,305 @@ + \ No newline at end of file + diff --git a/src/pages/goods/components/detail-basic-information.vue b/src/pages/goods/components/detail-basic-information.vue index 5c3ccd677854d82c369536e01e5f5c0af6c9de74..5755f5053f527935324a65894b824582374468e9 100644 --- a/src/pages/goods/components/detail-basic-information.vue +++ b/src/pages/goods/components/detail-basic-information.vue @@ -4,8 +4,10 @@ {{ task.task_number }}积分+¥{{ task.task_price }} + >{{ task.task_number }} + 积分+¥ + {{ task.task_price }} + {{ price }} ¥{{ linePrice }} @@ -18,6 +20,9 @@ 分享 + + {{ goodsIntroduce }} + @@ -28,7 +33,7 @@ - + @@ -45,6 +50,7 @@ + + \ No newline at end of file + diff --git a/src/pages/goods/components/detail-free-shipping.vue b/src/pages/goods/components/detail-free-shipping.vue index 725edaaeb617a42e4940189c85e312588becf181..53f22e9871ce92ba2b7b6e78e329870586ffce33 100644 --- a/src/pages/goods/components/detail-free-shipping.vue +++ b/src/pages/goods/components/detail-free-shipping.vue @@ -1,122 +1,130 @@ \ No newline at end of file + diff --git a/src/pages/goods/components/detail-parameter.vue b/src/pages/goods/components/detail-parameter.vue index 0a38efa874141f67ca9869de6e3550fd7fff1d4b..9884fddd627677ac3a4a39c1462f956b7dfd7233 100644 --- a/src/pages/goods/components/detail-parameter.vue +++ b/src/pages/goods/components/detail-parameter.vue @@ -1,174 +1,267 @@ + + \ No newline at end of file + diff --git a/src/pages/goods/components/detail-service.vue b/src/pages/goods/components/detail-service.vue index 23bbb4e2f7f80e1afaddb43a2eacf99aa1fab844..6dac6a9df931a0df4657ed6a55ab03e3914844af 100644 --- a/src/pages/goods/components/detail-service.vue +++ b/src/pages/goods/components/detail-service.vue @@ -1,104 +1,112 @@ \ No newline at end of file + diff --git a/src/pages/goods/components/detail-shipping-address.vue b/src/pages/goods/components/detail-shipping-address.vue index ee44a1b181ccf8ca9ca6c84fe564d5a2fe95c85d..e4e24075feec442164000ac5f14e661ef9631b67 100644 --- a/src/pages/goods/components/detail-shipping-address.vue +++ b/src/pages/goods/components/detail-shipping-address.vue @@ -1,192 +1,192 @@ + \ No newline at end of file + diff --git a/src/pages/goods/components/detail-skeleton.vue b/src/pages/goods/components/detail-skeleton.vue index bc79d242569c9c1f6df914d606f9ae7c85ea4824..7c29a8d0f6dc4fbceeca10f1ef12cd3821a649c2 100644 --- a/src/pages/goods/components/detail-skeleton.vue +++ b/src/pages/goods/components/detail-skeleton.vue @@ -1,236 +1,337 @@ - \ No newline at end of file + diff --git a/src/pages/goods/components/detail-task.vue b/src/pages/goods/components/detail-task.vue index fb26ebd9f7d3a28110c90f6a9a15eac9e6114085..7d9afa159a9cd32d3bc2076075ddb2d5a579e641 100644 --- a/src/pages/goods/components/detail-task.vue +++ b/src/pages/goods/components/detail-task.vue @@ -1,37 +1,30 @@ + + diff --git a/src/pages/goods/detail.vue b/src/pages/goods/detail.vue index 9c92368251f0f47efc9efd78bebd60783eb9f6e6..4b5dc7efb711cafa71865d185df584eb377bc7a0 100644 --- a/src/pages/goods/detail.vue +++ b/src/pages/goods/detail.vue @@ -1,10 +1,9 @@ + diff --git a/src/pages/order/after-sales-details.vue b/src/pages/order/after-sales-details.vue index 241a7e0cf10b7c9ed870e9e2f54466080d5e10e9..4ab2a9c8aa97f8d800d199c0d96ac17e72ac7c03 100644 --- a/src/pages/order/after-sales-details.vue +++ b/src/pages/order/after-sales-details.vue @@ -14,29 +14,19 @@ + diff --git a/src/pages/order/after-sales-records.vue b/src/pages/order/after-sales-records.vue index e26151381625dbca6a0ae2e455fbb756f8a7bf4b..e0dfb0fbd1092a3c84f57ab470244f1ed7c1a791 100644 --- a/src/pages/order/after-sales-records.vue +++ b/src/pages/order/after-sales-records.vue @@ -1,9 +1,16 @@ + diff --git a/src/pages/order/apply-detail.vue b/src/pages/order/apply-detail.vue index e461ea5452acd2c16e32a40dbfc346e53199d263..6cd6bafee91b4be5ce4f1729ea97e4ba912f2a6f 100644 --- a/src/pages/order/apply-detail.vue +++ b/src/pages/order/apply-detail.vue @@ -1,20 +1,30 @@ diff --git a/src/pages/order/apply.vue b/src/pages/order/apply.vue index 63ef1c92c559e47df09d20f2ffa353d03b995d8f..45002a27adb2cd3de4e865dde5b2486fd7f00fca 100644 --- a/src/pages/order/apply.vue +++ b/src/pages/order/apply.vue @@ -1,156 +1,177 @@ + \ No newline at end of file + diff --git a/src/pages/order/components/applyDetail-operating.vue b/src/pages/order/components/applyDetail-operating.vue index f1607f81c635015a8c8e6664358d616900fe30c8..c9db20a08dea2613d24e27f001a45776341a70c4 100644 --- a/src/pages/order/components/applyDetail-operating.vue +++ b/src/pages/order/components/applyDetail-operating.vue @@ -1,258 +1,310 @@ \ No newline at end of file + diff --git a/src/pages/order/components/detail-bottom-operating.vue b/src/pages/order/components/detail-bottom-operating.vue index 51ec21040d13eae30b293ef40afa345ff69c3da7..acf99cb67369992f8d0335f8373680857b1e82ad 100644 --- a/src/pages/order/components/detail-bottom-operating.vue +++ b/src/pages/order/components/detail-bottom-operating.vue @@ -1,229 +1,265 @@ \ No newline at end of file + diff --git a/src/pages/order/components/detail-logistics.vue b/src/pages/order/components/detail-logistics.vue index 7fd9d2caa617c6cbaeecea5916066719787bbcd6..d6511bfa7a90a5248df0b119f9d05c2605a97d86 100644 --- a/src/pages/order/components/detail-logistics.vue +++ b/src/pages/order/components/detail-logistics.vue @@ -1,114 +1,87 @@ \ No newline at end of file + diff --git a/src/pages/order/components/detail-product-info.vue b/src/pages/order/components/detail-product-info.vue index af9a4b06f44ea084003b65bf77b05a57cca12de6..0e93559a41a8b59d6b850e654f339503e183fc49 100644 --- a/src/pages/order/components/detail-product-info.vue +++ b/src/pages/order/components/detail-product-info.vue @@ -5,18 +5,20 @@ - + {{ item.after | afterStatus }} - {{ item.goods_name }} - - {{ - item.show_goods_param - }} + {{ item.goods_name }} + {{ item.show_goods_param }} {{ item.goods_number }} @@ -25,7 +27,9 @@ @@ -36,12 +40,14 @@ - - + @@ -49,72 +55,78 @@ diff --git a/src/pages/order/components/submit-button.vue b/src/pages/order/components/submit-button.vue index 5a6dd7c95fe545234bedc0b520f44c1d00dd7926..34dbdef09eed11e28233502a831abd6db0bd4c9e 100644 --- a/src/pages/order/components/submit-button.vue +++ b/src/pages/order/components/submit-button.vue @@ -1,147 +1,146 @@ diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue index 2ae191a4321902a0b2eccb865665bf5392b37a4f..7b518cb5f922176a8277fe935062d072961dba7e 100644 --- a/src/pages/order/detail.vue +++ b/src/pages/order/detail.vue @@ -11,13 +11,17 @@ - + @@ -88,19 +95,18 @@ export default { buyer: {}, id: null }, - loading: true, - freight: { - status: 0, - message: '', - desc: '', - datetime: '' - } + loading: true }; }, computed: { isBottom: function () { - let { status, is_evaluate } = this.detail; - return status === 100 || status === 202 || (status === 203 && is_evaluate === 0); + let { status, is_evaluate, goods, check_after } = this.detail; + return ( + status === 100 || + status === 202 || + (status === 201 && goods.length > 1 && !check_after) || + (status === 203 && is_evaluate === 0) + ); }, ...mapGetters('setting', { goodsSetting: 'goodsSetting' @@ -159,6 +165,7 @@ export default { } }; + diff --git a/src/pages/order/fill-return-information.vue b/src/pages/order/fill-return-information.vue index 294923a48bff0fdec97e9c302a2c2db7568eaa13..769e7b081ce9bc04acf482f8595f47016cbf0563 100644 --- a/src/pages/order/fill-return-information.vue +++ b/src/pages/order/fill-return-information.vue @@ -1,215 +1,215 @@ \ No newline at end of file + diff --git a/src/pages/order/index.vue b/src/pages/order/index.vue index 03895cd8468a7b098bfa1623253175a5da43447c..532f19db309594432f182c4575528b913bb594de 100644 --- a/src/pages/order/index.vue +++ b/src/pages/order/index.vue @@ -1,6 +1,19 @@ + diff --git a/src/pages/order/logistics.vue b/src/pages/order/logistics.vue index 6ec523f0d47ae62b805adb51c9c83af82cd2d62c..e825d4907c7f17d1462c79d787b55de5b18fc116 100644 --- a/src/pages/order/logistics.vue +++ b/src/pages/order/logistics.vue @@ -1,20 +1,14 @@ @@ -235,4 +224,4 @@ export default { } } } - \ No newline at end of file + diff --git a/src/pages/order/package.vue b/src/pages/order/package.vue new file mode 100644 index 0000000000000000000000000000000000000000..cf6055d0ae71e57b718bbf7c438f31fcbd98820e --- /dev/null +++ b/src/pages/order/package.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/src/pages/order/submit.vue b/src/pages/order/submit.vue index 92447091f4333fd6b0181078c3bc9418080a8b54..74da53576cc20e77efce5d1f02c89acc8b35bfc2 100644 --- a/src/pages/order/submit.vue +++ b/src/pages/order/submit.vue @@ -4,289 +4,300 @@ 积分余额不足 - {{msg}} - 去赚积分 - 看看其他积分商品 + {{ msg }} + 去赚积分 + 看看其他积分商品 + diff --git a/src/pages/order/successful.vue b/src/pages/order/successful.vue index f6fced702a445b4707e27795f1d1f87240777526..a6fd18a1b9a3816593684c7e288fb5532806384b 100644 --- a/src/pages/order/successful.vue +++ b/src/pages/order/successful.vue @@ -1,479 +1,478 @@ \ No newline at end of file + diff --git a/src/pages/other/web.vue b/src/pages/other/web.vue new file mode 100644 index 0000000000000000000000000000000000000000..405dca6894e7f45e39bb9d51b9feefac3be17bed --- /dev/null +++ b/src/pages/other/web.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/pages/page/index.vue b/src/pages/page/index.vue index 5bf967181e3afa634e6675e5bdecb91a2a1a2b27..3577529f6e40c53f4bee5d87dd84fc1f22f42f18 100644 --- a/src/pages/page/index.vue +++ b/src/pages/page/index.vue @@ -1,23 +1,109 @@ + \ No newline at end of file + diff --git a/src/pages/user/components/he-copyright.vue b/src/pages/user/components/he-copyright.vue index 62805b99f42038d7dfc987e50549edb6a4749309..81c95a6877bc0f5a6982a85a909b7af7874a6232 100644 --- a/src/pages/user/components/he-copyright.vue +++ b/src/pages/user/components/he-copyright.vue @@ -1,33 +1,53 @@ \ No newline at end of file + diff --git a/src/pages/user/components/user-features.vue b/src/pages/user/components/user-features.vue index 9b27800d7ce9c0741697e353734d98fb22737ec8..c9e42e6f0e9a12cc1835195ba4ec21fd5c9e8353 100644 --- a/src/pages/user/components/user-features.vue +++ b/src/pages/user/components/user-features.vue @@ -1,12 +1,18 @@ @@ -62,22 +68,24 @@ 电话客服 - {{ - storeSetting.contact.phone.time - }} + {{ storeSetting.contact.phone.time }} - + 选择性别 - + - + - + - + - - - - - 确定 + + 确定 @@ -96,58 +113,93 @@ - + - {{getYear(index)-1}}年 + {{ getYear(index) - 1 }}年 - {{getYear(index)}}年 + {{ getYear(index) }}年 - + - {{(index)}}月 + {{ index }}月 - {{(index+1)}}月 + {{ index + 1 }}月 - + - {{(index)}}日 + {{ index }}日 - {{(index+1)}}日 + {{ index + 1 }}日 - - - - - 确定 + + 确定 diff --git a/src/resources.scss b/src/resources.scss index 2019f70c6d087f53da75f0c8bb027201a120df1e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/src/resources.scss +++ b/src/resources.scss @@ -1,6 +0,0 @@ -/* -* @Author: qinuoyun -* @Date: 2021-02-02 14:29:58 -* @Last Modified by: qinuoyun -* @Last Modified time: 2021-02-23 11:48:32 -*/ diff --git a/src/siteinfo.js b/src/siteinfo.js index 5f53a0b039682a25329328d48ec886b8629760b5..fe5141b80e60ac85d994c2f4aca455921e83367f 100644 --- a/src/siteinfo.js +++ b/src/siteinfo.js @@ -1,10 +1,3 @@ -/* - * @Description: - * @Author: fjt - * @Date: 2021-05-24 13:22:32 - * @LastEditTime: 2021-06-18 09:59:34 - * @LastEditors: fjt - */ module.exports = { - "siteroot": "" + siteroot: '' }; diff --git a/src/static/h5/js/wechat.js b/src/static/h5/js/wechat.js index 022a4ac0c4d912d6d043a11986509beb3a217601..a25945dc1c640a527e662548a2ab2ceb5ac55a36 100644 --- a/src/static/h5/js/wechat.js +++ b/src/static/h5/js/wechat.js @@ -1,155 +1,162 @@ -import Vue from "vue"; +import Vue from 'vue'; function isWechat() { - let mic = window.navigator.userAgent.toLowerCase().match(/micromessenger/i); - return mic && mic[0] === 'micromessenger' ? 1 : 0; + let mic = window.navigator.userAgent.toLowerCase().match(/micromessenger/i); + return mic && mic[0] === 'micromessenger' ? 1 : 0; } function call() { - let whiteList = [ - "/pages/order/submit" - ] - let pathname = window.location.pathname; - pathname = pathname.split("?")[0]; - if (whiteList.indexOf(pathname) > -1) { - init(); - } + let whiteList = ['/pages/order/submit']; + let pathname = window.location.pathname; + pathname = pathname.split('?')[0]; + if (whiteList.indexOf(pathname) > -1) { + init(); + } } -function init(callback, jsApiList = [ - "chooseWXPay", - "hideAllNonBaseMenuItem", - "showMenuItems", - "onMenuShareAppMessage", - "updateTimelineShareData", - "onMenuShareTimeline", - "hideMenuItems" -]) { - if (isWechat()) { - let url = window.location.href.split('#')[0]; - Vue.prototype.$heshop.jssdk('get', { - url: url - }).then((e) => { - let config = { - debug: false, - appId: e.appid, - timestamp: e.timestamp, - nonceStr: e.noncestr, - signature: e.signature, - jsApiList: jsApiList, - openTagList: ['wx-open-subscribe'] - }; - jWeixin.config(config); - jWeixin.error(err => { - console.error('config fail:', err); - }); - jWeixin.ready(() => { - if (callback) callback(jWeixin); - }); +function init( + callback, + jsApiList = [ + 'chooseWXPay', + 'hideAllNonBaseMenuItem', + 'showMenuItems', + 'onMenuShareAppMessage', + 'updateTimelineShareData', + 'onMenuShareTimeline', + 'hideMenuItems' + ] +) { + if (isWechat()) { + let url = window.location.href.split('#')[0]; + Vue.prototype.$heshop + .jssdk('get', { + url: url + }) + .then(e => { + let config = { + debug: false, + appId: e.appid, + timestamp: e.timestamp, + nonceStr: e.noncestr, + signature: e.signature, + jsApiList: jsApiList, + openTagList: ['wx-open-subscribe', 'wx-open-launch-weapp'] + }; + jWeixin.config(config); + jWeixin.error(err => { + console.error('config fail:', err); }); - } + jWeixin.ready(() => { + if (callback) callback(jWeixin); + }); + }); + } } -function chooseWXPay({ - timestamp, - nonceStr, - packAge, - signType, - paySign, - success, - fail, - cancel -}) { - jWeixin.chooseWXPay({ - timestamp: timestamp, - nonceStr: nonceStr, - package: packAge, - signType: signType, - paySign: paySign, - success: function (res) { - success && success(res); - }, - fail: function (err) { - fail && fail(err); - - }, - cancel: function (res) { - cancel && cancel(res); - }, - complete: function () {} - }); +function chooseWXPay({ timestamp, nonceStr, packAge, signType, paySign, success, fail, cancel }) { + jWeixin.chooseWXPay({ + timestamp: timestamp, + nonceStr: nonceStr, + package: packAge, + signType: signType, + paySign: paySign, + success: function (res) { + success && success(res); + }, + fail: function (err) { + fail && fail(err); + }, + cancel: function (res) { + cancel && cancel(res); + }, + complete: function () {} + }); } function hideAllNonBaseMenuItem() { - init(function (jssdk) { - jssdk.hideAllNonBaseMenuItem(); - }); + init(function (jssdk) { + jssdk.hideAllNonBaseMenuItem(); + }); } // 批量显示功能按钮接口 -function showMenuItems({ - menuList = [] -}) { - init(function (jssdk) { - jssdk.showMenuItems({ - menuList: menuList // 要显示的菜单项 - }); - }, ["showMenuItems"]); +function showMenuItems({ menuList = [] }) { + init( + function (jssdk) { + jssdk.showMenuItems({ + menuList: menuList // 要显示的菜单项 + }); + }, + ['showMenuItems'] + ); } // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮 -function hideMenuItems({ - menuList = [] -}) { - init(function (jssdk) { - jssdk.hideMenuItems({ - menuList: menuList - }); - }, ["hideMenuItems"]); +function hideMenuItems({ menuList = [] }) { + init( + function (jssdk) { + jssdk.hideMenuItems({ + menuList: menuList + }); + }, + ['hideMenuItems'] + ); } // 分享 -function updateShareData({ - title = '', - desc = ' ', - path = '', - imageUrl = '' -}) { - let { - origin, - pathname, - } = window.location; - init(function (jssdk) { - // 分享给用户 - jssdk.onMenuShareAppMessage({ - title: title, // 分享标题 - desc: desc, // 分享描述 - link: origin + pathname + "?r=wechat#" + path, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: imageUrl, // 分享图标 - type: 'link' // 如果type是music或video,则要提供数据链接,默认为空 - }); - // 分享到朋友圈 - jssdk.updateTimelineShareData({ - title: title, // 分享标题 - link: origin + pathname + "?r=wechat#" + path, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: imageUrl, // 分享图标 - }); - // 兼容分享到朋友圈(官网已经说废弃) - jssdk.onMenuShareTimeline({ - title: title, // 分享标题 - link: origin + pathname + "?r=wechat#" + path, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: imageUrl, // 分享图标 - }); - }, ["onMenuShareAppMessage", "updateTimelineShareData", "onMenuShareTimeline"]) +function updateShareData({ title = '', desc = ' ', path = '', imageUrl = '' }) { + let { origin, pathname } = window.location; + init( + function (jssdk) { + // 分享给用户 + jssdk.onMenuShareAppMessage({ + title: title, // 分享标题 + desc: desc, // 分享描述 + link: origin + pathname + '?r=wechat#' + path, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: imageUrl, // 分享图标 + type: 'link' // 如果type是music或video,则要提供数据链接,默认为空 + }); + // 分享到朋友圈 + jssdk.updateTimelineShareData({ + title: title, // 分享标题 + link: origin + pathname + '?r=wechat#' + path, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: imageUrl // 分享图标 + }); + // 兼容分享到朋友圈(官网已经说废弃) + jssdk.onMenuShareTimeline({ + title: title, // 分享标题 + link: origin + pathname + '?r=wechat#' + path, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: imageUrl // 分享图标 + }); + }, + ['onMenuShareAppMessage', 'updateTimelineShareData', 'onMenuShareTimeline'] + ); +} + +// 获取定位 +function getLocation({ success }) { + init( + function (jssdk) { + jssdk.getLocation({ + type: 'wgs84', + success(response) { + success && success(response); + }, + fail() {} + }); + }, + ['getLocation'] + ); } export default { - isWechat, - showMenuItems, - hideAllNonBaseMenuItem, - chooseWXPay, - updateShareData, - init, - call, - hideMenuItems -} \ No newline at end of file + isWechat, + showMenuItems, + hideAllNonBaseMenuItem, + chooseWXPay, + updateShareData, + init, + call, + hideMenuItems, + getLocation +}; diff --git a/src/static/mp-weixin/js/qqmap-wx-jssdk.js b/src/static/mp-weixin/js/qqmap-wx-jssdk.js index 9724e31f820e0b25283b3167f5f31b36701df12a..f63e9d9f3d193259ee53fb8ba0b2d88a1498910f 100644 --- a/src/static/mp-weixin/js/qqmap-wx-jssdk.js +++ b/src/static/mp-weixin/js/qqmap-wx-jssdk.js @@ -1,20 +1,20 @@ /** * 微信小程序JavaScriptSDK - * + * * @version 1.2 * @date 2019-03-06 * @author v_ylyue@tencent.com */ var ERROR_CONF = { - KEY_ERR: 311, - KEY_ERR_MSG: 'key格式错误', - PARAM_ERR: 310, - PARAM_ERR_MSG: '请求参数信息有误', - SYSTEM_ERR: 600, - SYSTEM_ERR_MSG: '系统错误', - WX_ERR_CODE: 1000, - WX_OK_CODE: 200 + KEY_ERR: 311, + KEY_ERR_MSG: 'key格式错误', + PARAM_ERR: 310, + PARAM_ERR_MSG: '请求参数信息有误', + SYSTEM_ERR: 600, + SYSTEM_ERR_MSG: '系统错误', + WX_ERR_CODE: 1000, + WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; @@ -31,9 +31,9 @@ var MODE = { var EARTH_RADIUS = 6378136.49; var Utils = { /** - * md5加密方法 - * 版权所有©2011 Sebastian Tschan,https://blueimp.net - */ + * md5加密方法 + * 版权所有©2011 Sebastian Tschan,https://blueimp.net + */ safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); @@ -59,8 +59,8 @@ var Utils = { }, binlMD5(x, len) { /* append padding */ - x[len >> 5] |= 0x80 << (len % 32); - x[((len + 64) >>> 9 << 4) + 14] = len; + x[len >> 5] |= 0x80 << len % 32; + x[(((len + 64) >>> 9) << 4) + 14] = len; var i; var olda; @@ -158,7 +158,7 @@ var Utils = { var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { - output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff); + output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff); } return output; }, @@ -171,7 +171,7 @@ var Utils = { } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { - output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32); + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32; } return output; }, @@ -244,9 +244,11 @@ var Utils = { getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; - Object.keys(requestParam).sort().forEach(function(key){ - requestArr.push(key + '=' + requestParam[key]); - }); + Object.keys(requestParam) + .sort() + .forEach(function (key) { + requestArr.push(key + '=' + requestParam[key]); + }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk; } @@ -274,760 +276,820 @@ var Utils = { sig = this.md5(sig); return sig; }, - /** - * 得到终点query字符串 - * @param {Array|String} 检索数据 - */ - location2query(data) { - if (typeof data == 'string') { - return data; - } - var query = ''; - for (var i = 0; i < data.length; i++) { - var d = data[i]; - if (!!query) { - query += ';'; - } - if (d.location) { - query = query + d.location.lat + ',' + d.location.lng; - } - if (d.latitude && d.longitude) { - query = query + d.latitude + ',' + d.longitude; - } - } - return query; - }, - - /** - * 计算角度 - */ - rad(d) { - return d * Math.PI / 180.0; - }, - /** - * 处理终点location数组 - * @return 返回终点数组 - */ - getEndLocation(location){ - var to = location.split(';'); - var endLocation = []; - for (var i = 0; i < to.length; i++) { - endLocation.push({ - lat: parseFloat(to[i].split(',')[0]), - lng: parseFloat(to[i].split(',')[1]) - }) + /** + * 得到终点query字符串 + * @param {Array|String} 检索数据 + */ + location2query(data) { + if (typeof data == 'string') { + return data; + } + var query = ''; + for (var i = 0; i < data.length; i++) { + var d = data[i]; + if (!!query) { + query += ';'; } - return endLocation; - }, - - /** - * 计算两点间直线距离 - * @param a 表示纬度差 - * @param b 表示经度差 - * @return 返回的是距离,单位m - */ - getDistance(latFrom, lngFrom, latTo, lngTo) { - var radLatFrom = this.rad(latFrom); - var radLatTo = this.rad(latTo); - var a = radLatFrom - radLatTo; - var b = this.rad(lngFrom) - this.rad(lngTo); - var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); - distance = distance * EARTH_RADIUS; - distance = Math.round(distance * 10000) / 10000; - return parseFloat(distance.toFixed(0)); - }, - /** - * 使用微信接口进行定位 - */ - getWXLocation(success, fail, complete) { - wx.getLocation({ - type: 'gcj02', - success: success, - fail: fail, - complete: complete - }); - }, - - /** - * 获取location参数 - */ - getLocationParam(location) { - if (typeof location == 'string') { - var locationArr = location.split(','); - if (locationArr.length === 2) { - location = { - latitude: location.split(',')[0], - longitude: location.split(',')[1] - }; - } else { - location = {}; - } - } - return location; - }, - - /** - * 回调函数默认处理 - */ - polyfillParam(param) { - param.success = param.success || function () { }; - param.fail = param.fail || function () { }; - param.complete = param.complete || function () { }; - }, - - /** - * 验证param对应的key值是否为空 - * - * @param {Object} param 接口参数 - * @param {String} key 对应参数的key - */ - checkParamKeyEmpty(param, key) { - if (!param[key]) { - var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误'); - param.fail(errconf); - param.complete(errconf); - return true; - } - return false; - }, - - /** - * 验证参数中是否存在检索词keyword - * - * @param {Object} param 接口参数 - */ - checkKeyword(param){ - return !this.checkParamKeyEmpty(param, 'keyword'); - }, - - /** - * 验证location值 - * - * @param {Object} param 接口参数 - */ - checkLocation(param) { - var location = this.getLocationParam(param.location); - if (!location || !location.latitude || !location.longitude) { - var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); - param.fail(errconf); - param.complete(errconf); - return false; - } - return true; - }, - - /** - * 构造错误数据结构 - * @param {Number} errCode 错误码 - * @param {Number} errMsg 错误描述 - */ - buildErrorConfig(errCode, errMsg) { - return { - status: errCode, - message: errMsg + if (d.location) { + query = query + d.location.lat + ',' + d.location.lng; + } + if (d.latitude && d.longitude) { + query = query + d.latitude + ',' + d.longitude; + } + } + return query; + }, + + /** + * 计算角度 + */ + rad(d) { + return (d * Math.PI) / 180.0; + }, + /** + * 处理终点location数组 + * @return 返回终点数组 + */ + getEndLocation(location) { + var to = location.split(';'); + var endLocation = []; + for (var i = 0; i < to.length; i++) { + endLocation.push({ + lat: parseFloat(to[i].split(',')[0]), + lng: parseFloat(to[i].split(',')[1]) + }); + } + return endLocation; + }, + + /** + * 计算两点间直线距离 + * @param a 表示纬度差 + * @param b 表示经度差 + * @return 返回的是距离,单位m + */ + getDistance(latFrom, lngFrom, latTo, lngTo) { + var radLatFrom = this.rad(latFrom); + var radLatTo = this.rad(latTo); + var a = radLatFrom - radLatTo; + var b = this.rad(lngFrom) - this.rad(lngTo); + var distance = + 2 * + Math.asin( + Math.sqrt( + Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2) + ) + ); + distance = distance * EARTH_RADIUS; + distance = Math.round(distance * 10000) / 10000; + return parseFloat(distance.toFixed(0)); + }, + /** + * 使用微信接口进行定位 + */ + getWXLocation(success, fail, complete) { + wx.getLocation({ + type: 'gcj02', + success: success, + fail: fail, + complete: complete + }); + }, + + /** + * 获取location参数 + */ + getLocationParam(location) { + if (typeof location == 'string') { + var locationArr = location.split(','); + if (locationArr.length === 2) { + location = { + latitude: location.split(',')[0], + longitude: location.split(',')[1] }; - }, - - /** - * - * 数据处理函数 - * 根据传入参数不同处理不同数据 - * @param {String} feature 功能名称 - * search 地点搜索 - * suggest关键词提示 - * reverseGeocoder逆地址解析 - * geocoder地址解析 - * getCityList获取城市列表:父集 - * getDistrictByCityId获取区县列表:子集 - * calculateDistance距离计算 - * @param {Object} param 接口参数 - * @param {Object} data 数据 - */ - handleData(param,data,feature){ - if (feature == 'search') { - var searchResult = data.data; - var searchSimplify = []; - for (var i = 0; i < searchResult.length; i++) { - searchSimplify.push({ - id: searchResult[i].id || null, - title: searchResult[i].title || null, - latitude: searchResult[i].location && searchResult[i].location.lat || null, - longitude: searchResult[i].location && searchResult[i].location.lng || null, - address: searchResult[i].address || null, - category: searchResult[i].category || null, - tel: searchResult[i].tel || null, - adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, - city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, - district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, - province: searchResult[i].ad_info && searchResult[i].ad_info.province || null - }) - } - param.success(data, { - searchResult: searchResult, - searchSimplify: searchSimplify - }) - } else if (feature == 'suggest') { - var suggestResult = data.data; - var suggestSimplify = []; - for (var i = 0; i < suggestResult.length; i++) { - suggestSimplify.push({ - adcode: suggestResult[i].adcode || null, - address: suggestResult[i].address || null, - category: suggestResult[i].category || null, - city: suggestResult[i].city || null, - district: suggestResult[i].district || null, - id: suggestResult[i].id || null, - latitude: suggestResult[i].location && suggestResult[i].location.lat || null, - longitude: suggestResult[i].location && suggestResult[i].location.lng || null, - province: suggestResult[i].province || null, - title: suggestResult[i].title || null, - type: suggestResult[i].type || null - }) + } else { + location = {}; + } + } + return location; + }, + + /** + * 回调函数默认处理 + */ + polyfillParam(param) { + param.success = param.success || function () {}; + param.fail = param.fail || function () {}; + param.complete = param.complete || function () {}; + }, + + /** + * 验证param对应的key值是否为空 + * + * @param {Object} param 接口参数 + * @param {String} key 对应参数的key + */ + checkParamKeyEmpty(param, key) { + if (!param[key]) { + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); + param.fail(errconf); + param.complete(errconf); + return true; + } + return false; + }, + + /** + * 验证参数中是否存在检索词keyword + * + * @param {Object} param 接口参数 + */ + checkKeyword(param) { + return !this.checkParamKeyEmpty(param, 'keyword'); + }, + + /** + * 验证location值 + * + * @param {Object} param 接口参数 + */ + checkLocation(param) { + var location = this.getLocationParam(param.location); + if (!location || !location.latitude || !location.longitude) { + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); + param.fail(errconf); + param.complete(errconf); + return false; + } + return true; + }, + + /** + * 构造错误数据结构 + * @param {Number} errCode 错误码 + * @param {Number} errMsg 错误描述 + */ + buildErrorConfig(errCode, errMsg) { + return { + status: errCode, + message: errMsg + }; + }, + + /** + * + * 数据处理函数 + * 根据传入参数不同处理不同数据 + * @param {String} feature 功能名称 + * search 地点搜索 + * suggest关键词提示 + * reverseGeocoder逆地址解析 + * geocoder地址解析 + * getCityList获取城市列表:父集 + * getDistrictByCityId获取区县列表:子集 + * calculateDistance距离计算 + * @param {Object} param 接口参数 + * @param {Object} data 数据 + */ + handleData(param, data, feature) { + if (feature == 'search') { + var searchResult = data.data; + var searchSimplify = []; + for (var i = 0; i < searchResult.length; i++) { + searchSimplify.push({ + id: searchResult[i].id || null, + title: searchResult[i].title || null, + latitude: (searchResult[i].location && searchResult[i].location.lat) || null, + longitude: (searchResult[i].location && searchResult[i].location.lng) || null, + address: searchResult[i].address || null, + category: searchResult[i].category || null, + tel: searchResult[i].tel || null, + adcode: (searchResult[i].ad_info && searchResult[i].ad_info.adcode) || null, + city: (searchResult[i].ad_info && searchResult[i].ad_info.city) || null, + district: (searchResult[i].ad_info && searchResult[i].ad_info.district) || null, + province: (searchResult[i].ad_info && searchResult[i].ad_info.province) || null + }); + } + param.success(data, { + searchResult: searchResult, + searchSimplify: searchSimplify + }); + } else if (feature == 'suggest') { + var suggestResult = data.data; + var suggestSimplify = []; + for (var i = 0; i < suggestResult.length; i++) { + suggestSimplify.push({ + adcode: suggestResult[i].adcode || null, + address: suggestResult[i].address || null, + category: suggestResult[i].category || null, + city: suggestResult[i].city || null, + district: suggestResult[i].district || null, + id: suggestResult[i].id || null, + latitude: (suggestResult[i].location && suggestResult[i].location.lat) || null, + longitude: (suggestResult[i].location && suggestResult[i].location.lng) || null, + province: suggestResult[i].province || null, + title: suggestResult[i].title || null, + type: suggestResult[i].type || null + }); + } + param.success(data, { + suggestResult: suggestResult, + suggestSimplify: suggestSimplify + }); + } else if (feature == 'reverseGeocoder') { + var reverseGeocoderResult = data.result; + var reverseGeocoderSimplify = { + address: reverseGeocoderResult.address || null, + latitude: (reverseGeocoderResult.location && reverseGeocoderResult.location.lat) || null, + longitude: (reverseGeocoderResult.location && reverseGeocoderResult.location.lng) || null, + adcode: (reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode) || null, + city: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city) || null, + district: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district) || null, + nation: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation) || null, + province: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province) || null, + street: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street) || null, + street_number: + (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number) || null, + recommend: + (reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend) || null, + rough: (reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough) || null + }; + if (reverseGeocoderResult.pois) { + //判断是否返回周边poi + var pois = reverseGeocoderResult.pois; + var poisSimplify = []; + for (var i = 0; i < pois.length; i++) { + poisSimplify.push({ + id: pois[i].id || null, + title: pois[i].title || null, + latitude: (pois[i].location && pois[i].location.lat) || null, + longitude: (pois[i].location && pois[i].location.lng) || null, + address: pois[i].address || null, + category: pois[i].category || null, + adcode: (pois[i].ad_info && pois[i].ad_info.adcode) || null, + city: (pois[i].ad_info && pois[i].ad_info.city) || null, + district: (pois[i].ad_info && pois[i].ad_info.district) || null, + province: (pois[i].ad_info && pois[i].ad_info.province) || null + }); } param.success(data, { - suggestResult: suggestResult, - suggestSimplify: suggestSimplify - }) - } else if (feature == 'reverseGeocoder') { - var reverseGeocoderResult = data.result; - var reverseGeocoderSimplify = { - address: reverseGeocoderResult.address || null, - latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, - longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, - adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, - city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, - district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, - nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, - province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, - street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, - street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, - recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, - rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null - }; - if (reverseGeocoderResult.pois) {//判断是否返回周边poi - var pois = reverseGeocoderResult.pois; - var poisSimplify = []; - for (var i = 0;i < pois.length;i++) { - poisSimplify.push({ - id: pois[i].id || null, - title: pois[i].title || null, - latitude: pois[i].location && pois[i].location.lat || null, - longitude: pois[i].location && pois[i].location.lng || null, - address: pois[i].address || null, - category: pois[i].category || null, - adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, - city: pois[i].ad_info && pois[i].ad_info.city || null, - district: pois[i].ad_info && pois[i].ad_info.district || null, - province: pois[i].ad_info && pois[i].ad_info.province || null - }) - } - param.success(data,{ - reverseGeocoderResult: reverseGeocoderResult, - reverseGeocoderSimplify: reverseGeocoderSimplify, - pois: pois, - poisSimplify: poisSimplify - }) - } else { - param.success(data, { - reverseGeocoderResult: reverseGeocoderResult, - reverseGeocoderSimplify: reverseGeocoderSimplify - }) - } - } else if (feature == 'geocoder') { - var geocoderResult = data.result; - var geocoderSimplify = { - title: geocoderResult.title || null, - latitude: geocoderResult.location && geocoderResult.location.lat || null, - longitude: geocoderResult.location && geocoderResult.location.lng || null, - adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, - province: geocoderResult.address_components && geocoderResult.address_components.province || null, - city: geocoderResult.address_components && geocoderResult.address_components.city || null, - district: geocoderResult.address_components && geocoderResult.address_components.district || null, - street: geocoderResult.address_components && geocoderResult.address_components.street || null, - street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, - level: geocoderResult.level || null - }; - param.success(data,{ - geocoderResult: geocoderResult, - geocoderSimplify: geocoderSimplify - }); - } else if (feature == 'getCityList') { - var provinceResult = data.result[0]; - var cityResult = data.result[1]; - var districtResult = data.result[2]; - param.success(data,{ - provinceResult: provinceResult, - cityResult: cityResult, - districtResult: districtResult + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify, + pois: pois, + poisSimplify: poisSimplify }); - } else if (feature == 'getDistrictByCityId') { - var districtByCity = data.result[0]; - param.success(data, districtByCity); - } else if (feature == 'calculateDistance') { - var calculateDistanceResult = data.result.elements; - var distance = []; - for (var i = 0; i < calculateDistanceResult.length; i++){ - distance.push(calculateDistanceResult[i].distance); - } + } else { param.success(data, { - calculateDistanceResult: calculateDistanceResult, - distance: distance - }); - } else if (feature == 'direction') { - var direction = data.result.routes; - param.success(data,direction); + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify + }); + } + } else if (feature == 'geocoder') { + var geocoderResult = data.result; + var geocoderSimplify = { + title: geocoderResult.title || null, + latitude: (geocoderResult.location && geocoderResult.location.lat) || null, + longitude: (geocoderResult.location && geocoderResult.location.lng) || null, + adcode: (geocoderResult.ad_info && geocoderResult.ad_info.adcode) || null, + province: (geocoderResult.address_components && geocoderResult.address_components.province) || null, + city: (geocoderResult.address_components && geocoderResult.address_components.city) || null, + district: (geocoderResult.address_components && geocoderResult.address_components.district) || null, + street: (geocoderResult.address_components && geocoderResult.address_components.street) || null, + street_number: (geocoderResult.address_components && geocoderResult.address_components.street_number) || null, + level: geocoderResult.level || null + }; + param.success(data, { + geocoderResult: geocoderResult, + geocoderSimplify: geocoderSimplify + }); + } else if (feature == 'getCityList') { + var provinceResult = data.result[0]; + var cityResult = data.result[1]; + var districtResult = data.result[2]; + param.success(data, { + provinceResult: provinceResult, + cityResult: cityResult, + districtResult: districtResult + }); + } else if (feature == 'getDistrictByCityId') { + var districtByCity = data.result[0]; + param.success(data, districtByCity); + } else if (feature == 'calculateDistance') { + var calculateDistanceResult = data.result.elements; + var distance = []; + for (var i = 0; i < calculateDistanceResult.length; i++) { + distance.push(calculateDistanceResult[i].distance); + } + param.success(data, { + calculateDistanceResult: calculateDistanceResult, + distance: distance + }); + } else if (feature == 'direction') { + var direction = data.result.routes; + param.success(data, direction); + } else { + param.success(data); + } + }, + + /** + * 构造微信请求参数,公共属性处理 + * + * @param {Object} param 接口参数 + * @param {Object} param 配置项 + * @param {String} feature 方法名 + */ + buildWxRequestConfig(param, options, feature) { + var that = this; + options.header = { 'content-type': 'application/json' }; + options.method = 'GET'; + options.success = function (res) { + var data = res.data; + if (data.status === 0) { + that.handleData(param, data, feature); } else { - param.success(data); + param.fail(data); } - }, - - /** - * 构造微信请求参数,公共属性处理 - * - * @param {Object} param 接口参数 - * @param {Object} param 配置项 - * @param {String} feature 方法名 - */ - buildWxRequestConfig(param, options, feature) { - var that = this; - options.header = { "content-type": "application/json" }; - options.method = 'GET'; - options.success = function (res) { - var data = res.data; - if (data.status === 0) { - that.handleData(param, data, feature); - } else { - param.fail(data); - } - }; - options.fail = function (res) { - res.statusCode = ERROR_CONF.WX_ERR_CODE; - param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); - }; - options.complete = function (res) { - var statusCode = +res.statusCode; - switch(statusCode) { - case ERROR_CONF.WX_ERR_CODE: { - param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); - break; - } - case ERROR_CONF.WX_OK_CODE: { - var data = res.data; - if (data.status === 0) { - param.complete(data); - } else { - param.complete(that.buildErrorConfig(data.status, data.message)); - } - break; - } - default:{ - param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)); - } + }; + options.fail = function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + options.complete = function (res) { + var statusCode = +res.statusCode; + switch (statusCode) { + case ERROR_CONF.WX_ERR_CODE: { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + break; + } + case ERROR_CONF.WX_OK_CODE: { + var data = res.data; + if (data.status === 0) { + param.complete(data); + } else { + param.complete(that.buildErrorConfig(data.status, data.message)); + } + break; + } + default: { + param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)); + } + } + }; + return options; + }, - } - }; - return options; - }, - - /** - * 处理用户参数是否传入坐标进行不同的处理 - */ - locationProcess(param, locationsuccess, locationfail, locationcomplete) { - var that = this; - locationfail = locationfail || function (res) { - res.statusCode = ERROR_CONF.WX_ERR_CODE; - param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); - }; - locationcomplete = locationcomplete || function (res) { - if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { - param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); - } - }; - if (!param.location) { - that.getWXLocation(locationsuccess, locationfail, locationcomplete); - } else if (that.checkLocation(param)) { - var location = Utils.getLocationParam(param.location); - locationsuccess(location); + /** + * 处理用户参数是否传入坐标进行不同的处理 + */ + locationProcess(param, locationsuccess, locationfail, locationcomplete) { + var that = this; + locationfail = + locationfail || + function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + locationcomplete = + locationcomplete || + function (res) { + if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); } + }; + if (!param.location) { + that.getWXLocation(locationsuccess, locationfail, locationcomplete); + } else if (that.checkLocation(param)) { + var location = Utils.getLocationParam(param.location); + locationsuccess(location); } + } }; - class QQMapWX { + /** + * 构造函数 + * + * @param {Object} options 接口参数,key 为必选参数 + */ + constructor(options) { + if (!options.key) { + throw Error('key值不能为空'); + } + this.key = options.key; + } - /** - * 构造函数 - * - * @param {Object} options 接口参数,key 为必选参数 - */ - constructor(options) { - if (!options.key) { - throw Error('key值不能为空'); - } - this.key = options.key; + /** + * POI周边检索 + * + * @param {Object} options 接口参数对象 + * + * 参数对象结构可以参考 + * @see http://lbs.qq.com/webservice_v1/guide-search.html + */ + search(options) { + var that = this; + options = options || {}; + + Utils.polyfillParam(options); + + if (!Utils.checkKeyword(options)) { + return; + } + + var requestParam = { + keyword: options.keyword, + orderby: options.orderby || '_distance', + page_size: options.page_size || 10, + page_index: options.page_index || 1, + output: 'json', + key: that.key }; - /** - * POI周边检索 - * - * @param {Object} options 接口参数对象 - * - * 参数对象结构可以参考 - * @see http://lbs.qq.com/webservice_v1/guide-search.html - */ - search(options) { - var that = this; - options = options || {}; - - Utils.polyfillParam(options); - - if (!Utils.checkKeyword(options)) { - return; - } + if (options.address_format) { + requestParam.address_format = options.address_format; + } - var requestParam = { - keyword: options.keyword, - orderby: options.orderby || '_distance', - page_size: options.page_size || 10, - page_index: options.page_index || 1, - output: 'json', - key: that.key - }; + if (options.filter) { + requestParam.filter = options.filter; + } - if (options.address_format) { - requestParam.address_format = options.address_format; - } + var distance = options.distance || '1000'; + var auto_extend = options.auto_extend || 1; + var region = null; + var rectangle = null; - if (options.filter) { - requestParam.filter = options.filter; - } + //判断城市限定参数 + if (options.region) { + region = options.region; + } - var distance = options.distance || "1000"; - var auto_extend = options.auto_extend || 1; - var region = null; - var rectangle = null; + //矩形限定坐标(暂时只支持字符串格式) + if (options.rectangle) { + rectangle = options.rectangle; + } - //判断城市限定参数 - if (options.region) { - region = options.region; + var locationsuccess = function (result) { + if (region && !rectangle) { + //城市限定参数拼接 + requestParam.boundary = + 'region(' + region + ',' + auto_extend + ',' + result.latitude + ',' + result.longitude + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); } - - //矩形限定坐标(暂时只支持字符串格式) - if (options.rectangle) { - rectangle = options.rectangle; + } else if (rectangle && !region) { + //矩形搜索 + requestParam.boundary = 'rectangle(' + rectangle + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); } - - var locationsuccess = function (result) { - if (region && !rectangle) { - //城市限定参数拼接 - requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); - } - } else if (rectangle && !region) { - //矩形搜索 - requestParam.boundary = "rectangle(" + rectangle + ")"; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); - } - } else { - requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); - } - } - wx.request(Utils.buildWxRequestConfig(options, { - url: URL_SEARCH, - data: requestParam - }, 'search')); - }; - Utils.locationProcess(options, locationsuccess); + } else { + requestParam.boundary = + 'nearby(' + result.latitude + ',' + result.longitude + ',' + distance + ',' + auto_extend + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } + wx.request( + Utils.buildWxRequestConfig( + options, + { + url: URL_SEARCH, + data: requestParam + }, + 'search' + ) + ); }; + Utils.locationProcess(options, locationsuccess); + } - /** - * sug模糊检索 - * - * @param {Object} options 接口参数对象 - * - * 参数对象结构可以参考 - * http://lbs.qq.com/webservice_v1/guide-suggestion.html - */ - getSuggestion(options) { - var that = this; - options = options || {}; - Utils.polyfillParam(options); - - if (!Utils.checkKeyword(options)) { - return; - } + /** + * sug模糊检索 + * + * @param {Object} options 接口参数对象 + * + * 参数对象结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-suggestion.html + */ + getSuggestion(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); - var requestParam = { - keyword: options.keyword, - region: options.region || '全国', - region_fix: options.region_fix || 0, - policy: options.policy || 0, - page_size: options.page_size || 10,//控制显示条数 - page_index: options.page_index || 1,//控制页数 - get_subpois : options.get_subpois || 0,//返回子地点 - output: 'json', - key: that.key - }; - //长地址 - if (options.address_format) { - requestParam.address_format = options.address_format; - } - //过滤 - if (options.filter) { - requestParam.filter = options.filter; + if (!Utils.checkKeyword(options)) { + return; + } + + var requestParam = { + keyword: options.keyword, + region: options.region || '全国', + region_fix: options.region_fix || 0, + policy: options.policy || 0, + page_size: options.page_size || 10, //控制显示条数 + page_index: options.page_index || 1, //控制页数 + get_subpois: options.get_subpois || 0, //返回子地点 + output: 'json', + key: that.key + }; + //长地址 + if (options.address_format) { + requestParam.address_format = options.address_format; + } + //过滤 + if (options.filter) { + requestParam.filter = options.filter; + } + //排序 + if (options.location) { + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); } - //排序 - if (options.location) { - var locationsuccess = function (result) { - requestParam.location = result.latitude + ',' + result.longitude; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); - } - wx.request(Utils.buildWxRequestConfig(options, { + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_SUGGESTION, data: requestParam - }, "suggest")); - }; - Utils.locationProcess(options, locationsuccess); - } else { - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); - } - wx.request(Utils.buildWxRequestConfig(options, { + }, + 'suggest' + ) + ); + }; + Utils.locationProcess(options, locationsuccess); + } else { + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_SUGGESTION, data: requestParam - }, "suggest")); - } - }; + }, + 'suggest' + ) + ); + } + } - /** - * 逆地址解析 - * - * @param {Object} options 接口参数对象 - * - * 请求参数结构可以参考 - * http://lbs.qq.com/webservice_v1/guide-gcoder.html - */ - reverseGeocoder(options) { - var that = this; - options = options || {}; - Utils.polyfillParam(options); - var requestParam = { - coord_type: options.coord_type || 5, - get_poi: options.get_poi || 0, - output: 'json', - key: that.key - }; - if (options.poi_options) { - requestParam.poi_options = options.poi_options - } + /** + * 逆地址解析 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-gcoder.html + */ + reverseGeocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { + coord_type: options.coord_type || 5, + get_poi: options.get_poi || 0, + output: 'json', + key: that.key + }; + if (options.poi_options) { + requestParam.poi_options = options.poi_options; + } - var locationsuccess = function (result) { - requestParam.location = result.latitude + ',' + result.longitude; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder'); - } - wx.request(Utils.buildWxRequestConfig(options, { - url: URL_GET_GEOCODER, - data: requestParam - }, 'reverseGeocoder')); - }; - Utils.locationProcess(options, locationsuccess); + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { + url: URL_GET_GEOCODER, + data: requestParam + }, + 'reverseGeocoder' + ) + ); }; + Utils.locationProcess(options, locationsuccess); + } - /** - * 地址解析 - * - * @param {Object} options 接口参数对象 - * - * 请求参数结构可以参考 - * http://lbs.qq.com/webservice_v1/guide-geocoder.html - */ - geocoder(options) { - var that = this; - options = options || {}; - Utils.polyfillParam(options); - - if (Utils.checkParamKeyEmpty(options, 'address')) { - return; - } + /** + * 地址解析 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-geocoder.html + */ + geocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); - var requestParam = { - address: options.address, - output: 'json', - key: that.key - }; + if (Utils.checkParamKeyEmpty(options, 'address')) { + return; + } - //城市限定 - if (options.region) { - requestParam.region = options.region; - } + var requestParam = { + address: options.address, + output: 'json', + key: that.key + }; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder'); - } + //城市限定 + if (options.region) { + requestParam.region = options.region; + } - wx.request(Utils.buildWxRequestConfig(options, { - url: URL_GET_GEOCODER, - data: requestParam - },'geocoder')); + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder'); + } + + wx.request( + Utils.buildWxRequestConfig( + options, + { + url: URL_GET_GEOCODER, + data: requestParam + }, + 'geocoder' + ) + ); + } + + /** + * 获取城市列表 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-region.html + */ + getCityList(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { + output: 'json', + key: that.key }; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList'); + } - /** - * 获取城市列表 - * - * @param {Object} options 接口参数对象 - * - * 请求参数结构可以参考 - * http://lbs.qq.com/webservice_v1/guide-region.html - */ - getCityList(options) { - var that = this; - options = options || {}; - Utils.polyfillParam(options); - var requestParam = { - output: 'json', - key: that.key - }; + wx.request( + Utils.buildWxRequestConfig( + options, + { + url: URL_CITY_LIST, + data: requestParam + }, + 'getCityList' + ) + ); + } - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList'); - } + /** + * 获取对应城市ID的区县列表 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-region.html + */ + getDistrictByCityId(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); - wx.request(Utils.buildWxRequestConfig(options, { - url: URL_CITY_LIST, - data: requestParam - },'getCityList')); + if (Utils.checkParamKeyEmpty(options, 'id')) { + return; + } + + var requestParam = { + id: options.id || '', + output: 'json', + key: that.key }; - /** - * 获取对应城市ID的区县列表 - * - * @param {Object} options 接口参数对象 - * - * 请求参数结构可以参考 - * http://lbs.qq.com/webservice_v1/guide-region.html - */ - getDistrictByCityId(options) { - var that = this; - options = options || {}; - Utils.polyfillParam(options); - - if (Utils.checkParamKeyEmpty(options, 'id')) { - return; - } + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId'); + } - var requestParam = { - id: options.id || '', - output: 'json', - key: that.key - }; + wx.request( + Utils.buildWxRequestConfig( + options, + { + url: URL_AREA_LIST, + data: requestParam + }, + 'getDistrictByCityId' + ) + ); + } - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId'); - } + /** + * 用于单起点到多终点的路线距离(非直线距离)计算: + * 支持两种距离计算方式:步行和驾车。 + * 起点到终点最大限制直线距离10公里。 + * + * 新增直线距离计算。 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-distance.html + */ + calculateDistance(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); - wx.request(Utils.buildWxRequestConfig(options, { - url: URL_AREA_LIST, - data: requestParam - },'getDistrictByCityId')); + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + + var requestParam = { + mode: options.mode || 'walking', + to: Utils.location2query(options.to), + output: 'json', + key: that.key }; - /** - * 用于单起点到多终点的路线距离(非直线距离)计算: - * 支持两种距离计算方式:步行和驾车。 - * 起点到终点最大限制直线距离10公里。 - * - * 新增直线距离计算。 - * - * @param {Object} options 接口参数对象 - * - * 请求参数结构可以参考 - * http://lbs.qq.com/webservice_v1/guide-distance.html - */ - calculateDistance(options) { - var that = this; - options = options || {}; - Utils.polyfillParam(options); - - if (Utils.checkParamKeyEmpty(options, 'to')) { - return; - } + if (options.from) { + options.location = options.from; + } - var requestParam = { - mode: options.mode || 'walking', - to: Utils.location2query(options.to), - output: 'json', - key: that.key + //计算直线距离 + if (requestParam.mode == 'straight') { + var locationsuccess = function (result) { + var locationTo = Utils.getEndLocation(requestParam.to); //处理终点坐标 + var data = { + message: 'query ok', + result: { + elements: [] + }, + status: 0 }; - - if (options.from) { - options.location = options.from; + for (var i = 0; i < locationTo.length; i++) { + data.result.elements.push({ + //将坐标存入 + distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), + duration: 0, + from: { + lat: result.latitude, + lng: result.longitude + }, + to: { + lat: locationTo[i].lat, + lng: locationTo[i].lng + } + }); } + var calculateResult = data.result.elements; + var distanceResult = []; + for (var i = 0; i < calculateResult.length; i++) { + distanceResult.push(calculateResult[i].distance); + } + return options.success(data, { + calculateResult: calculateResult, + distanceResult: distanceResult + }); + }; - //计算直线距离 - if(requestParam.mode == 'straight'){ - var locationsuccess = function (result) { - var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标 - var data = { - message:"query ok", - result:{ - elements:[] - }, - status:0 - }; - for (var i = 0; i < locationTo.length; i++) { - data.result.elements.push({//将坐标存入 - distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), - duration:0, - from:{ - lat: result.latitude, - lng:result.longitude - }, - to:{ - lat: locationTo[i].lat, - lng: locationTo[i].lng - } - }); - } - var calculateResult = data.result.elements; - var distanceResult = []; - for (var i = 0; i < calculateResult.length; i++) { - distanceResult.push(calculateResult[i].distance); - } - return options.success(data,{ - calculateResult: calculateResult, - distanceResult: distanceResult - }); - }; - - Utils.locationProcess(options, locationsuccess); - } else { - var locationsuccess = function (result) { - requestParam.from = result.latitude + ',' + result.longitude; - if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance'); - } - wx.request(Utils.buildWxRequestConfig(options, { + Utils.locationProcess(options, locationsuccess); + } else { + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_DISTANCE, data: requestParam - },'calculateDistance')); - }; + }, + 'calculateDistance' + ) + ); + }; - Utils.locationProcess(options, locationsuccess); - } - }; + Utils.locationProcess(options, locationsuccess); + } + } /** * 路线规划: - * + * * @param {Object} options 接口参数对象 - * + * * 请求参数结构可以参考 * https://lbs.qq.com/webservice_v1/guide-road.html */ @@ -1103,21 +1165,27 @@ class QQMapWX { if (options.policy) { requestParam.policy = options.policy; } - } + } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { - requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode); + requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode); } - wx.request(Utils.buildWxRequestConfig(options, { - url: SET_URL_DIRECTION, - data: requestParam - }, 'direction')); + wx.request( + Utils.buildWxRequestConfig( + options, + { + url: SET_URL_DIRECTION, + data: requestParam + }, + 'direction' + ) + ); }; Utils.locationProcess(options, locationsuccess); } -}; +} -module.exports = QQMapWX; \ No newline at end of file +module.exports = QQMapWX; diff --git a/src/static/mp-weixin/js/qqmap-wx-jssdk.min.js b/src/static/mp-weixin/js/qqmap-wx-jssdk.min.js index 8fa1477c5f8b0bf4f49ed79e2831b6b1497fe86e..a79f372d34c1cce4c18bac6b45a83aa721b344de 100644 --- a/src/static/mp-weixin/js/qqmap-wx-jssdk.min.js +++ b/src/static/mp-weixin/js/qqmap-wx-jssdk.min.js @@ -1 +1,801 @@ -var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: 'key格式错误', PARAM_ERR: 310, PARAM_ERR_MSG: '请求参数信息有误', SYSTEM_ERR: 600, SYSTEM_ERR_MSG: '系统错误', WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; var URL_CITY_LIST = BASE_URL + 'district/v1/list'; var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; var URL_DISTANCE = BASE_URL + 'distance/v1/'; var URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, location2query(data) { if (typeof data == 'string') { return data } var query = ''; for (var i = 0; i < data.length; i++) { var d = data[i]; if (!!query) { query += ';' } if (d.location) { query = query + d.location.lat + ',' + d.location.lng } if (d.latitude && d.longitude) { query = query + d.latitude + ',' + d.longitude } } return query }, rad(d) { return d * Math.PI / 180.0 }, getEndLocation(location) { var to = location.split(';'); var endLocation = []; for (var i = 0; i < to.length; i++) { endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }) } return endLocation }, getDistance(latFrom, lngFrom, latTo, lngTo) { var radLatFrom = this.rad(latFrom); var radLatTo = this.rad(latTo); var a = radLatFrom - radLatTo; var b = this.rad(lngFrom) - this.rad(lngTo); var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); distance = distance * EARTH_RADIUS; distance = Math.round(distance * 10000) / 10000; return parseFloat(distance.toFixed(0)) }, getWXLocation(success, fail, complete) { wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) }, getLocationParam(location) { if (typeof location == 'string') { var locationArr = location.split(','); if (locationArr.length === 2) { location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } } else { location = {} } } return location }, polyfillParam(param) { param.success = param.success || function () { }; param.fail = param.fail || function () { }; param.complete = param.complete || function () { } }, checkParamKeyEmpty(param, key) { if (!param[key]) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); param.fail(errconf); param.complete(errconf); return true } return false }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, checkLocation(param) { var location = this.getLocationParam(param.location); if (!location || !location.latitude || !location.longitude) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); param.fail(errconf); param.complete(errconf); return false } return true }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, handleData(param, data, feature) { if (feature == 'search') { var searchResult = data.data; var searchSimplify = []; for (var i = 0; i < searchResult.length; i++) { searchSimplify.push({ id: searchResult[i].id || null, title: searchResult[i].title || null, latitude: searchResult[i].location && searchResult[i].location.lat || null, longitude: searchResult[i].location && searchResult[i].location.lng || null, address: searchResult[i].address || null, category: searchResult[i].category || null, tel: searchResult[i].tel || null, adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, province: searchResult[i].ad_info && searchResult[i].ad_info.province || null }) } param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) } else if (feature == 'suggest') { var suggestResult = data.data; var suggestSimplify = []; for (var i = 0; i < suggestResult.length; i++) { suggestSimplify.push({ adcode: suggestResult[i].adcode || null, address: suggestResult[i].address || null, category: suggestResult[i].category || null, city: suggestResult[i].city || null, district: suggestResult[i].district || null, id: suggestResult[i].id || null, latitude: suggestResult[i].location && suggestResult[i].location.lat || null, longitude: suggestResult[i].location && suggestResult[i].location.lng || null, province: suggestResult[i].province || null, title: suggestResult[i].title || null, type: suggestResult[i].type || null }) } param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) } else if (feature == 'reverseGeocoder') { var reverseGeocoderResult = data.result; var reverseGeocoderSimplify = { address: reverseGeocoderResult.address || null, latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null }; if (reverseGeocoderResult.pois) { var pois = reverseGeocoderResult.pois; var poisSimplify = []; for (var i = 0; i < pois.length; i++) { poisSimplify.push({ id: pois[i].id || null, title: pois[i].title || null, latitude: pois[i].location && pois[i].location.lat || null, longitude: pois[i].location && pois[i].location.lng || null, address: pois[i].address || null, category: pois[i].category || null, adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, city: pois[i].ad_info && pois[i].ad_info.city || null, district: pois[i].ad_info && pois[i].ad_info.district || null, province: pois[i].ad_info && pois[i].ad_info.province || null }) } param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify, pois: pois, poisSimplify: poisSimplify }) } else { param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify }) } } else if (feature == 'geocoder') { var geocoderResult = data.result; var geocoderSimplify = { title: geocoderResult.title || null, latitude: geocoderResult.location && geocoderResult.location.lat || null, longitude: geocoderResult.location && geocoderResult.location.lng || null, adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, province: geocoderResult.address_components && geocoderResult.address_components.province || null, city: geocoderResult.address_components && geocoderResult.address_components.city || null, district: geocoderResult.address_components && geocoderResult.address_components.district || null, street: geocoderResult.address_components && geocoderResult.address_components.street || null, street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, level: geocoderResult.level || null }; param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) } else if (feature == 'getCityList') { var provinceResult = data.result[0]; var cityResult = data.result[1]; var districtResult = data.result[2]; param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }) } else if (feature == 'getDistrictByCityId') { var districtByCity = data.result[0]; param.success(data, districtByCity) } else if (feature == 'calculateDistance') { var calculateDistanceResult = data.result.elements; var distance = []; for (var i = 0; i < calculateDistanceResult.length; i++) { distance.push(calculateDistanceResult[i].distance) } param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) } else if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, buildWxRequestConfig(param, options, feature) { var that = this; options.header = { "content-type": "application/json" }; options.method = 'GET'; options.success = function (res) { var data = res.data; if (data.status === 0) { that.handleData(param, data, feature) } else { param.fail(data) } }; options.fail = function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; options.complete = function (res) { var statusCode = +res.statusCode; switch (statusCode) { case ERROR_CONF.WX_ERR_CODE: { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); break } case ERROR_CONF.WX_OK_CODE: { var data = res.data; if (data.status === 0) { param.complete(data) } else { param.complete(that.buildErrorConfig(data.status, data.message)) } break } default: { param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } } }; return options }, locationProcess(param, locationsuccess, locationfail, locationcomplete) { var that = this; locationfail = locationfail || function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; locationcomplete = locationcomplete || function (res) { if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) } }; if (!param.location) { that.getWXLocation(locationsuccess, locationfail, locationcomplete) } else if (that.checkLocation(param)) { var location = Utils.getLocationParam(param.location); locationsuccess(location) } } }; class QQMapWX { constructor(options) { if (!options.key) { throw Error('key值不能为空') } this.key = options.key }; search(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, orderby: options.orderby || '_distance', page_size: options.page_size || 10, page_index: options.page_index || 1, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } var distance = options.distance || "1000"; var auto_extend = options.auto_extend || 1; var region = null; var rectangle = null; if (options.region) { region = options.region } if (options.rectangle) { rectangle = options.rectangle } var locationsuccess = function (result) { if (region && !rectangle) { requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; getSuggestion(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, region: options.region || '全国', region_fix: options.region_fix || 0, policy: options.policy || 0, page_size: options.page_size || 10, page_index: options.page_index || 1, get_subpois: options.get_subpois || 0, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } if (options.location) { var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { coord_type: options.coord_type || 5, get_poi: options.get_poi || 0, output: 'json', key: that.key }; if (options.poi_options) { requestParam.poi_options = options.poi_options } var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; geocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'address')) { return } var requestParam = { address: options.address, output: 'json', key: that.key }; if (options.region) { requestParam.region = options.region } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; getDistrictByCityId(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'id')) { return } var requestParam = { id: options.id || '', output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; calculateDistance(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { mode: options.mode || 'walking', to: Utils.location2query(options.to), output: 'json', key: that.key }; if (options.from) { options.location = options.from } if (requestParam.mode == 'straight') { var locationsuccess = function (result) { var locationTo = Utils.getEndLocation(requestParam.to); var data = { message: "query ok", result: { elements: [] }, status: 0 }; for (var i = 0; i < locationTo.length; i++) { data.result.elements.push({ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), duration: 0, from: { lat: result.latitude, lng: result.longitude }, to: { lat: locationTo[i].lat, lng: locationTo[i].lng } }) } var calculateResult = data.result.elements; var distanceResult = []; for (var i = 0; i < calculateResult.length; i++) { distanceResult.push(calculateResult[i].distance) } return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }) }; Utils.locationProcess(options, locationsuccess) } else { var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX; \ No newline at end of file +var ERROR_CONF = { + KEY_ERR: 311, + KEY_ERR_MSG: 'key格式错误', + PARAM_ERR: 310, + PARAM_ERR_MSG: '请求参数信息有误', + SYSTEM_ERR: 600, + SYSTEM_ERR_MSG: '系统错误', + WX_ERR_CODE: 1000, + WX_OK_CODE: 200 +}; +var BASE_URL = 'https://apis.map.qq.com/ws/'; +var URL_SEARCH = BASE_URL + 'place/v1/search'; +var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; +var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; +var URL_CITY_LIST = BASE_URL + 'district/v1/list'; +var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; +var URL_DISTANCE = BASE_URL + 'distance/v1/'; +var URL_DIRECTION = BASE_URL + 'direction/v1/'; +var MODE = { driving: 'driving', transit: 'transit' }; +var EARTH_RADIUS = 6378136.49; +var Utils = { + safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); + }, + bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + }, + md5cmn(q, a, b, x, s, t) { + return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b); + }, + md5ff(a, b, c, d, x, s, t) { + return this.md5cmn((b & c) | (~b & d), a, b, x, s, t); + }, + md5gg(a, b, c, d, x, s, t) { + return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t); + }, + md5hh(a, b, c, d, x, s, t) { + return this.md5cmn(b ^ c ^ d, a, b, x, s, t); + }, + md5ii(a, b, c, d, x, s, t) { + return this.md5cmn(c ^ (b | ~d), a, b, x, s, t); + }, + binlMD5(x, len) { + x[len >> 5] |= 0x80 << len % 32; + x[(((len + 64) >>> 9) << 4) + 14] = len; + var i; + var olda; + var oldb; + var oldc; + var oldd; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + a = this.md5ff(a, b, c, d, x[i], 7, -680876936); + d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = this.md5gg(b, c, d, a, x[i], 20, -373897302); + a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = this.md5hh(d, a, b, c, x[i], 11, -358537222); + c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = this.md5ii(a, b, c, d, x[i], 6, -198630844); + d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = this.safeAdd(a, olda); + b = this.safeAdd(b, oldb); + c = this.safeAdd(c, oldc); + d = this.safeAdd(d, oldd); + } + return [a, b, c, d]; + }, + binl2rstr(input) { + var i; + var output = ''; + var length32 = input.length * 32; + for (i = 0; i < length32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff); + } + return output; + }, + rstr2binl(input) { + var i; + var output = []; + output[(input.length >> 2) - 1] = undefined; + for (i = 0; i < output.length; i += 1) { + output[i] = 0; + } + var length8 = input.length * 8; + for (i = 0; i < length8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32; + } + return output; + }, + rstrMD5(s) { + return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)); + }, + rstrHMACMD5(key, data) { + var i; + var bkey = this.rstr2binl(key); + var ipad = []; + var opad = []; + var hash; + ipad[15] = opad[15] = undefined; + if (bkey.length > 16) { + bkey = this.binlMD5(bkey, key.length * 8); + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5c5c5c5c; + } + hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); + return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)); + }, + rstr2hex(input) { + var hexTab = '0123456789abcdef'; + var output = ''; + var x; + var i; + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i); + output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f); + } + return output; + }, + str2rstrUTF8(input) { + return unescape(encodeURIComponent(input)); + }, + rawMD5(s) { + return this.rstrMD5(this.str2rstrUTF8(s)); + }, + hexMD5(s) { + return this.rstr2hex(this.rawMD5(s)); + }, + rawHMACMD5(k, d) { + return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)); + }, + hexHMACMD5(k, d) { + return this.rstr2hex(this.rawHMACMD5(k, d)); + }, + md5(string, key, raw) { + if (!key) { + if (!raw) { + return this.hexMD5(string); + } + return this.rawMD5(string); + } + if (!raw) { + return this.hexHMACMD5(key, string); + } + return this.rawHMACMD5(key, string); + }, + getSig(requestParam, sk, feature, mode) { + var sig = null; + var requestArr = []; + Object.keys(requestParam) + .sort() + .forEach(function (key) { + requestArr.push(key + '=' + requestParam[key]); + }); + if (feature == 'search') { + sig = '/ws/place/v1/search?' + requestArr.join('&') + sk; + } + if (feature == 'suggest') { + sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk; + } + if (feature == 'reverseGeocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'geocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'getCityList') { + sig = '/ws/district/v1/list?' + requestArr.join('&') + sk; + } + if (feature == 'getDistrictByCityId') { + sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk; + } + if (feature == 'calculateDistance') { + sig = '/ws/distance/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'direction') { + sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk; + } + sig = this.md5(sig); + return sig; + }, + location2query(data) { + if (typeof data == 'string') { + return data; + } + var query = ''; + for (var i = 0; i < data.length; i++) { + var d = data[i]; + if (!!query) { + query += ';'; + } + if (d.location) { + query = query + d.location.lat + ',' + d.location.lng; + } + if (d.latitude && d.longitude) { + query = query + d.latitude + ',' + d.longitude; + } + } + return query; + }, + rad(d) { + return (d * Math.PI) / 180.0; + }, + getEndLocation(location) { + var to = location.split(';'); + var endLocation = []; + for (var i = 0; i < to.length; i++) { + endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }); + } + return endLocation; + }, + getDistance(latFrom, lngFrom, latTo, lngTo) { + var radLatFrom = this.rad(latFrom); + var radLatTo = this.rad(latTo); + var a = radLatFrom - radLatTo; + var b = this.rad(lngFrom) - this.rad(lngTo); + var distance = + 2 * + Math.asin( + Math.sqrt( + Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2) + ) + ); + distance = distance * EARTH_RADIUS; + distance = Math.round(distance * 10000) / 10000; + return parseFloat(distance.toFixed(0)); + }, + getWXLocation(success, fail, complete) { + wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }); + }, + getLocationParam(location) { + if (typeof location == 'string') { + var locationArr = location.split(','); + if (locationArr.length === 2) { + location = { latitude: location.split(',')[0], longitude: location.split(',')[1] }; + } else { + location = {}; + } + } + return location; + }, + polyfillParam(param) { + param.success = param.success || function () {}; + param.fail = param.fail || function () {}; + param.complete = param.complete || function () {}; + }, + checkParamKeyEmpty(param, key) { + if (!param[key]) { + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); + param.fail(errconf); + param.complete(errconf); + return true; + } + return false; + }, + checkKeyword(param) { + return !this.checkParamKeyEmpty(param, 'keyword'); + }, + checkLocation(param) { + var location = this.getLocationParam(param.location); + if (!location || !location.latitude || !location.longitude) { + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); + param.fail(errconf); + param.complete(errconf); + return false; + } + return true; + }, + buildErrorConfig(errCode, errMsg) { + return { status: errCode, message: errMsg }; + }, + handleData(param, data, feature) { + if (feature == 'search') { + var searchResult = data.data; + var searchSimplify = []; + for (var i = 0; i < searchResult.length; i++) { + searchSimplify.push({ + id: searchResult[i].id || null, + title: searchResult[i].title || null, + latitude: (searchResult[i].location && searchResult[i].location.lat) || null, + longitude: (searchResult[i].location && searchResult[i].location.lng) || null, + address: searchResult[i].address || null, + category: searchResult[i].category || null, + tel: searchResult[i].tel || null, + adcode: (searchResult[i].ad_info && searchResult[i].ad_info.adcode) || null, + city: (searchResult[i].ad_info && searchResult[i].ad_info.city) || null, + district: (searchResult[i].ad_info && searchResult[i].ad_info.district) || null, + province: (searchResult[i].ad_info && searchResult[i].ad_info.province) || null + }); + } + param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }); + } else if (feature == 'suggest') { + var suggestResult = data.data; + var suggestSimplify = []; + for (var i = 0; i < suggestResult.length; i++) { + suggestSimplify.push({ + adcode: suggestResult[i].adcode || null, + address: suggestResult[i].address || null, + category: suggestResult[i].category || null, + city: suggestResult[i].city || null, + district: suggestResult[i].district || null, + id: suggestResult[i].id || null, + latitude: (suggestResult[i].location && suggestResult[i].location.lat) || null, + longitude: (suggestResult[i].location && suggestResult[i].location.lng) || null, + province: suggestResult[i].province || null, + title: suggestResult[i].title || null, + type: suggestResult[i].type || null + }); + } + param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }); + } else if (feature == 'reverseGeocoder') { + var reverseGeocoderResult = data.result; + var reverseGeocoderSimplify = { + address: reverseGeocoderResult.address || null, + latitude: (reverseGeocoderResult.location && reverseGeocoderResult.location.lat) || null, + longitude: (reverseGeocoderResult.location && reverseGeocoderResult.location.lng) || null, + adcode: (reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode) || null, + city: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city) || null, + district: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district) || null, + nation: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation) || null, + province: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province) || null, + street: (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street) || null, + street_number: + (reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number) || null, + recommend: + (reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend) || null, + rough: (reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough) || null + }; + if (reverseGeocoderResult.pois) { + var pois = reverseGeocoderResult.pois; + var poisSimplify = []; + for (var i = 0; i < pois.length; i++) { + poisSimplify.push({ + id: pois[i].id || null, + title: pois[i].title || null, + latitude: (pois[i].location && pois[i].location.lat) || null, + longitude: (pois[i].location && pois[i].location.lng) || null, + address: pois[i].address || null, + category: pois[i].category || null, + adcode: (pois[i].ad_info && pois[i].ad_info.adcode) || null, + city: (pois[i].ad_info && pois[i].ad_info.city) || null, + district: (pois[i].ad_info && pois[i].ad_info.district) || null, + province: (pois[i].ad_info && pois[i].ad_info.province) || null + }); + } + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify, + pois: pois, + poisSimplify: poisSimplify + }); + } else { + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify + }); + } + } else if (feature == 'geocoder') { + var geocoderResult = data.result; + var geocoderSimplify = { + title: geocoderResult.title || null, + latitude: (geocoderResult.location && geocoderResult.location.lat) || null, + longitude: (geocoderResult.location && geocoderResult.location.lng) || null, + adcode: (geocoderResult.ad_info && geocoderResult.ad_info.adcode) || null, + province: (geocoderResult.address_components && geocoderResult.address_components.province) || null, + city: (geocoderResult.address_components && geocoderResult.address_components.city) || null, + district: (geocoderResult.address_components && geocoderResult.address_components.district) || null, + street: (geocoderResult.address_components && geocoderResult.address_components.street) || null, + street_number: (geocoderResult.address_components && geocoderResult.address_components.street_number) || null, + level: geocoderResult.level || null + }; + param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }); + } else if (feature == 'getCityList') { + var provinceResult = data.result[0]; + var cityResult = data.result[1]; + var districtResult = data.result[2]; + param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }); + } else if (feature == 'getDistrictByCityId') { + var districtByCity = data.result[0]; + param.success(data, districtByCity); + } else if (feature == 'calculateDistance') { + var calculateDistanceResult = data.result.elements; + var distance = []; + for (var i = 0; i < calculateDistanceResult.length; i++) { + distance.push(calculateDistanceResult[i].distance); + } + param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }); + } else if (feature == 'direction') { + var direction = data.result.routes; + param.success(data, direction); + } else { + param.success(data); + } + }, + buildWxRequestConfig(param, options, feature) { + var that = this; + options.header = { 'content-type': 'application/json' }; + options.method = 'GET'; + options.success = function (res) { + var data = res.data; + if (data.status === 0) { + that.handleData(param, data, feature); + } else { + param.fail(data); + } + }; + options.fail = function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + options.complete = function (res) { + var statusCode = +res.statusCode; + switch (statusCode) { + case ERROR_CONF.WX_ERR_CODE: { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + break; + } + case ERROR_CONF.WX_OK_CODE: { + var data = res.data; + if (data.status === 0) { + param.complete(data); + } else { + param.complete(that.buildErrorConfig(data.status, data.message)); + } + break; + } + default: { + param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)); + } + } + }; + return options; + }, + locationProcess(param, locationsuccess, locationfail, locationcomplete) { + var that = this; + locationfail = + locationfail || + function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + locationcomplete = + locationcomplete || + function (res) { + if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + } + }; + if (!param.location) { + that.getWXLocation(locationsuccess, locationfail, locationcomplete); + } else if (that.checkLocation(param)) { + var location = Utils.getLocationParam(param.location); + locationsuccess(location); + } + } +}; +class QQMapWX { + constructor(options) { + if (!options.key) { + throw Error('key值不能为空'); + } + this.key = options.key; + } + search(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (!Utils.checkKeyword(options)) { + return; + } + var requestParam = { + keyword: options.keyword, + orderby: options.orderby || '_distance', + page_size: options.page_size || 10, + page_index: options.page_index || 1, + output: 'json', + key: that.key + }; + if (options.address_format) { + requestParam.address_format = options.address_format; + } + if (options.filter) { + requestParam.filter = options.filter; + } + var distance = options.distance || '1000'; + var auto_extend = options.auto_extend || 1; + var region = null; + var rectangle = null; + if (options.region) { + region = options.region; + } + if (options.rectangle) { + rectangle = options.rectangle; + } + var locationsuccess = function (result) { + if (region && !rectangle) { + requestParam.boundary = + 'region(' + region + ',' + auto_extend + ',' + result.latitude + ',' + result.longitude + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } else if (rectangle && !region) { + requestParam.boundary = 'rectangle(' + rectangle + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } else { + requestParam.boundary = + 'nearby(' + result.latitude + ',' + result.longitude + ',' + distance + ',' + auto_extend + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')); + }; + Utils.locationProcess(options, locationsuccess); + } + getSuggestion(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (!Utils.checkKeyword(options)) { + return; + } + var requestParam = { + keyword: options.keyword, + region: options.region || '全国', + region_fix: options.region_fix || 0, + policy: options.policy || 0, + page_size: options.page_size || 10, + page_index: options.page_index || 1, + get_subpois: options.get_subpois || 0, + output: 'json', + key: that.key + }; + if (options.address_format) { + requestParam.address_format = options.address_format; + } + if (options.filter) { + requestParam.filter = options.filter; + } + if (options.location) { + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, 'suggest')); + }; + Utils.locationProcess(options, locationsuccess); + } else { + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, 'suggest')); + } + } + reverseGeocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { + coord_type: options.coord_type || 5, + get_poi: options.get_poi || 0, + output: 'json', + key: that.key + }; + if (options.poi_options) { + requestParam.poi_options = options.poi_options; + } + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')); + }; + Utils.locationProcess(options, locationsuccess); + } + geocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'address')) { + return; + } + var requestParam = { address: options.address, output: 'json', key: that.key }; + if (options.region) { + requestParam.region = options.region; + } + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')); + } + getCityList(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { output: 'json', key: that.key }; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')); + } + getDistrictByCityId(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'id')) { + return; + } + var requestParam = { id: options.id || '', output: 'json', key: that.key }; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')); + } + calculateDistance(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + var requestParam = { + mode: options.mode || 'walking', + to: Utils.location2query(options.to), + output: 'json', + key: that.key + }; + if (options.from) { + options.location = options.from; + } + if (requestParam.mode == 'straight') { + var locationsuccess = function (result) { + var locationTo = Utils.getEndLocation(requestParam.to); + var data = { message: 'query ok', result: { elements: [] }, status: 0 }; + for (var i = 0; i < locationTo.length; i++) { + data.result.elements.push({ + distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), + duration: 0, + from: { lat: result.latitude, lng: result.longitude }, + to: { lat: locationTo[i].lat, lng: locationTo[i].lng } + }); + } + var calculateResult = data.result.elements; + var distanceResult = []; + for (var i = 0; i < calculateResult.length; i++) { + distanceResult.push(calculateResult[i].distance); + } + return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }); + }; + Utils.locationProcess(options, locationsuccess); + } else { + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance'); + } + wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')); + }; + Utils.locationProcess(options, locationsuccess); + } + } + direction(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + var requestParam = { output: 'json', key: that.key }; + if (typeof options.to == 'string') { + requestParam.to = options.to; + } else { + requestParam.to = options.to.latitude + ',' + options.to.longitude; + } + var SET_URL_DIRECTION = null; + options.mode = options.mode || MODE.driving; + SET_URL_DIRECTION = URL_DIRECTION + options.mode; + if (options.from) { + options.location = options.from; + } + if (options.mode == MODE.driving) { + if (options.from_poi) { + requestParam.from_poi = options.from_poi; + } + if (options.heading) { + requestParam.heading = options.heading; + } + if (options.speed) { + requestParam.speed = options.speed; + } + if (options.accuracy) { + requestParam.accuracy = options.accuracy; + } + if (options.road_type) { + requestParam.road_type = options.road_type; + } + if (options.to_poi) { + requestParam.to_poi = options.to_poi; + } + if (options.from_track) { + requestParam.from_track = options.from_track; + } + if (options.waypoints) { + requestParam.waypoints = options.waypoints; + } + if (options.policy) { + requestParam.policy = options.policy; + } + if (options.plate_number) { + requestParam.plate_number = options.plate_number; + } + } + if (options.mode == MODE.transit) { + if (options.departure_time) { + requestParam.departure_time = options.departure_time; + } + if (options.policy) { + requestParam.policy = options.policy; + } + } + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode); + } + wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')); + }; + Utils.locationProcess(options, locationsuccess); + } +} +module.exports = QQMapWX; diff --git a/src/store/after.js b/src/store/after.js index d178acf3a6caa87b71e948995262e44062b33275..3615cef196fc535fe74773bf6bc6ae5a4954642a 100644 --- a/src/store/after.js +++ b/src/store/after.js @@ -3,16 +3,16 @@ const after = { state: { cancel_after: { boole: false, - order_id: null, - }, + order_id: null + } }, mutations: { cancelAfter: function (state, data) { state.cancel_after = data; - }, + } }, getters: {}, - actions: {}, + actions: {} }; export default after; diff --git a/src/store/cart.js b/src/store/cart.js index 2b8b88a64619354160e9f62d048f53950f3a9146..18f297b3fabd39cff3cc25478a1c899ad42d49c1 100644 --- a/src/store/cart.js +++ b/src/store/cart.js @@ -1,61 +1,64 @@ /* - * @Description: + * @Description: * @Author: fjt * @Date: 2021-04-26 12:37:36 * @LastEditTime: 2021-06-18 10:27:41 * @LastEditors: fjt */ const cart = { - namespaced: true, - state: { - cart_add: false, - cart_num: false + namespaced: true, + state: { + cart_add: false, + cart_num: false + }, + mutations: { + setCartAdd(state, data) { + state.cart_add = data; }, - mutations: { - setCartAdd(state, data) { - state.cart_add = data; - }, - cartNum(state, data) { - state.cart_num = data; - } - }, - getters: { - getCartAdd: function (state) { - return state.cart_add; - } + cartNum(state, data) { + state.cart_num = data; + } + }, + getters: { + getCartAdd: function (state) { + return state.cart_add; + } + }, + actions: { + getCartNumber: function ({}) { + return new Promise((resolve, reject) => { + let $heshop = this._vm.$heshop; + $heshop + .cart('get', { + behavior: 'number' + }) + .then(function (response) { + resolve(response); + }) + .catch(function () { + reject(); + }); + }); }, - actions: { - getCartNumber: function ({ }) { - return new Promise((resolve, reject) => { - let $heshop = this._vm.$heshop; - $heshop.cart('get', { - behavior: "number", - }).then(function (response) { - resolve(response); - }).catch(function () { - reject(); - }); - }) - }, - setCartNumber: function ({ rootGetters, dispatch }) { - let index = rootGetters['setting/getCartIndex']; - if (index === -1) { - return; - } - dispatch('getCartNumber').then(res => { - if (res !== 0) { - uni.setTabBarBadge({ - index: index, - text: res + "", - }); - } else { - uni.removeTabBarBadge({ - index: index, - }); - } - }); + setCartNumber: function ({ rootGetters, dispatch }) { + let index = rootGetters['setting/getCartIndex']; + if (index === -1) { + return; + } + dispatch('getCartNumber').then(res => { + if (res !== 0) { + uni.setTabBarBadge({ + index: index, + text: res + '' + }); + } else { + uni.removeTabBarBadge({ + index: index + }); } + }); } + } }; export default cart; diff --git a/src/store/components.js b/src/store/components.js index 6122214e1765675e634f557ce4c5f64fd7094899..ed528d084ef2bfae4f088bea3365c97413f34b69 100644 --- a/src/store/components.js +++ b/src/store/components.js @@ -1,82 +1,83 @@ -/* - * @Author: fjt - * @Date: 2021-05-16 17:54:36 - * @LastEditors: fjt - * @LastEditTime: 2021-06-14 21:55:11 - */ const components = { - namespaced: true, - state: { - search: { - height: 0, - top: 0, - fixed: false, - index: 0 - }, - page: [] + namespaced: true, + state: { + search: { + height: 0, + top: 0, + fixed: false, + index: 0 }, - mutations: { - setSearchFixed: function(state, data) { - state.search.fixed = data; - }, - setSearchIndex: function(state, data) { - state.search.index = data; - }, - setPage: function(state, data) { - state.page = data; - } + page: [] + }, + mutations: { + setSearchFixed: function (state, data) { + state.search.fixed = data; }, - getters: { - getSearchHeight: function(state) { - return state.search.height; - }, - getSearchFixed: function(state) { - return state.search.fixed; - }, - getSearchTop: function(state) { - return state.search.top; - }, - getSearchIndex: function(state) { - return state.search.index; - } + setSearchIndex: function (state, data) { + state.search.index = data; }, - actions: { - getSearch: function({ state }) { - let page = state.page; - let num = state.search.index; - let array = []; - for (let i = 0; i < page.length; i++) { - array.push( - new Promise((resolve, reject) => { - try { - let query = uni.createSelectorQuery(); - query.select('#' + page[i].name + '_' + i).boundingClientRect(rect => { - if (rect) { - resolve(rect.height); - } - - }).exec(); - } catch (e) { - reject(e); - } - }) - ) - if (i >= (num - 1)) break; + setPage: function (state, data) { + state.page = data; + } + }, + getters: { + getSearchHeight: function (state) { + return state.search.height; + }, + getSearchFixed: function (state) { + return state.search.fixed; + }, + getSearchTop: function (state) { + return state.search.top; + }, + getSearchIndex: function (state) { + return state.search.index; + } + }, + actions: { + getSearch: function ({ state }) { + let page = state.page; + let num = state.search.index; + let array = []; + for (let i = 0; i < page.length; i++) { + array.push( + new Promise((resolve, reject) => { + try { + let query = uni.createSelectorQuery(); + query + .select('#' + page[i].name + '_' + i) + .boundingClientRect(rect => { + if (rect) { + resolve(rect.height); + } + }) + .exec(); + } catch (e) { + reject(e); } - Promise.all(array).then(function(res) { - state.search.top = 0; - res.forEach((item) => { - state.search.top += parseInt(item); - }); - }).catch(function() { - }); - uni.createSelectorQuery().select('#search').boundingClientRect(function(rect) { - if (rect) { - state.search.height = rect.height; - } - }).exec(); - } + }) + ); + if (i >= num - 1) break; + } + Promise.all(array) + .then(function (res) { + state.search.top = 0; + res.forEach(item => { + state.search.top += parseInt(item); + }); + }) + .catch(function () {}); + uni + .createSelectorQuery() + .select('#search') + .boundingClientRect(function (rect) { + if (rect) { + state.search.height = rect.height; + } + }) + .exec(); } + } }; -export default components; \ No newline at end of file +export default components; diff --git a/src/store/getters.js b/src/store/getters.js index ed33697b59307e2f8845f29542b9e161bb8f60b9..d3e61b9d75117efe35b65d0ae0baa05e82ba4149 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -1,13 +1,13 @@ const getters = { - /** - * 获取当前属性栏目 - * @param {[type]} state [description] - * @return {[type]} [description] - */ - attribute: (state => { - let index = state.pages.status; - return state.pages.page[index].name; - }), + /** + * 获取当前属性栏目 + * @param {[type]} state [description] + * @return {[type]} [description] + */ + attribute: state => { + let index = state.pages.status; + return state.pages.page[index].name; + } }; -export default getters; \ No newline at end of file +export default getters; diff --git a/src/store/goods.js b/src/store/goods.js index ba73962f980c9b516c6b139350f45300607e98b9..8ce14156a9436851329a32b4b2dd6dff191b7bbc 100644 --- a/src/store/goods.js +++ b/src/store/goods.js @@ -1,42 +1,39 @@ const goods = { - namespaced: true, - state: { - shareGoods: [] - }, - mutations: { - shareGoods: function (state, data) { - state.shareGoods = data; - } - }, - getters: { - shareGoods: function (state) { - return state.shareGoods; - } + namespaced: true, + state: { + shareGoods: [] + }, + mutations: { + shareGoods: function (state, data) { + state.shareGoods = data; + } + }, + getters: { + shareGoods: function (state) { + return state.shareGoods; + } + }, + actions: { + shareGoods: function ({ getters, commit }) { + let $heshop = this._vm.$heshop; + if (getters.shareGoods.length === 0) { + $heshop + .goods('get', { + behavior: 'recommend' + }) + .then(function (res) { + commit('shareGoods', res); + }) + .catch(function (err) { + console.error(err); + }); + } }, - actions: { - shareGoods: function ({ - getters, - commit - }) { - let $heshop = this._vm.$heshop; - if (getters.shareGoods.length === 0) { - $heshop.goods('get', { - behavior: 'recommend' - }).then(function (res) { - commit('shareGoods', res); - }).catch(function (err) { - console.error(err); - }); - } - }, - emptyShareGoods: function ({ - commit, - dispatch - }) { - commit('shareGoods', []); - dispatch('shareGoods'); - } + emptyShareGoods: function ({ commit, dispatch }) { + commit('shareGoods', []); + dispatch('shareGoods'); } + } }; -export default goods; \ No newline at end of file +export default goods; diff --git a/src/store/index.js b/src/store/index.js index 22eb9cbe750461e6251a9bb3188315287817e403..032f828c2852059524ead7702aee5387d89a916f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,23 +1,23 @@ -import setting from "./setting.js"; -import user from "./user.js"; -import pages from "./pages.js"; -import cart from "./cart.js"; -import order from "./order.js"; -import goods from "./goods.js"; -import after from "./after.js"; -import plugins from "./plugins.js"; -import task from "@/plugins/task/store.js"; -import components from "./components.js"; +import setting from './setting.js'; +import user from './user.js'; +import pages from './pages.js'; +import cart from './cart.js'; +import order from './order.js'; +import goods from './goods.js'; +import after from './after.js'; +import plugins from './plugins.js'; +import task from '@/plugins/task/store.js'; +import components from './components.js'; export default { - setting, - user, - pages, - cart, - order, - goods, - after, - plugins, - task, - components -} \ No newline at end of file + setting, + user, + pages, + cart, + order, + goods, + after, + plugins, + task, + components +}; diff --git a/src/store/order.js b/src/store/order.js index 27107218c8d1aaac7bacf6156c5397999ddab0e6..4acdda5b34308188045ae43728e424fdf4fc57bb 100644 --- a/src/store/order.js +++ b/src/store/order.js @@ -1,29 +1,29 @@ const cart = { - namespaced: true, - state: { - cart_add: false, - isShip: { - bool: false, - id: null - } + namespaced: true, + state: { + cart_add: false, + isShip: { + bool: false, + id: null + } + }, + mutations: { + setCartAdd(state, data) { + state.cart_add = data; }, - mutations: { - setCartAdd(state, data) { - state.cart_add = data; - }, - setShip(state, data) { - state.isShip = data; - } + setShip(state, data) { + state.isShip = data; + } + }, + getters: { + getCartAdd: function (state) { + return state.cart_add; }, - getters: { - getCartAdd: function (state) { - return state.cart_add; - }, - getShip: function (state) { - return state.isShip; - } - }, - actions: {} + getShip: function (state) { + return state.isShip; + } + }, + actions: {} }; export default cart; diff --git a/src/store/pages.js b/src/store/pages.js index d37dfe6710af033377fd032556b209aae1450c92..9893cf658f4b35903e2651766e556e757416a180 100644 --- a/src/store/pages.js +++ b/src/store/pages.js @@ -1,133 +1,125 @@ -/* - * @Author: imac - * @Date: 2020-05-30 15:02:36 - * @Last Modified by: qinuoyun - * @Last Modified time: 2021-02-04 09:15:45 - */ const pages = { - namespaced: true, - state: { - dragIndex: -1, - position: "top", - status: -1, - page: [], - coms: null, - iframeHeight: 0 + namespaced: true, + state: { + dragIndex: -1, + position: 'top', + status: -1, + page: [], + coms: null, + iframeHeight: 0 + }, + mutations: { + /** + * 设置属性信息 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setAttribute(state, data) { + let { index, key, value } = data; + state.page[index][key] = JSON.parse(JSON.stringify(value)); }, - mutations: { - /** - * 设置属性信息 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setAttribute(state, data) { - let {index, key, value} = data; - let {status} = state; - state.page[index][key] = JSON.parse(JSON.stringify(value)); - }, - /** - * 设置信息 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setStatusIndex(state, data) { - state.status = data - }, - /** - * 设置信息 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setIframeHeight(state, data) { - state.iframeHeight = data - }, - /** - * 设置页面 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setPageData(state, data) { - state.page = data - }, - /** - * 获取页面内容 - * @param {[type]} state [description] - * @return {[type]} [description] - */ - getPageData(state) { - return JSON.stringify(state.page); - }, - /** - * 设置拖拽目的地 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setDragIndex(state, data) { - state.dragIndex = data - }, - /** - * 设置拖拽位置 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setDragPosition(state, data) { - state.position = data - }, - /** - * 设置当前原件 - * @param {[type]} state [description] - * @param {[type]} data [description] - */ - setComs(state, data) { - state.coms = data - } + /** + * 设置信息 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setStatusIndex(state, data) { + state.status = data; + }, + /** + * 设置信息 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setIframeHeight(state, data) { + state.iframeHeight = data; + }, + /** + * 设置页面 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setPageData(state, data) { + state.page = data; + }, + /** + * 获取页面内容 + * @param {[type]} state [description] + * @return {[type]} [description] + */ + getPageData(state) { + return JSON.stringify(state.page); }, - actions: { - /** - * 添加元件 - * @param {[type]} state [description] - * @param {[type]} data [description] - * @return {[type]} [description] - */ - pushPagesComs(context, data) { - let {dragIndex, coms, page, status, position} = context.state; - let element = JSON.parse(JSON.stringify(coms)); - //数据阻隔,否则在激活状态下,在顶部的增加数据会错乱 - let pages = JSON.parse(JSON.stringify(page)); - if (dragIndex == -2) { - pages.push(element); - } - //在其他位置点 - if (dragIndex > 0) { - if (position == 'top') { - dragIndex; - } else { - dragIndex++; - } - pages.splice(dragIndex, 0, element); - } - //在顶部添加 - if (dragIndex === 0) { - pages.unshift(element) - } - //重新修改数据元素 - context.commit('setPageData', pages) - //判断是否在激活组件之前添加元件 - if (dragIndex <= status && dragIndex !== -2) { - //用户判断在有多个组件的时候,且在激活的组件之前,添加组件,需要修改激活位置 - let index = status + 1; - context.commit('setStatusIndex', index); - //获取父级信息 - let parent = window.parent.window.app; - let name = context.rootGetters.attribute; - //通知父级修改激活选项的位置 - parent.$store.commit('pages/setAttribute', name); - parent.$store.commit('pages/setActiveIndex', index); - } - //清空数据 - context.commit('setComs', "") + /** + * 设置拖拽目的地 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setDragIndex(state, data) { + state.dragIndex = data; + }, + /** + * 设置拖拽位置 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setDragPosition(state, data) { + state.position = data; + }, + /** + * 设置当前原件 + * @param {[type]} state [description] + * @param {[type]} data [description] + */ + setComs(state, data) { + state.coms = data; + } + }, + actions: { + /** + * 添加元件 + * @param {[type]} state [description] + * @return {[type]} [description] + */ + pushPagesComs(context) { + let { dragIndex, coms, page, status, position } = context.state; + let element = JSON.parse(JSON.stringify(coms)); + //数据阻隔,否则在激活状态下,在顶部的增加数据会错乱 + let pages = JSON.parse(JSON.stringify(page)); + if (dragIndex == -2) { + pages.push(element); + } + //在其他位置点 + if (dragIndex > 0) { + if (position == 'top') { + dragIndex; + } else { + dragIndex++; } + pages.splice(dragIndex, 0, element); + } + //在顶部添加 + if (dragIndex === 0) { + pages.unshift(element); + } + //重新修改数据元素 + context.commit('setPageData', pages); + //判断是否在激活组件之前添加元件 + if (dragIndex <= status && dragIndex !== -2) { + //用户判断在有多个组件的时候,且在激活的组件之前,添加组件,需要修改激活位置 + let index = status + 1; + context.commit('setStatusIndex', index); + //获取父级信息 + let parent = window.parent.window.app; + let name = context.rootGetters.attribute; + //通知父级修改激活选项的位置 + parent.$store.commit('pages/setAttribute', name); + parent.$store.commit('pages/setActiveIndex', index); + } + //清空数据 + context.commit('setComs', ''); } + } }; -export default pages; \ No newline at end of file +export default pages; diff --git a/src/store/plugins.js b/src/store/plugins.js index 129d73b6ddefab1a6a642cba4e147aebed56df11..4816764023f6c9c2869b1e1576b845f02bbfb21b 100644 --- a/src/store/plugins.js +++ b/src/store/plugins.js @@ -1,10 +1,3 @@ -/* - * 插件配置 - * @Author: qinuoyun - * @Date: 2021-06-08 09:47:00 - * @Last Modified by: qinuoyun - * @Last Modified time: 2021-07-10 17:47:21 - */ const plugins = { namespaced: true, state: { @@ -21,7 +14,7 @@ const plugins = { * @param {[type]} data [description] */ setPlugins(state, data) { - console.log("获取插件所有配置信息", data) + console.log('获取插件所有配置信息', data); state.pluginsList = data; } }, @@ -31,25 +24,27 @@ const plugins = { * @param {[type]} state) [description] * @return {[type]} [description] */ - is_install: (state) => (name) => { - return state.todos.find(todo => todo.name === name) + is_install: state => name => { + return state.todos.find(todo => todo.name === name); }, /** * 获取插件配置信息 * @param {[type]} state) [description] * @return {[type]} [description] */ - manifest: (state) => (name, keys = "") => { - if (state.pluginsList[name]) { - if (keys) { - return state.pluginsList[name][keys]; + manifest: + state => + (name, keys = '') => { + if (state.pluginsList[name]) { + if (keys) { + return state.pluginsList[name][keys]; + } else { + return state.pluginsList[name]; + } } else { - return state.pluginsList[name]; + return false; } - } else { - return false; } - } }, actions: { /** @@ -58,17 +53,20 @@ const plugins = { * @param {[type]} options.commit [description] * @return {[type]} [description] */ - getPlugins: function({ commit }) { + getPlugins: function ({ commit }) { let $heshop = this._vm.$heshop; let $storageKey = this._vm.$storageKey; - $heshop.plugin('get', { include: 'empty', model: 'empty' }).then(function(res) { - commit('setPlugins', res); - // uni.setStorageSync($storageKey.plugins, res); - }).catch(function(err) { - console.log("插件获取配置错误", ) - console.error(err); - }); + $heshop + .plugin('get', { include: 'empty', model: 'empty' }) + .then(function (res) { + commit('setPlugins', res); + // uni.setStorageSync($storageKey.plugins, res); + }) + .catch(function (err) { + console.log('插件获取配置错误'); + console.error(err); + }); // if (uni.getStorageSync($storageKey.plugins)) { // commit('setPlugins', uni.getStorageSync($storageKey.plugins)); // } else { @@ -84,20 +82,27 @@ const plugins = { * 分享转发 * @return {[type]} [description] */ - onShare: function({ state, commit }) { + onShare: function ({ state, commit }) { let config = state.pluginsList['task']['share']; let $heshop = this._vm.$heshop; return new Promise((resolve, reject) => { - $heshop.plugin('post', { include: 'task', model: 'task' }, { - "number": 1, - "keyword": "share" - }).then(res => { - console.log("转发结果", res) - resolve(res) - }).catch(err => { - reject(err) - }); - }) + $heshop + .plugin( + 'post', + { include: 'task', model: 'task' }, + { + number: 1, + keyword: 'share' + } + ) + .then(res => { + console.log('转发结果', res); + resolve(res); + }) + .catch(err => { + reject(err); + }); + }); }, /** * 邀请执行 @@ -105,27 +110,34 @@ const plugins = { * @param {[type]} options.commit [description] * @return {[type]} [description] */ - onInvite: function({ state, commit }, { UID }) { - console.log("拿到用户ID", UID) + onInvite: function ({ state, commit }, { UID }) { + console.log('拿到用户ID', UID); let config = state.pluginsList['task']['share']; let $heshop = this._vm.$heshop; return new Promise((resolve, reject) => { - $heshop.plugin("post", { include: "task", model: "task" }, { - "number": UID, - "keyword": "invite" - }).then(res => { - console.log("邀请结果", res) - resolve(res) - }).catch(err => { - reject(err) - }); - }) + $heshop + .plugin( + 'post', + { include: 'task', model: 'task' }, + { + number: UID, + keyword: 'invite' + } + ) + .then(res => { + console.log('邀请结果', res); + resolve(res); + }) + .catch(err => { + reject(err); + }); + }); }, /** * 商品浏览信息 * @return {[type]} [description] */ - onBrowse: function({ state, commit }) { + onBrowse: function ({ state, commit }) { let config = state.pluginsList['task']['share']; let $heshop = this._vm.$heshop; /** @@ -134,15 +146,22 @@ const plugins = { * @return {[type]} [description] */ return new Promise((resolve, reject) => { - $heshop.plugin('post', { include: 'task', model: 'task' }, { - "number": 1, - "keyword": "browse" - }).then(res => { - resolve(res) - }).catch(err => { - reject(err) - }); - }) + $heshop + .plugin( + 'post', + { include: 'task', model: 'task' }, + { + number: 1, + keyword: 'browse' + } + ) + .then(res => { + resolve(res); + }) + .catch(err => { + reject(err); + }); + }); } } }; diff --git a/src/store/setting.js b/src/store/setting.js index 44c729bf69d5196b530ac7456d0e23e82c48ff33..cad4d89127d23a5d1a484642caccb18682adb087 100644 --- a/src/store/setting.js +++ b/src/store/setting.js @@ -1,3 +1,7 @@ +// #ifdef MP-WEIXIN +import QQMapWX from '../static/mp-weixin/js/qqmap-wx-jssdk.min'; +// #endif + const setting = { namespaced: true, state: { @@ -9,67 +13,72 @@ const setting = { data: [] }, addressJson: [], - subscribe: [] + subscribe: [], + // 是否授权 + auth: false, + isAuth: false }, mutations: { setting(state, data) { state.setting = data; }, setMenu(state, provider) { - state.menus = provider + state.menus = provider; }, setLocation(state, data) { state.location = data; }, setSys(state, data) { - console.log(data); state.sys = data; }, theme(state, data) { state.theme_color = data; }, - tabBar: function(state, data) { + tabBar: function (state, data) { state.tab_bar = data; }, - addressJson: function(state, data) { + addressJson: function (state, data) { state.addressJson = data; }, - subscribe: function(state, data) { + subscribe: function (state, data) { state.subscribe = data; + }, + setAuth(state, data) { + state.auth = data; + }, + setIsAuth(state, data) { + state.isAuth = data; } }, getters: { - storeSetting: function(state) { + storeSetting: function (state) { return state.setting.setting_collection && state.setting.setting_collection.store_setting; }, - goodsSetting: function(state) { + goodsSetting: function (state) { return state.setting.setting_collection && state.setting.setting_collection.goods_setting; }, - tradeSetting: function(state) { + tradeSetting: function (state) { return state.setting.setting_collection.trade_setting; }, - storagePicLimit: function(state) { - return Number(state.setting.storage_limit.pic_limit) * 1048576; - }, - getLocation: function(state) { + getLocation: function (state) { return state.location; }, - getPlatform: function(state) { + getPlatform: function (state) { return state.sys.platform; }, - getBasicSetting: function(state) { + getBasicSetting: function (state) { return state.setting.setting_collection && state.setting.setting_collection.basic_setting; }, - getTheme: function(state) { + getTheme: function (state) { return state.theme_color; }, - getTabBar: function(state) { + getTabBar: function (state) { return state.tab_bar.data; }, - statusBarHeight: function(state) { + statusBarHeight: function (state) { return state.sys.statusBarHeight; }, - getNavBarHeight: function(state) { + getNavBarHeight: function (state) { // #ifdef H5 return 44; // #endif @@ -77,16 +86,16 @@ const setting = { return state.sys.platform === 'ios' ? 44 : 48; // #endif }, - addressJson: function(state) { + addressJson: function (state) { return state.addressJson; }, - isProductsFeatured: function(state) { + isProductsFeatured: function (state) { return state.setting.setting_collection.goods_setting.recommend_showpage.goodsinfo.value; }, - subscribe: function(state) { + subscribe: function (state) { return state.subscribe; }, - getCartIndex: function(state) { + getCartIndex: function (state) { let list = state.tab_bar.data; let index = -1; for (let i = 0; i < list.length; i++) { @@ -96,68 +105,130 @@ const setting = { } return index; }, - getPicLimit: function(state) { - let limit = state.setting.storage_limit.pic_limit; + getPicLimit: function (state) { + console.log(state.setting.storage_limit); + let limit = state.setting.storage_limit?.pic_limit || 2; + console.log(limit); return limit * 1024 * 1024; }, - shareSetting: function(state) { + shareSetting: function (state) { return state.setting.setting_collection && state.setting.setting_collection.share_setting; }, getSys: function (state) { return state.sys; + }, + getOpeningad: function (state) { + return state.setting.openingad; + }, + getCopyright(state) { + return state.setting.copyright_information; + }, + getMapSdk(state) { + return state.setting.kb_express_setting.map_sdk; } }, actions: { - getSetting: function({ commit }) { + getSetting: function ({ commit }) { let $heshop = this._vm.$heshop; let $storageKey = this._vm.$storageKey; if (uni.getStorageSync($storageKey.setting)) { commit('setting', uni.getStorageSync($storageKey.setting)); } - $heshop.setting('get').then(function(res) { - commit('setting', res); - uni.setStorageSync($storageKey.setting, res); - }).catch(function(err) { - console.error(err); - }); + $heshop + .setting('get') + .then(function (res) { + commit('setting', res); + console.log(res); + uni.setStorageSync($storageKey.setting, res); + }) + .catch(function (err) { + console.error(err); + }); }, - resetting: function({ dispatch }) { + resetting: function ({ dispatch }) { let $storageKey = this._vm.$storageKey; uni.removeStorageSync($storageKey.setting); dispatch('getSetting'); }, - getLocation: function({ commit }) { - uni.getLocation({ - type: 'wgs84', - success: function(res) { - commit('setLocation', res); - } + getLocation: function ({ commit, getters, state }) { + console.log(state.setting.setting_collection?.location_setting.tencent_key); + console.log(arguments); + let $wechat = this._vm.$wechat; + console.log(getters); + return new Promise((resolve, reject) => { + // #ifdef MP-WEIXIN + const qqmapsdk = new QQMapWX({ + key: state.setting.setting_collection?.location_setting.tencent_key + }); + uni.getLocation({ + success(response) { + const latitude = response.latitude; + const longitude = response.longitude; + qqmapsdk.reverseGeocoder({ + location: { + latitude, + longitude + }, + success(res) { + resolve(res); + }, + fail(error) { + console.log(error); + } + }); + }, + fail(error) { + console.log(error); + } + }); + // #endif + // #ifdef H5 + let $jsonp = this._vm.$jsonp; + $wechat.getLocation({ + success(response) { + const latitude = response.latitude; + const longitude = response.longitude; + $jsonp( + `https://apis.map.qq.com/ws/geocoder/v1/?key=${state.setting.setting_collection?.location_setting.tencent_key}&location=${latitude},${longitude}&output=jsonp` + ) + .then(response => { + resolve(response); + }) + .catch(error => { + console.log(error); + }); + } + }); + // #endif }); }, - getSys: function({ commit }) { + getSys: function ({ commit }) { uni.getSystemInfo({ - success: function(res) { + success: function (res) { commit('setSys', res); } }); }, - getTheme: function({ commit }) { + getTheme: function ({ commit }) { let $heshop = this._vm.$heshop; let $storageKey = this._vm.$storageKey; if (uni.getStorageSync($storageKey.theme_color)) { commit('theme', uni.getStorageSync($storageKey.theme_color)); } else { - $heshop.fitment('post', { - keyword: 'themeColor' - }).then(function(res) { - commit('theme', res.content); - uni.setStorageSync($storageKey.theme_color, res.content); - }).catch(function(err) { - console.error(err); - }); + $heshop + .fitment('post', { + keyword: 'themeColor' + }) + .then(function (res) { + commit('theme', res.content); + uni.setStorageSync($storageKey.theme_color, res.content); + }) + .catch(function (err) { + console.error(err); + }); } }, - getTabBar: function({ commit }) { + getTabBar: function ({ commit }) { return new Promise((resolve, reject) => { let $heshop = this._vm.$heshop; let $storageKey = this._vm.$storageKey; @@ -165,43 +236,60 @@ const setting = { commit('tabBar', uni.getStorageSync($storageKey.tab_bar)); resolve(); } else { - $heshop.fitment('post', { - keyword: 'tabbar' - }).then(function(res) { - let data = JSON.parse(res.content); - commit('tabBar', data); - uni.setStorageSync($storageKey.tab_bar, data); - resolve(); - }).catch(function(err) { - console.error(err); - reject(); - }); + $heshop + .fitment('post', { + keyword: 'tabbar' + }) + .then(function (res) { + let data = JSON.parse(res.content); + commit('tabBar', data); + uni.setStorageSync($storageKey.tab_bar, data); + resolve(); + }) + .catch(function (err) { + console.error(err); + reject(); + }); } - }) + }); }, - getAddress: function({ commit }) { + getAddress: function ({ commit }) { let $heshop = this._vm.$heshop; let $storageKey = this._vm.$storageKey; if (uni.getStorageSync($storageKey.address_json)) { commit('addressJson', uni.getStorageSync($storageKey.address_json)); } else { - $heshop.search('post', { include: 'setting' }, { - keyword: 'addressjson', - content_key: '' - }).then(function(res) { - commit('addressJson', res); - uni.setStorageSync($storageKey.address_json, res); - }).catch(function(err) { - console.error(err); - }); + $heshop + .search( + 'post', + { include: 'setting' }, + { + keyword: 'addressjson', + content_key: '' + } + ) + .then(function (res) { + commit('addressJson', res); + uni.setStorageSync($storageKey.address_json, res); + }) + .catch(function (err) { + console.error(err); + }); } }, - subscribe: function({ commit }) { + subscribe: function ({ commit }) { let $heshop = this._vm.$heshop; - $heshop.subscribe('get').then(function(response) { - console.log("response-subscribe", response) + $heshop.subscribe('get').then(function (response) { + console.log('response-subscribe', response); commit('subscribe', response); }); + }, + getAuth({ commit }) { + let $heshop = this._vm.$heshop; + $heshop.cloud('get').then(response => { + commit('setAuth', response); + commit('setIsAuth', true); + }); } } }; diff --git a/src/store/user.js b/src/store/user.js index 855867b46f6b5a75a70d66223689093f5cf20137..edc0230ddba61d451a11ede8795b1b4c84102126 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -1,241 +1,244 @@ const user = { - namespaced: true, - state: { - userInfo: null, - orderTotal: { - noevaluate: 0, - orderafter: 0, - unpaid: 0, - unreceived: 0, - unsent: 0 - }, - shippingAddress: [], - couponTotal: 0 + namespaced: true, + state: { + userInfo: null, + orderTotal: { + noevaluate: 0, + orderafter: 0, + unpaid: 0, + unreceived: 0, + unsent: 0 }, - mutations: { - userInfo(state, data) { - uni.setStorageSync('userInfo', data); - state.userInfo = data; - }, - orderTotal(state, data) { - state.orderTotal = data; - }, - shippingAddress(state, data) { - state.shippingAddress = data; - }, - couponTotal(state, data) { - state.couponTotal = data; - } + shippingAddress: [], + couponTotal: 0 + }, + mutations: { + userInfo(state, data) { + uni.setStorageSync('userInfo', data); + state.userInfo = data; }, - getters: { - userInfo: function (state) { - return state.userInfo; - }, - orderTotal: function (state) { - return state.orderTotal; - }, - getAddress: function (state) { - return state.shippingAddress; - }, - couponTotal: function (state) { - return state.couponTotal; - } + orderTotal(state, data) { + state.orderTotal = data; }, - actions: { - decryptUserInfo: function ({ - dispatch, - commit - }) { - let $heshop = this._vm.$heshop; - let $pageURL = this._vm.$pageURL; - let _this = this._vm; - return new Promise((resolve, reject) => { - // #ifndef H5 - uni.login({ - provider: 'weixin', - success: function (loginRes) { - uni.getUserInfo({ - success: function (res) { - $heshop.login("post", "weapp", { - code: loginRes.code, - iv: res.iv, - encryptedData: res.encryptedData - }).then(function (res) { - dispatch('visit'); - commit('apply/login', res, { - root: true - }); - resolve(); - }); - } - }); - } - }); - // #endif - // #ifdef H5 - let page = getCurrentPages()[getCurrentPages().length - 2]; - let route = '/pages/user/index'; - if (page) { - route = '/' + page.route; - let query = '?' - for (let key in page.options) { - query += `${key}=${page.options[key]}&` - } - query = query.slice(0, query.length - 1); - route = route + query; - } - let url = $pageURL + '&_skip=' + route; - $heshop.login("post", { - type: 'wechat', - include: 'login_url', - url: url, - scope: 'snsapi_userinfo' - }).then(function (res) { - document.location.replace(res.url); - }).catch(function (error) { - _this.$toError(error); - }); - // #endif - }) - }, - getUserProfile: function ({ - dispatch, - commit - }) { - return new Promise((resolve, reject) => { - let $heshop = this._vm.$heshop; - uni.login({ - provider: 'weixin', - success: function () { - - } - }); - uni.getUserProfile({ - lang: "zh_CN", - desc: '授权', - success: function (res) { - uni.login({ - provider: 'weixin', - success: function (loginRes) { - $heshop.login("post", "weapp", { - code: loginRes.code, - iv: res.iv, - encryptedData: res.encryptedData - }).then(function (res) { - dispatch('visit'); - commit('apply/login', res, { - root: true - }); - resolve(); - }).catch(function (error) { - console.error(error); - reject(); - }); - } - }); - } - }); - }) - }, - visit: function () { - if (uni.getStorageSync('token')) { - let $heshop = this._vm.$heshop; - $heshop.users('get', { - behavior: 'visit' - }).then(function () { - }).catch(function (err) { }); - } - }, - getOrderTotal: function ({ - commit - }) { - let $heshop = this._vm.$heshop; - $heshop.order('get', { - behavior: 'tabcount' - }).then(function (res) { - commit('orderTotal', res); - }).catch(function (err) { - console.error(err); + shippingAddress(state, data) { + state.shippingAddress = data; + }, + couponTotal(state, data) { + state.couponTotal = data; + } + }, + getters: { + userInfo: function (state) { + return state.userInfo; + }, + orderTotal: function (state) { + return state.orderTotal; + }, + getAddress: function (state) { + return state.shippingAddress; + }, + couponTotal: function (state) { + return state.couponTotal; + } + }, + actions: { + decryptUserInfo: function ({ dispatch, commit }) { + let $heshop = this._vm.$heshop; + let $pageURL = this._vm.$pageURL; + let _this = this._vm; + return new Promise((resolve, reject) => { + // #ifndef H5 + uni.login({ + provider: 'weixin', + success: function (loginRes) { + uni.getUserInfo({ + success: function (res) { + $heshop + .login('post', 'weapp', { + code: loginRes.code, + iv: res.iv, + encryptedData: res.encryptedData + }) + .then(function (res) { + dispatch('visit'); + commit('apply/login', res, { + root: true + }); + resolve(); + }); + } }); - }, + } + }); + // #endif // #ifdef H5 - weChatLogin: function ({ - commit, - dispatch - }, options) { - if (!options.code) return; - let $heshop = this._vm.$heshop; - return new Promise(function (resolve, reject) { - $heshop.login('post', { - type: "wechat", - include: "login" - }, { - code: options.code - }).then(function (res) { + let page = getCurrentPages()[getCurrentPages().length - 2]; + let route = '/pages/user/index'; + if (page) { + route = '/' + page.route; + let query = '?'; + for (let key in page.options) { + query += `${key}=${page.options[key]}&`; + } + query = query.slice(0, query.length - 1); + route = route + query; + } + let url = $pageURL + '&_skip=' + route; + $heshop + .login('post', { + type: 'wechat', + include: 'login_url', + url: url, + scope: 'snsapi_userinfo' + }) + .then(function (res) { + document.location.replace(res.url); + }) + .catch(function (error) { + _this.$toError(error); + }); + // #endif + }); + }, + getUserProfile: function ({ dispatch, commit }) { + return new Promise((resolve, reject) => { + let $heshop = this._vm.$heshop; + uni.login({ + provider: 'weixin', + success: function () {} + }); + uni.getUserProfile({ + lang: 'zh_CN', + desc: '授权', + success: function (res) { + uni.login({ + provider: 'weixin', + success: function (loginRes) { + $heshop + .login('post', 'weapp', { + code: loginRes.code, + iv: res.iv, + encryptedData: res.encryptedData + }) + .then(function (res) { + dispatch('visit'); commit('apply/login', res, { - root: true + root: true }); - dispatch('visit'); resolve(); - }).catch(function () { + }) + .catch(function (error) { + console.error(error); reject(); - }); - }) - }, - // #endif - getAddress: function ({ - commit, - state - }) { - let $heshop = this._vm.$heshop; - let $h = this._vm.$h; - if ($h.test.isEmpty(state.shippingAddress)) { - $heshop.address('get').then(function (res) { - let data = res; - data.forEach(function (item) { - item.is_select = false; - }); - commit('shippingAddress', data); - }).catch(function (err) { - console.error(err); - }); + }); + } + }); + } + }); + }); + }, + visit: function () { + if (uni.getStorageSync('token')) { + let $heshop = this._vm.$heshop; + $heshop + .users('get', { + behavior: 'visit' + }) + .then(function () {}) + .catch(function (err) {}); + } + }, + getOrderTotal: function ({ commit }) { + let $heshop = this._vm.$heshop; + $heshop + .order('get', { + behavior: 'tabcount' + }) + .then(function (res) { + commit('orderTotal', res); + }) + .catch(function (err) { + console.error(err); + }); + }, + // #ifdef H5 + weChatLogin: function ({ commit, dispatch }, options) { + if (!options.code) return; + let $heshop = this._vm.$heshop; + return new Promise(function (resolve, reject) { + $heshop + .login( + 'post', + { + type: 'wechat', + include: 'login' + }, + { + code: options.code } - }, - // #ifndef H5 - authLogin: function () { - uni.checkSession({ - success: function () { - }, - fail: function () { - uni.login({ - provider: 'weixin', - scopes: 'auth_base', - success: function () { - }, - fail: function () { - } - }); - }, - complete: function () { } + ) + .then(function (res) { + commit('apply/login', res, { + root: true }); - }, - // #endif - getCouponTotal: function ({ - commit - }) { - let $heshop = this._vm.$heshop; - $heshop.coupon('get', { - behavior: 'tabcount' - }).then(function (res) { - commit('couponTotal', res.can_use_coupon_num); - }).catch(function (err) { - console.error(err); + dispatch('visit'); + resolve(); + }) + .catch(function () { + reject(); + }); + }); + }, + // #endif + getAddress: function ({ commit, state }) { + let $heshop = this._vm.$heshop; + let $h = this._vm.$h; + if ($h.test.isEmpty(state.shippingAddress)) { + $heshop + .address('get') + .then(function (res) { + let data = res; + data.forEach(function (item) { + item.is_select = false; }); + commit('shippingAddress', data); + }) + .catch(function (err) { + console.error(err); + }); + } + }, + // #ifndef H5 + authLogin: function () { + uni.checkSession({ + success: function () {}, + fail: function () { + uni.login({ + provider: 'weixin', + scopes: 'auth_base', + success: function () {}, + fail: function () {} + }); }, - bindPhone: function ({ }) { - - } - } + complete: function () {} + }); + }, + // #endif + getCouponTotal: function ({ commit }) { + let $heshop = this._vm.$heshop; + $heshop + .coupon('get', { + behavior: 'tabcount' + }) + .then(function (res) { + commit('couponTotal', res.can_use_coupon_num); + }) + .catch(function (err) { + console.error(err); + }); + }, + bindPhone: function ({}) {} + } }; -export default user; \ No newline at end of file +export default user; diff --git a/src/uni.scss b/src/uni.scss index 9b69e3b87dde68dccece7e104fc63ee9f8610fb3..3f53d9a1177e133a493ff8ee2d382ac178c74296 100644 --- a/src/uni.scss +++ b/src/uni.scss @@ -1,47 +1,47 @@ /* start--主题色--start */ $themes: ( - red_theme: ( - font_color: #E60B30, - background_color: #E60B30, - border_color: #E60B30, - opacify_background_0: rgba(230, 11, 48, 0.05), - ), - purple_theme: ( - font_color: #8F2DF3, - background_color: #8F2DF3, - border_color: #8F2DF3, - opacify_background_0: rgba(143, 45, 243, 0.05), - ), - blue_theme: ( - font_color: #33A7FF, - background_color: #33A7FF, - border_color: #33A7FF, - opacify_background_0: rgba(51, 167, 255, 0.05), - ), - green_theme: ( - font_color: #1FC551, - background_color: #1FC551, - border_color: #1FC551, - opacify_background_0: rgba(31, 197, 81, 0.05), - ), - orange_theme: ( - font_color: #FF7F00, - background_color: #FF7F00, - border_color: #FF7F00, - opacify_background_0: rgba(255, 127, 0, 0.05), - ), - golden_theme: ( - font_color: #CAA45A, - background_color: #CAA45A, - border_color: #CAA45A, - opacify_background_0: rgba(202, 164, 90, 0.05), - ) + red_theme: ( + font_color: #e60b30, + background_color: #e60b30, + border_color: #e60b30, + opacify_background_0: rgba(230, 11, 48, 0.05) + ), + purple_theme: ( + font_color: #8f2df3, + background_color: #8f2df3, + border_color: #8f2df3, + opacify_background_0: rgba(143, 45, 243, 0.05) + ), + blue_theme: ( + font_color: #33a7ff, + background_color: #33a7ff, + border_color: #33a7ff, + opacify_background_0: rgba(51, 167, 255, 0.05) + ), + green_theme: ( + font_color: #1fc551, + background_color: #1fc551, + border_color: #1fc551, + opacify_background_0: rgba(31, 197, 81, 0.05) + ), + orange_theme: ( + font_color: #ff7f00, + background_color: #ff7f00, + border_color: #ff7f00, + opacify_background_0: rgba(255, 127, 0, 0.05) + ), + golden_theme: ( + font_color: #caa45a, + background_color: #caa45a, + border_color: #caa45a, + opacify_background_0: rgba(202, 164, 90, 0.05) + ) ); //遍历主题map @mixin themeify { @each $theme-name, $theme-map in $themes { $theme-map: $theme-map !global; - [data-theme="#{$theme-name}"] & { + [data-theme='#{$theme-name}'] & { @content; } } @@ -54,28 +54,28 @@ $themes: ( //获取背景颜色 @mixin background_color($color) { @include themeify { - background-color: themed($color)!important; + background-color: themed($color) !important; } } //获取渐变背景颜色 @mixin background_linear($color, $deg, $min, $max) { - @include themeify { - background: linear-gradient($deg, themed($color) $min, themed($color) $max) !important; - } + @include themeify { + background: linear-gradient($deg, themed($color) $min, themed($color) $max) !important; + } } //获取字体颜色 @mixin font_color($color) { @include themeify { - color: themed($color)!important; + color: themed($color) !important; } } //获取边框颜色 @mixin border_color($color) { @include themeify { - border-color: themed($color)!important; + border-color: themed($color) !important; } } -/* end--主题色--end */ \ No newline at end of file +/* end--主题色--end */ diff --git a/src/utils/index.js b/src/utils/index.js index 706e428b29498d2f5871a7f7a30daf1db4784aff..4fb5c53e33397d1ca5e6ab59d5c9d0aa1b0cab74 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,17 +1,16 @@ - function doPreviewImage(url, images) { - uni.previewImage({ - urls: images, - current: url, - fail: function f(e) { - uni.showToast({ - title: '预览图片失败', - icon: 'none' - }); - } - }); + uni.previewImage({ + urls: images, + current: url, + fail: function f(e) { + uni.showToast({ + title: '预览图片失败', + icon: 'none' + }); + } + }); } export default { - doPreviewImage -} + doPreviewImage +}; diff --git a/src/utils/storageKey.js b/src/utils/storageKey.js index 363db57b9056d5c40b628acad9c232b6a28f82c2..e59c71a6e280cd07f044776779b3756be1c1300e 100644 --- a/src/utils/storageKey.js +++ b/src/utils/storageKey.js @@ -1,13 +1,13 @@ export default { - address: 'address', - setting: 'setting', - plugins: 'plugins', - address_submit: 'address_submit', - cart_add: 'cart_add', - comments_submit: 'comments_submit', - evaluation_post: 'evaluation_post', - theme_color: 'theme_color', - tab_bar: 'tab_bar', - address_json: 'address_json', - shipping_address: 'shipping_address' -} \ No newline at end of file + address: 'address', + setting: 'setting', + plugins: 'plugins', + address_submit: 'address_submit', + cart_add: 'cart_add', + comments_submit: 'comments_submit', + evaluation_post: 'evaluation_post', + theme_color: 'theme_color', + tab_bar: 'tab_bar', + address_json: 'address_json', + shipping_address: 'shipping_address' +}; diff --git a/src/utils/zIndex.js b/src/utils/zIndex.js index 98aa861395348f41bda88a3efa3b2d1838605132..72062d7744629154a5cc59e6df6893398dd9ae4e 100644 --- a/src/utils/zIndex.js +++ b/src/utils/zIndex.js @@ -1,10 +1,10 @@ export default { - toast: 10090, - noNetwork: 10080, - popup: 10075, - mask: 10070, - navbar: 980, - topTips: 975, - sticky: 970, - indexListSticky: 965, -} \ No newline at end of file + toast: 10090, + noNetwork: 10080, + popup: 10075, + mask: 10070, + navbar: 980, + topTips: 975, + sticky: 970, + indexListSticky: 965 +}; diff --git a/src/version.js b/src/version.js index 5d1d83594145b332646d92b68e47e0042bfbe1c6..509fa55e25a6ba0591760a240e15e2470b6c1d5b 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -module.exports = '1.1.0'; \ No newline at end of file +module.exports = '1.1.0'; diff --git a/vue.config.js b/vue.config.js index 3214cd03702b54070c67b12a291e0b498cf32a4e..3f274f405c8d2f7f435440f23a49ad9c2599dd25 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,10 +1,3 @@ -/* - * @Description: - * @Author: qinuoyun - * @Date: 2020-11-23 16:45:10 - * @LastEditTime: 2021-05-25 09:09:09 - * @LastEditors: fjt - */ const path = require('path'); const CopyWebpackPlugin = require('copy-webpack-plugin'); //最新版本copy-webpack-plugin插件暂不兼容,推荐v5.0.0