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
2ebefd8a
Commit
2ebefd8a
authored
Jul 20, 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
cff21a2e
c0410a4a
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
591 additions
and
185 deletions
+591
-185
index.vue
src/components/answer-explanation/index.vue
+2
-0
index.vue
src/components/answer-sheet/index.vue
+6
-1
index.vue
src/components/swiper-limited-load/index.vue
+1
-0
manifest.json
src/manifest.json
+1
-1
answer.vue
src/pages/learn/answer.vue
+189
-92
detail copy.vue
src/pages/learn/detail copy.vue
+0
-81
detail.vue
src/pages/learn/detail.vue
+63
-1
detail.vue
src/pages/search/detail.vue
+320
-4
index.vue
src/pages/search/index.vue
+5
-2
index.js
src/store/index.js
+4
-3
No files found.
src/components/answer-explanation/index.vue
View file @
2ebefd8a
...
@@ -44,6 +44,7 @@ export default {
...
@@ -44,6 +44,7 @@ export default {
}
}
.title
{
.title
{
padding-left
:
25rpx
;
padding-left
:
25rpx
;
color
:
#191C27
;
}
}
}
}
.content
{
.content
{
...
@@ -55,6 +56,7 @@ export default {
...
@@ -55,6 +56,7 @@ export default {
text-align
:
left
;
text-align
:
left
;
padding
:
10rpx
0
0rpx
30rpx
;
padding
:
10rpx
0
0rpx
30rpx
;
line-height
:
50rpx
;
line-height
:
50rpx
;
color
:
#5A6073
;
}
}
.lists
:nth-of-type
(
1
)
{
.lists
:nth-of-type
(
1
)
{
color
:
#2953ff
;
color
:
#2953ff
;
...
...
src/components/answer-sheet/index.vue
View file @
2ebefd8a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
></view>
></view>
<view
class=
"text"
>
{{
item
.
text
}}
</view>
<view
class=
"text"
>
{{
item
.
text
}}
</view>
</view>
</view>
<view
class=
"btn"
v-if=
"rightKey.length > 1"
>
<view
class=
"btn"
v-if=
"rightKey.length > 1
&& btnStatus
"
>
<view
<view
:class=
"['confirm',
{ active: getCheckedNum }]"
:class=
"['confirm',
{ active: getCheckedNum }]"
@click="confirmMultiple"
@click="confirmMultiple"
...
@@ -59,6 +59,10 @@ export default {
...
@@ -59,6 +59,10 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
,
},
},
btnStatus
:
{
type
:
Boolean
,
default
:
true
,
}
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -173,6 +177,7 @@ export default {
...
@@ -173,6 +177,7 @@ export default {
color
:
#fff
;
color
:
#fff
;
}
}
.text
{
.text
{
color
:
#191C27
;
padding-left
:
20rpx
;
padding-left
:
20rpx
;
flex
:
1
;
flex
:
1
;
}
}
...
...
src/components/swiper-limited-load/index.vue
View file @
2ebefd8a
...
@@ -124,6 +124,7 @@ export default {
...
@@ -124,6 +124,7 @@ export default {
},
},
answerChange
(
status
,
lists
)
{
answerChange
(
status
,
lists
)
{
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'errShow'
,
this
.
type
===
2
?
true
:
status
===
'fail'
)
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'errShow'
,
this
.
type
===
2
?
true
:
status
===
'fail'
)
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'submitStatus'
,
true
)
this
.
$emit
(
"answerChange"
,
status
,
lists
)
this
.
$emit
(
"answerChange"
,
status
,
lists
)
},
},
clear
()
{
clear
()
{
...
...
src/manifest.json
View file @
2ebefd8a
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
/*
快应用特有相关
*/
/*
快应用特有相关
*/
"mp-weixin"
:
{
"mp-weixin"
:
{
/*
微信小程序特有相关
*/
/*
微信小程序特有相关
*/
"appid"
:
"wx
d1d6eede324b0465
"
,
"appid"
:
"wx
4bd80cf10c2a1d14
"
,
"setting"
:
{
"setting"
:
{
"urlCheck"
:
false
,
"urlCheck"
:
false
,
"es6"
:
true
"es6"
:
true
...
...
src/pages/learn/answer.vue
View file @
2ebefd8a
This diff is collapsed.
Click to expand it.
src/pages/learn/detail copy.vue
deleted
100644 → 0
View file @
cff21a2e
<
template
>
<view>
<u-button
type=
"primary"
@
click=
"payOrder"
>
微信支付测试
</u-button>
</view>
</
template
>
<
script
>
import
md5
from
'@/common/md5.js'
export
default
{
components
:
{},
data
()
{
return
{
lists
:
[
{
questionWarehouseId
:
1
,
amount
:
0.01
,
count
:
1
,
},
],
}
},
methods
:
{
payOrder
()
{
const
data
=
{
instrtutionId
:
1
,
orders
:
JSON
.
stringify
(
this
.
lists
),
openId
:
this
.
openId
,
}
this
.
$u
.
api
.
payOrder
(
data
).
then
((
res
)
=>
{
this
.
pay
(
res
)
})
},
pay
(
data
)
{
const
timeStamp
=
String
(
Date
.
now
())
const
paySign
=
md5
.
hexMD5
(
`appId=wxd1d6eede324b0465&nonceStr=
${
data
.
nonce_str
}
&package=prepay_id=
${
data
.
prepay_id
}
&signType=MD5&timeStamp=
${
timeStamp
}
&key=weixiuhui20151a2b3c4d5e6f7g8h9ij`
)
.
toUpperCase
()
uni
.
requestPayment
({
provider
:
'wxpay'
,
timeStamp
:
timeStamp
,
nonceStr
:
data
.
nonce_str
,
package
:
`prepay_id=
${
data
.
prepay_id
}
`
,
signType
:
'MD5'
,
paySign
:
paySign
,
success
:
(
res
)
=>
{
console
.
log
(
'success:'
+
JSON
.
stringify
(
res
))
this
.
checkPayStatus
(
data
.
out_trade_no
)
},
fail
:
(
err
)
=>
{
console
.
log
(
'fail:'
+
JSON
.
stringify
(
err
))
if
(
err
.
errMsg
===
'requestPayment:fail cancel'
)
{
this
.
$u
.
toast
(
'取消支付'
)
}
else
{
this
.
checkPayStatus
(
data
.
out_trade_no
)
}
},
})
},
checkPayStatus
(
no
)
{
const
params
=
{
outTradeNo
:
no
}
this
.
$u
.
api
.
payQuery
(
params
).
then
(
res
=>
{
if
(
res
.
trade_state
===
'SUCCESS'
)
{
this
.
$u
.
toast
(
'支付成功'
)
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
this
.
$u
.
toast
(
'请稍后核实订单状态,不要重复发起支付'
)
}
else
if
(
res
.
trade_state
===
'PAYERROR'
)
{
this
.
$u
.
toast
(
'支付失败'
)
}
else
{
this
.
$u
.
toast
(
res
.
trade_state_desc
)
}
})
}
},
}
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
src/pages/learn/detail.vue
View file @
2ebefd8a
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
md5
from
'@/common/md5.js'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -99,6 +100,13 @@ export default {
...
@@ -99,6 +100,13 @@ export default {
trueOrFalse
:
526
,
trueOrFalse
:
526
,
total
:
986
,
total
:
986
,
},
},
lists
:
[
{
questionWarehouseId
:
1
,
amount
:
0.01
,
count
:
1
,
},
],
}
}
},
},
...
@@ -179,7 +187,61 @@ export default {
...
@@ -179,7 +187,61 @@ export default {
url
:
'/pages/index/index'
,
url
:
'/pages/index/index'
,
})
})
},
},
handleClickBuy
()
{},
handleClickBuy
()
{
const
data
=
{
instrtutionId
:
1
,
orders
:
JSON
.
stringify
(
this
.
lists
),
openId
:
this
.
openId
,
}
this
.
$u
.
api
.
payOrder
(
data
).
then
((
res
)
=>
{
this
.
pay
(
res
)
})
},
pay
(
data
)
{
const
timeStamp
=
String
(
Date
.
now
())
const
paySign
=
md5
.
hexMD5
(
`appId=wx4bd80cf10c2a1d14&nonceStr=
${
data
.
nonce_str
}
&package=prepay_id=
${
data
.
prepay_id
}
&signType=MD5&timeStamp=
${
timeStamp
}
&key=304b5d1810e481224d4a9199e8ba6c6e`
)
.
toUpperCase
()
uni
.
requestPayment
({
provider
:
'wxpay'
,
timeStamp
:
timeStamp
,
nonceStr
:
data
.
nonce_str
,
package
:
`prepay_id=
${
data
.
prepay_id
}
`
,
signType
:
'MD5'
,
paySign
:
paySign
,
success
:
(
res
)
=>
{
console
.
log
(
'success:'
+
JSON
.
stringify
(
res
))
this
.
checkPayStatus
(
data
.
out_trade_no
)
},
fail
:
(
err
)
=>
{
console
.
log
(
'fail:'
+
JSON
.
stringify
(
err
))
if
(
err
.
errMsg
===
'requestPayment:fail cancel'
)
{
this
.
$u
.
toast
(
'取消支付'
)
}
else
{
this
.
checkPayStatus
(
data
.
out_trade_no
)
}
},
})
},
checkPayStatus
(
no
)
{
const
params
=
{
outTradeNo
:
no
}
this
.
$u
.
api
.
payQuery
(
params
).
then
(
res
=>
{
if
(
res
.
trade_state
===
'SUCCESS'
)
{
this
.
$u
.
toast
(
'支付成功'
)
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
this
.
$u
.
toast
(
'请稍后核实订单状态,不要重复发起支付'
)
}
else
if
(
res
.
trade_state
===
'PAYERROR'
)
{
this
.
$u
.
toast
(
'支付失败'
)
}
else
{
this
.
$u
.
toast
(
res
.
trade_state_desc
)
}
})
}
},
},
}
}
</
script
>
</
script
>
...
...
src/pages/search/detail.vue
View file @
2ebefd8a
<
template
>
<
template
>
<view
class=
"search"
>
<view
class=
"u-flex search"
>
<u-navbar
back-icon-color=
"#333333"
background=
"transparent"
title=
" "
titleColor=
"#191C27"
:border-bottom=
"false"
title-bold
></u-navbar>
<view
class=
"search-bar"
>
<u-search
:clearabled=
"true"
:action-style=
"searchStyle"
bg-color=
"#fff"
v-model=
"keyword"
:show-action=
"false"
@
custom=
"search"
@
search=
"search"
></u-search>
</view>
<view
v-show=
"lists.length > 0"
>
<view
class=
"title"
>
共找到含有
<text>
“
{{
keyword
}}
”
</text>
相关试题
<text>
10
</text>
道
</view
>
<view
class=
"result"
>
<u-collapse
:item-style=
"itemStyle"
event-type=
"close"
>
<u-collapse-item
:ref=
"`collapse$
{index}`"
:index="index"
@change="itemChange"
v-for="(item, index) in lists"
:key="index"
>
<view
slot=
"title-all"
class=
"u-flex head"
>
<view
class=
"titles"
>
<text>
{{
titleType
[
item
.
type
-
1
]
}}
</text
>
{{
item
.
title
}}
</view>
<view
class=
"u-flex arrow"
v-show=
"index !== arrIndex"
>
<text>
展开
</text>
<u-icon
name=
"arrow-down"
color=
"#9EA5BB"
></u-icon>
</view>
</view>
<view
class=
"u-flex subject"
>
<view
class=
"content"
>
<answer-sheet
ref=
"answerSheet"
:answerList=
"item.answerList"
:rightKey=
"item.rightKey"
:multiple=
"item.type === 3"
:submitStatus=
"item.submitStatus"
:btnStatus=
"false"
@
change=
"answerChange"
></answer-sheet>
</view>
<view
class=
"explain"
>
<answer-explanation
:answer=
"item.answer"
:explain=
"item.explain"
></answer-explanation>
</view>
</view>
<view
class=
"u-flex opera"
>
<view
class=
"opera-list"
@
click=
"collection(item)"
>
<u-icon
name=
"star"
color=
"#5A6073"
size=
"40"
></u-icon>
<text>
收藏
</text>
</view>
<view
class=
"opera-list"
@
click=
"arrowUp(index)"
>
<text>
收起
</text>
<u-icon
name=
"arrow-up"
color=
"#9EA5BB"
></u-icon>
</view>
</view>
</u-collapse-item>
</u-collapse>
</view>
</view>
<view
class=
"u-flex default"
v-show=
"lists.length === 0"
>
<view>
<image
:src=
"defaultImg"
/>
</view>
<view
class=
"no-result"
>
当前暂无搜索结果
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
answerSheet
from
'@/components/answer-sheet/index.vue'
import
answerExplanation
from
'@/components/answer-explanation/index.vue'
export
default
{
export
default
{
components
:
{
answerSheet
,
answerExplanation
,
},
data
()
{
data
()
{
return
{
return
{
keyword
:
''
itemStyle
:
{
background
:
'#fff'
,
padding
:
'0rpx 20rpx'
,
margin
:
'10rpx 0'
,
'border-radius'
:
'30rpx 30rpx 0 0'
},
titleType
:
[
'单选题'
,
'判断题'
,
'多选题'
],
keyword
:
''
,
lists
:
[
{
type
:
1
,
title
:
'采用QS1电桥测量tanδ的接线方式一般有差接线及和接线。'
,
answerList
:
[
{
sort
:
'A'
,
text
:
'正确'
,
checked
:
true
,
confirm
:
true
,
},
{
sort
:
'B'
,
text
:
'错误'
,
},
],
answer
:
'A'
,
explain
:
'极性电介质在外电场作用下,由偶极子分子的转向形成的极化称为偶极子式极化。'
,
index
:
0
,
rightKey
:
[
'A'
],
submitStatus
:
true
,
},
{
type
:
2
,
title
:
'空气间隙的操作冲击击穿电压数值大小不仅与间隙距离、电极形状、电极极性有关,而且与操作冲击电压波的波前时间的长短有关。'
,
answerList
:
[
{
sort
:
'A'
,
text
:
'正确'
,
},
{
sort
:
'B'
,
text
:
'错误'
,
checked
:
true
,
confirm
:
true
,
},
],
answer
:
'B'
,
explain
:
'极性电介质在外电场作用下,由偶极子分子的转向形成的极化称为偶极子式极化。'
,
index
:
1
,
rightKey
:
[
'B'
],
submitStatus
:
true
,
},
{
type
:
3
,
title
:
'西林电桥采用正接线及反接线时,其测试原理相同'
,
answerList
:
[
{
sort
:
'A'
,
text
:
'影响'
,
},
{
sort
:
'B'
,
text
:
'影响很小'
,
checked
:
true
,
confirm
:
true
,
},
{
sort
:
'C'
,
text
:
'影响很大'
,
checked
:
true
,
confirm
:
true
,
},
{
sort
:
'D'
,
text
:
'无影响'
,
},
],
answer
:
'B,C'
,
explain
:
'双臂电桥是在单臂电桥的基础上增加特殊机构,以消除测试时连接线和接线柱接触电阻对测量结果的影响。'
,
index
:
2
,
rightKey
:
[
'B'
,
'C'
],
submitStatus
:
true
,
},
{
type
:
2
,
title
:
'测试标题测试标题测试标题测试标题'
,
answerList
:
[
{
sort
:
'A'
,
text
:
'是'
,
},
{
sort
:
'B'
,
text
:
'否'
,
checked
:
true
,
confirm
:
true
,
},
],
answer
:
'B'
,
explain
:
'测试内容测试内容测试内容测试内容测试内容测试内容'
,
index
:
3
,
rightKey
:
[
'B'
],
submitStatus
:
true
,
},
],
arrIndex
:
null
,
}
}
},
},
onLoad
(
e
)
{
this
.
keyword
=
e
?
decodeURIComponent
(
e
.
keyword
)
:
''
},
computed
:
{
computed
:
{
defaultImg
()
{
return
process
.
uniEnv
.
qn_base_url
+
'no-search.png'
},
},
},
methods
:
{
methods
:
{
itemChange
(
e
)
{
this
.
arrIndex
=
e
.
show
?
e
.
index
:
null
},
search
(
val
)
{
this
.
keyword
=
val
let
history
=
this
.
searchHistory
history
.
unshift
(
val
)
if
(
history
.
length
>
9
)
{
history
.
splice
(
9
,
1
)
}
this
.
$u
.
vuex
(
'searchHistory'
,
history
)
},
collection
(
item
)
{
console
.
log
(
"item"
,
item
)
},
arrowUp
(
index
)
{
this
.
$refs
[
`collapse
${
index
}
`
][
0
].
headClick
()
}
},
},
}
}
</
script
>
</
script
>
...
@@ -27,6 +250,99 @@ export default {
...
@@ -27,6 +250,99 @@ export default {
background-image
:
linear-gradient
(
to
top
,
#f8fafd
0%
,
#e9f3ff
50%
);
background-image
:
linear-gradient
(
to
top
,
#f8fafd
0%
,
#e9f3ff
50%
);
background-size
:
100%
520rpx
;
background-size
:
100%
520rpx
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
padding
:
0
20rpx
;
.search-bar
{
width
:
100%
;
padding
:
0
20rpx
;
}
.title
{
width
:
100%
;
color
:
#191c27
;
font-size
:
32rpx
;
font-weight
:
bold
;
margin-top
:
30rpx
;
padding
:
0
20rpx
;
text
{
color
:
#2953ff
;
}
}
.result
{
margin-top
:
30rpx
;
width
:
100%
;
.head
{
width
:
100%
;
height
:
60rpx
;
overflow
:
hidden
;
.titles
{
color
:
#191c27
;
font-size
:
32rpx
;
line-height
:
50rpx
;
font-weight
:
bold
;
height
:
60rpx
;
overflow
:
hidden
;
flex
:
1
;
text
{
background
:
#9ea5bb
;
color
:
#fff
;
padding
:
8rpx
20rpx
;
margin-right
:
10rpx
;
font-size
:
20rpx
;
border-radius
:
50rpx
;
}
}
.arrow
{
padding-left
:
20rpx
;
text
{
color
:
#2953ff
;
font-size
:
28rpx
;
padding-right
:
10rpx
;
}
}
}
.subject
{
flex-flow
:
column
;
.type
{
width
:
100%
;
text-align
:
left
;
padding
:
20rpx
0
;
}
.content
{
width
:
100%
;
}
.explain
,
.btn
{
width
:
100%
;
padding-top
:
50rpx
;
}
}
.opera
{
padding
:
30rpx
0
;
justify-content
:
space-between
;
color
:
#5a6073
;
font-size
:
28rpx
;
.opera-list
{
display
:
flex
;
&
:nth-of-type
(
1
)
{
text
{
padding-left
:
10rpx
;
}
}
&
:nth-of-type
(
2
)
{
text
{
padding-right
:
10rpx
;
color
:
#2953ff
;
}
}
}
}
}
.default
{
flex-flow
:
column
;
flex
:
1
;
justify-content
:
center
;
.no-result
{
color
:
#9EA5BB
;
font-size
:
28rpx
;
}
}
}
}
</
style
>
</
style
>
src/pages/search/index.vue
View file @
2ebefd8a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<u-navbar
<u-navbar
back-icon-color=
"#333333"
back-icon-color=
"#333333"
background=
"transparent"
background=
"transparent"
title=
"
搜索
"
title=
"
"
titleColor=
"#191C27"
titleColor=
"#191C27"
:border-bottom=
"false"
:border-bottom=
"false"
title-bold
title-bold
...
@@ -63,7 +63,10 @@ export default {
...
@@ -63,7 +63,10 @@ export default {
methods
:
{
methods
:
{
search
(
val
)
{
search
(
val
)
{
this
.
keyword
=
val
this
.
keyword
=
val
this
.
history
.
push
(
val
)
this
.
history
.
unshift
(
val
)
if
(
this
.
history
.
length
>
9
){
this
.
history
.
splice
(
9
,
1
)
}
this
.
$u
.
vuex
(
'searchHistory'
,
this
.
history
)
this
.
$u
.
vuex
(
'searchHistory'
,
this
.
history
)
this
.
toSearchDetail
(
val
)
this
.
toSearchDetail
(
val
)
},
},
...
...
src/store/index.js
View file @
2ebefd8a
...
@@ -12,7 +12,7 @@ try{
...
@@ -12,7 +12,7 @@ try{
}
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let
saveStateKeys
=
[
'userInfo'
,
'vuex_token'
,
'openId'
,
'searchHistory'
];
let
saveStateKeys
=
[
'userInfo'
,
'vuex_token'
,
'openId'
,
'searchHistory'
,
'questionList'
];
// 保存变量到本地存储中
// 保存变量到本地存储中
const
saveLifeData
=
function
(
key
,
value
){
const
saveLifeData
=
function
(
key
,
value
){
...
@@ -35,9 +35,10 @@ const store = new Vuex.Store({
...
@@ -35,9 +35,10 @@ const store = new Vuex.Store({
userInfo
:
lifeData
.
userInfo
?
lifeData
.
userInfo
:
{},
userInfo
:
lifeData
.
userInfo
?
lifeData
.
userInfo
:
{},
vuex_token
:
lifeData
.
vuex_token
?
lifeData
.
vuex_token
:
''
,
vuex_token
:
lifeData
.
vuex_token
?
lifeData
.
vuex_token
:
''
,
openId
:
lifeData
.
openId
?
lifeData
.
openId
:
''
,
openId
:
lifeData
.
openId
?
lifeData
.
openId
:
''
,
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
questionList
:
lifeData
.
questionList
?
lifeData
.
questionList
:
[],
// 练习列表
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version
:
'1.0.
1
'
,
vuex_version
:
'1.0.
0
'
,
},
},
mutations
:
{
mutations
:
{
$uStore
(
state
,
payload
)
{
$uStore
(
state
,
payload
)
{
...
...
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