修改发布页面

This commit is contained in:
HJ 2023-03-06 11:37:38 +08:00
parent 73e3a7dc2f
commit a762630b31

View File

@ -1,71 +1,71 @@
<template>
<view class="container">
<view class="title">选择圈子类目</view>
<view class="class-wrap">
<view class="class-item u-line-1" @click="chooseClass(item.cateId,item.cateName)"
v-for="(item, index) in classList" :key="index">{{ item.cateName }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
classList: []
};
},
created() {
this.getClassList();
},
methods: {
getClassList() {
this.$H.get('topic/classList').then(res => {
this.classList = res.result
})
},
chooseClass(id, name) {
console.log('id:', id)
console.log('name:', name)
let pages = getCurrentPages();
let nowPage = pages[pages.length - 1];
let prevPage = pages[pages.length - 2];
prevPage.$vm.form.cut = id;
prevPage.$vm.cateName = name;
uni.navigateBack();
}
}
};
</script>
<style lang="scss" scoped>
.title {
margin-bottom: 30rpx;
}
.class-wrap {
.class-item {
width: 30%;
display: inline-block;
border: 1px solid #999;
padding: 20rpx;
font-size: 24rpx;
color: #999;
text-align: center;
margin-bottom: 20rpx;
border-radius: 10rpx;
&:nth-child(3n + 2) {
margin-left: 5%;
margin-right: 5%;
}
&:active {
background-color: #333;
color: #fff;
}
}
}
<template>
<view class="container">
<view class="title">选择圈子类目</view>
<view class="class-wrap">
<view class="class-item u-line-1" @click="chooseClass(item.cateId,item.cateName)"
v-for="(item, index) in classList" :key="index">{{ item.cateName }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
classList: []
};
},
created() {
this.getClassList();
},
methods: {
getClassList() {
this.$H.get('topic/classList').then(res => {
this.classList = res.result
})
},
chooseClass(id, name) {
console.log('id:', id)
console.log('name:', name)
let pages = getCurrentPages();
let nowPage = pages[pages.length - 1];
let prevPage = pages[pages.length - 2];
prevPage.$vm.form.cut = id;
prevPage.$vm.cateName = name;
uni.navigateBack();
}
}
};
</script>
<style lang="scss" scoped>
.title {
margin-bottom: 30rpx;
}
.class-wrap {
.class-item {
width: 30%;
display: inline-block;
border: 1px solid #999;
padding: 20rpx;
font-size: 24rpx;
color: #999;
text-align: center;
margin-bottom: 20rpx;
border-radius: 10rpx;
&:nth-child(3n + 2) {
margin-left: 5%;
margin-right: 5%;
}
&:active {
background-color: #333;
color: #fff;
}
}
}
</style>