商品页

This commit is contained in:
shikong 2024-10-18 20:46:48 +08:00
parent 51f6596279
commit dd2a0a180d
Signed by: Shikong
GPG Key ID: BD85FF18B373C341
3 changed files with 17 additions and 14 deletions

View File

@ -33,12 +33,12 @@ function isCurrent(index) {
</view>
<view class="w-3/4 p-2 bg-white flex flex-col h-full">
<view class="flex-grow-0 flex flex-col h-full">
<view class="flex-grow flex flex-col h-full">
<view class="my-1">
<slot name="title" :current="ctx.current"></slot>
</view>
<scroll-view scroll-y class="flex-grow-0 min-h-0">
<scroll-view scroll-y class="flex-grow min-h-0">
<slot name="default" :current="ctx.current" :data="props.categories[ctx.current]"></slot>
</scroll-view>
</view>

View File

@ -65,7 +65,7 @@ onLoad(() => {
<view class="bg-orange-100 h-full"> {{ item.name }}</view>
<view> {{data.name}} </view>
<scroll-view scroll-y class="flex-grow-0 min-h-0 text-left">
<scroll-view scroll-y class="flex-grow min-h-0 text-left">
<Item v-for="i in 10" :key="i"
@tap="toCommodity(i)"
img="https://www.httpbin.org/image/png"

View File

@ -3,6 +3,7 @@ import {reactive} from "vue";
import qs from "qs";
import SideBarView from "@/components/sidebar-view/index.vue";
import Item from "./components/item.vue";
const ctx = reactive({
current: 0,
categories: [
@ -45,7 +46,7 @@ const ctx = reactive({
]
})
function toCommodity(){
function toCommodity() {
uni.navigateTo({
url: '/pages/commodity/commodity?' + qs.stringify({
id: 1,
@ -62,17 +63,19 @@ function toCommodity(){
</text>
</template>
<scroll-view scroll-y class="flex-grow-0 min-h-0">
<Item v-for="i in 10" :key="i"
@tap="toCommodity(i)"
img="https://www.httpbin.org/image/png"
title="测试商品测试商品测试商品测试商品测试商品测试商品测试商品" price="9999.99"/>
<template #default="{data}">
<scroll-view scroll-y class="flex-grow min-h-0 text-left">
<Item v-for="i in 10" :key="i"
@tap="toCommodity(i)"
img="https://www.httpbin.org/image/png"
title="测试商品测试商品测试商品测试商品测试商品测试商品测试商品" price="9999.99"/>
<Item v-for="i in 20" :key="i"
img="https://www.httpbin.org/image/jpeg"
title="测试商品" price="9999.99"
oldPrice="8888.88"/>
</scroll-view>
<Item v-for="i in 20" :key="i"
img="https://www.httpbin.org/image/jpeg"
title="测试商品" price="9999.99"
oldPrice="8888.88"/>
</scroll-view>
</template>
</SideBarView>
</template>