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>
......
...@@ -2,34 +2,41 @@ ...@@ -2,34 +2,41 @@
<view :style="{ 'padding-top': `${statusBarHeight}px` }"> <view :style="{ 'padding-top': `${statusBarHeight}px` }">
<view style="height: 100rpx"></view> <view style="height: 100rpx"></view>
<van-nav-bar fixed> <van-nav-bar fixed>
<template #left> <template #left>
<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" <van-image
style="justify-content: center" width="30rpx"
@click="start" height="30rpx"
> fit="cover"
<van-image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/clock.png"
width="30rpx" style="margin-right: 10rpx"
height="30rpx" />
fit="cover" <van-count-down
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/clock.png" :time="time"
style="margin-right: 10rpx" :auto-start="false"
class="flex flex_center_center"
ref="countdown"
/>
</view>
</template>
</van-nav-bar>
<view class="exam-con">
<view v-for="(item, index) in peaperDetail.Paper.GroupList" :key="index">
<SingleChoice
:paperData="item"
v-if="item.QuestionTypeKey === 'single'"
/> />
<van-count-down <MultipleChoice
:time="time" :paperData="item"
:auto-start="false" v-if="item.QuestionTypeKey === 'multiple'"
class="flex flex_center_center"
ref="countdown"
/> />
</view> </view>
</template> <FillInTheBlanks />
</van-nav-bar>
<view class="exam-con">
<Sub1 />
</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>
......
This diff is collapsed.
...@@ -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