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
8693c8c2
Commit
8693c8c2
authored
Sep 02, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取公共方法处理
parent
01d56b68
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
50 additions
and
36 deletions
+50
-36
common.js
common/common.js
+24
-10
albumIndex.vue
pages/album/albumIndex.vue
+2
-2
myPhotoAlbum.vue
pages/album/myPhotoAlbum/myPhotoAlbum.vue
+1
-1
combiChoose.vue
pages/combination/combiChoose/combiChoose.vue
+1
-1
combiOrder.vue
pages/combination/combiOrder/combiOrder.vue
+1
-1
distributionCombiChoose-old.vue
...n/distributionCombiChoose/distributionCombiChoose-old.vue
+1
-1
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+1
-1
hotelIndex.vue
pages/hotel/hotelIndex/hotelIndex.vue
+1
-1
index.vue
pages/indexs/index/index.vue
+1
-1
merchantListIndex.vue
pages/indexs/merchantListIndex/merchantListIndex.vue
+1
-1
commonInfo.vue
pages/my/commonInfo/commonInfo.vue
+1
-1
myCouponList.vue
pages/my/couponCenter/myCouponList/myCouponList.vue
+1
-1
enterpriseWechat - 副本.vue
...ustomerService/enterpriseWechat/enterpriseWechat - 副本.vue
+1
-1
afterSaleList.vue
pages/my/order/afterSale/afterSaleList/afterSaleList.vue
+1
-1
codeResult.vue
pages/my/passCode/codeResult/codeResult.vue
+1
-1
shopCart.vue
pages/my/shopCart/shopCart.vue
+1
-1
travelList.vue
pages/my/travelList/travelList/travelList.vue
+1
-1
myTravelogue.vue
pages/my/travelNotes/myTravelogue/myTravelogue.vue
+1
-1
scenicCombiOrder.vue
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
+1
-1
scenicIndex.vue
pages/scenic/scenicIndex/scenicIndex.vue
+1
-1
scenicJointOrder.vue
pages/scenic/scenicJointOrder/scenicJointOrder.vue
+1
-1
scenicProduct.vue
pages/scenic/scenicProduct/scenicProduct.vue
+1
-1
scenicSingleOrder.vue
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
+4
-4
No files found.
common/common.js
View file @
8693c8c2
...
...
@@ -130,9 +130,21 @@ export default{
uni
.
setStorageSync
(
'companyId'
,
companyId
)
return
companyId
},
//获取
除companyId的其他
参数
//获取
页面
参数
getKey
:
function
(
option
,
query
){
let
key
=
''
if
(
query
==
'companyId'
){
// 优先取值小程序页面参数,其次取值普通二维码,再次取缓存里面的值
//#ifdef MP-WEIXIN
key
=
option
[
query
]
||
this
.
getUrlKey
(
`
${
query
}
`
,
option
.
q
)
||
uni
.
getStorageSync
(
query
)
||
''
//#endif
//#ifdef MP-ALIPAY
key
=
option
[
query
]
||
this
.
getUrlKey
(
`
${
query
}
`
,
uni
.
getStorageSync
(
'alipayQrCode'
))
||
uni
.
getStorageSync
(
query
)
||
''
//#endif
uni
.
setStorageSync
(
query
,
key
)
return
key
}
else
{
// 优先取值小程序页面参数,其次取值普通二维码
//#ifdef MP-WEIXIN
key
=
option
[
query
]
||
this
.
getUrlKey
(
`
${
query
}
`
,
option
.
q
)
||
''
...
...
@@ -143,5 +155,7 @@ export default{
//#endif
return
key
}
}
}
//调用方法时--this.$commonjs.today()
\ No newline at end of file
pages/album/albumIndex.vue
View file @
8693c8c2
...
...
@@ -353,7 +353,7 @@ export default {
}
},
onLoad
(
options
)
{
this
.
$commonjs
.
get
CompanyId
(
options
)
this
.
$commonjs
.
get
Key
(
options
,
'companyId'
)
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
this
.
userId
=
uni
.
getStorageSync
(
'userId'
)
this
.
recordDeviceInfo
()
...
...
pages/album/myPhotoAlbum/myPhotoAlbum.vue
View file @
8693c8c2
...
...
@@ -174,7 +174,7 @@ export default {
}
},
onLoad
(
option
)
{
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
//this.companyId = '6da527f930be4aa1904fe17fcb41874f'
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
//获取openid
//this.openid = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ' //获取openid oroHZ5B455jLw_BqDmVpr7W13NLY
...
...
pages/combination/combiChoose/combiChoose.vue
View file @
8693c8c2
...
...
@@ -331,7 +331,7 @@ export default {
},
onLoad
(
option
)
{
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
||
''
this
.
channelId
=
this
.
$commonjs
.
getKey
(
option
,
'channelId'
)
||
''
this
.
groupId
=
this
.
$commonjs
.
getKey
(
option
,
'groupId'
)
||
''
...
...
pages/combination/combiOrder/combiOrder.vue
View file @
8693c8c2
...
...
@@ -15,7 +15,7 @@ export default {
onLoad
(
option
){
let
groupId
=
option
.
groupId
||
''
let
groupChannelId
=
option
.
groupChannelId
||
''
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
productIdList
=
option
.
productIdList
||
''
let
orderSource
=
option
.
orderSource
||
''
let
ifyukuaiCode
=
option
.
ifyukuaiCode
||
''
//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
...
...
pages/combination/distributionCombiChoose/distributionCombiChoose-old.vue
View file @
8693c8c2
...
...
@@ -314,7 +314,7 @@ export default {
},
2500
)
}
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
||
''
this
.
channelId
=
this
.
$commonjs
.
getKey
(
option
,
'channelId'
)
||
''
this
.
groupId
=
this
.
$commonjs
.
getKey
(
option
,
'groupId'
)
||
''
...
...
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
8693c8c2
...
...
@@ -314,7 +314,7 @@ export default {
},
2500
)
}
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
||
''
this
.
channelId
=
this
.
$commonjs
.
getKey
(
option
,
'channelId'
)
||
''
this
.
groupId
=
this
.
$commonjs
.
getKey
(
option
,
'groupId'
)
||
''
...
...
pages/hotel/hotelIndex/hotelIndex.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/indexs/index/index.vue
View file @
8693c8c2
...
...
@@ -150,7 +150,7 @@ export default {
},
onLoad
(
option
){
// 首次进入时执行
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
if
(
!
companyId
){
this
.
getCompanyId
()
}
...
...
pages/indexs/merchantListIndex/merchantListIndex.vue
View file @
8693c8c2
...
...
@@ -174,7 +174,7 @@ export default {
},
onLoad
(
option
)
{
//获取公司Id,保存到本地,支付等逻辑需要入口companyId
this
.
$commonjs
.
get
CompanyId
(
option
)
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
let
token
=
uni
.
getStorageSync
(
'token'
)
||
''
if
(
token
){
uni
.
getLocation
({
...
...
pages/my/commonInfo/commonInfo.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/couponCenter/myCouponList/myCouponList.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/customerService/enterpriseWechat/enterpriseWechat - 副本.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/order/afterSale/afterSaleList/afterSaleList.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/passCode/codeResult/codeResult.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/shopCart/shopCart.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/travelList/travelList/travelList.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/my/travelNotes/myTravelogue/myTravelogue.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
View file @
8693c8c2
...
...
@@ -416,7 +416,7 @@ export default {
}
},
onLoad
(
option
)
{
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
this
.
groupId
=
option
.
groupId
||
''
this
.
groupChannelId
=
option
.
groupChannelId
||
''
this
.
orderSource
=
option
.
orderSource
||
''
...
...
pages/scenic/scenicIndex/scenicIndex.vue
View file @
8693c8c2
...
...
@@ -12,7 +12,7 @@ export default {
}
},
onLoad
(
option
)
{
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
...
...
pages/scenic/scenicJointOrder/scenicJointOrder.vue
View file @
8693c8c2
...
...
@@ -15,7 +15,7 @@ export default {
onLoad
(
option
){
let
merchantId
=
option
.
merchantId
||
''
let
productId
=
option
.
productId
||
''
let
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
let
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
let
orderSource
=
option
.
orderSource
||
''
let
ifyukuaiCode
=
option
.
ifyukuaiCode
||
''
//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
...
...
pages/scenic/scenicProduct/scenicProduct.vue
View file @
8693c8c2
...
...
@@ -128,7 +128,7 @@ export default {
},
onLoad
(
option
)
{
this
.
nowTime
=
parseInt
(
new
Date
().
Format
(
'hhmm'
))
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
||
''
this
.
channelType
=
this
.
$commonjs
.
getKey
(
option
,
'channelType'
)
||
0
this
.
initProduct
()
...
...
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
View file @
8693c8c2
...
...
@@ -483,10 +483,10 @@ export default {
onLoad
(
option
)
{
let
times
=
new
Date
().
Format
(
'yyyy-MM-dd hh:mm:ss'
)
this
.
timeNumber
=
parseInt
(
this
.
$commonjs
.
changeTime
(
times
))
//将当前时间转化为数字
this
.
companyId
=
this
.
$commonjs
.
get
CompanyId
(
option
)
||
''
this
.
orderSource
=
this
.
$commonjs
.
getKey
(
option
,
'orderSource'
)
||
''
this
.
thirdOpenid
=
this
.
$commonjs
.
getKey
(
option
,
'thirdOpenid'
)
||
''
//第三方openid
this
.
productId
=
this
.
$commonjs
.
getKey
(
option
,
'productId'
)
||
''
this
.
companyId
=
this
.
$commonjs
.
get
Key
(
option
,
'companyId'
)
||
''
this
.
orderSource
=
this
.
$commonjs
.
getKey
(
option
,
'orderSource'
)
||
''
this
.
thirdOpenid
=
this
.
$commonjs
.
getKey
(
option
,
'thirdOpenid'
)
||
''
//第三方openid
this
.
productId
=
this
.
$commonjs
.
getKey
(
option
,
'productId'
)
||
''
//#ifdef MP-WEIXIN
this
.
initData
()
//页面初始化数据
//#endif
...
...
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