This commit is contained in:
2024-04-14 01:43:37 +08:00
parent b676a1acd9
commit 16dac8d97f
17 changed files with 60 additions and 32 deletions

View File

@@ -20,7 +20,7 @@
<grid-view type='masonry' :cross-axis-count='2'>
<view v-for='(item, index) in goodsList' :key='index' class='goods-item'
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
<image class='goods-image' :src='item.images' />
<image class='goods-image' :src='item.images||defaultImage' />
<text class='goods-name'>{{ item.goodsName }}</text>
<text class='goods-price'>¥{{ item.price }}</text>
<image class='add-image' :src='assetsUrl("ic_add_goods.png")' @click.stop='addShoppingCart(item)' />
@@ -42,7 +42,7 @@
<script setup lang='ts'>
import SkuDialog from '@/components/sku-dialog.vue';
import { assetsUrl } from '@/utils/assets';
import { assetsUrl, defaultImage } from '@/utils/assets';
import { goLogin, goPath, isLogin, showToast } from '@/utils';
import { getCategoryList, getGoodsList } from '@/api/goods';
import { CategoryBean, GoodsBean } from '@/api/goods/types';

View File

@@ -3,7 +3,7 @@
<view class='swiper-container'>
<swiper class='swiper' :interval='1500' :duration='1000' @change='swiperChange'>
<swiper-item v-for='(item,index) in [goodsBean?.images]' :key='index'>
<image :src='item' />
<image :src='item||defaultImage' />
</swiper-item>
</swiper>
<view class='indicator' style='display: none'>
@@ -48,7 +48,7 @@
<view style='display: inline-block' v-for='(item, index) in recommendList'
:key='index'>
<view class='recommend-item c-flex-column'>
<image :src='item.images' />
<image :src='item.images||defaultImage' />
<text>{{ item.goodsName }}</text>
<text class='goods-price'>{{ item.price }}</text>
</view>
@@ -94,7 +94,7 @@
</template>
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
import { assetsUrl, defaultImage } from '@/utils/assets';
import SkuDialog from '@/components/sku-dialog.vue';
import { goPath, showToast } from '@/utils';
import { getGoodsDetail, getGoodsList } from '@/api/goods';

View File

@@ -39,7 +39,7 @@
<view class='goods-info-view c-flex-column'>
<view class='c-flex-row' style='margin-bottom: 20rpx' v-for='(item,index) in orderBean?.orderGoods'
:key='index'>
<image class='goods-image' :src='item.images' />
<image class='goods-image' :src='item.images||defaultImage' />
<view class='c-flex-column' style='flex: 1;'>
<view class='c-flex-row'>
<text class='goods-name'>{{ item.name }}</text>
@@ -121,7 +121,7 @@
</template>
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
import { assetsUrl, defaultImage } from '@/utils/assets';
import PaymentDialog from '@/components/payment-dialog.vue';
import CouponDialog from '@/pages/mall/subs/components/coupon-dialog.vue';
import { goPath, parseParameter, sortASCII } from '@/utils';
@@ -198,7 +198,6 @@ const navigateTo = (e: any) => {
};
const createOrder = async () => {
await uni.showLoading();
const params = {
// 'discount': 0,
// 'freePrice': 0,
@@ -227,11 +226,12 @@ const createOrder = async () => {
}
))
};
await uni.showLoading();
const result = await orderCreate(params);
orderBean.value!.id = result.id;
uni.hideLoading();
//删除购物车已存在商品
orderBean?.value?.orderGoods?.forEach(item => {
const index = shoppingCartStore.getSameGoodsIndex(item.id, item.checkedStock.colorId, item.checkedStock.sizeId);

View File

@@ -11,7 +11,7 @@
<grid-view :cross-axis-count='2'>
<view v-for='(item, index) in goodsList' :key='index' class='goods-item'
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
<image class='goods-image' :src='item.images' />
<image class='goods-image' :src='item.images||defaultImage' />
<text class='goods-name'>{{ item.goodsName }}</text>
<text class='goods-price'>¥{{ item.price }}</text>
<image class='add-image' :src='assetsUrl("ic_add_goods.png")' @click.stop='addShoppingCart(item)' />
@@ -24,7 +24,7 @@
<script lang='ts' setup>
import SkuDialog from '@/components/sku-dialog.vue';
import { assetsUrl } from '@/utils/assets';
import { assetsUrl, defaultImage } from '@/utils/assets';
import { goPath } from '@/utils';
import { getGoodsList } from '@/api/goods';
import useShoppingCartStore from '@/store/modules/shoppingcart';

View File

@@ -13,7 +13,7 @@
<image class='checkbox'
:src='assetsUrl(item.checked?"ic_checkbox_active_red.png":"ic_checkbox_normal.png")'
@click.stop='item.checked=!item.checked' />
<image class='goods-image' :src='item.images' />
<image class='goods-image' :src='item.images||defaultImage' />
<view class='c-flex-column'>
<text>{{ item.name }}</text>
<view class='c-flex-row'>
@@ -61,7 +61,7 @@
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
import { assetsUrl, defaultImage } from '@/utils/assets';
import useShoppingCartStore from '@/store/modules/shoppingcart';
import { goPath, showToast } from '@/utils';
import { GoodsBean, StockBean } from '@/api/goods/types';