Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mongo-ui
Commits
1abb06c4
Commit
1abb06c4
authored
Aug 04, 2020
by
郭志伟
Committed by
郝聪敏
Aug 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 顾问联调
parent
19b4137b
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
227 additions
and
131 deletions
+227
-131
App.vue
src/App.vue
+4
-1
user.js
src/api/user.js
+1
-1
AuthFromXyqb.vue
src/components/AuthFromXyqb.vue
+41
-0
LoginModal.vue
src/components/LoginModal.vue
+2
-1
dev.config.js
src/config/dev.config.js
+2
-1
index.js
src/router/index.js
+21
-109
routes.js
src/router/routes.js
+106
-0
utils.js
src/service/utils.js
+24
-16
validation.js
src/service/validation.js
+6
-1
index.js
src/store/index.js
+8
-1
index.less
src/views/Consultant/Buy/index.less
+1
-0
index.less
src/views/Consultant/Question/index.less
+7
-0
index.vue
src/views/Consultant/Question/index.vue
+4
-0
No files found.
src/App.vue
View file @
1abb06c4
...
...
@@ -5,14 +5,17 @@
<cr-loading
class=
"loading"
size=
"24px"
>
加载中...
</cr-loading>
</div>
<login-modal
/>
<auth-from-xyqb
/>
</div>
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
import
LoginModal
from
"
@/components/LoginModal
"
;
import
AuthFromXyqb
from
"
@/components/AuthFromXyqb
"
;
export
default
{
components
:
{
LoginModal
LoginModal
,
AuthFromXyqb
},
computed
:
{
...
mapState
([
"
isLoading
"
])
...
...
src/api/user.js
View file @
1abb06c4
...
...
@@ -6,7 +6,7 @@ export const loginByPhone = param => {
};
// 信用钱包用户自动登录
export
const
login
Byxyqb
=
param
=>
{
export
const
auth
Byxyqb
=
param
=>
{
return
req
.
get
(
"
xyqb_user_info
"
,
param
);
};
...
...
src/components/AuthFromXyqb.vue
0 → 100644
View file @
1abb06c4
<
template
>
<cr-popup
v-model=
"showAuthXyqb"
get-container=
"body"
round
closeable
position=
"bottom"
class=
"auth"
>
111
</cr-popup>
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
{
authByxyqb
}
from
"
@/api/user
"
;
export
default
{
name
:
"
AuthFromXyqb
"
,
data
()
{
return
{};
},
computed
:
{
...
mapState
([
"
showAuthXyqb
"
])
},
methods
:
{
...
mapActions
([
"
setShowAuthXyqb
"
]),
async
getAuthInfo
()
{
const
res
=
await
authByxyqb
();
if
(
res
)
{
localStorage
.
set
(
"
mongoToken
"
,
res
.
token
);
localStorage
.
set
(
"
xyqbUserInfo
"
,
res
);
}
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
@import "../style/var.less";
</
style
>
src/components/LoginModal.vue
View file @
1abb06c4
...
...
@@ -85,7 +85,8 @@ export default {
if
(
res
)
{
this
.
$notify
(
"
登录成功
"
);
this
.
setIsShowLogin
(
false
);
localStorage
.
setItem
(
"
mongoToken
"
,
res
.
token
);
// localStorage.setItem("mongoToken", res.token);
localStorage
.
setItem
(
"
mongoToken
"
,
"
6ae7da7dd4c543f1a36c702c6f419f12
"
);
}
},
async
getCode
()
{
...
...
src/config/dev.config.js
View file @
1abb06c4
export
default
{
basicHost
:
"
http://yapi.quantgroups.com/mock/329/
"
,
// basicHost: "http://yapi.quantgroups.com/mock/329/",
basicHost
:
"
http://192.168.29.211:80/
"
,
wxAppId
:
"
wx514de17b23d53a20
"
};
src/router/index.js
View file @
1abb06c4
import
Vue
from
"
vue
"
;
import
VueRouter
from
"
vue-router
"
;
import
routes
from
"
./routes
"
;
import
{
parseSearch
}
from
"
@/service/utils
"
;
import
{
isXyqb
}
from
"
@/service/validation
"
;
import
{
authByxyqb
}
from
"
@/api/user
"
;
import
localStorage
from
"
@/service/localStorage
"
;
Vue
.
use
(
VueRouter
);
const
routes
=
[
{
path
:
"
/
"
,
name
:
"
Default
"
,
redirect
:
"
/goods
"
},
{
path
:
"
/home
"
,
name
:
"
Home
"
,
component
:
()
=>
import
(
"
../views/Home/index.vue
"
)
},
{
path
:
"
/home/smart-measure
"
,
name
:
"
SmartMeasure
"
,
component
:
()
=>
import
(
"
../views/Home/SmartMeasure/index.vue
"
)
},
{
path
:
"
/goods
"
,
name
:
"
Goods
"
,
component
:
()
=>
import
(
"
../views/Goods/index.vue
"
)
},
{
path
:
"
/goods/detail
"
,
name
:
"
GoodsDetail
"
,
component
:
()
=>
import
(
"
../views/Goods/Detail/index.vue
"
)
},
{
path
:
"
/goods/plan
"
,
name
:
"
GoodsPlan
"
,
component
:
()
=>
import
(
"
../views/Goods/Plan/index.vue
"
)
},
{
path
:
"
/goods/inform
"
,
name
:
"
GoodsInform
"
,
component
:
()
=>
import
(
"
../views/Goods/Inform/index.vue
"
)
},
{
path
:
"
/consultant
"
,
name
:
"
Consultant
"
,
component
:
()
=>
import
(
"
../views/Consultant/index.vue
"
)
},
{
path
:
"
/consultant/plan
"
,
name
:
"
ConsultantPlan
"
,
component
:
()
=>
import
(
"
../views/Consultant/Plan/index.vue
"
)
},
{
path
:
"
/user
"
,
name
:
"
User
"
,
component
:
()
=>
import
(
"
../views/User/index.vue
"
)
},
{
path
:
"
/user/family
"
,
name
:
"
Family
"
,
component
:
()
=>
import
(
"
../views/User/Family/index.vue
"
)
},
{
path
:
"
/user/family/detail/:id
"
,
name
:
"
Family
"
,
component
:
()
=>
import
(
"
../views/User/Family/Detail/index.vue
"
)
},
{
path
:
"
/user/help-center
"
,
name
:
"
Family
"
,
component
:
()
=>
import
(
"
../views/User/HelpCenter/index.vue
"
)
},
{
path
:
"
/policy
"
,
name
:
"
Policy
"
,
component
:
()
=>
import
(
"
../views/Policy/index.vue
"
)
},
{
path
:
"
/policy/detail
"
,
name
:
"
Detail
"
,
component
:
()
=>
import
(
"
../views/Policy/Detail/index.vue
"
)
},
{
path
:
"
/policy/add
"
,
name
:
"
AddPolicy
"
,
component
:
()
=>
import
(
"
../views/Policy/Add/index.vue
"
)
},
{
path
:
"
/policy/payment-record
"
,
name
:
"
PaymentRecord
"
,
component
:
()
=>
import
(
"
../views/Policy/PaymentRecord/index.vue
"
)
},
{
path
:
"
/policy/renewal
"
,
name
:
"
Renewal
"
,
component
:
()
=>
import
(
"
../views/Policy/Renewal/index.vue
"
)
},
{
path
:
"
/introduction
"
,
name
:
"
Introduction
"
,
component
:
()
=>
import
(
"
../views/Introduction/index.vue
"
)
},
{
path
:
"
/paytest
"
,
name
:
"
Introduction
"
,
component
:
()
=>
import
(
"
../views/paytest
"
)
},
{
path
:
"
*
"
,
redirect
:
"
/goods
"
}
];
const
originalPush
=
VueRouter
.
prototype
.
push
;
VueRouter
.
prototype
.
push
=
function
push
(
location
)
{
return
originalPush
.
call
(
this
,
location
).
catch
(
err
=>
err
);
};
...
...
@@ -125,4 +21,20 @@ const router = new VueRouter({
}
});
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
const
urlParams
=
parseSearch
(
window
.
location
.
href
);
if
(
isXyqb
())
getAuthInfo
(
urlParams
.
token
);
next
();
});
async
function
getAuthInfo
(
xyqbToken
)
{
const
res
=
await
authByxyqb
({
xyqbToken
});
if
(
res
)
{
localStorage
.
set
(
"
mongoToken
"
,
res
.
token
);
localStorage
.
set
(
"
xyqbUserInfo
"
,
res
);
localStorage
.
set
(
"
xyqbToken
"
,
xyqbToken
);
}
}
// router.afterEach(() => {});
export
default
router
;
src/router/routes.js
0 → 100644
View file @
1abb06c4
export
default
[
{
path
:
"
/
"
,
name
:
"
Default
"
,
redirect
:
"
/goods
"
},
{
path
:
"
/home
"
,
name
:
"
Home
"
,
component
:
()
=>
import
(
"
../views/Home/index.vue
"
)
},
{
path
:
"
/home/smart-measure
"
,
name
:
"
SmartMeasure
"
,
component
:
()
=>
import
(
"
../views/Home/SmartMeasure/index.vue
"
)
},
{
path
:
"
/goods
"
,
name
:
"
Goods
"
,
component
:
()
=>
import
(
"
../views/Goods/index.vue
"
)
},
{
path
:
"
/goods/detail
"
,
name
:
"
GoodsDetail
"
,
component
:
()
=>
import
(
"
../views/Goods/Detail/index.vue
"
)
},
{
path
:
"
/goods/plan
"
,
name
:
"
GoodsPlan
"
,
component
:
()
=>
import
(
"
../views/Goods/Plan/index.vue
"
)
},
{
path
:
"
/goods/inform
"
,
name
:
"
GoodsInform
"
,
component
:
()
=>
import
(
"
../views/Goods/Inform/index.vue
"
)
},
{
path
:
"
/consultant
"
,
name
:
"
Consultant
"
,
component
:
()
=>
import
(
"
../views/Consultant/index.vue
"
)
},
{
path
:
"
/consultant/plan
"
,
name
:
"
ConsultantPlan
"
,
component
:
()
=>
import
(
"
../views/Consultant/Plan/index.vue
"
)
},
{
path
:
"
/user
"
,
name
:
"
User
"
,
component
:
()
=>
import
(
"
../views/User/index.vue
"
)
},
{
path
:
"
/user/family
"
,
name
:
"
Family
"
,
component
:
()
=>
import
(
"
../views/User/Family/index.vue
"
)
},
{
path
:
"
/user/family/detail/:id
"
,
name
:
"
Family
"
,
component
:
()
=>
import
(
"
../views/User/Family/Detail/index.vue
"
)
},
{
path
:
"
/user/help-center
"
,
name
:
"
Family
"
,
component
:
()
=>
import
(
"
../views/User/HelpCenter/index.vue
"
)
},
{
path
:
"
/policy
"
,
name
:
"
Policy
"
,
component
:
()
=>
import
(
"
../views/Policy/index.vue
"
)
},
{
path
:
"
/policy/detail
"
,
name
:
"
Detail
"
,
component
:
()
=>
import
(
"
../views/Policy/Detail/index.vue
"
)
},
{
path
:
"
/policy/add
"
,
name
:
"
AddPolicy
"
,
component
:
()
=>
import
(
"
../views/Policy/Add/index.vue
"
)
},
{
path
:
"
/policy/payment-record
"
,
name
:
"
PaymentRecord
"
,
component
:
()
=>
import
(
"
../views/Policy/PaymentRecord/index.vue
"
)
},
{
path
:
"
/policy/renewal
"
,
name
:
"
Renewal
"
,
component
:
()
=>
import
(
"
../views/Policy/Renewal/index.vue
"
)
},
{
path
:
"
/introduction
"
,
name
:
"
Introduction
"
,
component
:
()
=>
import
(
"
../views/Introduction/index.vue
"
)
},
{
path
:
"
/paytest
"
,
name
:
"
Introduction
"
,
component
:
()
=>
import
(
"
../views/paytest
"
)
},
{
path
:
"
*
"
,
redirect
:
"
/goods
"
}
];
src/service/utils.js
View file @
1abb06c4
...
...
@@ -100,23 +100,31 @@ export function filterEmoji(name) {
);
return
str
;
}
/**
*
xss处理
* @param {String} s 输入字符串
*
hash路由获取url参数
* @param {String} s
earchString
输入字符串
* @return: {String} str 字符串
*/
export
function
xssParse
(
str
)
{
return
str
?
str
.
replace
(
/&
((
g|l|quo
)
t|amp|#39|nbsp
)
;/g
,
function
(
m
)
{
return
{
"
<
"
:
"
<
"
,
"
&
"
:
"
&
"
,
"
"
"
:
'
"
'
,
"
>
"
:
"
>
"
,
"
'
"
:
"
'
"
,
"
"
:
"
"
}[
m
];
})
:
""
;
export
function
parseSearch
(
searchString
)
{
if
(
!
searchString
)
{
return
{};
}
if
(
!
searchString
.
includes
(
"
?
"
))
{
return
{};
}
return
searchString
.
split
(
"
?
"
)[
1
]
.
split
(
"
#
"
)[
0
]
.
split
(
"
&
"
)
.
reduce
((
result
,
next
)
=>
{
const
pair
=
next
.
split
(
"
=
"
);
try
{
result
[
decodeURIComponent
(
pair
[
0
])]
=
decodeURIComponent
(
pair
[
1
]);
}
catch
(
e
)
{
// eslint-disable-next-line
// result[decodeURIComponent(pair[0])] = window.$URL.decode(pair[1]);
}
return
result
;
},
{});
}
src/service/validation.js
View file @
1abb06c4
...
...
@@ -252,5 +252,10 @@ export function isBankNumber(str) {
// 判断微信环境
export
function
isWeixinBrower
()
{
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
match
(
/MicroMessenger/i
)
==
"
micromessenger
"
;
return
ua
.
match
(
/MicroMessenger/i
)
===
"
micromessenger
"
;
}
// 判断信用钱包环境
export
function
isXyqb
()
{
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
match
(
/xyqb/i
)
===
"
xyqb
"
;
}
src/store/index.js
View file @
1abb06c4
...
...
@@ -8,7 +8,8 @@ export default new Vuex.Store({
state
:
{
activeIdx
:
0
,
isLoading
:
false
,
isShowLogin
:
false
isShowLogin
:
false
,
showAuthXyqb
:
true
},
mutations
:
{
setActiveIdx
(
state
,
value
)
{
...
...
@@ -19,6 +20,9 @@ export default new Vuex.Store({
},
setIsShowLogin
(
state
,
value
)
{
state
.
isShowLogin
=
value
;
},
setShowAuthXyqb
(
state
,
value
)
{
state
.
showAuthXyqb
=
value
;
}
},
actions
:
{
...
...
@@ -30,6 +34,9 @@ export default new Vuex.Store({
},
setIsShowLogin
({
commit
},
args
)
{
commit
(
"
setIsShowLogin
"
,
args
);
},
setShowAuthXyqb
({
commit
},
args
)
{
commit
(
"
setShowAuthXyqb
"
,
args
);
}
},
modules
:
{
...
...
src/views/Consultant/Buy/index.less
View file @
1abb06c4
...
...
@@ -66,6 +66,7 @@
background-color: #fff;
&-title {
.sub-text-mixins();
text-align: center;
}
.cr-button {
height: @button-large-height + 2;
...
...
src/views/Consultant/Question/index.less
View file @
1abb06c4
...
...
@@ -16,9 +16,15 @@
text-align: center;
a {
.sub-text-mixins();
display: block;
margin-top: 15px;
}
}
&-body {
height: 230px;
@{deep} .cr-picker--content-choose {
display: none;
}
@{deep} .wheel-item {
font-size: 16px;
}
...
...
@@ -71,6 +77,7 @@
margin-top: 8px;
color: @gray-4;
width: 100%;
height: 32px;
}
.cul-inline {
@{deep} .cr-radio {
...
...
src/views/Consultant/Question/index.vue
View file @
1abb06c4
...
...
@@ -40,6 +40,7 @@
}
"
v-show=
"currentStep === 1"
item-height=
"35"
:show-toolbar=
"false"
/>
<cr-radio-btn
...
...
@@ -57,6 +58,7 @@
}
"
v-show=
"currentStep === 3"
item-height=
"35"
:show-toolbar=
"false"
/>
<cr-picker
...
...
@@ -68,6 +70,7 @@
}
"
v-show=
"currentStep === 4"
item-height=
"35"
:show-toolbar=
"false"
/>
<cr-area
...
...
@@ -79,6 +82,7 @@
}
"
:columns-num=
"2"
item-height=
"35"
v-show=
"currentStep === 5"
/>
<cr-radio-btn
...
...
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