first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1 @@
d8e28b0c-04e0-4d44-b513-8b4bd5463bad

View File

@@ -0,0 +1,105 @@
const {
index,
util
} = getApp().globalData
Page({
/**
* 页面的初始数据
*/
data: {
active: 0,
hall: [
{
title: '失物招领',
index: 0,
children: [
{ title: '全部', type: -1, page: 1, content: [] },
{ title: '证件', type: 1, page: 1, content: [] },
{ title: '服装', type: 2, page: 1, content: [] },
{ title: '数码', type: 3, page: 1, content: [] },
{ title: '日用品', type: 4, page: 1, content: [] },
{ title: '其他', type: 5, page: 1, content: [] },
]
},
{
title: '寻物启事',
index: 0,
children: [
{ title: '全部', type: -1, page: 1, content: [] },
{ title: '证件', type: 1, page: 1, content: [] },
{ title: '服装', type: 2, page: 1, content: [] },
{ title: '数码', type: 3, page: 1, content: [] },
{ title: '日用品', type: 4, page: 1, content: [] },
{ title: '其他', type: 5, page: 1, content: [] },
]
}
]
},
onLoad: function (options) {
this.getList()
},
onReady: function () {},
onShow: function () {},
async getList() {
let { hall, active } = this.data;
let res = await index.tab({
thing_type: active + 1,
thing_category: hall[active].children[hall[active].index].type,
page: 1
});
var temp = `hall[${active}].children`
var oth = `${temp}[${hall[active].index}].content`
this.setData({ [oth]: res })
},
// 改变子项激活的下标
changeChildren(e) {
var temp = `hall[${this.data.active}].index`
this.setData({ [temp]: e.target.dataset.cid}, () => this.getList())
},
onChange(event) {
this.setData({ active: event.detail.name },() => this.getList())
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"item": "../../component/item/item"
},
"navigationBarTitleText": "广场"
}

View File

@@ -0,0 +1,24 @@
<view class="hall">
<van-tabs animated swipeable
color="#ffd23c"
id="tabs"
active="{{ active }}" bind:change="onChange">
<van-tab wx:for="{{ hall }}" title="{{ item.title }}" wx:key="type">
<view class="children_wrap van-hairline--top">
<view class="children_item {{ i == item.index ? 'active' : ''}}"
wx:for="{{ item.children }}"
wx:for-index="i"
wx:key="type"
wx:for-item="v" data-cid="{{ i }}"
bindtap="changeChildren">
{{ v.title }}
</view>
</view>
<item show-desc="{{ false }}"
search-list="{{ item.children[item.index].content }}">
</item>
</van-tab>
</van-tabs>
</view>

View File

@@ -0,0 +1,46 @@
page {
background: #fff;
}
.hall_head {
position: fixed;
top: 0;
width: 100%;
left: 0;
right: 0;
background: #ffd23c;
box-sizing: border-box;
}
.van-dropdown-menu {
background-color: #fff0 !important;
box-shadow: none !important;
display: inline-block !important;
height: auto !important;
position: absolute;
}
.down_item .van-dropdown-item {
top: 120rpx !important;
}
.hall_head input {
width: 100%;
background-color: #fff;
height: 64rpx;
border-radius: 60rpx;
}
.children_wrap {
display: flex;
justify-content: space-evenly;
height: 90rpx;
align-items: center;
background: #fff;
}
.children_wrap .children_item {
padding: 9rpx 20rpx;
border-radius: 53rpx;
font-size: 28rpx;
}
.children_wrap .active {
background: #ffd23c;
}