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
ca20de08
Commit
ca20de08
authored
Jul 13, 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
6d3dfbf0
448a0312
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1022 additions
and
128 deletions
+1022
-128
.env.js
.env.js
+27
-26
index.vue
src/components/pop-view/index.vue
+136
-0
bmap-wx.min.js
src/libs/bmap-wx.min.js
+317
-0
manifest.json
src/manifest.json
+82
-76
pages.json
src/pages.json
+10
-0
addExam.vue
src/pages/learn/addExam.vue
+40
-18
examSetting.vue
src/pages/learn/examSetting.vue
+394
-0
selectCategory.vue
src/pages/learn/selectCategory.vue
+16
-8
No files found.
.env.js
View file @
ca20de08
(
function
()
{
let
NODE_ENV
=
'dev'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
;
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
ENV_VAR
=
require
(
'./.env.dev.js'
);
}
else
if
(
NODE_ENV
===
'test'
)
{
ENV_VAR
=
require
(
'./.env.test.js'
);
}
else
if
(
NODE_ENV
===
'prod'
)
{
ENV_VAR
=
require
(
'./.env.prod.js'
);
}
}
else
if
(
process
.
env
.
NODE_ENV
===
"production"
)
{
if
(
NODE_ENV
===
'test'
)
{
ENV_VAR
=
require
(
'./.env.test.js'
);
}
else
if
(
NODE_ENV
===
'prod'
)
{
ENV_VAR
=
require
(
'./.env.prod.js'
);
}
}
if
(
ENV_VAR
)
{
process
.
uniEnv
=
{};
process
.
uniEnv
[
'node_env'
]
=
NODE_ENV
;
for
(
let
key
in
ENV_VAR
)
{
process
.
uniEnv
[
key
]
=
ENV_VAR
[
key
];
}
}
})();
;(
function
()
{
let
NODE_ENV
=
'dev'
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
if
(
NODE_ENV
===
'dev'
)
{
ENV_VAR
=
require
(
'./.env.dev.js'
)
}
else
if
(
NODE_ENV
===
'test'
)
{
ENV_VAR
=
require
(
'./.env.test.js'
)
}
else
if
(
NODE_ENV
===
'prod'
)
{
ENV_VAR
=
require
(
'./.env.prod.js'
)
}
}
else
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
if
(
NODE_ENV
===
'test'
)
{
ENV_VAR
=
require
(
'./.env.test.js'
)
}
else
if
(
NODE_ENV
===
'prod'
)
{
ENV_VAR
=
require
(
'./.env.prod.js'
)
}
}
ENV_VAR
[
'bmapAK'
]
=
'lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI'
if
(
ENV_VAR
)
{
process
.
uniEnv
=
{}
process
.
uniEnv
[
'node_env'
]
=
NODE_ENV
for
(
let
key
in
ENV_VAR
)
{
process
.
uniEnv
[
key
]
=
ENV_VAR
[
key
]
}
}
})()
src/components/pop-view/index.vue
0 → 100644
View file @
ca20de08
<
template
>
<u-popup
border-radius=
"12"
v-model=
"visible"
safe-area-inset-bottom
mode=
"center"
width=
"654rpx"
:mask-close-able=
"false"
>
<view
class=
"pop-view"
>
<view
class=
"pop-title"
>
<text>
{{
title
}}
</text>
</view>
<view
class=
"pop-message"
>
<text>
{{
message
}}
</text>
</view>
<view
class=
"line-view"
/>
<view
class=
"pop-content"
>
<slot></slot>
</view>
<view
class=
"pop-btn-view"
>
<u-button
:custom-style=
"customStyleCancel"
hover-class=
"none"
shape=
"circle"
@
click=
"handleClickCancel"
>
取消
</u-button>
<u-button
:custom-style=
"customStyleSave"
shape=
"circle"
type=
"primary"
@
click=
"handleClickSure"
>
{{
buttonText
}}
</u-button>
</view>
</view>
</u-popup>
</
template
>
<
script
>
export
default
{
props
:
{
visible
:
Boolean
,
title
:
String
,
message
:
String
,
buttonText
:
{
// 确定按钮
type
:
String
,
default
:
'确定'
,
},
},
data
()
{
return
{}
},
computed
:
{
customStyleCancel
()
{
return
{
width
:
'264rpx'
,
height
:
'80rpx'
,
color
:
'#9EA5BB'
,
fontWeight
:
'bold'
,
fontSize
:
'32rpx'
,
}
},
customStyleSave
()
{
return
{
backgroundColor
:
'#2953FF'
,
width
:
'264rpx'
,
height
:
'80rpx'
,
color
:
'#ffffff'
,
fontWeight
:
'bold'
,
fontSize
:
'32rpx'
,
}
},
},
methods
:
{
changeVisibleValue
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
},
handleClickCancel
()
{
this
.
changeVisibleValue
(
false
)
this
.
$emit
(
'cancel'
)
},
handleClickSure
()
{
this
.
$emit
(
'submit'
)
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.pop-view
{
padding
:
48rpx
40rpx
;
min-height
:
520rpx
;
position
:
relative
;
.pop-title
{
font-size
:
40rpx
;
margin-bottom
:
30rpx
;
text-align
:
center
;
color
:
#191c27
;
font-weight
:
bold
;
}
.pop-message
{
font-size
:
28rpx
;
text-align
:
center
;
color
:
#5a6073
;
text-align
:
center
;
}
.pop-content
{
margin-bottom
:
140rpx
;
}
.line-view
{
background-color
:
#e8ebf3
;
height
:
2rpx
;
width
:
100%
;
margin-bottom
:
40rpx
;
margin-top
:
40rpx
;
}
.pop-btn-view
{
display
:
flex
;
padding-top
:
60rpx
;
align-items
:
center
;
justify-content
:
space-between
;
position
:
absolute
;
bottom
:
48rpx
;
left
:
40rpx
;
right
:
40rpx
;
}
}
</
style
>
src/libs/bmap-wx.min.js
0 → 100644
View file @
ca20de08
var
t
=
function
()
{
function
t
(
t
,
a
)
{
for
(
var
e
=
0
;
e
<
a
.
length
;
e
++
)
{
var
i
=
a
[
e
];
i
.
enumerable
=
i
.
enumerable
||
!
1
,
i
.
configurable
=
!
0
,
"value"
in
i
&&
(
i
.
writable
=
!
0
),
Object
.
defineProperty
(
t
,
i
.
key
,
i
);
}
}
return
function
(
a
,
e
,
i
)
{
return
e
&&
t
(
a
.
prototype
,
e
),
i
&&
t
(
a
,
i
),
a
;
};
}(),
a
=
function
()
{
function
a
(
t
)
{
(
function
(
t
,
a
)
{
if
(
!
(
t
instanceof
a
))
throw
new
TypeError
(
"Cannot call a class as a function"
);
})(
this
,
a
),
this
.
ak
=
t
.
ak
;
}
return
t
(
a
,
[
{
key
:
"getWXLocation"
,
value
:
function
(
t
,
a
,
e
,
i
)
{
t
=
t
||
"gcj02"
,
a
=
a
||
function
()
{},
e
=
e
||
function
()
{},
i
=
i
||
function
()
{},
wx
.
getLocation
({
type
:
t
,
success
:
a
,
fail
:
e
,
complete
:
i
});
}
},
{
key
:
"search"
,
value
:
function
(
t
)
{
var
a
=
{
query
:
(
t
=
t
||
{}).
query
||
"生活服务$美食&酒店"
,
scope
:
t
.
scope
||
1
,
filter
:
t
.
filter
||
""
,
coord_type
:
t
.
coord_type
||
2
,
page_size
:
t
.
page_size
||
10
,
page_num
:
t
.
page_num
||
0
,
output
:
t
.
output
||
"json"
,
ak
:
this
.
ak
,
sn
:
t
.
sn
||
""
,
timestamp
:
t
.
timestamp
||
""
,
radius
:
t
.
radius
||
2
e3
,
ret_coordtype
:
"gcj02ll"
},
e
=
{
iconPath
:
t
.
iconPath
,
iconTapPath
:
t
.
iconTapPath
,
width
:
t
.
width
,
height
:
t
.
height
,
alpha
:
t
.
alpha
||
1
,
success
:
t
.
success
||
function
()
{},
fail
:
t
.
fail
||
function
()
{}
},
i
=
function
(
t
)
{
a
.
location
=
t
.
latitude
+
","
+
t
.
longitude
,
wx
.
request
({
url
:
"https://api.map.baidu.com/place/v2/search"
,
data
:
a
,
header
:
{
"content-type"
:
"application/json"
},
method
:
"GET"
,
success
:
function
(
t
)
{
var
a
=
t
.
data
;
if
(
0
===
a
.
status
)
{
var
i
=
a
.
results
,
n
=
{};
n
.
originalData
=
a
,
n
.
wxMarkerData
=
[];
for
(
var
o
=
0
;
o
<
i
.
length
;
o
++
)
n
.
wxMarkerData
[
o
]
=
{
id
:
o
,
latitude
:
i
[
o
].
location
.
lat
,
longitude
:
i
[
o
].
location
.
lng
,
title
:
i
[
o
].
name
,
iconPath
:
e
.
iconPath
,
iconTapPath
:
e
.
iconTapPath
,
address
:
i
[
o
].
address
,
telephone
:
i
[
o
].
telephone
,
alpha
:
e
.
alpha
,
width
:
e
.
width
,
height
:
e
.
height
};
e
.
success
(
n
);
}
else
e
.
fail
({
errMsg
:
a
.
message
,
statusCode
:
a
.
status
});
},
fail
:
function
(
t
)
{
e
.
fail
(
t
);
}
});
};
if
(
t
.
location
)
{
var
n
=
t
.
location
.
split
(
","
)[
1
];
i
({
errMsg
:
"input location"
,
latitude
:
t
.
location
.
split
(
","
)[
0
],
longitude
:
n
});
}
else
this
.
getWXLocation
(
"gcj02"
,
i
,
function
(
t
)
{
e
.
fail
(
t
);
},
function
(
t
)
{});
}
},
{
key
:
"suggestion"
,
value
:
function
(
t
)
{
var
a
=
{
query
:
(
t
=
t
||
{}).
query
||
""
,
region
:
t
.
region
||
"全国"
,
city_limit
:
t
.
city_limit
||
!
1
,
output
:
t
.
output
||
"json"
,
ak
:
this
.
ak
,
sn
:
t
.
sn
||
""
,
timestamp
:
t
.
timestamp
||
""
,
ret_coordtype
:
"gcj02ll"
},
e
=
{
success
:
t
.
success
||
function
()
{},
fail
:
t
.
fail
||
function
()
{}
};
wx
.
request
({
url
:
"https://api.map.baidu.com/place/v2/suggestion"
,
data
:
a
,
header
:
{
"content-type"
:
"application/json"
},
method
:
"GET"
,
success
:
function
(
t
)
{
var
a
=
t
.
data
;
0
===
a
.
status
?
e
.
success
(
a
)
:
e
.
fail
({
errMsg
:
a
.
message
,
statusCode
:
a
.
status
});
},
fail
:
function
(
t
)
{
e
.
fail
(
t
);
}
});
}
},
{
key
:
"regeocoding"
,
value
:
function
(
t
)
{
var
a
=
{
coordtype
:
(
t
=
t
||
{}).
coordtype
||
"gcj02ll"
,
ret_coordtype
:
"gcj02ll"
,
radius
:
t
.
radius
||
1
e3
,
ak
:
this
.
ak
,
sn
:
t
.
sn
||
""
,
output
:
t
.
output
||
"json"
,
callback
:
t
.
callback
||
function
()
{},
extensions_poi
:
t
.
extensions_poi
||
1
,
extensions_road
:
t
.
extensions_road
||
!
1
,
extensions_town
:
t
.
extensions_town
||
!
1
,
language
:
t
.
language
||
"zh-CN"
,
language_auto
:
t
.
language_auto
||
0
},
e
=
{
iconPath
:
t
.
iconPath
,
iconTapPath
:
t
.
iconTapPath
,
width
:
t
.
width
,
height
:
t
.
height
,
alpha
:
t
.
alpha
||
1
,
success
:
t
.
success
||
function
()
{},
fail
:
t
.
fail
||
function
()
{}
},
i
=
function
(
t
)
{
a
.
location
=
t
.
latitude
+
","
+
t
.
longitude
,
wx
.
request
({
url
:
"https://api.map.baidu.com/reverse_geocoding/v3"
,
data
:
a
,
header
:
{
"content-type"
:
"application/json"
},
method
:
"GET"
,
success
:
function
(
a
)
{
var
i
=
a
.
data
;
if
(
0
===
i
.
status
)
{
var
n
=
i
.
result
,
o
=
{};
o
.
originalData
=
i
,
o
.
wxMarkerData
=
[],
o
.
wxMarkerData
[
0
]
=
{
id
:
0
,
latitude
:
t
.
latitude
,
longitude
:
t
.
longitude
,
address
:
n
.
formatted_address
,
iconPath
:
e
.
iconPath
,
iconTapPath
:
e
.
iconTapPath
,
desc
:
n
.
sematic_description
,
business
:
n
.
business
,
alpha
:
e
.
alpha
,
width
:
e
.
width
,
height
:
e
.
height
},
e
.
success
(
o
);
}
else
e
.
fail
({
errMsg
:
i
.
message
,
statusCode
:
i
.
status
});
},
fail
:
function
(
t
)
{
e
.
fail
(
t
);
}
});
};
if
(
t
.
location
)
{
var
n
=
t
.
location
.
split
(
","
)[
1
];
i
({
errMsg
:
"input location"
,
latitude
:
t
.
location
.
split
(
","
)[
0
],
longitude
:
n
});
}
else
this
.
getWXLocation
(
"gcj02"
,
i
,
function
(
t
)
{
e
.
fail
(
t
);
},
function
(
t
)
{});
}
},
{
key
:
"geocoding"
,
value
:
function
(
t
)
{
var
a
=
{
address
:
(
t
=
t
||
{}).
address
||
""
,
city
:
t
.
city
||
""
,
ret_coordtype
:
t
.
coordtype
||
"gcj02ll"
,
ak
:
this
.
ak
,
sn
:
t
.
sn
||
""
,
output
:
t
.
output
||
"json"
,
callback
:
t
.
callback
||
function
()
{}
},
e
=
{
iconPath
:
t
.
iconPath
,
iconTapPath
:
t
.
iconTapPath
,
width
:
t
.
width
,
height
:
t
.
height
,
alpha
:
t
.
alpha
||
1
,
success
:
t
.
success
||
function
()
{},
fail
:
t
.
fail
||
function
()
{}
};
if
(
t
.
address
)
wx
.
request
({
url
:
"https://api.map.baidu.com/geocoding/v3"
,
data
:
a
,
header
:
{
"content-type"
:
"application/json"
},
method
:
"GET"
,
success
:
function
(
t
)
{
var
a
=
t
.
data
;
if
(
0
===
a
.
status
)
{
var
i
=
a
.
result
,
n
=
a
;
n
.
originalData
=
a
,
n
.
wxMarkerData
=
[],
n
.
wxMarkerData
[
0
]
=
{
id
:
0
,
latitude
:
i
.
location
.
lat
,
longitude
:
i
.
location
.
lng
,
iconPath
:
e
.
iconPath
,
iconTapPath
:
e
.
iconTapPath
,
alpha
:
e
.
alpha
,
width
:
e
.
width
,
height
:
e
.
height
},
e
.
success
(
n
);
}
else
e
.
fail
({
errMsg
:
a
.
message
,
statusCode
:
a
.
status
});
},
fail
:
function
(
t
)
{
e
.
fail
(
t
);
}
});
else
{
e
.
fail
({
errMsg
:
"input address!"
});
}
}
},
{
key
:
"weather"
,
value
:
function
(
t
)
{
var
a
=
{
coord_type
:
(
t
=
t
||
{}).
coord_type
||
"gcj02"
,
output
:
t
.
output
||
"json"
,
ak
:
this
.
ak
,
sn
:
t
.
sn
||
""
,
timestamp
:
t
.
timestamp
||
""
},
e
=
{
success
:
t
.
success
||
function
()
{},
fail
:
t
.
fail
||
function
()
{}
},
i
=
function
(
t
)
{
a
.
location
=
t
.
longitude
+
","
+
t
.
latitude
,
wx
.
request
({
url
:
"https://api.map.baidu.com/telematics/v3/weather"
,
data
:
a
,
header
:
{
"content-type"
:
"application/json"
},
method
:
"GET"
,
success
:
function
(
t
)
{
var
a
=
t
.
data
;
if
(
0
===
a
.
error
&&
"success"
===
a
.
status
)
{
var
i
=
a
.
results
,
n
=
{};
n
.
originalData
=
a
,
n
.
currentWeather
=
[],
n
.
currentWeather
[
0
]
=
{
currentCity
:
i
[
0
].
currentCity
,
pm25
:
i
[
0
].
pm25
,
date
:
i
[
0
].
weather_data
[
0
].
date
,
temperature
:
i
[
0
].
weather_data
[
0
].
temperature
,
weatherDesc
:
i
[
0
].
weather_data
[
0
].
weather
,
wind
:
i
[
0
].
weather_data
[
0
].
wind
},
e
.
success
(
n
);
}
else
e
.
fail
({
errMsg
:
a
.
message
,
statusCode
:
a
.
status
});
},
fail
:
function
(
t
)
{
e
.
fail
(
t
);
}
});
};
if
(
t
.
location
)
{
var
n
=
t
.
location
.
split
(
","
)[
0
];
i
({
errMsg
:
"input location"
,
latitude
:
t
.
location
.
split
(
","
)[
1
],
longitude
:
n
});
}
else
this
.
getWXLocation
(
"gcj02"
,
i
,
function
(
t
)
{
e
.
fail
(
t
);
},
function
(
t
)
{});
}
}
]),
a
;
}();
module
.
exports
.
BMapWX
=
a
;
\ No newline at end of file
src/manifest.json
View file @
ca20de08
{
"name"
:
""
,
"appid"
:
""
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"app-plus"
:
{
/*
5
+App特有相关
*/
"usingComponents"
:
true
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
true
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
"modules"
:
{
/*
模块配置
*/
},
"distribute"
:
{
/*
应用发布信息
*/
"android"
:
{
/*
android打包配置
*/
"permissions"
:
[
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_CONTACTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_CONTACTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.RECORD_AUDIO
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CALL_PHONE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_COARSE_LOCATION
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_FINE_LOCATION
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
]
},
"ios"
:
{
/*
ios打包配置
*/
},
"sdkConfigs"
:
{
/*
SDK配置
*/
}
}
},
"quickapp"
:
{
/*
快应用特有相关
*/
},
"mp-weixin"
:
{
/*
微信小程序特有相关
*/
"appid"
:
"wxfd20fa0ca340284b"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
true
},
"usingComponents"
:
true
},
"mp-alipay"
:
{
"usingComponents"
:
true
},
"mp-baidu"
:
{
"usingComponents"
:
true
},
"mp-toutiao"
:
{
"usingComponents"
:
true
},
"mp-qq"
:
{
"usingComponents"
:
true
}
}
{
"name"
:
""
,
"appid"
:
""
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"app-plus"
:
{
/*
5
+App特有相关
*/
"usingComponents"
:
true
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
true
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
"modules"
:
{},
/*
模块配置
*/
"distribute"
:
{
/*
应用发布信息
*/
"android"
:
{
/*
android打包配置
*/
"permissions"
:
[
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_CONTACTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_CONTACTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.RECORD_AUDIO
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CALL_PHONE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_COARSE_LOCATION
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_FINE_LOCATION
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
]
},
"ios"
:
{},
/*
ios打包配置
*/
"sdkConfigs"
:
{}
}
},
/*
SDK配置
*/
"quickapp"
:
{},
/*
快应用特有相关
*/
"mp-weixin"
:
{
/*
微信小程序特有相关
*/
"appid"
:
"wxfd20fa0ca340284b"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
true
},
"usingComponents"
:
true
,
"permission"
:
{
"scope.userLocation"
:
{
"desc"
:
"您的位置信息将用于默认对应区域题库的选择"
}
}
},
"mp-alipay"
:
{
"usingComponents"
:
true
},
"mp-baidu"
:
{
"usingComponents"
:
true
},
"mp-toutiao"
:
{
"usingComponents"
:
true
},
"mp-qq"
:
{
"usingComponents"
:
true
}
}
src/pages.json
View file @
ca20de08
...
...
@@ -74,6 +74,16 @@
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
},
{
"path"
:
"examSetting"
,
"name"
:
"learnExamSetting"
,
"style"
:
{
"navigationBarTitleText"
:
"选择题库-设置"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
]
},
...
...
src/pages/learn/addExam.vue
View file @
ca20de08
...
...
@@ -11,7 +11,7 @@
<!-- 类别 -->
<view>
<view
class=
"category-view"
>
<text>
{{
category
.
name
}}
</text>
<text>
{{
category
.
name
}}
</text>
</view>
</view>
<view
class=
"label-title"
>
...
...
@@ -25,11 +25,16 @@
<view>
{{
label
.
name
}}
</view>
<view
class=
"label-text"
>
共
<text
class=
"label-blue"
>
{{
label
.
quantity
}}
</text>
道精编试题,通过率
<text
class=
"label-blue"
>
{{
label
.
quantity
}}
</text
>
道精编试题,通过率
<text
class=
"label-blue"
>
{{
label
.
pass
}}
</text>
</view>
</view>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick(index)"
>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick(index)"
type=
"primary"
>
<u-icon
name=
"plus"
></u-icon>
添加
</u-button>
</view>
...
...
@@ -38,25 +43,29 @@
<view
class=
"tag-loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<!-- 无供应商、无品牌 -->
<view
class=
"tag-loading-view"
v-else-if=
"list.length
<
=
0
"
>
暂无数据
</view>
<!-- 无数据 -->
<view
class=
"tag-loading-view"
v-else-if=
"list.length
<
=
0
"
>
暂无数据
</view
>
</view>
</view>
</
template
>
<
script
>
import
uButton
from
'../../uview-ui/components/u-button/u-button.vue
'
import
UIcon
from
'../../uview-ui/components/u-icon/u-icon.vue
'
const
key2
=
'2
'
const
key3
=
'3
'
export
default
{
components
:
{
uButton
,
UIcon
},
data
()
{
return
{
category
:
{},
list
:
[],
// 题库列表
loading
:
true
,
selected
:
{},
}
},
computed
:
{
category
()
{
return
this
.
selected
[
key2
]
},
buttonStyle
()
{
return
{
width
:
'120rpx'
,
...
...
@@ -69,18 +78,17 @@ export default {
},
},
onLoad
(
e
)
{
if
(
e
&&
e
.
name
)
{
this
.
category
.
name
=
decodeURIComponent
(
e
.
name
)
}
if
(
e
&&
e
.
id
)
{
this
.
category
.
id
=
e
.
id
}
this
.
getPageInfo
()
this
.
loadList
()
// 获取题库列表
},
methods
:
{
// 点击了添加按钮
handleClick
(
index
)
{
this
.
selected
[
key
]
=
label
this
.
selected
[
key3
]
=
this
.
list
[
index
]
this
.
setPageInfo
(
this
.
selected
)
this
.
$u
.
route
({
url
:
'pages/learn/examSetting'
,
})
},
// 获取题库列表
loadList
()
{
...
...
@@ -97,10 +105,26 @@ export default {
name
:
'登高架设作业'
,
quantity
:
'80000'
,
pass
:
'98%'
,
id
:
i
,
})
}
// }
},
// 本页数据设置,用于其他页面访问本页数据
setPageInfo
(
info
)
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
1
)
{
var
page
=
pages
[
pages
.
length
-
1
]
page
.
info
=
info
}
},
getPageInfo
()
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
]
this
.
selected
=
page
.
info
}
},
},
}
</
script
>
...
...
@@ -165,9 +189,7 @@ export default {
font-size
:
36rpx
;
color
:
#191c27
;
font-weight
:
bold
;
word-break
:
break-all
;
.label-text
{
margin-top
:
24rpx
;
font-size
:
26rpx
;
...
...
src/pages/learn/examSetting.vue
0 → 100644
View file @
ca20de08
<
template
>
<view
class=
"exam-setting"
>
<u-navbar
back-icon-color=
"#333333"
background=
"transparent"
titleColor=
"#191C27"
:border-bottom=
"false"
title-bold
></u-navbar>
<!-- 类别 -->
<view>
<view
class=
"title-view"
>
<text>
{{
category
.
name
}}
</text>
</view>
</view>
<view
class=
"exam-type"
>
<view>
备考类型
</view>
<view
class=
"radio-view"
>
<view
v-for=
"(item, index) in types"
:key=
"index"
:class=
"['item-view',
{ selected: item.selected }]"
@click="handleClick(item.id)"
>
<view
:class=
"['radio-item-view',
{ selected: item.selected }]">
<u-icon
name=
"checkbox-mark"
:class=
"['item-icon',
{ selected: item.selected }]"
>
</u-icon>
<text>
{{
item
.
name
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"exam-area"
>
<view
class=
"area-title-view"
>
<text
class=
"rea-title-view"
>
包括区域
</text>
<text>
请确认与所在考试省份一致
</text>
</view>
<view
class=
"select-area"
>
<view
@
click=
"handleClickArea"
class=
"area-text-view"
>
<text>
{{
selectedProvince
.
label
}}
</text>
<u-icon
name=
"arrow-down"
></u-icon>
</view>
<view
class=
"loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<u-picker
mode=
"region"
v-model=
"show"
:params=
"params"
:default-region=
"defaultRegion"
@
confirm=
"handleConform"
></u-picker>
</view>
</view>
<view
class=
"bottom-view"
>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClickSure"
shape=
"circle"
:disabled=
"buttonDisabled"
:type=
"buttonDisabled ? '' : 'primary'"
>
确定
</u-button>
</view>
<PopView
:visible
.
sync=
"showPop"
title=
"确认选择"
message=
"题库确认后不可更改,请查看确认"
@
submit=
"handleClickSubmit"
>
<view
v-for=
"(value, key) in selected"
:key=
"key"
class=
"pop-content"
>
<view
:class=
"['pop-content-text',
{ last: key == thirdKey }]">
{{
value
.
name
}}
</view>
<u-icon
v-if=
"key != thirdKey"
name=
"arrow-downward"
></u-icon>
</view>
</PopView>
</view>
</
template
>
<
script
>
import
PopView
from
'@/components/pop-view'
let
r
=
require
(
'../../libs/bmap-wx.min.js'
)
let
h
=
new
r
.
BMapWX
({
ak
:
process
.
uniEnv
.
bmapAK
,
})
const
key1
=
'1'
const
key2
=
'2'
const
key3
=
'3'
export
default
{
components
:
{
PopView
,
},
data
()
{
return
{
selected
:
{},
list
:
[],
// 题库列表
show
:
false
,
value
:
''
,
types
:
[
{
id
:
'1'
,
name
:
'初训(初次考试)'
,
selected
:
false
},
{
id
:
'2'
,
name
:
'复训(年审或换证)'
,
selected
:
false
},
],
selectedProvince
:
{
label
:
'北京市'
,
value
:
11
},
loading
:
true
,
showPop
:
false
,
selectedCategorys
:
[
{
name
:
'特种作业人员'
,
id
:
0
},
{
name
:
'高处作业'
,
id
:
0
},
{
name
:
'高处作业'
,
id
:
0
},
],
}
},
computed
:
{
category
()
{
return
this
.
selected
[
key3
]
},
params
()
{
return
{
province
:
true
,
}
},
defaultRegion
()
{
console
.
log
(
'---------this.selectedProvince.value-------'
,
this
.
selectedProvince
.
label
)
return
[
this
.
selectedProvince
.
label
]
},
buttonStyle
()
{
return
this
.
buttonDisabled
?
{
height
:
'104rpx'
,
color
:
'#FFFFFF'
,
fontSize
:
'32rpx'
,
fontWeight
:
'bold'
,
backgroundColor
:
'#D2D5DE'
,
}
:
{
height
:
'104rpx'
,
color
:
'#FFFFFF'
,
fontSize
:
'32rpx'
,
fontWeight
:
'bold'
,
backgroundColor
:
'#2953FF'
,
}
},
buttonDisabled
()
{
return
!
(
this
.
selectedProvince
.
label
&&
this
.
selectedType
)
},
selectedType
()
{
for
(
var
item
of
this
.
types
)
{
if
(
item
.
selected
==
true
)
{
return
true
}
}
return
false
},
thirdKey
()
{
return
key3
},
},
onLoad
(
e
)
{
this
.
getPageInfo
()
this
.
getLocation
()
},
methods
:
{
// 选中某个单选框时,由radio时触发
radioChange
(
e
)
{
// console.log(e);
},
// 选中任一radio时,由radio-group触发
radioGroupChange
(
e
)
{
// console.log(e);
},
handleClickArea
()
{
this
.
loading
=
false
this
.
show
=
true
},
// 点击了添加按钮
handleClick
(
selectedId
)
{
for
(
var
item
of
this
.
types
)
{
console
.
log
(
item
,
selectedId
)
item
.
selected
=
item
.
id
==
selectedId
}
},
handleConform
(
e
)
{
console
.
log
(
e
)
this
.
selectedProvince
=
e
.
province
},
getLocation
()
{
this
.
loading
=
true
uni
.
getLocation
({
type
:
'wgs84'
,
success
:
(
res
)
=>
{
console
.
log
(
'当前位置的经度:'
+
res
.
longitude
)
console
.
log
(
'当前位置的纬度:'
+
res
.
latitude
)
this
.
baiduLocation
(
res
.
longitude
,
res
.
latitude
)
},
fail
:
()
=>
{
this
.
loading
=
false
},
})
},
handleClickSure
()
{
console
.
log
(
'---------handleClickSure----------'
)
this
.
showPop
=
true
},
handleClickSubmit
()
{
this
.
showPop
=
false
},
baiduLocation
(
long
,
lat
)
{
let
a
=
this
,
t
=
function
()
{
let
t
=
{
success
:
function
(
res
)
{
let
e
=
res
.
originalData
.
result
a
.
selectedProvince
.
label
=
e
.
addressComponent
.
province
a
.
loading
=
false
},
fail
:
function
(
a
)
{
a
.
loading
=
false
// n.error(a), console.log(a);
},
}
if
(
lat
&&
long
)
{
let
e
=
lat
+
','
+
long
t
.
location
=
e
}
h
.
regeocoding
(
t
)
}
t
()
},
// 本页数据设置,用于其他页面访问本页数据
setPageInfo
(
info
)
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
1
)
{
var
page
=
pages
[
pages
.
length
-
1
]
page
.
info
=
info
}
},
getPageInfo
()
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
]
this
.
selected
=
page
.
info
}
},
// 获取报考类型
// async loadList() {
// this.loading = true;
// let res = await this.$u.api.fileLabel({categoryId: this.category.id});
// this.loading = false
// if (res && res.code == 200) {
// this.list = res.data || [];
// }
// },
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.exam-setting
{
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
background-color
:
#f8fafd
;
background-image
:
linear-gradient
(
to
top
,
#f8fafd
0%
,
#e9f3ff
50%
);
background-size
:
100%
520rpx
;
background-repeat
:
no-repeat
;
padding
:
0
24rpx
;
.title-view
{
width
:
100%
;
font-size
:
48rpx
;
font-weight
:
bold
;
color
:
#191c27
;
margin-bottom
:
60rpx
;
}
.exam-type
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#191c27
;
.radio-view
{
margin-top
:
30rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-content
:
center
;
margin-bottom
:
50rpx
;
.item-view
{
display
:
flex
;
justify-content
:
flex-start
;
align-content
:
center
;
.radio-item-view
{
font-size
:
28rpx
;
color
:
#5a6073
;
font-weight
:
bold
;
display
:
flex
;
align-items
:
center
;
height
:
104rpx
;
width
:
340rpx
;
border-radius
:
12rpx
;
background-color
:
#ffffff
;
padding-left
:
24rpx
;
&
.selected
{
border
:
2rpx
solid
#2953ff
;
color
:
#2953ff
;
}
.item-icon
{
border
:
2rpx
solid
#9ea5bb
;
background-color
:
transparent
;
color
:
transparent
;
border-radius
:
36rpx
;
width
:
36rpx
;
height
:
36rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
margin-right
:
16rpx
;
flex-shrink
:
0
;
&
.selected
{
border
:
2rpx
solid
#2953ff
;
color
:
#ffffff
;
background-color
:
#2953ff
;
}
}
}
}
}
}
.exam-area
{
height
:
100%
;
overflow
:
auto
;
.area-title-view
{
display
:
flex
;
justify-content
:
space-between
;
align-content
:
flex-end
;
font-size
:
26rpx
;
color
:
#9ea5bb
;
margin-bottom
:
30rpx
;
.rea-title-view
{
color
:
#191c27
;
font-size
:
32rpx
;
font-weight
:
bold
;
}
}
.select-area
{
position
:
relative
;
.area-text-view
{
height
:
104rpx
;
background-color
:
#ffffff
;
border-radius
:
12rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
font-size
:
28rpx
;
color
:
#5a6073
;
padding
:
0
24rpx
;
}
.loading-view
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
absolute
;
left
:
24rpx
;
top
:
0
;
height
:
104rpx
;
width
:
100rpx
;
background-color
:
#ffffff
;
}
}
}
.bottom-view
{
padding-bottom
:
44rpx
;
}
.pop-content
{
margin-bottom
:
10rpx
;
text-align
:
center
;
color
:
#9ea5bb
;
.pop-content-text
{
margin-bottom
:
10rpx
;
font-weight
:
bold
;
font-size
:
32rpx
;
&
.last
{
color
:
#2953ff
;
}
}
}
}
</
style
>
src/pages/learn/selectCategory.vue
View file @
ca20de08
...
...
@@ -21,7 +21,10 @@
<view
:class=
"[
'label-normal',
{ 'selected': label.id == selected[key].id, 'wide': key == secondKey },
{
selected: label.id == selected[key].id,
wide: key == secondKey,
},
]"
@click="handleClick(key, label)"
>
...
...
@@ -34,11 +37,12 @@
<view
class=
"tag-loading-view"
v-if=
"tapLoading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<!-- 无
供应商、无品牌
-->
<!-- 无
数据
-->
<view
class=
"tag-loading-view"
v-else-if=
"item.length
<
=
0
&&
titles
[
key
]"
>
{{
"暂无"
+
selected
[
key1
].
name
}}
</view>
>
{{
'暂无'
+
selected
[
key1
].
name
}}
</view
>
</view>
</view>
</
template
>
...
...
@@ -88,13 +92,9 @@ export default {
this
.
loadLabel
(
key2
,
label
.
id
)
// 获取二级标签
}
else
{
// 选中二级标签
this
.
setPageInfo
(
this
.
selected
)
this
.
$u
.
route
({
type
:
'redirect'
,
url
:
'pages/learn/addExam'
,
params
:
{
name
:
'金属冶炼(有色金属冶炼<除铜、铝、铅、锌之外的其他有色金属>'
,
id
:
'888'
,
},
})
}
},
...
...
@@ -134,6 +134,14 @@ export default {
}
// }
},
// 本页数据设置,用于其他页面访问本页数据
setPageInfo
(
info
)
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
1
)
{
var
page
=
pages
[
pages
.
length
-
1
]
page
.
info
=
info
}
},
},
}
</
script
>
...
...
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