Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
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
zhengke
jz_Travel
Commits
97e9fd9a
Commit
97e9fd9a
authored
Jan 18, 2024
by
18224442217
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加密
parent
56233e2f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2105 additions
and
410 deletions
+2105
-410
index.vue
components/auth/index.vue
+72
-48
manifest.json
manifest.json
+2
-2
api.js
plugin/api.js
+390
-360
xhs.js
static/xhs.js
+1641
-0
No files found.
components/auth/index.vue
View file @
97e9fd9a
<
template
>
<
template
>
<div
class=
"auth-page"
>
<div
class=
"auth-page"
v-if=
"false"
>
<u-popup
v-model=
"showDialog"
mode=
"center"
:mask-close-able=
"false"
custom-style=
"padding:0;background:none;"
>
<u-popup
v-model=
"showDialog"
mode=
"center"
:mask-close-able=
"false"
custom-style=
"padding:0;background:none;"
>
<img
:src=
"pageinfo.pic_url"
mode=
"widthFix"
/>
<img
:src=
"pageinfo.pic_url"
mode=
"widthFix"
/>
<!-- #ifdef MP-WEIXIN -->
<!-- #ifdef MP-WEIXIN -->
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<
script
>
<
script
>
import
coupon
from
"@/components/coupons/coupons"
;
import
coupon
from
"@/components/coupons/coupons"
;
export
default
{
export
default
{
components
:
{
components
:
{
coupon
,
coupon
,
...
@@ -36,18 +37,19 @@
...
@@ -36,18 +37,19 @@
};
};
},
},
created
()
{
created
()
{
this
.
pageinfo
=
uni
.
getStorageSync
(
"basedata"
)
?
// this.pageinfo = uni.getStorageSync("basedata") ?
uni
.
getStorageSync
(
"basedata"
).
auth_page
:
{};
// uni.getStorageSync("basedata").auth_page : {};
if
(
wx
.
getUserProfile
)
{
// if (wx.getUserProfile) {
this
.
canIUseGetUserProfile
=
true
;
// this.canIUseGetUserProfile = true;
}
// }
// #ifdef MP-ALIPAY
// // #ifdef MP-ALIPAY
this
.
canIUseGetUserProfile
=
true
;
// this.canIUseGetUserProfile = true;
// #endif
// // #endif
let
x
=
this
.
pageinfo
.
hotspot
;
// let x = this.pageinfo.hotspot;
let
y
=
this
.
pageinfo
.
hotspot_cancel
;
// let y = this.pageinfo.hotspot_cancel;
this
.
sureStyle
=
`height:
${
x
.
height
}
rpx;width:
${
x
.
width
}
rpx;left:
${
x
.
left
}
rpx;top:
${
x
.
top
}
rpx;`
;
// this.sureStyle = `height:${x.height}rpx;width:${x.width}rpx;left:${x.left}rpx;top:${x.top}rpx;`;
this
.
cancelStyle
=
`height:
${
y
.
height
}
rpx;width:
${
y
.
width
}
rpx;left:
${
y
.
left
}
rpx;top:
${
y
.
top
}
rpx;`
;
// this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
this
.
getUserInfo
()
},
},
methods
:
{
methods
:
{
getoldUser
()
{
getoldUser
()
{
...
@@ -94,44 +96,66 @@
...
@@ -94,44 +96,66 @@
},
},
});
});
},
},
getUserInfo
(
info
)
{
getUserInfo
()
{
var
that
=
this
;
var
that
=
this
;
that
.
showDialog
=
true
;
that
.
showDialog
=
true
;
uni
.
getProvider
({
wx
.
login
({
service
:
"oauth"
,
success
:
(
res
)
=>
{
success
:
function
(
res
)
{
//console.log(res)
if
(
~
res
.
provider
.
indexOf
(
"weixin"
))
{
let
obj
=
{
uni
.
login
({
Source
:
1
,
provider
:
"weixin"
,
OpenId
:
""
,
success
:
(
res
)
=>
{
Name
:
'微信小程序用户'
,
//这里请求接口
Photo
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1695262844000_280.png'
,
let
obj
=
{
Gender
:
0
,
Source
:
1
,
Moblie
:
""
,
OpenId
:
""
,
SuperiorId
:
0
,
Name
:
info
.
userInfo
.
nickName
,
code
:
res
.
code
,
Photo
:
info
.
userInfo
.
avatarUrl
,
};
Gender
:
info
.
userInfo
.
gender
,
that
.
getCode
(
obj
);
Moblie
:
""
,
SuperiorId
:
0
,
code
:
res
.
code
,
};
that
.
getCode
(
obj
);
},
fail
:
()
=>
{
uni
.
showToast
({
title
:
"微信登录授权失败"
,
icon
:
"none"
,
});
},
});
}
else
{
uni
.
showToast
({
title
:
"请先安装微信或升级版本"
,
icon
:
"none"
,
});
}
},
},
});
fail
()
{
that
.
showDialog
=
false
uni
.
showToast
({
title
:
'微信登录失败'
})
}
})
// uni.getProvider({
// service: "oauth",
// success: function(res) {
// if (~res.provider.indexOf("weixin")) {
// uni.login({
// provider: "weixin",
// success: (res) => {
// //这里请求接口
// let obj = {
// Source: 1,
// OpenId: "",
// Name: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// Gender: info.userInfo.gender,
// Moblie: "",
// SuperiorId: 0,
// code: res.code,
// };
// that.getCode(obj);
// },
// fail: () => {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none",
// });
// },
// });
// } else {
// uni.showToast({
// title: "请先安装微信或升级版本",
// icon: "none",
// });
// }
// },
// });
},
},
close
()
{
close
()
{
this
.
showDialog
=
false
;
this
.
showDialog
=
false
;
...
...
manifest.json
View file @
97e9fd9a
...
@@ -69,9 +69,9 @@
...
@@ -69,9 +69,9 @@
"quickapp"
:
{},
"quickapp"
:
{},
/*
小程序特有相关
*/
/*
小程序特有相关
*/
"mp-weixin"
:
{
"mp-weixin"
:
{
"appid"
:
"wx
5564525562e92ddb
"
,
"appid"
:
"wx
cf0727a7c78b501e
"
,
"setting"
:
{
"setting"
:
{
"urlCheck"
:
fals
e
,
"urlCheck"
:
tru
e
,
"minified"
:
false
"minified"
:
false
},
},
"usingComponents"
:
true
,
"usingComponents"
:
true
,
...
...
plugin/api.js
View file @
97e9fd9a
import
Md5
from
"js-md5"
import
Md5
from
"js-md5"
export
default
{
import
{
get_xs
}
from
'@/static/xhs.js'
install
(
Vue
,
options
)
{
Vue
.
prototype
.
host
=
"https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
const
resolveRVHandler
=
(
response
)
=>
{
if
(
response
.
header
&&
response
.
header
[
'r-v'
]){
Vue
.
prototype
.
host2
=
"http://192.168.10.226:5004"
uni
.
setStorageSync
(
"r-v"
,
response
.
header
[
'r-v'
])
Vue
.
prototype
.
host3
=
"http://192.168.10.226"
}
Vue
.
prototype
.
host2
=
"https://erpmallapi.oytour.com"
}
Vue
.
prototype
.
host3
=
"https://reborn.oytour.com"
const
getRVHandler
=
(
payload
,
token
)
=>
{
Vue
.
prototype
.
request
=
function
(
param
,
success
,
failed
)
{
if
(
uni
.
getStorageSync
(
"r-v"
)){
//网络请求
let
a1
=
uni
.
getStorageSync
(
"r-v"
)
uni
.
request
({
let
xs
=
get_xs
(
payload
,
a1
,
token
)
url
:
this
.
host
+
"&r="
+
param
.
data
.
r
,
if
(
xs
&&
xs
!=
''
){
method
:
param
.
method
||
"GET"
,
console
.
log
(
xs
)
header
:
param
.
header
||
{
return
xs
'content-type'
:
"application/json"
}
},
}
data
:
param
.
data
,
return
''
success
:
res
=>
{
}
if
(
res
.
data
.
code
!=
0
&&
res
.
data
.
msg
!=
"商品未上架"
)
{}
typeof
success
==
"function"
&&
success
(
res
.
data
);
export
default
{
},
install
(
Vue
,
options
)
{
fail
:
(
e
)
=>
{
Vue
.
prototype
.
host
=
"https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
uni
.
showModal
({
Vue
.
prototype
.
host2
=
"http://192.168.10.226:5004"
content
:
""
+
res
.
errMsg
Vue
.
prototype
.
host3
=
"http://192.168.10.226"
});
Vue
.
prototype
.
host2
=
"https://erpmallapi.oytour.com"
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
Vue
.
prototype
.
host3
=
"https://reborn.oytour.com"
}
});
Vue
.
prototype
.
request
=
function
(
param
,
success
,
failed
)
{
}
//网络请求
Vue
.
prototype
.
request2
=
function
(
param
,
success
,
failed
)
{
uni
.
request
({
//网络请求
url
:
this
.
host
+
"&r="
+
param
.
data
.
r
,
uni
.
request
({
method
:
param
.
method
||
"GET"
,
url
:
this
.
host2
+
param
.
url
,
header
:
param
.
header
||
{
method
:
param
.
method
||
"Post"
,
'content-type'
:
"application/json"
header
:
param
.
header
||
{
},
'content-type'
:
"application/json"
data
:
param
.
data
,
},
success
:
res
=>
{
data
:
{
if
(
res
.
data
.
code
!=
0
&&
res
.
data
.
msg
!=
"商品未上架"
)
{}
MallBaseId
:
this
.
GetMiniAppId
().
MallBaseId
,
typeof
success
==
"function"
&&
success
(
res
.
data
);
TenantId
:
this
.
GetMiniAppId
().
TenantId
,
},
OpenId
:
this
.
GetOpenId
().
OpenId
,
fail
:
(
e
)
=>
{
UserId
:
this
.
GetOpenId
().
UserId
,
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
SmallShopsId
:
this
.
GetOpenId
().
SmallShopsId
,
uni
.
showModal
({
MiniAppId
:
this
.
GetMiniAppId
().
AppId
,
content
:
""
+
res
.
errMsg
msg
:
param
.
data
,
});
token
:
this
.
GetOpenId
().
token
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
},
}
success
:
res
=>
{
});
if
(
res
.
data
.
resultCode
==
10000
)
{
}
let
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
Vue
.
prototype
.
request2
=
function
(
param
,
success
,
failed
)
{
if
(
u
)
{
let
data
=
{
this
.
getLogin_t
(
u
)
MallBaseId
:
this
.
GetMiniAppId
().
MallBaseId
,
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
TenantId
:
this
.
GetMiniAppId
().
TenantId
,
}
OpenId
:
this
.
GetOpenId
().
OpenId
,
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
UserId
:
this
.
GetOpenId
().
UserId
,
if
(
res
.
data
.
message
!=
''
)
{
SmallShopsId
:
this
.
GetOpenId
().
SmallShopsId
,
uni
.
showToast
({
MiniAppId
:
this
.
GetMiniAppId
().
AppId
,
title
:
res
.
data
.
message
,
msg
:
param
.
data
,
icon
:
"none"
,
token
:
this
.
GetOpenId
().
token
});
}
}
//['X-s']
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
const
sign
=
getRVHandler
(
data
,
this
.
GetOpenId
().
token
)
}
else
{
//网络请求
typeof
success
==
"function"
&&
success
(
res
.
data
);
uni
.
request
({
}
url
:
this
.
host2
+
param
.
url
,
},
method
:
param
.
method
||
"Post"
,
fail
:
(
e
)
=>
{
header
:
param
.
header
||
{
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
'content-type'
:
"application/json"
,
uni
.
showModal
({
'x-sign'
:
sign
[
"X-s"
],
content
:
""
+
res
.
errMsg
'x-ts'
:
sign
[
"X-t"
]
});
},
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
data
,
}
success
:
res
=>
{
});
resolveRVHandler
(
res
)
}
if
(
res
.
data
.
resultCode
==
10000
)
{
let
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
//请求app接口
if
(
u
)
{
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
success
,
failed
)
{
this
.
getLogin_t
(
u
)
var
postData
=
this
.
GetPostData
(
cmd
,
msg
,
""
);
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
uni
.
request
({
}
url
:
this
.
host3
+
'/api/common/post'
,
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
method
:
"Post"
,
if
(
res
.
data
.
message
!=
''
)
{
header
:
{
uni
.
showToast
({
'Content-Type'
:
'application/json'
title
:
res
.
data
.
message
,
},
icon
:
"none"
,
data
:
postData
,
});
success
:
res
=>
{
}
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
uni
.
removeStorageSync
(
'b2b_user'
)
}
else
{
uni
.
removeStorageSync
(
'mall_UserInfo'
)
typeof
success
==
"function"
&&
success
(
res
.
data
);
// uni.redirectTo({
}
// url: '/pages/jiuzhai/login'
},
// })
fail
:
(
e
)
=>
{
uni
.
redirectTo
({
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
url
:
'/pages/index/index'
uni
.
showModal
({
})
content
:
""
+
res
.
errMsg
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
});
if
(
!
failed
)
{
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
if
(
res
.
data
.
message
!=
''
)
{
}
uni
.
showToast
({
});
title
:
res
.
data
.
message
,
}
icon
:
"none"
,
});
//请求app接口
}
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
success
,
failed
)
{
}
var
data
=
this
.
GetPostData
(
cmd
,
msg
,
""
);
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
//['X-s']
}
else
{
const
sign
=
getRVHandler
(
data
,
data
.
token
)
typeof
success
==
"function"
&&
success
(
res
.
data
);
uni
.
request
({
}
url
:
this
.
host3
+
'/api/common/post'
,
},
method
:
"Post"
,
fail
:
(
e
)
=>
{
header
:
{
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
'Content-Type'
:
'application/json'
,
uni
.
showModal
({
'x-sign'
:
sign
[
"X-s"
],
'x-ts'
:
sign
[
"X-t"
]
content
:
""
+
res
.
errMsg
},
});
data
,
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
success
:
res
=>
{
}
resolveRVHandler
(
res
)
})
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
},
uni
.
removeStorageSync
(
'b2b_user'
)
Vue
.
prototype
.
javaApipost
=
function
(
cmd
,
msg
,
success
,
failed
)
{
uni
.
removeStorageSync
(
'mall_UserInfo'
)
let
b2bUser
=
uni
.
getStorageSync
(
'b2b_user'
)
// uni.redirectTo({
let
token
=
""
;
// url: '/pages/jiuzhai/login'
let
key
=
""
;
// })
let
groupId
=
0
uni
.
redirectTo
({
let
timestamp
=
(
new
Date
()).
valueOf
();
url
:
'/pages/index/index'
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
})
if
(
b2bUser
&&
b2bUser
.
token
)
{
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
token
=
b2bUser
.
token
;
if
(
!
failed
)
{
key
=
b2bUser
.
secretKey
;
if
(
res
.
data
.
message
!=
''
)
{
groupId
=
b2bUser
.
groupId
;
uni
.
showToast
({
}
title
:
res
.
data
.
message
,
var
md5Str
=
Md5
(
`msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
icon
:
"none"
,
var
postData
=
{
});
"groupId"
:
groupId
,
}
"msg"
:
msg
,
}
"timestamp"
:
timestamp
,
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
"token"
:
token
,
}
else
{
"sign"
:
md5Str
,
typeof
success
==
"function"
&&
success
(
res
.
data
);
}
}
},
uni
.
request
({
fail
:
(
e
)
=>
{
url
:
'https://efficient.oytour.com/api/'
+
cmd
,
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
method
:
"Post"
,
uni
.
showModal
({
header
:
{
content
:
""
+
res
.
errMsg
'Content-Type'
:
'application/json'
});
},
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
data
:
postData
,
}
success
:
res
=>
{
})
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
},
uni
.
removeStorageSync
(
'b2b_user'
)
Vue
.
prototype
.
javaApipost
=
function
(
cmd
,
msg
,
success
,
failed
)
{
uni
.
removeStorageSync
(
'mall_UserInfo'
)
let
b2bUser
=
uni
.
getStorageSync
(
'b2b_user'
)
// uni.redirectTo({
let
token
=
""
;
// url: '/pages/jiuzhai/login'
let
key
=
""
;
// })
let
groupId
=
0
uni
.
redirectTo
({
let
timestamp
=
(
new
Date
()).
valueOf
();
url
:
'/pages/index/index'
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
})
if
(
b2bUser
&&
b2bUser
.
token
)
{
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
token
=
b2bUser
.
token
;
if
(
res
.
data
.
message
!=
''
)
{
key
=
b2bUser
.
secretKey
;
uni
.
showToast
({
groupId
=
b2bUser
.
groupId
;
title
:
res
.
data
.
message
,
}
icon
:
"none"
,
var
md5Str
=
Md5
(
`msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
});
var
postData
=
{
}
"groupId"
:
groupId
,
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
"msg"
:
msg
,
}
else
{
"timestamp"
:
timestamp
,
typeof
success
==
"function"
&&
success
(
res
.
data
);
"token"
:
token
,
}
"sign"
:
md5Str
,
},
}
fail
:
(
e
)
=>
{
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
uni
.
request
({
uni
.
showModal
({
url
:
'https://efficient.oytour.com/api/'
+
cmd
,
content
:
""
+
res
.
errMsg
method
:
"Post"
,
});
header
:
{
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
'Content-Type'
:
'application/json'
}
},
})
data
:
postData
,
},
success
:
res
=>
{
Vue
.
prototype
.
apipostDownload
=
function
(
cmd
,
msg
,
success
,
failed
)
{
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
var
postData
=
this
.
GetPostData
(
cmd
,
msg
,
""
);
uni
.
removeStorageSync
(
'b2b_user'
)
uni
.
request
({
uni
.
removeStorageSync
(
'mall_UserInfo'
)
url
:
this
.
host3
+
'/api/file/'
+
cmd
,
// uni.redirectTo({
method
:
"Post"
,
// url: '/pages/jiuzhai/login'
header
:
{
// })
'Content-Type'
:
'application/json'
uni
.
redirectTo
({
},
url
:
'/pages/index/index'
data
:
postData
,
})
success
:
res
=>
{
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
if
(
res
.
data
.
resultCode
==
10000
)
{
if
(
res
.
data
.
message
!=
''
)
{
let
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
uni
.
showToast
({
if
(
u
)
{
title
:
res
.
data
.
message
,
this
.
getLogin_t
(
u
)
icon
:
"none"
,
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
});
}
}
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
if
(
res
.
data
.
message
!=
''
)
{
}
else
{
uni
.
showToast
({
typeof
success
==
"function"
&&
success
(
res
.
data
);
title
:
res
.
data
.
message
,
}
icon
:
"none"
,
},
});
fail
:
(
e
)
=>
{
}
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
uni
.
showModal
({
}
else
{
content
:
""
+
res
.
errMsg
typeof
success
==
"function"
&&
success
(
res
.
data
);
});
}
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
},
}
fail
:
(
e
)
=>
{
})
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
},
uni
.
showModal
({
Vue
.
prototype
.
apipostDownload
=
function
(
cmd
,
msg
,
success
,
failed
)
{
content
:
""
+
res
.
errMsg
var
postData
=
this
.
GetPostData
(
cmd
,
msg
,
""
);
});
uni
.
request
({
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
url
:
this
.
host3
+
'/api/file/'
+
cmd
,
}
method
:
"Post"
,
})
header
:
{
},
'Content-Type'
:
'application/json'
},
//获取请求参数
data
:
postData
,
Vue
.
prototype
.
GetPostData
=
function
(
cmd
,
msg
)
{
success
:
res
=>
{
if
(
msg
==
null
||
msg
==
""
)
{
if
(
res
.
data
.
resultCode
==
10000
)
{
msg
=
{}
let
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
}
if
(
u
)
{
let
b2bUser
=
uni
.
getStorageSync
(
'b2b_user'
)
this
.
getLogin_t
(
u
)
let
token
=
''
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
let
key
=
""
}
let
groupId
=
''
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
let
timestamp
=
(
new
Date
()).
valueOf
();
if
(
res
.
data
.
message
!=
''
)
{
if
(
b2bUser
&&
b2bUser
.
token
)
{
uni
.
showToast
({
token
=
b2bUser
.
token
title
:
res
.
data
.
message
,
key
=
b2bUser
.
secretKey
icon
:
"none"
,
}
});
if
(
b2bUser
)
{
}
groupId
=
b2bUser
.
groupId
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
}
}
else
{
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
typeof
success
==
"function"
&&
success
(
res
.
data
);
var
postData
=
{
}
"groupId"
:
groupId
,
},
"msg"
:
msg
,
fail
:
(
e
)
=>
{
"cmd"
:
cmd
,
console
.
log
(
"网络请求fail:"
+
JSON
.
stringify
(
e
));
"timestamp"
:
timestamp
,
uni
.
showModal
({
"token"
:
token
,
content
:
""
+
res
.
errMsg
"sign"
:
''
,
});
"locale"
:
'zh_CN'
,
typeof
failed
==
"function"
&&
failed
(
res
.
data
);
"currencyCode"
:
'CNY'
,
}
version
:
'MiniProgram'
})
}
},
return
postData
},
//获取请求参数
// token失效再次登录接口
Vue
.
prototype
.
GetPostData
=
function
(
cmd
,
msg
)
{
Vue
.
prototype
.
getLogin_t
=
function
(
obj
)
{
if
(
msg
==
null
||
msg
==
""
)
{
console
.
log
(
'apijs'
,
obj
)
msg
=
{}
let
pid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
}
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
let
b2bUser
=
uni
.
getStorageSync
(
'b2b_user'
)
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
let
token
=
''
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
let
key
=
""
0
;
let
groupId
=
''
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
''
;
let
timestamp
=
(
new
Date
()).
valueOf
();
this
.
request2
({
if
(
b2bUser
&&
b2bUser
.
token
)
{
url
:
'/api/AppletLogin/Login'
,
token
=
b2bUser
.
token
data
:
{
key
=
b2bUser
.
secretKey
Source
:
obj
.
Source
,
}
OpenId
:
obj
.
OpenId
,
if
(
b2bUser
)
{
Name
:
obj
.
Name
,
groupId
=
b2bUser
.
groupId
Photo
:
obj
.
Photo
,
}
Moblie
:
''
,
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
SuperiorId
:
pid
,
var
postData
=
{
SmallShopId
:
SmallShopId
,
"groupId"
:
groupId
,
UserPageType
:
Up
,
"msg"
:
msg
,
CounponPassword
:
CounponPassword
,
"cmd"
:
cmd
,
KeyWord
:
KeyWord
,
"timestamp"
:
timestamp
,
}
"token"
:
token
,
},
"sign"
:
''
,
res
=>
{
"locale"
:
'zh_CN'
,
if
(
res
.
resultCode
==
1
)
{
"currencyCode"
:
'CNY'
,
uni
.
setStorageSync
(
'mall_UserInfo'
,
res
.
data
);
version
:
'MiniProgram'
uni
.
removeStorageSync
(
'pid'
);
}
uni
.
removeStorageSync
(
'SmallShopId'
);
return
postData
uni
.
removeStorageSync
(
"Up"
);
},
uni
.
removeStorageSync
(
"CounponPassword"
);
// token失效再次登录接口
uni
.
removeStorageSync
(
"KeyWord"
);
Vue
.
prototype
.
getLogin_t
=
function
(
obj
)
{
}
console
.
log
(
'apijs'
,
obj
)
}
let
pid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
);
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
}
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
// 获取小程序APPID
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
Vue
.
prototype
.
GetMiniAppId
=
function
()
{
0
;
let
appObj
=
{};
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
''
;
let
appType
=
2
;
this
.
request2
({
switch
(
appType
)
{
url
:
'/api/AppletLogin/Login'
,
case
1
:
//旅小友-支付宝
data
:
{
appObj
=
{
Source
:
obj
.
Source
,
AppId
:
'2021002181604459'
,
OpenId
:
obj
.
OpenId
,
TenantId
:
12
,
Name
:
obj
.
Name
,
MallBaseId
:
2
,
Photo
:
obj
.
Photo
,
};
Moblie
:
''
,
break
;
SuperiorId
:
pid
,
case
2
:
//旅小友-微信
SmallShopId
:
SmallShopId
,
//wx5564525562e92ddb
UserPageType
:
Up
,
//wxcf0727a7c78b501e
CounponPassword
:
CounponPassword
,
appObj
=
{
KeyWord
:
KeyWord
,
AppId
:
'wx5564525562e92ddb'
,
}
TenantId
:
29
,
},
MallBaseId
:
19
,
res
=>
{
};
if
(
res
.
resultCode
==
1
)
{
break
;
uni
.
setStorageSync
(
'mall_UserInfo'
,
res
.
data
);
}
uni
.
removeStorageSync
(
'pid'
);
return
appObj
;
uni
.
removeStorageSync
(
'SmallShopId'
);
}
uni
.
removeStorageSync
(
"Up"
);
//获取OpenId
uni
.
removeStorageSync
(
"CounponPassword"
);
Vue
.
prototype
.
GetOpenId
=
function
()
{
uni
.
removeStorageSync
(
"KeyWord"
);
let
mall_userinfo
=
wx
.
getStorageSync
(
'mall_UserInfo'
)
}
var
obj
=
{
}
OpenId
:
''
,
);
UserId
:
0
,
}
token
:
''
,
// 获取小程序APPID
SmallShopsId
:
0
,
Vue
.
prototype
.
GetMiniAppId
=
function
()
{
}
let
appObj
=
{};
if
(
mall_userinfo
)
{
let
appType
=
2
;
if
(
mall_userinfo
.
OpenId
)
{
switch
(
appType
)
{
obj
.
OpenId
=
mall_userinfo
.
OpenId
;
case
1
:
//旅小友-支付宝
obj
.
UserId
=
mall_userinfo
.
UserId
;
appObj
=
{
obj
.
token
=
mall_userinfo
.
Token
;
AppId
:
'2021002181604459'
,
obj
.
SmallShopsId
=
mall_userinfo
.
UserSmallShopId
;
TenantId
:
12
,
}
MallBaseId
:
2
,
}
};
return
obj
break
;
}
case
2
:
//旅小友-微信
//公用判断图片地址 判断是否包含http
//wx5564525562e92ddb
Vue
.
prototype
.
getIconLink
=
function
(
url
)
{
//wxcf0727a7c78b501e
let
str
=
''
appObj
=
{
if
(
url
&&
url
!=
''
)
{
AppId
:
'wxcf0727a7c78b501e'
,
if
(
url
.
indexOf
(
'http'
)
!=
-
1
)
{
TenantId
:
12
,
str
=
url
MallBaseId
:
2
,
}
else
{
};
str
=
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com'
+
url
;
break
;
}
}
return
str
;
return
appObj
;
}
}
}
//获取OpenId
//价格返回.00
Vue
.
prototype
.
GetOpenId
=
function
()
{
Vue
.
prototype
.
getPrice
=
function
(
val
)
{
let
mall_userinfo
=
wx
.
getStorageSync
(
'mall_UserInfo'
)
val
=
Number
(
val
).
toFixed
(
2
);
var
obj
=
{
return
val
OpenId
:
''
,
}
UserId
:
0
,
token
:
''
,
Vue
.
prototype
.
apiheader
=
function
()
{
SmallShopsId
:
0
,
return
{
}
'X-Access-Token'
:
'_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr'
,
if
(
mall_userinfo
)
{
'X-App-Platform'
:
'wxapp'
,
if
(
mall_userinfo
.
OpenId
)
{
'X-App-Version'
:
'4.2.47'
,
obj
.
OpenId
=
mall_userinfo
.
OpenId
;
'X-Form-Id-List'
:
'[]'
,
obj
.
UserId
=
mall_userinfo
.
UserId
;
'X-Requested-With'
:
'XMLHttpRequest'
,
obj
.
token
=
mall_userinfo
.
Token
;
'X-User-Id'
:
'19992'
,
obj
.
SmallShopsId
=
mall_userinfo
.
UserSmallShopId
;
'content-type'
:
"application/json"
}
}
}
}
return
obj
}
}
}
//公用判断图片地址 判断是否包含http
Vue
.
prototype
.
getIconLink
=
function
(
url
)
{
let
str
=
''
if
(
url
&&
url
!=
''
)
{
if
(
url
.
indexOf
(
'http'
)
!=
-
1
)
{
str
=
url
}
else
{
str
=
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com'
+
url
;
}
return
str
;
}
}
//价格返回.00
Vue
.
prototype
.
getPrice
=
function
(
val
)
{
val
=
Number
(
val
).
toFixed
(
2
);
return
val
}
Vue
.
prototype
.
apiheader
=
function
()
{
return
{
'X-Access-Token'
:
'_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr'
,
'X-App-Platform'
:
'wxapp'
,
'X-App-Version'
:
'4.2.47'
,
'X-Form-Id-List'
:
'[]'
,
'X-Requested-With'
:
'XMLHttpRequest'
,
'X-User-Id'
:
'19992'
,
'content-type'
:
"application/json"
}
}
}
}
...
...
static/xhs.js
0 → 100644
View file @
97e9fd9a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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