feat: 平价商品

This commit is contained in:
2025-09-06 21:05:45 +08:00
parent 279e6cf4c7
commit a335ef48fa
+47 -37
View File
@@ -6,19 +6,33 @@
<u-icon size="24" name="search" color="#999"></u-icon>
<text class="text-28 text-fu" style="margin-left: 12rpx">搜索</text>
</view>
</view>
<view class="tab-view">
<view class="tab-list" @click="onTab(index)" v-for="(item,index) in tabList" :key="index">
<text class="text-28 text-space" :style="{
color:curTab == index ? '#7A35F6' : '#666'
}">{{item.name}}</text>
<view
class="tab-list"
@click="onTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
<text
class="text-28 text-space"
:style="{
color: curTab == index ? '#7A35F6' : '#666',
}"
>{{ item.name }}</text
>
<view class="line" v-if="curTab == index"></view>
</view>
</view>
<view class="setting-view">
<view class="name-box">
<PingItem @ok="onJumpShop" style="margin-top:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></PingItem>
<PingItem
@ok="onJumpShop"
style="margin-top: 24rpx"
:obj="item"
v-for="(item, index) in dataList"
:key="index"
></PingItem>
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
@@ -29,14 +43,14 @@
</template>
<script>
import { getCascadeCategory } from '@/api/common.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import PingItem from '@/components/shop/ping-item.vue'
import CustomTabBar from '@/components/custom-tab-bar.vue';
import { searchList } from '@/api/product.js';
import func from '@/utils/func.js';
import { getCascadeCategory } from "@/api/common.js";
import Header from "@/components/common/header.vue";
import TopSafe from "@/components/common/top-safe.nvue";
import MyBtn from "@/components/common/my-btn.vue";
import PingItem from "@/components/shop/ping-item.vue";
import CustomTabBar from "@/components/custom-tab-bar.vue";
import { searchList } from "@/api/product.js";
import func from "@/utils/func.js";
export default {
components: { Header, TopSafe, MyBtn, PingItem },
@@ -44,32 +58,30 @@ export default {
return {
dataList: [],
tabList: [],
curTab:0
curTab: 0,
};
},
onShow() {
},
onShow() {},
onLoad() {
this.init();
},
methods: {
async cascadeCategory() {
getCascadeCategory({parentId: 0}).then(res=>{
getCascadeCategory({ parentId: 0 }).then((res) => {
if (res && res.bizcode === 100) {
this.tabList = res.data;
this.getSearchList()
this.getSearchList();
}
})
});
},
onTab(index) {
if (index != this.curTab) {
this.curTab = index;
this.getSearchList()
this.getSearchList();
}
},
init() {
this.cascadeCategory();
},
async getSearchList() {
const params = {
@@ -77,8 +89,8 @@ export default {
page: 1,
pageSize: 99,
categoryId: this.tabList[this.curTab].id,
isPar:true
}
isPar: true,
};
const resp = await searchList(params);
if (resp && resp.bizcode === 100) {
this.dataList = resp.data || [];
@@ -86,21 +98,21 @@ export default {
},
onJumpSearch() {
uni.navigateTo({
url: '/pages/rwa_package/dongjian/search',
})
url: "/pages/rwa_package/dongjian/search",
});
},
onJumpShop(id) {
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id='+id,
})
url: "/pages/other_package/productInfo/productInfo?id=" + id,
});
},
onShare() {
uni.navigateTo({
url: '/pages/other_package/invite_friends/invite_friends',
})
}
}
}
url: "/pages/other_package/invite_friends/invite_friends",
});
},
},
};
</script>
<style lang="scss" scoped>
@@ -141,7 +153,7 @@ export default {
padding: 0 24rpx;
flex-direction: row;
display: flex;
background-color: #F7F7F7;
background-color: #f7f7f7;
align-items: center;
border-radius: 16rpx;
}
@@ -169,7 +181,7 @@ export default {
.line {
width: 48rpx;
height: 4rpx;
background-color: #7A35F6;
background-color: #7a35f6;
}
}
.setting-view {
@@ -193,8 +205,6 @@ export default {
align-content: flex-start;
box-sizing: border-box;
}
}
</style>