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
2a9c6ee0
Commit
2a9c6ee0
authored
Jul 16, 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
f9b5b89b
5d16abe4
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
678 additions
and
89 deletions
+678
-89
common.js
src/api/common.js
+7
-2
upload.js
src/common/upload.js
+23
-2
index.vue
src/components/circle-progress/index.vue
+236
-0
index.vue
src/components/pop-view/index.vue
+2
-1
main.js
src/main.js
+10
-6
pages.json
src/pages.json
+10
-0
beginAnswer.vue
src/pages/learn/beginAnswer.vue
+98
-77
score.vue
src/pages/learn/score.vue
+291
-0
info.vue
src/pages/mine/info.vue
+1
-1
No files found.
src/api/common.js
View file @
2a9c6ee0
let
commonApiFun
=
function
(
vm
)
{
let
commonApiFun
=
function
(
vm
)
{
let
loginWechatAuth
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/wxapp/unify/authorization'
,
params
)
const
globalUrl
=
process
.
uniEnv
||
{}
let
ucenterApiUrl
=
globalUrl
.
uUrl
let
loginWechatAuth
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/wxapp/unify/authorization'
,
params
)
let
payOrder
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/pay/order'
,
params
)
let
payOrder
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/pay/order'
,
params
)
let
payQuery
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/pay/query'
,
params
)
let
payQuery
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/pay/query'
,
params
)
let
getQiNiuToken
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'v1/tokens'
,
params
)
let
getQiNiuToken
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'v1/tokens'
,
params
)
const
commonApi
=
{
const
commonApi
=
{
loginWechatAuth
,
loginWechatAuth
,
payOrder
,
payOrder
,
...
...
src/common/upload.js
View file @
2a9c6ee0
...
@@ -7,7 +7,19 @@ function hasPermissionOfCamera() {
...
@@ -7,7 +7,19 @@ function hasPermissionOfCamera() {
r
(
true
)
r
(
true
)
},
},
fail
:
function
()
{
fail
:
function
()
{
j
(
false
)
uni
.
showModal
({
content
:
'拒绝授权将无法进行拍照和上传图片,是否去设置打开?'
,
confirmText
:
'确认'
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
openSetting
()
}
},
fail
()
{
j
(
false
)
},
})
},
},
complete
:
function
()
{
complete
:
function
()
{
console
.
log
(
'done!'
)
console
.
log
(
'done!'
)
...
@@ -16,12 +28,21 @@ function hasPermissionOfCamera() {
...
@@ -16,12 +28,21 @@ function hasPermissionOfCamera() {
})
})
}
}
function
openSetting
()
{
// 打开设置
wx
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
)
},
})
}
//吊起设备原生相机相册取得文件,并自动上传七牛,返回七牛key,domain,本地file信息
//吊起设备原生相机相册取得文件,并自动上传七牛,返回七牛key,domain,本地file信息
function
getPhoto
(
type
,
token
)
{
function
getPhoto
(
type
,
token
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
hasPermissionOfCamera
().
then
((
r
)
=>
{
hasPermissionOfCamera
().
then
((
r
)
=>
{
if
(
!
r
)
{
if
(
!
r
)
{
console
.
warn
(
'调用相机失败'
)
reject
(
false
)
}
}
})
})
let
sourceType
=
type
==
1
?
[
'album'
]
:
[
'album'
,
'camera'
]
let
sourceType
=
type
==
1
?
[
'album'
]
:
[
'album'
,
'camera'
]
...
...
src/components/circle-progress/index.vue
0 → 100644
View file @
2a9c6ee0
<
template
>
<view
class=
"u-circle-progress"
:style=
"
{
width: widthPx + 'px',
height: widthPx + 'px',
backgroundColor: bgColor,
}"
>
<!-- 支付宝小程序不支持canvas-id属性,必须用id属性 -->
<canvas
class=
"u-canvas-bg"
:canvas-id=
"elBgId"
:id=
"elBgId"
:style=
"
{
width: widthPx + 'px',
height: widthPx + 'px',
}"
>
</canvas>
<canvas
class=
"u-canvas"
:canvas-id=
"elId"
:id=
"elId"
:style=
"
{
width: widthPx + 'px',
height: widthPx + 'px',
}"
>
</canvas>
<slot></slot>
</view>
</
template
>
<
script
>
/**
* circleProgress 环形进度条
* @description 展示操作或任务的当前进度,比如上传文件,是一个圆形的进度条。注意:此组件的percent值只能动态增加,不能动态减少。
* @property {String Number} percent 圆环进度百分比值,为数值类型,0-100
* @property {String} inactive-color 圆环的底色,默认为灰色(该值无法动态变更)(默认#ececec)
* @property {String} active-color 圆环激活部分的颜色(该值无法动态变更)(默认#19be6b)
* @property {String Number} width 整个圆环组件的宽度,高度默认等于宽度值,单位rpx(默认200)
* @property {String Number} border-width 圆环的边框宽度,单位rpx(默认14)
* @property {String Number} duration 整个圆环执行一圈的时间,单位ms(默认呢1500)
* @property {String} type 如设置,active-color值将会失效
* @property {String} bg-color 整个组件背景颜色,默认为白色
* @example <circle-progress active-color="#2979ff" :percent="80"></circle-progress>
*/
export
default
{
name
:
'circle-progress'
,
props
:
{
// 圆环进度百分比值
percent
:
{
type
:
Number
,
default
:
0
,
// 限制值在0到100之间
validator
:
(
val
)
=>
{
return
val
>=
0
&&
val
<=
100
},
},
// 底部圆环的颜色(灰色的圆环)
inactiveColor
:
{
type
:
String
,
default
:
'#ececec'
,
},
// 圆环激活部分的颜色
activeColor
:
{
type
:
String
,
default
:
'#19be6b'
,
},
// 圆环线条的宽度,单位rpx
borderWidth
:
{
type
:
[
Number
,
String
],
default
:
14
,
},
// 整个圆形的宽度,单位rpx
width
:
{
type
:
[
Number
,
String
],
default
:
200
,
},
// 整个圆环执行一圈的时间,单位ms
duration
:
{
type
:
[
Number
,
String
],
default
:
1500
,
},
// 主题类型
type
:
{
type
:
String
,
default
:
''
,
},
// 整个圆环进度区域的背景色
bgColor
:
{
type
:
String
,
default
:
'#ffffff'
,
},
},
data
()
{
return
{
// #ifdef MP-WEIXIN
elBgId
:
'uCircleProgressBgId'
,
// 微信小程序中不能使用this.$u.guid()形式动态生成id值,否则会报错
elId
:
'uCircleProgressElId'
,
// #endif
// #ifndef MP-WEIXIN
elBgId
:
this
.
$u
.
guid
(),
// 非微信端的时候,需用动态的id,否则一个页面多个圆形进度条组件数据会混乱
elId
:
this
.
$u
.
guid
(),
// #endif
widthPx
:
uni
.
upx2px
(
this
.
width
),
// 转成px后的整个组件的背景宽度
borderWidthPx
:
uni
.
upx2px
(
this
.
borderWidth
),
// 转成px后的圆环的宽度
startAngle
:
Math
.
PI
*
0.84
,
// canvas画圆的起始角度,默认为3点钟方向,定位到8点钟方向
progressContext
:
null
,
// 活动圆的canvas上下文
newPercent
:
0
,
// 当动态修改进度值的时候,保存进度值的变化前后值,用于比较用
oldPercent
:
0
,
// 当动态修改进度值的时候,保存进度值的变化前后值,用于比较用
}
},
watch
:
{
percent
(
nVal
,
oVal
=
0
)
{
if
(
nVal
>
100
)
nVal
=
100
if
(
nVal
<
0
)
oVal
=
0
// 此值其实等于this.percent,命名一个新
this
.
newPercent
=
nVal
this
.
oldPercent
=
oVal
setTimeout
(()
=>
{
// 无论是百分比值增加还是减少,需要操作还是原来的旧的百分比值
// 将此值减少或者新增到新的百分比值
this
.
drawCircleByProgress
(
oVal
)
},
50
)
},
},
created
()
{
// 赋值,用于加载后第一个画圆使用
this
.
newPercent
=
this
.
percent
this
.
oldPercent
=
0
},
computed
:
{
// 有type主题时,优先起作用
circleColor
()
{
if
(
[
'success'
,
'error'
,
'info'
,
'primary'
,
'warning'
].
indexOf
(
this
.
type
)
>=
0
)
return
this
.
$u
.
color
[
this
.
type
]
else
return
this
.
activeColor
},
},
mounted
()
{
// 在h5端,必须要做一点延时才起作用,this.$nextTick()无效(HX2.4.7)
setTimeout
(()
=>
{
this
.
drawProgressBg
()
this
.
drawCircleByProgress
(
this
.
oldPercent
)
},
50
)
},
methods
:
{
drawProgressBg
()
{
let
ctx
=
uni
.
createCanvasContext
(
this
.
elBgId
,
this
)
ctx
.
setLineWidth
(
this
.
borderWidthPx
)
// 设置圆环宽度
ctx
.
setStrokeStyle
(
this
.
inactiveColor
)
// 线条颜色
ctx
.
beginPath
()
// 开始描绘路径
// 设置一个原点(110,110),半径为100的圆的路径到当前路径
let
radius
=
this
.
widthPx
/
2
ctx
.
arc
(
radius
,
radius
,
radius
-
this
.
borderWidthPx
,
this
.
startAngle
,
2.16
*
Math
.
PI
,
false
)
ctx
.
stroke
()
// 对路径进行描绘
ctx
.
draw
()
},
drawCircleByProgress
(
progress
)
{
// 第一次操作进度环时将上下文保存到了this.data中,直接使用即可
let
ctx
=
this
.
progressContext
if
(
!
ctx
)
{
ctx
=
uni
.
createCanvasContext
(
this
.
elId
,
this
)
this
.
progressContext
=
ctx
}
// 表示进度的两端为圆形
ctx
.
setLineCap
(
'round'
)
// 设置线条的宽度和颜色
ctx
.
setLineWidth
(
this
.
borderWidthPx
)
ctx
.
setStrokeStyle
(
this
.
circleColor
)
// 将总过渡时间除以100,得出每修改百分之一进度所需的时间
let
time
=
Math
.
floor
(
this
.
duration
/
100
)
// 结束角的计算依据为:将2π分为100份,乘以当前的进度值,得出终止点的弧度值,加起始角,为整个圆从默认的
// 3点钟方向开始画图,转为更好理解的12点钟方向开始作图,这需要起始角和终止角同时加上this.startAngle值
let
endAngle
=
((
1.32
*
Math
.
PI
)
/
100
)
*
progress
+
this
.
startAngle
ctx
.
beginPath
()
// 半径为整个canvas宽度的一半
let
radius
=
this
.
widthPx
/
2
ctx
.
arc
(
radius
,
radius
,
radius
-
this
.
borderWidthPx
,
this
.
startAngle
,
endAngle
,
false
)
ctx
.
stroke
()
ctx
.
draw
()
// 如果变更后新值大于旧值,意味着增大了百分比
if
(
this
.
newPercent
>
this
.
oldPercent
)
{
// 每次递增百分之一
progress
++
// 如果新增后的值,大于需要设置的值百分比值,停止继续增加
if
(
progress
>
this
.
newPercent
)
return
}
else
{
// 同理于上面
progress
--
if
(
progress
<
this
.
newPercent
)
return
}
setTimeout
(()
=>
{
// 定时器,每次操作间隔为time值,为了让进度条有动画效果
this
.
drawCircleByProgress
(
progress
)
},
time
)
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.u-circle-progress
{
position
:
relative
;
/* #ifndef APP-NVUE */
display
:
inline-flex
;
/* #endif */
align-items
:
center
;
justify-content
:
center
;
}
.u-canvas-bg
{
position
:
absolute
;
}
.u-canvas
{
position
:
absolute
;
}
</
style
>
src/components/pop-view/index.vue
View file @
2a9c6ee0
...
@@ -125,9 +125,10 @@ export default {
...
@@ -125,9 +125,10 @@ export default {
.line-view
{
.line-view
{
background-color
:
#e8ebf3
;
background-color
:
#e8ebf3
;
height
:
2rpx
;
height
:
2rpx
;
width
:
100%
;
width
:
calc
(
100%
+
60rpx
)
;
margin-bottom
:
40rpx
;
margin-bottom
:
40rpx
;
margin-top
:
40rpx
;
margin-top
:
40rpx
;
margin-left
:
-30rpx
;
}
}
.pop-btn-view
{
.pop-btn-view
{
...
...
src/main.js
View file @
2a9c6ee0
import
Vue
from
'vue'
import
Vue
from
'vue'
import
App
from
'./App'
import
App
from
'./App'
import
store
from
'@/store'
import
store
from
'@/store'
import
vuexStore
from
"@/store/$u.mixin.js"
import
vuexStore
from
'@/store/$u.mixin.js'
import
{
router
,
RouterMount
}
from
'./router.js'
import
{
router
,
RouterMount
}
from
'./router.js'
Vue
.
use
(
router
)
Vue
.
use
(
router
)
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
...
@@ -11,13 +11,17 @@ Vue.mixin(vuexStore)
...
@@ -11,13 +11,17 @@ Vue.mixin(vuexStore)
// 引入全局uView
// 引入全局uView
import
uView
from
'uview-ui'
import
uView
from
'uview-ui'
Vue
.
use
(
uView
)
;
Vue
.
use
(
uView
)
const
app
=
new
Vue
({
const
app
=
new
Vue
({
store
,
store
,
...
App
...
App
,
})
})
// 引入uView对小程序分享的mixin封装
let
mpShare
=
require
(
'uview-ui/libs/mixin/mpShare.js'
)
Vue
.
mixin
(
mpShare
)
import
httpInterceptor
from
'@/common/http.interceptor.js'
import
httpInterceptor
from
'@/common/http.interceptor.js'
Vue
.
use
(
httpInterceptor
,
app
)
Vue
.
use
(
httpInterceptor
,
app
)
...
@@ -26,7 +30,7 @@ import httpApi from '@/common/http.api.js'
...
@@ -26,7 +30,7 @@ import httpApi from '@/common/http.api.js'
Vue
.
use
(
httpApi
,
app
)
Vue
.
use
(
httpApi
,
app
)
// #ifdef H5
// #ifdef H5
RouterMount
(
app
,
router
,
'#app'
)
RouterMount
(
app
,
router
,
'#app'
)
// #endif
// #endif
// #ifndef H5
// #ifndef H5
...
...
src/pages.json
View file @
2a9c6ee0
...
@@ -114,6 +114,16 @@
...
@@ -114,6 +114,16 @@
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
{
"path"
:
"score"
,
"name"
:
"learnScore"
,
"style"
:
{
"navigationBarTitleText"
:
"考试成绩"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
}
]
]
},
},
...
...
src/pages/learn/beginAnswer.vue
View file @
2a9c6ee0
...
@@ -9,32 +9,34 @@
...
@@ -9,32 +9,34 @@
title-bold
title-bold
></u-navbar>
></u-navbar>
<view
class=
"content"
>
<view
class=
"content"
>
<view
class=
"head-view"
>
<view
class=
"body-view"
>
<view
class=
"image-view"
>
<view
class=
"head-view"
>
<image
class=
"image"
:src=
"info.image || defaultImage"
>
</image
<view
class=
"image-view"
>
></view>
<image
class=
"image"
:src=
"info.image || defaultImage"
>
</image
<view>
{{
info
.
name
}}
</view>
></view>
</view>
<view>
{{
info
.
name
}}
</view>
<view
class=
"line-view"
></view>
<view
class=
"list-view"
>
<view
v-for=
"(value, key) in labels"
:key=
"key"
class=
"item-view"
>
<view
class=
"left-view"
>
{{
value
}}
</view>
<view>
{{
info
[
key
]
}}
</view>
</view>
</view>
</view>
<view
class=
"line-view"
></view>
<view
class=
"line-view"
></view>
<view
class=
"list-view"
>
<view
class=
"tip-view"
<view
v-for=
"(value, key) in labels"
:key=
"key"
class=
"item-view"
>
>
温馨提示:模拟考试中不能修改答案,没做错1道题扣2分,合格标准为90分。
</view
<view
class=
"left-view"
>
{{
value
}}
</view>
>
<view>
{{
info
[
key
]
}}
</view>
<view
class=
"bottom-view"
>
</view>
<u-button
</view>
:customStyle=
"buttonStyle"
<view
class=
"line-view"
></view>
@
click=
"handleClick"
<view
class=
"tip-view"
type=
"primary"
>
温馨提示:模拟考试中不能修改答案,没做错1道题扣2分,合格标准为90分。
</view
shape=
"circle"
>
>
开始模拟
<view
class=
"bottom-view"
>
</u-button>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick"
type=
"primary"
shape=
"circle"
>
开始模拟
</u-button>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -58,7 +60,7 @@ export default {
...
@@ -58,7 +60,7 @@ export default {
}
}
},
},
defaultImage
()
{
defaultImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'
lianxiwancheng-f
.png'
return
process
.
uniEnv
.
qn_base_url
+
'
morentouxiang
.png'
},
},
buttonStyle
()
{
buttonStyle
()
{
return
{
return
{
...
@@ -75,6 +77,13 @@ export default {
...
@@ -75,6 +77,13 @@ export default {
this
.
info
=
{
this
.
info
=
{
name
:
'我就是昵称'
,
name
:
'我就是昵称'
,
image
:
''
,
image
:
''
,
kemu
:
'考试科目fdsafsafdsadfdsafjlkafdaslffdsafsafsafdsafdsafdsajklsa'
,
tishu
:
'考试题数fdasfasfasfffdsafsafdsadfdsafjlkafdaslffdsafsafsafdsafdsafdsajklsaasfdsafdasfadssafasfsaf'
,
biaozhun
:
'合格标准dasfasfasfffdsafsafdsadfdsafjlkafdaslffdsafsafsafdsafdsafdsajklsaasfdsaf'
,
guize
:
'出题规则dasfasfasfffdsafsafdsadfdsafjlkafdaslffdsafsafsafdsafdsafdsajklsaasfdsaf'
,
}
}
},
},
methods
:
{
methods
:
{
...
@@ -84,6 +93,12 @@ export default {
...
@@ -84,6 +93,12 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
::-webkit-scrollbar
{
width
:
0
;
height
:
0
;
color
:
transparent
;
display
:
none
;
}
.begin-answer
{
.begin-answer
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -94,64 +109,70 @@ export default {
...
@@ -94,64 +109,70 @@ export default {
height
:
100vh
;
height
:
100vh
;
.content
{
.content
{
height
:
100%
;
height
:
100%
;
margin
:
70rpx
24rpx
24rpx
44rpx
;
overflow
:
auto
;
background-color
:
#ffffff
;
padding-top
:
100rpx
;
border-radius
:
12rpx
12rpx
0
0
;
.body-view
{
padding
:
0
30rpx
60rpx
30rpx
;
margin
:
0rpx
24rpx
44rpx
24rpx
;
.head-view
{
background-color
:
#ffffff
;
width
:
100%
;
border-radius
:
12rpx
;
display
:
flex
;
padding
:
0
30rpx
60rpx
30rpx
;
align-items
:
center
;
.head-view
{
font-size
:
32rpx
;
width
:
100%
;
font-weight
:
bold
;
color
:
#191c27
;
flex-direction
:
column
;
margin-bottom
:
40rpx
;
.image-view
{
margin-bottom
:
20rpx
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
padding
:
4rpx
;
font-size
:
32rpx
;
width
:
140rpx
;
font-weight
:
bold
;
height
:
140rpx
;
color
:
#191c27
;
background-color
:
#ffffff
;
flex-direction
:
column
;
border-radius
:
140rpx
;
margin-bottom
:
40rpx
;
margin-top
:
-70rpx
;
.image-view
{
.image
{
margin-bottom
:
20rpx
;
width
:
136rpx
;
display
:
flex
;
height
:
136rpx
;
justify-content
:
center
;
border-right
:
136rpx
;
align-items
:
center
;
border-radius
:
136rpx
;
padding
:
4rpx
;
width
:
140rpx
;
height
:
140rpx
;
background-color
:
#ffffff
;
border-radius
:
140rpx
;
margin-top
:
-70rpx
;
.image
{
width
:
136rpx
;
height
:
136rpx
;
border-radius
:
136rpx
;
}
}
}
}
}
}
.line-view
{
.line-view
{
background-color
:
#e8ebf3
;
background-color
:
#e8ebf3
;
height
:
2rpx
;
height
:
2rpx
;
}
}
.list-view
{
.list-view
{
padding
:
20rpx
0
;
padding
:
20rpx
0
;
.item-view
{
.item-view
{
margin
:
30rpx
0
;
margin
:
30rpx
0
;
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
flex-start
;
align-items
:
center
;
color
:
#5a6073
;
color
:
#5a6073
;
font-size
:
28rpx
;
font-size
:
28rpx
;
text-align
:
right
;
text-align
:
right
;
word-break
:
break-all
;
.left-view
{
.left-view
{
text-align
:
left
;
text-align
:
left
;
color
:
#9ea5bb
;
color
:
#9ea5bb
;
margin-right
:
30rpx
;
flex-shrink
:
0
;
}
}
}
}
}
}
.tip-view
{
.tip-view
{
font-size
:
26rpx
;
font-size
:
26rpx
;
color
:
#9ea5bb
;
color
:
#9ea5bb
;
margin
:
50rpx
0
210rpx
0
;
margin
:
50rpx
0
210rpx
0
;
}
}
.bottom-btn
{
.bottom-btn
{
}
}
}
}
}
}
}
...
...
src/pages/learn/score.vue
0 → 100644
View file @
2a9c6ee0
<
template
>
<view
class=
"score-view"
>
<u-navbar
back-icon-color=
"#191C27"
background=
"transparent"
title=
"考试成绩"
titleColor=
"#191C27"
:border-bottom=
"false"
title-bold
></u-navbar>
<view
class=
"top-view"
@
click=
"$u.throttle(handleClickRecord, 500)"
>
考试错题已自动加入
<text
class=
"blue-text"
>
"错题记录"
</text>
方便练习
</view
>
<view
class=
"content"
>
<view
class=
"content-view"
>
<image
mode=
"widthFix"
class=
"back-image"
:src=
"backImage"
></image>
<view
class=
"chart-view"
>
<CircleProgress
class=
"progress-view"
active-color=
"#FFFFFF"
:percent=
"info.score"
inactive-color=
"rgba(255, 255, 255, 0.3)"
width=
"240"
border-width=
"8"
bg-color=
"transparent"
>
<view
class=
"progress-content"
>
<view
class=
"progress-score"
>
{{
info
.
score
}}
</view>
<view
class=
"progress-info"
>
{{
resultText
}}
</view>
<view
class=
"percent-text"
>
超越了
{{
info
.
percent
}}
%的学员
</view>
</view>
</CircleProgress>
</view>
<view
class=
"head-view"
>
<view
class=
"image-view"
>
<image
class=
"image"
:src=
"info.image || defaultImage"
>
</image
></view>
<view>
{{
info
.
name
}}
</view>
<view
class=
"time-view"
>
{{
$u
.
timeFormat
(
info
.
time
||
new
Date
().
getTime
(),
'yyyy.mm.dd hh:MM:ss'
)
}}
</view>
</view>
<view
class=
"detail-view"
>
<view
class=
"name-view"
>
{{
info
.
category
}}
</view>
<view
class=
"type-view"
>
{{
info
.
type
}}
</view>
<image
class=
"qrcode-image"
:src=
"qrcodeImage"
></image>
</view>
</view>
<view
class=
"bottom-view"
>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick"
type=
"primary"
hover-class=
"hover-class"
open-type=
"share"
>
<image
:src=
"pengyunquanImage"
class=
"share-image"
></image>
分享朋友圈
</u-button>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick"
type=
"primary"
hover-class=
"none"
>
<image
:src=
"weixinImage"
class=
"share-image"
></image>
分享给好友
</u-button>
</view>
</view>
</view>
</
template
>
<
script
>
import
CircleProgress
from
'@/components/circle-progress'
export
default
{
components
:
{
CircleProgress
,
},
data
()
{
return
{
info
:
{},
}
},
computed
:
{
labels
()
{
return
{
kemu
:
'考试科目'
,
tishu
:
'考试题数'
,
biaozhun
:
'合格标准'
,
guize
:
'出题规则'
,
}
},
defaultImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'morentouxiang-w.png'
},
buttonStyle
()
{
return
{
height
:
'104rpx'
,
width
:
'312rpx'
,
backgroundColor
:
'#FFFFFF'
,
color
:
'#5A6073'
,
fontSize
:
'28rpx'
,
fontWeight
:
'bold'
,
borderRadius
:
'24rpx'
,
}
},
isPass
()
{
return
this
.
info
.
score
>
60
},
resultText
()
{
return
this
.
isPass
?
'合格'
:
'不合格'
},
backImage
()
{
return
this
.
isPass
?
this
.
hegechengjiImage
:
this
.
buhegechengjiImage
},
qrcodeImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'buhegechengji.png'
},
hegechengjiImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'hegechengji.png'
},
buhegechengjiImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'buhegechengji.png'
},
pengyunquanImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'pengyunquan.png'
},
weixinImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'weixin.png'
},
},
onLoad
()
{
this
.
info
=
{
name
:
'我就是昵称'
,
image
:
''
,
score
:
80
,
percent
:
60
,
time
:
1626402760689
,
category
:
'高处安装、维护、拆除作业人员'
,
type
:
'模拟考试'
,
}
},
methods
:
{
handleClick
()
{},
handleClickRecord
()
{},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
::-webkit-scrollbar
{
width
:
0
;
height
:
0
;
color
:
transparent
;
display
:
none
;
}
.score-view
{
display
:
flex
;
flex-direction
:
column
;
height
:
100vh
;
background-color
:
#f7f9fc
;
.top-view
{
background-color
:
rgba
(
250
,
90
,
73
,
0
.1
);
color
:
#5a6073
;
font-weight
:
28rpx
;
height
:
72rpx
;
text-align
:
center
;
line-height
:
72rpx
;
.blue-text
{
color
:
#2953ff
;
}
}
.content
{
height
:
100%
;
overflow
:
auto
;
padding
:
64rpx
48rpx
56rpx
48rpx
;
.content-view
{
background-color
:
#ffffff
;
border-radius
:
24rpx
;
position
:
relative
;
overflow
:
hidden
;
z-index
:
1
;
.back-image
{
position
:
absolute
;
width
:
100%
;
z-index
:
-1
;
}
.chart-view
{
text-align
:
center
;
margin-top
:
76rpx
;
.progress-view
{
.progress-content
{
margin-top
:
50rpx
;
.progress-score
{
font-size
:
80rpx
;
font-weight
:
bold
;
color
:
#ffffff
;
}
.progress-info
{
font-size
:
28rpx
;
color
:
#ffffff
;
}
.percent-text
{
margin-top
:
6px
;
font-size
:
28rpx
;
color
:
#ffffff
;
}
}
}
}
.head-view
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#191c27
;
flex-direction
:
column
;
margin-bottom
:
50rpx
;
margin-top
:
58rpx
;
.image-view
{
margin-bottom
:
24rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
padding
:
4rpx
;
width
:
140rpx
;
height
:
140rpx
;
background-color
:
#ffffff
;
border-radius
:
140rpx
;
.image
{
width
:
136rpx
;
height
:
136rpx
;
border-radius
:
136rpx
;
}
}
.time-view
{
margin-top
:
6rpx
;
color
:
#5a6073
;
font-size
:
26rpx
;
}
}
.detail-view
{
padding
:
20rpx
0
;
text-align
:
center
;
.name-view
{
font-size
:
36rpx
;
font-weight
:
bold
;
color
:
#191c27
;
margin-bottom
:
16rpx
;
}
.type-view
{
font-size
:
28rpx
;
color
:
#5a6073
;
margin-bottom
:
30rpx
;
}
.qrcode-image
{
width
:
160rpx
;
height
:
160rpx
;
}
}
.tip-view
{
font-size
:
26rpx
;
color
:
#9ea5bb
;
margin
:
50rpx
0
210rpx
0
;
}
}
.bottom-view
{
margin-top
:
30rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-content
:
center
;
.share-image
{
width
:
48rpx
;
height
:
48rpx
;
margin-right
:
20rpx
;
}
}
}
}
</
style
>
src/pages/mine/info.vue
View file @
2a9c6ee0
...
@@ -109,7 +109,7 @@ export default {
...
@@ -109,7 +109,7 @@ export default {
if
(
data
.
errMsg
==
'request:ok'
)
{
if
(
data
.
errMsg
==
'request:ok'
)
{
this
.
token
=
data
.
data
.
token
//token为七牛云的token一般由后台接口提供
this
.
token
=
data
.
data
.
token
//token为七牛云的token一般由后台接口提供
}
else
{
}
else
{
console
.
log
(
'get token error'
)
console
.
log
(
'get token error'
,
data
)
}
}
})
})
},
},
...
...
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