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
68cc1cb7
Commit
68cc1cb7
authored
Aug 22, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拖动排序
parent
ffbd4520
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
66 deletions
+82
-66
payments-setting.js
api/mine/payments-setting.js
+5
-2
pages.json
pages.json
+2
-1
drap-view.vue
pages/mine/payments-setting/components/drap-view.vue
+75
-63
No files found.
api/mine/payments-setting.js
View file @
68cc1cb7
...
@@ -4,6 +4,7 @@ export function getList(data) {
...
@@ -4,6 +4,7 @@ export function getList(data) {
url
:
`/rest/user/bookClassification`
,
url
:
`/rest/user/bookClassification`
,
method
:
'GET'
,
method
:
'GET'
,
data
,
data
,
noLoading
:
true
})
})
}
}
...
@@ -11,7 +12,8 @@ export function sortList(data) {
...
@@ -11,7 +12,8 @@ export function sortList(data) {
return
request
({
return
request
({
url
:
`/rest/user/bookClassification/sort`
,
url
:
`/rest/user/bookClassification/sort`
,
method
:
'POST'
,
method
:
'POST'
,
data
data
,
noLoading
:
true
})
})
}
}
...
@@ -27,6 +29,7 @@ export function update(data) {
...
@@ -27,6 +29,7 @@ export function update(data) {
return
request
({
return
request
({
url
:
`/rest/user/bookClassification`
,
url
:
`/rest/user/bookClassification`
,
method
:
'POST'
,
method
:
'POST'
,
data
data
,
noLoading
:
true
})
})
}
}
\ No newline at end of file
pages.json
View file @
68cc1cb7
...
@@ -183,7 +183,8 @@
...
@@ -183,7 +183,8 @@
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"收支设置"
,
"navigationBarTitleText"
:
"收支设置"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
}
}
...
...
pages/mine/payments-setting/components/drap-view.vue
View file @
68cc1cb7
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
:style="'height: ' + pageInfo.rowHeight + 'px;'"
:style="'height: ' + pageInfo.rowHeight + 'px;'"
@click.stop="closeAll"
@click.stop="closeAll"
>
>
<view
class=
"item-view"
@
click
.
stop=
"clickCell(item,
index)"
>
<view
class=
"item-view"
@
click
.
stop=
"clickCell(item,
index)"
>
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<view
class=
"image-view"
><image
:src=
"billStaticBaseUrl + item.icon"
v-if=
"item.icon"
></image></view>
<view
class=
"image-view"
><image
:src=
"billStaticBaseUrl + item.icon"
v-if=
"item.icon"
></image></view>
<view
class=
"name-view"
>
{{
item
.
label
}}
</view>
<view
class=
"name-view"
>
{{
item
.
label
}}
</view>
...
@@ -30,15 +30,8 @@
...
@@ -30,15 +30,8 @@
</uni-swipe-action>
</uni-swipe-action>
</view>
</view>
</scroll-view>
</scroll-view>
<movable-area
class=
"movable-area"
:style=
"'display:' + movableViewInfo.showClass + '; height:' + pageInfo.scrollHeight + '%'"
>
<movable-area
class=
"movable-area"
:class=
"
{ 'movable-area-active': pageInfo.beginMove }">
<movable-view
<movable-view
class=
"row list-row movable-row"
:out-of-bounds=
"true"
damping=
"999"
:style=
"movableViewStyle"
direction=
"vertical"
:y=
"movableViewInfo.y"
>
class=
"row list-row movable-row"
:out-of-bounds=
"true"
damping=
"999"
:style=
"'height:' + pageInfo.rowHeight + 'px;'"
direction=
"vertical"
:y=
"movableViewInfo.y"
>
<view
class=
"item-view"
>
<view
class=
"item-view"
>
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<view
class=
"image-view"
><image
:src=
"billStaticBaseUrl + movableViewInfo.data.icon"
class=
"image-view"
v-if=
"movableViewInfo.data.icon"
></image></view>
<view
class=
"image-view"
><image
:src=
"billStaticBaseUrl + movableViewInfo.data.icon"
class=
"image-view"
v-if=
"movableViewInfo.data.icon"
></image></view>
...
@@ -53,8 +46,8 @@
...
@@ -53,8 +46,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
UniSwipeAction
from
'@/components/uni-swipe-action/uni-swipe-action.vue'
;
import
UniSwipeAction
from
'@/components/uni-swipe-action/uni-swipe-action.vue'
;
import
UniSwipeActionItem
from
'@/components/uni-swipe-action-item/uni-swipe-action-item.vue'
;
import
UniSwipeActionItem
from
'@/components/uni-swipe-action-item/uni-swipe-action-item.vue'
;
import
PopInput
from
'@/components/pop-input-view'
;
import
PopInput
from
'@/components/pop-input-view'
;
import
{
billStaticBaseUrl
}
from
'@/utils/config.js'
;
import
{
billStaticBaseUrl
}
from
'@/utils/config.js'
;
export
default
{
export
default
{
...
@@ -63,7 +56,7 @@ export default {
...
@@ -63,7 +56,7 @@ export default {
components
:
{
components
:
{
UniSwipeAction
,
UniSwipeAction
,
UniSwipeActionItem
,
UniSwipeActionItem
,
PopInput
,
PopInput
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -101,6 +94,7 @@ export default {
...
@@ -101,6 +94,7 @@ export default {
selectedIndex
:
null
,
// 放置的位置
selectedIndex
:
null
,
// 放置的位置
beginMove
:
false
beginMove
:
false
},
},
beginMove
:
false
,
top
:
0
,
top
:
0
,
systemInfo
:
{}
systemInfo
:
{}
};
};
...
@@ -114,12 +108,21 @@ export default {
...
@@ -114,12 +108,21 @@ export default {
deep
:
true
deep
:
true
}
}
},
},
computed
:
{},
computed
:
{
movableViewStyle
()
{
let
style
=
`height:
${
this
.
pageInfo
.
rowHeight
}
px`
;
return
style
;
}
},
mounted
()
{
mounted
()
{
this
.
systemInfo
=
uni
.
getSystemInfoSync
();
this
.
systemInfo
=
uni
.
getSystemInfoSync
();
this
.
optionLists
=
[...
this
.
list
];
this
.
optionLists
=
[...
this
.
list
];
},
},
methods
:
{
methods
:
{
beginMoveChange
(){
this
.
beginMove
=!
this
.
beginMove
this
.
pageInfo
.
beginMove
=!
this
.
pageInfo
.
beginMove
},
clickCell
(
item
)
{
clickCell
(
item
)
{
let
flag
=
true
;
let
flag
=
true
;
this
.
optionLists
.
map
(
el
=>
{
this
.
optionLists
.
map
(
el
=>
{
...
@@ -131,13 +134,13 @@ export default {
...
@@ -131,13 +134,13 @@ export default {
this
.
toEdit
(
item
);
this
.
toEdit
(
item
);
}
}
},
},
onClick
(
e
,
item
)
{
onClick
(
e
,
item
)
{
console
.
log
(
e
);
console
.
log
(
e
);
console
.
log
(
'点击了'
+
(
e
.
position
===
'left'
?
'左侧'
:
'右侧'
)
+
e
.
content
.
text
+
'按钮'
);
console
.
log
(
'点击了'
+
(
e
.
position
===
'left'
?
'左侧'
:
'右侧'
)
+
e
.
content
.
text
+
'按钮'
);
if
(
e
.
position
===
'right'
)
{
if
(
e
.
position
===
'right'
)
{
if
(
e
.
content
.
text
===
'删除'
)
{
if
(
e
.
content
.
text
===
'删除'
)
{
this
.
beforeDelete
(
item
)
this
.
beforeDelete
(
item
)
;
}
else
if
(
e
.
content
.
text
===
'编辑'
)
{
}
else
if
(
e
.
content
.
text
===
'编辑'
)
{
this
.
toEdit
(
item
);
this
.
toEdit
(
item
);
}
}
}
}
...
@@ -157,28 +160,28 @@ export default {
...
@@ -157,28 +160,28 @@ export default {
}
}
});
});
uni
.
$once
(
`input-sure-payments-setting`
,
res
=>
{
uni
.
$once
(
`input-sure-payments-setting`
,
res
=>
{
this
.
optionLists
.
map
(
el
=>
{
this
.
optionLists
.
map
(
el
=>
{
if
(
el
.
id
===
item
.
id
)
{
if
(
el
.
id
===
item
.
id
)
{
el
.
label
=
res
.
content
el
.
label
=
res
.
content
;
}
}
})
})
;
this
.
$emit
(
'onEdit'
,
item
);
this
.
$emit
(
'onEdit'
,
item
);
});
});
},
},
handleConfirm
()
{
handleConfirm
()
{
this
.
optionLists
.
map
(
item
=>
{
this
.
optionLists
.
map
(
item
=>
{
if
(
item
.
id
===
this
.
readyDeleteItem
.
id
)
{
if
(
item
.
id
===
this
.
readyDeleteItem
.
id
)
{
item
.
show
=
false
item
.
show
=
false
;
}
}
})
})
;
this
.
$emit
(
'onDelete'
,
this
.
readyDeleteItem
);
this
.
$emit
(
'onDelete'
,
this
.
readyDeleteItem
);
},
},
handleCancel
()
{
handleCancel
()
{
this
.
optionLists
.
map
(
item
=>
{
this
.
optionLists
.
map
(
item
=>
{
if
(
item
.
id
===
this
.
readyDeleteItem
.
id
)
{
if
(
item
.
id
===
this
.
readyDeleteItem
.
id
)
{
item
.
show
=
false
item
.
show
=
false
;
}
}
})
})
;
},
},
beforeDelete
(
item
)
{
beforeDelete
(
item
)
{
...
@@ -194,9 +197,9 @@ export default {
...
@@ -194,9 +197,9 @@ export default {
},
},
closeAll
()
{
closeAll
()
{
if
(
this
.
optionLists
.
length
)
{
if
(
this
.
optionLists
.
length
)
{
this
.
optionLists
.
map
(
item
=>
{
this
.
optionLists
.
map
(
item
=>
{
item
.
show
=
false
item
.
show
=
false
;
})
})
;
}
}
},
},
async
longpress
(
event
,
item
)
{
async
longpress
(
event
,
item
)
{
...
@@ -212,6 +215,7 @@ export default {
...
@@ -212,6 +215,7 @@ export default {
.
select
(
className
);
.
select
(
className
);
info
.
boundingClientRect
(
data
=>
{
info
.
boundingClientRect
(
data
=>
{
//data - 各种参数
//data - 各种参数
console
.
log
(
'boundingClientRect'
,
data
);
this
.
top
=
data
.
top
;
this
.
top
=
data
.
top
;
this
.
dragStart
(
event
,
item
);
this
.
dragStart
(
event
,
item
);
}).
exec
();
}).
exec
();
...
@@ -221,6 +225,8 @@ export default {
...
@@ -221,6 +225,8 @@ export default {
console
.
log
(
'dragStart'
);
console
.
log
(
'dragStart'
);
// 开始本次拖拽
// 开始本次拖拽
this
.
pageInfo
.
beginMove
=
true
;
this
.
pageInfo
.
beginMove
=
true
;
console
.
log
(
'beginMove'
,
this
.
beginMove
);
// this.$set(this.pageInfo,'beginMove',true)
// 本次移动的view真实下标
// 本次移动的view真实下标
var
currentMoveIndex
=
(
this
.
optionLists
||
[]).
findIndex
(
x
=>
x
.
guid
===
item
.
guid
);
var
currentMoveIndex
=
(
this
.
optionLists
||
[]).
findIndex
(
x
=>
x
.
guid
===
item
.
guid
);
console
.
log
(
'currentMoveIndex'
,
currentMoveIndex
);
console
.
log
(
'currentMoveIndex'
,
currentMoveIndex
);
...
@@ -243,7 +249,10 @@ export default {
...
@@ -243,7 +249,10 @@ export default {
movableViewInfo
.
data
=
this
.
optionLists
[
startIndex
];
movableViewInfo
.
data
=
this
.
optionLists
[
startIndex
];
movableViewInfo
.
showClass
=
'inline'
;
movableViewInfo
.
showClass
=
'inline'
;
(
this
.
movableViewInfo
=
movableViewInfo
),
(
this
.
pageInfo
=
pageInfo
);
this
.
movableViewInfo
=
movableViewInfo
;
this
.
pageInfo
=
pageInfo
;
console
.
log
(
'movableViewInfo'
,
this
.
movableViewInfo
);
console
.
log
(
'pageInfo'
,
this
.
pageInfo
.
beginMove
);
},
},
// 拖拽移动(按住不松)
// 拖拽移动(按住不松)
dragMove
(
event
)
{
dragMove
(
event
)
{
...
@@ -284,7 +293,7 @@ export default {
...
@@ -284,7 +293,7 @@ export default {
}
}
},
},
// 拖拽结束(松手)
// 拖拽结束(松手)
dragEnd
(
event
,
item
)
{
dragEnd
(
event
,
item
)
{
// 禁止无效的move
// 禁止无效的move
if
(
this
.
pageInfo
.
beginMove
)
{
if
(
this
.
pageInfo
.
beginMove
)
{
console
.
log
(
'dragEnd'
);
console
.
log
(
'dragEnd'
);
...
@@ -350,6 +359,7 @@ export default {
...
@@ -350,6 +359,7 @@ export default {
}
}
.zhuti
{
.zhuti
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
bottom
:
0
;
bottom
:
0
;
...
@@ -381,18 +391,20 @@ export default {
...
@@ -381,18 +391,20 @@ export default {
left
:
0
;
left
:
0
;
z-index
:
10
;
z-index
:
10
;
width
:
100%
;
width
:
100%
;
// background-color: yellow;
visibility
:
hidden
;
height
:
100%
;
}
.movable-area-active
{
visibility
:
unset
;
display
:
inline-block
;
// display: block;
}
}
.movable-row
{
.movable-row
{
box-shadow
:
#d9d9d9
0
0
20px
;
box-shadow
:
#d9d9d9
0
0
20px
;
.item-view
{
}
}
}
.col1
{
width
:
90%
;
}
.col3
{
width
:
6%
;
color
:
#3c63eb
;
}
.ready-place
{
.ready-place
{
background
:
rgba
(
238
,
240
,
254
,
0
.6
);
background
:
rgba
(
238
,
240
,
254
,
0
.6
);
}
}
...
...
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