Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_wechat
Overview
Overview
Details
Activity
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
pseer
gxpt_wechat
Commits
7fe0bfe8
Commit
7fe0bfe8
authored
Apr 15, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能完善
parent
9a599823
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
471 additions
and
165 deletions
+471
-165
cleanRoom.js
api/cleanRoom.js
+6
-0
store.js
api/store.js
+6
-0
public.css
common/public.css
+6
-0
cleanManage.vue
pages/cleanManage/cleanManage.vue
+42
-4
cleanOrderInfo.vue
pages/cleanOrderInfo/cleanOrderInfo.vue
+128
-96
index.vue
pages/couponList/index.vue
+257
-58
order.vue
pages/order/order.vue
+6
-2
index.vue
pages/useCoupon/index.vue
+20
-5
No files found.
api/cleanRoom.js
View file @
7fe0bfe8
...
...
@@ -36,3 +36,9 @@ export const cleanList=(data)=>{
let
url
=
`/cleanRecords/myCleanList`
return
http
.
get
(
url
,
data
)
}
//领取全部的待保洁的任务
export
const
getAllByStoreId
=
(
data
)
=>
{
let
url
=
`/cleanRecords/startCleanByStore`
return
http
.
get
(
url
,
data
)
}
api/store.js
View file @
7fe0bfe8
...
...
@@ -36,3 +36,8 @@ export const deviceCtrlAuth=()=>{
let
url
=
`/store/storeListByConsumer`
return
http
.
get
(
url
)
}
export
const
getListByIds
=
(
data
)
=>
{
let
url
=
`/store/queryByStoreIds`
return
http
.
post
(
url
,
data
)
}
\ No newline at end of file
common/public.css
View file @
7fe0bfe8
...
...
@@ -24,3 +24,8 @@
width
:
100%
;
height
:
100%
;
}
.flex-row-center
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
\ No newline at end of file
pages/cleanManage/cleanManage.vue
View file @
7fe0bfe8
...
...
@@ -28,7 +28,7 @@
</view>
</view>
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"card-box"
>
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"card-box
card-box-item
"
>
<view
class=
"store-info"
>
...
...
@@ -38,9 +38,13 @@
</view>
<view
class=
"flex-col part-right"
>
<view
class=
"flex-between"
>
<text
class=
"text-black text-bold text-xl"
>
{{
item
.
name
}}
</text>
<text
class=
"text-black text-bold text-lg"
>
{{
item
.
name
}}
</text>
<view
class=
"flex-row-center"
>
<button
v-if=
"item.cleanOrderNum"
class=
"cu-btn bg-pink sm margin-right-sm"
@
tap=
"onGetAllByStoreId(item)"
>
一键领取
</button>
<image
:src=
"assetsPath+'/map_icon.png'"
mode=
"widthFix"
@
tap=
"onNavLocation(item)"
></image>
</view>
</view>
<view
class=
"flex-row"
>
<image
:src=
"assetsPath+'/location_icon.png'"
mode=
"widthFix"
></image>
<view
class=
""
>
...
...
@@ -93,7 +97,7 @@
</
template
>
<
script
>
import
{
getListStore
,
getStarOrder
}
from
"@/api/cleanRoom.js"
;
import
{
getListStore
,
getStarOrder
,
getAllByStoreId
}
from
"@/api/cleanRoom.js"
;
import
config
from
"@/config/index.config"
import
{
getDictItem
...
...
@@ -189,8 +193,15 @@ import moment from "@/common/moment";
if
(
res
.
data
.
code
===
200
){
let
list
=
res
.
data
.
data
&&
res
.
data
.
data
.
length
?
res
.
data
.
data
:[];
this
.
list
=
list
.
map
(
item
=>
{
let
cleanOrderNum
=
0
item
.
roolList
.
forEach
(
room
=>
{
if
(
room
.
recordsStatus
===
0
){
cleanOrderNum
+=
1
}
})
return
{
...
item
,
cleanOrderNum
:
cleanOrderNum
,
roolList
:
item
.
roolList
&&
item
.
roolList
.
length
?
item
.
roolList
.
map
(
val
=>
{
return
{
...
val
,
...
...
@@ -247,11 +258,31 @@ import moment from "@/common/moment";
url
:
"/pages/cleanOrderInfo/cleanOrderInfo?id="
+
val
.
recordsId
})
}
},
onGetAllByStoreId
(
val
){
uni
.
showLoading
(
"领取中..."
)
getAllByStoreId
({
storeId
:
val
.
id
}).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"操作成功"
})
this
.
onLoading
();
}
console
.
log
(
res
,
9999
)
})
}
}
}
</
script
>
<
style
>
page
{
background
:
#f1f1f1
;
}
</
style
>
<
style
lang=
"scss"
>
.clean-manage
{
display
:
flex
;
...
...
@@ -265,6 +296,13 @@ import moment from "@/common/moment";
width
:
94%
;
margin-top
:
10
upx
;
}
.card-box-item
{
width
:
100%
;
background-color
:
#ffffff
;
padding
:
20
upx
3%
;
border-radius
:
4
upx
;
margin-top
:
24
upx
;
}
.title-box
{
display
:
flex
;
flex-direction
:
row
;
...
...
pages/cleanOrderInfo/cleanOrderInfo.vue
View file @
7fe0bfe8
...
...
@@ -15,7 +15,7 @@
<text
class=
"text-bold"
>
{{
orderInfo
.
roomName
}}
</text>
</view>
<!--
<view
class=
"cu-form-group"
>
<!--
<view
class=
"cu-form-group"
>
<view
class=
"title"
>
房间号
</view>
<text>
111
</text>
</view>
-->
...
...
@@ -33,15 +33,18 @@
{{
orderInfo
.
startImage
?
orderInfo
.
startImage
.
length
:
'0'
}}
/4
</view>
</view>
<view
v-if=
"orderInfo.startImage"
class=
"cu-form-group"
>
<view
class=
"cu-form-group"
>
<view
class=
"grid col-4 grid-square flex-sub"
>
<view
class=
"bg-img"
v-for=
"(item,index) in orderInfo.startImage"
:key=
"index"
@
tap=
"ViewImage('start',item)"
>
<view
class=
"bg-img"
v-for=
"(item,index) in orderInfo.startImage"
:key=
"index"
@
tap=
"ViewImage('start',item)"
>
<image
:src=
"item"
mode=
"aspectFill"
></image>
<view
v-if=
"orderInfo.status === 0 "
class=
"cu-tag bg-red"
@
tap
.
stop=
"DelImg('start',index)"
:data-index=
"index"
>
<view
v-if=
"orderInfo.status === 0 "
class=
"cu-tag bg-red"
@
tap
.
stop=
"DelImg('start',index)"
:data-index=
"index"
>
<text
class=
'cuIcon-close'
></text>
</view>
</view>
<view
v-if=
"orderInfo.status === 0 && imgList.length
<4
"
class=
"solids"
@
tap=
"onChooseImage"
>
<view
v-if=
"orderInfo.status
<
=
1
&&
orderInfo
.
startImage
.
length
<4
"
class=
"solids"
@
tap=
"onChooseImage('startImage')"
>
<text
class=
'cuIcon-cameraadd'
></text>
</view>
</view>
...
...
@@ -58,13 +61,16 @@
<view
v-if=
"orderInfo.status>=1"
class=
"cu-form-group"
>
<view
class=
"grid col-4 grid-square flex-sub"
>
<view
class=
"bg-img"
v-for=
"(item,index) in orderInfo.endImage"
:key=
"index"
@
tap=
"ViewImage('end',item)"
>
<view
class=
"bg-img"
v-for=
"(item,index) in orderInfo.endImage"
:key=
"index"
@
tap=
"ViewImage('end',item)"
>
<image
:src=
"item"
mode=
"aspectFill"
></image>
<view
v-if=
"orderInfo.status == 1"
class=
"cu-tag bg-red"
@
tap
.
stop=
"DelImg('end',index)"
:data-index=
"index"
>
<view
v-if=
"orderInfo.status == 1"
class=
"cu-tag bg-red"
@
tap
.
stop=
"DelImg('end',index)"
:data-index=
"index"
>
<text
class=
'cuIcon-close'
></text>
</view>
</view>
<view
v-if=
"orderInfo.status == 1 && imgList.length
<4
"
class=
"solids"
@
tap=
"onChooseImage"
>
<view
v-if=
"orderInfo.status == 1 && imgList.length
<4
"
class=
"solids"
@
tap=
"onChooseImage('endImage')"
>
<text
class=
'cuIcon-cameraadd'
></text>
</view>
</view>
...
...
@@ -72,7 +78,8 @@
<view
class=
"cu-form-group align-start"
>
<view
class=
"title"
>
备注描述
</view>
<textarea
maxlength=
"-1"
:disabled=
"modalName!=null"
@
input=
"textareaBInput"
v-model=
"remark"
placeholder=
"请输入描述"
></textarea>
<textarea
maxlength=
"-1"
:disabled=
"modalName!=null"
@
input=
"textareaBInput"
v-model=
"remark"
placeholder=
"请输入描述"
></textarea>
</view>
</form>
...
...
@@ -80,11 +87,13 @@
<view
v-if=
"orderInfo.status !='2' "
class=
"confirm-box"
>
<view
class=
"confirm-btn"
>
<button
class=
"cu-btn block bg-blue margin-tb-sm lg"
type=
""
@
tap=
"onOrderConfirm"
>
提交并
{{
orderInfo
.
status
==
1
?
'完成'
:
'开始'
}}
保洁
</button>
<button
class=
"cu-btn block bg-blue margin-tb-sm lg"
type=
""
@
tap=
"onOrderConfirm"
>
提交并
{{
orderInfo
.
status
==
1
?
'完成'
:
'开始'
}}
保洁
</button>
</view>
<view
class=
"open-door-btn"
>
<button
class=
"cu-btn block margin-tb-sm lg"
type=
""
:class=
"openDoorStatus?'bg-gray':'bg-pink'"
@
tap=
"onOpenDoorByCleaner"
>
开门
</button>
<button
class=
"cu-btn block margin-tb-sm lg"
type=
""
:class=
"openDoorStatus?'bg-gray':'bg-pink'"
@
tap=
"onOpenDoorByCleaner"
>
开门
</button>
</view>
</view>
...
...
@@ -93,26 +102,35 @@
</
template
>
<
script
>
import
{
getInfoById
,
openDoorByCleaner
,
startClean
,
endClean
}
from
"@/api/cleanRoom.js"
;
import
{
getDictItem
}
from
"@/utils/tools.js"
import
{
uploadFile
}
from
"@/api/index.js"
import
{
getInfoById
,
openDoorByCleaner
,
startClean
,
endClean
}
from
"@/api/cleanRoom.js"
;
import
{
getDictItem
}
from
"@/utils/tools.js"
import
{
uploadFile
}
from
"@/api/index.js"
export
default
{
data
()
{
return
{
imgList
:[],
orderInfo
:{},
cleanStatusEnum
:{},
orderId
:
''
,
openDoor
:
false
,
openDoorStatus
:
false
imgList
:
[],
orderInfo
:
{},
cleanStatusEnum
:
{},
orderId
:
''
,
openDoor
:
false
,
openDoorStatus
:
false
};
},
onLoad
(
option
)
{
this
.
orderId
=
option
.
id
;
this
.
onGetDicts
()
},
methods
:{
methods
:
{
onGetDicts
()
{
let
dicts
=
[]
if
(
uni
.
getStorageSync
(
'dicts'
))
{
...
...
@@ -124,62 +142,68 @@
dicts
=
res
.
data
.
data
;
uni
.
setStorageSync
(
'dicts'
,
JSON
.
stringify
(
res
.
data
.
data
))
this
.
cleanStatusEnum
=
getDictItem
(
dicts
,
"clean_records_status"
);
console
.
log
(
this
.
cleanStatusEnum
,
909090
)
console
.
log
(
this
.
cleanStatusEnum
,
909090
)
this
.
onLoading
()
})
}
},
onLoading
(){
onLoading
()
{
this
.
imgList
=
[]
getInfoById
(
this
.
orderId
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
)
{
getInfoById
(
this
.
orderId
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
orderInfo
=
{
...
res
.
data
.
data
,
startImage
:
res
.
data
.
data
.
startImage
?
res
.
data
.
data
.
startImage
.
split
(
','
):
[],
endImage
:
res
.
data
.
data
.
endImage
?
res
.
data
.
data
.
endImage
.
split
(
','
):
[],
startImage
:
res
.
data
.
data
.
startImage
?
res
.
data
.
data
.
startImage
.
split
(
','
)
:
[],
endImage
:
res
.
data
.
data
.
endImage
?
res
.
data
.
data
.
endImage
.
split
(
','
)
:
[],
}
}
})
},
onChooseImage
()
{
onChooseImage
(
imgStatus
)
{
uni
.
chooseImage
({
count
:
4
,
//默认9
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'camera'
],
//仅拍照
sourceType
:
[
'
album'
,
'
camera'
],
//仅拍照
success
:
(
res
)
=>
{
console
.
log
(
res
,
"文件"
)
console
.
log
(
res
,
"文件"
)
// if (this.imgList.length != 0) {
// this.imgList = this.imgList.concat(res.tempFilePaths)
// } else {
// this.imgList = res.tempFilePaths
// }
uni
.
showLoading
({
title
:
'加载中...'
title
:
'加载中...'
})
uploadFile
({
url
:
res
.
tempFilePaths
[
0
]
}).
then
(
result
=>
{
this
.
onUploadFile
(
res
.
tempFilePaths
,
0
,
imgStatus
)
}
});
},
onUploadFile
(
list
=
[],
index
=
0
,
imgStatus
)
{
if
(
index
>=
list
.
length
)
{
uni
.
hideLoading
()
if
(
result
.
data
){
let
data
=
JSON
.
parse
(
result
.
data
);
if
(
this
.
orderInfo
.
status
>=
1
){
this
.
orderInfo
.
endImage
.
push
(
data
.
url
)
}
else
{
this
.
orderInfo
.
startImage
.
push
(
data
.
url
)
return
;
}
uploadFile
({
url
:
list
[
index
]
}).
then
(
result
=>
{
if
(
result
.
data
)
{
let
data
=
JSON
.
parse
(
result
.
data
);
this
.
orderInfo
[
imgStatus
].
push
(
data
.
url
)
this
.
onUploadFile
(
list
,
index
+
1
,
imgStatus
)
}
})
}
});
},
ViewImage
(
val
,
url
)
{
ViewImage
(
val
,
url
)
{
uni
.
previewImage
({
urls
:
val
==
'start'
?
this
.
orderInfo
.
startImage
:
this
.
orderInfo
.
endImage
,
urls
:
val
==
'start'
?
this
.
orderInfo
.
startImage
:
this
.
orderInfo
.
endImage
,
current
:
url
});
},
DelImg
(
val
,
i
)
{
DelImg
(
val
,
i
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'确定要删除吗?'
,
...
...
@@ -187,9 +211,9 @@
confirmText
:
'确定'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
if
(
val
==
'start'
)
{
if
(
val
==
'start'
)
{
this
.
orderInfo
.
startImage
.
splice
(
i
,
1
)
}
else
{
}
else
{
this
.
orderInfo
.
endImage
.
splice
(
i
,
1
)
}
...
...
@@ -200,102 +224,104 @@
textareaBInput
(
e
)
{
this
.
textareaBValue
=
e
.
detail
.
value
},
onOpenDoorByCleaner
(){
onOpenDoorByCleaner
()
{
if
(
this
.
openDoorStatus
)
{
if
(
this
.
openDoorStatus
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"请勿频繁进行开门操作"
icon
:
"none"
,
title
:
"请勿频繁进行开门操作"
})
return
}
uni
.
showLoading
({
title
:
"开门中..."
title
:
"开门中..."
})
this
.
openDoorStatus
=
true
;
openDoorByCleaner
({
roomId
:
this
.
orderInfo
.
roomId
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
this
.
openDoor
=
true
;
uni
.
showToast
({
icon
:
'success'
,
title
:
'开门成功'
icon
:
'success'
,
title
:
'开门成功'
})
}
else
{
uni
.
showToast
({
icon
:
'success'
,
title
:
res
.
data
.
msg
icon
:
'success'
,
title
:
res
.
data
.
msg
})
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
openDoorStatus
=
false
;
},
5000
)
},
5000
)
})
},
onOrderConfirm
(){
onOrderConfirm
()
{
// if(this.orderInfo.status === 0 && !this.openDoor){
// uni.showToast({
// icon:'none',
// title:'提交前请先开门'
// })
// }
if
(
this
.
orderInfo
.
status
==
1
){
if
(
!
this
.
orderInfo
.
endImage
.
length
){
if
(
!
this
.
orderInfo
.
startImage
.
length
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'请上传至少一张
图片'
icon
:
'none'
,
title
:
'请上传至少一张开始保洁
图片'
})
return
}
}
else
{
if
(
!
this
.
orderInfo
.
startImage
.
length
)
{
if
(
this
.
orderInfo
.
status
==
1
)
{
if
(
!
this
.
orderInfo
.
endImage
.
length
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'请上传至少一张
图片'
icon
:
'none'
,
title
:
'请上传至少一张完成保洁
图片'
})
return
}
}
if
(
this
.
orderInfo
.
status
==
'1'
)
{
if
(
this
.
orderInfo
.
status
==
'1'
)
{
endClean
({
id
:
this
.
orderInfo
.
id
,
storeId
:
this
.
orderInfo
.
storeId
,
id
:
this
.
orderInfo
.
id
,
startImage
:
this
.
orderInfo
.
startImage
.
join
(),
endImage
:
this
.
orderInfo
.
endImage
.
join
(),
remark
:
this
.
remark
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
uni
.
showToast
({
icon
:
'success'
,
title
:
'提交成功'
icon
:
'success'
,
title
:
'提交成功'
})
this
.
onLoading
()
}
else
{
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
res
.
data
.
msg
icon
:
'none'
,
title
:
res
.
data
.
msg
})
}
})
}
else
{
}
else
{
startClean
({
id
:
this
.
orderInfo
.
id
,
storeId
:
this
.
orderInfo
.
storeId
,
id
:
this
.
orderInfo
.
id
,
startImage
:
this
.
orderInfo
.
startImage
.
join
(),
remark
:
this
.
remark
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
uni
.
showToast
({
icon
:
'success'
,
title
:
'提交成功'
icon
:
'success'
,
title
:
'提交成功'
})
uni
.
navigateBack
()
}
else
{
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
res
.
data
.
msg
icon
:
'none'
,
title
:
res
.
data
.
msg
})
}
})
...
...
@@ -306,19 +332,21 @@
</
script
>
<
style
lang=
"scss"
>
.clean-order-info
{
.clean-order-info
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
width
:
100%
;
.card-box{
.card-box
{
width
:
94%
;
border-radius
:
24
upx
;
overflow
:
hidden
;
padding-bottom
:
120
upx
;
}
}
.confirm-box
{
}
.confirm-box
{
position
:
fixed
;
left
:
0
;
bottom
:
0
;
...
...
@@ -328,16 +356,19 @@
flex-direction
:
row
;
background-color
:
#ffffff
;
z-index
:
999
;
.confirm-btn{
.confirm-btn
{
width
:
76%
;
padding
:
0
30
upx
;
}
.open-door-btn
{
.open-door-btn
{
width
:
24%
;
padding
:
0
30
upx
0
0
;
}
}
.cu-form-group
.title
{
}
.cu-form-group
.title
{
width
:
280
upx
;
}
}
</
style
>
\ No newline at end of file
pages/couponList/index.vue
View file @
7fe0bfe8
...
...
@@ -10,49 +10,73 @@
</scroll-view>
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"coupon-item"
>
<view
class=
"part-left"
>
<image
:src=
"item.useStatus==0? assetsPath+'/coupon_icon.png':assetsPath+'/coupon_icon_gray.png'"
mode=
"widthFix"
></image>
<view
class=
"flex-row part-top-content"
>
<view
class=
"flex-col part-left"
:class=
"item.useStatus ===0? 'pink':'gray'"
>
<image
:src=
"item.useStatus==0? assetsPath+'/coupon_icon.png':assetsPath+'/coupon_icon_gray.png'"
mode=
"widthFix"
></image>
<text
v-if=
"item.useStatus ===2"
>
{{
item
.
endDate
}}
过期
</text>
<text
v-else-if=
"item.useStatus ===0"
class=
"text-white"
>
{{
item
.
surplusDays
>=
0
?
item
.
surplusDays
+
'天后'
:
item
.
endDate
}}
过期
</text>
<text
v-else
class=
"text-white"
>
{{
statusEnum
[
item
.
useStatus
]
}}
</text>
</view>
<view
class=
"part-right"
>
<view
class=
"coupon-name"
>
<text
class=
"text-title text-lg text-bold"
style=
"width: 64%;"
>
{{
item
.
name
}}
</text>
<text
class=
"text-lg"
:class=
"item.useStatus==0?'text-pink':'text-gray'"
>
{{
item
.
useStatus
==
0
?
'待使用'
:
'已使用'
}}
</text>
<view
class=
"flex-1 coupon-name"
>
<text
class=
"text-title text-bold"
>
{{
item
.
name
}}
</text>
<text
class=
""
:class=
"item.useStatus==0?'text-pink':'text-gray'"
>
{{
statusEnum
[
item
.
useStatus
]
}}
</text>
</view>
<view
class=
"flex-row margin-top
"
>
<view
class=
"flex-1 flex-row text-gray
"
>
<text
class=
""
>
来源:
</text>
<text>
{{
couponSourceEnum
[
item
.
sourceType
]
}}
</text>
<text>
{{
couponSourceEnum
[
item
.
sourceType
]
}}
{{
item
.
platformType
!==
1
?
'('
+
platformEnum
[
item
.
platformType
]
+
')'
:
''
}}
</text>
</view>
<view
v-if=
"item.couponType == 4"
class=
"flex-row margin-top
"
>
<view
v-if=
"item.couponType == 4"
class=
"flex-1 flex-row text-gray
"
>
<text
class=
""
>
使用说明:
</text>
<text>
{{
item
.
remark
||
''
}}
</text>
</view>
<view
v-else
class=
"flex-row margin-top
"
>
<view
v-else
class=
"flex-1 flex-row text-gray
"
>
<text
class=
""
>
使用说明:
</text>
<text
class=
""
>
满
{{
item
.
minPrice
}}
元,优惠
{{
item
.
subPrice
}}
元
</text>
</view>
<view
v-if=
"item.couponTimeStart && item.couponTimeEnd"
class=
"des margin-top
"
>
<view
v-if=
"item.couponTimeStart && item.couponTimeEnd"
class=
"flex-1 des text-gray
"
>
<view
class=
"flex-row"
>
<text
class=
""
>
可用时段:
</text>
<text
class=
""
>
{{
item
.
couponTimeStart
}}
-
{{
item
.
couponTimeEnd
}}
</text>
</view>
<text>
{{
platformEnum
[
item
.
platformType
]
}}
</text
>
<!--
<text
class=
""
>
{{
platformEnum
[
item
.
platformType
]
}}
</text>
--
>
</view>
<view
v-else
class=
"des margin-top
"
>
<view
v-else
class=
"flex-1 des text-gray
"
>
<text
class=
""
>
全天通用
</text>
<text>
{{
platformEnum
[
item
.
platformType
]
}}
</text>
</view>
<view
class=
"coupon-name margin-top"
>
<text
class=
"text-gray"
>
有效期限:
</text>
<text
class=
"text-gray"
>
{{
item
.
startDate
}}
至
{{
item
.
endDate
}}
</text>
</view>
</view>
<view
v-if=
"item.useStatus===0 && item.platformType!==1"
class=
"flex-row-center part-bottom-store"
>
<view
class=
"flex-1"
>
<text>
适用门店:
{{
item
.
storeNameList
[
0
]
}}
等门店适用
</text>
</view>
<view
class=
""
>
<button
class=
"cu-btn bg-pink sm"
@
tap=
"onGetListByIds(item)"
>
查看
</button>
</view>
</view>
<view
v-else-if=
"item.useStatus===0 && !item.storeIds"
class=
"flex-between part-bottom-store"
>
<view
class=
""
>
<text>
适用门店:全门店通用
</text>
</view>
<view
class=
""
>
</view>
</view>
<view
v-else-if=
"item.useStatus===1&&item.storeName"
class=
"flex-between part-bottom-store"
>
<view
class=
""
>
<text>
使用门店:
{{
item
.
storeName
}}
</text>
</view>
<view
class=
""
>
</view>
</view>
</view>
<view
v-if=
"list.length == 0"
class=
"empty-box"
>
<!-- 列表数量为0时 -->
<u-empty
text=
"暂无数据"
textColor=
'#C1C1C1'
width=
"120"
:icon=
"listBlankImage"
>
<u-empty
text=
"暂无数据"
textColor=
'#C1C1C1'
width=
"120"
:icon=
"listBlankImage"
>
</u-empty>
</view>
<!-- 当数据没有更多时 -->
...
...
@@ -61,18 +85,51 @@
:loadmore-text=
"loadmoreText"
:nomore-text=
"nomoreText"
/>
</view>
<uni-popup
ref=
"popupStoreList"
type=
"center"
>
<view
class=
"flex-col pop-store-list"
>
<!--
<image
style=
"width: 699upx;"
:src=
"assetsPath +'/pop_bg.png'"
mode=
"widthFix"
></image>
-->
<view
class=
"flex-col absolute"
>
<view
class=
"content-box"
>
<view
class=
"flex-row title margin-left-lg"
>
<text
style=
"color: #512C19;"
class=
"text-xl text-bold"
>
适用门店:
</text>
</view>
<view
class=
"close-box text-xxl margin-right"
@
tap=
"onStoreClose()"
>
<text
class=
"cuIcon-roundclosefill"
style=
"color: #bf9e62;"
></text>
</view>
</view>
<!-- 展示所有房间列表 -->
<view
class=
"store-box"
>
<StoreList
style=
"width: 100%;"
v-model=
"popStoreList"
@
change=
"onStoreChage"
></StoreList>
</view>
</view>
</view>
</uni-popup>
</view>
</
template
>
<
script
>
import
{
dictList
}
from
"@/api/index.js"
;
import
{
getDictItem
}
from
"@/utils/tools.js"
import
moment
from
"@/common/moment.js"
import
{
dictList
}
from
"@/api/index.js"
;
import
{
getDictItem
}
from
"@/utils/tools.js"
import
indexConfig
from
"@/config/index.config"
;
import
FixedHeader
from
"@/components/fixedHeader/index"
;
import
{
getCouponList
}
from
"@/api/coupon"
import
{
getCouponList
}
from
"@/api/coupon"
import
{
getListByIds
}
from
"@/api/store.js"
import
StoreList
from
"@/components/storeList/popStoreList"
export
default
{
components
:
{
StoreList
},
data
()
{
return
{
status
:
'nomore '
,
...
...
@@ -92,15 +149,14 @@
pageNum
:
1
,
useStatus
:
'0'
,
},
eventChannel
:
null
,
tipText
:
""
,
show
:
false
,
listBlankImage
:
indexConfig
.
assetsPath
+
'/no_data_icon.png'
,
eventChannel
:
null
,
tipText
:
""
,
show
:
false
,
listBlankImage
:
indexConfig
.
assetsPath
+
'/no_data_icon.png'
,
statusIndex
:
0
,
platformEnum
:{},
couponSourceEnum
:{},
statusList
:
[
{
platformEnum
:
{},
couponSourceEnum
:
{},
statusList
:
[{
label
:
"待使用"
,
value
:
"0"
,
},
...
...
@@ -112,15 +168,21 @@
label
:
"已过期"
,
value
:
"2"
,
},
]
],
statusEnum
:
{
'0'
:
"待使用"
,
'1'
:
"已使用"
,
'2'
:
"已过期"
,
},
popStoreList
:[]
};
},
components
:
{
'fixed-header'
:
FixedHeader
},
onReachBottom
()
{
if
(
this
.
status
==
'loadmore'
)
{
this
.
queryParams
.
pageNum
+=
1
;
if
(
this
.
status
==
'loadmore'
)
{
this
.
queryParams
.
pageNum
+=
1
;
this
.
onLoading
();
}
...
...
@@ -148,15 +210,26 @@
this
.
$forceUpdate
()
})
},
onLoading
(){
getCouponList
(
this
.
queryParams
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
){
if
(
this
.
queryParams
.
pageNum
==
1
){
this
.
list
=
res
.
data
.
rows
}
else
{
this
.
list
=
[...
this
.
list
,...
res
.
data
.
rows
]
onLoading
()
{
getCouponList
(
this
.
queryParams
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
)
{
let
list
=
res
.
data
.
rows
.
map
(
item
=>
{
let
endTime
=
moment
(
item
.
endDate
).
valueOf
();
let
nowTime
=
moment
().
valueOf
();
let
surplusDays
=
parseInt
(
moment
.
duration
(
endTime
-
nowTime
).
asDays
())
return
{
...
item
,
storeIds
:
item
.
storeIds
?
item
.
storeIds
.
split
(
','
):
''
,
surplusDays
:
surplusDays
<=
30
?
surplusDays
:
-
10000
}
})
if
(
this
.
queryParams
.
pageNum
==
1
)
{
this
.
list
=
list
}
else
{
this
.
list
=
[...
list
,
...
res
.
data
.
rows
]
}
console
.
log
(
this
.
list
,
9999
)
this
.
total
=
res
.
data
.
total
if
(
this
.
list
.
length
<
this
.
total
)
{
this
.
status
=
'loadmore'
;
...
...
@@ -166,6 +239,37 @@
}
})
},
onStoreClose
()
{
this
.
$refs
.
popupStoreList
.
close
()
},
onGetListByIds
(
item
){
getListByIds
({
longitude
:
uni
.
getStorageSync
(
'longitude'
),
latitude
:
uni
.
getStorageSync
(
'latitude'
),
storeIds
:
item
.
storeIds
}).
then
(
res
=>
{
console
.
log
(
res
,
99999999999
)
if
(
res
.
data
.
code
==
200
){
this
.
popStoreList
=
res
.
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
});
this
.
$refs
.
popupStoreList
.
open
()
}
})
},
onStoreChage
(
val
){
console
.
log
(
val
,
9999
)
uni
.
setStorageSync
(
"storeId"
,
val
);
setTimeout
(()
=>
{
uni
.
switchTab
({
url
:
"/pages/index/index"
})
},
200
)
},
tabSelect
(
i
)
{
this
.
statusIndex
=
i
;
this
.
queryParams
.
pageNum
=
1
;
...
...
@@ -178,68 +282,162 @@
</
script
>
<
style
scoped
lang=
"scss"
>
.coupon-list-box
{
.coupon-list-box
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
width
:
100%
;
padding-top
:
100
upx
;
.nav{
.nav
{
position
:
fixed
;
top
:
0
;
left
:
0
;
height
:
90
upx
;
z-index
:
999
;
text
{
font-size
:
32
upx
;
}
.coupon-item
{
.text-orange
{
color
:
#f3447e
;
font-weight
:
600
;
}
}
.coupon-item
{
display
:
flex
;
flex-direction
:
row
;
flex-direction
:
column
;
width
:
94%
;
border-radius
:
24
upx
;
border-radius
:
10
upx
;
background-color
:
#ffffff
;
margin
:
12
upx
0
;
padding
:
30
upx
20
upx
;
box-shadow
:
0
0
12
upx
rgba
(
255
,
0
,
127
,
0.23
);
.part-left{
padding
:
20
upx
0
;
//
border-top
:
1px
solid
#CCD1DB
;
//
border-bottom
:
1px
solid
#CCD1DB
;
box-shadow
:
0
0
12
upx
rgba
(
0
,
0
,
0
,
0.23
);
.part-top-content{
padding
:
0
26
upx
20
upx
;
}
.part-bottom-store
{
display
:
flex
;
align-items
:
center
;
margin-top
:
16
upx
;
border-top
:
1px
dashed
#e5e5e5
;
padding
:
20
upx
26
upx
0
;
}
.part-left
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
160
upx
;
width
:
240
upx
;
height
:
180
upx
;
margin-right
:
20
upx
;
image{
//
background
:
linear-gradient
(
120deg
,
rgba
(
224
,
57
,
151
,
0.8
),
rgba
(
255
,
55
,
93
,
0.8
));
border-radius
:
8
rpx
;
image
{
display
:
block
;
width
:
100%
;
max-height
:
140
upx
;
width
:
86%
;
max-height
:
120
upx
;
margin
:
12
upx
0
;
}
.text-white
{
margin-bottom
:
12
upx
;
}
.part-right
{
}
.pink
{
box-shadow
:
0
0
6
upx
rgba
(
224
,
57
,
151
,
0.6
);
.text-white
{
color
:
#e03997
;
}
}
.gray
{
box-shadow
:
0
0
6
upx
rgba
(
0
,
0
,
0
,
0.23
);
.text-white{
color
:
#666666
;
}
}
.part-right
{
display
:
flex
;
flex
:
1
;
flex-direction
:
column
;
.coupon-name{
.text-gray
{
color
:
#8c8c8c
;
}
.coupon-name
{
display
:
flex
;
justify-content
:
space-between
;
.text-title{
font-size
:
28
upx
;
width
:
280
upx
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
}
.des
{
.des
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.flex-row{
.flex-row
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
}
.margin-top
{
margin-top
:
12
upx
;
.margin-top
{
margin-top
:
8
upx
;
}
}
}
}
.empty-box
{
.empty-box
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
min-height
:
400
upx
;
}
.pop-store-list
{
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
width
:
92vw
;
height
:
74vh
;
background-color
:
#ffffff
;
border-radius
:
20
upx
;
box-shadow
:
0
6
upx
16
upx
rgba
(
255
,
0
,
255
,
0.34
);
padding-bottom
:
20
upx
;
overflow
:
hidden
;
.content-box
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
9%
;
padding-top
:
1%
;
.close-box
{
}
}
.store-box
{
display
:
flex
;
flex
:
1
;
width
:
100%
;
overflow-y
:
auto
;
padding
:
0
2%
3%
;
}
}
</
style
>
\ No newline at end of file
pages/order/order.vue
View file @
7fe0bfe8
...
...
@@ -211,7 +211,7 @@
<view
class=
"flex-between price use-coupon-box"
>
<text
class=
"text-black text-left"
>
{{
useCouponList
[
selectCouponIndex
].
couponType
==
2
?
'团购券'
:
'优惠券'
}}
</text>
<view
class=
"flex-row"
@
tap=
"onNavToSelectCoupon"
>
<view
class=
"flex-
1 flex-
row"
@
tap=
"onNavToSelectCoupon"
>
<text
class=
""
:class=
"useCouponList.length?'text-pink':'text-gray'"
>
{{
useCouponList
.
length
&&
selectCouponIndex
>=
0
?
useCouponList
[
selectCouponIndex
].
name
:
couponList
.
length
?
'请选择'
:
'暂无可用'
}}
</text>
<text
class=
"cuIcon-right "
:class=
"useCouponList.length?'text-pink':'text-gray'"
></text>
...
...
@@ -2092,7 +2092,11 @@
.use-coupon-box
{
.flex-row
{
max-width
:
70%
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
//
max-width
:
70%
;
margin-left
:
12
upx
;
}
}
...
...
pages/useCoupon/index.vue
View file @
7fe0bfe8
...
...
@@ -34,7 +34,13 @@
</view>
<view
class=
"part-left"
>
<view
class=
"select-btn"
:class=
"
{active: selectId === item.id }">
<view
class=
"surplus-days"
>
<view
v-if=
"item.surplusDays>=0"
class=
"flex-row-center"
>
<text
class=
"cuIcon-countdown text-red"
></text>
<text
class=
"text-red"
>
{{
item
.
surplusDays
}}
天后过期
</text>
</view>
</view>
<view
class=
"select-btn margin-top-sm"
:class=
"
{active: selectId === item.id }">
<radio-group
v-if=
"item.isAvailable != 1"
class=
"radio-group"
>
<radio
class=
'brown'
:class=
"selectId === item.id?'checked':''"
:checked=
"selectId === item.id?true:false"
color=
"#AF7117"
></radio>
</radio-group>
...
...
@@ -62,6 +68,7 @@
</
template
>
<
script
>
import
moment
from
"@/common/moment.js"
import
{
dictList
}
from
"@/api/index.js"
;
import
{
getDictItem
}
from
"@/utils/tools.js"
import
config
from
"@/config/index.config"
...
...
@@ -131,9 +138,14 @@
if
(
res
.
statusCode
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
data
.
length
)
{
let
list
=
res
.
data
.
data
.
map
(
item
=>
{
let
endTime
=
moment
(
item
.
endDate
).
valueOf
();
let
nowTime
=
moment
().
valueOf
();
let
surplusDays
=
parseInt
(
moment
.
duration
(
endTime
-
nowTime
).
asDays
())
return
{
...
item
,
subPrice
:
item
.
subPrice
||
0
subPrice
:
item
.
subPrice
||
0
,
surplusDays
:
surplusDays
<=
30
?
surplusDays
:
-
10000
}
})
...
...
@@ -210,7 +222,10 @@
}
.part-left
{
display
:
flex
;
flex-direction
:
row
;
flex-direction
:
column
;
.surplus-days{
height
:
40
upx
;
}
.select-btn
{
display
:
flex
;
flex-direction
:
row
;
...
...
@@ -265,9 +280,9 @@
filter
:
grayscale
(
100%
);
.select-btn{
background
:
#ffffff
!important
;
height
:
32
px
!important
;
height
:
26
px
!important
;
border-radius
:
16px
!important
;
padding
:
12
upx
24
upx
!important
;
padding
:
0
12
upx
!important
;
text{
color
:
#929292
!important
;
}
...
...
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