Commit ddbafbda by 肖康

first init

parents
Showing with 4961 additions and 0 deletions
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
@import './assets/css/font/iconfont.css';
/*每个页面公共css */
/* #ifdef H5 */
uni-page-head { display: none; }
/* #endif */
</style>
.addcar-pop{
$actcolorbl:$uni-coloract;//区分活动变量
background: rgba(0,0,0,0.5);
position: fixed;
z-index: 5;
left:0rpx;
top:0rpx;
bottom:0rpx;
right:0rpx;
.addcarpopbox{
width:100%;
height:100%;
position: relative;
.cons{
position: absolute;
left:0rpx;
bottom:0rpx;
width: 750rpx;
background: linear-gradient(180deg, #F0F6FF 0%, #FFFFFF 100%);
border-radius: 10rpx 10rpx 0px 0px;
padding-bottom: 10rpx;
.pophead{
height:93rpx;
line-height: 45rpx;
padding:24rpx;
.tits{
.goodsName{
max-width: 510rpx;
font-size: 32rpx;
font-weight: 600;
color: $uni-color333;
text-align: center;
}
.actag{
height: 28rpx;
padding: 0 10rpx;
line-height: 28rpx;
background: #FF3700;
border-radius: 0px 14rpx 14rpx 0px;
color:#fff;
position: relative;
margin-left: 10rpx;
top:10rpx;
}
}
.iconfont{
font-size: 40rpx;
color:#c2c4cc;
}
}
.popcons{
.infobox{
font-size: 24rpx;
color:$uni-color666;
line-height: 33rpx;
padding:24rpx;
padding-top: 0rpx;
.itemone{
margin-bottom: 6rpx;
.il{width:405rpx;}
.ir{width:269rpx;}
.kcty{color:$uni-coloract;}
}
.label{
color:$uni-color999;
}
}
.pricebox{
padding-top: 0rpx;
background: linear-gradient(180deg, #E6F1FF 0%, #FFFFFF 100%);
border-radius: 10rpx 10rpx 0rpx 0rpx;
.pricet{
height:103rpx;
line-height: 55rpx;
width:702rpx;
margin:0 auto;
padding-top: 24rpx;
padding-bottom: 24rpx;
border-bottom: 1rpx solid #AFCBFD;
font-size: 24rpx;
color:$uni-color666;
.pl{min-width:390rpx;}
.label{color:$uni-color999;width:72rpx;}
.hqitem{
margin-right: 18rpx;
}
.checkbox{
display: inline-block;
width:32rpx;
height:32rpx;
background: #fff;
border-radius: 32rpx;
border:2rpx solid #c2c4cc;
margin-right: 8rpx;
position: relative;
top:12rpx;
.icon{display: none;color:$actcolorbl;}
&.checked{
border:0rpx;
line-height: 32rpx;
.icon{display: inline;}
}
}
.pr{
width: 222rpx;
height: 56rpx;
background: #FFFFFF;
border-radius:8rpx;
border: 2rpx solid $actcolorbl;
color:$uni-color666;
text{
color:$actcolorbl;
height:54rpx;
text-align: center;
line-height: 50rpx;
width:56rpx;
font-weight: bold;
font-size: 40rpx;
}
input{
font-size: 24rpx;
width:110rpx;
height:54rpx;
text-align: center;
line-height: 54rpx;
border-left:1rpx solid $actcolorbl;
border-right:1rpx solid $actcolorbl;
}
}
}
.priceb{
margin-top: 23rpx;
.pitem{
padding-left:24rpx;
padding-right: 24rpx;
height:41rpx;
line-height: 41rpx;
font-size: 24rpx;
color:$uni-color999;
.pi1{width:139rpx;}
.pi2{width:318rpx;}
.w140{width:140rpx;}
.w120{width:120rpx;}
.hxj{
color:#C2C4CC!important;
font-weight: normal!important;
text-decoration-line: line-through;
}
&.titso{
color:$uni-color666;
font-weight: 600;
}
&.act{
background: #FFF8F2;
font-weight: 600rpx;
color:$uni-colorwarning;
}
}
.noprice{
font-size: 24rpx;
color:$uni-color999;
padding-top:46rpx;
padding-bottom: 46rpx;
text-align: center;
.icon{
color:#C2C4CC;
font-size: 36rpx;
margin-right: 6rpx;
position: relative;
top:5rpx;
}
}
}
}
.btnbox{
margin-top: 40rpx;
padding:0 24rpx;
.totalpricebox{
.hej{
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
color:$uni-color999;
.tje{
color:$actcolorbl;
font-size: 32rpx;
font-weight: 600;
}
}
.addcarbtn{
width: 344rpx;
height: 68rpx;
line-height: 68rpx;
text-align: center;
background: $actcolorbl;
border-radius: 10rpx;
font-size: 28rpx;
color:#fff;
}
}
.kfbtn{
height: 68rpx;
line-height: 50rpx;
background: #FFFFFF;
border-radius: 10rpx;
border: 2px solid $actcolorbl;
color:$actcolorbl;
text-align: center;
.icon{font-size: 44rpx;margin-right: 12rpx;position: relative;top:5rpx;}
}
}
}
}
}
/**活动价格样式**/
&.actpop{
.addcarpopbox{
.cons{
.popcons{
.pricebox{
background: linear-gradient(180deg, #FFFAF5 0%, #FFFFFF 100%);
.pricet{
.checkbox{
.icon{color:$uni-colorwarning;}
}
.pr{
border: 2rpx solid $uni-colorwarning;
text{
color:$uni-colorwarning;
}
input{
border-left:1rpx solid $uni-colorwarning;
border-right:1rpx solid $uni-colorwarning;
}
}
}
}
.btnbox{
.totalpricebox{
.hej{
.tje{
color:$uni-colorwarning;
}
}
.addcarbtn{
background: $uni-colorwarning;
}
}
.kfbtn{
border: 2px solid $uni-colorwarning;
color:$uni-colorwarning;
}
}
}
}
}
}
}
\ No newline at end of file
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
@font-face {
font-family: "iconfont"; /* Project id 3995505 */
src:
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABFcAAsAAAAAIIgAABEMAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACGIgquOKYqATYCJAOBBAtEAAQgBYRnB4ING3EbsyLYOAAB0ouT/ZcJ5px+BlYdkure5Sbp9Be/Rbc59YvIcR/KQINhGbKcQbMkiEtY5L2yMZQSnu/nes/NewHc3Q+EbR0AKQJOpwpYqCoA0iwJVQqkKjvZnKYzOubxIqPCn+yvbGy0sWLLyVZe0k+KCuAiqAB1eNzWvzFEQIZsCDowiBSj8K6BMUwkxUJRP/+wLyLRq1AuonMw77+SWSe7Dj7xsAKadozTnjRqruk1TfWFhxFQdADAQP0eABD4f3gNhEdQcav8GgD/0Vxp7wrkgB2lGFdvZjd52MsezPNeSnuPec5zCUAjquQJc2WWtXVEzlTI1rsK5+vWUqz7KxVtpg9js9+DVeg5DquwseLix4MggEcPBmAMu3l6NacrQTtzhkbZW8CqKSvLHMz+KRUdMVhwQpZopxo5lgnG/j0HjvJPLz/pJXQwMBXKTU1afO3N14+TI34c6gNxfkugcQMwAQV0SJYuJ6LNQyiDdXDDCzI1c2lAY57kPIUEM03u/4QHBRRSRDEllFJGORVUUkU1NeTIIx+FxsTCxsHFwycgJCJDFsEAsVBiATDcOgI13atrKgogISoKIaEqiiBhKooh4SpKIBEqSiGRKsogUSrKIdEqKiAxKiohsSqqIAEV1ZA4TS7ugeTAA5A88AgkHzwBUeAZiAYvQEzwCsQCb0Bs8A7EAR9AXPAJxANfQHzwDSQAv4CE4DeQCPwBkgF/gWTBP+gTW8d8GADUsg6GYJiBsbcb435FSROHI4ZqyARmGn6le6hFmSmYziKFg7W0aRT1BrTxFHG4GI/gcqOQqnAkFCABi8fDhNQoKic+NhHjMkIeLyqSx0NcbgQSMkeWxOOcNA5VHVVOdVlDuHh4eSEniicQsKI1PhcJMcxgkGKWbasnsoyjXCtNRyk7z0dJpyhaXWcUsWyjaiEVltY+ZMAdwQDn3TDbCWQq72u1ZrbRpEX7VPge3xBItkRH9dk/ss7fjNvZ+jh1l5ikOU/XbQhcUN9NEZdi/3h1t4aCR597RDY59urAoAtGqgFN2cSrYmAjzizgFQ7JANyscz/PkFLFDN0hJGDwAMgSKg0Ecbjt/h+0etfovkso89zyssxNU5Xnsii+UMd2ubuPeyf3yj0nCm0I6FjrOWZbeuadasxzvnlPP+oEHhXgi2VD1fBdc4GlS0L3tCW0Pa0AdVKkZB4CMvB6LK8OcEPkqVgm2IeyubVYUUPeM0SaSR7XmHBsPfrcY86zADnoUx8IkIE3JA06neW35tjGJF3MUpELW1I32UvxZVYJuOm9FMkVO1gUsObXi1DbWJ6rNO1oQeraqX0Ad//p67gB8kD+II9hK4rvMJ9md7d1/npZ1NPSx1rT/dkvPv+sWZSFT3enpVItz9ShvL/bsseKz6rNP5AmpdpEa6bMJWavVqtBwmRynyEf1y4N3bn6ZTxd/cwtbTO0tb3dR1vFArdOsdeESj5EgjN1C5CGMOBLjm2L02yH8gyK/plt3RRN7jo2+O4n9ky3b9lbWBu16/vC9QVBzDYbxszMosrTWhpLOpWYBmzRVdcbegcEvaR6l9FhYSsmJvEfTdau81PY+rHnk5H1BpvIy36thVKFHFlD/+QqI0L06Ugj+dbJ7lPUwUK+FV+ZeC1s00fgmtFo7ONlWSRl7P1rSfsWgC6HNyjH2triMSjWoRKBcd+3YLJzNF9yOW5Pqs333M7olYhGIE6/v6XyLy9A+drej2jUOlqGsm2qu0i8WOWIR/BITZqic614zpuN3HDGw+Ym8x7z4jlplrLkmqeVac4vCnDo+cCI9acQgQbvpigRsQYI36eZWxFZqPUClMyw5cvgJjgMgr+fXfTMSnXPve89lA8+rhq9rneNj8sWo2ouXbdWh8tJ36bIoPrODwRU+Pyc+vKCvSzuzSm+KgQJO/albvbGaCvlSTs/WMj8zbht1e4ep51tS+08dy62NOOXOiKzkBq4dDkcPq61EOy9x69es8LPmu2LdsWK2Ixm/mUOIWj2Lp/ZrFE5k4fDt3PIA4EyPZ2Z/ZtZvGOdH25HpNGkG0kn0M0pyoxcA12XIaUBro99L6igi/nnvshSS/jhRDVsWaiqbcqVRLbynpWu2ZpTuy9gpY7DLlztWzOXmMxFSNl0xTSeC8TZJ9TCdJNYcjQv0XUbgi3jn1FiP3SE2UidIS5nse80L4tgluYutFZbFuM5wRFbVdqeV8i8opB5/vPmbF9EbjX9ykjrSavlhbYucbBX4tsYF79hbFLQZ2Ed5FZlkVa/VkDCFkBqPSQV08kPKNGAaHeZCoqPOOZxer/dhUwydrKfj/e1jX3KYNzGQEOYVWMJoJF2N6c7wf4OMDJA0Be+D9BEDxxTHzJEaugzngbcy79CBp3qGnuLj1c5lO1o2ym2KiTKvvHhHKuUdOlYd8eGFrhvDCVS/noyzkGoNtp/ierZz+5ai5/K75/6+J4+9f5EUzt5i+WFslGjZAXy4qMEQR27UFYsPxJgk0j9uH+6kj0GB3S9skunW/Xps4uO//xpldXqwY8DETy02qN0K8aPV7iVnvMEgUPfv0d5PuBJBUgy1OkAKfeJoVbnBdN9UxQ5d2ofvE+dI59Ngv2URgY6qYWD5veOGdaMNgoalcoWQQvY//sBSkK8vS4jqABF5hDZHha0noKgyCAEQ8ZobKjluoDmF/gnt/hxlN5ImUBOm8qVpTapP+4qy+VRlMoKM1zXPOzfX7/+ZnuuZbhkhYpSj0sdTo6e1fm6ZLecJOXuZIfELrLo8+Ivcv4TTrnwPEjsDiPRrRtBeOOyYzXZRZocsSLDl+PLnm+fcMdq7eod6UyAX9+qUWcjY8Izzv91OVnQk9OzIVc2L/R0DmNz4NzXO+wsMqf1wnoEsGzSgCXdXoRgOIbw9xHePJDGMX4TEUMq7xRaX6otSUsr0ZZeJ+joJWml2usexzqdOy8+V6PJjc/b6uCRXE1f91Yab2ETIkH2sx8wZ4RcEF4M6TIfwUBrWHRhQ7UzVFSwPmwYaZtDLd+nj8iQIV7+PvNn64IgOK1HevBveFRrfwjCP7QZ9Qv9/foFBIH95F1W/S4q1UUQfxAJq19aaazRfAGmdPW0bu2h82NjLKctolg2JkTZalKlJNWo2pxIlTqlbU0ikS3PJ6huTduUaF+gKhqd7+pMXzQbFWLsWIvodIwlFm2jLS9r2z0YPm/ILdGIQKg35HB3OeFcQ7Geckpo0ofjx+q9LvHKXOrVQqJ31STYebsgQAjlGNfBKWtX2HrRklZF7csxxxq8BJX4yinnA5LUr3WhZM2ymbMXVxuQzVapKyDoL0n4pmy+lNQZEzYHAqrvNaSzN7XQmD8LAplP1PB+msHv95+fjKDrKWwMmcvqe+JGVfcQYPuDIFrqE31Z1OrenZj9bf95TM0Q35UA0ONG7pFU9hF41gm8Fj8xC74VJJu5apecMtEJz+i19GcTQCu0n+ZEl84IW4dWiX0Sn7iKE91DJiIRsFaACBZ1q2hdlp5e1rriIUFQ0Nf98OLYVVdhT7QkJFgS7fsJgoK+7v0XLO+Tb+ry5YflfBaAr1vpjLRaBBJBI0d642HdLZ4/aDyWlNAQMbuheWwxq0sHmGDg3hLJ0rc4fen9oGWPSuUGIEFSiljYdwsRmtbGLbZYIGbvOroLgfYXFw2J9QvBhBJmSvYhB0PolsGnELEfW/rMFiO7ehVlXGTvIGhKZbhi7CNTlaOoHPWr40R+bKaKnGBfkaXOUKlMsRlOfO3Ke3dW4DYnFnEJwNHwnyhXlLP+0tyCovrUvv0Ui/LhO9Z+uIHoMmTy6G46WoQxXm1Jplmafo+iMpgxpmDDnWLgmr+yw9IOQ05hLdhLTbzA/BzQ5Gmw7fJQpPSI4EgpgvlY/yzZpdoVxkzuP7BpOD3Y1wyYd5haJOZ8bK8q0WeXNFuFnjagp0ZWhHZbScNXdwk5L6gtDj9Of0j/f4nQDFuRoXvpFPzXU4opXrFrZ6XKZ61Sbb4uLPcRvJL1hK1SrpySqOxt7RMQ3xDEvQXfUopwdyl3gtHX/QJU4A9WZJ/gGnQ7xqio9xMHIrgiXmHw8Op5XYZzwGB+Hb/a7Ckut/Br+A3D6MN5XXj1HoUhrgt0dWM7/rz1XKjdxqsQdHgtz/FbmPNr7qACmUGqd2S5crvqrzV0qBZ3EmWCbEhjlup1tkxnTme9t6u+TlotzQa5INsDx3y9Nb1dS+Fg78SxRyE4Ish2EJVLfOEWqJbWSfOJr15vz7ZmREv1ceYckAmqxDWSLrpdq65cR5ZULzP05kDMzImDvfYe09vd+tptUDYXpxJviLn0luZA7dJAhmkc4w7TwbzDGFd1C0SdUF+Yr6V5N1HCOsm8Rd9Jv8XkdwDOLHyL5+P2qFVppqlT/QxM4J8ymdS5w4qybnhJBGEkyYiyj5yiZY1NiLjDT/mm7n6uGctJgNWtm5mbg+I8btduXDPZPHne3iMXLMop+0oqY/uE0uu07tSiolS39ipBULO07quex6qzZUU7pmwrMcdlazTZceaSDuouA3eHZwy2nzBekjeTfL8la3r6M3ya0rG4IQutNwr6XIBwC7djQsbpJQubcaPgDU7izUtnc5KGT2qe0o903SRq05+h1weD9Dbuja3IfioggpPS3Vqtu56gcL0hytWmxZfsGDDCDupl+YgZjqGOGZvNwt71ximwnZ5C3/BB+ycxC9Ek6FJmsBGaDEHFst4trPLg0xCzvMesYjmI+RSzqcDiq8p0UjvRuStDaCl3P7Di3OnUlUs5lHgkiHV2khGy07LAqWSYk2xxiJ63p7IE0LbBTOs310l1GhWfFQb3dRYWuPrrKg0EQXqC+btxTlPWdIjaJiidrNSZMtoxYUbxAI1iiHt0IvmDbE/jfIzKNZkMXqqK8NL5d7bt4EctVjCKiWwTAVpxIRYbLHDgC+92XlVYOGv+Pz1WhNdR7p8x18U48sgy+4KOixYtuPDuNMZRZz6zzfX8zIUBJaedlYO1+oSx/aKaxw6619oKhvyLQYAtnanewT7S8FANwcMAAJVFSdsNzaZoG/JRrgGQvtYGVjsHR1J+WO9NgjkYe98CWDz2u+2Uv2M/mQCjRb/Z4SBRczrlnUiv+YTuYaAcSFtpQmDc3BNibkwOudl7DNGh89SYS+NPNDQ1/oP0hVmq0jR0aQ8jPem2uXn1OTSXOqg00n/E8DF4Rvxv/RXQE9HPBuVZLY0dF/8HuzFWjj3/nZO5uIP/0X3EFzTjgyZ1S9D5vxqTB/3v9NXN1AbSVDvlQK3+Z+Hfq2kSja/lGI5lAJ6aBynK7Dw+yR3MF9b/lx/MtxQDm3JF4VDn133bFBOfXoqFQ3/Fo53hXfvks5YE0S7QxL6dImQ5qxhE3FUUWR75dd/XikkRXxWLLP8Vj8ly4s2nSbyXjKDobbaxpaMuMKT8bJ8xXzTAfgXvyFIiz44HI3fpLXbIWbQhy3yiGmxgau3N4eawacj2TBU6HRSq/Ww4DEFtDBy15hIGAZRN6bHMZzP9MhxER1i3Or+8Z5CcBQ0AC/rfBSOUkrO39KSLHgL+W6MTWqYkc29gSc6EjUQErMaYlLRYRpwArDkWEZa1wVYF4u7mgKUprJ4Z3eq6Fosag/KD7YwxGHfLVd62WqGIEi2mWGKLI6544ksgoUSSkSwUhisMD1+4CDgBoUhRosUQEZNkLmgQOFlvZVdjWKl/ghlpklWa+O02CX2f5FuOwzb1tOpiXySylgOBriqBVkGsVbJ2GavspRINhrMnbJKCdB982Xlcj3e90HmSYhYHkcQBx1XIXNO0mlrclQrcgivSDlcS6zZdCHI8n8eITgwAAA==') format('woff2'),
url('~@/assets/css/font/iconfont.woff?t=1681107671230') format('woff'),
url('~@/assets/css/font/iconfont.ttf?t=1681107671230') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-clear:before {
content: "\e693";
}
.icon-xzs:before {
content: "\e694";
}
.icon-arrtop:before {
content: "\e685";
}
.icon-arrbot:before {
content: "\e686";
}
.icon-bjt:before {
content: "\e687";
}
.icon-dzz:before {
content: "\e688";
}
.icon-fpp:before {
content: "\e689";
}
.icon-gzr:before {
content: "\e68a";
}
.icon-fz:before {
content: "\e68b";
}
.icon-down:before {
content: "\e68c";
}
.icon-dh:before {
content: "\e68d";
}
.icon-sxs:before {
content: "\e68e";
}
.icon-sanjiaoji:before {
content: "\e68f";
}
.icon-tj:before {
content: "\e690";
}
.icon-xxx:before {
content: "\e691";
}
.icon-ts:before {
content: "\e692";
}
.icon-arrleft:before {
content: "\e682";
}
.icon-del:before {
content: "\e683";
}
.icon-hot:before {
content: "\e684";
}
.icon-adindex1:before {
content: "\e675";
}
.icon-candan:before {
content: "\e676";
}
.icon-class:before {
content: "\e677";
}
.icon-car:before {
content: "\e678";
}
.icon-jt:before {
content: "\e679";
}
.icon-adindex3:before {
content: "\e67a";
}
.icon-home:before {
content: "\e67b";
}
.icon-search:before {
content: "\e67c";
}
.icon-news:before {
content: "\e67d";
}
.icon-tz:before {
content: "\e67e";
}
.icon-user:before {
content: "\e67f";
}
.icon-qq:before {
content: "\e680";
}
.icon-adindex2:before {
content: "\e681";
}
{
"id": "3995505",
"name": "ichunt_h5",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "34945195",
"name": "clear",
"font_class": "clear",
"unicode": "e693",
"unicode_decimal": 59027
},
{
"icon_id": "34945196",
"name": "xzs",
"font_class": "xzs",
"unicode": "e694",
"unicode_decimal": 59028
},
{
"icon_id": "34942177",
"name": "arrtop",
"font_class": "arrtop",
"unicode": "e685",
"unicode_decimal": 59013
},
{
"icon_id": "34942178",
"name": "arrbot",
"font_class": "arrbot",
"unicode": "e686",
"unicode_decimal": 59014
},
{
"icon_id": "34942179",
"name": "bjt",
"font_class": "bjt",
"unicode": "e687",
"unicode_decimal": 59015
},
{
"icon_id": "34942180",
"name": "dzz",
"font_class": "dzz",
"unicode": "e688",
"unicode_decimal": 59016
},
{
"icon_id": "34942181",
"name": "fpp",
"font_class": "fpp",
"unicode": "e689",
"unicode_decimal": 59017
},
{
"icon_id": "34942182",
"name": "gzr",
"font_class": "gzr",
"unicode": "e68a",
"unicode_decimal": 59018
},
{
"icon_id": "34942183",
"name": "fz",
"font_class": "fz",
"unicode": "e68b",
"unicode_decimal": 59019
},
{
"icon_id": "34942184",
"name": "down",
"font_class": "down",
"unicode": "e68c",
"unicode_decimal": 59020
},
{
"icon_id": "34942185",
"name": "dh",
"font_class": "dh",
"unicode": "e68d",
"unicode_decimal": 59021
},
{
"icon_id": "34942186",
"name": "sxs",
"font_class": "sxs",
"unicode": "e68e",
"unicode_decimal": 59022
},
{
"icon_id": "34942187",
"name": "sanjiaoji",
"font_class": "sanjiaoji",
"unicode": "e68f",
"unicode_decimal": 59023
},
{
"icon_id": "34942188",
"name": "tj",
"font_class": "tj",
"unicode": "e690",
"unicode_decimal": 59024
},
{
"icon_id": "34942189",
"name": "xxx",
"font_class": "xxx",
"unicode": "e691",
"unicode_decimal": 59025
},
{
"icon_id": "34942190",
"name": "ts",
"font_class": "ts",
"unicode": "e692",
"unicode_decimal": 59026
},
{
"icon_id": "34942055",
"name": "arrleft",
"font_class": "arrleft",
"unicode": "e682",
"unicode_decimal": 59010
},
{
"icon_id": "34942056",
"name": "del",
"font_class": "del",
"unicode": "e683",
"unicode_decimal": 59011
},
{
"icon_id": "34942057",
"name": "hot",
"font_class": "hot",
"unicode": "e684",
"unicode_decimal": 59012
},
{
"icon_id": "34890602",
"name": "adindex1",
"font_class": "adindex1",
"unicode": "e675",
"unicode_decimal": 58997
},
{
"icon_id": "34890603",
"name": "candan",
"font_class": "candan",
"unicode": "e676",
"unicode_decimal": 58998
},
{
"icon_id": "34890604",
"name": "class",
"font_class": "class",
"unicode": "e677",
"unicode_decimal": 58999
},
{
"icon_id": "34890605",
"name": "car",
"font_class": "car",
"unicode": "e678",
"unicode_decimal": 59000
},
{
"icon_id": "34890606",
"name": "jt",
"font_class": "jt",
"unicode": "e679",
"unicode_decimal": 59001
},
{
"icon_id": "34890607",
"name": "adindex3",
"font_class": "adindex3",
"unicode": "e67a",
"unicode_decimal": 59002
},
{
"icon_id": "34890608",
"name": "home",
"font_class": "home",
"unicode": "e67b",
"unicode_decimal": 59003
},
{
"icon_id": "34890609",
"name": "search",
"font_class": "search",
"unicode": "e67c",
"unicode_decimal": 59004
},
{
"icon_id": "34890610",
"name": "news",
"font_class": "news",
"unicode": "e67d",
"unicode_decimal": 59005
},
{
"icon_id": "34890611",
"name": "tz",
"font_class": "tz",
"unicode": "e67e",
"unicode_decimal": 59006
},
{
"icon_id": "34890612",
"name": "user",
"font_class": "user",
"unicode": "e67f",
"unicode_decimal": 59007
},
{
"icon_id": "34890613",
"name": "qq",
"font_class": "qq",
"unicode": "e680",
"unicode_decimal": 59008
},
{
"icon_id": "34890614",
"name": "adindex2",
"font_class": "adindex2",
"unicode": "e681",
"unicode_decimal": 59009
}
]
}
No preview for this file type
No preview for this file type
No preview for this file type
.header{
height: 466rpx;
background: linear-gradient(200deg, #D6E8FF 0%, #FFFFFF 100%);
&.fixedtop{
padding-top: 88rpx;
.search-topb{
position: fixed;
top:0rpx;
left:0rpx;
background: #fff;
z-index: 3;
.searchinput{
border:1rpx solid #F0F0F2;
}
}
}
.search-topb{
width:750rpx;
height: 88rpx;
padding:11rpx 0;
padding-left:32rpx;
padding-right:24rpx;
box-sizing: border-box;
image{
width:120rpx;
height:58rpx;
display: block;
flex-shrink:0;
position: relative;
top:4rpx;
}
.searchinput{
width: 388rpx;
height: 66rpx;
background: #FFFFFF;
border-radius: 33rpx;
line-height: 66rpx;
margin-left: 39rpx;
flex-shrink:0;
.seartext{
color:#c2c4cc;
font-size: 34rpx;
margin-left: 16rpx;
margin-right: 11rpx;
}
input{
height:66rpx;
font-size: 24rpx;
line-height: 66rpx;
width:264rpx;
color:$uni-color333;
flex-shrink:0;
}
}
.newsbox{
height:66rpx;
line-height: 66rpx;
margin-left: 37rpx;
position: relative;
.icon{
font-size: 44rpx;
color:$uni-color333;
}
.counts{
width: 46rpx;
height: 32rpx;
background: #FF3700;
border-radius: 16rpx;
border: 2rpx solid #FFFFFF;
position: absolute;
right:5rpx;
top:0rpx;
color:#fff;
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
}
.cdbox{
height:66rpx;
line-height: 66rpx;
position: relative;
left:6rpx;
.icon{
font-size: 44rpx;
color:$uni-color333;
}
.sj{
position: absolute;
border-style: solid;
border-width: 10rpx;
border-color:transparent transparent #292B33 transparent ;
top:57rpx;
left:10rpx;
display: none;
}
.cdcons{
position: absolute;
width: 200rpx;
height: 292rpx;
background: #292B33;
border-radius: 10px;
padding:0 24rpx;
display: none;
top:75rpx;
left:-150rpx;
z-index: 2;
navigator{
height:73rpx;
display: block;
width: 152rpx;
border-bottom: 1rpx solid #484B59;
color:#fff;
line-height: 72rpx;
&:last-child{
border:0rpx;
}
}
}
&:hover{
.cdcons,.sj{display: block;}
}
}
}
.tipsad{
width: 702rpx;
height:77rpx;
line-height: 77rpx;
font-size: 22rpx;
color:$uni-color999;
margin:0 auto;
.icon{margin-right: 6rpx;color:#23a8f6;font-size: 24rpx;}
}
.bannerbox{
width:702rpx;
margin:0 auto;
height:302rpx;
overflow: hidden;
border-radius: 10rpx;
swiper{height:302rpx;}
navigator{
display: block;
width:702rpx;
height:100%;
overflow: hidden;
image{
display: block;
width:702rpx;
height:302rpx;
}
}
}
}
.ggbox{
width:702rpx;
margin:0 auto;
height:81rpx;
border-bottom: 1px solid #F0F0F2;
line-height: 81rpx;
color:$uni-color666;
font-size: 24rpx;
.icon{
margin-right: 11rpx;
font-size: 32rpx;
}
}
.szbox{
width:704rpx;
margin:0 auto;
margin-top: 27rpx;
navigator{
display: block;
width:164rpx;
height:136rpx;
image{
display: block;
width:164rpx;
height:100rpx;
margin-bottom: 6rpx;
}
.sitips{
text-align: center;
font-size: 22rpx;
color:$uni-color666;
}
}
}
.brandbox{
width:702rpx;
margin:0 auto;
margin-top: 42rpx;
.brand-tab{
margin-bottom: 2rpx;
.tabitem{
width: 343rpx;
height: 106rpx;
background: #F0F6FF;
border-radius: 10rpx 10rpx 0rpx 0rpx;
font-weight: 600;
font-size: 28rpx;
color:$uni-color333;
padding-top:20rpx;
padding-left:24rpx;
.hztips{
color:$uni-color999;
font-weight: 400;
font-size: 20rpx;
margin-top: 4rpx;
overflow: hidden;
height:28rpx;
}
&.act{
background: #E6F6FF;
.hztext{
color:#23A8F6;
}
}
.hztext{
color:$uni-coloract;
}
&.hwxhitem{
background: #Fff8f2;
.hztext{
color:$uni-colorwarning;
}
}
}
}
.brand-con{
width: 702rpx;
padding-top: 16rpx;
background: #E6F6FF;
border-radius: 0rpx 0rpx 10rpx 10rpx;
flex-wrap: wrap;
padding-left:24rpx;
navigator{
width: 144rpx;
height: 81rpx;
display: block;
margin-right: 26rpx;
margin-bottom: 16rpx;
image{
width: 144rpx;
height: 81rpx;
}
}
&.brand-conxh{
background: #FFF8F2;
}
}
}
.goods-box{
margin-top: 42rpx;
width: 750rpx;
height: 482rpx;
background: linear-gradient(180deg, #E6F1FF 0%, #FFFFFF 100%);
border-radius: 10rpx 10rpx 0rpx 0rpx;
.titg{
height:97rpx;
line-height: 97rpx;
padding-left: 24rpx;
font-size: 28rpx;
color:$uni-color333;
text{
color:$uni-color999;
font-size:20rpx;
margin-left: 10rpx;
}
}
.goods-con{
height:353rpx;
white-space: nowrap;
.goods-item{
height:353rpx;
width: 232rpx;
background: #fff;
border-radius: 6rpx;
display: inline-block;
margin-left: 16rpx;
padding:16rpx;
.xhg{font-size: 26rpx;font-weight: 600;color:$uni-color333;height:37rpx;line-height: 37rpx;margin-top: 36rpx;margin-bottom: 4rpx;}
.ppg{font-size: 22rpx;color:$uni-color999;height:30rpx;line-height: 30rpx;text{color:$uni-color666;}margin-bottom: 4rpx;}
.jgg{font-size: 22rpx;color:$uni-color999;height:30rpx;line-height: 30rpx;text{color:$uni-colorwarning}}
image{
width: 180rpx;
height: 180rpx;
}
&:first-child{
margin-left:24rpx;
}
&:last-child{
margin-right:24rpx;
}
}
}
}
.fwbox{
min-height: 907rpx;
background:linear-gradient(180deg, #F5F5F7 0%, #FFFFFF 100%);
border-radius: 10px 10px 0px 0px;
margin-top: 42rpx;
.fwinfo{
padding: 0 55rpx;
padding-top:52rpx;
.tiiw{
font-size: 28rpx;
font-weight: 600;
color:$uni-color333;
text-align: center;
position: relative;
image{
width:70rpx;
height:55rpx;
position: absolute;
left:0rpx;
top:-18rpx;
}
}
.finfocon{
font-size: 24rpx;
line-height: 40rpx;
color:$uni-color999;
margin-top: 21rpx;
text-indent:2em;
}
.rzbox{
margin-top: 31rpx;
.rzitem{
width:200rpx;
image{display: block;width:200rpx;height:113rpx;margin-bottom: 15rpx;}
text{
font-size: 22rpx;
color:$uni-color999;
display: block;
text-align: center;
}
}
}
}
.videobox{
padding: 0 55rpx;
margin-top: 78rpx;
margin-bottom: 25rpx;
.tiib{
font-size: 28rpx;
font-weight: 600;
color:$uni-color333;
text-align: center;
position: relative;
image{
width:70rpx;
height:55rpx;
position: absolute;
right:0rpx;
top:-18rpx;
}
}
}
.videoval{
width: 702rpx;
height: 342rpx;
margin:0 auto;
video{
width: 702rpx;
height: 342rpx;
}
}
}
.newsbox{
width:702rpx;
margin:0 auto;
.news-tab{
padding-top:52rpx;
border-bottom: 1rpx solid #F0F0F2;
.tab-item{
margin-right: 35rpx;
padding-bottom: 13rpx;
font-size: 28rpx;
color:$uni-color666;
position: relative;
&.act{
color:$uni-color333;
font-weight: 600;
&::after{
content:"";
position: absolute;
width: 53rpx;
height: 7rpx;
background: $uni-coloract;
border-radius: 4px;
bottom: 0rpx;
left:50%;
transform: translateX(-26rpx);
}
}
}
}
.newscons{
.newsconitem{
display: block;
padding-top: 34rpx;
border-bottom: 1rpx solid #F0F0F2;
padding-bottom: 24rpx;
.ncleft{
width: 506rpx;
.titnew{
font-size: 28rpx;
font-weight: 400;
height:80rpx;
color:$uni-color333;
line-height: 40rpx;
}
.tittips{
margin-top: 12rpx;
height: 60rpx;
font-size: 22rpx;
font-weight: 400;
color:$uni-color999;
line-height: 30rpx;
}
}
image{
width: 180rpx;
height: 110rpx;
border-radius: 10rpx;
}
.newitembottom{
margin-top: 18rpx;
.tagitem{
height: 34rpx;
line-height: 30rpx;
padding:0 16rpx;
border-radius: 17rpx;
border: 1rpx solid #23A8F6;
color: #23A8F6;
font-size: 22rpx;
margin-right: 14rpx;
}
.newtime{
height:30rpx;
line-height: 30rpx;
color:$uni-color999;
font-size: 22rpx;
}
}
}
}
.newsbot{
height: 81rpx;
line-height: 81rpx;
color:$uni-coloract;
font-size: 24rpx;
text-align: center;
text{font-size: 28rpx;margin-left: 7rpx;}
}
}
.pagebot{
height: 62rpx;
line-height: 62rpx;
background: #F5F5F7;
font-size: 22rpx;
text-align: center;
color:#C6C7CC;
}
::v-deep {
uni-swiper .uni-swiper-dot{
width: 10px;
height: 8px;
background: #FFFFFF!important;
border-radius: 4px;
}
.uni-swiper-dot-active{
width:20px!important;
}
}
.header{
width: 750rpx;
height: 88rpx;
background: #F5F5F7;
padding-top: 11rpx;
padding-left:32rpx;
.back{
height: 66rpx;
line-height: 66rpx;
text{
font-size: 44rpx;
color:$uni-color999;
}
}
.inputbox{
.icon-search{
color:$uni-coloract;
font-size: 34rpx;
margin-right: 11rpx;
}
.icon-clear{
color:#C6C7CC;
font-size: 30rpx;
}
margin-left: 22rpx;
width: 538rpx;
height: 66rpx;
line-height: 66rpx;
background: #FFFFFF;
border-radius: 33rpx;
border: 2rpx solid $uni-coloract;
padding-left: 16rpx;
input{
height: 66rpx;
line-height: 66rpx;
width:430rpx;
font-size: 24rpx;
color:$uni-color666;
}
}
.searchBtn{
font-size: 28rpx;
color:$uni-color333;
height: 66rpx;
line-height: 66rpx;
margin-left: 25rpx;
}
}
.historyBox{
padding:0 22rpx;
padding-top: 36rpx;
.hisbox{
.tit{
font-weight: 600;
font-size: 28rpx;
color:$uni-color333;
height:40rpx;
line-height: 40rpx;
.icon{
font-size: 40rpx;
color:$uni-color999;
font-weight: normal;
}
}
.cons{
flex-wrap: wrap;
padding-bottom: 16rpx;
navigator{
padding:8rpx 24rpx;
height: 48rpx;
line-height: 30rpx;
background: #F5F5F7;
border-radius: 27rpx;
font-size: 28rpx;
margin-right: 16rpx;
margin-top: 16rpx;
color:$uni-color666;
}
}
}
.hotbox{
margin-top: 26rpx;
.tit{
font-weight: 600;
font-size: 28rpx;
color:$uni-color333;
height:40rpx;
line-height: 40rpx;
.icon{
font-size: 40rpx;
color:#f89119;
font-weight: normal;
margin-left: 4rpx;
}
}
.cons{
padding-top: 18rpx;
padding-bottom: 40rpx;
.hotitem{
height:33rpx;
line-height: 33rpx;
margin-bottom: 24rpx;
padding-left: 16rpx;
text{
font-size: 24rpx;
color:#C6C7CC;
font-weight: 600;
}
navigator{
font-size: 24rpx;
margin-left: 14rpx;
color:$uni-color666;
}
&:nth-child(1){
text,navigator{color:$uni-coloract;}
}
&:nth-child(2){
text,navigator{color:$uni-coloract;}
}
&:nth-child(3){
text,navigator{color:$uni-coloract;}
}
}
}
}
.adbox{
navigator{
width:343rpx;
height:120rpx;
image{
width:343rpx;
height:120rpx;
}
}
}
}
.lxbox{
padding-left: 39rpx;
padding-right: 25rpx;
padding-top: 13rpx;
navigator{
display: block;
height:81rpx;
line-height: 80rpx;
border-bottom: 1rpx solid #F0F0F2;
color:$uni-color666;
font-size: 24rpx;
.icon{
font-size: 34rpx;
color:#c2c4cc;
margin-right: 12rpx;
position: relative;
top:3rpx;
}
}
}
\ No newline at end of file
.searchList{
height:100vh;
background: #F5F5F7;
padding-top: 188rpx;
font-size: 24rpx;
color:$uni-color666;
.header{
background: #F5F5F7;
height:188rpx;
width:100%;
left:0rpx;
top:0rpx;
position: fixed;
z-index: 1;
.searchtop{
height:100rpx;
padding-top:11rpx;
padding-left:32rpx;
line-height: 66rpx;
.icon-arrleft{
font-size: 44rpx;
color:$uni-color999;
margin-right: 22rpx;
}
.inputbox{
width: 538rpx;
height: 66rpx;
background: #FFFFFF;
border-radius: 33rpx;
padding-left: 16rpx;
.icon-search{
color:#c2c4cc;
font-size: 34rpx;
margin-right: 11rpx;
}
input{
height: 66rpx;
line-height: 66rpx;
width:300rpx;
font-size: 24rpx;
color:$uni-color666;
}
}
.icon-car{
font-size: 44rpx;
color:$uni-color999;
margin-left: 27rpx;
}
}
.shiftbox{
height: 88rpx;
line-height: 88rpx;
background: #fff;
border-radius: 10px 10px 0px 0px;
font-size: 26rpx;
color:$uni-color333;
.sjpx{
position: relative;
&::after{
content:"";
position: absolute;
border-width: 8rpx;
right:-22rpx;
top:27rpx;
border-style: solid;
border-color:transparent transparent $uni-color999 transparent ;
}
&::before{
content:"";
position: absolute;
border-width: 8rpx;
border-style: solid;
top:47rpx;
right:-22rpx;
border-color:$uni-color999 transparent transparent transparent ;
}
}
.sxbox{
position: relative;
text{color:$uni-color999;font-size: 40rpx;}
left:18rpx;
.icon{margin-left: 9rpx;}
&::after{
content:"";
position: absolute;
height:40rpx;
width:1rpx;
background: #C2C4CC;
left:-43rpx;
top:26rpx;
}
}
.act{
color:$uni-coloract;
font-weight: 600;
&.top{
&::after{
border-color:transparent transparent $uni-coloract transparent ;
}
}
&.bot{
&::before{
border-color: $uni-coloract transparent transparent transparent ;
}
}
}
}
}
.databox{
width:100%;
padding:0 24rpx;
background: #fff;
.group{
padding:24rpx 0;
border-bottom: 1rpx solid #F5F5F7;
.toprs1{
height:48rpx;
line-height: 48rpx;
margin-bottom: 12rpx;
navigator{
height:48rpx;
line-height: 48rpx;
.goodsName{
font-size: 28rpx;
color:$uni-color333;
font-weight: 600;
max-width:400rpx;
}
.actag{
height: 28rpx;
padding: 0 10rpx;
line-height: 28rpx;
background: #FF3700;
border-radius: 0px 14rpx 14rpx 0px;
color:#fff;
position: relative;
margin-left: 10rpx;
top:10rpx;
}
}
.addcar{
width: 142rpx;
height: 48rpx;
line-height: 48rpx;
background: #1969F9;
color:#fff;
font-size: 22rpx;
text-align: center;
border-radius: 6rpx;
font-weight: 400;
}
.kfbtns{
width: 142rpx;
height: 48rpx;
line-height: 44rpx;
background: #fff;
color:#1969F9;
border:2rpx solid #1969F9;
font-size: 22rpx;
text-align: center;
border-radius: 6rpx;
font-weight: 400;
}
}
.labelsd{color:#9D9FA6;}
.toprs2{
margin-top: 6rpx;
font-size: 24rpx;
height:33rpx;
line-height: 33rpx;
.l2{width:396rpx;}
.r2{
width:269rpx;
}
}
.toprs3{
margin-top: 6rpx;
font-size: 24rpx;
height:33rpx;
line-height: 33rpx;
.priceb{
text{
color:$uni-colorwarning;
&.p1{width:126rpx;margin-right: 14rpx;}
&.p2{width:160rpx;margin-right: 14rpx;}
}
}
}
}
}
.pagebot{
height: 62rpx;
line-height: 62rpx;
background: #F5F5F7;
font-size: 22rpx;
text-align: center;
color:#C6C7CC;
}
.nodatabox{
padding-top: 100rpx;
text-align: center;
image{
display: block;
margin:0 auto;
width:356rpx;
height:356rpx;
margin-bottom: 28rpx;
}
color:$uni-color333;
font-size: 28rpx;
.kfqqbtns{
width: 702rpx;
height: 88rpx;
line-height: 88rpx;
background: #1969F9;
border-radius: 10px;
position: fixed;
left:24rpx;
bottom:0rpx;
font-size: 28rpx;
text-align: center;
color:#fff;
.icon{
font-size: 44rpx;
color:#fff;
margin-right: 12rpx;
position: relative;
top:4rpx;
}
}
}
.shift-pop{
background: rgba(0,0,0,0.5);
position: fixed;
z-index: 5;
left:0rpx;
top:0rpx;
bottom:0rpx;
right:0rpx;
.shiftpopbox{
width:100%;
height:100%;
position: relative;
.cons{
position: absolute;
left:0rpx;
bottom:0rpx;
width: 750rpx;
background: linear-gradient(180deg, #F0F6FF 0%, #FFFFFF 100%);
border-radius: 10rpx 10rpx 0px 0px;
padding: 24rpx;
padding-bottom: 10rpx;
.pophead{
height:40rpx;
line-height: 40rpx;
padding-left:100rpx;
margin-bottom: 32rpx;
.tits{
width: 510rpx;
font-size: 28rpx;
font-weight: 600;
color: $uni-color333;
text-align: center;
}
.iconfont{
font-size: 40rpx;
color:#c2c4cc;
}
}
.popcons{
margin-bottom: 40rpx;
.tpt{
height:40rpx;
line-height: 40rpx;
font-size: 28rpx;
font-weight: 600;
color: $uni-color333;
.cleartj{
color:$uni-coloract;
font-size: 24rpx;
font-weight: normal;
}
margin-bottom: 24rpx;
}
.tpo{
flex-wrap: wrap;
.toitem{
height: 48rpx;
line-height: 48rpx;
background: #F5F5F7;
border-radius: 27rpx;
padding: 0 24rpx;
margin-right: 16rpx;
margin-bottom: 16rpx;
&.act{
background: $uni-coloract;
color:#fff;
}
}
}
}
}
.foot{
margin-top: 82rpx;
.cz{
width: 344rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
background: #FFFFFF;
border-radius: 10rpx;
border: 2rpx solid $uni-coloract;
font-size: 28rpx;
color:$uni-coloract;
}
.cx{
width: 344rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
background: $uni-coloract;
border-radius: 10rpx;
font-size: 28rpx;
color:#fff;
}
}
}
}
}
\ No newline at end of file
No preview for this file type
<template>
<view class="addcar " v-show="popIsShow">
<view class="addcar-pop ">
<view class="addcarpopbox" @click="popIsShow=!popIsShow">
<view class="cons" @click.stop="popIsShow=popIsShow">
<view class="pophead row bothSide">
<view class="tits row">
<text class="goodsName elep">lm358asdasdasdasdasdads</text>
<text class="actag">91折</text>
</view>
<text class="icon iconfont icon-xxx" @click.stop="popIsShow=!popIsShow"></text>
</view>
<view class="popcons">
<view class="infobox">
<view class="itemone row bothSide">
<view class="il elep">
<text class="label">品牌:</text>
<text>Rice Lake Weighing</text>
</view>
<view class="ir">
<text class="label">ECCN:</text>
<text>ERA3006</text>
</view>
</view>
<view class="itemone row bothSide">
<view class="il elep">
<text class="label">供应商:</text>
<text>Mouser</text>
</view>
<view class="ir">
<text class="label">递增量:</text>
<text>66666</text>
</view>
</view>
<view class="itemone row bothSide">
<view class="il elep">
<text class="label">封装:</text>
<text>asdad</text>
</view>
<view class="ir">
<text class="label">起订量:</text>
<text>500</text>
</view>
</view>
<view class="itemone row bothSide">
<view class="il elep">
<text class="label">包装:</text>
<text>Cut Tape</text>
</view>
<view class="ir">
<text class="label">库存:</text>
<text class="kcty">654564654</text>
</view>
</view>
<view class="itemone row bothSide">
<view class="il elep">
<text class="label">类别:</text>
<text>Cut Tape</text>
</view>
</view>
</view>
<view class="pricebox">
<view class="pricet row">
<view class="pl row">
<text class="label">交期:</text>
<view class="row hqitem">
<text class="checkbox checked"><text class="icon iconfont icon-xzs"></text></text>
<text>大陆3-5日</text>
</view>
<view class="row hqitem">
<text class="checkbox"></text>
<text>香港3-5日</text>
</view>
</view>
<view class="pr row " >
<text>-</text>
<input type="number" />
<text>+</text>
</view>
</view>
<view class="priceb">
<view class="pitem titso row">
<view class="pi1">阶梯</view>
<view class="pi2">大陆交货(含税)</view>
<view class="pi3">香港交货</view>
</view>
<view class="pitem row " >
<view class="pi1">50000+:</view>
<view class="pi2 row"><text class="w140">¥130.856</text><text class="hxj">¥130.856</text></view>
<view class="pi3 row"> <text class="w120">$130.856</text><text class="hxj">$130.856</text></view>
</view>
<view class="pitem row " >
<view class="pi1">50000+:</view>
<view class="pi2 row"><text class="w140">¥130.856</text><text class="hxj">¥130.856</text></view>
<view class="pi3 row"> <text class="w120">$130.856</text><text class="hxj">$130.856</text></view>
</view>
<view class="pitem row act" >
<view class="pi1">50000+:</view>
<view class="pi2 row"><text class="w140">¥130.856</text><text class="hxj">¥130.856</text></view>
<view class="pi3 row"> <text class="w120">$130.856</text><text class="hxj">$130.856</text></view>
</view>
<view class="noprice" style="display:none;">
<text class="icon iconfont icon-sanjiaoji"></text>
暂无阶梯价格
</view>
</view>
</view>
<view class="btnbox">
<view class="totalpricebox row bothSide" >
<view class="hej">合计:<text class="tje">¥3235.6856</text></view>
<view class="addcarbtn">加入购物车</view>
</view>
<view class="kfbtn" style="display:none">
<text class="icon iconfont icon-qq"></text>
联系客服
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "addcar",
props: {
// goods_id: {
// type: String,
// default: 1
// },
},
data() {
return {
popIsShow:false
}
},
onLoad: function() {
},
methods: {
addcarpopfunc(goods_id){
console.log(goods_id)
if(goods_id){
this.popIsShow=!this.popIsShow;
}
}
},
}
</script>
<style scoped lang="scss">
@import '../assets/css/common/addcar.scss';
</style>
\ No newline at end of file
<template>
<view class="bottom-nav-fixed row">
<navigator url="#" class="navitem" :class="{'act':actval==1}">
<text class="icon iconfont icon-home"></text>
<view>首页</view>
</navigator>
<navigator url="#" class="navitem" :class="{'act':actval==2}">
<text class="icon iconfont icon-class"></text>
<view>分类</view>
</navigator>
<navigator url="#" class="cartbgo navitem" :class="{'act':actval==3}">
<text class="icon iconfont icon-car"></text>
<view >购物车<text class="counts">11</text></view>
</navigator>
<navigator url="#" class="navitem" :class="{'act':actval==4}">
<text class="icon iconfont icon-user"></text>
<view>我的</view>
</navigator>
</view>
</template>
<script>
export default {
name: "bottom_nav",
props: {
actval: {
type: String,
default: 1
},
},
data() {
return {
}
},
methods: {
getData() {
}
}
}
</script>
<style scoped lang="scss">
uni-page-body{padding-bottom:100rpx;}
.bottom-nav-fixed {
width: 750rpx;
height: 100rpx;
background: #fff;
position: fixed;
bottom:0rpx;
z-index: 666;
padding-top: 14rpx;
navigator{
display: block;
color:$uni-color999;
font-size: 20rpx;
width:25%;
text-align: center;
text{
font-size: 44rpx;
}
&.act{
color:$uni-coloract;
}
&.cartbgo{
position: relative;
.counts{
width: 46rpx;
height: 32rpx;
background: #FF3700;
border-radius: 16rpx;
border: 2rpx solid #FFFFFF;
position: absolute;
right:40rpx;
top:-5rpx;
color:#fff;
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view <!-- #ifndef MP-WEIXIN -->
:style="{
transform: `translate(${offsetX}px, ${offsetY}px)`,
MsTransform: `translate(${offsetX}px, ${offsetY}px)`,
MozTransform: `translate(${offsetX}px, ${offsetY}px)`,
WebkitTransform: `translate(${offsetX}px, ${offsetY}px)`,
OTransform: `translate(${offsetX}px, ${offsetY}px)`,
transition: move ? 'none' : 'transform 0.2s ease-in-out',
MsTransition: move ? 'none' : 'transform 0.2s ease-in-out',
MozTransition: move ? 'none' : 'transform 0.2s ease-in-out',
WebkitTransition: move ? 'none' : 'transform 0.2s ease-in-out',
OTransition: move ? 'none' : 'transform 0.2s ease-in-out'
}"
<!-- #endif -->
@click.stop="click"
@touchmove.stop.prevent="touchmove"
@touchstart="touchstart"
@touchend="touchend"
>
<view class="navxfbox25" >
<text class="icon iconfont icon-qq icon-qqnavxf"></text>
<view class="texttmavsk">QQ</view>
<view class="texttmavsk">咨询</view>
</view>
<slot>
</slot>
</view>
</template>
<script>
export default {
name: 'DragButtonFollow',
props: {
className: {
type: String,
default: ''
},
// #ifdef MP-WEIXIN
style: {
type: String,
default: ''
},
// #endif
drag: {
type: Boolean,
default: true
},
follow: {
type: String | Boolean,
default: 'all'
},
followNum: {
type: Number,
default: 0
}
},
safeArea: {},
data() {
return {
offsetX: 0,
offsetY: 0,
width: 0,
height: 0,
left: 0,
top: 0,
move: false,
foll: {
}
}
},
mounted() {
const systemInfo = uni.getSystemInfoSync() || {}
this.$options.safeArea = {
left: 0,
top: 0,
right: systemInfo.windowWidth,
bottom: systemInfo.windowHeight
}
const query = this.$parent.createSelectorQuery()
query.select(`.${this.className}`).boundingClientRect(data => {
if (data) {
this.width = data.width
this.height = data.height
this.left = data.left
this.top = data.top
}
}).exec()
if (this.follow) {
const type = this.follow.split(",")
let isLeft, isRight, isTop, isBottom, isAll, num
type.forEach(_ => {
if (_ === 'all') isAll = true
if (_ === 'left') isLeft = true
if (_ === 'right') isRight = true
if (_ === 'top') isTop = true
if (_ === 'bottom') isBottom = true
})
if (isAll) isLeft = isRight = isTop = isBottom = true
num = Math.round(this.width * this.followNum / 100)
this.foll = {
isLeft,
isRight,
isTop,
isBottom,
num
}
}
},
methods: {
click() {
this.$emit('btnClick');
},
touchstart(e) {
if (!this.drag) return
this.move = true
},
touchmove(e) {
if (!this.drag) return
if (!this.move) return
const {
left,
right,
top,
bottom
} = this.$options.safeArea
const dot = e.changedTouches[0]
if (dot.clientX < left + this.width / 2) dot.clientX = left + this.width / 2
if (dot.clientX > right - this.width / 2) dot.clientX = right - this.width / 2
if (dot.clientY < top + this.height / 2) dot.clientY = top + this.height / 2
if (dot.clientY > bottom - this.height / 2) dot.clientY = bottom - this.height / 2
this.offsetX = dot.clientX - this.left - this.width / 2
this.offsetY = dot.clientY - this.top - this.height / 2
// #ifdef MP-WEIXIN
this.$emit("update:style", `
transform: translate(${this.offsetX}px, ${this.offsetY}px);
WebkitTransform: translate(${this.offsetX}px, ${this.offsetY}px);
transition: ${this.move ? 'none' : 'transform 0.2s ease-in-out'};
WebkitTransition: ${this.move ? 'none' : 'transform 0.2s ease-in-out'};
`)
// #endif
},
touchend(e) {
if (!this.drag) return
this.move = false
if (!this.follow) return
const dot = e.changedTouches[0]
const {
left,
right,
top,
bottom
} = this.$options.safeArea
if (this.foll.isLeft && this.foll.isRight) {
if (dot.clientX <= (left + right) / 2) this.offsetX = this.foll.num - this.left
if (dot.clientX > (left + right) / 2) this.offsetX = right - this.width - this.foll.num - this.left
} else if (this.foll.isLeft) {
this.offsetX = this.foll.num - this.left
} else if (this.foll.isRight) {
this.offsetX = right - this.width - this.foll.num - this.left
}
if (this.foll.isTop && this.foll.isBottom) {
if (dot.clientY <= (top + bottom) / 2) this.offsetY = this.foll.num - this.top
if (dot.clientY > (top + bottom) / 2) this.offsetY = bottom - this.height - this.foll.num - this.top
} else if (this.foll.isTop) {
this.offsetY = this.foll.num - this.top
} else if (this.foll.isBottom) {
this.offsetY = bottom - this.height - this.foll.num - this.top
}
// #ifdef MP-WEIXIN
this.$emit("update:style", `
transform: translate(${this.offsetX}px, ${this.offsetY}px);
WebkitTransform: translate(${this.offsetX}px, ${this.offsetY}px);
transition: ${this.move ? 'none' : 'transform 0.2s ease-in-out'};
WebkitTransition: ${this.move ? 'none' : 'transform 0.2s ease-in-out'};
`)
// #endif
},
}
}
</script>
<style scoped>
/* #ifdef MP-WEIXIN */
view {
height: 100%;
width: 100%;
display: inherit;
justify-content: inherit;
align-items: inherit;
}
/* #endif */
.drag-button {
width: 68rpx;
height: 130rpx;
background: #1969F9;
border-radius: 10rpx;
position: fixed;
left: 0px;
top: 50%;
z-index: 777;
}
.navxfbox25 {
width: 68rpx;
height: 130rpx;
text-align: center;
padding-top: 16rpx;
box-sizing: border-box;
display: block;
text-decoration: none;
}
.icon-qqnavxf {
font-size: 48rpx;
color: #fff;
}
.texttmavsk {
font-size: 20rpx;
color: #fff;
height: 24rpx;
line-height: 24rpx;
}
</style>
\ No newline at end of file
export default {
bind(el, binding) {
el.addEventListener('click', function () {
uni.navigateBack({
delta: 1
});
}, false);
}
}
\ No newline at end of file
import Vue from 'vue'
import backDirective from './back';
export default {
install (Vue) {
Vue.directive('back', backDirective);
}
}
/**
* 隐藏文字
* @param value
* @returns {string}
*/
export const textDesc = (value, params) => {
if (value.length > 30) {
return value.substr(0, 30) + '......';
} else {
return value;
}
}
import { textDesc } from './formate';
export default {
textDesc
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>
import App from './App'
import { request } from '@/util/util.js'
import filters from '@/filters'
import router from '@/router/index.js'
import { RouterMount } from 'uni-simple-router'
import directive from '@/directive'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
Vue.prototype.request = request
App.mpType = 'app'
//过滤器遍历
Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
//自定义指令
Vue.use(directive);
try {
function isPromise(obj) {
return (
!!obj &&
(typeof obj === "object" || typeof obj === "function") &&
typeof obj.then === "function"
);
}
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致
uni.addInterceptor({
returnValue(res) {
if (!isPromise(res)) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => {
if (res[0]) {
reject(res[0]);
} else {
resolve(res[1]);
}
});
});
},
});
} catch (error) { }
const app = new Vue({
...App
})
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app,'#app');
// #endif
// #ifndef H5
app.$mount()//为了兼容小程序及app端必须这样写才有效果
// #endif
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
\ No newline at end of file
{
"name" : "H5_2.0",
"appid" : "",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}
'use strict';
var token = '%[a-f0-9]{2}';
var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
function decodeComponents(components, split) {
try {
// Try to decode the entire string first
return [decodeURIComponent(components.join(''))];
} catch (err) {
// Do nothing
}
if (components.length === 1) {
return components;
}
split = split || 1;
// Split the array in 2 parts
var left = components.slice(0, split);
var right = components.slice(split);
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
}
function decode(input) {
try {
return decodeURIComponent(input);
} catch (err) {
var tokens = input.match(singleMatcher) || [];
for (var i = 1; i < tokens.length; i++) {
input = decodeComponents(tokens, i).join('');
tokens = input.match(singleMatcher) || [];
}
return input;
}
}
function customDecodeURIComponent(input) {
// Keep track of all the replacements and prefill the map with the `BOM`
var replaceMap = {
'%FE%FF': '\uFFFD\uFFFD',
'%FF%FE': '\uFFFD\uFFFD'
};
var match = multiMatcher.exec(input);
while (match) {
try {
// Decode as big chunks as possible
replaceMap[match[0]] = decodeURIComponent(match[0]);
} catch (err) {
var result = decode(match[0]);
if (result !== match[0]) {
replaceMap[match[0]] = result;
}
}
match = multiMatcher.exec(input);
}
// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
replaceMap['%C2'] = '\uFFFD';
var entries = Object.keys(replaceMap);
for (var i = 0; i < entries.length; i++) {
// Replace all decoded components
var key = entries[i];
input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
}
return input;
}
module.exports = function (encodedURI) {
if (typeof encodedURI !== 'string') {
throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
}
try {
encodedURI = encodedURI.replace(/\+/g, ' ');
// Try the built in decoder first
return decodeURIComponent(encodedURI);
} catch (err) {
// Fallback to a more advanced decoder
return customDecodeURIComponent(encodedURI);
}
};
The MIT License (MIT)
Copyright (c) 2017, Sam Verschueren <sam.verschueren@gmail.com> (github.com/SamVerschueren)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "decode-uri-component",
"version": "0.2.2",
"description": "A better decodeURIComponent",
"license": "MIT",
"repository": "SamVerschueren/decode-uri-component",
"author": {
"name": "Sam Verschueren",
"email": "sam.verschueren@gmail.com",
"url": "github.com/SamVerschueren"
},
"engines": {
"node": ">=0.10"
},
"scripts": {
"test": "xo && nyc ava",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"files": [
"index.js"
],
"keywords": [
"decode",
"uri",
"component",
"decodeuricomponent",
"components",
"decoder",
"url"
],
"devDependencies": {
"ava": "^0.17.0",
"coveralls": "^2.13.1",
"nyc": "^10.3.2",
"xo": "^0.16.0"
},
"__npminstall_done": true,
"_from": "decode-uri-component@0.2.2",
"_resolved": "https://registry.npmmirror.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz"
}
\ No newline at end of file
# decode-uri-component
![CI](https://github.com/SamVerschueren/decode-uri-component/workflows/CI/badge.svg) [![Coverage Status](https://coveralls.io/repos/SamVerschueren/decode-uri-component/badge.svg?branch=master&service=github)](https://coveralls.io/github/SamVerschueren/decode-uri-component?branch=master)
> A better [decodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent)
## Why?
- Decodes `+` to a space.
- Converts the [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) to a [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) `�`.
- Does not throw with invalid encoded input.
- Decodes as much of the string as possible.
## Install
```
$ npm install --save decode-uri-component
```
## Usage
```js
const decodeUriComponent = require('decode-uri-component');
decodeUriComponent('%25');
//=> '%'
decodeUriComponent('%');
//=> '%'
decodeUriComponent('st%C3%A5le');
//=> 'ståle'
decodeUriComponent('%st%C3%A5le%');
//=> '%ståle%'
decodeUriComponent('%%7Bst%C3%A5le%7D%');
//=> '%{ståle}%'
decodeUriComponent('%7B%ab%%7C%de%%7D');
//=> '{%ab%|%de%}'
decodeUriComponent('%FE%FF');
//=> '\uFFFD\uFFFD'
decodeUriComponent('%C2');
//=> '\uFFFD'
decodeUriComponent('%C2%B5');
//=> 'µ'
```
## API
### decodeUriComponent(encodedURI)
#### encodedURI
Type: `string`
An encoded component of a Uniform Resource Identifier.
## License
MIT © [Sam Verschueren](https://github.com/SamVerschueren)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-decode-uri-component?utm_source=npm-decode-uri-component&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
'use strict';
module.exports = function (obj, predicate) {
var ret = {};
var keys = Object.keys(obj);
var isArr = Array.isArray(predicate);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var val = obj[key];
if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {
ret[key] = val;
}
}
return ret;
};
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "filter-obj",
"version": "1.1.0",
"description": "Filter object keys and values into a new object",
"license": "MIT",
"repository": "sindresorhus/filter-obj",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && node test.js"
},
"files": [
"index.js"
],
"keywords": [
"filter",
"obj",
"object",
"key",
"keys",
"value",
"values",
"val",
"iterate",
"iterator"
],
"devDependencies": {
"ava": "0.0.4",
"xo": "*"
},
"__npminstall_done": true,
"_from": "filter-obj@1.1.0",
"_resolved": "https://registry.npmmirror.com/filter-obj/-/filter-obj-1.1.0.tgz"
}
\ No newline at end of file
# filter-obj [![Build Status](https://travis-ci.org/sindresorhus/filter-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/filter-obj)
> Filter object keys and values into a new object
## Install
```
$ npm install --save filter-obj
```
## Usage
```js
var filterObj = require('filter-obj');
var obj = {
foo: true,
bar: false
};
var newObject = filterObj(obj, function (key, value, object) {
return value === true;
});
//=> {foo: true}
var newObject2 = filterObj(obj, ['bar']);
//=> {bar: true}
```
## Related
- [map-obj](https://github.com/sindresorhus/map-obj) - Map object keys and values into a new object
- [object-assign](https://github.com/sindresorhus/object-assign) - Copy enumerable own properties from one or more source objects to a target object
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
'use strict';
const strictUriEncode = require('strict-uri-encode');
const decodeComponent = require('decode-uri-component');
const splitOnFirst = require('split-on-first');
const filterObject = require('filter-obj');
const isNullOrUndefined = value => value === null || value === undefined;
function encoderForArrayFormat(options) {
switch (options.arrayFormat) {
case 'index':
return key => (result, value) => {
const index = result.length;
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, [encode(key, options), '[', index, ']'].join('')];
}
return [
...result,
[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
];
};
case 'bracket':
return key => (result, value) => {
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, [encode(key, options), '[]'].join('')];
}
return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
};
case 'comma':
case 'separator':
return key => (result, value) => {
if (value === null || value === undefined || value.length === 0) {
return result;
}
if (result.length === 0) {
return [[encode(key, options), '=', encode(value, options)].join('')];
}
return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
};
default:
return key => (result, value) => {
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, encode(key, options)];
}
return [...result, [encode(key, options), '=', encode(value, options)].join('')];
};
}
}
function parserForArrayFormat(options) {
let result;
switch (options.arrayFormat) {
case 'index':
return (key, value, accumulator) => {
result = /\[(\d*)\]$/.exec(key);
key = key.replace(/\[\d*\]$/, '');
if (!result) {
accumulator[key] = value;
return;
}
if (accumulator[key] === undefined) {
accumulator[key] = {};
}
accumulator[key][result[1]] = value;
};
case 'bracket':
return (key, value, accumulator) => {
result = /(\[\])$/.exec(key);
key = key.replace(/\[\]$/, '');
if (!result) {
accumulator[key] = value;
return;
}
if (accumulator[key] === undefined) {
accumulator[key] = [value];
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
case 'comma':
case 'separator':
return (key, value, accumulator) => {
const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);
const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));
value = isEncodedArray ? decode(value, options) : value;
const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
accumulator[key] = newValue;
};
default:
return (key, value, accumulator) => {
if (accumulator[key] === undefined) {
accumulator[key] = value;
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
}
}
function validateArrayFormatSeparator(value) {
if (typeof value !== 'string' || value.length !== 1) {
throw new TypeError('arrayFormatSeparator must be single character string');
}
}
function encode(value, options) {
if (options.encode) {
return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
}
return value;
}
function decode(value, options) {
if (options.decode) {
return decodeComponent(value);
}
return value;
}
function keysSorter(input) {
if (Array.isArray(input)) {
return input.sort();
}
if (typeof input === 'object') {
return keysSorter(Object.keys(input))
.sort((a, b) => Number(a) - Number(b))
.map(key => input[key]);
}
return input;
}
function removeHash(input) {
const hashStart = input.indexOf('#');
if (hashStart !== -1) {
input = input.slice(0, hashStart);
}
return input;
}
function getHash(url) {
let hash = '';
const hashStart = url.indexOf('#');
if (hashStart !== -1) {
hash = url.slice(hashStart);
}
return hash;
}
function extract(input) {
input = removeHash(input);
const queryStart = input.indexOf('?');
if (queryStart === -1) {
return '';
}
return input.slice(queryStart + 1);
}
function parseValue(value, options) {
if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
value = Number(value);
} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
value = value.toLowerCase() === 'true';
}
return value;
}
function parse(query, options) {
options = Object.assign({
decode: true,
sort: true,
arrayFormat: 'none',
arrayFormatSeparator: ',',
parseNumbers: false,
parseBooleans: false
}, options);
validateArrayFormatSeparator(options.arrayFormatSeparator);
const formatter = parserForArrayFormat(options);
// Create an object with no prototype
const ret = Object.create(null);
if (typeof query !== 'string') {
return ret;
}
query = query.trim().replace(/^[?#&]/, '');
if (!query) {
return ret;
}
for (const param of query.split('&')) {
if (param === '') {
continue;
}
let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '=');
// Missing `=` should be `null`:
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
value = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options);
formatter(decode(key, options), value, ret);
}
for (const key of Object.keys(ret)) {
const value = ret[key];
if (typeof value === 'object' && value !== null) {
for (const k of Object.keys(value)) {
value[k] = parseValue(value[k], options);
}
} else {
ret[key] = parseValue(value, options);
}
}
if (options.sort === false) {
return ret;
}
return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
const value = ret[key];
if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
// Sort object keys, not values
result[key] = keysSorter(value);
} else {
result[key] = value;
}
return result;
}, Object.create(null));
}
exports.extract = extract;
exports.parse = parse;
exports.stringify = (object, options) => {
if (!object) {
return '';
}
options = Object.assign({
encode: true,
strict: true,
arrayFormat: 'none',
arrayFormatSeparator: ','
}, options);
validateArrayFormatSeparator(options.arrayFormatSeparator);
const shouldFilter = key => (
(options.skipNull && isNullOrUndefined(object[key])) ||
(options.skipEmptyString && object[key] === '')
);
const formatter = encoderForArrayFormat(options);
const objectCopy = {};
for (const key of Object.keys(object)) {
if (!shouldFilter(key)) {
objectCopy[key] = object[key];
}
}
const keys = Object.keys(objectCopy);
if (options.sort !== false) {
keys.sort(options.sort);
}
return keys.map(key => {
const value = object[key];
if (value === undefined) {
return '';
}
if (value === null) {
return encode(key, options);
}
if (Array.isArray(value)) {
return value
.reduce(formatter(key), [])
.join('&');
}
return encode(key, options) + '=' + encode(value, options);
}).filter(x => x.length > 0).join('&');
};
exports.parseUrl = (url, options) => {
options = Object.assign({
decode: true
}, options);
const [url_, hash] = splitOnFirst(url, '#');
return Object.assign(
{
url: url_.split('?')[0] || '',
query: parse(extract(url), options)
},
options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}
);
};
exports.stringifyUrl = (object, options) => {
options = Object.assign({
encode: true,
strict: true
}, options);
const url = removeHash(object.url).split('?')[0] || '';
const queryFromUrl = exports.extract(object.url);
const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});
const query = Object.assign(parsedQueryFromUrl, object.query);
let queryString = exports.stringify(query, options);
if (queryString) {
queryString = `?${queryString}`;
}
let hash = getHash(object.url);
if (object.fragmentIdentifier) {
hash = `#${encode(object.fragmentIdentifier, options)}`;
}
return `${url}${queryString}${hash}`;
};
exports.pick = (input, filter, options) => {
options = Object.assign({
parseFragmentIdentifier: true
}, options);
const {url, query, fragmentIdentifier} = exports.parseUrl(input, options);
return exports.stringifyUrl({
url,
query: filterObject(query, filter),
fragmentIdentifier
}, options);
};
exports.exclude = (input, filter, options) => {
const exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value);
return exports.pick(input, exclusionFilter, options);
};
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (http://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
var token = '%[a-f0-9]{2}';
var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
function decodeComponents(components, split) {
try {
// Try to decode the entire string first
return [decodeURIComponent(components.join(''))];
} catch (err) {
// Do nothing
}
if (components.length === 1) {
return components;
}
split = split || 1;
// Split the array in 2 parts
var left = components.slice(0, split);
var right = components.slice(split);
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
}
function decode(input) {
try {
return decodeURIComponent(input);
} catch (err) {
var tokens = input.match(singleMatcher) || [];
for (var i = 1; i < tokens.length; i++) {
input = decodeComponents(tokens, i).join('');
tokens = input.match(singleMatcher) || [];
}
return input;
}
}
function customDecodeURIComponent(input) {
// Keep track of all the replacements and prefill the map with the `BOM`
var replaceMap = {
'%FE%FF': '\uFFFD\uFFFD',
'%FF%FE': '\uFFFD\uFFFD'
};
var match = multiMatcher.exec(input);
while (match) {
try {
// Decode as big chunks as possible
replaceMap[match[0]] = decodeURIComponent(match[0]);
} catch (err) {
var result = decode(match[0]);
if (result !== match[0]) {
replaceMap[match[0]] = result;
}
}
match = multiMatcher.exec(input);
}
// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
replaceMap['%C2'] = '\uFFFD';
var entries = Object.keys(replaceMap);
for (var i = 0; i < entries.length; i++) {
// Replace all decoded components
var key = entries[i];
input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
}
return input;
}
module.exports = function (encodedURI) {
if (typeof encodedURI !== 'string') {
throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
}
try {
encodedURI = encodedURI.replace(/\+/g, ' ');
// Try the built in decoder first
return decodeURIComponent(encodedURI);
} catch (err) {
// Fallback to a more advanced decoder
return customDecodeURIComponent(encodedURI);
}
};
The MIT License (MIT)
Copyright (c) 2017, Sam Verschueren <sam.verschueren@gmail.com> (github.com/SamVerschueren)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "decode-uri-component",
"version": "0.2.2",
"description": "A better decodeURIComponent",
"license": "MIT",
"repository": "SamVerschueren/decode-uri-component",
"author": {
"name": "Sam Verschueren",
"email": "sam.verschueren@gmail.com",
"url": "github.com/SamVerschueren"
},
"engines": {
"node": ">=0.10"
},
"scripts": {
"test": "xo && nyc ava",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"files": [
"index.js"
],
"keywords": [
"decode",
"uri",
"component",
"decodeuricomponent",
"components",
"decoder",
"url"
],
"devDependencies": {
"ava": "^0.17.0",
"coveralls": "^2.13.1",
"nyc": "^10.3.2",
"xo": "^0.16.0"
},
"__npminstall_done": true,
"_from": "decode-uri-component@0.2.2",
"_resolved": "https://registry.npmmirror.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz"
}
\ No newline at end of file
# decode-uri-component
![CI](https://github.com/SamVerschueren/decode-uri-component/workflows/CI/badge.svg) [![Coverage Status](https://coveralls.io/repos/SamVerschueren/decode-uri-component/badge.svg?branch=master&service=github)](https://coveralls.io/github/SamVerschueren/decode-uri-component?branch=master)
> A better [decodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent)
## Why?
- Decodes `+` to a space.
- Converts the [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) to a [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) `�`.
- Does not throw with invalid encoded input.
- Decodes as much of the string as possible.
## Install
```
$ npm install --save decode-uri-component
```
## Usage
```js
const decodeUriComponent = require('decode-uri-component');
decodeUriComponent('%25');
//=> '%'
decodeUriComponent('%');
//=> '%'
decodeUriComponent('st%C3%A5le');
//=> 'ståle'
decodeUriComponent('%st%C3%A5le%');
//=> '%ståle%'
decodeUriComponent('%%7Bst%C3%A5le%7D%');
//=> '%{ståle}%'
decodeUriComponent('%7B%ab%%7C%de%%7D');
//=> '{%ab%|%de%}'
decodeUriComponent('%FE%FF');
//=> '\uFFFD\uFFFD'
decodeUriComponent('%C2');
//=> '\uFFFD'
decodeUriComponent('%C2%B5');
//=> 'µ'
```
## API
### decodeUriComponent(encodedURI)
#### encodedURI
Type: `string`
An encoded component of a Uniform Resource Identifier.
## License
MIT © [Sam Verschueren](https://github.com/SamVerschueren)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-decode-uri-component?utm_source=npm-decode-uri-component&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
'use strict';
module.exports = function (obj, predicate) {
var ret = {};
var keys = Object.keys(obj);
var isArr = Array.isArray(predicate);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var val = obj[key];
if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {
ret[key] = val;
}
}
return ret;
};
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "filter-obj",
"version": "1.1.0",
"description": "Filter object keys and values into a new object",
"license": "MIT",
"repository": "sindresorhus/filter-obj",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && node test.js"
},
"files": [
"index.js"
],
"keywords": [
"filter",
"obj",
"object",
"key",
"keys",
"value",
"values",
"val",
"iterate",
"iterator"
],
"devDependencies": {
"ava": "0.0.4",
"xo": "*"
},
"__npminstall_done": true,
"_from": "filter-obj@1.1.0",
"_resolved": "https://registry.npmmirror.com/filter-obj/-/filter-obj-1.1.0.tgz"
}
\ No newline at end of file
# filter-obj [![Build Status](https://travis-ci.org/sindresorhus/filter-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/filter-obj)
> Filter object keys and values into a new object
## Install
```
$ npm install --save filter-obj
```
## Usage
```js
var filterObj = require('filter-obj');
var obj = {
foo: true,
bar: false
};
var newObject = filterObj(obj, function (key, value, object) {
return value === true;
});
//=> {foo: true}
var newObject2 = filterObj(obj, ['bar']);
//=> {bar: true}
```
## Related
- [map-obj](https://github.com/sindresorhus/map-obj) - Map object keys and values into a new object
- [object-assign](https://github.com/sindresorhus/object-assign) - Copy enumerable own properties from one or more source objects to a target object
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
/**
Split a string on the first occurrence of a given separator.
@param string - The string to split.
@param separator - The separator to split on.
@example
```
import splitOnFirst = require('split-on-first');
splitOnFirst('a-b-c', '-');
//=> ['a', 'b-c']
splitOnFirst('key:value:value2', ':');
//=> ['key', 'value:value2']
splitOnFirst('a---b---c', '---');
//=> ['a', 'b---c']
splitOnFirst('a-b-c', '+');
//=> ['a-b-c']
```
*/
declare function splitOnFirst(
string: string,
separator: string
): [string, string?];
export = splitOnFirst;
'use strict';
module.exports = (string, separator) => {
if (!(typeof string === 'string' && typeof separator === 'string')) {
throw new TypeError('Expected the arguments to be of type `string`');
}
if (separator === '') {
return [string];
}
const separatorIndex = string.indexOf(separator);
if (separatorIndex === -1) {
return [string];
}
return [
string.slice(0, separatorIndex),
string.slice(separatorIndex + separator.length)
];
};
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "split-on-first",
"version": "1.1.0",
"description": "Split a string on the first occurance of a given separator",
"license": "MIT",
"repository": "sindresorhus/split-on-first",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"split",
"string",
"first",
"occurrence",
"separator",
"delimiter",
"text"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"__npminstall_done": true,
"_from": "split-on-first@1.1.0",
"_resolved": "https://registry.npmmirror.com/split-on-first/-/split-on-first-1.1.0.tgz"
}
\ No newline at end of file
# split-on-first [![Build Status](https://travis-ci.com/sindresorhus/split-on-first.svg?branch=master)](https://travis-ci.com/sindresorhus/split-on-first)
> Split a string on the first occurrence of a given separator
This is similar to [`String#split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), but that one splits on all the occurrences, not just the first one.
## Install
```
$ npm install split-on-first
```
## Usage
```js
const splitOnFirst = require('split-on-first');
splitOnFirst('a-b-c', '-');
//=> ['a', 'b-c']
splitOnFirst('key:value:value2', ':');
//=> ['key', 'value:value2']
splitOnFirst('a---b---c', '---');
//=> ['a', 'b---c']
splitOnFirst('a-b-c', '+');
//=> ['a-b-c']
```
## API
### splitOnFirst(string, separator)
#### string
Type: `string`
The string to split.
#### separator
Type: `string`
The separator to split on.
## Related
- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
'use strict';
module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
The MIT License (MIT)
Copyright (c) Kevin Martensson <kevinmartensson@gmail.com> (github.com/kevva)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "strict-uri-encode",
"version": "2.0.0",
"description": "A stricter URI encode adhering to RFC 3986",
"license": "MIT",
"repository": "kevva/strict-uri-encode",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/kevva"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"component",
"encode",
"RFC3986",
"uri"
],
"devDependencies": {
"ava": "*",
"xo": "*"
},
"__npminstall_done": true,
"_from": "strict-uri-encode@2.0.0",
"_resolved": "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz"
}
\ No newline at end of file
# strict-uri-encode [![Build Status](https://travis-ci.org/kevva/strict-uri-encode.svg?branch=master)](https://travis-ci.org/kevva/strict-uri-encode)
> A stricter URI encode adhering to [RFC 3986](http://tools.ietf.org/html/rfc3986)
## Install
```
$ npm install --save strict-uri-encode
```
## Usage
```js
const strictUriEncode = require('strict-uri-encode');
strictUriEncode('unicorn!foobar');
//=> 'unicorn%21foobar'
strictUriEncode('unicorn*foobar');
//=> 'unicorn%2Afoobar'
```
## API
### strictUriEncode(string)
#### string
Type: `string`, `number`
String to URI encode.
## License
MIT © [Kevin Mårtensson](http://github.com/kevva)
{
"name": "query-string",
"version": "6.14.1",
"description": "Parse and stringify URL query strings",
"license": "MIT",
"repository": "sindresorhus/query-string",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"benchmark": "node benchmark.js",
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"browser",
"querystring",
"query",
"string",
"qs",
"param",
"parameter",
"url",
"parse",
"stringify",
"encode",
"decode",
"searchparams",
"filter"
],
"dependencies": {
"decode-uri-component": "^0.2.0",
"filter-obj": "^1.1.0",
"split-on-first": "^1.0.0",
"strict-uri-encode": "^2.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"benchmark": "^2.1.4",
"deep-equal": "^1.0.1",
"fast-check": "^1.5.0",
"tsd": "^0.7.3",
"xo": "^0.24.0"
},
"__npminstall_done": true,
"_from": "query-string@6.14.1",
"_resolved": "https://registry.npmmirror.com/query-string/-/query-string-6.14.1.tgz"
}
\ No newline at end of file
/**
Split a string on the first occurrence of a given separator.
@param string - The string to split.
@param separator - The separator to split on.
@example
```
import splitOnFirst = require('split-on-first');
splitOnFirst('a-b-c', '-');
//=> ['a', 'b-c']
splitOnFirst('key:value:value2', ':');
//=> ['key', 'value:value2']
splitOnFirst('a---b---c', '---');
//=> ['a', 'b---c']
splitOnFirst('a-b-c', '+');
//=> ['a-b-c']
```
*/
declare function splitOnFirst(
string: string,
separator: string
): [string, string?];
export = splitOnFirst;
'use strict';
module.exports = (string, separator) => {
if (!(typeof string === 'string' && typeof separator === 'string')) {
throw new TypeError('Expected the arguments to be of type `string`');
}
if (separator === '') {
return [string];
}
const separatorIndex = string.indexOf(separator);
if (separatorIndex === -1) {
return [string];
}
return [
string.slice(0, separatorIndex),
string.slice(separatorIndex + separator.length)
];
};
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "split-on-first",
"version": "1.1.0",
"description": "Split a string on the first occurance of a given separator",
"license": "MIT",
"repository": "sindresorhus/split-on-first",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"split",
"string",
"first",
"occurrence",
"separator",
"delimiter",
"text"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"__npminstall_done": true,
"_from": "split-on-first@1.1.0",
"_resolved": "https://registry.npmmirror.com/split-on-first/-/split-on-first-1.1.0.tgz"
}
\ No newline at end of file
# split-on-first [![Build Status](https://travis-ci.com/sindresorhus/split-on-first.svg?branch=master)](https://travis-ci.com/sindresorhus/split-on-first)
> Split a string on the first occurrence of a given separator
This is similar to [`String#split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), but that one splits on all the occurrences, not just the first one.
## Install
```
$ npm install split-on-first
```
## Usage
```js
const splitOnFirst = require('split-on-first');
splitOnFirst('a-b-c', '-');
//=> ['a', 'b-c']
splitOnFirst('key:value:value2', ':');
//=> ['key', 'value:value2']
splitOnFirst('a---b---c', '---');
//=> ['a', 'b---c']
splitOnFirst('a-b-c', '+');
//=> ['a-b-c']
```
## API
### splitOnFirst(string, separator)
#### string
Type: `string`
The string to split.
#### separator
Type: `string`
The separator to split on.
## Related
- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
'use strict';
module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
The MIT License (MIT)
Copyright (c) Kevin Martensson <kevinmartensson@gmail.com> (github.com/kevva)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "strict-uri-encode",
"version": "2.0.0",
"description": "A stricter URI encode adhering to RFC 3986",
"license": "MIT",
"repository": "kevva/strict-uri-encode",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/kevva"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"component",
"encode",
"RFC3986",
"uri"
],
"devDependencies": {
"ava": "*",
"xo": "*"
},
"__npminstall_done": true,
"_from": "strict-uri-encode@2.0.0",
"_resolved": "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz"
}
\ No newline at end of file
# strict-uri-encode [![Build Status](https://travis-ci.org/kevva/strict-uri-encode.svg?branch=master)](https://travis-ci.org/kevva/strict-uri-encode)
> A stricter URI encode adhering to [RFC 3986](http://tools.ietf.org/html/rfc3986)
## Install
```
$ npm install --save strict-uri-encode
```
## Usage
```js
const strictUriEncode = require('strict-uri-encode');
strictUriEncode('unicorn!foobar');
//=> 'unicorn%21foobar'
strictUriEncode('unicorn*foobar');
//=> 'unicorn%2Afoobar'
```
## API
### strictUriEncode(string)
#### string
Type: `string`, `number`
String to URI encode.
## License
MIT © [Kevin Mårtensson](http://github.com/kevva)
# uni-simple-router
> 一个更为简洁的[Vue-router](https://router.vuejs.org/zh/),专为 [uni-app](https://uniapp.dcloud.io/) 量身打造
## 介绍
`uni-simple-router` 是专为 [uni-app](https://uniapp.dcloud.io/) 打造的路由器。它与 [uni-app](https://uniapp.dcloud.io/) 核心深度集成,使使用 [uni-app](https://uniapp.dcloud.io/) 轻松构建单页应用程序变得轻而易举。功能包括:
* `H5端` 能完全使用 `vue-router` 进行开发。
* 模块化,基于组件的路由器配置。
* 路由参数,查询,通配符。
* `H5端` 查看由 `uni-simple-router` 过渡系统提供动力的过渡效果。
* 更细粒度的导航控制。
* `H端`自动控制活动的CSS类链接。
* 通配小程序端、APP端、H5端。
开始使用 [查看文档](http://hhyang.cn),或 [使用示例](https://github.com/SilurianYang/uni-simple-router/tree/master/examples)(请参见下面的示例)。
## 问题
在提交问题的之前,请确保阅读 [“问题报告清单”](https://github.com/SilurianYang/uni-simple-router/issues/new?assignees=&labels=&template=bug_report.md&title=) 。不符合准则的问题可能会立即被解决。
## 贡献
提出拉取请求之前,请务必先阅读 [查看文档](http://hhyang.cn)(请参见下面的示例)。。
## 变更日志
[发行说明](https://github.com/SilurianYang/uni-simple-router/releases) 中记录了每个发行版的详细信息更改。
## 特别感谢
特别感谢 [markrgba](https://github.com/markrgba) 一直以来对文档和相关测试的维护。
## 技术交流
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=0f4d7f38e5d15dd49bf7c3032c80ed3f54ecfa3dd800053d6ae145c869f9eb47"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="uni-app 插件" title="uni-app 插件"></a>
import {
proxyLaunchHook, beforeBackHooks, beforeTabHooks, backApiCallHook,
} from './hooks';
import { Global, uniAppHook } from '../helpers/config';
import { assertCanBack } from './util';
import { warn } from '../helpers/warn';
/**
* 重写掉uni-app的 uni.getLocation 和 uni.chooseLocation APi
* @param {Object} Router 当前路由对象
*/
export const rewriteUniFun = function (Router) {
const oldSwitchTab = uni.switchTab; // 缓存 跳转到 tabBar 页面
uni.switchTab = function ({ url, ...args }, normal = false) {
if (normal === true || uniAppHook.pageReady === false) { // 调用原始的uni-app api
oldSwitchTab({
url,
...args,
});
} else {
if (uniAppHook.pageReady) { // 只有在路由守卫等 处理完所有操作后才能触发
const { path } = Router.$Route; // 获取当前路径
if (path == url) { // 路径相同不执行
return warn(`当前跳转路径:${url} 已在本页面无须跳转`);
}
beforeTabHooks.call(Router, url.substring(1)); // 不要 /
} else {
warn('路由守卫正在忙碌中 不允许执行 ‘uni.switchTab’');
}
}
};
};
/**
* 对当前app做一个动画页面 用来过渡首次next 等待时间过长的尴尬
* @param {Object} Router 当前路由对象
*/
export const registerLoddingPage = function (Router) {
const { loddingPageHook, loddingPageStyle } = Router.CONFIG.APP; // 获取app所有配置
const view = new plus.nativeObj.View('router-loadding', {
top: '0px',
left: '0px',
height: '100%',
width: '100%',
...loddingPageStyle.call(Router),
});
loddingPageHook.call(Router, view); // 触发等待页面生命周期
};
/**
* 移除当前 页面上 非router 声明的 onBackPress 事件
* @param {Object} page 当前 vue 组件对象
* @param {Object} options 当前page对象的 $options
* 修复 https://github.com/SilurianYang/uni-simple-router/issues/106
*/
export const removeBackPressEvent = function (page, options) {
const isBack = assertCanBack(page);
if (isBack) { // 可返回
options.onBackPress = [options.onBackPress[0]]; // 路由混入的都干掉
}
};
/**
* 判断当前页面是否需要拦截返回
*
* @param {Object} page 当前 vue 组件对象
* @param {Object} options 当前 vue 组件对象下的$options对象
* @param {Array} args 当前页面是点击头部返回还是底部返回
* 修复 https://github.com/SilurianYang/uni-simple-router/issues/66
*
* this 为当前 Router 对象
*/
export const pageIsHeadBack = function (page, options, args) {
if (args[0].from == 'navigateBack') { // 调用api返回
if (Global.LockStatus) { // 正在跳转的时候 返回按键按的太快啦
warn('当前页面正在处于跳转状态,请稍后再进行跳转....');
return true;
}
Global.LockStatus = true; // 设置为锁住状态
backApiCallHook.call(this, options, args);
return true;
}
const isBack = assertCanBack(page);
if (isBack) { // 可返回
if (Global.LockStatus) { // 正在跳转的时候 返回按键按的太快啦
warn('当前页面正在处于跳转状态,请稍后再进行跳转....');
return true;
}
Global.LockStatus = true; // 设置为锁住状态
beforeBackHooks.call(this, options, args);
return true;
}
return false;
};
/**
* 开始初始化app端路由配置
*
* @param {Object} Router
*
* this 为当前 page 对象
*/
export const appInit = function (Router) {
proxyLaunchHook.call(this);
const { holdTabbar } = Router.CONFIG.APP;
if (holdTabbar) { // 开启tab拦截时
rewriteUniFun(Router);
}
registerLoddingPage(Router);
};
import { methods, baseConfig, Global } from '../helpers/config';
import { noop, formatURLQuery } from '../helpers/util';
let stop = null;
/**
* @param {Object} finalRoute 格式化后的路由跳转规则
* @param {Object} NAVTYPE 需要调用的跳转方法
*/
const uniPushTo = function (finalRoute, NAVTYPE) {
return new Promise((resolve) => {
const query = formatURLQuery(`?${finalRoute.uniRoute.query}`);
const { APP } = baseConfig;
const { url } = finalRoute.uniRoute;
stop = setTimeout(() => {
resolve(url);
resolve = noop; // 执行完了就没了 确保不会被下一次执行
Global.LockStatus = false; // 跳转完成解锁状态
}, APP.switchPageOutTime);
uni[methods[NAVTYPE]]({
url: url + query,
...finalRoute.route.animation,
complete: () => {
clearTimeout(stop);
resolve(url);
resolve = noop; // 执行完了就没了 确保不会被下一次执行
Global.LockStatus = false; // 跳转完成解锁状态
},
}, true); // 这里传递true 主要是兼容重写 uni.switchTab
});
};
export default uniPushTo;
import { err } from '../helpers/warn';
import { copyObject, parseQuery } from '../helpers/util';
import { Global, route as mergeRoute } from '../helpers/config';
/**
* 触发指定生命钩子
* @param {Array} funList //需要执行的方法列表
* @param {Object} args //触发生命钩子传递的参数
*/
export const callAppHook = function (funList = [], args) {
for (let i = 0; i < funList.length; i += 1) {
funList[i].call(this, args);
}
};
/**
* @param {Number} index //需要获取的页面下标 -2:表示获取最后一个即当前页面 -1:表示全部 -3:当前页面的前一个页面
* @param {Boolean} all //是否获取全部的页面
*/
export const getPages = function (index = -1, all) {
const pages = getCurrentPages(all);
if (index === -1) {
return pages;
}
if (index === -2) {
return pages[pages.length - 1];
}
if (index === -3) {
return pages[pages.length - 2];
}
return pages[index];
};
/**
* 验证当前页面是否为nvue页面
* @param {Object} page 当前页面对象
*/
export const isNvuePage = function (page) {
const cstr = page.constructor.name;
const pageType = {
s: true,
z: false,
};
return pageType[cstr];
};
/**
* @param {Object} page //当前顶级页面对象
* @param {Object} vim:? //是否获取 $vm 对象还是 $mp 对象
*/
export const getPageVmOrMp = function (page, vim = true) {
if (vim) {
return page.$vm;
}
if (page.$vm.$mp) {
return page.$vm.$mp;
}
if (isNvuePage(page)) { // nvue 页面
return {
page,
query: page.__displayReporter.query,
};
}
};
/**
* 获取 to 的配置参数
* @param {Object} rule 当前跳转的规则
*/
export const formatTo = function (finalRoute) {
const route = copyObject(finalRoute.route);
const { rule } = finalRoute;
route.query = rule.query || rule.params || {};
return route;
};
/**
* 通过一个未知的路径或者名称 在路由表中查找指定路由表 并返回
* @param {string} type //path 或者 name
* @param {Object} routes //当前对象的所有路由表
*/
export const pathOrNameToRoute = function (type, routes = Global.Router.CONFIG.routes) {
const routesKeys = Object.keys(routes);
for (let i = 0; i < routesKeys.length; i += 1) {
const key = routesKeys[i];
const item = routes[key];
if (item.path === `/${type}`) {
return mergeRoute(item); // 合并一下对象,主要是合并 query:{} 及 params:{}
}
if (item.path === type) {
return mergeRoute(item); // 合并一下对象,主要是合并 query:{} 及 params:{}
}
if (item.name == type) {
return mergeRoute(item); // 合并一下对象,主要是合并 query:{} 及 params:{}
}
}
err(`当前 '${type}' 在路由表中没有找到匹配的 name 或者 path`);
};
/**
* 统一格式话 路由传递的参数 看看是编码还是非编码 做相应的对策
*
* @param {Object} query 当前的路由参数
* @param {Boolean} getter 是从页面获取 route 对象下的参数 还是编码后传输
*/
export const getFormatQuery = function (query = {}) {
if (Global.Router.CONFIG.encodeURI) {
try {
query = JSON.parse(decodeURIComponent(query.query || encodeURIComponent('{}')));
} catch (e) {
query = JSON.parse(query.query);
}
}
return query;
};
/**
* 获取 from 的配置参数 from 页面永远都是站在当前页面忘其它地方走 所以都是最后一个页面
*
* @param {Object} routes //当前对象的所有路由表
*/
export const formatFrom = function (routes) {
const topPage = getPages(-2);
const { page, query } = getPageVmOrMp(topPage, false);
const route = pathOrNameToRoute(page.route, routes); // 获取到当前路由表下的 route
route.query = getFormatQuery(query); // 不管是编码传输还是非编码 最后都得在 to/from 中换成json对象
return route;
};
/**
*
* 把用户的跳转路由规则格式化成uni-app可用的路由跳转规则
*
* @param {Object} rule //当前用户跳转的路由规则
* @param {Object} routes //当前simple-router 下的路由表
*/
export const ruleToUniNavInfo = function (rule, routes) {
if (rule == null) {
return err('当前跳转规则为空,请检查跳转代码');
}
// eslint-disable-next-line
let [navType, route, query, animation] = ['path', null, {}, {}];
if (rule.constructor === String) { // 是字符串类型 那当前就是路径啦
route = pathOrNameToRoute(rule, routes); // 直接把 rule 当 path 传递 完事
} else if (rule.constructor === Object) { // 对象类型 可以是 path 或者 name
route = pathOrNameToRoute(rule.path || (navType = 'name', rule.name), routes); // 两则必有其一 报错自己处理
query = rule.query || rule.params || {};
animation = rule.animation || {};
} else {
return err('传的什么乱七八糟的类型?路由跳转规则只认字符串 \'path\' , 对象 \'path\' , 对象 \'name\' ');
}
animation = { ...Global.Router.CONFIG.APP.animation, ...route.animation || {}, ...animation }; // 合并多种方式声明的动画效果
route.animation = animation; // 这才是最终的页面切换效果
// 路径处理完后 开始格式化参数
const uniRoute = parseQuery(route.path, query); // uni-app 需要的跳转规则
return {
rule,
route,
uniRoute,
};
};
/**
* 获取当前页面下的 Route 信息
*
* @param {Object} pages 获取页面对象集合
* @param {Object} Vim 用户传递的当前页面对象
*/
export const APPGetPageRoute = function (pages, Vim) {
let [query, path] = [{}, ''];
const page = pages[pages.length - 1]; // 获取到当前页面
if (pages.length > 0) {
query = getFormatQuery(page.options, true);
path = page.route;
} else if (Vim != null) {
query = getFormatQuery(Vim.$mp.page.options, true);
path = page.route;
}
const route = pathOrNameToRoute(path);
route.query = query;
return route;
};
/**
* 获取当前页面下的 onBeforeBack 生命周期并执行
*
* @param {Object} args 当前返回页面时uni-app传递的参数
*/
export const getPageOnBeforeBack = function (args) {
return new Promise(async (resolve) => {
const currPage = getPages(-2); // 获取到当前页面
const { onBeforeBack } = currPage.$vm.$options;
if (onBeforeBack != null && onBeforeBack.constructor === Function) {
const isNext = await onBeforeBack.call(currPage.$vm, args);
if (isNext === true) {
return resolve(false);
}
}
return resolve(true);
});
};
/**
* 断言当前页面是否可返回上一级
* @param {Object} page 当前页面webview对象
*/
export const assertCanBack = function (page) {
const pageStyle = page.$getAppWebview().getStyle();
if (pageStyle.titleNView != null && pageStyle.titleNView.autoBackButton) { // 只有处理有带返回按钮的页面
return true;
}
// 两种情况 1.真的是顶级页面时 2.自定义头部
const { $page } = page;
if ($page && $page.meta.isQuit === false) { // 自定义头部 不是顶级页面
return true;
}
return false; // 不可返回 真的是顶级页面时 返回就直接退出app了
};
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment