拼团修改

This commit is contained in:
2025-12-18 09:42:46 +08:00
parent 261c7af9f8
commit a4043cbfd0
3 changed files with 101 additions and 75 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="min-page bg-f7 color-333 u-font-28 relative"> <view class="min-page bg-f7 color-333 u-font-28 relative">
<view class="top" :style="topStyle"> <view class="top" :style="topStyle">
<up-navbar bg-color="transparent" :fixed="false" :placeholder="false" title="订单详情" left-icon-color="#fff" <up-navbar bg-color="transparent" :fixed="false" :placeholder="false" title="订单详情" left-icon-color="#fff" @leftClick="uni.navigateBack()"
title-color="#fff"></up-navbar> title-color="#fff"></up-navbar>
<view class="u-flex info u-col-center"> <view class="u-flex info u-col-center">
</view> </view>
@@ -184,8 +184,16 @@
}) })
function init(opt) { function init(opt) {
// 获取小程序进入场景和参数
const launchOptions = uni.getLaunchOptionsSync();
console.log(launchOptions);
// 获取链接上的参数
const launchOptionsQuery = launchOptions.query;
console.log('launchOptionsQuery', launchOptionsQuery);
Object.assign(query, launchOptionsQuery)
console.log(opt) console.log(opt)
Object.assign(query, opt) Object.assign(query, opt)
console.log(query)
getDetail() getDetail()
} }
const item = reactive({}) const item = reactive({})

View File

@@ -33,6 +33,7 @@
</view> </view>
</view> </view>
<template v-if="item.gbOrderList.length">
<view class="bg-f7" style="height: 32rpx"></view> <view class="bg-f7" style="height: 32rpx"></view>
<view class="groups"> <view class="groups">
<view class="color-000 u-m-b-28 u-font-32 font-700">立即拼团</view> <view class="color-000 u-m-b-28 u-font-32 font-700">立即拼团</view>
@@ -54,6 +55,8 @@
</view> </view>
</view> </view>
</template>
<view class="bg-f7" style="height: 32rpx"></view> <view class="bg-f7" style="height: 32rpx"></view>
@@ -196,7 +199,7 @@
const popupData = reactive({ const popupData = reactive({
show: false, show: false,
item:null item: null
}); });
function exchangeClick() { function exchangeClick() {
@@ -204,13 +207,13 @@
} }
function fastBuy(item){ function fastBuy(item) {
popupData.item=item; popupData.item = item;
popupData.show = true popupData.show = true
} }
watch(()=>popupData.show,(newval)=>{ watch(() => popupData.show, (newval) => {
if(!newval){ if (!newval) {
popupData.item=null popupData.item = null
} }
}) })
@@ -230,7 +233,7 @@
shopId: item.shopId, shopId: item.shopId,
number: 1, number: 1,
price: item.extraPrice, price: item.extraPrice,
groupOrderNo:popupData.item?popupData.item.groupOrderNo:'', groupOrderNo: popupData.item ? popupData.item.groupOrderNo : '',
openId openId
}).then(orderRes => { }).then(orderRes => {
popupData.show = false; popupData.show = false;
@@ -238,7 +241,8 @@
console.log(res) console.log(res)
if (res) { if (res) {
uni.redirectTo({ uni.redirectTo({
url: '/groupBuying/success/index?detailId='+orderRes.goodsRecord.id url: '/groupBuying/success/index?detailId=' + orderRes.goodsRecord
.id
}) })
} else { } else {
uni.showToast({ uni.showToast({
@@ -327,20 +331,29 @@
const query = reactive({ const query = reactive({
shopId: '', shopId: '',
wareId: '', wareId: '',
groupOrderNo:''
}) })
const coverImgs = ref([]) const coverImgs = ref([])
function init(opt) { function init(opt) {
// 获取小程序进入场景和参数
const launchOptions = uni.getLaunchOptionsSync();
console.log(launchOptions);
// 获取链接上的参数
const launchOptionsQuery = launchOptions.query;
console.log('launchOptionsQuery', launchOptionsQuery);
Object.assign(query, launchOptionsQuery)
console.log(opt) console.log(opt)
Object.assign(query, opt) Object.assign(query, opt)
console.log(query)
getDetail() getDetail()
} }
function getDetail() { function getDetail() {
Api.wareDetail(query).then(res => { Api.wareDetail(query).then(res => {
res.wareCommentImgs = res.wareCommentImgs.split(',').filter(v=>v) res.wareCommentImgs = res.wareCommentImgs.split(',').filter(v => v)
Object.assign(item, res) Object.assign(item, res)
console.log(item) console.log(item)
coverImgs.value = res.wareImgs.split(',') coverImgs.value = res.wareImgs.split(',')
@@ -386,11 +399,11 @@
} }
let timer=null let timer = null
let nowTime=ref(Date.now()) let nowTime = ref(Date.now())
timer=setInterval(()=>{ timer = setInterval(() => {
nowTime.value=Date.now() nowTime.value = Date.now()
},1000) }, 1000)
// 组合使用:获取格式化后的剩余时间 // 组合使用:获取格式化后的剩余时间
function getRemainingHMS(item) { function getRemainingHMS(item) {
@@ -400,8 +413,8 @@
} }
function returnNeedPerpole(data){ function returnNeedPerpole(data) {
return data.groupPeopleNum-data.currentPeopleNum return data.groupPeopleNum - data.currentPeopleNum
} }
@@ -622,19 +635,23 @@
width: 100%; width: 100%;
} }
.groups{ .groups {
padding: 28rpx 22rpx; padding: 28rpx 22rpx;
background-color: #fff; background-color: #fff;
.item{
.item {
padding: 28rpx 0; padding: 28rpx 0;
border-bottom: 2rpx solid #EDEDED; border-bottom: 2rpx solid #EDEDED;
&:last-child{
&:last-child {
border-bottom: none; border-bottom: none;
} }
.main-color{
.main-color {
color: #ed5a2e; color: #ed5a2e;
} }
.btn{
.btn {
padding: 8rpx 26rpx; padding: 8rpx 26rpx;
border-radius: 36rpx; border-radius: 36rpx;
background: #E8AD7B; background: #E8AD7B;

View File

@@ -352,12 +352,13 @@
onShareAppMessage(() => { onShareAppMessage(() => {
console.log('onShareAppMessage') console.log('onShareAppMessage')
console.log(shareItem)
const query=`groupOrderNo=${shareItem.groupOrderNo}&shopId=${shareItem.shopId}`
return wxShare({ return wxShare({
title: shareItem.wareJson.wareName, title: shareItem.wareJson.wareName,
imageUrl: shareItem.goodsImg, imageUrl: shareItem.goodsImg,
path:'/groupBuying/goodsDetail/goodsDetail', path:'/groupBuying/detail/index' +'?'+query,
query: `wareId=${shareItem.wareId}&shopId=${shareItem.shopId}`, query,
}) })
}) })
onLoad(getData) onLoad(getData)