commit 51785b6761933571761062beef9cff2bb6ac1e50 Author: kevin <328471290@qq.com> Date: Wed May 8 18:00:07 2024 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14a19d5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# 忽略以下文件和目录 +node_modules/ +/dist/ +/dev/ +/.DS_Store + +# 忽略UniApp编译生成的小程序相关目录 +/unpackage/ + +# 忽略本地配置文件(请根据实际情况修改) +/manifest.local.json + +# 忽略编辑器自动生成的文件 +.idea/ +.vscode/ + +# 忽略日志文件 +/logs/ + +# 忽略临时文件 +/temp/ + +# 忽略构建工具自动生成的文件 +/build/ + +# 忽略npm安装的包文件 +/package-lock.json +/yarn.lock + diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..81f13f4 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // 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": [{ + "default" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..dd29bdb --- /dev/null +++ b/App.vue @@ -0,0 +1,29 @@ + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..38974df --- /dev/null +++ b/index.html @@ -0,0 +1,29 @@ + + + + + + + + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..5978e7f --- /dev/null +++ b/main.js @@ -0,0 +1,33 @@ +import App from './App' + +// #ifndef VUE3 +import Vue from 'vue' +import uView from "uview-ui"; +// import ElementUI from "element-ui"; +// import "element-ui/lib/theme-chalk/index.css"; +import './uni.promisify.adaptor'; +import http from "./utils/http"; +// 导入并挂载全局的分享方法 +import share from './utils/share.js' +Vue.mixin(share) +Vue.use(uView); +// 使用element +// Vue.use(ElementUI) +Vue.config.productionTip = false +Vue.prototype.http=http +App.mpType = 'app' +const app = new Vue({ + ...App +}) +app.$mount() +// #endif + +// #ifdef VUE3 +import { createSSRApp } from 'vue' +export function createApp() { + const app = createSSRApp(App) + return { + app + } +} +// #endif \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..bb07154 --- /dev/null +++ b/manifest.json @@ -0,0 +1,75 @@ +{ + "name" : "CloudTesting", + "appid" : "__UNI__6D30C35", + "description" : "云测试平台", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : {}, + /* SDK配置 */ + "sdkConfigs" : {} + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wx0606cba78611e49b", + "setting" : { + "urlCheck" : false, + "minified" : true, + "postcss" : true, + "es6" : false + }, + "usingComponents" : true + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "2" +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..faf6e20 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "cloudtesting", + "version": "1.0.0", + "description": "", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "crypto-js": "^4.2.0" + } +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..86974b5 --- /dev/null +++ b/pages.json @@ -0,0 +1,430 @@ +{ + "easycom": { + "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" + }, + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "首页", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/mytestkit/mytestkit", + "style" : + { + "navigationBarTitleText" : "我的测试宝", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/setup/Information", + "style" : + { + "navigationBarTitleText" : "个人信息", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/personalresume/personalresume", + "style" : + { + "navigationBarTitleText" : "个人简历", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/personalresume/advantage", + "style" : + { + "navigationBarTitleText" : "我的优势", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/personalresume/workexperience", + "style" : + { + "navigationBarTitleText" : "", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/privacy", + "style" : + { + "navigationBarTitleText" : "隐私政策", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/userAgreemen", + "style" : + { + "navigationBarTitleText" : "用户协议", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/personal/personalresume/projectexperience", + "style" : + { + "navigationBarTitleText" : "", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/setup/index", + "style" : + { + "navigationBarTitleText" : "设置", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + // "path": "pages/all/all", + // "style": { + // "navigationBarTitleText": "全部", + // "navigationBarBackgroundColor": "#284CD1" + // } + },{ + // "path": "pages/shoppingtrolley/shoppingtrolley", + // "style": { + // "navigationBarTitleText": "购物车", + // "navigationBarBackgroundColor": "#284CD1" + // } + },{ + "path": "pages/personal/personal", + "style": { + "navigationBarTitleText": "我的", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + // "path" : "pages/index/searchfor", + // "style" : + // { + // "navigationBarTitleText" : "搜索", + // "navigationBarBackgroundColor": "#284CD1" + // } + }, + + { + // "path" : "pages/index/addshoppingcart", + // "style" : + // { + // "navigationBarTitleText" : "加入购物车", + // "navigationBarBackgroundColor": "#284CD1" + // } + },{ + "path" : "pages/personal/mysignup/notice", + "style" : + { + "navigationBarTitleText" : "我的报名", + "navigationBarBackgroundColor": "#284CD1" + } + }, + + { + "path" : "pages/personal/ordernumber/ordernumber", + "style" : + { + "navigationBarTitleText" : "我的订单", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/index/testtraining/testtraining", + "style" : + { + "navigationBarTitleText" : "培训服务", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/index/outsourcing/outsourcing", + "style" : + { + "navigationBarTitleText" : "人力服务", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/index/toolleasing/toolleasing", + "style" : + { + "navigationBarTitleText" : "工具服务", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/index/toolleasing/tooldetails", + "style" : + { + "navigationBarTitleText" : "工具详情", + "navigationBarBackgroundColor": "#284CD1", + "app-plus":{ + "scrollIndicator":"none" + } + } + }, + { + "path" : "pages/index/testcrowdsourc/testcrowdsourc", + "style" : + { + "navigationBarTitleText" : "众包服务", + "navigationBarBackgroundColor": "#284CD1" + // "enablePullDownRefresh": true, //设置参数为true + // "onReachBottomDistance":100 //距离底部多远时触发 单位为px + } + }, + { + "path" : "pages/index/testcrowdsourc/crowdsourcingdetails", + "style" : + { + "navigationBarTitleText" : "", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/index/customerservice", + "style" : + { + "navigationBarTitleText" : "客服", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + // "path" : "pages/all/dynamicdetails", + // "style" : + // { + // "navigationBarTitleText" : "动态详情", + // "navigationBarBackgroundColor": "#284CD1" + // } + },{ + "path" : "pages/personal/login", + "style" : + { + "navigationBarTitleText" : "登录关键测试宝", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/phonelogin", + "style" : + { + "navigationBarTitleText" : "关键测试宝", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/index/testtraining/signup", + "style" : + { + "navigationBarTitleText" : "", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/personal/leavemessage/index", + "style" : + { + "navigationBarTitleText" : "我的留言", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/setup/aboutus", + "style" : + { + "navigationBarTitleText" : "关于我们", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/personal/setup/certification", + "style" : + { + "navigationBarTitleText" : "实名认证", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/message/message", + "style" : + { + "navigationBarTitleText" : "消息中心", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/setup/pcweb", + "style" : + { + "navigationBarTitleText" : "关键测试宝", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/personal/mycrowdtest/mycrowdtest", + "style" : + { + "navigationBarTitleText" : "我的众包", + "navigationBarBackgroundColor": "#284CD1" + } + }, + + { + "path" : "pages/personal/setup/transaction", + "style" : + { + "navigationBarTitleText" : "交易记录", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/personal/setup/tranpassword", + "style" : + { + "navigationBarTitleText" : "交易密码", + "navigationBarBackgroundColor": "#284CD1" + } + }, + + { + "path" : "pages/personal/setup/pclogin", + "style" : + { + "navigationBarTitleText" : "设置密码", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/setup/Withdrawal", + "style" : + { + "navigationBarTitleText" : "金额提现", + "navigationBarBackgroundColor": "#284CD1" + } + },{ + "path" : "pages/personal/setup/accountoverview", + "style" : + { + "navigationBarTitleText" : "", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path" : "pages/personal/personalresume/basicinform", + "style" : + { + "navigationBarTitleText" : "基本信息", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path": "pages/index/test", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path": "pages/personal/setup/peixunban", + "style": { + "navigationBarTitleText": "培训班", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path": "pages/personal/setup/usepeople", + "style": { + "navigationBarTitleText": "用人需求", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path": "pages/personal/setup/myreview", + "style": { + "navigationBarTitleText": "我的评价", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path": "pages/index/testcrowdsourc/companyInfo", + "style": { + "navigationBarTitleText": "发布者主页", + "navigationBarBackgroundColor": "#284CD1" + } + }, + { + "path": "pages/personal/setup/guide", + "style": { + "navigationBarTitleText": "PC端使用指南", + "navigationBarBackgroundColor": "#284CD1" + } + } + + + + + + + + + + + + + + + + + + + + + + + + + ], + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8" + }, + "tabBar": { + "color" : "#7A7E83", + // "selectedColor" : "#7A7E83", + "selectedColor" : "#1578ED", + "borderStyle" : "black", + "backgroundColor" : "#F8F8F8", + "list":[ + { + "pagePath" : "pages/index/index", + "iconPath" : "static/index/index.png", + "selectedIconPath" : "static/index/activeindex.png", + "text" : "首页" + }, + // { + // "pagePath" : "pages/message/message", + // "iconPath" : "static/index/message.png", + // "selectedIconPath" : "static/index/activemessage.png", + // "text" : "消息" + // }, + { + "pagePath" : "pages/index/testcrowdsourc/testcrowdsourc", + "iconPath" : "static/index/cedt.png", + "selectedIconPath" : "static/index/actcedt.png", + "text" : "众包大厅" + }, + // { + // "pagePath" : "pages/all/all", + // "iconPath" : "static/index/all.png", + // "selectedIconPath" : "static/index/activeall.png", + // "text" : "全部" + // }, + + // { + // "pagePath" : "pages/shoppingtrolley/shoppingtrolley", + // "iconPath" : "static/index/shopping.png", + // "selectedIconPath" : "static/index/activeshopping.png", + // "text" : "购物车" + // }, + { + "pagePath" : "pages/personal/personal", + "iconPath" : "static/index/person.png", + "selectedIconPath" : "static/index/activeperson.png", + "text" : "我的" + } + ] + }, + "uniIdRouter": {} +} diff --git a/pages/all/all.vue b/pages/all/all.vue new file mode 100644 index 0000000..31e45fe --- /dev/null +++ b/pages/all/all.vue @@ -0,0 +1,596 @@ + + + + + diff --git a/pages/all/dynamicdetails.vue b/pages/all/dynamicdetails.vue new file mode 100644 index 0000000..bc7defc --- /dev/null +++ b/pages/all/dynamicdetails.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/pages/index/addshoppingcart.vue b/pages/index/addshoppingcart.vue new file mode 100644 index 0000000..698a994 --- /dev/null +++ b/pages/index/addshoppingcart.vue @@ -0,0 +1,135 @@ + + + + + diff --git a/pages/index/customerservice.vue b/pages/index/customerservice.vue new file mode 100644 index 0000000..3bc5e7e --- /dev/null +++ b/pages/index/customerservice.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..db9b2e7 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,702 @@ + + + + + \ No newline at end of file diff --git a/pages/index/outsourcing/outsourcing.vue b/pages/index/outsourcing/outsourcing.vue new file mode 100644 index 0000000..8a66734 --- /dev/null +++ b/pages/index/outsourcing/outsourcing.vue @@ -0,0 +1,1113 @@ + + + + + \ No newline at end of file diff --git a/pages/index/searchfor.vue b/pages/index/searchfor.vue new file mode 100644 index 0000000..dee7065 --- /dev/null +++ b/pages/index/searchfor.vue @@ -0,0 +1,237 @@ + + + + + + + + + diff --git a/pages/index/test.vue b/pages/index/test.vue new file mode 100644 index 0000000..98811cb --- /dev/null +++ b/pages/index/test.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/pages/index/testcrowdsourc/companyInfo.vue b/pages/index/testcrowdsourc/companyInfo.vue new file mode 100644 index 0000000..26819c4 --- /dev/null +++ b/pages/index/testcrowdsourc/companyInfo.vue @@ -0,0 +1,381 @@ + + + + + \ No newline at end of file diff --git a/pages/index/testcrowdsourc/crowdsourcingdetails.vue b/pages/index/testcrowdsourc/crowdsourcingdetails.vue new file mode 100644 index 0000000..8612aeb --- /dev/null +++ b/pages/index/testcrowdsourc/crowdsourcingdetails.vue @@ -0,0 +1,995 @@ + + + + + \ No newline at end of file diff --git a/pages/index/testcrowdsourc/testcrowdsourc.vue b/pages/index/testcrowdsourc/testcrowdsourc.vue new file mode 100644 index 0000000..2a167d9 --- /dev/null +++ b/pages/index/testcrowdsourc/testcrowdsourc.vue @@ -0,0 +1,2618 @@ + + + + + \ No newline at end of file diff --git a/pages/index/testcrowdsourc/testcrowdsourcChange.vue b/pages/index/testcrowdsourc/testcrowdsourcChange.vue new file mode 100644 index 0000000..235881c --- /dev/null +++ b/pages/index/testcrowdsourc/testcrowdsourcChange.vue @@ -0,0 +1,2625 @@ + + + + + \ No newline at end of file diff --git a/pages/index/testtraining/signup.vue b/pages/index/testtraining/signup.vue new file mode 100644 index 0000000..5f412f6 --- /dev/null +++ b/pages/index/testtraining/signup.vue @@ -0,0 +1,695 @@ + + + + + + diff --git a/pages/index/testtraining/testtraining.old2vue b/pages/index/testtraining/testtraining.old2vue new file mode 100644 index 0000000..b40de78 --- /dev/null +++ b/pages/index/testtraining/testtraining.old2vue @@ -0,0 +1,926 @@ + + + + + diff --git a/pages/index/testtraining/testtraining.vue b/pages/index/testtraining/testtraining.vue new file mode 100644 index 0000000..fbc24c1 --- /dev/null +++ b/pages/index/testtraining/testtraining.vue @@ -0,0 +1,2193 @@ + + + + + \ No newline at end of file diff --git a/pages/index/testtraining/testtrainingold.vue b/pages/index/testtraining/testtrainingold.vue new file mode 100644 index 0000000..57602a5 --- /dev/null +++ b/pages/index/testtraining/testtrainingold.vue @@ -0,0 +1,670 @@ + + + + + diff --git a/pages/index/toolleasing/tooldetails.vue b/pages/index/toolleasing/tooldetails.vue new file mode 100644 index 0000000..dcd352e --- /dev/null +++ b/pages/index/toolleasing/tooldetails.vue @@ -0,0 +1,746 @@ + + + + + \ No newline at end of file diff --git a/pages/index/toolleasing/tooldetailsold.vue b/pages/index/toolleasing/tooldetailsold.vue new file mode 100644 index 0000000..f7586eb --- /dev/null +++ b/pages/index/toolleasing/tooldetailsold.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/pages/index/toolleasing/toolleasing.vue b/pages/index/toolleasing/toolleasing.vue new file mode 100644 index 0000000..ef375c9 --- /dev/null +++ b/pages/index/toolleasing/toolleasing.vue @@ -0,0 +1,295 @@ + + + + + \ No newline at end of file diff --git a/pages/index/toolleasing/toolleasingold.vue b/pages/index/toolleasing/toolleasingold.vue new file mode 100644 index 0000000..342f4e1 --- /dev/null +++ b/pages/index/toolleasing/toolleasingold.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/pages/message/message.vue b/pages/message/message.vue new file mode 100644 index 0000000..6f4d84d --- /dev/null +++ b/pages/message/message.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/pages/personal/leavemessage/index.vue b/pages/personal/leavemessage/index.vue new file mode 100644 index 0000000..6245d01 --- /dev/null +++ b/pages/personal/leavemessage/index.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/pages/personal/login.vue b/pages/personal/login.vue new file mode 100644 index 0000000..3b709da --- /dev/null +++ b/pages/personal/login.vue @@ -0,0 +1,177 @@ + + + + + \ No newline at end of file diff --git a/pages/personal/mycrowdtest/mycrowdtest.vue b/pages/personal/mycrowdtest/mycrowdtest.vue new file mode 100644 index 0000000..5ad7866 --- /dev/null +++ b/pages/personal/mycrowdtest/mycrowdtest.vue @@ -0,0 +1,367 @@ + + + + + \ No newline at end of file diff --git a/pages/personal/mysignup/notice.vue b/pages/personal/mysignup/notice.vue new file mode 100644 index 0000000..5249952 --- /dev/null +++ b/pages/personal/mysignup/notice.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/pages/personal/mytestkit/mytestkit.vue b/pages/personal/mytestkit/mytestkit.vue new file mode 100644 index 0000000..0876365 --- /dev/null +++ b/pages/personal/mytestkit/mytestkit.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/pages/personal/ordernumber/ordernumber.vue b/pages/personal/ordernumber/ordernumber.vue new file mode 100644 index 0000000..2621ab7 --- /dev/null +++ b/pages/personal/ordernumber/ordernumber.vue @@ -0,0 +1,444 @@ + + + + + \ No newline at end of file diff --git a/pages/personal/personal - 副本.vue b/pages/personal/personal - 副本.vue new file mode 100644 index 0000000..5bee51c --- /dev/null +++ b/pages/personal/personal - 副本.vue @@ -0,0 +1,474 @@ + + + + + diff --git a/pages/personal/personal.vue b/pages/personal/personal.vue new file mode 100644 index 0000000..1eb8638 --- /dev/null +++ b/pages/personal/personal.vue @@ -0,0 +1,545 @@ + + + + + diff --git a/pages/personal/personalresume/advantage.vue b/pages/personal/personalresume/advantage.vue new file mode 100644 index 0000000..7963561 --- /dev/null +++ b/pages/personal/personalresume/advantage.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/pages/personal/personalresume/basicinform.vue b/pages/personal/personalresume/basicinform.vue new file mode 100644 index 0000000..8ec1a3b --- /dev/null +++ b/pages/personal/personalresume/basicinform.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/pages/personal/personalresume/personalresume.vue b/pages/personal/personalresume/personalresume.vue new file mode 100644 index 0000000..6d727ee --- /dev/null +++ b/pages/personal/personalresume/personalresume.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/pages/personal/personalresume/projectexperience.vue b/pages/personal/personalresume/projectexperience.vue new file mode 100644 index 0000000..e5c8bbf --- /dev/null +++ b/pages/personal/personalresume/projectexperience.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/pages/personal/personalresume/workexperience.vue b/pages/personal/personalresume/workexperience.vue new file mode 100644 index 0000000..7314df5 --- /dev/null +++ b/pages/personal/personalresume/workexperience.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/pages/personal/phonelogin.vue b/pages/personal/phonelogin.vue new file mode 100644 index 0000000..adc4214 --- /dev/null +++ b/pages/personal/phonelogin.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/pages/personal/privacy.vue b/pages/personal/privacy.vue new file mode 100644 index 0000000..5c7e620 --- /dev/null +++ b/pages/personal/privacy.vue @@ -0,0 +1,266 @@ + + + + + diff --git a/pages/personal/setup/Information.vue b/pages/personal/setup/Information.vue new file mode 100644 index 0000000..70d759b --- /dev/null +++ b/pages/personal/setup/Information.vue @@ -0,0 +1,316 @@ + + + + + diff --git a/pages/personal/setup/Withdrawal.vue b/pages/personal/setup/Withdrawal.vue new file mode 100644 index 0000000..d633211 --- /dev/null +++ b/pages/personal/setup/Withdrawal.vue @@ -0,0 +1,216 @@ + + + + + diff --git a/pages/personal/setup/aboutus.vue b/pages/personal/setup/aboutus.vue new file mode 100644 index 0000000..cec4c62 --- /dev/null +++ b/pages/personal/setup/aboutus.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/pages/personal/setup/accountoverview.vue b/pages/personal/setup/accountoverview.vue new file mode 100644 index 0000000..60f46dc --- /dev/null +++ b/pages/personal/setup/accountoverview.vue @@ -0,0 +1,502 @@ + + + + + diff --git a/pages/personal/setup/certification.vue b/pages/personal/setup/certification.vue new file mode 100644 index 0000000..bfe5880 --- /dev/null +++ b/pages/personal/setup/certification.vue @@ -0,0 +1,435 @@ + + + + + diff --git a/pages/personal/setup/guide.vue b/pages/personal/setup/guide.vue new file mode 100644 index 0000000..95fbd03 --- /dev/null +++ b/pages/personal/setup/guide.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/pages/personal/setup/index.vue b/pages/personal/setup/index.vue new file mode 100644 index 0000000..d790d63 --- /dev/null +++ b/pages/personal/setup/index.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/pages/personal/setup/myreview.vue b/pages/personal/setup/myreview.vue new file mode 100644 index 0000000..774f8ac --- /dev/null +++ b/pages/personal/setup/myreview.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file diff --git a/pages/personal/setup/oldcertification.vue b/pages/personal/setup/oldcertification.vue new file mode 100644 index 0000000..c474652 --- /dev/null +++ b/pages/personal/setup/oldcertification.vue @@ -0,0 +1,442 @@ + + + + + diff --git a/pages/personal/setup/pclogin.vue b/pages/personal/setup/pclogin.vue new file mode 100644 index 0000000..e7ec680 --- /dev/null +++ b/pages/personal/setup/pclogin.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/pages/personal/setup/pcweb.vue b/pages/personal/setup/pcweb.vue new file mode 100644 index 0000000..94d2dee --- /dev/null +++ b/pages/personal/setup/pcweb.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/pages/personal/setup/peixunban.vue b/pages/personal/setup/peixunban.vue new file mode 100644 index 0000000..2b71436 --- /dev/null +++ b/pages/personal/setup/peixunban.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/pages/personal/setup/tranpassword.vue b/pages/personal/setup/tranpassword.vue new file mode 100644 index 0000000..8b97fc2 --- /dev/null +++ b/pages/personal/setup/tranpassword.vue @@ -0,0 +1,213 @@ + + + + + diff --git a/pages/personal/setup/transaction.vue b/pages/personal/setup/transaction.vue new file mode 100644 index 0000000..9698d26 --- /dev/null +++ b/pages/personal/setup/transaction.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/pages/personal/setup/usepeople.vue b/pages/personal/setup/usepeople.vue new file mode 100644 index 0000000..1596587 --- /dev/null +++ b/pages/personal/setup/usepeople.vue @@ -0,0 +1,157 @@ + + + + + \ No newline at end of file diff --git a/pages/personal/userAgreemen.vue b/pages/personal/userAgreemen.vue new file mode 100644 index 0000000..ed36ac2 --- /dev/null +++ b/pages/personal/userAgreemen.vue @@ -0,0 +1,381 @@ + + + + + diff --git a/pages/shoppingtrolley/shoppingtrolley.vue b/pages/shoppingtrolley/shoppingtrolley.vue new file mode 100644 index 0000000..3c98bcb --- /dev/null +++ b/pages/shoppingtrolley/shoppingtrolley.vue @@ -0,0 +1,378 @@ + + + + + diff --git a/pages/shoppingtrolley/shoppingtrolleyold.vue b/pages/shoppingtrolley/shoppingtrolleyold.vue new file mode 100644 index 0000000..00ada96 --- /dev/null +++ b/pages/shoppingtrolley/shoppingtrolleyold.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..a01554e --- /dev/null +++ b/project.config.json @@ -0,0 +1,33 @@ +{ + "appid": "wx0606cba78611e49b", + "compileType": "miniprogram", + "libVersion": "3.2.2", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "ignoreDevUnusedFiles": false, + "ignoreUploadUnusedFiles": false, + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "condition": false + }, + "miniprogramRoot": "unpackage/dist/dev/mp-weixin/", + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "srcMiniprogramRoot": "unpackage/dist/dev/mp-weixin/" +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..7bd6e6a --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "keysaas-app", + "setting": { + "compileHotReLoad": true + } +} \ No newline at end of file diff --git a/static/crowd/PAYB.png b/static/crowd/PAYB.png new file mode 100644 index 0000000..56a6bce Binary files /dev/null and b/static/crowd/PAYB.png differ diff --git a/static/crowd/add.png b/static/crowd/add.png new file mode 100644 index 0000000..35c18d0 Binary files /dev/null and b/static/crowd/add.png differ diff --git a/static/crowd/bankcad.png b/static/crowd/bankcad.png new file mode 100644 index 0000000..d8007b0 Binary files /dev/null and b/static/crowd/bankcad.png differ diff --git a/static/crowd/commny.png b/static/crowd/commny.png new file mode 100644 index 0000000..1f78eff Binary files /dev/null and b/static/crowd/commny.png differ diff --git a/static/crowd/daxue.png b/static/crowd/daxue.png new file mode 100644 index 0000000..a88034d Binary files /dev/null and b/static/crowd/daxue.png differ diff --git a/static/crowd/defaultAva.jpg b/static/crowd/defaultAva.jpg new file mode 100644 index 0000000..2ae42b8 Binary files /dev/null and b/static/crowd/defaultAva.jpg differ diff --git a/static/crowd/email.png b/static/crowd/email.png new file mode 100644 index 0000000..fac0c47 Binary files /dev/null and b/static/crowd/email.png differ diff --git a/static/crowd/fjupload.png b/static/crowd/fjupload.png new file mode 100644 index 0000000..d68abbf Binary files /dev/null and b/static/crowd/fjupload.png differ diff --git a/static/crowd/lesftt.png b/static/crowd/lesftt.png new file mode 100644 index 0000000..03e42f0 Binary files /dev/null and b/static/crowd/lesftt.png differ diff --git a/static/crowd/like.png b/static/crowd/like.png new file mode 100644 index 0000000..495b0d2 Binary files /dev/null and b/static/crowd/like.png differ diff --git a/static/crowd/noemail.png b/static/crowd/noemail.png new file mode 100644 index 0000000..2e87243 Binary files /dev/null and b/static/crowd/noemail.png differ diff --git a/static/crowd/nophone.png b/static/crowd/nophone.png new file mode 100644 index 0000000..b30e54a Binary files /dev/null and b/static/crowd/nophone.png differ diff --git a/static/crowd/phone.png b/static/crowd/phone.png new file mode 100644 index 0000000..81b2bf6 Binary files /dev/null and b/static/crowd/phone.png differ diff --git a/static/crowd/reeamil.png b/static/crowd/reeamil.png new file mode 100644 index 0000000..8bbd96e Binary files /dev/null and b/static/crowd/reeamil.png differ diff --git a/static/crowd/rihhj.png b/static/crowd/rihhj.png new file mode 100644 index 0000000..e0e8965 Binary files /dev/null and b/static/crowd/rihhj.png differ diff --git a/static/crowd/setpx.png b/static/crowd/setpx.png new file mode 100644 index 0000000..8de194b Binary files /dev/null and b/static/crowd/setpx.png differ diff --git a/static/crowd/setyr.png b/static/crowd/setyr.png new file mode 100644 index 0000000..b183cd7 Binary files /dev/null and b/static/crowd/setyr.png differ diff --git a/static/crowd/success.png b/static/crowd/success.png new file mode 100644 index 0000000..35bd79d Binary files /dev/null and b/static/crowd/success.png differ diff --git a/static/crowd/tubiao1.png b/static/crowd/tubiao1.png new file mode 100644 index 0000000..43b0f8d Binary files /dev/null and b/static/crowd/tubiao1.png differ diff --git a/static/crowd/upload.png b/static/crowd/upload.png new file mode 100644 index 0000000..b217cd1 Binary files /dev/null and b/static/crowd/upload.png differ diff --git a/static/crowd/zhuanye.png b/static/crowd/zhuanye.png new file mode 100644 index 0000000..65fc406 Binary files /dev/null and b/static/crowd/zhuanye.png differ diff --git a/static/crowd/zhuyi.png b/static/crowd/zhuyi.png new file mode 100644 index 0000000..428dc54 Binary files /dev/null and b/static/crowd/zhuyi.png differ diff --git a/static/index/actcedt.png b/static/index/actcedt.png new file mode 100644 index 0000000..798d479 Binary files /dev/null and b/static/index/actcedt.png differ diff --git a/static/index/activeall.png b/static/index/activeall.png new file mode 100644 index 0000000..5b0244d Binary files /dev/null and b/static/index/activeall.png differ diff --git a/static/index/activeindex.png b/static/index/activeindex.png new file mode 100644 index 0000000..739114f Binary files /dev/null and b/static/index/activeindex.png differ diff --git a/static/index/activemessage.png b/static/index/activemessage.png new file mode 100644 index 0000000..7ec4701 Binary files /dev/null and b/static/index/activemessage.png differ diff --git a/static/index/activeperson.png b/static/index/activeperson.png new file mode 100644 index 0000000..2197be6 Binary files /dev/null and b/static/index/activeperson.png differ diff --git a/static/index/activeshopping.png b/static/index/activeshopping.png new file mode 100644 index 0000000..1c6e0f8 Binary files /dev/null and b/static/index/activeshopping.png differ diff --git a/static/index/all.png b/static/index/all.png new file mode 100644 index 0000000..40bd4f3 Binary files /dev/null and b/static/index/all.png differ diff --git a/static/index/baoming.png b/static/index/baoming.png new file mode 100644 index 0000000..8112169 Binary files /dev/null and b/static/index/baoming.png differ diff --git a/static/index/cedt.png b/static/index/cedt.png new file mode 100644 index 0000000..e147b41 Binary files /dev/null and b/static/index/cedt.png differ diff --git a/static/index/dd.png b/static/index/dd.png new file mode 100644 index 0000000..6635fbb Binary files /dev/null and b/static/index/dd.png differ diff --git a/static/index/downarrow.png b/static/index/downarrow.png new file mode 100644 index 0000000..91b4474 Binary files /dev/null and b/static/index/downarrow.png differ diff --git a/static/index/duihuazixun.png b/static/index/duihuazixun.png new file mode 100644 index 0000000..fda75e2 Binary files /dev/null and b/static/index/duihuazixun.png differ diff --git a/static/index/grxx.png b/static/index/grxx.png new file mode 100644 index 0000000..be38b33 Binary files /dev/null and b/static/index/grxx.png differ diff --git a/static/index/gzjl.png b/static/index/gzjl.png new file mode 100644 index 0000000..7806f70 Binary files /dev/null and b/static/index/gzjl.png differ diff --git a/static/index/index.png b/static/index/index.png new file mode 100644 index 0000000..3729d60 Binary files /dev/null and b/static/index/index.png differ diff --git a/static/index/jnzs.png b/static/index/jnzs.png new file mode 100644 index 0000000..d83cf8e Binary files /dev/null and b/static/index/jnzs.png differ diff --git a/static/index/kf.png b/static/index/kf.png new file mode 100644 index 0000000..ad91c18 Binary files /dev/null and b/static/index/kf.png differ diff --git a/static/index/logo.png b/static/index/logo.png new file mode 100644 index 0000000..50fe5c1 Binary files /dev/null and b/static/index/logo.png differ diff --git a/static/index/message.png b/static/index/message.png new file mode 100644 index 0000000..497b865 Binary files /dev/null and b/static/index/message.png differ diff --git a/static/index/myper.png b/static/index/myper.png new file mode 100644 index 0000000..92abf0d Binary files /dev/null and b/static/index/myper.png differ diff --git a/static/index/mysignup.png b/static/index/mysignup.png new file mode 100644 index 0000000..d1e7601 Binary files /dev/null and b/static/index/mysignup.png differ diff --git a/static/index/person.png b/static/index/person.png new file mode 100644 index 0000000..bde743d Binary files /dev/null and b/static/index/person.png differ diff --git a/static/index/rnotice.png b/static/index/rnotice.png new file mode 100644 index 0000000..3ca63f6 Binary files /dev/null and b/static/index/rnotice.png differ diff --git a/static/index/shopping.png b/static/index/shopping.png new file mode 100644 index 0000000..1235bbc Binary files /dev/null and b/static/index/shopping.png differ diff --git a/static/index/success.png b/static/index/success.png new file mode 100644 index 0000000..cacd2bd Binary files /dev/null and b/static/index/success.png differ diff --git a/static/index/testkit.png b/static/index/testkit.png new file mode 100644 index 0000000..fe0f848 Binary files /dev/null and b/static/index/testkit.png differ diff --git a/static/index/tj.png b/static/index/tj.png new file mode 100644 index 0000000..cd301fb Binary files /dev/null and b/static/index/tj.png differ diff --git a/static/index/xiala.png b/static/index/xiala.png new file mode 100644 index 0000000..ed1a0f5 Binary files /dev/null and b/static/index/xiala.png differ diff --git a/static/index/zc.png b/static/index/zc.png new file mode 100644 index 0000000..d9e789f Binary files /dev/null and b/static/index/zc.png differ diff --git a/uni.promisify.adaptor.js b/uni.promisify.adaptor.js new file mode 100644 index 0000000..47fbce1 --- /dev/null +++ b/uni.promisify.adaptor.js @@ -0,0 +1,10 @@ +uni.addInterceptor({ + returnValue (res) { + if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) { + return res; + } + return new Promise((resolve, reject) => { + res.then((res) => res[0] ? reject(res[0]) : resolve(res[1])); + }); + }, +}); \ No newline at end of file diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..625a190 --- /dev/null +++ b/uni.scss @@ -0,0 +1,76 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ + +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ + +/* 颜色变量 */ +@import 'uview-ui/theme.scss'; +/* 行为相关颜色 */ +$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:12px; +$uni-font-size-base:14px; +$uni-font-size-lg:16; + +/* 图片尺寸 */ +$uni-img-size-sm:20px; +$uni-img-size-base:26px; +$uni-img-size-lg:40px; + +/* Border Radius */ +$uni-border-radius-sm: 2px; +$uni-border-radius-base: 3px; +$uni-border-radius-lg: 6px; +$uni-border-radius-circle: 50%; + +/* 水平间距 */ +$uni-spacing-row-sm: 5px; +$uni-spacing-row-base: 10px; +$uni-spacing-row-lg: 15px; + +/* 垂直间距 */ +$uni-spacing-col-sm: 4px; +$uni-spacing-col-base: 8px; +$uni-spacing-col-lg: 12px; + +/* 透明度 */ +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 + +/* 文章场景相关 */ +$uni-color-title: #2C405A; // 文章标题颜色 +$uni-font-size-title:20px; +$uni-color-subtitle: #555555; // 二级标题颜色 +$uni-font-size-subtitle:26px; +$uni-color-paragraph: #3F536E; // 文章段落颜色 +$uni-font-size-paragraph:15px; diff --git a/uni_modules/uni-number-box/changelog.md b/uni_modules/uni-number-box/changelog.md new file mode 100644 index 0000000..aab060d --- /dev/null +++ b/uni_modules/uni-number-box/changelog.md @@ -0,0 +1,29 @@ +## 1.2.3(2023-05-23) +更新示例工程 +## 1.2.2(2023-05-08) +- 修复 change 事件执行顺序错误的问题 +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.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-number-box](https://uniapp.dcloud.io/component/uniui/uni-number-box) +## 1.1.2(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.1.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.1.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.7(2021-05-12) +- 新增 组件示例地址 +## 1.0.6(2021-04-20) +- 修复 uni-number-box 浮点数运算不精确的 bug +- 修复 uni-number-box change 事件触发不正确的 bug +- 新增 uni-number-box v-model 双向绑定 +## 1.0.5(2021-02-05) +- 调整为uni_modules目录规范 + +## 1.0.7(2021-02-05) +- 调整为uni_modules目录规范 +- 新增 支持 v-model +- 新增 支持 focus、blur 事件 +- 新增 支持 PC 端 diff --git a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue new file mode 100644 index 0000000..5876be2 --- /dev/null +++ b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue @@ -0,0 +1,223 @@ + + + diff --git a/uni_modules/uni-number-box/package.json b/uni_modules/uni-number-box/package.json new file mode 100644 index 0000000..743d2e4 --- /dev/null +++ b/uni_modules/uni-number-box/package.json @@ -0,0 +1,82 @@ +{ + "id": "uni-number-box", + "displayName": "uni-number-box 数字输入框", + "version": "1.2.3", + "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。", + "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-number-box/readme.md b/uni_modules/uni-number-box/readme.md new file mode 100644 index 0000000..affc56f --- /dev/null +++ b/uni_modules/uni-number-box/readme.md @@ -0,0 +1,13 @@ + + +## NumberBox 数字输入框 +> **组件名:uni-number-box** +> 代码块: `uNumberBox` + + +带加减按钮的数字输入框。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-number-box) +#### 如使用过程中有任何问题,或者您对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/utils/comstemutil.js b/utils/comstemutil.js new file mode 100644 index 0000000..9304088 --- /dev/null +++ b/utils/comstemutil.js @@ -0,0 +1,311 @@ +import http from "./http"; +function wxloginmethod(data) { + let wxloginurl = '/wx/auth/wxlogin'; + return new Promise((resolve, reject) => { + uni.login({ + provider: 'weixin', + success: function(loginRes) { + uni.showLoading('正在登录中...'); + console.log('loginRes--',loginRes) + data.code=loginRes.code + console.log('data组织传给后台接口--',data) + // 获取 sessionKey openid unionid + // return; + http.quickPost(`${wxloginurl}`, data).then(res => { + console.log('登录成功1',res) + uni.hideLoading(); + if(res.data.code === 0) { + console.log('登录成功',res.data) + let {sessionKey, openid, unionid} = res.data.data; + resolve({sessionKey, openid, unionid}) + uni.setStorageSync('sessionKey', sessionKey); + uni.setStorageSync('openid', openid) + uni.setStorageSync('unionid', unionid) + } else { + reject(res.data) + } + }).catch((err)=>{ + reject(err) + }); + }, + fail(res) { + reject(res) + } + }); + }) +} +function saveWxUserInfoLocal (userInfo) { + uni.setStorageSync('wxUserInfo', userInfo) +} +//获取用户信息info +function getWxUserInfoServer (sessionKey, signature, rawData, encryptedData, iv) { + let wxinfourl = '/equestrianinfo/wxma/info/wx9d9f429ba1775063'; + return new Promise((resolve, reject) => { + http.quickPost(`${wxinfourl}`, + {sessionKey, signature, rawData, encryptedData, iv}) + .then(res => { + if (res.data.code === 0) { + uni.setStorageSync('wxUserInfo', res.data.data) + resolve(res.data.data) + } else { + reject(res.data) + } + }).catch((err)=>{ + reject(err) + }) + }) +} +//获取用户手机号信息 +function getWxUserPhoneServer (sessionKey, signature, encryptedData, iv) { + let wxphoneurl = '/equestrianinfo/wxma/phone/wx9d9f429ba1775063'; + return new Promise((resolve, reject) => { + http.quickPost(`${wxphoneurl}`, + {sessionKey, signature, encryptedData, iv}) + .then(res => { + if (res.data.code === 0) { + uni.setStorageSync('wxPhoneInfo', res.data.data) + resolve(res.data.data) + } else { + reject(res.data) + } + }).catch((err)=>{ + reject(err) + }) + }) +} +function registerUserInfo() { + let regurl = '/equestrianinfo/wxma/register'; + if (http.devStatus) { + regurl = http.devUrl + regurl + } + let wxUserInfo = uni.getStorageSync('wxUserInfo'); + let wxPhoneInfo = uni.getStorageSync('wxPhoneInfo'); + let {avatarUrl,city, country, gender,language,nickName, openId,province,unionId} = wxUserInfo + let {phoneNumber,countryCode, purePhoneNumber} = wxPhoneInfo; + return new Promise((resolve, reject) => { + http.quickPost(regurl, + {avatarUrl,city, country, gender,language,nickName, openId,province,unionId, phoneNumber,countryCode, purePhoneNumber}).then((res)=>{ + console.log('registerUserInfo:', res.data); + if(res.data.code === 0) { resolve(res.data.data) } + else { reject(res.data)} + }).catch((err)=>{ reject(err); }) + }) +} +/*function refreshToken(){ + let rturl = '/auth/oauth/token'; + if (http.devStatus) { + rturl = http.devUrl + rturl + } + let refresh_token = uni.getStorageSync('refreshToken') + return new Promise((resolve, reject) => { + http.post(rturl, + {refresh_token, grant_type:'refresh_token', scope:'server' }).then((res)=>{ + if(res.data.code === 0) { + let {access_token,refresh_token,expires_in,username} = res.data.data; + console.log('access_token:', access_token,'refresh_token:', refresh_token, 'expires_in:', expires_in); + uni.setStorageSync('accessToken', access_token) + uni.setStorageSync('refreshToken', refresh_token) + uni.setStorageSync('expiresIn', expires_in) + // uni.setStorageSync('username', user_name) + resolve() + } else { + reject(res.data) + } + }).catch((err)=>{ + reject(err) + }) + }) +}*/ + +function refreshToken(){ + let rturl = '/auth/oauth/token'; + if (http.devStatus) { + rturl = http.devUrl + rturl + } + let refresh_token = uni.getStorageSync('refreshToken'); + /*http.post(rturl, + {refresh_token, grant_type:'refresh_token', scope:'server' }).then((res)=>{ + if(res.data.code === 0) { + let {access_token,refresh_token,expires_in,username} = res.data.data; + console.log('access_token:', access_token,'refresh_token:', refresh_token, 'expires_in:', expires_in); + uni.setStorageSync('accessToken', access_token) + uni.setStorageSync('refreshToken', refresh_token) + uni.setStorageSync('expiresIn', expires_in) + // uni.setStorageSync('username', user_name) + resolve() + } else { + reject(res.data) + } + }).catch((err)=>{ + reject(err) + })*/ + return new Promise((resolve, reject) => { + uni.request({ + url: rturl, + data: {refresh_token, grant_type:'refresh_token', scope:'server' }, + method:'POST', + header:{isToken: false}, + success(res) { + // resolve(res) + if(res.data.code === 0) { + let {access_token,refresh_token,expires_in,username} = res.data.data; + console.log('access_token:', access_token,'refresh_token:', refresh_token, 'expires_in:', expires_in); + uni.setStorageSync('accessToken', access_token) + uni.setStorageSync('refreshToken', refresh_token) + uni.setStorageSync('expiresIn', expires_in) + // uni.setStorageSync('username', user_name) + resolve() + } else { + reject(res.data) + } + }, + fail(err) { + reject(err) + }, + complete() { + //不管请求成没成功都会走这一步 然后隐藏 加载中的效果 + } + }) + }) +} +//退出登录 清空信息 +function systemLogOut() { + uni.setStorageSync('accessToken', '') + uni.setStorageSync('refreshToken', '') + uni.setStorageSync('expiresIn', '') + uni.setStorageSync('personalInfo', null) + uni.setStorageSync('organInfo', null) + uni.setStorageSync('wxUserInfo', null) +} +function systemLogin() { + let adlogurl = '/admin/register/mobile'; + let adsmsurl = '/auth/mobile/token/sms'; + if (http.devStatus) { + adlogurl = http.devUrl + adlogurl + adsmsurl = http.devUrl + adsmsurl + } + return new Promise((resolve, reject) => { + let wxPhoneInfo = uni.getStorageSync('wxPhoneInfo'); + if (!wxPhoneInfo) (reject({ msg:'手机号未授权'})) + let mobile = wxPhoneInfo.purePhoneNumber; + if (!mobile)(reject({msg:'未授权手机号'})) + http.get(`${adlogurl}/${mobile}`,{force:false,debug:true}).then((codeRes)=>{ + let codeData = codeRes.data; + let data = {mobile: 'SMS@' + mobile, code: codeData.msg, grant_type:'mobile'}; + if (codeData.data) { + http.post(adsmsurl, data, null).then((logRes)=>{ + let logResData = logRes.data + if(logResData) { + // logResData = typeof logResData === 'string'? JSON.parse(logResData) : logResData; + let {access_token,refresh_token,expires_in,username} = logResData; + console.log('access_token:', access_token,'refresh_token:', refresh_token, 'expires_in:', expires_in); + + uni.setStorageSync('accessToken', access_token) + uni.setStorageSync('refreshToken', refresh_token) + uni.setStorageSync('expiresIn', expires_in) + uni.setStorageSync('username', username) + uni.setStorageSync('expiresTimeStamp', expires_in * 1000 + new Date().getTime()); + // console.log(access_token,refresh_token,expires_in,'信息:',logResData); + resolve(logResData) + } else { + reject(logRes) + } + }).catch((err)=>{ + reject(err) + }) + } else { + reject({msg:'验证码错误'}) + } + + }) + }); +} +function getSystemUserInfo() { + let sysurl = '/equestrianinfo/wxma/userinfo'; + if (http.devStatus) { + sysurl = http.devUrl + sysurl + } + return new Promise((resolve, reject) => { + http.quickPost(sysurl,null).then((res)=>{ + console.log('logRes', res.data); + if(res.data.code === 0) { + uni.setStorageSync('organInfo', res.data.data.organInfo) + let personalInfo = res.data.data.personalInfo; + uni.setStorageSync('personalInfo', personalInfo) + // console.log('sync:',personalInfo) + // uni.setStorageSync('personalInfo', res.data.data.personalInfo) + resolve(res.data.data) + } else { + reject(res.data); + } + }).catch((err)=>{ + reject(err); + }) + }) +} +function checkSystemLogin() { + return uni.getStorageSync('accessToken'); +} +function checkusernameLogin() { + return uni.getStorageSync('username'); +} +function checkPersonalInfo() { + return uni.getStorageSync('personalInfo'); +} +function checkOrganInfo() { + return uni.getStorageSync('organInfo'); +} +function checkWxUserInfo() { + return uni.getStorageSync('wxUserInfo'); +} +function checkPersonalBaseInfo() { + let personalInfo = uni.getStorageSync('personalInfo'); + if (personalInfo) { + let {id,card,phone,email,fullName, familyPy,namePy,birthday,sex,accountOwner, certificateType,certificateNumber, + idPhoto,province,city,county,postal,addr,country, + certificateImg,otherImg,resumeImg} = personalInfo + // console.log('个人信息:',personalInfo) + let idPhotoList = []; + if (idPhoto && idPhoto.indexOf('http') ===0) { + idPhotoList.push({url: idPhoto}) + } + if(certificateImg&&certificateImg.length>0) { + if(certificateImg[0] && certificateImg[0].path) { certificateImg = []} + } else { certificateImg = []} + if(otherImg&&otherImg.length>0) { + if(otherImg[0] && otherImg[0].path) { otherImg = []} + } else { otherImg = []} + if(resumeImg&&resumeImg.length>0) { + if(resumeImg[0] && resumeImg[0].path) { resumeImg = []} + } else { resumeImg = []} + return {id,card,phone,email,fullName, familyPy,namePy,birthday,sex,accountOwner, certificateType,certificateNumber, + idPhoto,province,city,county,postal,addr,country, + certificateImg,otherImg,resumeImg, idPhotoList}; + } + return personalInfo; +} +function checkPersonalRoleList() { + let personalInfo = uni.getStorageSync('personalInfo'); + if (personalInfo) { + return personalInfo.roleList; + } + return []; +} +export default { + wxloginmethod, + getWxUserInfoServer, + saveWxUserInfoLocal, + getWxUserPhoneServer, + registerUserInfo, + systemLogin, + refreshToken, + systemLogOut, + getSystemUserInfo, + checkSystemLogin, + checkOrganInfo, + checkPersonalInfo, + checkWxUserInfo, + checkPersonalBaseInfo, + checkPersonalRoleList, + checkusernameLogin, +} diff --git a/utils/encrypt.js b/utils/encrypt.js new file mode 100644 index 0000000..ab3e8c7 --- /dev/null +++ b/utils/encrypt.js @@ -0,0 +1,22 @@ +import CryptoJS from 'crypto-js' + +const SECRET_KEY = CryptoJS.enc.Utf8.parse('KeyWareSecretKey'); + + +// 加密 +export function encrypt(data) { + const encrypted = CryptoJS.AES.encrypt(data, SECRET_KEY, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }); + return encrypted.toString(); +} + +// 解密 +export function decrypt(data) { + const decrypted = CryptoJS.AES.decrypt(data, SECRET_KEY, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }) + return decrypted.toString(CryptoJS.enc.Utf8) +} \ No newline at end of file diff --git a/utils/http.js b/utils/http.js new file mode 100644 index 0000000..73aa915 --- /dev/null +++ b/utils/http.js @@ -0,0 +1,152 @@ +import comstemutil from "./comstemutil"; + +//es6 +const baseUrl = 'http://192.168.0.229:9999'; +// const baseUrl = 'http://172.16.36.180:9999'; +// const baseUrl = 'https://www.keyitest.cn/test-api'; +// const baseUrl = 'https://www.keyitest.cn/prod-api'; +// const devUrl = 'http://cloud-gateway:9999'; +const devStatus = false; +const commonhttp = (params, header) => { + return new Promise((resolve, reject) => { + uni.showLoading({ + title: "加载中" + }) + uni.request({ + ...params, + header, + success(res) { + resolve(res) + }, + fail(err) { + reject(err) + }, + complete(res) { + // console.log('--请求-',res) + let statusCode = res.data.code; + // console.log('---',statusCode) + if (statusCode==401){ + // comstemutil.systemLogOut(); + // reject({code:1,msg:'未授权'}) + uni.setStorageSync('accessToken', null) + uni.setStorageSync('wxUserInfo', null) + if(res.data.msg.includes('/my/shoppingCart')||res.data.msg.includes('message/my')){ + uni.setStorageSync('accessToken', null) + uni.setStorageSync('wxUserInfo', null) + }else{ + uni.showToast({ title:'登录失效,请重新登录', icon: 'none', duration:1000 }); + setTimeout(()=>{ + uni.navigateTo({ + url: '/pages/personal/login' + }) + },1000) + } + + } + // 不管请求成没成功都会走这一步 然后隐藏 加载中的效果 + uni.hideLoading() + } + }) + }) +} + // fial:(err)=>{} + // { + // // fail(err) { + // // reject(err) + // // }, + // complete(hide){ + // console.log('--报错-',hide); //可以看到错误信息被打印出来了 + // if(statusCode ==401){ + // reject({code:1,msg:'未授权'}) + // } else { + // uni.showToast({ title: res.data.msg, icon: 'none', duration: 2000 }); + // } + // } + // } + +const request = (params) => { + return new Promise((resolve, reject) => { + let header = {'TENANT-ID': 3}; + // console.log('params',params,) + // header['Authorization'] = 'Basic cGlnOnBpZw=='; + // 身份token信息 + // let {notToken} = {...params} + // console.log('====',notToken) + // if (notToken) { + // header['isToken'] = false; + // } + // const isToken = (header || {}).isToken === false + // if(!isToken){ + // header={isToken:false}; + // } + // console.log('==header==',header) + let accessToken = uni.getStorageSync('accessToken'); + // console.log('tpken--',accessToken) + if (accessToken && params.requireToken) { + // console.log('11111',res) + header['Authorization'] = 'Bearer ' + accessToken; + // let expiresTimeStamp = uni.getStorageSync('expiresTimeStamp'); + // let stamp = expiresTimeStamp - new Date().getTime(); + // if (stamp < 5000) { + // // 刷新 token + // reject({code: 1, msg: '需要刷新token重新登录'}); + /*comstemutil.refreshToken().then(()=>{ + accessToken = uni.getStorageSync('accessToken'); + header['Authorization'] = 'Bearer ' + accessToken; + commonhttp(params, header).then((res)=>{ + resolve(res) + }).catch((err)=>{ + reject(err) + }) + }).catch((err)=>{ + reject(err) + })*/ + // } + } + commonhttp(params, header).then((res)=>{ + resolve(res) + }).catch((err)=>{ + reject(err) + }) + }) +} +const buildQueryStr = (params) => { + if(typeof params === 'string') { return params; } + if(typeof params === 'function') { return ''; } + if(Object.keys(params).length === 0) { return ''; } + let paramArr = []; + Object.keys(params).forEach(kk=>{ paramArr.push(kk + '=' + params[kk]); }) + return paramArr.join('&'); +} +const buildUrl = (baseUrl, url) => { + if(url.indexOf("http") > -1) { + return url; + } + return baseUrl + url; +} +export default { + quickPost(url, data,requireToken){ + console.log('url/',url, data,requireToken) + return request({url: buildUrl(baseUrl , url), data, method:'POST',requireToken}) + }, + post(url, params, data,requireToken){ + let queryStr = params ? '?'+buildQueryStr(params) : ''; + return request({url: buildUrl(baseUrl , url) + queryStr, data, method:'POST',requireToken}) + }, + quickGet(url,requireToken) { + return request({url: baseUrl + url, method:'GET',requireToken}) + }, + get(url,params,requireToken) { + let queryStr = params ? '?'+buildQueryStr(params) : ''; + return request({url: buildUrl(baseUrl , url) + queryStr, method:'GET',requireToken}) + }, + quickDelete(url,requireToken) { + return request({url: buildUrl(baseUrl , url), method:'DELETE',requireToken}) + }, + quickPut(url, data,requireToken) { + return request({url: buildUrl(baseUrl , url), data, method:'PUT',requireToken}) + }, + devStatus, + baseUrl + // devUrl +} diff --git a/utils/mixin/index.js b/utils/mixin/index.js new file mode 100644 index 0000000..9100826 --- /dev/null +++ b/utils/mixin/index.js @@ -0,0 +1,19 @@ +let mixin = { + data(){ + return{ + tasktypelist:[] + } + }, + created() { + this.getDictType() + }, + methods: { + async getDictType() { + const res = await this.http.quickGet('/system/dict/data/type/crowdsourcing_task_type',false) + this.tasktypelist = res.data.data + }, + }, +} + +// 记住,最后一定要导出 +export default mixin diff --git a/utils/mixin/tootype.js b/utils/mixin/tootype.js new file mode 100644 index 0000000..fb0ba52 --- /dev/null +++ b/utils/mixin/tootype.js @@ -0,0 +1,19 @@ +let mixin = { + data(){ + return{ + tooltypelist:[] + } + }, + created() { + this.getToolType() + }, + methods: { + async getToolType() { + const res = await this.http.quickGet('/system/dict/data/type/sys_tool_type',false) + this.tooltypelist = res.data.data + }, + }, +} + +// 记住,最后一定要导出 +export default mixin diff --git a/utils/share.js b/utils/share.js new file mode 100644 index 0000000..ed4cd47 --- /dev/null +++ b/utils/share.js @@ -0,0 +1,21 @@ +export default { + data() { + return {} + }, + //1.配置发送给朋友 + onShareAppMessage() { + return { + title: '关键测试宝', //分享的标题 + path: 'pages/index/index', //点击分享链接之后进入的页面路径 + // imageUrl: '/static/index/logo.png' //分享发送的链接图片地址 + }; + }, + //2.配置分享到朋友圈 + onShareTimeline() { + return { + title: '关键测试宝', //分享的标题 + query: 'pages/index/index', //点击分享链接之后进入的页面路径 + // imageUrl: '/static/index/logo.png' //分享发送的链接图片地址 + } + }, +} \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..bc5e1eb --- /dev/null +++ b/utils/util.js @@ -0,0 +1,320 @@ +import { + validatenull +} from './validate' + + +// 表单序列化 +export const serialize = data => { + const list = [] + Object.keys(data).forEach(ele => { + list.push(`${ele}=${data[ele]}`) + }) + return list.join('&') +} +export const getObjType = obj => { + var toString = Object.prototype.toString + var map = { + '[object Boolean]': 'boolean', + '[object Number]': 'number', + '[object String]': 'string', + '[object Function]': 'function', + '[object Array]': 'array', + '[object Date]': 'date', + '[object RegExp]': 'regExp', + '[object Undefined]': 'undefined', + '[object Null]': 'null', + '[object Object]': 'object' + } + if (obj instanceof Element) { + return 'element' + } + return map[toString.call(obj)] +} +/** + * 对象深拷贝 + */ +export const deepClone = data => { + var type = getObjType(data) + var obj + if (type === 'array') { + obj = [] + } else if (type === 'object') { + obj = {} + } else { + // 不再具有下一层次 + return data + } + if (type === 'array') { + for (var i = 0, len = data.length; i < len; i++) { + obj.push(deepClone(data[i])) + } + } else if (type === 'object') { + for (var key in data) { + obj[key] = deepClone(data[key]) + } + } + return obj +} +/** + * 判断路由是否相等 + */ +export const diff = (obj1, obj2) => { + delete obj1.close + var o1 = obj1 instanceof Object + var o2 = obj2 instanceof Object + if (!o1 || !o2) { + /* 判断不是对象 */ + return obj1 === obj2 + } + + if (Object.keys(obj1).length !== Object.keys(obj2).length) { + return false + // Object.keys() 返回一个由对象的自身可枚举属性(key值)组成的数组,例如:数组返回下表:let arr = ["a", "b", "c"];console.log(Object.keys(arr))->0,1,2; + } + + for (var attr in obj1) { + var t1 = obj1[attr] instanceof Object + var t2 = obj2[attr] instanceof Object + if (t1 && t2) { + return diff(obj1[attr], obj2[attr]) + } else if (obj1[attr] !== obj2[attr]) { + return false + } + } + return true +} +/** + * 设置灰度模式 + */ +export const toggleGrayMode = (status) => { + if (status) { + document.body.className = document.body.className + ' grayMode' + } else { + document.body.className = document.body.className.replace(' grayMode', '') + } +} +/** + * 设置主题 + */ +export const setTheme = (name) => { + document.body.className = name +} +/** + * 递归寻找子类的父类 + */ + +export const findParent = (menu, id) => { + for (let i = 0; i < menu.length; i++) { + if (menu[i].children.length !== 0) { + for (let j = 0; j < menu[i].children.length; j++) { + if (menu[i].children[j].id === id) { + return menu[i] + } else { + if (menu[i].children[j].children.length !== 0) { + return findParent(menu[i].children[j].children, id) + } + } + } + } + } +} + +/** + * 动态插入css + */ + +export const loadStyle = url => { + const link = document.createElement('link') + link.type = 'text/css' + link.rel = 'stylesheet' + link.href = url + const head = document.getElementsByTagName('head')[0] + head.appendChild(link) +} +/** + * 判断路由是否相等 + */ +export const isObjectValueEqual = (a, b) => { + let result = true + Object.keys(a).forEach(ele => { + const type = typeof(a[ele]) + if (type === 'string' && a[ele] !== b[ele]) result = false + else if (type === 'object' && JSON.stringify(a[ele]) !== JSON.stringify(b[ele])) result = false + }) + return result +} + +export const findLabelValueByProp = (dic, value, propl, label) => { + // console.log(dic, value, propl,label) + propl = propl ? propl : 'value'; + label = label ? label : 'label'; + let result = '' + if (validatenull(dic)) return value + let idx = dic.findIndex(item => item[propl] == value); + if (idx > -1) { + return dic[idx][label] + } + return value +} +/** + * 根据字典的value显示label + */ +export const findByvalue = (dic, value) => { + let result = '' + if (validatenull(dic)) return value + if (typeof(value) === 'string' || typeof(value) === 'number' || typeof(value) === 'boolean') { + let index = 0 + index = findArray(dic, value) + if (index !== -1) { + result = dic[index].label + } else { + result = value + } + } else if (value instanceof Array) { + result = [] + let index = 0 + value.forEach(ele => { + index = findArray(dic, ele) + if (index !== -1) { + result.push(dic[index].label) + } else { + result.push(value) + } + }) + result = result.toString() + console.log('ddd', result) + } + return result +} +/** + * 根据字典的value查找对应的index + */ +export const findArray = (dic, value) => { + for (let i = 0; i < dic.length; i++) { + if (dic[i].value === value) { + return i + } + } + return -1 +} +/** + * 生成随机len位数字 + */ +export const randomLenNum = (len, date) => { + let random = '' + random = Math.ceil(Math.random() * 100000000000000).toString().substr(0, len || 4) + if (date) random = random + Date.now() + return random +} +/** + * 打开小窗口 + */ +export const openWindow = (url, title, w, h) => { + // Fixes dual-screen position Most browsers Firefox + const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left + const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top + + const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document + .documentElement.clientWidth : screen.width + const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document + .documentElement.clientHeight : screen.height + + const left = ((width / 2) - (w / 2)) + dualScreenLeft + const top = ((height / 2) - (h / 2)) + dualScreenTop + const newWindow = window.open(url, title, + 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + + w + ', height=' + h + ', top=' + top + ', left=' + left) + + // Puts focus on the newWindow + if (window.focus) { + newWindow.focus() + } +} + +/** + * src 处理 + * @returns {PromiseLike | Promise} + */ + +export function buildQueryString(params) { + let str = ''; + Object.keys(params).forEach((key) => { + str += `${key}=${params[key]}&`; + }); + str.substr(0, str.length - 1); + return str; +} +export function getQueryString(url, paraName) { + const arrObj = url.split('?') + if (arrObj.length > 1) { + const arrPara = arrObj[1].split('&') + let arr + for (let i = 0; i < arrPara.length; i++) { + arr = arrPara[i].split('=') + // eslint-disable-next-line eqeqeq + if (arr != null && arr[0] == paraName) { + return arr[1] + } + } + return '' + } else { + return '' + } +} +export function dateFormat(date, format) { + if (!format) { + format = 'yyyy-MM-dd hh:mm:ss'; + } + if (date !== 'Invalid Date') { + var o = { + 'M+': date.getMonth() + 1, // month + 'd+': date.getDate(), // day + 'h+': date.getHours(), // hour + 'm+': date.getMinutes(), // minute + 's+': date.getSeconds(), // second + 'q+': Math.floor((date.getMonth() + 3) / 3), // quarter + 'S': date.getMilliseconds() // millisecond + } + if (/(y+)/.test(format)) { + format = format.replace(RegExp.$1, + (date.getFullYear() + '').substr(4 - RegExp.$1.length)) + } + for (var k in o) { + if (new RegExp('(' + k + ')').test(format)) { + format = format.replace(RegExp.$1, + RegExp.$1.length === 1 ? o[k] : + ('00' + o[k]).substr(('' + o[k]).length)) + } + } + return format + } + return '' +} +export function dillFeSiteStaticurl(url) { + if (typeof url !== 'string') { + return url; + } + if (url.indexOf('/fencingapi') === 0) { + return '/fencinginfo' + url; + } + return url; +} + + +// 处理任务类型 +export function findLabelValueByPropnew(dic, value, propl, label) { + if (!value) return "" + const valueArr = value.split(',') + propl = propl ? propl : 'value'; + label = label ? label : 'label'; + let resultArr = [] + if (validatenull(dic)) return value + + valueArr.forEach((it, i) => { + const index = dic.findIndex(item => item[propl] == valueArr[i]) + if (index != -1) { + resultArr.push(dic[index][label]) + } + }) + return resultArr.join(',') +} \ No newline at end of file diff --git a/utils/validate.js b/utils/validate.js new file mode 100644 index 0000000..e512f9b --- /dev/null +++ b/utils/validate.js @@ -0,0 +1,260 @@ +/** + * 邮箱 + * @param {*} s + */ +export function isEmail(s) { + return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) +} + +/** + * 手机号码 + * @param {*} s + */ +export function isMobile(s) { + return /^1[0-9]{10}$/.test(s) +} + +/** + * 电话号码 + * @param {*} s + */ +export function isPhone(s) { + return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) +} + +/** + * URL地址 + * @param {*} s + */ +export function isURL(s) { + return /^http[s]?:\/\/.*/.test(s) +} + +export function isvalidUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} + +/* 合法uri */ +export function validateURL(textval) { + const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ + return urlregex.test(textval) +} + +/* 小写字母 */ +export function validateLowerCase(str) { + const reg = /^[a-z]+$/ + return reg.test(str) +} + +/* 大写字母 */ +export function validateUpperCase(str) { + const reg = /^[A-Z]+$/ + return reg.test(str) +} + +/* 大小写字母 */ +export function validatAlphabets(str) { + const reg = /^[A-Za-z]+$/ + return reg.test(str) +} + +/* 验证pad还是pc */ +export const vaildatePc = function() { + const userAgentInfo = navigator.userAgent + const Agents = ['Android', 'iPhone', + 'SymbianOS', 'Windows Phone', + 'iPad', 'iPod' + ] + let flag = true + for (var v = 0; v < Agents.length; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false + break + } + } + return flag +} + +/** + * validate email + * @param email + * @returns {boolean} + */ +export function validateEmail(email) { + const re = /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + return re.test(email) +} + +/** + * 判断身份证号码 + */ +export function cardid(code) { + const list = [] + let result = true + let msg = '' + var city = { + 11: '北京', + 12: '天津', + 13: '河北', + 14: '山西', + 15: '内蒙古', + 21: '辽宁', + 22: '吉林', + 23: '黑龙江 ', + 31: '上海', + 32: '江苏', + 33: '浙江', + 34: '安徽', + 35: '福建', + 36: '江西', + 37: '山东', + 41: '河南', + 42: '湖北 ', + 43: '湖南', + 44: '广东', + 45: '广西', + 46: '海南', + 50: '重庆', + 51: '四川', + 52: '贵州', + 53: '云南', + 54: '西藏 ', + 61: '陕西', + 62: '甘肃', + 63: '青海', + 64: '宁夏', + 65: '新疆', + 71: '台湾', + 81: '香港', + 82: '澳门', + 91: '国外 ' + } + if (!validatenull(code)) { + if (code.length === 18) { + if (!code || !/(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) { + msg = '证件号码格式错误' + } else if (!city[code.substr(0, 2)]) { + msg = '地址编码错误' + } else { + result = false + } + /* else { + // 18位身份证需要验证最后一位校验位 + code = code.split('') + // ∑(ai×Wi)(mod 11) + // 加权因子 + var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] + // 校验位 + var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2, 'x'] + var sum = 0 + var ai = 0 + var wi = 0 + for (var i = 0; i < 17; i++) { + ai = code[i] + wi = factor[i] + sum += ai * wi + } + if (parity[sum % 11] !== code[17]) { + msg = '证件号码校验位错误' + } else { + result = false + } + }*/ + } else if(code.length === 15) { + result = false + } else { + msg = '证件号码长度不为18位' + } + } else { + msg = '证件号码不能为空' + } + list.push(result) + list.push(msg) + return list +} + +/** + * 判断手机号码是否正确 + */ +export function isvalidatemobile(phone) { + const list = [] + let result = true + let msg = '' + var isPhone = /^0\d{2,3}-?\d{7,8}$/ + // 增加134 减少|1349[0-9]{7},增加181,增加145,增加17[678] + if (!validatenull(phone)) { + if (phone.length === 11) { + if (isPhone.test(phone)) { + msg = '手机号码格式不正确' + } else { + result = false + } + } else { + msg = '手机号码长度不为11位' + } + } else { + msg = '手机号码不能为空' + } + list.push(result) + list.push(msg) + return list +} + +/** + * 判断姓名是否正确 + */ +export function validatename(name) { + var regName = /^[\u4e00-\u9fa5]{2,4}$/ + if (!regName.test(name)) return false + return true +} + +/** + * 判断是否为整数 + */ +export function validatenum(num, type) { + let regName = /[^\d.]/g + if (type === 1) { + if (!regName.test(num)) return false + } else if (type === 2) { + regName = /[^\d]/g + if (!regName.test(num)) return false + } + return true +} + +/** + * 判断是否为小数 + */ +export function validatenumord(num, type) { + let regName = /[^\d.]/g + if (type === 1) { + if (!regName.test(num)) return false + } else if (type === 2) { + regName = /[^\d.]/g + if (!regName.test(num)) return false + } + return true +} + +/** + * 判断是否为空 + */ +export function validatenull(val) { + if (typeof val === 'boolean') { + return false + } + if (typeof val === 'number') { + return false + } + if (val instanceof Array) { + if (val.length === 0) return true + } else if (val instanceof Object) { + if (JSON.stringify(val) === '{}') return true + } else { + if (val === 'null' || val == null || val === 'undefined' || val === undefined || val === '') return true + return false + } + return false +} diff --git a/uview-ui/LICENSE b/uview-ui/LICENSE new file mode 100644 index 0000000..8e39ead --- /dev/null +++ b/uview-ui/LICENSE @@ -0,0 +1,21 @@ +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/uview-ui/README.md b/uview-ui/README.md new file mode 100644 index 0000000..06d5676 --- /dev/null +++ b/uview-ui/README.md @@ -0,0 +1,106 @@ +

