详情
This commit is contained in:
23
package.json
23
package.json
@@ -15,31 +15,30 @@
|
|||||||
"postinstall": "simple-git-hooks"
|
"postinstall": "simple-git-hooks"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-3090920231225001",
|
"@dcloudio/uni-app": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/uni-app-plus": "3.0.0-3090920231225001",
|
"@dcloudio/uni-app-plus": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/uni-components": "3.0.0-3090920231225001",
|
"@dcloudio/uni-components": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
|
"@dcloudio/uni-mp-weixin": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001",
|
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"pinia": "2.0.36",
|
"pinia": "2.0.36",
|
||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"uview-plus": "^3.1.38",
|
"uview-plus": "^3.1.38",
|
||||||
"vue": "3.2.47",
|
"vue": "3.4.21",
|
||||||
"vue-i18n": "^9.1.9",
|
"vue-i18n": "^9.9.0",
|
||||||
"z-paging": "^2.6.2"
|
"z-paging": "^2.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "1.1.0",
|
"@antfu/eslint-config": "1.1.0",
|
||||||
"@dcloudio/types": "^3.4.3",
|
"@dcloudio/types": "^3.4.3",
|
||||||
"@dcloudio/uni-automator": "3.0.0-3090920231225001",
|
"@dcloudio/uni-automator": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
|
"@dcloudio/uni-cli-shared": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
|
"@dcloudio/uni-stacktracey": "3.0.0-4000720240327001",
|
||||||
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
|
"@dcloudio/vite-plugin-uni": "3.0.0-4000720240327001",
|
||||||
"@types/node": "^20.8.10",
|
"@types/node": "^20.8.10",
|
||||||
"@typescript-eslint/parser": "^6.10.0",
|
"@typescript-eslint/parser": "^6.10.0",
|
||||||
"@uni-helper/uni-app-types": "^0.5.9",
|
"@uni-helper/uni-app-types": "^0.5.9",
|
||||||
"@unocss/eslint-plugin": "^0.57.2",
|
"@unocss/eslint-plugin": "^0.57.2",
|
||||||
"@vue/runtime-core": "^3.2.45",
|
"@vue/runtime-core": "^3.4.21",
|
||||||
"@vue/tsconfig": "^0.4.0",
|
"@vue/tsconfig": "^0.4.0",
|
||||||
"czg": "^1.7.1",
|
"czg": "^1.7.1",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
|
@@ -11,5 +11,9 @@ export const getGroupBuyList = (data: {
|
|||||||
export const getGroupBuyDetail = (
|
export const getGroupBuyDetail = (
|
||||||
id: string) => get({ url: `wechat/coupons/group/get/${id}` });
|
id: string) => get({ url: `wechat/coupons/group/get/${id}` });
|
||||||
|
|
||||||
|
export const getGroupBuyRecordList = (groupId: string, pageNum: number, pageSize: number) => post({
|
||||||
|
url: `wechat/coupons/group/order/list?groupId=${groupId}&pageNum=${pageNum}&pageSize=${pageSize}`
|
||||||
|
});
|
||||||
|
|
||||||
export const preOrder = (data: any) => post({ url: 'wechat/coupons/group/pre', data });
|
export const preOrder = (data: any) => post({ url: 'wechat/coupons/group/pre', data });
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<image class='goods-image' :src='bean?.images' />
|
<image class='goods-image' :src='bean?.images' />
|
||||||
<view class='c-flex-column' style='flex: 1'>
|
<view class='c-flex-column' style='flex: 1'>
|
||||||
<text class='goods-name'>{{ bean?.name }}</text>
|
<text class='goods-name'>{{ bean?.name }}</text>
|
||||||
<text class='goods-price'>{{ bean?.price }}</text>
|
<text class='goods-price'>{{ bean?.price||0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
<image class='close-image' :src='assetsUrl("ic_close.png")' @click.stop='close' />
|
<image class='close-image' :src='assetsUrl("ic_close.png")' @click.stop='close' />
|
||||||
</view>
|
</view>
|
||||||
|
@@ -64,6 +64,12 @@
|
|||||||
"navigationBarTitleText": "商品团购券"
|
"navigationBarTitleText": "商品团购券"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "groupbuy/order",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "确认订单"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "webview/index",
|
"path": "webview/index",
|
||||||
"navigationBarTitleText": "网页"
|
"navigationBarTitleText": "网页"
|
||||||
|
@@ -20,12 +20,12 @@
|
|||||||
<text>¥{{ detailBean?.goodsPrice || 0 }}</text>
|
<text>¥{{ detailBean?.goodsPrice || 0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='countdown-time c-flex-column'>
|
<view class='countdown-time c-flex-column'>
|
||||||
<view class='c-flex-row'>180天
|
<view class='c-flex-row'>{{ countdownTime?.days }}天
|
||||||
<text class='time'>23</text>
|
<text class='time'>{{ countdownTime?.hours }}</text>
|
||||||
:
|
:
|
||||||
<text class='time'>23</text>
|
<text class='time'>{{ countdownTime?.minutes }}</text>
|
||||||
:
|
:
|
||||||
<text class='time'>23</text>
|
<text class='time'>{{ countdownTime?.seconds }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text>距离活动结束仅剩</text>
|
<text>距离活动结束仅剩</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
<view class='goods-info-view c-flex-column'>
|
<view class='goods-info-view c-flex-column'>
|
||||||
<view class='c-flex-row'>
|
<view class='c-flex-row'>
|
||||||
<text class='goods-price accent-text-color'>39.89</text>
|
<text class='goods-price accent-text-color'>39.89</text>
|
||||||
<text>销量{{ detailBean.totalNum }}</text>
|
<text>销量{{ detailBean?.totalNum }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='c-flex-row'>
|
<view class='c-flex-row'>
|
||||||
<text style='flex: 1'>{{ detailBean.name }}</text>
|
<text style='flex: 1'>{{ detailBean?.name }}</text>
|
||||||
<view class='share-button c-flex-column'>
|
<view class='share-button c-flex-column'>
|
||||||
<image :src='assetsUrl("ic_share.png")'></image>
|
<image :src='assetsUrl("ic_share.png")'></image>
|
||||||
<button class='btn' plain open-type='share'>分享</button>
|
<button class='btn' plain open-type='share'>分享</button>
|
||||||
@@ -58,12 +58,12 @@
|
|||||||
<view class='recommend-view c-flex-column'>
|
<view class='recommend-view c-flex-column'>
|
||||||
<text>浏览此商品的客户还浏览了</text>
|
<text>浏览此商品的客户还浏览了</text>
|
||||||
<scroll-view scroll-x>
|
<scroll-view scroll-x>
|
||||||
<view style='display: inline-block' v-for='(item, index) in [1, 2, 3, 4]'
|
<view style='display: inline-block' v-for='(item, index) in recommendList'
|
||||||
:key='index'>
|
:key='index'>
|
||||||
<view class='recommend-item c-flex-column'>
|
<view class='recommend-item c-flex-column'>
|
||||||
<image :src='assetsUrl("test_bg.png")' />
|
<image :src='item.images' />
|
||||||
<text>女童夏装套装…</text>
|
<text>{{ item.goodsName }}</text>
|
||||||
<text class='goods-price'>22</text>
|
<text class='goods-price'>{{ item.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -71,76 +71,134 @@
|
|||||||
|
|
||||||
<view class='goods-detail c-flex-column'>
|
<view class='goods-detail c-flex-column'>
|
||||||
<text>商品详情</text>
|
<text>商品详情</text>
|
||||||
|
|
||||||
<image
|
<image
|
||||||
v-for='(item,index) in JSON.parse(detailBean.content).filter((a: any) => a.type === 2).map((b: any) => b.images)'
|
v-for='(item,index) in JSON.parse(detailBean?.content).filter((a: any) => a.type === 2).map((b: any) => b.images)'
|
||||||
:src='item' mode='aspectFill' :key='index' />
|
:src='item' mode='aspectFill' :key='index' />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='bottom-view c-flex-row'>
|
<view class='goods-detail record-view c-flex-column'>
|
||||||
<view class='small-button-view' @click.stop='goBack'>
|
<text class='record-view-title'>跟团记录</text>
|
||||||
<view class='small-button-item'>
|
<scroll-view>
|
||||||
<image :src='assetsUrl("ic_goods_store.png")' />
|
<view class='c-flex-column' v-for='(item,index) in recordList' :key='index'>
|
||||||
<text>商家</text>
|
<view class='item-view c-flex-row'>
|
||||||
</view>
|
<image :src='item.memberImage' />
|
||||||
|
<view class='c-flex-column' style='flex: 1'>
|
||||||
<view class='small-button-item' @click.stop='goPath("/pages/mine/subs/order/index")'>
|
<text>{{ item.goodsCode }}</text>
|
||||||
<image :src='assetsUrl("ic_goods_order.png")' />
|
<text>{{ item.createTime }}</text>
|
||||||
<text>订单</text>
|
</view>
|
||||||
</view>
|
<text>+{{ item.goodsNum }}</text>
|
||||||
|
|
||||||
<view class='small-button-item'>
|
|
||||||
<view class='shoppingcart-count' @click.stop='goPath("/pages/mall/subs/shoppingcart/index")'>
|
|
||||||
<image :src='assetsUrl("ic_goods_shoppingcart.png")' />
|
|
||||||
<text>12</text>
|
|
||||||
</view>
|
</view>
|
||||||
<text>购物车</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class='bottom-view c-flex-row'>
|
||||||
<view class='primary-button-view c-flex-row'>
|
<view class='primary-button-view c-flex-row'>
|
||||||
<view class='add-shoppingcart-button' @click.stop='addShoppingCart'>加入购物车</view>
|
<view class='place-order-button' @click.stop='placeOrder'>跟团购买</view>
|
||||||
<view class='place-order-button' @click.stop='placeOrder'>立即下单</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<sku-dialog ref='skuDialogRef' />
|
<sku-dialog ref='skuDialogRef' :bean='detailBean?.goods' @confirm='confirmGoodsSku' />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { assetsUrl } from '@/utils/assets';
|
import { assetsUrl } from '@/utils/assets';
|
||||||
import { goPath } from '@/utils';
|
import { goPath } from '@/utils';
|
||||||
import SkuDialog from '@/components/sku-dialog.vue';
|
import SkuDialog from '@/components/sku-dialog.vue';
|
||||||
import { getGroupBuyDetail } from '@/api/groupbuy';
|
import { getGroupBuyDetail, getGroupBuyRecordList } from '@/api/groupbuy';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { getGoodsList } from '@/api/goods';
|
||||||
|
import { GoodsBean } from '@/api/goods/types';
|
||||||
|
|
||||||
const skuDialogRef = ref();
|
const skuDialogRef = ref();
|
||||||
const detailBean = ref();
|
const detailBean = ref();
|
||||||
|
const recommendList = ref<GoodsBean[]>();
|
||||||
|
const skuBean = ref();
|
||||||
|
|
||||||
const bannerList = ref([]);
|
const bannerList = ref([]);
|
||||||
const swiperIndex = ref(0);
|
const swiperIndex = ref(0);
|
||||||
|
|
||||||
onLoad(async (e) => {
|
let interval: number;
|
||||||
|
|
||||||
|
const countdownTime = ref<{
|
||||||
|
days: number,
|
||||||
|
hours: number,
|
||||||
|
minutes: number,
|
||||||
|
seconds: number
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const recordList = ref([]);
|
||||||
|
|
||||||
|
onLoad(async (e: any) => {
|
||||||
detailBean.value = await getGroupBuyDetail(e.id);
|
detailBean.value = await getGroupBuyDetail(e.id);
|
||||||
bannerList.value = JSON.parse(detailBean.value.content).filter((item: any) => item.type === 2).map((item: any) => item.images);
|
bannerList.value = JSON.parse(detailBean.value.content).filter((item: any) => item.type === 2).map((item: any) => item.images);
|
||||||
|
countdown();
|
||||||
|
await fetchRecommendList();
|
||||||
|
await fetchBuyRecordList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnload(() => {
|
||||||
|
if(interval) {
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const fetchRecommendList = async () => {
|
||||||
|
const { rows } = await getGoodsList({
|
||||||
|
page: {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
bean: {
|
||||||
|
keyword: '',
|
||||||
|
typeIds: ['1724629185362591745']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
recommendList.value = rows;
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchBuyRecordList = async () => {
|
||||||
|
const { list } = await getGroupBuyRecordList(detailBean.value.id, 1, 10);
|
||||||
|
recordList.value = list;
|
||||||
|
};
|
||||||
|
|
||||||
const swiperChange = (e: any) => {
|
const swiperChange = (e: any) => {
|
||||||
swiperIndex.value = e.detail.current;
|
swiperIndex.value = e.detail.current;
|
||||||
};
|
};
|
||||||
|
|
||||||
const goBack = () => {
|
const getRemainingDays = computed(() => {
|
||||||
uni.navigateBack();
|
let now = new Date();
|
||||||
|
let end = dayjs(detailBean.value?.endDate).toDate().getTime();
|
||||||
|
return Math.floor((end - now.getTime()) / 1000 / 60 / 60 / 24);
|
||||||
|
});
|
||||||
|
|
||||||
|
const countdown = () => {
|
||||||
|
interval = setInterval(() => {
|
||||||
|
if(detailBean.value?.endDate) {
|
||||||
|
let now = new Date();
|
||||||
|
let end = dayjs(detailBean.value?.endDate).toDate().getTime();
|
||||||
|
let remaining = Math.floor((end - now.getTime()) / 1000);
|
||||||
|
if(remaining > 0) {
|
||||||
|
countdownTime.value = {
|
||||||
|
days: Math.floor(remaining / 60 / 60 / 24),
|
||||||
|
hours: Math.floor(remaining / 60 / 60 % 24),
|
||||||
|
minutes: Math.floor(remaining / 60 % 60),
|
||||||
|
seconds: Math.floor(remaining % 60)
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
const showSkuDialog = () => {
|
const showSkuDialog = () => {
|
||||||
skuDialogRef.value.show();
|
skuDialogRef.value.show();
|
||||||
};
|
};
|
||||||
|
|
||||||
const addShoppingCart = () => {
|
const confirmGoodsSku = (e: any) => {
|
||||||
uni.showToast({
|
skuBean.value = e;
|
||||||
title: '加入购物车成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const placeOrder = () => {
|
const placeOrder = () => {
|
||||||
@@ -332,7 +390,7 @@ const placeOrder = () => {
|
|||||||
view:nth-of-type(n+1) {
|
view:nth-of-type(n+1) {
|
||||||
position: relative;
|
position: relative;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 105rpx;
|
height: 80rpx;
|
||||||
|
|
||||||
text:nth-of-type(1) {
|
text:nth-of-type(1) {
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
@@ -358,7 +416,7 @@ const placeOrder = () => {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 80rpx;
|
top: 40rpx;
|
||||||
left: 100rpx;
|
left: 100rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -474,6 +532,7 @@ const placeOrder = () => {
|
|||||||
|
|
||||||
.primary-button-view {
|
.primary-button-view {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
width: 100%;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
||||||
.add-shoppingcart-button {
|
.add-shoppingcart-button {
|
||||||
@@ -489,13 +548,14 @@ const placeOrder = () => {
|
|||||||
|
|
||||||
.place-order-button {
|
.place-order-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 198rpx;
|
//width: 198rpx;
|
||||||
|
flex: 1;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background: #F32B2B;
|
background: #F32B2B;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
border-radius: 0 40rpx 40rpx 0;
|
border-radius: 40rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -515,4 +575,46 @@ const placeOrder = () => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.record-view {
|
||||||
|
.record-view-title {
|
||||||
|
margin: 20rpx 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-view {
|
||||||
|
margin: 10rpx 20rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.c-flex-column {
|
||||||
|
margin: 0 15rpx;
|
||||||
|
|
||||||
|
text:nth-of-type(1) {
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
text:nth-of-type(2) {
|
||||||
|
font-size: 15rpx;
|
||||||
|
color: #666666;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
text:nth-of-type(1) {
|
||||||
|
color: #F32B2B;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class='card-view'>
|
<view class='card-view'>
|
||||||
<text class='category-title'>2023-02-12</text>
|
<!-- <text class='category-title'>2023-02-12</text>-->
|
||||||
<view class='item c-flex-column' v-for='(item,index) in 3' :key='index'>
|
<view class='item c-flex-column' v-for='(item,index) in 3' :key='index'>
|
||||||
<view class='c-flex-row'>
|
<view class='c-flex-row'>
|
||||||
<text class='primary-text-color' style='flex: 1'>消费</text>
|
<text class='primary-text-color' style='flex: 1'>消费</text>
|
||||||
@@ -10,14 +10,16 @@
|
|||||||
<text class='secondary-text-color' style='flex: 1'>2023-06-27 15:02:11</text>
|
<text class='secondary-text-color' style='flex: 1'>2023-06-27 15:02:11</text>
|
||||||
<text style='color: #999999'>会员余额:¥30.00</text>
|
<text style='color: #999999'>会员余额:¥30.00</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='divider' style='margin-top: 20rpx'/>
|
<view class='divider' style='margin-top: 20rpx' />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
|
import { PropType } from 'vue';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
item: Object
|
item: Object as PropType<any>
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -59,7 +59,6 @@ const codeRefreshInterval = ref(30);
|
|||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
generateCode();
|
generateCode();
|
||||||
console.log('------->>>',userInfo.value)
|
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
codeRefreshInterval.value -= 1;
|
codeRefreshInterval.value -= 1;
|
||||||
|
Reference in New Issue
Block a user