commit
75d0b004dc
|
@ -1,6 +1,6 @@
|
||||||
<!-- 拼团活动列表 -->
|
<!-- 拼团活动列表 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FE832A' }" navbar="inner">
|
<s-layout :bgStyle="{ color: '#FE832A' }" navbar="inner">
|
||||||
<view class="page-bg" :style="[{ marginTop: '-' + Number(statusBarHeight + 88) + 'rpx' }]" />
|
<view class="page-bg" :style="[{ marginTop: '-' + Number(statusBarHeight + 88) + 'rpx' }]" />
|
||||||
<view class="list-content">
|
<view class="list-content">
|
||||||
<!-- 参团会员统计 -->
|
<!-- 参团会员统计 -->
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 秒杀活动列表 -->
|
<!-- 秒杀活动列表 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: 'rgb(245,28,19)' }" navbar="inner">
|
<s-layout :bgStyle="{ color: 'rgb(245,28,19)' }" navbar="inner">
|
||||||
<!--顶部背景图-->
|
<!--顶部背景图-->
|
||||||
<view
|
<view
|
||||||
class="page-bg"
|
class="page-bg"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 优惠券中心 -->
|
<!-- 优惠券中心 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#f2f2f2' }" title="优惠券">
|
<s-layout :bgStyle="{ color: '#f2f2f2' }" title="优惠券">
|
||||||
<su-sticky bgColor="#fff">
|
<su-sticky bgColor="#fff">
|
||||||
<su-tabs
|
<su-tabs
|
||||||
:list="tabMaps"
|
:list="tabMaps"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#fff' }" tabbar="/pages/index/cart" title="购物车">
|
<s-layout :bgStyle="{ color: '#fff' }" tabbar="/pages/index/cart" title="购物车">
|
||||||
<s-empty
|
<s-empty
|
||||||
v-if="state.list.length === 0"
|
v-if="state.list.length === 0"
|
||||||
icon="/static/cart-empty.png"
|
icon="/static/cart-empty.png"
|
||||||
|
@ -109,7 +109,6 @@
|
||||||
import { computed, reactive } from 'vue';
|
import { computed, reactive } from 'vue';
|
||||||
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||||
import { isEmpty } from '@/sheep/helper/utils';
|
import { isEmpty } from '@/sheep/helper/utils';
|
||||||
import { DeliveryTypeEnum } from '@/sheep/util/const';
|
|
||||||
|
|
||||||
const sys_navBar = sheep.$platform.navbar;
|
const sys_navBar = sheep.$platform.navbar;
|
||||||
const cart = sheep.$store('cart');
|
const cart = sheep.$store('cart');
|
||||||
|
@ -158,37 +157,60 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 校验配送方式 */
|
/**
|
||||||
function validateDeliveryType(spuIds) {
|
* 校验配送方式冲突
|
||||||
return new Promise(async (resolve, reject) => {
|
*
|
||||||
const { data } = await SpuApi.getSpuListByIds(spuIds.join(','));
|
* @param {string[]} spuIds - 商品ID数组
|
||||||
if (isEmpty(data)) {
|
* @returns {Promise<void>}
|
||||||
reject('获取商品信息失败!!!');
|
* @throws {Error} 当配送方式冲突或获取商品信息失败时抛出错误
|
||||||
return;
|
*/
|
||||||
|
async function validateDeliveryType(spuIds) {
|
||||||
|
// 获取商品信息
|
||||||
|
const { data: spuList } = await SpuApi.getSpuListByIds(spuIds.join(','));
|
||||||
|
if (isEmpty(spuList)) {
|
||||||
|
sheep.$helper.toast('未找到商品信息');
|
||||||
|
throw new Error('未找到商品信息');
|
||||||
}
|
}
|
||||||
let onlyExpress = false; // 只快递
|
// 获取所有商品的配送方式列表
|
||||||
let onlyPickup = false; // 只自提
|
const deliveryTypesList = spuList.map(item => item.deliveryTypes);
|
||||||
// TODO @puhui999:这里需要比对,A 商品支持自提、B 商品支持快递,这样导致 A 和 B 无法一起下单。
|
// 检查配送方式冲突
|
||||||
const deliveryTypes = data.map((item) => item.deliveryTypes);
|
const hasConflict = checkDeliveryConflicts(deliveryTypesList);
|
||||||
for (const deliveryType of deliveryTypes) {
|
if (hasConflict) {
|
||||||
// 情况一:两种配送方式都支持
|
sheep.$helper.toast('选中商品支持的配送方式冲突,不允许提交');
|
||||||
if (deliveryType.length > 1) {
|
throw new Error('选中商品支持的配送方式冲突,不允许提交');
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 情况二:只支持一种
|
|
||||||
if (deliveryType[0] === DeliveryTypeEnum.EXPRESS.type) {
|
|
||||||
onlyExpress = true;
|
|
||||||
} else if (deliveryType[0] === DeliveryTypeEnum.PICK_UP.type) {
|
|
||||||
onlyPickup = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (onlyExpress || onlyPickup) {
|
|
||||||
reject('选中商品存在只支持特定配送方式的情况不允许提交!!!');
|
/**
|
||||||
sheep.$helper.toast('选中商品存在只支持特定配送方式的情况不允许提交!!!');
|
* 检查配送方式列表中是否存在冲突
|
||||||
return;
|
* @description
|
||||||
|
* 示例场景:
|
||||||
|
* A 商品支持:[快递, 自提]
|
||||||
|
* B 商品支持:[快递]
|
||||||
|
* C 商品支持:[自提]
|
||||||
|
*
|
||||||
|
* 对比结果:
|
||||||
|
* A 和 B:不冲突 (有交集:快递)
|
||||||
|
* A 和 C:不冲突 (有交集:自提)
|
||||||
|
* B 和 C:冲突 (无交集)
|
||||||
|
* @param {Array<Array<number>>} deliveryTypesList - 配送方式列表的数组
|
||||||
|
* @returns {boolean} 是否存在冲突
|
||||||
|
*/
|
||||||
|
function checkDeliveryConflicts(deliveryTypesList) {
|
||||||
|
for (let i = 0; i < deliveryTypesList.length - 1; i++) {
|
||||||
|
const currentTypes = deliveryTypesList[i];
|
||||||
|
for (let j = i + 1; j < deliveryTypesList.length; j++) {
|
||||||
|
const nextTypes = deliveryTypesList[j];
|
||||||
|
// 检查是否没有交集(即冲突)
|
||||||
|
const hasNoIntersection = !currentTypes.some(type =>
|
||||||
|
nextTypes.includes(type),
|
||||||
|
);
|
||||||
|
if (hasNoIntersection) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
resolve();
|
}
|
||||||
});
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onNumberChange(e, cartItem) {
|
function onNumberChange(e, cartItem) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 商品分类列表 -->
|
<!-- 商品分类列表 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#fff' }" tabbar="/pages/index/category" title="分类">
|
<s-layout :bgStyle="{ color: '#fff' }" tabbar="/pages/index/category" title="分类">
|
||||||
<view class="s-category">
|
<view class="s-category">
|
||||||
<view class="three-level-wrap ss-flex ss-col-top" :style="[{ height: pageHeight + 'px' }]">
|
<view class="three-level-wrap ss-flex ss-col-top" :style="[{ height: pageHeight + 'px' }]">
|
||||||
<!-- 商品分类(左) -->
|
<!-- 商品分类(左) -->
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 搜索界面 -->
|
<!-- 搜索界面 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FFF' }" class="set-wrap" title="搜索">
|
<s-layout :bgStyle="{ color: '#FFF' }" class="set-wrap" title="搜索">
|
||||||
<view class="ss-p-x-24">
|
<view class="ss-p-x-24">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<uni-search-bar
|
<uni-search-bar
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 支付结果页面 -->
|
<!-- 支付结果页面 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FFF' }" title="支付结果">
|
<s-layout :bgStyle="{ color: '#FFF' }" title="支付结果">
|
||||||
<view class="pay-result-box ss-flex-col ss-row-center ss-col-center">
|
<view class="pay-result-box ss-flex-col ss-row-center ss-col-center">
|
||||||
<!-- 信息展示 -->
|
<!-- 信息展示 -->
|
||||||
<view class="pay-waiting ss-m-b-30" v-if="payResult === 'waiting'" />
|
<view class="pay-waiting ss-m-b-30" v-if="payResult === 'waiting'" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- FAQ 常见问题 -->
|
<!-- FAQ 常见问题 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FFF' }" class="set-wrap" title="常见问题">
|
<s-layout :bgStyle="{ color: '#FFF' }" class="set-wrap" title="常见问题">
|
||||||
<uni-collapse>
|
<uni-collapse>
|
||||||
<uni-collapse-item v-for="(item, index) in state.list" :key="item">
|
<uni-collapse-item v-for="(item, index) in state.list" :key="item">
|
||||||
<template v-slot:title>
|
<template v-slot:title>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 文章展示 -->
|
<!-- 文章展示 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FFF' }" :title="state.title" class="set-wrap">
|
<s-layout :bgStyle="{ color: '#FFF' }" :title="state.title" class="set-wrap">
|
||||||
<view class="ss-p-30">
|
<view class="ss-p-30">
|
||||||
<mp-html class="richtext" :content="state.content" />
|
<mp-html class="richtext" :content="state.content" />
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#fff' }" class="set-wrap" title="系统设置">
|
<s-layout :bgStyle="{ color: '#fff' }" class="set-wrap" title="系统设置">
|
||||||
<view class="header-box ss-flex-col ss-row-center ss-col-center">
|
<view class="header-box ss-flex-col ss-row-center ss-col-center">
|
||||||
<image
|
<image
|
||||||
class="logo-img ss-m-b-46"
|
class="logo-img ss-m-b-46"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 收件地址列表 -->
|
<!-- 收件地址列表 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FFF' }" title="收货地址">
|
<s-layout :bgStyle="{ color: '#FFF' }" title="收货地址">
|
||||||
<view v-if="state.list.length">
|
<view v-if="state.list.length">
|
||||||
<s-address-item
|
<s-address-item
|
||||||
hasBorderBottom
|
hasBorderBottom
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- 商品浏览记录 -->
|
<!-- 商品浏览记录 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#f2f2f2' }" title="我的足迹">
|
<s-layout :bgStyle="{ color: '#f2f2f2' }" title="我的足迹">
|
||||||
<view class="cart-box ss-flex ss-flex-col ss-row-between">
|
<view class="cart-box ss-flex ss-flex-col ss-row-between">
|
||||||
<!-- 头部 -->
|
<!-- 头部 -->
|
||||||
<view class="cart-header ss-flex ss-col-center ss-row-between ss-p-x-30">
|
<view class="cart-header ss-flex ss-col-center ss-row-between ss-p-x-30">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<s-layout :bgStyle="{ backgroundColor: '#FFF' }" title="选择自提门店">
|
<s-layout :bgStyle="{ color: '#FFF' }" title="选择自提门店">
|
||||||
<view class="storeBox" ref="container">
|
<view class="storeBox" ref="container">
|
||||||
<view
|
<view
|
||||||
class="storeBox-box"
|
class="storeBox-box"
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
src: '',
|
src: '',
|
||||||
backgroundColor: 'var(--ui-BG-1)',
|
color: 'var(--ui-BG-1)',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
tabbar: {
|
tabbar: {
|
||||||
|
@ -153,11 +153,10 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// 背景1
|
// 背景1
|
||||||
// TODO puhui999:是不是应该还是用 color。然后后端装修那,做下调整~
|
|
||||||
const bgMain = computed(() => {
|
const bgMain = computed(() => {
|
||||||
if (navbarMode.value === 'inner') {
|
if (navbarMode.value === 'inner') {
|
||||||
return {
|
return {
|
||||||
background: `${props.bgStyle.backgroundColor} url(${sheep.$url.cdn(
|
background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
|
||||||
props.bgStyle.backgroundImage,
|
props.bgStyle.backgroundImage,
|
||||||
)}) no-repeat top center / 100% auto`,
|
)}) no-repeat top center / 100% auto`,
|
||||||
};
|
};
|
||||||
|
@ -169,7 +168,7 @@
|
||||||
const bgBody = computed(() => {
|
const bgBody = computed(() => {
|
||||||
if (navbarMode.value === 'normal') {
|
if (navbarMode.value === 'normal') {
|
||||||
return {
|
return {
|
||||||
background: `${props.bgStyle.backgroundColor} url(${sheep.$url.cdn(
|
background: `${props.bgStyle.backgroundColor || props.bgStyle.color} url(${sheep.$url.cdn(
|
||||||
props.bgStyle.backgroundImage,
|
props.bgStyle.backgroundImage,
|
||||||
)}) no-repeat top center / 100% auto`,
|
)}) no-repeat top center / 100% auto`,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue