分包处理完成写作渲染
This commit is contained in:
		
							parent
							
								
									ae473ab007
								
							
						
					
					
						commit
						88fc295058
					
				|  | @ -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
 | ||||
|  |  | |||
|  | @ -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) { | ||||
|  |  | |||
|  | @ -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){ | ||||
| 				this.subsetArr.push(e) | ||||
| 				console.log((this.subsetArr)) | ||||
| 			checkboxChange(e,id){ | ||||
| 				if(id.value) { | ||||
| 					this.subsetArr.push(e) | ||||
| 				}else { | ||||
| 				let  index=this.subsetArr.indexOf(e); | ||||
| 					if(e!==-1) { | ||||
| 						this.subsetArr.splice(index, 1); | ||||
| 					} | ||||
| 				} | ||||
| 				console.log(this.subsetArr) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 libowei
						libowei