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
320b56c1
Commit
320b56c1
authored
Oct 20, 2023
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 我的订单
parent
d7d46b3a
Pipeline
#7079
canceled with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
333 additions
and
2 deletions
+333
-2
order.js
api/mine/order.js
+32
-0
manifest.json
manifest.json
+1
-1
pages.json
pages.json
+9
-1
order-item.vue
pages/mine/order/components/order-item.vue
+120
-0
order.vue
pages/mine/order/order.vue
+165
-0
index.js
utils/options/mine/index.js
+6
-0
No files found.
api/mine/order.js
0 → 100644
View file @
320b56c1
import
request
from
"@/utils/request.js"
export
async
function
getList
(
data
)
{
return
request
({
url
:
`/rest/order/list`
,
method
:
'GET'
,
data
})
}
export
async
function
getDetail
(
data
)
{
return
request
({
url
:
`/rest/order/detail`
,
method
:
'GET'
,
data
})
}
export
async
function
cancelOrder
(
data
)
{
return
request
({
url
:
`/rest/order/cancel`
,
method
:
'POST'
,
data
})
}
export
async
function
applyRefund
(
data
)
{
return
request
({
url
:
`/rest/order/refund/apply`
,
method
:
'POST'
,
data
})
}
manifest.json
View file @
320b56c1
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
"prompt"
:
"为获取当地天气信息,需要获取 位置信息 使用权限,请允许。"
"prompt"
:
"为获取当地天气信息,需要获取 位置信息 使用权限,请允许。"
},
},
"schemes"
:
"com.shenjiying.jizhang"
,
"schemes"
:
"com.shenjiying.jizhang"
,
"minSdkVersion"
:
30
,
"minSdkVersion"
:
""
,
"targetSdkVersion"
:
30
"targetSdkVersion"
:
30
},
},
/*
ios打包配置
*/
/*
ios打包配置
*/
...
...
pages.json
View file @
320b56c1
...
@@ -418,7 +418,15 @@
...
@@ -418,7 +418,15 @@
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
}
}
,{
"path"
:
"order/order"
,
"style"
:
{
"navigationBarTitleText"
:
"我的订单"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
]
]
},
},
{
{
...
...
pages/mine/order/components/order-item.vue
0 → 100644
View file @
320b56c1
<
template
>
<view
class=
"update-log-item"
>
<view
class=
"head"
>
<view
class=
"head-title"
>
<text>
订单编号
</text>
<text
class=
"order-number"
>
{{
detail
.
orderNumber
}}
</text>
</view>
<view
class=
"head-time"
:style=
"
{color:detail.orderStatus
&&
statusColor[detail.orderStatus.code]}">
{{
detail
.
orderStatus
&&
detail
.
orderStatus
.
desc
}}
</view>
</view>
<view
class=
"content"
>
<view
class=
"order-info"
>
<text
class=
"order-name"
>
{{
detail
.
businessName
}}
</text>
<text
class=
"order-price"
>
{{
detail
.
amount
}}
</text>
</view>
<view
class=
"order-date"
>
{{
detail
.
createTime
}}
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
detail
:
{
type
:
Object
,
default
:
()
=>
{}
},
},
data
()
{
return
{
parseTime
,
statusColor
:
{
WAIT
:
'#fc524d'
,
FINISH
:
'#333333'
,
CANCEL
:
'#8d8d8d'
,
CLOSE
:
'#8d8d8d'
,
REFUNDING
:
'#df7922'
,
REFUND
:
'#8d8d8d'
,
},
};
},
methods
:
{
checkStatus
(
status
)
{
return
this
.
detail
.
status
&&
status
.
indexOf
(
this
.
detail
.
status
.
code
)
!==
-
1
},
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.update-log-item
{
padding
:
24rpx
;
background-color
:
#ffffff
;
margin-bottom
:
24rpx
;
border-radius
:
16rpx
;
.head
{
padding
:
16rpx
0
32rpx
0
;
border-bottom
:
2px
solid
#f6f7fa
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.head-title
{
line-height
:
32rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
.order-number
{
margin-left
:
12rpx
;
color
:
#8d8d8d
;
line-height
:
28rpx
;
font-size
:
24rpx
;
}
}
.head-time
{
color
:
#8d8d8d
;
line-height
:
28rpx
;
font-size
:
28rpx
;
}
}
.content
{
padding
:
32rpx
0
;
line-height
:
40rpx
;
font-size
:
28rpx
;
.order-info
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-weight
:
bold
;
font-size
:
28rpx
;
.order-name
{}
.order-price
{}
}
.order-date
{
margin-top
:
12rpx
;
font-size
:
24rpx
;
color
:
#8d8d8d
;
text-align
:
right
;
}
}
}
</
style
>
\ No newline at end of file
pages/mine/order/order.vue
0 → 100644
View file @
320b56c1
<
template
>
<view
class=
"update-log"
>
<view
class=
"content-view"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
scroll-anchoring
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
refresher-background=
"#F6F7FA"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
enable-back-to-top
>
<view
class=
"scroll-view"
>
<NoData
v-if=
"noData"
:text=
"noDataText"
customStyle=
"margin-top: 0rpx;"
/>
<view
v-else
>
<view
class=
"bill-list"
><order-item
v-for=
"(item, index) in list"
:key=
"index"
:detail=
"item"
></order-item></view>
<view
class=
"load-more-view"
v-show=
"(current == 1 && loaded) || current > 1"
><u-loadmore
:status=
"loadStatus"
bgColor=
"#F6F7FA"
></u-loadmore></view>
</view>
<view
class=
"loading-view"
v-if=
"!loaded && !freshing"
><u-loading
mode=
"flower"
></u-loading></view>
</view>
</scroll-view>
</view>
<PopInput
title=
"提醒"
type=
"text"
sureText=
"确定"
:content=
"popContent"
:visible
.
sync=
"showPopup"
@
click=
"handleConfirm"
/>
</view>
</
template
>
<
script
>
import
NoData
from
'@/components/no-data'
;
import
PopInput
from
'@/components/pop-input-view'
;
import
OrderItem
from
'./components/order-item.vue'
;
import
{
getList
,
cancelOrder
}
from
"@/api/mine/order.js"
export
default
{
components
:
{
NoData
,
PopInput
,
OrderItem
},
data
()
{
return
{
list
:
[],
loaded
:
false
,
current
:
1
,
size
:
10
,
loadStatus
:
'loading'
,
triggered
:
true
,
freshing
:
false
,
noDataText
:
'当前暂无内容'
,
showPopup
:
false
,
popContent
:
"确定取消订单"
,
detail
:
null
,
notification
:
'order-list'
};
},
computed
:
{
noData
()
{
return
(
this
.
list
||
[]).
length
==
0
&&
this
.
loaded
;
}
},
onLoad
()
{
this
.
reloadList
();
this
.
freshing
=
false
;
uni
.
$on
(
this
.
notification
,()
=>
{
this
.
reloadList
();
})
},
onUnload
()
{
uni
.
$off
(
this
.
notification
);
},
methods
:
{
reloadList
()
{
this
.
current
=
1
;
this
.
loadStatus
=
'loading'
;
this
.
getList
();
},
async
getList
()
{
if
(
this
.
current
==
1
)
{
this
.
list
=
[];
this
.
loaded
=
false
;
}
try
{
let
params
=
{
current
:
this
.
current
,
size
:
this
.
size
,
};
let
res
=
await
getList
(
params
);
let
{
records
,
total
}
=
res
.
data
;
if
(
records
)
{
this
.
list
.
push
(...
records
);
// 更新底部加载状态
this
.
loadStatus
=
total
>
this
.
list
.
length
?
'loadmore'
:
'nomore'
;
}
setTimeout
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
this
.
freshing
)
{
this
.
triggered
=
false
;
this
.
freshing
=
false
;
}
});
},
500
)
}
catch
(
e
)
{
//TODO handle the exception
this
.
loadStatus
=
'loadmore'
console
.
log
(
'error'
,
e
);
this
.
$nextTick
(()
=>
{
if
(
this
.
freshing
)
{
this
.
triggered
=
false
;
this
.
freshing
=
false
;
}
});
}
this
.
loaded
=
true
;
},
onRefresh
()
{
if
(
this
.
freshing
)
return
;
this
.
freshing
=
true
;
this
.
reloadList
();
},
onRestore
()
{
this
.
triggered
=
'restore'
;
// 需要重置
},
// 滚动底部
reachBottom
(
e
)
{
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
this
.
current
+=
1
;
this
.
loadStatus
==
'loading'
;
this
.
getList
();
},
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.update-log
{
padding
:
32rpx
24rpx
;
background-color
:
#F6F7FA
;
width
:
100%
;
height
:
100vh
;
.content-view
{
width
:
100%
;
height
:
100%
;
overflow
:
auto
;
.scroll-view
{
width
:
100%
;
height
:
100%
;
}
.load-more-view
{
margin-top
:
24rpx
;
padding-bottom
:
44rpx
;
}
.loading-view
{
width
:
100%
;
background-color
:
transparent
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
top
:
50%
;
left
:
0
;
position
:
fixed
;
}
}
}
</
style
>
\ No newline at end of file
utils/options/mine/index.js
View file @
320b56c1
...
@@ -43,11 +43,17 @@ export const packageOptions = [
...
@@ -43,11 +43,17 @@ export const packageOptions = [
title
:
'我的奖金'
,
title
:
'我的奖金'
,
path
:
"/pages/bonus/index"
path
:
"/pages/bonus/index"
},
},
{
id
:
7
,
title
:
'我的订单'
,
path
:
"/pages/mine/order/order"
},
{
{
id
:
6
,
id
:
6
,
title
:
'使用帮助'
,
title
:
'使用帮助'
,
path
:
"/pages/mine/help/index"
path
:
"/pages/mine/help/index"
},
},
{
{
id
:
0
,
id
:
0
,
title
:
'数据导出/导入'
,
title
:
'数据导出/导入'
,
...
...
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