Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
X
XiTianSenMall
Project
Project
Details
Activity
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
leiqingsong
XiTianSenMall
Commits
c95b648e
Commit
c95b648e
authored
Mar 29, 2021
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安卓联调对接
parent
0bf3fdbf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
27 deletions
+48
-27
.env.production
H5/.env.production
+2
-2
App.vue
H5/src/App.vue
+3
-2
BaseNavBar.vue
H5/src/components/BaseNavBar.vue
+0
-1
bridgeToAppFun.js
H5/src/utils/bridgeToAppFun.js
+27
-14
bank.vue
H5/src/views/bank.vue
+8
-4
cash-out.vue
H5/src/views/cashOut/cash-out.vue
+1
-1
customer-service.vue
H5/src/views/customer-service.vue
+6
-2
vue.config.js
H5/vue.config.js
+1
-1
No files found.
H5/.env.production
View file @
c95b648e
# 生产环境 部署生产环境放开这个
#
VUE_APP_BASE_URL = "http://app.xitiansen.com"
VUE_APP_BASE_URL = "http://app.xitiansen.com"
# 测试环境 部署测试环境放开这个
VUE_APP_BASE_URL = "http://8.131.244.76:81"
\ No newline at end of file
# VUE_APP_BASE_URL = "http://8.131.244.76:81"
\ No newline at end of file
H5/src/App.vue
View file @
c95b648e
...
...
@@ -27,11 +27,12 @@ export default {
this
.
$bridgeToAppFun
.
getAuthToken
()
.
then
(
res
=>
{
console
.
log
(
"获取token成功"
,
res
);
console
.
log
(
"获取到token成功"
,
res
);
localStorage
.
setItem
(
'token'
,
res
);
this
.
saveUser
(
res
);
})
.
catch
(
err
=>
{
console
.
log
(
"获取token失败"
,
err
);
console
.
log
(
"获取token失败
123
"
,
err
);
});
},
methods
:
{
...
...
H5/src/components/BaseNavBar.vue
View file @
c95b648e
...
...
@@ -23,7 +23,6 @@ export default {
const
currentPage
=
this
.
$router
.
currentRoute
.
name
;
console
.
log
(
"router"
,
currentPage
);
const
whiteList
=
[
"MyStatus"
,
"Publish"
,
"FastestProgress"
,
"MonthAward"
,
...
...
H5/src/utils/bridgeToAppFun.js
View file @
c95b648e
...
...
@@ -18,30 +18,28 @@ class bridgeToAppFun {
}
// 获取Token
getAuthToken
()
{
console
.
log
(
'系统:'
,
this
.
userAgent
);
console
.
log
(
"系统:"
,
this
.
userAgent
);
if
(
this
.
userAgent
===
"android"
)
{
// android
let
token
=
null
;
try
{
token
=
window
.
android
.
getAuthToken
();
localStorage
.
setItem
(
"token"
,
token
);
}
catch
{
console
.
log
(
"token获取失败"
);
}
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
token
)
{
console
.
log
(
'版本'
,
window
.
android
.
getAppVersion
());
console
.
log
(
'接收'
,
window
.
android
.
getToken
());
token
=
window
.
android
.
getToken
();
console
.
log
(
'token'
,
token
);
if
(
token
)
{
resolve
(
token
);
}
else
{
reject
(
"失败"
);
reject
(
'没有token'
);
}
});
}
else
if
(
this
.
userAgent
===
"ios"
)
{
// ios
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
'调ios的方法'
);
console
.
log
(
"调ios的方法"
);
jsBridge
.
callhandler
(
"getAuthToken"
,
null
,
data
=>
{
localStorage
.
setItem
(
"token"
,
data
);
if
(
data
)
{
// localStorage.setItem("token", data);
resolve
(
data
);
}
else
{
console
.
log
(
"调用失败"
);
...
...
@@ -66,9 +64,10 @@ class bridgeToAppFun {
console
.
log
(
"返回"
);
if
(
this
.
userAgent
===
"android"
)
{
try
{
const
home_url
=
"https://shop92680967.youzan.com/v2/showcase/homepage?alias=6aFsQ4vCp7"
;
location
.
href
=
home_url
;
// const home_url =
// "https://shop92680967.youzan.com/v2/showcase/homepage?alias=6aFsQ4vCp7";
// location.href = home_url;
window
.
android1
.
navigateBack
();
}
catch
{
console
.
log
(
"返回调用失败,都不行"
);
}
...
...
@@ -95,6 +94,20 @@ class bridgeToAppFun {
jsBridge
.
callhandler
(
"redirectToLogin"
);
}
}
// 保存图片
saveImage
(
url
)
{
console
.
log
(
"调用App保存图片, 图片地址"
,
url
);
if
(
this
.
userAgent
===
"android"
)
{
console
.
log
(
"an"
);
window
.
android
.
appSaveImage
(
url
);
}
else
{
jsBridge
.
callhandler
(
"appSaveImage"
,
url
,
response
=>
{
if
(
response
)
{
console
.
log
(
"保存成功"
);
}
});
}
}
}
export
default
bridgeToAppFun
;
H5/src/views/bank.vue
View file @
c95b648e
...
...
@@ -106,13 +106,17 @@ export default {
this
.
$toast
.
fail
(
"请输入身份证号"
);
return
;
}
if
(
!
/^
[
1-9
]\d{5}(
18|19|20|
(
3
\d))\d{2}((
0
[
1-9
])
|
(
1
[
0-2
]))(([
0-2
][
1-9
])
|10|20|30|31
)\d{3}[
0-9Xx
]
$/
.
test
(
this
.
form
.
idCardNo
))
{
if
(
!
/^
[
1-9
]\d{5}(
18|19|20|
(
3
\d))\d{2}((
0
[
1-9
])
|
(
1
[
0-2
]))(([
0-2
][
1-9
])
|10|20|30|31
)\d{3}[
0-9Xx
]
$/
.
test
(
this
.
form
.
idCardNo
)
)
{
this
.
$toast
.
fail
(
"请输入正确的身份证号"
);
return
;
}
if
(
!
/^
[
a-zA-Z
\u
4e00-
\u
9fa5
]
+$/
.
test
(
this
.
form
.
name
))
{
this
.
$toast
.
fail
(
"姓名仅支持中文或英文"
);
return
;
if
(
!
/^
[
a-zA-Z
\u
4e00-
\u
9fa5
]
+$/
.
test
(
this
.
form
.
name
))
{
this
.
$toast
.
fail
(
"姓名仅支持中文或英文"
);
return
;
}
const
params
=
this
.
form
;
if
(
this
.
form
.
id
)
{
...
...
H5/src/views/cashOut/cash-out.vue
View file @
c95b648e
...
...
@@ -246,7 +246,7 @@ export default {
const
params
=
{
code
:
this
.
validCode
,
money
:
this
.
money
,
userId
:
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
userId
:
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
};
cashOut
(
params
)
.
then
(
res
=>
{
...
...
H5/src/views/customer-service.vue
View file @
c95b648e
...
...
@@ -16,9 +16,9 @@
<div
class=
"save-code"
>
<p>
保存二维码
</p>
<p>
打开微信扫一扫添加客服
</p>
<
p>
请截图保存!
</p
>
<
!--
<p>
请截图保存!
</p>
--
>
</div>
<
!--
<van-button>
保存
</van-button>
--
>
<
van-button
@
click=
"onSave"
>
保存
</van-button
>
</div>
</div>
</div>
...
...
@@ -39,6 +39,10 @@ export default {
},
mounted
()
{},
methods
:
{
onSave
()
{
const
url
=
this
.
imageUrl
;
this
.
$bridgeToAppFun
.
saveImage
(
url
);
},
handlerBack
()
{
try
{
this
.
$bridgeToAppFun
.
navigateBack
();
...
...
H5/vue.config.js
View file @
c95b648e
...
...
@@ -4,7 +4,7 @@ const name = "西田森App";
module
.
exports
=
{
publicPath
:
"/front"
,
//
outputDir: "front",
outputDir
:
"front"
,
devServer
:
{
proxy
:
{
'/shop-mall'
:
{
...
...
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