Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
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
Damon
study
Commits
8e4481b3
Commit
8e4481b3
authored
Oct 30, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 广告改为动态返回
parent
1949c9e6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
36 deletions
+37
-36
.env.js
.env.js
+1
-1
learn.js
src/api/learn.js
+7
-3
index.vue
src/components/advertisement-swiper/index.vue
+10
-7
questionnaire.vue
src/pages/advertisement/questionnaire.vue
+3
-2
results.vue
src/pages/advertisement/results.vue
+1
-1
index.vue
src/pages/index/index.vue
+15
-22
No files found.
.env.js
View file @
8e4481b3
;(
function
()
{
let
NODE_ENV
=
'
prod
'
// dev:开发环境 | test:测试环境 | prod:生产环境
let
NODE_ENV
=
'
test
'
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
let
VERSION
=
'v1.3.1'
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
...
...
src/api/learn.js
View file @
8e4481b3
...
...
@@ -128,9 +128,12 @@ let learnApiFun = function(vm) {
await
vm
.
$u
.
post
(
'/rest/reward/receive/award'
,
params
)
// 获取问卷回答状态
let
answerStatus
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/rest/survey/answer/status'
,
params
)
//
let answerStatus = async (params = {}) =>
//
await vm.$u.get('/rest/survey/answer/status', params)
//
let
getAdvertisementList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/rest/ad/config/1'
,
params
)
const
learnApi
=
{
getQuestion
,
getQuestionTotal
,
...
...
@@ -160,7 +163,8 @@ let learnApiFun = function(vm) {
examCancel
,
submitSurvey
,
receiveAward
,
answerStatus
// answerStatus
getAdvertisementList
}
return
learnApi
}
...
...
src/components/advertisement-swiper/index.vue
View file @
8e4481b3
<
template
>
<view
class=
"wrap"
>
<u-swiper
:list=
"list"
@
click=
"handleClick"
height=
"180"
border-radius=
"16"
:mode=
"mode"
></u-swiper>
<u-swiper
:list=
"list"
name=
"subjectUrl"
@
click=
"handleClick"
height=
"180"
border-radius=
"16"
:mode=
"mode"
></u-swiper>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
list
:
{
type
:
Array
,
default
()
{
return
[]
},
},
},
data
()
{
return
{
list
:
[{
image
:
process
.
uniEnv
.
qn_base_url
+
'wenjuandatiguagngao.jpg'
,
id
:
1
}
],
}
},
created
()
{
...
...
@@ -36,7 +39,7 @@
},
handleClick
(
index
)
{
console
.
log
(
index
)
this
.
$emit
(
'click'
,
this
.
list
[
index
]
.
id
)
this
.
$emit
(
'click'
,
this
.
list
[
index
])
}
}
}
...
...
src/pages/advertisement/questionnaire.vue
View file @
8e4481b3
...
...
@@ -87,7 +87,7 @@ export default {
computed
:
{
wenjuandatiImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'wenjuan
dati
.jpg'
return
process
.
uniEnv
.
qn_base_url
+
'wenjuan
zhutu
.jpg'
},
checked
()
{
var
count
=
0
...
...
@@ -136,6 +136,7 @@ export default {
}
},
methods
:
{
/*
queryQuestionWarehouseById(id) {
// 埋点-调查问卷信息信息
// let trackParams = {
...
...
@@ -153,7 +154,7 @@ export default {
.catch((err) => {
console.log(err)
})
},
},
*/
handleChange
(
event
,
index
,
i
)
{
for
(
var
question
of
this
.
list
[
index
].
answerList
)
{
question
.
checked
=
false
...
...
src/pages/advertisement/results.vue
View file @
8e4481b3
...
...
@@ -61,7 +61,7 @@ export default {
},
computed
:
{
lingqujiangliImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'li
ngqujiang
li.jpg'
return
process
.
uniEnv
.
qn_base_url
+
'li
gnqufu
li.jpg'
},
buttonStyle
()
{
return
this
.
selected
...
...
src/pages/index/index.vue
View file @
8e4481b3
...
...
@@ -87,7 +87,7 @@
<view>
{{
item
.
title
}}
</view>
</view>
</view>
<AdvertisementSwiper
v-if=
"showAdvertisement"
@
click=
"handleClickAdvertisement"
/>
<AdvertisementSwiper
v-if=
"showAdvertisement"
:list=
"advertisementList"
@
click=
"handleClickAdvertisement"
/>
<view
:class=
"['bottom-view',
{'showAdvertisement': showAdvertisement}]">
<image
class=
"bottom-image"
...
...
@@ -148,7 +148,7 @@ export default {
tipTop
:
410
,
tipTop0
:
128
,
havingExamination
:
false
,
// 有进行中的考试
questionnaireStatus
:
10
,
advertisementList
:
[],
// 广告位
}
},
computed
:
{
...
...
@@ -279,18 +279,8 @@ export default {
return
`width:570rpx;margin-top:
${
this
.
tipTop0
}
rpx`
},
showAdvertisement
()
{
return
this
.
selected
.
id
>
0
&&
(
this
.
filledQuestionnaire
||
this
.
notQuestionnaire
)
},
// 0-未参与问卷, 1-已参与未领取奖品, 2-已参与已领取奖品, 10-已参与无奖品问卷
// 已参与调查未领取奖励
filledQuestionnaire
()
{
return
this
.
questionnaireStatus
==
1
},
// 未参与调查
notQuestionnaire
()
{
return
this
.
questionnaireStatus
==
0
}
},
return
this
.
selected
.
id
>
0
&&
this
.
advertisementList
.
length
>
0
},
},
watch
:
{
'detail.totalCount'
(
val
)
{
// 上次答题总数为0,这次答题总数大于0,弹出提示
...
...
@@ -366,7 +356,7 @@ export default {
this
.
getInProgress
()
// 是否显示广告:调查问卷
this
.
answerStatus
()
this
.
getAdvertisementList
()
})
.
catch
((
err
)
=>
{
this
.
loading
=
false
...
...
@@ -666,17 +656,18 @@ export default {
},
})
},
handleClickAdvertisement
(
i
d
)
{
handleClickAdvertisement
(
i
tem
)
{
var
path
=
'questionnaire'
if
(
this
.
notQuestionnaire
)
{
// 0-未参与问卷, 1-已参与未领取奖品, 2-已参与已领取奖品, 10-已参与无奖品问卷
if
(
item
.
status
==
0
){
path
=
'questionnaire'
}
else
if
(
this
.
filledQuestionnaire
)
{
}
else
if
(
item
.
status
==
1
)
{
path
=
'results'
}
this
.
$u
.
route
({
url
:
'pages/advertisement/'
+
path
,
params
:
{
surveyId
:
id
,
surveyId
:
i
tem
.
businessI
d
,
},
})
},
...
...
@@ -692,12 +683,14 @@ export default {
console
.
log
(
err
)
})
},
answerStatus
()
{
getAdvertisementList
()
{
// surveyId 问卷id,暂时写死
this
.
$u
.
api
.
answerStatus
({
surveyId
:
1
}
)
.
getAdvertisementList
(
)
.
then
((
res
)
=>
{
this
.
questionnaireStatus
=
res
this
.
advertisementList
=
res
.
filter
((
item
)
=>
{
return
item
.
status
==
0
||
item
.
status
==
1
})
||
[]
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
...
...
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