拼团问题修复,增加套餐功能
This commit is contained in:
@@ -35,6 +35,9 @@ import { computed } from 'vue'
|
||||
},
|
||||
])
|
||||
const returnClass=computed(()=>{
|
||||
if(props.status=='已退款'){
|
||||
return 'gray';
|
||||
}
|
||||
const item=list.value.find(v=>props.status.includes(v.name))
|
||||
return item?item.class:''
|
||||
})
|
||||
@@ -62,5 +65,10 @@ import { computed } from 'vue'
|
||||
color: #FF1C1C;
|
||||
background: rgba(255, 28, 28, 0.18);
|
||||
}
|
||||
&.gray{
|
||||
color: #bbb;
|
||||
background-color: #f7f7f7;
|
||||
border-color: #bbb;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -12,8 +12,7 @@
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-col-center u-row-between">
|
||||
<view style="max-width: 326rpx;">
|
||||
<view class="font-bold" v-if="item.wareJson">{{item.wareJson
|
||||
.wareName}}</view>
|
||||
<view class="font-bold u-line-1" v-if="item">{{item.wareName}}</view>
|
||||
<view class="u-flex u-m-t-10 u-col-center ">
|
||||
<view class="price">
|
||||
<text class="u-font-30">¥</text>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="min-page bg-f7 color-333 u-font-28 relative">
|
||||
<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="title" left-icon-color="#fff"
|
||||
@leftClick="back('/groupBuying/index/index')" title-color="#fff"></up-navbar>
|
||||
<view class="u-flex info u-col-center">
|
||||
</view>
|
||||
@@ -26,7 +26,7 @@
|
||||
<text class="">{{item.groupPeopleNum}}人团</text>
|
||||
</view>
|
||||
<template v-if="item.id">
|
||||
<statusVue :status="item.wareGroupStatus=='ing'?'待成团': item.status"></statusVue>
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
</template>
|
||||
<template v-else>
|
||||
<statusVue v-if="item.wareGroupStatus=='ing'" status="待成团"></statusVue>
|
||||
@@ -36,7 +36,7 @@
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-col-center">
|
||||
<view style="width: 356rpx;">
|
||||
<view class="font-bold" v-if="item&&item.wareJson">{{item.wareJson
|
||||
<view class="font-bold u-line-1" v-if="item&&item.wareJson">{{item.wareJson
|
||||
.wareName}}</view>
|
||||
<view class="u-flex u-m-t-10 u-col-center ">
|
||||
<view class="price">
|
||||
@@ -57,7 +57,7 @@
|
||||
</view>
|
||||
|
||||
<view class="refund" v-if="item.status=='退款中'">已申请退款,需等待商家审核</view>
|
||||
<view class="shop-box" >
|
||||
<view class="shop-box">
|
||||
<view class="u-flex u-row-center u-flex-col u-col-center" v-if="item.status=='待核销'||item.status=='退款中'">
|
||||
<up-qrcode :val="item.verifyCode" :size="104"></up-qrcode>
|
||||
<view class="u-flex u-m-t-22 u-m-b-18 u-col-center">
|
||||
@@ -79,8 +79,8 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="members">
|
||||
<view class="list" v-if="item.users&&item.users.length">
|
||||
<view class="members" v-if="item.status!='已退款'">
|
||||
<view class="list" v-if="item.users&&item.users.length">
|
||||
<view class="item" v-for="(user,index) in item.users" :key="index">
|
||||
<view class="box">
|
||||
<view class="u-flex relative">
|
||||
@@ -140,7 +140,8 @@
|
||||
<view class="color-666">支付时间</view>
|
||||
<view class="">{{item.payTime}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between item" v-if="item.groupEndTime&&item.status=='待核销'">
|
||||
<view class="u-flex u-row-between item"
|
||||
v-if="item.groupEndTime&&item.wareGroupStatus=='success'">
|
||||
<view class="color-666">成团时间</view>
|
||||
<view class="">{{item.groupEndTime}}</view>
|
||||
</view>
|
||||
@@ -182,7 +183,8 @@
|
||||
<image class="cover" :src="item.goodsImg"></image>
|
||||
<view class="u-flex u-flex-1 u-row-between u-p-l-16 u-col-center">
|
||||
<view style="max-width: 340rpx;">
|
||||
<view class="u-font-32 font-bold" v-if="item && item.wareJson">{{item.wareJson.wareName}}</view>
|
||||
<view class="u-font-32 font-bold u-line-1" v-if="item && item.wareJson">
|
||||
{{item.wareJson.wareName}}</view>
|
||||
|
||||
<view class="u-m-t-12 color-666 u-line-2">{{item.wareJson.wareDetail}}</view>
|
||||
</view>
|
||||
@@ -221,6 +223,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
Storelogin
|
||||
} from '@/stores/user.js';
|
||||
const storelogin = Storelogin();
|
||||
import {
|
||||
back
|
||||
} from '@/utils/uniapp.js'
|
||||
@@ -291,11 +297,11 @@
|
||||
...item,
|
||||
...item.wareJson,
|
||||
number: number.value,
|
||||
id:item.wareId||'',
|
||||
originalPrice:item.wareOriginalPrice,
|
||||
groupPrice:item.wareGroupPrice,
|
||||
wareImgs:item.wareJson.wareImgs.join(','),
|
||||
groupOrderNo: item.groupOrderNo||'',
|
||||
id: item.wareId || '',
|
||||
originalPrice: item.wareOriginalPrice,
|
||||
groupPrice: item.wareGroupPrice,
|
||||
wareImgs: item.wareJson.wareImgs.join(','),
|
||||
groupOrderNo: item.groupOrderNo || '',
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/groupBuying/confirm-order/confirm-order'
|
||||
@@ -330,7 +336,7 @@
|
||||
detailId: '',
|
||||
})
|
||||
|
||||
function init(opt) {
|
||||
async function init(opt) {
|
||||
// 获取小程序进入场景和参数
|
||||
const launchOptions = uni.getLaunchOptionsSync();
|
||||
console.log(launchOptions);
|
||||
@@ -341,6 +347,7 @@
|
||||
console.log(opt)
|
||||
Object.assign(query, opt)
|
||||
console.log(query)
|
||||
await storelogin.actionslogin()
|
||||
getDetail()
|
||||
}
|
||||
const item = reactive({})
|
||||
@@ -353,19 +360,19 @@
|
||||
res.goodsImg = wareJson.wareImgs[0];
|
||||
Object.assign(item, res)
|
||||
console.log('item', item)
|
||||
uni.cache.set('shopId',item.shopId)
|
||||
if(!item.id&& item.wareGroupStatus!='ing'){
|
||||
uni.cache.set('shopId', item.shopId)
|
||||
if (!item.id && item.wareGroupStatus != 'ing') {
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'拼团已结束',
|
||||
showCancel:false,
|
||||
title: '提示',
|
||||
content: '拼团已结束',
|
||||
showCancel: false,
|
||||
success() {
|
||||
uni.redirectTo({
|
||||
url:'/groupBuying/index/index',
|
||||
url: '/groupBuying/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -453,6 +460,13 @@
|
||||
query,
|
||||
})
|
||||
})
|
||||
|
||||
const title=computed(()=>{
|
||||
if(!item.id&&item.wareGroupStatus=='ing'){
|
||||
return '拼团特惠'
|
||||
}
|
||||
return '订单详情'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -559,11 +573,13 @@
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.item {
|
||||
width: calc(100% / 3);
|
||||
display: flex;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.add-box {
|
||||
width: 140rpx;
|
||||
@@ -583,7 +599,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
&:nth-of-type(3n-1) {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -682,63 +698,63 @@
|
||||
font-weight: 700;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
|
||||
.popup-content {
|
||||
font-size: 28rpx;
|
||||
min-height: 300px;
|
||||
|
||||
|
||||
.popup-content-top {
|
||||
padding: 32rpx 28rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
|
||||
|
||||
.goods-info {
|
||||
padding: 32rpx 28rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
|
||||
|
||||
.cover {
|
||||
width: 184rpx;
|
||||
height: 184rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #d9d9d9;
|
||||
|
||||
|
||||
&.bg-fff {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.price {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #ed5a2e;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
|
||||
|
||||
.old-price {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
text-decoration-line: line-through;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
|
||||
.limitBuyNum {
|
||||
color: #666;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.popup-content-bottom {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
|
||||
|
||||
.price {
|
||||
color: #ed5a2e;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
padding: 22rpx 214rpx;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<view class="color-333 u-font-28" v-if="item.id">
|
||||
<view>
|
||||
<view class="relative">
|
||||
<up-swiper height="428rpx" :list="coverImgs" @click="prveImg"></up-swiper>
|
||||
<view class="share-box">
|
||||
分享
|
||||
<button class="share" open-type="share">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sku">
|
||||
@@ -40,7 +44,7 @@
|
||||
<view class="item u-flex" v-for="(item,index) in item.gbOrderList" :key="index">
|
||||
<up-avatar size="76rpx" :src="item.avatar"></up-avatar>
|
||||
<view class="u-flex u-flex-1 u-p-l-22 u-col-center u-row-between">
|
||||
<view>
|
||||
<view>立即购买购
|
||||
<view class="color-000 u-line-1" style="max-width: 180rpx;">{{item.nickName}}</view>
|
||||
<view class="main-color u-m-t-2">差{{returnNeedPerpole(item)}}人拼成</view>
|
||||
</view>
|
||||
@@ -104,7 +108,7 @@
|
||||
<view>
|
||||
<view class="price">¥{{item.groupPrice}}</view>
|
||||
<view class="old-price">¥{{item.originalPrice}}</view>
|
||||
<view class="limitBuyNum" v-if="item.limitBuyNum"> 限购{{item.limitBuyNum}} </view>
|
||||
<view class="limitBuyNum" v-if="item.limitBuyNum&&item.limitBuyNum!=-10086"> 限购{{item.limitBuyNum}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -139,6 +143,7 @@
|
||||
watch
|
||||
} from "vue";
|
||||
import dayjs from "dayjs";
|
||||
import {wxShare} from '@/utils/share.js'
|
||||
import {
|
||||
getOpenId
|
||||
} from '@/utils/uniapp.js'
|
||||
@@ -147,6 +152,11 @@
|
||||
import {
|
||||
pay
|
||||
} from '@/utils/pay.js'
|
||||
import {
|
||||
Storelogin
|
||||
} from '@/stores/user.js';
|
||||
const storelogin = Storelogin();
|
||||
|
||||
const imgs = {
|
||||
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/9fd6a3ad2b384f6cb4e88ed6b77bd334.png",
|
||||
};
|
||||
@@ -326,7 +336,7 @@
|
||||
|
||||
const coverImgs = ref([])
|
||||
|
||||
function init(opt) {
|
||||
async function init(opt) {
|
||||
// 获取小程序进入场景和参数
|
||||
const launchOptions = uni.getLaunchOptionsSync();
|
||||
console.log(launchOptions);
|
||||
@@ -337,6 +347,7 @@
|
||||
console.log(opt)
|
||||
Object.assign(query, opt)
|
||||
console.log(query)
|
||||
await storelogin.actionslogin()
|
||||
getDetail()
|
||||
}
|
||||
|
||||
@@ -346,6 +357,7 @@
|
||||
Object.assign(item, res)
|
||||
console.log(item)
|
||||
coverImgs.value = res.wareImgs.split(',')
|
||||
uni.cache.set('shopId',item.shopId)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -413,11 +425,11 @@
|
||||
// #endif
|
||||
onShareAppMessage(() => {
|
||||
|
||||
const query = `wareId=${item.wareId}&shopId=${item.shopId}`
|
||||
const query = `wareId=${item.id}&shopId=${item.shopId}`
|
||||
return wxShare({
|
||||
title: item.wareJson.wareName,
|
||||
imageUrl: item.goodsImg,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
title: item.wareName,
|
||||
imageUrl: coverImgs.value[0],
|
||||
path: '/groupBuying/goodsDetail/goodsDetail' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
@@ -663,4 +675,22 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.share-box{
|
||||
top: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
padding: 4rpx 30rpx;
|
||||
border-radius: 0 0 0 24rpx;
|
||||
color: #ed5a2e; font-weight: 700;
|
||||
background: #FFF;
|
||||
overflow: hidden;
|
||||
.share{
|
||||
position: absolute;
|
||||
left:0;
|
||||
right: 0;
|
||||
top:0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,8 +2,8 @@
|
||||
<view class="min-page bg-f7 u-font-28">
|
||||
<up-sticky :offsetTop="0" :customNavHeight="0">
|
||||
<view class="top" :style="topStyle">
|
||||
<up-navbar bg-color="transparent" :fixed="false" :placeholder="false" title="拼团特惠"
|
||||
@leftClick="back()" left-icon-color="#fff" title-color="#fff"></up-navbar>
|
||||
<up-navbar bg-color="transparent" :fixed="false" :placeholder="false" title="拼团特惠" @leftClick="back()"
|
||||
left-icon-color="#fff" title-color="#fff"></up-navbar>
|
||||
<view class="u-flex info u-col-center">
|
||||
<image :src="imgs.map" class="map"></image>
|
||||
<view class="u-line-1 u-m-l-20">{{shopInfo.shopName||''}}</view>
|
||||
@@ -104,6 +104,10 @@
|
||||
<text class="title ">门店地址:</text>
|
||||
<text class="stitle">{{item.shopAddress}}</text>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-32 u-col-center" v-if="item.groupEndTime&&item.wareGroupStatus=='success'">
|
||||
<text class="title">成团时间:</text>
|
||||
<text class="stitle price">{{item.groupEndTime}}</text>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-32 u-col-center" v-if="showTime(item)">
|
||||
<text class="title">剩余成团时间:</text>
|
||||
<text class="stitle price">{{returnTime(item)}}</text>
|
||||
@@ -136,7 +140,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {back} from '@/utils/uniapp.js'
|
||||
import {
|
||||
APIusershopInfodetail
|
||||
} from '@/common/api/member.js'
|
||||
import {
|
||||
back
|
||||
} from '@/utils/uniapp.js'
|
||||
import LookQrcode from "@/components/look-qrcode/look-qrcode.vue";
|
||||
import {
|
||||
wxShare
|
||||
@@ -181,7 +190,7 @@
|
||||
pin: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/3/4bcce5bdfa074f2a838a0209fac24241.png'
|
||||
}
|
||||
|
||||
const shopInfo = ref(uni.cache.get('shopInfo'))
|
||||
const shopInfo = ref({})
|
||||
|
||||
const steps = ['发起拼团', '邀请好友', '成团优惠']
|
||||
|
||||
@@ -404,7 +413,15 @@
|
||||
})
|
||||
})
|
||||
onShow(getData)
|
||||
|
||||
onLoad(() => {
|
||||
APIusershopInfodetail({
|
||||
shopId: uni.cache.get('shopId')
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
shopInfo.value = res.shopInfo
|
||||
uni.cache.set('shopInfo', res.shopInfo)
|
||||
})
|
||||
})
|
||||
|
||||
let timer = null
|
||||
let nowTime = ref(Date.now())
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<view style="height: 100px;"></view>
|
||||
<view class="btns">
|
||||
<view class="btn" @click="toPinIndex">继续拼团</view>
|
||||
<button class="btn main" @click="toOrderDetail(item)">查看订单</button>
|
||||
<button class="btn main" @click="toOrderDetail(item)">查看订单</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -165,7 +165,7 @@
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-col-center u-row-between">
|
||||
<view style="max-width: 356rpx;">
|
||||
<view class="font-bold" v-if="item.wareJson">{{item.wareJson
|
||||
<view class="font-bold u-line-1" v-if="item.wareJson">{{item.wareJson
|
||||
.wareName}}</view>
|
||||
<view class="u-flex u-m-t-10 u-col-center ">
|
||||
<view class="price">
|
||||
@@ -227,7 +227,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center" v-if="item.status=='待成团'">
|
||||
<view class="pin-btn" >邀请好友参团
|
||||
<view class="pin-btn">邀请好友参团
|
||||
<button open-type="share" class="share">邀请好友参团</button>
|
||||
|
||||
</view>
|
||||
@@ -325,14 +325,36 @@
|
||||
const item = reactive({})
|
||||
|
||||
function getDetail() {
|
||||
Api.recordDetail(query).then(res => {
|
||||
const wareJson = JSON.parse(res.wareJson)
|
||||
wareJson.wareImgs = wareJson.wareImgs.split(',').filter(v => v)
|
||||
res.wareJson = wareJson;
|
||||
res.goodsImg = wareJson.wareImgs[0];
|
||||
Object.assign(item, res)
|
||||
console.log('item', item)
|
||||
})
|
||||
try {
|
||||
Api.recordDetail(query).then(res => {
|
||||
if (!res) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content :'当前商品已下架或者不存在',
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
uni.redirectTo({
|
||||
url: '/groupBuying/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log(res, 'res')
|
||||
const wareJson = JSON.parse(res.wareJson)
|
||||
wareJson.wareImgs = wareJson.wareImgs.split(',').filter(v => v)
|
||||
res.wareJson = wareJson;
|
||||
res.goodsImg = wareJson.wareImgs[0];
|
||||
Object.assign(item, res)
|
||||
console.log('item', item)
|
||||
})
|
||||
} catch (err) {
|
||||
console.log('err', err)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
onLoad(init)
|
||||
|
||||
@@ -506,6 +528,7 @@
|
||||
.item {
|
||||
width: calc(100% / 3);
|
||||
display: flex;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.add-box {
|
||||
width: 140rpx;
|
||||
@@ -525,9 +548,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
justify-content: center;
|
||||
}
|
||||
// &:nth-of-type(2n) {
|
||||
// justify-content: center;
|
||||
// }
|
||||
|
||||
&:nth-of-type(3n) {
|
||||
justify-content: flex-end;
|
||||
@@ -601,7 +624,6 @@
|
||||
border: 2rpx solid #E8AD7B;
|
||||
background: #E8AD7B;
|
||||
color: #fff;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.share {
|
||||
@@ -736,12 +758,14 @@
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.item {
|
||||
width: calc(100% / 3);
|
||||
display: flex;
|
||||
|
||||
|
||||
.add-box {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
@@ -760,7 +784,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
&:nth-of-type(3n-1) {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user