├── .gitignore ├── LICENSE ├── README.md ├── app.js ├── app.json ├── app.wxss ├── coupon.gif ├── dist ├── actionsheet │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── badge │ └── index.wxss ├── btn │ └── index.wxss ├── capsule │ ├── index.wxml │ └── index.wxss ├── card │ └── index.wxss ├── cell │ └── index.wxss ├── col │ └── index.wxss ├── color │ └── index.wxss ├── common │ └── helper.js ├── dialog │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── field │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── helper │ └── index.wxss ├── icon │ └── index.wxss ├── index.js ├── index.wxss ├── loadmore │ ├── index.wxml │ └── index.wxss ├── noticebar │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── panel │ └── index.wxss ├── popup │ └── index.wxss ├── row │ └── index.wxss ├── select │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── stepper │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── steps │ ├── index.wxml │ ├── index.wxss │ └── wxss │ │ ├── step.wxss │ │ └── vstep.wxss ├── switch │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── tab │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── tag │ └── index.wxss ├── toast │ ├── index.js │ ├── index.wxml │ └── index.wxss └── toptips │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── images ├── all.png ├── bktj.png ├── chaojisou.png ├── chaquan.jpg ├── coupon.png ├── esfd.png ├── favour-select.png ├── favour.png ├── food.png ├── home.png ├── hot-select.png ├── hot.png ├── index-select.png ├── index.png ├── jkj.png ├── kefu.png ├── logo.png ├── search.png ├── share.png ├── taobao.png ├── tmall.png ├── wholesale-select.png ├── wholesale.png └── woman.png ├── pages ├── detail │ ├── detail.js │ ├── detail.json │ ├── detail.wxml │ └── detail.wxss ├── explain │ ├── explain.js │ ├── explain.json │ ├── explain.wxml │ └── explain.wxss ├── favour │ ├── favour.js │ ├── favour.json │ ├── favour.wxml │ └── favour.wxss ├── search │ ├── search.js │ ├── search.json │ ├── search.wxml │ └── search.wxss └── supersearch │ ├── supersearch.js │ ├── supersearch.json │ ├── supersearch.wxml │ └── supersearch.wxss ├── qq.jpeg └── style └── weui.wxss /.gitignore: -------------------------------------------------------------------------------- 1 | project.config.json 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 优惠券小程序 2 | 3 | ## 效果 4 | ![演示](coupon.gif) 5 | 6 | ### 使用方法 7 | 8 | git clone https://github.com/AmateurEvents/coupon.git 9 | cd coupon 10 | 11 | #### 无服务端 12 | 13 | * 下载微信开发者工具 14 | * 打开项目 15 | 16 | #### 有服务端版 17 | 18 | * 申请小程序 19 | * 填写AppID 20 | * 搭建服务端 21 | * 打开小程序 22 | 23 | ### 待做 24 | 25 | * 服务端接口完善 26 | * 获取商品详情 27 | * 获取商品推荐理由 28 | * .... 29 | 30 | ### 交流(感兴趣的可加qq) 31 | 32 | ![交流](qq.jpeg) -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | App({ 2 | onLaunch: function () { 3 | wx.clearStorageSync(); 4 | }, 5 | globalData: { 6 | } 7 | }) 8 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/favour/favour", 4 | "pages/detail/detail", 5 | "pages/search/search", 6 | "pages/supersearch/supersearch", 7 | "pages/explain/explain" 8 | ], 9 | "window": { 10 | "backgroundTextStyle": "dark", 11 | "backgroundColor": "#f7f7f7", 12 | "navigationBarBackgroundColor": "#fff", 13 | "navigationBarTitleText": "优惠券", 14 | "navigationBarTextStyle": "black" 15 | }, 16 | "tabBar": { 17 | "color": "#999", 18 | "selectedColor": "#ec3e42", 19 | "backgroundColor": "#f7f7f7", 20 | "borderStyle": "black", 21 | "list": [ 22 | { 23 | "pagePath": "pages/favour/favour", 24 | "text": "优惠券", 25 | "iconPath": "images/favour.png", 26 | "selectedIconPath": "images/favour-select.png" 27 | }, 28 | { 29 | "pagePath": "pages/supersearch/supersearch", 30 | "text": "超级搜索", 31 | "iconPath": "images/hot.png", 32 | "selectedIconPath": "images/hot-select.png" 33 | } 34 | ] 35 | } 36 | } -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | @import "style/weui.wxss"; 2 | @import "dist/index.wxss"; 3 | -------------------------------------------------------------------------------- /coupon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/coupon.gif -------------------------------------------------------------------------------- /dist/actionsheet/index.js: -------------------------------------------------------------------------------- 1 | const { extractComponentId } = require('../common/helper'); 2 | 3 | module.exports = { 4 | _handleZanActionsheetMaskClick({ currentTarget = {} }) { 5 | const dataset = currentTarget.dataset || {}; 6 | const { componentId, closeOnClickOverlay } = dataset; 7 | 8 | // 判断是否在点击背景时需要关闭弹层 9 | if (!closeOnClickOverlay) { 10 | return; 11 | } 12 | 13 | resolveCancelClick.call(this, { componentId }); 14 | }, 15 | 16 | _handleZanActionsheetCancelBtnClick(e) { 17 | const componentId = extractComponentId(e); 18 | 19 | resolveCancelClick.call(this, { componentId }); 20 | }, 21 | 22 | _handleZanActionsheetBtnClick({ currentTarget = {} }) { 23 | const dataset = currentTarget.dataset || {}; 24 | const { componentId, index } = dataset; 25 | 26 | if (this.handleZanActionsheetClick) { 27 | this.handleZanActionsheetClick({ componentId, index }); 28 | } else { 29 | console.warn('页面缺少 handleZanActionsheetClick 回调函数'); 30 | } 31 | } 32 | }; 33 | 34 | function resolveCancelClick({ componentId }) { 35 | console.info('[zan:actionsheet:cancel]'); 36 | if (this.handleZanActionsheetCancel) { 37 | this.handleZanActionsheetCancel({ componentId }); 38 | } else { 39 | console.warn('页面缺少 handleZanActionsheetCancel 回调函数'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dist/actionsheet/index.wxml: -------------------------------------------------------------------------------- 1 | 41 | -------------------------------------------------------------------------------- /dist/actionsheet/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-actionsheet{background-color:#f8f8f8}.zan-actionsheet__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-actionsheet__container{position:fixed;left:0;right:0;bottom:0;background:#f8f8f8;transform:translate3d(0,50%,0);transform-origin:center;transition:all .2s ease;z-index:11;opacity:0;visibility:hidden}.zan-actionsheet__btn.zan-btn{height:50px;line-height:50px;margin-bottom:0}.zan-actionsheet__btn.zan-btn::after{border-width:0;border-bottom-width:1px}.zan-actionsheet__btn.zan-btn:last-child::after{border-bottom-width:0}.zan-actionsheet__subname{margin-left:2px;font-size:12px;color:#666}.zan-actionsheet__footer{margin-top:10px}.zan-actionsheet__btn.zan-btn--loading .zan-actionsheet__subname{color:transparent}.zan-actionsheet--show .zan-actionsheet__container{opacity:1;transform:translate3d(0,0,0);visibility:visible}.zan-actionsheet--show .zan-actionsheet__mask{display:block} -------------------------------------------------------------------------------- /dist/badge/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-badge{position:relative}.zan-badge__count{position:absolute;top:-16px;right:0;height:1.6em;min-width:1.6em;line-height:1.6;padding:0 .4em;font-size:20px;border-radius:.8em;background:#f44;color:#fff;text-align:center;white-space:nowrap;transform:translateX(50%) scale(.5);transform-origin:center;z-index:10;box-shadow:0 0 0 2px #fff;box-sizing:border-box} -------------------------------------------------------------------------------- /dist/btn/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-btn{position:relative;color:#333;background-color:#fff;margin-bottom:10px;padding-left:15px;padding-right:15px;border-radius:2px;font-size:16px;line-height:45px;height:45px;box-sizing:border-box;text-decoration:none;text-align:center;vertical-align:middle}.zan-btn::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-btns{margin:15px}.zan-btn--primary{color:#fff;background-color:#4b0}.zan-btn--primary::after{border-color:#0a0}.zan-btn--warn{color:#fff;background-color:#f85}.zan-btn--warn::after{border-color:#f85}.zan-btn--danger{color:#fff;background-color:#f44}.zan-btn--danger::after{border-color:#e33}.zan-btn--small{display:inline-block;height:30px;line-height:30px;font-size:12px;margin-right:5px;margin-bottom:0}.zan-btn--mini{display:inline-block;line-height:21px;height:22px;font-size:10px;margin-right:5px;margin-bottom:0;padding-left:5px;padding-right:5px}.zan-btn--large{border-radius:0;margin-bottom:0;border:none;line-height:50px;height:50px}.zan-btn--plain.zan-btn{background-color:transparent}.zan-btn--plain.zan-btn--primary{color:#06bf04}.zan-btn--plain.zan-btn--warn{color:#f60}.zan-btn--plain.zan-btn--danger{color:#f44}.button-hover{opacity:.9}.zan-btn--loading{color:transparent;opacity:1}.zan-btn--loading::before{position:absolute;left:50%;top:50%;content:' ';width:16px;height:16px;margin-left:-8px;margin-top:-8px;border:3px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;border-radius:8px;box-sizing:border-box;animation:btn-spin .6s linear;animation-iteration-count:infinite}.zan-btn--danger.zan-btn--loading::before,.zan-btn--primary.zan-btn--loading::before,.zan-btn--warn.zan-btn--loading::before{border-color:#fff rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.1)}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.zan-btn.zan-btn--disabled{color:#999!important;background:#f8f8f8!important;border-color:#e5e5e5!important;cursor:not-allowed!important;opacity:1!important}.zan-btn.zan-btn--disabled::after{border-color:#e5e5e5!important}.zan-btn--last-child,.zan-btn:last-child{margin-bottom:0;margin-right:0} -------------------------------------------------------------------------------- /dist/capsule/index.wxml: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /dist/capsule/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-capsule{display:inline-block;font-size:12px;vertical-align:middle;line-height:19px;transform:scale(.83)}.zan-capsule__left,.zan-capsule__right{display:inline-block;line-height:17px;height:19px;vertical-align:middle;box-sizing:border-box}.zan-capsule__left{padding:0 2px;color:#fff;background:#999;border-radius:2px 0 0 2px;border:1rpx solid #999}.zan-capsule__right{padding:0 5px;color:#999;border-radius:0 2px 2px 0;border:1rpx solid #999}.zan-capsule--danger .zan-capsule__left{color:#fff;background:#f24544;border-color:#f24544}.zan-capsule--danger .zan-capsule__right{color:#f24544;border-color:#f24544} -------------------------------------------------------------------------------- /dist/card/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-card{margin-left:0;width:auto;padding:5px 15px;overflow:hidden;position:relative;font-size:14px}.zan-card__thumb{width:90px;height:90px;float:left;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover}.zan-card__img{position:absolute;top:0;left:0;right:0;bottom:0;width:auto;height:auto;max-width:100%;max-height:100%}.zan-card__detail{margin-left:100px;width:auto;position:relative}.zan-card__detail-row{overflow:hidden;line-height:20px;min-height:20px;margin-bottom:3px}.zan-card__right-col{float:right}.zan-card__left-col{margin-right:80px} -------------------------------------------------------------------------------- /dist/cell/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px} -------------------------------------------------------------------------------- /dist/col/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-col{float:left;box-sizing:border-box;width:0}.zan-col-1{width:4.16667%}.zan-col-offset-1{margin-left:4.16667%}.zan-col-2{width:8.33333%}.zan-col-offset-2{margin-left:8.33333%}.zan-col-3{width:12.5%}.zan-col-offset-3{margin-left:12.5%}.zan-col-4{width:16.66667%}.zan-col-offset-4{margin-left:16.66667%}.zan-col-5{width:20.83333%}.zan-col-offset-5{margin-left:20.83333%}.zan-col-6{width:25%}.zan-col-offset-6{margin-left:25%}.zan-col-7{width:29.16667%}.zan-col-offset-7{margin-left:29.16667%}.zan-col-8{width:33.33333%}.zan-col-offset-8{margin-left:33.33333%}.zan-col-9{width:37.5%}.zan-col-offset-9{margin-left:37.5%}.zan-col-10{width:41.66667%}.zan-col-offset-10{margin-left:41.66667%}.zan-col-11{width:45.83333%}.zan-col-offset-11{margin-left:45.83333%}.zan-col-12{width:50%}.zan-col-offset-12{margin-left:50%}.zan-col-13{width:54.16667%}.zan-col-offset-13{margin-left:54.16667%}.zan-col-14{width:58.33333%}.zan-col-offset-14{margin-left:58.33333%}.zan-col-15{width:62.5%}.zan-col-offset-15{margin-left:62.5%}.zan-col-16{width:66.66667%}.zan-col-offset-16{margin-left:66.66667%}.zan-col-17{width:70.83333%}.zan-col-offset-17{margin-left:70.83333%}.zan-col-18{width:75%}.zan-col-offset-18{margin-left:75%}.zan-col-19{width:79.16667%}.zan-col-offset-19{margin-left:79.16667%}.zan-col-20{width:83.33333%}.zan-col-offset-20{margin-left:83.33333%}.zan-col-21{width:87.5%}.zan-col-offset-21{margin-left:87.5%}.zan-col-22{width:91.66667%}.zan-col-offset-22{margin-left:91.66667%}.zan-col-23{width:95.83333%}.zan-col-offset-23{margin-left:95.83333%}.zan-col-24{width:100%}.zan-col-offset-24{margin-left:100%} -------------------------------------------------------------------------------- /dist/color/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-c-red{color:#f44!important}.zan-c-gray{color:#c9c9c9!important}.zan-c-gray-dark{color:#999!important}.zan-c-gray-darker{color:#666!important}.zan-c-black{color:#333!important}.zan-c-blue{color:#38f!important}.zan-c-green{color:#06bf04!important} -------------------------------------------------------------------------------- /dist/common/helper.js: -------------------------------------------------------------------------------- 1 | // 从事件对象中解析得到 componentId 2 | // 需要在元素上声明 data-component-id 3 | function extractComponentId(event = {}) { 4 | const { dataset: { componentId } } = event.currentTarget || {}; 5 | return componentId; 6 | } 7 | 8 | /* 9 | 注:默认合并所有生命周期函数 10 | 配置合并指定的生命周期 or 忽略指定字段 11 | const extend = extendCreator({ 12 | life: ['onLoad', 'onPullDownRefresh'], 13 | exclude: ['binder'] 14 | }); 15 | 16 | Page(extend({}, { 17 | onLoad() {}, 18 | ... 19 | })); 20 | */ 21 | 22 | const LIFE_CYCLE = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll']; 23 | 24 | const extendCreator = (config = {}) => { 25 | const { 26 | life = LIFE_CYCLE, 27 | exclude = [] 28 | } = config; 29 | 30 | const excludeList = exclude.concat(LIFE_CYCLE.map(getFuncArrayName)); 31 | 32 | if (!Array.isArray(life) || !Array.isArray(exclude)) throw new Error('Invalid Extend Config'); 33 | let lifeCycleList = life.filter(item => LIFE_CYCLE.indexOf(item) >= 0); 34 | return function extend(target, ...objList) { 35 | objList.forEach((source) => { 36 | if (source) { 37 | let keys = Object.keys(source); 38 | keys.forEach((key) => { 39 | let value = source[key]; 40 | if (excludeList.indexOf(key) >= 0) return; 41 | if (lifeCycleList.indexOf(key) >= 0 && typeof value === 'function') { 42 | let funcArrayName = getFuncArrayName(key); 43 | if (!target[funcArrayName]) { 44 | target[funcArrayName] = []; 45 | if (target[key]) { 46 | target[funcArrayName].push(target[key]); 47 | } 48 | target[key] = function (...rest) { 49 | target[funcArrayName].forEach(func => func.apply(this, rest)); 50 | }; 51 | } 52 | 53 | if (source[funcArrayName]) { 54 | // 经过生命周期合并的组件直接整合函数列表 55 | target[funcArrayName].push(...source[funcArrayName]); 56 | } else { 57 | // 添加生命周期函数进入函数列表 58 | target[funcArrayName].push(value); 59 | } 60 | } else { 61 | target[key] = value; 62 | } 63 | }); 64 | } 65 | }); 66 | return target; 67 | }; 68 | }; 69 | 70 | const getFuncArrayName = name => `__$${name}`; 71 | 72 | module.exports = { 73 | extractComponentId, 74 | extend: Object.assign, 75 | extendCreator 76 | }; 77 | -------------------------------------------------------------------------------- /dist/dialog/index.js: -------------------------------------------------------------------------------- 1 | const _f = function () {}; 2 | 3 | module.exports = { 4 | showZanDialog(options = {}) { 5 | const { 6 | // 自定义 btn 列表 7 | // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色 } 8 | buttons = [], 9 | // 标题 10 | title = '', 11 | // 内容 12 | content = ' ', 13 | // 按钮是否展示为纵向 14 | buttonsShowVertical = false, 15 | // 是否展示确定 16 | showConfirm = true, 17 | // 确认按钮文案 18 | confirmText = '确定', 19 | // 确认按钮颜色 20 | confirmColor = '#3CC51F', 21 | // 是否展示取消 22 | showCancel = false, 23 | // 取消按钮文案 24 | cancelText = '取消', 25 | // 取消按钮颜色 26 | cancelColor = '#333' 27 | } = options; 28 | 29 | // 处理默认按钮的展示 30 | // 纵向排布确认按钮在上方 31 | let showCustomBtns = false; 32 | if (buttons.length === 0) { 33 | if (showConfirm) { 34 | buttons.push({ 35 | type: 'confirm', 36 | text: confirmText, 37 | color: confirmColor 38 | }); 39 | } 40 | 41 | if (showCancel) { 42 | const cancelButton = { 43 | type: 'cancel', 44 | text: cancelText, 45 | color: cancelColor 46 | }; 47 | if (buttonsShowVertical) { 48 | buttons.push(cancelButton); 49 | } else { 50 | buttons.unshift(cancelButton); 51 | } 52 | } 53 | } else { 54 | showCustomBtns = true; 55 | } 56 | 57 | return new Promise((resolve, reject) => { 58 | this.setData({ 59 | zanDialog: { 60 | show: true, 61 | showCustomBtns, 62 | buttons, 63 | title, 64 | content, 65 | buttonsShowVertical, 66 | showConfirm, 67 | confirmText, 68 | confirmColor, 69 | showCancel, 70 | cancelText, 71 | cancelColor, 72 | // 回调钩子 73 | resolve, 74 | reject 75 | } 76 | }); 77 | }); 78 | }, 79 | 80 | _handleZanDialogButtonClick(e) { 81 | const { currentTarget = {} } = e; 82 | const { dataset = {} } = currentTarget; 83 | 84 | // 获取当次弹出框的信息 85 | const zanDialogData = this.data.zanDialog || {}; 86 | const { resolve = _f, reject = _f } = zanDialogData; 87 | 88 | // 重置 zanDialog 里的内容 89 | this.setData({ 90 | zanDialog: { show: false } 91 | }); 92 | 93 | // 自定义按钮,全部 resolve 形式返回,根据 type 区分点击按钮 94 | if (zanDialogData.showCustomBtns) { 95 | resolve({ 96 | type: dataset.type 97 | }); 98 | return; 99 | } 100 | 101 | // 默认按钮,确认为 resolve,取消为 reject 102 | if (dataset.type === 'confirm') { 103 | resolve({ 104 | type: 'confirm' 105 | }); 106 | } else { 107 | reject({ 108 | type: 'cancel' 109 | }); 110 | } 111 | } 112 | }; 113 | -------------------------------------------------------------------------------- /dist/dialog/index.wxml: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /dist/dialog/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-dialog--container{position:fixed;top:45%;left:50%;width:80%;height:0;font-size:16px;overflow:hidden;transition:all .2s linear;border-radius:4px;background-color:#fff;transform:translate3d(-50%,-50%,0);color:#333;opacity:0}.zan-dialog--mask{position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.6);transition:.3s;display:none}.zan-dialog__header{padding:15px 0 0;text-align:center}.zan-dialog__content{position:relative;padding:15px 20px;line-height:1.5;min-height:40px}.zan-dialog__content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px}.zan-dialog__content--title{color:#999;font-size:14px}.zan-dialog__footer{overflow:hidden}.zan-dialog__button{line-height:50px;height:50px;padding:0 5px;border-radius:0;margin-bottom:0}.zan-dialog__button::after{border-width:0;border-radius:0}.zan-dialog--show .zan-dialog--container{opacity:1;height:auto}.zan-dialog--show .zan-dialog--mask{display:block}.zan-dialog__footer--horizon{display:flex}.zan-dialog__footer--horizon .zan-dialog__button{flex:1}.zan-dialog__footer--horizon .zan-dialog__button::after{border-right-width:1px}.zan-dialog__footer--horizon .zan-dialog__button:last-child::after{border-right-width:0}.zan-dialog__footer--vertical .zan-dialog__button{flex:1}.zan-dialog__footer--vertical .zan-dialog__button::after{border-bottom-width:1px}.zan-dialog__footer--vertical .zan-dialog__button:last-child::after{border-bottom-width:0} -------------------------------------------------------------------------------- /dist/field/index.js: -------------------------------------------------------------------------------- 1 | const { extractComponentId } = require('../common/helper'); 2 | 3 | module.exports = { 4 | _handleZanFieldChange(event) { 5 | const componentId = extractComponentId(event); 6 | event.componentId = componentId; 7 | 8 | console.info('[zan:field:change]', event); 9 | 10 | if (this.handleZanFieldChange) { 11 | return this.handleZanFieldChange(event); 12 | } 13 | 14 | console.warn('页面缺少 handleZanFieldChange 回调函数'); 15 | }, 16 | 17 | _handleZanFieldFocus(event) { 18 | const componentId = extractComponentId(event); 19 | event.componentId = componentId; 20 | 21 | console.info('[zan:field:focus]', event); 22 | 23 | if (this.handleZanFieldFocus) { 24 | return this.handleZanFieldFocus(event); 25 | } 26 | 27 | console.warn('页面缺少 handleZanFieldFocus 回调函数'); 28 | }, 29 | 30 | _handleZanFieldBlur(event) { 31 | const componentId = extractComponentId(event); 32 | event.componentId = componentId; 33 | 34 | console.info('[zan:field:blur]', event); 35 | 36 | if (this.handleZanFieldBlur) { 37 | return this.handleZanFieldBlur(event); 38 | } 39 | 40 | console.warn('页面缺少 handleZanFieldBlur 回调函数'); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /dist/field/index.wxml: -------------------------------------------------------------------------------- 1 | 32 | -------------------------------------------------------------------------------- /dist/field/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}.zan-field{padding:7px 15px;color:#333}.zan-field--wrapped{margin:0 15px;background-color:#fff}.zan-field--wrapped::after{left:0;border-width:1px;border-radius:4px}.zan-field--wrapped+.zan-field--wrapped{margin-top:10px}.zan-field--error{color:#f40}.zan-field--wrapped.zan-field--error::after{border-color:#f40}.zan-field__title{color:#333;min-width:65px;padding-right:10px}.zan-field__input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.zan-field__placeholder{font-size:14px}.zan-field__input--right{text-align:right} -------------------------------------------------------------------------------- /dist/helper/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-pull-left{float:left}.zan-pull-right{float:right}.zan-center{text-align:center}.zan-right{text-align:right}.zan-text-deleted{text-decoration:line-through}.zan-font-8{font-size:8px}.zan-font-10{font-size:10px}.zan-font-12{font-size:12px}.zan-font-14{font-size:14px}.zan-font-16{font-size:16px}.zan-font-18{font-size:18px}.zan-font-20{font-size:20px}.zan-font-22{font-size:22px}.zan-font-24{font-size:22px}.zan-font-30{font-size:30px}.zan-font-bold{font-weight:700}.zan-arrow{position:absolute;right:15px;top:50%;display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.zan-ellipsis--l2{max-height:40px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.zan-ellipsis--l3{max-height:60px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.zan-clearfix{zoom:1}.zan-clearfix::after{content:'';display:table;clear:both}.zan-hairline,.zan-hairline--bottom,.zan-hairline--left,.zan-hairline--right,.zan-hairline--surround,.zan-hairline--top,.zan-hairline--top-bottom{position:relative}.zan-hairline--bottom::after,.zan-hairline--left::after,.zan-hairline--right::after,.zan-hairline--surround::after,.zan-hairline--top-bottom::after,.zan-hairline--top::after,.zan-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.zan-hairline--top::after{border-top-width:1px}.zan-hairline--left::after{border-left-width:1px}.zan-hairline--right::after{border-right-width:1px}.zan-hairline--bottom::after{border-bottom-width:1px}.zan-hairline--top-bottom::after{border-width:1px 0}.zan-hairline--surround::after{border-width:1px} -------------------------------------------------------------------------------- /dist/icon/index.wxss: -------------------------------------------------------------------------------- 1 | @font-face{font-family:zanui-weapp-icon;src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot);src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot?#iefix) format('embedded-opentype'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff2) format('woff2'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff) format('woff'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.ttf) format('truetype')}.zan-icon{display:inline-block}.zan-icon::before{font-family:zanui-weapp-icon!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased}.zan-icon-qr-invalid:before{content:'\e800'}.zan-icon-qr:before{content:'\e801'}.zan-icon-exchange:before{content:'\e802'}.zan-icon-close:before{content:'\e803'}.zan-icon-location:before{content:'\e804'}.zan-icon-upgrade:before{content:'\e805'}.zan-icon-check:before{content:'\e806'}.zan-icon-checked:before{content:'\e807'}.zan-icon-like-o:before{content:'\e808'}.zan-icon-like:before{content:'\e809'}.zan-icon-chat:before{content:'\e80a'}.zan-icon-shop:before{content:'\e80b'}.zan-icon-photograph:before{content:'\e80c'}.zan-icon-add:before{content:'\e80d'}.zan-icon-add2:before{content:'\e80e'}.zan-icon-photo:before{content:'\e80f'}.zan-icon-logistics:before{content:'\e810'}.zan-icon-edit:before{content:'\e811'}.zan-icon-passed:before{content:'\e812'}.zan-icon-cart:before{content:'\e813'}.zan-icon-shopping-cart:before{content:'\e814'}.zan-icon-arrow:before{content:'\e815'}.zan-icon-gift:before{content:'\e816'}.zan-icon-search:before{content:'\e817'}.zan-icon-clear:before{content:'\e818'}.zan-icon-success:before{content:'\e819'}.zan-icon-fail:before{content:'\e81a'}.zan-icon-contact:before{content:'\e81b'}.zan-icon-wechat:before{content:'\e81c'}.zan-icon-alipay:before{content:'\e81d'}.zan-icon-password-view:before{content:'\e81e'}.zan-icon-password-not-view:before{content:'\e81f'}.zan-icon-wap-nav:before{content:'\e820'}.zan-icon-wap-home:before{content:'\e821'}.zan-icon-ecard-pay:before{content:'\e822'}.zan-icon-balance-pay:before{content:'\e823'}.zan-icon-peer-pay:before{content:'\e824'}.zan-icon-credit-pay:before{content:'\e825'}.zan-icon-debit-pay:before{content:'\e826'}.zan-icon-other-pay:before{content:'\e827'}.zan-icon-browsing-history:before{content:'\e828'}.zan-icon-goods-collect:before{content:'\e829'}.zan-icon-shop-collect:before{content:'\e82a'}.zan-icon-receive-gift:before{content:'\e82b'}.zan-icon-send-gift:before{content:'\e82c'}.zan-icon-setting:before{content:'\e82d'}.zan-icon-points:before{content:'\e82e'}.zan-icon-coupon:before{content:'\e82f'}.zan-icon-free-postage:before{content:'\e830'}.zan-icon-discount:before{content:'\e831'}.zan-icon-birthday-privilege:before{content:'\e832'}.zan-icon-member-day-privilege:before{content:'\e833'}.zan-icon-balance-details:before{content:'\e834'}.zan-icon-cash-back-record:before{content:'\e835'}.zan-icon-points-mall:before{content:'\e836'}.zan-icon-exchange-record:before{content:'\e837'}.zan-icon-pending-payment:before{content:'\e838'}.zan-icon-pending-orders:before{content:'\e839'}.zan-icon-pending-deliver:before{content:'\e83a'}.zan-icon-pending-evaluate:before{content:'\e83b'}.zan-icon-gift-card-pay:before{content:'\e83c'}.zan-icon-cash-on-deliver:before{content:'\e83d'}.zan-icon-underway:before{content:'\e83e'}.zan-icon-point-gift:before{content:'\e83f'}.zan-icon-after-sale:before{content:'\e840'}.zan-icon-edit-data:before{content:'\e841'}.zan-icon-question:before{content:'\e842'}.zan-icon-delete:before{content:'\e843'}.zan-icon-records:before{content:'\e844'}.zan-icon-description:before{content:'\e845'}.zan-icon-card:before{content:'\e846'}.zan-icon-gift-card:before{content:'\e847'}.zan-icon-clock:before{content:'\e848'}.zan-icon-gold-coin:before{content:'\e849'}.zan-icon-completed:before{content:'\e84a'}.zan-icon-value-card:before{content:'\e84b'}.zan-icon-certificate:before{content:'\e84c'}.zan-icon-tosend:before{content:'\e84d'}.zan-icon-sign:before{content:'\e84e'}.zan-icon-home:before{content:'\e84f'}.zan-icon-phone:before{content:'\e850'}.zan-icon-add-o:before{content:'\e851'}.zan-icon-play:before{content:'\e852'}.zan-icon-pause:before{content:'\e853'}.zan-icon-stop:before{content:'\e854'}.zan-icon-hot:before{content:'\e855'}.zan-icon-new:before{content:'\e856'}.zan-icon-new-arrival:before{content:'\e857'}.zan-icon-hot-sale:before{content:'\e858'} -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | exports.Actionsheet = require('./actionsheet/index'); 2 | exports.Dialog = require('./dialog/index'); 3 | exports.Field = require('./field/index'); 4 | exports.NoticeBar = require('./noticebar/index'); 5 | exports.Select = require('./select/index'); 6 | exports.Stepper = require('./stepper/index'); 7 | exports.Switch = require('./switch/index'); 8 | exports.Tab = require('./tab/index'); 9 | exports.Toast = require('./toast/index'); 10 | exports.TopTips = require('./toptips/index'); 11 | 12 | // 兼容老版本,在下次大版本发布时会被移除 13 | exports.CheckLabel = require('./select/index'); 14 | 15 | const { extend } = require('./common/helper'); 16 | exports.extend = extend; 17 | -------------------------------------------------------------------------------- /dist/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-actionsheet{background-color:#f8f8f8}.zan-actionsheet__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-actionsheet__container{position:fixed;left:0;right:0;bottom:0;background:#f8f8f8;transform:translate3d(0,50%,0);transform-origin:center;transition:all .2s ease;z-index:11;opacity:0;visibility:hidden}.zan-actionsheet__btn.zan-btn{height:50px;line-height:50px;margin-bottom:0}.zan-actionsheet__btn.zan-btn::after{border-width:0;border-bottom-width:1px}.zan-actionsheet__btn.zan-btn:last-child::after{border-bottom-width:0}.zan-actionsheet__subname{margin-left:2px;font-size:12px;color:#666}.zan-actionsheet__footer{margin-top:10px}.zan-actionsheet__btn.zan-btn--loading .zan-actionsheet__subname{color:transparent}.zan-actionsheet--show .zan-actionsheet__container{opacity:1;transform:translate3d(0,0,0);visibility:visible}.zan-actionsheet--show .zan-actionsheet__mask{display:block}.zan-badge{position:relative}.zan-badge__count{position:absolute;top:-16px;right:0;height:1.6em;min-width:1.6em;line-height:1.6;padding:0 .4em;font-size:20px;border-radius:.8em;background:#f44;color:#fff;text-align:center;white-space:nowrap;transform:translateX(50%) scale(.5);transform-origin:center;z-index:10;box-shadow:0 0 0 2px #fff;box-sizing:border-box}.zan-btn{position:relative;color:#333;background-color:#fff;margin-bottom:10px;padding-left:15px;padding-right:15px;border-radius:2px;font-size:16px;line-height:45px;height:45px;box-sizing:border-box;text-decoration:none;text-align:center;vertical-align:middle}.zan-btn::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-btns{margin:15px}.zan-btn--primary{color:#fff;background-color:#4b0}.zan-btn--primary::after{border-color:#0a0}.zan-btn--warn{color:#fff;background-color:#f85}.zan-btn--warn::after{border-color:#f85}.zan-btn--danger{color:#fff;background-color:#f44}.zan-btn--danger::after{border-color:#e33}.zan-btn--small{display:inline-block;height:30px;line-height:30px;font-size:12px;margin-right:5px;margin-bottom:0}.zan-btn--mini{display:inline-block;line-height:21px;height:22px;font-size:10px;margin-right:5px;margin-bottom:0;padding-left:5px;padding-right:5px}.zan-btn--large{border-radius:0;margin-bottom:0;border:none;line-height:50px;height:50px}.zan-btn--plain.zan-btn{background-color:transparent}.zan-btn--plain.zan-btn--primary{color:#06bf04}.zan-btn--plain.zan-btn--warn{color:#f60}.zan-btn--plain.zan-btn--danger{color:#f44}.button-hover{opacity:.9}.zan-btn--loading{color:transparent;opacity:1}.zan-btn--loading::before{position:absolute;left:50%;top:50%;content:' ';width:16px;height:16px;margin-left:-8px;margin-top:-8px;border:3px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;border-radius:8px;box-sizing:border-box;animation:btn-spin .6s linear;animation-iteration-count:infinite}.zan-btn--danger.zan-btn--loading::before,.zan-btn--primary.zan-btn--loading::before,.zan-btn--warn.zan-btn--loading::before{border-color:#fff rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.1)}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.zan-btn.zan-btn--disabled{color:#999!important;background:#f8f8f8!important;border-color:#e5e5e5!important;cursor:not-allowed!important;opacity:1!important}.zan-btn.zan-btn--disabled::after{border-color:#e5e5e5!important}.zan-btn--last-child,.zan-btn:last-child{margin-bottom:0;margin-right:0}.zan-capsule{display:inline-block;font-size:12px;vertical-align:middle;line-height:19px;transform:scale(.83)}.zan-capsule__left,.zan-capsule__right{display:inline-block;line-height:17px;height:19px;vertical-align:middle;box-sizing:border-box}.zan-capsule__left{padding:0 2px;color:#fff;background:#999;border-radius:2px 0 0 2px;border:1rpx solid #999}.zan-capsule__right{padding:0 5px;color:#999;border-radius:0 2px 2px 0;border:1rpx solid #999}.zan-capsule--danger .zan-capsule__left{color:#fff;background:#f24544;border-color:#f24544}.zan-capsule--danger .zan-capsule__right{color:#f24544;border-color:#f24544}.zan-card{margin-left:0;width:auto;padding:5px 15px;overflow:hidden;position:relative;font-size:14px}.zan-card__thumb{width:90px;height:90px;float:left;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover}.zan-card__img{position:absolute;top:0;left:0;right:0;bottom:0;width:auto;height:auto;max-width:100%;max-height:100%}.zan-card__detail{margin-left:100px;width:auto;position:relative}.zan-card__detail-row{overflow:hidden;line-height:20px;min-height:20px;margin-bottom:3px}.zan-card__right-col{float:right}.zan-card__left-col{margin-right:80px}.zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}.zan-col{float:left;box-sizing:border-box;width:0}.zan-col-1{width:4.16667%}.zan-col-offset-1{margin-left:4.16667%}.zan-col-2{width:8.33333%}.zan-col-offset-2{margin-left:8.33333%}.zan-col-3{width:12.5%}.zan-col-offset-3{margin-left:12.5%}.zan-col-4{width:16.66667%}.zan-col-offset-4{margin-left:16.66667%}.zan-col-5{width:20.83333%}.zan-col-offset-5{margin-left:20.83333%}.zan-col-6{width:25%}.zan-col-offset-6{margin-left:25%}.zan-col-7{width:29.16667%}.zan-col-offset-7{margin-left:29.16667%}.zan-col-8{width:33.33333%}.zan-col-offset-8{margin-left:33.33333%}.zan-col-9{width:37.5%}.zan-col-offset-9{margin-left:37.5%}.zan-col-10{width:41.66667%}.zan-col-offset-10{margin-left:41.66667%}.zan-col-11{width:45.83333%}.zan-col-offset-11{margin-left:45.83333%}.zan-col-12{width:50%}.zan-col-offset-12{margin-left:50%}.zan-col-13{width:54.16667%}.zan-col-offset-13{margin-left:54.16667%}.zan-col-14{width:58.33333%}.zan-col-offset-14{margin-left:58.33333%}.zan-col-15{width:62.5%}.zan-col-offset-15{margin-left:62.5%}.zan-col-16{width:66.66667%}.zan-col-offset-16{margin-left:66.66667%}.zan-col-17{width:70.83333%}.zan-col-offset-17{margin-left:70.83333%}.zan-col-18{width:75%}.zan-col-offset-18{margin-left:75%}.zan-col-19{width:79.16667%}.zan-col-offset-19{margin-left:79.16667%}.zan-col-20{width:83.33333%}.zan-col-offset-20{margin-left:83.33333%}.zan-col-21{width:87.5%}.zan-col-offset-21{margin-left:87.5%}.zan-col-22{width:91.66667%}.zan-col-offset-22{margin-left:91.66667%}.zan-col-23{width:95.83333%}.zan-col-offset-23{margin-left:95.83333%}.zan-col-24{width:100%}.zan-col-offset-24{margin-left:100%}.zan-c-red{color:#f44!important}.zan-c-gray{color:#c9c9c9!important}.zan-c-gray-dark{color:#999!important}.zan-c-gray-darker{color:#666!important}.zan-c-black{color:#333!important}.zan-c-blue{color:#38f!important}.zan-c-green{color:#06bf04!important}.zan-dialog--container{position:fixed;top:45%;left:50%;width:80%;height:0;font-size:16px;overflow:hidden;transition:all .2s linear;border-radius:4px;background-color:#fff;transform:translate3d(-50%,-50%,0);color:#333;opacity:0}.zan-dialog--mask{position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.6);transition:.3s;display:none}.zan-dialog__header{padding:15px 0 0;text-align:center}.zan-dialog__content{position:relative;padding:15px 20px;line-height:1.5;min-height:40px}.zan-dialog__content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px}.zan-dialog__content--title{color:#999;font-size:14px}.zan-dialog__footer{overflow:hidden}.zan-dialog__button{line-height:50px;height:50px;padding:0 5px;border-radius:0;margin-bottom:0}.zan-dialog__button::after{border-width:0;border-radius:0}.zan-dialog--show .zan-dialog--container{opacity:1;height:auto}.zan-dialog--show .zan-dialog--mask{display:block}.zan-dialog__footer--horizon{display:flex}.zan-dialog__footer--horizon .zan-dialog__button{flex:1}.zan-dialog__footer--horizon .zan-dialog__button::after{border-right-width:1px}.zan-dialog__footer--horizon .zan-dialog__button:last-child::after{border-right-width:0}.zan-dialog__footer--vertical .zan-dialog__button{flex:1}.zan-dialog__footer--vertical .zan-dialog__button::after{border-bottom-width:1px}.zan-dialog__footer--vertical .zan-dialog__button:last-child::after{border-bottom-width:0}.zan-field{padding:7px 15px;color:#333}.zan-field--wrapped{margin:0 15px;background-color:#fff}.zan-field--wrapped::after{left:0;border-width:1px;border-radius:4px}.zan-field--wrapped+.zan-field--wrapped{margin-top:10px}.zan-field--error{color:#f40}.zan-field--wrapped.zan-field--error::after{border-color:#f40}.zan-field__title{color:#333;min-width:65px;padding-right:10px}.zan-field__input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.zan-field__placeholder{font-size:14px}.zan-field__input--right{text-align:right}.zan-pull-left{float:left}.zan-pull-right{float:right}.zan-center{text-align:center}.zan-right{text-align:right}.zan-text-deleted{text-decoration:line-through}.zan-font-8{font-size:8px}.zan-font-10{font-size:10px}.zan-font-12{font-size:12px}.zan-font-14{font-size:14px}.zan-font-16{font-size:16px}.zan-font-18{font-size:18px}.zan-font-20{font-size:20px}.zan-font-22{font-size:22px}.zan-font-24{font-size:22px}.zan-font-30{font-size:30px}.zan-font-bold{font-weight:700}.zan-arrow{position:absolute;right:15px;top:50%;display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.zan-ellipsis--l2{max-height:40px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.zan-ellipsis--l3{max-height:60px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.zan-clearfix{zoom:1}.zan-clearfix::after{content:'';display:table;clear:both}.zan-hairline,.zan-hairline--bottom,.zan-hairline--left,.zan-hairline--right,.zan-hairline--surround,.zan-hairline--top,.zan-hairline--top-bottom{position:relative}.zan-hairline--bottom::after,.zan-hairline--left::after,.zan-hairline--right::after,.zan-hairline--surround::after,.zan-hairline--top-bottom::after,.zan-hairline--top::after,.zan-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.zan-hairline--top::after{border-top-width:1px}.zan-hairline--left::after{border-left-width:1px}.zan-hairline--right::after{border-right-width:1px}.zan-hairline--bottom::after{border-bottom-width:1px}.zan-hairline--top-bottom::after{border-width:1px 0}.zan-hairline--surround::after{border-width:1px}@font-face{font-family:zanui-weapp-icon;src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot);src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot?#iefix) format('embedded-opentype'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff2) format('woff2'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff) format('woff'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.ttf) format('truetype')}.zan-icon{display:inline-block}.zan-icon::before{font-family:zanui-weapp-icon!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased}.zan-icon-qr-invalid:before{content:'\e800'}.zan-icon-qr:before{content:'\e801'}.zan-icon-exchange:before{content:'\e802'}.zan-icon-close:before{content:'\e803'}.zan-icon-location:before{content:'\e804'}.zan-icon-upgrade:before{content:'\e805'}.zan-icon-check:before{content:'\e806'}.zan-icon-checked:before{content:'\e807'}.zan-icon-like-o:before{content:'\e808'}.zan-icon-like:before{content:'\e809'}.zan-icon-chat:before{content:'\e80a'}.zan-icon-shop:before{content:'\e80b'}.zan-icon-photograph:before{content:'\e80c'}.zan-icon-add:before{content:'\e80d'}.zan-icon-add2:before{content:'\e80e'}.zan-icon-photo:before{content:'\e80f'}.zan-icon-logistics:before{content:'\e810'}.zan-icon-edit:before{content:'\e811'}.zan-icon-passed:before{content:'\e812'}.zan-icon-cart:before{content:'\e813'}.zan-icon-shopping-cart:before{content:'\e814'}.zan-icon-arrow:before{content:'\e815'}.zan-icon-gift:before{content:'\e816'}.zan-icon-search:before{content:'\e817'}.zan-icon-clear:before{content:'\e818'}.zan-icon-success:before{content:'\e819'}.zan-icon-fail:before{content:'\e81a'}.zan-icon-contact:before{content:'\e81b'}.zan-icon-wechat:before{content:'\e81c'}.zan-icon-alipay:before{content:'\e81d'}.zan-icon-password-view:before{content:'\e81e'}.zan-icon-password-not-view:before{content:'\e81f'}.zan-icon-wap-nav:before{content:'\e820'}.zan-icon-wap-home:before{content:'\e821'}.zan-icon-ecard-pay:before{content:'\e822'}.zan-icon-balance-pay:before{content:'\e823'}.zan-icon-peer-pay:before{content:'\e824'}.zan-icon-credit-pay:before{content:'\e825'}.zan-icon-debit-pay:before{content:'\e826'}.zan-icon-other-pay:before{content:'\e827'}.zan-icon-browsing-history:before{content:'\e828'}.zan-icon-goods-collect:before{content:'\e829'}.zan-icon-shop-collect:before{content:'\e82a'}.zan-icon-receive-gift:before{content:'\e82b'}.zan-icon-send-gift:before{content:'\e82c'}.zan-icon-setting:before{content:'\e82d'}.zan-icon-points:before{content:'\e82e'}.zan-icon-coupon:before{content:'\e82f'}.zan-icon-free-postage:before{content:'\e830'}.zan-icon-discount:before{content:'\e831'}.zan-icon-birthday-privilege:before{content:'\e832'}.zan-icon-member-day-privilege:before{content:'\e833'}.zan-icon-balance-details:before{content:'\e834'}.zan-icon-cash-back-record:before{content:'\e835'}.zan-icon-points-mall:before{content:'\e836'}.zan-icon-exchange-record:before{content:'\e837'}.zan-icon-pending-payment:before{content:'\e838'}.zan-icon-pending-orders:before{content:'\e839'}.zan-icon-pending-deliver:before{content:'\e83a'}.zan-icon-pending-evaluate:before{content:'\e83b'}.zan-icon-gift-card-pay:before{content:'\e83c'}.zan-icon-cash-on-deliver:before{content:'\e83d'}.zan-icon-underway:before{content:'\e83e'}.zan-icon-point-gift:before{content:'\e83f'}.zan-icon-after-sale:before{content:'\e840'}.zan-icon-edit-data:before{content:'\e841'}.zan-icon-question:before{content:'\e842'}.zan-icon-delete:before{content:'\e843'}.zan-icon-records:before{content:'\e844'}.zan-icon-description:before{content:'\e845'}.zan-icon-card:before{content:'\e846'}.zan-icon-gift-card:before{content:'\e847'}.zan-icon-clock:before{content:'\e848'}.zan-icon-gold-coin:before{content:'\e849'}.zan-icon-completed:before{content:'\e84a'}.zan-icon-value-card:before{content:'\e84b'}.zan-icon-certificate:before{content:'\e84c'}.zan-icon-tosend:before{content:'\e84d'}.zan-icon-sign:before{content:'\e84e'}.zan-icon-home:before{content:'\e84f'}.zan-icon-phone:before{content:'\e850'}.zan-icon-add-o:before{content:'\e851'}.zan-icon-play:before{content:'\e852'}.zan-icon-pause:before{content:'\e853'}.zan-icon-stop:before{content:'\e854'}.zan-icon-hot:before{content:'\e855'}.zan-icon-new:before{content:'\e856'}.zan-icon-new-arrival:before{content:'\e857'}.zan-icon-hot-sale:before{content:'\e858'}.zan-loadmore{position:relative;width:65%;margin:21px auto;line-height:20px;font-size:14px;text-align:center;vertical-align:middle}.zan-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12,end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iciIgd2lkdGg9JzEyMHB4JyBoZWlnaHQ9JzEyMHB4JyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJub25lIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjRTlFOUU5JwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoMCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICA8L3JlY3Q+CiAgICA8cmVjdCB4PSc0Ni41JyB5PSc0MCcgd2lkdGg9JzcnIGhlaWdodD0nMjAnIHJ4PSc1JyByeT0nNScgZmlsbD0nIzk4OTY5NycKICAgICAgICAgIHRyYW5zZm9ybT0ncm90YXRlKDMwIDUwIDUwKSB0cmFuc2xhdGUoMCAtMzApJz4KICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0naW5kZWZpbml0ZScvPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyM5Qjk5OUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSg2MCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9J2luZGVmaW5pdGUnLz4KICAgIDwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjQTNBMUEyJwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoOTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNBQkE5QUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxMjAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCMkIyQjInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxNTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCQUI4QjknCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxODAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDMkMwQzEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyMTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDQkNCQ0InCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEMkQyRDInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEQURBREEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNFMkUyRTInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0Pgo8L3N2Zz4=) no-repeat;-webkit-background-size:100%;background-size:100%}.zan-loadmore .zan-loading{margin-right:4px}.zan-loadmore__tips{display:inline-block;vertical-align:middle;height:20px;line-height:20px}.zan-loadmore--nodata,.zan-loadmore--nomore{color:#999}.zan-loadmore--nodata::after,.zan-loadmore--nomore::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px}.zan-loadmore--nodata{margin-top:120px}.zan-loadmore--nodata .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore--nomore .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore__dot{position:absolute;left:50%;top:10px;margin-left:-2px;margin-top:-2px;content:" ";width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;vertical-align:middle}.zan-noticebar{color:#f60;padding:9px 10px;font-size:12px;line-height:1.5;background-color:#fff7cc}.zan-panel{position:relative;background:#fff;margin-top:10px;overflow:hidden}.zan-panel::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px;border-bottom-width:1px}.zan-panel-title{font-size:14px;line-height:1;color:#999;padding:20px 15px 0 15px}.zan-panel--without-margin-top{margin-top:0}.zan-panel--without-border::after{border:0 none}.zan-popup{visibility:hidden}.zan-popup--show{visibility:visible}.zan-popup__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-popup__container{position:fixed;left:50%;top:50%;background:#fff;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .4s ease;z-index:11;opacity:0}.zan-popup--show .zan-popup__container{opacity:1}.zan-popup--show .zan-popup__mask{display:block}.zan-popup--left .zan-popup__container{left:0;top:auto;transform:translate3d(-100%,0,0)}.zan-popup--show.zan-popup--left .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--right .zan-popup__container{right:0;top:auto;left:auto;transform:translate3d(100%,0,0)}.zan-popup--show.zan-popup--right .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--bottom .zan-popup__container{top:auto;left:auto;bottom:0;transform:translate3d(0,100%,0)}.zan-popup--show.zan-popup--bottom .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--top .zan-popup__container{top:0;left:auto;transform:translate3d(0,-100%,0)}.zan-popup--show.zan-popup--top .zan-popup__container{transform:translate3d(0,0,0)}.zan-row:after{content:"";display:table;clear:both}.zan-select__list .zan-select__radio{display:none}.zan-stepper{color:#666}.zan-stepper view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #999}.zan-stepper .zan-stepper__minus{border-right:none;border-radius:2px 0 0 2px}.zan-stepper .zan-stepper__text{border:1rpx solid #999;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.zan-stepper .zan-stepper__plus{border-left:none;border-radius:0 2px 2px 0}.zan-stepper .zan-stepper--disabled{background:#f8f8f8;color:#bbb;border-color:#e8e8e8}.zan-stepper--small view{min-width:36px;line-height:18px}.zan-stepper--small .zan-stepper__text{width:36px;line-height:28px;height:28px}.zan-steps--steps.zan-steps--5 .zan-steps__step{width:25%}.zan-steps--steps.zan-steps--4 .zan-steps__step{width:33%}.zan-steps--steps.zan-steps--3 .zan-steps__step{width:50%}.zan-steps--steps .zan-steps__step{position:relative;float:left;padding-bottom:25px;color:#b1b1b1}.zan-steps--steps .zan-steps__title{transform:translateX(-50%);font-size:10px;text-align:center}.zan-steps--steps .zan-steps__icons{position:absolute;top:30px;left:-10px;padding:0 8px;background-color:#fff;z-index:10}.zan-steps--steps .zan-steps__circle{display:block;position:relative;width:5px;height:5px;background-color:#e5e5e5;border-radius:50%}.zan-steps--steps .zan-steps__line{position:absolute;left:0;top:32px;width:100%;height:1px;background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--done{color:#333}.zan-steps--steps .zan-steps__step--done .zan-steps__line{background-color:#06bf04}.zan-steps--steps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--steps .zan-steps__step--cur .zan-steps__icons{top:25px;left:-14px}.zan-steps--steps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background-image:url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px}.zan-steps--steps .zan-steps__step--cur .zan-steps__line{background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--first-child .zan-steps__title{margin-left:0;transform:none;text-align:left}.zan-steps--steps .zan-steps__step--first-child .zan-steps__icons{left:-7px}.zan-steps--steps .zan-steps__step--last-child{position:absolute;right:0;top:0;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__title{transform:none;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__icons{left:auto;right:-6px}.zan-steps--steps .zan-steps__step--last-child .zan-steps__line{display:none}.zan-steps--steps .zan-steps__step--db-title{min-height:29px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__line{top:45px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__icons{top:43px}.zan-steps--steps .zan-steps__step--db-title.zan-steps__step--cur .zan-steps__icons{top:39px}.zan-steps--vsteps{color:#999;font-size:14px}.zan-steps--vsteps .zan-steps__step{position:relative;padding:15px 0}.zan-steps--vsteps .zan-steps__step--done{color:#4b0}.zan-steps--vsteps .zan-steps__line{position:absolute;top:0;bottom:0;left:7px;width:1px;background-color:#e5e5e5}.zan-steps--vsteps .zan-steps__title{display:inline-block;line-height:20px;padding-left:27px}.zan-steps--vsteps .zan-steps__title--desc{padding-left:3px}.zan-steps--vsteps .zan-steps__icons{position:absolute;left:7px;top:50%;transform:translate(-50%,-50%);z-index:2;padding:3px 0;background-color:#fff}.zan-steps--vsteps .zan-steps__circle{width:5px;height:5px;background-color:#cacaca;border-radius:10px}.zan-steps--vsteps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--vsteps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background:transparent url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px;border-radius:0}.zan-steps--vsteps .zan-steps__icon--active{width:13px;height:13px}.zan-steps--vsteps .zan-steps__step--first-child .zan-steps__title::before{content:'';position:absolute;top:0;bottom:50%;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps--vsteps .zan-steps__step--last-child .zan-steps__title::after{content:'';position:absolute;top:50%;bottom:0;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps{position:relative}.zan-switch{position:relative;display:inline-block;width:52px;height:32px;vertical-align:middle;box-sizing:border-box;border-radius:16px;background:#44db5e;border:1px solid #44db5e}.zan-switch__circle{position:absolute;top:0;left:0;width:30px;height:30px;display:inline-block;background:#fff;border-radius:15px;box-sizing:border-box;box-shadow:0 0 0 1px rgba(0,0,0,.1),0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:transform .35s cubic-bezier(.45,1,.4,1);z-index:2}.zan-switch__bg{position:absolute;top:-1px;left:-1px;width:52px;height:32px;background:#fff;border-radius:26px;display:inline-block;border:1px solid #e5e5e5;box-sizing:border-box;transition:transform .35s cubic-bezier(.45,1,.4,1);transform:scale(0);transform-origin:36px 16px}.zan-switch--on .zan-switch__circle{transform:translateX(20px)}.zan-switch--off .zan-switch__bg{transform:scale(1)}.zan-swtich--disabled{opacity:.4}.zan-switch__loading{position:absolute;left:7px;top:7px;width:16px;height:16px;background:url(https://img.yzcdn.cn/public_files/2017/02/24/9acec77d91106cd15b8107c4633d9155.png) no-repeat;background-size:16px 16px;animation:zan-switch-loading .8s infinite linear}@keyframes zan-switch-loading{from{transform:rotate(0)}to{transform:rotate(360deg)}}.zan-tab{height:45px}.zan-tab__bd{width:750rpx;display:flex;flex-direction:row;border-bottom:1rpx solid #e5e5e5;background:#fff}.zan-tab__bd--fixed{position:fixed;top:0;z-index:2}.zan-tab__item{flex:1;display:inline-block;padding:0 10px;line-height:0;box-sizing:border-box;overflow:hidden;text-align:center}.zan-tab__title{display:inline-block;max-width:100%;height:44px;line-height:44px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;word-break:keep-all;font-size:14px;color:#666}.zan-tab__item--selected .zan-tab__title{color:#f44;border-bottom:2px solid #f44}.zan-tab__bd--scroll{display:block;white-space:nowrap}.zan-tab__bd--scroll .zan-tab__item{min-width:80px}.zan-tag{display:inline-block;position:relative;box-sizing:border-box;line-height:16px;padding:0 5px;border-radius:2px;font-size:11px;background:#c9c9c9;text-align:center;color:#fff}.zan-tag::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-tag--plain{color:#c9c9c9;background:#fff}.zan-tag--primary{color:#fff;background-color:#4b0}.zan-tag--primary::after{border-color:#4b0}.zan-tag--primary.zan-tag--plain{color:#4b0;background:#fff}.zan-tag--danger{color:#fff;background:#f44}.zan-tag--danger::after{border-color:#f44}.zan-tag--danger.zan-tag--plain{color:#f44;background:#fff}.zan-tag--warn{color:#fff;background:#f85}.zan-tag--warn::after{border-color:#f85}.zan-tag--warn.zan-tag--plain{color:#f85;background:#fff}.zan-tag--disabled{color:#999!important;background:#e5e5e5}.zan-tag--disabled::after{border-color:#ccc}.zan-toast{position:fixed;top:35%;left:20%;transform:translateZ(0) translateY(-100%);background:rgba(0,0,0,.7);color:#fff;font-size:14px;width:60%;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px;text-align:center;border-radius:4px;z-index:100}.zan-toptips{display:block;position:fixed;-webkit-transform:translateZ(0) translateY(-100%);width:100%;min-height:32px;top:0;line-height:2.3;font-size:14px;text-align:center;color:#fff;background-color:#e64340;z-index:110;transition:all .4s ease}.zan-toptips--show{-webkit-transform:translateZ(0) translateY(0)} -------------------------------------------------------------------------------- /dist/loadmore/index.wxml: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /dist/loadmore/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-loadmore{position:relative;width:65%;margin:21px auto;line-height:20px;font-size:14px;text-align:center;vertical-align:middle}.zan-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12,end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iciIgd2lkdGg9JzEyMHB4JyBoZWlnaHQ9JzEyMHB4JyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJub25lIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjRTlFOUU5JwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoMCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICA8L3JlY3Q+CiAgICA8cmVjdCB4PSc0Ni41JyB5PSc0MCcgd2lkdGg9JzcnIGhlaWdodD0nMjAnIHJ4PSc1JyByeT0nNScgZmlsbD0nIzk4OTY5NycKICAgICAgICAgIHRyYW5zZm9ybT0ncm90YXRlKDMwIDUwIDUwKSB0cmFuc2xhdGUoMCAtMzApJz4KICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0naW5kZWZpbml0ZScvPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyM5Qjk5OUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSg2MCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9J2luZGVmaW5pdGUnLz4KICAgIDwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjQTNBMUEyJwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoOTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNBQkE5QUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxMjAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCMkIyQjInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxNTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCQUI4QjknCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxODAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDMkMwQzEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyMTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDQkNCQ0InCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEMkQyRDInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEQURBREEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNFMkUyRTInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0Pgo8L3N2Zz4=) no-repeat;-webkit-background-size:100%;background-size:100%}.zan-loadmore .zan-loading{margin-right:4px}.zan-loadmore__tips{display:inline-block;vertical-align:middle;height:20px;line-height:20px}.zan-loadmore--nodata,.zan-loadmore--nomore{color:#999}.zan-loadmore--nodata::after,.zan-loadmore--nomore::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px}.zan-loadmore--nodata{margin-top:120px}.zan-loadmore--nodata .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore--nomore .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore__dot{position:absolute;left:50%;top:10px;margin-left:-2px;margin-top:-2px;content:" ";width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;vertical-align:middle} -------------------------------------------------------------------------------- /dist/noticebar/index.js: -------------------------------------------------------------------------------- 1 | var ZanNoticeBar = { 2 | initZanNoticeBarScroll(componentId) { 3 | this.zanNoticeBarNode = this.zanNoticeBarNode || {}; 4 | this.zanNoticeBarNode[`${componentId}`] = { 5 | width: undefined, 6 | wrapWidth: undefined, 7 | animation: null, 8 | resetAnimation: null 9 | }; 10 | var currentComponent = this.zanNoticeBarNode[`${componentId}`]; 11 | wx.createSelectorQuery().select(`#${componentId}__content`).boundingClientRect((rect) => { 12 | if (rect.width) { 13 | currentComponent.width = rect.width; 14 | wx.createSelectorQuery().select(`#${componentId}__content-wrap`).boundingClientRect((rect) => { 15 | currentComponent.wrapWidth = rect.width; 16 | if (currentComponent.wrapWidth < currentComponent.width) { 17 | var mstime = currentComponent.width / 40 * 1000; 18 | currentComponent.animation = wx.createAnimation({ 19 | duration: mstime, 20 | timingFunction: 'linear' 21 | }); 22 | currentComponent.resetAnimation = wx.createAnimation({ 23 | duration: 0, 24 | timingFunction: 'linear' 25 | }); 26 | this.scrollZanNoticeBar(componentId, mstime); 27 | } 28 | }).exec(); 29 | } else { 30 | console.warn('页面缺少 noticebar 元素'); 31 | } 32 | }).exec(); 33 | }, 34 | 35 | scrollZanNoticeBar(componentId, mstime) { 36 | var currentComponent = this.zanNoticeBarNode[`${componentId}`]; 37 | var resetAnimationData = currentComponent.resetAnimation.translateX(currentComponent.wrapWidth).step(); 38 | this.setData({ 39 | [`${componentId}.animationData`]: resetAnimationData.export() 40 | }); 41 | var aninationData = currentComponent.animation.translateX(-mstime * 40 / 1000).step(); 42 | setTimeout(() => { 43 | this.setData({ 44 | [`${componentId}.animationData`]: aninationData.export() 45 | }); 46 | }, 100); 47 | 48 | setTimeout(() => { 49 | this.scrollZanNoticeBar(componentId, mstime); 50 | }, mstime); 51 | } 52 | }; 53 | 54 | module.exports = ZanNoticeBar; 55 | -------------------------------------------------------------------------------- /dist/noticebar/index.wxml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /dist/noticebar/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-noticebar{color:#f60;padding:9px 10px;font-size:12px;line-height:1.5;background-color:#fff7cc} -------------------------------------------------------------------------------- /dist/panel/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-panel{position:relative;background:#fff;margin-top:10px;overflow:hidden}.zan-panel::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px;border-bottom-width:1px}.zan-panel-title{font-size:14px;line-height:1;color:#999;padding:20px 15px 0 15px}.zan-panel--without-margin-top{margin-top:0}.zan-panel--without-border::after{border:0 none} -------------------------------------------------------------------------------- /dist/popup/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-popup{visibility:hidden}.zan-popup--show{visibility:visible}.zan-popup__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-popup__container{position:fixed;left:50%;top:50%;background:#fff;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .4s ease;z-index:11;opacity:0}.zan-popup--show .zan-popup__container{opacity:1}.zan-popup--show .zan-popup__mask{display:block}.zan-popup--left .zan-popup__container{left:0;top:auto;transform:translate3d(-100%,0,0)}.zan-popup--show.zan-popup--left .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--right .zan-popup__container{right:0;top:auto;left:auto;transform:translate3d(100%,0,0)}.zan-popup--show.zan-popup--right .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--bottom .zan-popup__container{top:auto;left:auto;bottom:0;transform:translate3d(0,100%,0)}.zan-popup--show.zan-popup--bottom .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--top .zan-popup__container{top:0;left:auto;transform:translate3d(0,-100%,0)}.zan-popup--show.zan-popup--top .zan-popup__container{transform:translate3d(0,0,0)} -------------------------------------------------------------------------------- /dist/row/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-row:after{content:"";display:table;clear:both} -------------------------------------------------------------------------------- /dist/select/index.js: -------------------------------------------------------------------------------- 1 | const { extractComponentId } = require('../common/helper'); 2 | 3 | function handle(e) { 4 | const componentId = extractComponentId(e); 5 | const value = e.detail.value; 6 | 7 | callback.call(this, componentId, value); 8 | } 9 | 10 | function callback(componentId, value) { 11 | const e = { componentId, value }; 12 | console.info('[zan:Select:change]', e); 13 | 14 | if (this.handleZanSelectChange) { 15 | this.handleZanSelectChange(e); 16 | } else { 17 | console.warn('页面缺少 handleZanSelectChange 回调函数'); 18 | } 19 | } 20 | 21 | module.exports = { 22 | _handleZanSelectChange(e) { 23 | handle.call(this, e); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /dist/select/index.wxml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | function getColor(color) { 25 | color = color || '#ff4444' 26 | return color; 27 | } 28 | 29 | module.exports = { 30 | getColor: getColor, 31 | getItemStyle: function(item, checkedValue, activeColor) { 32 | var padding = item.padding * 10; 33 | var style = 'padding-left: ' + padding + 'px;'; 34 | 35 | // 如果为选中状态,则高亮 36 | if (item.value === checkedValue) { 37 | style += 'color: ' + getColor(activeColor); 38 | } 39 | 40 | return style; 41 | } 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /dist/select/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-select__list .zan-select__radio{display:none} -------------------------------------------------------------------------------- /dist/stepper/index.js: -------------------------------------------------------------------------------- 1 | function handle(e, num) { 2 | var dataset = e.currentTarget.dataset; 3 | var componentId = dataset.componentId; 4 | var disabled = dataset.disabled; 5 | var stepper = +dataset.stepper; 6 | 7 | if (disabled) return null; 8 | 9 | callback.call(this, componentId, stepper + num); 10 | } 11 | 12 | function callback(componentId, stepper) { 13 | stepper = +stepper; 14 | var e = { componentId, stepper }; 15 | console.info('[zan:stepper:change]', e); 16 | 17 | if (this.handleZanStepperChange) { 18 | this.handleZanStepperChange(e); 19 | } else { 20 | console.warn('页面缺少 handleZanStepperChange 回调函数'); 21 | } 22 | } 23 | 24 | var Stepper = { 25 | _handleZanStepperMinus(e) { 26 | handle.call(this, e, -1); 27 | }, 28 | 29 | _handleZanStepperPlus(e) { 30 | handle.call(this, e, +1); 31 | }, 32 | 33 | _handleZanStepperBlur(e) { 34 | var dataset = e.currentTarget.dataset; 35 | var componentId = dataset.componentId; 36 | var max = +dataset.max; 37 | var min = +dataset.min; 38 | var value = e.detail.value; 39 | 40 | if (!value) { 41 | setTimeout(() => { 42 | callback.call(this, componentId, min); 43 | }, 16); 44 | callback.call(this, componentId, value); 45 | return '' + value; 46 | } 47 | 48 | value = +value; 49 | if (value > max) { 50 | value = max; 51 | } else if (value < min) { 52 | value = min; 53 | } 54 | 55 | callback.call(this, componentId, value); 56 | 57 | return '' + value; 58 | } 59 | }; 60 | 61 | module.exports = Stepper; 62 | -------------------------------------------------------------------------------- /dist/stepper/index.wxml: -------------------------------------------------------------------------------- 1 | 29 | -------------------------------------------------------------------------------- /dist/stepper/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-stepper{color:#666}.zan-stepper view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #999}.zan-stepper .zan-stepper__minus{border-right:none;border-radius:2px 0 0 2px}.zan-stepper .zan-stepper__text{border:1rpx solid #999;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.zan-stepper .zan-stepper__plus{border-left:none;border-radius:0 2px 2px 0}.zan-stepper .zan-stepper--disabled{background:#f8f8f8;color:#bbb;border-color:#e8e8e8}.zan-stepper--small view{min-width:36px;line-height:18px}.zan-stepper--small .zan-stepper__text{width:36px;line-height:28px;height:28px} -------------------------------------------------------------------------------- /dist/steps/index.wxml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /dist/steps/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-steps--steps.zan-steps--5 .zan-steps__step{width:25%}.zan-steps--steps.zan-steps--4 .zan-steps__step{width:33%}.zan-steps--steps.zan-steps--3 .zan-steps__step{width:50%}.zan-steps--steps .zan-steps__step{position:relative;float:left;padding-bottom:25px;color:#b1b1b1}.zan-steps--steps .zan-steps__title{transform:translateX(-50%);font-size:10px;text-align:center}.zan-steps--steps .zan-steps__icons{position:absolute;top:30px;left:-10px;padding:0 8px;background-color:#fff;z-index:10}.zan-steps--steps .zan-steps__circle{display:block;position:relative;width:5px;height:5px;background-color:#e5e5e5;border-radius:50%}.zan-steps--steps .zan-steps__line{position:absolute;left:0;top:32px;width:100%;height:1px;background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--done{color:#333}.zan-steps--steps .zan-steps__step--done .zan-steps__line{background-color:#06bf04}.zan-steps--steps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--steps .zan-steps__step--cur .zan-steps__icons{top:25px;left:-14px}.zan-steps--steps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background-image:url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px}.zan-steps--steps .zan-steps__step--cur .zan-steps__line{background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--first-child .zan-steps__title{margin-left:0;transform:none;text-align:left}.zan-steps--steps .zan-steps__step--first-child .zan-steps__icons{left:-7px}.zan-steps--steps .zan-steps__step--last-child{position:absolute;right:0;top:0;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__title{transform:none;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__icons{left:auto;right:-6px}.zan-steps--steps .zan-steps__step--last-child .zan-steps__line{display:none}.zan-steps--steps .zan-steps__step--db-title{min-height:29px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__line{top:45px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__icons{top:43px}.zan-steps--steps .zan-steps__step--db-title.zan-steps__step--cur .zan-steps__icons{top:39px}.zan-steps--vsteps{color:#999;font-size:14px}.zan-steps--vsteps .zan-steps__step{position:relative;padding:15px 0}.zan-steps--vsteps .zan-steps__step--done{color:#4b0}.zan-steps--vsteps .zan-steps__line{position:absolute;top:0;bottom:0;left:7px;width:1px;background-color:#e5e5e5}.zan-steps--vsteps .zan-steps__title{display:inline-block;line-height:20px;padding-left:27px}.zan-steps--vsteps .zan-steps__title--desc{padding-left:3px}.zan-steps--vsteps .zan-steps__icons{position:absolute;left:7px;top:50%;transform:translate(-50%,-50%);z-index:2;padding:3px 0;background-color:#fff}.zan-steps--vsteps .zan-steps__circle{width:5px;height:5px;background-color:#cacaca;border-radius:10px}.zan-steps--vsteps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--vsteps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background:transparent url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px;border-radius:0}.zan-steps--vsteps .zan-steps__icon--active{width:13px;height:13px}.zan-steps--vsteps .zan-steps__step--first-child .zan-steps__title::before{content:'';position:absolute;top:0;bottom:50%;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps--vsteps .zan-steps__step--last-child .zan-steps__title::after{content:'';position:absolute;top:50%;bottom:0;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps{position:relative} -------------------------------------------------------------------------------- /dist/steps/wxss/step.wxss: -------------------------------------------------------------------------------- 1 | .zan-steps--steps.zan-steps--5 .zan-steps__step{width:25%}.zan-steps--steps.zan-steps--4 .zan-steps__step{width:33%}.zan-steps--steps.zan-steps--3 .zan-steps__step{width:50%}.zan-steps--steps .zan-steps__step{position:relative;float:left;padding-bottom:25px;color:#b1b1b1}.zan-steps--steps .zan-steps__title{transform:translateX(-50%);font-size:10px;text-align:center}.zan-steps--steps .zan-steps__icons{position:absolute;top:30px;left:-10px;padding:0 8px;background-color:#fff;z-index:10}.zan-steps--steps .zan-steps__circle{display:block;position:relative;width:5px;height:5px;background-color:#e5e5e5;border-radius:50%}.zan-steps--steps .zan-steps__line{position:absolute;left:0;top:32px;width:100%;height:1px;background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--done{color:#333}.zan-steps--steps .zan-steps__step--done .zan-steps__line{background-color:#06bf04}.zan-steps--steps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--steps .zan-steps__step--cur .zan-steps__icons{top:25px;left:-14px}.zan-steps--steps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background-image:url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px}.zan-steps--steps .zan-steps__step--cur .zan-steps__line{background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--first-child .zan-steps__title{margin-left:0;transform:none;text-align:left}.zan-steps--steps .zan-steps__step--first-child .zan-steps__icons{left:-7px}.zan-steps--steps .zan-steps__step--last-child{position:absolute;right:0;top:0;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__title{transform:none;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__icons{left:auto;right:-6px}.zan-steps--steps .zan-steps__step--last-child .zan-steps__line{display:none}.zan-steps--steps .zan-steps__step--db-title{min-height:29px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__line{top:45px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__icons{top:43px}.zan-steps--steps .zan-steps__step--db-title.zan-steps__step--cur .zan-steps__icons{top:39px} -------------------------------------------------------------------------------- /dist/steps/wxss/vstep.wxss: -------------------------------------------------------------------------------- 1 | .zan-steps--vsteps{color:#999;font-size:14px}.zan-steps--vsteps .zan-steps__step{position:relative;padding:15px 0}.zan-steps--vsteps .zan-steps__step--done{color:#4b0}.zan-steps--vsteps .zan-steps__line{position:absolute;top:0;bottom:0;left:7px;width:1px;background-color:#e5e5e5}.zan-steps--vsteps .zan-steps__title{display:inline-block;line-height:20px;padding-left:27px}.zan-steps--vsteps .zan-steps__title--desc{padding-left:3px}.zan-steps--vsteps .zan-steps__icons{position:absolute;left:7px;top:50%;transform:translate(-50%,-50%);z-index:2;padding:3px 0;background-color:#fff}.zan-steps--vsteps .zan-steps__circle{width:5px;height:5px;background-color:#cacaca;border-radius:10px}.zan-steps--vsteps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--vsteps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background:transparent url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px;border-radius:0}.zan-steps--vsteps .zan-steps__icon--active{width:13px;height:13px}.zan-steps--vsteps .zan-steps__step--first-child .zan-steps__title::before{content:'';position:absolute;top:0;bottom:50%;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps--vsteps .zan-steps__step--last-child .zan-steps__title::after{content:'';position:absolute;top:50%;bottom:0;left:7px;width:1px;background-color:#fff;z-index:1} -------------------------------------------------------------------------------- /dist/switch/index.js: -------------------------------------------------------------------------------- 1 | var Switch = { 2 | _handleZanSwitchChange(e) { 3 | var dataset = e.currentTarget.dataset; 4 | 5 | var checked = !dataset.checked; 6 | var loading = dataset.loading; 7 | var disabled = dataset.disabled; 8 | var componentId = dataset.componentId; 9 | 10 | if (loading || disabled) return; 11 | 12 | console.info('[zan:switch:change]', { checked, componentId }); 13 | 14 | if (this.handleZanSwitchChange) { 15 | this.handleZanSwitchChange({ 16 | checked, 17 | componentId 18 | }); 19 | } else { 20 | console.warn('页面缺少 handleZanSwitchChange 回调函数'); 21 | } 22 | } 23 | }; 24 | 25 | module.exports = Switch; 26 | -------------------------------------------------------------------------------- /dist/switch/index.wxml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /dist/switch/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-switch{position:relative;display:inline-block;width:52px;height:32px;vertical-align:middle;box-sizing:border-box;border-radius:16px;background:#44db5e;border:1px solid #44db5e}.zan-switch__circle{position:absolute;top:0;left:0;width:30px;height:30px;display:inline-block;background:#fff;border-radius:15px;box-sizing:border-box;box-shadow:0 0 0 1px rgba(0,0,0,.1),0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:transform .35s cubic-bezier(.45,1,.4,1);z-index:2}.zan-switch__bg{position:absolute;top:-1px;left:-1px;width:52px;height:32px;background:#fff;border-radius:26px;display:inline-block;border:1px solid #e5e5e5;box-sizing:border-box;transition:transform .35s cubic-bezier(.45,1,.4,1);transform:scale(0);transform-origin:36px 16px}.zan-switch--on .zan-switch__circle{transform:translateX(20px)}.zan-switch--off .zan-switch__bg{transform:scale(1)}.zan-swtich--disabled{opacity:.4}.zan-switch__loading{position:absolute;left:7px;top:7px;width:16px;height:16px;background:url(https://img.yzcdn.cn/public_files/2017/02/24/9acec77d91106cd15b8107c4633d9155.png) no-repeat;background-size:16px 16px;animation:zan-switch-loading .8s infinite linear}@keyframes zan-switch-loading{from{transform:rotate(0)}to{transform:rotate(360deg)}} -------------------------------------------------------------------------------- /dist/tab/index.js: -------------------------------------------------------------------------------- 1 | const { extractComponentId } = require('../common/helper'); 2 | 3 | var Tab = { 4 | _handleZanTabChange(e) { 5 | const componentId = extractComponentId(e); 6 | const dataset = e.currentTarget.dataset; 7 | const selectedId = dataset.itemId; 8 | const data = { componentId, selectedId }; 9 | 10 | console.info('[zan:tab:change]', data); 11 | if (this.handleZanTabChange) { 12 | this.handleZanTabChange(data); 13 | } else { 14 | console.warn('页面缺少 handleZanTabChange 回调函数'); 15 | } 16 | } 17 | }; 18 | 19 | module.exports = Tab; 20 | -------------------------------------------------------------------------------- /dist/tab/index.wxml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 38 | -------------------------------------------------------------------------------- /dist/tab/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-tab{height:45px}.zan-tab__bd{width:750rpx;display:flex;flex-direction:row;border-bottom:1rpx solid #e5e5e5;background:#fff}.zan-tab__bd--fixed{position:fixed;top:0;z-index:2}.zan-tab__item{flex:1;display:inline-block;padding:0 10px;line-height:0;box-sizing:border-box;overflow:hidden;text-align:center}.zan-tab__title{display:inline-block;max-width:100%;height:44px;line-height:44px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;word-break:keep-all;font-size:14px;color:#666}.zan-tab__item--selected .zan-tab__title{color:#f44;border-bottom:2px solid #f44}.zan-tab__bd--scroll{display:block;white-space:nowrap}.zan-tab__bd--scroll .zan-tab__item{min-width:80px} -------------------------------------------------------------------------------- /dist/tag/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-tag{display:inline-block;position:relative;box-sizing:border-box;line-height:16px;padding:0 5px;border-radius:2px;font-size:11px;background:#c9c9c9;text-align:center;color:#fff}.zan-tag::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-tag--plain{color:#c9c9c9;background:#fff}.zan-tag--primary{color:#fff;background-color:#4b0}.zan-tag--primary::after{border-color:#4b0}.zan-tag--primary.zan-tag--plain{color:#4b0;background:#fff}.zan-tag--danger{color:#fff;background:#f44}.zan-tag--danger::after{border-color:#f44}.zan-tag--danger.zan-tag--plain{color:#f44;background:#fff}.zan-tag--warn{color:#fff;background:#f85}.zan-tag--warn::after{border-color:#f85}.zan-tag--warn.zan-tag--plain{color:#f85;background:#fff}.zan-tag--disabled{color:#999!important;background:#e5e5e5}.zan-tag--disabled::after{border-color:#ccc} -------------------------------------------------------------------------------- /dist/toast/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | showZanToast(title, timeout) { 3 | var zanToast = this.data.zanToast || {}; 4 | clearTimeout(zanToast.timer); 5 | 6 | // 弹层设置~ 7 | zanToast = { 8 | show: true, 9 | title 10 | }; 11 | this.setData({ 12 | zanToast 13 | }); 14 | 15 | var timer = setTimeout(() => { 16 | this.clearZanToast(); 17 | }, timeout || 3000); 18 | 19 | this.setData({ 20 | 'zanToast.timer': timer 21 | }); 22 | }, 23 | 24 | clearZanToast() { 25 | var zanToast = this.data.zanToast || {}; 26 | clearTimeout(zanToast.timer); 27 | 28 | this.setData({ 29 | 'zanToast.show': false 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /dist/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /dist/toast/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-toast{position:fixed;top:35%;left:20%;transform:translateZ(0) translateY(-100%);background:rgba(0,0,0,.7);color:#fff;font-size:14px;width:60%;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px;text-align:center;border-radius:4px;z-index:100} -------------------------------------------------------------------------------- /dist/toptips/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | showZanTopTips(content = '', options = {}) { 3 | let zanTopTips = this.data.zanTopTips || {}; 4 | // 如果已经有一个计时器在了,就清理掉先 5 | if (zanTopTips.timer) { 6 | clearTimeout(zanTopTips.timer); 7 | zanTopTips.timer = undefined; 8 | } 9 | 10 | if (typeof options === 'number') { 11 | options = { 12 | duration: options 13 | }; 14 | } 15 | 16 | // options参数默认参数扩展 17 | options = Object.assign({ 18 | duration: 3000 19 | }, options); 20 | 21 | // 设置定时器,定时关闭topTips 22 | let timer = setTimeout(() => { 23 | this.setData({ 24 | 'zanTopTips.show': false, 25 | 'zanTopTips.timer': undefined 26 | }); 27 | }, options.duration); 28 | 29 | // 展示出topTips 30 | this.setData({ 31 | zanTopTips: { 32 | show: true, 33 | content, 34 | options, 35 | timer 36 | } 37 | }); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /dist/toptips/index.wxml: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /dist/toptips/index.wxss: -------------------------------------------------------------------------------- 1 | .zan-toptips{display:block;position:fixed;-webkit-transform:translateZ(0) translateY(-100%);width:100%;min-height:32px;top:0;line-height:2.3;font-size:14px;text-align:center;color:#fff;background-color:#e64340;z-index:110;transition:all .4s ease}.zan-toptips--show{-webkit-transform:translateZ(0) translateY(0)} -------------------------------------------------------------------------------- /images/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/all.png -------------------------------------------------------------------------------- /images/bktj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/bktj.png -------------------------------------------------------------------------------- /images/chaojisou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/chaojisou.png -------------------------------------------------------------------------------- /images/chaquan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/chaquan.jpg -------------------------------------------------------------------------------- /images/coupon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/coupon.png -------------------------------------------------------------------------------- /images/esfd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/esfd.png -------------------------------------------------------------------------------- /images/favour-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/favour-select.png -------------------------------------------------------------------------------- /images/favour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/favour.png -------------------------------------------------------------------------------- /images/food.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/food.png -------------------------------------------------------------------------------- /images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/home.png -------------------------------------------------------------------------------- /images/hot-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/hot-select.png -------------------------------------------------------------------------------- /images/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/hot.png -------------------------------------------------------------------------------- /images/index-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/index-select.png -------------------------------------------------------------------------------- /images/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/index.png -------------------------------------------------------------------------------- /images/jkj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/jkj.png -------------------------------------------------------------------------------- /images/kefu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/kefu.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/logo.png -------------------------------------------------------------------------------- /images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/search.png -------------------------------------------------------------------------------- /images/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/share.png -------------------------------------------------------------------------------- /images/taobao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/taobao.png -------------------------------------------------------------------------------- /images/tmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/tmall.png -------------------------------------------------------------------------------- /images/wholesale-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/wholesale-select.png -------------------------------------------------------------------------------- /images/wholesale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/wholesale.png -------------------------------------------------------------------------------- /images/woman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmateurEvents/coupon/c6bcb4ac09ca1a9778f8015470ef2a1b19070bb5/images/woman.png -------------------------------------------------------------------------------- /pages/detail/detail.js: -------------------------------------------------------------------------------- 1 | const Zan = require('../../dist/index'); 2 | 3 | 4 | Page(Object.assign({}, Zan.Dialog, { 5 | data: { 6 | couponInfo: {}, 7 | picWidth: wx.getSystemInfoSync().windowWidth, 8 | platformTypeUrl: "../../images/taobao.png", 9 | loadingBtn: false, 10 | showStatus: false, 11 | content: "", 12 | maxLength: 0 13 | }, 14 | onShow: function () { 15 | wx.setStorageSync('isDetailBack', true) 16 | }, 17 | onLoad: function (options) { 18 | this.setData({ 19 | couponInfo: wx.getStorageSync('couponInfo') 20 | }) 21 | if (this.data.couponInfo.PlatformType == "天猫") 22 | this.setData({ 23 | platformTypeUrl: "../../images/tmall.png" 24 | }) 25 | }, 26 | hideView: function () { 27 | this.setData({ 28 | showStatus: false 29 | }) 30 | }, 31 | getCoupon: function (options) { 32 | var that = this; 33 | that.setData({ 34 | loadingBtn: true 35 | }) 36 | var InfoData = { 37 | "message": "success", "data": { "content": "\u6253\u5f00\u624b\u673a\u6dd8\u5b9d\u5929\u732b\u5ba2\u6237\u7aef\u5373\u53ef\u4f7f\u7528", "info_id": "\uffe5lEoJ0nBsWGa\uffe5" }, "errcode": 10000, "getCouponTitle": "\u83b7\u53d6\u6210\u529f", "getCouponInfo": "\u606d\u559c\u83b7\u5f97\u8be5\u5238\uff0c\u8bf7\u8054\u7cfb\u5ba2\u670d" } 38 | wx.setClipboardData({ 39 | data: InfoData.data.info_id, 40 | success: function (res) { 41 | that.setData({ 42 | content: InfoData.data.content, 43 | loadingBtn: false, 44 | showStatus: true, 45 | maxLength: InfoData.data.content.length 46 | }) 47 | }, 48 | }) 49 | that.showZanDialog({ 50 | title: '复制成功', 51 | content: InfoData.data.content, 52 | buttons: [{ 53 | text: '使用教程', 54 | type: 'explain' 55 | }, { 56 | text: '确定', 57 | color: '#3CC51F', 58 | type: 'confirm' 59 | }] 60 | }).then(({ type }) => { 61 | if (type === 'explain') { 62 | wx.navigateTo({ 63 | url: "../../pages/explain/explain", 64 | }) 65 | } 66 | console.log('=== dialog with custom buttons ===', `type: ${type}`); 67 | }); 68 | // 在有服务端时使用 69 | // wx.request({ 70 | // url: "https://tuteng2345.applinzi.com/api/v1/word", 71 | // data: { 72 | // "ItemID": that.data.couponInfo.ItemID, 73 | // "CouponID": that.data.couponInfo.CouponID, 74 | // "text": that.data.couponInfo.ItemName 75 | // }, 76 | // method: "POST", 77 | // success: function (resRequest) { 78 | // if (resRequest.statusCode === 200 && resRequest.data.errcode === 10000) { 79 | // wx.setClipboardData({ 80 | // data: resRequest.data.data.info_id, 81 | // success: function (res) { 82 | // that.setData({ 83 | // content: resRequest.data.data.content, 84 | // loadingBtn: false, 85 | // showStatus: true, 86 | // maxLength: resRequest.data.data.content.length 87 | // }) 88 | // }, 89 | // }) 90 | // that.showZanDialog({ 91 | // title: '复制成功', 92 | // content: resRequest.data.data.content, 93 | // buttons: [{ 94 | // text: '使用教程', 95 | // type: 'explain' 96 | // }, { 97 | // text: '确定', 98 | // color: '#3CC51F', 99 | // type: 'confirm' 100 | // }] 101 | // }).then(({ type }) => { 102 | // if (type === 'explain') { 103 | // wx.navigateTo({ 104 | // url: "../../pages/explain/explain", 105 | // }) 106 | // } 107 | // console.log('=== dialog with custom buttons ===', `type: ${type}`); 108 | // }); 109 | // } 110 | // } 111 | // }) 112 | } 113 | })) 114 | -------------------------------------------------------------------------------- /pages/detail/detail.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/detail/detail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 券后价: ¥{{couponInfo.QuanHouJia}} 10 | 11 | 12 | 13 | 14 | 月销量:{{couponInfo.MonthlySales}} 15 | 16 | 17 | 18 | 19 | {{couponInfo.ItemName}} 20 | 21 | 优惠券ID: {{couponInfo.CouponID}} 22 | 23 | 24 | 25 | ¥{{couponInfo.QuanHouJia}}¥{{couponInfo.ItemPrice}} 26 | 27 | 28 | 29 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /pages/detail/detail.wxss: -------------------------------------------------------------------------------- 1 | #page-detail { 2 | background-color: #fff; 3 | } 4 | 5 | #good-info { 6 | padding: 10px; 7 | } 8 | 9 | #coupon-info { 10 | border-top: 1px #f7f7f7 solid; 11 | border-bottom: 1px #f7f7f7 solid; 12 | width: 100%; 13 | margin-top: 20px; 14 | font-size: 14px; 15 | line-height: 20px; 16 | } 17 | 18 | .coupon-info-item { 19 | display: flex; 20 | margin: 0 10px; 21 | height: 40px; 22 | line-height: 40px; 23 | } 24 | 25 | .coupon-info-item-des { 26 | border-top: 1px #f7f7f7 solid; 27 | margin: 0 10px; 28 | padding: 5px 0; 29 | font-size: 12px; 30 | } 31 | 32 | .coupon-des { 33 | color: #999; 34 | height: 30px; 35 | line-height: 30px; 36 | } 37 | 38 | #coupon-denomination { 39 | color: #f40; 40 | } 41 | 42 | #coupon-coin { 43 | flex-grow: 1; 44 | color: #999; 45 | text-align: center; 46 | } 47 | 48 | #coupon-coin image { 49 | width: 16px; 50 | height: 20px; 51 | margin-right: 5px; 52 | vertical-align: middle; 53 | } 54 | 55 | #goods-sales { 56 | color: #999; 57 | } 58 | 59 | 60 | #get-coupon { 61 | position: fixed; 62 | left: 0px; 63 | bottom: 0; 64 | border-top: 1px solid #D1D1D1; 65 | width: 100%; 66 | background-color: #fff; 67 | } 68 | 69 | 70 | .hide { 71 | display: none; 72 | } 73 | .goods-price-coupon { 74 | border-right: 1px solid #D1D1D1; 75 | } 76 | .goods-price-coupon, .goods-price-number { 77 | font-size: 11px; 78 | color: #666; 79 | margin-top: 3px; 80 | margin-left: 12px; 81 | } 82 | .goods-name { 83 | padding-left: 20px; 84 | padding-right: 20px; 85 | font-size: 12px; 86 | text-align: center; 87 | margin-top: 15px; 88 | color: #666; 89 | } 90 | .coupon-price { 91 | font-size: 15px; 92 | color: red; 93 | margin-top: 6.5px; 94 | } 95 | .now-price { 96 | font-size: 12px; 97 | } 98 | .share-kefu, .coupon, .kouling { 99 | text-align: center; 100 | } 101 | .coupon { 102 | height: 30px; 103 | margin-top: 4px; 104 | } 105 | .share-kefu { 106 | margin-top: 3.5px; 107 | } 108 | .share-kefu image { 109 | height: 20px; 110 | width: 20px; 111 | margin-top: 2px; 112 | } 113 | .share-kefu button::after { 114 | border: none; 115 | } 116 | #get-coupon .zan-col-10, #get-coupon .zan-col-4 { 117 | border-right: 1px dotted #D1D1D1; 118 | } 119 | .kouling { 120 | font-size: 13px; 121 | height: 34px; 122 | background-color: rgb(255, 68, 68); 123 | } 124 | .kouling .zan-btn--danger { 125 | margin-top: 2px; 126 | border-color: rgb(255, 68, 68) !important; 127 | } 128 | .kouling .zan-btn::after { 129 | border-width: 0 !important; 130 | } -------------------------------------------------------------------------------- /pages/explain/explain.js: -------------------------------------------------------------------------------- 1 | // pages/explain/explain.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面初次渲染完成 20 | */ 21 | onReady: function () { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面显示 27 | */ 28 | onShow: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面隐藏 34 | */ 35 | onHide: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面卸载 41 | */ 42 | onUnload: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 页面相关事件处理函数--监听用户下拉动作 48 | */ 49 | onPullDownRefresh: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面上拉触底事件的处理函数 55 | */ 56 | onReachBottom: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 用户点击右上角分享 62 | */ 63 | onShareAppMessage: function () { 64 | 65 | } 66 | }) -------------------------------------------------------------------------------- /pages/explain/explain.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/explain/explain.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pages/explain/explain.wxss: -------------------------------------------------------------------------------- 1 | /* pages/explain/explain.wxss */ 2 | .show { 3 | height: 1500px !important; 4 | } -------------------------------------------------------------------------------- /pages/favour/favour.js: -------------------------------------------------------------------------------- 1 | const { Tab, extend } = require('../../dist/index'); 2 | 3 | Page(extend({}, Tab, { 4 | data: { 5 | inputShowed: false, 6 | inputVal: "", 7 | imgUrls: [ 8 | 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 9 | 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 10 | 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' 11 | ], 12 | couponList: [], 13 | inputContent: "", 14 | selectCategory: 0, 15 | sort: "commission_rate_desc", 16 | indicatorDots: true, 17 | autoplay: true, 18 | interval: 5000, 19 | duration: 1000, 20 | cate_method: {}, 21 | sort_method: {}, 22 | cate_src: [] 23 | }, 24 | onShow: function () { 25 | this.setData({ 26 | couponList: [], 27 | pageIndex: 0, 28 | isLoading: true, 29 | loadOver: false, 30 | }) 31 | this.getMoreCouponList() 32 | }, 33 | onLoad: function (options) { 34 | // this.getCategoryList() 35 | var that = this; 36 | this.setData({ 37 | sort_method: { 38 | list: [{ 39 | id: 'commission_rate_desc', 40 | title: '默认' 41 | }, { 42 | id: 'new', 43 | title: '最新' 44 | }, { 45 | id: 'sale_num', 46 | title: '销量' 47 | }, { 48 | id: 'price_asc', 49 | title: '价格' 50 | }, { 51 | id: 'commission_rate_descsign', 52 | title: '券额' 53 | }], 54 | selectedId: 'commission_rate_desc' 55 | }, 56 | cate_method: { 57 | list: [{ 58 | id: '1', 59 | title: '全部' 60 | }, { 61 | id: '2', 62 | title: '女装' 63 | }, { 64 | id: '3', 65 | title: '男装' 66 | }, { 67 | id: '4', 68 | title: '鞋子' 69 | }, { 70 | id: '5', 71 | title: '箱包' 72 | }, { 73 | id: '6', 74 | title: '母婴' 75 | }, { 76 | id: '7', 77 | title: '内衣' 78 | }, { 79 | id: '8', 80 | title: '美妆' 81 | }, { 82 | id: '9', 83 | title: '配饰' 84 | }, { 85 | id: '10', 86 | title: '家居' 87 | }, { 88 | id: '11', 89 | title: '文体' 90 | }, { 91 | id: '12', 92 | title: '数码' 93 | }, { 94 | id: '13', 95 | title: '电器' 96 | }, { 97 | id: '14', 98 | title: '美食' 99 | }, { 100 | id: '15', 101 | title: '其他' 102 | }], 103 | selectedId: '1', 104 | scroll: true, 105 | height: 42, 106 | }, 107 | cate_src: [ 108 | { 109 | mode: 'scaleToFill', 110 | text: '九块九', 111 | picture: '../../images/jkj.png', 112 | }, 113 | { 114 | mode: 'scaleToFill', 115 | text: '20封顶', 116 | picture: '../../images/hot.png', 117 | }, 118 | { 119 | mode: 'scaleToFill', 120 | text: '爆款推荐', 121 | picture: '../../images/bktj.png', 122 | }, 123 | { 124 | mode: 'scaleToFill', 125 | text: '找优惠券', 126 | picture: '../../images/jkj.png', 127 | } 128 | ] 129 | }) 130 | }, 131 | getMoreCouponList: function () { 132 | var that = this 133 | var data = [ 134 | { 135 | "ItemID": "521424623286", 136 | "QuanHouJia": 2.4, 137 | "CouponID": "25e180440f884a5ebeca22249fa14c91", 138 | "background": "券", 139 | "Jian": "3.0", 140 | "CounponIDText": "券ID", 141 | "ItemPic": "https://img.alicdn.com/imgextra/i4/1713332935/TB2KxAikXcJL1JjSZFOXXcWlXXa_!!1713332935.jpg", 142 | "MonthlySales": "742", 143 | "ZongHeBiLi": 0.56, 144 | "buttonText": "领取优惠券", 145 | "proportion": "优惠\n比例", 146 | "CouponTotalText": "数量", 147 | "ItemPrice": "5.4", 148 | "MonthlySalesText": "月销量", 149 | "CouponEndTimeText": "结束时间", 150 | "ItemPriceText": "在售价", 151 | "QuanHouJiaText": "券后价", 152 | "CouponEndTime": "2018-02-28 11:59:59", 153 | "ItemName": "四季景观混色格桑花种子波斯菊野花组合百日草盆栽庭院易活包邮", 154 | "CouponDenomination": "3.0" 155 | }, 156 | { 157 | "ItemID": "16807798207", 158 | "QuanHouJia": 44.35, 159 | "CouponID": "e423193ba0694c80bacc2ab4e39cb9bf", 160 | "background": "券", 161 | "Jian": "20.0", 162 | "CounponIDText": "券ID", 163 | "ItemPic": "https://img.alicdn.com/tfscom/i1/249551805/TB2j3Fil0RopuFjSZFtXXcanpXa_!!249551805.jpg", 164 | "MonthlySales": "70", 165 | "ZongHeBiLi": 0.31, 166 | "buttonText": "领取优惠券", 167 | "proportion": "优惠\n比例", 168 | "CouponTotalText": "数量", 169 | "ItemPrice": "64.35", 170 | "MonthlySalesText": "月销量", 171 | "CouponEndTimeText": "结束时间", 172 | "ItemPriceText": "在售价", 173 | "QuanHouJiaText": "券后价", 174 | "CouponEndTime": "2018-02-27 11:59:59", 175 | "ItemName": "檀香家用室内净化空气倒流香粒塔香沉香锥香线香盘香藏香天然瓦纳", 176 | "CouponDenomination": "20.0" 177 | }, 178 | { 179 | "ItemID": "559553538275", 180 | "QuanHouJia": 49.8, 181 | "CouponID": "928152738dea4173ba269abd0eb732cb", 182 | "background": "券", 183 | "Jian": "10.0", 184 | "CounponIDText": "券ID", 185 | "ItemPic": "https://img.alicdn.com/bao/uploaded/i3/1974868550/TB1pc3NhWmWQ1JjSZPhXXXCJFXa_!!0-item_pic.jpg", 186 | "MonthlySales": "960", 187 | "ZongHeBiLi": 0.17, 188 | "buttonText": "领取优惠券", 189 | "proportion": "优惠\n比例", 190 | "CouponTotalText": "数量", 191 | "ItemPrice": "59.8", 192 | "MonthlySalesText": "月销量", 193 | "CouponEndTimeText": "结束时间", 194 | "ItemPriceText": "在售价", 195 | "QuanHouJiaText": "券后价", 196 | "CouponEndTime": "2018-02-28 11:59:59", 197 | "ItemName": "海鲜水产干鱿鱼 大鱿鱼干500g 烧烤鱿鱼板 鱿鱼片 鱿鱼头", 198 | "CouponDenomination": "10.0" 199 | }, 200 | { 201 | "ItemID": "534797190507", 202 | "QuanHouJia": 12.9, 203 | "CouponID": "9f24c67029644eaa8b9a31043b28ea18", 204 | "background": "券", 205 | "Jian": "3.0", 206 | "CounponIDText": "券ID", 207 | "ItemPic": "https://img.alicdn.com/imgextra/i1/1838814586/TB2puqnaBE_1uJjSZFOXXXNwXXa_!!1838814586.jpg", 208 | "MonthlySales": "724", 209 | "ZongHeBiLi": 0.19, 210 | "buttonText": "领取优惠券", 211 | "proportion": "优惠\n比例", 212 | "CouponTotalText": "数量", 213 | "ItemPrice": "15.9", 214 | "MonthlySalesText": "月销量", 215 | "CouponEndTimeText": "结束时间", 216 | "ItemPriceText": "在售价", 217 | "QuanHouJiaText": "券后价", 218 | "CouponEndTime": "2018-02-28 11:59:59", 219 | "ItemName": "苹果6/6s/6plus手机壳套苹果保护壳全包7Plus防摔时尚款7潮男女", 220 | "CouponDenomination": "3.0" 221 | }, 222 | { 223 | "ItemID": "538044838934", 224 | "QuanHouJia": 12.9, 225 | "CouponID": "9f24c67029644eaa8b9a31043b28ea18", 226 | "background": "券", 227 | "Jian": "3.0", 228 | "CounponIDText": "券ID", 229 | "ItemPic": "https://img.alicdn.com/imgextra/i1/1838814586/TB2vNBpXcrHK1JjSszbXXXbvVXa_!!1838814586.jpg", 230 | "MonthlySales": "642", 231 | "ZongHeBiLi": 0.19, 232 | "buttonText": "领取优惠券", 233 | "proportion": "优惠\n比例", 234 | "CouponTotalText": "数量", 235 | "ItemPrice": "15.9", 236 | "MonthlySalesText": "月销量", 237 | "CouponEndTimeText": "结束时间", 238 | "ItemPriceText": "在售价", 239 | "QuanHouJiaText": "券后价", 240 | "CouponEndTime": "2018-02-28 11:59:59", 241 | "ItemName": "苹果5/5s防摔手机壳iPhoneX/7/8保护壳plus软胶6/6s套男女奢华皮", 242 | "CouponDenomination": "3.0" 243 | } 244 | ] 245 | data.forEach(function (coupon) { 246 | coupon.ZongHeBiLiText = parseInt(coupon.ZongHeBiLi * 100) + "%" 247 | // coupon.CouponEndTime = coupon.CouponEndTime.substring(0, 10) 248 | if (coupon.ItemName.length > 25) { 249 | coupon.SimpleName = coupon.ItemName.substring(0, 25) + "..." 250 | } else { 251 | coupon.SimpleName = coupon.ItemName 252 | } 253 | }) 254 | that.setData({ 255 | couponList: that.data.couponList.concat(data), 256 | isLoading: false 257 | }) 258 | // 在有服务端时使用 259 | // wx.request({ 260 | // url: "https://tuteng2345.applinzi.com/api/v1/search", 261 | // data: { 262 | // "sort": that.data.sort, 263 | // "q": that.data.inputContent, 264 | // "cate_id": that.data.selectCategory 265 | // }, 266 | // method: "GET", 267 | // success: function (resRequest) { 268 | // if (resRequest.statusCode === 200) { 269 | // if (resRequest.data != null && resRequest.data.errcode === 10000 && resRequest.data.data.length > 0) { 270 | // resRequest.data.data.forEach(function (coupon) { 271 | // coupon.ZongHeBiLiText = parseInt(coupon.ZongHeBiLi * 100) + "%" 272 | // // coupon.CouponEndTime = coupon.CouponEndTime.substring(0, 10) 273 | // if (coupon.ItemName.length > 25) { 274 | // coupon.SimpleName = coupon.ItemName.substring(0, 25) + "..." 275 | // } else { 276 | // coupon.SimpleName = coupon.ItemName 277 | // } 278 | // }) 279 | // that.setData({ 280 | // couponList: that.data.couponList.concat(resRequest.data.data), 281 | // isLoading: false 282 | // }) 283 | // } 284 | // else { 285 | // that.setData({ 286 | // isLoading: true, 287 | // loadOver: true 288 | // }) 289 | // } 290 | // } 291 | // } 292 | // }) 293 | }, 294 | handleZanTabChange(e) { 295 | var componentId = e.componentId; 296 | var selectedId = e.selectedId; 297 | if (componentId === "cate_method") { 298 | this.setData({ 299 | selectCategory: selectedId 300 | }) 301 | } 302 | if (componentId === "sort_method") { 303 | this.setData({ 304 | sort: selectedId 305 | }) 306 | } 307 | this.setData({ 308 | [`${componentId}.selectedId`]: selectedId, 309 | couponList: [], 310 | pageIndex: 0, 311 | }); 312 | this.getMoreCouponList() 313 | }, 314 | setCouponInfo: function (e) { 315 | wx.setStorageSync('couponInfo', this.data.couponList[e.currentTarget.dataset.index]) 316 | }, 317 | onPullDownRefresh: function () { 318 | this.setData({ 319 | couponList: [], 320 | loadOver: false, 321 | isLoading: true, 322 | pageIndex: 0 323 | }) 324 | wx.stopPullDownRefresh() 325 | this.getMoreCouponList() 326 | }, 327 | onReachBottom: function () { 328 | this.setData({ 329 | isLoading: true, 330 | loadOver: false, 331 | pageIndex: this.data.pageIndex + 1 332 | }) 333 | this.getMoreCouponList() 334 | }, 335 | inputTyping: function () { 336 | wx.navigateTo({ 337 | url: "../../pages/search/search", 338 | }) 339 | } 340 | })); 341 | -------------------------------------------------------------------------------- /pages/favour/favour.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/favour/favour.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | {{item.text}} 36 | 37 | 38 | 39 | 40 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | {{item.SimpleName}} 58 | 59 | 60 | 券后价¥{{item.QuanHouJia}} 61 | 现价¥{{item.ItemPrice}} 月销量{{item.MonthlySales}} 62 | 63 | 64 | 65 | 66 | 67 | ¥{{item.Jian}} 68 | 优惠券 69 | 查看详情 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /pages/favour/favour.wxss: -------------------------------------------------------------------------------- 1 | /* pages/favour/favour.wxss */ 2 | page { 3 | background: rgb(249, 249, 249); 4 | } 5 | .container { 6 | position: fixed; 7 | top: 0; 8 | z-index: 3; 9 | height: 42px; 10 | } 11 | .container .zan-tab__item { 12 | min-width: 40px !important; 13 | } 14 | .container .zan-tab__title { 15 | font-size: 11px !important; 16 | height: 42px !important; 17 | } 18 | .new-body { 19 | position: absolute; 20 | } 21 | .swiper-search { 22 | margin-top: 42px; 23 | height: 150px; 24 | position: relative; 25 | width: 100%; 26 | } 27 | .swiper { 28 | position: absolute; 29 | width: 100%; 30 | z-index: 1; 31 | } 32 | .search { 33 | position: absolute; 34 | z-index:2; 35 | width: 80%; 36 | margin-top: 15px; 37 | margin-left: 10%; 38 | } 39 | .weui-search-bar { 40 | padding: 0 !important; 41 | background-color: transparent !important; 42 | border-top: 0 !important; 43 | border-bottom: 0 !important; 44 | } 45 | .weui-search-bar__form { 46 | border-radius: 200px !important; 47 | } 48 | .menu { 49 | margin-top: 10px; 50 | height: 74px; 51 | width: 100%; 52 | } 53 | .section__title { 54 | font-size: 11px; 55 | text-align: center; 56 | width: 50px; 57 | color: #666; 58 | } 59 | .section__image { 60 | width: 50px; 61 | height: 50px; 62 | } 63 | .section__ctn { 64 | float:left; 65 | width: 25%; 66 | } 67 | .image-title { 68 | margin-left: 15px; 69 | } 70 | .tab-menu { 71 | margin-top: 5px; 72 | width: 100%; 73 | } 74 | .tab-menu .zan-tab__title { 75 | border-bottom: 0px !important; 76 | font-size: 11px !important; 77 | } 78 | .tab-menu .zan-tab__bd { 79 | border-top: 20rpx solid #e5e5e5 !important; 80 | border-bottom: 0 !important; 81 | background-color: rgb(249, 249, 249); 82 | } 83 | .card { 84 | border-top: 20rpx solid #e5e5e5 !important; 85 | background-color: rgb(249, 249, 249) !important; 86 | font-size: 11px; 87 | color: #666; 88 | } 89 | .zan-card { 90 | padding: 3px 3px !important; 91 | } 92 | .searchbar-result{ 93 | margin-top: 0; 94 | font-size: 14px; 95 | } 96 | .searchbar-result:before{ 97 | display: none; 98 | } 99 | .weui-cell{ 100 | padding: 12px 15px 12px 35px; 101 | } 102 | .slide-image { 103 | width: 100%; 104 | } 105 | .product-image { 106 | width: 78px; 107 | height: 78px; 108 | } 109 | .line { 110 | width: 2px; 111 | height: 79px; 112 | margin-left: 2px; 113 | border-left: 1px rgb(229, 229, 229) dotted; 114 | } 115 | .content { 116 | margin-left: 4px; 117 | } 118 | .content .zan-card__detail-row{ 119 | margin-bottom: 0px; 120 | } 121 | .coupon { 122 | margin-top: 10px; 123 | } 124 | .coupon-price { 125 | font-size: 20px 126 | } 127 | .coupon-price, .coupon-text, .coupon-info { 128 | text-align: center; 129 | } 130 | .coupon-info { 131 | color: red; 132 | } -------------------------------------------------------------------------------- /pages/search/search.js: -------------------------------------------------------------------------------- 1 | const { Tab, extend } = require('../../dist/index'); 2 | 3 | Page(extend({}, Tab,{ 4 | data: { 5 | inputShowed: false, 6 | showResult: false, 7 | inputVal: "", 8 | loading: false, 9 | nodata: true, 10 | nomore: false, 11 | couponList: [], 12 | sort_method: { 13 | list: [{ 14 | id: 'commission_rate_desc', 15 | title: '默认' 16 | }, { 17 | id: 'new', 18 | title: '最新' 19 | }, { 20 | id: 'sale_num', 21 | title: '销量' 22 | }, { 23 | id: 'price_asc', 24 | title: '价格' 25 | }, { 26 | id: 'commission_rate_descsign', 27 | title: '券额' 28 | }], 29 | selectedId: 'commission_rate_desc' 30 | }, 31 | }, 32 | onLoad: function (res) { 33 | this.setData({ 34 | inputVal: res.value 35 | }) 36 | }, 37 | showInput: function () { 38 | this.setData({ 39 | inputShowed: true 40 | }); 41 | }, 42 | inputTyping: function (e) { 43 | this.setData({ 44 | inputVal: e.detail.value 45 | }); 46 | }, 47 | searchData: function (e) { 48 | console.log(e.detail) 49 | this.setData({ 50 | nodata: false, 51 | loading: true, 52 | }) 53 | this.setData({ 54 | inputVal: e.detail.value, 55 | loading: false, 56 | showResult: true, 57 | couponList: [ 58 | { 59 | "ItemPic": "../../images/taobao.png", 60 | "ItemName": "test0", 61 | "QuanHouJia": 200, 62 | "ItemPrice": 300, 63 | "MonthlySales": 2000, 64 | "Jian": 100 65 | }, { 66 | "ItemPic": "../../images/taobao.png", 67 | "ItemName": "test1", 68 | "QuanHouJia": 200, 69 | "ItemPrice": 300, 70 | "MonthlySales": 2000, 71 | "Jian": 100 72 | }, { 73 | "ItemPic": "../../images/taobao.png", 74 | "ItemName": "test2", 75 | "QuanHouJia": 200, 76 | "ItemPrice": 300, 77 | "MonthlySales": 2000, 78 | "Jian": 100 79 | }, { 80 | "ItemPic": "../../images/taobao.png", 81 | "ItemName": "test", 82 | "QuanHouJia": 200, 83 | "ItemPrice": 300, 84 | "MonthlySales": 2000, 85 | "Jian": 100 86 | }, { 87 | "ItemPic": "../../images/taobao.png", 88 | "ItemName": "test", 89 | "QuanHouJia": 200, 90 | "ItemPrice": 300, 91 | "MonthlySales": 2000, 92 | "Jian": 100 93 | }, { 94 | "ItemPic": "../../images/taobao.png", 95 | "ItemName": "test", 96 | "QuanHouJia": 200, 97 | "ItemPrice": 300, 98 | "MonthlySales": 2000, 99 | "Jian": 100 100 | }, { 101 | "ItemPic": "../../images/taobao.png", 102 | "ItemName": "test", 103 | "QuanHouJia": 200, 104 | "ItemPrice": 300, 105 | "MonthlySales": 2000, 106 | "Jian": 100 107 | }, { 108 | "ItemPic": "../../images/taobao.png", 109 | "ItemName": "test", 110 | "QuanHouJia": 200, 111 | "ItemPrice": 300, 112 | "MonthlySales": 2000, 113 | "Jian": 100 114 | }, { 115 | "ItemPic": "../../images/taobao.png", 116 | "ItemName": "test", 117 | "QuanHouJia": 200, 118 | "ItemPrice": 300, 119 | "MonthlySales": 2000, 120 | "Jian": 100 121 | }, { 122 | "ItemPic": "../../images/taobao.png", 123 | "ItemName": "test", 124 | "QuanHouJia": 200, 125 | "ItemPrice": 300, 126 | "MonthlySales": 2000, 127 | "Jian": 100 128 | }] 129 | }) 130 | }, 131 | handleZanTabChange(e) { 132 | console.log(e) 133 | var componentId = e.componentId; 134 | var selectedId = e.selectedId; 135 | // if (componentId === "sort_method") { 136 | // this.setData({ 137 | // sort: selectedId 138 | // }) 139 | // } 140 | this.setData({ 141 | [`${componentId}.selectedId`]: selectedId, 142 | // couponList: [], 143 | // pageIndex: 0, 144 | }); 145 | }, 146 | })); 147 | -------------------------------------------------------------------------------- /pages/search/search.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /pages/search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 |