Merge branch 'master' of https://codeup.aliyun.com/bsdtec/biz-mobile-react-cloud
# Conflicts: # .env
This commit is contained in:
commit
76cfd49d15
6 files changed
+55
-28
No files matched your search
@@ -28,7 +28,7 @@
|
||||
|
||||
<template #footer>
|
||||
<view class="z-200 p-x-30rpx p-y-30rpx bg-white" :style="{ marginBottom: getHeight() }">
|
||||
<product-total :totPrice="props.totPrice" :totCount="props.totCount" @doPay="doPay" />
|
||||
<product-total :totPrice="props.totPrice" :totCount="props.totCount" @submit="doBuy" />
|
||||
</view>
|
||||
</template>
|
||||
</tm-drawer>
|
||||
@@ -58,7 +58,7 @@ const props = withDefaults(
|
||||
|
||||
const doClose = () => emit("update:modelValue", false)
|
||||
|
||||
const doPay = () => emit("submit")
|
||||
const doBuy = () => emit("submit")
|
||||
|
||||
const getHeight = () => {
|
||||
const { bottom } = uni.getSystemInfoSync().safeAreaInsets!
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="flex-1 m-l-20rpx">
|
||||
<view class="sub-text-28 show-line">{{ props.productName }}</view>
|
||||
<view v-if="mode === 'default'" class="flex-row items-center">
|
||||
<view class="second-text-32 c-red!"> ¥{{ hooks.useMoney(props.promotionPrice) }} </view>
|
||||
<view class="second-text-32 c-red!"> ¥{{ hooks.useMoney(props.promotionPrice || props.retailPrice) }} </view>
|
||||
<view class="m-l-20rpx second-text-26 line-through"> ¥{{ hooks.useMoney(props.retailPrice) }} </view>
|
||||
</view>
|
||||
<view class="second-text-26 show-line">单位:{{ props.unit }}</view>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
z-index="100"
|
||||
v-model:show="props.modelValue"
|
||||
showFooter
|
||||
showClose
|
||||
title="加入购物车"
|
||||
position="bottom"
|
||||
size="70%"
|
||||
@@ -15,14 +16,24 @@
|
||||
<view class="flex-col card p-y-20rpx p-x-30rpx mb-20rpx">
|
||||
<view class="prefix_title mb-15rpx">商品信息</view>
|
||||
<view class="flex-row items-center">
|
||||
<image class="w-120rpx h-120rpx bg-#0094ff" :src="filePath(state.goodsDetail.picUrl)" mode="aspectFill" />
|
||||
<image
|
||||
class="w-160rpx h-160rpx bg-#0094ff rounded-1"
|
||||
:src="filePath(state.goodsDetail.picUrl)"
|
||||
mode="aspectFill"
|
||||
@tap.stop="state.goodsDetail.picUrl && usePreviewImage(filePath(state.goodsDetail.picUrl))"
|
||||
/>
|
||||
<view class="ml-3 flex flex-col justify-between">
|
||||
<view class="text-30 ws-nowrap text-ellipsis overflow-hidden">{{ state.goodsDetail.productName }}</view>
|
||||
<view class="text-32 ws-nowrap text-ellipsis overflow-hidden">{{ state.goodsDetail.productName }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="second-text-30 c-red!">促销 ¥{{ state.selectedSku.promotionPrice }}</view>
|
||||
<view class="m-l-20rpx second-text-28 line-through">原价 ¥{{ state.selectedSku.retailPrice }}</view>
|
||||
<view class="second-text-30 c-red!">
|
||||
促销 ¥{{ parseFloat(state.selectedSku.promotionPrice) || state.selectedSku.retailPrice || 0 }}
|
||||
</view>
|
||||
<view class="m-l-20rpx second-text-28 line-through">原价 ¥{{ state.selectedSku.retailPrice || 0 }}</view>
|
||||
</view>
|
||||
<view class="second-text-26">内装数量:{{ state.selectedSku.packageNum || 0 }}</view>
|
||||
<view class="second-text-26">
|
||||
已选择:{{ `${state.selectedSku.spec || "未选择"} / ${state.selectedSku.unit || "未选择"},数量:${state.goodsCount}` }}
|
||||
</view>
|
||||
<view class="second-text-26">内装数量:{{ state.selectedSku.packageNum }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -32,13 +43,13 @@
|
||||
<view class="prefix_title mb-15rpx">包装单位</view>
|
||||
<view class="flex flex-wrap">
|
||||
<view
|
||||
class="text-center rounded-2 mr-4 mb-2 py-2 px-3 text-28 duration-200"
|
||||
class="text-center rounded-2 mr-4 mb-2 py-2 px-3 text-28 bg-#F2F2F2 c-black border border-solid border-#E5E5E5"
|
||||
:class="{ 'bg-#0094ff! c-white!': state.selectedSku.id === v.id }"
|
||||
v-for="v in state.goodsDetail?.skuList"
|
||||
:key="v.id"
|
||||
:style="{ 'background-color': state.selectedSku.id === v.id ? '#0094ff66' : '#F0F0F0' }"
|
||||
@click="onSelectSku(v)"
|
||||
>
|
||||
{{ v.spec + " " + v.unit }}
|
||||
{{ v.spec + " / " + v.unit }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -59,7 +70,13 @@
|
||||
</scroll-view>
|
||||
|
||||
<template #footer>
|
||||
<button class="mx-12 border-rd-8 bg-#0094ff sub-text-30 py-2 c-white!" @tap="handleSkuAddToCar">加入购物车</button>
|
||||
<button
|
||||
class="mx-12 border-rd-8 bg-#0094ff sub-text-30 py-2 c-white!"
|
||||
:class="{ 'bg-#0094ff77!': Object.keys(state.selectedSku).length === 0 }"
|
||||
@tap="handleSkuAddToCart"
|
||||
>
|
||||
加入购物车
|
||||
</button>
|
||||
</template>
|
||||
</tm-drawer>
|
||||
</template>
|
||||
@@ -67,8 +84,8 @@
|
||||
<script setup lang="ts">
|
||||
import { shopApi } from "@/sheep/api"
|
||||
import { filePath } from "@/sheep/utils/file"
|
||||
import { computed, reactive, watch } from "vue"
|
||||
import { hooks } from "@@/index"
|
||||
import { reactive, watch } from "vue"
|
||||
import { usePreviewImage } from "@/sheep/hooks/use-img"
|
||||
|
||||
const emit = defineEmits(["update:modelValue", "onSkuAddToCart"])
|
||||
|
||||
@@ -109,7 +126,7 @@ watch(
|
||||
|
||||
// 选择规格/取消选择规格
|
||||
const onSelectSku = (skuItem: any) => {
|
||||
if (state.selectedSku.id === skuItem.id) {
|
||||
if (state.selectedSku.id == skuItem.id) {
|
||||
state.selectedSku = {}
|
||||
return
|
||||
}
|
||||
@@ -128,7 +145,7 @@ const handleNumRemove = () => {
|
||||
}
|
||||
|
||||
// 点击sku加入到购物车
|
||||
const handleSkuAddToCar = async () => {
|
||||
const handleSkuAddToCart = async () => {
|
||||
// 检查包装单位选择
|
||||
if (!state.selectedSku.id) return uni.showToast({ title: "请选择包装单位", icon: "none" })
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<view class="sub-text-28">共{{ props.totCount }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-#0094ff p-x-30rpx p-y-20rpx text-center rounded-40rpx sub-text-30 color-white!" @tap.stop="doPay">提交订单</view>
|
||||
<view class="bg-#0094ff p-x-30rpx p-y-20rpx text-center rounded-40rpx sub-text-30 color-white!" @tap.stop="doBuy">提交订单</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -27,11 +27,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
totCount: 0,
|
||||
})
|
||||
|
||||
const doPay = () => {
|
||||
emit("submit")
|
||||
}
|
||||
const doBuy = () => emit("submit")
|
||||
|
||||
const doContainer = () => {
|
||||
emit("doContainer")
|
||||
}
|
||||
const doContainer = () => emit("doContainer")
|
||||
</script>
|
||||
@@ -42,8 +42,8 @@ const getDetail = async () => {
|
||||
|
||||
<view class="p-15rpx">
|
||||
<view class="flex-col justify-between card p-y-20rpx p-x-30rpx">
|
||||
<view class="prefix_title">商品</view>
|
||||
<view class="sub-text-32 m-t-15rpx">{{ state.detail.productName }}</view>
|
||||
<view class="prefix_title mb-15rpx">商品</view>
|
||||
<view class="sub-text-32">{{ state.detail.productName }}</view>
|
||||
<view class="flex-row items-center justify-between m-t-15rpx">
|
||||
<!-- <view class="second-text-46 color-#f63a36!">¥{{ state.detail.price }}</view> -->
|
||||
<!-- <view class="m-l-20rpx second-text-28 line-through">¥{{ state.detail.marketPrice }}</view> -->
|
||||
@@ -53,12 +53,24 @@ const getDetail = async () => {
|
||||
</view>
|
||||
|
||||
<view class="h-15rpx" />
|
||||
<view class="flex-row items-center justify-between card p-y-20rpx p-x-30rpx">
|
||||
<view class="prefix_title">评价</view>
|
||||
<view class="flex-col justify-between card p-y-20rpx p-x-30rpx">
|
||||
<view class="prefix_title mb-15rpx">包装单位</view>
|
||||
<!-- <view class="flex justify-between p-2 m-2" v-for="(item, index) in state.detail.skuList" :key="index">
|
||||
<view class="second-text-28">{{ item.spec + " / " + item.unit }}</view>
|
||||
<view class="second-text-28">装数:{{ item.packageNum }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="second-text-30 c-red!"> 促销 ¥{{ parseFloat(item.promotionPrice) || item.retailPrice || 0 }} </view>
|
||||
<view class="m-l-20rpx second-text-28 line-through">原价 ¥{{ item.retailPrice || 0 }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="h-15rpx" />
|
||||
<view class="flex-col justify-between card p-y-20rpx p-x-30rpx">
|
||||
<view class="prefix_title">详情</view>
|
||||
<view class="prefix_title mb-15rpx">评价</view>
|
||||
</view>
|
||||
<view class="h-15rpx" />
|
||||
<view class="flex-col justify-between card p-y-20rpx p-x-30rpx">
|
||||
<view class="prefix_title mb-15rpx">详情</view>
|
||||
<view class="m-t-15rpx" v-html="state.detail.description"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -51,6 +51,8 @@ const pageHook = hooks.usePage(
|
||||
? orderApi.supPage
|
||||
: getLaunchParam() == "coopMerchant"
|
||||
? orderApi.supPage
|
||||
: getLaunchParam() == "onlineShop"
|
||||
? orderApi.supPage
|
||||
: async () => [],
|
||||
null,
|
||||
"data.records",
|
||||
|
||||
Reference in new issue
Block a user