├── .gitignore ├── .hbuilderx └── launch.json ├── App.vue ├── README.md ├── components ├── applets-bind-userInfo │ └── applets-bind-userInfo.vue ├── date-popup │ └── date-popup.vue ├── jyf-parser │ ├── jyf-parser.vue │ └── libs │ │ ├── CssHandler.js │ │ ├── MpHtmlParser.js │ │ ├── config.js │ │ ├── handler.sjs │ │ ├── handler.wxs │ │ └── trees.vue └── public-module │ └── public-module.vue ├── config ├── baseUrl.js ├── componentConfig.js ├── html5Utils.js ├── login.js ├── requestConfig.js ├── socket.js └── utils.js ├── main.js ├── manifest.json ├── pages.json ├── pages ├── home │ ├── home.vue │ ├── template.vue │ └── webView.vue ├── my │ └── my.vue ├── order │ └── order.vue ├── shopCar │ └── shopCar.vue └── user │ ├── bindPhone.vue │ ├── forget.vue │ ├── login.vue │ ├── protocol.vue │ └── register.vue ├── plugins ├── imageTools.js ├── md5.js ├── permission.js ├── utils.js └── wxJsSDK.js ├── static ├── icon │ ├── WeChatIcon.png │ ├── bindingIcon.png │ ├── ic_agreed.png │ ├── ic_gender_selected.png │ ├── ic_gender_unselected.png │ ├── ic_login_ios.png │ ├── ic_login_weixin.png │ ├── ic_logon_display.png │ ├── ic_logon_hide.png │ ├── ic_upload.png │ ├── icon_weixuanzhong.png │ ├── icon_xiajiantou.png │ ├── me_lise_more.png │ ├── tab │ │ ├── icon_TA.png │ │ ├── icon_TA_c.png │ │ ├── icon_home.png │ │ ├── icon_home_c.png │ │ ├── icon_wode.png │ │ ├── icon_wode_c.png │ │ ├── icon_xiaoxi.png │ │ └── icon_xiaoxi_c.png │ └── wechat.png └── mp-h5 │ └── jweixin-1.4.0.js ├── store ├── index.js └── modules │ ├── common.js │ ├── order.js │ ├── user.js │ └── video.js ├── style ├── common.scss ├── input.scss └── mixin.scss ├── template.h5.html ├── uni.scss ├── uni_modules ├── multiple-choice │ ├── changelog.md │ ├── components │ │ └── multiple-choice │ │ │ └── multiple-choice.vue │ ├── package.json │ └── readme.md ├── z-address-popup │ ├── changelog.md │ ├── components │ │ └── z-address-popup │ │ │ └── z-address-popup.vue │ ├── package.json │ └── readme.md ├── z-address │ ├── changelog.md │ ├── components │ │ └── z-address │ │ │ └── z-address.vue │ ├── package.json │ └── readme.md ├── z-loading │ ├── changelog.md │ ├── components │ │ └── z-loading │ │ │ └── z-loading.vue │ ├── package.json │ └── readme.md ├── z-nav-bar │ ├── changelog.md │ ├── components │ │ └── z-nav-bar │ │ │ └── z-nav-bar.vue │ ├── package.json │ ├── readme.md │ └── static │ │ ├── icon_back_black.png │ │ ├── icon_back_white.png │ │ ├── icon_home_black.png │ │ └── icon_home_white.png ├── z-paging │ ├── changelog.md │ ├── components │ │ ├── z-paging-empty-view │ │ │ └── z-paging-empty-view.vue │ │ ├── z-paging-swiper-item │ │ │ └── z-paging-swiper-item.vue │ │ ├── z-paging-swiper │ │ │ └── z-paging-swiper.vue │ │ └── z-paging │ │ │ ├── components │ │ │ ├── z-paging-load-more.vue │ │ │ └── z-paging-refresh.vue │ │ │ ├── css │ │ │ ├── z-paging-main.css │ │ │ └── z-paging-static.css │ │ │ ├── js │ │ │ ├── z-paging-config.js │ │ │ ├── z-paging-i18n.js │ │ │ ├── z-paging-main.js │ │ │ ├── z-paging-mixin.js │ │ │ ├── z-paging-static.js │ │ │ └── z-paging-utils.js │ │ │ ├── wxs │ │ │ ├── z-paging-refresh.wxs │ │ │ ├── z-paging-renderjs.js │ │ │ └── z-paging-wxs.wxs │ │ │ ├── z-paging-load-more.vue │ │ │ ├── z-paging-mixin.js │ │ │ ├── z-paging-refresh.vue │ │ │ ├── z-paging-refresh.wxs │ │ │ ├── z-paging-static.css │ │ │ ├── z-paging-static.js │ │ │ └── z-paging.vue │ ├── package.json │ └── readme.md ├── z-popup │ ├── changelog.md │ ├── components │ │ └── z-popup │ │ │ └── z-popup.vue │ ├── package.json │ └── readme.md ├── z-prompt │ ├── changelog.md │ ├── components │ │ └── z-prompt │ │ │ └── z-prompt.vue │ ├── package.json │ └── readme.md ├── z-swipe-action │ ├── README.md │ ├── changelog.md │ ├── components │ │ └── z-swipe-action │ │ │ └── z-swipe-action.vue │ ├── index.vue │ └── package.json ├── zhouWei-APPUpdate │ ├── changelog.md │ ├── js_sdk │ │ └── appUpdate.js │ ├── package.json │ ├── readme.md │ └── static │ │ └── ic_ar.png ├── zhouWei-APPshare │ ├── changelog.md │ ├── js_sdk │ │ └── appShare.js │ ├── package.json │ ├── readme.md │ └── static │ │ ├── ic_xiaochengxu.png │ │ ├── icon_QQkongjian.png │ │ ├── icon_copy.png │ │ ├── icon_more.png │ │ ├── icon_pengyouquan.png │ │ ├── icon_qq.png │ │ ├── icon_weibo.png │ │ └── icon_weixin.png └── zhouWei-request │ ├── changelog.md │ ├── js_sdk │ ├── request │ │ ├── core │ │ │ ├── request.js │ │ │ └── utils.js │ │ ├── index.js │ │ ├── request.md │ │ └── upload │ │ │ ├── Base64.js │ │ │ ├── aliUploader.js │ │ │ ├── crypto.js │ │ │ ├── hmac.js │ │ │ ├── qiniuUploader.js │ │ │ ├── sha1.js │ │ │ ├── upload.js │ │ │ └── utils.js │ └── requestConfig.js │ ├── package.json │ └── readme.md └── 项目资料.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | unpackage/dist 4 | unpackage/release 5 | unpackage/cache 6 | /dist 7 | vue.config 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # Editor directories and files 19 | .idea 20 | .vscode 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw* 26 | -------------------------------------------------------------------------------- /.hbuilderx/launch.json: -------------------------------------------------------------------------------- 1 | { // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ 2 | // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 3 | "version": "0.0", 4 | "configurations": [{ 5 | "default" : 6 | { 7 | "launchtype" : "local" 8 | }, 9 | "h5" : 10 | { 11 | "launchtype" : "local" 12 | }, 13 | "type" : "uniCloud" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /App.vue: -------------------------------------------------------------------------------- 1 | 84 | 85 | 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # uni-app项目模板(不喜勿喷) 2 | > 一个5年的web前端开源的uni-app快速开发模板,参考学习一同进步 3 | > 建议uni-app使用时间达到1年以上的程序员来学习 4 | 5 | ### 使用步骤 6 | 1. 下载下来,解压成文件夹 7 | 2. 把项目包丢到HBuilder X里面 8 | 3. HBuilder X要安装scss/sass编译插件 9 | 4. 运行项目 10 | 11 | ### `觉得不错,给个5星好评吧` 12 | 13 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 14 | | ----------------------------|--------------------------- | 15 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 16 | | QQ群号:607391225 |微信号:zhou0612wei| 17 | 18 | ### `开源不易,需要花费很多精力,打个赏吧` 19 | | `微信打赏码` | `支付宝打赏码` | 20 | | ----------------------------|--------------------------- | 21 | |![微信打赏二维码](http://qn.kemean.cn/upload/202006/17/15923814750253qjayobp.png)|![支付宝打赏二维码](http://qn.kemean.cn/upload/202006/17/1592381515304aezjp7h3.jpg)| 22 | 23 | ### 常见问题 24 | 1.怎么登录,没有账号?, 25 | 26 | 答:自己注册账号登录,本地运行请先修改接口环境 27 | 28 | 2.下载到本地运行,接口不能调用报错? 29 | 30 | 答:在`config => baseUrl.js`文件里面`开发环境`的`baseUrl`和`socketUrl`域名设置为`https://twin-ui.com/`和`wss://twin-ui.com:6001/` 31 | 32 | 33 | ### [H5预览地址](https://twin-ui.com/uniappDemo/index.html) 34 | ### [安卓APP安装包下载地址(最新版)](http://qn.kemean.cn/upload/202104/14/16183932977309iisprxe.apk) 35 | ### [Demo版GitHub地址](https://github.com/zhouwei1994/uni-app-demo) 36 | ### [空项目模板GitHub地址(开发用这个)](https://github.com/zhouwei1994/uni-app-template) 37 | --- 38 | ### [后台管理地址(进入链接后点击案例预览)](https://twin-ui.com) 39 | 40 | ## 架构功能清单 41 | ### 组件示例 42 | 1. 瀑布流列表 43 | 2. 防抖音滑动视频(带进度加载) 44 | 3. 项目主题色介绍 45 | 4. 头部导航示例 46 | 5. 上拉加载,下拉刷新列表 47 | 6. 地区选择 48 | 7. 弹窗输入框 49 | 8. 滑动操作 50 | 9. 富文本编译 51 | 52 | ### SDK示例 53 | 1. 接口请求 54 | 2. APP版本更新 55 | 3. 支付 56 | 4. 分享 57 | 5. 小程序登录 58 | 6. 公众号登录 59 | 7. 登录拦截 60 | 8. 获取当前位置 61 | 9. 图片上传/文件上传 62 | 10. 七牛云图片上传/文件上传 63 | 11. 保存图片到相册 64 | 12. webSocket封装介绍 65 | 13. 公众号SDK 66 | 14. APP权限判断和跳转到系统设置 67 | 15. 常用工具 68 | 69 | ### 模板页面 70 | 1. 登录 71 | 2. 注册 72 | 3. 忘记密码 73 | 4. 绑定手机号 74 | 5. 协议 75 | 76 | ### 项目结构 77 | 78 | ``` bash 79 | ├── components // 组件 80 | │   ├── common // 公共组件 81 | │   └── module // 项目组件 82 | ├── config // 配置 // vuex主文件 83 | │   ├── baseUrl.js // 项目配置 84 | │   ├── html5Utils.js // H5相关的功能(公众号支付、公众号登录) 85 | │   ├── login.js // 小程序登录js代码部分和登录拦截器代码 86 | │   ├── requestConfig.js // 接口请求配置 87 | │   ├── socket.js // webSocket相关代码 88 | │   └── utils.js // 项目相关工具(公众号分享、小程序分享数据处理、支付、获取经纬度、支付分配) 89 | ├── pages // 项目页面 90 | ├── plugins // 公共SDK(基本上不需要改) 91 | │   ├── APPUpdate // APP版本更新 92 | │   ├── request // 接口请求封装 93 | │   ├── share // APP分享 94 | │   ├── md5.js // md5加密 95 | │   ├── permission.js // APP权限判断和打开手机系统设置 96 | │   ├── utils.js // 工具(时间转换、APP和小程序获取经纬度代码) 97 | │   └── wxJsSDK.js // 微信公众号SDK去权限获取页面 98 | ├── static // 公共文件 99 | │   ├── demo // 本项目相关的图片(可删除) 100 | │   ├── icon // 项目图标 101 | │   ├── mp-h5 // H5第三方包(公众号JS-SDK) 102 | │   ├── mp-weixin // 微信小程序第三方包 103 | │   ├── share // 分享SDK的图标 104 | │   └── zhouWei-navBar // 导航组件的图标 105 | ├── store // vuex商店 106 | │ ├── modules // vuex分类 107 | │ │ ├── common.js // vuex通用数据管理 108 | │ │ ├── user.js // vuex用户数据管理 109 | │   │ └── order.js // vuex订单数据管理 110 | │   └── index.js // vuex方法集合 111 | ├── style 112 | │ ├── common.scss // 公共样式文件 113 | │ ├── input.scss // 公共表单样式 114 | │ ├── mixin.scss // 样式配置文件 115 | │ └── table.scss // 本项目相关的css(可删除) 116 | ├── unpackage // 项目编译后的文件 117 | ├── App.vue // 项目主界面 118 | ├── main.js // 程序入口文件,加载各种公共组件 119 | ├── manifest.json // uni-app项目类型及环境配置 120 | ├── pages.json // 项目路由及项目界面配置 121 | ├── README.md // 项目介绍文件 122 | └── template.h5.html // 项目发布的时候使用的文件 123 | ``` 124 | -------------------------------------------------------------------------------- /components/applets-bind-userInfo/applets-bind-userInfo.vue: -------------------------------------------------------------------------------- 1 | 15 | 59 | 60 | 117 | -------------------------------------------------------------------------------- /components/jyf-parser/libs/CssHandler.js: -------------------------------------------------------------------------------- 1 | var cfg = require('./config.js'), 2 | isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); 3 | class CssHandler { 4 | constructor(tagStyle) { 5 | var styles = Object.assign({}, cfg.userAgentStyles); 6 | for (var item in tagStyle) 7 | styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item]; 8 | this.styles = styles; 9 | } 10 | getStyle(data) { 11 | this.styles = new CssParser(data, this.styles).parse(); 12 | } 13 | match(name, attrs) { 14 | var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : ''; 15 | if (attrs.class) { 16 | var items = attrs.class.split(' '); 17 | for (var i = 0, item; item = items[i]; i++) 18 | if (tmp = this.styles['.' + item]) 19 | matched += tmp + ';'; 20 | } 21 | if (tmp = this.styles['#' + attrs.id]) 22 | matched += tmp + ';'; 23 | return matched; 24 | } 25 | } 26 | module.exports = CssHandler; 27 | class CssParser { 28 | constructor(data, init) { 29 | this.data = data; 30 | this.floor = 0; 31 | this.i = 0; 32 | this.list = []; 33 | this.res = init; 34 | this.state = this.Space; 35 | } 36 | parse() { 37 | for (var c; c = this.data[this.i]; this.i++) 38 | this.state(c); 39 | return this.res; 40 | } 41 | section() { 42 | return this.data.substring(this.start, this.i); 43 | } 44 | // 状态机 45 | Space(c) { 46 | if (c == '.' || c == '#' || isLetter(c)) { 47 | this.start = this.i; 48 | this.state = this.Name; 49 | } else if (c == '/' && this.data[this.i + 1] == '*') 50 | this.Comment(); 51 | else if (!cfg.blankChar[c] && c != ';') 52 | this.state = this.Ignore; 53 | } 54 | Comment() { 55 | this.i = this.data.indexOf('*/', this.i) + 1; 56 | if (!this.i) this.i = this.data.length; 57 | this.state = this.Space; 58 | } 59 | Ignore(c) { 60 | if (c == '{') this.floor++; 61 | else if (c == '}' && !--this.floor) this.state = this.Space; 62 | } 63 | Name(c) { 64 | if (cfg.blankChar[c]) { 65 | this.list.push(this.section()); 66 | this.state = this.NameSpace; 67 | } else if (c == '{') { 68 | this.list.push(this.section()); 69 | this.Content(); 70 | } else if (c == ',') { 71 | this.list.push(this.section()); 72 | this.Comma(); 73 | } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_') 74 | this.state = this.Ignore; 75 | } 76 | NameSpace(c) { 77 | if (c == '{') this.Content(); 78 | else if (c == ',') this.Comma(); 79 | else if (!cfg.blankChar[c]) this.state = this.Ignore; 80 | } 81 | Comma() { 82 | while (cfg.blankChar[this.data[++this.i]]); 83 | if (this.data[this.i] == '{') this.Content(); 84 | else { 85 | this.start = this.i--; 86 | this.state = this.Name; 87 | } 88 | } 89 | Content() { 90 | this.start = ++this.i; 91 | if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length; 92 | var content = this.section(); 93 | for (var i = 0, item; item = this.list[i++];) 94 | if (this.res[item]) this.res[item] += ';' + content; 95 | else this.res[item] = content; 96 | this.list = []; 97 | this.state = this.Space; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /components/jyf-parser/libs/config.js: -------------------------------------------------------------------------------- 1 | /* 配置文件 */ 2 | // #ifdef MP-WEIXIN 3 | const canIUse = wx.canIUse('editor'); // 高基础库标识,用于兼容 4 | // #endif 5 | module.exports = { 6 | // 过滤器函数 7 | filter: null, 8 | // 代码高亮函数 9 | highlight: null, 10 | // 文本处理函数 11 | onText: null, 12 | // 实体编码列表 13 | entities: { 14 | quot: '"', 15 | apos: "'", 16 | semi: ';', 17 | nbsp: '\xA0', 18 | ensp: '\u2002', 19 | emsp: '\u2003', 20 | ndash: '–', 21 | mdash: '—', 22 | middot: '·', 23 | lsquo: '‘', 24 | rsquo: '’', 25 | ldquo: '“', 26 | rdquo: '”', 27 | bull: '•', 28 | hellip: '…' 29 | }, 30 | blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'), 31 | // 块级标签,将被转为 div 32 | blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,section' + ( 33 | // #ifdef MP-WEIXIN 34 | canIUse ? '' : 35 | // #endif 36 | ',pre')), 37 | // 将被移除的标签 38 | ignoreTags: makeMap( 39 | 'area,base,basefont,canvas,command,frame,input,isindex,keygen,link,map,meta,param,script,source,style,svg,textarea,title,track,use,wbr' 40 | // #ifdef MP-WEIXIN 41 | + (canIUse ? ',rp' : '') 42 | // #endif 43 | // #ifndef APP-PLUS 44 | + ',embed,iframe' 45 | // #endif 46 | ), 47 | // 只能被 rich-text 显示的标签 48 | richOnlyTags: makeMap('a,colgroup,fieldset,legend,picture,table' 49 | // #ifdef MP-WEIXIN 50 | + (canIUse ? ',bdi,bdo,caption,rt,ruby' : '') 51 | // #endif 52 | ), 53 | // 自闭合的标签 54 | selfClosingTags: makeMap( 55 | 'area,base,basefont,br,col,circle,ellipse,embed,frame,hr,img,input,isindex,keygen,line,link,meta,param,path,polygon,rect,source,track,use,wbr' 56 | ), 57 | // 信任的属性 58 | trustAttrs: makeMap( 59 | 'align,alt,app-id,author,autoplay,border,cellpadding,cellspacing,class,color,colspan,controls,data-src,dir,face,height,href,id,ignore,loop,media,muted,name,path,poster,rowspan,size,span,src,start,style,type,unit-id,width,xmlns' 60 | ), 61 | // bool 型的属性 62 | boolAttrs: makeMap('autoplay,controls,ignore,loop,muted'), 63 | // 信任的标签 64 | trustTags: makeMap( 65 | 'a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video' 66 | // #ifdef MP-WEIXIN 67 | + (canIUse ? ',bdi,bdo,caption,pre,rt,ruby' : '') 68 | // #endif 69 | // #ifdef APP-PLUS 70 | + ',embed,iframe' 71 | // #endif 72 | ), 73 | // 默认的标签样式 74 | userAgentStyles: { 75 | address: 'font-style:italic', 76 | big: 'display:inline;font-size:1.2em', 77 | blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px', 78 | caption: 'display:table-caption;text-align:center', 79 | center: 'text-align:center', 80 | cite: 'font-style:italic', 81 | dd: 'margin-left:40px', 82 | mark: 'background-color:yellow', 83 | pre: 'font-family:monospace;white-space:pre;overflow:scroll', 84 | s: 'text-decoration:line-through', 85 | small: 'display:inline;font-size:0.8em', 86 | u: 'text-decoration:underline' 87 | } 88 | } 89 | 90 | function makeMap(str) { 91 | var map = {}, 92 | list = str.split(','); 93 | for (var i = list.length; i--;) 94 | map[list[i]] = true; 95 | return map; 96 | } 97 | -------------------------------------------------------------------------------- /components/jyf-parser/libs/handler.sjs: -------------------------------------------------------------------------------- 1 | var inlineTags = { 2 | abbr: 1, 3 | b: 1, 4 | big: 1, 5 | code: 1, 6 | del: 1, 7 | em: 1, 8 | i: 1, 9 | ins: 1, 10 | label: 1, 11 | q: 1, 12 | small: 1, 13 | span: 1, 14 | strong: 1 15 | } 16 | export default { 17 | useRichText: function(item) { 18 | return !item.c && !inlineTags[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /components/jyf-parser/libs/handler.wxs: -------------------------------------------------------------------------------- 1 | var inlineTags = { 2 | abbr: 1, 3 | b: 1, 4 | big: 1, 5 | code: 1, 6 | del: 1, 7 | em: 1, 8 | i: 1, 9 | ins: 1, 10 | label: 1, 11 | q: 1, 12 | small: 1, 13 | span: 1, 14 | strong: 1 15 | } 16 | module.exports = { 17 | useRichText: function(item) { 18 | return !item.c && !inlineTags[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /components/public-module/public-module.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/baseUrl.js: -------------------------------------------------------------------------------- 1 | let baseUrl = ""; 2 | let socketUrl = ""; 3 | if (process.env.NODE_ENV === 'development') { 4 | // 开发环境 5 | // baseUrl = "http://localhost:7001/"; 6 | // socketUrl = "ws://localhost:6001/"; 7 | baseUrl = "https://twin-ui.com/demo/"; 8 | // socketUrl = "ws://8.129.186.35:6001/"; 9 | } else if (process.env.NODE_ENV === 'production') { 10 | // 生产环境 11 | baseUrl = "https://twin-ui.com/demo/"; 12 | // socketUrl = "ws://twin-ui.com:6001/"; 13 | } 14 | const courtConfig = { 15 | //微信公众号APPID 16 | publicAppId: "", 17 | //请求接口 18 | baseUrl: baseUrl, 19 | //webSocket地址 20 | socketUrl: socketUrl, 21 | //平台名称 22 | platformName: "uniApp-案例", 23 | //项目logo 24 | logoUrl: "https://qn.kemean.cn/upload/201906/19/3f3b4751f3ed4a97be804450c3ec4c79", 25 | //页面分享配置 26 | share: { 27 | title: 'uniApp-案例', 28 | // #ifdef MP-WEIXIN 29 | path: '/pages/home/home', //小程序分享路径 30 | // #endif 31 | // #ifdef H5 || APP-PLUS 32 | //公众号||APP分享 33 | desc: "uniApp-案例", // 分享描述 34 | link: "https://www.kemean.com/sameCity/18031201/index.html", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 35 | imgUrl: "http://qn.kemean.cn/upload/201901/28/23bedfc34597482292ecd6dc107f6342", // 分享图标 36 | // #endif 37 | } 38 | }; 39 | //手机号验证正则表达式 40 | const phoneRegular = /^1\d{10}$/; 41 | //邮箱验证正则表达式 42 | const mailRegular = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/; 43 | //密码验证正则表达式 44 | const passwordRegular = /^[a-zA-Z0-9]{4,10}$/; 45 | export default Object.assign({ 46 | phoneRegular, 47 | mailRegular, 48 | passwordRegular 49 | }, courtConfig); 50 | -------------------------------------------------------------------------------- /config/componentConfig.js: -------------------------------------------------------------------------------- 1 | import $http from '@/config/requestConfig' 2 | const platform = uni.getSystemInfoSync().platform; 3 | export default { 4 | /****************以下是z-nav-bar插件配置*******************/ 5 | // 主页页面的页面路径 6 | // 关联功能:打开的页面只有一个的时候右上角自动显示返回首页按钮,下面这个数组是排除显示返回首页的页面。 7 | // 主页使用场景:小程序分享出去的页面,用户点击开是分享页面,很多情况下是没有返回首页按钮的 8 | mainPagePath: ['pages/home/home', 'pages/my/my', 'pages/order/order', 'pages/shopCar/shopCar'], 9 | //返回首页的地址 10 | homePath: '/pages/home/home', 11 | 12 | /****************以下是zhouWei-APPUpdate插件配置*******************/ 13 | // 发起ajax请求获取服务端版本号 14 | getServerNo: (version, isPrompt = false, callback) => { 15 | let httpData = { 16 | version: version.versionCode, 17 | // 版本名称 18 | versionName: version.versionName, 19 | }; 20 | if (platform == "android") { 21 | httpData.type = 1101; 22 | } else { 23 | httpData.type = 1102; 24 | } 25 | /* 接口入参说明 26 | * version: 应用当前版本号(已自动获取) 27 | * versionName: 应用当前版本名称(已自动获取) 28 | * type:平台(1101是安卓,1102是IOS) 29 | */ 30 | /****************以下是示例*******************/ 31 | // 可以用自己项目的请求方法 32 | $http.get("api/common/v1/app_version", httpData,{ 33 | isPrompt: isPrompt 34 | }).then(res => { 35 | /* res的数据说明 36 | * | 参数名称 | 一定返回 | 类型 | 描述 37 | * | -------------|--------- | --------- | ------------- | 38 | * | versionCode | y | int | 版本号 | 39 | * | versionName | y | String | 版本名称 | 40 | * | versionInfo | y | String | 版本信息 | 41 | * | updateType | y | String | forcibly = 强制更新, solicit = 弹窗确认更新, silent = 静默更新 | 42 | * | downloadUrl | y | String | 版本下载链接(IOS安装包更新请放跳转store应用商店链接,安卓apk和wgt文件放文件下载链接) | 43 | */ 44 | if (res && res.downloadUrl) { 45 | // 判断用户是不是从设置页面点击的更新,如果是设置页面点击的更新,无视接口给的更新类型,强制修改为弹窗确认更新 46 | if(isPrompt){ 47 | res.updateType = "solicit"; 48 | } 49 | // 兼容之前的版本(updateType是新版才有的参数) 50 | if(res.updateType){ 51 | callback && callback(res); 52 | } else { 53 | if(res.forceUpdate){ 54 | res.updateType = "forcibly"; 55 | } else { 56 | res.updateType = "solicit"; 57 | } 58 | callback && callback(res); 59 | } 60 | } else if (isPrompt) { 61 | uni.showToast({ 62 | title: "暂无新版本", 63 | icon: "none" 64 | }); 65 | } 66 | }); 67 | /****************以上是示例*******************/ 68 | }, 69 | // 弹窗主颜色(不填默认粉色) 70 | appUpdateColor: "f00", 71 | // 弹窗图标(不填显示默认图标,链接配置示例如: '/static/demo/ic_attention.png') 72 | appUpdateIcon: '' 73 | } -------------------------------------------------------------------------------- /config/login.js: -------------------------------------------------------------------------------- 1 | import store from '@/store'; 2 | import $http from '@/config/requestConfig' 3 | import base from '@/config/baseUrl'; 4 | // #ifdef H5 5 | import { h5Login } from '@/config/html5Utils'; 6 | // #endif 7 | let code = ""; 8 | let loginStart = true; 9 | let userInfo = { 10 | token: "" 11 | }; 12 | let lastPageUrl = ""; 13 | // 微信小程序登录 14 | function onLogin(type = "judge",callback) { 15 | //判断登录状态 16 | if (loginStart) { 17 | loginStart = false; 18 | const _this = this; 19 | let platform; 20 | // #ifdef MP-WEIXIN 21 | platform = 'weixin'; 22 | // #endif 23 | // #ifdef MP-ALIPAY 24 | platform = 'alipay'; 25 | // #endif 26 | // #ifdef MP-BAIDU 27 | platform = 'baidu'; 28 | // #endif 29 | uni.login({ 30 | provider: platform, 31 | success: function(loginRes) { 32 | if (loginRes.errMsg == 'login:ok') { 33 | // 获取用户信息 34 | uni.getUserInfo({ 35 | provider: platform, 36 | success: function(infoRes) { 37 | let httpData = { 38 | wxSmallCode: loginRes.code, //小程序code 39 | iv: infoRes.iv, //小程序加密算法的初始向量 40 | encryptedData: infoRes.encryptedData //包括敏感数据在内的完整用户信息的加密数据 41 | }; 42 | // store.state.chatScenesInfo里面是小程序二维码附带的信息 43 | if(store.state.chatScenesInfo.invite){ 44 | // 推荐码 45 | httpData.invite = store.state.chatScenesInfo.invite; 46 | } 47 | $http.post('api/open/v1/login', httpData).then(res => { 48 | loginStart = true; 49 | store.commit('setUserInfo', res); 50 | callback && callback(); 51 | if (res.nullUserInfo) { 52 | // 没有绑定过微信的头像或者昵称弹出授权获取头像昵称的弹窗 53 | store.commit('setBindUserInfoShow', true); 54 | } else { 55 | uni.showToast({ 56 | title: "登录成功" 57 | }); 58 | } 59 | }, err => { 60 | loginStart = true; 61 | }); 62 | } 63 | }); 64 | } 65 | } 66 | }); 67 | } 68 | } 69 | //判断是否登录(所有端) 70 | function judgeLogin(callback, type = "judge"){ 71 | if(store.state.chatScenesInfo.scene == 1154){ 72 | uni.showToast({ 73 | title: '请前往小程序使用完整服务', 74 | icon: "none" 75 | }); 76 | } else { 77 | let storeUserInfo = store.state.userInfo; 78 | if(!storeUserInfo.token){ // nvue页面读取不到vuex里面数据,将取缓存 79 | storeUserInfo = uni.getStorageSync("userInfo"); 80 | } 81 | if (type != "force" && storeUserInfo.token) { 82 | callback(); 83 | } else if (storeUserInfo.token && !storeUserInfo.phone) { 84 | if (type == "force") { 85 | uni.navigateTo({ 86 | url: '/pages/user/bindPhone' 87 | }); 88 | } else { 89 | uni.showModal({ 90 | title: "提示", 91 | content: "您还未绑定手机号,请先绑定~", 92 | confirmText: "去绑定", 93 | cancelText: "再逛会", 94 | success: (res) => { 95 | if (res.confirm) { 96 | uni.navigateTo({ 97 | url: '/pages/user/bindPhone' 98 | }); 99 | } 100 | } 101 | }); 102 | } 103 | } else { 104 | // #ifdef MP 105 | onLogin(type, callback); 106 | // #endif 107 | // #ifdef APP-PLUS 108 | uni.showModal({ 109 | title: "登录提示", 110 | content: "此时此刻需要您登录喔~", 111 | confirmText: "去登录", 112 | cancelText: "再逛会", 113 | success: (res) => { 114 | if (res.confirm) { 115 | uni.navigateTo({ 116 | url: "/pages/user/login" 117 | }); 118 | } 119 | } 120 | }); 121 | // #endif 122 | // #ifdef H5 123 | h5Login(type, () => { 124 | callback(); 125 | }); 126 | // #endif 127 | } 128 | } 129 | } 130 | export { 131 | onLogin, 132 | judgeLogin 133 | } 134 | -------------------------------------------------------------------------------- /config/socket.js: -------------------------------------------------------------------------------- 1 | import base from '@/config/baseUrl'; 2 | import store from '@/store'; 3 | class socket { 4 | constructor(options) { 5 | //地址 6 | this.socketUrl = base.socketUrl; 7 | this.socketStart = false; 8 | this.monitorSocketError(); 9 | this.monitorSocketClose(); 10 | this.socketReceive(); 11 | } 12 | init(callback) { 13 | const _this = this; 14 | if (base.socketUrl) { 15 | if(this.socketStart){ 16 | console.log('webSocket已经启动了'); 17 | }else{ 18 | uni.connectSocket({ 19 | url: this.socketUrl, 20 | method: 'GET' 21 | }); 22 | uni.onSocketOpen((res) => { 23 | this.socketStart = true; 24 | callback && callback(); 25 | console.log('WebSocket连接已打开!'); 26 | }); 27 | setTimeout(() => { 28 | _this.getHeartbeat(); 29 | }, 5000); 30 | } 31 | }else{ 32 | console.log('config/baseUrl socketUrl为空'); 33 | } 34 | } 35 | //Socket给服务器发送消息 36 | send(data, callback) { 37 | const _this = this; 38 | if (store.state.userInfo.uid) { 39 | data.userUid = store.state.userInfo.uid; 40 | } 41 | console.log(data); 42 | uni.sendSocketMessage({ 43 | data: JSON.stringify(data), 44 | success: () => { 45 | callback && callback(true); 46 | }, 47 | fail: () => { 48 | callback && callback(false); 49 | } 50 | }); 51 | } 52 | //Socket接收服务器发送过来的消息 53 | socketReceive() { 54 | const _this = this; 55 | uni.onSocketMessage(function(res) { 56 | let data = JSON.parse(res.data); 57 | console.log('收到服务器内容:', data); 58 | _this.acceptMessage && _this.acceptMessage(data); 59 | }); 60 | } 61 | //关闭Socket 62 | closeSocket() { 63 | uni.closeSocket(); 64 | _this.socketStart = false; 65 | } 66 | //监听Socket关闭 67 | monitorSocketClose() { 68 | const _this = this; 69 | uni.onSocketClose(function(res) { 70 | console.log('WebSocket 已关闭!'); 71 | _this.socketStart = false; 72 | setTimeout(function() { 73 | _this.init(); 74 | }, 3000); 75 | }); 76 | } 77 | //监听Socket错误 78 | monitorSocketError() { 79 | const _this = this; 80 | uni.onSocketError(function(res) { 81 | _this.socketStart = false; 82 | console.log('WebSocket连接打开失败,请检查!'); 83 | }); 84 | } 85 | //心跳 86 | getHeartbeat() { 87 | const _this = this; 88 | this.send({ 89 | type: "心跳", 90 | userUid: store.state.userInfo.userUid 91 | }, (val) => { 92 | setTimeout(() => { 93 | if (val) { 94 | _this.getHeartbeat(); 95 | } else { 96 | _this.init(); 97 | } 98 | }, 10000); 99 | }); 100 | } 101 | }; 102 | const mySocket = new socket(); 103 | export default mySocket; 104 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | //数据管理中心 4 | import store from '@/store' 5 | Vue.prototype.$store = store; 6 | // 工具 7 | import '@/plugins/utils.js'; 8 | //权限配置中心 9 | import base from '@/config/baseUrl' 10 | Vue.prototype.$base = base; 11 | //挂载全局http请求 12 | import $http from '@/config/requestConfig' 13 | Vue.prototype.$http = $http; 14 | // #ifdef MP-WEIXIN 15 | //挂载全局微信分享 16 | import { wxShare } from '@/config/utils' 17 | Vue.prototype.wxShare = wxShare; 18 | // #endif 19 | //判断是否登录 20 | import { judgeLogin } from '@/config/login'; 21 | Vue.prototype.judgeLogin = judgeLogin; 22 | Vue.config.productionTip = false; 23 | // #ifdef H5 24 | //微信SDK 25 | import '@/plugins/wxJsSDK.js'; 26 | // #endif 27 | //全局组件 28 | App.mpType = 'app' 29 | 30 | const app = new Vue({ 31 | store, 32 | ...App 33 | }) 34 | app.$mount(); -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "uniApp-案例", 3 | "appid" : "__UNI__uniProject", 4 | "description" : "uniApp-案例", 5 | "transformPx" : false, 6 | "icons" : [ 7 | { 8 | "sizes" : "分辨率,192x192", 9 | "src" : "图片路径" 10 | } 11 | ], 12 | "versionName" : "1.2.0", 13 | "versionCode" : 120, 14 | "app-plus" : { 15 | "compatible" : { 16 | "ignoreVersion" : true 17 | }, 18 | "privacy" : { 19 | "prompt" : "template", 20 | "template" : { 21 | "title" : "用户协议和隐私政策", 22 | "message" : "请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
  你可阅读《用户协议》《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。", 23 | "buttonAccept" : "同意", 24 | "buttonRefuse" : "暂不同意" 25 | } 26 | }, 27 | "modules" : { 28 | "Payment" : {}, 29 | "OAuth" : {}, 30 | "Messaging" : {}, 31 | "VideoPlayer" : {}, 32 | "Share" : {} 33 | }, 34 | "distribute" : { 35 | "android" : { 36 | "permissionPhoneState" : { 37 | "request" : "none", 38 | "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。" 39 | }, 40 | "permissionExternalStorage" : { 41 | "request" : "none", 42 | "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" 43 | }, 44 | "permissions" : [ 45 | "", 46 | "", 47 | "", 48 | "", 49 | "", 50 | "", 51 | "", 52 | "", 53 | "", 54 | "", 55 | "", 56 | "", 57 | "", 58 | "", 59 | "", 60 | "", 61 | "", 62 | "", 63 | "", 64 | "", 65 | "", 66 | "", 67 | "", 68 | "", 69 | "" 70 | ], 71 | "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ] 72 | }, 73 | "sdkConfigs" : { 74 | "ad" : {}, 75 | "maps" : {}, 76 | "share" : {} 77 | }, 78 | "splashscreen" : { 79 | "iosStyle" : "storyboard", 80 | "androidStyle" : "common" 81 | } 82 | }, 83 | "compilerVersion" : 3, 84 | "nvueLaunchMode" : "fast" 85 | }, 86 | // 5+App特有相关 87 | "quickapp" : {}, 88 | // 快应用特有相关 89 | "mp-weixin" : { 90 | "setting" : { 91 | "urlCheck" : false, 92 | "es6" : true, 93 | "postcss" : true, 94 | "minified" : true 95 | }, 96 | "usingComponents" : true, 97 | "appid" : "wx4277c1145515b274", 98 | "permission" : { 99 | "scope.userLocation" : { 100 | "desc" : "你的位置信息将用于小程序位置接口的效果展示" 101 | } 102 | } 103 | }, 104 | "h5" : { 105 | "template" : "template.h5.html", 106 | "router" : { 107 | "mode" : "hash", 108 | "base" : "/uniappDemo/" 109 | }, 110 | "optimization" : { 111 | "treeShaking" : { 112 | "enable" : true 113 | } 114 | } 115 | } 116 | } 117 | // 小程序特有相关 118 | 119 | -------------------------------------------------------------------------------- /pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | { 4 | "path": "pages/home/home", 5 | "style": { 6 | "navigationBarTitleText": "首页" 7 | } 8 | }, 9 | { 10 | "path": "pages/home/webView", 11 | "style": { 12 | "navigationBarTitleText": "", 13 | "navigationStyle": "default" 14 | } 15 | }, 16 | { 17 | "path": "pages/user/bindPhone", 18 | "style": { 19 | "navigationBarTitleText": "绑定手机号" 20 | } 21 | }, 22 | { 23 | "path": "pages/user/forget", 24 | "style": { 25 | "navigationBarTitleText": "忘记密码" 26 | } 27 | }, 28 | { 29 | "path": "pages/user/protocol", 30 | "style": { 31 | "navigationBarTitleText": "协议" 32 | } 33 | }, 34 | { 35 | "path": "pages/user/register", 36 | "style": { 37 | "navigationBarTitleText": "注册" 38 | } 39 | }, 40 | { 41 | "path": "pages/user/login", 42 | "style": { 43 | "navigationBarTitleText": "登录" 44 | } 45 | }, 46 | { 47 | "path" : "pages/my/my", 48 | "style" : 49 | { 50 | "navigationBarTitleText": "我的", 51 | "enablePullDownRefresh": false 52 | } 53 | 54 | } 55 | ,{ 56 | "path" : "pages/shopCar/shopCar", 57 | "style" : 58 | { 59 | "navigationBarTitleText": "购物车", 60 | "enablePullDownRefresh": false 61 | } 62 | 63 | } 64 | ,{ 65 | "path" : "pages/order/order", 66 | "style" : 67 | { 68 | "navigationBarTitleText": "订单", 69 | "enablePullDownRefresh": false 70 | } 71 | 72 | } 73 | ], 74 | "globalStyle": { 75 | "navigationBarTextStyle": "black", 76 | "navigationBarTitleText": "uni-app", 77 | "navigationBarBackgroundColor": "#FFFFFF", 78 | "backgroundColor": "#FFFFFF", 79 | "navigationStyle": "custom" 80 | }, 81 | "tabBar": { 82 | "color": "#444444", 83 | "selectedColor": "#FF80AB", 84 | "borderStyle": "black", 85 | "backgroundColor": "#ffffff", 86 | "list": [{ 87 | "pagePath": "pages/home/home", 88 | "iconPath": "static/icon/tab/icon_home.png", 89 | "selectedIconPath": "static/icon/tab/icon_home_c.png", 90 | "text": "首页" 91 | }, 92 | { 93 | "pagePath": "pages/shopCar/shopCar", 94 | "iconPath": "static/icon/tab/icon_wode.png", 95 | "selectedIconPath": "static/icon/tab/icon_wode_c.png", 96 | "text": "购物车" 97 | }, 98 | { 99 | "pagePath": "pages/order/order", 100 | "iconPath": "static/icon/tab/icon_xiaoxi.png", 101 | "selectedIconPath": "static/icon/tab/icon_xiaoxi_c.png", 102 | "text": "订单" 103 | }, 104 | { 105 | "pagePath": "pages/my/my", 106 | "iconPath": "static/icon/tab/icon_xiaoxi.png", 107 | "selectedIconPath": "static/icon/tab/icon_xiaoxi_c.png", 108 | "text": "我的" 109 | } 110 | ] 111 | }, 112 | "condition": { //模式配置,仅开发期间生效 113 | "current": 0, //当前激活的模式(list 的索引项) 114 | "list": [{ 115 | "name": "", //模式名称 116 | "path": "", //启动页面,必选 117 | "query": "" //启动参数,在页面的onLoad函数里面得到 118 | }] 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /pages/home/home.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 93 | 141 | -------------------------------------------------------------------------------- /pages/home/template.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | 29 | -------------------------------------------------------------------------------- /pages/home/webView.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 36 | 39 | -------------------------------------------------------------------------------- /pages/my/my.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 40 | 43 | -------------------------------------------------------------------------------- /pages/order/order.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 40 | 43 | -------------------------------------------------------------------------------- /pages/shopCar/shopCar.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 40 | 43 | -------------------------------------------------------------------------------- /pages/user/forget.vue: -------------------------------------------------------------------------------- 1 | 17 | 166 | 221 | -------------------------------------------------------------------------------- /pages/user/protocol.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 61 | 74 | -------------------------------------------------------------------------------- /plugins/imageTools.js: -------------------------------------------------------------------------------- 1 | function getLocalFilePath(path) { 2 | if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) { 3 | return path 4 | } 5 | if (path.indexOf('file://') === 0) { 6 | return path 7 | } 8 | if (path.indexOf('/storage/emulated/0/') === 0) { 9 | return path 10 | } 11 | if (path.indexOf('/') === 0) { 12 | var localFilePath = plus.io.convertAbsoluteFileSystem(path) 13 | if (localFilePath !== path) { 14 | return localFilePath 15 | } else { 16 | path = path.substr(1) 17 | } 18 | } 19 | return '_www/' + path 20 | } 21 | 22 | export function pathToBase64(path) { 23 | return new Promise(function(resolve, reject) { 24 | if (typeof window === 'object' && 'document' in window) { 25 | var canvas = document.createElement('canvas') 26 | var c2x = canvas.getContext('2d') 27 | var img = new Image 28 | img.onload = function() { 29 | canvas.width = img.width 30 | canvas.height = img.height 31 | c2x.drawImage(img, 0, 0) 32 | resolve(canvas.toDataURL()) 33 | } 34 | img.onerror = reject 35 | img.src = path 36 | return 37 | } 38 | if (typeof plus === 'object') { 39 | plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) { 40 | entry.file(function(file) { 41 | var fileReader = new plus.io.FileReader() 42 | fileReader.onload = function(data) { 43 | resolve(data.target.result) 44 | } 45 | fileReader.onerror = function(error) { 46 | reject(error) 47 | } 48 | fileReader.readAsDataURL(file) 49 | }, function(error) { 50 | reject(error) 51 | }) 52 | }, function(error) { 53 | reject(error) 54 | }) 55 | return 56 | } 57 | if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { 58 | wx.getFileSystemManager().readFile({ 59 | filePath: path, 60 | encoding: 'base64', 61 | success: function(res) { 62 | resolve('data:image/png;base64,' + res.data) 63 | }, 64 | fail: function(error) { 65 | reject(error) 66 | } 67 | }) 68 | return 69 | } 70 | reject(new Error('not support')) 71 | }) 72 | } 73 | 74 | export function base64ToPath(base64) { 75 | return new Promise(function(resolve, reject) { 76 | if (typeof window === 'object' && 'document' in window) { 77 | base64 = base64.split(',') 78 | var type = base64[0].match(/:(.*?);/)[1] 79 | var str = atob(base64[1]) 80 | var n = str.length 81 | var array = new Uint8Array(n) 82 | while (n--) { 83 | array[n] = str.charCodeAt(n) 84 | } 85 | return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type }))) 86 | } 87 | var extName = base64.match(/data\:\S+\/(\S+);/) 88 | if (extName) { 89 | extName = extName[1] 90 | } else { 91 | reject(new Error('base64 error')) 92 | } 93 | var fileName = Date.now() + '.' + extName 94 | if (typeof plus === 'object') { 95 | var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) 96 | bitmap.loadBase64Data(base64, function() { 97 | var filePath = '_doc/uniapp_temp/' + fileName 98 | bitmap.save(filePath, {}, function() { 99 | bitmap.clear() 100 | resolve(filePath) 101 | }, function(error) { 102 | bitmap.clear() 103 | reject(error) 104 | }) 105 | }, function(error) { 106 | bitmap.clear() 107 | reject(error) 108 | }) 109 | return 110 | } 111 | if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { 112 | var filePath = wx.env.USER_DATA_PATH + '/' + fileName 113 | wx.getFileSystemManager().writeFile({ 114 | filePath: filePath, 115 | data: base64.replace(/^data:\S+\/\S+;base64,/, ''), 116 | encoding: 'base64', 117 | success: function() { 118 | resolve(filePath) 119 | }, 120 | fail: function(error) { 121 | reject(error) 122 | } 123 | }) 124 | return 125 | } 126 | reject(new Error('not support')) 127 | }) 128 | } -------------------------------------------------------------------------------- /plugins/wxJsSDK.js: -------------------------------------------------------------------------------- 1 | // 获取微信公众号SDK权限 2 | //接口请求方法 3 | import $http from '@/config/requestConfig'; 4 | import base from '@/config/baseUrl'; 5 | import { publicShareFun } from '@/config/html5Utils'; 6 | //获取地理位置 7 | export const getLocation = () => { 8 | return new Promise((resolve, reject) => { 9 | //配置校验成功后执行 10 | jWeixin.ready(function () { 11 | // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。 12 | jWeixin.getLocation({ 13 | type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' 14 | success: function (res) { 15 | console.log(res); 16 | resolve(res); 17 | }, 18 | fail: (err) => { 19 | reject(err); 20 | } 21 | }); 22 | }); 23 | }); 24 | } 25 | //设置分享信息 26 | export const setShare = (data, callback) => { 27 | //配置校验成功后执行 28 | jWeixin.ready(function () { 29 | if (!data.link) { 30 | let url = window.location.href; 31 | let index = url.indexOf("?"); 32 | if (index != -1) { 33 | if (url.indexOf("#") != -1 && url.indexOf("#") > index) { 34 | url = url.substring(0, index) + url.substring(url.indexOf("#")); 35 | } else { 36 | url = url.substr(0, index); 37 | } 38 | } 39 | data.link = url; 40 | } 41 | // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。 42 | jWeixin.updateAppMessageShareData({ 43 | title: data.title, // 分享标题 44 | desc: data.desc, // 分享描述 45 | link: data.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 46 | imgUrl: data.imgUrl, // 分享图标 47 | success: function () { 48 | // 设置成功 49 | callback && callback(); 50 | } 51 | }); 52 | jWeixin.updateTimelineShareData({ 53 | title: data.title, // 分享标题 54 | link: data.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 55 | imgUrl: data.imgUrl, // 分享图标 56 | success: function () { 57 | // 设置成功 58 | callback && callback(); 59 | } 60 | }); 61 | }); 62 | } 63 | //微信扫一扫 64 | export const scanQRCode = ( callback,needResult = 0) => { 65 | //配置校验成功后执行 66 | jWeixin.ready(function () { 67 | jWeixin.scanQRCode({ 68 | needResult: needResult, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, 69 | scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有 70 | success: function (res) { 71 | callback && callback(res); 72 | } 73 | }); 74 | }); 75 | } 76 | window.onload = function () { 77 | // 配置文件里面没有publicAppId将不激活微信SDK功能 78 | if (!base.publicAppId) { 79 | return; 80 | } 81 | //获取当前页面地址 82 | let url = window.location.href; 83 | url = url.substring(0, url.indexOf("#")); 84 | //获取微信公众号SDK权限的签名、随机数、时间戳 85 | $http.post("api/open/signature", { 86 | url: url 87 | }).then(res => { 88 | // 微信SDK配置 89 | jWeixin.config({ 90 | debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 91 | appId: base.publicAppId, // 必填,公众号的唯一标识 92 | timestamp: res.timestamp, // 必填,生成签名的时间戳 93 | nonceStr: res.noncestr, // 必填,生成签名的随机串 94 | signature: res.signature,// 必填,签名 95 | jsApiList: [ 96 | "getLocation", 97 | "updateAppMessageShareData", 98 | "updateTimelineShareData", 99 | 'onMenuShareAppMessage', //旧的接口,即将废弃 100 | 'onMenuShareTimeline' //旧的接口,即将废弃 101 | ] // 必填,需要使用的JS接口列表 102 | }); 103 | //设置分享内容 104 | publicShareFun(); 105 | }); 106 | //配置校验失败后执行 107 | jWeixin.error(function (res) { 108 | // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 109 | console.log(res); 110 | }); 111 | }; -------------------------------------------------------------------------------- /static/icon/WeChatIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/WeChatIcon.png -------------------------------------------------------------------------------- /static/icon/bindingIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/bindingIcon.png -------------------------------------------------------------------------------- /static/icon/ic_agreed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_agreed.png -------------------------------------------------------------------------------- /static/icon/ic_gender_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_gender_selected.png -------------------------------------------------------------------------------- /static/icon/ic_gender_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_gender_unselected.png -------------------------------------------------------------------------------- /static/icon/ic_login_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_login_ios.png -------------------------------------------------------------------------------- /static/icon/ic_login_weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_login_weixin.png -------------------------------------------------------------------------------- /static/icon/ic_logon_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_logon_display.png -------------------------------------------------------------------------------- /static/icon/ic_logon_hide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_logon_hide.png -------------------------------------------------------------------------------- /static/icon/ic_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/ic_upload.png -------------------------------------------------------------------------------- /static/icon/icon_weixuanzhong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/icon_weixuanzhong.png -------------------------------------------------------------------------------- /static/icon/icon_xiajiantou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/icon_xiajiantou.png -------------------------------------------------------------------------------- /static/icon/me_lise_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/me_lise_more.png -------------------------------------------------------------------------------- /static/icon/tab/icon_TA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_TA.png -------------------------------------------------------------------------------- /static/icon/tab/icon_TA_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_TA_c.png -------------------------------------------------------------------------------- /static/icon/tab/icon_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_home.png -------------------------------------------------------------------------------- /static/icon/tab/icon_home_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_home_c.png -------------------------------------------------------------------------------- /static/icon/tab/icon_wode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_wode.png -------------------------------------------------------------------------------- /static/icon/tab/icon_wode_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_wode_c.png -------------------------------------------------------------------------------- /static/icon/tab/icon_xiaoxi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_xiaoxi.png -------------------------------------------------------------------------------- /static/icon/tab/icon_xiaoxi_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/tab/icon_xiaoxi_c.png -------------------------------------------------------------------------------- /static/icon/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/static/icon/wechat.png -------------------------------------------------------------------------------- /store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Vuex from "vuex"; 3 | 4 | Vue.use(Vuex); 5 | const files = require.context("./modules", false, /\.js$/); 6 | let modules = { 7 | state: {}, 8 | mutations: {}, 9 | actions: {} 10 | }; 11 | 12 | files.keys().forEach((key) => { 13 | Object.assign(modules.state, files(key)["state"]); 14 | Object.assign(modules.mutations, files(key)["mutations"]); 15 | Object.assign(modules.actions, files(key)["actions"]); 16 | }); 17 | const store = new Vuex.Store(modules); 18 | export default store; 19 | 20 | -------------------------------------------------------------------------------- /store/modules/common.js: -------------------------------------------------------------------------------- 1 | export const state = { 2 | //webView地址 3 | webViewUrl: "", 4 | loadingShow: false, 5 | //微信场景参数 6 | chatScenesInfo: {}, 7 | //绑定微信头像昵称弹窗状态 8 | bindUserInfoShow: false, 9 | //当前位置 10 | currentAddress: { 11 | areaName: "请选择", 12 | areaId: '' 13 | }, 14 | }; 15 | //缓存浏览器的数据名称 16 | const cacheNameList = ["userInfo", "webViewUrl"]; 17 | let clearTime; 18 | export const mutations = { 19 | //取出缓存数据(打开APP就取出) 20 | setCacheData(state) { 21 | for (let name of cacheNameList) { 22 | let data; 23 | // #ifndef H5 24 | data = uni.getStorageSync(name); 25 | // #endif 26 | // #ifdef H5 27 | data = sessionStorage.getItem(name) || localStorage.getItem(name); 28 | // #endif 29 | if (data) { 30 | // #ifdef H5 31 | try { 32 | data = JSON.parse(data); 33 | } catch (e) { 34 | } 35 | // #endif 36 | state[name] = data; 37 | } 38 | } 39 | }, 40 | //WebView地址 41 | setWebViewUrl(state, data) { 42 | if (data) { 43 | state.webViewUrl = data; 44 | // #ifdef H5 45 | window.sessionStorage.setItem('webViewUrl', data); 46 | // #endif 47 | } 48 | }, 49 | //数据加载状态 50 | setLoadingShow(state, data) { 51 | if(state.loadingShow){ 52 | if(data){ 53 | clearTime && clearTimeout(clearTime); 54 | clearTime = setTimeout(function(){ 55 | state.loadingShow = false; 56 | },5000); 57 | } else { 58 | clearTime && clearTimeout(clearTime); 59 | clearTime = setTimeout(function(){ 60 | state.loadingShow = false; 61 | },50); 62 | } 63 | } else { 64 | state.loadingShow = data; 65 | } 66 | }, 67 | //微信场景参数 68 | setChatScenesInfo(state, data) { 69 | if (data) { 70 | state.chatScenesInfo = Object.assign({}, state.chatScenesInfo, data); 71 | } 72 | }, 73 | //绑定微信头像昵称弹窗状态 74 | setBindUserInfoShow(state, data) { 75 | state.bindUserInfoShow = data; 76 | }, 77 | //当前地址 78 | setCurrentAddress(state, data) { 79 | if (data) { 80 | state.currentAddress = Object.assign(state.currentAddress, data); 81 | let addressInfo = { 82 | "provinceId": state.currentAddress.provinceId, 83 | "provinceName": state.currentAddress.provinceName, 84 | "cityId": state.currentAddress.cityId, 85 | "cityName": state.currentAddress.cityName, 86 | "areaId": state.currentAddress.areaId, 87 | "areaName": state.currentAddress.areaName, 88 | }; 89 | uni.setStorageSync('currentAddress', addressInfo); 90 | } 91 | } 92 | }; 93 | export const actions = { 94 | 95 | }; 96 | -------------------------------------------------------------------------------- /store/modules/order.js: -------------------------------------------------------------------------------- 1 | export const state = { 2 | 3 | }; 4 | export const mutations = { 5 | 6 | }; 7 | export const actions = { 8 | 9 | }; 10 | -------------------------------------------------------------------------------- /store/modules/user.js: -------------------------------------------------------------------------------- 1 | export const state = { 2 | //用户数据 3 | userInfo: {}, 4 | }; 5 | export const mutations = { 6 | //储存用户信息 7 | setUserInfo(state, data) { 8 | if (data) { 9 | state.userInfo = Object.assign({}, state.userInfo,data); 10 | // #ifdef H5 11 | window.sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo)); 12 | // #endif 13 | // #ifndef H5 14 | uni.setStorageSync('userInfo', state.userInfo); 15 | // #endif 16 | } 17 | }, 18 | // 退出APP 19 | emptyUserInfo(state) { 20 | state.userInfo = {}; 21 | // #ifdef H5 22 | window.sessionStorage.removeItem("userInfo"); 23 | // #endif 24 | // #ifndef H5 25 | uni.removeStorageSync("userInfo"); 26 | // #endif 27 | }, 28 | }; 29 | export const actions = { 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /store/modules/video.js: -------------------------------------------------------------------------------- 1 | export const state = { 2 | videoPlayId: "" 3 | }; 4 | export const mutations = { 5 | setVideoPlayId(state, data){ 6 | state.videoPlayId = data; 7 | } 8 | }; 9 | export const actions = { 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /style/common.scss: -------------------------------------------------------------------------------- 1 | @import '@/style/mixin.scss'; 2 | view, 3 | page, 4 | text, 5 | button, 6 | image, 7 | textarea, 8 | scroll-view,input { 9 | box-sizing: border-box; 10 | } 11 | image { 12 | display: block; 13 | } 14 | button { 15 | margin: 0; 16 | padding: 0; 17 | background-color: #FFFF; 18 | } 19 | button::after { 20 | border: none; 21 | } 22 | // 主题背景色 23 | .themeBgColor { 24 | background-color: $themeColor; 25 | } 26 | // 主题字体色 27 | .themeFontColor { 28 | color: $themeColor !important; 29 | } -------------------------------------------------------------------------------- /style/mixin.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | //主题色 3 | $themeColor: #ea552d; 4 | 5 | @mixin theme($type,$path:''){ 6 | @if $type == "btn_bg" { 7 | background-image: linear-gradient(90deg, #ea552d 0%, #f19837 100%); 8 | } @else if $type == "unselected_img" { 9 | background-image: url($path + "static/icon/ic_gender_unselected.png"); 10 | } @else if $type == "check_img" { 11 | background-image: url($path + "static/icon/ic_agreed.png"); 12 | } @else if $type == "radio_img" { 13 | background-image: url($path + "static/icon/ic_gender_selected.png"); 14 | } 15 | } 16 | // 背景图片地址和大小 17 | @mixin bis($url, $size: cover) { 18 | background-image: url($url); 19 | background-repeat: no-repeat; 20 | background-position: center center; 21 | background-size: $size; 22 | } 23 | 24 | // 头像 25 | @mixin ic($width, $height) { 26 | display: flex; 27 | align-items: center; 28 | justify-content: center; 29 | overflow: hidden; 30 | flex-shrink: 0; 31 | width: $width; 32 | height: $height; 33 | } 34 | 35 | // 单行省略号 36 | @mixin toe() { 37 | overflow: hidden; 38 | text-overflow: ellipsis; 39 | white-space: nowrap 40 | } 41 | 42 | // 多行省略号 43 | @mixin bov($num:2) { 44 | overflow: hidden; 45 | text-overflow: ellipsis; 46 | display: -webkit-box; 47 | -webkit-line-clamp: $num; 48 | -webkit-box-orient: vertical; 49 | } 50 | -------------------------------------------------------------------------------- /template.h5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /uni.scss: -------------------------------------------------------------------------------- 1 | /* 颜色变量 */ 2 | 3 | /* 行为相关颜色 */ 4 | $uni-color-primary: #007aff; 5 | $uni-color-success: #4cd964; 6 | $uni-color-warning: #f0ad4e; 7 | $uni-color-error: #dd524d; 8 | 9 | /* 文字基本颜色 */ 10 | $uni-text-color:#333;//基本色 11 | $uni-text-color-inverse:#fff;//反色 12 | $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 13 | $uni-text-color-placeholder: #808080; 14 | $uni-text-color-disable:#c0c0c0; 15 | 16 | /* 背景颜色 */ 17 | $uni-bg-color:#ffffff; 18 | $uni-bg-color-grey:#f8f8f8; 19 | $uni-bg-color-hover:#f1f1f1;//点击状态颜色 20 | $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 21 | 22 | /* 边框颜色 */ 23 | $uni-border-color:#c8c7cc; 24 | 25 | /* 尺寸变量 */ 26 | 27 | /* 文字尺寸 */ 28 | $uni-font-size-sm:24upx; 29 | $uni-font-size-base:28upx; 30 | $uni-font-size-lg:32upx; 31 | 32 | /* 图片尺寸 */ 33 | $uni-img-size-sm:40upx; 34 | $uni-img-size-base:52upx; 35 | $uni-img-size-lg:80upx; 36 | 37 | /* Border Radius */ 38 | $uni-border-radius-sm: 4upx; 39 | $uni-border-radius-base: 6upx; 40 | $uni-border-radius-lg: 12upx; 41 | $uni-border-radius-circle: 50%; 42 | 43 | /* 水平间距 */ 44 | $uni-spacing-row-sm: 10px; 45 | $uni-spacing-row-base: 20upx; 46 | $uni-spacing-row-lg: 30upx; 47 | 48 | /* 垂直间距 */ 49 | $uni-spacing-col-sm: 8upx; 50 | $uni-spacing-col-base: 16upx; 51 | $uni-spacing-col-lg: 24upx; 52 | 53 | /* 透明度 */ 54 | $uni-opacity-disabled: 0.3; // 组件禁用态的透明度 55 | 56 | /* 文章场景相关 */ 57 | $uni-color-title: #2C405A; // 文章标题颜色 58 | $uni-font-size-title:40upx; 59 | $uni-color-subtitle: #555555; // 二级标题颜色 60 | $uni-font-size-subtitle:36upx; 61 | $uni-color-paragraph: #3F536E; // 文章段落颜色 62 | $uni-font-size-paragraph:30upx; -------------------------------------------------------------------------------- /uni_modules/multiple-choice/changelog.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/multiple-choice/components/multiple-choice/multiple-choice.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 108 | 109 | 186 | -------------------------------------------------------------------------------- /uni_modules/multiple-choice/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "multiple-choice", 3 | "displayName": "多选组件", 4 | "version": "1.0.0", 5 | "description": "多选组件", 6 | "keywords": [ 7 | "多选", 8 | "多选组件" 9 | ], 10 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 11 | "engines": { 12 | "HBuilderX": "^3.0.0" 13 | }, 14 | "dcloudext": { 15 | "category": [ 16 | "前端组件", 17 | "通用组件" 18 | ], 19 | "sale": { 20 | "regular": { 21 | "price": "0.00" 22 | }, 23 | "sourcecode": { 24 | "price": "0.00" 25 | } 26 | }, 27 | "contact": { 28 | "qq": "465081029" 29 | }, 30 | "declaration": { 31 | "ads": "无", 32 | "data": "无", 33 | "permissions": "无" 34 | }, 35 | "npmurl": "" 36 | }, 37 | "uni_modules": { 38 | "dependencies": [], 39 | "encrypt": [], 40 | "platforms": { 41 | "cloud": { 42 | "tcb": "y", 43 | "aliyun": "y" 44 | }, 45 | "client": { 46 | "App": { 47 | "app-vue": "y", 48 | "app-nvue": "y" 49 | }, 50 | "H5-mobile": { 51 | "Safari": "y", 52 | "Android Browser": "y", 53 | "微信浏览器(Android)": "y", 54 | "QQ浏览器(Android)": "y" 55 | }, 56 | "H5-pc": { 57 | "Chrome": "y", 58 | "IE": "y", 59 | "Edge": "y", 60 | "Firefox": "y", 61 | "Safari": "y" 62 | }, 63 | "小程序": { 64 | "微信": "y", 65 | "阿里": "y", 66 | "百度": "y", 67 | "字节跳动": "y", 68 | "QQ": "y" 69 | }, 70 | "快应用": { 71 | "华为": "u", 72 | "联盟": "u" 73 | } 74 | } 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /uni_modules/multiple-choice/readme.md: -------------------------------------------------------------------------------- 1 | # 多选组件 2 | 3 | 多选组件 4 | 5 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 6 | | ----------------------------|--------------------------- | 7 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 8 | | QQ群号:607391225 |微信号:zhou0612wei| 9 | 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 案例一 13 | ``` 14 | 15 | ``` 16 | ### 案例二 17 | ``` 18 | 19 | 20 | 21 | ``` 22 | 23 | ### 属性 24 | | 名称 | 类型 | 默认值 | 描述 | 25 | | ----------------------------|--------------- | ------------- | ---------------------------------------------------| 26 | | value | Boolean | false | 控制弹窗是否打开 | 27 | | title | String | | 弹窗标题| 28 | | range | Array | [] | 可选内容 | 29 | | rangeKey | String | name | 显示内容的key| -------------------------------------------------------------------------------- /uni_modules/z-address-popup/changelog.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/z-address-popup/components/z-address-popup/z-address-popup.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 81 | 82 | 109 | -------------------------------------------------------------------------------- /uni_modules/z-address-popup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-address", 3 | "displayName": "三级联动弹窗,地址选择弹窗,可选长度", 4 | "version": "1.0.0", 5 | "description": "三级联动,地址选择,可选长度", 6 | "keywords": [ 7 | "三级联动弹窗", 8 | "地址选择弹窗", 9 | "地区选择弹窗" 10 | ], 11 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 12 | "engines": { 13 | "HBuilderX": "^3.0.0" 14 | }, 15 | "dcloudext": { 16 | "category": [ 17 | "前端组件", 18 | "通用组件" 19 | ], 20 | "sale": { 21 | "regular": { 22 | "price": "0.00" 23 | }, 24 | "sourcecode": { 25 | "price": "0.00" 26 | } 27 | }, 28 | "contact": { 29 | "qq": "465081029" 30 | }, 31 | "declaration": { 32 | "ads": "无", 33 | "data": "无", 34 | "permissions": "无" 35 | }, 36 | "npmurl": "" 37 | }, 38 | "uni_modules": { 39 | "dependencies": [], 40 | "encrypt": [], 41 | "platforms": { 42 | "cloud": { 43 | "tcb": "y", 44 | "aliyun": "y" 45 | }, 46 | "client": { 47 | "App": { 48 | "app-vue": "y", 49 | "app-nvue": "y" 50 | }, 51 | "H5-mobile": { 52 | "Safari": "y", 53 | "Android Browser": "y", 54 | "微信浏览器(Android)": "y", 55 | "QQ浏览器(Android)": "y" 56 | }, 57 | "H5-pc": { 58 | "Chrome": "y", 59 | "IE": "y", 60 | "Edge": "y", 61 | "Firefox": "y", 62 | "Safari": "y" 63 | }, 64 | "小程序": { 65 | "微信": "y", 66 | "阿里": "y", 67 | "百度": "y", 68 | "字节跳动": "y", 69 | "QQ": "y" 70 | }, 71 | "快应用": { 72 | "华为": "u", 73 | "联盟": "u" 74 | } 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /uni_modules/z-address-popup/readme.md: -------------------------------------------------------------------------------- 1 | # 三级联动弹窗,地址选择弹窗,可选长度 2 | 3 | 三级联动弹窗,地址选择弹窗,可选长度 4 | 5 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 6 | | ----------------------------|--------------------------- | 7 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 8 | | QQ群号:607391225 |微信号:zhou0612wei| 9 | 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 案例一 13 | ``` 14 | 15 | ``` 16 | 17 | ### 属性 18 | | 名称 | 类型 | 默认值 | 描述 | 19 | | ----------------------------|--------------- | ------------- | ---------------------------------------------------| 20 | | dataList | Array | [] | 默认值| 21 | | length | Number | 3 | 地区选择长度(1-3) | 22 | | force | Boolean | true | 强制选择,选择长度必须达到指定长度| 23 | | value | Boolean | false | 控制弹窗是否打开 | 24 | 25 | ### 事件 26 | | 名称 | 类型 | 描述 | 27 | | -----------------|------------------ | --------------------------| 28 | | @change | function | 选择时数据返回 | 29 | -------------------------------------------------------------------------------- /uni_modules/z-address/changelog.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/z-address/components/z-address/z-address.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 132 | 133 | 176 | -------------------------------------------------------------------------------- /uni_modules/z-address/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-address", 3 | "displayName": "三级联动,地址选择,可选长度", 4 | "version": "1.0.0", 5 | "description": "三级联动,地址选择,可选长度", 6 | "keywords": [ 7 | "三级联动", 8 | "地址选择", 9 | "地区选择" 10 | ], 11 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 12 | "engines": { 13 | "HBuilderX": "^3.0.0" 14 | }, 15 | "dcloudext": { 16 | "category": [ 17 | "前端组件", 18 | "通用组件" 19 | ], 20 | "sale": { 21 | "regular": { 22 | "price": "0.00" 23 | }, 24 | "sourcecode": { 25 | "price": "0.00" 26 | } 27 | }, 28 | "contact": { 29 | "qq": "465081029" 30 | }, 31 | "declaration": { 32 | "ads": "无", 33 | "data": "无", 34 | "permissions": "无" 35 | }, 36 | "npmurl": "" 37 | }, 38 | "uni_modules": { 39 | "dependencies": [], 40 | "encrypt": [], 41 | "platforms": { 42 | "cloud": { 43 | "tcb": "y", 44 | "aliyun": "y" 45 | }, 46 | "client": { 47 | "App": { 48 | "app-vue": "y", 49 | "app-nvue": "y" 50 | }, 51 | "H5-mobile": { 52 | "Safari": "y", 53 | "Android Browser": "y", 54 | "微信浏览器(Android)": "y", 55 | "QQ浏览器(Android)": "y" 56 | }, 57 | "H5-pc": { 58 | "Chrome": "y", 59 | "IE": "y", 60 | "Edge": "y", 61 | "Firefox": "y", 62 | "Safari": "y" 63 | }, 64 | "小程序": { 65 | "微信": "y", 66 | "阿里": "y", 67 | "百度": "y", 68 | "字节跳动": "y", 69 | "QQ": "y" 70 | }, 71 | "快应用": { 72 | "华为": "u", 73 | "联盟": "u" 74 | } 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /uni_modules/z-address/readme.md: -------------------------------------------------------------------------------- 1 | # 三级联动,地址选择,可选长度 2 | 3 | 三级联动,地址选择,可选长度 4 | 5 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 6 | | ----------------------------|--------------------------- | 7 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 8 | | QQ群号:607391225 |微信号:zhou0612wei| 9 | 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 案例一 13 | ``` 14 | 15 | ``` 16 | 17 | ### 属性 18 | | 名称 | 类型 | 默认值 | 描述 | 19 | | ----------------------------|--------------- | ------------- | ---------------------------------------------------| 20 | | dataList | Array | [] | 默认值| 21 | | length | Number | 3 | 地区选择长度(1-3) | 22 | | force | Boolean | true | 强制选择,选择长度必须达到指定长度| 23 | 24 | ### 事件 25 | | 名称 | 类型 | 描述 | 26 | | -----------------|------------------ | --------------------------| 27 | | @change | function | 选择时数据返回 | 28 | -------------------------------------------------------------------------------- /uni_modules/z-loading/changelog.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/z-loading/components/z-loading/z-loading.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 26 | 27 | 114 | -------------------------------------------------------------------------------- /uni_modules/z-loading/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-loading", 3 | "displayName": "加载中组件", 4 | "version": "1.0.0", 5 | "description": "加载中组件", 6 | "keywords": [ 7 | "加载", 8 | "加载中", 9 | "加载组件" 10 | ], 11 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 12 | "engines": { 13 | "HBuilderX": "^3.0.0" 14 | }, 15 | "dcloudext": { 16 | "category": [ 17 | "前端组件", 18 | "通用组件" 19 | ], 20 | "sale": { 21 | "regular": { 22 | "price": "0.00" 23 | }, 24 | "sourcecode": { 25 | "price": "0.00" 26 | } 27 | }, 28 | "contact": { 29 | "qq": "465081029" 30 | }, 31 | "declaration": { 32 | "ads": "无", 33 | "data": "无", 34 | "permissions": "无" 35 | }, 36 | "npmurl": "" 37 | }, 38 | "uni_modules": { 39 | "dependencies": [], 40 | "encrypt": [], 41 | "platforms": { 42 | "cloud": { 43 | "tcb": "y", 44 | "aliyun": "y" 45 | }, 46 | "client": { 47 | "App": { 48 | "app-vue": "y", 49 | "app-nvue": "y" 50 | }, 51 | "H5-mobile": { 52 | "Safari": "y", 53 | "Android Browser": "y", 54 | "微信浏览器(Android)": "y", 55 | "QQ浏览器(Android)": "y" 56 | }, 57 | "H5-pc": { 58 | "Chrome": "y", 59 | "IE": "y", 60 | "Edge": "y", 61 | "Firefox": "y", 62 | "Safari": "y" 63 | }, 64 | "小程序": { 65 | "微信": "y", 66 | "阿里": "y", 67 | "百度": "y", 68 | "字节跳动": "y", 69 | "QQ": "y" 70 | }, 71 | "快应用": { 72 | "华为": "u", 73 | "联盟": "u" 74 | } 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /uni_modules/z-loading/readme.md: -------------------------------------------------------------------------------- 1 | # 加载中组件 2 | 3 | 加载中组件 4 | 5 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 6 | | ----------------------------|--------------------------- | 7 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 8 | | QQ群号:607391225 |微信号:zhou0612wei| 9 | 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 案例一 13 | ``` 14 | 15 | ``` 16 | 17 | ### 用法第一步 18 | ``` 19 | // vuex里面注册loadingShow变量和setLoadingShow赋值方法 20 | ``` 21 | 22 | ### 用法第二步 23 | ``` 24 | import store from '@/store'; 25 | //调用vuex方法打开加载动画 26 | store.commit("setLoadingShow", true); 27 | ``` -------------------------------------------------------------------------------- /uni_modules/z-nav-bar/changelog.md: -------------------------------------------------------------------------------- 1 | ## 2.0.5(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/z-nav-bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-nav-bar", 3 | "displayName": "zhouWei-navBar 适用于 uni-app 项目的头部导航组件,支持V3编译、nvue编译", 4 | "version": "2.0.5", 5 | "description": "导航栏组件,主要用于头部导航,主流平台都支持。自动改变导航栏颜色和头部返回首页,支持nvue、V3", 6 | "keywords": [ 7 | "导航栏", 8 | "nvue", 9 | "navBar", 10 | "顶部导航" 11 | ], 12 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 13 | "engines": { 14 | "HBuilderX": "^3.0.0" 15 | }, 16 | "dcloudext": { 17 | "category": [ 18 | "前端组件", 19 | "通用组件" 20 | ], 21 | "sale": { 22 | "regular": { 23 | "price": "0.00" 24 | }, 25 | "sourcecode": { 26 | "price": "0.00" 27 | } 28 | }, 29 | "contact": { 30 | "qq": "465081029" 31 | }, 32 | "declaration": { 33 | "ads": "无", 34 | "data": "无", 35 | "permissions": "无" 36 | }, 37 | "npmurl": "" 38 | }, 39 | "uni_modules": { 40 | "dependencies": [], 41 | "encrypt": [], 42 | "platforms": { 43 | "cloud": { 44 | "tcb": "y", 45 | "aliyun": "y" 46 | }, 47 | "client": { 48 | "App": { 49 | "app-vue": "y", 50 | "app-nvue": "y" 51 | }, 52 | "H5-mobile": { 53 | "Safari": "y", 54 | "Android Browser": "y", 55 | "微信浏览器(Android)": "y", 56 | "QQ浏览器(Android)": "y" 57 | }, 58 | "H5-pc": { 59 | "Chrome": "y", 60 | "IE": "y", 61 | "Edge": "y", 62 | "Firefox": "y", 63 | "Safari": "y" 64 | }, 65 | "小程序": { 66 | "微信": "y", 67 | "阿里": "y", 68 | "百度": "y", 69 | "字节跳动": "y", 70 | "QQ": "y" 71 | }, 72 | "快应用": { 73 | "华为": "u", 74 | "联盟": "u" 75 | } 76 | } 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /uni_modules/z-nav-bar/static/icon_back_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/z-nav-bar/static/icon_back_black.png -------------------------------------------------------------------------------- /uni_modules/z-nav-bar/static/icon_back_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/z-nav-bar/static/icon_back_white.png -------------------------------------------------------------------------------- /uni_modules/z-nav-bar/static/icon_home_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/z-nav-bar/static/icon_home_black.png -------------------------------------------------------------------------------- /uni_modules/z-nav-bar/static/icon_home_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/z-nav-bar/static/icon_home_white.png -------------------------------------------------------------------------------- /uni_modules/z-paging/changelog.md: -------------------------------------------------------------------------------- 1 | ## 2.0.1(2021-08-16) 2 | 1.自定义下拉刷新view无需设置`refresher-threshold`,将根据view自动计算高度。 3 | 2.修复在iOS 13中下拉刷新抖动的问题。 4 | 3.新增`inside-more`,支持在分页未满一屏时自动加载下一页。 5 | 4.修复z-paging prop代码自动补全无效的问题,完善代码自动补全文档注释。 6 | 5.修复在微信小程序中提示:uni is not defined的bug。 7 | 6.修复在某些情况下,下拉刷新页面会跟着下拉的bug。 8 | 7.其他细节优化。 9 | ## 2.0.0(2021-08-16) 10 | 1.自定义下拉刷新view无需设置`refresher-threshold`,将根据view自动计算高度。 11 | 2.修复在iOS 13中下拉刷新抖动的问题。 12 | 3.新增`inside-more`,支持在分页未满一屏时自动加载下一页。 13 | 4.修复z-paging prop代码自动补全无效的问题,完善代码自动补全文档注释。 14 | 5.其他细节优化。 15 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 18 | 19 | 120 | 121 | 171 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging-swiper-item/z-paging-swiper-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 76 | 77 | 87 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging-swiper/z-paging-swiper.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 18 | 19 | 83 | 84 | 127 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/components/z-paging-load-more.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 43 | 71 | 72 | 162 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/css/z-paging-main.css: -------------------------------------------------------------------------------- 1 | /* z-paging 2 | github地址:https://github.com/SmileZXLee/uni-z-paging 3 | dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | 反馈QQ群:790460711 5 | */ 6 | 7 | .z-paging-content { 8 | position: relative; 9 | /* #ifndef APP-NVUE */ 10 | display: flex; 11 | width: 100%; 12 | height: 100%; 13 | /* #endif */ 14 | flex-direction: column; 15 | } 16 | 17 | .z-paging-content-fixed { 18 | position: fixed; 19 | /* #ifndef APP-NVUE */ 20 | height: auto; 21 | width: auto; 22 | /* #endif */ 23 | top: 0; 24 | left: 0; 25 | bottom: 0; 26 | right: 0; 27 | } 28 | 29 | .zp-page-scroll-top, 30 | .zp-page-scroll-bottom { 31 | /* #ifndef APP-NVUE */ 32 | width: auto; 33 | /* #endif */ 34 | position: fixed; 35 | left: 0; 36 | right: 0; 37 | z-index: 999; 38 | } 39 | 40 | .zp-scroll-view-super { 41 | flex: 1; 42 | position: relative; 43 | } 44 | 45 | .zp-custom-refresher-container { 46 | overflow: hidden; 47 | } 48 | 49 | .zp-scroll-view { 50 | height: 100%; 51 | width: 100%; 52 | } 53 | 54 | .zp-scroll-view-absolute { 55 | position: absolute; 56 | top: 0; 57 | left: 0; 58 | } 59 | 60 | .zp-paging-touch-view { 61 | width: 100%; 62 | height: 100%; 63 | position: relative; 64 | } 65 | 66 | .zp-fixed-bac-view { 67 | position: absolute; 68 | width: 100%; 69 | top: 0; 70 | left: 0; 71 | height: 200px; 72 | } 73 | 74 | .zp-paging-main { 75 | height: 100%; 76 | /* #ifndef APP-NVUE */ 77 | display: flex; 78 | /* #endif */ 79 | flex-direction: column; 80 | } 81 | 82 | .zp-paging-container { 83 | flex: 1; 84 | position: relative; 85 | } 86 | 87 | .zp-chat-record-loading-container { 88 | /* #ifndef APP-NVUE */ 89 | display: flex; 90 | width: 100%; 91 | /* #endif */ 92 | /* #ifdef APP-NVUE */ 93 | width: 750rpx; 94 | /* #endif */ 95 | align-items: center; 96 | justify-content: center; 97 | height: 60rpx; 98 | font-size: 26rpx; 99 | } 100 | 101 | .zp-chat-record-loading-custom-image { 102 | width: 35rpx; 103 | height: 35rpx; 104 | /* #ifndef APP-NVUE */ 105 | animation: loading-flower 1s linear infinite; 106 | /* #endif */ 107 | } 108 | 109 | .zp-custom-refresher-container { 110 | /* #ifndef APP-NVUE */ 111 | display: flex; 112 | /* #endif */ 113 | flex-direction: row; 114 | justify-content: center; 115 | align-items: center; 116 | } 117 | 118 | .zp-back-to-top { 119 | width: 76rpx; 120 | height: 76rpx; 121 | z-index: 999; 122 | position: absolute; 123 | bottom: 0rpx; 124 | right: 25rpx; 125 | transition-duration: .3s; 126 | transition-property: opacity; 127 | } 128 | 129 | .zp-back-to-top-show { 130 | opacity: 1; 131 | } 132 | 133 | .zp-back-to-top-hide { 134 | opacity: 0; 135 | } 136 | 137 | .zp-back-to-top-img { 138 | /* #ifndef APP-NVUE */ 139 | width: 100%; 140 | height: 100%; 141 | /* #endif */ 142 | /* #ifdef APP-NVUE */ 143 | flex: 1; 144 | /* #endif */ 145 | z-index: 999; 146 | } 147 | 148 | .zp-empty-view { 149 | /* #ifdef APP-NVUE */ 150 | height: 100%; 151 | /* #endif */ 152 | flex: 1; 153 | } 154 | 155 | .zp-n-refresh-container { 156 | /* #ifndef APP-NVUE */ 157 | display: flex; 158 | /* #endif */ 159 | justify-content: center; 160 | width: 750rpx; 161 | } 162 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/css/z-paging-static.css: -------------------------------------------------------------------------------- 1 | /* z-paging 2 | github地址:https://github.com/SmileZXLee/uni-z-paging 3 | dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | 反馈QQ群:790460711 5 | 6 | 公用的静态css资源 */ 7 | 8 | .zp-loading-more-line-loading-image { 9 | margin-right: 8rpx; 10 | width: 28rpx; 11 | height: 28rpx; 12 | /* #ifndef APP-NVUE */ 13 | animation: loading-flower 1s steps(12) infinite; 14 | /* #endif */ 15 | color: #666666; 16 | } 17 | 18 | .zp-loading-image-ios{ 19 | width: 20px; 20 | height: 20px; 21 | } 22 | 23 | .zp-loading-image-android{ 24 | width: 32rpx; 25 | height: 32rpx; 26 | } 27 | 28 | @keyframes loading-flower { 29 | 0% { 30 | -webkit-transform: rotate(0deg); 31 | transform: rotate(0deg); 32 | } 33 | 34 | to { 35 | -webkit-transform: rotate(1turn); 36 | transform: rotate(1turn); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/js/z-paging-config.js: -------------------------------------------------------------------------------- 1 | // z-paging 2 | // github地址:https://github.com/SmileZXLee/uni-z-paging 3 | // dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | // 反馈QQ群:790460711 5 | // z-paging配置文件 6 | 7 | let config = null; 8 | let getedStorage = false; 9 | const storageKey = 'Z-PAGING-CONFIG-STORAGE-KEY' 10 | 11 | function setConfig(value) { 12 | try { 13 | uni.setStorageSync(storageKey, value); 14 | } catch {} 15 | } 16 | 17 | function getConfig() { 18 | try { 19 | if (getedStorage) { 20 | return config; 21 | } 22 | config = uni.getStorageSync(storageKey); 23 | getedStorage = true; 24 | } catch { 25 | return null; 26 | } 27 | } 28 | 29 | module.exports = { 30 | setConfig, 31 | getConfig 32 | }; 33 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/js/z-paging-i18n.js: -------------------------------------------------------------------------------- 1 | // z-paging 2 | // github地址:https://github.com/SmileZXLee/uni-z-paging 3 | // dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | // 反馈QQ群:790460711 5 | // z-paging国际化(支持中文、中文繁体和英文) 6 | 7 | const i18nUpdateKey = 'z-paging-i18n-update'; 8 | 9 | const refresherDefaultText = { 10 | 'en': 'Pull down to refresh', 11 | 'zh-cn': '继续下拉刷新', 12 | 'zh-hant-cn': '繼續下拉重繪', 13 | } 14 | const refresherPullingText = { 15 | 'en': 'Release to refresh', 16 | 'zh-cn': '松开立即刷新', 17 | 'zh-hant-cn': '鬆開立即重繪', 18 | } 19 | const refresherRefreshingText = { 20 | 'en': 'Refreshing...', 21 | 'zh-cn': '正在刷新...', 22 | 'zh-hant-cn': '正在重繪...', 23 | } 24 | 25 | const loadingMoreDefaultText = { 26 | 'en': 'Click to load more', 27 | 'zh-cn': '点击加载更多', 28 | 'zh-hant-cn': '點擊加載更多', 29 | } 30 | const loadingMoreLoadingText = { 31 | 'en': 'Loading...', 32 | 'zh-cn': '正在加载...', 33 | 'zh-hant-cn': '正在加載...', 34 | } 35 | const loadingMoreNoMoreText = { 36 | 'en': 'No more data', 37 | 'zh-cn': '没有更多了', 38 | 'zh-hant-cn': '沒有更多了', 39 | } 40 | const loadingMoreFailText = { 41 | 'en': 'Load failed,click to reload', 42 | 'zh-cn': '加载失败,点击重新加载', 43 | 'zh-hant-cn': '加載失敗,點擊重新加載', 44 | } 45 | 46 | const emptyViewText = { 47 | 'en': 'No data', 48 | 'zh-cn': '没有数据哦~', 49 | 'zh-hant-cn': '沒有數據哦~', 50 | } 51 | 52 | const emptyViewReloadText = { 53 | 'en': 'Reload', 54 | 'zh-cn': '重新加载', 55 | 'zh-hant-cn': '重新加載', 56 | } 57 | 58 | const emptyViewErrorText = { 59 | 'en': 'Sorry,load failed', 60 | 'zh-cn': '很抱歉,加载失败', 61 | 'zh-hant-cn': '很抱歉,加載失敗', 62 | } 63 | 64 | const refresherUpdateTimeText = { 65 | 'en': 'Last update: ', 66 | 'zh-cn': '最后更新:', 67 | 'zh-hant-cn': '最後更新:', 68 | } 69 | 70 | const refresherUpdateTimeNoneText = { 71 | 'en': 'None', 72 | 'zh-cn': '无', 73 | 'zh-hant-cn': '無', 74 | } 75 | 76 | const refresherUpdateTimeTodayText = { 77 | 'en': 'Today', 78 | 'zh-cn': '今天', 79 | 'zh-hant-cn': '今天', 80 | } 81 | 82 | const refresherUpdateTimeYesterdayText = { 83 | 'en': 'Yesterday', 84 | 'zh-cn': '昨天', 85 | 'zh-hant-cn': '昨天', 86 | } 87 | 88 | // 插件内部使用,请勿直接调用 89 | function getPrivateLanguage(myLanguage, followSystemLanguage = true) { 90 | let systemLanguage = ''; 91 | if (followSystemLanguage) { 92 | systemLanguage = uni.getSystemInfoSync().language; 93 | } 94 | let language = myLanguage || uni.getStorageSync(i18nUpdateKey) || systemLanguage; 95 | language = language.toLowerCase(); 96 | var reg = new RegExp('_', ''); 97 | language = language.replace(reg, '-'); 98 | if (language.indexOf('zh') !== -1) { 99 | if (language === 'zh' || language === 'zh-cn' || language.indexOf('zh-hans') !== -1) { 100 | return 'zh-cn'; 101 | } 102 | return 'zh-hant-cn'; 103 | } 104 | if (language.indexOf('en') !== -1) { 105 | return 'en'; 106 | } 107 | return 'zh-cn'; 108 | } 109 | 110 | // 获取当前语言,格式为:zh-cn、zh-hant-cn、en。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的 111 | function getLanguage(followSystemLanguage = true) { 112 | return getPrivateLanguage(false, followSystemLanguage); 113 | } 114 | 115 | // 获取当前语言,格式为:简体中文、繁體中文、English。followSystemLanguage:获取的结果是否是在不跟随系统语言下获取到的 116 | function getLanguageName(followSystemLanguage = true) { 117 | const language = getLanguage(followSystemLanguage); 118 | const languageNameMap = { 119 | 'zh-cn': '简体中文', 120 | 'zh-hant-cn': '繁體中文', 121 | 'en': 'English' 122 | }; 123 | return languageNameMap[language]; 124 | } 125 | 126 | function setLanguage(myLanguage) { 127 | uni.setStorageSync(i18nUpdateKey, myLanguage); 128 | uni.$emit(i18nUpdateKey, myLanguage); 129 | } 130 | 131 | module.exports = { 132 | refresherDefaultText, 133 | refresherPullingText, 134 | refresherRefreshingText, 135 | loadingMoreDefaultText, 136 | loadingMoreLoadingText, 137 | loadingMoreNoMoreText, 138 | loadingMoreFailText, 139 | emptyViewText, 140 | emptyViewReloadText, 141 | emptyViewErrorText, 142 | getPrivateLanguage, 143 | getLanguage, 144 | getLanguageName, 145 | setLanguage, 146 | refresherUpdateTimeText, 147 | refresherUpdateTimeNoneText, 148 | refresherUpdateTimeTodayText, 149 | refresherUpdateTimeYesterdayText 150 | } 151 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js: -------------------------------------------------------------------------------- 1 | // z-paging 2 | // github地址:https://github.com/SmileZXLee/uni-z-paging 3 | // dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | // 反馈QQ群:790460711 5 | // 使用页面滚动时引入此mixin,用于监听和处理onPullDownRefresh等页面生命周期方法 6 | 7 | const ZPagingMixin = { 8 | onPullDownRefresh() { 9 | if (this.isPagingRefNotFound()) { 10 | return; 11 | } 12 | this.$refs.paging.reload(); 13 | }, 14 | onPageScroll(e) { 15 | if (this.isPagingRefNotFound()) { 16 | return; 17 | } 18 | this.$refs.paging.updatePageScrollTop(e.scrollTop); 19 | if (e.scrollTop < 10) { 20 | this.$refs.paging.doChatRecordLoadMore(); 21 | } 22 | }, 23 | onReachBottom() { 24 | if (this.isPagingRefNotFound()) { 25 | return; 26 | } 27 | this.$refs.paging.doLoadMore(); 28 | }, 29 | methods: { 30 | isPagingRefNotFound() { 31 | return !this.$refs.paging || this.$refs.paging === undefined; 32 | } 33 | } 34 | } 35 | 36 | export default ZPagingMixin; 37 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/js/z-paging-utils.js: -------------------------------------------------------------------------------- 1 | // z-paging 2 | // github地址:https://github.com/SmileZXLee/uni-z-paging 3 | // dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | // 反馈QQ群:790460711 5 | // z-paging工具类 6 | 7 | import zI18n from './z-paging-i18n' 8 | 9 | const storageKey = 'Z-PAGING-REFRESHER-TIME-STORAGE-KEY' 10 | 11 | //判断两个数组是否相等 12 | function arrayIsEqual(arr1, arr2) { 13 | if (arr1 === arr2) { 14 | return true; 15 | } 16 | if (arr1.length !== arr2.length) { 17 | return false; 18 | } 19 | for (let i = 0; i < arr1.length; i++) { 20 | if (arr1[i] !== arr2[i]) { 21 | return false; 22 | } 23 | } 24 | return true; 25 | } 26 | 27 | //获取最终的touch位置 28 | function getCommonTouch(e) { 29 | let touch = null; 30 | if (e.touches && e.touches.length) { 31 | touch = e.touches[0]; 32 | } else if (e.changedTouches && e.changedTouches.length) { 33 | touch = e.changedTouches[0]; 34 | } else if (e.datail && e.datail !== {}) { 35 | touch = e.datail; 36 | } else { 37 | return { 38 | touchX: 0, 39 | touchY: 0 40 | } 41 | } 42 | return { 43 | touchX: touch.clientX, 44 | touchY: touch.clientY 45 | }; 46 | } 47 | 48 | //判断当前手势是否在z-paging内触发 49 | function getTouchFromZPaging(target) { 50 | if (target && target.tagName && target.tagName !== 'BODY' && target.tagName !== 'UNI-PAGE-BODY') { 51 | var classList = target.classList; 52 | if (classList && classList.contains('zp-paging-touch-view')) { 53 | return true; 54 | } else { 55 | return getTouchFromZPaging(target.parentNode); 56 | } 57 | } else { 58 | return false; 59 | } 60 | } 61 | 62 | //获取z-paging所在的parent 63 | function getParent(parent) { 64 | if (!parent) { 65 | return null; 66 | } 67 | if (parent.$refs.paging) { 68 | return parent; 69 | } 70 | return getParent(parent.$parent); 71 | } 72 | 73 | //打印错误信息 74 | function consoleErr(err) { 75 | console.error(`[z-paging]${err}`); 76 | } 77 | 78 | //打印警告信息 79 | function consoleWarn(warn) { 80 | console.warn(`[z-paging]${warn}`); 81 | } 82 | 83 | //设置下拉刷新时间 84 | function setRefesrherTime(time, key) { 85 | try { 86 | let datas = getRefesrherTime(); 87 | if (!datas) { 88 | datas = {}; 89 | } 90 | datas[key] = time; 91 | uni.setStorageSync(storageKey, datas); 92 | } catch {} 93 | } 94 | 95 | //获取下拉刷新时间 96 | function getRefesrherTime() { 97 | try { 98 | const datas = uni.getStorageSync(storageKey); 99 | return datas; 100 | } catch { 101 | return null; 102 | } 103 | } 104 | 105 | //通过下拉刷新标识key获取下拉刷新时间 106 | function getRefesrherTimeByKey(key) { 107 | const datas = getRefesrherTime(); 108 | if (datas) { 109 | const data = datas[key]; 110 | if (data) { 111 | return data; 112 | } 113 | } 114 | return null; 115 | } 116 | 117 | //通过下拉刷新标识key获取下拉刷新时间(格式化之后) 118 | function getRefesrherFormatTimeByKey(key) { 119 | const time = getRefesrherTimeByKey(key); 120 | let timeText = zI18n['refresherUpdateTimeNoneText'][zI18n.getLanguage()]; 121 | if (time) { 122 | timeText = _timeFormat(time); 123 | } 124 | return `${zI18n['refresherUpdateTimeText'][zI18n.getLanguage()]}${timeText}`; 125 | } 126 | 127 | function _timeFormat(time) { 128 | const date = new Date(time); 129 | const currentDate = new Date(); 130 | const dateDay = new Date(time).setHours(0, 0, 0, 0); 131 | const currentDateDay = new Date().setHours(0, 0, 0, 0); 132 | const disTime = dateDay - currentDateDay; 133 | let dayStr = ''; 134 | const timeStr = _dateTimeFormat(date); 135 | if (disTime === 0) { 136 | dayStr = zI18n['refresherUpdateTimeTodayText'][zI18n.getLanguage()]; 137 | } else if (disTime === -86400000) { 138 | dayStr = zI18n['refresherUpdateTimeYesterdayText'][zI18n.getLanguage()]; 139 | } else { 140 | dayStr = _dateDayFormat(date, date.getFullYear() !== currentDate.getFullYear()); 141 | } 142 | return `${dayStr} ${timeStr}`; 143 | } 144 | 145 | function _dateDayFormat(date, showYear = true) { 146 | const year = date.getFullYear(); 147 | const month = date.getMonth() + 1; 148 | const day = date.getDate(); 149 | if (showYear) { 150 | return `${year}-${_fullZeroToTwo(month)}-${_fullZeroToTwo(day)}`; 151 | } else { 152 | return `${_fullZeroToTwo(month)}-${_fullZeroToTwo(day)}`; 153 | } 154 | } 155 | 156 | function _dateTimeFormat(date) { 157 | const hour = date.getHours(); 158 | const minute = date.getMinutes(); 159 | return `${_fullZeroToTwo(hour)}:${_fullZeroToTwo(minute)}`; 160 | } 161 | 162 | function _fullZeroToTwo(str) { 163 | str = str.toString(); 164 | if (str.length === 1) { 165 | return '0' + str; 166 | } 167 | return str; 168 | } 169 | 170 | module.exports = { 171 | setRefesrherTime, 172 | getRefesrherFormatTimeByKey, 173 | arrayIsEqual, 174 | getCommonTouch, 175 | getTouchFromZPaging, 176 | getParent, 177 | consoleErr, 178 | consoleWarn 179 | }; 180 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/wxs/z-paging-renderjs.js: -------------------------------------------------------------------------------- 1 | // z-paging 2 | // github地址:https://github.com/SmileZXLee/uni-z-paging 3 | // dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | // 反馈QQ群:790460711 5 | // 使用renderjs在app-vue和h5中对touchmove事件冒泡进行处理 6 | 7 | import zUtils from '../js/z-paging-utils' 8 | var data = { 9 | renderScrollTop: 0, 10 | renderUsePageScroll: false, 11 | renderIsIos: uni.getSystemInfoSync().platform === 'ios', 12 | startY: 0, 13 | isTouchFromZPaging: false 14 | } 15 | 16 | export default { 17 | mounted() { 18 | this._handleTouch(); 19 | }, 20 | methods: { 21 | //接收逻辑层发送的数据 22 | renderPropScrollTopChange(newVal, oldVal, ownerVm, vm) { 23 | data.renderScrollTop = newVal; 24 | }, 25 | renderPropUsePageScrollChange(newVal, oldVal, ownerVm, vm) { 26 | if(newVal !== -1){ 27 | data.renderUsePageScroll = newVal; 28 | } 29 | }, 30 | //拦截处理touch事件 31 | _handleTouch() { 32 | if (window && !window.$zPagingRenderJsInited) { 33 | window.$zPagingRenderJsInited = true; 34 | window.addEventListener('touchstart', this._handleTouchstart, { 35 | passive: true 36 | }) 37 | window.addEventListener('touchmove', this._handleTouchmove, { 38 | passive: false 39 | }) 40 | } 41 | }, 42 | _handleTouchstart(e) { 43 | const touch = zUtils.getCommonTouch(e); 44 | data.startY = touch.touchY; 45 | data.isTouchFromZPaging = zUtils.getTouchFromZPaging(e.target); 46 | }, 47 | _handleTouchmove(e) { 48 | const touch = zUtils.getCommonTouch(e); 49 | var moveY = touch.touchY - data.startY; 50 | if ((data.isTouchFromZPaging && data.renderScrollTop < 1 && moveY > 0) || (data.isTouchFromZPaging && data.renderIsIos && !data.renderUsePageScroll && moveY < 0)) { 51 | if (e.cancelable && !e.defaultPrevented) { 52 | e.preventDefault(); 53 | } 54 | } 55 | }, 56 | 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/z-paging-load-more.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 42 | 69 | 70 | 157 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/z-paging-mixin.js: -------------------------------------------------------------------------------- 1 | 2 | // z-paging 3 | // github地址:https://github.com/SmileZXLee/uni-z-paging 4 | // dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 5 | // 反馈QQ群:790460711 6 | 7 | // 使用页面滚动时引入此mixin,用于监听和处理onPullDownRefresh等页面生命周期方法 8 | 9 | const ZPagingMixin = { 10 | onPullDownRefresh(){ 11 | if(this.isPagingRefNotFound()){ 12 | return; 13 | } 14 | this.$refs.paging.reload(); 15 | }, 16 | onPageScroll(e) { 17 | if(this.isPagingRefNotFound()){ 18 | return; 19 | } 20 | this.$refs.paging.updatePageScrollTop(e.scrollTop); 21 | }, 22 | onReachBottom() { 23 | if(this.isPagingRefNotFound()){ 24 | return; 25 | } 26 | this.$refs.paging.doLoadMore(); 27 | }, 28 | methods: { 29 | isPagingRefNotFound(){ 30 | return !this.$refs.paging || this.$refs.paging === undefined; 31 | } 32 | } 33 | } 34 | 35 | export default ZPagingMixin; 36 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/z-paging-refresh.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 32 | 63 | 64 | 174 | -------------------------------------------------------------------------------- /uni_modules/z-paging/components/z-paging/z-paging-static.css: -------------------------------------------------------------------------------- 1 | /* z-paging 2 | github地址:https://github.com/SmileZXLee/uni-z-paging 3 | dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935 4 | 反馈QQ群:790460711 5 | 6 | 公用的静态css资源 */ 7 | 8 | .zp-loading-more-line-loading-image { 9 | margin-right: 8rpx; 10 | width: 28rpx; 11 | height: 28rpx; 12 | /* #ifndef APP-NVUE */ 13 | animation: loading-flower 1s steps(12) infinite; 14 | /* #endif */ 15 | color: #666666; 16 | } 17 | 18 | @keyframes loading-flower { 19 | 0% { 20 | -webkit-transform: rotate(0deg); 21 | transform: rotate(0deg); 22 | } 23 | 24 | to { 25 | -webkit-transform: rotate(1turn); 26 | transform: rotate(1turn); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /uni_modules/z-paging/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-paging", 3 | "displayName": "【z-paging下拉刷新、上拉加载更多】超简单、低耦合!仅需两步轻松完成完整分页逻辑", 4 | "version": "2.0.1", 5 | "description": "【支持nvue,使用wxs+renderjs实现】全平台兼容,支持自定义下拉刷新、上拉加载更多,支持自动管理空数据图、点击返回顶部,支持聊天分页、本地分页,支持展示最后更新时间,支持国际化等等", 6 | "keywords": [ 7 | "下拉刷新", 8 | "上拉加载", 9 | "分页器", 10 | "nvue", 11 | "wxs" 12 | ], 13 | "repository": "https://github.com/SmileZXLee/uni-z-paging", 14 | "engines": { 15 | "HBuilderX": "^3.0.7" 16 | }, 17 | "dcloudext": { 18 | "category": [ 19 | "前端组件", 20 | "通用组件" 21 | ], 22 | "sale": { 23 | "regular": { 24 | "price": "0.00" 25 | }, 26 | "sourcecode": { 27 | "price": "0.00" 28 | } 29 | }, 30 | "contact": { 31 | "qq": "393727164" 32 | }, 33 | "declaration": { 34 | "ads": "无", 35 | "data": "无", 36 | "permissions": "无" 37 | }, 38 | "npmurl": "" 39 | }, 40 | "uni_modules": { 41 | "dependencies": [], 42 | "encrypt": [], 43 | "platforms": { 44 | "cloud": { 45 | "tcb": "y", 46 | "aliyun": "y" 47 | }, 48 | "client": { 49 | "App": { 50 | "app-vue": "y", 51 | "app-nvue": "y" 52 | }, 53 | "H5-mobile": { 54 | "Safari": "y", 55 | "Android Browser": "y", 56 | "微信浏览器(Android)": "y", 57 | "QQ浏览器(Android)": "y" 58 | }, 59 | "H5-pc": { 60 | "Chrome": "y", 61 | "IE": "y", 62 | "Edge": "y", 63 | "Firefox": "y", 64 | "Safari": "y" 65 | }, 66 | "小程序": { 67 | "微信": "y", 68 | "阿里": "y", 69 | "百度": "y", 70 | "字节跳动": "y", 71 | "QQ": "y" 72 | }, 73 | "快应用": { 74 | "华为": "u", 75 | "联盟": "u" 76 | } 77 | } 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /uni_modules/z-popup/changelog.md: -------------------------------------------------------------------------------- 1 | ## 1.0.1(2021-06-24) 2 | 修复微信小程序不显示问题 3 | ## 1.0.0(2021-05-12) 4 | 1. 支持uni_modules 5 | -------------------------------------------------------------------------------- /uni_modules/z-popup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-popup", 3 | "displayName": "弹窗,上弹窗,下弹窗,中间弹窗", 4 | "version": "1.0.1", 5 | "description": "弹窗,上弹窗,下弹窗,中间弹窗", 6 | "keywords": [ 7 | "弹窗", 8 | "下弹窗", 9 | "中间弹窗", 10 | "上弹窗" 11 | ], 12 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 13 | "engines": { 14 | "HBuilderX": "^3.0.7" 15 | }, 16 | "dcloudext": { 17 | "category": [ 18 | "前端组件", 19 | "通用组件" 20 | ], 21 | "sale": { 22 | "regular": { 23 | "price": "0.00" 24 | }, 25 | "sourcecode": { 26 | "price": "0.00" 27 | } 28 | }, 29 | "contact": { 30 | "qq": "465081029" 31 | }, 32 | "declaration": { 33 | "ads": "无", 34 | "data": "无", 35 | "permissions": "无" 36 | }, 37 | "npmurl": "" 38 | }, 39 | "uni_modules": { 40 | "dependencies": [], 41 | "encrypt": [], 42 | "platforms": { 43 | "cloud": { 44 | "tcb": "y", 45 | "aliyun": "y" 46 | }, 47 | "client": { 48 | "App": { 49 | "app-vue": "y", 50 | "app-nvue": "y" 51 | }, 52 | "H5-mobile": { 53 | "Safari": "y", 54 | "Android Browser": "y", 55 | "微信浏览器(Android)": "y", 56 | "QQ浏览器(Android)": "y" 57 | }, 58 | "H5-pc": { 59 | "Chrome": "y", 60 | "IE": "y", 61 | "Edge": "y", 62 | "Firefox": "y", 63 | "Safari": "y" 64 | }, 65 | "小程序": { 66 | "微信": "y", 67 | "阿里": "y", 68 | "百度": "y", 69 | "字节跳动": "y", 70 | "QQ": "y" 71 | }, 72 | "快应用": { 73 | "华为": "u", 74 | "联盟": "u" 75 | } 76 | } 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /uni_modules/z-popup/readme.md: -------------------------------------------------------------------------------- 1 | # 弹窗,上弹窗,下弹窗,中间弹窗 2 | 3 | 弹窗,上弹窗,下弹窗,中间弹窗 4 | 5 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 6 | | ----------------------------|--------------------------- | 7 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 8 | | QQ群号:607391225 |微信号:zhou0612wei| 9 | 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 案例一 13 | ``` 14 | 15 | 16 | 取消 17 | 弹窗标题 18 | 确定 19 | 20 | 21 | 弹窗内容 22 | 23 | 24 | 25 | // js 26 | methods: { 27 | onChange(e){ 28 | if(e){ 29 | uni.showToast({ 30 | title:"打开了弹窗", 31 | icon:"none" 32 | }); 33 | }else { 34 | uni.showToast({ 35 | title:"关闭了弹窗", 36 | icon:"none" 37 | }); 38 | } 39 | } 40 | }, 41 | ``` 42 | 43 | ### 属性 44 | | 名称 | 类型 | 默认值 | 描述 | 45 | | ----------------------------|--------------- | ------------- | ---------------------------------------------------| 46 | | value | Boolean | false | 控制弹窗是否打开 | 47 | | hideOnBlur | Boolean | true | 点击遮罩层关闭弹窗| 48 | | scroll | Boolean | true | 禁止页面滚动(H5生效) | 49 | | type | String | bottom | 弹窗方位bottom 靠下, center 居中, top 靠上 | 50 | | offset | Number | 0 | type=bottom和type=top的时候设置这个数据弹窗会朝相反的方向偏移 | 51 | | zIndex | Number | 500 | 设置弹窗的层级, 普通vue页面有效 | -------------------------------------------------------------------------------- /uni_modules/z-prompt/changelog.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/z-prompt/components/z-prompt/z-prompt.vue: -------------------------------------------------------------------------------- 1 | 29 | 114 | 194 | -------------------------------------------------------------------------------- /uni_modules/z-prompt/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-prompt", 3 | "displayName": "弹出输入框", 4 | "version": "1.0.0", 5 | "description": "弹出输入框", 6 | "keywords": [ 7 | "弹出输入框", 8 | "输入框" 9 | ], 10 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 11 | "engines": { 12 | "HBuilderX": "^3.0.0" 13 | }, 14 | "dcloudext": { 15 | "category": [ 16 | "前端组件", 17 | "通用组件" 18 | ], 19 | "sale": { 20 | "regular": { 21 | "price": "0.00" 22 | }, 23 | "sourcecode": { 24 | "price": "0.00" 25 | } 26 | }, 27 | "contact": { 28 | "qq": "465081029" 29 | }, 30 | "declaration": { 31 | "ads": "无", 32 | "data": "无", 33 | "permissions": "无" 34 | }, 35 | "npmurl": "" 36 | }, 37 | "uni_modules": { 38 | "dependencies": [], 39 | "encrypt": [], 40 | "platforms": { 41 | "cloud": { 42 | "tcb": "y", 43 | "aliyun": "y" 44 | }, 45 | "client": { 46 | "App": { 47 | "app-vue": "y", 48 | "app-nvue": "y" 49 | }, 50 | "H5-mobile": { 51 | "Safari": "y", 52 | "Android Browser": "y", 53 | "微信浏览器(Android)": "y", 54 | "QQ浏览器(Android)": "y" 55 | }, 56 | "H5-pc": { 57 | "Chrome": "y", 58 | "IE": "y", 59 | "Edge": "y", 60 | "Firefox": "y", 61 | "Safari": "y" 62 | }, 63 | "小程序": { 64 | "微信": "y", 65 | "阿里": "y", 66 | "百度": "y", 67 | "字节跳动": "y", 68 | "QQ": "y" 69 | }, 70 | "快应用": { 71 | "华为": "u", 72 | "联盟": "u" 73 | } 74 | } 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /uni_modules/z-prompt/readme.md: -------------------------------------------------------------------------------- 1 | # 弹出输入框 2 | 3 | 弹出输入框 4 | 5 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 6 | | ----------------------------|--------------------------- | 7 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 8 | | QQ群号:607391225 |微信号:zhou0612wei| 9 | 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 案例一 13 | ``` 14 | 15 | // js 16 | methods: { 17 | onChange(e){ 18 | if(/^1\d{10}$/.test(e.value)){ 19 | uni.showToast({ 20 | title: '请输入正确的手机', 21 | icon: 'none' 22 | }); 23 | return; 24 | } 25 | e.close(); 26 | } 27 | }, 28 | ``` 29 | ### 案例二 30 | ``` 31 | 32 | 33 | 34 | // js 35 | methods: { 36 | onChange(e){ 37 | if(/^1\d{10}$/.test(e.value)){ 38 | uni.showToast({ 39 | title: '请输入正确的手机', 40 | icon: 'none' 41 | }); 42 | return; 43 | } 44 | e.close(); 45 | } 46 | }, 47 | ``` 48 | 49 | ### 属性 50 | | 名称 | 类型 | 默认值 | 描述 | 51 | | ----------------------------|--------------- | ------------- | ---------------------------------------------------| 52 | | value | Boolean | false | 控制弹窗是否打开 | 53 | | options | Object | 有 | 弹窗配置参数 请看下面options属性 | 54 | 55 | ### options属性 56 | | 名称 | 类型 | 默认值 | 描述 | 57 | | ----------------------------|--------------- | ------------- | ---------------------------------------------------| 58 | | title | String | 操作 | 弹窗标题 | 59 | | tips | String | 请输入 | 输入框上面的提示 | 60 | | confirmText | String | 请输入 | 确认按钮的弹窗 | 61 | | placeholder | String | | 输入框的提示 | 62 | | password | Boolean | false | 是否密码输入框 | 63 | | inputType | String | text | 输入框类型 | 64 | | maxlength | Number | 140 | 输入框最大可输入长度 | 65 | | confirmType | String | done | 键盘提交按钮配置(值请参考官方) | -------------------------------------------------------------------------------- /uni_modules/z-swipe-action/README.md: -------------------------------------------------------------------------------- 1 | # swipe-action 滑动操作 2 | ### `觉得不错,给个5星好评吧` 3 | 4 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 5 | | ----------------------------|--------------------------- | 6 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 7 | | QQ群号:607391225 |微信号:zhou0612wei| 8 | 9 | ### [点击跳转-本插件示例](https://ext.dcloud.net.cn/plugin?id=2009) 10 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 11 | 12 | ### 使用时不懂的请看上面链接的插件示例 13 | 14 | ### 示例代码 15 | ``` 16 | 27 | 62 | ``` 63 | 64 | 65 | ### 使用说明 66 | | 名称 | 类型 | 默认值 | 描述 | 67 | | ----------|--------------- | ------------- | -------------------| 68 | | options | Array | [] | 查看options参数说明 | 69 | | disabled | Boolean | false | 是否禁止滑动 | 70 | | show | Boolean | false | 是否打开 | 71 | | autoClose | Boolean | true | 点击后是否自动关闭 | 72 | | index | Number | 0 | 循环的时候的索引值,通过@button传递出去 | 73 | 74 | ### options参数说明 75 | | 名称 | 类型 | 描述 | 76 | | ------------------------|--------------- | -------------------| 77 | | text | String | 按钮名称 | 78 | | style | Object | 按钮样式 | 79 | | style.backgroundColor | String | 按钮背景颜色 | 80 | | style.fontSize | String | 按钮字体大小 | 81 | | style.color | String | 按钮字体颜色 | 82 | 83 | ### 事件 84 | | 名称 | 描述 | 85 | | -----------------| --------------------------| 86 | | button | 左滑按钮点击事件 | 87 | 88 | ``` 89 | 按钮左滑按钮点击事件返回值 90 | { 91 | content: "点击按钮的options参数", 92 | index: "循环的时候的索引值", 93 | buttonIndex: "点击按钮的索引值" 94 | } 95 | ``` -------------------------------------------------------------------------------- /uni_modules/z-swipe-action/changelog.md: -------------------------------------------------------------------------------- 1 | ## 2.0.5(2021-05-12) 2 | 1. 支持uni_modules 3 | -------------------------------------------------------------------------------- /uni_modules/z-swipe-action/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "z-swipe-action", 3 | "displayName": "swipe-action 滑动操作", 4 | "version": "2.0.5", 5 | "description": "swipe-action 滑动操作", 6 | "keywords": [ 7 | "滑动", 8 | "滑动操作", 9 | "action", 10 | "左滑", 11 | "swipe" 12 | ], 13 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 14 | "engines": { 15 | "HBuilderX": "^3.0.0" 16 | }, 17 | "dcloudext": { 18 | "category": [ 19 | "前端组件", 20 | "通用组件" 21 | ], 22 | "sale": { 23 | "regular": { 24 | "price": "0.00" 25 | }, 26 | "sourcecode": { 27 | "price": "0.00" 28 | } 29 | }, 30 | "contact": { 31 | "qq": "465081029" 32 | }, 33 | "declaration": { 34 | "ads": "无", 35 | "data": "无", 36 | "permissions": "无" 37 | }, 38 | "npmurl": "" 39 | }, 40 | "uni_modules": { 41 | "dependencies": [], 42 | "encrypt": [], 43 | "platforms": { 44 | "cloud": { 45 | "tcb": "y", 46 | "aliyun": "y" 47 | }, 48 | "client": { 49 | "App": { 50 | "app-vue": "y", 51 | "app-nvue": "y" 52 | }, 53 | "H5-mobile": { 54 | "Safari": "y", 55 | "Android Browser": "y", 56 | "微信浏览器(Android)": "y", 57 | "QQ浏览器(Android)": "y" 58 | }, 59 | "H5-pc": { 60 | "Chrome": "y", 61 | "IE": "y", 62 | "Edge": "y", 63 | "Firefox": "y", 64 | "Safari": "y" 65 | }, 66 | "小程序": { 67 | "微信": "y", 68 | "阿里": "y", 69 | "百度": "y", 70 | "字节跳动": "y", 71 | "QQ": "y" 72 | }, 73 | "快应用": { 74 | "华为": "u", 75 | "联盟": "u" 76 | } 77 | } 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPUpdate/changelog.md: -------------------------------------------------------------------------------- 1 | ## 3.0.1(2021-05-13) 2 | 1. 跳转颜色和图标配置 3 | 2. 新增静默更新 4 | ## 3.0.0(2021-05-12) 5 | 1. 支持uni_modules 6 | -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPUpdate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "zhouWei-APPUpdate", 3 | "displayName": "APP版本更新、强制更新、静默更新、下载进度(wgt更新)", 4 | "version": "3.0.1", 5 | "description": "APP版本更新、强制更新、静默更新、漂亮弹窗、下载进度(wgt更新)", 6 | "keywords": [ 7 | "APP版本更新", 8 | "强制更新", 9 | "版本更新", 10 | "静默更新" 11 | ], 12 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 13 | "engines": { 14 | "HBuilderX": "^3.1.0" 15 | }, 16 | "dcloudext": { 17 | "category": [ 18 | "JS SDK", 19 | "通用 SDK" 20 | ], 21 | "sale": { 22 | "regular": { 23 | "price": "0.00" 24 | }, 25 | "sourcecode": { 26 | "price": "0.00" 27 | } 28 | }, 29 | "contact": { 30 | "qq": "465081029" 31 | }, 32 | "declaration": { 33 | "ads": "无", 34 | "data": "无", 35 | "permissions": " \n" 36 | }, 37 | "npmurl": "" 38 | }, 39 | "uni_modules": { 40 | "dependencies": [], 41 | "encrypt": [], 42 | "platforms": { 43 | "cloud": { 44 | "tcb": "y", 45 | "aliyun": "y" 46 | }, 47 | "client": { 48 | "App": { 49 | "app-vue": "y", 50 | "app-nvue": "y" 51 | }, 52 | "H5-mobile": { 53 | "Safari": "n", 54 | "Android Browser": "n", 55 | "微信浏览器(Android)": "n", 56 | "QQ浏览器(Android)": "n" 57 | }, 58 | "H5-pc": { 59 | "Chrome": "n", 60 | "IE": "n", 61 | "Edge": "n", 62 | "Firefox": "n", 63 | "Safari": "n" 64 | }, 65 | "小程序": { 66 | "微信": "n", 67 | "阿里": "n", 68 | "百度": "n", 69 | "字节跳动": "n", 70 | "QQ": "n" 71 | }, 72 | "快应用": { 73 | "华为": "n", 74 | "联盟": "n" 75 | } 76 | } 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPUpdate/readme.md: -------------------------------------------------------------------------------- 1 | # APP版本更新、强制更新、漂亮的更新界面、IOS更新(跳转IOS store)、wgt更新 2 | 3 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 4 | | ----------------------------|--------------------------- | 5 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 6 | | QQ群号:607391225 |微信号:zhou0612wei| 7 | 8 | ### [点击跳转-插件示例](https://ext.dcloud.net.cn/plugin?id=2009) 9 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 10 | 11 | ### 常见问题 12 | 1.安卓apk下载完成后没有更新APP? 13 | 14 | 答:问题是因为没有添加APP安装应用的权限,解决方法在`manifest.json`文件里面`APP模块权限配置`的`Android打包权限配置`勾选以下权限 15 | ``` 16 | 17 | 18 | ``` 19 | 若还有问题请看[安装apk无法执行的解决方案](https://ask.dcloud.net.cn/article/35703 "安装apk无法执行的解决方案") 20 | 21 | 2.APP更新后版本号没变,还是之前的版本号? 22 | 23 | 答:可能是更新的安装包没有升级版本号,`manifest.json`文件里面基本设置`应用版本号`和`应用版本名称`需要升高(保持一直减少问题) 24 | 25 | 3.APP更新后没有覆盖之前的APP? 26 | 27 | 答:可能是更新的安装包`包名`和APP的`包名`不一样 28 | 29 | 4.弹窗的图标不显示? 30 | 31 | 答:检查图片是不是放项目资源文件`static`,然后重新运行项目 32 | 33 | 5.版本号是在前端对比还是在后端接口对比? 34 | 35 | 答:当前案例是本地的版本号通过接口传递给后台,是后台对比的,若需要前端对比,请在接口返回数据的地方修改,不更新就不要调用`callback`方法 36 | 37 | 6.本地的版本号比接口的版本号高还弹窗升级窗口? 38 | 39 | 答:当前案例是本地的版本号通过接口传递给后台,后台对比是否需要升级,不需要升级就不要返回数据(特别是需要wgt更新的,建议这种方式) 40 | 41 | ### 第一步`关键`配置APP更新接口(可以参考上面的示例) 42 | 在项目目录下`config/componentConfig.js`里面如下配置 43 | ``` 44 | // 此方法是接口请求方法 45 | import $http from '@/config/requestConfig' 46 | export default { 47 | // 发起ajax请求获取服务端版本号 48 | getServerNo: (version, isPrompt = false, callback) => { 49 | let httpData = { 50 | version: version.versionCode, 51 | // 版本名称 52 | versionName: version.versionName, 53 | // setupPage参数说明(判断用户是不是从设置页面点击的更新,如果是设置页面点击的更新,有不要用静默更新了,不然用户点击没反应很奇怪的) 54 | setupPage: isPrompt 55 | }; 56 | if (platform == "android") { 57 | httpData.type = 1101; 58 | } else { 59 | httpData.type = 1102; 60 | } 61 | /* 接口入参说明 62 | * version: 应用当前版本号(已自动获取) 63 | * versionName: 应用当前版本名称(已自动获取) 64 | * type:平台(1101是安卓,1102是IOS) 65 | */ 66 | /****************以下是示例*******************/ 67 | // 可以用自己项目的请求方法(接口自己找后台要,插件不提供) 68 | $http.get("api/common/v1/app_version", httpData,{ 69 | isPrompt: isPrompt 70 | }).then(res => { 71 | /* res的数据说明 72 | * | 参数名称 | 一定返回 | 类型 | 描述 73 | * | -------------|--------- | --------- | ------------- | 74 | * | versionCode | y | int | 版本号 | 75 | * | versionName | y | String | 版本名称 | 76 | * | versionInfo | y | String | 版本信息 | 77 | * | updateType | y | String | forcibly = 强制更新, solicit = 弹窗确认更新, silent = 静默更新 | 78 | * | downloadUrl | y | String | 版本下载链接(IOS安装包更新请放跳转store应用商店链接,安卓apk和wgt文件放文件下载链接) | 79 | */ 80 | if (res && res.downloadUrl) { 81 | // 兼容之前的版本(updateType是新版才有的参数) 82 | if(res.updateType){ 83 | callback && callback(res); 84 | } else { 85 | if(res.forceUpdate){ 86 | res.updateType = "forcibly"; 87 | } else { 88 | res.updateType = "solicit"; 89 | } 90 | callback && callback(res); 91 | } 92 | } else if (isPrompt) { 93 | uni.showToast({ 94 | title: "暂无新版本", 95 | icon: "none" 96 | }); 97 | } 98 | }); 99 | /****************以上是示例*******************/ 100 | }, 101 | // 弹窗主颜色(不填默认粉色) 102 | appUpdateColor: "f00", 103 | // 弹窗图标(不填显示默认图标,链接配置示例如: '/static/demo/ic_attention.png') 104 | appUpdateIcon: '' 105 | } 106 | ``` 107 | 108 | ### 第二步 使用方法 109 | ``` 110 | // App.vue页面 111 | 112 | // #ifdef APP-PLUS 113 | import APPUpdate from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate'; 114 | // #endif 115 | 116 | onLaunch: function(e) { 117 | // #ifdef APP-PLUS 118 | APPUpdate(); 119 | // #endif 120 | } 121 | ``` 122 | 123 | ### 第三步 添加APP安装应用的权限 124 | 在`manifest.json`文件里面`APP模块权限配置`的`Android打包权限配置`勾选以下权限 125 | ``` 126 | 127 | 128 | ``` 129 | 130 | ### 修改弹窗的主题色或弹窗图标 131 | 在`APPUpdate/index.js`里面上面`$mainColor`常量中定义主题颜色,`$iconUrl`常量中定义图标地址 132 | 133 | ### 检查APP是否有新版本(一般在设置页面使用) 134 | ``` 135 | // #ifdef APP-PLUS 136 | import APPUpdate, { getCurrentNo } from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate'; 137 | // #endif 138 | export default { 139 | data() { 140 | return { 141 | version: "" // 版本号 142 | }; 143 | }, 144 | //第一次加载 145 | onLoad(e) { 146 | // #ifdef APP-PLUS 147 | getCurrentNo(res => { 148 | // 进页面获取当前APP版本号(用于页面显示) 149 | this.version = res.version; 150 | }); 151 | // #endif 152 | }, 153 | //方法 154 | methods: { 155 | // 检查APP是否有新版本 156 | onAPPUpdate() { 157 | // true 没有新版本的时候有提示,默认:false 158 | APPUpdate(true); 159 | } 160 | } 161 | } 162 | ``` -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPUpdate/static/ic_ar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPUpdate/static/ic_ar.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/changelog.md: -------------------------------------------------------------------------------- 1 | ## 2.0.3(2021-07-12) 2 | 修改关闭回调bug 3 | ## 2.0.2(2021-06-25) 4 | 修复图标不显示问题 5 | ## 2.0.1(2021-06-07) 6 | 修改图片不显示bug 7 | ## 2.0.0(2021-05-12) 8 | 1. 支持uni_modules 9 | -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "zhouWei-APPshare", 3 | "displayName": "APP分享、微博分享、QQ分享、微信好友、朋友圈", 4 | "version": "2.0.3", 5 | "description": "APP分享、微博分享、QQ分享、微信好友、朋友圈", 6 | "keywords": [ 7 | "APP分享", 8 | "分享", 9 | "微信分享" 10 | ], 11 | "repository": "", 12 | "engines": { 13 | "HBuilderX": "^3.1.0" 14 | }, 15 | "dcloudext": { 16 | "category": [ 17 | "JS SDK", 18 | "通用 SDK" 19 | ], 20 | "sale": { 21 | "regular": { 22 | "price": "0.00" 23 | }, 24 | "sourcecode": { 25 | "price": "0.00" 26 | } 27 | }, 28 | "contact": { 29 | "qq": "" 30 | }, 31 | "declaration": { 32 | "ads": "无", 33 | "data": "无", 34 | "permissions": "无" 35 | }, 36 | "npmurl": "" 37 | }, 38 | "uni_modules": { 39 | "dependencies": [], 40 | "encrypt": [], 41 | "platforms": { 42 | "cloud": { 43 | "tcb": "y", 44 | "aliyun": "y" 45 | }, 46 | "client": { 47 | "App": { 48 | "app-vue": "y", 49 | "app-nvue": "y" 50 | }, 51 | "H5-mobile": { 52 | "Safari": "n", 53 | "Android Browser": "n", 54 | "微信浏览器(Android)": "n", 55 | "QQ浏览器(Android)": "n" 56 | }, 57 | "H5-pc": { 58 | "Chrome": "n", 59 | "IE": "n", 60 | "Edge": "n", 61 | "Firefox": "n", 62 | "Safari": "n" 63 | }, 64 | "小程序": { 65 | "微信": "n", 66 | "阿里": "n", 67 | "百度": "n", 68 | "字节跳动": "n", 69 | "QQ": "n" 70 | }, 71 | "快应用": { 72 | "华为": "n", 73 | "联盟": "n" 74 | } 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/readme.md: -------------------------------------------------------------------------------- 1 | # APP分享、微博分享、QQ分享、微信好友、朋友圈 2 | 3 | | `QQ交流群(607391225)` | `微信交流群(加我好友备注"进群")` | 4 | | ----------------------------|--------------------------- | 5 | |![QQ交流群](http://qn.kemean.cn//upload/202004/14/15868301778472k7oubi6.png)|![微信交流群](https://qn.kemean.cn/upload/202010/13/weiXin_group_code.jpg)| 6 | | QQ群号:607391225 |微信号:zhou0612wei| 7 | 8 | ### [点击跳转-插件示例](https://ext.dcloud.net.cn/plugin?id=2009) 9 | ### [点击跳转-5年的web前端开源的uni-app快速开发模板-下载看文档](https://ext.dcloud.net.cn/plugin?id=2009) 10 | 11 | ### 使用方法 第一步 12 | 在`manifest.json`文件里面的`App SDK配置`的`分享`配置对应的平台参数(`不配置参数`在自定义基座里面只会显示`复制`和`更多`, 配置之后要`重新打包`才`生效`) 13 | 14 | ### 常见问题 15 | 1. 运行示例报错 16 | 17 | 答:不要在H5、小程序等浏览器上面运行,此插件只适合在android、IOS上运行 18 | 19 | 2. 分享图标不显示 20 | 21 | 答:插件里面static文件里面的图片放到根目录的static文件里面, 直接导入插件,结构有问题 22 | 23 | 3. 分享出去的图片不显示 24 | 25 | 答:本分享插件使用的官方分享API,有分享问题,仔细研究官方的分享API 26 | 27 | 28 | ### 使用方法 第二步 29 | ``` 30 | 33 | 34 | 64 | ``` 65 | ### 插件说明 66 | | 参数名称 | 类型 | 默认值 | 描述 67 | | -------------- |---------- | ------------ | --------------------------------------- | 68 | | shareUrl | String | -- | 分享的地址`(type 为 0 时必传)` | 69 | | shareTitle | String | -- | 分享的标题 | 70 | | shareContent | String | 分享的描述 | 分享的描述`(type 为 1 时必传)` | 71 | | shareImg | String | 分享的图片 | 分享的图片`(type 为 0、2、5 时必传)` | 72 | | mediaUrl | String | -- | 分享的音视频地址`(type 为 3、4 时必传)` | 73 | | type | Number | 参考平台默认值| 分享形式,如图文、纯文字、纯图片、音乐、视频、小程序等,具体参考下面type说明| 74 | 75 | ### type 值说明 76 | | 值 | 说明 | 支持平台 | 77 | | ------- |--------- | ------------- | 78 | | 0 | 图文 | 微信、新浪微博 | 79 | | 1 | 纯文字 | 全平台支持 | 80 | | 2 | 纯图片 | 全平台支持 | 81 | | 3 | 音乐 | 微信、QQ | 82 | | 4 | 视频 | 微信、新浪微博 | 83 | | 5 | 小程序 | 微信聊天界面 | 84 | 85 | ### 平台默认值 86 | | 平台 | 默认值 | 87 | | ---------- |--------- | 88 | | 新浪微博 | 0 | 89 | | 微信好友 | 0 | 90 | | 微信朋友圈 | 0 | 91 | | QQ | 1 | 92 | | 微信小程序 | 5 | 93 | 94 | ### 分享小程序必传参数`(type 为 5 时必传)` 95 | 注意:`小程序必须是在微信开放平台与App绑定的才行` 96 | | 参数名称 | 类型 | 默认值 | 描述 97 | | -------------- |---------- | ------------ | --------------------------- | 98 | | appId | String | -- | 微信小程序原始id (比传) | 99 | | appPath | String | -- | 点击链接进入的页面 (比传) | 100 | | appWebUrl | String | "" | 兼容低版本的网页链接(比传) | 101 | | appType | Number | 0 | 微信小程序版本类型,可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0 | 102 | -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/ic_xiaochengxu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/ic_xiaochengxu.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_QQkongjian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_QQkongjian.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_copy.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_more.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_pengyouquan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_pengyouquan.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_qq.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_weibo.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-APPshare/static/icon_weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouwei1994/uni-app-template/60415c8f707aa15e89397a094c5ef57cd76af053/uni_modules/zhouWei-APPshare/static/icon_weixin.png -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/changelog.md: -------------------------------------------------------------------------------- 1 | ## 3.3.2(2021-07-29) 2 | 修复app用阿里云上传文件报错 3 | ## 3.3.1(2021-07-09) 4 | 修改阿里云视频上传bug 5 | ## 3.3.0(2021-07-09) 6 | 新增阿里云文件上传、图片上传 7 | ## 3.2.1(2021-05-18) 8 | 新增文件类型 9 | ## 3.2.0(2021-05-12) 10 | 1. 支持uni_modules 11 | -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/core/request.js: -------------------------------------------------------------------------------- 1 | import { mergeConfig, dispatchRequest, jsonpRequest} from "./utils.js"; 2 | export default class request { 3 | constructor(options) { 4 | //请求公共地址 5 | this.baseUrl = options.baseUrl || ""; 6 | //公共文件上传请求地址 7 | this.fileUrl = options.fileUrl || ""; 8 | // 超时时间 9 | this.timeout = options.timeout || 6000; 10 | // 服务器上传图片默认url 11 | this.defaultUploadUrl = options.defaultUploadUrl || ""; 12 | // 服务器上传文件名称 13 | this.defaultFileName = options.defaultFileName || ""; 14 | //默认请求头 15 | this.header = options.header || {}; 16 | //默认配置 17 | this.config = options.config || { 18 | isPrompt: true, 19 | load: true, 20 | isFactory: true, 21 | resend: 0 22 | }; 23 | } 24 | //post请求 25 | post(url = '', data = {}, options = {}) { 26 | return this.request({ 27 | method: "POST", 28 | data: data, 29 | url: url, 30 | ...options 31 | }); 32 | } 33 | 34 | //get请求 35 | get(url = '', data = {}, options = {}) { 36 | return this.request({ 37 | method: "GET", 38 | data: data, 39 | url: url, 40 | ...options 41 | }); 42 | } 43 | 44 | //put请求 45 | put(url = '', data = {}, options = {}) { 46 | return this.request({ 47 | method: "PUT", 48 | data: data, 49 | url: url, 50 | ...options 51 | }); 52 | } 53 | 54 | //delete请求 55 | delete(url = '', data = {}, options = {}) { 56 | return this.request({ 57 | method: "DELETE", 58 | data: data, 59 | url: url, 60 | ...options 61 | }); 62 | } 63 | //jsonp请求(只限于H5使用) 64 | jsonp(url = '', data = {}, options = {}) { 65 | return this.request({ 66 | method: "JSONP", 67 | data: data, 68 | url: url, 69 | ...options 70 | }); 71 | } 72 | //接口请求方法 73 | async request(data) { 74 | // 请求数据 75 | let requestInfo, 76 | // 是否运行过请求开始钩子 77 | runRequestStart = false; 78 | try { 79 | if (!data.url) { 80 | throw { errMsg: "【request】缺失数据url", statusCode: 0} 81 | } 82 | // 数据合并 83 | requestInfo = mergeConfig(this, data); 84 | // 代表之前运行到这里 85 | runRequestStart = true; 86 | //请求前回调 87 | if (this.requestStart) { 88 | let requestStart = this.requestStart(requestInfo); 89 | if (typeof requestStart == "object") { 90 | let changekeys = ["data", "header", "isPrompt", "load", "isFactory"]; 91 | changekeys.forEach(key => { 92 | requestInfo[key] = requestStart[key]; 93 | }); 94 | } else { 95 | throw { 96 | errMsg: "【request】请求开始拦截器未通过", 97 | statusCode: 0, 98 | data: requestInfo.data, 99 | method: requestInfo.method, 100 | header: requestInfo.header, 101 | url: requestInfo.url, 102 | } 103 | } 104 | } 105 | let requestResult = {}; 106 | if(requestInfo.method == "JSONP"){ 107 | requestResult = await jsonpRequest(requestInfo); 108 | } else { 109 | requestResult = await dispatchRequest(requestInfo); 110 | } 111 | //是否用外部的数据处理方法 112 | if (requestInfo.isFactory && this.dataFactory) { 113 | //数据处理 114 | let result = await this.dataFactory({ 115 | ...requestInfo, 116 | response: requestResult 117 | }); 118 | return Promise.resolve(result); 119 | } else { 120 | return Promise.resolve(requestResult); 121 | } 122 | } catch (err){ 123 | this.requestError && this.requestError(err); 124 | return Promise.reject(err); 125 | } finally { 126 | // 如果请求开始未运行到,请求结束也不运行 127 | if(runRequestStart){ 128 | this.requestEnd && this.requestEnd(requestInfo); 129 | } 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/core/utils.js: -------------------------------------------------------------------------------- 1 | // 获取合并的数据 2 | export const mergeConfig = function(_this, options) { 3 | //判断url是不是链接 4 | let urlType = /^(http|https):\/\//.test(options.url); 5 | let config = Object.assign({ 6 | timeout: _this.timeout 7 | }, _this.config, options); 8 | if (options.method == "FILE") { 9 | config.url = urlType ? options.url : _this.fileUrl + options.url; 10 | } else { 11 | config.url = urlType ? options.url : _this.baseUrl + options.url; 12 | } 13 | //请求头 14 | if (options.header) { 15 | config.header = Object.assign({}, _this.header, options.header); 16 | } else { 17 | config.header = Object.assign({}, _this.header); 18 | } 19 | return config; 20 | } 21 | // 请求 22 | export const dispatchRequest = function(requestInfo) { 23 | return new Promise((resolve, reject) => { 24 | let requestAbort = true; 25 | let requestData = { 26 | url: requestInfo.url, 27 | header: requestInfo.header, //加入请求头 28 | success: (res) => { 29 | requestAbort = false; 30 | resolve(res); 31 | }, 32 | fail: (err) => { 33 | requestAbort = false; 34 | if(err.errMsg == "request:fail abort"){ 35 | reject({ 36 | errMsg: "请求超时,请重新尝试", 37 | statusCode: 0, 38 | }); 39 | } else { 40 | reject(err); 41 | } 42 | } 43 | }; 44 | //请求类型 45 | if (requestInfo.method) { 46 | requestData.method = requestInfo.method; 47 | } 48 | if (requestInfo.data) { 49 | requestData.data = requestInfo.data; 50 | } 51 | // #ifdef MP-WEIXIN || MP-ALIPAY 52 | if (requestInfo.timeout) { 53 | requestData.timeout = requestInfo.timeout; 54 | } 55 | // #endif 56 | if (requestInfo.dataType) { 57 | requestData.dataType = requestInfo.dataType; 58 | } 59 | // #ifndef APP-PLUS || MP-ALIPAY 60 | if (requestInfo.responseType) { 61 | requestData.responseType = requestInfo.responseType; 62 | } 63 | // #endif 64 | // #ifdef H5 65 | if (requestInfo.withCredentials) { 66 | requestData.withCredentials = requestInfo.withCredentials; 67 | } 68 | // #endif 69 | let requestTask = uni.request(requestData); 70 | setTimeout(() => { 71 | if(requestAbort){ 72 | requestTask.abort(); 73 | } 74 | }, requestInfo.timeout) 75 | }) 76 | } 77 | // jsonp请求 78 | export const jsonpRequest = function(requestInfo) { 79 | return new Promise((resolve, reject) => { 80 | let dataStr = ''; 81 | Object.keys(requestInfo.data).forEach(key => { 82 | dataStr += key + '=' + requestInfo.data[key] + '&'; 83 | }); 84 | //匹配最后一个&并去除 85 | if (dataStr !== '') { 86 | dataStr = dataStr.substr(0, dataStr.lastIndexOf('&')); 87 | } 88 | requestInfo.url = requestInfo.url + '?' + dataStr; 89 | let callbackName = "callback" + Math.ceil(Math.random() * 1000000); 90 | // #ifdef H5 91 | window[callbackName] = function(data) { 92 | resolve(data); 93 | } 94 | let script = document.createElement("script"); 95 | script.src = requestInfo.url + "&callback=" + callbackName; 96 | document.head.appendChild(script); 97 | // 及时删除,防止加载过多的JS 98 | document.head.removeChild(script); 99 | // #endif 100 | }); 101 | } -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/index.js: -------------------------------------------------------------------------------- 1 | /***************纯粹的数据请求(如果使用这种可以删除掉fileUpload.js)******************/ 2 | // import request from "./core/request.js"; 3 | // export default request; 4 | 5 | /********数据请求同时继承了文件上传(包括七牛云上传)************/ 6 | import upload from "./upload/upload.js"; 7 | export default upload; -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/upload/Base64.js: -------------------------------------------------------------------------------- 1 | const Base64 = { 2 | 3 | // private property 4 | _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 5 | 6 | // public method for encoding 7 | encode: function (input) { 8 | var output = ""; 9 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 10 | var i = 0; 11 | 12 | input = Base64._utf8_encode(input); 13 | 14 | while (i < input.length) { 15 | 16 | chr1 = input.charCodeAt(i++); 17 | chr2 = input.charCodeAt(i++); 18 | chr3 = input.charCodeAt(i++); 19 | 20 | enc1 = chr1 >> 2; 21 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 22 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 23 | enc4 = chr3 & 63; 24 | 25 | if (isNaN(chr2)) { 26 | enc3 = enc4 = 64; 27 | } else if (isNaN(chr3)) { 28 | enc4 = 64; 29 | } 30 | 31 | output = output + 32 | this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + 33 | this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); 34 | 35 | } 36 | 37 | return output; 38 | }, 39 | 40 | // public method for decoding 41 | decode: function (input) { 42 | var output = ""; 43 | var chr1, chr2, chr3; 44 | var enc1, enc2, enc3, enc4; 45 | var i = 0; 46 | 47 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 48 | 49 | while (i < input.length) { 50 | 51 | enc1 = this._keyStr.indexOf(input.charAt(i++)); 52 | enc2 = this._keyStr.indexOf(input.charAt(i++)); 53 | enc3 = this._keyStr.indexOf(input.charAt(i++)); 54 | enc4 = this._keyStr.indexOf(input.charAt(i++)); 55 | 56 | chr1 = (enc1 << 2) | (enc2 >> 4); 57 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 58 | chr3 = ((enc3 & 3) << 6) | enc4; 59 | 60 | output = output + String.fromCharCode(chr1); 61 | 62 | if (enc3 != 64) { 63 | output = output + String.fromCharCode(chr2); 64 | } 65 | if (enc4 != 64) { 66 | output = output + String.fromCharCode(chr3); 67 | } 68 | 69 | } 70 | 71 | output = Base64._utf8_decode(output); 72 | 73 | return output; 74 | 75 | }, 76 | 77 | // private method for UTF-8 encoding 78 | _utf8_encode: function (string) { 79 | string = string.replace(/\r\n/g, "\n"); 80 | var utftext = ""; 81 | 82 | for (var n = 0; n < string.length; n++) { 83 | 84 | var c = string.charCodeAt(n); 85 | 86 | if (c < 128) { 87 | utftext += String.fromCharCode(c); 88 | } else if ((c > 127) && (c < 2048)) { 89 | utftext += String.fromCharCode((c >> 6) | 192); 90 | utftext += String.fromCharCode((c & 63) | 128); 91 | } else { 92 | utftext += String.fromCharCode((c >> 12) | 224); 93 | utftext += String.fromCharCode(((c >> 6) & 63) | 128); 94 | utftext += String.fromCharCode((c & 63) | 128); 95 | } 96 | 97 | } 98 | 99 | return utftext; 100 | }, 101 | 102 | // private method for UTF-8 decoding 103 | _utf8_decode: function (utftext) { 104 | var string = ""; 105 | var i = 0; 106 | var c = c1 = c2 = 0; 107 | 108 | while (i < utftext.length) { 109 | 110 | c = utftext.charCodeAt(i); 111 | 112 | if (c < 128) { 113 | string += String.fromCharCode(c); 114 | i++; 115 | } else if ((c > 191) && (c < 224)) { 116 | c2 = utftext.charCodeAt(i + 1); 117 | string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 118 | i += 2; 119 | } else { 120 | c2 = utftext.charCodeAt(i + 1); 121 | c3 = utftext.charCodeAt(i + 2); 122 | string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 123 | i += 3; 124 | } 125 | 126 | } 127 | 128 | return string; 129 | } 130 | } 131 | 132 | module.exports = Base64; -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/upload/aliUploader.js: -------------------------------------------------------------------------------- 1 | const Base64 = require('./Base64.js'); 2 | require('./hmac.js'); 3 | require('./sha1.js'); 4 | const Crypto = require('./crypto.js'); 5 | // 获取policy 6 | const getPolicyBase64 = function (timeout) { 7 | let dateTime = new Date().getTime(); 8 | let date = new Date(dateTime + (timeout || 1800000)); 9 | let srcT = date.toISOString(); 10 | const policyText = { 11 | "expiration": srcT, //设置该Policy的失效时间 12 | "conditions": [ 13 | ["content-length-range", 0, 100 * 1024 * 1024] // 设置上传文件的大小限制,100mb 14 | ] 15 | }; 16 | const policyBase64 = Base64.encode(JSON.stringify(policyText)); 17 | return policyBase64; 18 | } 19 | // 获取签名 20 | const getSignature = function (policyBase64, AccessKeySecret) { 21 | const bytes = Crypto.HMAC(Crypto.SHA1, policyBase64, AccessKeySecret, { 22 | asBytes: true 23 | }); 24 | const signature = Crypto.util.bytesToBase64(bytes); 25 | return signature; 26 | } 27 | // 获取阿里云token信息 28 | const getAliyunOssKey = function (options) { 29 | const policyBase64 = getPolicyBase64(options.timeout); 30 | const signature = getSignature(policyBase64, options.accessKeySecret); 31 | return { 32 | policy: policyBase64, 33 | accessKeyId: options.accessKeyId, 34 | accessKeySecret: options.accessKeySecret, 35 | signature: signature, 36 | success_action_status: '200' 37 | } 38 | } 39 | 40 | module.exports = getAliyunOssKey; -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/upload/crypto.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Crypto-JS v1.1.0 3 | * http://code.google.com/p/crypto-js/ 4 | * Copyright (c) 2009, Jeff Mott. All rights reserved. 5 | * http://code.google.com/p/crypto-js/wiki/License 6 | */ 7 | 8 | const Crypto = {}; 9 | 10 | (function(){ 11 | 12 | var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 13 | 14 | 15 | // Crypto utilities 16 | var util = Crypto.util = { 17 | 18 | // Bit-wise rotate left 19 | rotl: function (n, b) { 20 | return (n << b) | (n >>> (32 - b)); 21 | }, 22 | 23 | // Bit-wise rotate right 24 | rotr: function (n, b) { 25 | return (n << (32 - b)) | (n >>> b); 26 | }, 27 | 28 | // Swap big-endian to little-endian and vice versa 29 | endian: function (n) { 30 | 31 | // If number given, swap endian 32 | if (n.constructor == Number) { 33 | return util.rotl(n, 8) & 0x00FF00FF | 34 | util.rotl(n, 24) & 0xFF00FF00; 35 | } 36 | 37 | // Else, assume array and swap all items 38 | for (var i = 0; i < n.length; i++) 39 | n[i] = util.endian(n[i]); 40 | return n; 41 | 42 | }, 43 | 44 | // Generate an array of any length of random bytes 45 | randomBytes: function (n) { 46 | for (var bytes = []; n > 0; n--) 47 | bytes.push(Math.floor(Math.random() * 256)); 48 | return bytes; 49 | }, 50 | 51 | // Convert a string to a byte array 52 | stringToBytes: function (str) { 53 | var bytes = []; 54 | for (var i = 0; i < str.length; i++) 55 | bytes.push(str.charCodeAt(i)); 56 | return bytes; 57 | }, 58 | 59 | // Convert a byte array to a string 60 | bytesToString: function (bytes) { 61 | var str = []; 62 | for (var i = 0; i < bytes.length; i++) 63 | str.push(String.fromCharCode(bytes[i])); 64 | return str.join(""); 65 | }, 66 | 67 | // Convert a string to big-endian 32-bit words 68 | stringToWords: function (str) { 69 | var words = []; 70 | for (var c = 0, b = 0; c < str.length; c++, b += 8) 71 | words[b >>> 5] |= str.charCodeAt(c) << (24 - b % 32); 72 | return words; 73 | }, 74 | 75 | // Convert a byte array to big-endian 32-bits words 76 | bytesToWords: function (bytes) { 77 | var words = []; 78 | for (var i = 0, b = 0; i < bytes.length; i++, b += 8) 79 | words[b >>> 5] |= bytes[i] << (24 - b % 32); 80 | return words; 81 | }, 82 | 83 | // Convert big-endian 32-bit words to a byte array 84 | wordsToBytes: function (words) { 85 | var bytes = []; 86 | for (var b = 0; b < words.length * 32; b += 8) 87 | bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); 88 | return bytes; 89 | }, 90 | 91 | // Convert a byte array to a hex string 92 | bytesToHex: function (bytes) { 93 | var hex = []; 94 | for (var i = 0; i < bytes.length; i++) { 95 | hex.push((bytes[i] >>> 4).toString(16)); 96 | hex.push((bytes[i] & 0xF).toString(16)); 97 | } 98 | return hex.join(""); 99 | }, 100 | 101 | // Convert a hex string to a byte array 102 | hexToBytes: function (hex) { 103 | var bytes = []; 104 | for (var c = 0; c < hex.length; c += 2) 105 | bytes.push(parseInt(hex.substr(c, 2), 16)); 106 | return bytes; 107 | }, 108 | 109 | // Convert a byte array to a base-64 string 110 | bytesToBase64: function (bytes) { 111 | 112 | // Use browser-native function if it exists 113 | // if (typeof btoa == "function") return btoa(util.bytesToString(bytes)); 114 | 115 | var base64 = [], 116 | overflow; 117 | 118 | for (var i = 0; i < bytes.length; i++) { 119 | switch (i % 3) { 120 | case 0: 121 | base64.push(base64map.charAt(bytes[i] >>> 2)); 122 | overflow = (bytes[i] & 0x3) << 4; 123 | break; 124 | case 1: 125 | base64.push(base64map.charAt(overflow | (bytes[i] >>> 4))); 126 | overflow = (bytes[i] & 0xF) << 2; 127 | break; 128 | case 2: 129 | base64.push(base64map.charAt(overflow | (bytes[i] >>> 6))); 130 | base64.push(base64map.charAt(bytes[i] & 0x3F)); 131 | overflow = -1; 132 | } 133 | } 134 | 135 | // Encode overflow bits, if there are any 136 | if (overflow != undefined && overflow != -1) 137 | base64.push(base64map.charAt(overflow)); 138 | 139 | // Add padding 140 | while (base64.length % 4 != 0) base64.push("="); 141 | 142 | return base64.join(""); 143 | 144 | }, 145 | 146 | // Convert a base-64 string to a byte array 147 | base64ToBytes: function (base64) { 148 | 149 | // Use browser-native function if it exists 150 | if (typeof atob == "function") return util.stringToBytes(atob(base64)); 151 | 152 | // Remove non-base-64 characters 153 | base64 = base64.replace(/[^A-Z0-9+\/]/ig, ""); 154 | 155 | var bytes = []; 156 | 157 | for (var i = 0; i < base64.length; i++) { 158 | switch (i % 4) { 159 | case 1: 160 | bytes.push((base64map.indexOf(base64.charAt(i - 1)) << 2) | 161 | (base64map.indexOf(base64.charAt(i)) >>> 4)); 162 | break; 163 | case 2: 164 | bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & 0xF) << 4) | 165 | (base64map.indexOf(base64.charAt(i)) >>> 2)); 166 | break; 167 | case 3: 168 | bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & 0x3) << 6) | 169 | (base64map.indexOf(base64.charAt(i)))); 170 | break; 171 | } 172 | } 173 | 174 | return bytes; 175 | 176 | } 177 | 178 | }; 179 | 180 | // Crypto mode namespace 181 | Crypto.mode = {}; 182 | 183 | })(); 184 | 185 | module.exports = Crypto; -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/upload/hmac.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Crypto-JS v1.1.0 3 | * http://code.google.com/p/crypto-js/ 4 | * Copyright (c) 2009, Jeff Mott. All rights reserved. 5 | * http://code.google.com/p/crypto-js/wiki/License 6 | */ 7 | 8 | const Crypto = require('./crypto.js'); 9 | 10 | (function(){ 11 | 12 | // Shortcut 13 | var util = Crypto.util; 14 | 15 | Crypto.HMAC = function (hasher, message, key, options) { 16 | 17 | // Allow arbitrary length keys 18 | key = key.length > hasher._blocksize * 4 ? 19 | hasher(key, { asBytes: true }) : 20 | util.stringToBytes(key); 21 | 22 | // XOR keys with pad constants 23 | var okey = key, 24 | ikey = key.slice(0); 25 | for (var i = 0; i < hasher._blocksize * 4; i++) { 26 | okey[i] ^= 0x5C; 27 | ikey[i] ^= 0x36; 28 | } 29 | 30 | var hmacbytes = hasher(util.bytesToString(okey) + 31 | hasher(util.bytesToString(ikey) + message, { asString: true }), 32 | { asBytes: true }); 33 | return options && options.asBytes ? hmacbytes : 34 | options && options.asString ? util.bytesToString(hmacbytes) : 35 | util.bytesToHex(hmacbytes); 36 | 37 | }; 38 | 39 | })(); 40 | 41 | module.exports = Crypto; -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/request/upload/sha1.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Crypto-JS v1.1.0 3 | * http://code.google.com/p/crypto-js/ 4 | * Copyright (c) 2009, Jeff Mott. All rights reserved. 5 | * http://code.google.com/p/crypto-js/wiki/License 6 | */ 7 | 8 | const Crypto = require('./crypto.js'); 9 | 10 | (function(){ 11 | 12 | // Shortcut 13 | var util = Crypto.util; 14 | 15 | // Public API 16 | var SHA1 = Crypto.SHA1 = function (message, options) { 17 | var digestbytes = util.wordsToBytes(SHA1._sha1(message)); 18 | return options && options.asBytes ? digestbytes : 19 | options && options.asString ? util.bytesToString(digestbytes) : 20 | util.bytesToHex(digestbytes); 21 | }; 22 | 23 | // The core 24 | SHA1._sha1 = function (message) { 25 | 26 | var m = util.stringToWords(message), 27 | l = message.length * 8, 28 | w = [], 29 | H0 = 1732584193, 30 | H1 = -271733879, 31 | H2 = -1732584194, 32 | H3 = 271733878, 33 | H4 = -1009589776; 34 | 35 | // Padding 36 | m[l >> 5] |= 0x80 << (24 - l % 32); 37 | m[((l + 64 >>> 9) << 4) + 15] = l; 38 | 39 | for (var i = 0; i < m.length; i += 16) { 40 | 41 | var a = H0, 42 | b = H1, 43 | c = H2, 44 | d = H3, 45 | e = H4; 46 | 47 | for (var j = 0; j < 80; j++) { 48 | 49 | if (j < 16) w[j] = m[i + j]; 50 | else { 51 | var n = w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16]; 52 | w[j] = (n << 1) | (n >>> 31); 53 | } 54 | 55 | var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + ( 56 | j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 : 57 | j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 : 58 | j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 : 59 | (H1 ^ H2 ^ H3) - 899497514); 60 | 61 | H4 = H3; 62 | H3 = H2; 63 | H2 = (H1 << 30) | (H1 >>> 2); 64 | H1 = H0; 65 | H0 = t; 66 | 67 | } 68 | 69 | H0 += a; 70 | H1 += b; 71 | H2 += c; 72 | H3 += d; 73 | H4 += e; 74 | 75 | } 76 | 77 | return [H0, H1, H2, H3, H4]; 78 | 79 | }; 80 | 81 | // Package private blocksize 82 | SHA1._blocksize = 16; 83 | 84 | })(); 85 | 86 | module.exports = Crypto; -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/js_sdk/requestConfig.js: -------------------------------------------------------------------------------- 1 | import request from "./request"; 2 | // 全局配置的请求域名 3 | let baseUrl = "http://www.xxx.com/api/"; 4 | //可以new多个request来支持多个域名请求 5 | let $http = new request({ 6 | //接口请求地址 7 | baseUrl: baseUrl, 8 | //服务器本地上传文件地址 9 | fileUrl: baseUrl, 10 | // 服务器上传图片默认url 11 | defaultUploadUrl: "api/common/v1/upload_image", 12 | //设置请求头(如果使用报错跨域问题,可能是content-type请求类型和后台那边设置的不一致) 13 | header: { 14 | 'content-type': 'application/json;charset=UTF-8' 15 | }, 16 | // 请求超时时间(默认6000) 17 | timeout: 6000, 18 | // 默认配置(可不写) 19 | config: { 20 | // 是否自动提示错误 21 | isPrompt: true, 22 | // 是否显示加载动画 23 | load: true, 24 | // 是否使用数据工厂 25 | isFactory: true 26 | } 27 | }); 28 | 29 | // 添加获取七牛云token的方法 30 | $http.getQnToken = function(callback){ 31 | //该地址需要开发者自行配置(每个后台的接口风格都不一样) 32 | $http.get("api/kemean/aid/qn_upload").then(data => { 33 | /* 34 | *接口返回参数: 35 | *visitPrefix:访问文件的域名 36 | *token:七牛云上传token 37 | *folderPath:上传的文件夹 38 | *region: 地区 默认为:SCN 39 | */ 40 | callback({ 41 | visitPrefix: data.visitPrefix, 42 | token: data.token, 43 | folderPath: data.folderPath, 44 | region: "SCN" 45 | }); 46 | }); 47 | } 48 | // 添加获取阿里云token的方法 49 | $http.getAliToken = function(callback){ 50 | //该地址需要开发者自行配置(每个后台的接口风格都不一样) 51 | $http.get("api/open/v1/ali_oss_upload").then(data => { 52 | /* 53 | *接口返回参数: 54 | *visitPrefix: 访问文件的域名 55 | *folderPath: 上传的文件夹 56 | *region: 地区 57 | *bucket: 阿里云的 bucket 58 | *accessKeyId: 阿里云的访问ID 59 | *accessKeySecret: 阿里云的访问密钥 60 | *stsToken: 阿里云的访问token 61 | */ 62 | callback({ 63 | accessKeyId: data.accessKeyId, 64 | accessKeySecret: data.accessKeySecret, 65 | bucket: data.bucket, 66 | region: data.region, 67 | visitPrefix: data.visitPrefix, 68 | token: data.token, 69 | folderPath: data.folderPath, 70 | stsToken: data.securityToken, 71 | }); 72 | }); 73 | } 74 | //当前接口请求数 75 | let requestNum = 0; 76 | //请求开始拦截器 77 | $http.requestStart = function(options) { 78 | if (options.load) { 79 | if (requestNum <= 0) { 80 | //打开加载动画 81 | uni.showLoading({ 82 | title: '加载中', 83 | mask: true 84 | }); 85 | } 86 | requestNum += 1; 87 | } 88 | // 图片、视频上传大小限制 89 | if (options.method == "FILE") { 90 | // 文件最大字节: options.maxSize 可以在调用方法的时候加入参数 91 | let maxSize = options.maxSize || ''; 92 | for (let item of options.files) { 93 | if(item.fileType == 'image'){ 94 | if (maxSize && item.size > maxSize) { 95 | setTimeout(() => { 96 | uni.showToast({ 97 | title: "图片过大,请重新上传", 98 | icon: "none" 99 | }); 100 | }, 500); 101 | return false; 102 | } 103 | } else if(item.fileType == "video"){ 104 | if (item.duration < 3) { 105 | setTimeout(() => { 106 | uni.showToast({ 107 | title: "视频长度不足3秒,请重新上传", 108 | icon: "none" 109 | }); 110 | }, 500); 111 | return false; 112 | } 113 | } 114 | } 115 | } 116 | //请求前加入token 117 | options.header['token'] = "你的项目登录token"; 118 | return options; // return false 表示请求拦截,不会继续请求 119 | } 120 | //请求结束 121 | $http.requestEnd = function(options) { 122 | //判断当前接口是否需要加载动画 123 | if (options.load) { 124 | requestNum = requestNum - 1; 125 | if (requestNum <= 0) { 126 | uni.hideLoading(); 127 | } 128 | } 129 | } 130 | //登录弹窗次数 131 | let loginPopupNum = 0; 132 | //所有接口数据处理(可在接口里设置不调用此方法) 133 | //此方法需要开发者根据各自的接口返回类型修改,以下只是模板 134 | $http.dataFactory = async function(res) { 135 | console.log("接口请求数据", { 136 | url: res.url, 137 | resolve: res.response, 138 | header: res.header, 139 | data: res.data, 140 | method: res.method, 141 | }); 142 | if (res.response.statusCode && res.response.statusCode == 200) { 143 | let httpData = res.response.data; 144 | if (typeof (httpData) == "string") { 145 | httpData = JSON.parse(httpData); 146 | } 147 | /*********以下只是模板(及共参考),需要开发者根据各自的接口返回类型修改*********/ 148 | 149 | //判断数据是否请求成功 150 | if (httpData.success || httpData.code == 200) { 151 | // 返回正确的结果(then接受数据) 152 | return Promise.resolve(httpData.data); 153 | } else if (httpData.code == "1000" || httpData.code == "1001" || httpData.code == 1100) { 154 | let content = '此时此刻需要您登录喔~'; 155 | if (loginPopupNum <= 0) { 156 | loginPopupNum++; 157 | uni.showModal({ 158 | title: '温馨提示', 159 | content: content, 160 | confirmText: "去登录", 161 | cancelText: "再逛会", 162 | success: function (res) { 163 | loginPopupNum--; 164 | if (res.confirm) { 165 | uni.navigateTo({ 166 | url: "/pages/user/login" 167 | }); 168 | } 169 | } 170 | }); 171 | } 172 | // 返回错误的结果(catch接受数据) 173 | return Promise.reject({ 174 | statusCode: 0, 175 | errMsg: "【request】" + (httpData.info || httpData.msg) 176 | }); 177 | } else { //其他错误提示 178 | if (res.isPrompt) { 179 | uni.showToast({ 180 | title: httpData.info || httpData.msg, 181 | icon: "none", 182 | duration: 3000 183 | }); 184 | } 185 | // 返回错误的结果(catch接受数据) 186 | return Promise.reject({ 187 | statusCode: 0, 188 | errMsg: "【request】" + (httpData.info || httpData.msg) 189 | }); 190 | } 191 | 192 | /*********以上只是模板(及共参考),需要开发者根据各自的接口返回类型修改*********/ 193 | 194 | } else { 195 | // 返回错误的结果(catch接受数据) 196 | return Promise.reject({ 197 | statusCode: res.response.statusCode, 198 | errMsg: "【request】数据工厂验证不通过" 199 | }); 200 | } 201 | }; 202 | // 错误回调 203 | $http.requestError = function (e) { 204 | // e.statusCode === 0 是参数效验错误抛出的 205 | if (e.statusCode === 0) { 206 | throw e; 207 | } else { 208 | uni.showToast({ 209 | title: "网络错误,请检查一下网络", 210 | icon: "none" 211 | }); 212 | } 213 | } 214 | export default $http; 215 | -------------------------------------------------------------------------------- /uni_modules/zhouWei-request/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "zhouWei-request", 3 | "displayName": "request请求、配置简单、批量上传图片、视频、超强适应性(支持多域名请求)", 4 | "version": "3.3.2", 5 | "description": "适用于一项目多域名请求、七牛云图片上传、阿里云图片上传、本地服务器图片上传、支持 Promise", 6 | "keywords": [ 7 | "request", 8 | "请求", 9 | "http", 10 | "ajax", 11 | "上传" 12 | ], 13 | "repository": "https://github.com/zhouwei1994/uni-app-demo", 14 | "engines": { 15 | "HBuilderX": "^3.1.0" 16 | }, 17 | "dcloudext": { 18 | "category": [ 19 | "JS SDK", 20 | "通用 SDK" 21 | ], 22 | "sale": { 23 | "regular": { 24 | "price": "0.00" 25 | }, 26 | "sourcecode": { 27 | "price": "0.00" 28 | } 29 | }, 30 | "contact": { 31 | "qq": "465081029" 32 | }, 33 | "declaration": { 34 | "ads": "无", 35 | "data": "无", 36 | "permissions": "无" 37 | }, 38 | "npmurl": "" 39 | }, 40 | "uni_modules": { 41 | "dependencies": [], 42 | "encrypt": [], 43 | "platforms": { 44 | "cloud": { 45 | "tcb": "y", 46 | "aliyun": "y" 47 | }, 48 | "client": { 49 | "App": { 50 | "app-vue": "y", 51 | "app-nvue": "y" 52 | }, 53 | "H5-mobile": { 54 | "Safari": "y", 55 | "Android Browser": "y", 56 | "微信浏览器(Android)": "y", 57 | "QQ浏览器(Android)": "y" 58 | }, 59 | "H5-pc": { 60 | "Chrome": "y", 61 | "IE": "y", 62 | "Edge": "y", 63 | "Firefox": "y", 64 | "Safari": "y" 65 | }, 66 | "小程序": { 67 | "微信": "y", 68 | "阿里": "y", 69 | "百度": "y", 70 | "字节跳动": "y", 71 | "QQ": "y" 72 | }, 73 | "快应用": { 74 | "华为": "y", 75 | "联盟": "y" 76 | } 77 | } 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /项目资料.txt: -------------------------------------------------------------------------------- 1 | 1. 包名:com.uniProject 2 | --------------------------------------------------------------------------------