Merge branch 'dev' into 'master'

uniapp【修复】: 售后金额为0的问题/首页骨架屏

See merge request jianweie/coreshoppro!67
This commit is contained in:
花城
2024-11-02 02:33:16 +00:00
6 changed files with 81 additions and 18 deletions

View File

@@ -1,11 +1,11 @@
<template>
<template v-if="props.needSkeleton">
<view v-if="props.needSkeleton" class="coreshop-skeleton">
<uv-skeletons :skeleton="props.skeleton" :loading="props.skeletonLoading">
<coreshop-page-content v-bind="props">
<slot name="default" />
</coreshop-page-content>
</uv-skeletons>
</template>
</view>
<template v-else>
<coreshop-page-content v-bind="props">
@@ -13,7 +13,8 @@
</coreshop-page-content>
<template v-if="props.needLoadingPage">
<uv-loading-page :loading="props.loadingPage" :loading-text="props.loadingText"
:font-size="props.loadingTextFontSize" :color="props.loadingColor" :loadingColor="loadingColor" :bgColor="props.loadingBgColor"></uv-loading-page>
:font-size="props.loadingTextFontSize" :color="props.loadingColor" :loadingColor="loadingColor"
:bgColor="props.loadingBgColor"></uv-loading-page>
</template>
</template>
</template>
@@ -30,7 +31,7 @@
handleCustomRouteJump : () => void | null,
showLoginModalDom : boolean;
needSkeleton : boolean;
skeleton ?: Array<any>;
skeleton ?: Array<{ [key : string] : any }>;
skeletonLoading : boolean;
placeholder : boolean;
loadingPage : boolean;
@@ -38,7 +39,7 @@
loadingText : string;
loadingTextFontSize : string;
loadingBgColor : string;
loadingColor:string;
loadingColor : string;
}>(), {
isBack: true,
bgColor: '#eef2f6',
@@ -51,12 +52,7 @@
handleCustomRouteJump: null,
showLoginModalDom: false,
needSkeleton: false,
skeleton: [{
type: 'line',
num: 3,
gap: '20rpx',
style: ['width: 200rpx;marginBottom: 50rpx;', 'height: 100rpx;', 'width: 500rpx;'],
}],
skeleton: [],
skeletonLoading: false,
placeholder: true,
loadingPage: false,
@@ -64,8 +60,11 @@
loadingText: '加载中...',
loadingTextFontSize: '24rpx',
loadingBgColor: 'rgba(255, 255, 255, 0.2)',
loadingColor:'#d33123'
loadingColor: '#d33123'
});
</script>
<style lang="scss" scoped>
</style>
.coreshop-skeleton {
background-color: #fff;
}
</style>

View File

@@ -15,7 +15,6 @@ export const useSystemInfo = () => {
onMounted(() => {
const systemInfo = uni.getSystemInfoSync();
state.systemInfo = systemInfo;
// #ifndef APP
const menuButton = uni.getMenuButtonBoundingClientRect();
state.menuButtonHeight = menuButton.height + (menuButton.top - systemInfo.statusBarHeight) * 2;

View File

@@ -1,6 +1,6 @@
<template>
<coreshop-page :isBack="false" bgColor="rgba(0,0,0,0)" :isShowStatusBarHeight="false" showLoginModalDom
needLoadingPage :loadingPage="loading">
<coreshop-page :isBack="false" bgColor="rgba(0,0,0,0)" :isShowStatusBarHeight="false" showLoginModalDom needSkeleton :skeleton="skeleton"
:skeletonLoading="loading">
<view class="layout-home-page page-bg">
<image class="home-bg" :src="handleStaticResources('/static/images/home-bg.jpg')"></image>
<uv-navbar :title="shopConfigStore.config?.shopName"
@@ -38,6 +38,7 @@
import { UserToken, onHomePageShow, shareUrl } from '@/core/consts';
import { useUserInfoStore, useShopConfigStore } from '@/core/store';
import { ShareClientEnum, ShareModelEnum, ShareEnum } from '@/core/enum';
import { skeleton } from './skeleton'
/** 获取项目配置 */
const shopConfigStore = useShopConfigStore();

View File

@@ -0,0 +1,61 @@
export const skeleton = [
{
type: 'flex',
num: 1,
children: [{
type: 'line',
num: 1,
style: `height:80px;background: #fff;`
}]
},
{
type: 'flex',
num: 1,
children: [{
type: 'line',
num: 1,
style: 'height:300rpx;marginLeft:20rpx;marginRight: 20rpx;marginTop:20rpx'
}]
},
30, {
type: 'flex',
num: 2,
children: [{
type: 'custom',
style: 'width:98rpx;height:98rpx;marginLeft:20rpx;border-radius: 100%;'
}, {
type: 'custom',
style: 'width:98rpx;height:98rpx;marginLeft:20rpx;border-radius: 100%;'
}, {
type: 'custom',
style: 'width:98rpx;height:98rpx;marginLeft:20rpx;border-radius: 100%;'
}, {
type: 'custom',
style: 'width:98rpx;height:98rpx;marginLeft:20rpx;border-radius: 100%;'
}, {
type: 'custom',
style: 'width:98rpx;height:98rpx;marginLeft:20rpx;border-radius: 100%;'
},
{
type: 'custom',
style: 'width:98rpx;height:98rpx;marginLeft:20rpx;border-radius: 100%;'
}
]
},
30,
30, {
type: 'flex',
num: 5,
children: [
{
type: 'custom',
style: 'width:160rpx;height:160rpx;marginLeft: 20rpx;marginRight: 20rpx;'
},
{
type: 'line',
num: 3,
gap: '30rpx',
style: ["marginRight: 20rpx;", "marginRight: 20rpx;", "marginRight: 20rpx;"]
}]
}
]

View File

@@ -128,6 +128,7 @@
images : Array<any>;
reason : string;
refundPrice : number; /** 退款金额 */
payedAmount : number; /** 订单金额 */
}>({
orderId: "",
goodsList: [],
@@ -139,6 +140,7 @@
images: [],
reason: "",
refundPrice: 0,
payedAmount: 0,
});
const loading = ref(false);
@@ -185,6 +187,7 @@
}
return item;
})
state.payedAmount = orderDetail.data.payedAmount;
state.maxRefund = (orderDetail.data.orderAmount * 10000 - orderDetail.data.refunded * 10000) / 10000;
state.costFreight = orderDetail.data.costFreight;
state.refundShow = (orderDetail.data.payedAmount * 10000 - orderDetail.data.refunded * 10000) / 10000;
@@ -292,7 +295,7 @@
/** 提交 */
async function onSubmit() {
if (!amount(state.refundPrice)) {
if (state.payedAmount != 0 && !amount(state.refundPrice)) {
handleShowToast('请输入正确金额'); return;
}
if (state.refundPrice > state.refundShow) {

View File

@@ -223,7 +223,7 @@
</view>
<view class="msg-box">
<view class="lab">{{ shopConfigStore?.config?.pointShowName }}优惠</view>
<view class="val">{{ state.orderDetail?.pointMoney }}</view>
<view class="val">-{{ state.orderDetail?.pointMoney }}</view>
</view>
<view class="msg-box" v-if="state.orderDetail?.orderDiscountAmount > 0">
<view class="lab">订单优惠</view>