分包处理完成写作渲染

This commit is contained in:
libowei 2023-12-07 00:17:07 +08:00
parent ae473ab007
commit 88fc295058
3 changed files with 25 additions and 20 deletions

View File

@ -41,7 +41,7 @@ const install = (Vue, vm) => {
// 方式四如果token放在了Storage本地存储中拦截是每次请求都执行的
// 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token');
const token = " Bearer 47c982b63064436bb905144c082ffba3"
const token = " Bearer ce1a0c1ec5344cefbc7a185e29353c7c"
// console.log("我是token", token)
config.header.Authorization = token;
// config.header.Tenant-Id=1

View File

@ -9,14 +9,13 @@
</view>
<view class="substance">
<!-- 渲染Text -->
<text :class="{ 'active': itemActive[item.id] === TextIndex , '': itemActive[item.id] !== TextIndex }" v-for="(TextItem,TextIndex) in item.tests"
:key="TextIndex" @click="Bages_addActive(TextIndex,item.id) ">
<text :class="{ 'active': itemActive[item.id] === TextIndex }" v-for="(TextItem,TextIndex) in item.tests"
:key="TextIndex" @click="Bages_addActive(TextIndex,item.id,TextItem) ">
{{TextItem.name}}
</text>
</view>
<!-- 渲染part -->
<view v-for="(TextItem,TextIndex) in item.tests" :key="TextIndex">
<view v-for="(partitem,partindex) in TextItem.parts" :key="partindex" v-if="itemActive[item.id] === TextIndex || TextIndex==0">
<view>
<view class="Part1">
@ -57,18 +56,13 @@
export default {
data() {
return {
selepad: [],
listHearing: [],
itemActive: {}, //
checked: [],
subsets: [],
itemActive: {},
firstActive:true,
image: true,
tk: null,
list2: [{
value: '选项1',
id: '1'
}],
}
},
@ -78,17 +72,22 @@
methods: {
//
hearing() {
this.$u.get('https://api.admin-v2.langsi.online/admin-api/ielts/paper/list', {
classify: 1
}).then(res => {
this.$u.get('https://api.admin-v2.langsi.online/admin-api/ielts/paper/list', {classify: 1}).then(res => {
this.listHearing = res.data
let arr =res.data
for(let a of arr){
a.active = 'Test 1'
}
this.listHearing= arr
})
},
// test
Bages_addActive(idex, id) {
Bages_addActive(idex, id,TextItem) {
this.itemActive[id] = idex
this.$forceUpdate()
},
//
icon(id) {

View File

@ -25,7 +25,7 @@
</view>
<view>
<u-checkbox @change="checkboxChange(item[text][Task].id)" v-model="subsets">{{item.name}}</u-checkbox>
<u-checkbox @change="checkboxChange(item[text][Task].id,$event)" v-model="item[text][Task].subsetArr">{{item.name}}</u-checkbox>
</view>
</view>
</view>
@ -41,7 +41,6 @@
return {
transformedData: [],
//
subsets:[],
subsetArr:[],
textArr:['test1','test2','test3','test4'],
taskArr:['task1','task2'],
@ -76,9 +75,16 @@
item.active = text
this.$forceUpdate()
},
checkboxChange(e){
checkboxChange(e,id){
if(id.value) {
this.subsetArr.push(e)
console.log((this.subsetArr))
}else {
let index=this.subsetArr.indexOf(e);
if(e!==-1) {
this.subsetArr.splice(index, 1);
}
}
console.log(this.subsetArr)
}
}
}