详情
This commit is contained in:
23
package.json
23
package.json
@@ -15,31 +15,30 @@
|
||||
"postinstall": "simple-git-hooks"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-components": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-app": "3.0.0-4000720240327001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-4000720240327001",
|
||||
"@dcloudio/uni-components": "3.0.0-4000720240327001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-4000720240327001",
|
||||
"dayjs": "^1.11.10",
|
||||
"pinia": "2.0.36",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"uview-plus": "^3.1.38",
|
||||
"vue": "3.2.47",
|
||||
"vue-i18n": "^9.1.9",
|
||||
"vue": "3.4.21",
|
||||
"vue-i18n": "^9.9.0",
|
||||
"z-paging": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "1.1.0",
|
||||
"@dcloudio/types": "^3.4.3",
|
||||
"@dcloudio/uni-automator": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
|
||||
"@dcloudio/uni-automator": "3.0.0-4000720240327001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-4000720240327001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-4000720240327001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-4000720240327001",
|
||||
"@types/node": "^20.8.10",
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"@uni-helper/uni-app-types": "^0.5.9",
|
||||
"@unocss/eslint-plugin": "^0.57.2",
|
||||
"@vue/runtime-core": "^3.2.45",
|
||||
"@vue/runtime-core": "^3.4.21",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"czg": "^1.7.1",
|
||||
"eslint": "^8.53.0",
|
||||
|
@@ -11,5 +11,9 @@ export const getGroupBuyList = (data: {
|
||||
export const getGroupBuyDetail = (
|
||||
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 });
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<image class='goods-image' :src='bean?.images' />
|
||||
<view class='c-flex-column' style='flex: 1'>
|
||||
<text class='goods-name'>{{ bean?.name }}</text>
|
||||
<text class='goods-price'>{{ bean?.price }}</text>
|
||||
<text class='goods-price'>{{ bean?.price||0 }}</text>
|
||||
</view>
|
||||
<image class='close-image' :src='assetsUrl("ic_close.png")' @click.stop='close' />
|
||||
</view>
|
||||
|
@@ -64,6 +64,12 @@
|
||||
"navigationBarTitleText": "商品团购券"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "groupbuy/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "webview/index",
|
||||
"navigationBarTitleText": "网页"
|
||||
|
@@ -20,12 +20,12 @@
|
||||
<text>¥{{ detailBean?.goodsPrice || 0 }}</text>
|
||||
</view>
|
||||
<view class='countdown-time c-flex-column'>
|
||||
<view class='c-flex-row'>180天
|
||||
<text class='time'>23</text>
|
||||
<view class='c-flex-row'>{{ countdownTime?.days }}天
|
||||
<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>
|
||||
<text>距离活动结束仅剩</text>
|
||||
</view>
|
||||
@@ -34,11 +34,11 @@
|
||||
<view class='goods-info-view c-flex-column'>
|
||||
<view class='c-flex-row'>
|
||||
<text class='goods-price accent-text-color'>39.89</text>
|
||||
<text>销量{{ detailBean.totalNum }}</text>
|
||||
<text>销量{{ detailBean?.totalNum }}</text>
|
||||
</view>
|
||||
|
||||
<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'>
|
||||
<image :src='assetsUrl("ic_share.png")'></image>
|
||||
<button class='btn' plain open-type='share'>分享</button>
|
||||
@@ -58,12 +58,12 @@
|
||||
<view class='recommend-view c-flex-column'>
|
||||
<text>浏览此商品的客户还浏览了</text>
|
||||
<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'>
|
||||
<view class='recommend-item c-flex-column'>
|
||||
<image :src='assetsUrl("test_bg.png")' />
|
||||
<text>女童夏装套装…</text>
|
||||
<text class='goods-price'>22</text>
|
||||
<image :src='item.images' />
|
||||
<text>{{ item.goodsName }}</text>
|
||||
<text class='goods-price'>{{ item.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -71,76 +71,134 @@
|
||||
|
||||
<view class='goods-detail c-flex-column'>
|
||||
<text>商品详情</text>
|
||||
|
||||
<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' />
|
||||
</view>
|
||||
|
||||
<view class='goods-detail record-view c-flex-column'>
|
||||
<text class='record-view-title'>跟团记录</text>
|
||||
<scroll-view>
|
||||
<view class='c-flex-column' v-for='(item,index) in recordList' :key='index'>
|
||||
<view class='item-view c-flex-row'>
|
||||
<image :src='item.memberImage' />
|
||||
<view class='c-flex-column' style='flex: 1'>
|
||||
<text>{{ item.goodsCode }}</text>
|
||||
<text>{{ item.createTime }}</text>
|
||||
</view>
|
||||
<text>+{{ item.goodsNum }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class='bottom-view c-flex-row'>
|
||||
<view class='small-button-view' @click.stop='goBack'>
|
||||
<view class='small-button-item'>
|
||||
<image :src='assetsUrl("ic_goods_store.png")' />
|
||||
<text>商家</text>
|
||||
</view>
|
||||
|
||||
<view class='small-button-item' @click.stop='goPath("/pages/mine/subs/order/index")'>
|
||||
<image :src='assetsUrl("ic_goods_order.png")' />
|
||||
<text>订单</text>
|
||||
</view>
|
||||
|
||||
<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>
|
||||
<text>购物车</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<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>
|
||||
<sku-dialog ref='skuDialogRef' />
|
||||
<sku-dialog ref='skuDialogRef' :bean='detailBean?.goods' @confirm='confirmGoodsSku' />
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import { goPath } from '@/utils';
|
||||
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 detailBean = ref();
|
||||
const recommendList = ref<GoodsBean[]>();
|
||||
const skuBean = ref();
|
||||
|
||||
const bannerList = ref([]);
|
||||
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);
|
||||
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) => {
|
||||
swiperIndex.value = e.detail.current;
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
const getRemainingDays = computed(() => {
|
||||
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 = () => {
|
||||
skuDialogRef.value.show();
|
||||
};
|
||||
|
||||
const addShoppingCart = () => {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
icon: 'none'
|
||||
});
|
||||
const confirmGoodsSku = (e: any) => {
|
||||
skuBean.value = e;
|
||||
};
|
||||
|
||||
const placeOrder = () => {
|
||||
@@ -332,7 +390,7 @@ const placeOrder = () => {
|
||||
view:nth-of-type(n+1) {
|
||||
position: relative;
|
||||
align-items: center;
|
||||
height: 105rpx;
|
||||
height: 80rpx;
|
||||
|
||||
text:nth-of-type(1) {
|
||||
width: 100rpx;
|
||||
@@ -358,7 +416,7 @@ const placeOrder = () => {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
position: absolute;
|
||||
top: 80rpx;
|
||||
top: 40rpx;
|
||||
left: 100rpx;
|
||||
}
|
||||
}
|
||||
@@ -474,6 +532,7 @@ const placeOrder = () => {
|
||||
|
||||
.primary-button-view {
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
font-size: 30rpx;
|
||||
|
||||
.add-shoppingcart-button {
|
||||
@@ -489,13 +548,14 @@ const placeOrder = () => {
|
||||
|
||||
.place-order-button {
|
||||
display: flex;
|
||||
width: 198rpx;
|
||||
//width: 198rpx;
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F32B2B;
|
||||
color: #FFFFFF;
|
||||
border-radius: 0 40rpx 40rpx 0;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,4 +575,46 @@ const placeOrder = () => {
|
||||
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>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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='c-flex-row'>
|
||||
<text class='primary-text-color' style='flex: 1'>消费</text>
|
||||
@@ -16,8 +16,10 @@
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { PropType } from 'vue';
|
||||
|
||||
defineProps({
|
||||
item: Object
|
||||
item: Object as PropType<any>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@@ -59,7 +59,6 @@ const codeRefreshInterval = ref(30);
|
||||
|
||||
onLoad(() => {
|
||||
generateCode();
|
||||
console.log('------->>>',userInfo.value)
|
||||
|
||||
setInterval(() => {
|
||||
codeRefreshInterval.value -= 1;
|
||||
|
Reference in New Issue
Block a user