mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
Merge branch 'dev' into 'master'
uniapp【修复】: 购物车商品 增/减数量没有调用接口更新 See merge request jianweie/coreshoppro!57
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
</coreshop-page-content>
|
</coreshop-page-content>
|
||||||
<template v-if="props.needLoadingPage">
|
<template v-if="props.needLoadingPage">
|
||||||
<uv-loading-page :loading="props.loadingPage" :loading-text="props.loadingText"
|
<uv-loading-page :loading="props.loadingPage" :loading-text="props.loadingText"
|
||||||
:font-size="props.loadingTextFontSize" :bgColor="props.loadingBgColor"></uv-loading-page>
|
:font-size="props.loadingTextFontSize" :color="props.loadingColor" :loadingColor="loadingColor" :bgColor="props.loadingBgColor"></uv-loading-page>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
loadingText : string;
|
loadingText : string;
|
||||||
loadingTextFontSize : string;
|
loadingTextFontSize : string;
|
||||||
loadingBgColor : string;
|
loadingBgColor : string;
|
||||||
|
loadingColor:string;
|
||||||
}>(), {
|
}>(), {
|
||||||
isBack: true,
|
isBack: true,
|
||||||
bgColor: '#eef2f6',
|
bgColor: '#eef2f6',
|
||||||
@@ -62,7 +63,8 @@
|
|||||||
needLoadingPage: false,
|
needLoadingPage: false,
|
||||||
loadingText: '加载中...',
|
loadingText: '加载中...',
|
||||||
loadingTextFontSize: '24rpx',
|
loadingTextFontSize: '24rpx',
|
||||||
loadingBgColor: 'rgba(255, 255, 255, 0.2)'
|
loadingBgColor: 'rgba(255, 255, 255, 0.2)',
|
||||||
|
loadingColor:'#d33123'
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -51,4 +51,8 @@ export const queryRemoveCart = (data : any) : Promise<Response<any>> => {
|
|||||||
return post('Api/Cart/DoDelete', {
|
return post('Api/Cart/DoDelete', {
|
||||||
data,
|
data,
|
||||||
}, true);
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const setCartProductNum = (productId : number, nums : number) => {
|
||||||
|
return post('api/Cart/SetCartNum', { data: { id: productId, nums } })
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-navbar :isBack="false" mode="left" title="购物车"> </coreshop-navbar>
|
<coreshop-navbar :isBack="false" mode="left" title="购物车"> </coreshop-navbar>
|
||||||
<view class="content-box p-25 page-bg">
|
<view class="content-box p-25 page-bg">
|
||||||
<view class="cart-box" v-if="state.cartList.length > 0">
|
<view class="cart-box" v-if="state.cartList.length > 0">
|
||||||
<view class="all-select" :style="{ 'top': `${statusBarHeight}px` }">
|
<view class="all-select" :style="{ 'top': `${statusBarHeight}px` }">
|
||||||
@@ -100,8 +100,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-loading-page :loading="loading" loading-text="加载中..." font-size="24rpx"
|
<uv-loading-page :loading="loading" loading-text="加载中..." color="#d33123" loadingColor="#d33123"
|
||||||
bgColor="rgba(255, 255, 255, 0.2)"></uv-loading-page>
|
font-size="24rpx" bgColor="rgba(255, 255, 255, 0.2)"></uv-loading-page>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
import { reactive, nextTick, computed, ref } from 'vue';
|
import { reactive, nextTick, computed, ref } from 'vue';
|
||||||
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { handleStaticResources, hanldeShowModal, handleRouteSwitchTab, handleRouteNavigateTo, handleShowToast } from '@/core/utils';
|
import { handleStaticResources, hanldeShowModal, handleRouteSwitchTab, handleRouteNavigateTo, handleShowToast } from '@/core/utils';
|
||||||
import { queryCartList, deleteGoodsSingle, deleteGoodsSome } from '@/core/api';
|
import { queryCartList, deleteGoodsSingle, deleteGoodsSome, setCartProductNum } from '@/core/api';
|
||||||
import type { Response, CartListType, ShopConfigStoreType } from '@/core/models';
|
import type { Response, CartListType, ShopConfigStoreType } from '@/core/models';
|
||||||
import { useShopConfigStore } from '@/core/store';
|
import { useShopConfigStore } from '@/core/store';
|
||||||
import {
|
import {
|
||||||
@@ -244,11 +244,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 商品加减 */
|
/** 商品加减 */
|
||||||
const handleChangeGoodsNum = (e : any, item : any) => {
|
const handleChangeGoodsNum = async (e : any, item : CartListType) => {
|
||||||
|
await setCartProductNum(item.productId, e.value);
|
||||||
item.nums = e.value;
|
item.nums = e.value;
|
||||||
nextTick(() => {
|
handleCalculatePrice();
|
||||||
handleCalculatePrice();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 单个删除 */
|
/** 单个删除 */
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-loading-page :loading="loading" loading-text="加载中..." font-size="24rpx"
|
<uv-loading-page :loading="loading" loading-text="加载中..." color="#d33123" loadingColor="#d33123" font-size="24rpx"
|
||||||
bgColor="rgba(255, 255, 255, 0.2)"></uv-loading-page>
|
bgColor="rgba(255, 255, 255, 0.2)"></uv-loading-page>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user