Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
voucher-h5
Project
Overview
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
潘琦
voucher-h5
Commits
92c81f3f
Commit
92c81f3f
authored
Sep 06, 2019
by
潘琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
内容流详情分享功能放开;
parent
f9130961
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
25 deletions
+34
-25
dev.env.js
config/dev.env.js
+2
-3
cardItem.vue
src/components/cardItem.vue
+3
-0
request.js
src/router/request.js
+1
-0
requestSjkg.js
src/router/requestSjkg.js
+12
-11
index.vue
src/views/content/index.vue
+11
-10
wxpermission.js
src/wxpermission.js
+5
-1
No files found.
config/dev.env.js
View file @
92c81f3f
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
const
merge
=
require
(
'webpack-merge'
)
const
merge
=
require
(
'webpack-merge'
)
const
prodEnv
=
require
(
'./prod.env'
)
const
prodEnv
=
require
(
'./prod.env'
)
const
baseUrl
=
'"http://voucher.check.icaremgt.com"'
//打包前请求前缀(开发)
//
const baseUrl = '"http://voucher.check.icaremgt.com"' //打包前请求前缀(开发)
// const baseUrl = '"http://voucher.icaremgt.com"' //打包前请求前缀(正式)
// const baseUrl = '"http://voucher.icaremgt.com"' //打包前请求前缀(正式)
module
.
exports
=
merge
(
prodEnv
,
{
module
.
exports
=
merge
(
prodEnv
,
{
NODE_ENV
:
'"development"'
,
NODE_ENV
:
'"development"'
API_ROOT
:
baseUrl
})
})
src/components/cardItem.vue
View file @
92c81f3f
...
@@ -105,5 +105,8 @@ export default {
...
@@ -105,5 +105,8 @@ export default {
font-weight
:
bold
;
font-weight
:
bold
;
/* margin-bottom:0.5em; */
/* margin-bottom:0.5em; */
margin-bottom
:
0
;
margin-bottom
:
0
;
white-space
:
nowrap
;
max-width
:
13.2em
;
overflow
:
hidden
;
}
}
</
style
>
</
style
>
src/router/request.js
View file @
92c81f3f
...
@@ -2,6 +2,7 @@ import axios from 'axios'
...
@@ -2,6 +2,7 @@ import axios from 'axios'
import
store
from
'../store'
import
store
from
'../store'
import
{
Toast
}
from
'mint-ui'
import
{
Toast
}
from
'mint-ui'
// import router from '@/router/index'
// import router from '@/router/index'
// import baseUrl from '@/util/baseUrl'
import
{
removeUrlParam
}
from
'@/util/index'
import
{
removeUrlParam
}
from
'@/util/index'
axios
.
defaults
.
timeout
=
30000
axios
.
defaults
.
timeout
=
30000
...
...
src/router/requestSjkg.js
View file @
92c81f3f
import
axios
from
'axios'
import
axios
SJKG
from
'axios'
import
store
from
'../store'
import
store
from
'../store'
import
{
Toast
}
from
'mint-ui'
import
{
Toast
}
from
'mint-ui'
import
baseUrl
from
'@/util/baseUrl'
import
baseUrl
from
'@/util/baseUrl'
// import router from '@/router/index'
// import router from '@/router/index'
import
{
removeUrlParam
}
from
'@/util/index'
import
{
removeUrlParam
}
from
'@/util/index'
axios
.
defaults
.
timeout
=
30000
// 创建axios实例
console
.
log
(
'NODE_ENV'
+
process
.
env
.
NODE_ENV
)
const
service
=
axiosSJKG
.
create
({
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
baseURL
:
baseUrl
.
sjkgUrl
,
axios
.
defaults
.
baseURL
=
baseUrl
.
sjkgUrl
timeout
:
30000
// 请求超时时间
}
})
// 返回其他状态吗
// 返回其他状态吗
axios
.
defaults
.
validateStatus
=
function
(
status
)
{
service
.
defaults
.
validateStatus
=
function
(
status
)
{
return
status
// 默认的
return
status
// 默认的
}
}
// 跨域请求,允许保存cookie
// 跨域请求,允许保存cookie
axios
.
defaults
.
withCredentials
=
true
// axiosSJKG
.defaults.withCredentials = true
// request拦截器
// request拦截器
axios
.
interceptors
.
request
.
use
(
config
=>
{
service
.
interceptors
.
request
.
use
(
config
=>
{
let
token
=
store
.
getters
.
access_token
let
token
=
store
.
getters
.
access_token
if
(
token
)
{
if
(
token
)
{
// config.headers['Authorization'] = 'Bearer ' + token
// config.headers['Authorization'] = 'Bearer ' + token
...
@@ -30,7 +31,7 @@ axios.interceptors.request.use(config => {
...
@@ -30,7 +31,7 @@ axios.interceptors.request.use(config => {
})
})
// respone拦截器
// respone拦截器
axios
.
interceptors
.
response
.
use
(
response
=>
{
service
.
interceptors
.
response
.
use
(
response
=>
{
const
res
=
response
.
data
&&
(
response
.
data
.
code
===
0
||
response
.
data
.
code
===
200
)
?
response
.
data
:
response
const
res
=
response
.
data
&&
(
response
.
data
.
code
===
0
||
response
.
data
.
code
===
200
)
?
response
.
data
:
response
const
status
=
Number
(
response
.
status
)
||
200
const
status
=
Number
(
response
.
status
)
||
200
console
.
log
(
'response status:'
+
status
)
console
.
log
(
'response status:'
+
status
)
...
@@ -77,4 +78,4 @@ axios.interceptors.response.use(response => {
...
@@ -77,4 +78,4 @@ axios.interceptors.response.use(response => {
return
Promise
.
reject
(
new
Error
(
error
))
return
Promise
.
reject
(
new
Error
(
error
))
})
})
export
default
axios
export
default
service
src/views/content/index.vue
View file @
92c81f3f
...
@@ -48,7 +48,6 @@ export default {
...
@@ -48,7 +48,6 @@ export default {
this
.
getContentInfoFn
(
this
.
imprId
)
this
.
getContentInfoFn
(
this
.
imprId
)
},
},
mounted
:
function
()
{
mounted
:
function
()
{
wxpermission
(
1
,
()
=>
{})
},
},
computed
:
{
computed
:
{
},
},
...
@@ -71,15 +70,17 @@ export default {
...
@@ -71,15 +70,17 @@ export default {
}
}
console
.
log
(
'getContentInfo'
)
console
.
log
(
'getContentInfo'
)
let
that
=
this
let
that
=
this
let
newShareLink
=
removeUrlParam
(
'code'
)
wxpermission
(
1
,
()
=>
{
newShareLink
=
newShareLink
.
split
(
'#'
)[
0
]
+
'#/content?imprId='
+
this
.
imprId
let
newShareLink
=
removeUrlParam
(
'code'
)
const
shareData
=
{
newShareLink
=
newShareLink
.
split
(
'#'
)[
0
]
+
'#/content?imprId='
+
this
.
imprId
title
:
that
.
data
.
mainTitle
,
const
shareData
=
{
imgUrl
:
that
.
data
.
cover
,
title
:
that
.
data
.
mainTitle
,
desc
:
that
.
data
.
subheading
!==
''
?
that
.
data
.
subheading
:
'凯歌健康券'
,
imgUrl
:
that
.
data
.
cover
,
link
:
newShareLink
desc
:
that
.
data
.
subheading
!==
''
?
that
.
data
.
subheading
:
'凯歌健康券'
,
}
link
:
newShareLink
initWXShare
(
shareData
)
}
initWXShare
(
shareData
)
})
}
}
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
this
.
$toast
({
this
.
$toast
({
...
...
src/wxpermission.js
View file @
92c81f3f
...
@@ -34,7 +34,11 @@ export const wxpermission = (state, fn) => {
...
@@ -34,7 +34,11 @@ export const wxpermission = (state, fn) => {
fn
()
fn
()
if
(
state
===
0
)
{
if
(
state
===
0
)
{
wx
.
hideMenuItems
({
wx
.
hideMenuItems
({
menuList
:
[
'menuItem:share:appMessage'
,
'menuItem:share:timeline'
,
'menuItem:copyUrl'
,
'menuItem:share:qq'
,
'menuItem:share:weiboApp'
,
'menuItem:favorite'
,
'menuItem:share:facebook'
,
'menuItem:share:QZone'
,
'menuItem:originPage'
,
'menuItem:openWithQQBrowser'
,
'menuItem:openWithSafari'
,
'menuItem:share:email'
,
'menuItem:share:brand'
,
'menuItem:editTag'
]
// 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
menuList
:
[
'menuItem:share:appMessage'
,
'menuItem:share:timeline'
,
'menuItem:share:qq'
,
'menuItem:share:weiboApp'
,
'menuItem:favorite'
,
'menuItem:share:facebook'
,
'menuItem:share:QZone'
,
'menuItem:originPage'
,
'menuItem:openWithQQBrowser'
,
'menuItem:openWithSafari'
,
'menuItem:share:email'
,
'menuItem:share:brand'
,
'menuItem:editTag'
]
// 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
})
}
else
if
(
state
===
1
)
{
wx
.
showMenuItems
({
menuList
:
[
'menuItem:share:appMessage'
,
'menuItem:share:timeline'
,
'menuItem:share:qq'
]
})
})
}
}
// const shareData = {
// const shareData = {
...
...
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