+ 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/uview-ui/components/u-action-sheet/u-action-sheet.vue b/uview-ui/components/u-action-sheet/u-action-sheet.vue new file mode 100644 index 0000000..722b668 --- /dev/null +++ b/uview-ui/components/u-action-sheet/u-action-sheet.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/uview-ui/components/u-alert-tips/u-alert-tips.vue b/uview-ui/components/u-alert-tips/u-alert-tips.vue new file mode 100644 index 0000000..e81fc37 --- /dev/null +++ b/uview-ui/components/u-alert-tips/u-alert-tips.vue @@ -0,0 +1,256 @@ + + + + + diff --git a/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue b/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue new file mode 100644 index 0000000..a48dd54 --- /dev/null +++ b/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/uview-ui/components/u-avatar-cropper/weCropper.js b/uview-ui/components/u-avatar-cropper/weCropper.js new file mode 100644 index 0000000..df02483 --- /dev/null +++ b/uview-ui/components/u-avatar-cropper/weCropper.js @@ -0,0 +1,1265 @@ +/** + * 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/uview-ui/components/u-avatar/u-avatar.vue b/uview-ui/components/u-avatar/u-avatar.vue new file mode 100644 index 0000000..289b9b0 --- /dev/null +++ b/uview-ui/components/u-avatar/u-avatar.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/uview-ui/components/u-back-top/u-back-top.vue b/uview-ui/components/u-back-top/u-back-top.vue new file mode 100644 index 0000000..7970fc7 --- /dev/null +++ b/uview-ui/components/u-back-top/u-back-top.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/uview-ui/components/u-badge/u-badge.vue b/uview-ui/components/u-badge/u-badge.vue new file mode 100644 index 0000000..e85b133 --- /dev/null +++ b/uview-ui/components/u-badge/u-badge.vue @@ -0,0 +1,216 @@ + + + + + \ No newline at end of file diff --git a/uview-ui/components/u-button/u-button.vue b/uview-ui/components/u-button/u-button.vue new file mode 100644 index 0000000..82c3a6f --- /dev/null +++ b/uview-ui/components/u-button/u-button.vue @@ -0,0 +1,596 @@ + + + + + diff --git a/uview-ui/components/u-calendar/u-calendar.vue b/uview-ui/components/u-calendar/u-calendar.vue new file mode 100644 index 0000000..6602bd0 --- /dev/null +++ b/uview-ui/components/u-calendar/u-calendar.vue @@ -0,0 +1,639 @@ + + + + \ No newline at end of file diff --git a/uview-ui/components/u-car-keyboard/u-car-keyboard.vue b/uview-ui/components/u-car-keyboard/u-car-keyboard.vue new file mode 100644 index 0000000..84b1467 --- /dev/null +++ b/uview-ui/components/u-car-keyboard/u-car-keyboard.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/uview-ui/components/u-card/u-card.vue b/uview-ui/components/u-card/u-card.vue new file mode 100644 index 0000000..a3cb2aa --- /dev/null +++ b/uview-ui/components/u-card/u-card.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/uview-ui/components/u-cell-group/u-cell-group.vue b/uview-ui/components/u-cell-group/u-cell-group.vue new file mode 100644 index 0000000..3fbca72 --- /dev/null +++ b/uview-ui/components/u-cell-group/u-cell-group.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/uview-ui/components/u-cell-item/u-cell-item.vue b/uview-ui/components/u-cell-item/u-cell-item.vue new file mode 100644 index 0000000..055af3a --- /dev/null +++ b/uview-ui/components/u-cell-item/u-cell-item.vue @@ -0,0 +1,316 @@ + + + + + diff --git a/uview-ui/components/u-checkbox-group/u-checkbox-group.vue b/uview-ui/components/u-checkbox-group/u-checkbox-group.vue new file mode 100644 index 0000000..6a149b3 --- /dev/null +++ b/uview-ui/components/u-checkbox-group/u-checkbox-group.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/uview-ui/components/u-checkbox/u-checkbox.vue b/uview-ui/components/u-checkbox/u-checkbox.vue new file mode 100644 index 0000000..9414461 --- /dev/null +++ b/uview-ui/components/u-checkbox/u-checkbox.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/uview-ui/components/u-circle-progress/u-circle-progress.vue b/uview-ui/components/u-circle-progress/u-circle-progress.vue new file mode 100644 index 0000000..46e7c18 --- /dev/null +++ b/uview-ui/components/u-circle-progress/u-circle-progress.vue @@ -0,0 +1,220 @@ + + + + + diff --git a/uview-ui/components/u-col/u-col.vue b/uview-ui/components/u-col/u-col.vue new file mode 100644 index 0000000..3b6cc64 --- /dev/null +++ b/uview-ui/components/u-col/u-col.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/uview-ui/components/u-collapse-item/u-collapse-item.vue b/uview-ui/components/u-collapse-item/u-collapse-item.vue new file mode 100644 index 0000000..3b66bfa --- /dev/null +++ b/uview-ui/components/u-collapse-item/u-collapse-item.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/uview-ui/components/u-collapse/u-collapse.vue b/uview-ui/components/u-collapse/u-collapse.vue new file mode 100644 index 0000000..8572957 --- /dev/null +++ b/uview-ui/components/u-collapse/u-collapse.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/uview-ui/components/u-column-notice/u-column-notice.vue b/uview-ui/components/u-column-notice/u-column-notice.vue new file mode 100644 index 0000000..dd8bd31 --- /dev/null +++ b/uview-ui/components/u-column-notice/u-column-notice.vue @@ -0,0 +1,237 @@ + + + + + diff --git a/uview-ui/components/u-count-down/u-count-down.vue b/uview-ui/components/u-count-down/u-count-down.vue new file mode 100644 index 0000000..7285d67 --- /dev/null +++ b/uview-ui/components/u-count-down/u-count-down.vue @@ -0,0 +1,318 @@ + + + + + diff --git a/uview-ui/components/u-count-to/u-count-to.vue b/uview-ui/components/u-count-to/u-count-to.vue new file mode 100644 index 0000000..053dc5f --- /dev/null +++ b/uview-ui/components/u-count-to/u-count-to.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/uview-ui/components/u-divider/u-divider.vue b/uview-ui/components/u-divider/u-divider.vue new file mode 100644 index 0000000..6f8d7e6 --- /dev/null +++ b/uview-ui/components/u-divider/u-divider.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/uview-ui/components/u-dropdown-item/u-dropdown-item.vue b/uview-ui/components/u-dropdown-item/u-dropdown-item.vue new file mode 100644 index 0000000..ba60d8f --- /dev/null +++ b/uview-ui/components/u-dropdown-item/u-dropdown-item.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/uview-ui/components/u-dropdown/u-dropdown.vue b/uview-ui/components/u-dropdown/u-dropdown.vue new file mode 100644 index 0000000..a62e469 --- /dev/null +++ b/uview-ui/components/u-dropdown/u-dropdown.vue @@ -0,0 +1,298 @@ + + + + + diff --git a/uview-ui/components/u-empty/u-empty.vue b/uview-ui/components/u-empty/u-empty.vue new file mode 100644 index 0000000..2c77b24 --- /dev/null +++ b/uview-ui/components/u-empty/u-empty.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/uview-ui/components/u-field/u-field.vue b/uview-ui/components/u-field/u-field.vue new file mode 100644 index 0000000..b562798 --- /dev/null +++ b/uview-ui/components/u-field/u-field.vue @@ -0,0 +1,384 @@ +