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
afd989c3
Commit
afd989c3
authored
Jul 22, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-v1.0.0' of
https://git.banshouhui.com/wuzhenzhe/study
into dev-v1.0.0
parents
cec01ecd
7744dd92
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
15 deletions
+41
-15
index.vue
src/components/swiper-limited-load/index.vue
+23
-15
answer.vue
src/pages/learn/answer.vue
+2
-0
detail.vue
src/pages/learn/detail.vue
+8
-0
utils.js
src/pages/learn/utils.js
+4
-0
index.vue
src/pages/login/index.vue
+4
-0
No files found.
src/components/swiper-limited-load/index.vue
View file @
afd989c3
...
@@ -110,12 +110,12 @@ export default {
...
@@ -110,12 +110,12 @@ export default {
immediate
:
true
immediate
:
true
},
},
model
(
newVal
,
oldVal
){
model
(
newVal
,
oldVal
){
if
(
newVal
===
2
)
this
.
autoAnswer
(
)
this
.
changeModel
(
newVal
)
}
}
},
},
methods
:
{
methods
:
{
init
(
defaulaIndex
)
{
init
(
defaulaIndex
)
{
let
list
=
this
.
list
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
list
))
if
(
list
==
null
||
list
.
length
==
0
)
{
if
(
list
==
null
||
list
.
length
==
0
)
{
return
return
}
}
...
@@ -181,21 +181,29 @@ export default {
...
@@ -181,21 +181,29 @@ export default {
// 记录滑过来的位置,此值对于下一次滑动的计算很重要
// 记录滑过来的位置,此值对于下一次滑动的计算很重要
this
.
swiperIndex
=
current
this
.
swiperIndex
=
current
if
(
this
.
model
===
2
)
{
if
(
this
.
model
===
2
)
{
this
.
autoAnswer
()
this
.
changeModel
()
}
}
},
},
autoAnswer
()
{
// 切换模式
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'errShow'
,
true
)
changeModel
(
model
)
{
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'submitStatus'
,
true
)
let
info
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
swiperList
[
this
.
swiperIndex
]))
const
info
=
this
.
swiperList
[
this
.
swiperIndex
]
if
(
model
===
1
)
{
const
lists
=
info
.
answerList
.
map
(
v
=>
{
const
item
=
this
.
list
.
find
(
v
=>
v
.
index
===
info
.
index
)
if
(
info
.
rightKey
.
includes
(
v
.
sort
))
{
this
.
$set
(
this
.
swiperList
,
this
.
swiperIndex
,
item
)
v
.
checked
=
true
}
else
{
v
.
confirm
=
true
// 学习模式,显示答案
}
info
.
errShow
=
true
return
v
info
.
answerList
.
forEach
(
v
=>
{
})
if
(
info
.
rightKey
.
includes
(
v
.
sort
))
{
this
.
$emit
(
"answerChange"
,
'pass'
,
lists
)
v
.
checked
=
true
v
.
confirm
=
true
}
else
{
v
.
checked
=
false
v
.
confirm
=
false
}
})
this
.
$set
(
this
.
swiperList
,
this
.
swiperIndex
,
info
)
}
},
},
/**
/**
* 获取初始化的swiperList
* 获取初始化的swiperList
...
...
src/pages/learn/answer.vue
View file @
afd989c3
...
@@ -225,6 +225,7 @@ export default {
...
@@ -225,6 +225,7 @@ export default {
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
// 初始化数据
init
()
{
init
()
{
const
params
=
{
const
params
=
{
questionWarehouseId
:
this
.
questionWarehouseId
,
questionWarehouseId
:
this
.
questionWarehouseId
,
...
@@ -251,6 +252,7 @@ export default {
...
@@ -251,6 +252,7 @@ export default {
this
.
refresh
(
index
)
this
.
refresh
(
index
)
})
})
},
},
// 切换
swiperChange
(
e
)
{
swiperChange
(
e
)
{
let
current
=
e
.
current
let
current
=
e
.
current
this
.
currentIndex
=
current
this
.
currentIndex
=
current
...
...
src/pages/learn/detail.vue
View file @
afd989c3
...
@@ -193,7 +193,11 @@ export default {
...
@@ -193,7 +193,11 @@ export default {
orders
:
JSON
.
stringify
(
this
.
lists
),
orders
:
JSON
.
stringify
(
this
.
lists
),
openId
:
this
.
openId
,
openId
:
this
.
openId
,
}
}
uni
.
showLoading
({
title
:
'加载中'
})
this
.
$u
.
api
.
payOrder
(
data
).
then
((
res
)
=>
{
this
.
$u
.
api
.
payOrder
(
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
this
.
pay
(
res
)
this
.
pay
(
res
)
})
})
},
},
...
@@ -223,7 +227,11 @@ export default {
...
@@ -223,7 +227,11 @@ export default {
const
params
=
{
const
params
=
{
outTradeNo
:
no
,
outTradeNo
:
no
,
}
}
uni
.
showLoading
({
title
:
'支付中'
})
this
.
$u
.
api
.
payQuery
(
params
).
then
((
res
)
=>
{
this
.
$u
.
api
.
payQuery
(
params
).
then
((
res
)
=>
{
uni
.
hideLoading
()
if
(
res
.
trade_state
===
'SUCCESS'
)
{
if
(
res
.
trade_state
===
'SUCCESS'
)
{
this
.
$u
.
toast
(
'支付成功'
)
this
.
$u
.
toast
(
'支付成功'
)
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
...
...
src/pages/learn/utils.js
View file @
afd989c3
...
@@ -104,7 +104,11 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
...
@@ -104,7 +104,11 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
source
:
vm
.
source
source
:
vm
.
source
}
}
}
}
uni
.
showLoading
({
title
:
'加载中'
})
vm
.
$u
.
api
.
getQuestion
(
params
).
then
(
res
=>
{
vm
.
$u
.
api
.
getQuestion
(
params
).
then
(
res
=>
{
uni
.
hideLoading
()
const
list
=
res
.
records
const
list
=
res
.
records
let
data
=
{}
let
data
=
{}
data
.
total
=
res
.
total
data
.
total
=
res
.
total
...
...
src/pages/login/index.vue
View file @
afd989c3
...
@@ -37,7 +37,11 @@ export default {
...
@@ -37,7 +37,11 @@ export default {
avatar
:
userInfo
.
avatarUrl
,
avatar
:
userInfo
.
avatarUrl
,
nickname
:
userInfo
.
nickName
,
nickname
:
userInfo
.
nickName
,
}
}
uni
.
showLoading
({
title
:
'加载中'
})
this
.
$u
.
api
.
loginWechatAuth
(
data
).
then
((
res
)
=>
{
this
.
$u
.
api
.
loginWechatAuth
(
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
this
.
$u
.
vuex
(
'vuex_token'
,
res
.
token
)
this
.
$u
.
vuex
(
'vuex_token'
,
res
.
token
)
this
.
$u
.
vuex
(
'openId'
,
res
.
openId
)
this
.
$u
.
vuex
(
'openId'
,
res
.
openId
)
this
.
$u
.
vuex
(
'userInfo'
,
userInfo
)
this
.
$u
.
vuex
(
'userInfo'
,
userInfo
)
...
...
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