diff --git a/api/api.js b/api/api.js index c70db8b..f830a4e 100644 --- a/api/api.js +++ b/api/api.js @@ -13,7 +13,7 @@ import Fly from 'flyio/dist/npm/wx' // #endif import { handleLoginFailure } from '@/utils' -import { VUE_APP_API_URL } from '@/config' +import { VUE_APP_API_URL, VUE_APP_UPLOAD_URL } from '@/config' import cookie from '@/utils/cookie' import { replace } from '@/utils/router' @@ -155,7 +155,7 @@ export const upload = (options)=>{ ...options.headers, Authorization: 'Bearer ' + token.accessToken, }, - url:options.url?`${VUE_APP_API_URL}${options.url}`:VUE_APP_API_URL+'/member/user/update-avatar', + url:options.url?`${VUE_APP_API_URL}${options.url}`:VUE_APP_UPLOAD_URL, success:(res)=>resolve(res), fail:(err)=>reject(err), complete:()=>uni.hideLoading() diff --git a/components/Header/index.vue b/components/Header/index.vue index 20d8b94..51e2df6 100644 --- a/components/Header/index.vue +++ b/components/Header/index.vue @@ -12,7 +12,7 @@ import { useRouter } from "@/hooks/useRouter"; import { createAnimation } from "@/utils/utils"; import { useScroll } from "@/hooks/useScroll"; -const HEADER_HEIGHT = 40 // header高度 +const HEADER_HEIGHT = 60 // header高度 const {goBack} = useRouter() /** @@ -31,6 +31,10 @@ const {goBack} = useRouter() * */ const props = defineProps({ + scrollTop:{ + type:Number, + default:()=>0 + }, systemBarAreaBg: { type: String, default: () => '#FFFFFF00' // 透明 #FFFFFF00 @@ -93,7 +97,8 @@ const { bgChangeColor, propUp, showRight, - leftWidth + leftWidth, + scrollTop } = toRefs(props) const emits = defineEmits(['getSystemInfo', 'animation']) @@ -198,7 +203,8 @@ const scrollMaskStyle = computed(() => { // 总高度 const containerHeight = computed(() => { - return (unref(heightInfo).statusBarHeight + HEADER_HEIGHT) + const marginTop = unref(menuInfo).height > 0 ? `${((HEADER_HEIGHT - unref(menuInfo).height))/2}` : 0 + return (unref(heightInfo).statusBarHeight + HEADER_HEIGHT - marginTop) }) let animation @@ -208,7 +214,6 @@ function doCreateAnimation() { animation = createAnimation(0, scrollEnd, 0, 1) } -const {scrollTop} = useScroll(); watch(scrollTop, () => { if (!bgChangeByScroll.value) return if (!animation) doCreateAnimation() diff --git a/components/LazyImage/index.vue b/components/LazyImage/index.vue new file mode 100644 index 0000000..c1bb8f0 --- /dev/null +++ b/components/LazyImage/index.vue @@ -0,0 +1,89 @@ + + + + + + diff --git a/components/ListLoadLoading/index.vue b/components/ListLoadLoading/index.vue index 299f4b9..e9d9821 100644 --- a/components/ListLoadLoading/index.vue +++ b/components/ListLoadLoading/index.vue @@ -7,11 +7,14 @@ --> + + + + diff --git a/components/activity/activity.vue b/components/activity/activity.vue index e0159b2..0232c19 100644 --- a/components/activity/activity.vue +++ b/components/activity/activity.vue @@ -19,7 +19,7 @@ {{ more }} diff --git a/components/good-attr-select/good-attr-select.vue b/components/good-attr-select/good-attr-select.vue index 2099450..f779861 100644 --- a/components/good-attr-select/good-attr-select.vue +++ b/components/good-attr-select/good-attr-select.vue @@ -44,12 +44,13 @@ > @@ -62,12 +63,13 @@ @@ -89,7 +91,7 @@ {{ item.attrName }} - + { const detail = await getProductDetail(id) @@ -157,6 +166,9 @@ const handleGetDetail = async (id) => { selectedAttr.value = unref(defaultSelectAttrStr).split(',') curAttr.value = productValue.value[defaultSelectAttrStr.value] } + if(storeNum.value>curAttr.value.stock){ + storeNum.value = curAttr.value.stock + } } } @@ -164,6 +176,12 @@ const handleSelectAttr = (index, attr) => { selectedAttr.value[index] = attr let selectedAttrStr = selectedAttr.value.join(',') curAttr.value = productValue.value[selectedAttrStr] + if(storeNum.value === 0 && curAttr.value.stock >0){ + storeNum.value = 1 + } + if(storeNum.value>curAttr.value.stock){ + storeNum.value = curAttr.value.stock + } } const handleSubmit = () => { @@ -180,20 +198,21 @@ const handleSubmit = () => { // }) // return // } - let selectedAttrStr = selectedAttr.value.join(',') - emit('submit', { - store: productValue.value[selectedAttrStr], - num: storeNum.value - }) - emit('select', { - store: productValue.value[selectedAttrStr], - num: storeNum.value - }) - emit('onSelect', { - store: productValue.value[selectedAttrStr], - num: storeNum.value - }) - + if(curAttr.value.stock!==0 && storeNum.value!==0){ + let selectedAttrStr = selectedAttr.value.join(',') + emit('submit', { + store: productValue.value[selectedAttrStr], + num: storeNum.value + }) + emit('select', { + store: productValue.value[selectedAttrStr], + num: storeNum.value + }) + emit('onSelect', { + store: productValue.value[selectedAttrStr], + num: storeNum.value + }) + } } const {toast} = useInterface() @@ -208,13 +227,11 @@ function handleCartNumberInputChange(e, item) { const value = Number(e.detail.value) if (value <= 0) { storeNum.value = 1 - toast({title: '至少选一件哦~'}) - } - if (value > item.stock) { + } else if (value > item.stock) { storeNum.value = item.stock - toast({title: '超出库存啦~'}) + } else { + storeNum.value = value } - storeNum.value = value } /** @@ -225,13 +242,18 @@ function handleCartNumberInputChange(e, item) { */ function handleCartNumberChange(item, type = 'plus') { if (type === 'plus') { - // + - if (storeNum.value + 1 > item.stock) return toast({title: '超出库存啦~'}) - storeNum.value += 1 + if (storeNum.value + 1 > item.stock){ + storeNum.value =item.stock + } else{ + storeNum.value += 1 + } + } else { - // - - if (storeNum.value - 1 <= 0) return toast({title: '至少选一件哦~'}) - storeNum.value -= 1 + if (storeNum.value - 1 <= 0){ + storeNum.value = 1 + } else { + storeNum.value -= 1 + } } } @@ -268,8 +290,9 @@ defineExpose({ } .attr-info { - flex: 1; + max-width: calc(100% - 150rpx - 30rpx); display: flex; + flex: 1; flex-direction: column; justify-content: space-between; margin-left: 30rpx; @@ -277,6 +300,11 @@ defineExpose({ font-size: 28rpx; line-height: 40rpx; color: #333333; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 2; } &-bottom { @@ -304,12 +332,13 @@ defineExpose({ } &-attr { - padding: 40rpx 30rpx; + padding: 40rpx 30rpx 10rpx 0; &.row { display: flex; align-items: center; justify-content: space-between; + padding-bottom: 40rpx; .goodAttrSelect-attr-title { margin-bottom: 0; @@ -317,7 +346,7 @@ defineExpose({ } &-title { - margin-bottom: 30rpx; + margin:0 0 30rpx 30rpx; } &-content { @@ -341,7 +370,7 @@ defineExpose({ display: flex; justify-content: center; align-items: center; - + margin: 0 0 30rpx 30rpx; &.check { background: #333333; color: #fff; @@ -363,20 +392,33 @@ defineExpose({ .button { font-size: 32rpx; - width: 34rpx; + width: 40rpx; aspect-ratio: 1/1; border-radius: 5rpx; - border: 2rpx solid #cccccc; box-sizing: border-box; display: flex; align-items: center; justify-content: center; transition: all .3s; + border: 1px solid #999999; &:active { scale: 1.2; } + &.disabled{ + border-color: #dddddd; + :deep(.uv-icon__icon){ + color: #dddddd !important; + } + &:active { + scale: 1; + } + } } } +.gap{ + gap: 20rpx; +} + diff --git a/components/good-coupon-select/good-coupon-select.vue b/components/good-coupon-select/good-coupon-select.vue index 49a2d1d..8119e2c 100644 --- a/components/good-coupon-select/good-coupon-select.vue +++ b/components/good-coupon-select/good-coupon-select.vue @@ -6,15 +6,15 @@ > 暂时没有可领取的优惠券~ @@ -31,7 +31,7 @@ import Empty from "@/components/Empty/index.vue" import { getProductCoupon } from "@/api/coupon"; import CouponItem from "@/pages/discountCoupon/components/CouponItem.vue"; import Popup from '@/components/Popup/index.vue'; -import emptyIcon from "@/static/icon/empty/优惠券.png"; +import { emptyCouponIcon } from "@/utils/images"; const props = defineProps(["id"]) @@ -91,6 +91,9 @@ defineExpose({ padding: 24rpx; box-sizing: border-box; width: 100%; + .coupon-list { + margin-bottom: 24rpx; + } } diff --git a/components/goods/goods.vue b/components/goods/goods.vue index fb80588..87b3594 100644 --- a/components/goods/goods.vue +++ b/components/goods/goods.vue @@ -29,7 +29,7 @@ > {{ data.attrInfo.sku }} - + @@ -368,6 +368,9 @@ const handleSelectAttr = () => { font-size: 24rpx; color: #999999; margin-right: 10rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } &-value { @@ -375,6 +378,7 @@ const handleSelectAttr = () => { font-size: 24rpx; color: #333333; margin-right: 10rpx; + display: -webkit-box; } &-action { diff --git a/components/goodsComponents/Goods.vue b/components/goodsComponents/Goods.vue index ba1294d..afd5784 100644 --- a/components/goodsComponents/Goods.vue +++ b/components/goodsComponents/Goods.vue @@ -6,7 +6,8 @@ @update: 2023-11-02 18:30 --> - diff --git a/components/refund-order/refund-order.vue b/components/refund-order/refund-order.vue index 7043153..25297dc 100644 --- a/components/refund-order/refund-order.vue +++ b/components/refund-order/refund-order.vue @@ -42,7 +42,7 @@ :class="data.state === 3 && 'color-y'" >{{ data.state === 3 ? '成功退款' : '待平台处理' }} - {{ data.state === 3 ? '成功' : '' }}退款¥{{data.refundAmount}} + {{ data.state === 3 ? '成功' : '' }}退款¥{{data.refundAmount.toFixed(2)}} @@ -52,14 +52,14 @@ 删除记录 撤销申请 @@ -88,17 +88,20 @@ + diff --git a/pages/bargaining/bargaining.vue b/pages/bargaining/bargaining.vue index 13a4e49..47606c2 100644 --- a/pages/bargaining/bargaining.vue +++ b/pages/bargaining/bargaining.vue @@ -1,7 +1,7 @@