Commit a07c74c6 authored by 罗超's avatar 罗超

1

parent 0c91ba88
......@@ -17,6 +17,7 @@
</view>
</view>
</view>
<van-toast id="van-toast" />
</div>
</template>
......
......@@ -49,6 +49,7 @@
</view>
</view>
</view>
<van-toast id="van-toast" />
</view>
</template>
......
......@@ -100,6 +100,7 @@
<Item :data="item" />
</view>
</view>
<van-toast id="van-toast" />
</view>
</template>
......
......@@ -30,6 +30,7 @@
</view>
</view>
</view>
<van-toast id="van-toast" />
</view>
</template>
......
......@@ -6,11 +6,7 @@
<van-icon name="cross" size="30rpx" @click="back" />
</template>
<template #title>
<view
class="flex"
style="justify-content: center"
@click="start"
>
<view class="flex" style="justify-content: center" @click="start">
<van-image
width="30rpx"
height="30rpx"
......@@ -28,8 +24,19 @@
</template>
</van-nav-bar>
<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>
<van-toast id="van-toast" />
</view>
</template>
......@@ -45,14 +52,19 @@ import {
onMounted,
} from "vue";
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 {
components: { Sub1 },
components: { SingleChoice, MultipleChoice, FillInTheBlanks },
setup(props, context) {
let { refs } = getCurrentInstance();
let data = reactive({
time: 2 * 60 * 60 * 1000,
statusBarHeight: 0,
msg: { PaperId: 30, Id: 11 },
peaperDetail: {},
});
let methods = {
jumpPage() {
......@@ -66,6 +78,13 @@ export default {
back() {
uni.navigateBack();
},
async getPaperDetail() {
let res = await getPaperDetail(data.msg);
console.log(74, res.Data);
if (res) {
data.peaperDetail = res.Data;
}
},
};
onMounted(() => {
getSystemInfo((res) => {
......@@ -77,7 +96,9 @@ export default {
...methods,
};
},
onLoad() {},
onLoad() {
this.getPaperDetail();
},
};
</script>
......
......@@ -50,6 +50,7 @@
<Loadmore :state="pageState" />
</scroll-view>
</view>
<van-toast id="van-toast" />
</view>
</template>
......
......@@ -5,15 +5,32 @@
</van-nav-bar>
<view class="top">
登录
<van-image width="193rpx" height="242rpx" fit="cover" class="yuqi"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuqi.png" />
<van-image
width="193rpx"
height="242rpx"
fit="cover"
class="yuqi"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuqi.png"
/>
</view>
<view class="main">
<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>
</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>
</van-field>
</van-cell-group>
......@@ -25,7 +42,7 @@
</template>
<script>
import {
import {
ref,
reactive,
toRefs,
......@@ -35,12 +52,10 @@
computed,
onMounted,
inject,
} from "vue";
// import Toast from "../../wxcomponents/vant/toast/toast";
import {
login
} from "../../api/index";
export default {
} from "vue";
// import Toast from "../../wxcomponents/vant/toast/toast";
import { login } from "../../api/index";
export default {
setup(props, context) {
let Toast = inject("$toast");
let msg = reactive({
......@@ -141,11 +156,11 @@
...methods,
};
},
};
};
</script>
<style scoped>
.top {
.top {
height: 242rpx;
box-sizing: border-box;
padding-left: 40rpx;
......@@ -156,27 +171,27 @@
color: #0f1b35;
position: relative;
margin-bottom: 20rpx;
}
}
.yuqi {
.yuqi {
position: absolute;
top: 0;
right: 1rpx;
}
}
.main {
.main {
height: 250rpx;
box-sizing: border-box;
padding: 0 40rpx;
margin-bottom: 165rpx;
}
}
/deep/.van-cell {
/deep/.van-cell {
height: 124rpx;
padding-top: 50rpx;
}
}
/deep/.loginBtn {
/deep/.loginBtn {
width: 600rpx;
height: 90rpx;
background-color: #00acf9;
......@@ -186,20 +201,20 @@
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
}
}
.auth {
.auth {
text-align: center;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #00acf9;
margin-top: 30rpx;
}
}
.left-iconfont {
.left-iconfont {
margin-right: 20rpx;
font-size: 30rpx;
color: #111111;
}
}
</style>
......@@ -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