Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
11bf8463
Commit
11bf8463
authored
Jul 20, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品选择页面开发
parent
995c4ad1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
446 additions
and
124 deletions
+446
-124
common.js
common/common.js
+46
-35
buyKnow.vue
components/buyKnow.vue
+164
-0
customer.vue
components/customer.vue
+5
-23
merchantDetail.vue
components/merchantDetail.vue
+6
-25
main.js
main.js
+24
-1
scenicChooseProduct.vue
pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
+201
-40
No files found.
common/common.js
View file @
11bf8463
export
default
{
getCurrentPageUrl
(){
//---获取当前页面url
let
pages
=
getCurrentPages
()
//获取加载的页面
let
currentPage
=
pages
[
pages
.
length
-
1
]
//获取当前页面的对象
let
url
=
currentPage
.
route
//当前页面url
let
options
=
currentPage
.
options
//如果要获取url中所带的参数可
let
queryTotal
=
""
for
(
let
key
in
options
){
queryTotal
+=
"&"
+
key
+
"="
+
options
[
key
]
}
queryTotal
=
queryTotal
.
substr
(
1
)
let
pageUrl
=
url
+
"?"
+
queryTotal
//请求的全路径
return
pageUrl
},
today
:
function
(){
//默认当天
var
now
=
new
Date
();
var
day
=
(
"0"
+
now
.
getDate
()).
slice
(
-
2
);
var
month
=
(
"0"
+
(
now
.
getMonth
()
+
1
)).
slice
(
-
2
);
var
today
=
now
.
getFullYear
()
+
"-"
+
(
month
)
+
"-"
+
(
day
)
;
return
today
},
todayTime
:
function
(){
var
now
=
new
Date
();
var
hour
=
now
.
getHours
()
<
10
?
'0'
+
now
.
getHours
():
now
.
getHours
()
var
minutes
=
now
.
getMinutes
()
<
10
?
'0'
+
now
.
getMinutes
():
now
.
getMinutes
()
var
seconds
=
now
.
getSeconds
()
<
10
?
'0'
+
now
.
getSeconds
():
now
.
getSeconds
()
var
time
=
hour
+
":"
+
minutes
+
":"
+
seconds
return
time
},
dateDifference
:
function
(
start
,
end
){
//结束日期与开始日期相差几天
var
strSeparator
=
"-"
;
var
oDate1
=
start
.
split
(
strSeparator
)
;
var
oDate2
=
end
.
split
(
strSeparator
)
;
var
strDateS
=
new
Date
(
oDate1
[
0
],
oDate1
[
1
]
-
1
,
oDate1
[
2
])
;
var
strDateE
=
new
Date
(
oDate2
[
0
],
oDate2
[
1
]
-
1
,
oDate2
[
2
])
;
getCurrentPageUrl
(){
//---获取当前页面url
let
pages
=
getCurrentPages
()
//获取加载的页面
let
currentPage
=
pages
[
pages
.
length
-
1
]
//获取当前页面的对象
let
url
=
currentPage
.
route
//当前页面url
let
options
=
currentPage
.
options
//如果要获取url中所带的参数可
let
queryTotal
=
''
for
(
let
key
in
options
){
queryTotal
+=
'&'
+
key
+
'='
+
options
[
key
]
}
queryTotal
=
queryTotal
.
substr
(
1
)
let
pageUrl
=
url
+
'?'
+
queryTotal
//请求的全路径
return
pageUrl
},
today
:
function
(){
//默认当天
var
now
=
new
Date
()
var
day
=
(
'0'
+
now
.
getDate
()).
slice
(
-
2
)
var
month
=
(
'0'
+
(
now
.
getMonth
()
+
1
)).
slice
(
-
2
)
var
today
=
now
.
getFullYear
()
+
'-'
+
(
month
)
+
'-'
+
(
day
)
return
today
},
todayTime
:
function
(){
var
now
=
new
Date
()
var
hour
=
now
.
getHours
()
<
10
?
'0'
+
now
.
getHours
():
now
.
getHours
()
var
minutes
=
now
.
getMinutes
()
<
10
?
'0'
+
now
.
getMinutes
():
now
.
getMinutes
()
var
seconds
=
now
.
getSeconds
()
<
10
?
'0'
+
now
.
getSeconds
():
now
.
getSeconds
()
var
time
=
hour
+
':'
+
minutes
+
':'
+
seconds
return
time
},
dateDifference
:
function
(
start
,
end
){
//结束日期与开始日期相差几天
var
strSeparator
=
'-'
var
oDate1
=
start
.
split
(
strSeparator
)
var
oDate2
=
end
.
split
(
strSeparator
)
var
strDateS
=
new
Date
(
oDate1
[
0
],
oDate1
[
1
]
-
1
,
oDate1
[
2
])
var
strDateE
=
new
Date
(
oDate2
[
0
],
oDate2
[
1
]
-
1
,
oDate2
[
2
])
var
iDays
=
parseInt
((
strDateE
-
strDateS
)
/
1000
/
60
/
60
/
24
)
return
iDays
}
},
changeTime
:
function
(
option
)
{
//把时间格式转化成数字
// currentTime当前时间,假设是 2019-7-2 19:03
var
currentTime
=
option
var
reg
=
new
RegExp
(
'-'
,
'g'
)
//去掉时间里面的-
var
a
=
currentTime
.
replace
(
reg
,
''
)
var
regs
=
new
RegExp
(
' '
,
'g'
)
//去掉时间里面的空格
var
b
=
a
.
replace
(
regs
,
''
)
var
regss
=
new
RegExp
(
':'
,
'g'
)
//去掉时间里面的:冒号
var
c
=
b
.
replace
(
regss
,
''
)
return
c
}
}
//调用方法时--this.$commonjs.today()
\ No newline at end of file
components/buyKnow.vue
0 → 100644
View file @
11bf8463
<
template
>
<u-popup
v-model=
"showPop"
mode=
"bottom"
border-radius=
"14"
closeable
height=
"85%"
>
<view
class=
"son-wrap"
>
<view
class=
"head"
>
<view
class=
"head1"
>
购买须知
</view>
<view
class=
"head2"
>
{{
buyKnowData
.
name
}}
</view>
<view
class=
"head3"
>
挂牌价:¥
{{
buyKnowData
.
originalPrice
}}
</view>
</view>
<view
class=
"middle"
>
<view
class=
"middle-list"
v-for=
"(item,a) of buyKnowData.productTitleResVos"
:key=
"a"
>
<view
class=
"middle-title"
>
{{
item
.
title
}}
</view>
<view
class=
"middle-content"
v-for=
"(items,b) of item.productChildTitleData"
:key=
"b"
>
<text>
{{
items
.
title
}}
</text>
<view>
<!--
<text>
随买随用
</text>
-->
<text
v-for=
"(itemss,c) of items.contentList"
:key=
"c"
class=
"content-child"
>
{{
itemss
.
content
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"bottom"
>
<text
class=
"bottom-left"
>
¥
<text>
{{
buyKnowData
.
sellingPrice
}}
</text>
</text>
<view
class=
"bottom-right"
>
<text
class=
"btn"
@
click=
"showPop=false"
>
去预订
</text>
</view>
</view>
</view>
</u-popup>
</
template
>
<
script
>
export
default
{
props
:
[
'buyKnowData'
],
data
()
{
return
{
showPop
:
false
,
//控制弹窗显示隐藏
}
},
methods
:
{
}
}
</
script
>
<
style
scoped=
"scoped"
>
.son-wrap
{
font-size
:
24
rpx
;
position
:
relative
;
}
.head
{
padding
:
100
rpx
24
rpx
0
24
rpx
;
}
.head1
{
text-align
:
center
;
font-size
:
32
rpx
;
font-weight
:
bold
;
text-align
:
center
;
padding
:
30
rpx
0
;
position
:
fixed
;
top
:
0
;
width
:
100%
;
background
:
#fff
;
z-index
:
1
;
}
.head2
{
font-weight
:
bolder
;
font-size
:
32
rpx
;
line-height
:
40
rpx
;
}
.head3
{
font-size
:
28
rpx
;
margin-top
:
20
rpx
;
color
:
#666666
;
border-bottom
:
1px
solid
#e6e6e6
;
padding-bottom
:
30
rpx
;
}
.middle
{
padding-bottom
:
100
rpx
;
font-size
:
28
rpx
;
}
.middle-list
{
margin
:
30
rpx
24
rpx
;
padding-bottom
:
24
rpx
;
border-bottom
:
1px
solid
#E6E6E6
;
}
.middle-title
{
font-size
:
32
rpx
;
font-weight
:
bold
;
}
.middle-content
{
display
:
flex
;
margin-top
:
30
rpx
;
position
:
relative
;
}
.middle-content
>
text
{
color
:
#666666
;
margin-right
:
30
rpx
;
width
:
120
rpx
;
display
:
inline-block
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
flex-shrink
:
0
;
font-size
:
26
rpx
;
position
:
relative
;
}
.middle-content
view
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
.bottom
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
0
24
rpx
;
height
:
100
rpx
;
align-items
:
center
;
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
z-index
:
9
;
background
:
#FFFFFF
;
box-sizing
:
border-box
;
}
.bottom-left
{
color
:
#f9690e
;
}
.bottom-left
text
{
font-size
:
36
rpx
;
font-weight
:
bolder
;
}
.bottom
view
{
display
:
flex
;
align-items
:
center
;
}
.btn
{
padding
:
16
rpx
48
rpx
;
border-radius
:
20
rpx
;
font-size
:
32
rpx
;
}
</
style
>
components/customer.vue
View file @
11bf8463
<
template
>
<!-- 客服 -->
<u-popup
v-model=
"showPop"
mode=
"bottom"
border-radius=
"14"
closeable
>
<view
class=
"wrap"
>
<u-popup
v-model=
"showPop"
mode=
"bottom"
border-radius=
"14"
closeable
height=
"85%"
>
<view
class=
"
son-
wrap"
>
<view
class=
"title"
>
客服电话
</view>
...
...
@@ -40,6 +40,9 @@ export default{
</
script
>
<
style
scoped
lang=
"scss"
>
.son-wrap
{
position
:
relative
;
}
.title
{
text-align
:
center
;
font-size
:
32rpx
;
...
...
@@ -62,26 +65,5 @@ export default{
align-items
:
center
;
justify-content
:
space-between
;
}
.wrap
{
overflow-y
:
auto
;
position
:
relative
;
}
@media
only
screen
and
(
max-height
:
900px
)
{
.wrap
{
max-height
:
750px
;
}
}
@media
only
screen
and
(
max-height
:
750px
)
{
.wrap
{
max-height
:
600px
;
}
}
@media
only
screen
and
(
max-height
:
600px
)
{
.wrap
{
max-height
:
500px
;
}
}
</
style
>
\ No newline at end of file
components/merchantDetail.vue
View file @
11bf8463
<
template
>
<!-- 商家详情弹窗 -->
<u-popup
v-model=
"showPop"
mode=
"bottom"
border-radius=
"14"
closeable
>
<view
class=
"
buy
-wrap"
>
<u-popup
v-model=
"showPop"
mode=
"bottom"
border-radius=
"14"
closeable
height=
"85%"
>
<view
class=
"
son
-wrap"
>
<view
class=
"head"
>
{{
detailData
.
name
}}
</view>
...
...
@@ -155,7 +155,10 @@ export default {
}
</
script
>
<
style
scoped=
"scoped"
>
<
style
scoped=
"scoped"
lang=
"scss"
>
.son-wrap
{
position
:
relative
;
}
.head
{
text-align
:
center
;
font-size
:
32rpx
;
...
...
@@ -228,26 +231,4 @@ export default {
white-space
:
nowrap
;
margin-right
:
10rpx
;
}
.buy-wrap
{
overflow-y
:
auto
;
position
:
relative
;
}
@media
only
screen
and
(
max-height
:
900px
)
{
.buy-wrap
{
max-height
:
750px
;
}
}
@media
only
screen
and
(
max-height
:
750px
)
{
.buy-wrap
{
max-height
:
600px
;
}
}
@media
only
screen
and
(
max-height
:
600px
)
{
.buy-wrap
{
max-height
:
500px
;
}
}
</
style
>
\ No newline at end of file
main.js
View file @
11bf8463
...
...
@@ -41,4 +41,27 @@ Number.prototype.toFixed=function (d) {
return
(
pm
+
s
).
replace
(
/
\.
$/
,
''
)
}
return
this
+
''
}
// 时间格式化
Date
.
prototype
.
Format
=
function
(
fmt
)
{
var
o
=
{
'M+'
:
this
.
getMonth
()
+
1
,
// 月份
'd+'
:
this
.
getDate
(),
// 日
'h+'
:
this
.
getHours
(),
// 小时
'm+'
:
this
.
getMinutes
(),
// 分
's+'
:
this
.
getSeconds
(),
// 秒
'q+'
:
Math
.
floor
((
this
.
getMonth
()
+
3
)
/
3
),
// 季度
S
:
this
.
getMilliseconds
()
// 毫秒
}
if
(
/
(
y+
)
/
.
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
this
.
getFullYear
()
+
''
).
substr
(
4
-
RegExp
.
$1
.
length
)
)
for
(
var
k
in
o
)
if
(
new
RegExp
(
'('
+
k
+
')'
).
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
1
?
o
[
k
]
:
(
'00'
+
o
[
k
]).
substr
((
''
+
o
[
k
]).
length
)
)
return
fmt
}
//调用new Date().Format("yyyy-MM-dd hh:mm");
pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
View file @
11bf8463
This diff is collapsed.
Click to expand it.
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