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
5d2d5ef3
Commit
5d2d5ef3
authored
Aug 02, 2022
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
距离上一次登录时间大于7天重新登录
parent
6b03bbe2
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
116 additions
and
25 deletions
+116
-25
App.vue
App.vue
+12
-0
common.js
common/common.js
+9
-0
pages.json
pages.json
+9
-0
combiChoose.vue
pages/combination/combiChoose/combiChoose.vue
+11
-11
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+12
-12
login.vue
pages/login/login.vue
+4
-1
orderPayment.vue
pages/payment/orderPayment/orderPayment.vue
+1
-1
scenicProduct.vue
pages/scenic/scenicProduct/scenicProduct.vue
+58
-0
12345.png
static/img/12345.png
+0
-0
No files found.
App.vue
View file @
5d2d5ef3
...
...
@@ -6,6 +6,18 @@
//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
){
uni
.
clearStorageSync
()
}
}
else
{
//用于处理这个功能之前登录过的用户,未保存登录时间
uni
.
clearStorageSync
()
}
let
path
=
options
.
path
uni
.
setStorageSync
(
'enterOptions'
,
options
)
let
token
=
uni
.
getStorageSync
(
'token'
)
...
...
common/common.js
View file @
5d2d5ef3
...
...
@@ -26,6 +26,15 @@ export default{
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
}
}
//调用方法时--this.$commonjs.today()
\ No newline at end of file
pages.json
View file @
5d2d5ef3
...
...
@@ -275,6 +275,15 @@
}
}
,{
"path"
:
"pages/scenic/scenicProduct/scenicProduct"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"white"
,
...
...
pages/combination/combiChoose/combiChoose.vue
View file @
5d2d5ef3
...
...
@@ -42,17 +42,17 @@
})
}
}
else
{
//小程序页面跳转进入
let
channelId
=
option
.
channelId
let
companyId
=
option
.
companyId
let
merchantId
=
option
.
merchantId
let
groupId
=
option
.
groupId
let
groupChannelId
=
option
.
groupChannelId
let
thirdOpenid
=
option
.
thirdOpenid
//第三方openid
let
touristType
=
option
.
touristType
//游客类型
let
pdOpenid
=
uni
.
getStorageSync
(
"openid"
)
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
"token"
)
let
pdCreateUserId
=
uni
.
getStorageSync
(
"createUserId"
)
let
pdUserId
=
uni
.
getStorageSync
(
"userId"
)
let
channelId
=
option
.
channelId
||
''
let
companyId
=
option
.
companyId
||
''
let
merchantId
=
option
.
merchantId
||
''
let
groupId
=
option
.
groupId
||
''
let
groupChannelId
=
option
.
groupChannelId
||
''
let
thirdOpenid
=
option
.
thirdOpenid
||
''
//第三方openid
let
touristType
=
option
.
touristType
||
''
//游客类型
let
pdOpenid
=
uni
.
getStorageSync
(
"openid"
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
"token"
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
"createUserId"
)
||
''
let
pdUserId
=
uni
.
getStorageSync
(
"userId"
)
||
''
let
baseUrl
=
"https://wx.pangdly.com/#/combiChoose?thirdOpenid="
+
thirdOpenid
+
"&touristType="
+
touristType
this
.
outUrl
=
baseUrl
+
"&channelId="
+
channelId
+
"&merchantId="
+
merchantId
+
"&groupId="
+
groupId
+
"&groupChannelId="
+
groupChannelId
+
"&companyId="
+
companyId
+
"&pdOpenid="
+
pdOpenid
+
"&pdToken="
+
pdToken
+
"&pdCreateUserId="
+
pdCreateUserId
+
"&pdUserId="
+
pdUserId
...
...
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
5d2d5ef3
...
...
@@ -42,18 +42,18 @@
}
}
else
{
//小程序页面跳转进入
let
channelId
=
option
.
channelId
let
companyId
=
option
.
companyId
let
merchantId
=
option
.
merchantId
let
groupId
=
option
.
groupId
let
groupChannelId
=
option
.
groupChannelId
let
thirdOpenid
=
option
.
thirdOpenid
//第三方openid
let
touristType
=
option
.
touristType
//游客类型
let
pageCode
=
option
.
pageCode
//赠送优惠券接口参数
let
pdOpenid
=
uni
.
getStorageSync
(
"openid"
)
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
"token"
)
let
pdCreateUserId
=
uni
.
getStorageSync
(
"createUserId"
)
let
pdUserId
=
uni
.
getStorageSync
(
"userId"
)
let
channelId
=
option
.
channelId
||
''
let
companyId
=
option
.
companyId
||
''
let
merchantId
=
option
.
merchantId
||
''
let
groupId
=
option
.
groupId
||
''
let
groupChannelId
=
option
.
groupChannelId
||
''
let
thirdOpenid
=
option
.
thirdOpenid
||
''
//第三方openid
let
touristType
=
option
.
touristType
||
''
//游客类型
let
pageCode
=
option
.
pageCode
||
''
//赠送优惠券接口参数
let
pdOpenid
=
uni
.
getStorageSync
(
"openid"
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
"token"
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
"createUserId"
)
||
''
let
pdUserId
=
uni
.
getStorageSync
(
"userId"
)
||
''
let
baseUrl
=
"https://wx.pangdly.com/#/distributionCombiChoose?thirdOpenid="
+
thirdOpenid
+
"&touristType="
+
touristType
this
.
outUrl
=
baseUrl
+
"&channelId="
+
channelId
+
"&merchantId="
+
merchantId
+
"&groupId="
+
groupId
+
"&groupChannelId="
+
groupChannelId
+
"&companyId="
+
companyId
+
"&pdOpenid="
+
pdOpenid
+
"&pdToken="
+
pdToken
+
"&pdCreateUserId="
+
pdCreateUserId
+
"&pdUserId="
+
pdUserId
+
"&pageCode"
+
pageCode
}
...
...
pages/login/login.vue
View file @
5d2d5ef3
...
...
@@ -56,6 +56,9 @@ export default {
uni
.
redirectTo
({
url
:
'/'
+
enterOptions
.
path
+
'?'
+
queryTotal
})
//保存当前日期
let
oldDate
=
_this
.
$commonjs
.
today
()
uni
.
setStorageSync
(
'oldDate'
,
oldDate
)
// uni.navigateBack({
// delta:1
// })
...
...
@@ -75,7 +78,7 @@ export default {
let
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
_
this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
clearTimeout
(
timer
)
})
})
...
...
pages/payment/orderPayment/orderPayment.vue
View file @
5d2d5ef3
...
...
@@ -163,7 +163,7 @@ export default {
let
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
_
this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
clearTimeout
(
timer
)
})
})
...
...
pages/scenic/scenicProduct/scenicProduct.vue
0 → 100644
View file @
5d2d5ef3
<
template
>
<view>
<web-view
:src=
"outUrl"
></web-view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
enterUrl
:
''
,
//进入页面路由
outUrl
:
''
,
//跳出页面路由
}
},
onLoad
(
option
)
{
//#ifdef MP-WEIXIN
this
.
enterUrl
=
option
.
q
//#endif
//#ifdef MP-ALIPAY
this
.
enterUrl
=
uni
.
getStorageSync
(
'alipayQrCode'
)
//#endif
if
(
this
.
enterUrl
){
//普通二维码扫码进入
let
merchantId
=
this
.
getUrlKey
(
'merchantId'
)
let
companyId
=
this
.
getUrlKey
(
'companyId'
)
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
let
pdUserId
=
uni
.
getStorageSync
(
'userId'
)
let
baseUrl
=
'https://wx.pangdly.com/#/scenicProduct?pdOpenid='
+
pdOpenid
+
'&pdToken='
+
pdToken
+
'&pdCreateUserId='
+
pdCreateUserId
+
'&pdUserId='
+
pdUserId
let
url
=
'&merchantId='
+
merchantId
+
'&companyId='
+
companyId
this
.
outUrl
=
baseUrl
+
url
}
else
{
//小程序页面跳转进入
let
merchantId
=
option
.
merchantId
||
''
let
companyId
=
option
.
companyId
||
''
let
ifyukuaiCode
=
option
.
ifyukuaiCode
||
''
//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
let
pdUserId
=
uni
.
getStorageSync
(
'userId'
)
let
baseUrl
=
'https://wx.pangdly.com/#/scenicProduct?pdOpenid='
+
pdOpenid
+
'&pdToken='
+
pdToken
+
'&pdCreateUserId='
+
pdCreateUserId
+
'&pdUserId='
+
pdUserId
let
url
=
'&merchantId='
+
merchantId
+
'&companyId='
+
companyId
+
'&ifyukuaiCode='
+
ifyukuaiCode
this
.
outUrl
=
baseUrl
+
url
}
},
methods
:
{
getUrlKey
(
name
){
//---------------------------------------------------------------获取url
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
''
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
''
},
}
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
static/img/12345.png
deleted
100644 → 0
View file @
6b03bbe2
37.3 KB
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