Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
scrm-equity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1845651a
authored
Aug 03, 2021
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加mock配置
1 parent
9cf2c04b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
127 additions
and
90 deletions
package-lock.json
src/api/axios.js
src/api/request.js
src/api/sign.js
src/main.js
src/views/equity/index.vue
package-lock.json
View file @
1845651
This diff could not be displayed because it is too large.
src/api/axios.js
View file @
1845651
...
...
@@ -8,7 +8,7 @@ import {
import
store
from
'@/store'
axios
.
defaults
.
withCredentials
=
true
const
service
=
axios
.
create
({
baseURL
:
process
.
env
.
VUE_APP_API
,
//
baseURL: process.env.VUE_APP_API,
timeout
:
60
*
1000
,
// 请求超时时间
transformRequest
:
[
function
(
data
)
{
return
Qs
.
stringify
(
data
)
...
...
@@ -48,7 +48,7 @@ service.interceptors.response.use(
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
)
{
window
.
vm
.
$router
.
replace
({
name
:
'common.phoneLogin'
})
}
else
{
}
else
{
let
equipmentType
=
""
let
agent
=
navigator
.
userAgent
.
toLowerCase
()
let
android
=
agent
.
indexOf
(
"android"
)
...
...
src/api/request.js
View file @
1845651
...
...
@@ -2,27 +2,28 @@ import axios from './axios'
import
sign
from
'./sign'
import
RequestMethods
from
'./RequestMethods'
import
store
from
'@/store'
const
request
=
(
params
=
{},
url
,
method
=
RequestMethods
.
POST
,
noSignAttr
=
[])
=>
{
params
.
method
=
url
.
trimStart
().
trimEnd
()
const
request
=
(
params
=
{},
target
,
method
=
RequestMethods
.
POST
,
noSignAttr
=
[])
=>
{
params
.
method
=
target
.
trimStart
().
trimEnd
()
// params.source = 'h5'
params
.
source
=
1
params
.
appKey
=
process
.
env
.
VUE_APP_KEY
params
.
appKey
=
window
.
$baseConfig
.
axios
.
appKey
params
.
timestamp
=
new
Date
().
getTime
()
// params.timestamp = new Date().format('yyyy-MM-dd hh:mm:ss')
params
.
v
=
'1.0.0'
params
.
format
=
'json'
params
.
locale
=
'zh_CN'
let
{
sessionId
}
=
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)
?
JSON
.
parse
(
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)):
store
.
state
let
{
sessionId
}
=
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)
?
JSON
.
parse
(
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
))
:
store
.
state
if
(
sessionId
)
params
.
sessionId
=
sessionId
const
url
=
window
.
$baseConfig
.
axios
.
baseURL
if
(
method
==
'post'
)
{
return
axios
({
url
,
method
,
data
:
sign
(
params
,
noSignAttr
)
})
}
else
{
return
axios
({
url
,
method
,
params
:
sign
(
params
,
noSignAttr
)
})
...
...
src/api/sign.js
View file @
1845651
import
sha1
from
'sha1'
import
qs
from
'qs'
const
secret
=
process
.
env
.
VUE_APP_SECRET
const
sign
=
(
params
,
noSignAttr
=
[])
=>
{
delete
params
.
sign
var
objStr
=
qs
.
stringify
(
params
,
{
arrayFormat
:
'indices'
,
encode
:
false
,
allowDots
:
true
})
...
...
@@ -13,7 +12,7 @@ const sign = (params, noSignAttr = []) => {
realObj
[
item
.
split
(
'='
)[
0
]]
=
item
.
split
(
'='
)[
1
]
}
})
const
secret
=
window
.
$baseConfig
.
axios
.
secret
const
keys
=
Object
.
keys
(
realObj
).
sort
()
var
str
=
[]
var
obj
=
null
...
...
src/main.js
View file @
1845651
...
...
@@ -7,6 +7,7 @@ import 'vant/lib/index.css'
import
VueWechatTitle
from
'vue-wechat-title'
import
'@a/scss/common.scss'
import
store
from
"./store"
import
axios
from
'axios'
Vue
.
use
(
VueWechatTitle
)
Vue
.
use
(
Vant
)
import
VConsole
from
'vconsole'
...
...
@@ -17,8 +18,18 @@ import 'vue-photo-preview/dist/skin.css'
Vue
.
use
(
preview
)
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
isMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
window
.
vm
=
new
Vue
({
router
,
store
,
render
:
h
=>
h
(
App
)
}).
$mount
(
'#app'
)
axios
({
baseURL
:
process
.
env
.
VUE_APP_REPO
+
'/scrm-equity-mobile-config'
,
method
:
'get'
}).
then
(({
data
:
config
})
=>
{
window
.
$baseConfig
=
config
window
.
vm
=
new
Vue
({
router
,
store
,
render
:
h
=>
{
return
h
(
App
)
}
}).
$mount
(
'#app'
)
})
\ No newline at end of file
src/views/equity/index.vue
View file @
1845651
<
template
>
<div
class=
"main"
:class=
"[
<div
class=
"main"
:class=
"[
showFollowAccount ? 'main-top' : ''
]"
>
<div
class=
"follow-wechat-account"
v-if=
"showFollowAccount"
>
]"
>
<div
class=
"follow-wechat-account"
v-if=
"showFollowAccount"
>
<span>
权益服务可通过公众号随时随地使用
</span>
<button
class=
"follow-btn"
@
click=
"followAccount"
>
关注公众号
</button>
<button
class=
"follow-btn"
@
click=
"followAccount"
>
关注公众号
</button>
</div>
<div
class=
"card-box"
>
<div
class=
"sprite-icon icon-banner"
>
...
...
@@ -15,25 +24,34 @@
<div
class=
"card_user"
>
<div
class=
"user_info"
>
<img
:src=
"userInfo.logo"
v-if=
"userInfo.logo"
class=
"user_img"
:src=
"userInfo.logo"
v-if=
"userInfo.logo"
class=
"user_img"
>
<div
v-else
class=
"sprite-icon icon-default-avatar"
v-else
class=
"sprite-icon icon-default-avatar"
></div>
<span
class=
"user_name"
>
{{
nickName
?
nickName
:
userInfo
.
memberName
}}
</span>
</div>
<div
class=
"user_func"
>
<span
class=
"user_func_link"
@
click=
"jumpOrder"
>
权益订单
</span>
<span
class=
"user_func_link"
@
click=
"jumpJiangli"
>
查看奖励
</span>
<span
class=
"user_func_link"
@
click=
"jumpOrder"
>
权益订单
</span>
<span
class=
"user_func_link"
@
click=
"jumpJiangli"
>
查看奖励
</span>
</div>
</div>
</div>
</div>
<div
class=
"card-box box_between"
>
<div
class=
"invite_box invite_bg"
@
click=
"jumpInvite"
>
<div
class=
"invite_box invite_bg"
@
click=
"jumpInvite"
>
<span
class=
"invite_btn"
>
我要分享
</span>
<p>
享推广佣金奖励
</p>
</div>
...
...
@@ -49,12 +67,15 @@
<div
class=
"items"
>
<template
v-for=
"(i,index) in carServiceList"
>
<div
class=
"item"
:key=
"index"
@
click=
"CarLink(i)"
class=
"item"
:key=
"index"
@
click=
"CarLink(i)"
>
<div
class=
"icon-goods"
>
<img
:src=
"i.equityIcon"
alt=
""
>
<img
:src=
"i.equityIcon"
alt=
""
>
</div>
<div
class=
"item-name text-hide"
>
{{
i
.
equityName
}}
</div>
<div
class=
"item-des text-hide"
>
{{
i
.
equityDesc
}}
</div>
...
...
@@ -66,20 +87,28 @@
<div
class=
"box equity_box"
>
<div
class=
"bar_title"
><span>
更多权益
</span></div>
<div
class=
"scroll-items"
>
<ul
class=
"tab_list"
>
<li
:class=
"goodsTab === index?'active':''"
@
click=
"changeGoods(index)"
v-for=
"(item,index) in goodsServiceList"
:key=
"index"
>
{{item.goodsCategory}}
</li>
<ul
class=
"tab_list"
>
<li
:class=
"goodsTab === index?'active':''"
@
click=
"changeGoods(index)"
v-for=
"(item,index) in goodsServiceList"
:key=
"index"
>
{{item.goodsCategory}}
</li>
</ul>
</div>
<div
class=
"tab_content"
>
<div
class=
"items items_5_1"
>
<
template
v-for=
"(i,index) in equityGoodsGroupDescDtos"
>
<div
class=
"item"
:key=
"index"
@
click=
"jumpLink(i)"
class=
"item"
:key=
"index"
@
click=
"jumpLink(i)"
>
<div
class=
"icon-goods"
>
<img
:src=
"i.equityIcon"
alt=
""
>
<img
:src=
"i.equityIcon"
alt=
""
>
</div>
<div
class=
"item-name"
>
{{
i
.
equityName
}}
</div>
<div
class=
"item-des"
>
{{
i
.
equityDesc
}}
</div>
...
...
@@ -100,7 +129,7 @@ export default {
data
()
{
return
{
userInfo
:
{},
nickName
:
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)
?
JSON
.
parse
(
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)).
nickName
:
''
,
nickName
:
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)
?
JSON
.
parse
(
sessionStorage
.
getItem
(
'GL_EQUITY_USER_INFO'
)).
nickName
:
''
,
showFollowAccount
:
false
,
icon
:
require
(
`@a/images/notice.png`
),
activeTab
:
'drink'
,
...
...
@@ -116,7 +145,7 @@ export default {
this
.
hideLoading
()
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
if
(
data
.
isConcern
==
0
)
{
if
(
data
.
isConcern
==
0
)
{
this
.
showFollowAccount
=
true
;
}
data
.
time
=
new
Date
(
data
.
validitDate
).
format
(
'yyyy-MM-dd'
);
...
...
@@ -129,7 +158,7 @@ export default {
const
urlObj
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'URL_PARAM'
))
let
URLParams
=
{}
if
(
urlObj
&&
urlObj
.
merchantId
)
{
if
(
urlObj
&&
urlObj
.
merchantId
)
{
URLParams
.
merchantId
=
urlObj
.
merchantId
}
...
...
@@ -137,7 +166,7 @@ export default {
let
{
code
,
data
}
=
res
this
.
hideLoading
()
if
(
code
==
0
)
{
if
(
data
)
{
if
(
data
)
{
this
.
inviteUrl
=
data
.
posterUrl
this
.
jiangliUrl
=
data
.
commissionUrl
}
...
...
@@ -155,37 +184,37 @@ export default {
},
methods
:
{
followAccount
()
{
window
.
location
.
href
=
process
.
env
.
VUE_APP_WECHAT_ACCOUNT
;
followAccount
()
{
window
.
location
.
href
=
window
.
$baseConfig
.
axios
.
VUE_APP_WECHAT_ACCOUNT
;
},
jumpHotel
()
{
let
url
=
'http://m.s11.cn/tehui/sz/?order_cust_id=4892038'
this
.
openWindows
(
url
)
},
jumpOrder
()
{
jumpOrder
()
{
let
{
sessionId
}
=
this
.
$store
.
state
;
let
[
href
]
=
window
.
location
.
href
.
split
(
'/#/'
);
let
url
=
`
${
href
}
/#/cardRoll/index?sessionId=
${
sessionId
}
`
;
this
.
openWindows
(
url
,
'cardRoll.index'
)
},
jumpOpenShop
()
{
jumpOpenShop
()
{
this
.
openWindows
(
'https://www.wjx.cn/m/89882107.aspx'
)
},
jumpJiangli
()
{
if
(
this
.
jiangliUrl
)
{
jumpJiangli
()
{
if
(
this
.
jiangliUrl
)
{
this
.
openWindows
(
this
.
jiangliUrl
)
}
else
{
}
else
{
this
.
showToast
(
'尚未配置活动参数'
)
}
},
jumpInvite
()
{
if
(
this
.
inviteUrl
)
{
jumpInvite
()
{
if
(
this
.
inviteUrl
)
{
this
.
openWindows
(
this
.
inviteUrl
)
}
else
{
}
else
{
this
.
showToast
(
'尚未配置活动参数'
)
}
},
willComeDialog
()
{
willComeDialog
()
{
this
.
showToast
(
'即将上线,敬请期待'
)
}
}
...
...
@@ -202,7 +231,7 @@ body {
width
:
46px
;
height
:
46px
;
margin-bottom
:
4px
;
>img
{
>
img
{
border-radius
:
50%
;
}
}
...
...
@@ -235,7 +264,7 @@ body {
}
.card-box
{
padding
:
20px
0
0
;
&:first-child{
&:first-child
{
padding-top
:
0
;
}
.card
{
...
...
@@ -277,86 +306,83 @@ body {
}
}
.card_num
{
.card_num
{
padding
:
30px
40px
10px
;
display
:
flex
;
justify-content
:
space-between
;
}
.card_user
{
.card_user
{
padding
:
5px
40px
10px
;
display
:
flex
;
.user_info{
.user_info
{
display
:
flex
;
align-items
:
center
;
flex
:
1
;
align-self
:
flex-start
;
.user_img{
.user_img
{
width
:
50px
;
height
:
50px
;
}
.user_name
{
.user_name
{
padding
:
0
10px
;
font-size
:
16px
;
flex
:
1
;
word-break
:
break-word
;
}
}
.user_func
{
.user_func
{
display
:
flex
;
flex-direction
:
column
;
.user_func_link{
.user_func_link
{
font-size
:
12px
;
background
:
#
DCA
700
;
background
:
#
dca
700
;
color
:
#ffffff
;
border-radius
:
12px
;
padding
:
3px
10px
;
margin
:
10px
;
&.hide{
visibility
:
hidden
&.hide
{
visibility
:
hidden
;
}
}
}
}
.invite_box
{
.invite_box
{
width
:
350px
;
height
:
135px
;
background-size
:
100%
100%
;
box-shadow
:
0
2px
8px
0
rgba
(
0
,
55
,
170
,
0.09
);
.invite_btn{
box-shadow
:
0
2px
8px
0
rgba
(
0
,
55
,
170
,
0.09
);
.invite_btn
{
display
:
inline-block
;
border
:
1px
solid
#6
A
0000
;
border
:
1px
solid
#6
a
0000
;
padding
:
2px
8px
;
border-radius
:
14px
;
color
:
#6
A
0000
;
color
:
#6
a
0000
;
margin
:
20px
0
10px
10px
;
&.hide{
&.hide
{
visibility
:
hidden
;
}
}
&
>
p
{
color
:
#
B
00000
;
&
>
p
{
color
:
#
b
00000
;
font-size
:
12px
;
margin
:
0px
0
0
10px
;
}
&
.invite_bg
{
background-image
:
url(
'~@a/images/invite_bg_lg.png'
)
;
&
.invite_bg
{
background-image
:
url(
"~@a/images/invite_bg_lg.png"
)
;
}
&
.openshop_bg
{
background-image
:
url(
'~@a/images/openshop_bg.png'
)
;
.invite_btn{
border-color
:
#002
D4E
;
color
:
#002
D4E
;
&
.openshop_bg
{
background-image
:
url(
"~@a/images/openshop_bg.png"
)
;
.invite_btn
{
border-color
:
#002
d4e
;
color
:
#002
d4e
;
}
&
>
p
{
color
:
#004
F8A
;
&
>
p
{
color
:
#004
f8a
;
}
}
}
&
.box_between
{
&
.box_between
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
20px
;
...
...
@@ -364,7 +390,7 @@ body {
}
}
.tab_content
{
.tab_content
{
padding
:
10px
;
.icon-goods
{
width
:
46px
;
...
...
@@ -374,19 +400,19 @@ body {
}
.content
.box
{
&.equity_box{
&.equity_box
{
margin-bottom
:
10px
;
}
.car_content
{
.car_content
{
padding
:
10px
;
.items
{
grid-template-columns
:
repeat
(
5
,
1
fr
);
.item
{
margin-bottom
:
10px
;
}
.tip
{
.tip
{
flex
:
1
;
color
:
#9
C9C9C
;
color
:
#9
c9c9c
;
font-size
:
12px
;
align-self
:
center
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment