Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-new-compaign
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-new-compaign
提交
a837f7e3
提交
a837f7e3
编写于
3月 10, 2020
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
联调绑定居民微信
上级
ca07c0d9
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
47 行增加
和
15 行删除
+47
-15
task-activity.vue
components/task-activity.vue
+6
-2
index.vue
pages/index.vue
+26
-9
api.js
service/api.js
+3
-2
index.js
service/index.js
+9
-0
index.js
utils/index.js
+3
-2
未找到文件。
components/task-activity.vue
浏览文件 @
a837f7e3
...
...
@@ -50,7 +50,8 @@
<
script
>
// asyncData fetch 在组件中无效
import
{
getNewActivityDesc
}
from
'@/service'
;
const
cookies
=
require
(
'cookie-universal'
)();
// const cookies = require('cookie-universal')();
import
{
setCookie
,
getCookie
,
delCookie
}
from
'@/utils/index'
;
export
default
{
name
:
'TaskActivity'
,
props
:
{
...
...
@@ -120,7 +121,7 @@ export default {
if
(
self
.
isWeb
)
{
req
=
{
id
:
acTempId
,
token
:
cookies
.
get
(
'token'
)
||
'2B7FA4D845C74D7EA3183F9E316630C6'
token
:
getCookie
(
'token'
)
||
'2B7FA4D845C74D7EA3183F9E316630C6'
}
}
else
{
req
=
{
...
...
@@ -144,6 +145,9 @@ export default {
if
(
this
.
taskList
[
i
].
resourceType
==
7
&&
this
.
taskList
[
i
].
resourceId
==
1
)
{
this
.
$emit
(
'getTaskId'
,{
taskId
:
this
.
taskList
[
i
].
id
});
}
if
(
this
.
taskList
[
i
].
resourceType
==
10
&&
this
.
userMobile
)
{
this
.
$emit
(
'firstEnterActivity'
,{
taskId
:
this
.
taskList
[
i
].
id
});
}
}
}
})
...
...
pages/index.vue
浏览文件 @
a837f7e3
...
...
@@ -56,7 +56,8 @@
:userMobile=
"userMobile"
:acTempId=
"activityId"
@
activityTaskJump=
"activityTaskJump"
@
getTaskId=
"getTaskId"
/>
@
getTaskId=
"getTaskId"
@
firstEnterActivity=
"firstEnterActivity"
/>
</div>
<div
class=
"step bt"
>
<step
...
...
@@ -101,11 +102,12 @@ import FirstEnterDialog from '../components/first-enter-dialog';
import
{
checkToken
,
selectAppModuleParam
,
getSelfAllScore
}
from
"@/service"
;
getSelfAllScore
,
getEncryptId
}
from
"@/service"
;
import
{
setEventByModuleCode
}
from
"@/utils"
import
{
ENV_CONFIG
}
from
'@/utils/enumerate'
;
import
{
Base64
}
from
'js-base64'
;
const
cookies
=
require
(
'cookie-universal'
)()
;
import
{
setCookie
,
getCookie
,
delCookie
}
from
'@/utils/index'
;
export
default
{
components
:
{
...
...
@@ -152,6 +154,7 @@ export default {
userName
:
''
,
taskId
:
''
,
origin
:
'tims'
,
encryptId
:
''
,
showFirstEnter
:
false
,
//是否展示第一次进入获得勤奋分弹框
}
},
...
...
@@ -179,6 +182,10 @@ export default {
};
},
methods
:
{
// 首次进入活动页面
firstEnterActivity
()
{
this
.
showFirstEnter
=
true
;
},
getUserInfo
()
{
this
.
$rocNative
.
getUserInfo
()
...
...
@@ -186,19 +193,28 @@ export default {
let
_t
=
params
.
userToken
;
let
_this
=
this
;
_this
.
token
=
params
.
userToken
;
cookies
.
set
(
'token'
,
_this
.
token
);
setCookie
(
'token'
,
_this
.
token
);
checkToken
({
_t
}).
then
(
res
=>
{
if
(
res
.
code
==
'200000'
||
res
.
code
==
'200006'
)
{
_this
.
userMobile
=
''
;
cookies
.
remov
e
(
'token'
);
delCooki
e
(
'token'
);
}
else
{
_this
.
userMobile
=
params
.
userMobile
;
cookies
.
set
(
'token'
,
_this
.
token
);
setCookie
(
'token'
,
_this
.
token
);
_this
.
getSelfAllScore
();
_this
.
getEncryptId
();
}
})
});
},
// 获取加密后的doctorId
getEncryptId
()
{
getEncryptId
().
then
(
res
=>
{
if
(
res
&&
res
.
code
&&
res
.
code
==
'000000'
){
this
.
encryptId
=
res
.
data
;
}
})
},
// 获取个人信息
getSelfAllScore
()
{
let
_this
=
this
;
...
...
@@ -246,9 +262,9 @@ export default {
let
shareUrl
=
''
;
const
{
NUXT_ENV_APP
}
=
process
.
env
;
if
(
data
.
resourceType
==
7
)
{
// 邀请好友点赞
const
{
tempId
,
token
,
user
Id
,
userName
,
myAvatarl
,
shareTitle1
,
shareTitle2
,
shareIconUrl
}
=
this
;
const
{
tempId
,
token
,
encrypt
Id
,
userName
,
myAvatarl
,
shareTitle1
,
shareTitle2
,
shareIconUrl
}
=
this
;
//shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/compaign_ssr/?id=' + tempId + '&token=' + token;
shareUrl
=
`http://10.177.10.217:3000/compaign_ssr/login-point?activityId=
${
tempId
}
&taskId=
${
data
.
id
}
&id=
${
user
Id
}
&name=
${
userName
}
&avatar=
${
myAvatarl
}
`
;
shareUrl
=
`http://10.177.10.217:3000/compaign_ssr/login-point?activityId=
${
tempId
}
&taskId=
${
data
.
id
}
&id=
${
encrypt
Id
}
&name=
${
userName
}
&avatar=
${
myAvatarl
}
`
;
this
.
$rocNative
.
shareWechat
({
type
:
6
,
shareId
:
0
,
...
...
@@ -259,7 +275,8 @@ export default {
});
}
else
if
(
data
.
resourceType
==
9
)
{
// 绑定居民微信
const
{
userId
,
origin
,
activityId
,
shareTitle3
,
shareTitle4
,
shareIconUrl
}
=
this
;
shareUrl
=
`
${
ENV_CONFIG
[
NUXT_ENV_APP
][
'shareUrl'
]}
/active_news/activity/qrcode?doctorId=
${
userId
}
&origin=
${
origin
}
&activity=
${
activityId
}
`
;
let
doctorId
=
Base64
.
encode
(
userId
);
shareUrl
=
`
${
ENV_CONFIG
[
NUXT_ENV_APP
][
'shareUrl'
]}
/active_news/activity/qrcode?doctorId=
${
doctorId
}
&origin=
${
origin
}
&activityId=
${
activityId
}
`
;
this
.
$rocNative
.
shareWechat
({
type
:
6
,
shareId
:
0
,
...
...
service/api.js
浏览文件 @
a837f7e3
import
Axios
from
'axios'
;
import
{
Toast
}
from
'vant'
;
import
{
API_CONFIG
,
REPONSE_CODE
}
from
'@/utils/enumerate'
;
import
{
setCookie
,
getCookie
,
delCookie
}
from
'@/utils/index'
;
const
{
VUE_ENV
}
=
process
.
env
;
// server or client
const
cookies
=
require
(
'cookie-universal'
)();
//
const cookies = require('cookie-universal')();
Axios
.
interceptors
.
request
.
use
(
config
=>
{
...
...
@@ -13,7 +14,7 @@ Axios.interceptors.request.use(
const
method
=
config
.
method
.
toLocaleLowerCase
();
if
(
method
===
'post'
||
method
===
'put'
||
method
===
'delete'
)
{}
if
(
config
.
withCredentials
)
{
config
.
headers
.
token
=
cookies
.
get
(
'token'
);
config
.
headers
.
token
=
getCookie
(
'token'
);
}
return
config
;
},
...
...
service/index.js
浏览文件 @
a837f7e3
...
...
@@ -84,3 +84,12 @@ export const getAuthCode = ({ mobilePhone, flag, captchaToken, captchaAnswer })
},
})
}
// 获取加密过后的id
export
const
getEncryptId
=
()
=>
{
return
request
({
url
:
`campaign/inviteDetail/vinci`
,
method
:
'get'
,
withCredentials
:
true
,
})
}
\ No newline at end of file
utils/index.js
浏览文件 @
a837f7e3
const
{
NUXT_ENV_APP
}
=
process
.
env
;
export
const
getSearchByName
=
name
=>
{
const
match
=
RegExp
(
`[?&]
${
name
}
=([^&]*)`
).
exec
(
window
.
location
.
href
);
return
match
&&
decodeURIComponent
(
match
[
1
].
replace
(
/
\+
/g
,
' '
));
...
...
@@ -32,14 +33,14 @@ export const removeItem = name => {
export
const
setCookie
=
(
cname
,
cvalue
,
exdays
=
7
,
domain
=
'.yunqueyi.com'
)
=>
{
//yunqueyi.com
let
d
=
new
Date
(),
expires
=
''
;
if
(
NUXT_ENV_APP
===
'dev'
)
{
domain
=
window
.
location
.
hostname
;
}
d
.
setTime
(
d
.
getTime
()
+
(
exdays
*
24
*
60
*
60
*
1000
));
expires
=
`expires=
${
d
.
toUTCString
()}
`
;
document
.
cookie
=
`
${
cname
}
=
${
cvalue
}
;path=/;
${
expires
}
;domain=
${
domain
}
`
;
}
export
const
getCookie
=
(
cname
)
=>
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录