Tang 4 лет назад
Родитель
Сommit
4ce53be3c6
4 измененных файлов с 256 добавлено и 55 удалено
  1. 1 29
      package-lock.json
  2. 12 2
      pages.json
  3. 26 24
      pages/index/index.vue
  4. 217 0
      pages2/bank/questionBank.vue

+ 1 - 29
package-lock.json

@@ -1,36 +1,8 @@
 {
   "name": "zz-applet",
   "version": "1.0.0",
-  "lockfileVersion": 2,
+  "lockfileVersion": 1,
   "requires": true,
-  "packages": {
-    "": {
-      "name": "zz-applet",
-      "version": "1.0.0",
-      "license": "ISC",
-      "dependencies": {
-        "jweixin-module": "^1.6.0",
-        "tki-qrcode": "^0.1.6",
-        "uview-ui": "^1.8.3"
-      },
-      "devDependencies": {}
-    },
-    "node_modules/jweixin-module": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
-      "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
-    },
-    "node_modules/tki-qrcode": {
-      "version": "0.1.6",
-      "resolved": "https://registry.npmjs.org/tki-qrcode/-/tki-qrcode-0.1.6.tgz",
-      "integrity": "sha512-EnnlS8psowC7PsW3MDYcxvJYkuklX3WAZ/BYanR4TdBHTu74GfjTBX8Y16REP+AeDENiVtBPh4jtTRL2P736hQ=="
-    },
-    "node_modules/uview-ui": {
-      "version": "1.8.3",
-      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.3.tgz",
-      "integrity": "sha512-DqKc+qRrOZLPcyfWv4b0HspSS9n1Cd6BbgKiYEv9rjTAnWoqJV7rXsvWqZdr5iKGP5EMNbNS741GLNw4sIHbpw=="
-    }
-  },
   "dependencies": {
     "jweixin-module": {
       "version": "1.6.0",

+ 12 - 2
pages.json

@@ -54,7 +54,7 @@
 					"bounce": "none"
 				}
 			}
-		
+
 		},
 		{
 			"path": "pages/shopping/shoppingCart",
@@ -98,7 +98,7 @@
 						"bounce": "none"
 					}
 				}
-				}, {
+			}, {
 				"path": "register/register",
 				"style": {
 					"navigationBarTitleText": "注册页",
@@ -214,6 +214,16 @@
 						"bounce": "none"
 					}
 				}
