diff --git a/apis/clientDetailApi.js b/apis/clientDetailApi.js new file mode 100644 index 0000000..7969932 --- /dev/null +++ b/apis/clientDetailApi.js @@ -0,0 +1,12 @@ +import http from '../utils/http/index.js' + +// 纸掌柜--客户详情--基础信息 +export function getBaseInfo(data) { + return http.get( + { + url: '/yyt-uec/get/customer/detail/base-info', + data + } + ) +} + diff --git a/apis/trade.js b/apis/trade.js new file mode 100644 index 0000000..a5e2e40 --- /dev/null +++ b/apis/trade.js @@ -0,0 +1,23 @@ +import http from '../utils/http/index.js' + +// 交易大厅-报价 +export function getEnterpriseList(data) { + return http.get( + { + url: '/base-paper-trading/get/supplier/enquiry-reply/wait-reply-list', + data + }, + { hideLoading: true } + ) +} +// 交易大厅-订单 +export function gettradingHallList(data) { + return http.get( + { + url: '/base-paper-trading/get/trading-hall/supplier-order-page', + data + }, + { hideLoading: true } + ) +} + diff --git a/common/css/reset.scss b/common/css/reset.scss index 6d60b13..ca1fcb7 100644 --- a/common/css/reset.scss +++ b/common/css/reset.scss @@ -45,3 +45,12 @@ button::after { clear: both; visibility: hidden; } +// 两行省略号 +.u-line-2 { + -webkit-line-clamp: 2; + overflow: hidden; + word-break: break-all; + text-overflow: ellipsis; + display: -webkit-box; // 弹性伸缩盒 + -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式 +} diff --git a/components/not-logged/not-logged.vue b/components/not-logged/not-logged.vue new file mode 100644 index 0000000..2a0fae4 --- /dev/null +++ b/components/not-logged/not-logged.vue @@ -0,0 +1,65 @@ + + + + + + 登录后可以查看更多,请先登录 + + + 登录 + + + + + + + + diff --git a/components/u-gap/u-gap.vue b/components/u-gap/u-gap.vue new file mode 100644 index 0000000..bd518a2 --- /dev/null +++ b/components/u-gap/u-gap.vue @@ -0,0 +1,24 @@ + + + + + + + diff --git a/pages.json b/pages.json index fd9bbc4..a911a82 100644 --- a/pages.json +++ b/pages.json @@ -1,115 +1,157 @@ { - "pages": [ - //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/client/index", - "style": { - "navigationBarTitleText": "客户", - "navigationStyle": "custom" - } - }, - { - "path": "pages/client-list/index", - "style": { - "navigationBarTitleText": "客户列表", - "navigationStyle": "custom" - } - }, - { - "path": "pages/search/index", - "style": { - "navigationBarTitleText": "客户搜索", - "navigationStyle": "custom" - } - }, - { - "path": "pages/add-user/index", - "style": { - "navigationBarTitleText": "添加客户", - "navigationStyle": "custom" - } - }, - { - "path": "pages/trade/index", - "style": { - "navigationBarTitleText": "交易" - } - }, - { - "path": "pages/mall/index", - "style": { - "navigationBarTitleText": "商城" - } - }, - { - "path": "pages/mine/index", - "style": { - "navigationBarTitleText": "我的" - } - }, - { - "path": "pages/login/index", - "style": { - "navigationBarTitleText": "登录", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, - { - "path": "pages/agreement/index", - "style": { - "navigationBarTitleText": "用户与隐私协议" - } - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8", - "backgroundColorTop": "#FFFFFF" - }, - "tabBar": { - "color": "#888", - "selectedColor": "#007AFF", - "borderStyle": "white", - "backgroundColor": "#f9f9f9", - "list": [ - { - "pagePath": "pages/client/index", - "iconPath": "static/imgs/tabbar/client-gray.png", - "selectedIconPath": "static/imgs/tabbar/client-blue.png", - "text": "客户" - }, - { - "pagePath": "pages/trade/index", - "iconPath": "static/imgs/tabbar/trade-gray.png", - "selectedIconPath": "static/imgs/tabbar/trade-blue.png", - "text": "交易" - }, - { - "pagePath": "pages/mall/index", - "iconPath": "static/imgs/tabbar/mall-gray.png", - "selectedIconPath": "static/imgs/tabbar/mall-blue.png", - "text": "纸商城" - }, - { - "pagePath": "pages/mine/index", - "iconPath": "static/imgs/tabbar/mine-gray.png", - "selectedIconPath": "static/imgs/tabbar/mine-blue.png", - "text": "我的" - } - ] - }, - "condition": { - //模式配置,仅开发期间生效 - "current": 0, //当前激活的模式(list 的索引项) - "list": [ - { - "name": "", //模式名称 - "path": "", //启动页面,必选 - "query": "" //启动参数,在页面的onLoad函数里面得到 - } - ] - } + "pages": [ + //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + + { + "path": "pages/client/index", + "style": { + "navigationBarTitleText": "客户", + "navigationStyle": "custom" + } + }, + { + "path": "pages/client-list/index", + "style": { + "navigationBarTitleText": "客户列表", + "navigationStyle": "custom" + } + }, + { + "path": "pages/search/index", + "style": { + "navigationBarTitleText": "客户搜索", + "navigationStyle": "custom" + } + }, + { + "path": "pages/add-user/index", + "style": { + "navigationBarTitleText": "添加客户", + "navigationStyle": "custom" + } + }, + { + "path": "pages/trade/index", + "style": { + "navigationBarTitleText": "交易", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/index", + "style": { + "navigationBarTitleText": "商城" + } + }, + { + "path": "pages/mine/index", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/login/index", + "style": { + "navigationBarTitleText": "登录", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, + { + "path": "pages/agreement/index", + "style": { + "navigationBarTitleText": "用户与隐私协议" + } + }, + { + "path": "pages/client-detail/index", + "style": { + "navigationBarTitleText": "客户详情", + "navigationStyle": "custom" + } + } + ,{ + "path" : "components/not-logged/not-logged", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/trade/quotationList", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/trade/orderList", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/trade/my-offer", + "style" : + { + "navigationBarTitleText": "我的报价", + "enablePullDownRefresh": false + } + + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + "backgroundColorTop": "#FFFFFF" + }, + "tabBar": { + "color": "#888", + "selectedColor": "#007AFF", + "borderStyle": "white", + "backgroundColor": "#f9f9f9", + "list": [{ + "pagePath": "pages/client/index", + "iconPath": "static/imgs/tabbar/client-gray.png", + "selectedIconPath": "static/imgs/tabbar/client-blue.png", + "text": "客户" + }, + { + "pagePath": "pages/trade/index", + "iconPath": "static/imgs/tabbar/trade-gray.png", + "selectedIconPath": "static/imgs/tabbar/trade-blue.png", + "text": "交易" + }, + { + "pagePath": "pages/mall/index", + "iconPath": "static/imgs/tabbar/mall-gray.png", + "selectedIconPath": "static/imgs/tabbar/mall-blue.png", + "text": "纸商城" + }, + { + "pagePath": "pages/mine/index", + "iconPath": "static/imgs/tabbar/mine-gray.png", + "selectedIconPath": "static/imgs/tabbar/mine-blue.png", + "text": "我的" + } + ] + }, + "condition": { + //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [{ + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }] + } } diff --git a/pages/client-detail/base-paper-deals.vue b/pages/client-detail/base-paper-deals.vue new file mode 100644 index 0000000..d85bbbd --- /dev/null +++ b/pages/client-detail/base-paper-deals.vue @@ -0,0 +1,22 @@ + + + 原纸交易 + + + + + + diff --git a/pages/client-detail/basic-information.vue b/pages/client-detail/basic-information.vue new file mode 100644 index 0000000..db9e96e --- /dev/null +++ b/pages/client-detail/basic-information.vue @@ -0,0 +1,540 @@ + + + + + + 基本信息 + 跟进记录 + + + + + + + {{info.name}} + + + + 主营:{{ info.mainBusiness }} + + + + + + 法定代表人 + {{ info.legalPersonName }} + + + 注册资本 + {{ info.registeredCapital }}万 + + + 成立时间 + {{ transformDate(info.foundDate) }} + + + + + {{ info.locProvinceName }}{{ info.locCityName }} {{ info.locDetail }} + + + + + + 工商信息 + + + + + + 社会统一 + + 信用代码: + + + {{info.uniformSocialCreditCode}} + + + 营业执照: + 点击查看 + + + 所属行业: + {{info.belongIndustry}} + + + 登记状态: + {{info.registrationStatus}} + + + + + + + 厂房信息 + + + + + 产房面积: + {{info.plantArea}}m² + + + 年营业额: + {{info.annualTurnover}}万 + + + + + 产房照片: + 点击查看 + + + 租赁合同: + 点击查看 + + + + + + {{info.factoryAddress}} + + + + + + 法律诉讼 + + + + + + + 买卖合同纠纷案件执行首次执行裁定书 + + + + 案件: + 金融借款合同纠纷 + + + 案号: + (2019)鲁0911执1608号 + + + 裁判日期: + 2019/12/09 + + + + + + + 查看更多 + + + + + + + 经营异常 + + + + + + + 编号 44012020013906 + + 有效 + + + 抵押人: + 金融借款合同纠纷 + + + 抵押权人: + (2019)鲁0911执1608号 + + + 债务期限: + 2020/01/24~2023/01/24 + + + 债务数额: + 243.95万人民币 + + + + + + + + 征信信息 + + + + + 立案日期: + 2021/07/21 + + + 案号: + (2019)鲁0911执1608号 + + + 执行标准: + 24563345元 + + + 执行法院: + 太原市杏花岭区人民法院 + + + + + + + + + + + + diff --git a/pages/client-detail/custom-header.vue b/pages/client-detail/custom-header.vue new file mode 100644 index 0000000..687c3c9 --- /dev/null +++ b/pages/client-detail/custom-header.vue @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/pages/client-detail/equipment-information.vue b/pages/client-detail/equipment-information.vue new file mode 100644 index 0000000..f36a8bd --- /dev/null +++ b/pages/client-detail/equipment-information.vue @@ -0,0 +1,22 @@ + + + 设备信息 + + + + + + diff --git a/pages/client-detail/index.vue b/pages/client-detail/index.vue new file mode 100644 index 0000000..ecb4a44 --- /dev/null +++ b/pages/client-detail/index.vue @@ -0,0 +1,82 @@ + + + + + 客户详情 + 客户授信 + + + + + + + + + + + + + + + + + + + diff --git a/pages/client-detail/news-item.nvue b/pages/client-detail/news-item.nvue new file mode 100644 index 0000000..18973ed --- /dev/null +++ b/pages/client-detail/news-item.nvue @@ -0,0 +1,464 @@ + + + + + + + + {{tab.name}} + + + + + + + + + + + + {{tab.refreshText}} + + + + + + + {{tab.loadingText}} + + + + + + + + + + {{tab.loadingText}} + + + + + + + + + + diff --git a/pages/client-detail/waste-paper-trading.vue b/pages/client-detail/waste-paper-trading.vue new file mode 100644 index 0000000..5b96d08 --- /dev/null +++ b/pages/client-detail/waste-paper-trading.vue @@ -0,0 +1,22 @@ + + + 废纸交易 + + + + + + diff --git a/pages/trade/index.vue b/pages/trade/index.vue index c9cc50c..5555e0a 100644 --- a/pages/trade/index.vue +++ b/pages/trade/index.vue @@ -1,40 +1,120 @@ - - trade + + + 交易大厅 + + + 报价 + 订单 + + + + + + + + + + + + + + - diff --git a/pages/trade/my-offer.vue b/pages/trade/my-offer.vue new file mode 100644 index 0000000..fd75c55 --- /dev/null +++ b/pages/trade/my-offer.vue @@ -0,0 +1,208 @@ + + + + + + + 广州民族印刷有限公司 + {{ items.orderStatus }} + + + + + + {{ item.brandName }}{{ item.categoryName }} + + {{ item.categoryName }}/{{ item.brandName }}/{{ item.gramWeight }}g/{{ item.length }}*{{ item.width }}/{{ item.pieceQuantity }}张 + + + + + + + 三分钟前 + ¥{{ items.totalOfferPrice }} + + + + + + + + + + + diff --git a/pages/trade/orderList.vue b/pages/trade/orderList.vue new file mode 100644 index 0000000..edd927e --- /dev/null +++ b/pages/trade/orderList.vue @@ -0,0 +1,201 @@ + + + + + + + 广州民族印刷有限公司 + {{ items.orderStatus }} + + + + + + {{ item.brandName }}{{ item.categoryName }} + + {{ item.categoryName }}/{{ item.brandName }}/{{ item.gramWeight }}g/{{ item.length }}*{{ item.width }}/{{ item.pieceQuantity }}张 + + + + + + + 交货时间: + {{ items.deliveryDay }}天 + ¥{{ items.totalOfferPrice }} + + + + + + + + + + + diff --git a/pages/trade/quotationList.vue b/pages/trade/quotationList.vue new file mode 100644 index 0000000..1a795d5 --- /dev/null +++ b/pages/trade/quotationList.vue @@ -0,0 +1,268 @@ + + + + + + 广州民族印刷有限公司 + 待报价 + + + + + + 金蝶蓝白卡 + 白卡纸/金蝶蓝/350g/787*1092/2200张 + + + + + + 金蝶蓝白卡 + 白卡纸/金蝶蓝/350g/787*1092/2200张 + + + + + + 交货时间: + 3天 + + + 交货区域: + 3天 + + + + 报价截止: + 3天 + + + 报价 + + + + + + + + + + + 我的报价 + + + + + + + + + + diff --git a/static/imgs/client-detail/address-icon.png b/static/imgs/client-detail/address-icon.png new file mode 100644 index 0000000..5184a40 Binary files /dev/null and b/static/imgs/client-detail/address-icon.png differ diff --git a/static/imgs/client-detail/arrow-down-icon.png b/static/imgs/client-detail/arrow-down-icon.png new file mode 100644 index 0000000..dc82fe4 Binary files /dev/null and b/static/imgs/client-detail/arrow-down-icon.png differ diff --git a/static/imgs/client-detail/arrow-up-icon.png b/static/imgs/client-detail/arrow-up-icon.png new file mode 100644 index 0000000..fe9a53c Binary files /dev/null and b/static/imgs/client-detail/arrow-up-icon.png differ diff --git a/static/imgs/trade/not-login.png b/static/imgs/trade/not-login.png new file mode 100644 index 0000000..01af390 Binary files /dev/null and b/static/imgs/trade/not-login.png differ diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md new file mode 100644 index 0000000..544ecc1 --- /dev/null +++ b/uni_modules/uni-badge/changelog.md @@ -0,0 +1,29 @@ +## 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-badge](https://uniapp.dcloud.io/component/uniui/uni-badge) +## 1.1.7(2021-11-08) +- 优化 升级ui +- 修改 size 属性默认值调整为 small +- 修改 type 属性,默认值调整为 error,info 替换 default +## 1.1.6(2021-09-22) +- 修复 在字节小程序上样式不生效的 bug +## 1.1.5(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.4(2021-07-29) +- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性 +## 1.1.3(2021-06-24) +- 优化 示例项目 +## 1.1.1(2021-05-12) +- 新增 组件示例地址 +## 1.1.0(2021-05-12) +- 新增 uni-badge 的 absolute 属性,支持定位 +- 新增 uni-badge 的 offset 属性,支持定位偏移 +- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点 +- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+ +- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式 +## 1.0.7(2021-05-07) +- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug +- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug +- 新增 uni-badge 属性 custom-style, 支持自定义样式 +## 1.0.6(2021-02-04) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue new file mode 100644 index 0000000..1981b4e --- /dev/null +++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue @@ -0,0 +1,268 @@ + + + + {{displayValue}} + + + + + + diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json new file mode 100644 index 0000000..7ba6d2f --- /dev/null +++ b/uni_modules/uni-badge/package.json @@ -0,0 +1,88 @@ +{ + "id": "uni-badge", + "displayName": "uni-badge 数字角标", + "version": "1.2.0", + "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", + "keywords": [ + "", + "badge", + "uni-ui", + "uniui", + "数字角标", + "徽章" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "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": "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" + }, + "快应用": { + "华为": "y", + "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-badge/readme.md b/uni_modules/uni-badge/readme.md new file mode 100644 index 0000000..bdf175d --- /dev/null +++ b/uni_modules/uni-badge/readme.md @@ -0,0 +1,10 @@ +## Badge 数字角标 +> **组件名:uni-badge** +> 代码块: `uBadge` + +数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + diff --git a/uni_modules/uni-list/changelog.md b/uni_modules/uni-list/changelog.md new file mode 100644 index 0000000..64513ef --- /dev/null +++ b/uni_modules/uni-list/changelog.md @@ -0,0 +1,18 @@ +## 1.2.0(2021-11-23) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-list](https://uniapp.dcloud.io/component/uniui/uni-list) +## 1.1.3(2021-08-30) +- 修复 在vue3中to属性在发行应用的时候报错的bug +## 1.1.2(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.1.1(2021-07-21) +- 修复 与其他组件嵌套使用时,点击失效的Bug +## 1.1.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.17(2021-05-12) +- 新增 组件示例地址 +## 1.0.16(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.0.15(2021-02-05) +- 调整为uni_modules目录规范 +- 修复 uni-list-chat 角标显示不正常的问题 diff --git a/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue new file mode 100644 index 0000000..e256e4c --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss new file mode 100644 index 0000000..311f8d9 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss @@ -0,0 +1,58 @@ +/** + * 这里是 uni-list 组件内置的常用样式变量 + * 如果需要覆盖样式,这里提供了基本的组件样式变量,您可以尝试修改这里的变量,去完成样式替换,而不用去修改源码 + * + */ + +// 背景色 +$background-color : #fff; +// 分割线颜色 +$divide-line-color : #e5e5e5; + +// 默认头像大小,如需要修改此值,注意同步修改 js 中的值 const avatarWidth = xx ,目前只支持方形头像 +// nvue 页面不支持修改头像大小 +$avatar-width : 45px ; + +// 头像边框 +$avatar-border-radius: 5px; +$avatar-border-color: #eee; +$avatar-border-width: 1px; + +// 标题文字样式 +$title-size : 16px; +$title-color : #3b4144; +$title-weight : normal; + +// 描述文字样式 +$note-size : 12px; +$note-color : #999; +$note-weight : normal; + +// 右侧额外内容默认样式 +$right-text-size : 12px; +$right-text-color : #999; +$right-text-weight : normal; + +// 角标样式 +// nvue 页面不支持修改圆点位置以及大小 +// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动 +$badge-left: 0px; +$badge-top: 0px; + +// 显示圆点时,圆点大小 +$dot-width: 10px; +$dot-height: 10px; + +// 显示角标时,角标大小和字体大小 +$badge-size : 18px; +$badge-font : 12px; +// 显示角标时,角标前景色 +$badge-color : #fff; +// 显示角标时,角标背景色 +$badge-background-color : #ff5a5f; +// 显示角标时,角标左右间距 +$badge-space : 6px; + +// 状态样式 +// 选中颜色 +$hover : #f5f5f5; diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue new file mode 100644 index 0000000..0c8519e --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + {{ badgeText === 'dot' ? '' : badgeText }} + + + + {{ title }} + {{ note }} + + + + {{ time }} + + {{ badgeText === 'dot' ? '' : badgeText }} + + + + + + + + + + + + + + diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue new file mode 100644 index 0000000..c3a942a --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + + + + + + {{ title }} + {{ note }} + + + + + {{ rightText }} + + + + + + + + + + + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-list - 副本.vue b/uni_modules/uni-list/components/uni-list/uni-list - 副本.vue new file mode 100644 index 0000000..1c85003 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-list - 副本.vue @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue new file mode 100644 index 0000000..976a80d --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-list.vue @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.vue b/uni_modules/uni-list/components/uni-list/uni-refresh.vue new file mode 100644 index 0000000..3b4c5a2 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-refresh.vue @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.wxs b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs new file mode 100644 index 0000000..818a6b7 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs @@ -0,0 +1,87 @@ +var pullDown = { + threshold: 95, + maxHeight: 200, + callRefresh: 'onrefresh', + callPullingDown: 'onpullingdown', + refreshSelector: '.uni-refresh' +}; + +function ready(newValue, oldValue, ownerInstance, instance) { + var state = instance.getState() + state.canPullDown = newValue; + // console.log(newValue); +} + +function touchStart(e, instance) { + var state = instance.getState(); + state.refreshInstance = instance.selectComponent(pullDown.refreshSelector); + state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined); + if (!state.canPullDown) { + return + } + + // console.log("touchStart"); + + state.height = 0; + state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY; + state.refreshInstance.setStyle({ + 'height': 0 + }); + state.refreshInstance.callMethod("onchange", true); +} + +function touchMove(e, ownerInstance) { + var instance = e.instance; + var state = instance.getState(); + if (!state.canPullDown) { + return + } + + var oldHeight = state.height; + var endY = e.touches[0].pageY || e.changedTouches[0].pageY; + var height = endY - state.touchStartY; + if (height > pullDown.maxHeight) { + return; + } + + var refreshInstance = state.refreshInstance; + refreshInstance.setStyle({ + 'height': height + 'px' + }); + + height = height < pullDown.maxHeight ? height : pullDown.maxHeight; + state.height = height; + refreshInstance.callMethod(pullDown.callPullingDown, { + height: height + }); +} + +function touchEnd(e, ownerInstance) { + var state = e.instance.getState(); + if (!state.canPullDown) { + return + } + + state.refreshInstance.callMethod("onchange", false); + + var refreshInstance = state.refreshInstance; + if (state.height > pullDown.threshold) { + refreshInstance.callMethod(pullDown.callRefresh); + return; + } + + refreshInstance.setStyle({ + 'height': 0 + }); +} + +function propObserver(newValue, oldValue, instance) { + pullDown = newValue; +} + +module.exports = { + touchmove: touchMove, + touchstart: touchStart, + touchend: touchEnd, + propObserver: propObserver +} diff --git a/uni_modules/uni-list/package.json b/uni_modules/uni-list/package.json new file mode 100644 index 0000000..9d20a73 --- /dev/null +++ b/uni_modules/uni-list/package.json @@ -0,0 +1,91 @@ +{ + "id": "uni-list", + "displayName": "uni-list 列表", + "version": "1.2.0", + "description": "List 组件 ,帮助使用者快速构建列表。", + "keywords": [ + "", + "uni-ui", + "uniui", + "列表", + "", + "list" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "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": [ + "uni-badge", + "uni-icons" + ], + "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-list/readme.md b/uni_modules/uni-list/readme.md new file mode 100644 index 0000000..e4a5d73 --- /dev/null +++ b/uni_modules/uni-list/readme.md @@ -0,0 +1,347 @@ + + +## List 列表 +> **组件名:uni-list** +> 代码块: `uList`、`uListItem` +> 关联组件:`uni-list-item`、`uni-badge`、`uni-icons`、`uni-list-chat`、`uni-list-ad` + + +List 列表组件,包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容。 + +在vue页面里,它默认使用页面级滚动。在app-nvue页面里,它默认使用原生list组件滚动。这样的长列表,在滚动出屏幕外后,系统会回收不可见区域的渲染内存资源,不会造成滚动越长手机越卡的问题。 + +uni-list组件是父容器,里面的核心是uni-list-item子组件,它代表列表中的一个可重复行,子组件可以无限循环。 + +uni-list-item有很多风格,uni-list-item组件通过内置的属性,满足一些常用的场景。当内置属性不满足需求时,可以通过扩展插槽来自定义列表内容。 + +内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表。 + +涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现。 + +下文均有样例给出。 + +uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uni-load-more](https://ext.dcloud.net.cn/plugin?id=29) + + +### 安装方式 + +本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 + +如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +> **注意事项** +> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 +> - 组件需要依赖 `sass` 插件 ,请自行手动安装 +> - 组件内部依赖 `'uni-icons'` 、`uni-badge` 组件 +> - `uni-list` 和 `uni-list-item` 需要配套使用,暂不支持单独使用 `uni-list-item` +> - 只有开启点击反馈后,会有点击选中效果 +> - 使用插槽时,可以完全自定义内容 +> - note 、rightText 属性暂时没做限制,不支持文字溢出隐藏,使用时应该控制长度显示或通过默认插槽自行扩展 +> - 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: 详情 --> 项目配置 --> 启用 component2 编译 +> - 如果需要修改 `switch`、`badge` 样式,请使用插槽自定义 +> - 在 `HBuilderX` 低版本中,可能会出现组件显示 `undefined` 的问题,请升级最新的 `HBuilderX` 或者 `cli` +> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + +### 基本用法 + +- 设置 `title` 属性,可以显示列表标题 +- 设置 `disabled` 属性,可以禁用当前项 + +```html + + + + + +``` + +### 多行内容显示 + +- 设置 `note` 属性 ,可以在第二行显示描述文本信息 + +```html + + + + + +``` + +### 右侧显示角标、switch + +- 设置 `show-badge` 属性 ,可以显示角标内容 +- 设置 `show-switch` 属性,可以显示 switch 开关 + +```html + + + + + +``` + +### 左侧显示略缩图、图标 + +- 设置 `thumb` 属性 ,可以在列表左侧显示略缩图 +- 设置 `show-extra-icon` 属性,并指定 `extra-icon` 可以在左侧显示图标 + +```html + + + + +``` + +### 开启点击反馈和右侧箭头 +- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件 +- 设置 `link` 属性,会自动开启点击反馈,并给列表右侧添加一个箭头 +- 设置 `to` 属性,可以跳转页面,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo` + +```html + + + + + + + +``` + + +### 聊天列表示例 +- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件 +- 设置 `link` 属性,会自动开启点击反馈,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo` +- 设置 `to` 属性,可以跳转页面 +- `time` 属性,通常会设置成时间显示,但是这个属性不仅仅可以设置时间,你可以传入任何文本,注意文本长度可能会影响显示 +- `avatar` 和 `avatarList` 属性同时只会有一个生效,同时设置的话,`avatarList` 属性的长度大于1 ,`avatar` 属性将失效 +- 可以通过默认插槽自定义列表右侧内容 + +```html + + + + + + + + + + + + + + + + + 刚刚 + + + + + + + +``` + +```javascript + +export default { + components: {}, + data() { + return { + avatarList: [{ + url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' + }, { + url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' + }, { + url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' + }] + } + } +} + +``` + + +```css + +.chat-custom-right { + flex: 1; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + justify-content: space-between; + align-items: flex-end; +} + +.chat-custom-text { + font-size: 12px; + color: #999; +} + +``` + +## API + +### List Props + +属性名 |类型 |默认值 | 说明 +:-: |:-: |:-: | :-: +border |Boolean |true | 是否显示边框 + + +### ListItem Props + +属性名 |类型 |默认值 | 说明 +:-: |:-: |:-: | :-: +title |String |- | 标题 +note |String |- | 描述 +ellipsis |Number |0 | title 是否溢出隐藏,可选值,0:默认; 1:显示一行; 2:显示两行;【nvue 暂不支持】 +thumb |String |- | 左侧缩略图,若thumb有值,则不会显示扩展图标 +thumbSize |String |medium | 略缩图尺寸,可选值,lg:大图; medium:一般; sm:小图; +showBadge |Boolean |false | 是否显示数字角标 +badgeText |String |- | 数字角标内容 +badgeType |String |- | 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21) +rightText |String |- | 右侧文字内容 +disabled |Boolean |false | 是否禁用 +showArrow |Boolean |true | 是否显示箭头图标 +link |String |navigateTo | 新页面跳转方式,可选值见下表 +to |String |- | 新页面跳转地址,如填写此属性,click 会返回页面是否跳转成功 +clickable |Boolean |false | 是否开启点击反馈 +showSwitch |Boolean |false | 是否显示Switch +switchChecked |Boolean |false | Switch是否被选中 +showExtraIcon |Boolean |false | 左侧是否显示扩展图标 +extraIcon |Object |- | 扩展图标参数,格式为 ``{color: '#4cd964',size: '22',type: 'spinner'}``,参考 [uni-icons](https://ext.dcloud.net.cn/plugin?id=28) +direction | String |row | 排版方向,可选值,row:水平排列; column:垂直排列; 3个插槽是水平排还是垂直排,也受此属性控制 + + +#### Link Options + +属性名 | 说明 +:-: | :-: +navigateTo | 同 uni.navigateTo() +redirectTo | 同 uni.reLaunch() +reLaunch | 同 uni.reLaunch() +switchTab | 同 uni.switchTab() + +### ListItem Events + +事件称名 |说明 |返回参数 +:-: |:-: |:-: +click |点击 uniListItem 触发事件,需开启点击反馈 |- +switchChange |点击切换 Switch 时触发,需显示 switch |e={value:checked} + + + +### ListItem Slots + +名称 | 说明 +:-: | :-: +header | 左/上内容插槽,可完全自定义默认显示 +body | 中间内容插槽,可完全自定义中间内容 +footer | 右/下内容插槽,可完全自定义右侧内容 + + +> **通过插槽扩展** +> 需要注意的是当使用插槽时,内置样式将会失效,只保留排版样式,此时的样式需要开发者自己实现 +> 如果 `uni-list-item` 组件内置属性样式无法满足需求,可以使用插槽来自定义uni-list-item里的内容。 +> uni-list-item提供了3个可扩展的插槽:`header`、`body`、`footer` +> - 当 `direction` 属性为 `row` 时表示水平排列,此时 `header` 表示列表的左边部分,`body` 表示列表的中间部分,`footer` 表示列表的右边部分 +> - 当 `direction` 属性为 `column` 时表示垂直排列,此时 `header` 表示列表的上边部分,`body` 表示列表的中间部分,`footer` 表示列表的下边部分 +> 开发者可以只用1个插槽,也可以3个一起使用。在插槽中可自主编写view标签,实现自己所需的效果。 + + +**示例** + +```html + + + + + + + + + + + 自定义插槽 + + + + + + +``` + + + + + +### ListItemChat Props + +属性名 |类型 |默认值 | 说明 +:-: |:-: |:-: | :-: +title |String |- | 标题 +note |String |- | 描述 +clickable |Boolean |false | 是否开启点击反馈 +badgeText |String |- | 数字角标内容,设置为 `dot` 将显示圆点 +badgePositon |String |right | 角标位置 +link |String |navigateTo | 是否展示右侧箭头并开启点击反馈,可选值见下表 +clickable |Boolean |false | 是否开启点击反馈 +to |String |- | 跳转页面地址,如填写此属性,click 会返回页面是否跳转成功 +time |String |- | 右侧时间显示 +avatarCircle |Boolean |false | 是否显示圆形头像 +avatar |String |- | 头像地址,avatarCircle 不填时生效 +avatarList |Array |- | 头像组,格式为 [{url:''}] + +#### Link Options + +属性名 | 说明 +:-: | :-: +navigateTo | 同 uni.navigateTo() +redirectTo | 同 uni.reLaunch() +reLaunch | 同 uni.reLaunch() +switchTab | 同 uni.switchTab() + +### ListItemChat Slots + +名称 | 说明 +:- | :- +default | 自定义列表右侧内容(包括时间和角标显示) + +### ListItemChat Events +事件称名 | 说明 | 返回参数 +:-: | :-: | :-: +@click | 点击 uniListChat 触发事件 | {data:{}} ,如有 to 属性,会返回页面跳转信息 + + + + + + +## 基于uni-list扩展的页面模板 + +通过扩展插槽,可实现多种常见样式的列表 + +**新闻列表类** + +1. 云端一体混合布局:[https://ext.dcloud.net.cn/plugin?id=2546](https://ext.dcloud.net.cn/plugin?id=2546) +2. 云端一体垂直布局,大图模式:[https://ext.dcloud.net.cn/plugin?id=2583](https://ext.dcloud.net.cn/plugin?id=2583) +3. 云端一体垂直布局,多行图文混排:[https://ext.dcloud.net.cn/plugin?id=2584](https://ext.dcloud.net.cn/plugin?id=2584) +4. 云端一体垂直布局,多图模式:[https://ext.dcloud.net.cn/plugin?id=2585](https://ext.dcloud.net.cn/plugin?id=2585) +5. 云端一体水平布局,左图右文:[https://ext.dcloud.net.cn/plugin?id=2586](https://ext.dcloud.net.cn/plugin?id=2586) +6. 云端一体水平布局,左文右图:[https://ext.dcloud.net.cn/plugin?id=2587](https://ext.dcloud.net.cn/plugin?id=2587) +7. 云端一体垂直布局,无图模式,主标题+副标题:[https://ext.dcloud.net.cn/plugin?id=2588](https://ext.dcloud.net.cn/plugin?id=2588) + +**商品列表类** + +1. 云端一体列表/宫格视图互切:[https://ext.dcloud.net.cn/plugin?id=2651](https://ext.dcloud.net.cn/plugin?id=2651) +2. 云端一体列表(宫格模式):[https://ext.dcloud.net.cn/plugin?id=2671](https://ext.dcloud.net.cn/plugin?id=2671) +3. 云端一体列表(列表模式):[https://ext.dcloud.net.cn/plugin?id=2672](https://ext.dcloud.net.cn/plugin?id=2672) + +## 组件示例 + +点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/list/list](https://hellouniapp.dcloud.net.cn/pages/extUI/list/list) \ No newline at end of file diff --git a/uni_modules/uni-segmented-control/changelog.md b/uni_modules/uni-segmented-control/changelog.md new file mode 100644 index 0000000..a44385d --- /dev/null +++ b/uni_modules/uni-segmented-control/changelog.md @@ -0,0 +1,9 @@ +## 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-segmented-control](https://uniapp.dcloud.io/component/uniui/uni-segmented-control) +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.5(2021-05-12) +- 新增 项目示例地址 +## 1.0.4(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue b/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue new file mode 100644 index 0000000..1cc9d69 --- /dev/null +++ b/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue @@ -0,0 +1,146 @@ + + + + + {{ item }} + + + + + + + + + diff --git a/uni_modules/uni-segmented-control/package.json b/uni_modules/uni-segmented-control/package.json new file mode 100644 index 0000000..6cae41d --- /dev/null +++ b/uni_modules/uni-segmented-control/package.json @@ -0,0 +1,87 @@ +{ + "id": "uni-segmented-control", + "displayName": "uni-segmented-control 分段器", + "version": "1.2.0", + "description": "分段器由至少 2 个分段控件组成,用作不同视图的显示", + "keywords": [ + "uni-ui", + "uniui", + "分段器", + "segement", + "顶部选择" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "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": ["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-segmented-control/readme.md b/uni_modules/uni-segmented-control/readme.md new file mode 100644 index 0000000..3527b03 --- /dev/null +++ b/uni_modules/uni-segmented-control/readme.md @@ -0,0 +1,13 @@ + + +## SegmentedControl 分段器 +> **组件名:uni-segmented-control** +> 代码块: `uSegmentedControl` + + +用作不同视图的显示 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-segmented-control) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + +