调整
This commit is contained in:
1 parent
bab4a4383b
commit
01b5f47f5c
3 files changed
+201
-225
No files matched your search
@@ -2,9 +2,7 @@
|
||||
<view
|
||||
:class="[props.mode == 'car' ? 'car_border' : '']"
|
||||
class="flex-row items-start card p-x-15rpx p-y-25rpx m-b-20rpx"
|
||||
@tap="
|
||||
props.productId && props.mode === 'default' && router.jump('/pages/shop/product-detail', { id: props.productId })
|
||||
"
|
||||
@tap="props.productId && props.mode === 'default' && router.jump('/pages/shop/product-detail', { id: props.productId })"
|
||||
>
|
||||
<image class="size-140rpx rounded-12rpx" :src="props.picUrl" mode="aspectFill" />
|
||||
<view class="flex-1 m-l-20rpx">
|
||||
@@ -32,10 +30,7 @@
|
||||
</view>
|
||||
|
||||
<view v-if="mode === 'car'" class="flex-row items-center justify-end m-t-20rpx">
|
||||
<view
|
||||
class="flex-row-center size-40rpx rounded-full border-1px border-solid border-color-#0094ff"
|
||||
@tap.stop="remove"
|
||||
>
|
||||
<view class="flex-row-center size-40rpx rounded-full border-1px border-solid border-color-#0094ff" @tap.stop="remove">
|
||||
<view class="iconfont icon-a--" />
|
||||
</view>
|
||||
<view class="sub-text-28 m-x-20rpx">{{ productCount }}</view>
|
||||
@@ -50,7 +45,7 @@
|
||||
<script setup lang="ts">
|
||||
import { hooks, router } from "@@/index"
|
||||
|
||||
const emit = defineEmits(["onClickAddToCar", "add", "remove"])
|
||||
const emit = defineEmits(["onClickAddToCart", "add", "remove"])
|
||||
|
||||
export type Props = {
|
||||
mode?: "default" | "car"
|
||||
@@ -65,7 +60,7 @@ export type Props = {
|
||||
stock?: number
|
||||
spec?: string
|
||||
unit?: string
|
||||
onClickAddToCar?: () => void
|
||||
onClickAddToCart?: () => void
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
mode: "default",
|
||||
@@ -84,7 +79,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
|
||||
const handleClickAddToCar = () => {
|
||||
if (props.productId) {
|
||||
emit("onClickAddToCar", { ...props })
|
||||
emit("onClickAddToCart", { ...props })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
:productName="goodsItem.productName"
|
||||
:salesCount="goodsItem.salesCount"
|
||||
:stock="goodsItem.stock"
|
||||
@onClickAddToCar="onClickAddToCar"
|
||||
@onClickAddToCart="onClickAddToCart(goodsItem)"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -130,7 +130,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, nextTick, ref } from "vue"
|
||||
import { reactive, nextTick } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { isEmpty } from "radash"
|
||||
import { router } from "@@/index"
|
||||
@@ -247,9 +247,9 @@ const doClassify = async (i: any) => {
|
||||
}
|
||||
|
||||
// 点击添加到购物车
|
||||
const onClickAddToCar = (productData: any) => {
|
||||
const onClickAddToCart = (goodsItem: any) => {
|
||||
state.curProductData = goodsItem
|
||||
state.showSkuDialog = true
|
||||
state.curProductData = productData
|
||||
}
|
||||
|
||||
// 加入到购物车时
|
||||
|
||||
Reference in new issue
Block a user