Bläddra i källkod

选择试卷页面

xionghaojie 3 år sedan
förälder
incheckning
cbba894e5c

+ 6 - 0
pages.json

@@ -41,6 +41,12 @@
 			"style": {
 				"navigationBarTitleText": ""
 			}
+		},
+		{
+			"path": "pages/selectTest/selectTest",
+			"style": {
+				"navigationBarTitleText": "选择试卷"
+			}
 		}
 		
     ],

+ 0 - 0
pages/index/index.css


+ 0 - 200
pages/index/index.vue

@@ -1,200 +0,0 @@
-<template>
-	<view>
-		<Headers></Headers>
-		<view class="content wrap dflex">
-			<Left-nav currentTab="index"></Left-nav>
-			<view class="right">
-				<view class="c-title">概况</view>
-				<view class="idx-nav dflex">
-					<navigator url="/pages/declareHonor/declareHonor" hover-class="none" class="li"><image src="../../static/images/sy_honor.png"></image></navigator>
-					<navigator url="/pages/declareFunds/declareFunds" hover-class="none" class="li"><image src="../../static/images/sy_declare.png"></image></navigator>
-				</view>
-				<view class="c-box hb-box">
-					<view class="sj-tits dflex">
-						<view class="flex">文旅红榜</view>
-						<navigator url="/pages/boardContent/boardContent" hover-class="none" class="sj-more">查看全部</navigator>
-					</view>
-					<view class="hb-list dflex">
-						<view v-if="index <= 5" v-for="(item, index) in moneyDeclareList" :key="index" @click="jumpUrl('/pages/content/content?id=' + item.id)" class="li dflex">
-							<image :src="'../../static/images/bdico' + getRandom() + '.png'"></image>
-							<view class="flex">
-								<view class="hb-tit tover">{{ item.title }}</view>
-								<view class="hb-bri tover">{{ removeHtmlStyle(item.text) }}</view>
-							</view>
-						</view>
-					</view>
-				</view>
-				<view class="c-box gk-info dflex">
-					<view class="li dflex">
-						<image src="../../static/images/idxico1.png"></image>
-						<view>
-							<text>累计营收</text>
-							¥{{ indexData.money ? indexData.money : '0.00' }}
-						</view>
-					</view>
-					<view class="li dflex">
-						<image src="../../static/images/idxico2.png"></image>
-						<view>
-							<text>累计客流量</text>
-							{{ indexData.person ? indexData.person : 0 }}
-						</view>
-					</view>
-					<view class="li dflex" @click="jumpUrl('/pages/personal/personal')">
-						<image src="../../static/images/idxico3.png"></image>
-						<view>
-							<text>人力资源</text>
-							{{ indexData.humanResources ? indexData.humanResources : 0 }}
-						</view>
-					</view>
-					<view class="li dflex" @click="jumpUrl('/pages/materials/materials')">
-						<image src="../../static/images/idxico4.png"></image>
-						<view>
-							<text>物资资源</text>
-							{{ indexData.material ? indexData.material : 0 }}
-						</view>
-					</view>
-					<view class="li dflex" @click="jumpUrl('/pages/complaint/complaint')">
-						<image src="../../static/images/idxico5.png"></image>
-						<view>
-							<text>累计投诉</text>
-							{{ indexData.complaint ? indexData.complaint : 0 }}
-						</view>
-					</view>
-				</view>
-				<view class="c-box sy-box">
-					<view class="sj-tit">营收额</view>
-					<view class="sye">
-						<view class="canvasView">
-							<!-- :echartsH5="true" :echartsApp="true" -->
-							<qiun-data-charts
-								type="line"
-								:chartData="Line"
-								:opts="{
-									legend: {
-										show: false
-									},
-									yAxis: {
-										showTitle: true,
-										data: [{ title: '单位(元)', titleOffsetY: -8 }]
-									}
-								}"
-							/>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<Foot></Foot>
-	</view>
-</template>
-<script>
-const app = getApp();
-const req = require('../../utils/request.js');
-const utils = require('../../utils/util.js');
-export default {
-	data() {
-		return {
-			indexData: '',
-			Line: {},
-			form: {
-				page: 1,
-				limit: 10
-			},
-			moneyDeclareList: []
-		};
-	},
-	onLoad() {
-		this.getHongBList();
-	},
-
-	onShow() {
-		let userInfo = req.getStorage('userInfo');
-		if (userInfo.type!=1&&userInfo.institutionState != 2) {
-			uni.navigateTo({
-				url: '/pages/company/company'
-			});
-		}
-		if(userInfo.type==1){
-			uni.navigateTo({
-				url: '/pages/learn/learn'
-			});
-			return 
-		}
-		this.getData();
-	},
-
-	methods: {
-		jumpUrl(url) {
-			uni.navigateTo({
-				url: url
-			});
-		},
-
-		removeHtmlStyle(text) {
-			var str = '';
-			if (text) {
-				str = utils.removeHtml(text);
-			}
-			return str;
-		},
-
-		getRandom() {
-			return parseInt(Math.random() * 3 + 1);
-		},
-
-		getHongBList() {
-			var formP = this.form;
-			formP.code = 'wenlvhonbang';
-			return new Promise((resolve, reject) => {
-				req.getRequest('/api/v3/content/page', formP, data => {
-					//资金申报公告
-					this.moneyDeclareList = data.list;
-					resolve();
-				});
-			});
-		},
-
-		getData() {
-			req.getRequest('/api/v3/hy/indexData/get', {}, data => {
-				this.indexData = data;
-				if (data.monitors && data.monitors.length > 0) {
-					this.Line = this.setStyleLine(data.monitors);
-				}
-			});
-		},
-
-		setStyleLine(data) {
-			var line = {};
-			if (data && data.length > 0) {
-				//获取时间轴数据;
-				line.categories = data.map(it => {
-					return it.name;
-				});
-				line.series = [];
-				var seriesItem = {};
-				var list = data.map(itx => {
-					return itx.value;
-				});
-				seriesItem.name = '';
-				seriesItem.data = list;
-				line.series.push(seriesItem);
-			}
-			return line;
-		}
-	}
-};
-</script>
-
-<style>
-.ec-canvas {
-	display: flex;
-	width: 100%;
-	height: 100%;
-	flex: 1;
-}
-.canvasView {
-	width: 100%;
-	margin-top: 30rpx;
-	height: 100%;
-}
-</style>

