Bladeren bron

主题添加列表

lidongyu 1 jaar geleden
bovenliggende
commit
cc57c61033
2 gewijzigde bestanden met toevoegingen van 14 en 7 verwijderingen
  1. 4 2
      pages/matterAll/matterAll.vue
  2. 10 5
      pages/topic/topic.vue

+ 4 - 2
pages/matterAll/matterAll.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<uni-list>
-			<uni-list-item  :title="item.title" v-for="(item,index) in dataList"></uni-list-item>
+			<uni-list-item  :title="item.title" v-for="(item,index) in dataList" @click="onclick(item)"></uni-list-item>
 		</uni-list>
 	</view>
 </template>
@@ -24,7 +24,9 @@
 			this.getMatters(data)
 		},
 		methods: {
-
+			onclick(data){//点击详情
+				
+			},
 			getMatters(data) {
 				let _that = this
 				getMattersAll(data).then(res => {

+ 10 - 5
pages/topic/topic.vue

@@ -5,10 +5,10 @@
 			</button>
 		</view>
 		<view>
-			<uni-grid :column="2" :square="false" :highlight="false">
-				<uni-grid-item v-for="(item, index) in dataList" :index="index" :key="index">
-					<view class="grid-item-box">
-						<text class="text">{{ item.deptName }}</text>
+			<uni-grid :column="2" :square="false" :highlight="false" >
+				<uni-grid-item v-for="(item, index) in dataList" :index="index" :key="index" >
+					<view class="grid-item-box" @click="onMatters(item)">
+						<text class="text" >{{ item.deptName }}</text>
 					</view>
 				</uni-grid-item>
 			</uni-grid>
@@ -38,7 +38,12 @@
 			this.getdataList()//初始化数据
 		},
 		methods: {
-			
+			onMatters(data){
+				uni.setStorageSync('data', {type:data.deptName})
+				uni.navigateTo({
+					url: '/pages/matterAll/matterAll',
+				});
+			},
 			getdataList(data){
 				let _that = this
 				if (!data) {