From c0e156747c83c0a1848e5f457d0116e8fef51767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com>
Date: Fri, 10 Dec 2021 10:00:53 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 1 -
api/user.js | 12 +
components/sSwiper.vue | 66 +++
components/vSwiper.vue | 99 ++++
config/index.js | 4 +-
main.js | 3 +
pages/demandHall/resourcesDetail/index.vue | 85 +--
pages/home/index.vue | 1 +
pages/life/addGoods/index.vue | 89 ++--
pages/life/index.vue | 2 +-
pages/life/temp/index.vue | 105 +---
pages/life/tempList/index.vue | 48 +-
pages/order/OrderSubmission/index.vue | 11 +-
pages/shop/GoodsCon/index.vue | 18 +-
pages/user/agreement/index.vue | 482 +++++++++---------
pages/user/goodsManage/index.vue | 11 +-
pages/user/index.vue | 7 +-
pages/user/openStore/index.vue | 2 +-
static/images/edit-icon.png | Bin 0 -> 646 bytes
uni_modules/uni-badge/changelog.md | 22 +
.../components/uni-badge/uni-badge.vue | 253 +++++++++
uni_modules/uni-badge/package.json | 88 ++++
uni_modules/uni-badge/readme.md | 58 +++
23 files changed, 989 insertions(+), 478 deletions(-)
create mode 100644 components/sSwiper.vue
create mode 100644 components/vSwiper.vue
create mode 100644 static/images/edit-icon.png
create mode 100644 uni_modules/uni-badge/changelog.md
create mode 100644 uni_modules/uni-badge/components/uni-badge/uni-badge.vue
create mode 100644 uni_modules/uni-badge/package.json
create mode 100644 uni_modules/uni-badge/readme.md
diff --git a/App.vue b/App.vue
index 3783774..498da52 100644
--- a/App.vue
+++ b/App.vue
@@ -251,7 +251,6 @@ export default {
setMenuHeight() {
uni.getSystemInfo({
success: res => {
- console.log(res);
this.globalData.navTopHeight = res.statusBarHeight;
this.globalData.CustomBar = res.statusBarHeight + 45;
this.globalData.systemInfo = res;
diff --git a/api/user.js b/api/user.js
index 95c245d..2f3ff4d 100644
--- a/api/user.js
+++ b/api/user.js
@@ -31,6 +31,12 @@ export function addTemp(data) {
login: true,
})
}
+//删除运费模板
+export function delTemp(data) {
+ return request.delete('/user/shippingtemplate?ids=' + data, {
+ login: true,
+ })
+}
//获取运费模板列表
export function getTempList(data) {
@@ -38,6 +44,12 @@ export function getTempList(data) {
login: true,
})
}
+//获取运费模板详情
+export function getTempDetail(data) {
+ return request.get('/user/shippingtemplate/getTemplatesDetail?id='+data, {
+ login: true,
+ })
+}
/**
* 用户登录
diff --git a/components/sSwiper.vue b/components/sSwiper.vue
new file mode 100644
index 0000000..d6d0b49
--- /dev/null
+++ b/components/sSwiper.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/vSwiper.vue b/components/vSwiper.vue
new file mode 100644
index 0000000..0ed0c6c
--- /dev/null
+++ b/components/vSwiper.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+ 标题标题标题标题标题
+
+ 云快讯
+ 3小时钱
+ 300阅读
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/index.js b/config/index.js
index dbb5bee..844be21 100644
--- a/config/index.js
+++ b/config/index.js
@@ -1,8 +1,8 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
// export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
-// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
-export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
+export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
+// export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
diff --git a/main.js b/main.js
index da7db6c..48c4502 100644
--- a/main.js
+++ b/main.js
@@ -45,6 +45,9 @@ Object.defineProperty(Vue.prototype, '$yroute', {
},
})
+console.log(Vue.prototype)
+console.log(Object.getPrototypeOf(Vue))
+
let deviceType = ''
// #ifdef APP-PLUS
// App平台编译的代码
diff --git a/pages/demandHall/resourcesDetail/index.vue b/pages/demandHall/resourcesDetail/index.vue
index 8785563..038e1c3 100644
--- a/pages/demandHall/resourcesDetail/index.vue
+++ b/pages/demandHall/resourcesDetail/index.vue
@@ -49,13 +49,8 @@
-
-
-
-
-
-
-
+
+
立即沟通
@@ -66,7 +61,8 @@
@@ -324,29 +274,4 @@ export default {
color: #707070;
line-height: 40rpx;
}
-
-.swiper-block {
- height: 300rpx;
- width: 100%;
-}
-
-.swiper-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: flex-start;
- overflow: unset;
-}
-.slide-image {
- height: 250rpx;
- width: 520rpx;
- border-radius: 9rpx;
- margin: 0rpx 30rpx;
- z-index: 1;
-}
-.active {
- transform: scale(1.14);
- transition: all 0.2s ease-in 0s;
- z-index: 20;
-}
\ No newline at end of file
diff --git a/pages/home/index.vue b/pages/home/index.vue
index e65df47..2652fac 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -231,6 +231,7 @@ export default {
}
},
onLoad() {
+
uni.hideTabBar();
// app.globalData.editTabbar();
this.pagePath = '/pages/home/index'
diff --git a/pages/life/addGoods/index.vue b/pages/life/addGoods/index.vue
index 303e18c..2537788 100644
--- a/pages/life/addGoods/index.vue
+++ b/pages/life/addGoods/index.vue
@@ -89,7 +89,7 @@
-
+
提交
@@ -237,6 +237,8 @@
this.attrArr = info.items
this.spec_type = 1
this.isShow = info.is_show
+ this.tempId = info.shippingTemplatesDto.id
+ this.temp = info.name
let strArr = info.items.map(item=>{
return item.value
})
@@ -291,6 +293,9 @@
this.addOptionsDialog = true
},
delAttr(i){
+ if(this.attrArr.length == 1){
+ return this.alertMessage('至少有一个规格')
+ }
this.attrArr.splice(i,1)
this.getFormatAttr()
},
@@ -303,19 +308,19 @@
///添加属性提交
submitAddAttr(){
if(this.attr.value == ''){
- return uni.showToast({
- title: '请填写属性名称!',
- icon: 'none'
- })
+ return this.alertMessage('请填写属性名称','none')
}
try{
var o = this.attr.detail;
+ if(o.length == 0){
+ throw "请至少填写一个属性值!";
+ }
o.forEach(function(item,index) {
if(item == ""){
- throw "属性规格不能为空!";
+ throw "属性值不能为空!";
}
});
- }catch(e){
+ } catch(e){
uni.showToast({
title: e,
icon: 'none'
@@ -337,19 +342,13 @@
if(res.success){
this.$set(this.batchData,'priceArr',res.data.value)
if(res.data.attr){
- let strArr = res.data.attr.map(item=>{
- return item.value
- })
+ let strArr = res.data.attr.map(item=> item.value)
this.$set(this.batchData,'titleStr',strArr.join('/'))
} else{
this.$set(this.batchData,'titleStr','')
}
-
} else{
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
+ this.alertMessage(res.msg)
}
})
},
@@ -391,7 +390,6 @@
} else{
this.attrValTitle = '批量修改规格'
}
-
this.showAttrVal= true
},
cancelClick(){
@@ -400,7 +398,7 @@
},
submitClick(){
const idx = this.idx
- console.log(this.price,this.ot_price,this.stock)
+ // console.log(this.price,this.ot_price,this.stock)
if(this.stock == 0){
return this.alertMessage('商品库存不能为0')
}
@@ -414,9 +412,6 @@
this.$set(this.batchData.priceArr[idx],'price',this.price)
this.$set(this.batchData.priceArr[idx],'ot_price',this.ot_price)
this.$set(this.batchData.priceArr[idx],'stock',this.stock)
- // this.batchData.priceArr[idx].price= this.price
- // this.batchData.priceArr[idx].ot_price= this.ot_price
- // this.batchData.priceArr[idx].stock= this.stock
}
this.showAttrVal= false
},
@@ -436,77 +431,59 @@
isShow: this.isShow,
items: this.items
}
+ console.log(form.slider_image[0])
if(form.store_name == ''){
- this.alertMessage('请填写商品名称')
- return
- } else if(form.slider_image[0] == ''){
- this.alertMessage('请至少上传一张商品图片')
- return
+ return this.alertMessage('请填写商品名称','none')
+ } else if(form.slider_image[0]){
+ return this.alertMessage('请至少上传一张商品图片','none')
} else if(form.description == ''){
- this.alertMessage('请填写商品详情')
- return
+ return this.alertMessage('请填写商品详情','none')
} else if(form.description == ''){
- this.alertMessage('请填写商品详情')
- return
+ return this.alertMessage('请填写商品详情','none')
}
form.attrs.forEach((item,index)=>{
if(item.price == '' || item.price == 0){
- this.alertMessage('请商品规格价格')
- return
+ return this.alertMessage('请商品规格价格','none')
} else if(item.stock == '' || item.stock == 0){
- this.alertMessage('库存不能为0')
- return
+ return this.alertMessage('商品规格库存不能为0','none')
}
})
if(this.id != ''){
form.id = this.id
form.spec_type = this.spec_type
- console.log(form)
editProduct(form).then((res)=>{
if(res.success){
- uni.showToast({
- title: res.msg,
- duration: 1500
- })
+ this.alertMessage(res.msg,'success')
setTimeout((res)=>{
uni.redirectTo({
- url: '/pages/user/goodsManage/index'
+ url: '/pages/user/goodsManage/index?type=' + 0
});
},1500)
} else{
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
+ this.alertMessage(res.msg,'none')
}
})
} else{
form.spec_type = this.batchData.priceArr.length > 1 ? 1 : 0
- console.log(form)
addProduct(form).then((res)=>{
if(res.success){
- uni.showToast({
- title: res.msg,
- duration: 1500
- })
+ this.alertMessage(res.msg,'success')
setTimeout((res)=>{
uni.redirectTo({
- url: '/pages/user/goodsManage/index'
+ url: '/pages/user/goodsManage/index?type=' + 0
});
},1500)
} else{
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
+ this.alertMessage(res.msg,'none')
}
})
}
},
- alertMessage(msg){
+ alertMessage(msg,type){
uni.showToast({
title: msg,
- icon: 'none'
+ icon: type,
+ duration: 1500
})
}
}
diff --git a/pages/life/index.vue b/pages/life/index.vue
index 8859db7..a873776 100644
--- a/pages/life/index.vue
+++ b/pages/life/index.vue
@@ -179,7 +179,7 @@ export default {
} else{
this.flowList = res.data
}
- this.isLoad = this.limit <= res.data.length
+ // this.isLoad = this.limit <= res.data.length
if(this.limit <= res.data.length){ //分页数等于返回值的length说明还有
this.isLoad = true
} else{
diff --git a/pages/life/temp/index.vue b/pages/life/temp/index.vue
index d49b9d7..a75615b 100644
--- a/pages/life/temp/index.vue
+++ b/pages/life/temp/index.vue
@@ -22,9 +22,9 @@
阶梯运费
-
+
-
+
{{type == 0 ? '件' : 'kg' }}内(含)¥
@@ -87,76 +87,8 @@
const app = getApp();
import selectTree from "@/components/select-tree/select-tree"
import tkiTree from "@/components/tki-tree/tki-tree.vue"
-import { getCity, citys, addTemp } from "@/api/user";
+import { getCity, citys, addTemp, getTempDetail } from "@/api/user";
-let testList = [
- {
- city_id: 1,
- id: 1,
- isShow: 1,
- lat: "39.904030",
- level: 0,
- lng: "116.407526",
- mergerName: "北京",
- name: "北京市",
- parentId: 0,
- children: [
- {
- areaCode: "110100000000",
- children: null,
- city_id: 2,
- id: 35,
- isShow: 1,
- lat: "39.904030",
- level: 1,
- lng: "116.407526",
- mergerName: "北京",
- name: "北京市",
- parentId: 1,
- },
- ]
- },
- {
- areaCode: "130000000000",
- children: [
- {
- areaCode: "130100000000",
- children: null,
- city_id: 13268,
- id: 37,
- isShow: 1,
- lat: "38.042306",
- level: 1,
- lng: "114.514859",
- mergerName: "河北,石家庄",
- name: "石家庄市",
- parentId: 13267,
- },
- {
- areaCode: "130200000000",
- children: null,
- city_id: 18128,
- id: 38,
- isShow: 1,
- lat: "39.630867",
- level: 1,
- lng: "118.180193",
- mergerName: "河北,唐山",
- name: "唐山市",
- parentId: 13267,
- }
- ],
- city_id: 13267,
- id: 3,
- isShow: 1,
- lat: "38.037057",
- level: 0,
- lng: "114.468664",
- mergerName: "河北",
- name: "河北省",
- parentId: 0,
- }
- ]
var g = [
{
region: [
@@ -182,17 +114,36 @@ export default {
name: "",
type:0,
setpFreight: false,
- list: testList,
- templateList: g
+ list: [],
+ templateList: g,
+ id: null
};
},
mounted(){
+ if(this.$yroute.query.id){
+ this.id = this.$yroute.query.id
+ this.getTempDetail(this.$yroute.query.id)
+ }
citys().then((res)=>{
let data = res.data;
this.list = data
})
},
methods: {
+ getTempDetail(id){
+ getTempDetail(id).then((res)=>{
+ if(res.success){
+ this.name= res.data.name
+ this.type= res.data.type
+ this.templateList = res.data.region_info
+ this.templateList.forEach((item)=>{
+ item.setpFreight = true
+ })
+ } else{
+ this.alertMessage(res.msg)
+ }
+ })
+ },
radioChange(e){
this.type = e.detail.value
},
@@ -208,13 +159,13 @@ export default {
this.$refs.tkitree._show();
},
delTempItem(idx){
- console.log(idx)
this.templateList.splice(idx,1)
},
// 确定回调事件
treeConfirm(e) {
- // console.log(e,'确认')
- // console.log(this.list,'列表')
+ console.log(e,'确认')
+ console.log(this.list,'列表')
+ if(e.length == 0) return
let list = this.list;
let selectCity = e;
let selectName = [];
@@ -260,13 +211,13 @@ export default {
// 取消回调事件
treeCancel(e) {
console.log(e)
-
},
submit(){
let form = {}
form.name = this.name
form.type = this.type
form.region_info = this.templateList
+ form.id = this.id
if(form.name == '' ){
return this.alertMessage('请填写模板名字')
diff --git a/pages/life/tempList/index.vue b/pages/life/tempList/index.vue
index 7d0d736..af5a311 100644
--- a/pages/life/tempList/index.vue
+++ b/pages/life/tempList/index.vue
@@ -5,8 +5,13 @@
{{index + 1}}、{{item.name}}
-
-
+
+
+
+
+
+
+
@@ -15,7 +20,7 @@
\ No newline at end of file
+ .pay-box .img2 {
+ height: 1235rpx;
+ }
+
diff --git a/pages/user/goodsManage/index.vue b/pages/user/goodsManage/index.vue
index 0ff4540..5fdb2d7 100644
--- a/pages/user/goodsManage/index.vue
+++ b/pages/user/goodsManage/index.vue
@@ -1,10 +1,10 @@
-
+
出售中
-
+
待上架
@@ -60,12 +60,15 @@
}
},
onShow() {
+ this.$yroute.query.type ? this.type = this.$yroute.query.type : this.type = 1
this.getProducts()
let pages = getCurrentPages();
- console.log(pages)
},
onReachBottom() {
- this.getProducts()
+ if(this.loading){
+ this.page= this.page + 1
+ this.getProducts()
+ }
},
onPullDownRefresh() {
this.goodsList = []
diff --git a/pages/user/index.vue b/pages/user/index.vue
index b22fc87..9f71fea 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -230,7 +230,6 @@ export default {
userInfo: {},
CustomBar: app.globalData.CustomBar,
menuHeight: app.globalData.menuHeight,
- navHeight: app.globalData.navHeight,
menuTop: app.globalData.menuTop,
demandCounts: 0,
supplyCounts: 0,
@@ -250,15 +249,14 @@ export default {
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
- // app.globalData.editTabbar();
+
this.getInfo();
},
-
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
-
+
},
onPullDownRefresh() {
this.getInfo()
@@ -311,7 +309,6 @@ export default {
},
toAuth() {
-
uni.navigateTo({
url: '/pages/release/index'
});
diff --git a/pages/user/openStore/index.vue b/pages/user/openStore/index.vue
index ef8fbde..cf9ecde 100644
--- a/pages/user/openStore/index.vue
+++ b/pages/user/openStore/index.vue
@@ -146,7 +146,7 @@
min-height: 100vh;
background: #eee;
.form-box{
- padding: 0rpx 40rpx;
+ padding: 20rpx 40rpx;
.form-item{
width: 100%;
padding: 30rpx 28rpx;
diff --git a/static/images/edit-icon.png b/static/images/edit-icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..75cf11d0e9624af268eba0d5540c0c65098ed2e2
GIT binary patch
literal 646
zcmV;10(t$3P)Px%KuJVFR9Hvtm(ObyF%-w&%d*EJ2p)wVy?C*IfcCP<+g%F_JD&C8zhV6c{2K}$
z1?ggk$B1AB5kU&27eNYD5fMZvintUfk*o=ZFx^adXTU?}n0d+flkdxq7lewBnQv6J
zr`m{UHx=XmGxI7Dy+_|r6vdj>`Yr&B0N_&HfuguOM6{Lao9Fqa5aJ#HY|Q|QqPU{9
zew*r8}LK$YyCh7QQOK;ER}*#91-n=GY{|)04`f1B3iF8
z(=&&J;>MVFh?o)4fd?>lM6LDx!Ctl#gyjUnBQHv$lf8)J@b&XrQnQsRxA1Cj0Do$XKO
zi8FI%|J!?GDF>p}{?mzbLfl^UJ~itL14QD#?AflA%2T$xT4OnYNc=^HL?b3Pq!lQ9N^r6|JH#c09b9aEcY8CD$g(YlW+n68!l*1YrV6~Ry(b)5aK!j
ztO39ZBC=AdKLg0~{HhS*pbgPEFgK-?J5`USYXATM
literal 0
HcmV?d00001
diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md
new file mode 100644
index 0000000..4ca8c5b
--- /dev/null
+++ b/uni_modules/uni-badge/changelog.md
@@ -0,0 +1,22 @@
+## 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..f3869c4
--- /dev/null
+++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue
@@ -0,0 +1,253 @@
+
+
+
+ {{displayValue}}
+
+
+
+
+
+
diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json
new file mode 100644
index 0000000..4efafd5
--- /dev/null
+++ b/uni_modules/uni-badge/package.json
@@ -0,0 +1,88 @@
+{
+ "id": "uni-badge",
+ "displayName": "uni-badge 数字角标",
+ "version": "1.1.6",
+ "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..d29680b
--- /dev/null
+++ b/uni_modules/uni-badge/readme.md
@@ -0,0 +1,58 @@
+
+
+## Badge 数字角标
+> **组件名:uni-badge**
+> 代码块: `uBadge`
+
+
+数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
+
+### 安装方式
+
+本组件符合[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)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+
+
+
+
+
+
+
+```
+
+
+## API
+
+### Badge Props
+
+|属性名 |类型 |默认值 |说明 |
+|:-: |:-: |:-: |:-: |
+|text |String |- |角标内容 |
+|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
+|size |String |normal |Badge 大小,可取值:normal、small |
+|is-dot |Boolean|false |不展示数字,只有一个小点 |
+|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ |
+|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 |
+|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
+|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) |
+|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])|
+
+### Badge Events
+
+|事件名 |事件说明 |返回参数 |
+|:-: |:-: |:-: |
+|@click |点击 Badge 触发事件| - |
+
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge)
\ No newline at end of file