commit bf8dc07cb7f64f577b994378f25b6861a657bd06 Author: 山兮 <3208053815@qq.com> Date: Thu Mar 21 13:53:51 2024 +0800 初始化项目 diff --git a/.buildpath b/.buildpath new file mode 100644 index 0000000..8bcb4b5 --- /dev/null +++ b/.buildpath @@ -0,0 +1,5 @@ + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a503fa2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/unpackage/ diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..ee5be77 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,20 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "app-plus" : + { + "launchtype" : "local" + }, + "default" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..10b731c --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ diff --git a/.idea/UniappTool.xml b/.idea/UniappTool.xml new file mode 100644 index 0000000..8694db6 --- /dev/null +++ b/.idea/UniappTool.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/.idea/dengLan_home_mpWeixin.iml b/.idea/dengLan_home_mpWeixin.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/dengLan_home_mpWeixin.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6db107f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.project b/.project new file mode 100644 index 0000000..3bf5aad --- /dev/null +++ b/.project @@ -0,0 +1,22 @@ + + + djh5 + + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.dltk.core.scriptbuilder + + + + + + org.eclipse.php.core.PHPNature + + diff --git a/.settings/org.eclipse.php.core.prefs b/.settings/org.eclipse.php.core.prefs new file mode 100644 index 0000000..d8cdb4a --- /dev/null +++ b/.settings/org.eclipse.php.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +include_path=0;/djh5 +use_asp_tags_as_php=false diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..6ec7375 --- /dev/null +++ b/App.vue @@ -0,0 +1,381 @@ + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/agent/pages/account.vue b/agent/pages/account.vue new file mode 100644 index 0000000..753085c --- /dev/null +++ b/agent/pages/account.vue @@ -0,0 +1,135 @@ + + + + + + \ No newline at end of file diff --git a/agent/pages/apply.vue b/agent/pages/apply.vue new file mode 100644 index 0000000..868e0b5 --- /dev/null +++ b/agent/pages/apply.vue @@ -0,0 +1,315 @@ + + + + + + \ No newline at end of file diff --git a/agent/pages/income/commission.vue b/agent/pages/income/commission.vue new file mode 100644 index 0000000..8d2cc6c --- /dev/null +++ b/agent/pages/income/commission.vue @@ -0,0 +1,576 @@ + + + + + + \ No newline at end of file diff --git a/agent/pages/index.vue b/agent/pages/index.vue new file mode 100644 index 0000000..efc49af --- /dev/null +++ b/agent/pages/index.vue @@ -0,0 +1,653 @@ + + + + + + \ No newline at end of file diff --git a/agent/pages/order/change.vue b/agent/pages/order/change.vue new file mode 100644 index 0000000..d50ce8b --- /dev/null +++ b/agent/pages/order/change.vue @@ -0,0 +1,508 @@ + + + + + diff --git a/dynamic/pages/technician/follow.vue b/dynamic/pages/technician/follow.vue new file mode 100644 index 0000000..4557753 --- /dev/null +++ b/dynamic/pages/technician/follow.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/dynamic/pages/technician/list.vue b/dynamic/pages/technician/list.vue new file mode 100644 index 0000000..0832e84 --- /dev/null +++ b/dynamic/pages/technician/list.vue @@ -0,0 +1,341 @@ + + + + + diff --git a/dynamic/pages/technician/thumbs.vue b/dynamic/pages/technician/thumbs.vue new file mode 100644 index 0000000..56de56e --- /dev/null +++ b/dynamic/pages/technician/thumbs.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/jweixin-module/README.md b/jweixin-module/README.md new file mode 100644 index 0000000..7c91d7b --- /dev/null +++ b/jweixin-module/README.md @@ -0,0 +1,30 @@ +# jweixin-module + +微信JS-SDK + +## 安装 + +### NPM + +```shell +npm install jweixin-module --save +``` + +### UMD + +```http +https://unpkg.com/jweixin-module/out/index.js +``` + +## 使用 + +```js +var jweixin = require('jweixin-module') +jweixin.ready(function(){ + // TODO +}); +``` + +## 完整API + +>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115) diff --git a/jweixin-module/lib/index.js b/jweixin-module/lib/index.js new file mode 100644 index 0000000..ae4baaf --- /dev/null +++ b/jweixin-module/lib/index.js @@ -0,0 +1 @@ +!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ], + "autoSdkPermissions" : true + }, + "icons" : { + // 改为自己的 logo + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png" + }, + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png" + } + } + }, + "ios" : { + "capabilities" : { + "entitlements" : { + "com.apple.developer.associated-domains" : [ "applinks:testapps.cncnconnect.com" ] // 改为自己的 + } + }, + "dSYMs" : false, + "privacyDescription" : { + // ios隐私信息访问许可描述 + "NSPhotoLibraryUsageDescription" : "允许手机存储权限读写相册,注册服务人员/退款时需从相册中选择图片", + "NSPhotoLibraryAddUsageDescription" : "允许手机存储权限读写相册,用于保存图片", + "NSCameraUsageDescription" : "需要访问相册,以便于上传服务人员资格证书、工作形象照等功能", + "NSLocationWhenInUseUsageDescription" : "允许获取您的位置信息,以便获取您附近的服务人员,更好的为您服务", + "NSLocationAlwaysUsageDescription" : "允许获取您的位置信息,以便获取您附近的服务人员,更好的为您服务", + "NSLocationAlwaysAndWhenInUseUsageDescription" : "允许获取您的位置信息,以便获取您附近的服务人员,更好的为您服务" + } + } + } + }, + "nativePlugins" : {}, + "_spaceID" : "8a1db412-049f-4be6-894a-755ffe5ebe5b" +} diff --git a/package (2).json b/package (2).json new file mode 100644 index 0000000..f7d3409 --- /dev/null +++ b/package (2).json @@ -0,0 +1,17 @@ +{ + "id": "jarvis-timePickerPopup", + "name": "时间范围弹窗选择器", + "displayName": "时间范围弹窗选择器", + "version": "1.0.0", + "description": "时间范围弹窗选择器:使用uni-popup+picker-view实现", + "keywords": [ + "时间选择器", + "时间范围" + ], + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ] + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1861f19 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,16 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "jweixin-module": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz", + "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==" + }, + "vue-i18n": { + "version": "8.28.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.28.2.tgz", + "integrity": "sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5bd9dac --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "jweixin-module": "^1.6.0", + "vue-i18n": "^8.18.2" + } +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..4cf9bfa --- /dev/null +++ b/pages.json @@ -0,0 +1,807 @@ +{ + "pages": [{ + "path": "pages/service", + "style": { + "navigationBarTitleText": "首页", + //#ifndef H5 + "navigationStyle": "custom", + //#endif + "enablePullDownRefresh": true + } + }, + { + "path": "pages/map", + "style": { + "navigationBarTitleText": "技师", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/technician", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/shopstore", + "style": { + "navigationBarTitleText": "门店", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/dynamic", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/order", + "style": { + "navigationBarTitleText": "订单", + //#ifndef H5 + "navigationStyle": "custom", + //#endif + "enablePullDownRefresh": true + } + }, + { + "path": "pages/mine", + "style": { + "navigationBarTitleText": "我的", + //#ifndef H5 + "navigationStyle": "custom", + //#endif + "enablePullDownRefresh": true + } + } + //#ifndef MP-WEIXIN + , { + "path": "pages/login", // app H5登陆页面 + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#ffffff" + } + }, + { + "path" : "pages/test", + "style" : + { + "navigationBarTitleText" : "", + "enablePullDownRefresh" : false + } + } + //#endif + ], + "subPackages": [ + // 用户端 + { + "root": "user/", + "pages": [{ + "path": "pages/detail", + "style": { + "navigationBarTitleText": "服务详情" + } + }, + { + "path": "pages/article", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/protocol", + "style": { + "navigationBarTitleText": "隐私政策" + } + }, + { + "path": "pages/information", + "style": { + "navigationBarTitleText": "服务协议" + } + }, + { + "path": "pages/collect", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/technician-info", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/merchant-info", + "style": { + "navigationBarTitleText": "商户信息" + } + }, + { + "path": "pages/comment", + "style": { + "navigationBarTitleText": "评论", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/order", + "style": { + "navigationBarTitleText": "下单" + } + }, + { + "path": "pages/choose-time", + "style": { + "navigationBarTitleText": "选择时间" + } + }, + { + "path": "pages/choose-technician", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/address/list", + "style": { + "navigationBarTitleText": "地址列表", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/address/edit", + "style": { + "navigationBarTitleText": "添加新地址" + } + }, + { + "path": "pages/order/bell-list", + "style": { + "navigationBarTitleText": "加钟订单", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/order/sign", + "style": { + "navigationBarTitleText": "签名确认" + } + }, + { + "path": "pages/order/detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "pages/order/refund", + "style": { + "navigationBarTitleText": "申请退款" + } + }, + { + "path": "pages/order/evaluate", + "style": { + "navigationBarTitleText": "评价" + } + }, + { + "path": "pages/refund/list", + "style": { + "navigationBarTitleText": "售后/退款", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/refund/detail", + "style": { + "navigationBarTitleText": "售后详情" + } + }, { + "path": "pages/channel/apply", + "style": { + "navigationBarTitleText": "" + } + }, { + "path": "pages/channel/income", + "style": { + "navigationBarTitleText": "我是渠道商", + "enablePullDownRefresh": true + } + }, { + "path": "pages/channel/poster", + "style": { + "navigationBarTitleText": "渠道码" + } + }, { + "path": "pages/salesman/apply", + "style": { + "navigationBarTitleText": "" + } + }, { + "path": "pages/salesman/income", + "style": { + "navigationBarTitleText": "我是业务员", + "enablePullDownRefresh": true + } + }, { + "path": "pages/salesman/record", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/service/list", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/service/cate", + "style": { + "navigationBarTitleText": "全部分类" + } + }, { + "path": "pages/common/web", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/common/video", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/coupon/list", + "style": { + "navigationBarTitleText": "我的卡券", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/coupon/use", + "style": { + "navigationBarTitleText": "选择卡券", + "enablePullDownRefresh": true + } + }, { + "path": "pages/coupon/share", + "style": { + "navigationBarTitleText": "分享有奖", + "enablePullDownRefresh": true + } + }, { + "path": "pages/coupon/poster", + "style": { + "navigationBarTitleText": "我的邀请码" + } + }, { + "path": "pages/stored/list", + "style": { + "navigationBarTitleText": "余额充值", + "enablePullDownRefresh": true + } + }, { + "path": "pages/stored/choose-technician", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/stored/commission", + "style": { + "navigationBarTitleText": "佣金流水", + "enablePullDownRefresh": true + } + }, { + "path": "pages/stored/record", + "style": { + "navigationBarTitleText": "充值记录", + "enablePullDownRefresh": true + } + }, { + "path": "pages/stored/consume", + "style": { + "navigationBarTitleText": "消费明细", + "enablePullDownRefresh": true + } + }, { + "path": "pages/stored/poster", + "style": { + "navigationBarTitleText": "邀请好友" + } + }, { + "path": "pages/distribution/apply", + "style": { + "navigationBarTitleText": "申请分销商" + } + }, { + "path": "pages/distribution/income", + "style": { + "navigationBarTitleText": "我的收入", + "enablePullDownRefresh": true + } + }, { + "path": "pages/distribution/record", + "style": { + "navigationBarTitleText": "提现记录", + "enablePullDownRefresh": true + } + }, { + "path": "pages/distribution/team", + "style": { + "navigationBarTitleText": "我的邀请", + "enablePullDownRefresh": true + } + }, { + "path": "pages/distribution/poster", + "style": { + "navigationBarTitleText": "推广海报" + } + }, + { + "path": "pages/distribution/bind-technician", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/distribution/share-set", + "style": { + "navigationBarTitleText": "分享设置" + } + }, + { + "path": "pages/distribution/agent", + "style": { + "navigationBarTitleText": "选择代理商" + } + }, { + "path": "pages/cash-out", + "style": { + "navigationBarTitleText": "提现" + } + }, + //#ifndef MP-WEIXIN + { + "path": "pages/alipay-account", + "style": { + "navigationBarTitleText": "绑定支付宝账号" + } + }, + //#endif + { + "path": "pages/alipay-result", + "style": { + "navigationBarTitleText": "支付宝支付", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/apply-result", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/app-download", + "style": { + "navigationBarTitleText": "APP下载", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/phone-code", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/phone", + "style": { + "navigationBarTitleText": "绑定手机号" + } + }, + { + "path": "pages/setting", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "pages/shield", + "style": { + "navigationBarTitleText": "屏蔽列表", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/logout", + "style": { + "navigationBarTitleText": "注销账户" + } + }, + { + "path": "pages/feedback/box", + "style": { + "navigationBarTitleText": "问题反馈" + } + }, + { + "path": "pages/feedback/list", + "style": { + "navigationBarTitleText": "反馈记录", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/feedback/detail", + "style": { + "navigationBarTitleText": "反馈详情" + } + }, + { + "path": "pages/feedback/success", + "style": { + "navigationBarTitleText": "提交结果" + } + }, + { + "path": "pages/bell/list", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/bell/order", + "style": { + "navigationBarTitleText": "下单" + } + }, + { + "path": "pages/gzh", + "style": { + "navigationBarTitleText": "关注公众号" + } + } + ] + }, + // 代理端 + { + "root": "agent/", + "pages": [{ + "path": "pages/index", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/account", + "style": { + "navigationBarTitleText": "账号设置" + } + }, { + "path": "pages/apply", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/income/commission", + "style": { + "navigationBarTitleText": "分佣明细", + "enablePullDownRefresh": true + } + }, { + "path": "pages/order/list", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/order/change", + "style": { + "navigationBarTitleText": "拒单管理", + "enablePullDownRefresh": true + } + }, { + "path": "pages/order/detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, { + "path": "pages/refund/list", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/refund/detail", + "style": { + "navigationBarTitleText": "退款详情" + } + }, { + "path": "pages/technician/list", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician/user", + "style": { + "navigationBarTitleText": "选择用户", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician/apply", + "style": { + "navigationBarTitleText": "" + } + }, { + "path": "pages/poster/channel", + "style": { + "navigationBarTitleText": "邀请渠道商" + } + }, { + "path": "pages/poster/salesman", + "style": { + "navigationBarTitleText": "邀请业务员" + } + }] + }, + // 技-师 + { + "root": "technician/", + "pages": [{ + "path": "pages/apply", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/order/recorder", + "style": { + "navigationBarTitleText": "测试录音" + } + }, + { + "path": "pages/edit", + "style": { + "navigationBarTitleText": "编辑信息" + } + }, + { + "path": "pages/time-manage", + "style": { + "navigationBarTitleText": "时间管理" + } + }, + { + "path": "pages/time-set", + "style": { + "navigationBarTitleText": "出行设置" + } + }, + { + "path": "pages/income/index", + "style": { + "navigationBarTitleText": "服务费提现", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/income/cash-integral", + "style": { + "navigationBarTitleText": "储值返佣明细", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/income/commission-list", + "style": { + "navigationBarTitleText": "分成明细", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/income/commission-detail", + "style": { + "navigationBarTitleText": "收益详情" + } + }, + { + "path": "pages/order/label", + "style": { + "navigationBarTitleText": "评价客户" + } + }, + { + "path": "pages/order/list", + "style": { + "navigationBarTitleText": "订单管理", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/order/detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "pages/car-fare", + "style": { + "navigationBarTitleText": "车费明细" + } + }, + { + "path": "pages/shop/detail", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/shop/list", + "style": { + "navigationBarTitleText": "物料商城", + "enablePullDownRefresh": true + } + }, { + "path": "pages/bad-comments/box", + "style": { + "navigationBarTitleText": "差评申诉" + } + }, { + "path": "pages/bad-comments/list", + "style": { + "navigationBarTitleText": "申诉记录", + "enablePullDownRefresh": true + } + }, { + "path": "pages/bad-comments/choice", + "style": { + "navigationBarTitleText": "选择订单", + "enablePullDownRefresh": true + } + }, { + "path": "pages/bad-comments/success", + "style": { + "navigationBarTitleText": "提交结果" + } + }, { + "path": "pages/level", + "style": { + "navigationBarTitleText": "等级管理" + } + }, { + "path": "pages/shield", + "style": { + "navigationBarTitleText": "拉黑用户", + "enablePullDownRefresh": true + } + } + ] + }, + // 门店 + { + "root": "shopstore/", + "pages": [{ + "path": "pages/store-info", + "style": { + "navigationBarTitleText": "" + } + }, { + "path": "pages/detail", + "style": { + "navigationBarTitleText": "商家详情", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, { + "path": "pages/service", + "style": { + "navigationBarTitleText": "推荐服务", + "enablePullDownRefresh": true + } + }] + }, + // 动态 + { + "root": "dynamic/", + "pages": [{ + "path": "pages/technician/edit", + "style": { + "navigationBarTitleText": "发布动态" + } + }, { + "path": "pages/technician/comment", + "style": { + "navigationBarTitleText": "收获的评论", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician/detail", + "style": { + "navigationBarTitleText": "动态详情", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician/follow", + "style": { + "navigationBarTitleText": "新增关注", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician/list", + "style": { + "navigationBarTitleText": "动态发布", + "enablePullDownRefresh": true + } + }, { + "path": "pages/technician/thumbs", + "style": { + "navigationBarTitleText": "收获的赞", + "enablePullDownRefresh": true + } + }, { + "path": "pages/detail", + "style": { + "navigationBarTitleText": "动态详情", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, { + "path": "pages/follow", + "style": { + "navigationBarTitleText": "我的关注", + "enablePullDownRefresh": true + } + }] + } + ], + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#F4F6F8", + "backgroundColor": "#F8F8F8", + "onReachBottomDistance": 140 + }, + "condition": { //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [{ + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }] + }, + "requiredPrivateInfos": [ + "getLocation", + "chooseLocation" + ] +} \ No newline at end of file diff --git a/pages/dynamic.vue b/pages/dynamic.vue new file mode 100644 index 0000000..b6b208f --- /dev/null +++ b/pages/dynamic.vue @@ -0,0 +1,396 @@ + + + + + + \ No newline at end of file diff --git a/pages/login.vue b/pages/login.vue new file mode 100644 index 0000000..a7bb915 --- /dev/null +++ b/pages/login.vue @@ -0,0 +1,326 @@ + + + + + \ No newline at end of file diff --git a/pages/map.vue b/pages/map.vue new file mode 100644 index 0000000..b5d6ef3 --- /dev/null +++ b/pages/map.vue @@ -0,0 +1,866 @@ + + + + + + \ No newline at end of file diff --git a/pages/mine.vue b/pages/mine.vue new file mode 100644 index 0000000..b5b7fc3 --- /dev/null +++ b/pages/mine.vue @@ -0,0 +1,1530 @@ + + + + + \ No newline at end of file diff --git a/pages/order.vue b/pages/order.vue new file mode 100644 index 0000000..ab2271e --- /dev/null +++ b/pages/order.vue @@ -0,0 +1,417 @@ + + + + + + diff --git a/pages/service.vue b/pages/service.vue new file mode 100644 index 0000000..6b00534 --- /dev/null +++ b/pages/service.vue @@ -0,0 +1,793 @@ + + + + + + diff --git a/pages/shopstore.vue b/pages/shopstore.vue new file mode 100644 index 0000000..34921ea --- /dev/null +++ b/pages/shopstore.vue @@ -0,0 +1,382 @@ + + + + + + \ No newline at end of file diff --git a/pages/technician.vue b/pages/technician.vue new file mode 100644 index 0000000..12ea15f --- /dev/null +++ b/pages/technician.vue @@ -0,0 +1,587 @@ + + + + + + \ No newline at end of file diff --git a/pages/test.vue b/pages/test.vue new file mode 100644 index 0000000..10caad8 --- /dev/null +++ b/pages/test.vue @@ -0,0 +1,82 @@ + + + + + \ No newline at end of file diff --git a/shopstore/pages/detail.vue b/shopstore/pages/detail.vue new file mode 100644 index 0000000..82ebcab --- /dev/null +++ b/shopstore/pages/detail.vue @@ -0,0 +1,409 @@ + + + + + + \ No newline at end of file diff --git a/shopstore/pages/service.vue b/shopstore/pages/service.vue new file mode 100644 index 0000000..f188dd7 --- /dev/null +++ b/shopstore/pages/service.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/shopstore/pages/store-info.vue b/shopstore/pages/store-info.vue new file mode 100644 index 0000000..3587e43 --- /dev/null +++ b/shopstore/pages/store-info.vue @@ -0,0 +1,130 @@ + + + + + + diff --git a/shopstore/pages/technician.vue b/shopstore/pages/technician.vue new file mode 100644 index 0000000..7ef0137 --- /dev/null +++ b/shopstore/pages/technician.vue @@ -0,0 +1,303 @@ + + + + + + \ No newline at end of file diff --git a/siteinfo.js b/siteinfo.js new file mode 100644 index 0000000..fbeb92b --- /dev/null +++ b/siteinfo.js @@ -0,0 +1,8 @@ +module.exports = { + // 预约按摩 多城市 + "uniacid": "666", + "multiid": "0", + "version": "3.0", + "gzh_appid": "wx88bf27358c22f867", + "siteroot": "https://tianjin.tianjinhualong.cn/index.php" +} diff --git a/static/coupon/btn.png b/static/coupon/btn.png new file mode 100644 index 0000000..0ee1366 Binary files /dev/null and b/static/coupon/btn.png differ diff --git a/static/coupon/coupon.png b/static/coupon/coupon.png new file mode 100644 index 0000000..7f2f454 Binary files /dev/null and b/static/coupon/coupon.png differ diff --git a/static/coupon/line.png b/static/coupon/line.png new file mode 100644 index 0000000..db7cb69 Binary files /dev/null and b/static/coupon/line.png differ diff --git a/static/coupon/menu.png b/static/coupon/menu.png new file mode 100644 index 0000000..7524602 Binary files /dev/null and b/static/coupon/menu.png differ diff --git a/static/coupon/picture.png b/static/coupon/picture.png new file mode 100644 index 0000000..9ffeda8 Binary files /dev/null and b/static/coupon/picture.png differ diff --git a/static/coupon/wechat-moments.png b/static/coupon/wechat-moments.png new file mode 100644 index 0000000..095e2d8 Binary files /dev/null and b/static/coupon/wechat-moments.png differ diff --git a/static/coupon/wechat.png b/static/coupon/wechat.png new file mode 100644 index 0000000..71c2cca Binary files /dev/null and b/static/coupon/wechat.png differ diff --git a/static/img/axg.png b/static/img/axg.png new file mode 100644 index 0000000..5bcfeb1 Binary files /dev/null and b/static/img/axg.png differ diff --git a/static/img/icon_project.png b/static/img/icon_project.png new file mode 100644 index 0000000..73fa2e6 Binary files /dev/null and b/static/img/icon_project.png differ diff --git a/static/img/icon_technician.png b/static/img/icon_technician.png new file mode 100644 index 0000000..501cfef Binary files /dev/null and b/static/img/icon_technician.png differ diff --git a/static/img/qs_dingdan.png b/static/img/qs_dingdan.png new file mode 100644 index 0000000..60b54f0 Binary files /dev/null and b/static/img/qs_dingdan.png differ diff --git a/static/logo-120.png b/static/logo-120.png new file mode 100644 index 0000000..d7a6f5c Binary files /dev/null and b/static/logo-120.png differ diff --git a/static/logo-180.png b/static/logo-180.png new file mode 100644 index 0000000..3a36a87 Binary files /dev/null and b/static/logo-180.png differ diff --git a/static/logo-40.png b/static/logo-40.png new file mode 100644 index 0000000..d6b66c4 Binary files /dev/null and b/static/logo-40.png differ diff --git a/static/logo-58.png b/static/logo-58.png new file mode 100644 index 0000000..af0a7ba Binary files /dev/null and b/static/logo-58.png differ diff --git a/static/logo-60.png b/static/logo-60.png new file mode 100644 index 0000000..47882fb Binary files /dev/null and b/static/logo-60.png differ diff --git a/static/logo-80.png b/static/logo-80.png new file mode 100644 index 0000000..314a0d8 Binary files /dev/null and b/static/logo-80.png differ diff --git a/static/logo-87.png b/static/logo-87.png new file mode 100644 index 0000000..2a073a1 Binary files /dev/null and b/static/logo-87.png differ diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..c4d3557 Binary files /dev/null and b/static/logo.png differ diff --git a/static/mine/Add.png b/static/mine/Add.png new file mode 100644 index 0000000..da6f25e Binary files /dev/null and b/static/mine/Add.png differ diff --git a/static/mine/Wallet.png b/static/mine/Wallet.png new file mode 100644 index 0000000..b4a6c2f Binary files /dev/null and b/static/mine/Wallet.png differ diff --git a/static/mine/auth.png b/static/mine/auth.png new file mode 100644 index 0000000..4194edf Binary files /dev/null and b/static/mine/auth.png differ diff --git a/static/mine/balance.png b/static/mine/balance.png new file mode 100644 index 0000000..6c060cc Binary files /dev/null and b/static/mine/balance.png differ diff --git a/static/mine/bg.jpg b/static/mine/bg.jpg new file mode 100644 index 0000000..d6381a2 Binary files /dev/null and b/static/mine/bg.jpg differ diff --git a/static/mine/cfmx.png b/static/mine/cfmx.png new file mode 100644 index 0000000..c9fef6e Binary files /dev/null and b/static/mine/cfmx.png differ diff --git a/static/mine/cftx.png b/static/mine/cftx.png new file mode 100644 index 0000000..2f07744 Binary files /dev/null and b/static/mine/cftx.png differ diff --git a/static/mine/coupon.png b/static/mine/coupon.png new file mode 100644 index 0000000..1cb8b0e Binary files /dev/null and b/static/mine/coupon.png differ diff --git a/static/mine/default_user.png b/static/mine/default_user.png new file mode 100644 index 0000000..0d54c70 Binary files /dev/null and b/static/mine/default_user.png differ diff --git a/static/mine/dengji.png b/static/mine/dengji.png new file mode 100644 index 0000000..c019fb6 Binary files /dev/null and b/static/mine/dengji.png differ diff --git a/static/mine/dizhiguanli.png b/static/mine/dizhiguanli.png new file mode 100644 index 0000000..9a76468 Binary files /dev/null and b/static/mine/dizhiguanli.png differ diff --git a/static/mine/dongtai.png b/static/mine/dongtai.png new file mode 100644 index 0000000..052e99e Binary files /dev/null and b/static/mine/dongtai.png differ diff --git a/static/mine/fencheng.png b/static/mine/fencheng.png new file mode 100644 index 0000000..3167c51 Binary files /dev/null and b/static/mine/fencheng.png differ diff --git a/static/mine/fenxiao.png b/static/mine/fenxiao.png new file mode 100644 index 0000000..ca00da1 Binary files /dev/null and b/static/mine/fenxiao.png differ diff --git a/static/mine/fx.png b/static/mine/fx.png new file mode 100644 index 0000000..dc0c0ac Binary files /dev/null and b/static/mine/fx.png differ diff --git a/static/mine/guanli.png b/static/mine/guanli.png new file mode 100644 index 0000000..49f77e4 Binary files /dev/null and b/static/mine/guanli.png differ diff --git a/static/mine/guanzhu.png b/static/mine/guanzhu.png new file mode 100644 index 0000000..ec48d31 Binary files /dev/null and b/static/mine/guanzhu.png differ diff --git a/static/mine/hetong.png b/static/mine/hetong.png new file mode 100644 index 0000000..28d4f34 Binary files /dev/null and b/static/mine/hetong.png differ diff --git a/static/mine/jishizhaopin.png b/static/mine/jishizhaopin.png new file mode 100644 index 0000000..098cf4c Binary files /dev/null and b/static/mine/jishizhaopin.png differ diff --git a/static/mine/lianxikefu.png b/static/mine/lianxikefu.png new file mode 100644 index 0000000..b5cefaf Binary files /dev/null and b/static/mine/lianxikefu.png differ diff --git a/static/mine/pingbi.png b/static/mine/pingbi.png new file mode 100644 index 0000000..bbd93d1 Binary files /dev/null and b/static/mine/pingbi.png differ diff --git a/static/mine/pingjia.png b/static/mine/pingjia.png new file mode 100644 index 0000000..3fb30c9 Binary files /dev/null and b/static/mine/pingjia.png differ diff --git a/static/mine/qiehuan.png b/static/mine/qiehuan.png new file mode 100644 index 0000000..3b7f02c Binary files /dev/null and b/static/mine/qiehuan.png differ diff --git a/static/mine/qudao.png b/static/mine/qudao.png new file mode 100644 index 0000000..13fc599 Binary files /dev/null and b/static/mine/qudao.png differ diff --git a/static/mine/setTime2.png b/static/mine/setTime2.png new file mode 100644 index 0000000..ce48bd5 Binary files /dev/null and b/static/mine/setTime2.png differ diff --git a/static/mine/shens.png b/static/mine/shens.png new file mode 100644 index 0000000..1268d83 Binary files /dev/null and b/static/mine/shens.png differ diff --git a/static/mine/shop.png b/static/mine/shop.png new file mode 100644 index 0000000..8ebf915 Binary files /dev/null and b/static/mine/shop.png differ diff --git a/static/mine/tel.png b/static/mine/tel.png new file mode 100644 index 0000000..3822fef Binary files /dev/null and b/static/mine/tel.png differ diff --git a/static/mine/tuikuan.png b/static/mine/tuikuan.png new file mode 100644 index 0000000..2c9c5e4 Binary files /dev/null and b/static/mine/tuikuan.png differ diff --git a/static/mine/vip.png b/static/mine/vip.png new file mode 100644 index 0000000..b584d36 Binary files /dev/null and b/static/mine/vip.png differ diff --git a/static/mine/yewu.png b/static/mine/yewu.png new file mode 100644 index 0000000..8f38dc6 Binary files /dev/null and b/static/mine/yewu.png differ diff --git a/static/mine/yijianfank.png b/static/mine/yijianfank.png new file mode 100644 index 0000000..d51c048 Binary files /dev/null and b/static/mine/yijianfank.png differ diff --git a/static/mine/youhui.png b/static/mine/youhui.png new file mode 100644 index 0000000..9658f12 Binary files /dev/null and b/static/mine/youhui.png differ diff --git a/static/tab/dingdan_nor.png b/static/tab/dingdan_nor.png new file mode 100644 index 0000000..6c8bd35 Binary files /dev/null and b/static/tab/dingdan_nor.png differ diff --git a/static/tab/dingdan_sel.png b/static/tab/dingdan_sel.png new file mode 100644 index 0000000..9795c5b Binary files /dev/null and b/static/tab/dingdan_sel.png differ diff --git a/static/tab/find_nor.png b/static/tab/find_nor.png new file mode 100644 index 0000000..238f346 Binary files /dev/null and b/static/tab/find_nor.png differ diff --git a/static/tab/find_sel.png b/static/tab/find_sel.png new file mode 100644 index 0000000..22ef546 Binary files /dev/null and b/static/tab/find_sel.png differ diff --git a/static/tab/jishi_nor.png b/static/tab/jishi_nor.png new file mode 100644 index 0000000..6722394 Binary files /dev/null and b/static/tab/jishi_nor.png differ diff --git a/static/tab/jishi_sel.png b/static/tab/jishi_sel.png new file mode 100644 index 0000000..ca9c592 Binary files /dev/null and b/static/tab/jishi_sel.png differ diff --git a/static/tab/shouye_nor.png b/static/tab/shouye_nor.png new file mode 100644 index 0000000..6726e9b Binary files /dev/null and b/static/tab/shouye_nor.png differ diff --git a/static/tab/shouye_sel.png b/static/tab/shouye_sel.png new file mode 100644 index 0000000..4483309 Binary files /dev/null and b/static/tab/shouye_sel.png differ diff --git a/static/tab/store_nor.png b/static/tab/store_nor.png new file mode 100644 index 0000000..0ed1e3b Binary files /dev/null and b/static/tab/store_nor.png differ diff --git a/static/tab/store_sel.png b/static/tab/store_sel.png new file mode 100644 index 0000000..86b8e83 Binary files /dev/null and b/static/tab/store_sel.png differ diff --git a/static/tab/wode_nor.png b/static/tab/wode_nor.png new file mode 100644 index 0000000..ea30390 Binary files /dev/null and b/static/tab/wode_nor.png differ diff --git a/static/tab/wode_sel.png b/static/tab/wode_sel.png new file mode 100644 index 0000000..767f860 Binary files /dev/null and b/static/tab/wode_sel.png differ diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..c5590ad --- /dev/null +++ b/store/index.js @@ -0,0 +1,10 @@ +import Vue from "vue" +import Vuex from "vuex" +Vue.use(Vuex) +const files = require.context('./modules', false, /\.js$/) +const modules = {} +files.keys().forEach(key => { + modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default +}) + +export default new Vuex.Store({modules}) \ No newline at end of file diff --git a/store/modules/config.js b/store/modules/config.js new file mode 100644 index 0000000..e633b9a --- /dev/null +++ b/store/modules/config.js @@ -0,0 +1,235 @@ +import $util from "@/utils/index.js" +import $api from "@/api/index.js" +export default { + state: { + merchantAuth: 0, // 技-师列表是否显示商家 + old_attendant_name: '技师', + configInfo: { + id: 0, + isIos: uni.getSystemInfoSync().system.includes('iOS'), + navBarHeight: uni.getSystemInfoSync().statusBarHeight * 1 + 44, + curSysHeight: '', + tabbarHeight: '', + methodObj: { + 1: 'call', + 2: 'miniProgram', + 3: 'web', + 4: 'navigateTo' + }, + tabBar: [], + }, + play_method: [{ + method: 'onPlay', + msg: '开始播放', + status: true, + }, { + method: 'onStop', + msg: '结束播放', + status: false, + }, { + method: 'onError', + msg: '报错Error', + status: false, + }, { + method: 'onEnded', + msg: '自然结束播放', + status: false, + }], + audioBg: {}, + audioType: 'countdown_voice', + playBg: false, + isHaveAudio: false + }, + mutations: { + //修改信息 + updateConfigItem(state, item) { + let { + key, + val + } = item + state[key] = val + if (key !== 'configInfo') return + uni.setStorageSync('configInfo', val) + let src = val[state.audioType] + if (state.isHaveAudio) { + state.audioBg.src = src || '' + return + } + if (!val.countdown_voice && !val.service_start_recording && !val.service_end_recording) return + state.audioBg = uni.createInnerAudioContext(); + state.isHaveAudio = true + state.audioBg.src = src + // #ifndef APP-PLUS + state.audioBg.obeyMuteSwitch = false + // #endif + state.play_method.map(item => { + state.audioBg[item.method](() => { + console.log('bg=>', item.msg) + state.playBg = item.status; + }) + }) + } + }, + actions: { + // 获取基本配置 + async getConfigInfo({ + commit, + state + }, param) { + let config = await $api.base.configInfo() + if (!config.primaryColor) { + config.primaryColor = '#A40035' + } + if (!config.subColor) { + config.subColor = '#F1C06B' + } + if (!config.user_image) { + config.user_image = 'https://lbqny.migugu.com/admin/anmo/mine/bg.png' + } + if (!config.coach_image) { + config.coach_image = 'https://lbqny.migugu.com/admin/anmo/mine/bg.png' + } + if (!config.service_btn_color) { + config.service_btn_color = '#282B34' + } + if (!config.service_font_color) { + config.service_font_color = '#EBDDB1' + } + if (!config.user_font_color) { + config.user_font_color = '#ffffff' + } + if (!config.coach_font_color) { + config.coach_font_color = '#ffffff' + } + + let base_config = $util.pick(state.configInfo, ['isIos', 'navBarHeight', 'curSysHeight', + 'tabbarHeight', 'methodObj', 'tabBar' + ]) + + let tabBar = [{ + id: 1, + name: '首页', + default_img: '../static/tab/shouye_nor.png', + selected_img: '../static/tab/shouye_sel.png' + }, { + id: 2, + name: '技师', + default_img: '../static/tab/jishi_nor.png', + selected_img: '../static/tab/jishi_sel.png' + }, { + id: 4, + name: '订单', + default_img: '../static/tab/dingdan_nor.png', + selected_img: '../static/tab/dingdan_sel.png' + }, { + id: 5, + name: '我的', + default_img: '../static/tab/wode_nor.png', + selected_img: '../static/tab/wode_sel.png' + }] + + + let tInd = tabBar.findIndex(item => { + return item.id == 2 + }) + tabBar[tInd].name = config.attendant_name + + // let authArr = ['map', 'dynamic', 'store'] + // let authArr = ['dynamic', 'store'] + let authArr = [] // tabbar 权限 + let authObj = { + dynamic: { + id: 3, + name: '动态', + default_img: '../static/tab/find_nor.png', + selected_img: '../static/tab/find_sel.png', + ind: config.attendant_name + }, + store: { + id: 6, + name: '门店', + default_img: '../static/tab/store_nor.png', + selected_img: '../static/tab/store_sel.png', + ind: '首页' + }, + map: { + id: 7, + name: '地图找人', + default_img: '../static/tab/jishi_nor.png', + selected_img: '../static/tab/jishi_sel.png', + ind: config.attendant_name + } + } + + let plugNum = 0 + let { + plugAuth + } = config + for (let i in plugAuth) { + plugAuth[i] = plugAuth[i] == 1 || plugAuth[i] ? false : true + if (authArr.includes(i)) { + if (plugAuth[i]) { + plugNum++ + } + let addInd = tabBar.findIndex(item => { + return item.name == authObj[i].name + }) + let spliceInd = tabBar.findIndex(item => { + return item.name == authObj[i].ind + }) + if (plugAuth[i] && addInd == -1) { + tabBar.splice(spliceInd + 1, 0, authObj[i]) + } + if (!plugAuth[i] && addInd !== -1) { + tabBar.splice(addInd, 1) + } + } + } + config.plugAuth = plugAuth + + + //if (plugNum > 1) { + //tabBar.splice(tabBar.findIndex(item => { + //return item.name == '订单' + //}), 1) + //} + + base_config.tabBar = tabBar + let data = Object.assign({}, config, base_config) + commit('updateConfigItem', { + key: 'configInfo', + val: data + }) + + }, + toPlayAudio({ + commit, + state + }, param) { + state.audioType = param.key + let src = state.configInfo[param.key] + if (!src) return + if (state.isHaveAudio) { + state.audioBg.src = src + } else { + state.audioBg = uni.createInnerAudioContext(); + state.isHaveAudio = true + state.audioBg.src = src + // #ifndef APP-PLUS + state.audioBg.obeyMuteSwitch = false + // #endif + state.play_method.map(item => { + state.audioBg[item.method](() => { + console.log('bg=>', item.msg) + state.playBg = item.status; + }) + }) + } + + if (state.playBg) { + state.audioBg.stop() + } + state.audioBg.play() + } + } +} \ No newline at end of file diff --git a/store/modules/dynamic.js b/store/modules/dynamic.js new file mode 100644 index 0000000..9bda587 --- /dev/null +++ b/store/modules/dynamic.js @@ -0,0 +1,83 @@ +import $util from "@/utils/index.js" +import $api from "@/api/index.js" +export default { + state: { + pageActive: false, + activeIndex: 0, + haveOperItem: false, + tabList: [{ + title: '推荐', + id: 0, + }, { + title: '关注', + id: 1, + number: 0 + }], + param: { + page: 1, + coach_name: '' + }, + list: { + data: [], + last_page: 1, + current_page: 1 + }, + follow_dynamic_num: 0, + coach_status: -1 + }, + mutations: { + async updateDynamicItem(state, item) { + let { + key, + val + } = item + state[key] = val + } + }, + actions: { + async getDynamicIndex({ + commit, + state + }, param) { + let d = await $api.dynamic.getFollowData(param) + commit('updateDynamicItem', { + key: 'follow_dynamic_num', + val: d.num + }) + commit('updateDynamicItem', { + key: 'coach_status', + val: d.coach_status + }) + let tabList = $util.deepCopy(state.tabList) + tabList[1].number = d.num + commit('updateDynamicItem', { + key: 'tabList', + val: tabList + }) + }, + async getDynamicList({ + commit, + state + }, param) { + let methodModel = state.activeIndex == 0 ? 'dynamicList' : 'followDynamicList' + let d = await $api.dynamic[methodModel](param) + let oldList = state.list; + let newList = d; + let list = {} + if (param.page == 1) { + list = newList; + } else { + newList.data = oldList.data.concat(newList.data) + list = newList; + } + commit('updateDynamicItem', { + key: 'param', + val: param + }) + commit('updateDynamicItem', { + key: 'list', + val: list + }) + } + }, +} diff --git a/store/modules/map.js b/store/modules/map.js new file mode 100644 index 0000000..cf2708a --- /dev/null +++ b/store/modules/map.js @@ -0,0 +1,153 @@ +import $api from "@/api/index.js" +import $store from "@/store/index.js" +export default { + state: { + pageActive: false, + sexList: [{ + id: -1, + title: '全部' + }, { + id: 0, + title: '男' + }, { + id: 1, + title: '女' + }], + yearList: [{ + id: 1, + title: '1-3年', + year: [1, 3] + }, { + id: 2, + title: '3-5年', + year: [3, 5] + }, { + id: 3, + title: '5-10年', + year: [5, 10] + }, { + id: 4, + title: '10年以上', + year: [10, 200] + }], + map: { + latitude: 0, + longitude: 0, + scale: 16, + controls: [] + }, + covers: [], + service_cate: [], + param: { + page: 1, + sex: -1, + year: 1, + cate_id: 0, + activeIndex: 0, + coach_name: '', + service_time: '' + }, + check: { + sex: -1, + year: 1, + coach_name: '', + service_time: '' + }, + mapList: [], + list: { + data: [], + last_page: 1, + current_page: 1 + }, + mapType: 'map' + }, + mutations: { + async updateMapItem(state, item) { + let { + key, + val + } = item + state[key] = val + } + }, + actions: { + async getMapIndex({ + commit, + state + }, param) { + let d = await $api.service.serviceCateList(param) + d.unshift({ + id: 0, + title: '全部' + }) + commit('updateMapItem', { + key: 'service_cate', + val: d + }) + }, + async getMapList({ + commit, + state + }, param) { + let d = await $api.service.mapCoachList(param) + let map = Object.assign({}, state.map, { + latitude: param.lat, + longitude: param.lng, + }) + let arr = [] + d.map((item, index) => { + arr.push({ + id: index, + latitude: item.lat, + longitude: item.lng, + iconPath: item.work_img, + width: 30, + height: 30 + }) + }) + arr.unshift({ + id: '-1', + latitude: param.lat, + longitude: param.lng, + iconPath: 'https://mapapi.qq.com/web/lbs/visualizationApi/demo/img/big.png', + width: 20, + height: 25, + }) + commit('updateMapItem', { + key: 'map', + val: map + }) + commit('updateMapItem', { + key: 'covers', + val: arr + }) + commit('updateMapItem', { + key: 'mapList', + val: d + }) + }, + async getMapCoachList({ + commit, + state + }, param) { + let { + coach_format = 1 + } = $store.state.config.configInfo + let methodModel = coach_format == 1 ? 'serviceCoachList' : 'typeServiceCoachList' + let d = await $api.service[methodModel](param) + let oldList = state.list; + let newList = d; + let list = {} + if (param.page == 1) { + list = newList; + } else { + newList.data = oldList.data.concat(newList.data) + list = newList; + } + commit('updateMapItem', { + key: 'list', + val: list + }) + } + }, +} \ No newline at end of file diff --git a/store/modules/order.js b/store/modules/order.js new file mode 100644 index 0000000..27b52b5 --- /dev/null +++ b/store/modules/order.js @@ -0,0 +1,99 @@ +import $util from "@/utils/index.js" +import $api from "@/api/index.js" +import { + req +} from '@/utils/req.js'; +export default { + state: { + pageActive: false, + // pay_type 1待支付,2待服务,3技-师接单,4技-师出发,5技-师到达,6服务中,7服务完成 + activeIndex: 0, + tabList: [{ + title: '全部', + id: 0 + }, { + title: '待支付', + id: 1, + // number: 10 + }, { + title: '待服务', + id: 5 + }, { + title: '服务中', + id: 6 + }, { + title: '已完成', + id: 7 + }], + param: { + page: 1, + pay_type: 0, + }, + list: { + data: [], + last_page: 1, + current_page: 1 + }, + carList: {}, + haveOperItem: false, + bellOrderParams: {}, + alipayOrderParams: {}, + recorder: null, + recorder_status: false, + recorder_order_id: 0 + }, + mutations: { + updateOrderItem(state, item) { + let { + key, + val + } = item + state[key] = val + } + }, + actions: { + async getOrderList({ + commit, + state + }, param) { + let d = await $api.order.orderList(param) + let oldList = state.list; + let newList = d; + let list = {} + if (param.page == 1) { + let { + current_page = 0 + } = newList + if (!current_page) { + newList = { + data: [], + last_page: 1, + current_page: 1 + } + } + list = newList; + } else { + newList.data = oldList.data.concat(newList.data) + list = newList; + } + commit('updateOrderItem', { + key: 'list', + val: list + }) + }, + // 获取购物车数据 + async getCarList({ + commit, + state + }, param) { + let carList = await $api.order.carInfo(param) + carList.list.map(item => { + item.checked = false + }) + commit('updateOrderItem', { + key: 'carList', + val: carList + }) + }, + } +} \ No newline at end of file diff --git a/store/modules/service.js b/store/modules/service.js new file mode 100644 index 0000000..692e641 --- /dev/null +++ b/store/modules/service.js @@ -0,0 +1,128 @@ +import $api from "@/api/index.js" +import $util from "@/utils/index.js" +import $store from "@/store/index.js" +export default { + state: { + pageActive: false, + activeIndex: 0, + tabList: [{ + title: '全部', + sort: 'top desc', + }, { + title: '价格', + sort: 'price', + sign: 0, + is_sign: 1, + }, { + title: '销量', + sort: 'total_sale', + sign: 0, + is_sign: 1, + }, { + title: '好评度', + sort: 'star', + sign: 0, + is_sign: 1, + }], + param: { + page: 1, + sort: '' + }, + list: { + data: [], + last_page: 1, + current_page: 1 + }, + banner: [], + service_cate: [], + service_all_cate: [], + recommend_list: [], + recommend_style: 1 + }, + mutations: { + async updateServiceItem(state, item) { + let { + key, + val + } = item + state[key] = val + } + }, + actions: { + async getServiceIndex({ + commit, + state + }, param) { + let d = await $api.service.index(param); + let { + banner = [], + service_cate = [], + recommend_list = [], + recommend_style = 1, + coach_apply_show = 0 + } = d + let all_cate = $util.deepCopy(service_cate) + commit('updateServiceItem', { + key: 'service_all_cate', + val: all_cate + }) + let cateLen = all_cate.length + if (coach_apply_show) { + service_cate.splice(cateLen > 4 ? 4 : cateLen - 1, 0, { + id: 0, + title: $store.state.config.configInfo.attendant_name + '入驻', + cover: 'https://lbqny.migugu.com/admin/anmo/technician/default_technician.png', + url: '/technician/pages/apply' + }) + } + let num = ((coach_apply_show && cateLen > 28) || (!coach_apply_show && cateLen > 29)) ? 29 : + coach_apply_show ? cateLen + 1 : cateLen + console.log(coach_apply_show, num, "======num") + service_cate = service_cate.slice(0, num) + if ((cateLen > (coach_apply_show ? 28 : 29))) { + service_cate.push({ + id: 0, + title: '全部分类', + cover: '', + icon: 'iconfenleiyingyongtongzhi2', + url: '/user/pages/service/cate' + }) + } + commit('updateServiceItem', { + key: 'banner', + val: banner + }) + commit('updateServiceItem', { + key: 'service_cate', + val: service_cate + }) + commit('updateServiceItem', { + key: 'recommend_list', + val: recommend_list + }) + commit('updateServiceItem', { + key: 'recommend_style', + val: recommend_style + }) + }, + async getServiceList({ + commit, + state + }, param) { + let d = await $api.service.serviceList(param) + let oldList = state.list; + let newList = d; + let list = {} + if (param.page == 1) { + list = newList; + } else { + newList.data = oldList.data.concat(newList.data) + list = newList; + } + commit('updateServiceItem', { + key: 'list', + val: list + }) + } + }, +} \ No newline at end of file diff --git a/store/modules/shopstore.js b/store/modules/shopstore.js new file mode 100644 index 0000000..2f2c6e7 --- /dev/null +++ b/store/modules/shopstore.js @@ -0,0 +1,51 @@ +import $util from "@/utils/index.js" +import $api from "@/api/index.js" +export default { + state: { + pageActive: false, + haveOperItem: false, + param: { + page: 1, + coach_name: '' + }, + list: { + data: [], + last_page: 1, + current_page: 1 + } + }, + mutations: { + async updateShopstoreItem(state, item) { + let { + key, + val + } = item + state[key] = val + } + }, + actions: { + async getShopstoreList({ + commit, + state + }, param) { + let d = await $api.shopstore.storeList(param) + let oldList = state.list; + let newList = d; + let list = {} + if (param.page == 1) { + list = newList; + } else { + newList.data = oldList.data.concat(newList.data) + list = newList; + } + commit('updateShopstoreItem', { + key: 'param', + val: param + }) + commit('updateShopstoreItem', { + key: 'list', + val: list + }) + } + }, +} diff --git a/store/modules/technician.js b/store/modules/technician.js new file mode 100644 index 0000000..9ce78f2 --- /dev/null +++ b/store/modules/technician.js @@ -0,0 +1,100 @@ +import $api from "@/api/index.js" +import $store from "@/store/index.js" +export default { + state: { + pageActive: false, + activeIndex: 0, + haveOperItem: false, + tabList: [{ + title: '全部', + id: 0, + }, { + title: '可服务', + id: 1, + }, { + title: '服务中', + id: 2 + }, { + title: '可预约', + id: 3 + }], + cityId: 0, + cityIndex: -1, + cityList: [], + param: { + page: 1, + ser_id: 0, + coach_name: '' + }, + list: { + data: [], + last_page: 1, + current_page: 1 + } + }, + mutations: { + async updateTechnicianItem(state, item) { + let { + key, + val + } = item + state[key] = val + } + }, + actions: { + async getCityList({ + commit, + state + }, param) { + let { + change = 0 + } = param + let params = JSON.parse(JSON.stringify(param)) + delete params.change + let d = await $api.base.getCity(params); + let { + cityId = 0 + } = state + let ind = d.findIndex(v => { + return change || !cityId ? v.is_select : v.id == cityId + }) + commit('updateTechnicianItem', { + key: 'cityList', + val: d + }) + let cityIndex = ind + // let cityIndex = ind === -1 ? 0 : ind + commit('updateTechnicianItem', { + key: 'cityIndex', + val: cityIndex + }) + commit('updateTechnicianItem', { + key: 'cityId', + val: d && d.length > 0 && cityIndex !== -1 ? d[cityIndex].id : 0 + }) + }, + async getServiceCoachList({ + commit, + state + }, param) { + let { + coach_format = 1 + } = $store.state.config.configInfo + let methodModel = coach_format == 1 ? 'serviceCoachList' : 'typeServiceCoachList' + let d = await $api.service[methodModel](param) + let oldList = state.list; + let newList = d; + let list = {} + if (param.page == 1) { + list = newList; + } else { + newList.data = oldList.data.concat(newList.data) + list = newList; + } + commit('updateTechnicianItem', { + key: 'list', + val: list + }) + } + }, +} diff --git a/store/modules/user.js b/store/modules/user.js new file mode 100644 index 0000000..5be052e --- /dev/null +++ b/store/modules/user.js @@ -0,0 +1,208 @@ +import $util from "@/utils/index.js" +import $api from "@/api/index.js" +import $store from "@/store/index.js" +import { + req +} from '@/utils/req.js'; +export default { + state: { + autograph: '', + userInfo: {}, + appLogin: '', + loginType: '', + loginPage: '', + isGzhLogin: false, + locationChange: false, + locationChangeUnix: 0, + commonOptions: { + id: 0, + pid: 0, + coupon_atv_id: 0, + admin_id: 0, + coach_id: 0, + channel_id: 0, + }, + location: {}, + isShowAuth: true, + mineInfo: {}, // 用户个人中心 + userPageType: 1, // 1用户,2技-师 + coachInfo: {}, + haveShieldOper: 0, + personVerifyUrl: '', + fddExtsign: '', + }, + mutations: { + //更新内容 + async updateUserItem(state, item) { + let { + key, + val + } = item + if (key == 'userInfo' && val.id) { + let { + phone = '', + create_time, + alipay_number = '' + } = val + if (phone) { + val.split_phone = phone.substring(0, 3) + '****' + phone.substring(7, 11) + } + val.create_date = $util.formatTime(create_time * 1000, 'YY-M-D') + if (alipay_number) { + let len = alipay_number.length + val.split_alipay_number = alipay_number.substring(0, len > 3 ? 3 : 1) + '***' + if (len > 6) { + val.split_alipay_number += alipay_number.substring(len == 6 ? len - 2 : + len - 3, len) + } + } + } + + if (key == 'mineInfo') { + let { + id: mine_id = -1 + } = val + + if (mine_id == -1) { + let stoerArr = ['userInfo', 'location', 'appLogin', 'loginType', 'isShowLogin', + 'isGzhLogin' + ] + stoerArr.map(key => { + state[key] = key == 'isShowLogin' ? true : '' + uni.setStorageSync(key, key == 'isShowLogin' ? true : '') + }) + } + } + + if (['autograph', 'userInfo', 'location', 'appLogin', 'loginType', 'isShowLogin', 'isGzhLogin'] + .includes(key)) { + uni.setStorageSync(key, val) + } + + + if (key === 'locationChange' && val == true) { + let locationChangeUnix = $util.DateToUnix($util.formatTime(new Date(), 'YY-M-D h:m:s')) + state.locationChangeUnix = locationChangeUnix + } + + state[key] = val + } + }, + actions: { + //获取个人信息 + async getUserInfo({ + commit, + state + }, param) { + let data = await $api.user.userInfo() + commit('updateUserItem', { + key: 'userInfo', + val: data + }) + }, + //获取用户个人中心数据 + async getMineInfo({ + commit, + state + }, param) { + let data = await $api.mine.index() + let { + id = 0, + fx_status + } = data + if (!id) { + data = { + id: -1 + } + } + let { + fx_check = 0 + } = $store.state.config.configInfo + data.is_fx = !fx_check || (fx_check && fx_status == 2) + commit('updateUserItem', { + key: 'mineInfo', + val: data + }) + }, + //获取技-师信息 + async getCoachInfo({ + commit, + state + }, param) { + let data = await $api.technician.coachInfo() + commit('updateUserItem', { + key: 'coachInfo', + val: data + }) + }, + // 获取用户信息 + async getAuthUserProfile({ + commit, + state + }, param) { + let { + nickName, + avatarUrl + } = param + await $api.user.userUpdate(param) + let data = Object.assign({}, state.userInfo, { + nickName, + avatarUrl + }) + commit('updateUserItem', { + key: 'userInfo', + val: data + }) + }, + // 获取手机号 + async getAuthPhone({ + commit, + state + }, { + e = { + detail: {} + }, + must = false + } = {}) { + let { + encryptedData = '', iv = '' + } = e.detail; + let phone = '' + if (encryptedData && iv) { + let phone = await $api.user.reportPhone({ + encryptedData, + iv + }) + let data = Object.assign({}, state.userInfo, { + phone + }) + commit('updateUserItem', { + key: 'userInfo', + val: data + }) + return phone; + } + }, + // 更新公共参数 + async updateCommonOptions({ + commit, + state + }, param) { + let target = {} + if (param.scene) { + let res = await $api.base.getWxCodeData({ + code_id: param.scene + }) + target = Object.assign({}, state.commonOptions, res.data) + } else { + target = Object.assign({}, state.commonOptions, param) + } + let data = $util.pick(target, ['id', 'pid', 'coupon_atv_id', 'admin_id', 'channel_id', 'coach_id']) + commit('updateUserItem', { + key: 'commonOptions', + val: data + }) + return target + } + } +} \ No newline at end of file diff --git a/styles/1px.wxss b/styles/1px.wxss new file mode 100644 index 0000000..809cb42 --- /dev/null +++ b/styles/1px.wxss @@ -0,0 +1,102 @@ +/* 1px方案,改变border的颜色即可 */ +.b-1px, .b-1px-t, .b-1px-b, .b-1px-tb, .b-1px-l, .b-1px-r { + position: relative; +} + +.b-1px:before { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 200%; + border: 1px solid #eee; + color: #eee; + height: 200%; + transform-origin: left top; + transform: scale(0.5); + box-sizing: border-box; +} + +.b-1px-t:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid #eee; + color: #eee; + transform-origin: 0 0; + transform: scaley(0.5); + box-sizing: border-box; +} + +.b-1px-b:after { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid #eee; + color: #eee; + transform-origin: 0 100%; + transform: scaley(0.5); + box-sizing: border-box; +} + +.b-1px-tb:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid #eee; + color: #eee; + transform-origin: 0 0; + transform: scaley(0.5); + box-sizing: border-box; +} + +.b-1px-tb:after { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid #eee; + color: #eee; + transform-origin: 0 100%; + transform: scaley(0.5); + box-sizing: border-box; +} + +.b-1px-l::before { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid #eee; + color: #eee; + transform-origin: 0 0; + transform: scalex(0.5); + box-sizing: border-box; +} + +.b-1px-r::after { + content: " "; + position: absolute; + right: 0; + top: 0; + width: 1px; + bottom: 0; + border-right: 1px solid #eee; + color: #eee; + transform-origin: 100% 0; + transform: scalex(0.5); + box-sizing: border-box; +} \ No newline at end of file diff --git a/styles/avatar.wxss b/styles/avatar.wxss new file mode 100644 index 0000000..84d45dc --- /dev/null +++ b/styles/avatar.wxss @@ -0,0 +1,54 @@ +/* 头像 */ +.avatar { + margin: 0; + padding: 0; + display: inline-flex; + text-align: center; + justify-content: center; + align-items: center; + /* background: #f4f6f8; */ + color: #fff; + white-space: nowrap; + position: relative; + width: 120rpx; + height: 120rpx; + background-size: cover; + background-position: center; + vertical-align: middle; +} + +.avatar.lg { + width: 160rpx; + height: 160rpx; +} + +.avatar.md { + width: 100rpx; + height: 100rpx; +} + +.avatar.sm { + width: 80rpx; + height: 80rpx; +} + +.avatar-group { + direction: ltl; + unicode-bidi: bidi-override; + display: inline-block; +} + +.avatar-group .avatar { + width: 48rpx; + height: 48rpx; + font-size: 1em; + border-radius: 50%; + margin-left: -20rpx; + border: 4rpx solid white; + vertical-align: middle; + transform: rotateZ(360deg); +} + +.avatar-group .avatar:nth-child(1) { + margin-left: 0rpx; +} diff --git a/styles/base.wxss b/styles/base.wxss new file mode 100644 index 0000000..8251159 --- /dev/null +++ b/styles/base.wxss @@ -0,0 +1,187 @@ + +/* 字体大小 */ +.f-little{font-size: 18rpx;} +.f-icontext{font-size: 22rpx;}/* 很小的文字,一般和图标一起使用 */ +.f-caption{font-size: 24rpx;}/* 辅助描述性文字 */ +.f-desc{font-size: 26rpx;}/* 段落字体 */ +.f-paragraph{font-size: 28rpx;}/* 段落字体 */ +.f-mini-title{font-size: 30rpx;} +.f-title{font-size: 32rpx;}/* 标题 */ +.f-st-title{font-size: 34rpx;}/* 大点的标题 */ +.f-sm-title{font-size: 36rpx;}/* 大点的标题 */ +.f-md-title{font-size: 40rpx;}/* 大点的标题 */ +.f-lg-title{font-size: 42rpx;}/* 大点的标题 */ +.f-big-title{font-size: 46rpx;}/* 大点的标题 */ + + +/* 字体颜色 */ +.c-base{color:#ffffff;}/* 白色 */ +.c-base-rgba{color:rgba(255, 255, 255, 0.6)}/* 白色 */ +.c-black{color: #000000;}/* 黑色 */ +.c-title{color: #232A24}/* 标题/副标题 */ +.c-desc{color:#3D2C1B;}/* 辅助描述性文字 */ +.c-caption{color:#999999;}/* 辅助描述性文字 */ +.c-disable{color: #c7c7c7;}/* 按钮文字禁用 */ +.c-paragraph{color:#666666;}/* 段落字体 */ +.c-success{color:#1BCA62;}/* 成功/链接文字 */ +.c-alipay{color:#01AAF2;}/* 支付宝支付文字 */ +.c-balance{color:#FA7917;}/* 🈷余额支付文字 */ +.c-tips{color:#ffd753;}/* 失效 */ +.c-warning{color:#E82F21;}/* 警告/非法 */ +.c-nodata{color:#cccccc;}/* 链接文字 */ +.c-orange{color:#ff4a00;}/* 首页价格文字 */ +.c-vip{color:#d9cf9a;}/* 充值文字 */ +.c-grey{color:#b9b9b9;}/* 灰色文字 */ +.c-shadow{text-shadow:2rpx 2rpx 2rpx #808080;}/* 字体阴影 */ + + + +/* 填充色 */ +.fill-base{background:#ffffff;}/* 默认 */ +.fill-black{background:#000000;}/* 默认 */ +.fill-body{background:#F7F8FA;}/* 页面 */ +.fill-primary{background:#19c865;}/* 主题色/主要活动按钮 */ +.fill-caption{background:#ffd753;}/* 辅助色 */ +.fill-warning{background:#f12c20;}/* 警告/非法 */ +.fill-second{background:#efeff4;}/* 区块分割线 */ +.fill-space{background: #FCFCFC;}/* 次要活动按钮 */ + +/* 阴影 */ +.box-shadow{box-shadow: 0px 3px 6px 0px rgba(227, 227, 227, 0.47);} +.box-shadow-mini{box-shadow: 2rpx 0 10rpx rgba(4,0,0,0.08);} + +/* 字体样式 */ +text{vertical-align: middle;}/* 上下居中 */ +.text-left{text-align: left;}/* 左对齐 */ +.text-center { text-align: center}/* 中对齐 */ +.text-right {text-align: right}/* 右对齐 */ +.text-justify{text-align: justify;}/* 两端对齐,谨慎使用 */ +.text-justify::after{content: '';width: 100%;display: inline-block;} +.text-delete {text-decoration: line-through}/* 删除线 */ +.text-underline{text-decoration: underline}/* 下划线 */ +.text-bold{ font-weight:bold;}/* 加粗 */ +.text-normal{ font-weight:normal;} + + +/* 文本溢出省略 */ +.ellipsis{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;} +.ellipsis-2{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp:2;overflow: hidden;} +.ellipsis-3{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp:3;overflow: hidden;} +.ellipsis-4{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp:4;overflow: hidden;} + +/* 最大宽度 */ +.max-100{max-width: 100rpx;} +.max-150{max-width: 150rpx;} +.max-200{max-width: 200rpx;} +.max-270{max-width: 270rpx;} +.max-280{max-width: 280rpx;} +.max-300{max-width: 300rpx;} +.max-350{max-width: 350rpx;} +.max-380{max-width: 380rpx;} +.max-400{max-width: 400rpx;} +.max-446{max-width: 446rpx;} +.max-450{max-width: 450rpx;} +.max-470{max-width: 470rpx;} +.max-500{max-width: 500rpx;} +.max-510{max-width: 510rpx;} +.max-520{max-width: 520rpx;} +.max-540{max-width: 540rpx;} +.max-550{max-width: 550rpx;} +.max-566{max-width: 566rpx;} +.max-580{max-width: 580rpx;} + +/* 外间距 */ +.mg-sm{margin:10rpx;} +.mg-md{margin:20rpx;} +.mg-lg{margin:30rpx;} + +.mt-sm{margin-top:10rpx;} +.mt-md{margin-top:20rpx;} +.mt-lg{margin-top:30rpx;} + +.mr-sm{margin-right:10rpx;} +.mr-md{margin-right:20rpx;} +.mr-lg{margin-right:30rpx;} + +.mb-sm{margin-bottom:10rpx;} +.mb-md{margin-bottom:20rpx;} +.mb-lg{margin-bottom:30rpx;} + +.ml-sm{margin-left:10rpx;} +.ml-md{margin-left:20rpx;} +.ml-lg{margin-left:30rpx;} + + +/* 内间距 */ +.pd-sm{padding:10rpx;} +.pd-md{padding:20rpx;} +.pd-lg{padding:30rpx;} + +.pt-sm{padding-top:10rpx;} +.pt-md{padding-top:20rpx;} +.pt-lg{padding-top:30rpx;} + +.pr-sm{padding-right:10rpx;} +.pr-md{padding-right:20rpx;} +.pr-lg{padding-right:30rpx;} + +.pb-sm{padding-bottom:10rpx;} +.pb-md{padding-bottom:20rpx;} +.pb-lg{padding-bottom:30rpx;} + +.pl-sm{padding-left:10rpx;} +.pl-md{padding-left:20rpx;} +.pl-lg{padding-left:30rpx;} + + +/* 图标尺寸 */ +.icon-xs{width:32rpx; height:32rpx;display: block;font-size: 32rpx;} +.icon-sm{width:44rpx; height:44rpx;display: block;font-size: 44rpx;} +.icon-md{width:60rpx; height:60rpx;display: block;font-size: 60rpx;} +.icon-lg{width:80rpx; height:80rpx;display: block;font-size: 80rpx;} + + +/* 组件间距 */ +.space-sm{height: 10rpx;} +.space-md{height: 20rpx;} +.space-lg{height: 30rpx;} +.space-ht{height: 190rpx;} +.space-body{height: 150rpx;} +.space-safe{height: calc(env(safe-area-inset-bottom) / 2);padding-bottom: calc( env(safe-area-inset-bottom) / 2);} +.space-footer{height: 30rpx;height: calc(30rpx + env(safe-area-inset-bottom) / 2);padding-bottom: calc( env(safe-area-inset-bottom) / 2);} +.space-tabbar-footer{height: 100rpx;height: calc(100rpx + env(safe-area-inset-bottom) / 2);padding-bottom: calc( env(safe-area-inset-bottom) / 2);} +.space-max-footer{height: 180rpx;height: calc(180rpx + env(safe-area-inset-bottom) / 2);padding-bottom: calc(env(safe-area-inset-bottom) / 2);} +.space{height: 1rpx ;background: rgba(216, 216, 216, 0.5);} + + +/* 圆角 */ +.radius{border-radius: 5000rpx;} +.radius-5 {border-radius: 5rpx;} +.radius-10 {border-radius: 10rpx;} +.radius-16 {border-radius: 16rpx;} +.radius-18 {border-radius: 18rpx;} +.radius-20 {border-radius: 20rpx;} +.radius-24 {border-radius: 24rpx;} +.radius-26 {border-radius: 26rpx;} +.radius-32 {border-radius: 32rpx;} +.radius-34 {border-radius: 34rpx;} + +/* 旋转 */ +.rotate-45{transform: rotate(45deg);} +.rotate-90{transform: rotate(90deg);} +.rotate-180{transform: rotate(180deg);} +.rotate-270{transform: rotate(270deg);} + +/* 定位 */ +.rel{position: relative;} +.abs{position: absolute;} +.fix{position: fixed;width: 100%;z-index: 100;} +.fixed-top{position: fixed;left: 0;right: 0;top: 0;z-index: 100;} +.fixed-bottom{position: fixed;left: 0;right: 0;bottom: 0;z-index: 100;} + +/* 灰度 */ +.grayscale {-webkit-filter: grayscale(100%);filter: grayscale(100%);} + + +/* 字体颜色 */ +.icon-font-color{-webkit-background-clip: text;-webkit-text-fill-color: transparent;} \ No newline at end of file diff --git a/styles/button.wxss b/styles/button.wxss new file mode 100644 index 0000000..1ad5b36 --- /dev/null +++ b/styles/button.wxss @@ -0,0 +1,104 @@ +/* button样式修改 */ +button { + font-size: 30rpx; + border-radius: 15rpx; + /* line-height: 96rpx; */ + padding: 0rpx; + margin: 0rpx; + color: #fff; + background: transparent; +} + +button::after { + border-color: transparent; + border-radius: 30rpx; +} + +button.plain::after { + border-color: currentColor; +} + +button[type='grey'] { + color: #999999; + background: #EEEEEE; +} + +/* 订单按钮 */ +button.order { + min-width: 140rpx; + padding: 0 20rpx; + line-height: 52rpx; + color: #5B5B5B; + background: #fff; + border-radius: 8rpx; + border: 1rpx solid #979797; + transform: rotateZ(360deg); + font-size: 26rpx; + font-weight: bold; + display: inline-flex; + align-items: center; + justify-content: center; + margin-left: 20rpx +} + + +/* 购物车按钮 */ +button.reduce, +button.add { + width: 38rpx; + height: 38rpx; + border-radius: 10rpx; + border: 1rpx solid #EEEEEE; + transform: rotateZ(360deg); + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +} + +button.reduce .iconfont, +button.add .iconfont { + font-size: 24rpx; + line-height: 24rpx; + overflow: hidden; +} + +button.addreduce, +input.addreduce { + min-width: 60rpx; + padding: 0 10rpx; + height: 38rpx; + color: #666666; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: center; + margin: 0rpx 10rpx; +} + +input.addreduce { + text-align: center; + max-width: 150rpx; +} + + +/* 按钮按下 */ +.button-hover { + opacity: 0.6; +} + +/* 清除按钮默认样式 */ +.clear-btn { + margin: 0; + padding: 0; + background: transparent; + border-radius: 0rpx; + line-height: 1.5; + border: none; + text-align: left; + color: #333; +} + +.clear-btn::after { + border: none; +} diff --git a/styles/icon.wxss b/styles/icon.wxss new file mode 100644 index 0000000..87980da --- /dev/null +++ b/styles/icon.wxss @@ -0,0 +1,1657 @@ +@font-face { + font-family: 'iconfont'; /* Project id 4110196 */ + src: url('https://at.alicdn.com/t/c/font_4110196_r2eepy29ecm.woff2?t=1690765463726') format('woff2'), + url('https://at.alicdn.com/t/c/font_4110196_r2eepy29ecm.woff?t=1690765463726') format('woff'), + url('https://at.alicdn.com/t/c/font_4110196_r2eepy29ecm.ttf?t=1690765463726') format('truetype'); +} +@font-face { + font-family: "iconfont"; /* Project id 2649930 */ + src: url('https://at.alicdn.com/t/c/font_2649930_kwmue8hcdxj.woff2?t=1685093547270') format('woff2'), + url('https://at.alicdn.com/t/c/font_2649930_kwmue8hcdxj.woff?t=1685093547270') format('woff'), + url('https://at.alicdn.com/t/c/font_2649930_kwmue8hcdxj.ttf?t=1685093547270') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + line-height:1; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-kzz:before { + content: "\e90c"; +} + +.icon-kpk:before { + content: "\e932"; +} + +.icon-kzj:before { + content: "\e819"; +} + +.icon-khz:before { + content: "\e9b1"; +} + +.icon-kpb:before { + content: "\e9c3"; +} + +.icon-kdt:before { + content: "\e9c9"; +} + +.icon-khydj:before { + content: "\e97f"; +} + +.icon-kcpss:before { + content: "\e982"; +} + +.icon-kcfmx:before { + content: "\e90d"; +} + +.icon-ksc1:before { + content: "\e945"; +} + +.icon-ksc:before { + content: "\e9c0"; +} + +.icon-kqh1:before { + content: "\e929"; +} + +.icon-kdd2:before { + content: "\e81d"; +} + +.icon-kqh:before { + content: "\e856"; +} + +.icon-kdqr:before { + content: "\e911"; +} + +.icon-kwd:before { + content: "\e918"; +} + +.icon-ktg:before { + content: "\e919"; +} + +.icon-kfs:before { + content: "\e921"; +} + +.icon-shouyi:before { + content: "\e92a"; +} + +.icon-kefu:before { + content: "\e95c"; +} + +.icon-ksy:before { + content: "\e922"; +} + +.icon-qichuyue:before { + content: "\e66e"; +} + +.icon-kfkjy1:before { + content: "\f917"; +} + +.icon-kdzf:before { + content: "\e9a5"; +} + +.icon-kfkjy:before { + content: "\e937"; +} + +.icon-kye:before { + content: "\faf6"; +} + +.icon-khhr2:before { + content: "\e956"; +} + +.icon-kjs:before { + content: "\e917"; +} + +.icon-kqds1:before { + content: "\e9ef"; +} + +.icon-khhr:before { + content: "\e972"; +} + +.icon-dd:before { + content: "\e97b"; +} + +.icon-kqds:before { + content: "\e850"; +} + +.icon-kyhj:before { + content: "\e889"; +} + +.icon-kll:before { + content: "\e831"; +} + +.icon-kdd:before { + content: "\e80d"; +} + +.icon-kpj:before { + content: "\e66f"; +} + +.icon-dizhi:before { + content: "\e871"; +} + +.icon-shijian:before { + content: "\e909"; +} + +.icon-shuxian:before { + content: "\e908"; +} + +.icon-tech:before { + content: "\e905"; +} + +.icon-tuijian:before { + content: "\e906"; +} + +.icon-tuijian1:before { + content: "\e907"; +} + +.icon-czsg:before { + content: "\e902"; +} + +.icon-csmt:before { + content: "\e901"; +} + +.icon-qcbz:before { + content: "\e904"; +} + +.icon-sybp:before { + content: "\e903"; +} + +.icondianqianhetong:before { + content: "\e7b2"; +} + +.iconduanxinyanzhengma:before { + content: "\e61e"; +} + +.iconshoujitianchong:before { + content: "\e6e3"; +} + +.iconemiyanzhengma:before { + content: "\e61b"; +} + +.iconbiaoqianye-dituzhaoren1:before { + content: "\e7ac"; +} + +.iconbiaoqianye-dituzhaoren2:before { + content: "\e7ae"; +} + +.icondituzhaoren2:before { + content: "\e7a1"; +} + +.iconshimingrenzheng:before { + content: "\e7a3"; +} + +.iconzizhirenzheng:before { + content: "\e7a7"; +} + +.iconshaixuan:before { + content: "\e7a8"; +} + +.iconliebiaomoshi2:before { + content: "\e7aa"; +} + +.iconhetongguanli:before { + content: "\e66d"; +} + +.iconfenleiyingyongtongzhi2:before { + content: "\e6a9"; +} + +.iconjingjirenshuoming:before { + content: "\e79f"; +} + +.iconxiangxiazhankai:before { + content: "\e8f2"; +} + +.iconyinhangqia:before { + content: "\e622"; +} + +.icontixingshixin:before { + content: "\ec72"; +} + +.iconwoyaofabu:before { + content: "\e79e"; +} + +.icondaijiedan1:before { + content: "\e78c"; +} + +.iconyijiedan1:before { + content: "\e792"; +} + +.iconyiwancheng1:before { + content: "\e79d"; +} + +.iconedit-fill:before { + content: "\eb5c"; +} + +.iconbianzu-8_2x:before { + content: "\e606"; +} + +.iconbianzu-8_2x_1_:before { + content: "\e607"; +} + +.iconjinrong_financebeifen-2_2x:before { + content: "\e619"; +} + +.iconshangjia_1:before { + content: "\e78f"; +} + +.iconbangdingqudaoshang:before { + content: "\e767"; +} + +.iconbangdingyewuyuan:before { + content: "\e780"; +} + +.icondaizhuandan:before { + content: "\e791"; +} + +.icondaifuwu4:before { + content: "\e795"; +} + +.iconjujuetuikuan:before { + content: "\e796"; +} + +.iconjishidaoda1:before { + content: "\e799"; +} + +.iconjishichufa1:before { + content: "\e79b"; +} + +.iconjishijiedan1:before { + content: "\e79c"; +} + +.icontixianshenqing1:before { + content: "\e7a0"; +} + +.icontixianjilu1:before { + content: "\e7a2"; +} + +.iconlianxifangshi:before { + content: "\e7a4"; +} + +.icontongyituikuan:before { + content: "\e7a5"; +} + +.iconyongjinxinxi1:before { + content: "\e7a6"; +} + +.iconwodeshouyi2:before { + content: "\e7a9"; +} + +.iconyiwancheng:before { + content: "\e7ab"; +} + +.iconwodeyaoqing1:before { + content: "\e7ad"; +} + +.iconzhanghaoshezhi:before { + content: "\e7b0"; +} + +.iconshenqingzhong:before { + content: "\e7b3"; +} + +.iconpeiwanguan2:before { + content: "\e760"; +} + +.iconpeiwanguan1:before { + content: "\e77f"; +} + +.iconshangcheng2:before { + content: "\e75e"; +} + +.icondaipinglun:before { + content: "\e755"; +} + +.icondaifukuan:before { + content: "\e756"; +} + +.icondaifuwu3:before { + content: "\e758"; +} + +.icondizhi2:before { + content: "\e759"; +} + +.icondituzhaoren1:before { + content: "\e75c"; +} + +.icondingdan11:before { + content: "\e75f"; +} + +.icongexingbiaoqian:before { + content: "\e765"; +} + +.iconhezuohuoban:before { + content: "\e766"; +} + +.icondizhiguanli3:before { + content: "\e768"; +} + +.iconfuwuzhong3:before { + content: "\e76c"; +} + +.iconjishixiangqing:before { + content: "\e772"; +} + +.iconjishi11:before { + content: "\e774"; +} + +.iconlianxikefu3:before { + content: "\e783"; +} + +.icondianpu:before { + content: "\e784"; +} + +.iconpinglun3:before { + content: "\e785"; +} + +.iconqiehuan:before { + content: "\e78b"; +} + +.iconshoucang23:before { + content: "\e78d"; +} + +.iconshenqingjishi3:before { + content: "\e78e"; +} + +.iconwode12:before { + content: "\e793"; +} + +.icontuikuan3:before { + content: "\e794"; +} + +.iconwoshiqudao2:before { + content: "\e797"; +} + +.iconwentifankui4:before { + content: "\e798"; +} + +.iconshoucang13:before { + content: "\e79a"; +} + +.iconbuxihuan-xuanzhong:before { + content: "\e753"; +} + +.iconbuxihuan:before { + content: "\e754"; +} + +.icondizhiguanli2:before { + content: "\e757"; +} + +.iconfaxian-1:before { + content: "\e75b"; +} + +.iconfaxian-2:before { + content: "\e75d"; +} + +.iconhehuoren1:before { + content: "\e762"; +} + +.iconpeiwanguan:before { + content: "\e76a"; +} + +.iconpinglun2:before { + content: "\e76b"; +} + +.iconshangchuantupian:before { + content: "\e76d"; +} + +.iconshezhi:before { + content: "\e76e"; +} + +.iconshenqingfenxiaoyuan:before { + content: "\e76f"; +} + +.iconshouye12:before { + content: "\e770"; +} + +.iconshichang:before { + content: "\e771"; +} + +.iconshouye2:before { + content: "\e777"; +} + +.iconwentifankui3:before { + content: "\e778"; +} + +.iconwode-1:before { + content: "\e77a"; +} + +.iconwode-2:before { + content: "\e781"; +} + +.iconxiaoxi2:before { + content: "\e786"; +} + +.iconwoshiqudaoshang:before { + content: "\e782"; +} + +.iconwoyaoruzhu:before { + content: "\e788"; +} + +.iconxiaoxi1:before { + content: "\e789"; +} + +.iconxiangqing2:before { + content: "\e78a"; +} + +.iconshoucang22:before { + content: "\e72b"; +} + +.iconshoucang12:before { + content: "\e730"; +} + +.icondizhi_1:before { + content: "\e737"; +} + +.icondadianhua_1:before { + content: "\e73d"; +} + +.iconshipin2:before { + content: "\e735"; +} + +.iconbangdingjishi1:before { + content: "\e723"; +} + +.icondaifuwu2:before { + content: "\e72a"; +} + +.icondaipingjia2:before { + content: "\e72c"; +} + +.icondaizhifu2:before { + content: "\e72d"; +} + +.icondizhi1:before { + content: "\e72e"; +} + +.icondizhiguanli1:before { + content: "\e72f"; +} + +.icondingdan1:before { + content: "\e731"; +} + +.icondianming:before { + content: "\e732"; +} + +.iconfuwuzhong2:before { + content: "\e733"; +} + +.icongongsi:before { + content: "\e734"; +} + +.iconjingxiaoshang:before { + content: "\e736"; +} + +.iconjuli3:before { + content: "\e738"; +} + +.iconjishi1:before { + content: "\e739"; +} + +.iconlianxikefu2:before { + content: "\e73a"; +} + +.iconmendian1:before { + content: "\e73b"; +} + +.iconpingjia:before { + content: "\e73c"; +} + +.iconqiehuanjishiduan2:before { + content: "\e740"; +} + +.iconputonghuiyuan:before { + content: "\e741"; +} + +.iconshijian1:before { + content: "\e742"; +} + +.iconshenqingjishi2:before { + content: "\e743"; +} + +.iconshoucang:before { + content: "\e745"; +} + +.iconshouye1:before { + content: "\e746"; +} + +.iconwentifankui2:before { + content: "\e747"; +} + +.icontuiguanghaibao1:before { + content: "\e748"; +} + +.iconwode11:before { + content: "\e749"; +} + +.iconwodeshouyi1:before { + content: "\e74b"; +} + +.iconwodefensi:before { + content: "\e74c"; +} + +.iconwoshiqudao1:before { + content: "\e74d"; +} + +.iconyingyezhizhao:before { + content: "\e74e"; +} + +.iconshenqingfenxiaoshang:before { + content: "\e74f"; +} + +.icontuikuan2:before { + content: "\e750"; +} + +.iconyingyeshijian:before { + content: "\e751"; +} + +.iconzuizaokeyue1:before { + content: "\e752"; +} + +.icon-hezuoguanxi:before { + content: "\e8a9"; +} + +.iconpinglun1:before { + content: "\e70d"; +} + +.iconjuli2:before { + content: "\e70e"; +} + +.iconshoucang11:before { + content: "\e713"; +} + +.iconshoucang21:before { + content: "\e715"; +} + +.iconxiangqing1:before { + content: "\e716"; +} + +.iconcamera-fill:before { + content: "\e711"; +} + +.icondaipingjia1:before { + content: "\e718"; +} + +.icondaifuwu1:before { + content: "\e719"; +} + +.icondaizhifu1:before { + content: "\e71a"; +} + +.icondizhi:before { + content: "\e71b"; +} + +.iconlianxikefu1:before { + content: "\e71c"; +} + +.iconhehuoren:before { + content: "\e71d"; +} + +.iconpingbiyonghu:before { + content: "\e71e"; +} + +.iconshenqingjishi1:before { + content: "\e71f"; +} + +.icontixianjilu:before { + content: "\e720"; +} + +.icontuikuan1:before { + content: "\e721"; +} + +.iconfuwuzhong1:before { + content: "\e722"; +} + +.iconwentifankui1:before { + content: "\e724"; +} + +.iconwodeyaoqing:before { + content: "\e725"; +} + +.iconqiehuanjishiduan1:before { + content: "\e726"; +} + +.iconwodeyouhuiquan:before { + content: "\e727"; +} + +.iconwoshiqudao:before { + content: "\e728"; +} + +.iconyongjinliushui:before { + content: "\e729"; +} + +.icondingdan4:before { + content: "\e709"; +} + +.iconpingfen1:before { + content: "\e70a"; +} + +.iconjuli1:before { + content: "\e70b"; +} + +.iconanmo3:before { + content: "\e70c"; +} + +.iconshangjia:before { + content: "\e70f"; +} + +.iconshijian:before { + content: "\e710"; +} + +.iconshouye31:before { + content: "\e712"; +} + +.iconwode3:before { + content: "\e714"; +} + +.iconzuizaokeyue:before { + content: "\e717"; +} + +.icon-account:before { + content: "\e610"; +} + +.icon-alipay-fill:before { + content: "\e669"; +} + +.iconshipin:before { + content: "\e618"; +} + +.iconshang:before { + content: "\e862"; +} + +.iconxia:before { + content: "\e863"; +} + +.icon-android:before { + content: "\e63d"; +} + +.icon-play-video:before { + content: "\e66e"; +} + +.icon-shield:before { + content: "\e65d"; +} + +.icondingdanguanli:before { + content: "\e700"; +} + +.iconshouhuodepinglun:before { + content: "\e703"; +} + +.iconxinzengguanzhu:before { + content: "\e706"; +} + +.icontixianshenqing:before { + content: "\e707"; +} + +.iconyongjinxinxi:before { + content: "\e708"; +} + +.iconkeyuyue:before { + content: "\e6ff"; +} + +.icon-bofang:before { + content: "\e621"; +} + +.icon-caidan:before { + content: "\e790"; +} + +.icon-edit:before { + content: "\ec7c"; +} + +.icon-kefuwu:before { + content: "\e702"; +} + +.icon-dongtai2:before { + content: "\e6f7"; +} + +.icon-dongtai1:before { + content: "\e6fb"; +} + +.icon-shoucang-fill:before { + content: "\e6fc"; +} + +.icon-shoucang:before { + content: "\e6fd"; +} + +.icon-pinglun:before { + content: "\e6fe"; +} + +.iconshengji:before { + content: "\e6f4"; +} + +.icon-required:before { + content: "\e649"; +} + +.iconchefeitixianjilu:before { + content: "\e6f0"; +} + +.icondengjiguanli:before { + content: "\e6f1"; +} + +.iconyanzhengma:before { + content: "\e624"; +} + +.icondangqianweizhi:before { + content: "\e6de"; +} + +.iconshijianguanli2:before { + content: "\e6df"; +} + +.iconweizhigengxin1:before { + content: "\e6e0"; +} + +.iconyijianbaojing:before { + content: "\e6e1"; +} + +.icontishishuoming:before { + content: "\e64c"; +} + +.iconshuyi_shuoming:before { + content: "\e668"; +} + +.icon-alipay:before { + content: "\e68a"; +} + +.icon-level-line:before { + content: "\e6dd"; +} + +.icon-level-icon:before { + content: "\e6d4"; +} + +.icon-xiuxi:before { + content: "\e667"; +} + +.icon-jiedan:before { + content: "\e625"; +} + +.icon-zaixian:before { + content: "\e89d"; +} + +.icon-caiwuguanli:before { + content: "\e617"; +} + +.icon-guanbi-fill:before { + content: "\e85f"; +} + +.iconwodeshoucang:before { + content: "\e6c8"; +} + +.iconwodekaquan:before { + content: "\e6c9"; +} + +.iconshouye:before { + content: "\e6e2"; +} + +.icontushucxuanzebofangtiaozhuan:before { + content: "\e677"; +} + +.icongengduo1:before { + content: "\e644"; +} + +.iconbianjiziliao:before { + content: "\e6c4"; +} + +.iconchapingshensu:before { + content: "\e6c5"; +} + +.iconchefeimingxi:before { + content: "\e6c6"; +} + +.iconchongzhijine:before { + content: "\e6c7"; +} + +.iconfenchengmingxi:before { + content: "\e6ca"; +} + +.iconfenxiang:before { + content: "\e6cb"; +} + +.iconjifenmingxi:before { + content: "\e6cc"; +} + +.iconguanbi:before { + content: "\e6cd"; +} + +.iconqiehuanyonghuduan:before { + content: "\e6ce"; +} + +.iconjiazhongtongji:before { + content: "\e6cf"; +} + +.iconriqi:before { + content: "\e6d0"; +} + +.iconshangchuanzhaopian:before { + content: "\e6d1"; +} + +.iconsousuo:before { + content: "\e6d2"; +} + +.iconshijianguanli1:before { + content: "\e6d3"; +} + +.iconweizhigengxin:before { + content: "\e6d5"; +} + +.iconwentifankui:before { + content: "\e6d6"; +} + +.iconwuliaoshangcheng:before { + content: "\e6d7"; +} + +.iconyejimingxi:before { + content: "\e6d9"; +} + +.iconzhuxiaozhanghu:before { + content: "\e6db"; +} + +.iconwoyaojieyue:before { + content: "\e6dc"; +} + +.icongengduo:before { + content: "\e6b8"; +} + +.iconguan:before { + content: "\e6bc"; +} + +.iconkai:before { + content: "\e6c1"; +} + +.icon-weixin:before { + content: "\e627"; +} + +.icon-apple:before { + content: "\e60f"; +} + +.icongerenxinxi:before { + content: "\e616"; +} + +.iconzhiweixiangqing:before { + content: "\e6e5"; +} + +.icon-account-line:before { + content: "\e688"; +} + +.icon-person-accounts:before { + content: "\e6ba"; +} + +.icon-chaifenyemian:before { + content: "\e6c0"; +} + +.icon-diy:before { + content: "\e629"; +} + +.icon-zuzhi:before { + content: "\eaaa"; +} + +.icon-qudao:before { + content: "\e63b"; +} + +.iconjishijiedan:before { + content: "\e6b9"; +} + +.iconerweima3:before { + content: "\e84c"; +} + +.iconerweima:before { + content: "\e623"; +} + +.iconjishidaoda:before { + content: "\e6b3"; +} + +.iconjishichufa:before { + content: "\e6b5"; +} + +.iconjishifuwu:before { + content: "\e6b6"; +} + +.iconjishiwancheng:before { + content: "\e6bd"; +} + +.iconyijiedan:before { + content: "\e6be"; +} + +.icondaijiedan:before { + content: "\e6bf"; +} + +.iconjingbao:before { + content: "\e636"; +} + +.iconanmo1:before { + content: "\e857"; +} + +.iconanmo2:before { + content: "\e858"; +} + +.iconchongzhi:before { + content: "\e859"; +} + +.iconbodadianhua:before { + content: "\e85a"; +} + +.icondaipingjia:before { + content: "\e85b"; +} + +.icondizhiguanli:before { + content: "\e85c"; +} + +.icondingdan2:before { + content: "\e85d"; +} + +.iconfuwuzhong:before { + content: "\e85e"; +} + +.iconjifen3:before { + content: "\e860"; +} + +.icondingdan3:before { + content: "\e861"; +} + +.iconjuli:before { + content: "\e867"; +} + +.iconlianxikefu:before { + content: "\e868"; +} + +.iconbangdingjishi:before { + content: "\e869"; +} + +.iconpinglun:before { + content: "\e86a"; +} + +.iconqiehuanjishiduan:before { + content: "\e86b"; +} + +.icondaizhifu:before { + content: "\e86c"; +} + +.icondaifuwu:before { + content: "\e86d"; +} + +.iconshaixuanshang-1:before { + content: "\e870"; +} + +.iconshijianguanli:before { + content: "\e873"; +} + +.iconshipin1:before { + content: "\e875"; +} + +.iconshoucang1:before { + content: "\e876"; +} + +.iconshenqingjishi:before { + content: "\e877"; +} + +.iconshoucangjishi:before { + content: "\e878"; +} + +.iconshouye21:before { + content: "\e879"; +} + +.iconshouye11:before { + content: "\e87a"; +} + +.iconpingfen:before { + content: "\e87b"; +} + +.icontuikuan:before { + content: "\e87c"; +} + +.icontuiguanghaibao:before { + content: "\e87d"; +} + +.iconwodeshouyi:before { + content: "\e87e"; +} + +.iconxiangqing:before { + content: "\e87f"; +} + +.iconwodetuandui1:before { + content: "\e880"; +} + +.iconshaixuanxia-1:before { + content: "\e881"; +} + +.iconsousuo1:before { + content: "\e883"; +} + +.iconshoucang2:before { + content: "\e884"; +} + +.iconwode2:before { + content: "\e885"; +} + +.iconyaoqingyouli:before { + content: "\e886"; +} + +.iconwode1:before { + content: "\e887"; +} + +.icon-down-fill:before { + content: "\e665"; +} + +.icon-up-fill:before { + content: "\e666"; +} + +.iconweixin:before { + content: "\e64f"; +} + +.icon-share:before { + content: "\e638"; +} + +.iconnan-xiaotu:before { + content: "\e7b1"; +} + +.iconnv-xiaotu:before { + content: "\e7b4"; +} + +.icontongzhi:before { + content: "\e64e"; +} + +.iconsanjiao_xia:before { + content: "\e671"; +} + +.iconbalance:before { + content: "\e763"; +} + +.iconweixinzhifu1:before { + content: "\e764"; +} + +.iconqianbao:before { + content: "\e829"; +} + +.iconhuiyuanka:before { + content: "\e7af"; +} + +.icon-liuyanguanli:before { + content: "\e6bb"; +} + +.iconguanzhu:before { + content: "\e68c"; +} + +.iconguanzhuxuanzhong:before { + content: "\e689"; +} + +.iconyduixingxingkongxin:before { + content: "\e779"; +} + +.iconyduixingxingshixin:before { + content: "\e77b"; +} + +.icon-yuyue:before { + content: "\e6da"; +} + +.icon-yingxiao:before { + content: "\e701"; +} + +.icon-gouwuche-fill:before { + content: "\e600"; +} + +.icon-dingwei-fill:before { + content: "\e602"; +} + +.icon-left:before { + content: "\e604"; +} + +.icon-right:before { + content: "\e608"; +} + +.icon-close:before { + content: "\e609"; +} + +.icon-add:before { + content: "\e611"; +} + +.icon-gouwudai:before { + content: "\e73e"; +} + +.icon-caiwu:before { + content: "\e6a7"; +} + +.icon-kehu:before { + content: "\e6ad"; +} + +.icon-member:before { + content: "\e761"; +} + +.icon-shenhe:before { + content: "\e695"; +} + +.icon-xitong:before { + content: "\e6a8"; +} + +.icon-daifukuan:before { + content: "\e787"; +} + +.icon-dingdanguanli:before { + content: "\e632"; +} + +.icon-shangpin:before { + content: "\e63c"; +} + +.icon-dianpu:before { + content: "\e66c"; +} + +.icon-daihexiao:before { + content: "\e6f8"; +} + +.icon-yiwancheng:before { + content: "\e6f9"; +} + +.icon-pingjia:before { + content: "\e77e"; +} + +.icon-home:before { + content: "\e775"; +} + +.icon-home-fill:before { + content: "\e776"; +} + +.icon-dingwei:before { + content: "\e612"; +} + +.icon-shouhouguanli:before { + content: "\e773"; +} + +.icon-jishi:before { + content: "\e652"; +} + +.icon-wodeshouhou:before { + content: "\e60d"; +} + +.icon-tongzhi-fill:before { + content: "\e615"; +} + +.icon-jishi-fill:before { + content: "\e601"; +} + +.icon-tuichu:before { + content: "\e603"; +} + +.icon-camera:before { + content: "\e60e"; +} + +.icon-down:before { + content: "\e60a"; +} + +.icon-xuanze:before { + content: "\e77c"; +} + +.icon-xuanze-fill:before { + content: "\e77d"; +} + +.icon-switch:before { + content: "\e642"; +} + +.icon-switch-on:before { + content: "\e643"; +} + +.icon-jian-fill:before { + content: "\e61f"; +} + +.icon-jian:before { + content: "\e6fa"; +} + +.icon-radio-fill:before { + content: "\e620"; +} + +.icon-gouwudai-fill:before { + content: "\e6d8"; +} + +.icon-eyeclose:before { + content: "\e6ab"; +} + +.icon-eyeopen:before { + content: "\e6ac"; +} + +.icon-mima:before { + content: "\e69e"; +} + +.icon-username:before { + content: "\e6b7"; +} + +.icon-mine:before { + content: "\e6f5"; +} + +.icon-mine-fill:before { + content: "\e6f6"; +} + +.icon-tongzhi:before { + content: "\e60b"; +} + +.icon-jia-bold:before { + content: "\e613"; +} + +.icon-jian-bold:before { + content: "\e614"; +} + +.icon-tianjia:before { + content: "\e653"; +} + +.icon-zhuanhuan:before { + content: "\e6c2"; +} + +.icon-xiaochengxu:before { + content: "\e6c3"; +} + +.icon-warn:before { + content: "\e6a5"; +} + +.icon-weirenzheng:before { + content: "\e63a"; +} + +.icon-biaoqian:before { + content: "\e60c"; +} + +.icon-shuaxin:before { + content: "\e654"; +} diff --git a/styles/index.wxss b/styles/index.wxss new file mode 100644 index 0000000..b9a2929 --- /dev/null +++ b/styles/index.wxss @@ -0,0 +1,9 @@ +@import './1px.wxss'; +@import './avatar.wxss'; +@import './base.wxss'; +@import './button.wxss'; +@import './icon.wxss'; +@import './layout.wxss'; +@import './navbar.wxss'; +@import './popup.wxss'; +@import './pages.wxss'; diff --git a/styles/layout.wxss b/styles/layout.wxss new file mode 100644 index 0000000..b9ecb6d --- /dev/null +++ b/styles/layout.wxss @@ -0,0 +1,60 @@ +/*flex布局,可以自己定义适合自己的*/ +.flex { + display: flex; +} + +.flex-1 { + flex: 1; +} + +.flex-column { + display: flex; + flex-direction: column; +} + +.flex-warp { + display: flex; + flex-wrap: wrap; +} + +.flex-center { + display: flex; + align-items: center; + justify-content: center; +} + +.flex-between { + display: flex; + align-items: center; + justify-content: space-between; +} + +.flex-x-center { + display: flex; + justify-content: center; +} + +.flex-x-between { + display: flex; + justify-content: space-between; +} + +.flex-y-center { + display: flex; + align-items: center; +} + +.flex-y-start { + display: flex; + align-items: flex-start; +} + +.flex-y-end { + display: flex; + align-items: flex-end; +} + +.flex-y-baseline { + display: flex; + align-items: baseline; +} diff --git a/styles/navbar.wxss b/styles/navbar.wxss new file mode 100644 index 0000000..a701bbd --- /dev/null +++ b/styles/navbar.wxss @@ -0,0 +1,100 @@ +/* ios_自定义navBar */ +.back-user-ios { + width: 87px; + height: 32px; + border-radius: 32px; + margin-top: 6px; + display: flex; + align-items: center; + justify-content: center; + background: #fff; + border: 1px solid #eeeeee; + margin-left: 24rpx; + transform: rotateZ(360deg); +} + +.back-user-ios .back-user_avatar { + width: 24px; + height: 24px; + border-radius: 50%; + background: #f4f6f8; +} + +.back-user-ios .back-user_text { + font-size: 11px; + line-height: 44px; + margin-left: 5px; +} + +/* .nav_c_text { + line-height: 44px; + font-size: 16px; +} */ + +/* android_自定义navBar */ +.back-user-android { + /* #ifdef MP-BAIDU */ + width: 74.5px; + height: 28px; + border-radius: 28px; + margin-top: 5px; + /* #endif */ + /* #ifndef MP-BAIDU */ + width: 87px; + height: 32px; + border-radius: 32px; + margin-top: 6px; + /* #endif */ + display: flex; + align-items: center; + justify-content: center; + background: #fff; + border: 1px solid #eeeeee; + margin-left: 24rpx; + transform: rotateZ(360deg); +} + + +.back-user-android .back-user_avatar { + /* #ifdef MP-BAIDU */ + width: 20px; + height: 20px; + /* #endif */ + /* #ifndef MP-BAIDU */ + width: 24px; + height: 24px; + /* #endif */ + border-radius: 50%; + background: #f4f6f8; +} + + +.back-user-android .back-user_text { + /* #ifdef MP-BAIDU */ + font-size: 10px; + line-height: 28px; + margin-left: 3px; + /* #endif */ + /* #ifndef MP-BAIDU */ + font-size: 11px; + line-height: 44px; + margin-left: 5px; + /* #endif */ +} + +.back-user-ios.none, +.back-user-android.none { + color: #fff; + background: none; +} + +.nav_c_text { + /* #ifdef MP-BAIDU */ + line-height: 36px; + font-size: 15px; + /* #endif */ + /* #ifndef MP-BAIDU */ + line-height: 44px; + font-size: 16px; + /* #endif */ +} diff --git a/styles/pages.wxss b/styles/pages.wxss new file mode 100644 index 0000000..55603f1 --- /dev/null +++ b/styles/pages.wxss @@ -0,0 +1,440 @@ +.page-height { + width: 100%; + height: 100vh; + background: #fff; +} + +/* 单选/多选按钮 */ +.pay-icon { + font-size: 40rpx; +} + +/* 分享按钮 */ +.common-share-btn { + right: 30rpx; + bottom: 140rpx; + width: 90rpx; + height: 90rpx; + margin-bottom: calc(env(safe-area-inset-bottom) / 2); + + .iconfont { + font-size: 40rpx; + } +} + +.common-share-btn.detail { + bottom: 170rpx; +} + +.map-info { + .iconjuli { + font-size: 42rpx; + } + + .icon-down { + transform: scale(0.5); + } +} + +/* 海报 */ +.hideCanvasView { + position: relative; + + .hideCanvas { + position: absolute; + left: -9999rpx; + top: -9999rpx + } +} + +/* 技-师页面 */ +.pages-technician { + .fix-info { + height: 225rpx; + + .space-top { + width: 100%; + height: 40rpx; + top: 0; + } + + .search-info { + width: 100%; + top: 0; + + .city-info { + width: 170rpx; + + .iconfont { + font-size: 20rpx; + transform: scale(0.5); + } + } + } + } + + .fix-info.choose { + height: 135rpx; + } + + + .choose-city-popup { + padding: 0 32rpx 0 30rpx; + + .city-img { + width: 688rpx; + height: 364rpx; + } + + .text { + top: 256rpx; + left: 78rpx; + width: 606rpx; + } + + .flex-between { + margin-top: 25rpx; + + .item-btn { + width: 238rpx; + height: 85rpx; + background: #F9F9F9; + } + } + + } +} + + +/* 订单相关页面 */ +.order-pages { + + .service-type-item { + min-width: 143rpx; + height: 59rpx; + padding: 0 10rpx; + background: #F5F5F5; + border-radius: 8rpx + } + + .address-info { + .address-icon { + width: 64rpx; + height: 64rpx; + + .iconfont { + font-size: 38rpx; + } + } + + .username { + font-size: 30rpx; + } + } + + .store-info { + + .item-icon { + width: 40rpx; + height: 40rpx; + + .iconfont { + font-size: 28rpx; + } + + .item-icon { + top: 0; + left: 0; + opacity: 0.1; + } + } + } + + + + .item-child { + .bell-tag { + top: 0; + left: 0; + width: 120rpx; + height: 40rpx; + border-radius: 16rpx 0 16rpx 0; + } + + .grayscale { + + .c-title, + .c-warning { + color: #999; + } + } + + .cover { + width: 155rpx; + height: 155rpx; + } + + .refund-img { + width: 196rpx; + height: 196rpx; + } + + .refund-img:nth-child(3n) { + margin-right: 0 + } + } + + .item-textarea { + width: 570rpx; + height: 300rpx; + } + + .menu-list { + margin-top: -30rpx; + + .menu-title { + height: 90rpx; + + .iconfont { + font-size: 24rpx; + } + } + + .menu-line { + width: 80%; + top: 76rpx; + left: 10%; + } + + .item-child { + width: 20%; + margin: 10rpx 0; + + .item-img { + width: 72rpx; + height: 72rpx; + z-index: 9; + border: 1px solid #666; + + .iconfont { + font-size: 40rpx; + } + } + } + + } + + .add-bell { + .menu-line { + width: 70%; + top: 76rpx; + left: 15%; + } + + .item-child { + width: 33.33%; + } + + } + + .order-agent-info { + color: #4A4A4A; + + .coach-img { + width: 94rpx; + height: 94rpx; + } + + .title { + width: 200rpx; + font-weight: bold; + } + + .text { + color: #777; + font-size: 26rpx; + } + } + + .copy-btn { + width: 60rpx; + height: 32rpx; + border: 1rpx solid #fff; + transform: rotateZ(360deg); + } + + .copy-btn.fill { + color: 333; + borderColor: #eee; + background: #eee; + padding: 2rpx 6rpx; + } + + .copy-btn.span { + padding: 2rpx 6rpx; + } + + .footer-info { + + bottom: 0; + + .item-btn { + min-width: 150rpx; + height: 64rpx; + padding: 0 10rpx; + background: #EEEEEE; + } + + } + +} + + +/* 申请表单相关页面 */ +.apply-pages { + .apply-form { + + .item-text { + width: 200rpx; + height: 30rpx; + line-height: 30rpx; + font-size: 30rpx; + color: #1F1F1F; + } + + .item-input { + min-height: 30rpx; + line-height: 30rpx; + padding: 25rpx 0; + font-size: 26rpx; + color: #A9A9A9; + } + + .item-input.text { + padding: 30rpx 0; + } + + .item-textarea { + width: 630rpx; + height: 400rpx; + color: #A9A9A9; + } + + .icon-switch, + .icon-switch-on { + font-size: 90rpx; + line-height: 46rpx; + } + } +} + +/* 储值明细记录 */ +.stored-record-pages { + .list-time { + z-index: 99999; + + .item-child { + width: 50%; + height: 95rpx; + + .iconfont { + font-size: 28rpx; + } + } + } + + movable-area, + movable-view { + width: 686rpx; + height: 148rpx; + overflow: hidden; + } + + .touch-item { + font-size: 14px; + display: flex; + justify-content: space-between; + width: 686rpx; + height: 100%; + overflow: hidden + } + + .content { + width: 100%; + -webkit-transition: all 0.4s; + transition: all 0.4s; + -webkit-transform: translateX(270rpx); + transform: translateX(270rpx); + margin-left: -270rpx; + } + + .delete-btn { + width: 120rpx; + height: 100%; + color: #fff; + border-radius: 0 15rpx 15rpx 0; + -webkit-transform: translateX(270rpx); + transform: translateX(270rpx); + -webkit-transition: all 0.4s; + transition: all 0.4s; + } + + .touch-move-active .content, + .touch-move-active .delete-btn { + -webkit-transform: translateX(0); + transform: translateX(0); + } + + .popup-choose-time { + .item-child { + width: 50%; + } + } +} + +.container { + width: 100%; +} + +/* 技-师等级 */ +.technician-level { + height: 333rpx; + background: linear-gradient(206deg, #464749 0%, #020202 30%, #000000 100%); + border-radius: 16rpx; + transform: rotateZ(360deg); + overflow: hidden; + + .icon-level-icon { + font-size: 505rpx; + top: -86rpx; + left: 40rpx; + z-index: -1; + } + + .level-icon-img { + top: 22rpx; + right: 41rpx; + width: 111rpx; + height: 111rpx; + } + + .level-title { + font-size: 38rpx; + color: #F9F9F9; + } + + .level-line { + width: 100%; + height: 20rpx; + background: #2D333C; + } + + .level-line.cur { + top: 0; + left: 0; + } + + .f-icontext { + color: rgba(255, 255, 255, 0.7); + } +} \ No newline at end of file diff --git a/styles/popup.wxss b/styles/popup.wxss new file mode 100644 index 0000000..9bfac09 --- /dev/null +++ b/styles/popup.wxss @@ -0,0 +1,72 @@ +.common-popup-content { + width: 620rpx; + height: auto; + padding: 50rpx; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + + .title { + font-size: 40rpx; + font-family: Microsoft YaHei; + font-weight: bold; + color: #333; + } + + .desc, + .name { + font-size: 24rpx; + font-family: Microsoft YaHei; + font-weight: 400; + color: #666; + margin-top: 5rpx; + } + + .name { + color: #999; + margin-top: 15rpx; + } + + .image { + width: 200rpx; + height: 200rpx; + border-radius: 15rpx; + margin-top: 40rpx; + } + + .image.middle { + width: 300rpx; + height: 300rpx; + } + + .input { + width: 480rpx; + height: 110rpx; + background: #F7F7F7; + } + .textarea { + width: 480rpx; + height: 300rpx; + background: #F7F7F7; + } + + .button { + display: flex; + align-items: center; + justify-content: center; + margin-top: 50rpx; + + .item-child { + width: 240rpx; + height: 90rpx; + color: #666; + background: #EEEEEE; + border-radius: 45rpx; + margin: 0 20rpx; + display: flex; + align-items: center; + justify-content: center; + } + } +} diff --git a/technician/pages/apply.vue b/technician/pages/apply.vue new file mode 100644 index 0000000..fc5b116 --- /dev/null +++ b/technician/pages/apply.vue @@ -0,0 +1,704 @@ + + + + + + \ No newline at end of file diff --git a/technician/pages/bad-comments/box.vue b/technician/pages/bad-comments/box.vue new file mode 100644 index 0000000..ef458d8 --- /dev/null +++ b/technician/pages/bad-comments/box.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/technician/pages/bad-comments/choice.vue b/technician/pages/bad-comments/choice.vue new file mode 100644 index 0000000..50fdd89 --- /dev/null +++ b/technician/pages/bad-comments/choice.vue @@ -0,0 +1,232 @@ + + + + + diff --git a/technician/pages/bad-comments/list.vue b/technician/pages/bad-comments/list.vue new file mode 100644 index 0000000..95f2758 --- /dev/null +++ b/technician/pages/bad-comments/list.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/technician/pages/bad-comments/success.vue b/technician/pages/bad-comments/success.vue new file mode 100644 index 0000000..2fb7c1e --- /dev/null +++ b/technician/pages/bad-comments/success.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/technician/pages/car-fare.vue b/technician/pages/car-fare.vue new file mode 100644 index 0000000..e3f8d6e --- /dev/null +++ b/technician/pages/car-fare.vue @@ -0,0 +1,220 @@ + + + + + diff --git a/technician/pages/edit.vue b/technician/pages/edit.vue new file mode 100644 index 0000000..911f566 --- /dev/null +++ b/technician/pages/edit.vue @@ -0,0 +1,700 @@ + + + + + + \ No newline at end of file diff --git a/technician/pages/order/label.vue b/technician/pages/order/label.vue new file mode 100644 index 0000000..33bcb00 --- /dev/null +++ b/technician/pages/order/label.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/technician/pages/order/list.vue b/technician/pages/order/list.vue new file mode 100644 index 0000000..553266d --- /dev/null +++ b/technician/pages/order/list.vue @@ -0,0 +1,914 @@ + + + + + + \ No newline at end of file diff --git a/technician/pages/order/recorder.vue b/technician/pages/order/recorder.vue new file mode 100644 index 0000000..565b190 --- /dev/null +++ b/technician/pages/order/recorder.vue @@ -0,0 +1,184 @@ + + + + + + \ No newline at end of file diff --git a/technician/pages/shield.vue b/technician/pages/shield.vue new file mode 100644 index 0000000..2b3b7b0 --- /dev/null +++ b/technician/pages/shield.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/technician/pages/shop/detail.vue b/technician/pages/shop/detail.vue new file mode 100644 index 0000000..2681297 --- /dev/null +++ b/technician/pages/shop/detail.vue @@ -0,0 +1,239 @@ + + + + + diff --git a/technician/pages/shop/list.vue b/technician/pages/shop/list.vue new file mode 100644 index 0000000..cd796d1 --- /dev/null +++ b/technician/pages/shop/list.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/technician/pages/time-manage.vue b/technician/pages/time-manage.vue new file mode 100644 index 0000000..bbd4f40 --- /dev/null +++ b/technician/pages/time-manage.vue @@ -0,0 +1,294 @@ + + + + + + diff --git a/technician/pages/time-set.vue b/technician/pages/time-set.vue new file mode 100644 index 0000000..12536e3 --- /dev/null +++ b/technician/pages/time-set.vue @@ -0,0 +1,437 @@ + + + + + + \ No newline at end of file diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..b04ded9 --- /dev/null +++ b/uni.scss @@ -0,0 +1,103 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ + +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ + +/* 颜色变量 */ +@mixin bg_color($color) { + background-color: $color; + [data-theme="theme1"] & { + background-color:#F3C149; + } +} + +// 背景 +$-background-main-color:#F8F8F8;//主色 +$-background-deputy-color:#FFFFFF;//副色 +$-background-secondary-color:#373A3F;//次色 +$-background-select-vehicle-color:#1258E6;//车辆 +$-background-select-make-color:linear-gradient(-90deg, #F7B433, #F3C149);//挂号人默认背景 + +// 文本 +$-text-main-color:#3175FE;//主色 +$-text-deputy-color:#999999;//副色 +$-text-secondary-color:#333333;//副色 + +//按钮 +$-button-main-color:#373A3F;//主色 +$-button-deputy-color:#C9CDD4;//副色 + + + + + + +/* 行为相关颜色 */ +$uni-color-primary: #007aff; +$uni-color-success: #4cd964; +$uni-color-warning: #f0ad4e; +$uni-color-error: #dd524d; + +/* 文字基本颜色 */ +$uni-text-color:#333;//基本色 +$uni-text-color-inverse:#fff;//反色 +$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 +$uni-text-color-placeholder: #808080; +$uni-text-color-disable:#c0c0c0; + +/* 背景颜色 */ +$uni-bg-color:#ffffff; +$uni-bg-color-grey:#f8f8f8; +$uni-bg-color-hover:#f1f1f1;//点击状态颜色 +$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 + +/* 边框颜色 */ +$uni-border-color:#c8c7cc; + +/* 尺寸变量 */ + +/* 文字尺寸 */ +$uni-font-size-sm:24rpx; +$uni-font-size-base:28rpx; +$uni-font-size-lg:32rpx; + +/* 图片尺寸 */ +$uni-img-size-sm:40rpx; +$uni-img-size-base:52rpx; +$uni-img-size-lg:80rpx; + +/* Border Radius */ +$uni-border-radius-sm: 4rpx; +$uni-border-radius-base: 6rpx; +$uni-border-radius-lg: 12rpx; +$uni-border-radius-circle: 50%; + +/* 水平间距 */ +$uni-spacing-row-sm: 10px; +$uni-spacing-row-base: 20rpx; +$uni-spacing-row-lg: 30rpx; + +/* 垂直间距 */ +$uni-spacing-col-sm: 8rpx; +$uni-spacing-col-base: 16rpx; +$uni-spacing-col-lg: 24rpx; + +/* 透明度 */ +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 + +/* 文章场景相关 */ +$uni-color-title: #2C405A; // 文章标题颜色 +$uni-font-size-title:40rpx; +$uni-color-subtitle: #555555; // 二级标题颜色 +$uni-font-size-subtitle:36rpx; +$uni-color-paragraph: #3F536E; // 文章段落颜色 +$uni-font-size-paragraph:30rpx; \ No newline at end of file diff --git a/uni_modules/lime-painter/changelog.md b/uni_modules/lime-painter/changelog.md new file mode 100644 index 0000000..84871a5 --- /dev/null +++ b/uni_modules/lime-painter/changelog.md @@ -0,0 +1,153 @@ +## 1.9.3.4(2022-06-20) +- fix: 修复 因创建节点速度问题导致顺序出错。 +- fix: 修复 微信小程序 PC 无法显示本地图片 +- fix: 修复 flex-box 对齐问题 +- feat: 增加 `text-shadow` +- feat: 重写 `text` 对齐方式 +- chore: 更新文档 +## 1.9.3.3(2022-06-17) +- fix: 修复 支付宝小程序 canvas 2d 存在ctx.draw问题导致报错 +- fix: 修复 支付宝小程序 toDataURL 存在权限问题改用 `toTempFilePath` +- fix: 修复 支付宝小程序 image size 问题导致 `objectFit` 无效 +## 1.9.3.2(2022-06-14) +- fix: 修复 image 设置背景色不生效问题 +- fix: 修复 nvue 环境判断缺少参数问题 +## 1.9.3.1(2022-06-14) +- fix: 修复 bottom 定位不对问题 +- fix: 修复 因小数导致计算出错换行问题 +- feat: 增加 `useCORS` h5端图片跨域 在设置请求头无效果后试一下设置这个值 +- chore: 更新文档 +## 1.9.3(2022-06-13) +- feat: 增加 `zIndex` +- feat: 增加 `flex-box` 该功能处于原始阶段,非常简陋。 +- tips: QQ小程序 vue3 不支持, 为 uni 官方BUG +## 1.9.2.9(2022-06-10) +- fix: 修复`text-align`及`margin`居中问题 +## 1.9.2.8(2022-06-10) +- fix: 修复 Nvue `canvasToTempFilePathSync` 不生效问题 +## 1.9.2.7(2022-06-10) +- fix: 修复 margin及padding的bug +- fix: 修复 Nvue `isCanvasToTempFilePath` 不生效问题 +## 1.9.2.6(2022-06-09) +- fix: 修复 Nvue 不显示 +- feat: 增加支持字体渐变 +```html + +``` +## 1.9.2.5(2022-06-09) +- chore: 更变获取父级宽度的设定 +- chore: `pathType` 在canvas 2d 默认为 `url` +## 1.9.2.4(2022-06-08) +- fix: 修复 `pathType` 不生效问题 +## 1.9.2.3(2022-06-08) +- fix: 修复 `canvasToTempFilePath` 漏写 `success` 参数 +## 1.9.2.2(2022-06-07) +- chore: 更新文档 +## 1.9.2.1(2022-06-07) +- fix: 修复 vue3 赋值给this再传入导致image无法绘制 +- fix: 修复 `canvasToTempFilePathSync` 时机问题 +- feat: canvas 2d 更改图片生成方式 `toDataURL` +## 1.9.2(2022-05-30) +- fix: 修复 `canvasToTempFilePathSync` 在 vue3 下只生成一次 +## 1.9.1.7(2022-05-28) +- fix: 修复 `qrcode`显示不全问题 +## 1.9.1.6(2022-05-28) +- fix: 修复 `canvasToTempFilePathSync` 会重复多次问题 +- fix: 修复 `view` css `backgroundImage` 图片下载失败导致 子节点不渲染 +## 1.9.1.5(2022-05-27) +- fix: 修正支付宝小程序 canvas 2d版本号 2.7.15 +## 1.9.1.4(2022-05-22) +- fix: 修复字节小程序无法使用xml方式 +- fix: 修复字节小程序无法使用base64(非2D情况下工具上无法显示) +- fix: 修复支付宝小程序 `canvasToTempFilePath` 报错 +## 1.9.1.3(2022-04-29) +- fix: 修复vue3打包后uni对象为空后的报错 +## 1.9.1.2(2022-04-25) +- fix: 删除多余文件 +## 1.9.1.1(2022-04-25) +- fix: 修复图片不显示问题 +## 1.9.1(2022-04-12) +- fix: 因四舍五入导致有些机型错位 +- fix: 修复无views报错 +- chore: nvue下因ios无法读取插件内static文件,改由下载方式 +## 1.9.0(2022-03-20) +- fix: 因无法固定尺寸导致生成图片不全 +- fix: 特定情况下text判断无效 +- chore: 本地化APP Nvue webview +## 1.8.9(2022-02-20) +- fix: 修复 小程序下载最多10次并发的问题 +- fix: 修复 APP端无法获取本地图片 +- fix: 修复 APP Nvue端不执行问题 +- chore: 增加图片缓存机制 +## 1.8.8.8(2022-01-27) +- fix: 修复 主动调用尺寸问题 +## 1.8.8.6(2022-01-26) +- fix: 修复 nvue 下无宽度时获取父级宽度 +- fix: 修复 ios app 无法渲染问题 +## 1.8.8(2022-01-23) +- fix: 修复 主动调用时无节点问题 +- fix: 修复 `box-shadow` 颜色问题 +- fix: 修复 `transform:rotate` 角度位置问题 +- feat: 增加 `overflow:hidden` +## 1.8.7(2022-01-07) +- fix: 修复 image 方向为 `right` 时原始宽高问题 +- feat: 支持 view 设置背景图 `background-image: url(xxx)` +- chore: 去掉可选链 +## 1.8.6(2021-11-28) +- feat: 支持`view`对`inline-block`的子集使用`text-align` +## 1.8.5.5(2021-08-17) +- chore: 更新文档,删除 replace +- fix: 修复 text 值为 number时报错 +## 1.8.5.4(2021-08-16) +- fix: 字节小程序兼容 +## 1.8.5.3(2021-08-15) +- fix: 修复线性渐变与css现实效果不一致的问题 +- chore: 更新文档 +## 1.8.5.2(2021-08-13) +- chore: 增加`background-image`、`background-repeat` 能力,主要用于背景纹理的绘制,并不是代替`image`。例如:大面积的重复平铺的水印 +- 注意:这个功能H5暂时无法使用,因为[官方的API有BUG](https://ask.dcloud.net.cn/question/128793),待官方修复!!! +## 1.8.5.1(2021-08-10) +- fix: 修复因`margin`报错问题 +## 1.8.5(2021-08-09) +- chore: 增加margin支持`auto`,以达到居中效果 +## 1.8.4(2021-08-06) +- chore: 增加判断缓存文件条件 +- fix: 修复css 多余空格报错问题 +## 1.8.3(2021-08-04) +- tips: 1.6.x 以下的版本升级到1.8.x后要为每个元素都加上定位:position: 'absolute' +- fix: 修复只有一个view子元素时不计算高度的问题 +## 1.8.2(2021-08-03) +- fix: 修复 path-type 为 `url` 无效问题 +- fix: 修复 qrcode `text` 为空时报错问题 +- fix: 修复 image `src` 动态设置时不生效问题 +- feat: 增加 css 属性 `min-width` `max-width` +## 1.8.1(2021-08-02) +- fix: 修复无法加载本地图片 +## 1.8.0(2021-08-02) +- chore 文档更新 +- 使用旧版的同学不要升级! +## 1.8.0-beta(2021-07-30) +- ## 全新布局方式 不兼容旧版! +- chore: 布局方式变更 +- tips: 微信canvas 2d 不支持真机调试 +## 1.6.6(2021-07-09) +- chore: 统一命名规范,无须主动引入组件 +## 1.6.5(2021-06-08) +- chore: 去掉console +## 1.6.4(2021-06-07) +- fix: 修复 数字 为纯字符串时不转换的BUG +## 1.6.3(2021-06-06) +- fix: 修复 PC 端放大的BUG +## 1.6.2(2021-05-31) +- fix: 修复 报`adaptor is not a function`错误 +- fix: 修复 text 多行高度 +- fix: 优化 默认文字的基准线 +- feat: `@progress`事件,监听绘制进度 +## 1.6.1(2021-02-28) +- 删除多余节点 +## 1.6.0(2021-02-26) +- 调整为uni_modules目录规范 +- 修复:transform的rotate不能为负数问题 +- 新增:`pathType` 指定生成图片返回的路径类型,可选值有 `base64`、`url` diff --git a/uni_modules/lime-painter/components/common/relation.js b/uni_modules/lime-painter/components/common/relation.js new file mode 100644 index 0000000..c68661c --- /dev/null +++ b/uni_modules/lime-painter/components/common/relation.js @@ -0,0 +1,147 @@ +const styles = (v ='') => v.split(';').filter(v => v && !/^[\n\s]+$/.test(v)).map(v => { + const key = v.slice(0, v.indexOf(':')) + const value = v.slice(v.indexOf(':')+1) + return { + [key + .replace(/-([a-z])/g, function() { return arguments[1].toUpperCase()}) + .replace(/\s+/g, '') + ]: value.replace(/^\s+/, '').replace(/\s+$/, '') || '' + } + }) +export function parent(parent) { + return { + provide() { + return { + [parent]: this + } + }, + data() { + return { + el: { + css: {}, + views: [] + }, + } + }, + watch: { + css: { + handler(v) { + if(this.canvasId) { + this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {} + this.canvasWidth = this.el.css && this.el.css.width || this.canvasWidth + this.canvasHeight = this.el.css && this.el.css.height || this.canvasHeight + } + }, + immediate: true + } + } + } +} +export function children(parent, options = {}) { + const indexKey = options.indexKey || 'index' + return { + inject: { + [parent]: { + default: null + } + }, + watch: { + el: { + handler(v, o) { + if(JSON.stringify(v) != JSON.stringify(o)) + this.bindRelation() + }, + deep: true, + immediate: true + }, + src: { + handler(v, o) { + if(v != o) + this.bindRelation() + }, + immediate: true + }, + text: { + handler(v, o) { + if(v != o) this.bindRelation() + }, + immediate: true + }, + css: { + handler(v, o) { + if(v != o) + this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {} + }, + immediate: true + }, + replace: { + handler(v, o) { + if(JSON.stringify(v) != JSON.stringify(o)) + this.bindRelation() + }, + deep: true, + immediate: true + } + }, + created() { + if(!this._uid) { + this._uid = this._.uid + } + Object.defineProperty(this, 'parent', { + get: () => this[parent] || [], + }) + Object.defineProperty(this, 'index', { + get: () => { + this.bindRelation(); + const {parent: {el: {views=[]}={}}={}} = this + return views.indexOf(this.el) + }, + }); + this.el.type = this.type + + this.bindRelation() + }, + // #ifdef VUE3 + beforeUnmount() { + this.removeEl() + }, + // #endif + // #ifdef VUE2 + beforeDestroy() { + this.removeEl() + }, + // #endif + methods: { + removeEl() { + if (this.parent) { + this.parent.el.views = this.parent.el.views.filter( + (item) => item._uid !== this._uid + ); + } + }, + bindRelation() { + if(!this.el._uid) { + this.el._uid = this._uid + } + if(['text','qrcode'].includes(this.type)) { + this.el.text = this.$slots && this.$slots.default && this.$slots.default[0].text || `${this.text || ''}`.replace(/\\n/g, '\n') + } + if(this.type == 'image') { + this.el.src = this.src + } + if (!this.parent) { + return; + } + let views = this.parent.el.views || []; + if(views.indexOf(this.el) !== -1) { + this.parent.el.views = views.map(v => v._uid == this._uid ? this.el : v) + } else { + this.parent.el.views = [...views, this.el]; + } + } + }, + mounted() { + // this.bindRelation() + }, + } +} \ No newline at end of file diff --git a/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue b/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue new file mode 100644 index 0000000..f1ce13e --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue b/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue new file mode 100644 index 0000000..4620d3f --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue b/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue new file mode 100644 index 0000000..1af0484 --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue b/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue new file mode 100644 index 0000000..4451e23 --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/uni_modules/lime-painter/components/l-painter/l-painter.vue b/uni_modules/lime-painter/components/l-painter/l-painter.vue new file mode 100644 index 0000000..9406fd0 --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter/l-painter.vue @@ -0,0 +1,409 @@ + + + + + diff --git a/uni_modules/lime-painter/components/l-painter/nvue.js b/uni_modules/lime-painter/components/l-painter/nvue.js new file mode 100644 index 0000000..9ce594d --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter/nvue.js @@ -0,0 +1,218 @@ +// #ifdef APP-NVUE +import { sleep, getImageInfo, isBase64, useNvue, networkReg } from './utils'; +const dom = weex.requireModule('dom') +import {version } from '../../package.json' + +export default { + data() { + return { + tempFilePath: [], + isInitFile: false, + osName: uni.getSystemInfoSync().osName + } + }, + created() { + // if (this.hybrid) return + // useNvue('_doc/uni_modules/lime-painter/', version, this.timeout).then(res => { + // this.isInitFile = true + // }) + }, + methods: { + getParentWeith() { + return new Promise(resolve => { + dom.getComponentRect(this.$refs.limepainter, (res) => { + this.parentWidth = Math.ceil(res.size.width) + this.canvasWidth = this.canvasWidth || this.parentWidth ||300 + this.canvasHeight = res.size.height || this.canvasHeight||150 + resolve(res.size) + }) + }) + }, + onPageFinish() { + this.webview = this.$refs.webview + this.webview.evalJS(`init(${this.dpr})`) + }, + onMessage(e) { + const res = e.detail.data[0] || null; + if (res.event) { + if (res.event == 'inited') { + this.inited = true + } + if(res.event == 'fail'){ + this.$emit('fail', res) + } + if (res.event == 'layoutChange') { + const data = typeof res.data == 'string' ? JSON.parse(res.data) : res.data + this.canvasWidth = Math.ceil(data.width); + this.canvasHeight = Math.ceil(data.height); + } + if (res.event == 'progressChange') { + this.progress = res.data * 1 + } + if (res.event == 'file') { + this.tempFilePath.push(res.data) + if (this.tempFilePath.length > 7) { + this.tempFilePath.shift() + } + return + } + if (res.event == 'success') { + if (res.data) { + this.tempFilePath.push(res.data) + if (this.tempFilePath.length > 8) { + this.tempFilePath.shift() + } + if (this.isCanvasToTempFilePath) { + this.setFilePath(this.tempFilePath.join(''), {isEmit:true}) + } + } else { + this.$emit('fail', 'canvas no data') + } + return + } + this.$emit(res.event, JSON.parse(res.data)); + } else if (res.file) { + this.file = res.data; + } else{ + console.info(res[0]) + } + }, + getWebViewInited() { + if (this.inited) return Promise.resolve(this.inited); + return new Promise((resolve) => { + this.$watch( + 'inited', + async val => { + if (val) { + resolve(val) + } + }, { + immediate: true + } + ); + }) + }, + getTempFilePath() { + if (this.tempFilePath.length == 8) return Promise.resolve(this.tempFilePath) + return new Promise((resolve) => { + this.$watch( + 'tempFilePath', + async val => { + if (val.length == 8) { + resolve(val.join('')) + } + } + ); + }) + }, + getWebViewDone() { + if (this.progress == 1) return Promise.resolve(this.progress); + return new Promise((resolve) => { + this.$watch( + 'progress', + async val => { + if (val == 1) { + this.$emit('done') + this.done = true + resolve(val) + } + }, { + immediate: true + } + ); + }) + }, + async render(args) { + try { + await this.getSize(args) + const {width} = args.css || args + if(!width && this.parentWidth) { + Object.assign(args, {width: this.parentWidth}) + } + const newNode = await this.calcImage(args); + await this.getWebViewInited() + this.webview.evalJS(`source(${JSON.stringify(newNode)})`) + await this.getWebViewDone() + await sleep(this.afterDelay) + if (this.isCanvasToTempFilePath) { + const params = { + fileType: this.fileType, + quality: this.quality + } + this.webview.evalJS(`save(${JSON.stringify(params)})`) + } + return Promise.resolve() + } catch (e) { + this.$emit('fail', e) + } + }, + getfile(e){ + let url = plus.io.convertLocalFileSystemURL( e ) + return new Promise((resolve,reject)=>{ + plus.io.resolveLocalFileSystemURL(url, entry => { + var reader = null; + entry.file( file => { + reader = new plus.io.FileReader(); + reader.onloadend = ( read )=> { + resolve(read.target.result) + }; + reader.readAsDataURL( file ); + }, function ( error ) { + alert( error.message ); + } ); + },err=>{ + resolve(e) + }) + }) + }, + async calcImage(args) { + let node = JSON.parse(JSON.stringify(args)) + const urlReg = /url\((.+)\)/ + const {backgroundImage} = node.css||{} + const isBG = backgroundImage && urlReg.exec(backgroundImage)[1] + const url = node.url || node.src || isBG + if(['text', 'qrcode'].includes(node.type)) { + return node + } + if ((node.type === "image" || isBG) && url && !isBase64(url) && (this.osName == 'ios' ? true : !networkReg.test(url))) { + let {path} = await getImageInfo(url) + if(this.osName == 'ios') { + path = await this.getfile(path) + } + if (isBG) { + node.css.backgroundImage = `url(${path})` + } else { + node.src = path + } + } else if (node.views && node.views.length) { + for (let i = 0; i < node.views.length; i++) { + node.views[i] = await this.calcImage(node.views[i]) + } + } + return node + }, + async canvasToTempFilePath(args = {}) { + if (!this.inited) { + return this.$emit('fail', 'no init') + } + this.tempFilePath = [] + if (args.fileType == 'jpg') { + args.fileType = 'jpeg' + } + this.webview.evalJS(`save(${JSON.stringify(args)})`) + try { + let tempFilePath = await this.getTempFilePath() + tempFilePath = await this.setFilePath(tempFilePath) + args.success({ + errMsg: "canvasToTempFilePath:ok", + tempFilePath + }) + } catch (e) { + args.fail({ + error: e + }) + } + } + } +} +// #endif \ No newline at end of file diff --git a/uni_modules/lime-painter/components/l-painter/painter.js b/uni_modules/lime-painter/components/l-painter/painter.js new file mode 100644 index 0000000..b0813bc --- /dev/null +++ b/uni_modules/lime-painter/components/l-painter/painter.js @@ -0,0 +1 @@ +var t=function(){return t=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-a)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+a)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-a)return{x0:e+n,y0:i+r,x1:n,y1:r};var h=0,d=0,c=0,l=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var f=s*Math.PI/180,u=s360-a?i/2:-i/2,p=Math.tan(f)*u,g=s180-a&&s<180?e/2-p:-e/2-p;h=-(c=p+(v=Math.pow(Math.sin(f),2)*g)),d=-(l=u+v/Math.tan(f))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var v;f=(90-s)*Math.PI/180,p=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(f)*p,g=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(c=p+(v=Math.pow(Math.sin(f),2)*g)/Math.tan(f)),d=-(l=u+v)}return h=Math.round(h+e/2)+n,d=Math.round(i/2-d)+r,c=Math.round(c+e/2)+n,l=Math.round(i/2-l)+r,{x0:h,y0:d,x1:c,y1:l}}(r,t,e,i,n),a=s.x0,h=s.y0,d=s.x1,c=s.y1,l=o.createLinearGradient(a,h,d,c),f=r.match(/linear-gradient\((.+)\)/)[1],u=F(f.substring(f.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Y(t){return"number"==typeof t}function $(t){return"auto"===t||null===t}function D(t){return/%$/.test(t)}var X,_=0,N=function(){function t(){j(this,"elements",[]),j(this,"afterElements",[]),j(this,"beforeElements",[]),j(this,"ids",[]),j(this,"width",0),j(this,"height",0),j(this,"top",0),j(this,"left",0),j(this,"pre",null),j(this,"offsetX",0),j(this,"offsetY",0),_++,this.id=_}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t)},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this[this.key.height]=t.offsetSize[this.key.height]),this[this.key.width]+=t.offsetSize[this.key.width],(this.container.lineMaxWidth||0)1?0:"flex-end"===t.style.alignSelf?this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height]:"center"===t.style.alignSelf?(this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height])/2:0},n}(N),q=y,J=v,Q=g,Z=b,K=x,et=m,it=S,nt=z,rt=B,ot=0,st={left:null,top:null,width:null,height:null},at=function(){function t(t,e,i,n){var r=this;j(this,"id",ot++),j(this,"style",{left:null,top:null,width:null,height:null}),j(this,"computedStyle",{}),j(this,"originStyle",{}),j(this,"children",{}),j(this,"layoutBox",C({},st)),j(this,"contentSize",C({},st)),j(this,"clientSize",C({},st)),j(this,"borderSize",C({},st)),j(this,"offsetSize",C({},st)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.name||t.type,this.attributes=this.getAttributes(t);var o=this.getComputedStyle(t,null==e?void 0:e.computedStyle);this.isAbsolute=o.position==nt,this.isFixed=o.position==rt,this.originStyle=o,Object.keys(o).forEach((function(t){Object.defineProperty(r.style,t,{configurable:!0,enumerable:!0,get:function(){return o[t]},set:function(e){o[t]=e}})}));var s={contentSize:C({},this.contentSize),clientSize:C({},this.clientSize),borderSize:C({},this.borderSize),offsetSize:C({},this.offsetSize)};Object.keys(s).forEach((function(t){Object.keys(r[t]).forEach((function(e){Object.defineProperty(r[t],e,{configurable:!0,enumerable:!0,get:function(){return s[t][e]},set:function(i){s[t][e]=i}})}))})),this.computedStyle=this.style}var e=t.prototype;return e.add=function(t){t.parent=this,this.children[t.id]=t},e.getChildren=function(){var t=this;return Object.keys(this.children).map((function(e){return t.children[e]}))},e.getLineRect=function(t,e){var i={width:0,height:0},n=e?e.lines:this.parent&&this.parent.lines;return n&&n.find((function(e){return e.ids.includes(t)}))||i},e.getComputedStyle=function(t,e){var i=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],n=t.css,r=void 0===n?{}:n,o=t.type,s=void 0===o?Q:o,a=C({},M);if([J,q,Z].includes(s)&&!r.display&&(a.display=et),e)for(var h=0;h=0&&l<0,Y=d>=0&&u<0;return i==s[0]&&(this[i].left=t.left+a+v+C+(U?2*-l:0),this[i].top=t.top+d+b+P+(Y?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:E),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=E,this[i].heightAdd=H),i==s[1]&&(this[i].left=t.left+a+C+(U<0?-l:0),this[i].top=t.top+d+P+(Y?-u:0),this[i].width=t.width+v+m,this[i].height=t.height+b+S),i==s[2]&&(this[i].left=t.left+a+C/2+(U<0?-l:0),this[i].top=t.top+d+P/2+(Y?-u:0),this[i].width=t.width+v+m+C/2+A/2,this[i].height=t.height+b+S+O/2+P/2),i==s[3]&&(this[i].left=t.left+(U<0?-l:0),this[i].top=t.top+(Y?-u:0),this[i].width=t.width+v+m+C+A+a+l,this[i].height=t.height+b+S+O+P+u+d),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},a=o.border,h=(a=void 0===a?{}:a).borderWidth,d=void 0===h?0:h,c=o.borderTop,l=(c=void 0===c?{}:c).borderTopWidth,f=void 0===l?d:l,u=o.borderBottom,p=(u=void 0===u?{}:u).borderBottomWidth,g=void 0===p?d:p,v=o.borderRight,y=(v=void 0===v?{}:v).borderRightWidth,b=void 0===y?d:y,x=o.borderLeft,m=(x=void 0===x?{}:x).borderLeftWidth,w=void 0===m?d:m,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,B=void 0===z?0:z,M=S.paddingRight,I=void 0===M?0:M,k=S.paddingBottom,P=void 0===k?0:k,W=S.paddingLeft,R=void 0===W?0:W;i||(t.width-=R+I+b+w),1!==i||n||(t.height-=B+P+f+g)}this.layoutBox&&(s.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition2=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,a=t.padding||{},h=a.paddingBottom,d=void 0===h?0:h,c=a.paddingRight,l=void 0===c?0:c,f=C({},this.contentSize,{left:r,top:s}),u=this.contentSize.top-this.offsetSize.top,p=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var g,v=U(this.root.fixedLine.elements);!(g=v()).done;){var y=g.value;y.setPosition(y,this.root.offsetSize),y.getBoxPosition2()}}if(e)for(var b,x=U(e.elements);!(b=x()).done;){var m=b.value;m.setPosition(m,f),m.style.left+=r+p+l,m.style.top+=s+u+d,m.getBoxPosition2()}if(i)for(var w,S=U(i);!(w=S()).done;){w.value.layout(f.top+u,f.left+p)}return this.layoutBoxUpdate(f,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==K},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==it},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==it)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==et},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getBoxWidthHeight=function(){var t,e=this,i=this.name,n=this.computedStyle,r=this.attributes,o=this.parent,s=void 0===o?{}:o,a=this.ctx,h=this.getChildren(),d=n.left,c=void 0===d?0:d,l=n.top,f=void 0===l?0:l,u=n.bottom,p=n.right,g=n.width,v=void 0===g?0:g,y=n.minWidth,b=n.maxWidth,x=n.minHeight,m=n.maxHeight,w=n.height,S=void 0===w?0:w,z=n.fontSize,B=void 0===z?14:z,M=n.fontWeight,I=n.fontFamily,k=n.fontStyle,P=n.position,W=n.lineClamp,R=n.lineHeight,L=n.padding,T=void 0===L?{}:L,A=n.margin,F=void 0===A?{}:A,j=n.border,C=(j=void 0===j?{}:j).borderWidth,E=void 0===C?0:C,H=n.borderRight,U=(H=void 0===H?{}:H).borderRightWidth,Y=void 0===U?E:U,$=n.borderLeft,X=($=void 0===$?{}:$).borderLeftWidth,_=void 0===X?E:X,V=s.contentSize&&s.contentSize.width,Z=s.contentSize&&s.contentSize.height;if(D(v)&&V&&(v=O(v,V)),D(v)&&!V&&(v=null),D(S)&&Z&&(S=O(S,Z)),D(S)&&!Z&&(S=null),D(y)&&V&&(y=O(y,V)),D(b)&&V&&(b=O(b,V)),D(x)&&Z&&(x=O(x,Z)),D(m)&&Z&&(m=O(m,Z)),n.padding&&null!=(t=s.contentSize)&&t.width)for(var K in n.padding)Object.hasOwnProperty.call(n.padding,K)&&(n.padding[K]=O(n.padding[K],V));var tt=T.paddingRight,et=void 0===tt?0:tt,it=T.paddingLeft,rt=void 0===it?0:it;if(n.margin&&[n.margin.marginLeft,n.margin.marginRight].includes("auto"))if(v){var ot=V&&V-v-et-rt-_-Y||0;n.margin.marginLeft==n.margin.marginRight?n.margin.marginLeft=n.margin.marginRight=ot/2:"auto"==n.margin.marginLeft?n.margin.marginLeft=ot:n.margin.marginRight=ot}else n.margin.marginLeft=n.margin.marginRight=0;var st=F.marginRight,at=void 0===st?0:st,ht=F.marginLeft,dt={width:v,height:S,left:0,top:0},ct=rt+et+_+Y+(void 0===ht?0:ht)+at;if(i==J&&!this.attributes.widths){var lt=r.text||"";a.save(),a.setFonts({fontFamily:I,fontSize:B,fontWeight:M,fontStyle:k});var ft=new Map;lt.split("\n").map((function(t){var i=t.split("").map((function(t){var i=ft.get(t);if(i)return i;var n=e.measureText(t,B).width;return ft.set(t,n),n})),n=e.measureText(t,B),r=n.fontHeight,o=n.ascent,s=n.descent;e.attributes.fontHeight=r,e.attributes.ascent=o,e.attributes.descent=s,e.attributes.widths||(e.attributes.widths=[]),e.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e}),0)})})),a.restore()}if(i==q&&null==v){var ut=r.width,pt=r.height;dt.width=this.contrastSize(Math.round(ut*S/pt)||0,y,b),this.layoutBoxUpdate(dt,n,0)}if(i==J&&null==v){var gt=this.attributes.widths,vt=Math.max.apply(Math,gt.map((function(t){return t.total})));if(s&&V>0&&(vt>V||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)vt=V-ct;dt.width=this.contrastSize(vt,y,b),this.layoutBoxUpdate(dt,n,0)}if(i==J&&!this.attributes.lines){var yt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e>dt.width?(yt++,e):t+e}),0)})),yt=W&&yt>W?W:yt,this.attributes.lines=yt}if(i==q&&null==S){var bt=r.width,xt=r.height;dt.height=this.contrastSize(O(dt.width*xt/bt)||0,x,m),this.layoutBoxUpdate(dt,n,1)}i==J&&null==S&&(R=O(R,B),dt.height=this.contrastSize(O(this.attributes.lines*R),x,m),this.layoutBoxUpdate(dt,n,1,!0)),s&&s.children&&V&&([Q,J].includes(i)&&this.isFlex()||i==Q&&this.isBlock(this)&&!this.isInFlow())&&(dt.width=this.contrastSize(V-ct,y,b),this.layoutBoxUpdate(dt,n)),v&&!D(v)&&(dt.width=this.contrastSize(v,y,b),this.layoutBoxUpdate(dt,n,0)),S&&!D(S)&&(dt.height=this.contrastSize(dt.height,x,m),this.layoutBoxUpdate(dt,n,1));var mt=0;if(h.length){var wt=null;h.forEach((function(t,i){t.getBoxWidthHeight();var r=h[i+1];if(r&&r.isInFlow()&&(t.next=r),t.isInFlow()&&!t.inFlexBox()){var o=e.getBoxState(wt,t);e.line&&e.line.canIEnter(t)&&!o?e.line.add(t):(new N).bind(t),wt=t}else t.inFlexBox()?e.line&&(e.line.canIEnter(t)||"nowrap"==n.flexWrap)?e.line.add(t):(new G).bind(t):t.isFixed?e.root.fixedLine?e.root.fixedLine.fixedAdd(t):(new N).fixedBind(t):e.fixedLine?e.fixedLine.fixedAdd(t):(new N).fixedBind(t,1)})),this.lines&&(mt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,zt=0;if(!v&&(this.isAbsolute||this.isFixed)&&V){var Bt=P==nt?V:this.root.width,Mt=Bt-(D(c)?O(c,Bt):c)-(D(p)?O(p,Bt):p);St=n.left?Mt:this.lineMaxWidth}if(!S&&(null!=f?f:this.isAbsolute||this.isFixed&&Z)){var It=P==nt?Z:this.root.height,kt=It-(D(f)?O(f,It):f)-(D(u)?O(u,It):u);zt=n.top?kt:0}if(v&&!D(v)||dt.width||(dt.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?V||s.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,y,b),this.layoutBoxUpdate(dt,n,0)),S||!mt&&!zt||(dt.height=zt||this.contrastSize(mt,x,m),this.layoutBoxUpdate(dt,n)),n.borderRadius&&this.borderSize&&this.borderSize.width)for(var K in n.borderRadius)Object.hasOwnProperty.call(n.borderRadius,K)&&(n.borderRadius[K]=O(n.borderRadius[K],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.getBoxPosition2(),this.offsetSize},t}(),ht=function(){var t,e,i,n,r,o,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],d=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],c=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],l=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],f=[],u=[],p=[],g=[],v=[],y=2;function b(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function x(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)b(t-1,i+n),b(t+1,i-n),b(t-n,i-1),b(t+n,i+1)}function m(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var w=[];function S(t,e,i,n){var r,o,s;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function B(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function I(){var t,i,n,r,o,s=0,a=0;for(i=0;ie*e;)h-=e*e,d++;for(s+=10*d,t=0;t1)for(W=s[t],k=e-7;;){for(M=e-7;M>W-3&&(x(M,k),!(M6)for(W=a[t-7],P=17,M=0;M<6;M++)for(k=0;k<3;k++,P--)1&(P>11?t>>P-12:W>>P)?(p[5-M+e*(2-k+e-11)]=1,p[2-k+e-11+e*(5-M)]=1):(b(5-M,2-k+e-11),b(2-k+e-11,5-M));for(k=0;k=(M=r*(i+n)+n)-2&&(R=M-2,t>9&&R--),O=R,t>9){for(f[O+2]=0,f[O+3]=0;O--;)W=f[O],f[O+3]|=255&W<<4,f[O+2]=W>>4;f[2]|=255&R<<4,f[1]=R>>4,f[0]=64|R>>12}else{for(f[O+1]=0,f[O+2]=0;O--;)W=f[O],f[O+2]|=255&W<<4,f[O+1]=W>>4;f[1]|=255&R<<4,f[0]=64|R>>4}for(O=R+3-(t<10);O0;L--)w[L]=w[L]?w[L-1]^l[m(c[w[L]]+O)]:w[L-1];w[0]=l[m(c[w[0]]+O)]}for(O=0;O<=o;O++)w[O]=c[w[O]];for(P=M,k=0,O=0;O>=1)1&k&&(p[e-1-P+8*e]=1,P<6?p[8+e*P]=1:p[8+e*(P+1)]=1);for(P=0;P<7;P++,k>>=1)1&k&&(p[8+e*(e-7+P)]=1,P?p[6-P+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var s=i.ctx,a=n.contentSize,h=a.width,d=a.height,c=a.left,l=a.top;r.borderRadius,r.backgroundColor;var f=r.color,u=void 0===f?"#000000":f;r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top;if(y=o||y,s){s.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,d);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(u);for(var b=0;b=s||"cover"==n&&o=s)&&(a=e.width/i.width);var h=i.width*a,d=i.height*a,c=r||[],l=c[0],f=c[1],u=/^\d+px|rpx$/.test(l)?O(l,e.width):(e.width-h)*(L(l)?O(l,1):{left:0,center:.5,right:1}[l||"center"]),p=/^\d+px|rpx$/.test(f)?O(f,e.height):(e.height-d)*(L(f)?O(f,1):{top:0,center:.5,bottom:1}[f||"center"]),g=function(t,e){return[(t-u)/a,(e-p)/a]},v=g(0,0),y=v[0],b=v[1],x=g(e.width,e.height),m=x[0],w=x[1];return{sx:Math.max(y,0),sy:Math.max(b,0),sw:Math.min(m-y,i.width),sh:Math.min(w-b,i.height),dx:Math.max(u,0),dy:Math.max(p,0),dw:Math.min(h,e.width),dh:Math.min(d,e.height)}}({objectFit:u,objectPosition:v},n.contentSize,t),r=i.sx,s=i.sy,a=i.sh,h=i.sw,d=i.dx,c=i.dy,l=i.dh,f=i.dw;k==o.MP_BAIDU?e.drawImage(t.src,d+w,c+S,f,l,r,s,h,a):e.drawImage(t.src,r,s,h,a,d+w,c+S,f,l)}else e.drawImage(t.src,w,S,x,m)},I=function(){e.restore(),W.drawView(n,r,!1,!0,!1),h(1)},P=function(t){M(t),I()},P(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},n.prototype.drawText=function(t,e,i,n){var r=this.ctx,o=e.borderSize,s=e.contentSize,a=e.left,h=e.top,d=s.width,c=s.height,l=s.left-o.left,f=s.top-o.top,u=i.color,p=void 0===u?"#000000":u,g=i.lineHeight,v=void 0===g?"1.4em":g,y=i.fontSize,b=void 0===y?14:y,x=i.fontWeight,m=i.fontFamily,w=i.fontStyle,S=i.textAlign,z=void 0===S?"left":S,B=i.verticalAlign,M=void 0===B?pt:B,I=i.backgroundColor,k=i.lineClamp,P=i.backgroundClip,W=i.textShadow,R=i.textDecoration;if(this.drawView(e,i,P!=ct),v=O(v,b),t){switch(r.save(),this.setShadow({boxShadow:W}),a+=l,h+=f,r.setFonts({fontFamily:m,fontSize:b,fontWeight:x,fontStyle:w}),r.setTextBaseline(pt),r.setTextAlign(z),P?this.setBackground(I,d,c,a,h):r.setFillStyle(p),z){case vt:break;case yt:a+=.5*d;break;case bt:a+=d}var L=n.lines*v,T=Math.ceil((c-L)/2);switch(T<0&&(T=0),M){case ut:break;case pt:h+=T;break;case gt:h+=2*T}var A=n.fontHeight,F=n.descent,j=(v-A)/2,C=function(t){var e=r.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,o=e.actualBoundingBoxAscent,s=void 0===o?0:o,a=n+s||.7*b+1;return M==ut?{fix:s,height:a,lineY:v-a}:M==pt?{fix:v/2+n/4,height:a,lineY:(v-a)/2}:M==gt?{fix:v-n,height:a,lineY:0}:{fix:0,height:0,lineY:0}},E=function(t,e,i){var o=t;switch(z){case vt:o+=i;break;case yt:o=(t-=i/2)+i;break;case bt:o=t,t-=i}if(R){r.setLineWidth(b/13),r.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(R)&&(F||(e+=j/2),r.moveTo(t,e+s),r.lineTo(o,e+s)),/\boverline\b/.test(R)&&(F||(e-=j/2),r.moveTo(t,e-n.fontHeight-s),r.lineTo(o,e-n.fontHeight-s)),/\bline-through\b/.test(R)&&(r.moveTo(t,e-.5*n.fontHeight),r.lineTo(o,e-.5*n.fontHeight)),r.closePath(),r.setStrokeStyle(p),r.stroke()}};if(!n.widths||1==n.widths.length&&n.widths[0].total<=s.width){var H=C(t),U=H.fix,Y=H.lineY;return r.fillText(t,a,h+U),E(a,(h+=v)-Y,n&&n.widths&&n.widths[0].total||n.text),r.restore(),void this.setBorder(e,i)}for(var $=t.split(""),D=h,X=a,_="",N=0,V=0;V<=$.length;V++){var G=$[V]||"",q="\n"===G,J=""==G,Q=_+(G=q?"":G),Z=r.measureText(Q).width;if(N>=k)break;if(X=a,Z>s.width||q||J){if(N++,_=J&&Z<=s.width?Q:_,N===k&&Z>d){for(;r.measureText("".concat(_,"...")).width>s.width&&!(_.length<=1);)_=_.substring(0,_.length-1);_+="..."}var K=C(_);U=K.fix,Y=K.lineY;if(r.fillText(_,X,h+U),E(X,(h+=v)-Y,Z),_=G,h>D+c)break}else _=Q}r.restore()}},n.prototype.source=function(t){var n;return e(this,void 0,void 0,(function(){var e,r,o,s=this;return i(this,(function(i){switch(i.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(r in t.type=ft,t.css=t.css||{},t)["views","children","type","css"].includes(r)||(t.css[r]=t[r],delete t[r]);return(null===(n=t.css)||void 0===n?void 0:n.width)||t.css||(t.css={}),[4,this.create(t)];case 1:return o=i.sent(),this.size=(null==o?void 0:o.layout())||{},this.node=o,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]}}))}))},n.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},n.prototype.create=function(n,r){var o,s;return e(this,void 0,void 0,(function(){var e,a,h,d,c,l,f,u,p,g,v,y,b,x,m,S,z;return i(this,(function(i){switch(i.label){case 0:if(e=n.type==dt,a=[ct,lt].includes(n.type),h=n.css||{},d=h.backgroundImage,c=h.display,e&&!n.src&&!n.url||a&&!n.text)return[2];if(c==w)return[2];if(a&&(n.text=String(n.text)),!(e||n.type==ft&&d))return[3,4];l=e?n.src:"",f=/url\((.+)\)/,d&&(null===(o=f.exec(d))||void 0===o?void 0:o[1])&&(l=(null===(s=f.exec(d))||void 0===s?void 0:s[1])||""),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getImageInfo(l)];case 2:return u=i.sent(),p=u.width,g=u.height,!(v=u.path)&&e?[2]:(v&&(n.attributes=Object.assign(n.attributes||{},{width:p,height:g,path:v,src:v,naturalSrc:l})),[3,4]);case 3:return y=i.sent(),n.type!=ft?[2]:(this.lifecycle("onEffectFail",t(t({},y),{src:l})),[3,4]);case 4:if(this.count+=1,b=new at(n,r,this.root,this.ctx),!(x=n.views||n.children))return[3,8];m=0,i.label=5;case 5:return m /^data:image\/(\w+);base64/.test(path); +export function sleep(delay) { + return new Promise(resolve => setTimeout(resolve, delay)) +} +const isDev = ['devtools'].includes(uni.getSystemInfoSync().platform) +// 缓存图片 +let cache = {} +export function isNumber(value) { + return /^-?\d+(\.\d+)?$/.test(value); +} +export function toPx(value, baseSize, isDecimal = false) { + // 如果是数字 + if (typeof value === 'number') { + return value + } + // 如果是字符串数字 + if (isNumber(value)) { + return value * 1 + } + // 如果有单位 + if (typeof value === 'string') { + const reg = /^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g + const results = reg.exec(value); + if (!value || !results) { + return 0; + } + const unit = results[3]; + value = parseFloat(value); + let res = 0; + if (unit === 'rpx') { + res = uni.upx2px(value); + } else if (unit === 'px') { + res = value * 1; + } else if (unit === '%') { + res = value * toPx(baseSize) / 100; + } else if (unit === 'em') { + res = value * toPx(baseSize || 14); + } + return isDecimal ? res.toFixed(2) * 1 : Math.round(res); + } + return 0 +} + +// 计算版本 +export function compareVersion(v1, v2) { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10) + const num2 = parseInt(v2[i], 10) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + return 0 +} +// #ifdef MP +export const prefix = () => { + // #ifdef MP-TOUTIAO + return tt + // #endif + // #ifdef MP-WEIXIN + return wx + // #endif + // #ifdef MP-BAIDU + return swan + // #endif + // #ifdef MP-ALIPAY + return my + // #endif + // #ifdef MP-QQ + return qq + // #endif + // #ifdef MP-360 + return qh + // #endif +} +// #endif + + +const base64ToArrayBuffer = (data) => { + // #ifndef MP-WEIXIN || APP-PLUS + /** + * Base64Binary.decode(base64_string); + * Base64Binary.decodeArrayBuffer(base64_string); + */ + const Base64Binary = { + _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + /* will return a Uint8Array type */ + decodeArrayBuffer(input) { + const bytes = (input.length / 4) * 3; + const ab = new ArrayBuffer(bytes); + this.decode(input, ab); + return ab; + }, + removePaddingChars(input) { + const lkey = this._keyStr.indexOf(input.charAt(input.length - 1)); + if (lkey == 64) { + return input.substring(0, input.length - 1); + } + return input; + }, + decode(input, arrayBuffer) { + //get last chars to see if are valid + input = this.removePaddingChars(input); + input = this.removePaddingChars(input); + + const bytes = parseInt((input.length / 4) * 3, 10); + + let uarray; + let chr1, chr2, chr3; + let enc1, enc2, enc3, enc4; + let i = 0; + let j = 0; + + if (arrayBuffer) + uarray = new Uint8Array(arrayBuffer); + else + uarray = new Uint8Array(bytes); + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + for (i = 0; i < bytes; i += 3) { + //get the 3 octects in 4 ascii chars + enc1 = this._keyStr.indexOf(input.charAt(j++)); + enc2 = this._keyStr.indexOf(input.charAt(j++)); + enc3 = this._keyStr.indexOf(input.charAt(j++)); + enc4 = this._keyStr.indexOf(input.charAt(j++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + uarray[i] = chr1; + if (enc3 != 64) uarray[i + 1] = chr2; + if (enc4 != 64) uarray[i + 2] = chr3; + } + return uarray; + } + } + return Base64Binary.decodeArrayBuffer(data) + // #endif + // #ifdef MP-WEIXIN || APP-PLUS + return uni.base64ToArrayBuffer(data) + // #endif +} + + +/** + * base64转路径 + * @param {Object} base64 + */ +export function base64ToPath(base64) { + const [, format] = /^data:image\/(\w+);base64,/.exec(base64) || []; + + return new Promise((resolve, reject) => { + // #ifdef MP + const fs = uni.getFileSystemManager() + //自定义文件名 + if (!format) { + reject(new Error('ERROR_BASE64SRC_PARSE')) + } + const time = new Date().getTime(); + let pre = prefix() + const filePath = `${pre.env.USER_DATA_PATH}/${time}.${format}` + //let buffer = base64ToArrayBuffer(bodyData) + fs.writeFile({ + filePath, + data: base64.split(',')[1], //base64.replace(/^data:\S+\/\S+;base64,/, ''), + encoding: 'base64', + // data: buffer, + // encoding: 'binary', + success() { + resolve(filePath) + }, + fail(err) { + reject(err) + } + }) + // #endif + + // #ifdef H5 + // mime类型 + let mimeString = base64.split(',')[0].split(':')[1].split(';')[0]; + //base64 解码 + let byteString = atob(base64.split(',')[1]); + //创建缓冲数组 + let arrayBuffer = new ArrayBuffer(byteString.length); + //创建视图 + let intArray = new Uint8Array(arrayBuffer); + for (let i = 0; i < byteString.length; i++) { + intArray[i] = byteString.charCodeAt(i); + } + resolve(URL.createObjectURL(new Blob([intArray], { + type: mimeString + }))) + // #endif + + // #ifdef APP-PLUS + const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) + bitmap.loadBase64Data(base64, () => { + if (!format) { + reject(new Error('ERROR_BASE64SRC_PARSE')) + } + const time = new Date().getTime(); + const filePath = `_doc/uniapp_temp/${time}.${format}` + bitmap.save(filePath, {}, + () => { + bitmap.clear() + resolve(filePath) + }, + (error) => { + bitmap.clear() + reject(error) + }) + }, (error) => { + bitmap.clear() + reject(error) + }) + // #endif + }) +} + +/** + * 路径转base64 + * @param {Object} string + */ +export function pathToBase64(path) { + if (/^data:/.test(path)) return path + return new Promise((resolve, reject) => { + // #ifdef H5 + let image = new Image(); + image.setAttribute("crossOrigin", 'Anonymous'); + image.onload = function() { + let canvas = document.createElement('canvas'); + canvas.width = this.naturalWidth; + canvas.height = this.naturalHeight; + canvas.getContext('2d').drawImage(image, 0, 0); + let result = canvas.toDataURL('image/png') + resolve(result); + canvas.height = canvas.width = 0 + } + image.src = path + '?v=' + Math.random() + image.onerror = (error) => { + reject(error); + }; + // #endif + + // #ifdef MP + if (uni.canIUse('getFileSystemManager')) { + uni.getFileSystemManager().readFile({ + filePath: path, + encoding: 'base64', + success: (res) => { + resolve('data:image/png;base64,' + res.data) + }, + fail: (error) => { + reject(error) + } + }) + } + // #endif + + // #ifdef APP-PLUS + plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => { + entry.file((file) => { + const fileReader = new plus.io.FileReader() + fileReader.onload = (data) => { + resolve(data.target.result) + } + fileReader.onerror = (error) => { + reject(error) + } + fileReader.readAsDataURL(file) + }, reject) + }, reject) + // #endif + }) +} + + + +export function getImageInfo(path, useCORS) { + return new Promise(async (resolve, reject) => { + let src = path + if (cache[path] && cache[path].errMsg) { + resolve(cache[path]) + } else { + try { + // if (!isBase64 && PLATFORM == UNI_PLATFORM.PLUS && !/^\/?(static|_doc)\//.test(src)) { + // src = await downloadFile(path) as string + // } else + // #ifdef MP || APP-PLUS + if (isBase64(path)) { + src = await base64ToPath(path) + } + // #endif + // #ifdef H5 + if(useCORS) { + src = await pathToBase64(path) + } + // #endif + + } catch (error) { + reject({ + ...error, + src + }) + } + uni.getImageInfo({ + src, + success: (image) => { + const localReg = /^\.|^\/(?=[^\/])/; + // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO + image.path = localReg.test(src) ? `/${image.path}` : image.path; + // #endif + // #ifdef H5 + image.path = image.path.replace(/^\./, window.location.origin) + // #endif + if (isDev) { + resolve(image) + } else { + cache[path] = image + resolve(cache[path]) + } + }, + fail(err) { + reject({ + err, + path + }) + } + }) + } + }) +} + +export function downloadFile(url) { + if (!url) return Promise.reject({ + err: 'no url' + }) + return new Promise((resolve, reject) => { + if (cache[url]) { + return reject() + } + cache[url] = 1 + uni.downloadFile({ + url, + success(res) { + resolve(res) + }, + fail(err) { + reject(err) + } + }) + }) +} + +// #ifdef APP-PLUS +const getLocalFilePath = (path) => { + if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path + .indexOf('_downloads') === 0) { + return path + } + if (path.indexOf('file://') === 0) { + return path + } + if (path.indexOf('/storage/emulated/0/') === 0) { + return path + } + if (path.indexOf('/') === 0) { + const localFilePath = plus.io.convertAbsoluteFileSystem(path) + if (localFilePath !== path) { + return localFilePath + } else { + path = path.substr(1) + } + } + return '_www/' + path +} +const getFile = (url) => { + return new Promise((resolve, rejcet) => { + plus.io.resolveLocalFileSystemURL(url, resolve, (err) => { + resolve(false) + }) + }) +} +const createFile = ({ + fs, + url, + target, + name +}) => { + return new Promise((resolve, reject) => { + plus.io.resolveLocalFileSystemURL(url, res1 => { + fs.root.getDirectory(target, { + create: true + }, fileEntry => { + const success = () => { + res1.remove() + resolve() + } + getFile(target + name).then(res => { + if (res) { + res.remove((res2) => { + res1.moveTo(fileEntry, name, success, reject) + }) + } + res1.moveTo(fileEntry, name, success, reject) + }) + }) + }, reject) + }) +} +export function useNvue(target, version, timeout) { + return new Promise((resolve, reject) => { + plus.io.requestFileSystem(plus.io.PRIVATE_DOC, async (fs) => { + try { + cache['lime-painter'] = 0 + let names = ['uni.webview.1.5.3.js', 'painter.js', 'index.html'] + let urls = ['https://gitee.com/dcloud/uni-app/raw/dev/dist/', + 'https://static-6d65bd90-8508-4d6c-abbc-a4ef5c8e49e7.bspapp.com/lime-painter/' + ] + const oldVersion = plus.storage.getItem('lime-painter') + const isFile = await getFile(`${target}${names[1]}`) + if (isFile && oldVersion && compareVersion(oldVersion, version) >= 0) { + resolve() + } else { + for (var i = 0; i < names.length; i++) { + const name = names[i] + const file = await downloadFile(urls[i >= 1 ? 1 : 0] + name) + await createFile({ + fs, + url: file.tempFilePath, + target, + name: name.includes('uni.webview') ? 'uni.webview.js' : name + }) + } + plus.storage.setItem('lime-painter', version) + cache['lime-painter'] = version + resolve() + } + } catch (e) { + let index = parseInt(timeout / 20) + while (!cache['lime-painter'] && index) { + await sleep(20) + index-- + } + if (cache['lime-painter']) { + resolve() + } else { + reject(e) + } + } + }, reject) + }) +} +// #endif diff --git a/uni_modules/lime-painter/components/lime-painter/index.vue b/uni_modules/lime-painter/components/lime-painter/index.vue new file mode 100644 index 0000000..ba53413 --- /dev/null +++ b/uni_modules/lime-painter/components/lime-painter/index.vue @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/uni_modules/lime-painter/package.json b/uni_modules/lime-painter/package.json new file mode 100644 index 0000000..f973fc3 --- /dev/null +++ b/uni_modules/lime-painter/package.json @@ -0,0 +1,96 @@ +{ + "id": "lime-painter", + "displayName": "海报画板", + "version": "1.9.3.4", + "description": "一款canvas海报组件,更优雅的海报生成方案", + "keywords": [ + "海报", + "canvas", + "生成海报", + "生成二维码", + "JSON" +], + "repository": "https://gitee.com/liangei/lime-painter", + "engines": { + "HBuilderX": "^3.4.14" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "305716444" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "u", + "Edge": "u", + "Firefox": "u", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u", + "小红书": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + }, + "name": "lime-painter", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} diff --git a/uni_modules/lime-painter/readme.md b/uni_modules/lime-painter/readme.md new file mode 100644 index 0000000..3bd8e41 --- /dev/null +++ b/uni_modules/lime-painter/readme.md @@ -0,0 +1,910 @@ +# Painter 画板 测试版 + +> uniapp 海报画板,更优雅的海报生成方案 +> [查看更多 站点 1](https://limeui.qcoon.cn/#/painter) +> [查看更多 站点 2](http://liangei.gitee.io/limeui/#/painter) +> Q 群:806744170 + +## 平台兼容 + +| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App | +| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- | +| √ | √ | √ | 未测 | √ | √ | √ | + +## 安装 +在市场导入[海报画板](https://ext.dcloud.net.cn/plugin?id=2389)uni_modules版本的即可,无需`import` + +## 代码演示 + +### 基本用法 + +- 插件提供 JSON 及 XML 的方式绘制海报 +- 参考了 css 块状流布局模拟 css schema 方式。 +- 使用JSON的方式时,请使用驼峰key + + +#### 方式一 XML + +- 提供`l-painter-view`、`l-painter-text`、`l-painter-image`、`l-painter-qrcode`四种类型组件 +- 通过 `css` 属性绘制样式,与 style 使用方式保持一致。 + +```html + + + + + +``` + +#### 方式二 JSON + +- 在 json 里四种类型组件的`type`为`view`、`text`、`image`、`qrcode` +- 通过 `board` 设置海报所需的 JSON 数据进行绘制或`ref`获取组件实例调用组件内的`render(json)` +- 所有类型的 schema 都具有`css`字段,css 的 key 值使用**驼峰**如:`lineHeight` + +```html + +``` + +```js +data() { + return { + poster: { + css: { + // 根节点若无尺寸,自动获取父级节点 + width: '750rpx' + }, + views: [ + { + css: { + background: "#07c160", + height: "120rpx", + width: "120rpx", + display: "inline-block" + }, + type: "view" + }, + { + css: { + background: "#1989fa", + height: "120rpx", + width: "120rpx", + borderTopRightRadius: "60rpx", + borderBottomLeftRadius: "60rpx", + display: "inline-block", + margin: "0 30rpx" + }, + views: [], + type: "view" + }, + { + css: { + background: "#ff9d00", + height: "120rpx", + width: "120rpx", + borderRadius: "50%", + display: "inline-block" + }, + views: [], + type: "view" + }, + ] + } + } +} +``` + +### View 容器 + +- 类似于 `div` 可以嵌套承载更多的 view、text、image,qrcode 共同构建一颗完整的节点树 +- 在 JSON 里具有 `views` 的数组字段,用于嵌套承载节点。 + +#### 方式一 XML + +```html + + + + + + +``` + +#### 方式二 JSON + +```js +{ + css: {}, + views: [ + { + type: 'view', + css: { + background: '#f0f0f0', + paddingTop: '100rpx' + }, + views: [ + { + type: 'view', + css: { + background: '#d9d9d9', + width: '33.33%', + height: '100rpx', + display: 'inline-block' + } + }, + { + type: 'view', + css: { + background: '#bfbfbf', + width: '66.66%', + height: '100rpx', + display: 'inline-block' + } + } + ], + + } + ] +} +``` + +### Text 文本 + +- 通过 `text` 属性填写文本内容。 +- 支持`\n`换行符 +- 支持省略号,使用 css 的`line-clamp`设置行数,当文字内容超过会显示省略号。 +- 支持`text-decoration` + +#### 方式一 XML + +```html + + + + + + + + +``` + +#### 方式二 JSON + +```js +// 基础用法 +{ + type: 'text', + text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼', +}, +{ + type: 'text', + text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼', + css: { + // 设置居中对齐 + textAlign: 'center', + // 设置中划线 + textDecoration: 'line-through' + } +}, +{ + type: 'text', + text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼', + css: { + // 设置右对齐 + textAlign: 'right', + } +}, +{ + type: 'text', + text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼', + css: { + // 设置行数,超出显示省略号 + lineClamp: 3, + // 渐变文字 + background: 'linear-gradient(,#ff971b 0%, #1989fa 100%)', + backgroundClip: 'text' + } +} +``` + +### Image 图片 + +- 通过 `src` 属性填写图片路径。 +- 图片路径支持:网络图片,本地 static 里的图片路径,缓存路径 +- 通过 `css` 的 `object-fit`属性可以设置图片的填充方式,可选值见下方 CSS 表格。 +- 通过 `css` 的 `object-position`配合 `object-fit` 可以设置图片的对齐方式,类似于`background-position`,详情见下方 CSS 表格。 +- 使用网络图片时:小程序需要去公众平台配置 [downloadFile](https://mp.weixin.qq.com/) 域名 +- 使用网络图片时:**H5 和 Nvue 需要决跨域问题** + +#### 方式一 XML + +```html + + + + + + + + + +``` + +#### 方式二 JSON + +```js +// 基础用法 +{ + type: 'image', + src: 'https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg', + css: { + width: '200rpx', + height: '200rpx' + } +}, +// 填充方式 +// css objectFit 设置 填充方式 见下方表格 +{ + type: 'image', + src: 'https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg', + css: { + width: '200rpx', + height: '200rpx', + objectFit: 'contain' + } +}, +// css objectPosition 设置 图片的对齐方式 +{ + type: 'image', + src: 'https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg', + css: { + width: '200rpx', + height: '200rpx', + objectFit: 'contain', + objectPosition: '50% 50%' + } +} +``` + +### Qrcode 二维码 + +- 通过`text`属性填写需要生成二维码的文本。 +- 通过 `css` 里的 `color` 可设置生成码点的颜色。 +- 通过 `css` 里的 `background`可设置背景色。 +- 通过 `css `里的 `width`、`height`设置尺寸。 + +#### 方式一 XML + +```html + + + +``` + +#### 方式二 JSON + +```js +{ + type: 'qrcode', + text: 'limeui.qcoon.cn', + css: { + width: '200rpx', + height: '200rpx', + } +} +``` + +### 生成图片 + +- 1、通过设置`isCanvasToTempFilePath`自动生成图片并在 `@success` 事件里接收海报临时路径 +- 2、通过调用内部方法生成图片: + +```html +...code +``` + +```js +this.$refs.painter.canvasToTempFilePathSync({ + fileType: "jpg", + // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url + pathType: 'url', + quality: 1, + success: (res) => { + console.log(res.tempFilePath); + // 非H5 保存到相册 + // H5 提示用户长按图另存 + uni.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function () { + console.log('save success'); + } + }); + }, +}); +``` + +### 主动调用方式 + +- 通过获取组件实例内部的`render`函数 传递`JSON`即可 + +```html + +``` + +```js +// 渲染 +this.$refs.painter.render(jsonSchema); +// 生成图片 +this.$refs.painter.canvasToTempFilePathSync({ + fileType: "jpg", + // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url + pathType: 'url', + quality: 1, + success: (res) => { + console.log(res.tempFilePath); + // 非H5 保存到相册 + uni.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function () { + console.log('save success'); + } + }); + }, +}); +``` + + +### H5跨域 +- 一般是需要后端或管理OSS资源的大佬处理 +- 一般OSS的处理方式: + +1、设置来源 +```cmd +* +``` + +2、允许Methods +```html +GET +``` + +3、允许Headers +```html +access-control-allow-origin:* +``` + +4、最后如果还是不行,可试下给插件设置`useCORS` +```html + +``` + + + +### 海报示例 + +- 提供一份示例,只把插件当成生成图片的工具,非必要不要在弹窗里使用。 +- 通过设置`isCanvasToTempFilePath`主动生成图片,再由 `@success` 事件接收海报临时路径 +- 设置`custom-style="position: fixed; left: 200%"`样式把画板移到屏幕之外,达到隐藏画板的效果。 +- **注意**:受平台影响海报画板最好不要隐藏,可能会无法生成图片。 + +#### 方式一 XML + +```html + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +```js +data() { + return { + path: '' + } +} +``` + +#### 方式二 JSON + +```html + + +``` + +```js +data() { + return { + path: '', + poster: { + css: { + width: "750rpx", + paddingBottom: "40rpx", + background: "linear-gradient(,#000 0%, #ff5000 100%)" + }, + views: [ + { + src: "https://fastly.jsdelivr.net/gh/liangei/image@latest/avatar-1.jpeg", + type: "image", + css: { + background: "#fff", + objectFit: "cover", + marginLeft: "40rpx", + marginTop: "40rpx", + width: "84rpx", + border: "2rpx solid #fff", + boxSizing: "border-box", + height: "84rpx", + borderRadius: "50%" + } + }, + { + type: "view", + css: { + marginTop: "40rpx", + paddingLeft: "20rpx", + display: "inline-block" + }, + views: [ + { + text: "隔壁老王", + type: "text", + css: { + display: "block", + paddingBottom: "10rpx", + color: "#fff", + fontSize: "32rpx", + fontWeight: "bold" + } + }, + { + text: "为您挑选了一个好物", + type: "text", + css: { + color: "rgba(255,255,255,.7)", + fontSize: "24rpx" + }, + } + ], + }, + { + css: { + marginLeft: "40rpx", + marginTop: "30rpx", + padding: "32rpx", + boxSizing: "border-box", + background: "#fff", + borderRadius: "16rpx", + width: "670rpx", + boxShadow: "0 20rpx 58rpx rgba(0,0,0,.15)" + }, + views: [ + { + src: "https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg", + type: "image", + css: { + objectFit: "cover", + objectPosition: "50% 50%", + width: "606rpx", + height: "606rpx" + }, + }, { + css: { + marginTop: "32rpx", + color: "#FF0000", + fontWeight: "bold", + fontSize: "28rpx", + lineHeight: "1em" + }, + views: [{ + text: "¥", + type: "text", + css: { + verticalAlign: "bottom" + }, + }, { + text: "39", + type: "text", + css: { + verticalAlign: "bottom", + fontSize: "58rpx" + }, + }, { + text: ".39", + type: "text", + css: { + verticalAlign: "bottom" + }, + }, { + text: "¥59.99", + type: "text", + css: { + verticalAlign: "bottom", + paddingLeft: "10rpx", + fontWeight: "normal", + textDecoration: "line-through", + color: "#999999" + } + }], + + type: "view" + }, { + css: { + marginTop: "32rpx", + fontSize: "26rpx", + color: "#8c5400" + }, + views: [{ + text: "自营", + type: "text", + css: { + color: "#212121", + background: "#ffb400" + }, + }, { + text: "30天最低价", + type: "text", + css: { + marginLeft: "16rpx", + background: "#fff4d9", + textDecoration: "line-through" + }, + }, { + text: "满减优惠", + type: "text", + css: { + marginLeft: "16rpx", + background: "#fff4d9" + }, + }, { + text: "超高好评", + type: "text", + css: { + marginLeft: "16rpx", + background: "#fff4d9" + }, + + }], + + type: "view" + }, { + css: { + marginTop: "30rpx" + }, + views: [ + { + text: "360儿童电话手表9X 智能语音问答定位支付手表 4G全网通20米游泳级防水视频通话拍照手表男女孩星空蓝", + type: "text", + css: { + paddingRight: "32rpx", + boxSizing: "border-box", + lineClamp: 2, + color: "#333333", + lineHeight: "1.8em", + fontSize: "36rpx", + width: "478rpx" + }, + }, { + text: "limeui.qcoon.cn", + type: "qrcode", + css: { + width: "128rpx", + height: "128rpx", + }, + + }], + type: "view" + }], + type: "view" + } + ] + } + } +} +``` + +### Nvue +- 必须为HBX 3.4.11及以上 + + +### 原生小程序 + +- 插件里的`painter.js`支持在原生小程序中使用 +- new Painter 之后在`source`里传入 JSON +- 再调用`render`绘制海报 +- 如需生成图片,请查看微信小程序 cavnas 的[canvasToTempFilePath](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasToTempFilePath.html) + +```html + +``` + +```js +import { Painter } from "./painter"; +page({ + data: { + poster: { + css: { + width: "750rpx", + }, + views: [ + { + type: "view", + css: { + background: "#d2d4c8", + paddingTop: "100rpx", + }, + views: [ + { + type: "view", + css: { + background: "#5f7470", + width: "33.33%", + height: "100rpx", + display: "inline-block", + }, + }, + { + type: "view", + css: { + background: "#889696", + width: "33.33%", + height: "100rpx", + display: "inline-block", + }, + }, + { + type: "view", + css: { + background: "#b8bdb5", + width: "33.33%", + height: "100rpx", + display: "inline-block", + }, + }, + ], + }, + ], + }, + }, + async onLoad() { + const res = await this.getCentext(); + const painter = new Painter(res); + // 返回计算布局后的整个内容尺寸 + const { width, height } = await painter.source(this.data.poster); + // 得到计算后的尺寸后 可给canvas尺寸赋值,达到动态响应效果 + // 渲染 + await painter.render(); + }, + // 获取canvas 2d + // 非2d也可以使用这里只是举个例子 + getCentext() { + return new Promise((resolve) => { + wx.createSelectorQuery() + .select(`#painter`) + .node() + .exec((res) => { + let { node: canvas } = res[0]; + resolve({ + canvas, + context: canvas.getContext("2d"), + width: canvas.width, + height: canvas.height, + pixelRatio: 2, + }); + }); + }); + }, +}); +``` + +### 旧版(1.6.x)更新 + +- 由于 1.8.x 版放弃了以定位的方式,所以 1.6.x 版更新之后要每个样式都加上`position: absolute` +- 旧版的 `image` mode 模式被放弃,使用`object-fit` +- 旧版的 `isRenderImage` 改成 `is-canvas-to-temp-filePath` +- 旧版的 `maxLines` 改成 `line-clamp` + +## API + +### Props + +| 参数 | 说明 | 类型 | 默认值 | +| -------------------------- | ------------------------------------------------------------ | ---------------- | ------------ | +| board | JSON 方式的海报元素对象集 | object | - | +| css | 海报最外层的样式,可以理解为`body` | object | 参数请向下看 | +| custom-style | canvas 自定义样式 | string | | +| is-canvas-to-temp-filePath | 是否生成图片,在`@success`事件接收图片地址 | boolean | `false` | +| after-delay | 生成图片错乱,可延时生成图片 | number | `100` | +| type | canvas 类型,对微信头条支付宝小程序可有效,可选值:`2d`,`''` | string | `2d` | +| file-type | 生成图片的后缀类型, 可选值:`png`、`jpg` | string | `png` | +| path-type | 生成图片路径类型,可选值`url`、`base64` | string | `-` | +| pixel-ratio | 生成图片的像素密度,默认为对应手机的像素密度,`nvue`无效 | number | `-` | +| width | **废弃** 画板的宽度,一般只用于通过内部方法时加上 | number | `` | +| height | **废弃** 画板的高度 ,同上 | number | `` | + +### css +| 属性名 | 支持的值或类型 | 默认值 | +| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | +| (min\max)width | 支持`%`、`rpx`、`px` | - | +| height | 同上 | - | +| color | `string` | - | +| position | 定位,可选值:`absolute`、`fixed` | - | +| ↳ left、top、right、bottom | 配合`position`才生效,支持`%`、`rpx`、`px` | - | +| margin | 可简写或各方向分别写,如:`margin-top`,支持`auto`、`rpx`、`px` | - | +| padding | 可简写或各方向分别写,支持`rpx`、`px` | - | +| border | 可简写或各个值分开写:`border-width`、`border-style` 、`border-color`,简写请按顺序写 | - | +| line-clamp | `number`,超过行数显示省略号 | - | +| vertical-align | 文字垂直对齐,可选值:`bottom`、`top`、`middle` | `middle` | +| line-height | 文字行高,支持`rpx`、`px`、`em` | `1.4em` | +| font-weight | 文字粗细,可选值:`normal`、`bold` | `normal` | +| font-size | 文字大小,`string`,支持`rpx`、`px` | `14px` | +| text-decoration | 文本修饰,可选值:`underline` 、`line-through`、`overline` | - | +| text-align | 文本水平对齐,可选值:`right` 、`center` | `left` | +| display | 框类型,可选值:`block`、`inline-block`、`flex`、`none`,当为`none`时是不渲染该段, `flex`功能简陋。 | - | +| flex | 配合 display: flex; 属性定义了在分配多余空间,目前只用为数值如: flex: 1 | - | +| align-self | 配合 display: flex; 单个项目垂直轴对齐方式: `flex-start` `flex-end` `center` | `flex-start` | +| justify-content | 配合 display: flex; 水平轴对齐方式: `flex-start` `flex-end` `center` | `flex-start` | +| align-items | 配合 display: flex; 垂直轴对齐方式: `flex-start` `flex-end` `center` | `flex-start` | +| border-radius | 圆角边框,支持`%`、`rpx`、`px` | - | +| box-sizing | 可选值:`border-box` | - | +| box-shadow | 投影 | - | +| background(color) | 支持渐变,但必须写百分比!如:`linear-gradient(,#ff971b 0%, #ff5000 100%)`、`radial-gradient(#0ff 15%, #f0f 60%)`,目前 radial-gradient 渐变的圆心为元素中点,半径为最长边,不支持设置 | - | +| background-clip | 文字渐变,配合`background`背景渐变,设置`background-clip: text` 达到文字渐变效果 | - | +| background-image | view 元素背景:`url(src)`,若只是设置背景图,请不要设置`background-repeat` | - | +| background-repeat | 设置是否及如何重复背景纹理,可选值:`repeat`、`repeat-x`、`repeat-y`、`no-repeat` | `repeat` | +| [object-fit](https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit/) | 图片元素适应容器方式,类似于`mode`,可选值:`cover`、 `contain`、 `fill`、 `none` | - | +| [object-position](https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-position) | 图片的对齐方式,配合`object-fit`使用 | - | + +### 图片填充模式 object-fit + +| 名称 | 含义 | +| ------- | ------------------------------------------------------ | +| contain | 保持宽高缩放图片,使图片的长边能完全显示出来 | +| cover | 保持宽高缩放图片,使图片的短边能完全显示出来,裁剪长边 | +| fill | 拉伸图片,使图片填满元素 | +| none | 保持图片原有尺寸 | + +### 事件 Events + +| 事件名 | 说明 | 返回值 | +| -------- | ---------------------------------------------------------------- | ------ | +| success | 生成图片成功,若使用`is-canvas-to-temp-filePath` 可以接收图片地址 | path | +| fail | 生成图片失败 | error | +| done | 绘制成功 | | +| progress | 绘制进度 | number | + +### 内部函数 Ref +| 事件名 | 说明 | 返回值 | +| -------- | ---------------------------------------------------------------- | ------ | +| render(object) | 渲染器,传入JSON 绘制海报 | promise | +| [canvasToTempFilePath](https://uniapp.dcloud.io/api/canvas/canvasToTempFilePath.html#canvastotempfilepath)(object) | 把当前画布指定区域的内容导出生成指定大小的图片,并返回文件临时路径。 | | +| canvasToTempFilePathSync(object) | 同步接口,同上 | | + + +## 常见问题 + +- 1、H5 端使用网络图片需要解决跨域问题。 +- 2、小程序使用网络图片需要去公众平台增加下载白名单!二级域名也需要配! +- 3、H5 端生成图片是 base64,有时显示只有一半可以使用原生标签`` +- 4、发生保存图片倾斜变形或提示 native buffer exceed size limit 时,使用 pixel-ratio="2"参数,降分辨率。 +- 5、h5 保存图片不需要调接口,提示用户长按图片保存。 +- 6、画板不能隐藏,包括`v-if`,`v-show`、`display:none`、`opacity:0`,另外也不要把画板放在弹窗里。如果需要隐藏画板请设置 `custom-style="position: fixed; left: 200%"` +- 7、微信小程序 canvas 2d **不支持真机调试**,请使用真机预览方式。 +- 8、微信小程序打开调试时可以生但并闭无法生成时,这种情况一般是没有在公众号配置download域名 +- 9、HBX 3.4.5之前的版本不支持vue3 +- 10、在微信开发工具上 canvas 层级最高无法zindex,并不影响真机 +- 11、请不要导入非uni_modules插件 +- 华为手机 APP 上无法生成图片,请使用 HBX2.9.11++(已过时,忽略这条) +- IOS APP 请勿使用 HBX2.9.3.20201014 的版本!这个版本无法生成图片。(已过时,忽略这条) +- 苹果微信 7.0.20 存在闪退和图片无法 onload 为微信 bug(已过时,忽略这条) + +## 打赏 + +如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。 + +![输入图片说明](https://static-6d65bd90-8508-4d6c-abbc-a4ef5c8e49e7.bspapp.com/image/222521_bb543f96_518581.jpeg "微信图片编辑_20201122220352.jpg") +![输入图片说明](https://static-6d65bd90-8508-4d6c-abbc-a4ef5c8e49e7.bspapp.com/image/wxplay.jpg "wxplay.jpg") \ No newline at end of file diff --git a/uni_modules/lime-painter/static/index.html b/uni_modules/lime-painter/static/index.html new file mode 100644 index 0000000..fdf884e --- /dev/null +++ b/uni_modules/lime-painter/static/index.html @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uni_modules/lime-painter/static/painter.js b/uni_modules/lime-painter/static/painter.js new file mode 100644 index 0000000..2910063 --- /dev/null +++ b/uni_modules/lime-painter/static/painter.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Painter={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+o,x1:Math.round(e/2)+n,y1:o};if(180===s)return{x0:Math.round(e/2)+n,y0:o,x1:Math.round(e/2)+n,y1:i+o};if(90===s)return{x0:n,y0:Math.round(i/2)+o,x1:e+n,y1:Math.round(i/2)+o};if(270===s)return{x0:e+n,y0:Math.round(i/2)+o,x1:n,y1:Math.round(i/2)+o};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+o,x1:e+n,y1:o};if(s===180-a)return{x0:n,y0:o,x1:e+n,y1:i+o};if(s===180+a)return{x0:e+n,y0:o,x1:n,y1:i+o};if(s===360-a)return{x0:e+n,y0:i+o,x1:n,y1:o};var h=0,d=0,c=0,l=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var f=s*Math.PI/180,u=s360-a?i/2:-i/2,p=Math.tan(f)*u,g=s180-a&&s<180?e/2-p:-e/2-p;h=-(c=p+(v=Math.pow(Math.sin(f),2)*g)),d=-(l=u+v/Math.tan(f))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var v;f=(90-s)*Math.PI/180,p=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(f)*p,g=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(c=p+(v=Math.pow(Math.sin(f),2)*g)/Math.tan(f)),d=-(l=u+v)}return h=Math.round(h+e/2)+n,d=Math.round(i/2-d)+o,c=Math.round(c+e/2)+n,l=Math.round(i/2-l)+o,{x0:h,y0:d,x1:c,y1:l}}(o,t,e,i,n),a=s.x0,h=s.y0,d=s.x1,c=s.y1,l=r.createLinearGradient(a,h,d,c),f=o.match(/linear-gradient\((.+)\)/)[1],u=U(f.substring(f.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t){return"number"==typeof t}function V(t){return"auto"===t||null===t}function G(t){return/%$/.test(t)}var q,J=0,Q=function(){function t(){Y(this,"elements",[]),Y(this,"afterElements",[]),Y(this,"beforeElements",[]),Y(this,"ids",[]),Y(this,"width",0),Y(this,"height",0),Y(this,"top",0),Y(this,"left",0),Y(this,"pre",null),Y(this,"offsetX",0),Y(this,"offsetY",0),J++,this.id=J}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t)},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this[this.key.height]=t.offsetSize[this.key.height]),this[this.key.width]+=t.offsetSize[this.key.width],(this.container.lineMaxWidth||0)1?0:"flex-end"===t.style.alignSelf?this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height]:"center"===t.style.alignSelf?(this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height])/2:0},n}(Q),et=b,it=y,nt=v,ot=x,rt=m,st=w,at=z,ht=M,dt=B,ct=0,lt={left:null,top:null,width:null,height:null},ft=function(){function t(t,e,i,n){var o=this;Y(this,"id",ct++),Y(this,"style",{left:null,top:null,width:null,height:null}),Y(this,"computedStyle",{}),Y(this,"originStyle",{}),Y(this,"children",{}),Y(this,"layoutBox",$({},lt)),Y(this,"contentSize",$({},lt)),Y(this,"clientSize",$({},lt)),Y(this,"borderSize",$({},lt)),Y(this,"offsetSize",$({},lt)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.name||t.type,this.attributes=this.getAttributes(t);var r=this.getComputedStyle(t,null==e?void 0:e.computedStyle);this.isAbsolute=r.position==ht,this.isFixed=r.position==dt,this.originStyle=r,Object.keys(r).forEach((function(t){Object.defineProperty(o.style,t,{configurable:!0,enumerable:!0,get:function(){return r[t]},set:function(e){r[t]=e}})}));var s={contentSize:$({},this.contentSize),clientSize:$({},this.clientSize),borderSize:$({},this.borderSize),offsetSize:$({},this.offsetSize)};Object.keys(s).forEach((function(t){Object.keys(o[t]).forEach((function(e){Object.defineProperty(o[t],e,{configurable:!0,enumerable:!0,get:function(){return s[t][e]},set:function(i){s[t][e]=i}})}))})),this.computedStyle=this.style}var e=t.prototype;return e.add=function(t){t.parent=this,this.children[t.id]=t},e.getChildren=function(){var t=this;return Object.keys(this.children).map((function(e){return t.children[e]}))},e.getLineRect=function(t,e){var i={width:0,height:0},n=e?e.lines:this.parent&&this.parent.lines;return n&&n.find((function(e){return e.ids.includes(t)}))||i},e.getComputedStyle=function(t,e){var i=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],n=t.css,o=void 0===n?{}:n,r=t.type,s=void 0===r?nt:r,a=$({},P);if([it,et,ot].includes(s)&&!o.display&&(a.display=st),e)for(var h=0;h=0&&l<0,Y=d>=0&&u<0;return i==a[0]&&(this[i].left=t.left+s+v+C+(U?2*-l:0),this[i].top=t.top+d+b+P+(Y?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:E),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=E,this[i].heightAdd=H),i==a[1]&&(this[i].left=t.left+s+C+(U<0?-l:0),this[i].top=t.top+d+P+(Y?-u:0),this[i].width=t.width+v+m,this[i].height=t.height+b+S),i==a[2]&&(this[i].left=t.left+s+C/2+(U<0?-l:0),this[i].top=t.top+d+P/2+(Y?-u:0),this[i].width=t.width+v+m+C/2+A/2,this[i].height=t.height+b+S+O/2+P/2),i==a[3]&&(this[i].left=t.left+(U<0?-l:0),this[i].top=t.top+(Y?-u:0),this[i].width=t.width+v+m+C+A+s+l,this[i].height=t.height+b+S+O+P+u+d),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var o=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var r=e||{},s=r.border,h=(s=void 0===s?{}:s).borderWidth,d=void 0===h?0:h,c=r.borderTop,l=(c=void 0===c?{}:c).borderTopWidth,f=void 0===l?d:l,u=r.borderBottom,p=(u=void 0===u?{}:u).borderBottomWidth,g=void 0===p?d:p,v=r.borderRight,y=(v=void 0===v?{}:v).borderRightWidth,b=void 0===y?d:y,x=r.borderLeft,m=(x=void 0===x?{}:x).borderLeftWidth,w=void 0===m?d:m,S=r.padding,z=(S=void 0===S?{}:S).paddingTop,M=void 0===z?0:z,B=S.paddingRight,I=void 0===B?0:B,k=S.paddingBottom,P=void 0===k?0:k,W=S.paddingLeft,R=void 0===W?0:W;i||(t.width-=R+I+b+w),1!==i||n||(t.height-=M+P+f+g)}this.layoutBox&&(a.forEach((function(i){return o.layoutBox[i]=o.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition2=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,o=void 0===n?0:n,r=t.top,s=void 0===r?0:r,a=t.padding||{},h=a.paddingBottom,d=void 0===h?0:h,c=a.paddingRight,l=void 0===c?0:c,f=$({},this.contentSize,{left:o,top:s}),u=this.contentSize.top-this.offsetSize.top,p=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var g,v=X(this.root.fixedLine.elements);!(g=v()).done;){var y=g.value;y.setPosition(y,this.root.offsetSize),y.getBoxPosition2()}}if(e)for(var b,x=X(e.elements);!(b=x()).done;){var m=b.value;m.setPosition(m,f),m.style.left+=o+p+l,m.style.top+=s+u+d,m.getBoxPosition2()}if(i)for(var w,S=X(i);!(w=S()).done;){w.value.layout(f.top+u,f.left+p)}return this.layoutBoxUpdate(f,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==rt},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==at},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==at)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==st},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,o=i.actualBoundingBoxAscent,r=i.actualBoundingBoxDescent;return{ascent:o,descent:r,width:n,fontHeight:o+r||.7*e+1}},e.getBoxWidthHeight=function(){var t,e=this,i=this.name,n=this.computedStyle,o=this.attributes,r=this.parent,s=void 0===r?{}:r,a=this.ctx,h=this.getChildren(),d=n.left,c=void 0===d?0:d,l=n.top,f=void 0===l?0:l,u=n.bottom,p=n.right,g=n.width,v=void 0===g?0:g,y=n.minWidth,b=n.maxWidth,x=n.minHeight,m=n.maxHeight,w=n.height,S=void 0===w?0:w,z=n.fontSize,M=void 0===z?14:z,B=n.fontWeight,I=n.fontFamily,k=n.fontStyle,P=n.position,W=n.lineClamp,R=n.lineHeight,O=n.padding,T=void 0===O?{}:O,L=n.margin,A=void 0===L?{}:L,F=n.border,C=(F=void 0===F?{}:F).borderWidth,E=void 0===C?0:C,H=n.borderRight,U=(H=void 0===H?{}:H).borderRightWidth,Y=void 0===U?E:U,$=n.borderLeft,D=($=void 0===$?{}:$).borderLeftWidth,_=void 0===D?E:D,X=s.contentSize&&s.contentSize.width,N=s.contentSize&&s.contentSize.height;if(G(v)&&X&&(v=j(v,X)),G(v)&&!X&&(v=null),G(S)&&N&&(S=j(S,N)),G(S)&&!N&&(S=null),G(y)&&X&&(y=j(y,X)),G(b)&&X&&(b=j(b,X)),G(x)&&N&&(x=j(x,N)),G(m)&&N&&(m=j(m,N)),n.padding&&null!=(t=s.contentSize)&&t.width)for(var V in n.padding)Object.hasOwnProperty.call(n.padding,V)&&(n.padding[V]=j(n.padding[V],X));var q=T.paddingRight,J=void 0===q?0:q,Z=T.paddingLeft,tt=void 0===Z?0:Z;if(n.margin&&[n.margin.marginLeft,n.margin.marginRight].includes("auto"))if(v){var ot=X&&X-v-J-tt-_-Y||0;n.margin.marginLeft==n.margin.marginRight?n.margin.marginLeft=n.margin.marginRight=ot/2:"auto"==n.margin.marginLeft?n.margin.marginLeft=ot:n.margin.marginRight=ot}else n.margin.marginLeft=n.margin.marginRight=0;var rt=A.marginRight,st=void 0===rt?0:rt,at=A.marginLeft,dt={width:v,height:S,left:0,top:0},ct=tt+J+_+Y+(void 0===at?0:at)+st;if(i==it&&!this.attributes.widths){var lt=o.text||"";a.save(),a.setFonts({fontFamily:I,fontSize:M,fontWeight:B,fontStyle:k});var ft=new Map;lt.split("\n").map((function(t){var i=t.split("").map((function(t){var i=ft.get(t);if(i)return i;var n=e.measureText(t,M).width;return ft.set(t,n),n})),n=e.measureText(t,M),o=n.fontHeight,r=n.ascent,s=n.descent;e.attributes.fontHeight=o,e.attributes.ascent=r,e.attributes.descent=s,e.attributes.widths||(e.attributes.widths=[]),e.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e}),0)})})),a.restore()}if(i==et&&null==v){var ut=o.width,pt=o.height;dt.width=this.contrastSize(Math.round(ut*S/pt)||0,y,b),this.layoutBoxUpdate(dt,n,0)}if(i==it&&null==v){var gt=this.attributes.widths,vt=Math.max.apply(Math,gt.map((function(t){return t.total})));if(s&&X>0&&(vt>X||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)vt=X-ct;dt.width=this.contrastSize(vt,y,b),this.layoutBoxUpdate(dt,n,0)}if(i==it&&!this.attributes.lines){var yt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e>dt.width?(yt++,e):t+e}),0)})),yt=W&&yt>W?W:yt,this.attributes.lines=yt}if(i==et&&null==S){var bt=o.width,xt=o.height;dt.height=this.contrastSize(j(dt.width*xt/bt)||0,x,m),this.layoutBoxUpdate(dt,n,1)}i==it&&null==S&&(R=j(R,M),dt.height=this.contrastSize(j(this.attributes.lines*R),x,m),this.layoutBoxUpdate(dt,n,1,!0)),s&&s.children&&X&&([nt,it].includes(i)&&this.isFlex()||i==nt&&this.isBlock(this)&&!this.isInFlow())&&(dt.width=this.contrastSize(X-ct,y,b),this.layoutBoxUpdate(dt,n)),v&&!G(v)&&(dt.width=this.contrastSize(v,y,b),this.layoutBoxUpdate(dt,n,0)),S&&!G(S)&&(dt.height=this.contrastSize(dt.height,x,m),this.layoutBoxUpdate(dt,n,1));var mt=0;if(h.length){var wt=null;h.forEach((function(t,i){t.getBoxWidthHeight();var o=h[i+1];if(o&&o.isInFlow()&&(t.next=o),t.isInFlow()&&!t.inFlexBox()){var r=e.getBoxState(wt,t);e.line&&e.line.canIEnter(t)&&!r?e.line.add(t):(new Q).bind(t),wt=t}else t.inFlexBox()?e.line&&(e.line.canIEnter(t)||"nowrap"==n.flexWrap)?e.line.add(t):(new K).bind(t):t.isFixed?e.root.fixedLine?e.root.fixedLine.fixedAdd(t):(new Q).fixedBind(t):e.fixedLine?e.fixedLine.fixedAdd(t):(new Q).fixedBind(t,1)})),this.lines&&(mt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,zt=0;if(!v&&(this.isAbsolute||this.isFixed)&&X){var Mt=P==ht?X:this.root.width,Bt=Mt-(G(c)?j(c,Mt):c)-(G(p)?j(p,Mt):p);St=n.left?Bt:this.lineMaxWidth}if(!S&&(null!=f?f:this.isAbsolute||this.isFixed&&N)){var It=P==ht?N:this.root.height,kt=It-(G(f)?j(f,It):f)-(G(u)?j(u,It):u);zt=n.top?kt:0}if(v&&!G(v)||dt.width||(dt.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?X||s.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,y,b),this.layoutBoxUpdate(dt,n,0)),S||!mt&&!zt||(dt.height=zt||this.contrastSize(mt,x,m),this.layoutBoxUpdate(dt,n)),n.borderRadius&&this.borderSize&&this.borderSize.width)for(var V in n.borderRadius)Object.hasOwnProperty.call(n.borderRadius,V)&&(n.borderRadius[V]=j(n.borderRadius[V],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.getBoxPosition2(),this.offsetSize},t}(),ut=function(){var t,e,i,n,o,r,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],d=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],c=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],l=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],f=[],u=[],p=[],g=[],v=[],y=2;function b(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function x(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)b(t-1,i+n),b(t+1,i-n),b(t-n,i-1),b(t+n,i+1)}function m(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var w=[];function S(t,e,i,n){var o,r,s;for(o=0;oe&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function M(t){var i,n,o,r;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function I(){var t,i,n,o,r,s=0,a=0;for(i=0;ie*e;)h-=e*e,d++;for(s+=10*d,t=0;t1)for(W=s[t],k=e-7;;){for(B=e-7;B>W-3&&(x(B,k),!(B6)for(W=a[t-7],P=17,B=0;B<6;B++)for(k=0;k<3;k++,P--)1&(P>11?t>>P-12:W>>P)?(p[5-B+e*(2-k+e-11)]=1,p[2-k+e-11+e*(5-B)]=1):(b(5-B,2-k+e-11),b(2-k+e-11,5-B));for(k=0;k=(B=o*(i+n)+n)-2&&(R=B-2,t>9&&R--),O=R,t>9){for(f[O+2]=0,f[O+3]=0;O--;)W=f[O],f[O+3]|=255&W<<4,f[O+2]=W>>4;f[2]|=255&R<<4,f[1]=R>>4,f[0]=64|R>>12}else{for(f[O+1]=0,f[O+2]=0;O--;)W=f[O],f[O+2]|=255&W<<4,f[O+1]=W>>4;f[1]|=255&R<<4,f[0]=64|R>>4}for(O=R+3-(t<10);O0;T--)w[T]=w[T]?w[T-1]^l[m(c[w[T]]+O)]:w[T-1];w[0]=l[m(c[w[0]]+O)]}for(O=0;O<=r;O++)w[O]=c[w[O]];for(P=B,k=0,O=0;O>=1)1&k&&(p[e-1-P+8*e]=1,P<6?p[8+e*P]=1:p[8+e*(P+1)]=1);for(P=0;P<7;P++,k>>=1)1&k&&(p[8+e*(e-7+P)]=1,P?p[6-P+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,o;for(e="",n=t.length,i=0;i=1&&o<=127?e+=t.charAt(i):o>2047?(e+=String.fromCharCode(224|o>>12&15),e+=String.fromCharCode(128|o>>6&63),e+=String.fromCharCode(128|o>>0&63)):(e+=String.fromCharCode(192|o>>6&31),e+=String.fromCharCode(128|o>>0&63));return e},draw:function(t,i,n,o,r){i.drawView(n,o);var s=i.ctx,a=n.contentSize,h=a.width,d=a.height,c=a.left,l=a.top;o.borderRadius,o.backgroundColor;var f=o.color,u=void 0===f?"#000000":f;o.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top;if(y=r||y,s){s.save(),i.setOpacity(o),i.setTransform(n,o);var p=Math.min(h,d);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(u);for(var b=0;b=s||"cover"==n&&r=s)&&(a=e.width/i.width);var h=i.width*a,d=i.height*a,c=o||[],l=c[0],f=c[1],u=/^\d+px|rpx$/.test(l)?j(l,e.width):(e.width-h)*(C(l)?j(l,1):{left:0,center:.5,right:1}[l||"center"]),p=/^\d+px|rpx$/.test(f)?j(f,e.height):(e.height-d)*(C(f)?j(f,1):{top:0,center:.5,bottom:1}[f||"center"]),g=function(t,e){return[(t-u)/a,(e-p)/a]},v=g(0,0),y=v[0],b=v[1],x=g(e.width,e.height),m=x[0],w=x[1];return{sx:Math.max(y,0),sy:Math.max(b,0),sw:Math.min(m-y,i.width),sh:Math.min(w-b,i.height),dx:Math.max(u,0),dy:Math.max(p,0),dw:Math.min(h,e.width),dh:Math.min(d,e.height)}}({objectFit:u,objectPosition:v},e.contentSize,t),o=n.sx,r=n.sy,a=n.sh,h=n.sw,d=n.dx,c=n.dy,l=n.dh,f=n.dw;T==s.MP_BAIDU?i.drawImage(t.src,d+w,c+S,f,l,o,r,h,a):i.drawImage(t.src,o,r,h,a,d+w,c+S,f,l)}else i.drawImage(t.src,w,S,x,m)},P=function(){i.restore(),R.drawView(e,o,!1,!0,!1),h(1)},W=function(t){B(t),P()},W(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},t.prototype.drawText=function(t,e,i,n){var o=this.ctx,r=e.borderSize,s=e.contentSize,a=e.left,h=e.top,d=s.width,c=s.height,l=s.left-r.left,f=s.top-r.top,u=i.color,p=void 0===u?"#000000":u,g=i.lineHeight,v=void 0===g?"1.4em":g,y=i.fontSize,b=void 0===y?14:y,x=i.fontWeight,m=i.fontFamily,w=i.fontStyle,S=i.textAlign,z=void 0===S?"left":S,M=i.verticalAlign,B=void 0===M?xt:M,I=i.backgroundColor,k=i.lineClamp,P=i.backgroundClip,W=i.textShadow,R=i.textDecoration;if(this.drawView(e,i,P!=gt),v=j(v,b),t){switch(o.save(),this.setShadow({boxShadow:W}),a+=l,h+=f,o.setFonts({fontFamily:m,fontSize:b,fontWeight:x,fontStyle:w}),o.setTextBaseline(xt),o.setTextAlign(z),P?this.setBackground(I,d,c,a,h):o.setFillStyle(p),z){case wt:break;case St:a+=.5*d;break;case zt:a+=d}var O=n.lines*v,T=Math.ceil((c-O)/2);switch(T<0&&(T=0),B){case bt:break;case xt:h+=T;break;case mt:h+=2*T}var L=n.fontHeight,A=n.descent,F=(v-L)/2,C=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent,s=void 0===r?0:r,a=n+s||.7*b+1;return B==bt?{fix:s,height:a,lineY:v-a}:B==xt?{fix:v/2+n/4,height:a,lineY:(v-a)/2}:B==mt?{fix:v-n,height:a,lineY:0}:{fix:0,height:0,lineY:0}},E=function(t,e,i){var r=t;switch(z){case wt:r+=i;break;case St:r=(t-=i/2)+i;break;case zt:r=t,t-=i}if(R){o.setLineWidth(b/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(R)&&(A||(e+=F/2),o.moveTo(t,e+s),o.lineTo(r,e+s)),/\boverline\b/.test(R)&&(A||(e-=F/2),o.moveTo(t,e-n.fontHeight-s),o.lineTo(r,e-n.fontHeight-s)),/\bline-through\b/.test(R)&&(o.moveTo(t,e-.5*n.fontHeight),o.lineTo(r,e-.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}};if(!n.widths||1==n.widths.length&&n.widths[0].total<=s.width){var H=C(t),U=H.fix,Y=H.lineY;return o.fillText(t,a,h+U),E(a,(h+=v)-Y,n&&n.widths&&n.widths[0].total||n.text),o.restore(),void this.setBorder(e,i)}for(var $=t.split(""),D=h,_=a,X="",N=0,V=0;V<=$.length;V++){var G=$[V]||"",q="\n"===G,J=""==G,Q=X+(G=q?"":G),Z=o.measureText(Q).width;if(N>=k)break;if(_=a,Z>s.width||q||J){if(N++,X=J&&Z<=s.width?Q:X,N===k&&Z>d){for(;o.measureText("".concat(X,"...")).width>s.width&&!(X.length<=1);)X=X.substring(0,X.length-1);X+="..."}var K=C(X);U=K.fix,Y=K.lineY;if(o.fillText(X,_,h+U),E(_,(h+=v)-Y,Z),X=G,h>D+c)break}else X=Q}o.restore()}},t.prototype.source=function(t){var e;return i(this,void 0,void 0,(function(){var i,o,r,s=this;return n(this,(function(n){switch(n.label){case 0:if(this.node=null,i=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(o in t.type=yt,t.css=t.css||{},t)["views","children","type","css"].includes(o)||(t.css[o]=t[o],delete t[o]);return(null===(e=t.css)||void 0===e?void 0:e.width)||t.css||(t.css={}),[4,this.create(t)];case 1:return r=n.sent(),this.size=(null==r?void 0:r.layout())||{},this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),console.log("布局用时:"+(+new Date-i)+"ms"),[2,this.size]}}))}))},t.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},t.prototype.create=function(t,o){var r,s;return i(this,void 0,void 0,(function(){var i,a,h,d,c,l,f,u,p,g,v,y,b,x,m,w,z;return n(this,(function(n){switch(n.label){case 0:if(i=t.type==pt,a=[gt,vt].includes(t.type),h=t.css||{},d=h.backgroundImage,c=h.display,i&&!t.src&&!t.url||a&&!t.text)return[2];if(c==S)return[2];if(a&&(t.text=String(t.text)),!(i||t.type==yt&&d))return[3,4];l=i?t.src:"",f=/url\((.+)\)/,d&&(null===(r=f.exec(d))||void 0===r?void 0:r[1])&&(l=(null===(s=f.exec(d))||void 0===s?void 0:s[1])||""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getImageInfo(l)];case 2:return u=n.sent(),p=u.width,g=u.height,!(v=u.path)&&i?[2]:(v&&(t.attributes=Object.assign(t.attributes||{},{width:p,height:g,path:v,src:v,naturalSrc:l})),[3,4]);case 3:return y=n.sent(),t.type!=yt?[2]:(this.lifecycle("onEffectFail",e(e({},y),{src:l})),[3,4]);case 4:if(this.count+=1,b=new ft(t,o,this.root,this.ctx),!(x=t.views||t.children))return[3,8];m=0,n.label=5;case 5:return m0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;r("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("redirectTo",{url:encodeURI(n)})},getEnv:function(e){o()?e({nvue:!0}):window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r("postMessage",e.data||{})}},d=/uni-app/i.test(navigator.userAgent),s=/Html5Plus/i.test(navigator.userAgent),w=/complete|loaded|interactive/;var u=window.my&&navigator.userAgent.indexOf("AlipayClient")>-1;var g=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var c=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var v=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var m=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.qa&&/quickapp/i.test(navigator.userAgent);var f=window.ks&&window.ks.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var l=window.tt&&window.tt.miniProgram&&/Lark|Feishu/i.test(navigator.userAgent);var _=window.jd&&window.jd.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);for(var E,b=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},h=[function(e){if(d||s)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&w.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),a},function(e){if(m)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(c)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(u){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(g)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(v)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(p){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(f)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.ks.miniProgram},function(e){if(l)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(_)return window.JDJSBridgeReady&&window.JDJSBridgeReady.invoke?setTimeout(e,0):document.addEventListener("JDJSBridgeReady",e),window.jd.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),a}],y=0;y + + + + + + \ No newline at end of file diff --git a/uni_modules/mumu-recorder/package.json b/uni_modules/mumu-recorder/package.json new file mode 100644 index 0000000..00d5e90 --- /dev/null +++ b/uni_modules/mumu-recorder/package.json @@ -0,0 +1,87 @@ +{ + "id": "mumu-recorder", + "displayName": "h5录音组件,调用H5原生功能使用麦克风进行录音", + "version": "1.0.1", + "description": "演示案例中模仿了微信的长按发送语音,与普通录音demo。", + "keywords": [ + "录音", + "麦克风", + "模仿微信" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "麦克风" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "n", + "app-nvue": "n" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "n", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "u", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u", + "小红书": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/mumu-recorder/readme.md b/uni_modules/mumu-recorder/readme.md new file mode 100644 index 0000000..1f888e5 --- /dev/null +++ b/uni_modules/mumu-recorder/readme.md @@ -0,0 +1,117 @@ +## 插件简绍 + +### 实现原理 + +> 通过 navigator.mediaDevices.getUserMedia(需要https环境) 这个api调用麦克风,获取到到音频流数据。 +> +> 通过 MediaRecorder 这个构造函数对音频流进行接收,完成录制后会返回一个存储`Blob`内容的录制数据。 + + +### 使用环境 + +需要https环境才能使用,本地测试可以在 manifest.json 中点击源码展示,找到h5 ,添加:"devServer" : { "https" : true} + +**请勿使用 UC浏览器 与 夸克等阿里旗下的浏览器,发现他们使用的内核都较低,无法正常获取音频流,并且都有对接音频流截取的插件,导致无法正常获取音频流的数据。在微信中可以正常使用,推荐在微信内打开演示案例 ** + +需要https环境才能使用!!! + +需要https环境才能使用!!! + +需要https环境才能使用!!! + +### 插件使用 + +**插件已支持 uni_modules 支持组件easycom,以下代码演示的是普通使用** + +``` html + + + + + {{!status?'开始录音':'结束录音'}} + + + +``` + +``` javascript +// js + import MumuRecorder from '@/uni_modules/mumu-recorder/components/mumu-recorder/mumu-recorder.vue' + export default { + components: { MumuRecorder }, + data() { + return { + status: false, + recorder: null + } + }, + onLoad() { + + }, + methods: { + handlerSave() { + let tag = document.createElement('a') + tag.href = this.recorder.localUrl + tag.download = '录音' + tag.click() + }, + handlerOnCahnger() { + if (this.status) { + this.$refs.recorder.stop() + } else { + this.$refs.recorder.start() + } + this.status = !this.status + }, + handlerSuccess(res) { + console.log(res) + this.recorder = res + }, + handlerError(code) { + switch (code) { + case '101': + uni.showModal({ + content: '当前浏览器版本较低,请更换浏览器使用,推荐在微信中打开。' + }) + break; + case '201': + uni.showModal({ + content: '麦克风权限被拒绝,请刷新页面后授权麦克风权限。' + }) + break + default: + uni.showModal({ + content: '未知错误,请刷新页面重试' + }) + break + } + } + } + } +``` + +### 相关API + +##### 组件内部方法($refs 调用) + +| 方法名 | 说明 | 参数 | +| ------ | -------- | ---- | +| start | 开始录音 | 无 | +| stop | 结束录音 | 无 | + + + +##### 事件(Events) + +| 事件名 | 说明 | 回调参数 | +| ------- | -------------------- | ------------------------------------------------------------ | +| success | 停止录音后调用此事件 | 返回录音数据,是一个对象
{ data: 音频的 blob 数据,上传请使用这个
duration: 当前音频长度
localUrl: 当前音频的本地链接,可直接通过 audio 标签进行播放 } | +| error | 组件内部发生错误 | 错误码:<100 当前不是https环境> <101 浏览器不支持> <201 麦克风权限被拒绝> <500 未知错误> | + +### 案例演示 + +![enter description here](https://h5plugin.mumudev.top/public/recorder/qrcode.png) + +## 支持作者 + +![支持作者](https://student.mumudev.top/wxMP.jpg) \ No newline at end of file diff --git a/uni_modules/uni-popup/changelog.md b/uni_modules/uni-popup/changelog.md new file mode 100644 index 0000000..b4bfd61 --- /dev/null +++ b/uni_modules/uni-popup/changelog.md @@ -0,0 +1,78 @@ +## 1.8.8(2024-02-20) +- 修复 uni-popup 在微信小程序下出现文字向上闪动的bug +## 1.8.7(2024-02-02) +- 新增 uni-popup-dialog 新增属性focus:input模式下,是否自动自动聚焦 +## 1.8.6(2024-01-30) +- 新增 uni-popup-dialog 新增属性maxLength:限制输入框字数 +## 1.8.5(2024-01-26) +- 新增 uni-popup-dialog 新增属性showClose:控制关闭按钮的显示 +## 1.8.4(2023-11-15) +- 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close` +## 1.8.3(2023-04-17) +- 修复 uni-popup 重复打开时的 bug +## 1.8.2(2023-02-02) +- uni-popup-dialog 组件新增 inputType 属性 +## 1.8.1(2022-12-01) +- 修复 nvue 下 v-show 报错 +## 1.8.0(2022-11-29) +- 优化 主题样式 +## 1.7.9(2022-04-02) +- 修复 弹出层内部无法滚动的bug +## 1.7.8(2022-03-28) +- 修复 小程序中高度错误的bug +## 1.7.7(2022-03-17) +- 修复 快速调用open出现问题的Bug +## 1.7.6(2022-02-14) +- 修复 safeArea 属性不能设置为false的bug +## 1.7.5(2022-01-19) +- 修复 isMaskClick 失效的bug +## 1.7.4(2022-01-19) +- 新增 cancelText \ confirmText 属性 ,可自定义文本 +- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 +- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 +## 1.7.3(2022-01-13) +- 修复 设置 safeArea 属性不生效的bug +## 1.7.2(2021-11-26) +- 优化 组件示例 +## 1.7.1(2021-11-26) +- 修复 vuedoc 文字错误 +## 1.7.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) +## 1.6.2(2021-08-24) +- 新增 支持国际化 +## 1.6.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.6.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.5.0(2021-06-23) +- 新增 mask-click 遮罩层点击事件 +## 1.4.5(2021-06-22) +- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.4(2021-06-18) +- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.3(2021-06-08) +- 修复 错误的 watch 字段 +- 修复 safeArea 属性不生效的问题 +- 修复 点击内容,再点击遮罩无法关闭的Bug +## 1.4.2(2021-05-12) +- 新增 组件示例地址 +## 1.4.1(2021-04-29) +- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 +## 1.4.0 (2021-04-29) +- 新增 type 属性的 left\right 值,支持左右弹出 +- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 +- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 +- 新增 safeArea 属性,是否适配底部安全区 +- 修复 App\h5\微信小程序底部安全区占位不对的Bug +- 修复 App 端弹出等待的Bug +- 优化 提升低配设备性能,优化动画卡顿问题 +- 优化 更简单的组件自定义方式 +## 1.2.9(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.2.8(2021-02-05) +- 调整为uni_modules目录规范 +## 1.2.7(2021-02-05) +- 调整为uni_modules目录规范 +- 新增 支持 PC 端 +- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js b/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js new file mode 100644 index 0000000..6ef26a2 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 避免和其他按键事件冲突 + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + this.$once('hook:beforeDestroy', () => { + document.removeEventListener('keyup', listener) + }) + }, + render: () => {} +} +// #endif diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue new file mode 100644 index 0000000..68a1ce2 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue @@ -0,0 +1,294 @@ + + + + + diff --git a/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue b/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue new file mode 100644 index 0000000..91370a8 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue @@ -0,0 +1,143 @@ + + + + diff --git a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue new file mode 100644 index 0000000..f7e667c --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue @@ -0,0 +1,187 @@ + + + + diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/en.json b/uni_modules/uni-popup/components/uni-popup/i18n/en.json new file mode 100644 index 0000000..7f1bd06 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/en.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "cancel", + "uni-popup.ok": "ok", + "uni-popup.placeholder": "pleace enter", + "uni-popup.title": "Hint", + "uni-popup.shareTitle": "Share to" +} diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/index.js b/uni_modules/uni-popup/components/uni-popup/i18n/index.js new file mode 100644 index 0000000..de7509c --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/index.js @@ -0,0 +1,8 @@ +import en from './en.json' +import zhHans from './zh-Hans.json' +import zhHant from './zh-Hant.json' +export default { + en, + 'zh-Hans': zhHans, + 'zh-Hant': zhHant +} diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json new file mode 100644 index 0000000..5e3003c --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "取消", + "uni-popup.ok": "确定", + "uni-popup.placeholder": "请输入", + "uni-popup.title": "提示", + "uni-popup.shareTitle": "分享到" +} diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json new file mode 100644 index 0000000..13e39eb --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "取消", + "uni-popup.ok": "確定", + "uni-popup.placeholder": "請輸入", + "uni-popup.title": "提示", + "uni-popup.shareTitle": "分享到" +} diff --git a/uni_modules/uni-popup/components/uni-popup/keypress.js b/uni_modules/uni-popup/components/uni-popup/keypress.js new file mode 100644 index 0000000..62dda46 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 避免和其他按键事件冲突 + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + // this.$once('hook:beforeDestroy', () => { + // document.removeEventListener('keyup', listener) + // }) + }, + render: () => {} +} +// #endif diff --git a/uni_modules/uni-popup/components/uni-popup/popup.js b/uni_modules/uni-popup/components/uni-popup/popup.js new file mode 100644 index 0000000..c4e5781 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/popup.js @@ -0,0 +1,26 @@ + +export default { + data() { + return { + + } + }, + created(){ + this.popup = this.getParent() + }, + methods:{ + /** + * 获取父元素实例 + */ + getParent(name = 'uniPopup') { + let parent = this.$parent; + let parentName = parent.$options.name; + while (parentName !== name) { + parent = parent.$parent; + if (!parent) return false + parentName = parent.$options.name; + } + return parent; + }, + } +} diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue b/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue new file mode 100644 index 0000000..5eb8d5b --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue new file mode 100644 index 0000000..5d9e9d2 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue @@ -0,0 +1,479 @@ + + + + diff --git a/uni_modules/uni-popup/package.json b/uni_modules/uni-popup/package.json new file mode 100644 index 0000000..6427510 --- /dev/null +++ b/uni_modules/uni-popup/package.json @@ -0,0 +1,87 @@ +{ + "id": "uni-popup", + "displayName": "uni-popup 弹出层", + "version": "1.8.8", + "description": " Popup 组件,提供常用的弹层", + "keywords": [ + "uni-ui", + "弹出层", + "弹窗", + "popup", + "弹框" + ], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-transition" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-popup/readme.md b/uni_modules/uni-popup/readme.md new file mode 100644 index 0000000..fdad4b3 --- /dev/null +++ b/uni_modules/uni-popup/readme.md @@ -0,0 +1,17 @@ + + +## Popup 弹出层 +> **组件名:uni-popup** +> 代码块: `uPopup` +> 关联组件:`uni-transition` + + +弹出层组件,在应用中弹出一个消息提示窗口、提示框等 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + + + + diff --git a/uni_modules/uni-scss/changelog.md b/uni_modules/uni-scss/changelog.md new file mode 100644 index 0000000..b863bb0 --- /dev/null +++ b/uni_modules/uni-scss/changelog.md @@ -0,0 +1,8 @@ +## 1.0.3(2022-01-21) +- 优化 组件示例 +## 1.0.2(2021-11-22) +- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题 +## 1.0.1(2021-11-22) +- 修复 vue3中scss语法兼容问题 +## 1.0.0(2021-11-18) +- init diff --git a/uni_modules/uni-scss/index.scss b/uni_modules/uni-scss/index.scss new file mode 100644 index 0000000..1744a5f --- /dev/null +++ b/uni_modules/uni-scss/index.scss @@ -0,0 +1 @@ +@import './styles/index.scss'; diff --git a/uni_modules/uni-scss/package.json b/uni_modules/uni-scss/package.json new file mode 100644 index 0000000..7cc0ccb --- /dev/null +++ b/uni_modules/uni-scss/package.json @@ -0,0 +1,82 @@ +{ + "id": "uni-scss", + "displayName": "uni-scss 辅助样式", + "version": "1.0.3", + "description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。", + "keywords": [ + "uni-scss", + "uni-ui", + "辅助样式" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "category": [ + "JS SDK", + "通用 SDK" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "n", + "联盟": "n" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-scss/readme.md b/uni_modules/uni-scss/readme.md new file mode 100644 index 0000000..b7d1c25 --- /dev/null +++ b/uni_modules/uni-scss/readme.md @@ -0,0 +1,4 @@ +`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-scss/styles/index.scss b/uni_modules/uni-scss/styles/index.scss new file mode 100644 index 0000000..ffac4fe --- /dev/null +++ b/uni_modules/uni-scss/styles/index.scss @@ -0,0 +1,7 @@ +@import './setting/_variables.scss'; +@import './setting/_border.scss'; +@import './setting/_color.scss'; +@import './setting/_space.scss'; +@import './setting/_radius.scss'; +@import './setting/_text.scss'; +@import './setting/_styles.scss'; diff --git a/uni_modules/uni-scss/styles/setting/_border.scss b/uni_modules/uni-scss/styles/setting/_border.scss new file mode 100644 index 0000000..12a11c3 --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_border.scss @@ -0,0 +1,3 @@ +.uni-border { + border: 1px $uni-border-1 solid; +} \ No newline at end of file diff --git a/uni_modules/uni-scss/styles/setting/_color.scss b/uni_modules/uni-scss/styles/setting/_color.scss new file mode 100644 index 0000000..1ededd9 --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_color.scss @@ -0,0 +1,66 @@ + +// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐 +// @mixin get-styles($k,$c) { +// @if $k == size or $k == weight{ +// font-#{$k}:#{$c} +// }@else{ +// #{$k}:#{$c} +// } +// } +$uni-ui-color:( + // 主色 + primary: $uni-primary, + primary-disable: $uni-primary-disable, + primary-light: $uni-primary-light, + // 辅助色 + success: $uni-success, + success-disable: $uni-success-disable, + success-light: $uni-success-light, + warning: $uni-warning, + warning-disable: $uni-warning-disable, + warning-light: $uni-warning-light, + error: $uni-error, + error-disable: $uni-error-disable, + error-light: $uni-error-light, + info: $uni-info, + info-disable: $uni-info-disable, + info-light: $uni-info-light, + // 中性色 + main-color: $uni-main-color, + base-color: $uni-base-color, + secondary-color: $uni-secondary-color, + extra-color: $uni-extra-color, + // 背景色 + bg-color: $uni-bg-color, + // 边框颜色 + border-1: $uni-border-1, + border-2: $uni-border-2, + border-3: $uni-border-3, + border-4: $uni-border-4, + // 黑色 + black:$uni-black, + // 白色 + white:$uni-white, + // 透明 + transparent:$uni-transparent +) !default; +@each $key, $child in $uni-ui-color { + .uni-#{"" + $key} { + color: $child; + } + .uni-#{"" + $key}-bg { + background-color: $child; + } +} +.uni-shadow-sm { + box-shadow: $uni-shadow-sm; +} +.uni-shadow-base { + box-shadow: $uni-shadow-base; +} +.uni-shadow-lg { + box-shadow: $uni-shadow-lg; +} +.uni-mask { + background-color:$uni-mask; +} diff --git a/uni_modules/uni-scss/styles/setting/_radius.scss b/uni_modules/uni-scss/styles/setting/_radius.scss new file mode 100644 index 0000000..9a0428b --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_radius.scss @@ -0,0 +1,55 @@ +@mixin radius($r,$d:null ,$important: false){ + $radius-value:map-get($uni-radius, $r) if($important, !important, null); + // Key exists within the $uni-radius variable + @if (map-has-key($uni-radius, $r) and $d){ + @if $d == t { + border-top-left-radius:$radius-value; + border-top-right-radius:$radius-value; + }@else if $d == r { + border-top-right-radius:$radius-value; + border-bottom-right-radius:$radius-value; + }@else if $d == b { + border-bottom-left-radius:$radius-value; + border-bottom-right-radius:$radius-value; + }@else if $d == l { + border-top-left-radius:$radius-value; + border-bottom-left-radius:$radius-value; + }@else if $d == tl { + border-top-left-radius:$radius-value; + }@else if $d == tr { + border-top-right-radius:$radius-value; + }@else if $d == br { + border-bottom-right-radius:$radius-value; + }@else if $d == bl { + border-bottom-left-radius:$radius-value; + } + }@else{ + border-radius:$radius-value; + } +} + +@each $key, $child in $uni-radius { + @if($key){ + .uni-radius-#{"" + $key} { + @include radius($key) + } + }@else{ + .uni-radius { + @include radius($key) + } + } +} + +@each $direction in t, r, b, l,tl, tr, br, bl { + @each $key, $child in $uni-radius { + @if($key){ + .uni-radius-#{"" + $direction}-#{"" + $key} { + @include radius($key,$direction,false) + } + }@else{ + .uni-radius-#{$direction} { + @include radius($key,$direction,false) + } + } + } +} diff --git a/uni_modules/uni-scss/styles/setting/_space.scss b/uni_modules/uni-scss/styles/setting/_space.scss new file mode 100644 index 0000000..3c89528 --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_space.scss @@ -0,0 +1,56 @@ + +@mixin fn($space,$direction,$size,$n) { + @if $n { + #{$space}-#{$direction}: #{$size*$uni-space-root}px + } @else { + #{$space}-#{$direction}: #{-$size*$uni-space-root}px + } +} +@mixin get-styles($direction,$i,$space,$n){ + @if $direction == t { + @include fn($space, top,$i,$n); + } + @if $direction == r { + @include fn($space, right,$i,$n); + } + @if $direction == b { + @include fn($space, bottom,$i,$n); + } + @if $direction == l { + @include fn($space, left,$i,$n); + } + @if $direction == x { + @include fn($space, left,$i,$n); + @include fn($space, right,$i,$n); + } + @if $direction == y { + @include fn($space, top,$i,$n); + @include fn($space, bottom,$i,$n); + } + @if $direction == a { + @if $n { + #{$space}:#{$i*$uni-space-root}px; + } @else { + #{$space}:#{-$i*$uni-space-root}px; + } + } +} + +@each $orientation in m,p { + $space: margin; + @if $orientation == m { + $space: margin; + } @else { + $space: padding; + } + @for $i from 0 through 16 { + @each $direction in t, r, b, l, x, y, a { + .uni-#{$orientation}#{$direction}-#{$i} { + @include get-styles($direction,$i,$space,true); + } + .uni-#{$orientation}#{$direction}-n#{$i} { + @include get-styles($direction,$i,$space,false); + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-scss/styles/setting/_styles.scss b/uni_modules/uni-scss/styles/setting/_styles.scss new file mode 100644 index 0000000..689afec --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_styles.scss @@ -0,0 +1,167 @@ +/* #ifndef APP-NVUE */ + +$-color-white:#fff; +$-color-black:#000; +@mixin base-style($color) { + color: #fff; + background-color: $color; + border-color: mix($-color-black, $color, 8%); + &:not([hover-class]):active { + background: mix($-color-black, $color, 10%); + border-color: mix($-color-black, $color, 20%); + color: $-color-white; + outline: none; + } +} +@mixin is-color($color) { + @include base-style($color); + &[loading] { + @include base-style($color); + &::before { + margin-right:5px; + } + } + &[disabled] { + &, + &[loading], + &:not([hover-class]):active { + color: $-color-white; + border-color: mix(darken($color,10%), $-color-white); + background-color: mix($color, $-color-white); + } + } + +} +@mixin base-plain-style($color) { + color:$color; + background-color: mix($-color-white, $color, 90%); + border-color: mix($-color-white, $color, 70%); + &:not([hover-class]):active { + background: mix($-color-white, $color, 80%); + color: $color; + outline: none; + border-color: mix($-color-white, $color, 50%); + } +} +@mixin is-plain($color){ + &[plain] { + @include base-plain-style($color); + &[loading] { + @include base-plain-style($color); + &::before { + margin-right:5px; + } + } + &[disabled] { + &, + &:active { + color: mix($-color-white, $color, 40%); + background-color: mix($-color-white, $color, 90%); + border-color: mix($-color-white, $color, 80%); + } + } + } +} + + +.uni-btn { + margin: 5px; + color: #393939; + border:1px solid #ccc; + font-size: 16px; + font-weight: 200; + background-color: #F9F9F9; + // TODO 暂时处理边框隐藏一边的问题 + overflow: visible; + &::after{ + border: none; + } + + &:not([type]),&[type=default] { + color: #999; + &[loading] { + background: none; + &::before { + margin-right:5px; + } + } + + + + &[disabled]{ + color: mix($-color-white, #999, 60%); + &, + &[loading], + &:active { + color: mix($-color-white, #999, 60%); + background-color: mix($-color-white,$-color-black , 98%); + border-color: mix($-color-white, #999, 85%); + } + } + + &[plain] { + color: #999; + background: none; + border-color: $uni-border-1; + &:not([hover-class]):active { + background: none; + color: mix($-color-white, $-color-black, 80%); + border-color: mix($-color-white, $-color-black, 90%); + outline: none; + } + &[disabled]{ + &, + &[loading], + &:active { + background: none; + color: mix($-color-white, #999, 60%); + border-color: mix($-color-white, #999, 85%); + } + } + } + } + + &:not([hover-class]):active { + color: mix($-color-white, $-color-black, 50%); + } + + &[size=mini] { + font-size: 16px; + font-weight: 200; + border-radius: 8px; + } + + + + &.uni-btn-small { + font-size: 14px; + } + &.uni-btn-mini { + font-size: 12px; + } + + &.uni-btn-radius { + border-radius: 999px; + } + &[type=primary] { + @include is-color($uni-primary); + @include is-plain($uni-primary) + } + &[type=success] { + @include is-color($uni-success); + @include is-plain($uni-success) + } + &[type=error] { + @include is-color($uni-error); + @include is-plain($uni-error) + } + &[type=warning] { + @include is-color($uni-warning); + @include is-plain($uni-warning) + } + &[type=info] { + @include is-color($uni-info); + @include is-plain($uni-info) + } +} +/* #endif */ diff --git a/uni_modules/uni-scss/styles/setting/_text.scss b/uni_modules/uni-scss/styles/setting/_text.scss new file mode 100644 index 0000000..a34d08f --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_text.scss @@ -0,0 +1,24 @@ +@mixin get-styles($k,$c) { + @if $k == size or $k == weight{ + font-#{$k}:#{$c} + }@else{ + #{$k}:#{$c} + } +} + +@each $key, $child in $uni-headings { + /* #ifndef APP-NVUE */ + .uni-#{$key} { + @each $k, $c in $child { + @include get-styles($k,$c) + } + } + /* #endif */ + /* #ifdef APP-NVUE */ + .container .uni-#{$key} { + @each $k, $c in $child { + @include get-styles($k,$c) + } + } + /* #endif */ +} diff --git a/uni_modules/uni-scss/styles/setting/_variables.scss b/uni_modules/uni-scss/styles/setting/_variables.scss new file mode 100644 index 0000000..557d3d7 --- /dev/null +++ b/uni_modules/uni-scss/styles/setting/_variables.scss @@ -0,0 +1,146 @@ +// @use "sass:math"; +@import '../tools/functions.scss'; +// 间距基础倍数 +$uni-space-root: 2 !default; +// 边框半径默认值 +$uni-radius-root:5px !default; +$uni-radius: () !default; +// 边框半径断点 +$uni-radius: map-deep-merge( + ( + 0: 0, + // TODO 当前版本暂时不支持 sm 属性 + // 'sm': math.div($uni-radius-root, 2), + null: $uni-radius-root, + 'lg': $uni-radius-root * 2, + 'xl': $uni-radius-root * 6, + 'pill': 9999px, + 'circle': 50% + ), + $uni-radius +); +// 字体家族 +$body-font-family: 'Roboto', sans-serif !default; +// 文本 +$heading-font-family: $body-font-family !default; +$uni-headings: () !default; +$letterSpacing: -0.01562em; +$uni-headings: map-deep-merge( + ( + 'h1': ( + size: 32px, + weight: 300, + line-height: 50px, + // letter-spacing:-0.01562em + ), + 'h2': ( + size: 28px, + weight: 300, + line-height: 40px, + // letter-spacing: -0.00833em + ), + 'h3': ( + size: 24px, + weight: 400, + line-height: 32px, + // letter-spacing: normal + ), + 'h4': ( + size: 20px, + weight: 400, + line-height: 30px, + // letter-spacing: 0.00735em + ), + 'h5': ( + size: 16px, + weight: 400, + line-height: 24px, + // letter-spacing: normal + ), + 'h6': ( + size: 14px, + weight: 500, + line-height: 18px, + // letter-spacing: 0.0125em + ), + 'subtitle': ( + size: 12px, + weight: 400, + line-height: 20px, + // letter-spacing: 0.00937em + ), + 'body': ( + font-size: 14px, + font-weight: 400, + line-height: 22px, + // letter-spacing: 0.03125em + ), + 'caption': ( + 'size': 12px, + 'weight': 400, + 'line-height': 20px, + // 'letter-spacing': 0.03333em, + // 'text-transform': false + ) + ), + $uni-headings +); + + + +// 主色 +$uni-primary: #2979ff !default; +$uni-primary-disable:lighten($uni-primary,20%) !default; +$uni-primary-light: lighten($uni-primary,25%) !default; + +// 辅助色 +// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。 +$uni-success: #18bc37 !default; +$uni-success-disable:lighten($uni-success,20%) !default; +$uni-success-light: lighten($uni-success,25%) !default; + +$uni-warning: #f3a73f !default; +$uni-warning-disable:lighten($uni-warning,20%) !default; +$uni-warning-light: lighten($uni-warning,25%) !default; + +$uni-error: #e43d33 !default; +$uni-error-disable:lighten($uni-error,20%) !default; +$uni-error-light: lighten($uni-error,25%) !default; + +$uni-info: #8f939c !default; +$uni-info-disable:lighten($uni-info,20%) !default; +$uni-info-light: lighten($uni-info,25%) !default; + +// 中性色 +// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。 +$uni-main-color: #3a3a3a !default; // 主要文字 +$uni-base-color: #6a6a6a !default; // 常规文字 +$uni-secondary-color: #909399 !default; // 次要文字 +$uni-extra-color: #c7c7c7 !default; // 辅助说明 + +// 边框颜色 +$uni-border-1: #F0F0F0 !default; +$uni-border-2: #EDEDED !default; +$uni-border-3: #DCDCDC !default; +$uni-border-4: #B9B9B9 !default; + +// 常规色 +$uni-black: #000000 !default; +$uni-white: #ffffff !default; +$uni-transparent: rgba($color: #000000, $alpha: 0) !default; + +// 背景色 +$uni-bg-color: #f7f7f7 !default; + +/* 水平间距 */ +$uni-spacing-sm: 8px !default; +$uni-spacing-base: 15px !default; +$uni-spacing-lg: 30px !default; + +// 阴影 +$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default; +$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default; +$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default; + +// 蒙版 +$uni-mask: rgba($color: #000000, $alpha: 0.4) !default; diff --git a/uni_modules/uni-scss/styles/tools/functions.scss b/uni_modules/uni-scss/styles/tools/functions.scss new file mode 100644 index 0000000..ac6f63e --- /dev/null +++ b/uni_modules/uni-scss/styles/tools/functions.scss @@ -0,0 +1,19 @@ +// 合并 map +@function map-deep-merge($parent-map, $child-map){ + $result: $parent-map; + @each $key, $child in $child-map { + $parent-has-key: map-has-key($result, $key); + $parent-value: map-get($result, $key); + $parent-type: type-of($parent-value); + $child-type: type-of($child); + $parent-is-map: $parent-type == map; + $child-is-map: $child-type == map; + + @if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){ + $result: map-merge($result, ( $key: $child )); + }@else { + $result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) )); + } + } + @return $result; +}; diff --git a/uni_modules/uni-scss/theme.scss b/uni_modules/uni-scss/theme.scss new file mode 100644 index 0000000..80ee62f --- /dev/null +++ b/uni_modules/uni-scss/theme.scss @@ -0,0 +1,31 @@ +// 间距基础倍数 +$uni-space-root: 2; +// 边框半径默认值 +$uni-radius-root:5px; +// 主色 +$uni-primary: #2979ff; +// 辅助色 +$uni-success: #4cd964; +// 警告色 +$uni-warning: #f0ad4e; +// 错误色 +$uni-error: #dd524d; +// 描述色 +$uni-info: #909399; +// 中性色 +$uni-main-color: #303133; +$uni-base-color: #606266; +$uni-secondary-color: #909399; +$uni-extra-color: #C0C4CC; +// 背景色 +$uni-bg-color: #f5f5f5; +// 边框颜色 +$uni-border-1: #DCDFE6; +$uni-border-2: #E4E7ED; +$uni-border-3: #EBEEF5; +$uni-border-4: #F2F6FC; + +// 常规色 +$uni-black: #000000; +$uni-white: #ffffff; +$uni-transparent: rgba($color: #000000, $alpha: 0); diff --git a/uni_modules/uni-scss/variables.scss b/uni_modules/uni-scss/variables.scss new file mode 100644 index 0000000..1c062d4 --- /dev/null +++ b/uni_modules/uni-scss/variables.scss @@ -0,0 +1,62 @@ +@import './styles/setting/_variables.scss'; +// 间距基础倍数 +$uni-space-root: 2; +// 边框半径默认值 +$uni-radius-root:5px; + +// 主色 +$uni-primary: #2979ff; +$uni-primary-disable:mix(#fff,$uni-primary,50%); +$uni-primary-light: mix(#fff,$uni-primary,80%); + +// 辅助色 +// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。 +$uni-success: #18bc37; +$uni-success-disable:mix(#fff,$uni-success,50%); +$uni-success-light: mix(#fff,$uni-success,80%); + +$uni-warning: #f3a73f; +$uni-warning-disable:mix(#fff,$uni-warning,50%); +$uni-warning-light: mix(#fff,$uni-warning,80%); + +$uni-error: #e43d33; +$uni-error-disable:mix(#fff,$uni-error,50%); +$uni-error-light: mix(#fff,$uni-error,80%); + +$uni-info: #8f939c; +$uni-info-disable:mix(#fff,$uni-info,50%); +$uni-info-light: mix(#fff,$uni-info,80%); + +// 中性色 +// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。 +$uni-main-color: #3a3a3a; // 主要文字 +$uni-base-color: #6a6a6a; // 常规文字 +$uni-secondary-color: #909399; // 次要文字 +$uni-extra-color: #c7c7c7; // 辅助说明 + +// 边框颜色 +$uni-border-1: #F0F0F0; +$uni-border-2: #EDEDED; +$uni-border-3: #DCDCDC; +$uni-border-4: #B9B9B9; + +// 常规色 +$uni-black: #000000; +$uni-white: #ffffff; +$uni-transparent: rgba($color: #000000, $alpha: 0); + +// 背景色 +$uni-bg-color: #f7f7f7; + +/* 水平间距 */ +$uni-spacing-sm: 8px; +$uni-spacing-base: 15px; +$uni-spacing-lg: 30px; + +// 阴影 +$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5); +$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2); +$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5); + +// 蒙版 +$uni-mask: rgba($color: #000000, $alpha: 0.4); diff --git a/uni_modules/uni-transition/changelog.md b/uni_modules/uni-transition/changelog.md new file mode 100644 index 0000000..70c1cd4 --- /dev/null +++ b/uni_modules/uni-transition/changelog.md @@ -0,0 +1,22 @@ +## 1.3.2(2023-05-04) +- 修复 NVUE 平台报错的问题 +## 1.3.1(2021-11-23) +- 修复 init 方法初始化问题 +## 1.3.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-transition](https://uniapp.dcloud.io/component/uniui/uni-transition) +## 1.2.1(2021-09-27) +- 修复 init 方法不生效的 Bug +## 1.2.0(2021-07-30) +- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.1(2021-05-12) +- 新增 示例地址 +- 修复 示例项目缺少组件的 Bug +## 1.1.0(2021-04-22) +- 新增 通过方法自定义动画 +- 新增 custom-class 非 NVUE 平台支持自定义 class 定制样式 +- 优化 动画触发逻辑,使动画更流畅 +- 优化 支持单独的动画类型 +- 优化 文档示例 +## 1.0.2(2021-02-05) +- 调整为 uni_modules 目录规范 diff --git a/uni_modules/uni-transition/components/uni-transition/createAnimation.js b/uni_modules/uni-transition/components/uni-transition/createAnimation.js new file mode 100644 index 0000000..8f89b18 --- /dev/null +++ b/uni_modules/uni-transition/components/uni-transition/createAnimation.js @@ -0,0 +1,131 @@ +// const defaultOption = { +// duration: 300, +// timingFunction: 'linear', +// delay: 0, +// transformOrigin: '50% 50% 0' +// } +// #ifdef APP-NVUE +const nvueAnimation = uni.requireNativePlugin('animation') +// #endif +class MPAnimation { + constructor(options, _this) { + this.options = options + // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误 + this.animation = uni.createAnimation({ + ...options + }) + this.currentStepAnimates = {} + this.next = 0 + this.$ = _this + + } + + _nvuePushAnimates(type, args) { + let aniObj = this.currentStepAnimates[this.next] + let styles = {} + if (!aniObj) { + styles = { + styles: {}, + config: {} + } + } else { + styles = aniObj + } + if (animateTypes1.includes(type)) { + if (!styles.styles.transform) { + styles.styles.transform = '' + } + let unit = '' + if(type === 'rotate'){ + unit = 'deg' + } + styles.styles.transform += `${type}(${args+unit}) ` + } else { + styles.styles[type] = `${args}` + } + this.currentStepAnimates[this.next] = styles + } + _animateRun(styles = {}, config = {}) { + let ref = this.$.$refs['ani'].ref + if (!ref) return + return new Promise((resolve, reject) => { + nvueAnimation.transition(ref, { + styles, + ...config + }, res => { + resolve() + }) + }) + } + + _nvueNextAnimate(animates, step = 0, fn) { + let obj = animates[step] + if (obj) { + let { + styles, + config + } = obj + this._animateRun(styles, config).then(() => { + step += 1 + this._nvueNextAnimate(animates, step, fn) + }) + } else { + this.currentStepAnimates = {} + typeof fn === 'function' && fn() + this.isEnd = true + } + } + + step(config = {}) { + // #ifndef APP-NVUE + this.animation.step(config) + // #endif + // #ifdef APP-NVUE + this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config) + this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin + this.next++ + // #endif + return this + } + + run(fn) { + // #ifndef APP-NVUE + this.$.animationData = this.animation.export() + this.$.timer = setTimeout(() => { + typeof fn === 'function' && fn() + }, this.$.durationTime) + // #endif + // #ifdef APP-NVUE + this.isEnd = false + let ref = this.$.$refs['ani'] && this.$.$refs['ani'].ref + if(!ref) return + this._nvueNextAnimate(this.currentStepAnimates, 0, fn) + this.next = 0 + // #endif + } +} + + +const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', + 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', + 'translateZ' +] +const animateTypes2 = ['opacity', 'backgroundColor'] +const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'] +animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => { + MPAnimation.prototype[type] = function(...args) { + // #ifndef APP-NVUE + this.animation[type](...args) + // #endif + // #ifdef APP-NVUE + this._nvuePushAnimates(type, args) + // #endif + return this + } +}) + +export function createAnimation(option, _this) { + if(!_this) return + clearTimeout(_this.timer) + return new MPAnimation(option, _this) +} diff --git a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue new file mode 100644 index 0000000..bfbba93 --- /dev/null +++ b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue @@ -0,0 +1,286 @@ + + + + + diff --git a/uni_modules/uni-transition/package.json b/uni_modules/uni-transition/package.json new file mode 100644 index 0000000..ea995a2 --- /dev/null +++ b/uni_modules/uni-transition/package.json @@ -0,0 +1,84 @@ +{ + "id": "uni-transition", + "displayName": "uni-transition 过渡动画", + "version": "1.3.2", + "description": "元素的简单过渡动画", + "keywords": [ + "uni-ui", + "uniui", + "动画", + "过渡", + "过渡动画" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-transition/readme.md b/uni_modules/uni-transition/readme.md new file mode 100644 index 0000000..2f8a77e --- /dev/null +++ b/uni_modules/uni-transition/readme.md @@ -0,0 +1,11 @@ + + +## Transition 过渡动画 +> **组件名:uni-transition** +> 代码块: `uTransition` + + +元素过渡动画 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-transition) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/v-sign/changelog.md b/uni_modules/v-sign/changelog.md new file mode 100644 index 0000000..17deb52 --- /dev/null +++ b/uni_modules/v-sign/changelog.md @@ -0,0 +1,48 @@ +## 0.5.2(2022-06-10) +- canvas 默认设置 disable-scroll 属性为true, 当在 canvas 中移动时且有绑定手势事件时,禁止屏幕滚动以及下拉刷新 +## 0.5.1(2022-05-27) +- 取消属性 width, height 默认值 +## 0.5.0(2022-05-27) +- 新增 v-sgin 组件获取坐标信息数组方法 `getLineData` +- 新增 v-sign 组件事件触发 @clear, @revoke, @end +- 修复撤销操作重设背景色导致线条消失问题 +## 0.4.0(2022-05-15) +- 新增属性 bgColor 设置画布背景色,修复导出图片无背景色问题 +## 0.3.4(2022-03-30) +修复 v-sign-action 子组件 svg 加载报错 +## 0.3.3(2022-03-30) +修复 v-sign-action 子组件 svg 加载报错 +## 0.3.2(2022-01-12) +- 修复多组件共存绘制问题 +## 0.3.1(2021-12-14) +- 【新增】保存 png 图片方法 saveImage; +- 【修改】 控件子组件保存按钮动作由保存为临时文件路径改为保存图片 +## 0.3.0(2021-12-11) +- 添加颜色选择器组件 +## 0.2.0(2021-12-10) +- 修改为 uni_modules 规范 +## 0.1.7 (2021-12-09) + +- 画笔组件优化 + +## 0.1.6 (2021-12-08) + +- 画笔样式优化 + +## 0.1.5 (2021-12-08) + +- 画笔子组件样式修改,支持circle、line 两种样式 + +## 0.1.4 (2021-12-08) + +- 添加画笔子组件 + +## 0.1.3 (2021-12-02) + +- 添加按钮控件子组件 + +## 0.1.0 (2021-11-28) + +- 支持线宽、颜色自定义,自定义画布样式 +- 支持画布清空、撤回、保存图片 +- 事件 init 暴露清空、撤回、保存图片方法 \ No newline at end of file diff --git a/uni_modules/v-sign/components/v-sign-action/v-sign-action.vue b/uni_modules/v-sign/components/v-sign-action/v-sign-action.vue new file mode 100644 index 0000000..e8760d2 --- /dev/null +++ b/uni_modules/v-sign/components/v-sign-action/v-sign-action.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/uni_modules/v-sign/components/v-sign-color/v-sign-color.vue b/uni_modules/v-sign/components/v-sign-color/v-sign-color.vue new file mode 100644 index 0000000..f335349 --- /dev/null +++ b/uni_modules/v-sign/components/v-sign-color/v-sign-color.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/uni_modules/v-sign/components/v-sign-pen/v-sign-pen.vue b/uni_modules/v-sign/components/v-sign-pen/v-sign-pen.vue new file mode 100644 index 0000000..41786a3 --- /dev/null +++ b/uni_modules/v-sign/components/v-sign-pen/v-sign-pen.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/uni_modules/v-sign/components/v-sign/v-sign.vue b/uni_modules/v-sign/components/v-sign/v-sign.vue new file mode 100644 index 0000000..0d2d529 --- /dev/null +++ b/uni_modules/v-sign/components/v-sign/v-sign.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/uni_modules/v-sign/package.json b/uni_modules/v-sign/package.json new file mode 100644 index 0000000..18e537c --- /dev/null +++ b/uni_modules/v-sign/package.json @@ -0,0 +1,84 @@ +{ + "id": "v-sign", + "displayName": "canvas 手写 签名 签字 画板组件", + "version": "0.5.2", + "description": "基于 canvas 实现;1. 支持线条自定义样式;2. 支持撤回、清空、导出图片等功能;3. 内置按钮、画笔等子组件。", + "keywords": [ + "canvas", + "签名", + "签字", + "电子签名", + "signature" +], + "repository": "https://github.com/jizai1125/v-sign", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "n" + }, + "App": { + "app-vue": "u", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/v-sign/readme.md b/uni_modules/v-sign/readme.md new file mode 100644 index 0000000..696e33d --- /dev/null +++ b/uni_modules/v-sign/readme.md @@ -0,0 +1,245 @@ +# v-sign 手写签名 + +**如有问题或者建议,欢迎留言或加群联系我(群号:736123963)!!!将保持维护!!!** + +uniapp 交流群群聊二维码 + +## 快速使用 + +基础示例,具体说明见下方 API,**若需要使用内置子组件,见下方子组件说明。** + +```html + + +``` + +## API + +### 属性 (Props) + +| 属性名 | 类型 | 默认值 | 说明 | +| :---------: | :-----------: | :-----------: | :--------------------------: | +| cid | String | v-sign-时间戳 | canvas id | +| width | String/Number | - | canvas 宽度,Number 单位 rpx | +| height | String/Number | - | canvas 高度,Number 单位 rpx | +| customStyle | Object | - | canvas 自定义样式 | +| lineWidth | Number | 4 | 线宽,单位 px | +| lineColor | String | #333 | 线颜色 | +| bgColor | String | #fff | 画布背景颜色 | + +### 事件(Events) + +| 事件称名 | 说明 | 返回值 | +| :------: | :------------------------------------------------------------: | :--------------------------------: | +| @init | 创建完 canvas 实例后触发,向外提供 canvas 实例,撤回,清空方法 | Object:具体见下方事件回调参数说明 | +| @clear | 清空画布后触发 | - | +| @revoke | 撤销操作后触发 | 坐标信息数组 | +| @end | 每次绘制结束后触发 | 坐标信息数组 | + +### 事件回调参数说明 + +#### **`init(ctx: SignContext)`** + +可以通过该事件回调暴露的 clear、revoke 等方法操作画布。 + +```java +interface SignContext { + // canvas 实例 + ctx: object; + // 清空画布 + clear(): void; + // 撤回 + revoke(): void; + // 保存 png 图片,文件名 filename 配置仅支持 h5 + saveImage(filename: string): Promise; + // 返回图片临时文件路径,config 参数同 uni.canvasToTempFilePath方法,内部只是做了 Promise 化处理而已 + canvasToTempFilePath(config: object): Promise; + // 设置画布背景色 + setBackgroundColor(color: string): void; + setLineWidth(value: number): void; + setLineColor(value: string): void; + // 获取坐标信息数组 + getLineData(): Array; +} +``` + +示例: + +```html + + +``` + +# 子组件 + +子组件需要包裹在 `v-sign` 组件内使用!!! + +## 按钮控件(v-sign-action) + +### 示例 + +```html + + +``` + +### API + +### 属性 (Props) + +| 属性名 | 类型 | 默认值 | 说明 | +| :---------: | :-----------: | :-----------------------: | :----------------------------------------------------: | +| actions | Array | ["clear", "prev", "save"] | 按钮配置;清空(clear), 撤回(prev) 保存图片(save) | +| border | Boolean | true | 按钮是否有边框 | +| space | String/Number | 12 | 按钮间隔,Number 单位 rpx | +| customStyle | Object | - | 根元素自定义样式 | + +### 事件(Events) + +点击对应类型按钮触发对应事件, 例如:配置了清空(clear)按钮,点击则触发 clear 事件。 + +--- + +## 画笔组件(v-sign-pen) + +### 示例 + +```html + + +``` + +### API + +### 属性 (Props) + +| 属性名 | 类型 | 默认值 | 说明 | +| :---------: | :-----: | :--------------: | :--------------------------: | +| type | String | circle | 选项样式,可选 circle \ line | +| label | String | - | 标签 | +| sizes | Array | [2, 4, 6, 8, 10] | 画笔尺寸数组,单位 px | +| color | String | #333 | 选项颜色 | +| activeColor | String | #333 | 选中项颜色 | +| border | Boolean | true | 选中项是否有边框 | +| borderWidth | Number | 4 | 边框大小,单位 rpx | +| space | Number | 20 | 选项间隙,单位 rpx | +| bigger | Number | 2 | 圆点变大变粗倍数 | +| minSize | Number | 4 | 圆点最小尺寸,单位 px | + +### 事件(Events) + +| 事件称名 | 说明 | 返回值 | +| :------: | :----------------: | :----------------: | +| @change | 选择画笔大小时触发 | size:画笔尺寸大小 | + +--- + +## 颜色选择器组件(v-sign-color) + +### 示例 + +```html + + +``` + +### API + +### 属性 (Props) + +| 属性名 | 类型 | 默认值 | 说明 | +| :---------: | :-----------: | :-------------------------------------------------------------: | :-------------------: | +| type | String | square | 选项样式,可选 circle | +| color | String | - | 默认颜色 | +| options | Array | ['#333', '#f44236', '#3f51b5', '#2195f3', '#ffeb3b', '#ff9900'] | 备选色 | +| size | Number/String | 44 | 圆/方形大小,单位 rpx | +| tick | Boolean | true | 是否选中打勾 | +| tickSize | Number/String | 24 | 勾大小 | +| borderColor | String | #fff | 边框颜色 | +| border | Boolean | false | 是否有边框 | +| space | Number/String | 16 | 选项间隙 | + +### 事件(Events) + +| 事件称名 | 说明 | 返回值 | +| :------: | :------------: | :----: | +| @change | 选择颜色时触发 | color | diff --git a/uni_modules/v-sign/static/image/clear.png b/uni_modules/v-sign/static/image/clear.png new file mode 100644 index 0000000..032e7aa Binary files /dev/null and b/uni_modules/v-sign/static/image/clear.png differ diff --git a/uni_modules/v-sign/static/image/clear.svg b/uni_modules/v-sign/static/image/clear.svg new file mode 100644 index 0000000..0285fbe --- /dev/null +++ b/uni_modules/v-sign/static/image/clear.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uni_modules/v-sign/static/image/next.png b/uni_modules/v-sign/static/image/next.png new file mode 100644 index 0000000..20cbf6c Binary files /dev/null and b/uni_modules/v-sign/static/image/next.png differ diff --git a/uni_modules/v-sign/static/image/next.svg b/uni_modules/v-sign/static/image/next.svg new file mode 100644 index 0000000..36e2445 --- /dev/null +++ b/uni_modules/v-sign/static/image/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uni_modules/v-sign/static/image/prev.png b/uni_modules/v-sign/static/image/prev.png new file mode 100644 index 0000000..e81d3b9 Binary files /dev/null and b/uni_modules/v-sign/static/image/prev.png differ diff --git a/uni_modules/v-sign/static/image/prev.svg b/uni_modules/v-sign/static/image/prev.svg new file mode 100644 index 0000000..5a67586 --- /dev/null +++ b/uni_modules/v-sign/static/image/prev.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uni_modules/v-sign/static/image/save.png b/uni_modules/v-sign/static/image/save.png new file mode 100644 index 0000000..5269210 Binary files /dev/null and b/uni_modules/v-sign/static/image/save.png differ diff --git a/uni_modules/v-sign/static/image/save.svg b/uni_modules/v-sign/static/image/save.svg new file mode 100644 index 0000000..e97dcf7 --- /dev/null +++ b/uni_modules/v-sign/static/image/save.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uni_modules/v-sign/utils/index.js b/uni_modules/v-sign/utils/index.js new file mode 100644 index 0000000..270dcf7 --- /dev/null +++ b/uni_modules/v-sign/utils/index.js @@ -0,0 +1,15 @@ +/** + * 判断是否未数值 + * @param {Object} val + */ +export function isNumber(val) { + return !isNaN(Number(val)) +} + +/** + * 处理大小单位 + * @param {Object} val + */ +export function formatSize(val, unit = 'rpx') { + return isNumber(val) ? `${val}${unit}` : val +} diff --git a/user/pages/address/edit.vue b/user/pages/address/edit.vue new file mode 100644 index 0000000..423d8e4 --- /dev/null +++ b/user/pages/address/edit.vue @@ -0,0 +1,305 @@ + + + + + + diff --git a/user/pages/address/list.vue b/user/pages/address/list.vue new file mode 100644 index 0000000..a2be3be --- /dev/null +++ b/user/pages/address/list.vue @@ -0,0 +1,252 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/alipay-account.vue b/user/pages/alipay-account.vue new file mode 100644 index 0000000..335c522 --- /dev/null +++ b/user/pages/alipay-account.vue @@ -0,0 +1,188 @@ + + + + + + diff --git a/user/pages/alipay-result.vue b/user/pages/alipay-result.vue new file mode 100644 index 0000000..9a07735 --- /dev/null +++ b/user/pages/alipay-result.vue @@ -0,0 +1,221 @@ + + + + + diff --git a/user/pages/app-download.vue b/user/pages/app-download.vue new file mode 100644 index 0000000..bc56f3c --- /dev/null +++ b/user/pages/app-download.vue @@ -0,0 +1,131 @@ + + + + + + diff --git a/user/pages/apply-result.vue b/user/pages/apply-result.vue new file mode 100644 index 0000000..398d508 --- /dev/null +++ b/user/pages/apply-result.vue @@ -0,0 +1,227 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/article.vue b/user/pages/article.vue new file mode 100644 index 0000000..edb4aa4 --- /dev/null +++ b/user/pages/article.vue @@ -0,0 +1,219 @@ + + + + + + diff --git a/user/pages/bell/list.vue b/user/pages/bell/list.vue new file mode 100644 index 0000000..67fa932 --- /dev/null +++ b/user/pages/bell/list.vue @@ -0,0 +1,610 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/bell/order.vue b/user/pages/bell/order.vue new file mode 100644 index 0000000..10066d6 --- /dev/null +++ b/user/pages/bell/order.vue @@ -0,0 +1,461 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/cash-out.vue b/user/pages/cash-out.vue new file mode 100644 index 0000000..b05e268 --- /dev/null +++ b/user/pages/cash-out.vue @@ -0,0 +1,301 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/channel/apply.vue b/user/pages/channel/apply.vue new file mode 100644 index 0000000..87e6d29 --- /dev/null +++ b/user/pages/channel/apply.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/user/pages/feedback/detail.vue b/user/pages/feedback/detail.vue new file mode 100644 index 0000000..557317a --- /dev/null +++ b/user/pages/feedback/detail.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/user/pages/feedback/list.vue b/user/pages/feedback/list.vue new file mode 100644 index 0000000..a9d3dcf --- /dev/null +++ b/user/pages/feedback/list.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/user/pages/feedback/success.vue b/user/pages/feedback/success.vue new file mode 100644 index 0000000..e047c1c --- /dev/null +++ b/user/pages/feedback/success.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/user/pages/gzh.vue b/user/pages/gzh.vue new file mode 100644 index 0000000..ad7900d --- /dev/null +++ b/user/pages/gzh.vue @@ -0,0 +1,124 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/information.vue b/user/pages/information.vue new file mode 100644 index 0000000..59a3544 --- /dev/null +++ b/user/pages/information.vue @@ -0,0 +1,70 @@ + + + + + + diff --git a/user/pages/logout.vue b/user/pages/logout.vue new file mode 100644 index 0000000..0449c9e --- /dev/null +++ b/user/pages/logout.vue @@ -0,0 +1,99 @@ + + + + + + diff --git a/user/pages/merchant-info.vue b/user/pages/merchant-info.vue new file mode 100644 index 0000000..3a9d8d6 --- /dev/null +++ b/user/pages/merchant-info.vue @@ -0,0 +1,109 @@ + + + + + + \ No newline at end of file diff --git a/user/pages/order.vue b/user/pages/order.vue new file mode 100644 index 0000000..50889c6 --- /dev/null +++ b/user/pages/order.vue @@ -0,0 +1,954 @@ + + + + + diff --git a/user/pages/order/refund.vue b/user/pages/order/refund.vue new file mode 100644 index 0000000..03c7125 --- /dev/null +++ b/user/pages/order/refund.vue @@ -0,0 +1,437 @@ +