Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
e1abf1ac
Commit
e1abf1ac
authored
Mar 29, 2021
by
leiqingsong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_lqs' into 'master'
Dev lqs See merge request
!144
parents
7429f700
f3f3b9f9
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
174 additions
and
70 deletions
+174
-70
App.vue
H5/src/App.vue
+3
-2
base.js
H5/src/api/base.js
+12
-0
BaseNavBar.vue
H5/src/components/BaseNavBar.vue
+0
-1
index.js
H5/src/router/index.js
+0
-27
bridgeToAppFun.js
H5/src/utils/bridgeToAppFun.js
+40
-13
airDropPool.vue
H5/src/views/airDropPool.vue
+3
-1
bank.vue
H5/src/views/bank.vue
+8
-4
canCashOut.vue
H5/src/views/canCashOut.vue
+2
-2
cash-out.vue
H5/src/views/cashOut/cash-out.vue
+1
-1
customer-service.vue
H5/src/views/customer-service.vue
+6
-2
invite.vue
H5/src/views/invite.vue
+38
-15
settings.vue
H5/src/views/settings.vue
+60
-1
vue.config.js
H5/vue.config.js
+1
-1
No files found.
H5/src/App.vue
View file @
e1abf1ac
...
@@ -27,11 +27,12 @@ export default {
...
@@ -27,11 +27,12 @@ export default {
this
.
$bridgeToAppFun
this
.
$bridgeToAppFun
.
getAuthToken
()
.
getAuthToken
()
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
"获取token成功"
,
res
);
console
.
log
(
"获取到token成功"
,
res
);
localStorage
.
setItem
(
"token"
,
res
);
this
.
saveUser
(
res
);
this
.
saveUser
(
res
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
"获取token失败"
,
err
);
console
.
log
(
"获取token失败
123
"
,
err
);
});
});
},
},
methods
:
{
methods
:
{
...
...
H5/src/api/base.js
View file @
e1abf1ac
...
@@ -30,3 +30,15 @@ export function uploadImage(params, file) {
...
@@ -30,3 +30,15 @@ export function uploadImage(params, file) {
data
:
file
data
:
file
});
});
}
}
/**
* 版本检查
* @param {*} version
* @returns
*/
export
function
versionUpdate
(
version
)
{
return
request
({
url
:
`/account/version?version=
${
version
}
`
,
method
:
"get"
});
}
H5/src/components/BaseNavBar.vue
View file @
e1abf1ac
...
@@ -23,7 +23,6 @@ export default {
...
@@ -23,7 +23,6 @@ export default {
const
currentPage
=
this
.
$router
.
currentRoute
.
name
;
const
currentPage
=
this
.
$router
.
currentRoute
.
name
;
console
.
log
(
"router"
,
currentPage
);
console
.
log
(
"router"
,
currentPage
);
const
whiteList
=
[
const
whiteList
=
[
"MyStatus"
,
"Publish"
,
"Publish"
,
"FastestProgress"
,
"FastestProgress"
,
"MonthAward"
,
"MonthAward"
,
...
...
H5/src/router/index.js
View file @
e1abf1ac
...
@@ -162,31 +162,4 @@ const router = new VueRouter({
...
@@ -162,31 +162,4 @@ const router = new VueRouter({
routes
routes
});
});
// router.beforeEach((to, from, next) => {
// console.log('to', to);
// const whiteList = [
// "MyStatus",
// "Publish",
// "FastestProgress",
// "MonthAward",
// "Settings",
// "Grade",
// "AirDrop",
// "Invite",
// "AboutUs",
// "customerService",
// "Wallet"
// ];
// const token = localStorage.getItem("token");
// if (whiteList.indexOf(to.name) > -1) {
// if (token) {
// next()
// } else {
// console.log('未登录');
// }
// } else {
// next()
// }
// })
export
default
router
;
export
default
router
;
H5/src/utils/bridgeToAppFun.js
View file @
e1abf1ac
...
@@ -18,30 +18,28 @@ class bridgeToAppFun {
...
@@ -18,30 +18,28 @@ class bridgeToAppFun {
}
}
// 获取Token
// 获取Token
getAuthToken
()
{
getAuthToken
()
{
console
.
log
(
'系统:'
,
this
.
userAgent
);
console
.
log
(
"系统:"
,
this
.
userAgent
);
if
(
this
.
userAgent
===
"android"
)
{
if
(
this
.
userAgent
===
"android"
)
{
// android
// android
let
token
=
null
;
let
token
=
null
;
try
{
token
=
window
.
android
.
getAuthToken
();
localStorage
.
setItem
(
"token"
,
token
);
}
catch
{
console
.
log
(
"token获取失败"
);
}
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
"版本"
,
window
.
android
.
getAppVersion
());
console
.
log
(
"接收"
,
window
.
android
.
getToken
());
token
=
window
.
android
.
getToken
();
console
.
log
(
"token"
,
token
);
if
(
token
)
{
if
(
token
)
{
resolve
(
token
);
resolve
(
token
);
}
else
{
}
else
{
reject
(
"
失败
"
);
reject
(
"
没有token
"
);
}
}
});
});
}
else
if
(
this
.
userAgent
===
"ios"
)
{
}
else
if
(
this
.
userAgent
===
"ios"
)
{
// ios
// ios
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
'调ios的方法'
);
console
.
log
(
"调ios的方法"
);
jsBridge
.
callhandler
(
"getAuthToken"
,
null
,
data
=>
{
jsBridge
.
callhandler
(
"getAuthToken"
,
null
,
data
=>
{
localStorage
.
setItem
(
"token"
,
data
);
if
(
data
)
{
if
(
data
)
{
// localStorage.setItem("token", data);
resolve
(
data
);
resolve
(
data
);
}
else
{
}
else
{
console
.
log
(
"调用失败"
);
console
.
log
(
"调用失败"
);
...
@@ -66,9 +64,10 @@ class bridgeToAppFun {
...
@@ -66,9 +64,10 @@ class bridgeToAppFun {
console
.
log
(
"返回"
);
console
.
log
(
"返回"
);
if
(
this
.
userAgent
===
"android"
)
{
if
(
this
.
userAgent
===
"android"
)
{
try
{
try
{
const
home_url
=
// const home_url =
"https://shop92680967.youzan.com/v2/showcase/homepage?alias=6aFsQ4vCp7"
;
// "https://shop92680967.youzan.com/v2/showcase/homepage?alias=6aFsQ4vCp7";
location
.
href
=
home_url
;
// location.href = home_url;
window
.
android1
.
navigateBack
();
}
catch
{
}
catch
{
console
.
log
(
"返回调用失败,都不行"
);
console
.
log
(
"返回调用失败,都不行"
);
}
}
...
@@ -95,6 +94,34 @@ class bridgeToAppFun {
...
@@ -95,6 +94,34 @@ class bridgeToAppFun {
jsBridge
.
callhandler
(
"redirectToLogin"
);
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
(
"保存成功"
);
}
});
}
}
getAppVersion
()
{
let
version
=
""
;
if
(
this
.
userAgent
===
"android"
)
{
console
.
log
(
"an"
);
version
=
window
.
android
.
getAppVersion
();
}
else
{
jsBridge
.
callhandler
(
"getAppVersion"
,
null
,
response
=>
{
if
(
response
)
{
version
=
response
;
}
});
}
return
version
;
}
}
}
export
default
bridgeToAppFun
;
export
default
bridgeToAppFun
;
H5/src/views/airDropPool.vue
View file @
e1abf1ac
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
>
>
<p
<p
v-for=
"(item, index) in userPoolVos"
v-for=
"(item, index) in userPoolVos"
:key=
"index"
:key=
"index
+ 'down'
"
@
click=
"openUserInfo(item)"
@
click=
"openUserInfo(item)"
>
>
用户
{{
item
.
userId
}}
进入空投池
用户
{{
item
.
userId
}}
进入空投池
...
@@ -89,9 +89,11 @@ export default {
...
@@ -89,9 +89,11 @@ export default {
methods
:
{
methods
:
{
onCloseUser
()
{
onCloseUser
()
{
this
.
userInfoDialog
=
false
;
this
.
userInfoDialog
=
false
;
this
.
canScroll
=
true
;
},
},
openUserInfo
(
item
)
{
openUserInfo
(
item
)
{
console
.
log
(
123
);
console
.
log
(
123
);
this
.
canScroll
=
false
;
this
.
userInfoDialog
=
true
;
this
.
userInfoDialog
=
true
;
this
.
currentUser
=
item
;
this
.
currentUser
=
item
;
this
.
currentUser
.
avatar
=
process
.
env
.
VUE_APP_BASE_URL
+
item
.
headImage
;
this
.
currentUser
.
avatar
=
process
.
env
.
VUE_APP_BASE_URL
+
item
.
headImage
;
...
...
H5/src/views/bank.vue
View file @
e1abf1ac
...
@@ -106,13 +106,17 @@ export default {
...
@@ -106,13 +106,17 @@ export default {
this
.
$toast
.
fail
(
"请输入身份证号"
);
this
.
$toast
.
fail
(
"请输入身份证号"
);
return
;
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
(
"请输入正确的身份证号"
);
this
.
$toast
.
fail
(
"请输入正确的身份证号"
);
return
;
return
;
}
}
if
(
!
/^
[
a-zA-Z
\u
4e00-
\u
9fa5
]
+$/
.
test
(
this
.
form
.
name
))
{
if
(
!
/^
[
a-zA-Z
\u
4e00-
\u
9fa5
]
+$/
.
test
(
this
.
form
.
name
))
{
this
.
$toast
.
fail
(
"姓名仅支持中文或英文"
);
this
.
$toast
.
fail
(
"姓名仅支持中文或英文"
);
return
;
return
;
}
}
const
params
=
this
.
form
;
const
params
=
this
.
form
;
if
(
this
.
form
.
id
)
{
if
(
this
.
form
.
id
)
{
...
...
H5/src/views/canCashOut.vue
View file @
e1abf1ac
...
@@ -41,8 +41,8 @@ export default {
...
@@ -41,8 +41,8 @@ export default {
name
:
"CanCashOut"
,
name
:
"CanCashOut"
,
data
()
{
data
()
{
return
{
return
{
preNum
:
"
125
"
,
preNum
:
"
0
"
,
currentNum
:
"
325
"
,
currentNum
:
"
0
"
,
rules
:
"提现规则:"
,
rules
:
"提现规则:"
,
rulesMent
:
rulesMent
:
"1、结算:所有购买及推广产生的佣金实时结算,月度肥料及进步奖每月1号结算上个月收益,在APP我的收益页面可随时查询收益情况。"
,
"1、结算:所有购买及推广产生的佣金实时结算,月度肥料及进步奖每月1号结算上个月收益,在APP我的收益页面可随时查询收益情况。"
,
...
...
H5/src/views/cashOut/cash-out.vue
View file @
e1abf1ac
...
@@ -246,7 +246,7 @@ export default {
...
@@ -246,7 +246,7 @@ export default {
const
params
=
{
const
params
=
{
code
:
this
.
validCode
,
code
:
this
.
validCode
,
money
:
this
.
money
,
money
:
this
.
money
,
userId
:
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
userId
:
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
};
};
cashOut
(
params
)
cashOut
(
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
H5/src/views/customer-service.vue
View file @
e1abf1ac
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
<div
class=
"save-code"
>
<div
class=
"save-code"
>
<p>
保存二维码
</p>
<p>
保存二维码
</p>
<p>
打开微信扫一扫添加客服
</p>
<p>
打开微信扫一扫添加客服
</p>
<
p>
请截图保存!
</p
>
<
!--
<p>
请截图保存!
</p>
--
>
</div>
</div>
<
!--
<van-button>
保存
</van-button>
--
>
<
van-button
@
click=
"onSave"
>
保存
</van-button
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -39,6 +39,10 @@ export default {
...
@@ -39,6 +39,10 @@ export default {
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
onSave
()
{
const
url
=
this
.
imageUrl
;
this
.
$bridgeToAppFun
.
saveImage
(
url
);
},
handlerBack
()
{
handlerBack
()
{
try
{
try
{
this
.
$bridgeToAppFun
.
navigateBack
();
this
.
$bridgeToAppFun
.
navigateBack
();
...
...
H5/src/views/invite.vue
View file @
e1abf1ac
<
template
>
<
template
>
<div
class=
"invite-code"
>
<div
class=
"invite-code"
:style=
"
`background-image: url($
{imgSrc});background-size: 100% 100%;background-repeat: no-repeat;`
"
>
<div
class=
"nav"
>
<div
class=
"nav"
>
<van-icon
<van-icon
name=
"arrow-left"
name=
"arrow-left"
...
@@ -8,12 +13,13 @@
...
@@ -8,12 +13,13 @@
color=
"#ffffff"
color=
"#ffffff"
@
click=
"handlerBack"
@
click=
"handlerBack"
/>
/>
<
img
:src=
"imgSrc"
alt=
""
class=
"imgCode"
/
>
<
!--
<img
:src=
"imgSrc"
alt=
""
class=
"imgCode"
/>
--
>
</div>
</div>
<van-button
type
@
click=
"onSave"
>
保存
</van-button>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
inviteCode
}
from
"@/api/invite"
;
//
import { inviteCode } from "@/api/invite";
export
default
{
export
default
{
name
:
"Invite"
,
name
:
"Invite"
,
data
()
{
data
()
{
...
@@ -25,6 +31,10 @@ export default {
...
@@ -25,6 +31,10 @@ export default {
this
.
inviteCode
();
this
.
inviteCode
();
},
},
methods
:
{
methods
:
{
onSave
()
{
const
url
=
this
.
imgSrc
;
this
.
$bridgeToAppFun
.
saveImage
(
url
);
},
handlerBack
()
{
handlerBack
()
{
try
{
try
{
this
.
$bridgeToAppFun
.
navigateBack
();
this
.
$bridgeToAppFun
.
navigateBack
();
...
@@ -34,16 +44,17 @@ export default {
...
@@ -34,16 +44,17 @@ export default {
}
}
},
},
inviteCode
()
{
inviteCode
()
{
const
_this
=
this
;
//
const _this = this;
let
loading
=
_this
.
$toast
.
loading
({
//
let loading = _this.$toast.loading({
forbidClick
:
true
,
//
forbidClick: true,
message
:
"加载中..."
//
message: "加载中..."
});
//
});
const
userId
=
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
;
const
userId
=
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
;
inviteCode
(
userId
).
then
(
res
=>
{
// inviteCode(userId).then(res => {
if
(
loading
)
_this
.
$toast
.
clear
();
// if (loading) _this.$toast.clear();
_this
.
imgSrc
=
_this
.
getUserPhoto
(
res
);
// _this.imgSrc = _this.getUserPhoto(res);
});
// });
this
.
imgSrc
=
`
${
process
.
env
.
VUE_APP_BASE_URL
}
/shop-mall/api/user/registerByQrCode?height=150&userId=
${
userId
}
&width=150`
;
},
},
getUserPhoto
(
res
)
{
getUserPhoto
(
res
)
{
let
uInt8Array
=
new
Uint8Array
(
res
);
let
uInt8Array
=
new
Uint8Array
(
res
);
...
@@ -64,9 +75,21 @@ export default {
...
@@ -64,9 +75,21 @@ export default {
.invite-code
{
.invite-code
{
width
:
100%
;
width
:
100%
;
height
:
100vh
;
height
:
100vh
;
background
:
url("../assets/images/invite_1.png")
;
background-repeat
:
no-repeat
;
.van-button
{
background-size
:
100%
100%
;
position
:
absolute
;
left
:
50%
;
bottom
:
100px
;
transform
:
translateX
(
-50%
);
width
:
160px
;
height
:
36px
;
font-size
:
18px
;
color
:
#ffffff
;
background-color
:
#88c678
;
border
:
none
;
border-radius
:
4px
;
}
.imgCode
{
.imgCode
{
position
:
absolute
;
position
:
absolute
;
width
:
60px
;
width
:
60px
;
...
...
H5/src/views/settings.vue
View file @
e1abf1ac
...
@@ -14,7 +14,12 @@
...
@@ -14,7 +14,12 @@
:value=
"inviteeCode"
:value=
"inviteeCode"
@
click=
"fillInviterCode"
@
click=
"fillInviterCode"
/>
/>
<van-cell
is-link
title=
"软件更新"
value=
"版本v1.2"
/>
<van-cell
is-link
title=
"软件更新"
:value=
"version"
@
click=
"updateVersion"
/>
<van-cell
is-link
title=
"用户协议"
@
click=
"jumpToInstructions"
/>
<van-cell
is-link
title=
"用户协议"
@
click=
"jumpToInstructions"
/>
</van-cell-group>
</van-cell-group>
...
@@ -42,10 +47,22 @@
...
@@ -42,10 +47,22 @@
/>
/>
</div>
</div>
</base-dialog>
</base-dialog>
<base-dialog
base-dialog-title=
"版本更新"
:base-dialog-show=
"versionShow"
:base-dialog-btn=
"updateBtn"
@
onClick=
"onUpdateVersion"
>
<div
slot=
"content"
class=
"update-content"
>
<span
class=
"update-tip"
>
{{
updateResult
}}
</span>
</div>
</base-dialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
versionUpdate
}
from
"@/api/base"
;
import
{
getUserInfo2
}
from
"@/api/user"
;
import
{
getUserInfo2
}
from
"@/api/user"
;
import
{
logout
}
from
"@/api/user"
;
import
{
logout
}
from
"@/api/user"
;
import
{
fillInviteCode
}
from
"@/api/user"
;
import
{
fillInviteCode
}
from
"@/api/user"
;
...
@@ -55,6 +72,12 @@ export default {
...
@@ -55,6 +72,12 @@ export default {
name
:
"Settings"
,
name
:
"Settings"
,
data
()
{
data
()
{
return
{
return
{
downAppUrl
:
""
,
needUpdate
:
false
,
updateBtn
:
"关闭"
,
updateResult
:
""
,
versionShow
:
false
,
version
:
""
,
userName
:
""
,
userName
:
""
,
imageBaseUrl
:
""
,
imageBaseUrl
:
""
,
headImage
:
""
,
headImage
:
""
,
...
@@ -68,8 +91,33 @@ export default {
...
@@ -68,8 +91,33 @@ export default {
mounted
()
{
mounted
()
{
this
.
imageBaseUrl
=
process
.
env
.
VUE_APP_BASE_URL
;
this
.
imageBaseUrl
=
process
.
env
.
VUE_APP_BASE_URL
;
this
.
getUser
();
this
.
getUser
();
this
.
getAppVersion
();
},
},
methods
:
{
methods
:
{
onUpdateVersion
()
{
if
(
this
.
needUpdate
)
{
location
.
href
=
this
.
downAppUrl
;
}
else
{
this
.
versionShow
=
false
;
}
},
updateVersion
()
{
versionUpdate
(
this
.
version
).
then
(
res
=>
{
this
.
versionShow
=
true
;
if
(
res
.
data
===
"当前已是最新版本!"
)
{
this
.
updateResult
=
res
.
data
;
this
.
needUpdate
=
false
;
}
else
{
this
.
downAppUrl
=
res
.
data
;
this
.
updateResult
=
"最新版App下载地址:"
+
res
.
data
;
this
.
updateBtn
=
"下载最新版App"
;
this
.
needUpdate
=
true
;
}
});
},
getAppVersion
()
{
this
.
version
=
"版本"
+
this
.
$bridgeToAppFun
.
getAppVersion
();
},
getUser
()
{
getUser
()
{
const
params
=
{
const
params
=
{
userId
:
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
userId
:
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
userId
...
@@ -188,4 +236,15 @@ export default {
...
@@ -188,4 +236,15 @@ export default {
background-color
:
#f9f9f9
;
background-color
:
#f9f9f9
;
border-radius
:
20px
;
border-radius
:
20px
;
}
}
.update-content
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
100%
;
}
.update-tip
{
width
:
90%
;
font-size
:
18px
;
word-break
:
break-all
;
}
</
style
>
</
style
>
H5/vue.config.js
View file @
e1abf1ac
...
@@ -4,7 +4,7 @@ const name = "西田森App";
...
@@ -4,7 +4,7 @@ const name = "西田森App";
module
.
exports
=
{
module
.
exports
=
{
publicPath
:
"/front"
,
publicPath
:
"/front"
,
//
outputDir: "front",
outputDir
:
"front"
,
devServer
:
{
devServer
:
{
proxy
:
{
proxy
:
{
'/shop-mall'
:
{
'/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