Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘文虎
account-book
Commits
9fb45e34
Commit
9fb45e34
authored
Jul 20, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入指示点之前
parent
a9854512
Pipeline
#2820
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
286 additions
and
11 deletions
+286
-11
billing-details.vue
components/billing-details/billing-details.vue
+1
-1
billing-category.vue
components/billing-details/components/billing-category.vue
+43
-10
uni-swiper-dot.vue
...i-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
+218
-0
index.js
utils/options/index/index.js
+24
-0
No files found.
components/billing-details/billing-details.vue
View file @
9fb45e34
...
...
@@ -68,7 +68,7 @@ export default {
billingTypeOptions
,
takePhotoIcon
:
indexBaseUrl
+
'shangchuanbeizhu@3x.png'
,
takePhotoSuccessIcon
:
indexBaseUrl
+
'shangchuanbeizhuchenggong@3x.png'
,
show
:
fals
e
,
show
:
tru
e
,
customStyle
:
{
width
:
'104rpx'
,
height
:
'48rpx'
,
...
...
components/billing-details/components/billing-category.vue
View file @
9fb45e34
<
template
>
<view
class=
"billing-category"
>
<view
class=
"billing-category-item"
:class=
"
{ active: item.value === checked }" v-for="(item, index) in list" :key="index" @click="handleCheck(item)">
<view
class=
"billing-category-item-icon"
>
<image
:src=
"billBaseUrl+item.icon"
mode=
""
v-if=
"item.value !== checked"
></image>
<image
:src=
"billBaseUrl+item.selectedIcon"
mode=
""
v-else
></image>
</view>
<view
class=
"billing-category-item-text"
>
{{
item
.
label
}}
</view>
</view>
<uni-swiper-dot
:info=
"swiperList"
:current=
"current"
field=
"content"
:mode=
"mode"
:dotsStyles=
"dotsStyles"
>
<swiper
class=
"swiper"
circular
:indicator-dots=
"false"
indicator-color=
"#8d8d8d"
indicator-active-color=
"#02A074"
:autoplay=
"false"
:duration=
"duration"
@
change=
"change"
>
<swiper-item
v-for=
"(swiper, swiperIndex) in swiperList"
:key=
"swiperIndex"
>
<view
class=
"swiper-item"
>
<view
class=
"billing-category-item"
:class=
"
{ active: item.value === checked }" v-for="(item, index) in list" :key="index" @click="handleCheck(item)">
<view
class=
"billing-category-item-icon"
>
<image
:src=
"billBaseUrl + item.icon"
mode=
""
v-if=
"item.value !== checked"
></image>
<image
:src=
"billBaseUrl + item.selectedIcon"
mode=
""
v-else
></image>
</view>
<view
class=
"billing-category-item-text"
>
{{
item
.
label
}}
</view>
</view>
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
</
template
>
<
script
>
import
UniSwiperDot
from
"@/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue"
import
{
billingCategoryOptions
}
from
'@/utils/options/index/index.js'
;
import
{
billBaseUrl
}
from
'@/utils/config.js'
;
export
default
{
...
...
@@ -25,11 +34,25 @@ export default {
return
{
billBaseUrl
,
list
:
billingCategoryOptions
,
swiperList
:
[
1
,
2
],
duration
:
500
,
current
:
0
,
mode
:
'round'
,
dotsStyles
:{
width
:
8
,
bottom
:
10
,
backgroundColor
:
'#8d8d8d'
,
selectedBackgroundColor
:
'#02A074'
}
};
},
methods
:
{
handleCheck
(
item
)
{
this
.
$emit
(
'handleClick'
,
item
);
},
change
(
e
)
{
this
.
current
=
e
.
detail
.
current
;
console
.
log
(
this
.
current
)
}
}
};
...
...
@@ -37,10 +60,20 @@ export default {
<
style
lang=
"scss"
scoped
>
.billing-category
{
display
:
flex
;
flex-wrap
:
wrap
;
margin-top
:
24upx
;
// margin-bottom: 24upx;
width
:
100%
;
height
:
272rpx
;
.swiper
{
width
:
100%
;
height
:
272rpx
;
.swiper-item
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-wrap
:
wrap
;
}
}
&
-item
{
padding
:
0
22upx
;
font-size
:
28upx
;
...
...
@@ -64,7 +97,7 @@ export default {
}
}
.active
{
.billing-category-item-icon
{
.billing-category-item-icon
{
background-color
:
$default-color
;
}
.billing-category-item-text
{
...
...
uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
0 → 100644
View file @
9fb45e34
<
template
>
<view
class=
"uni-swiper__warp"
>
<slot
/>
<view
v-if=
"mode === 'default'"
:style=
"
{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='default'>
<view
v-for=
"(item,index) in info"
@
click=
"clickItem(index)"
:style=
"
{
'width': (index === current? dots.width*2:dots.width ) + 'px','height':dots.width/2 +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border-radius':'0px'}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-bar" />
</view>
<view
v-if=
"mode === 'dot'"
:style=
"
{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='dot'>
<view
v-for=
"(item,index) in info"
@
click=
"clickItem(index)"
:style=
"
{
'width': dots.width + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item" />
</view>
<view
v-if=
"mode === 'round'"
:style=
"
{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='round'>
<view
v-for=
"(item,index) in info"
@
click=
"clickItem(index)"
:class=
"[index === current&&'uni-swiper__dots-long']"
:style=
"
{
'width':(index === current? dots.width*3:dots.width ) + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item " />
</view>
<view
v-if=
"mode === 'nav'"
key=
'nav'
:style=
"
{'background-color':dotsStyles.backgroundColor,'bottom':'0'}" class="uni-swiper__dots-box uni-swiper__dots-nav">
<text
:style=
"
{'color':dotsStyles.color}" class="uni-swiper__dots-nav-item">
{{
(
current
+
1
)
+
"/"
+
info
.
length
+
' '
+
info
[
current
][
field
]
}}
</text>
</view>
<view
v-if=
"mode === 'indexes'"
key=
'indexes'
:style=
"
{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box">
<view
v-for=
"(item,index) in info"
@
click=
"clickItem(index)"
:style=
"
{
'width':dots.width + 'px','height':dots.height +'px' ,'color':index === current?dots.selectedColor:dots.color,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-indexes">
<text
class=
"uni-swiper__dots-indexes-text"
>
{{
index
+
1
}}
</text></view>
</view>
</view>
</
template
>
<
script
>
/**
* SwiperDod 轮播图指示点
* @description 自定义轮播图指示点
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
* @value defualt 默认指示点
* @value round 圆形指示点
* @value nav 条形指示点
* @value indexes 索引指示点
* @property {String} field mode 为 nav 时,显示的内容字段(mode = nav 时必填)
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
* @property {Object} dotsStyles 指示点样式
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
*/
export
default
{
name
:
'UniSwiperDot'
,
emits
:[
'clickItem'
],
props
:
{
info
:
{
type
:
Array
,
default
()
{
return
[]
}
},
current
:
{
type
:
Number
,
default
:
0
},
dotsStyles
:
{
type
:
Object
,
default
()
{
return
{}
}
},
// 类型 :default(默认) indexes long nav
mode
:
{
type
:
String
,
default
:
'default'
},
// 只在 nav 模式下生效,变量名称
field
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
dots
:
{
width
:
6
,
height
:
6
,
bottom
:
10
,
color
:
'#fff'
,
backgroundColor
:
'rgba(0, 0, 0, .3)'
,
border
:
'1px rgba(0, 0, 0, .3) solid'
,
selectedBackgroundColor
:
'#333'
,
selectedBorder
:
'1px rgba(0, 0, 0, .9) solid'
}
}
},
watch
:
{
dotsStyles
(
newVal
)
{
this
.
dots
=
Object
.
assign
(
this
.
dots
,
this
.
dotsStyles
)
},
mode
(
newVal
)
{
if
(
newVal
===
'indexes'
)
{
this
.
dots
.
width
=
14
this
.
dots
.
height
=
14
}
else
{
this
.
dots
.
width
=
6
this
.
dots
.
height
=
6
}
}
},
created
()
{
if
(
this
.
mode
===
'indexes'
)
{
this
.
dots
.
width
=
12
this
.
dots
.
height
=
12
}
this
.
dots
=
Object
.
assign
(
this
.
dots
,
this
.
dotsStyles
)
},
methods
:
{
clickItem
(
index
)
{
this
.
$emit
(
'clickItem'
,
index
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.uni-swiper__warp
{
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
flex
:
1
;
flex-direction
:
column
;
position
:
relative
;
overflow
:
hidden
;
}
.uni-swiper__dots-box
{
position
:
absolute
;
bottom
:
10px
;
left
:
0
;
right
:
0
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
flex
:
1
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
}
.uni-swiper__dots-item
{
width
:
8px
;
border-radius
:
100px
;
margin-left
:
6px
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.4
);
/* #ifndef APP-NVUE */
cursor
:
pointer
;
/* #endif */
/* #ifdef H5 */
// border-width: 5px 0;
// border-style: solid;
// border-color: transparent;
// background-clip: padding-box;
/* #endif */
// transition: width 0.2s linear; 不要取消注释,不然会不能变色
}
.uni-swiper__dots-item
:first-child
{
margin
:
0
;
}
.uni-swiper__dots-default
{
border-radius
:
100px
;
}
.uni-swiper__dots-long
{
border-radius
:
50px
;
}
.uni-swiper__dots-bar
{
border-radius
:
50px
;
}
.uni-swiper__dots-nav
{
bottom
:
0px
;
// height: 26px;
padding
:
8px
0
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
flex
:
1
;
flex-direction
:
row
;
justify-content
:
flex-start
;
align-items
:
center
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.2
);
}
.uni-swiper__dots-nav-item
{
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; */
font-size
:
14px
;
color
:
#fff
;
margin
:
0
15px
;
}
.uni-swiper__dots-indexes
{
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
// flex: 1;
justify-content
:
center
;
align-items
:
center
;
}
.uni-swiper__dots-indexes-text
{
color
:
#fff
;
font-size
:
12px
;
line-height
:
14px
;
}
</
style
>
utils/options/index/index.js
View file @
9fb45e34
...
...
@@ -76,6 +76,30 @@ export const billingCategoryOptions = [{
},
{
value
:
"8"
,
label
:
"材料"
,
icon
:
'cailiao0@3x.png'
,
selectedIcon
:
'cailiao1@3x.png'
},
{
value
:
"9"
,
label
:
"材料"
,
icon
:
'cailiao0@3x.png'
,
selectedIcon
:
'cailiao1@3x.png'
},
{
value
:
"10"
,
label
:
"材料"
,
icon
:
'cailiao0@3x.png'
,
selectedIcon
:
'cailiao1@3x.png'
},
{
value
:
"11"
,
label
:
"材料"
,
icon
:
'cailiao0@3x.png'
,
selectedIcon
:
'cailiao1@3x.png'
},
{
value
:
"12"
,
label
:
"设置"
,
icon
:
'shezhi0@3x.png'
,
selectedIcon
:
'shezhi1@3x.png'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment