diff --git a/README.md b/README.md index 02bb36d..1a2bcbb 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,70 @@ yarn build ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). +### 本地电脑window 使用命令行云打包: +cli命令需要配置环境变量:[cli配置环境变量](https://hx.dcloud.net.cn/cli/README) +cli云打包使用: +``` +cli pack --config D:/work_xuan/pda-cli/pack.json +``` + +pack.json内容如下:详情可访问 [CLI uni-app发行 - Android/iOS云打包](https://hx.dcloud.net.cn/cli/pack) 了解更多 + +以下的证书信息是我本地电脑的本地证书:生成证书可参考 [证书生成](https://ask.dcloud.net.cn/article/35777) + +本地使用Android Studio 离线打包教程如下: [Android 打包发行](https://nativesupport.dcloud.net.cn/AppDocs/package/android.html) +``` +{ + //项目名字或项目绝对路径 + "project": "pda", + //打包平台 默认值android 值有"android","ios" 如果要打多个逗号隔开打包平台 + "platform":"android", + //是否使用自定义基座 默认值false true自定义基座 false自定义证书 + "iscustom": false, + //打包方式是否为安心打包默认值false,true安心打包,false传统打包 + "safemode": false, + //android打包参数 + "android": { + //安卓包名 + "packagename":"uni.UNI_F79F300", + //安卓打包类型 默认值0 0 使用自有证书 1 使用公共证书 2 使用老版证书 3 使用云端证书 + "androidpacktype":"0", + //安卓使用自有证书自有打包证书参数 + //安卓打包证书别名,自有证书打包填写的参数 + "certalias":"testalias", + //安卓打包证书文件路径,自有证书打包填写的参数 + "certfile":"C:\\Users\\13597\\test.keystore", + //安卓打包证书密码,自有证书打包填写的参数 + "certpassword":"123456", + //安卓打包证书库密码(HBuilderx4.41支持),自有证书打包填写的参数 + "storePassword": "123456", + //安卓平台要打的渠道包 取值有"google","yyb","360","huawei","xiaomi","oppo","vivo",如果要打多个逗号隔开 + "channels":"" + }, + //ios打包参数 + "ios": { + //ios appid + "bundle":"com.test.ios", + //ios打包支持的设备类型 默认值iPhone 值有"iPhone","iPad" 如果要打多个逗号隔开打包平台 + "supporteddevice":"iPhone,iPad", + //iOS使用自定义证书打包的profile文件路径 + "profile":"", + //iOS使用自定义证书打包的p12文件路径 + "certfile":"", + //iOS使用自定义证书打包的证书密码 + "certpassword":"123" + }, + //是否混淆 true混淆 false关闭 + "isconfusion":false, + //开屏广告 true打开 false关闭 + "splashads":false, + //悬浮红包广告true打开 false关闭 + "rpads":false, + //push广告 true打开 false关闭 + "pushads":false, + //加入换量联盟 true加入 false不加入 + "exchange":false +} +``` +### 云服务器走CICD 打包: +需要下载 [Linux HBuilderX Cli](https://ask.dcloud.net.cn/article/41469) \ No newline at end of file diff --git a/package.json b/package.json index 24d399c..1b49040 100644 --- a/package.json +++ b/package.json @@ -75,14 +75,15 @@ "@dcloudio/uni-quickapp-webview": "^2.0.2-4070520250711001", "@dcloudio/uni-stacktracey": "^2.0.2-4070520250711001", "@dcloudio/uni-stat": "^2.0.2-4070520250711001", + "@icon-park/vue": "^1.3.5", "@vue/shared": "^3.0.0", "core-js": "^3.8.3", - "flyio": "^0.6.2", - "vue": ">= 2.6.14 < 2.7", - "vuex": "^3.2.0", - "@icon-park/vue": "^1.3.5", "dayjs": "^1.11.13", - "vue-i18n": "^8.20.0" + "flyio": "^0.6.2", + "uview-ui": "1.8.8", + "vue": ">= 2.6.14 < 2.7", + "vue-i18n": "^8.20.0", + "vuex": "^3.2.0" }, "devDependencies": { "@dcloudio/types": "^3.3.2", @@ -103,6 +104,8 @@ "cross-env": "^7.0.2", "jest": "^25.4.0", "postcss-comment": "^2.0.0", + "sass": "1.26.2", + "sass-loader": "8.0.2", "vue-template-compiler": ">= 2.6.14 < 2.7" }, "browserslist": [ diff --git a/src/manifest.json b/src/manifest.json index afbda09..1f102da 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -40,6 +40,7 @@ "", "", "", + "", "", "", "", @@ -75,10 +76,10 @@ }, "icons" : { "android" : { - "hdpi" : "static/haotop/image/logo/72.png", - "xhdpi" : "static/haotop/image/logo/96.png", - "xxhdpi" : "static/haotop/image/logo/144.png", - "xxxhdpi" : "static/haotop/image/logo/192.png" + "hdpi" : "dist/dev/app-plus/static/haotop/image/logo/72.png", + "xhdpi" : "dist/dev/app-plus/static/haotop/image/logo/96.png", + "xxhdpi" : "dist/dev/app-plus/static/haotop/image/logo/144.png", + "xxxhdpi" : "dist/dev/app-plus/static/haotop/image/logo/1024.png" }, "ios" : { "appstore" : "", @@ -108,9 +109,9 @@ "splashscreen" : { "androidStyle" : "default", "android" : { - "hdpi" : "static/haotop/image/logo/Start.png", - "xhdpi" : "static/haotop/image/logo/Start.png", - "xxhdpi" : "static/haotop/image/logo/Start.png" + "hdpi" : "dist/dev/app-plus/static/haotop/image/logo/Start.png", + "xhdpi" : "dist/dev/app-plus/static/haotop/image/logo/Start.png", + "xxhdpi" : "dist/dev/app-plus/static/haotop/image/logo/Start.png" } } } diff --git a/src/pages.json b/src/pages.json index 971d04e..f062686 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,6 +1,6 @@ { "easycom": { - "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" }, "pages": [ { @@ -58,7 +58,7 @@ } }, { - "path": "uview-ui/components/u-avatar-cropper/u-avatar-cropper", + "path": "../node_modules/uview-ui/components/u-avatar-cropper/u-avatar-cropper", "style": { "navigationBarTitleText": "头像裁剪", "navigationBarBackgroundColor": "#000000" diff --git a/src/uni.scss b/src/uni.scss index 4e6bb92..4232213 100644 --- a/src/uni.scss +++ b/src/uni.scss @@ -4,7 +4,7 @@ * 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可 * uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用 */ - +@import 'uview-ui/theme.scss'; $u-main-color: #303133; $u-content-color: #505256; $u-tips-color: #909399; @@ -39,3 +39,852 @@ $u-type-info-light: #f4f4f5; $u-form-item-height: 70rpx; $u-form-item-border-color: #dcdfe6; +.uni-tabbar{ + box-shadow: 0px 0px 10px rgba(0,0,0,0.15); +} + +.uni-page-head{ + background: #ffffff!important; +} + .form_right{ + .u-form-item__message{ + text-align: right; + } + .u-input{ + textarea{ + text-align: left!important; + } + } + .uni-input-input{ + text-align: right; + } + } + .yjfk-form-right{ + .uni-input-input{ + text-align: right; + } + } + .input-left-form{ + .input-placeholder{ + text-align: left!important; + } + .uni-input-input{ + text-align: left!important; + } + } + .pages-sys-user-index{ + .uni-page-head{ + background: #5b95ff!important; + color: #ffffff!important; + } + } + .pages-sys-login-index{ + .uni-page-head{ + display: none; + } + .uni-placeholder{ + height: 0!important; + } + } +.home-icon { + width: 48px; + height: 48px; + align-items: center; + border-radius: 6px; + box-sizing: border-box; + display: flex; + justify-content: center; + color:#ffffff; + font-size: 26px; + } + .home-icon i{ + font-size: 26px; + } +.icon-color01{ + background: #ef8e35; + border:1rpx solid #ef8e35; +} +.icon-color02{ + background-image: linear-gradient(0deg, #5a9aec, #84acf7); + border:1rpx solid #6893d5; +} +.icon-color03{ + background-image: linear-gradient(0deg, #5fceb3, #61d2ba); + border:1rpx solid #58c1ab; +} +.icon-color03{ + background-image: linear-gradient(0deg, #58ca93, #58ca93); + border:1rpx solid #58c1ab; +} +.icon-color04{ + background-image: linear-gradient(0deg, #4f77ed, #4f77ed); + border:1rpx solid #4f77ed; +} +.icon-color05{ + background-image: linear-gradient(0deg, #eb516b, #eb516c); + border:1rpx solid #cc4962; +} +.icon-color06{ + background-image: linear-gradient(0deg, #F35643, #F35643); + border:1rpx solid #F35643; +} +.icon-color07{ + background-image: linear-gradient(0deg, #4b86f6, #4b86f6); + border:1rpx solid #4e7fd8; +} +.icon-color08{ + background-image: linear-gradient(0deg, #f2a953, #f2a953); + border:1rpx solid #d2954c; +} +.icon-color09{ + background-image: linear-gradient(-30deg, #3b6eef, #3b6eef); + border:1rpx solid #3663d1; +} +.icon-color10{ + background-image: linear-gradient(0deg, #59bef7, #58bcf6); + border:1rpx solid #4ea6da; +} +.icon-color11{ + background:#ffffff; + border:1rpx solid #ddddde; +} +.icon-color12{ + background-image: linear-gradient(0deg, #FFC60A, #FFC60A); + border:1rpx solid #FFC60A; +} +.icon-color13{ + background:#f5f6f7; + border:1rpx dashed #e1e1e3; +} +.home-icon{ + position: relative; + .u-badge{ + top:-8px!important; + right:-8px!important; + padding:1px 4px!important; + } +} +/* .grid-height270 .u-collapse-body{ + height: 270px!important; +} */ +.u-grid-item-box{ + padding: 0 0 12px!important; +} +.pages-sys-login-code .u-box{ + border: 1px solid #dcdee1!important; +} +/* 首页样式开始 */ +.home-head{ + margin-left: 10px; +} +.home-head img, .home-head uni-image{ + width: 32px!important; + height: 32px!important; +} +.wrap-home .u-slot-right{ + margin-right: 20rpx!important; +} +.wrap-home .list .u-cell-item-box .u-cell_title{ + width: auto!important; + min-width:auto!important ; + color: #202328; +} +.wrap-home .u-navbar:after{ + border-bottom-width: 0px!important; +} +.side-personal-list .u-cell{ + padding: 12px 16px; +} +.side-personal-list .u-cell .u-iconfont{ + font-size: 20px!important; +} +.side-info .u-border-top:after, .side-info .u-border-bottom:after{ + border-bottom-width: 0; + border-top-width: 0; +} + .side-personal-list .u-border-top:after{ + border-bottom-width: 0; + border-top-width: 0; +} +.u-mask-zoom{ + background-color: rgba(0, 0, 0, 0.5)!important; +} +.wrap-home .u-title{ + font-weight: bold!important; + color: #000000!important; +} +.wrap-home .u-cell__value{ + text-align: left!important; +} +/* 首页样式结束 */ +/* 物联中心样式开始 */ +.pages-sys-application-index .u-slot-right{ + margin-right: 20rpx!important; +} +.pages-sys-application-index .u-title{ + font-weight: bold!important; + color: #000000!important; +} +.pages-sys-application-index .u-navbar:after { + border-bottom-width: 0px!important; +} +.apply-topbox{ + background: #ffffff; + padding: 10px 0; +} +.apply-box{ + padding: 10px 0 10px; + position: relative; + .u-image{ + position: absolute; + left: 10px; + } + .u-image .u-image__image{ + border-radius: 50%!important; + border: 1px solid #ededed; + box-shadow:0 3px 3px rgba(#000000, 0.2); + } + .u-size-default{ + padding:2px 5px!important; + margin: 0 10rpx!important; + } + .other-title{ + color: #999999; + } + .u-row{ + padding-left: 10px; + } +} +.Statistics-box{ + padding: 15px; + background: #ffffff; + .title-text{ + color: #000000; + font-size: 32rpx; + text-align: center; + border-bottom: 1px solid #ededed; + padding-bottom: 10px; + margin-bottom: 5px; + } + .other-text{ + color: #666666; + font-size: 28rpx; + text-align: left; + padding: 5px 0; + } + .other-text02{ + color: #9c9c9c; + font-size: 24rpx; + padding: 5px 0; + em{ + font-style: normal; + color: #5473e8; + } + } + .u-active{ + background-image: linear-gradient(90deg, #8271ff, #65cbff); +} +} +/* 物联中心样式结束 */ +/* 套餐详情开始 */ +.details-list-item { + margin:20rpx 0 0!important; + .u-card__body{ + padding: 0!important; + } + .u-body-item{ + padding: 15px!important; + .header-text{ + color: #000000; + font-size: 30rpx; + } + .other-itemtext{ + color: #999999; + font-size: 20rpx; + em{ + font-style: normal; + color: #ff4400; + } + } + } + +} +/* 套餐详情结束 */ +/* 套餐列表开始 */ +.order-list-item { + margin:20rpx 0 0!important; + uni-image{ + width: 130rpx; + height: 130rpx; + margin-right: 10rpx; + } + .u-card__body{ + padding: 0!important; + } + .u-body-item{ + padding: 15px!important; + background: #ffffff; + .u-body-item-title{ + color: #000000; + font-size: 30rpx; + } + .other-itemtext{ + color: #999999; + font-size: 20rpx; + } + .money-itemtext{ + color: #ff4400; + font-size: 20rpx; + em{ + font-style: normal; + color: #ff4400; + font-size: 36rpx; + } + } + } + + +} +/* 套餐列表结束 */ +/* 套餐购买详情 */ +.buy-box{ + padding:0 15px 10px; + background: #ffffff; + .remind-text{ + font-size: 12px; + color: #ff4300; + } + +} +.payment-box{ + background: #ffffff; + + .u-form-item--left .u-icon{ + font-size: 32px; + margin-top: 8px; + } + .uicon-weixin-circle-fill{ + color: #36c956; + } + .uicon-zhifubao-circle-fill{ + color: #06b4fd; + } + .u-form-item{ + padding:5px 10px!important; + } +} +.pay-box{ + background: #ffffff; + padding:0 0 15px; + .u-form-item--left .u-icon{ + font-size: 32px; + margin-top: 8px; + color: #2e2e2e; + } + .u-btn{ + padding: 0px 20px!important; + } + .u-form-item{ + padding:5px 10px!important; + } + .uni-input-input{ + font-size: 32px; + color: #2e2e2e; + } +} +.bottom-box{ + position: fixed; + z-index: 99; + background: #ffffff; + height: 49px; + bottom:0; + width: 100%; + border-top: 1px solid #ededed; + .number-text{ + color: #333333; + font-size: 20rpx; + em{ + font-style: normal; + color: #ff4400; + font-size: 36rpx; + } + } +} +/* 套餐购买详情 */ +.amount-top-box{ + padding: 10px 15px; + background: #ffffff; + .amount-text{ + color: #333333; + font-size: 30rpx; + + } + .number-text{ + color: #333333; + font-size: 60rpx; + padding-top: 10rpx; + float: left; + em{ + font-style: normal; + color: #333333; + font-size: 20rpx; + } + } + .u-size-mini{ + margin: 16px 0 0 10px; + } +} +.text-spacing{ + color: #333333; + font-size: 30rpx; + padding: 10rpx 15px; +} +.u-cell-title{ + padding: 10px 16px; + color: #333333; +} +.pay-right-box{ + text-align: right; + height: 48px; + .number{ + font-size: 40rpx; + color: #333333; + padding: 5px 0; + } + .up{ + color: #ff7000; + } + .other{ + font-size: 24rpx; + color: #999999; + padding: 3px 0 0; + } +} +/* 联系客服开始 */ +.service-banner{ + padding: 15px 15px 0; + + uni-image{ + height: 155px; + width: 100%; + border-radius: 8px; + } +} + +.service-box{ + padding:0 15px; + + .u-cell__left-icon-wrap .u-icon__icon{ + font-size: 32px!important; + } + .u-cell_title{ + border-left: 1px solid #d7d4d4; + padding-left: 10px; + } + .uicon-phone-fill{ + color: #f3ae45; + } + .uicon-weixin-circle-fill{ + color: #36c956; + } + .uicon-qq-circle-fill{ + color: #23a0f0; + } + .u-cell{ + padding:10px!important; + border-radius: 8px; + border: 1px solid #e4e7ed!important; + box-shadow: 0px 0px 10px rgba(0,0,0,0.15); + margin: 0 0 15px; + } + .u-border-bottom:after { + border-bottom-width: 0px; + } + .u-border-top:after { + border-top-width: 0px; + } +} +/* 联系客服结束 */ +/* 个人中心开始 */ +.user-banner{ + padding: 0px 15px; + + uni-image{ + height: 100px; + width: 100%; + border-radius: 8px; + } +} +.personal-list .u-cell{ + padding: 12px 16px; +} +.personal-list .u-cell-box .u-cell_title{ + color: #202328; +} +.personal-list .u-cell .u-iconfont{ + font-size: 20px!important; +} + +/* 个人中心结束 */ +.u-cell-title{ + padding: 10px 16px!important; + color: #333333!important; +} +/* 全部订单列表开始 */ +.order-list-item{ + .u-card__head{ + padding: 8px 15px!important; + } + .u-body-item-title{ + width: 100%; + } + .u-card__head--left__title{ + color: #9d9d9d!important; + font-size: 12px!important; + } + .u-card__head--right .u-card__head__title__text{ + color: #ff7001!important; + font-size: 16px!important; + } + .u-card__foot{ + padding: 8px 15px!important; + font-size: 12px!important; + } + .order-list-foot{ + height: 25px; + line-height: 25px; + } + .order-list-foot-btn{ + float: right; + .u-btn{ + margin: 0 2px; + border: 1px solid #e6e6e6!important; + } + } +} +/* 全部订单列表结束 */ +/* 订单详情开始 */ +.pages-sys-application-order-detailed{ + .title-text{ + color: #333333; + font-size: 15px; + padding:10px 15px; + background: #ffffff; + } + .detailed-information{ + background: #ffffff; + font-size: 12px; + color: #1f1f1f; + .u-col{ + padding: 8px 15px!important; + } + } +} + +/* 订单详情结束 */ +/* 代理商样式开始 */ +.agent-box{ + padding:10px; + .u-col{ + padding:0 3px!important; + } + .u-card{ + margin:0px!important; + .u-card__head{ + padding: 8px 10px 0!important; + .iconfont{ + float: left; + margin-right: 5px; + } + } + .u-card__body{ + padding:27px 5px!important; + .agent-text{ + color: #ff7001; + font-size: 16px; + font-weight: 700; + } + .agent-other-text{ + color: #999999; + font-size: 12px; + } + } + } + .agent-box-right{ + .u-card__body { + padding: 5px 10px!important; + span{ + margin: 0 5px; + color: #999999; + font-size: 12px; + em{ + font-style: normal; + color: #ff7001; + font-size: 14px; + margin: 0 5px; + font-weight: 700; + } + } + } + } + .u-border-bottom:after { + border-bottom-width: 0px; + } +} +/* 代理商样式结束 */ +/* 我的利益样式开始 */ +.earning-list-item{ + margin: 0!important; + .u-card__head{ + padding: 8px 15px!important; + } + .u-card__body{ + padding: 10px 15px 0!important; + } + .u-body-item-title{ + width: 100%; + font-size: 12px; + color: #999; + .type-name{ + font-size: 16px; + font-weight: 500; + color: #000; + line-height: 2; + } + .type-money{ + font-size: 18px; + font-weight: 500; + color: #ff7001; + line-height: 2; + } + } + .u-card__head--left__title{ + color: #000000!important; + font-size: 16px!important; + } + .u-card__head--right .u-card__head__title__text{ + color: #999999!important; + font-size: 12px!important; + } + .u-card__foot{ + padding: 5px 15px 10px!important; + font-size: 12px!important; + + } + .earning-list-foot{ + line-height: 20px; + } + .u-card__foot:after { + border-top-width: 0px!important; + } + .earning-headleft{ + font-size: 16px; + color: #000; + line-height: 28px; + .iconfont{ + margin: 5px 5px 0 0; + float: left; + } + } + .earning-headright{ + font-size: 12px; + color: #999; + } +} +/* 我的利益样式结束 */ +/* 地址管理样式开始 */ +.address-item{ + margin: 0!important; + .u-card__head{ + padding: 10px 15px 0!important; + .u-flex{ + justify-content: start; + } + } + .u-card__head:after { + border-bottom-width: 0px!important; + } + .u-card__body{ + color: #999999!important; + } + .u-card__foot{ + padding: 10px 15px!important; + } + .address-foot{ + justify-content: space-between; + .u-radio{ + .u-radio__label{ + font-size: 12px!important; + } + } + .u-icon{ + margin: 0 5px; + } + .u-icon__label{ + font-size: 12px!important; + } + } +} +.pages-sys-user-edit-address .u-form-item{ + padding:10px 15px!important; +} +/* 地址管理样式结束 */ +.sign-out{ + margin:0; + border-radius: 0; + border: 0!important; + color: #ff4141!important; + background: #fff; +} +/* 批量充值样式 */ +.pages-sys-user-batch-recharge .u-form-item{ + padding:10px 15px!important; +} +.batch-recharge-box{ + background: #ffffff; +} +.batch-recharge-title{ + padding: 10px 15px; + font-size: 30rpx; + background: #ffffff; + color: #333333; + em{ + font-style: normal; + color: #ff4300; + } +} +.result-text{ + em{ + font-style: normal; + color: #ff4300; + } +} +.card-list-item{ + background: #ffffff; +} +.card-list-item .u-form-item{ + padding: 5px 15px!important; +} +.remind-text { + font-size: 12px; + color: #ff4300; +} +/* 提现样式记录 */ + +.pages-sys-application-cash-out-record .u-input__input{ + min-height: 25px!important; +} +/* 消息列表页面样式 */ +.msg-list-item{ + .u-card__head--left__thumb{ + width: 22px!important; + height:22px!important; + } +} +/* 消息列表页面样式 */ +.u-divider{ + background: transparent!important; + padding: 10px 0!important; +} +.pages-sys-book-index{ + .u-index-bar__sidebar{ + top:55%!important; + } +} +.pages-sys-book-personal-details{ + .u-icon{ + color: #999999; + } + .u-cell_title{ + color: #999999; + } + .u-cell__value{ + text-align: left!important; + color: #000000!important; + font-size: 30rpx!important; + } + .connect{ + .u-cell__value{ + color: #5b95ff!important; + } + } +} +.apply-form-field{ + background: #ffffff; + .u-form-item{ + padding:5px 10px!important; + } + .input-placeholder{ + text-align: right!important; + } + .uni-input-input{ + text-align: right!important; + } + .form-field-select{ + .u-iconfont{ + font-size: 0!important; + } + } + .add-user{ + color: #bfbfbf; + font-size: 30px; + } + + .apply-name{ + color: #333333; + line-height: 20px; + span{ + color: #999999; + display: block; + + } + } + .apply-link{ + .u-link{ + color: #5ab149!important; + padding: 0 5px; + } + } + .u-close--top-right{ + top:5px!important; + } + .popup-title{ + color: #333333; + padding:5px 10px; + font-size: 30rpx; + } + .u-cell{ + padding:8px 12px!important; + } +} +/* 申请详情页面 */ +.datails-examine{ + .u-cell{ + padding: 15rpx 40rpx!important; + } +} +.pages-sys-msg-details{ + .u-time-axis { + position: relative; + background: #fff; + padding: 15px 10px 10px 70px!important; + } + .u-time-axis-node{ + left: -20px!important; + } + .u-time-axis::before { + left: 45px!important; + top:15px!important; + border-left: 2px solid #ddd!important; + } + .u-time-axis-item{ + min-height: 40px; + } +} +.custom-header{ + .u-title{ + font-size: 16px!important; + color: #000!important; + font-weight:700!important; + } + } \ No newline at end of file diff --git a/src/uview-ui/LICENSE b/src/uview-ui/LICENSE deleted file mode 100644 index 8e39ead..0000000 --- a/src/uview-ui/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 www.uviewui.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/src/uview-ui/README.md b/src/uview-ui/README.md deleted file mode 100644 index 06d5676..0000000 --- a/src/uview-ui/README.md +++ /dev/null @@ -1,106 +0,0 @@ -

