{"id":13755150,"url":"https://github.com/hss01248/wxTabs","last_synced_at":"2025-05-10T00:31:36.935Z","repository":{"id":119093874,"uuid":"78188182","full_name":"hss01248/wxTabs","owner":"hss01248","description":"tabs for wechat app 微信小程序的多tab实现,各tab页面状态独立","archived":false,"fork":false,"pushed_at":"2017-01-06T08:52:40.000Z","size":28,"stargazers_count":49,"open_issues_count":1,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-16T09:33:57.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hss01248.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-06T08:19:09.000Z","updated_at":"2022-03-15T05:44:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"8611d36d-3231-43ae-9e90-4823e681d453","html_url":"https://github.com/hss01248/wxTabs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hss01248%2FwxTabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hss01248%2FwxTabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hss01248%2FwxTabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hss01248%2FwxTabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hss01248","download_url":"https://codeload.github.com/hss01248/wxTabs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253346488,"owners_count":21894264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T10:00:47.440Z","updated_at":"2025-05-10T00:31:36.413Z","avatar_url":"https://github.com/hss01248.png","language":"JavaScript","funding_links":[],"categories":["UI组件"],"sub_categories":[],"readme":"# wxTabs\ntabs for wechat app\n\n\n\n# 特点:\n\n各页面状态(空白,错误,加载中)已自动处理\n\n页面下拉刷新和上拉加载更多的方法已实现,并封装在tabUtil中,无需在page中书写.\n\ntab之间的切换逻辑已处理.\n\n\n\n# 使用时需要做的:\n\n## 拷贝\n\nnetUtil.js拷贝到utils目录下\n\nlib文件夹拷贝到根目录下\n\n\n\n##  修改\n\n针对具体项目微调netUtil里的一些字段,比如将用于分批加载的pagesize和pageIndex改成自己网络请求里的相应字段.\n\ntab颜色和最小宽度,以及高度可在tabs.wxss里修改.\n\n## 使用(参考pages\\index)\n\n写每个页面的wxml和wxss,模板化,并在具体页面导入\n\n```\n\u003c!--tab标题--\u003e\n  \u003cimport src=\"../../lib/tab/tabs.wxml\"/\u003e\n  \u003cview  style=\"width: 100%\"\u003e\n    \u003ctemplate is=\"tabs\" data=\"{{...tabInfo}}\" /\u003e\n  \u003c/view\u003e\n\n  \u003c!--tab下方的listview--\u003e\n\n  \u003cimport src=\"../../lib/listview/albumlv.wxml\"/\u003e\n  \u003cblock wx:for-items=\"{{tabInfo.tabStrs}}\" wx:for-item=\"str\" wx:for-index=\"i\" wx:key=\"unique\"\u003e\n\n    \u003cview  wx:if=\"{{tabInfo.tabIndex == i}}\" style=\"width: 100%;height: 60%\"\u003e\n      \u003ctemplate is=\"albumlv\" data=\"{{...tabDatas[i]}}\" /\u003e\n    \u003c/view\u003e\n  \u003c/block\u003e\n```\n\n引入js:\n\n```\nvar netUtil=require(\"../../utils/netUtil.js\");\nvar tabUtil=require(\"../../lib/tab/tabUtil.js\");\nvar lvUtil=require(\"../../lib/tab/lvUtil.js\");\n```\n\n\n\n调用:\n\n```\n var tabStrs = [' ',' ','推荐','学业成绩','行为问题','亲子关系','人际关系','情绪困扰'];\n\n    tabUtil.initTab(that,tabStrs,2,function(i){\n      var params = {};\n      params.type=1;\n      params.labelIds =\"1,2,3,4,5\";\n      params.sourceType=0;\n      params.priceType=0;\n      params.categoryIds = i-2;\n      params.pageIndex = 1;\n      params.pageSize = 20;\n      var lvBean = lvUtil.initLv(that,API.Lesson.SEARCH,params,i,'',{\n        getListFromNetData:function(netData){\n          return netData;\n        },\n        handleItemInfo:function(item){\n          // utils.showVoiceItemPriceText(item);\n        }\n      });\n      return lvBean;\n    });\n```\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhss01248%2FwxTabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhss01248%2FwxTabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhss01248%2FwxTabs/lists"}