+			},
+			{
+				"path": "bank/questionBank",
+				"style": {
+					"navigationBarTitleText": "试卷题目",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
 			}
 		],
 		"plugins": {

+ 26 - 24
pages/index/index.vue

@@ -1,26 +1,18 @@
 <template>
 	<view>
-		首页
+		<view class="content"><u-button @click="jumpBank">前往题库</u-button></view>
 	</view>
 </template>
 
 <script>
-
 import { mapGetters } from 'vuex';
 export default {
-	components: {
-		
-	},
+	components: {},
 	data() {
-		return {
-			
-		};
-	},
-	onPullDownRefresh(){
-	},
-	onLoad(option) {
-		
+		return {};
 	},
+	onPullDownRefresh() {},
+	onLoad(option) {},
 	onShow() {
 		/* if(this.current === 2 && this.$method.isLogin()){
 			this.$refs.refMy.init();
@@ -34,18 +26,21 @@ export default {
 		};
 	},
 	methods: {
-		getDict(){
-			let that = this
+		jumpBank() {
+			this.$navTo.togo('/pages2/bank/questionBank');
+		},
+		getDict() {
+			let that = this;
 			this.$api.dictList().then(res => {
 				if (res.data.code === 200) {
-					let newList = {}
-					let list = res.data.data
-					for(let i =0 ;i<list.length;i++){
-						let item = list[i]
-						if(newList.hasOwnProperty(item.dictType)){
-							newList[item.dictType].push(item.dictLabel)
-						}else{
-							newList[item.dictType] = [item.dictLabel]
+					let newList = {};
+					let list = res.data.data;
+					for (let i = 0; i < list.length; i++) {
+						let item = list[i];
+						if (newList.hasOwnProperty(item.dictType)) {
+							newList[item.dictType].push(item.dictLabel);
+						} else {
+							newList[item.dictType] = [item.dictLabel];
 						}
 					}
 					that.$store.state.dictObj = newList;
@@ -83,4 +78,11 @@ export default {
 };
 </script>
 
-<style scoped></style>
+<style scoped>
+.content {
+	height: 80vh;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+</style>

+ 217 - 0
pages2/bank/questionBank.vue

@@ -0,0 +1,217 @@
+<template>
+	<view id="questionBank">
+		<view class="pageContent">
+			<view class="pad_8 titBox">
+				<view class="firstLetter">
+					<view class="leftLetters">
+						<view class="btnType">单选</view>
+						<text>1/10</text>
+					</view>
+					<view style="color: #666;font-size: 28rpx;">03:25:06</view>
+					<view class="leftLetters"></view>
+				</view>
+				<view class="titles">建造师执业资格注册的有效期一般为( )年。</view>
+				<view class="">
+					<view v-for="(item, index) in bankList" :key="index" class="lisSty">
+						<text class="activeTI">{{ ast[index] }}</text>
+						{{ item.label }}
+					</view>
+				</view>
+			</view>
+			<view class="pad_8 answer">
+				<view>正确答案:C</view>
+				<view>我的答案:B</view>
+			</view>
+			<view class="pad_8 answerInfos">
+				<view class="answerTitle">答案解析</view>
+				<view class="answerContent">
+					建造师执业资格注册有效期一般为3年,有效期满前3个月,持证者应到原注册管理机构办理再次注册手续。在注册有效期内,变更执业单位者,应当及时办理变更手续。
+				</view>
+			</view>
+		</view>
+		<view class="footer_btn">
+			<view>收藏</view>
+			<view @click="openFooterTab">答题卡</view>
+			<view>交卷</view>
+		</view>
+		<u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
+			<view class="popupView">
+				<view class="popupTops">
+					<view class="topIcon"></view>
+					点击编号即可跳转至对应题目
+				</view>
+				<view class="popupContent">
+					<scroll-view scroll-y="true" style="height: 506rpx;">
+						<view class="boxSty">
+							<view v-for="(item, index) in 23" :key="index" class="liListSty">{{ index + 1 }}</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			ast: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
+			show: false,
+			bankList: [
+				{
+					label: '我是选项一',
+					value: 1
+				},
+				{
+					label: '我是选项二',
+					value: 2
+				},
+				{
+					label: '我是选项三',
+					value: 3
+				},
+				{
+					label: '我是选项四',
+					value: 4
+				}
+			]
+		};
+	},
+	methods: {
+		openFooterTab() {
+			this.show = true;
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.lisSty {
+	margin-bottom: 16rpx;
+}
+.activeTI {
+	display: inline-block;
+	border: 1rpx solid #eee;
+	border-radius: 50rpx;
+	height: 48rpx;
+	line-height: 46rpx;
+	text-align: center;
+	width: 48rpx;
+	margin-right: 15rpx;
+	color: #666;
+	font-size: 30rpx;
+}
+.titles {
+	margin-bottom: 24rpx;
+}
+.titBox {
+	padding: 41rpx 25rpx 24rpx 25rpx;
+}
+.firstLetter {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	margin-bottom: 30rpx;
+	.leftLetters {
+		display: flex;
+		align-items: center;
+		width: 220rpx;
+		.btnType {
+			padding: 5rpx 10rpx;
+			border: 1rpx solid #007aff;
+			border-radius: 10rpx;
+			background-color: rgba(0, 122, 255, 0.1);
+			font-size: 28rpx;
+			color: #007aff;
+			margin-right: 15rpx;
+		}
+	}
+}
+.popupView {
+	height: 100%;
+	padding-bottom: 100rpx;
+	.popupTops {
+		height: 77rpx;
+		border-bottom: 1rpx solid #eee;
+		text-align: center;
+		line-height: 77rpx;
+		font-size: 24rpx;
+		color: #999;
+		position: relative;
+		.topIcon {
+			position: absolute;
+			top: 10rpx;
+			left: 50%;
+			transform: translateX(-50%);
+			width: 80rpx;
+			height: 8rpx;
+			background-color: #999;
+			border-radius: 4rpx;
+		}
+	}
+	.popupContent {
+	}
+}
+.pageContent {
+	background-color: #eaeef1;
+	min-height: 100vh;
+	padding-top: 8rpx;
+	padding-bottom: 100rpx;
+}
+.pad_8 {
+	background-color: #fff;
+	margin: 0rpx 8rpx 8rpx;
+	border-radius: 16rpx;
+}
+.answer {
+	height: 80rpx;
+	line-height: 80rpx;
+	padding: 0rpx 24rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	color: #666;
+	font-size: 30rpx;
+}
+.footer_btn {
+	background-color: #fff;
+	z-index: 10078;
+	position: fixed;
+	bottom: 0rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	width: 100%;
+	height: 98rpx;
+	padding: 0rpx 38rpx;
+	border-top: 1rpx solid #eee;
+}
+.boxSty {
+	padding: 44rpx 41rpx 0rpx;
+}
+.liListSty {
+	width: 88rpx;
+	height: 88rpx;
+	border-radius: 32rpx;
+	background-color: #ff3b30;
+	text-align: center;
+	line-height: 88rpx;
+	color: #fff;
+	font-size: 32rpx;
+	float: left;
+	margin: 20rpx 23rpx;
+}
+.answerInfos {
+	padding: 25rpx 25rpx 25rpx 23rpx;
+}
+.answerTitle {
+	margin-bottom: 28rpx;
+	color: #666;
+	font-size: 30rpx;
+}
+.answerContent {
+	font-size: 30rpx;
+	color: #666;
+}
+</style>