Commit a07c74c6 authored by 罗超's avatar 罗超

1

parent 0c91ba88
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
</view> </view>
</view> </view>
</view> </view>
<van-toast id="van-toast" />
</div> </div>
</template> </template>
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
</view> </view>
</view> </view>
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
<Item :data="item" /> <Item :data="item" />
</view> </view>
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
</view> </view>
</view> </view>
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
......
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
<van-icon name="cross" size="30rpx" @click="back" /> <van-icon name="cross" size="30rpx" @click="back" />
</template> </template>
<template #title> <template #title>
<view <view class="flex" style="justify-content: center" @click="start">
class="flex"
style="justify-content: center"
@click="start"
>
<van-image <van-image
width="30rpx" width="30rpx"
height="30rpx" height="30rpx"
...@@ -28,8 +24,19 @@ ...@@ -28,8 +24,19 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<view class="exam-con"> <view class="exam-con">
<Sub1 /> <view v-for="(item, index) in peaperDetail.Paper.GroupList" :key="index">
<SingleChoice
:paperData="item"
v-if="item.QuestionTypeKey === 'single'"
/>
<MultipleChoice
:paperData="item"
v-if="item.QuestionTypeKey === 'multiple'"
/>
</view>
<FillInTheBlanks />
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
...@@ -45,14 +52,19 @@ import { ...@@ -45,14 +52,19 @@ import {
onMounted, onMounted,
} from "vue"; } from "vue";
import { getSystemInfo } from "../../utils/index"; import { getSystemInfo } from "../../utils/index";
import Sub1 from "./subject1"; import { getPaperDetail } from "../../api/exam";
import SingleChoice from "../../components/subject/SingleChoice.vue";
import MultipleChoice from "../../components/subject/MultipleChoice.vue";
import FillInTheBlanks from "../../components/subject/FillInTheBlanks.vue";
export default { export default {
components: { Sub1 }, components: { SingleChoice, MultipleChoice, FillInTheBlanks },
setup(props, context) { setup(props, context) {
let { refs } = getCurrentInstance(); let { refs } = getCurrentInstance();
let data = reactive({ let data = reactive({
time: 2 * 60 * 60 * 1000, time: 2 * 60 * 60 * 1000,
statusBarHeight: 0, statusBarHeight: 0,
msg: { PaperId: 30, Id: 11 },
peaperDetail: {},
}); });
let methods = { let methods = {
jumpPage() { jumpPage() {
...@@ -66,6 +78,13 @@ export default { ...@@ -66,6 +78,13 @@ export default {
back() { back() {
uni.navigateBack(); uni.navigateBack();
}, },
async getPaperDetail() {
let res = await getPaperDetail(data.msg);
console.log(74, res.Data);
if (res) {
data.peaperDetail = res.Data;
}
},
}; };
onMounted(() => { onMounted(() => {
getSystemInfo((res) => { getSystemInfo((res) => {
...@@ -77,7 +96,9 @@ export default { ...@@ -77,7 +96,9 @@ export default {
...methods, ...methods,
}; };
}, },
onLoad() {}, onLoad() {
this.getPaperDetail();
},
}; };
</script> </script>
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<Loadmore :state="pageState" /> <Loadmore :state="pageState" />
</scroll-view> </scroll-view>
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
......
...@@ -5,15 +5,32 @@ ...@@ -5,15 +5,32 @@
</van-nav-bar> </van-nav-bar>
<view class="top"> <view class="top">
登录 登录
<van-image width="193rpx" height="242rpx" fit="cover" class="yuqi" <van-image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuqi.png" /> width="193rpx"
height="242rpx"
fit="cover"
class="yuqi"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuqi.png"
/>
</view> </view>
<view class="main"> <view class="main">
<van-cell-group> <van-cell-group>
<van-field :value="Account" clearable placeholder="请输入用户名" clearable @input="usernameInput"> <van-field
:value="Account"
clearable
placeholder="请输入用户名"
clearable
@input="usernameInput"
>
<i class="iconfont icon-user2 left-iconfont" slot="left-icon"></i> <i class="iconfont icon-user2 left-iconfont" slot="left-icon"></i>
</van-field> </van-field>
<van-field :value="Password" password placeholder="请输入密码" clearable @input="passwordInput"> <van-field
:value="Password"
password
placeholder="请输入密码"
clearable
@input="passwordInput"
>
<i class="iconfont icon-password left-iconfont" slot="left-icon"></i> <i class="iconfont icon-password left-iconfont" slot="left-icon"></i>
</van-field> </van-field>
</van-cell-group> </van-cell-group>
...@@ -25,7 +42,7 @@ ...@@ -25,7 +42,7 @@
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
...@@ -35,12 +52,10 @@ ...@@ -35,12 +52,10 @@
computed, computed,
onMounted, onMounted,
inject, inject,
} from "vue"; } from "vue";
// import Toast from "../../wxcomponents/vant/toast/toast"; // import Toast from "../../wxcomponents/vant/toast/toast";
import { import { login } from "../../api/index";
login export default {
} from "../../api/index";
export default {
setup(props, context) { setup(props, context) {
let Toast = inject("$toast"); let Toast = inject("$toast");
let msg = reactive({ let msg = reactive({
...@@ -141,11 +156,11 @@ ...@@ -141,11 +156,11 @@
...methods, ...methods,
}; };
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.top { .top {
height: 242rpx; height: 242rpx;
box-sizing: border-box; box-sizing: border-box;
padding-left: 40rpx; padding-left: 40rpx;
...@@ -156,27 +171,27 @@ ...@@ -156,27 +171,27 @@
color: #0f1b35; color: #0f1b35;
position: relative; position: relative;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.yuqi { .yuqi {
position: absolute; position: absolute;
top: 0; top: 0;
right: 1rpx; right: 1rpx;
} }
.main { .main {
height: 250rpx; height: 250rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 40rpx; padding: 0 40rpx;
margin-bottom: 165rpx; margin-bottom: 165rpx;
} }
/deep/.van-cell { /deep/.van-cell {
height: 124rpx; height: 124rpx;
padding-top: 50rpx; padding-top: 50rpx;
} }
/deep/.loginBtn { /deep/.loginBtn {
width: 600rpx; width: 600rpx;
height: 90rpx; height: 90rpx;
background-color: #00acf9; background-color: #00acf9;
...@@ -186,20 +201,20 @@ ...@@ -186,20 +201,20 @@
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
} }
.auth { .auth {
text-align: center; text-align: center;
font-size: 26rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #00acf9; color: #00acf9;
margin-top: 30rpx; margin-top: 30rpx;
} }
.left-iconfont { .left-iconfont {
margin-right: 20rpx; margin-right: 20rpx;
font-size: 30rpx; font-size: 30rpx;
color: #111111; color: #111111;
} }
</style> </style>
...@@ -174,3 +174,35 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, success ...@@ -174,3 +174,35 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, success
// } // }
// }); // });
} }
// 数字转汉字
export let changeNumToHan = (num) => {
var arr1 = new Array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九');
var arr2 = new Array('', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千', '万', '十', '百', '千', '亿');//可继续追加更高位转换值
if (!num || isNaN(num)) {
return "零";
}
var english = num.toString().split("")
var result = "";
for (var i = 0; i < english.length; i++) {
var des_i = english.length - 1 - i;//倒序排列设值
result = arr2[i] + result;
var arr1_index = english[des_i];
result = arr1[arr1_index] + result;
}
//将【零千、零百】换成【零】 【十零】换成【十】
result = result.replace(/零(千|百|十)/g, '零').replace(/十零/g, '十');
//合并中间多个零为一个零
result = result.replace(/零+/g, '零');
//将【零亿】换成【亿】【零万】换成【万】
result = result.replace(/零亿/g, '亿').replace(/零万/g, '万');
//将【亿万】换成【亿】
result = result.replace(/亿万/g, '亿');
//移除末尾的零
result = result.replace(/零+$/, '')
//将【零一十】换成【零十】
//result = result.replace(/零一十/g, '零十');//貌似正规读法是零一十
//将【一十】换成【十】
result = result.replace(/^一十/g, '十')
return result;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment