{"id":23105359,"url":"https://github.com/faurewu/iwepy","last_synced_at":"2025-08-16T16:33:20.745Z","repository":{"id":43161713,"uuid":"138576367","full_name":"FaureWu/iwepy","owner":"FaureWu","description":"一套基于wepy, iview-weapp, zoro的完整的小程序开发解决方案","archived":false,"fork":false,"pushed_at":"2022-12-10T19:46:17.000Z","size":1304,"stargazers_count":8,"open_issues_count":15,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-02T02:06:48.862Z","etag":null,"topics":["iview","redux","weapp","wepy","zoro"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FaureWu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-25T09:57:40.000Z","updated_at":"2019-11-11T15:56:32.000Z","dependencies_parsed_at":"2023-01-26T09:00:23.977Z","dependency_job_id":null,"html_url":"https://github.com/FaureWu/iwepy","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaureWu%2Fiwepy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaureWu%2Fiwepy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaureWu%2Fiwepy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaureWu%2Fiwepy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FaureWu","download_url":"https://codeload.github.com/FaureWu/iwepy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230045734,"owners_count":18164345,"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":["iview","redux","weapp","wepy","zoro"],"created_at":"2024-12-17T00:50:11.275Z","updated_at":"2024-12-17T00:50:12.036Z","avatar_url":"https://github.com/FaureWu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iwepy\n\n结合小程序框架[wepy](https://tencent.github.io/wepy/)，状态管理库[zoro](https://github.com/FaureWu/zoro)，ui组件库[iview](https://weapp.iviewui.com/?from=iview)，小程序开发解决方案\n\n## 启动开发环境\n\n### 安装依赖\n```bash\nyarn\n```\n\n### 启动dev环境\n```bash\nyarn dev\n```\n\n\u003e 你可以通过APP_ENV来配置开发环境链接不同的server服务器\n\n### 启动mock环境\n```bash\nyarn mock\n```\n\n\u003e mock环境下server会链接本地启动的mock服务器，也就是APP_ENV将会无效\n\n环境启动后，只需在微信开发者工具中，打开dist目录即可进行实时开发\n\n## 打包生产环境代码\n\n```bash\nyarn build\n```\n\ndist目录为最终发布目录\n\n## 如何配置不同环境下的server地址\n\n根目录下wepy.config.js文件中\n```js\nconst SERVER = {\n  dev: '',\n  prod: '',\n}\n```\n\n## 如何编写mock\n\n该项目引入[faker](https://github.com/Marak/faker.js)做为模拟数据生成器，具体写法参考[faker文档](https://github.com/Marak/faker.js)，及项目根目录下mock/demo.js\n\n## 如何编写model\n\n请查看src/models/下的使用演示，更多信息查看[zoro文档](https://github.com/FaureWu/zoro/blob/master/doc/API.md)\n\n## 如何发起请求\n\niwepy因为对wepy框架的request进行了一次封装，放于src/utils/request.js中，需要请求时请引入此工具代替\n\n提供了的api有:\n* request() 参数同wepy.request\n* get(url, params, options)\n* post(url, params, options)\n* delete(url, params, options)\n\n以上接口均支持冒号参数\n\n使用方法\n```js\nimport request from '@/utils/request'\n\nrequest.get('/api/product/:id', { id: 1 }).then(...)\n```\n\nmodel中使用请参考src/models/的文件\n\n## 如何使用iview库\n\n```js\nexport default class Index extends wepy.page {\n  config = {\n    navigationBarTitleText: 'wepy小程序演示',\n    usingComponents: {\n      // 这里需要填写相对路径，不可以使用别名\n      'i-panel': '../iview/panel/index',\n      'i-button': '../iview/button/index',\n      'i-spin': '../iview/spin/index',\n      'i-alert': '../iview/alert/index',\n    },\n  }\n```\n\n```html\n\u003ctemplate\u003e\n\u003ci-panel i-class=\"index-panel\" title=\"演示全局HTTP错误捕获\"\u003e\n  \u003ci-button @click=\"handleQueryHttpError\" type=\"primary\"\u003e点击演示http错误\u003c/i-button\u003e\n  \u003ci-spin fix wx:if=\"{{ loading.queryHttpError }}\" /\u003e\n\u003c/i-panel\u003e\n\u003c/template\u003e\n```\n相关组件参考iview文档，需要注意的是，替换iview中的事件为wepy的对应事件即可\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaurewu%2Fiwepy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaurewu%2Fiwepy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaurewu%2Fiwepy/lists"}