mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 05:19:49 +08:00
uniapp【新增】:新增服务商品列表/详情,订单提交页面,团购列表,拼团列表,秒杀列表,接龙列表,会员中心进入查询系统配置
This commit is contained in:
@@ -67,7 +67,7 @@
|
|||||||
"path": "pages/order/submit/submit",
|
"path": "pages/order/submit/submit",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "订单提交",
|
"navigationBarTitleText": "订单提交",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"path": "pinTuan/list/list",
|
"path": "pinTuan/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团列表",
|
"navigationBarTitleText": "拼团列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"path": "seckill/list/list",
|
"path": "seckill/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "秒杀列表",
|
"navigationBarTitleText": "秒杀列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -36,15 +36,15 @@
|
|||||||
{
|
{
|
||||||
"path": "groupBuying/list/list",
|
"path": "groupBuying/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团列表",
|
"navigationBarTitleText": "团购列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "groupBuying/detail/detail",
|
"path": "groupBuying/detail/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团详情",
|
"navigationBarTitleText": "团购详情",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"path": "solitaire/list/list",
|
"path": "solitaire/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "接龙列表",
|
"navigationBarTitleText": "接龙列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,15 +5,15 @@
|
|||||||
"path": "list/list",
|
"path": "list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "服务商品",
|
"navigationBarTitleText": "服务商品",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "detail/detail",
|
"path": "detail/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "服务商品",
|
"navigationBarTitleText": "服务商品详情",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
"path": "pages/order/submit/submit",
|
"path": "pages/order/submit/submit",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "订单提交",
|
"navigationBarTitleText": "订单提交",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -474,15 +474,15 @@
|
|||||||
"path": "list/list",
|
"path": "list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "服务商品",
|
"navigationBarTitleText": "服务商品",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "detail/detail",
|
"path": "detail/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "服务商品",
|
"navigationBarTitleText": "服务商品详情",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -493,7 +493,7 @@
|
|||||||
"path": "pinTuan/list/list",
|
"path": "pinTuan/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团列表",
|
"navigationBarTitleText": "拼团列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -509,7 +509,7 @@
|
|||||||
"path": "seckill/list/list",
|
"path": "seckill/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "秒杀列表",
|
"navigationBarTitleText": "秒杀列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -524,15 +524,15 @@
|
|||||||
{
|
{
|
||||||
"path": "groupBuying/list/list",
|
"path": "groupBuying/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团列表",
|
"navigationBarTitleText": "团购列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "groupBuying/detail/detail",
|
"path": "groupBuying/detail/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团详情",
|
"navigationBarTitleText": "团购详情",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@@ -541,7 +541,7 @@
|
|||||||
"path": "solitaire/list/list",
|
"path": "solitaire/list/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "接龙列表",
|
"navigationBarTitleText": "接龙列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const hanldeClickViewMore = () => {
|
const hanldeClickViewMore = () => {
|
||||||
console.log('点击更多')
|
handleRouteNavigateTo('/pages/category/category')
|
||||||
}
|
}
|
||||||
|
|
||||||
const hanldeClickGoods = (data : any) => {
|
const hanldeClickGoods = (data : any) => {
|
||||||
|
|||||||
@@ -211,6 +211,7 @@
|
|||||||
getOrderStatusNum();
|
getOrderStatusNum();
|
||||||
getUserInfo();
|
getUserInfo();
|
||||||
}
|
}
|
||||||
|
shopConfigStore.querySystemConfig();
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 获取用户信息 */
|
/** 获取用户信息 */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page title="订单提交" mode="left">
|
<coreshop-page title="订单提交" mode="left" needLoadingPage :loadingPage="loadingPage">
|
||||||
<view class="layout-order-box p-25 m-b-25">
|
<view class="layout-order-box p-25 m-b-25">
|
||||||
<!-- 下单提醒 -->
|
<!-- 下单提醒 -->
|
||||||
<view class="remind-box">
|
<view class="remind-box">
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, computed, ref } from 'vue';
|
import { reactive, computed, ref } from 'vue';
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
PaymentTypeEnum, OrderDistributionEnum, ShowStoresSwitchEnum,
|
PaymentTypeEnum, OrderDistributionEnum, ShowStoresSwitchEnum,
|
||||||
OpenPointEnum, PointExchangeModelEnum, ShowPointExchangePriceEnum,
|
OpenPointEnum, PointExchangeModelEnum, ShowPointExchangePriceEnum,
|
||||||
@@ -257,6 +257,11 @@
|
|||||||
teamId ?: number;
|
teamId ?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CartListCallBack {
|
||||||
|
success : Function,
|
||||||
|
file : Function,
|
||||||
|
}
|
||||||
|
|
||||||
/** 获取项目配置 */
|
/** 获取项目配置 */
|
||||||
const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
|
const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
@@ -310,8 +315,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
const loadingPage = ref(true);
|
||||||
const handleSubmit = useLoadingFn(onSubmit, loading);
|
const handleSubmit = useLoadingFn(onSubmit, loading);
|
||||||
|
const handleGetOrderDetail = useLoadingFn(getOrderDetail, loadingPage);
|
||||||
/** 是否显示积分兑换价合计 */
|
/** 是否显示积分兑换价合计 */
|
||||||
const isShowPointRedemptionPrice = computed(() => {
|
const isShowPointRedemptionPrice = computed(() => {
|
||||||
return shopConfigStore.config.pointSwitch == OpenPointEnum.yes &&
|
return shopConfigStore.config.pointSwitch == OpenPointEnum.yes &&
|
||||||
@@ -381,6 +387,15 @@
|
|||||||
if (query.teamId) {
|
if (query.teamId) {
|
||||||
state.teamId = query.teamId;
|
state.teamId = query.teamId;
|
||||||
}
|
}
|
||||||
|
handleGetOrderDetail();
|
||||||
|
});
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
await handleGetOrderDetail();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getOrderDetail() {
|
||||||
|
|
||||||
/** 获取不同类型,营销下单支持的配送方式 */
|
/** 获取不同类型,营销下单支持的配送方式 */
|
||||||
await getOrderDistributionModel();
|
await getOrderDistributionModel();
|
||||||
@@ -392,18 +407,11 @@
|
|||||||
}
|
}
|
||||||
/** 获取用户默认地址 */
|
/** 获取用户默认地址 */
|
||||||
await getUserDefaultShip();
|
await getUserDefaultShip();
|
||||||
});
|
|
||||||
|
|
||||||
interface CartListCallBack {
|
|
||||||
success : Function,
|
|
||||||
file : Function,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 获取商品详情 */
|
/** 获取商品详情 */
|
||||||
const getCartList = async (data ?: CartListCallBack) => {
|
const getCartList = async (data ?: CartListCallBack) => {
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中'
|
|
||||||
});
|
|
||||||
state.params.receiptType = state.tabSelectType;
|
state.params.receiptType = state.tabSelectType;
|
||||||
|
|
||||||
const cartList : Response<any> = await queryCartList({
|
const cartList : Response<any> = await queryCartList({
|
||||||
@@ -414,7 +422,6 @@
|
|||||||
couponCode: state.couponCodeList.length > 0 ? state.couponCodeList.join(',') : '',
|
couponCode: state.couponCodeList.length > 0 ? state.couponCodeList.join(',') : '',
|
||||||
});
|
});
|
||||||
if (cartList.status) {
|
if (cartList.status) {
|
||||||
uni.hideLoading();
|
|
||||||
state.cartData = cartList?.data;
|
state.cartData = cartList?.data;
|
||||||
|
|
||||||
/** 判断是否有库存 */
|
/** 判断是否有库存 */
|
||||||
@@ -432,7 +439,6 @@
|
|||||||
}
|
}
|
||||||
data?.success(cartList);
|
data?.success(cartList);
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading();
|
|
||||||
data?.file(cartList);
|
data?.file(cartList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page title="团购" mode="left" bgColor="#D33123" titleColor="#fff">
|
<coreshop-page title="团购" mode="left" bgColor="#D33123" titleColor="#fff" needLoadingPage :loadingPage="loading">
|
||||||
<view class="layout-goods-box">
|
<view class="layout-goods-box">
|
||||||
<view class="goods-box" v-if="state.list.length > 0">
|
<view class="goods-box" v-if="state.list.length > 0">
|
||||||
<view class="card-box" v-for="item, index in state.list" :key="index">
|
<view class="card-box" v-for="item, index in state.list" :key="index">
|
||||||
@@ -55,11 +55,12 @@
|
|||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { handleRouteNavigateTo } from '@/core/utils';
|
import { handleRouteNavigateTo } from '@/core/utils';
|
||||||
import { queryActivityList } from '@/core/api';
|
import { queryActivityList } from '@/core/api';
|
||||||
import { PaymentTypeEnum, IsStartSeckillEnum, EmptyEnum } from '@/core/enum';
|
import { PaymentTypeEnum, IsStartSeckillEnum, EmptyEnum } from '@/core/enum';
|
||||||
|
import { useLoadingFn } from '@/core/hooks';
|
||||||
|
|
||||||
interface QueryParams {
|
interface QueryParams {
|
||||||
id : number;
|
id : number;
|
||||||
@@ -78,26 +79,29 @@
|
|||||||
list: [],
|
list: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad((query : QueryParams) => {
|
const loading = ref(true);
|
||||||
getActivityList();
|
const handleQuerytActivityList = useLoadingFn(getActivityList, loading);
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
handleQuerytActivityList();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
state.list = [];
|
||||||
|
await handleQuerytActivityList();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
/** 获取团购列表 */
|
/** 获取团购列表 */
|
||||||
const getActivityList = async () => {
|
async function getActivityList() {
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中..."
|
|
||||||
})
|
|
||||||
|
|
||||||
const activityList = await queryActivityList({
|
const activityList = await queryActivityList({
|
||||||
page: state.page,
|
page: state.page,
|
||||||
limit: state.limit,
|
limit: state.limit,
|
||||||
type: PaymentTypeEnum.group,
|
type: PaymentTypeEnum.group,
|
||||||
status: IsStartSeckillEnum.start
|
status: IsStartSeckillEnum.start
|
||||||
});
|
});
|
||||||
|
|
||||||
state.totalPages = activityList.data?.totalPages;
|
state.totalPages = activityList.data?.totalPages;
|
||||||
state.list = state.list.concat(activityList.data?.list);
|
state.list = state.list.concat(activityList.data?.list);
|
||||||
uni.hideLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组合商品数据传入组件
|
// 组合商品数据传入组件
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page title="拼团" titleColor="#fff" bgColor="rgba(0,0,0,0)" mode="left" :isShowStatusBarHeight="false">
|
<coreshop-page title="拼团" titleColor="#fff" bgColor="rgba(0,0,0,0)" mode="left" :isShowStatusBarHeight="false"
|
||||||
|
needLoadingPage :loadingPage="loading">
|
||||||
<view class="layout-pintuan-box" v-if="state.list.length > 0">
|
<view class="layout-pintuan-box" v-if="state.list.length > 0">
|
||||||
<view class="bg-box"></view>
|
<view class="bg-box"></view>
|
||||||
<view class="content-box">
|
<view class="content-box">
|
||||||
@@ -45,12 +46,13 @@
|
|||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, onMounted } from 'vue';
|
import { reactive, onMounted, ref } from 'vue';
|
||||||
import { onReachBottom } from '@dcloudio/uni-app';
|
import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { queryPinTuanList } from '@/core/api';
|
import { queryPinTuanList } from '@/core/api';
|
||||||
import type { Response, PinTuanListType } from '@/core/models';
|
import type { Response, PinTuanListType } from '@/core/models';
|
||||||
import { EmptyEnum } from '@/core/enum';
|
import { EmptyEnum } from '@/core/enum';
|
||||||
import { handleRouteNavigateTo } from '@/core/utils';
|
import { handleRouteNavigateTo } from '@/core/utils';
|
||||||
|
import { useLoadingFn } from '@/core/hooks';
|
||||||
|
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
list : Array<PinTuanListType>;
|
list : Array<PinTuanListType>;
|
||||||
@@ -64,16 +66,22 @@
|
|||||||
noData: false,
|
noData: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const loading = ref(true);
|
||||||
|
const handleQuerytPinTuanList = useLoadingFn(getPinTuanList, loading);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
/** 获取拼团列表 */
|
/** 获取拼团列表 */
|
||||||
getPinTuanList()
|
handleQuerytPinTuanList()
|
||||||
|
});
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
state.list = [];
|
||||||
|
await handleQuerytPinTuanList();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 获取拼团列表 */
|
/** 获取拼团列表 */
|
||||||
const getPinTuanList = async () => {
|
async function getPinTuanList() {
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中..."
|
|
||||||
})
|
|
||||||
const pinTuanList : Response<Array<PinTuanListType>> = await queryPinTuanList({
|
const pinTuanList : Response<Array<PinTuanListType>> = await queryPinTuanList({
|
||||||
page: state.page,
|
page: state.page,
|
||||||
limit: state.limit,
|
limit: state.limit,
|
||||||
@@ -84,7 +92,6 @@
|
|||||||
if (pinTuanList.data?.length > 0) {
|
if (pinTuanList.data?.length > 0) {
|
||||||
state.list = state.list.concat(pinTuanList.data);
|
state.list = state.list.concat(pinTuanList.data);
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 组合商品数据传入组件 */
|
/** 组合商品数据传入组件 */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page title="秒杀" mode="left" bgColor="#D33123" titleColor="#fff">
|
<coreshop-page title="秒杀" mode="left" bgColor="#D33123" titleColor="#fff" needLoadingPage :loadingPage="loading">
|
||||||
<view class="layout-seckill-box">
|
<view class="layout-seckill-box">
|
||||||
<view class="navbar-box" :style="{ 'top': `${statusBarHeight}px` }">
|
<view class="navbar-box" :style="{ 'top': `${statusBarHeight}px` }">
|
||||||
<image class="bg" :style="{ 'left': state.left }"
|
<image class="bg" :style="{ 'left': state.left }"
|
||||||
@@ -64,9 +64,9 @@
|
|||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { useSystemInfo } from '@/core/hooks';
|
import { useLoadingFn, useSystemInfo } from '@/core/hooks';
|
||||||
import { handleStaticResources, handleRouteNavigateTo } from '@/core/utils';
|
import { handleStaticResources, handleRouteNavigateTo } from '@/core/utils';
|
||||||
import { queryActivityList } from '@/core/api';
|
import { queryActivityList } from '@/core/api';
|
||||||
import { PaymentTypeEnum, IsStartSeckillEnum, EmptyEnum } from '@/core/enum';
|
import { PaymentTypeEnum, IsStartSeckillEnum, EmptyEnum } from '@/core/enum';
|
||||||
@@ -120,9 +120,17 @@
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad((query : QueryParams) => {
|
const loading = ref(true);
|
||||||
getActivityList();
|
const handleQuerytActivityList = useLoadingFn(getActivityList, loading);
|
||||||
})
|
onLoad(() => {
|
||||||
|
handleQuerytActivityList();
|
||||||
|
});
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
state.list = [];
|
||||||
|
await handleQuerytActivityList();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
/** 切换tab */
|
/** 切换tab */
|
||||||
const handleChangeTab = (item : ItabList) => {
|
const handleChangeTab = (item : ItabList) => {
|
||||||
@@ -130,15 +138,12 @@
|
|||||||
state.tabStatus = item.status;
|
state.tabStatus = item.status;
|
||||||
state.left = item.left;
|
state.left = item.left;
|
||||||
state.list = [];
|
state.list = [];
|
||||||
getActivityList();
|
handleQuerytActivityList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取秒杀列表 */
|
/** 获取秒杀列表 */
|
||||||
const getActivityList = async () => {
|
async function getActivityList() {
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中..."
|
|
||||||
})
|
|
||||||
|
|
||||||
const activityList = await queryActivityList({
|
const activityList = await queryActivityList({
|
||||||
page: state.page,
|
page: state.page,
|
||||||
@@ -149,7 +154,6 @@
|
|||||||
|
|
||||||
state.totalPages = activityList.data?.totalPages;
|
state.totalPages = activityList.data?.totalPages;
|
||||||
state.list = state.list.concat(activityList.data?.list);
|
state.list = state.list.concat(activityList.data?.list);
|
||||||
uni.hideLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组合商品数据传入组件
|
// 组合商品数据传入组件
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page title="接龙" mode="left" bgColor="#D33123" titleColor="#fff" showLoginModalDom>
|
<coreshop-page title="接龙" mode="left" bgColor="#D33123" titleColor="#fff" showLoginModalDom needLoadingPage
|
||||||
|
:loadingPage="loading">
|
||||||
<view class="layout-solitaire-box">
|
<view class="layout-solitaire-box">
|
||||||
<view class="config-box">
|
<view class="config-box">
|
||||||
<image class="img" :src="shopConfigStore?.config?.shopLogo"></image>
|
<image class="img" :src="shopConfigStore?.config?.shopLogo"></image>
|
||||||
@@ -44,13 +45,14 @@
|
|||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { handleRouteNavigateTo } from '@/core/utils';
|
import { handleRouteNavigateTo } from '@/core/utils';
|
||||||
import { querySolitaireList } from '@/core/api';
|
import { querySolitaireList } from '@/core/api';
|
||||||
import { EmptyEnum } from '@/core/enum';
|
import { EmptyEnum } from '@/core/enum';
|
||||||
import { useShopConfigStore, useLoginStore } from '@/core/store';
|
import { useShopConfigStore, useLoginStore } from '@/core/store';
|
||||||
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
|
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
|
||||||
|
import { useLoadingFn } from '@/core/hooks';
|
||||||
|
|
||||||
/** 获取项目配置 */
|
/** 获取项目配置 */
|
||||||
const shopConfigStore = useShopConfigStore();
|
const shopConfigStore = useShopConfigStore();
|
||||||
@@ -72,15 +74,22 @@
|
|||||||
noData: false,
|
noData: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const loading = ref(true);
|
||||||
|
const handleQuerytSolitaireList = useLoadingFn(getSolitaireList, loading);
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getSolitaireList();
|
handleQuerytSolitaireList();
|
||||||
})
|
});
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
state.list = [];
|
||||||
|
await handleQuerytSolitaireList();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/** 获取接龙列表 */
|
/** 获取接龙列表 */
|
||||||
const getSolitaireList = async () => {
|
async function getSolitaireList() {
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中..."
|
|
||||||
})
|
|
||||||
|
|
||||||
const activityList = await querySolitaireList({
|
const activityList = await querySolitaireList({
|
||||||
page: state.page,
|
page: state.page,
|
||||||
@@ -93,7 +102,6 @@
|
|||||||
if (activityList.data?.length > 0) {
|
if (activityList.data?.length > 0) {
|
||||||
state.list = state.list.concat(activityList.data);
|
state.list = state.list.concat(activityList.data);
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组合商品数据传入组件
|
// 组合商品数据传入组件
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page bgColor="rgba(0,0,0,0)" :isShowStatusBarHeight="false" :placeholder="false" showLoginModalDom>
|
<coreshop-page bgColor="rgba(0,0,0,0)" :isShowStatusBarHeight="false" :placeholder="false" showLoginModalDom
|
||||||
|
needLoadingPage :loadingPage="loadingPage">
|
||||||
<view class="layout-goods-detail">
|
<view class="layout-goods-detail">
|
||||||
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
||||||
:swiperBanner="state.swiperBanner" :goodsDetailContent="state.goodsDetailContent"
|
:swiperBanner="state.swiperBanner" :goodsDetailContent="state.goodsDetailContent"
|
||||||
@@ -81,8 +82,8 @@
|
|||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad ,onShareAppMessage,onShareTimeline} from '@dcloudio/uni-app';
|
import { onLoad, onShareAppMessage, onShareTimeline,onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import type { Response, ServiceGoodsType } from '@/core/models';
|
import type { Response, ServiceGoodsType } from '@/core/models';
|
||||||
import { queryServiceDetail, queryAddServiceOrder } from '@/core/api';
|
import { queryServiceDetail, queryAddServiceOrder } from '@/core/api';
|
||||||
import { ServiceGoodsOpenEnum, ShareEnum, PaymentTypeEnum, ShareClientEnum, ShareModelEnum, } from '@/core/enum';
|
import { ServiceGoodsOpenEnum, ShareEnum, PaymentTypeEnum, ShareClientEnum, ShareModelEnum, } from '@/core/enum';
|
||||||
@@ -92,6 +93,7 @@
|
|||||||
import GoodsDetail from '@/pages/components/goods-detail/index.vue';
|
import GoodsDetail from '@/pages/components/goods-detail/index.vue';
|
||||||
import GoodsDetailRecommend from '@/pages/components/goods-detail/components/goods-detail-recommend/goods-detail-recommend.vue';
|
import GoodsDetailRecommend from '@/pages/components/goods-detail/components/goods-detail-recommend/goods-detail-recommend.vue';
|
||||||
import GoodsDetailBottomTabbar from '@/pages/components/goods-detail/components/goods-detail-bottom-tabbar/goods-detail-bottom-tabbar.vue';
|
import GoodsDetailBottomTabbar from '@/pages/components/goods-detail/components/goods-detail-bottom-tabbar/goods-detail-bottom-tabbar.vue';
|
||||||
|
import { useLoadingFn } from '@/core/hooks';
|
||||||
|
|
||||||
interface QueryParams {
|
interface QueryParams {
|
||||||
id : number;
|
id : number;
|
||||||
@@ -114,13 +116,22 @@
|
|||||||
shareUrl: "",
|
shareUrl: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const loadingPage = ref(true);
|
||||||
|
const handleGetGoodsDetail = useLoadingFn(getGoodsDetail, loadingPage);
|
||||||
|
|
||||||
|
|
||||||
onLoad((query : QueryParams) => {
|
onLoad((query : QueryParams) => {
|
||||||
state.id = query?.id;
|
state.id = query?.id;
|
||||||
/** 获取商品详情 */
|
/** 获取商品详情 */
|
||||||
getGoodsDetail();
|
handleGetGoodsDetail();
|
||||||
})
|
});
|
||||||
|
|
||||||
const getGoodsDetail = async () => {
|
onPullDownRefresh(async () => {
|
||||||
|
await handleGetGoodsDetail();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getGoodsDetail() {
|
||||||
const goodsDetail : Response<ServiceGoodsType> = await queryServiceDetail({ id: state.id });
|
const goodsDetail : Response<ServiceGoodsType> = await queryServiceDetail({ id: state.id });
|
||||||
if (goodsDetail.status) {
|
if (goodsDetail.status) {
|
||||||
state.goodsDetailData = {
|
state.goodsDetailData = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<coreshop-page title="服务商品" mode="left">
|
<coreshop-page title="服务商品" mode="left" needLoadingPage :loadingPage="loading">
|
||||||
<view class="layout-goods-box">
|
<view class="layout-goods-box">
|
||||||
<view v-if="state.list.length > 0">
|
<view v-if="state.list.length > 0">
|
||||||
<view class="item-box" v-for="item, index in state.list" :key="item.id">
|
<view class="item-box" v-for="item, index in state.list" :key="item.id">
|
||||||
@@ -77,12 +77,13 @@
|
|||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { queryServicelist } from '@/core/api';
|
import { queryServicelist } from '@/core/api';
|
||||||
import type { Response, ServiceGoodsType } from '@/core/models';
|
import type { Response, ServiceGoodsType } from '@/core/models';
|
||||||
import { EmptyEnum, ServiceGoodsOpenEnum } from '@/core/enum';
|
import { EmptyEnum, ServiceGoodsOpenEnum } from '@/core/enum';
|
||||||
import { handleRouteNavigateTo } from '@/core/utils';
|
import { handleRouteNavigateTo } from '@/core/utils';
|
||||||
|
import { useLoadingFn } from '@/core/hooks';
|
||||||
|
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
list : Array<ServiceGoodsType>;
|
list : Array<ServiceGoodsType>;
|
||||||
@@ -98,15 +99,22 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const loading = ref(true);
|
||||||
|
const handleQuerytServicelist = useLoadingFn(getServicelist, loading);
|
||||||
|
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getServicelist()
|
handleQuerytServicelist()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
state.list = [];
|
||||||
|
await handleQuerytServicelist();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
/** 获取服务商品列表 */
|
/** 获取服务商品列表 */
|
||||||
const getServicelist = async () => {
|
async function getServicelist() {
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中..."
|
|
||||||
})
|
|
||||||
const servicelist : Response<Array<ServiceGoodsType>> = await queryServicelist({
|
const servicelist : Response<Array<ServiceGoodsType>> = await queryServicelist({
|
||||||
page: state.page,
|
page: state.page,
|
||||||
limit: state.limit
|
limit: state.limit
|
||||||
@@ -121,7 +129,6 @@
|
|||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
}));
|
}));
|
||||||
uni.hideLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user