- logo -

-

uView

-

多平台快速开发的UI框架

- - -## 说明 - -uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 - -## 特性 - -- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序 -- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用 -- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨 -- 众多的常用页面和布局,让您专注逻辑,事半功倍 -- 详尽的文档支持,现代化的演示效果 -- 按需引入,精简打包体积 - - -## 安装 - -```bash -# npm方式安装 -npm i uview-ui -``` - -## 快速上手 - -1. `main.js`引入uView库 -```js -// main.js -import uView from 'uview-ui'; -Vue.use(uView); -``` - -2. `App.vue`引入基础样式(注意style标签需声明scss属性支持) -```css -/* App.vue */ - -``` - -3. `uni.scss`引入全局scss变量文件 -```css -/* uni.scss */ -@import "uview-ui/theme.scss"; -``` - -4. `pages.json`配置easycom规则(按需引入) - -```js -// pages.json -{ - "easycom": { - // npm安装的方式不需要前面的"@/",下载安装的方式需要"@/" - // npm安装方式 - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" - // 下载安装方式 - // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" - }, - // 此为本身已有的内容 - "pages": [ - // ...... - ] -} -``` - -请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 - -## 使用方法 -配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 - -```html - -``` - -请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 - -## 链接 - -- [官方文档](https://uviewui.com/) -- [更新日志](https://uviewui.com/components/changelog.html) -- [升级指南](https://uviewui.com/components/changelog.html) -- [关于我们](https://uviewui.com/cooperation/about.html) - -## 预览 - -您可以通过**微信**扫码,查看最佳的演示效果。 -
-
- - - -## 版权信息 -uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 diff --git a/src/uview-ui/components/u-action-sheet/u-action-sheet.vue b/src/uview-ui/components/u-action-sheet/u-action-sheet.vue deleted file mode 100644 index 722b668..0000000 --- a/src/uview-ui/components/u-action-sheet/u-action-sheet.vue +++ /dev/null @@ -1,190 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-alert-tips/u-alert-tips.vue b/src/uview-ui/components/u-alert-tips/u-alert-tips.vue deleted file mode 100644 index e81fc37..0000000 --- a/src/uview-ui/components/u-alert-tips/u-alert-tips.vue +++ /dev/null @@ -1,256 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue b/src/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue deleted file mode 100644 index a48dd54..0000000 --- a/src/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue +++ /dev/null @@ -1,290 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-avatar-cropper/weCropper.js b/src/uview-ui/components/u-avatar-cropper/weCropper.js deleted file mode 100644 index df02483..0000000 --- a/src/uview-ui/components/u-avatar-cropper/weCropper.js +++ /dev/null @@ -1,1265 +0,0 @@ -/** - * we-cropper v1.3.9 - * (c) 2020 dlhandsome - * @license MIT - */ -(function(global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.WeCropper = factory()); -}(this, (function() { - 'use strict'; - - var device = void 0; - var TOUCH_STATE = ['touchstarted', 'touchmoved', 'touchended']; - - function firstLetterUpper(str) { - return str.charAt(0).toUpperCase() + str.slice(1) - } - - function setTouchState(instance) { - var arg = [], - len = arguments.length - 1; - while (len-- > 0) arg[len] = arguments[len + 1]; - - TOUCH_STATE.forEach(function(key, i) { - if (arg[i] !== undefined) { - instance[key] = arg[i]; - } - }); - } - - function validator(instance, o) { - Object.defineProperties(instance, o); - } - - function getDevice() { - if (!device) { - device = uni.getSystemInfoSync(); - } - return device - } - - var tmp = {}; - - var ref = getDevice(); - var pixelRatio = ref.pixelRatio; - - var DEFAULT = { - id: { - default: 'cropper', - get: function get() { - return tmp.id - }, - set: function set(value) { - if (typeof(value) !== 'string') { - console.error(("id:" + value + " is invalid")); - } - tmp.id = value; - } - }, - width: { - default: 750, - get: function get() { - return tmp.width - }, - set: function set(value) { - if (typeof(value) !== 'number') { - console.error(("width:" + value + " is invalid")); - } - tmp.width = value; - } - }, - height: { - default: 750, - get: function get() { - return tmp.height - }, - set: function set(value) { - if (typeof(value) !== 'number') { - console.error(("height:" + value + " is invalid")); - } - tmp.height = value; - } - }, - pixelRatio: { - default: pixelRatio, - get: function get() { - return tmp.pixelRatio - }, - set: function set(value) { - if (typeof(value) !== 'number') { - console.error(("pixelRatio:" + value + " is invalid")); - } - tmp.pixelRatio = value; - } - }, - scale: { - default: 2.5, - get: function get() { - return tmp.scale - }, - set: function set(value) { - if (typeof(value) !== 'number') { - console.error(("scale:" + value + " is invalid")); - } - tmp.scale = value; - } - }, - zoom: { - default: 5, - get: function get() { - return tmp.zoom - }, - set: function set(value) { - if (typeof(value) !== 'number') { - console.error(("zoom:" + value + " is invalid")); - } else if (value < 0 || value > 10) { - console.error("zoom should be ranged in 0 ~ 10"); - } - tmp.zoom = value; - } - }, - src: { - default: '', - get: function get() { - return tmp.src - }, - set: function set(value) { - if (typeof(value) !== 'string') { - console.error(("src:" + value + " is invalid")); - } - tmp.src = value; - } - }, - cut: { - default: {}, - get: function get() { - return tmp.cut - }, - set: function set(value) { - if (typeof(value) !== 'object') { - console.error(("cut:" + value + " is invalid")); - } - tmp.cut = value; - } - }, - boundStyle: { - default: {}, - get: function get() { - return tmp.boundStyle - }, - set: function set(value) { - if (typeof(value) !== 'object') { - console.error(("boundStyle:" + value + " is invalid")); - } - tmp.boundStyle = value; - } - }, - onReady: { - default: null, - get: function get() { - return tmp.ready - }, - set: function set(value) { - tmp.ready = value; - } - }, - onBeforeImageLoad: { - default: null, - get: function get() { - return tmp.beforeImageLoad - }, - set: function set(value) { - tmp.beforeImageLoad = value; - } - }, - onImageLoad: { - default: null, - get: function get() { - return tmp.imageLoad - }, - set: function set(value) { - tmp.imageLoad = value; - } - }, - onBeforeDraw: { - default: null, - get: function get() { - return tmp.beforeDraw - }, - set: function set(value) { - tmp.beforeDraw = value; - } - } - }; - - var ref$1 = getDevice(); - var windowWidth = ref$1.windowWidth; - - function prepare() { - var self = this; - - // v1.4.0 版本中将不再自动绑定we-cropper实例 - self.attachPage = function() { - var pages = getCurrentPages(); - // 获取到当前page上下文 - var pageContext = pages[pages.length - 1]; - // 把this依附在Page上下文的wecropper属性上,便于在page钩子函数中访问 - Object.defineProperty(pageContext, 'wecropper', { - get: function get() { - console.warn( - 'Instance will not be automatically bound to the page after v1.4.0\n\n' + - 'Please use a custom instance name instead\n\n' + - 'Example: \n' + - 'this.mycropper = new WeCropper(options)\n\n' + - '// ...\n' + - 'this.mycropper.getCropperImage()' - ); - return self - }, - configurable: true - }); - }; - - self.createCtx = function() { - var id = self.id; - var targetId = self.targetId; - - if (id) { - self.ctx = self.ctx || uni.createCanvasContext(id); - self.targetCtx = self.targetCtx || uni.createCanvasContext(targetId); - } else { - console.error("constructor: create canvas context failed, 'id' must be valuable"); - } - }; - - self.deviceRadio = windowWidth / 750; - } - - var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== - 'undefined' ? self : {}; - - - - - - function createCommonjsModule(fn, module) { - return module = { - exports: {} - }, fn(module, module.exports), module.exports; - } - - var tools = createCommonjsModule(function(module, exports) { - /** - * String type check - */ - exports.isStr = function(v) { - return typeof v === 'string'; - }; - /** - * Number type check - */ - exports.isNum = function(v) { - return typeof v === 'number'; - }; - /** - * Array type check - */ - exports.isArr = Array.isArray; - /** - * undefined type check - */ - exports.isUndef = function(v) { - return v === undefined; - }; - - exports.isTrue = function(v) { - return v === true; - }; - - exports.isFalse = function(v) { - return v === false; - }; - /** - * Function type check - */ - exports.isFunc = function(v) { - return typeof v === 'function'; - }; - /** - * Quick object check - this is primarily used to tell - * Objects from primitive values when we know the value - * is a JSON-compliant type. - */ - exports.isObj = exports.isObject = function(obj) { - return obj !== null && typeof obj === 'object' - }; - - /** - * Strict object type check. Only returns true - * for plain JavaScript objects. - */ - var _toString = Object.prototype.toString; - exports.isPlainObject = function(obj) { - return _toString.call(obj) === '[object Object]' - }; - - /** - * Check whether the object has the property. - */ - var hasOwnProperty = Object.prototype.hasOwnProperty; - exports.hasOwn = function(obj, key) { - return hasOwnProperty.call(obj, key) - }; - - /** - * Perform no operation. - * Stubbing args to make Flow happy without leaving useless transpiled code - * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/) - */ - exports.noop = function(a, b, c) {}; - - /** - * Check if val is a valid array index. - */ - exports.isValidArrayIndex = function(val) { - var n = parseFloat(String(val)); - return n >= 0 && Math.floor(n) === n && isFinite(val) - }; - }); - - var tools_7 = tools.isFunc; - var tools_10 = tools.isPlainObject; - - var EVENT_TYPE = ['ready', 'beforeImageLoad', 'beforeDraw', 'imageLoad']; - - function observer() { - var self = this; - - self.on = function(event, fn) { - if (EVENT_TYPE.indexOf(event) > -1) { - if (tools_7(fn)) { - event === 'ready' ? - fn(self) : - self[("on" + (firstLetterUpper(event)))] = fn; - } - } else { - console.error(("event: " + event + " is invalid")); - } - return self - }; - } - - function wxPromise(fn) { - return function(obj) { - var args = [], - len = arguments.length - 1; - while (len-- > 0) args[len] = arguments[len + 1]; - - if (obj === void 0) obj = {}; - return new Promise(function(resolve, reject) { - obj.success = function(res) { - resolve(res); - }; - obj.fail = function(err) { - reject(err); - }; - fn.apply(void 0, [obj].concat(args)); - }) - } - } - - function draw(ctx, reserve) { - if (reserve === void 0) reserve = false; - - return new Promise(function(resolve) { - ctx.draw(reserve, resolve); - }) - } - - var getImageInfo = wxPromise(uni.getImageInfo); - - var canvasToTempFilePath = wxPromise(uni.canvasToTempFilePath); - - var base64 = createCommonjsModule(function(module, exports) { - /*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ - (function(root) { - - // Detect free variables `exports`. - var freeExports = 'object' == 'object' && exports; - - // Detect free variable `module`. - var freeModule = 'object' == 'object' && module && - module.exports == freeExports && module; - - // Detect free variable `global`, from Node.js or Browserified code, and use - // it as `root`. - var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal; - if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { - root = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - var InvalidCharacterError = function(message) { - this.message = message; - }; - InvalidCharacterError.prototype = new Error; - InvalidCharacterError.prototype.name = 'InvalidCharacterError'; - - var error = function(message) { - // Note: the error messages used throughout this file match those used by - // the native `atob`/`btoa` implementation in Chromium. - throw new InvalidCharacterError(message); - }; - - var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - // http://whatwg.org/html/common-microsyntaxes.html#space-character - var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g; - - // `decode` is designed to be fully compatible with `atob` as described in the - // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob - // The optimized base64-decoding algorithm used is based on @atk’s excellent - // implementation. https://gist.github.com/atk/1020396 - var decode = function(input) { - input = String(input) - .replace(REGEX_SPACE_CHARACTERS, ''); - var length = input.length; - if (length % 4 == 0) { - input = input.replace(/==?$/, ''); - length = input.length; - } - if ( - length % 4 == 1 || - // http://whatwg.org/C#alphanumeric-ascii-characters - /[^+a-zA-Z0-9/]/.test(input) - ) { - error( - 'Invalid character: the string to be decoded is not correctly encoded.' - ); - } - var bitCounter = 0; - var bitStorage; - var buffer; - var output = ''; - var position = -1; - while (++position < length) { - buffer = TABLE.indexOf(input.charAt(position)); - bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer; - // Unless this is the first of a group of 4 characters… - if (bitCounter++ % 4) { - // …convert the first 8 bits to a single ASCII character. - output += String.fromCharCode( - 0xFF & bitStorage >> (-2 * bitCounter & 6) - ); - } - } - return output; - }; - - // `encode` is designed to be fully compatible with `btoa` as described in the - // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa - var encode = function(input) { - input = String(input); - if (/[^\0-\xFF]/.test(input)) { - // Note: no need to special-case astral symbols here, as surrogates are - // matched, and the input is supposed to only contain ASCII anyway. - error( - 'The string to be encoded contains characters outside of the ' + - 'Latin1 range.' - ); - } - var padding = input.length % 3; - var output = ''; - var position = -1; - var a; - var b; - var c; - var buffer; - // Make sure any padding is handled outside of the loop. - var length = input.length - padding; - - while (++position < length) { - // Read three bytes, i.e. 24 bits. - a = input.charCodeAt(position) << 16; - b = input.charCodeAt(++position) << 8; - c = input.charCodeAt(++position); - buffer = a + b + c; - // Turn the 24 bits into four chunks of 6 bits each, and append the - // matching character for each of them to the output. - output += ( - TABLE.charAt(buffer >> 18 & 0x3F) + - TABLE.charAt(buffer >> 12 & 0x3F) + - TABLE.charAt(buffer >> 6 & 0x3F) + - TABLE.charAt(buffer & 0x3F) - ); - } - - if (padding == 2) { - a = input.charCodeAt(position) << 8; - b = input.charCodeAt(++position); - buffer = a + b; - output += ( - TABLE.charAt(buffer >> 10) + - TABLE.charAt((buffer >> 4) & 0x3F) + - TABLE.charAt((buffer << 2) & 0x3F) + - '=' - ); - } else if (padding == 1) { - buffer = input.charCodeAt(position); - output += ( - TABLE.charAt(buffer >> 2) + - TABLE.charAt((buffer << 4) & 0x3F) + - '==' - ); - } - - return output; - }; - - var base64 = { - 'encode': encode, - 'decode': decode, - 'version': '0.1.0' - }; - - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof undefined == 'function' && - typeof undefined.amd == 'object' && - undefined.amd - ) { - undefined(function() { - return base64; - }); - } else if (freeExports && !freeExports.nodeType) { - if (freeModule) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = base64; - } else { // in Narwhal or RingoJS v0.7.0- - for (var key in base64) { - base64.hasOwnProperty(key) && (freeExports[key] = base64[key]); - } - } - } else { // in Rhino or a web browser - root.base64 = base64; - } - - }(commonjsGlobal)); - }); - - function makeURI(strData, type) { - return 'data:' + type + ';base64,' + strData - } - - function fixType(type) { - type = type.toLowerCase().replace(/jpg/i, 'jpeg'); - var r = type.match(/png|jpeg|bmp|gif/)[0]; - return 'image/' + r - } - - function encodeData(data) { - var str = ''; - if (typeof data === 'string') { - str = data; - } else { - for (var i = 0; i < data.length; i++) { - str += String.fromCharCode(data[i]); - } - } - return base64.encode(str) - } - - /** - * 获取图像区域隐含的像素数据 - * @param canvasId canvas标识 - * @param x 将要被提取的图像数据矩形区域的左上角 x 坐标 - * @param y 将要被提取的图像数据矩形区域的左上角 y 坐标 - * @param width 将要被提取的图像数据矩形区域的宽度 - * @param height 将要被提取的图像数据矩形区域的高度 - * @param done 完成回调 - */ - function getImageData(canvasId, x, y, width, height, done) { - uni.canvasGetImageData({ - canvasId: canvasId, - x: x, - y: y, - width: width, - height: height, - success: function success(res) { - done(res, null); - }, - fail: function fail(res) { - done(null, res); - } - }); - } - - /** - * 生成bmp格式图片 - * 按照规则生成图片响应头和响应体 - * @param oData 用来描述 canvas 区域隐含的像素数据 { data, width, height } = oData - * @returns {*} base64字符串 - */ - function genBitmapImage(oData) { - // - // BITMAPFILEHEADER: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183374(v=vs.85).aspx - // BITMAPINFOHEADER: http://msdn.microsoft.com/en-us/library/dd183376.aspx - // - var biWidth = oData.width; - var biHeight = oData.height; - var biSizeImage = biWidth * biHeight * 3; - var bfSize = biSizeImage + 54; // total header size = 54 bytes - - // - // typedef struct tagBITMAPFILEHEADER { - // WORD bfType; - // DWORD bfSize; - // WORD bfReserved1; - // WORD bfReserved2; - // DWORD bfOffBits; - // } BITMAPFILEHEADER; - // - var BITMAPFILEHEADER = [ - // WORD bfType -- The file type signature; must be "BM" - 0x42, 0x4D, - // DWORD bfSize -- The size, in bytes, of the bitmap file - bfSize & 0xff, bfSize >> 8 & 0xff, bfSize >> 16 & 0xff, bfSize >> 24 & 0xff, - // WORD bfReserved1 -- Reserved; must be zero - 0, 0, - // WORD bfReserved2 -- Reserved; must be zero - 0, 0, - // DWORD bfOffBits -- The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits. - 54, 0, 0, 0 - ]; - - // - // typedef struct tagBITMAPINFOHEADER { - // DWORD biSize; - // LONG biWidth; - // LONG biHeight; - // WORD biPlanes; - // WORD biBitCount; - // DWORD biCompression; - // DWORD biSizeImage; - // LONG biXPelsPerMeter; - // LONG biYPelsPerMeter; - // DWORD biClrUsed; - // DWORD biClrImportant; - // } BITMAPINFOHEADER, *PBITMAPINFOHEADER; - // - var BITMAPINFOHEADER = [ - // DWORD biSize -- The number of bytes required by the structure - 40, 0, 0, 0, - // LONG biWidth -- The width of the bitmap, in pixels - biWidth & 0xff, biWidth >> 8 & 0xff, biWidth >> 16 & 0xff, biWidth >> 24 & 0xff, - // LONG biHeight -- The height of the bitmap, in pixels - biHeight & 0xff, biHeight >> 8 & 0xff, biHeight >> 16 & 0xff, biHeight >> 24 & 0xff, - // WORD biPlanes -- The number of planes for the target device. This value must be set to 1 - 1, 0, - // WORD biBitCount -- The number of bits-per-pixel, 24 bits-per-pixel -- the bitmap - // has a maximum of 2^24 colors (16777216, Truecolor) - 24, 0, - // DWORD biCompression -- The type of compression, BI_RGB (code 0) -- uncompressed - 0, 0, 0, 0, - // DWORD biSizeImage -- The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps - biSizeImage & 0xff, biSizeImage >> 8 & 0xff, biSizeImage >> 16 & 0xff, biSizeImage >> 24 & 0xff, - // LONG biXPelsPerMeter, unused - 0, 0, 0, 0, - // LONG biYPelsPerMeter, unused - 0, 0, 0, 0, - // DWORD biClrUsed, the number of color indexes of palette, unused - 0, 0, 0, 0, - // DWORD biClrImportant, unused - 0, 0, 0, 0 - ]; - - var iPadding = (4 - ((biWidth * 3) % 4)) % 4; - - var aImgData = oData.data; - - var strPixelData = ''; - var biWidth4 = biWidth << 2; - var y = biHeight; - var fromCharCode = String.fromCharCode; - - do { - var iOffsetY = biWidth4 * (y - 1); - var strPixelRow = ''; - for (var x = 0; x < biWidth; x++) { - var iOffsetX = x << 2; - strPixelRow += fromCharCode(aImgData[iOffsetY + iOffsetX + 2]) + - fromCharCode(aImgData[iOffsetY + iOffsetX + 1]) + - fromCharCode(aImgData[iOffsetY + iOffsetX]); - } - - for (var c = 0; c < iPadding; c++) { - strPixelRow += String.fromCharCode(0); - } - - strPixelData += strPixelRow; - } while (--y) - - var strEncoded = encodeData(BITMAPFILEHEADER.concat(BITMAPINFOHEADER)) + encodeData(strPixelData); - - return strEncoded - } - - /** - * 转换为图片base64 - * @param canvasId canvas标识 - * @param x 将要被提取的图像数据矩形区域的左上角 x 坐标 - * @param y 将要被提取的图像数据矩形区域的左上角 y 坐标 - * @param width 将要被提取的图像数据矩形区域的宽度 - * @param height 将要被提取的图像数据矩形区域的高度 - * @param type 转换图片类型 - * @param done 完成回调 - */ - function convertToImage(canvasId, x, y, width, height, type, done) { - if (done === void 0) done = function() {}; - - if (type === undefined) { - type = 'png'; - } - type = fixType(type); - if (/bmp/.test(type)) { - getImageData(canvasId, x, y, width, height, function(data, err) { - var strData = genBitmapImage(data); - tools_7(done) && done(makeURI(strData, 'image/' + type), err); - }); - } else { - console.error('暂不支持生成\'' + type + '\'类型的base64图片'); - } - } - - var CanvasToBase64 = { - convertToImage: convertToImage, - // convertToPNG: function (width, height, done) { - // return convertToImage(width, height, 'png', done) - // }, - // convertToJPEG: function (width, height, done) { - // return convertToImage(width, height, 'jpeg', done) - // }, - // convertToGIF: function (width, height, done) { - // return convertToImage(width, height, 'gif', done) - // }, - convertToBMP: function(ref, done) { - if (ref === void 0) ref = {}; - var canvasId = ref.canvasId; - var x = ref.x; - var y = ref.y; - var width = ref.width; - var height = ref.height; - if (done === void 0) done = function() {}; - - return convertToImage(canvasId, x, y, width, height, 'bmp', done) - } - }; - - function methods() { - var self = this; - - var boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度 - var boundHeight = self.height; // 裁剪框默认高度,即整个画布高度 - - var id = self.id; - var targetId = self.targetId; - var pixelRatio = self.pixelRatio; - - var ref = self.cut; - var x = ref.x; - if (x === void 0) x = 0; - var y = ref.y; - if (y === void 0) y = 0; - var width = ref.width; - if (width === void 0) width = boundWidth; - var height = ref.height; - if (height === void 0) height = boundHeight; - - self.updateCanvas = function(done) { - if (self.croperTarget) { - // 画布绘制图片 - self.ctx.drawImage( - self.croperTarget, - self.imgLeft, - self.imgTop, - self.scaleWidth, - self.scaleHeight - ); - } - tools_7(self.onBeforeDraw) && self.onBeforeDraw(self.ctx, self); - - self.setBoundStyle(self.boundStyle); // 设置边界样式 - - self.ctx.draw(false, done); - return self - }; - - self.pushOrigin = self.pushOrign = function(src) { - self.src = src; - - tools_7(self.onBeforeImageLoad) && self.onBeforeImageLoad(self.ctx, self); - - return getImageInfo({ - src: src - }) - .then(function(res) { - var innerAspectRadio = res.width / res.height; - var customAspectRadio = width / height; - - self.croperTarget = res.path; - - if (innerAspectRadio < customAspectRadio) { - self.rectX = x; - self.baseWidth = width; - self.baseHeight = width / innerAspectRadio; - self.rectY = y - Math.abs((height - self.baseHeight) / 2); - } else { - self.rectY = y; - self.baseWidth = height * innerAspectRadio; - self.baseHeight = height; - self.rectX = x - Math.abs((width - self.baseWidth) / 2); - } - - self.imgLeft = self.rectX; - self.imgTop = self.rectY; - self.scaleWidth = self.baseWidth; - self.scaleHeight = self.baseHeight; - - self.update(); - - return new Promise(function(resolve) { - self.updateCanvas(resolve); - }) - }) - .then(function() { - tools_7(self.onImageLoad) && self.onImageLoad(self.ctx, self); - }) - }; - - self.removeImage = function() { - self.src = ''; - self.croperTarget = ''; - return draw(self.ctx) - }; - - self.getCropperBase64 = function(done) { - if (done === void 0) done = function() {}; - - CanvasToBase64.convertToBMP({ - canvasId: id, - x: x, - y: y, - width: width, - height: height - }, done); - }; - - self.getCropperImage = function(opt, fn) { - var customOptions = opt; - - var canvasOptions = { - canvasId: id, - x: x, - y: y, - width: width, - height: height - }; - - var task = function() { - return Promise.resolve(); - }; - - if ( - tools_10(customOptions) && - customOptions.original - ) { - // original mode - task = function() { - self.targetCtx.drawImage( - self.croperTarget, - self.imgLeft * pixelRatio, - self.imgTop * pixelRatio, - self.scaleWidth * pixelRatio, - self.scaleHeight * pixelRatio - ); - - canvasOptions = { - canvasId: targetId, - x: x * pixelRatio, - y: y * pixelRatio, - width: width * pixelRatio, - height: height * pixelRatio - }; - - return draw(self.targetCtx) - }; - } - - return task() - .then(function() { - if (tools_10(customOptions)) { - canvasOptions = Object.assign({}, canvasOptions, customOptions); - } - - if (tools_7(customOptions)) { - fn = customOptions; - } - - var arg = canvasOptions.componentContext ? - [canvasOptions, canvasOptions.componentContext] : - [canvasOptions]; - - return canvasToTempFilePath.apply(null, arg) - }) - .then(function(res) { - var tempFilePath = res.tempFilePath; - - return tools_7(fn) ? - fn.call(self, tempFilePath, null) : - tempFilePath - }) - .catch(function(err) { - if (tools_7(fn)) { - fn.call(self, null, err); - } else { - throw err - } - }) - }; - } - - /** - * 获取最新缩放值 - * @param oldScale 上一次触摸结束后的缩放值 - * @param oldDistance 上一次触摸结束后的双指距离 - * @param zoom 缩放系数 - * @param touch0 第一指touch对象 - * @param touch1 第二指touch对象 - * @returns {*} - */ - var getNewScale = function(oldScale, oldDistance, zoom, touch0, touch1) { - var xMove, yMove, newDistance; - // 计算二指最新距离 - xMove = Math.round(touch1.x - touch0.x); - yMove = Math.round(touch1.y - touch0.y); - newDistance = Math.round(Math.sqrt(xMove * xMove + yMove * yMove)); - - return oldScale + 0.001 * zoom * (newDistance - oldDistance) - }; - - function update() { - var self = this; - - if (!self.src) { - return - } - - self.__oneTouchStart = function(touch) { - self.touchX0 = Math.round(touch.x); - self.touchY0 = Math.round(touch.y); - }; - - self.__oneTouchMove = function(touch) { - var xMove, yMove; - // 计算单指移动的距离 - if (self.touchended) { - return self.updateCanvas() - } - xMove = Math.round(touch.x - self.touchX0); - yMove = Math.round(touch.y - self.touchY0); - - var imgLeft = Math.round(self.rectX + xMove); - var imgTop = Math.round(self.rectY + yMove); - - self.outsideBound(imgLeft, imgTop); - - self.updateCanvas(); - }; - - self.__twoTouchStart = function(touch0, touch1) { - var xMove, yMove, oldDistance; - - self.touchX1 = Math.round(self.rectX + self.scaleWidth / 2); - self.touchY1 = Math.round(self.rectY + self.scaleHeight / 2); - - // 计算两指距离 - xMove = Math.round(touch1.x - touch0.x); - yMove = Math.round(touch1.y - touch0.y); - oldDistance = Math.round(Math.sqrt(xMove * xMove + yMove * yMove)); - - self.oldDistance = oldDistance; - }; - - self.__twoTouchMove = function(touch0, touch1) { - var oldScale = self.oldScale; - var oldDistance = self.oldDistance; - var scale = self.scale; - var zoom = self.zoom; - - self.newScale = getNewScale(oldScale, oldDistance, zoom, touch0, touch1); - - // 设定缩放范围 - self.newScale <= 1 && (self.newScale = 1); - self.newScale >= scale && (self.newScale = scale); - - self.scaleWidth = Math.round(self.newScale * self.baseWidth); - self.scaleHeight = Math.round(self.newScale * self.baseHeight); - var imgLeft = Math.round(self.touchX1 - self.scaleWidth / 2); - var imgTop = Math.round(self.touchY1 - self.scaleHeight / 2); - - self.outsideBound(imgLeft, imgTop); - - self.updateCanvas(); - }; - - self.__xtouchEnd = function() { - self.oldScale = self.newScale; - self.rectX = self.imgLeft; - self.rectY = self.imgTop; - }; - } - - var handle = { - // 图片手势初始监测 - touchStart: function touchStart(e) { - var self = this; - var ref = e.touches; - var touch0 = ref[0]; - var touch1 = ref[1]; - - if (!self.src) { - return - } - - setTouchState(self, true, null, null); - - // 计算第一个触摸点的位置,并参照改点进行缩放 - self.__oneTouchStart(touch0); - - // 两指手势触发 - if (e.touches.length >= 2) { - self.__twoTouchStart(touch0, touch1); - } - }, - - // 图片手势动态缩放 - touchMove: function touchMove(e) { - var self = this; - var ref = e.touches; - var touch0 = ref[0]; - var touch1 = ref[1]; - - if (!self.src) { - return - } - - setTouchState(self, null, true); - - // 单指手势时触发 - if (e.touches.length === 1) { - self.__oneTouchMove(touch0); - } - // 两指手势触发 - if (e.touches.length >= 2) { - self.__twoTouchMove(touch0, touch1); - } - }, - - touchEnd: function touchEnd(e) { - var self = this; - - if (!self.src) { - return - } - - setTouchState(self, false, false, true); - self.__xtouchEnd(); - } - }; - - function cut() { - var self = this; - var boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度 - var boundHeight = self.height; - // 裁剪框默认高度,即整个画布高度 - var ref = self.cut; - var x = ref.x; - if (x === void 0) x = 0; - var y = ref.y; - if (y === void 0) y = 0; - var width = ref.width; - if (width === void 0) width = boundWidth; - var height = ref.height; - if (height === void 0) height = boundHeight; - - /** - * 设置边界 - * @param imgLeft 图片左上角横坐标值 - * @param imgTop 图片左上角纵坐标值 - */ - self.outsideBound = function(imgLeft, imgTop) { - self.imgLeft = imgLeft >= x ? - x : - self.scaleWidth + imgLeft - x <= width ? - x + width - self.scaleWidth : - imgLeft; - - self.imgTop = imgTop >= y ? - y : - self.scaleHeight + imgTop - y <= height ? - y + height - self.scaleHeight : - imgTop; - }; - - /** - * 设置边界样式 - * @param color 边界颜色 - */ - self.setBoundStyle = function(ref) { - if (ref === void 0) ref = {}; - var color = ref.color; - if (color === void 0) color = '#04b00f'; - var mask = ref.mask; - if (mask === void 0) mask = 'rgba(0, 0, 0, 0.3)'; - var lineWidth = ref.lineWidth; - if (lineWidth === void 0) lineWidth = 1; - - var half = lineWidth / 2; - var boundOption = [{ - start: { - x: x - half, - y: y + 10 - half - }, - step1: { - x: x - half, - y: y - half - }, - step2: { - x: x + 10 - half, - y: y - half - } - }, - { - start: { - x: x - half, - y: y + height - 10 + half - }, - step1: { - x: x - half, - y: y + height + half - }, - step2: { - x: x + 10 - half, - y: y + height + half - } - }, - { - start: { - x: x + width - 10 + half, - y: y - half - }, - step1: { - x: x + width + half, - y: y - half - }, - step2: { - x: x + width + half, - y: y + 10 - half - } - }, - { - start: { - x: x + width + half, - y: y + height - 10 + half - }, - step1: { - x: x + width + half, - y: y + height + half - }, - step2: { - x: x + width - 10 + half, - y: y + height + half - } - } - ]; - - // 绘制半透明层 - self.ctx.beginPath(); - self.ctx.setFillStyle(mask); - self.ctx.fillRect(0, 0, x, boundHeight); - self.ctx.fillRect(x, 0, width, y); - self.ctx.fillRect(x, y + height, width, boundHeight - y - height); - self.ctx.fillRect(x + width, 0, boundWidth - x - width, boundHeight); - self.ctx.fill(); - - boundOption.forEach(function(op) { - self.ctx.beginPath(); - self.ctx.setStrokeStyle(color); - self.ctx.setLineWidth(lineWidth); - self.ctx.moveTo(op.start.x, op.start.y); - self.ctx.lineTo(op.step1.x, op.step1.y); - self.ctx.lineTo(op.step2.x, op.step2.y); - self.ctx.stroke(); - }); - }; - } - - var version = "1.3.9"; - - var WeCropper = function WeCropper(params) { - var self = this; - var _default = {}; - - validator(self, DEFAULT); - - Object.keys(DEFAULT).forEach(function(key) { - _default[key] = DEFAULT[key].default; - }); - Object.assign(self, _default, params); - - self.prepare(); - self.attachPage(); - self.createCtx(); - self.observer(); - self.cutt(); - self.methods(); - self.init(); - self.update(); - - return self - }; - - WeCropper.prototype.init = function init() { - var self = this; - var src = self.src; - - self.version = version; - - typeof self.onReady === 'function' && self.onReady(self.ctx, self); - - if (src) { - self.pushOrign(src); - } else { - self.updateCanvas(); - } - setTouchState(self, false, false, false); - - self.oldScale = 1; - self.newScale = 1; - - return self - }; - - Object.assign(WeCropper.prototype, handle); - - WeCropper.prototype.prepare = prepare; - WeCropper.prototype.observer = observer; - WeCropper.prototype.methods = methods; - WeCropper.prototype.cutt = cut; - WeCropper.prototype.update = update; - - return WeCropper; - -}))); diff --git a/src/uview-ui/components/u-avatar/u-avatar.vue b/src/uview-ui/components/u-avatar/u-avatar.vue deleted file mode 100644 index 289b9b0..0000000 --- a/src/uview-ui/components/u-avatar/u-avatar.vue +++ /dev/null @@ -1,244 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-back-top/u-back-top.vue b/src/uview-ui/components/u-back-top/u-back-top.vue deleted file mode 100644 index 7970fc7..0000000 --- a/src/uview-ui/components/u-back-top/u-back-top.vue +++ /dev/null @@ -1,153 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-badge/u-badge.vue b/src/uview-ui/components/u-badge/u-badge.vue deleted file mode 100644 index e85b133..0000000 --- a/src/uview-ui/components/u-badge/u-badge.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/uview-ui/components/u-button/u-button.vue b/src/uview-ui/components/u-button/u-button.vue deleted file mode 100644 index 82c3a6f..0000000 --- a/src/uview-ui/components/u-button/u-button.vue +++ /dev/null @@ -1,596 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-calendar/u-calendar.vue b/src/uview-ui/components/u-calendar/u-calendar.vue deleted file mode 100644 index 2b30184..0000000 --- a/src/uview-ui/components/u-calendar/u-calendar.vue +++ /dev/null @@ -1,639 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/uview-ui/components/u-car-keyboard/u-car-keyboard.vue b/src/uview-ui/components/u-car-keyboard/u-car-keyboard.vue deleted file mode 100644 index 84b1467..0000000 --- a/src/uview-ui/components/u-car-keyboard/u-car-keyboard.vue +++ /dev/null @@ -1,257 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-card/u-card.vue b/src/uview-ui/components/u-card/u-card.vue deleted file mode 100644 index a3cb2aa..0000000 --- a/src/uview-ui/components/u-card/u-card.vue +++ /dev/null @@ -1,299 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-cell-group/u-cell-group.vue b/src/uview-ui/components/u-cell-group/u-cell-group.vue deleted file mode 100644 index 3fbca72..0000000 --- a/src/uview-ui/components/u-cell-group/u-cell-group.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-cell-item/u-cell-item.vue b/src/uview-ui/components/u-cell-item/u-cell-item.vue deleted file mode 100644 index 10d9b20..0000000 --- a/src/uview-ui/components/u-cell-item/u-cell-item.vue +++ /dev/null @@ -1,316 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-checkbox-group/u-checkbox-group.vue b/src/uview-ui/components/u-checkbox-group/u-checkbox-group.vue deleted file mode 100644 index 6a149b3..0000000 --- a/src/uview-ui/components/u-checkbox-group/u-checkbox-group.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-checkbox/u-checkbox.vue b/src/uview-ui/components/u-checkbox/u-checkbox.vue deleted file mode 100644 index 9414461..0000000 --- a/src/uview-ui/components/u-checkbox/u-checkbox.vue +++ /dev/null @@ -1,284 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-circle-progress/u-circle-progress.vue b/src/uview-ui/components/u-circle-progress/u-circle-progress.vue deleted file mode 100644 index 46e7c18..0000000 --- a/src/uview-ui/components/u-circle-progress/u-circle-progress.vue +++ /dev/null @@ -1,220 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue b/src/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue deleted file mode 100644 index 77e2da2..0000000 --- a/src/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-col/u-col.vue b/src/uview-ui/components/u-col/u-col.vue deleted file mode 100644 index 3b6cc64..0000000 --- a/src/uview-ui/components/u-col/u-col.vue +++ /dev/null @@ -1,156 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-collapse-item/u-collapse-item.vue b/src/uview-ui/components/u-collapse-item/u-collapse-item.vue deleted file mode 100644 index ed11778..0000000 --- a/src/uview-ui/components/u-collapse-item/u-collapse-item.vue +++ /dev/null @@ -1,204 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-collapse/u-collapse.vue b/src/uview-ui/components/u-collapse/u-collapse.vue deleted file mode 100644 index 8572957..0000000 --- a/src/uview-ui/components/u-collapse/u-collapse.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-column-notice/u-column-notice.vue b/src/uview-ui/components/u-column-notice/u-column-notice.vue deleted file mode 100644 index dd8bd31..0000000 --- a/src/uview-ui/components/u-column-notice/u-column-notice.vue +++ /dev/null @@ -1,237 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-count-down/u-count-down.vue b/src/uview-ui/components/u-count-down/u-count-down.vue deleted file mode 100644 index 7285d67..0000000 --- a/src/uview-ui/components/u-count-down/u-count-down.vue +++ /dev/null @@ -1,318 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-count-to/u-count-to.vue b/src/uview-ui/components/u-count-to/u-count-to.vue deleted file mode 100644 index 053dc5f..0000000 --- a/src/uview-ui/components/u-count-to/u-count-to.vue +++ /dev/null @@ -1,241 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-divider/u-divider.vue b/src/uview-ui/components/u-divider/u-divider.vue deleted file mode 100644 index 6f8d7e6..0000000 --- a/src/uview-ui/components/u-divider/u-divider.vue +++ /dev/null @@ -1,153 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-dropdown-item/u-dropdown-item.vue b/src/uview-ui/components/u-dropdown-item/u-dropdown-item.vue deleted file mode 100644 index ba60d8f..0000000 --- a/src/uview-ui/components/u-dropdown-item/u-dropdown-item.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-dropdown/u-dropdown.vue b/src/uview-ui/components/u-dropdown/u-dropdown.vue deleted file mode 100644 index a62e469..0000000 --- a/src/uview-ui/components/u-dropdown/u-dropdown.vue +++ /dev/null @@ -1,298 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-empty/u-empty.vue b/src/uview-ui/components/u-empty/u-empty.vue deleted file mode 100644 index 2c77b24..0000000 --- a/src/uview-ui/components/u-empty/u-empty.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - - - diff --git a/src/uview-ui/components/u-field/u-field.vue b/src/uview-ui/components/u-field/u-field.vue deleted file mode 100644 index b562798..0000000 --- a/src/uview-ui/components/u-field/u-field.vue +++ /dev/null @@ -1,384 +0,0 @@ -