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
c814ffbb
Commit
c814ffbb
authored
Jul 19, 2021
by
Damon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-v1.0.0' of git.banshouhui.com:wuzhenzhe/study into dev-v1.0.0
parents
701804be
ea133e80
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
544 additions
and
62 deletions
+544
-62
pages.json
src/pages.json
+14
-1
boundTest.vue
src/pages/learn/boundTest.vue
+109
-0
detail copy.vue
src/pages/learn/detail copy.vue
+81
-0
detail.vue
src/pages/learn/detail.vue
+340
-61
No files found.
src/pages.json
View file @
c814ffbb
...
@@ -62,7 +62,10 @@
...
@@ -62,7 +62,10 @@
"path"
:
"detail"
,
"path"
:
"detail"
,
"name"
:
"learnDetail"
,
"name"
:
"learnDetail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"题库详情"
"navigationBarTitleText"
:
""
,
//
题库详情
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
},
},
{
{
...
@@ -124,6 +127,16 @@
...
@@ -124,6 +127,16 @@
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
{
"path"
:
"boundTest"
,
"name"
:
"learnBoundTest"
,
"style"
:
{
"navigationBarTitleText"
:
"绑定试题"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
}
]
]
},
},
...
...
src/pages/learn/boundTest.vue
0 → 100644
View file @
c814ffbb
<
template
>
<view
class=
"bound-test"
>
<u-navbar
back-icon-color=
"#191C27"
background=
"transparent"
title=
"绑定试题"
titleColor=
"#191C27"
:border-bottom=
"false"
title-bold
></u-navbar>
<view
class=
"body-view"
>
<image
class=
"image-view"
:src=
"successImage"
></image>
<view
class=
"content-view"
>
学习卡已绑定成功
</view>
<view
class=
"tip-view"
>
可以前往首页进行答题或模拟考试学习
</view>
<view
class=
"bottom-view"
>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick"
type=
"primary"
shape=
"circle"
>
去首页
</u-button>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{}
},
computed
:
{
labels
()
{
return
{
kemu
:
'考试科目'
,
tishu
:
'考试题数'
,
biaozhun
:
'合格标准'
,
guize
:
'出题规则'
,
}
},
successImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'shenqingtijiaochenggong.png'
},
buttonStyle
()
{
return
{
height
:
'104rpx'
,
width
:
'400rpx'
,
backgroundColor
:
'#2953FF'
,
color
:
'#FFFFFF'
,
fontSize
:
'32rpx'
,
fontWeight
:
'bold'
,
}
},
},
onLoad
()
{},
methods
:
{
handleClick
()
{
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
::-webkit-scrollbar
{
width
:
0
;
height
:
0
;
color
:
transparent
;
display
:
none
;
}
.bound-test
{
display
:
flex
;
flex-direction
:
column
;
background-image
:
linear-gradient
(
to
top
,
#f7f9fc
0%
,
#e9f3ff
50%
);
background-color
:
#f7f9fc
;
background-size
:
100%
520rpx
;
background-repeat
:
no-repeat
;
height
:
100vh
;
.body-view
{
height
:
100%
;
overflow
:
auto
;
padding-top
:
100rpx
;
text-align
:
center
;
.image-view
{
margin-top
:
100rpx
;
width
:
224rpx
;
height
:
224rpx
;
}
.content-view
{
font-size
:
40rpx
;
color
:
#2953ff
;
font-weight
:
bold
;
}
.tip-view
{
font-size
:
26rpx
;
color
:
#9ea5bb
;
margin-top
:
10rpx
;
}
.bottom-view
{
margin-top
:
180rpx
;
}
}
}
</
style
>
src/pages/learn/detail copy.vue
0 → 100644
View file @
c814ffbb
<
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 @
c814ffbb
This diff is collapsed.
Click to expand it.
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