From 4138ce6628b8e274e1802363e5fc4441444e5ebd Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 11 May 2022 15:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/modules/client.js | 12 + libs/util.js | 13 + pages.json | 11 +- pages/addClient/addClient.vue | 135 ---------- pages/clientDetail/clientDetail.vue | 110 ++++++-- uni_modules/hpy-form-select/changelog.md | 2 + .../hpy-form-select/hpy-form-select.vue | 255 ++++++++++++++++++ uni_modules/hpy-form-select/package.json | 87 ++++++ uni_modules/hpy-form-select/readme.md | 169 ++++++++++++ uni_modules/uni-scss/variables.scss | 2 +- 10 files changed, 634 insertions(+), 162 deletions(-) delete mode 100644 pages/addClient/addClient.vue create mode 100644 uni_modules/hpy-form-select/changelog.md create mode 100644 uni_modules/hpy-form-select/components/hpy-form-select/hpy-form-select.vue create mode 100644 uni_modules/hpy-form-select/package.json create mode 100644 uni_modules/hpy-form-select/readme.md diff --git a/apis/modules/client.js b/apis/modules/client.js index 24b6538..14567c9 100644 --- a/apis/modules/client.js +++ b/apis/modules/client.js @@ -19,4 +19,16 @@ export const queryIndustryClass = (data) => { export const queryIndustry = (data) => { return get('nakadai/nakadai/hrIndustry/queryIndustry', data) +} + +export const queryCustomerIsExists = (data) => { + return get('nakadai/nakadai/customer/queryCustomerIsExists', data) +} + +export const addCustomer = (data) => { + return post('nakadai/nakadai/customer/addCustomer', data) +} + +export const updateCustomer = (data) => { + return post('nakadai/nakadai/customer/updateCustomer', data) } \ No newline at end of file diff --git a/libs/util.js b/libs/util.js index 89cf6b1..8b57ff4 100644 --- a/libs/util.js +++ b/libs/util.js @@ -4,5 +4,18 @@ export default { uni.navigateTo({ url }) + }, + // 成功提示 + sucMsg(title) { + uni.showToast({ + title + }) + }, + // 错误提示 + errMsg(title) { + uni.showToast({ + title, + icon: 'none' + }) } } \ No newline at end of file diff --git a/pages.json b/pages.json index f24623f..2e02728 100644 --- a/pages.json +++ b/pages.json @@ -85,16 +85,7 @@ "enablePullDownRefresh": false } - } - ,{ - "path" : "pages/addClient/addClient", - "style" : - { - "navigationBarTitleText": "新建客户", - "enablePullDownRefresh": false - } - - }, + }, { "path" : "pages/ordered/ordered", "style" : diff --git a/pages/addClient/addClient.vue b/pages/addClient/addClient.vue deleted file mode 100644 index ec40e90..0000000 --- a/pages/addClient/addClient.vue +++ /dev/null @@ -1,135 +0,0 @@ - - - - - diff --git a/pages/clientDetail/clientDetail.vue b/pages/clientDetail/clientDetail.vue index 2c172f7..50715d0 100644 --- a/pages/clientDetail/clientDetail.vue +++ b/pages/clientDetail/clientDetail.vue @@ -5,31 +5,30 @@ {{ form.customerName }} 客户编号:2124232 客户类型:{{ customerType }} - 产品到期时间:{{ form.expireDate }} + 产品到期时间:{{ form.expireDate || '' }} - - - - - + + + + - + - + - - + + - - + + @@ -55,11 +54,12 @@ + - + 编辑 @@ -76,7 +76,7 @@ diff --git a/uni_modules/hpy-form-select/changelog.md b/uni_modules/hpy-form-select/changelog.md new file mode 100644 index 0000000..01f2a3e --- /dev/null +++ b/uni_modules/hpy-form-select/changelog.md @@ -0,0 +1,2 @@ +## 0.0.10(2022-04-26) +- 适配uni-forms校验 diff --git a/uni_modules/hpy-form-select/components/hpy-form-select/hpy-form-select.vue b/uni_modules/hpy-form-select/components/hpy-form-select/hpy-form-select.vue new file mode 100644 index 0000000..78de734 --- /dev/null +++ b/uni_modules/hpy-form-select/components/hpy-form-select/hpy-form-select.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/uni_modules/hpy-form-select/package.json b/uni_modules/hpy-form-select/package.json new file mode 100644 index 0000000..c40ce8a --- /dev/null +++ b/uni_modules/hpy-form-select/package.json @@ -0,0 +1,87 @@ +{ + "id": "hpy-form-select", + "displayName": "picker选择器、下拉框,选择器", + "version": "0.0.10", + "description": "下拉选择器 基于 picker 简单封装", + "keywords": [ + "picker", + "选择器", + "下拉选择" +], + "repository": "", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uni-load-more" + ], + "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", + "阿里": "u", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "y", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/hpy-form-select/readme.md b/uni_modules/hpy-form-select/readme.md new file mode 100644 index 0000000..30f721e --- /dev/null +++ b/uni_modules/hpy-form-select/readme.md @@ -0,0 +1,169 @@ + +## hpy-form-select 下拉选择器 基于 [picker](https://uniapp.dcloud.io/component/picker?id=picker) 简单封装 + +> **组件名:hpy-form-select + +从底部弹起的滚动选择器。支持五种选择器,通过mode来区分,分别是普通选择器,多列选择器,时间选择器,日期选择器,省市区选择器,默认是普通选择器 + +## API + +### FilePicker Props + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
属性名类型默认值说明
islotBoolean | Stringfalse是否使用插槽
titleString请选择默认标题
modeString选择模式selector | multiSelector
startString表示有效日期范围的开始,字符串格式为"YYYY-MM-DD"
endString表示有效日期范围的结束,字符串格式为"YYYY-MM-DD"
fieldsStringday有效值 year、month、day,表示选择器的粒度,默认为 day,App 端未配置此项时使用系统 UI
customItemString可为每一列的顶部添加一个自定义的项
dataListArray选择器数据
textString显示值的key
nameString保存值的key
v-model | valueArray | Object绑定的数据
disabledBoolean | Stringfalse是否禁用
hideBorderBoolean | Stringfalse是否隐藏边框
hideArrowBoolean | Stringfalse是否隐藏箭头
+ + +## 使用示例 +## dataList 为对象数组时,name为实际保存的value值,text为显示的值 +## dataList 为对象数组[{name:'张三', age:'18'}, {name:'李四', age:'19'}]时,需要设置name、text属性,name为实际保存的value值,text为显示的值 +## +## ====================================================================================================== +## dataList 为普通数组['张三', '李四'] name、text可不设置 +## +## 类似: +## + + +```html + + + + + + + + + + + + + + 可自定义显示 + + + + + + + +``` + +```javascript +export default { + data() { + return { + formData:{ + hobbySelect:'' + }, + hobbyList: [{ + text: '足球', + value: 1 + }, { + text: '篮球', + value: 2 + }, { + text: '游泳', + value: 3 + }], + } + }, + methods:{ + change(e){ + console.log(e.index); + console.log(e.value); + console.log(e.data); + } + } +} + +``` \ No newline at end of file diff --git a/uni_modules/uni-scss/variables.scss b/uni_modules/uni-scss/variables.scss index a369497..1c062d4 100644 --- a/uni_modules/uni-scss/variables.scss +++ b/uni_modules/uni-scss/variables.scss @@ -5,7 +5,7 @@ $uni-space-root: 2; $uni-radius-root:5px; // 主色 -$uni-primary: #007eff; +$uni-primary: #2979ff; $uni-primary-disable:mix(#fff,$uni-primary,50%); $uni-primary-light: mix(#fff,$uni-primary,80%);