+ 2 - 1
pages/login/login.vue

@@ -186,7 +186,8 @@ export default {
 					
 					// 直接考试,是否允许考试
 					uni.navigateTo({
-						url: '/pages/test/test?paperId='+this.paperId,
+						// url: '/pages/test/test?paperId='+this.paperId,
+						url: '/pages/selectTest/selectTest?paperId='+this.paperId,
 						success:()=> {
 							this.close()
 						}

+ 181 - 0
pages/selectTest/selectTest.css

@@ -0,0 +1,181 @@
+.project {
+	height: 70px;
+	line-height: 70px;
+	background: #1AA1E6;
+	font-size: 24px;
+	color: #FFFFFF;
+	font-weight: bold;
+}
+
+.project-content {
+	margin: 38px 0;
+	justify-content: center;
+	align-items: stretch;
+}
+
+/* 考试 */
+.test-box {
+	width: 890px;
+	/* min-height: 812px; */
+	background: #FFFFFF;
+	border-radius: 0px 0px 0px 0px;
+	opacity: 1;
+	border: 3px solid #FFFFFF;
+	position: relative;
+	padding: 30px;
+	box-sizing: border-box;
+}
+
+.test-title {
+	font-size: 30px;
+	font-family: Source Han Sans CN-Bold, Source Han Sans CN;
+	font-weight: bold;
+	color: #333333;
+	line-height: 36px;
+	text-align: center;
+	margin-bottom: 30px;
+}
+
+.test-time {
+	text-align: center;
+	margin-top: 10px;
+	font-size: 14px;
+}
+
+.yj-icon {
+	width: 77px;
+	height: 81px;
+	margin: 76px auto 0;
+}
+
+.yj-label {
+	text-align: center;
+	font-size: 18px;
+	margin-top: 18px;
+}
+.chufen-number{
+	color: #F45D44;
+	font-size: 46px;
+	margin: 76px auto 0;
+	text-align: center;
+}
+.score {
+	justify-content: center;
+	margin-top: 30px;
+	margin-bottom: 60px;
+	padding-left: 30px;
+}
+.score-label{
+	font-size: 16px;
+	color: #999999;
+}
+.score-value{
+	font-size: 24px;
+	color: #1AA1E6;
+	margin-top: 20px;
+}
+.line{
+	width: 1px;
+	height: 57px;
+	color: #DEDEDE;
+	background-color: #DEDEDE;
+	margin: 0 30px;
+}
+.back-btn{
+	width: 190px;
+	height: 46px;
+	background: #F5F5F5;
+	border-radius: 50px 50px 50px 50px;
+	opacity: 1;
+	font-size: 14px;
+	justify-content: center;
+	margin:200px auto 0;
+}
+.back-btn image{
+	width: 19px;
+	height: 15px;
+	margin-right: 10px;
+}
+
+
+.test-info {
+	width: 280px;
+	flex-direction: column;
+	margin-left: 30px;
+}
+
+/* 考试信息 */
+.test-people {
+	width: 100%;
+	background-color: #FFFFFF;
+	padding: 12px 11px;
+	box-sizing: border-box;
+}
+
+.test-people image {
+	width: 80px;
+	height: 89px;
+	margin-right: 19px;
+}
+
+.test-people-info {
+	flex-direction: column;
+	justify-content: space-between;
+	font-size: 14px;
+	flex: 1;
+	align-items: flex-start;
+}
+
+.test-people-label {
+	color: #999999;
+	line-height: 36px;
+	margin-right: 8px;
+}
+
+/* 考试公告 */
+.note-box {
+	width: 100%;
+	background-color: #FFFFFF;
+	padding: 20px;
+	box-sizing: border-box;
+	margin-top: 20px;
+}
+
+.note-title {
+	margin-bottom: 18px;
+	font-size: 16px;
+}
+
+.note-title-icon {
+	width: 18px;
+	height: 18px;
+	margin-right: 10px;
+}
+
+.note-item {
+	justify-content: space-between;
+	font-size: 12px;
+	font-weight: 400;
+	line-height: 30px;
+	font-family: Source Han Sans CN-Regular, Source Han Sans CN;
+	cursor: pointer;
+}
+
+.note-item-content {
+	color: #666666;
+	flex: 1;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	margin-right: 10px;
+	padding: 0 10px;
+}
+
+.note-item-content:hover {
+	text-decoration: underline #666666;
+	background-color: #ededed;
+}
+
+.note-item-date {
+	color: #999999;
+}

+ 138 - 0
pages/selectTest/selectTest.vue

@@ -0,0 +1,138 @@
+<template>
+	<view>
+		<Headers></Headers>
+		<view class="project">
+			<view style="width: 1200px;margin: auto;">在线考试系统</view>
+		</view>
+		
+		<view class="project-content ddflex">
+			<!-- 成绩区域 -->
+			<view class="test-box">
+				<view class="test-title">选择考试试卷</view>
+				<view>
+					<view class="note-item" style="font-size: 16px;" v-for="item,index in testList" :key="index+'test'" @click="toTest(item)">
+						<view class="note-item-content">{{index+1}}.  {{item.title}}</view>
+					</view>
+				</view>
+				
+				<uni-pagination style="margin-top: 30px;" title="标题文字" show-icon="true" total="50" current="2"></uni-pagination>
+				
+				<!-- <navigator class="back-btn ddflex" hover-class="none" open-type="navigateBack">
+					<image src="/static/images/back3.png"></image>
+					<text>返回上一页</text>
+				</navigator> -->
+			</view>
+			<!-- 答题卡区域 -->
+			<view class="test-info ddflex" v-if="false">
+				<view class="test-people ddflex">
+					<image :src="examResult.avatar"></image>
+					<view class="test-people-info ddflex">
+						<view class="ddflex">
+							<view class="test-people-label">考生姓名</view>
+							<view class="fflex">{{examResult.userName}}</view>
+						</view>
+						<view class="ddflex">
+							<view class="test-people-label">准考证号</view>
+							<view class="fflex" style="word-break: break-all;">{{examResult.admissionNo}}</view>
+						</view>
+						<view class="ddflex">
+							<view class="test-people-label">考试科目</view>
+							<view class="fflex">{{examResult.title}}</view>
+						</view>
+					</view>
+				</view>
+				<view class="note-box">
+					<view class="note-title ddflex">
+						<image class="note-title-icon" src="/static/images/ksgg.png"></image>
+						<view>考试公告</view>
+					</view>
+					<view>
+						<view class="note-item ddflex" v-for="item,index in otherInfo" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
+							<view class="note-item-content">{{item.title}}</view>
+						</view>
+					</view>
+				</view>
+				<!-- 注意事项 -->
+				<view class="note-box">
+					<view class="note-title ddflex">
+						<image class="note-title-icon" src="/static/images/zysx.png"></image>
+						<view>注意事项</view>
+					</view>
+					<view>
+						<view class="note-item ddflex" v-for="item,index in noteInfo" :key="index+'zy'" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
+							<view class="note-item-content">{{item.title}}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		
+		<Foot></Foot>
+	</view>
+</template>
+
+<script>
+	const app = getApp();
+	const req = require('../../utils/request.js');
+	const utils = require('../../utils/util.js');
+	const api = require('../../utils/api.js')
+	export default {
+		data() {
+			return {
+				paperId:null,
+				admissionNo:null,
+				paper: '', //试卷详情
+				examResult:{},//考试详情
+				
+				otherInfo:[],
+				noteInfo:[],
+				
+				testList:[]
+			}
+		},
+		onReady() {},
+		onLoad(options) {
+			this.paperId = options.paperId;
+			this.admissionNo = options.admissionNo;
+			this.getTestProject()
+		},
+		methods: {
+			jumpUrl(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
+			// 获取考试项目
+			getTestProject(){
+				req.getRequest('/api/v3/exam/user/manager',{},res=>{
+					this.testList = res
+				})
+			},
+			// 去考试
+			toTest(item){
+				uni.showModal({
+					title:'提示',
+					content:`确定开始 ${item.title}?`,
+					success: (res) => {
+						if(res.confirm){
+							uni.navigateTo({
+								// url: '/pages/test/test?paperId='+this.paperId,
+								url: '/pages/test/test?paperId='+item.id,
+								success:()=> {
+									this.close()
+								}
+							});
+						}else{
+							
+						}
+					}
+				})
+			}
+		}
+	}
+
+</script>
+
+<style>
+	@import url('./selectTest.css');
+</style>

+ 1 - 1
pages/test/test.vue

@@ -228,7 +228,7 @@
 			// this.getQuests();
 		},
 		onUnload() {
-				uni.clearStorageSync();
+				// uni.clearStorageSync();
 		},
 		methods: {
 			// 考试信息

+ 7 - 0
uni_modules/uni-pagination/changelog.md

@@ -1,3 +1,10 @@
+## 1.2.4(2022-09-19)
+- 修复,未对主题色设置默认色,导致未引入 uni-scss 变量文件报错。
+- 修复,未对移动端当前页文字做主题色适配。
+## 1.2.3(2022-09-15)
+- 修复未使用 uni-scss 主题色的 bug。
+## 1.2.2(2022-07-06)
+- 修复 es 语言 i18n 错误
 ## 1.2.1(2021-11-22)
 - 修复 vue3中某些scss变量无法找到的问题
 ## 1.2.0(2021-11-19)

+ 2 - 1
uni_modules/uni-pagination/components/uni-pagination/i18n/en.json

@@ -1,4 +1,5 @@
 {
 	"uni-pagination.prevText": "prev",
-	"uni-pagination.nextText": "next"
+	"uni-pagination.nextText": "next",
+	"uni-pagination.piecePerPage": "piece/page"
 }

+ 2 - 1
uni_modules/uni-pagination/components/uni-pagination/i18n/es.json

@@ -1,4 +1,5 @@
 {
 	"uni-pagination.prevText": "anterior",
-	"uni-pagination.nextText": "próxima"
+	"uni-pagination.nextText": "prxima",
+	"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
 }

+ 2 - 1
uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json

@@ -1,4 +1,5 @@
 {
 	"uni-pagination.prevText": "précédente",
-	"uni-pagination.nextText": "suivante"
+	"uni-pagination.nextText": "suivante",
+	"uni-pagination.piecePerPage": "Articles/Pages"
 }

+ 2 - 1
uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json

@@ -1,4 +1,5 @@
 {
 	"uni-pagination.prevText": "上一页",
-	"uni-pagination.nextText": "下一页"
+	"uni-pagination.nextText": "下一页",
+	"uni-pagination.piecePerPage": "条/页"
 }

+ 2 - 1
uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json

@@ -1,4 +1,5 @@
 {
 	"uni-pagination.prevText": "上一頁",
-	"uni-pagination.nextText": "下一頁"
+	"uni-pagination.nextText": "下一頁",
+	"uni-pagination.piecePerPage": "條/頁"
 }

+ 63 - 7
uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue

@@ -1,7 +1,17 @@
 <template>
 	<view class="uni-pagination">
+		<!-- #ifndef MP -->
+		<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
+			:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
+			@click.native="pickerClick">
+			<button type="default" size="mini" :plain="true">
+				<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
+				<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
+			</button>
+		</picker>
+		<!-- #endif -->
 		<!-- #ifndef APP-NVUE -->
-		<!-- <view class="uni-pagination__total is-phone-hide">共 {{ total }} 条</view> -->
+		<view class="uni-pagination__total is-phone-hide">共 {{ total }} 条</view>
 		<!-- #endif -->
 		<view class="uni-pagination__btn"
 			:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
@@ -16,8 +26,7 @@
 		</view>
 		<view class="uni-pagination__num uni-pagination__num-flex-none">
 			<view class="uni-pagination__num-current">
-				<text class="uni-pagination__num-current-text is-pc-hide"
-					style="color:#DF230F">{{ currentIndex }}</text>
+				<text class="uni-pagination__num-current-text is-pc-hide current-index-text">{{ currentIndex }}</text>
 				<text class="uni-pagination__num-current-text is-pc-hide">/{{ maxPage || 0 }}</text>
 				<!-- #ifndef APP-NVUE -->
 				<view v-for="(item, index) in paper" :key="index" :class="{ 'page--active': item === currentIndex }"
@@ -49,11 +58,15 @@
 	 * @tutorial https://ext.dcloud.net.cn/plugin?id=32
 	 * @property {String} prevText 左侧按钮文字
 	 * @property {String} nextText 右侧按钮文字
+	 * @property {String} piecePerPageText 条/页文字
 	 * @property {Number} current 当前页
 	 * @property {Number} total 数据总量
 	 * @property {Number} pageSize 每页数据量
-	 * @property {Number} showIcon = [true|false] 是否以 icon 形式展示按钮
+	 * @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
+	 * @property {Boolean} showPageSize = [true|false] 是否展示每页条数
+	 * @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
 	 * @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个
+	 * * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
 	 */
 
 	import {
@@ -65,7 +78,7 @@
 	} = initVueI18n(messages)
 	export default {
 		name: 'UniPagination',
-		emits: ['update:modelValue', 'input', 'change'],
+		emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
 		props: {
 			value: {
 				type: [Number, String],
@@ -81,6 +94,9 @@
 			nextText: {
 				type: String,
 			},
+			piecePerPageText: {
+				type: String
+			},
 			current: {
 				type: [Number, String],
 				default: 1
@@ -100,18 +116,32 @@
 				type: [Boolean, String],
 				default: false
 			},
+			showPageSize: {
+				// 是否以 icon 形式展示按钮
+				type: [Boolean, String],
+				default: false
+			},
 			pagerCount: {
 				type: Number,
 				default: 7
+			},
+			pageSizeRange: {
+				type: Array,
+				default: () => [20, 50, 100, 500]
 			}
 		},
 		data() {
 			return {
+				pageSizeIndex: 0,
 				currentIndex: 1,
-				paperData: []
+				paperData: [],
+				pickerShow: false
 			}
 		},
 		computed: {
+			piecePerPage() {
+				return this.piecePerPageText || t('uni-pagination.piecePerPage')
+			},
 			prevPageText() {
 				return this.prevText || t('uni-pagination.prevText')
 			},
@@ -199,9 +229,31 @@
 						this.currentIndex = val
 					}
 				}
+			},
+			pageSizeIndex(val) {
+				this.$emit('pageSizeChange', this.pageSizeRange[val])
 			}
 		},
 		methods: {
+			pickerChange(e) {
+				this.pageSizeIndex = e.detail.value
+				this.pickerClick()
+			},
+			pickerClick() {
+				// #ifdef H5
+				const body = document.querySelector('body')
+				if (!body) return
+
+				const className = 'uni-pagination-picker-show'
+				this.pickerShow = !this.pickerShow
+
+				if (this.pickerShow) {
+					body.classList.add(className)
+				} else {
+					setTimeout(() => body.classList.remove(className), 300)
+				}
+				// #endif
+			},
 			// 选择标签
 			selectPage(e, index) {
 				if (parseInt(e)) {
@@ -257,7 +309,7 @@
 </script>
 
 <style lang="scss" scoped>
-	$uni-primary: #DF230F;
+	$uni-primary: #2979ff !default;
 	.uni-pagination {
 		/* #ifndef APP-NVUE */
 		display: flex;
@@ -352,6 +404,10 @@
 		font-size: 15px;
 	}
 
+	.current-index-text{
+		color: $uni-primary;
+	}
+
 	.uni-pagination--enabled {
 		color: #333333;
 		opacity: 1;

+ 4 - 7
uni_modules/uni-pagination/package.json

@@ -1,7 +1,7 @@
 {
   "id": "uni-pagination",
   "displayName": "uni-pagination 分页器",
-  "version": "1.2.1",
+  "version": "1.2.4",
   "description": "Pagination 分页器组件,用于展示页码、请求数据等。",
   "keywords": [
     "uni-ui",
@@ -16,11 +16,7 @@
   "directories": {
     "example": "../../temps/example_temps"
   },
-  "dcloudext": {
-    "category": [
-      "前端组件",
-      "通用组件"
-    ],
+"dcloudext": {
     "sale": {
       "regular": {
         "price": "0.00"
@@ -37,7 +33,8 @@
       "data": "无",
       "permissions": "无"
     },
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
   },
   "uni_modules": {
     "dependencies": ["uni-scss","uni-icons"],

+ 0 - 2
uni_modules/uni-pagination/readme.md

@@ -9,5 +9,3 @@
 
 ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
-
-