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
6ef23112
Commit
6ef23112
authored
May 04, 2023
by
qipeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://git.tbd.yanzuoguang.com/panyongping/uni-pdtravel
into develop
parents
bc51fcdf
b26c4236
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
81 deletions
+189
-81
App.vue
App.vue
+95
-64
pages.json
pages.json
+7
-0
simpleProduct.vue
pages/common/simpleProduct/simpleProduct.vue
+75
-0
paySuccess.vue
pages/payment/paySuccess/paySuccess.vue
+12
-17
No files found.
App.vue
View file @
6ef23112
<
script
>
// 1、uni-app的页面生命周期仅在page页面有效,而单独封装的组件中【页面周期无效】,
//但是Vue的生命周期依然有效 【Vue的生命周期在任何地方都是有效的,即你仍然可以在uni-app项目中使用Vue生命周期,但是不建议这么做】
// 2、推荐使用uni-app里面的onLoad 代替 vue 里面的 created
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
export
default
{
onLaunch
:
function
(
options
)
{
//初始化完成时触发(全局只触发一次
let
today
=
this
.
$commonjs
.
today
()
let
oldDate
=
uni
.
getStorageSync
(
'oldDate'
)
// 1、uni-app的页面生命周期仅在page页面有效,而单独封装的组件中【页面周期无效】,
//但是Vue的生命周期依然有效 【Vue的生命周期在任何地方都是有效的,即你仍然可以在uni-app项目中使用Vue生命周期,但是不建议这么做】
// 2、推荐使用uni-app里面的onLoad 代替 vue 里面的 created
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
export
default
{
onLaunch
:
function
(
options
)
{
//初始化完成时触发(全局只触发一次
let
today
=
this
.
$commonjs
.
today
()
let
oldDate
=
uni
.
getStorageSync
(
'oldDate'
)
//大于7天重新登录
if
(
oldDate
)
{
let
number
=
this
.
$commonjs
.
dateDifference
(
today
,
oldDate
)
if
(
number
>
7
)
{
if
(
oldDate
)
{
let
number
=
this
.
$commonjs
.
dateDifference
(
today
,
oldDate
)
if
(
number
>
7
)
{
uni
.
clearStorageSync
()
}
}
else
{
}
else
{
//用于处理这个功能之前登录过的用户,未保存登录时间
uni
.
clearStorageSync
()
}
let
path
=
options
.
path
uni
.
setStorageSync
(
'enterOptions'
,
options
)
let
token
=
uni
.
getStorageSync
(
'token'
)
if
(
!
token
&&
path
.
indexOf
(
'pages/payment/ourPayment/ourPayment'
)
==-
1
){
//扫码支付页面不需要在此登录
setTimeout
(()
=>
{
//解决关联普通二维码扫码首次进入时一直显示登录中
let
path
=
options
.
path
uni
.
setStorageSync
(
'enterOptions'
,
options
)
let
token
=
uni
.
getStorageSync
(
'token'
)
if
(
!
token
&&
path
.
indexOf
(
'pages/payment/ourPayment/ourPayment'
)
==
-
1
)
{
//扫码支付页面不需要在此登录
setTimeout
(()
=>
{
//解决关联普通二维码扫码首次进入时一直显示登录中
uni
.
navigateTo
({
url
:
'/pages/login/login'
})
},
300
)
},
300
)
}
//#ifdef MP-WEIXIN
uni
.
setStorageSync
(
'appid'
,
'wxe678d5240e98a7b8'
)
uni
.
setStorageSync
(
'appid'
,
'wxe678d5240e98a7b8'
)
//#endif
//#ifdef MP-ALIPAY
if
(
options
.
query
&&
options
.
query
.
qrCode
)
{
uni
.
setStorageSync
(
'alipayQrCode'
,
options
.
query
.
qrCode
)
}
else
{
uni
.
setStorageSync
(
'alipayQrCode'
,
options
.
query
.
qrCode
)
}
else
{
uni
.
removeStorageSync
(
'alipayQrCode'
)
}
//#endif
...
...
@@ -46,12 +46,13 @@ export default {
onHide
:
function
()
{
}
}
}
</
script
>
<
style
lang=
"scss"
>
@import
"uview-ui/index.scss"
;
/*
@import
"uview-ui/index.scss"
;
/*
1.页面背景颜色#f7f7f7
2.分隔线颜色#DBDBDB
3.正常字体颜色#333333
...
...
@@ -61,21 +62,51 @@ export default {
8.页面最外层与里面的第一层为padding:0 12px;
9.css单位为rpx
*/
page
{
font-size
:
28rpx
;
color
:
#333333
;
background
:
#F7F7F7
;
height
:
100%
;}
view
,
text
,
image
,
video
,
button
,
checkbox
,
form
,
input
,
label
,
radio
,
switch
,
textarea
{
box-sizing
:border-box
;}
.btn
{
background
:linear-gradient
(
132deg
,
#ED400C
0
%
,
#FB862C
100
%
)
;
display
:
inline-block
;
color
:
#FFFFFF
;
font-size
:
28rpx
;
border-radius
:
8rpx
;
text-align
:
center
;}
/*单行溢出*/
.one-txt-cut
{
page
{
font-size
:
28rpx
;
color
:
#333333
;
background
:
#F7F7F7
;
height
:
100%
;
}
view
,
text
,
image
,
video
,
button
,
checkbox
,
form
,
input
,
label
,
radio
,
switch
,
textarea
{
box-sizing
:
border-box
;
}
.btn
{
background
:
linear-gradient
(
132deg
,
#ED400C
0%
,
#FB862C
100%
);
display
:
inline-block
;
color
:
#FFFFFF
;
font-size
:
28rpx
;
border-radius
:
8rpx
;
text-align
:
center
;
padding
:
10rpx
20rpx
;
}
/*单行溢出*/
.one-txt-cut
{
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
/*多行溢出 手机端使用*/
.txt-cut
{
overflow
:
hidden
;
}
/*多行溢出 手机端使用*/
.txt-cut
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-
webkit-box
;
/* -webkit-line-clamp: 2; */
-webkit-box-orient
:
vertical
;
}
}
</
style
>
pages.json
View file @
6ef23112
...
...
@@ -279,6 +279,13 @@
"navigationBarTitleText"
:
"兑换"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/common/simpleProduct/simpleProduct"
,
"style"
:
{
"navigationBarTitleText"
:
"产品选择"
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
...
...
pages/common/simpleProduct/simpleProduct.vue
0 → 100644
View file @
6ef23112
<
template
>
<view>
<view
v-for=
"(item,index) in productData"
:key=
"inde"
class=
"list"
>
<view
class=
"list-left"
>
<view>
{{
item
.
name
}}
</view>
<view
class=
"money"
>
<text
style=
"font-size: 28rpx;"
>
¥
</text>
{{
parseFloat
((
item
.
sellingPrice
).
toFixed
(
2
))
}}
</view>
</view>
<view
class=
"list-right"
>
<text
class=
"btn"
>
购买
</text>
</view>
</view>
<view
class=
"no-more"
>
没有更多了...
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
productData
:[],
//产品数据
merchantId
:
''
,
//商户Id
}
},
onLoad
(
option
)
{
this
.
merchantId
=
option
.
merchantId
||
''
this
.
initProduct
()
},
methods
:
{
//---产品加载
initProduct
(){
let
data
=
{
merchantId
:
this
.
merchantId
,
//商户id
type
:
1
,
//类型:1景区、2酒店、3餐饮
}
this
.
$request
(
'scenic/user/product/findProductList'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
"00"
){
this
.
productData
=
res
.
data
.
list
||
[]
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.list
{
display
:
flex
;
align-items
:
center
;
padding
:
30rpx
20rpx
;
border-bottom
:
1px
solid
#E6e6e6
;
}
.list-left
{
flex
:
1
;
margin-right
:
30rpx
;
}
.money
{
margin-top
:
10rpx
;
font-size
:
40rpx
;
color
:
#f9690e
;
font-weight
:
bolder
;
}
.no-more
{
text-align
:
center
;
margin
:
30rpx
0
;
}
</
style
>
pages/payment/paySuccess/paySuccess.vue
View file @
6ef23112
...
...
@@ -13,7 +13,7 @@
export
default
{
data
()
{
return
{
title
:
"正在出票中"
,
//标题
title
:
"正在出票中
...
"
,
//标题
orderId
:
""
,
//订单Id
status
:
""
,
//出票状态
timer
:
""
,
//计时器
...
...
@@ -26,32 +26,18 @@
this
.
orderId
=
option
.
orderId
||
''
this
.
afterBuyUrl
=
option
.
afterBuyUrl
||
''
this
.
ifyukuaiCode
=
option
.
ifyukuaiCode
||
''
let
sum
=
0
this
.
ticketStatus
()
let
intFun
=
()
=>
{
//页面初始化
this
.
timer
=
setTimeout
(()
=>
{
sum
+=
300
if
(
sum
>
300
)
{
sum
+=
700
}
if
(
this
.
status
==
"2"
||
this
.
status
==
"4"
||
this
.
status
==
"5"
)
{
uni
.
redirectTo
({
url
:
this
.
afterBuyUrl
+
'?orderId='
+
this
.
orderId
+
'&ifyukuaiCode='
+
this
.
ifyukuaiCode
})
return
}
if
(
this
.
status
==
"3"
)
{
this
.
title
=
"出票失败..."
this
.
loadImg
=
false
return
}
if
(
sum
>
10000
)
{
this
.
title
=
"出票失败..."
this
.
loadImg
=
false
return
}
this
.
ticketStatus
()
intFun
()
},
sum
)
},
1200
)
}
intFun
()
},
...
...
@@ -74,6 +60,15 @@
this
.
$request
(
"order/order/getStatusById"
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
"00"
)
{
this
.
status
=
res
.
data
if
(
this
.
status
==
"2"
||
this
.
status
==
"4"
||
this
.
status
==
"5"
)
{
uni
.
redirectTo
({
url
:
this
.
afterBuyUrl
+
'?orderId='
+
this
.
orderId
+
'&ifyukuaiCode='
+
this
.
ifyukuaiCode
})
}
if
(
this
.
status
==
"3"
)
{
this
.
title
=
"出票失败..."
this
.
loadImg
=
false
}
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
...
...
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