Commit 729fa5e6 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/xiangwei/educationstu into master

# Conflicts:
#	src/components/subject/SortingProblem.vue
parents 6083728c e9a49d89
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
:key="index2" :key="index2"
class="flex item2 flex_start_center" class="flex item2 flex_start_center"
> >
<view class="chooseNum">{{index2+1}}</view>
<view class="chooseName"> <view class="chooseName">
<input <input
type="text" type="text"
...@@ -172,13 +173,8 @@ export default { ...@@ -172,13 +173,8 @@ export default {
} }
.chooseNum { .chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center; text-align: center;
line-height: 40rpx; margin-right: 25rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
:key="index2" :key="index2"
class="flex item2 flex_start_center" class="flex item2 flex_start_center"
> >
<view class="chooseNum">{{index2+1}}</view>
<view class="chooseName"> <view class="chooseName">
<input <input
type="text" type="text"
...@@ -178,13 +179,8 @@ export default { ...@@ -178,13 +179,8 @@ export default {
} }
.chooseNum { .chooseNum {
width: 40rpx;
height: 40rpx;
text-align: center; text-align: center;
line-height: 40rpx; margin-right: 25rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
......
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
:key="index2" :key="index2"
class="flex item2 flex_start_center" class="flex item2 flex_start_center"
> >
<view class="chooseNum">{{index2+1}}</view>
<view class="chooseName"> <view class="chooseName">
<input type="text" v-model="item2.Content" class="input" /> <input type="text" v-model="item2.Content" :placeholder="'请填写第 '+(index2+1)+' 空答案'" class="input" />
</view> </view>
</view> </view>
</view> </view>
...@@ -152,13 +153,10 @@ export default { ...@@ -152,13 +153,10 @@ export default {
} }
.chooseNum { .chooseNum {
width: 40rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
border-radius: 50%; margin-right: 25rpx;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 26rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
......
...@@ -120,8 +120,6 @@ ...@@ -120,8 +120,6 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
onSelect(e,item3){ onSelect(e,item3){
console.log(e,'e');
console.log(item3,'item3');
item3.isShow = false; item3.isShow = false;
item3.Name = e.detail.name; item3.Name = e.detail.name;
}, },
......
...@@ -31,16 +31,52 @@ ...@@ -31,16 +31,52 @@
<view>{{ index1 + 1 }}</view> <view>{{ index1 + 1 }}</view>
<view class="num" v-html="item1.Title"></view> <view class="num" v-html="item1.Title"></view>
</view> </view>
<view class="chooseName"> <template
<textarea v-if="
type="text" item1.QuestionContentObj[0] &&
v-model="item1.myAnswer" item1.QuestionContentObj[0].length > 0
class="input textarea" "
placeholder="请填写答案" >
placeholder-style="textarea-placeholder" <view
:maxlength="-1" v-for="(item2, index2) in item1.QuestionContentObj[0]"
/> :key="index2"
</view> >
<view class="flex item2 flex_start_center">
<view class="num">{{ item2.Name }}</view>
<view
style="margin-left: 5px"
class="chooseName"
v-html="item2.Content"
></view>
</view>
</view>
</template>
<template
v-if="
item1.QuestionContentObj[1] &&
item1.QuestionContentObj[1].length > 0
"
>
<view
v-for="(item3, index3) in item1.QuestionContentObj[1]"
:key="index3"
style="margin-bottom: 20px"
>
<van-button
type="primary"
size="small"
@click="alertMenu(item3)"
>
{{ item3.Name == "" ? "请选择" : item3.Name }}
</van-button>
<van-action-sheet
:show="item3.isShow"
@click-overlay="hideVan(item3)"
:actions="getSelect(item1.QuestionContentObj[0])"
@select="onSelect($event, item3)"
/>
</view>
</template>
</view> </view>
</swiper-item> </swiper-item>
<swiper-item v-if="sortIndex != sortTotal"></swiper-item> <swiper-item v-if="sortIndex != sortTotal"></swiper-item>
...@@ -72,9 +108,13 @@ export default { ...@@ -72,9 +108,13 @@ export default {
}, },
setup(props, context) { setup(props, context) {
let { ctx } = getCurrentInstance(); let { ctx } = getCurrentInstance();
props.paperData.DetailsList.forEach((item, index) => { if (props.paperData.DetailsList && props.paperData.DetailsList.length > 0) {
item.myAnswer = ""; props.paperData.DetailsList[0].QuestionContentObj[1].forEach(
}); (item, index) => {
item.isShow = false;
}
);
}
let data = reactive({ let data = reactive({
data: props.paperData, data: props.paperData,
autoplay: false, autoplay: false,
...@@ -107,6 +147,32 @@ export default { ...@@ -107,6 +147,32 @@ export default {
this.$emit("getBeforeTopic"); this.$emit("getBeforeTopic");
} }
}, },
alertMenu(item) {
item.isShow = true;
this.$forceUpdate();
console.log(item, "item");
},
//点击背景隐藏
hideVan(item) {
item.isShow = false;
this.$forceUpdate();
},
onSelect(e, item3) {
item3.isShow = false;
item3.Name = e.detail.name;
},
getSelect(item) {
let Array = [];
if (item && item.length > 0) {
item.forEach((x) => {
let obj = {
name: x.Name,
};
Array.push(obj);
});
}
return Array;
},
}; };
onMounted(() => { onMounted(() => {
if (props.isLast) { if (props.isLast) {
......
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