拼团修复
This commit is contained in:
41
components/look-qrcode/look-qrcode.vue
Normal file
41
components/look-qrcode/look-qrcode.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<modal v-model="show" title="查看券码" :showBottom="false">
|
||||
<view class="u-p-28">
|
||||
<view class="u-flex u-row-center">
|
||||
<up-qrcode cid="ex1" :size="104" :val="qrcode"></up-qrcode>
|
||||
</view>
|
||||
<view class="u-m-t-22 u-flex u-row-center">
|
||||
<text>{{ qrcode }}</text>
|
||||
<view @click="copyCode">
|
||||
<image src="/scoreShop/static/image/copy.png" class="u-m-l-24 copy"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import modal from '@/components/modal.vue'
|
||||
const props = defineProps({
|
||||
qrcode: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const show = defineModel({
|
||||
default: false
|
||||
})
|
||||
|
||||
function copyCode() {
|
||||
uni.setClipboardData({
|
||||
data: props.qrcode
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.copy {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
</style>
|
||||
97
components/modal.vue
Normal file
97
components/modal.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-popup
|
||||
:show="show"
|
||||
mode="center"
|
||||
:safeAreaInsetBottom="mode === 'bottom' ? true : false"
|
||||
>
|
||||
<view class="popup-content">
|
||||
<view class="top u-flex u-row-between">
|
||||
<text class="font-bold u-font-32 color-333">{{ title }}</text>
|
||||
<up-icon size="18" name="close" @click="show = false"></up-icon>
|
||||
</view>
|
||||
<up-line></up-line>
|
||||
<scroll-view style="max-height: 50vh" :scroll-y="true">
|
||||
<slot></slot>
|
||||
</scroll-view>
|
||||
<template v-if="showBottom">
|
||||
<up-line></up-line>
|
||||
|
||||
<view class="bottom">
|
||||
<view class="btn cancel" @click="close">{{ cancelText }}</view>
|
||||
<view class="btn success" @click="confirm">{{ confirmText }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
mode: {
|
||||
type: String,
|
||||
default: "center",
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "标题",
|
||||
},
|
||||
confirmText: {
|
||||
type: String,
|
||||
default: "确认",
|
||||
},
|
||||
cancelText: {
|
||||
type: String,
|
||||
default: "取消",
|
||||
},
|
||||
showBottom: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
const show = defineModel({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
});
|
||||
const emits = defineEmits(["close", "confirm"]);
|
||||
function close() {
|
||||
show.value = false;
|
||||
emits("close");
|
||||
}
|
||||
function confirm() {
|
||||
emits("confirm");
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.popup-content {
|
||||
background: #fff;
|
||||
width: 640rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.top {
|
||||
padding: 40rpx 48rpx;
|
||||
}
|
||||
.bottom {
|
||||
padding: 48rpx 52rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 50rpx;
|
||||
.btn {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 18rpx 60rpx;
|
||||
border-radius: 100rpx;
|
||||
font-size: 32rpx;
|
||||
border: 2rpx solid transparent;
|
||||
&.success {
|
||||
background-color: $my-main-color;
|
||||
color: #fff;
|
||||
}
|
||||
&.cancel {
|
||||
border-color: $my-main-color;
|
||||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -21,7 +21,8 @@ import { computed } from 'vue'
|
||||
},
|
||||
{
|
||||
name: '待核销',
|
||||
value: ''
|
||||
value: '',
|
||||
class:'warning'
|
||||
},
|
||||
{
|
||||
name: '已核销',
|
||||
@@ -44,14 +45,18 @@ import { computed } from 'vue'
|
||||
.status {
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid transparent;
|
||||
border: 2rpx solid #333;
|
||||
|
||||
&.success {
|
||||
border-color: rgba(123, 209, 54, 1);
|
||||
color: rgba(123, 209, 54, 1);
|
||||
background: rgba(123, 209, 54, 0.12);
|
||||
}
|
||||
|
||||
&.warning{
|
||||
border-color: rgba(255, 141, 40, 1);
|
||||
color: rgba(255, 141, 40, 1);
|
||||
background: rgba(255, 141, 40, 0.12);
|
||||
}
|
||||
&.error {
|
||||
border-color: #FF1C1C;
|
||||
color: #FF1C1C;
|
||||
|
||||
251
groupBuying/confirm-order/confirm-order.vue
Normal file
251
groupBuying/confirm-order/confirm-order.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<view class="min-page bg-f7 u-font-28 color-333 u-p-30">
|
||||
<view class="info">
|
||||
<view class="goods u-flex u-col-center u-p-t-22 u-p-b-22 u-border-bottom">
|
||||
<up-image width="158rpx" height="158rpx" radius="14rpx" :src="item.goodsImg"></up-image>
|
||||
<view class=" u-flex-1 u-p-l-16">
|
||||
<view class="u-flex u-col-center u-row-between">
|
||||
<view class="u-flex tuan-members">
|
||||
<image :src="imgs.pin" class="pin" mode=""></image>
|
||||
<text class="">{{item.groupPeopleNum}}人团</text>
|
||||
</view>
|
||||
</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="u-flex u-m-t-10 u-col-center ">
|
||||
<view class="price">
|
||||
<text class="u-font-30">¥</text>
|
||||
<text class="u-font-48 font-bold">{{item.groupPrice}} </text>
|
||||
</view>
|
||||
<view class="old-price u-m-l-32">
|
||||
<text>¥</text>
|
||||
<text>{{item.originalPrice}} </text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-l-10 color-333 no-wrap">
|
||||
数量:{{item.number}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="shop ">
|
||||
<view class="u-flex">
|
||||
<text style="min-width: 180rpx;" class="color-666">可核销门店:</text>
|
||||
<text>{{item.shopName}}</text>
|
||||
</view>
|
||||
<view class="u-m-t-32 u-flex">
|
||||
<text style="min-width: 180rpx;" class="color-666">门店地址:</text>
|
||||
<text>{{item.shopAddress}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-20 u-p-t-28 u-p-b-28">
|
||||
<view class="u-flex u-row-between u-p-t-20 u-p-b-20">
|
||||
<text>商品总额</text>
|
||||
<text class="u-font-32">¥{{totalPayPrice}}</text>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-p-t-20 u-p-b-20">
|
||||
<text>支付方式</text>
|
||||
<text class="u-font-32">微信支付</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view style="height: 100px;"></view>
|
||||
<view class="u-flex bottom">
|
||||
<view>
|
||||
<text class="color-666">合计:</text>
|
||||
<text class="price">¥{{totalPayPrice}}</text>
|
||||
</view>
|
||||
<view class="btn" @click="payExchange">去支付</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as Api from '@/common/api/order/gbOrder.js'
|
||||
import {
|
||||
pay
|
||||
} from '@/utils/pay.js'
|
||||
import {
|
||||
getOpenId
|
||||
} from '@/utils/uniapp.js'
|
||||
|
||||
const imgs = {
|
||||
bg: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/1/d21f2dfd7bec44618f2d5e4b88372b08.png',
|
||||
pin: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3947892924dd481782331513aff00eb3.png'
|
||||
}
|
||||
|
||||
const item = reactive({})
|
||||
onShow(() => {
|
||||
const data = uni.getStorageSync('group_buying_order')
|
||||
const wareImgs = data.wareImgs.split(',').filter(v => v)
|
||||
data.goodsImg = wareImgs[0]
|
||||
Object.assign(item, data)
|
||||
console.log(item)
|
||||
})
|
||||
|
||||
function dingyue() {
|
||||
return new Promise((revlove, reject) => {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['JGPAGmqcPEgWB6mvAl0SC5cMqr5H5Qjcim8JCpHAZd0',
|
||||
'F4OyUhe_ZQ9BR731jlkaN2QXAUaA3HBZuUeVPfraSz0'
|
||||
],
|
||||
success(res) {},
|
||||
complete() {
|
||||
revlove()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
async function payExchange() {
|
||||
await dingyue();
|
||||
uni.showLoading({
|
||||
title: '支付中……'
|
||||
})
|
||||
const openId = await getOpenId()
|
||||
uni.hideLoading()
|
||||
if (openId) {
|
||||
Api.exchange({
|
||||
paramId: item.id,
|
||||
shopId: item.shopId,
|
||||
number: item.number,
|
||||
groupOrderNo: item.groupOrderNo || '',
|
||||
openId
|
||||
}).then(orderRes => {
|
||||
pay(orderRes.payInfo).then(res => {
|
||||
console.log(res)
|
||||
|
||||
if (res) {
|
||||
uni.redirectTo({
|
||||
url: '/groupBuying/success/index?detailId=' + orderRes.record
|
||||
.id + '&shopId=' + orderRes.record.shopId
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '开团失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '鉴权失败,开团失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
import {
|
||||
BigNumber
|
||||
} from "bignumber.js";
|
||||
const totalPrice = computed(() => {
|
||||
if (!item.groupPrice) {
|
||||
return 0;
|
||||
}
|
||||
return BigNumber(item.number).times(item.originalPrice).toNumber()
|
||||
})
|
||||
|
||||
const totalPayPrice = computed(() => {
|
||||
if (!item.groupPrice) {
|
||||
return 0;
|
||||
}
|
||||
return BigNumber(item.number).times(item.groupPrice).toNumber()
|
||||
})
|
||||
|
||||
|
||||
let shareItem = null
|
||||
|
||||
function share(item) {
|
||||
shareItem = item
|
||||
}
|
||||
onShareAppMessage(() => {
|
||||
console.log('onShareAppMessage')
|
||||
console.log(shareItem)
|
||||
const query = `groupOrderNo=${shareItem.groupOrderNo}&shopId=${shareItem.shopId}`
|
||||
return wxShare({
|
||||
title: shareItem.wareJson.wareName,
|
||||
imageUrl: shareItem.goodsImg,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info {
|
||||
border-radius: 16rpx;
|
||||
background-color: #fff;
|
||||
padding: 0 24rpx;
|
||||
|
||||
.goods {
|
||||
background-color: #fff;
|
||||
padding: 22rpx 0;
|
||||
|
||||
.pin {
|
||||
width: 60rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
|
||||
.tuan-members {
|
||||
padding: 0 16rpx 0 0;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
background: #4C2828;
|
||||
color: #f5d9ad;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #ed5a2e;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
color: #666666;
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.u-font-48 {
|
||||
font-size: 48rpx;
|
||||
}
|
||||
|
||||
.shop {
|
||||
padding: 22rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
padding: 42rpx 28rpx 60rpx 28rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
|
||||
.price {
|
||||
color: #ed5a2e;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 14rpx 70rpx;
|
||||
border-radius: 200rpx;
|
||||
background: #E8AD7B;
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +1,13 @@
|
||||
<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" @leftClick="uni.navigateBack()"
|
||||
title-color="#fff"></up-navbar>
|
||||
<up-navbar bg-color="transparent" :fixed="false" :placeholder="false" title="订单详情" left-icon-color="#fff"
|
||||
@leftClick="uni.navigateBack()" title-color="#fff"></up-navbar>
|
||||
<view class="u-flex info u-col-center">
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="time">
|
||||
<view class="time" v-if="item.status=='待成团'">
|
||||
<text class="color-666">剩余成团时间:</text>
|
||||
<view class="u-font-32">
|
||||
<text class="number">{{returnNum(0)}}</text>
|
||||
@@ -25,7 +25,7 @@
|
||||
<image :src="imgs.pin" class="pin" mode=""></image>
|
||||
<text class="">{{item.groupPeopleNum}}人团</text>
|
||||
</view>
|
||||
<statusVue></statusVue>
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-col-center">
|
||||
@@ -51,7 +51,7 @@
|
||||
</view>
|
||||
|
||||
<view class="refund" v-if="item.status=='待退款'">已申请退款,需等待商家审核</view>
|
||||
<view class="shop-box">
|
||||
<view class="shop-box" v-if="item.status=='待核销'">
|
||||
<view class="u-flex u-row-center u-flex-col u-col-center">
|
||||
<up-qrcode :val="item.verifyCode" :size="104"></up-qrcode>
|
||||
<view class="u-flex u-m-t-22 u-m-b-18 u-col-center">
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<view class="item" v-if="item.status=='待成团'">
|
||||
<view class="box">
|
||||
<view class="u-flex relative">
|
||||
<view class="add-box u-flex u-row-center">
|
||||
@@ -101,7 +101,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<view class="u-flex u-row-center" v-if="item.status=='待成团'&&!item.id">
|
||||
<view class="pin-btn">立即参与拼团</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -140,9 +140,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 100px;"></view>
|
||||
<view class="btns">
|
||||
<view class="btn" @click="refund(item)">申请退款</view>
|
||||
<view class="btns" v-if="item.id">
|
||||
<template v-if="item.status=='待成团'">
|
||||
<view class="btn" @click="refund(item)" v-if="canRefund(item)">申请退款</view>
|
||||
<button open-type="share" class="btn main" @click="share(item)">邀请好友</button>
|
||||
</template>
|
||||
<template v-if="item.status=='待核销'">
|
||||
<view class="btn" @click="refund(item)" v-if="canRefund(item)">申请退款</view>
|
||||
</template>
|
||||
<template v-if="item.status=='待退款'">
|
||||
<view class="btn" @click="cancelRefund(item)">取消退款</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -167,6 +175,15 @@
|
||||
}
|
||||
|
||||
|
||||
const canRefundStatus = ['待成团', '待核销']
|
||||
|
||||
function canRefund(item) {
|
||||
if (canRefundStatus.includes(item.status)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const topStyle = {
|
||||
backgroundImage: 'url(' + imgs.bg + ')'
|
||||
}
|
||||
@@ -251,6 +268,31 @@
|
||||
})
|
||||
}
|
||||
|
||||
function cancelRefund(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否取消退款?',
|
||||
showCancel: true,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
Api.cancelRefund({
|
||||
recordId: item.id,
|
||||
orderNo: item.orderNo,
|
||||
}).then(res => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '取消成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
getDetail()
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let shareItem = null
|
||||
|
||||
function share(item) {
|
||||
@@ -258,11 +300,13 @@
|
||||
}
|
||||
onShareAppMessage(() => {
|
||||
console.log('onShareAppMessage')
|
||||
console.log(shareItem)
|
||||
const query = `groupOrderNo=${shareItem.groupOrderNo}&shopId=${shareItem.shopId}`
|
||||
return wxShare({
|
||||
title: shareItem.wareJson.wareName,
|
||||
imageUrl: shareItem.goodsImg,
|
||||
query: `detailId=${shareItem.id}&shopId=${shareItem.shopId}`,
|
||||
type: 2,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -285,7 +329,8 @@
|
||||
.bottom {
|
||||
margin: 0 28rpx;
|
||||
transform: translateY(-160rpx);
|
||||
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
.time {
|
||||
padding: 18rpx 24rpx;
|
||||
background: #FFF4E2;
|
||||
@@ -310,8 +355,7 @@
|
||||
|
||||
.goods {
|
||||
background-color: #fff;
|
||||
padding: 22rpx 24rpx 0;
|
||||
border-radius: 0 0 16rpx 16rpx;
|
||||
padding: 22rpx 24rpx ;
|
||||
|
||||
.pin {
|
||||
width: 60rpx;
|
||||
|
||||
@@ -182,6 +182,16 @@
|
||||
return
|
||||
}
|
||||
if (step === '+') {
|
||||
if(item.limitBuyNum==-10086){
|
||||
number.value++
|
||||
return
|
||||
}
|
||||
if(number.value>=item.limitBuyNum){
|
||||
return uni.showToast({
|
||||
title:'最多可购买'+item.limitBuyNum+'份',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
number.value++
|
||||
return
|
||||
}
|
||||
@@ -234,6 +244,15 @@
|
||||
}
|
||||
|
||||
async function payExchange() {
|
||||
uni.setStorageSync('group_buying_order', {
|
||||
...item,
|
||||
number: number.value,
|
||||
groupOrderNo: popupData.item ? popupData.item.groupOrderNo : '',
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/groupBuying/confirm-order/confirm-order'
|
||||
})
|
||||
return
|
||||
await dingyue();
|
||||
uni.showLoading({
|
||||
title: '支付中……'
|
||||
@@ -244,8 +263,7 @@
|
||||
Api.exchange({
|
||||
paramId: item.id,
|
||||
shopId: item.shopId,
|
||||
number: 1,
|
||||
price: item.extraPrice,
|
||||
number: number.value,
|
||||
groupOrderNo: popupData.item ? popupData.item.groupOrderNo : '',
|
||||
openId
|
||||
}).then(orderRes => {
|
||||
@@ -255,7 +273,7 @@
|
||||
|
||||
if (res) {
|
||||
uni.redirectTo({
|
||||
url: '/groupBuying/success/index?detailId=' + orderRes.goodsRecord
|
||||
url: '/groupBuying/success/index?detailId=' + orderRes.record
|
||||
.id
|
||||
})
|
||||
} else {
|
||||
@@ -400,6 +418,19 @@
|
||||
|
||||
|
||||
onLoad(init)
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.showShareMenu()
|
||||
// #endif
|
||||
onShareAppMessage(() => {
|
||||
|
||||
const query = `wareId=${item.wareId}&shopId=${item.shopId}`
|
||||
return wxShare({
|
||||
title: item.wareJson.wareName,
|
||||
imageUrl: item.goodsImg,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<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="拼团特惠"
|
||||
<up-navbar bg-color="transparent" :fixed="false" :placeholder="false" title="拼团特惠" @leftClick="uni.navigateBack()"
|
||||
left-icon-color="#fff" title-color="#fff"></up-navbar>
|
||||
<view class="u-flex info u-col-center">
|
||||
<image :src="imgs.map" class="map"></image>
|
||||
@@ -57,7 +57,7 @@
|
||||
<text class="numbers">{{item.groupPeopleNum}}人团</text>
|
||||
<text class="u-line-1 font-bold u-m-l-18 name">{{item.wareName}}</text>
|
||||
</view>
|
||||
<view class="members">已团:9999</view>
|
||||
<view class="members">已团:{{item.groupedNum}}</view>
|
||||
<view class="info">
|
||||
<view class="left">
|
||||
<view class="">
|
||||
@@ -110,17 +110,30 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns" v-if="showBtns(item)">
|
||||
<view class="btn " @click.stop="refund(item)">申请退款</view>
|
||||
<template v-if="item.status=='待核销'">
|
||||
<view class="btn " @click.stop="lookCode(item)">查看券码</view>
|
||||
<button class="btn black" @click.stop="refund(item)">申请退款</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="btn " @click.stop="refund(item)" v-if="canRefund(item)">申请退款</view>
|
||||
<view class="btn " @click.stop="cancelRefund(item)" v-if="item.status=='退款中'">取消退款</view>
|
||||
<button open-type="share" class="btn black" @click.stop="share(item)">邀请好友</button>
|
||||
<button open-type="share" class="btn black" @click.stop="share(item)"
|
||||
v-if="showShare(item)">邀请好友</button>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import LookQrcode from "@/components/look-qrcode/look-qrcode.vue";
|
||||
import {
|
||||
wxShare
|
||||
} from '@/utils/share.js'
|
||||
@@ -139,6 +152,24 @@
|
||||
watch
|
||||
} from 'vue'
|
||||
|
||||
const canRefundStatus = ['待成团', '待核销']
|
||||
|
||||
function canRefund(item) {
|
||||
if (canRefundStatus.includes(item.status)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
const modalData = reactive({
|
||||
show: false,
|
||||
});
|
||||
const qrcode = ref("");
|
||||
|
||||
function lookCode(item) {
|
||||
qrcode.value = item.verifyCode
|
||||
modalData.show = true;
|
||||
}
|
||||
|
||||
const imgs = {
|
||||
bg: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/1/d21f2dfd7bec44618f2d5e4b88372b08.png',
|
||||
bg1: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/1/604c3f917daa41af9239145196c6d3f3.png',
|
||||
@@ -300,7 +331,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
function camcelRefund(item) {
|
||||
function cancelRefund(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否取消退款?',
|
||||
@@ -336,12 +367,19 @@
|
||||
return true
|
||||
}
|
||||
|
||||
function showTime(item) {
|
||||
if (item.status == '已退款') {
|
||||
function showShare(item) {
|
||||
if (item.status == '待成团') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function showTime(item) {
|
||||
if (item.status == '待成团') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
let shareItem = null
|
||||
@@ -526,6 +564,7 @@
|
||||
.orderStatus {
|
||||
padding: 26rpx 28rpx;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
|
||||
.orderState {
|
||||
color: #999;
|
||||
@@ -558,23 +597,7 @@
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid transparent;
|
||||
|
||||
&.success {
|
||||
border-color: rgba(123, 209, 54, 1);
|
||||
color: rgba(123, 209, 54, 1);
|
||||
background: rgba(123, 209, 54, 0.12);
|
||||
}
|
||||
|
||||
&.error {
|
||||
border-color: #FF1C1C;
|
||||
color: #FF1C1C;
|
||||
background: rgba(255, 28, 28, 0.18);
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #ED5A2E;
|
||||
@@ -632,4 +655,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.copy {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,9 +1,14 @@
|
||||
<template>
|
||||
|
||||
<view>
|
||||
<template v-if="item.status=='待核销'">
|
||||
<view class="min-page bg-f7 color-333 u-font-28 relative">
|
||||
<up-navbar bg-color="#F8F8F8" :fixed="true" :placeholder="true" title="支付成功"
|
||||
@leftClick="uni.navigateBack()"></up-navbar>
|
||||
|
||||
<view class="bottom">
|
||||
<view class="u-p-32 u-flex u-row-center u-col-center u-flex-col bg-fff">
|
||||
<image :src="imgs.success" mode="" class="success"></image>
|
||||
<image :src="imgs.success" mode="" class="success-icon"></image>
|
||||
<view class="u-font-36 font-bold u-m-t-16">拼团成功</view>
|
||||
</view>
|
||||
|
||||
@@ -51,19 +56,6 @@
|
||||
</view>
|
||||
|
||||
|
||||
<view class="shop-box" v-if="false">
|
||||
<view class="u-flex u-row-center u-flex-col u-col-center">
|
||||
<up-qrcode :val="item.verifyCode" :size="104"></up-qrcode>
|
||||
<view class="u-flex u-m-t-22 u-m-b-18 u-col-center">
|
||||
<text>{{item.verifyCode}}</text>
|
||||
<image @click="copyText(item.verifyCode)" class="copy" src="/groupBuying/static/image/copy.png">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="members">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(user,index) in item.users" :key="index">
|
||||
@@ -136,11 +128,152 @@
|
||||
|
||||
<view style="height: 100px;"></view>
|
||||
<view class="btns">
|
||||
<view class="btn" @click="uni.navigateBack()">继续拼团</view>
|
||||
<button open-type="share" class="btn main" @click="toOrderDetail(item)">查看订单</button>
|
||||
<view class="btn" @click="toPinIndex">继续拼团</view>
|
||||
<button class="btn main" @click="toOrderDetail(item)">查看订单</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="item.status=='待成团'">
|
||||
<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" @leftClick="uni.navigateBack()" title-color="#fff"></up-navbar>
|
||||
<view class="u-flex info u-col-center">
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom bottom1">
|
||||
<view class="time" v-if="item.status=='待成团'">
|
||||
<text class="color-666">剩余成团时间:</text>
|
||||
<view class="u-font-32">
|
||||
<text class="number">{{returnNum(0)}}</text>
|
||||
<text class="gap">:</text>
|
||||
<text class="number">{{returnNum(1)}}</text>
|
||||
<text class="gap">:</text>
|
||||
<text class="number">{{returnNum(2)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods u-flex u-col-center">
|
||||
<up-image width="158rpx" height="158rpx" radius="14rpx" :src="item.goodsImg"></up-image>
|
||||
<view class=" u-flex-1 u-p-l-16">
|
||||
<view class="u-flex u-col-center u-row-between">
|
||||
<view class="u-flex tuan-members">
|
||||
<image :src="imgs.pin" class="pin" mode=""></image>
|
||||
<text class="">{{item.groupPeopleNum}}人团</text>
|
||||
</view>
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
|
||||
</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
|
||||
.wareName}}</view>
|
||||
<view class="u-flex u-m-t-10 u-col-center ">
|
||||
<view class="price">
|
||||
<text class="u-font-30">¥</text>
|
||||
<text class="u-font-48 font-bold">{{item.payAmount}} </text>
|
||||
</view>
|
||||
<view class="old-price u-m-l-32">
|
||||
<text>¥</text>
|
||||
<text>{{item.payAmount}} </text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-l-16 color-333 no-wrap">
|
||||
数量:{{item.num}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="shop-box">
|
||||
<view class="shop ">
|
||||
<view class="u-flex">
|
||||
<text style="min-width: 180rpx;" class="color-666">可核销门店:</text>
|
||||
<text>{{item.shopName}}</text>
|
||||
</view>
|
||||
<view class="u-m-t-32 u-flex">
|
||||
<text style="min-width: 180rpx;" class="color-666">门店地址:</text>
|
||||
<text>{{item.shopAddress}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="members">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(user,index) in item.users" :key="index">
|
||||
<view class="box">
|
||||
<view class="u-flex relative">
|
||||
<up-avatar size="140rpx" :src="user.userAvatar"></up-avatar>
|
||||
<view class="u-flex u-row-center absolute">
|
||||
<text class="tuanzhang" v-if="index==0">团长</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="u-line-1 u-m-t-16 color-000 text-center">{{user.userName}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<view class="box">
|
||||
<view class="u-flex relative">
|
||||
<view class="add-box u-flex u-row-center">
|
||||
<up-icon color="#D9D9D9" name="plus"></up-icon>
|
||||
<button open-type="share" class="share" @click="share(item)">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-line-1 u-m-t-16 color-000 text-center">等待参团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center" v-if="item.status=='待成团'">
|
||||
<view class="pin-btn" >邀请好友参团
|
||||
<button open-type="share" class="share">邀请好友参团</button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="order">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold u-font-32">订单信息</view>
|
||||
|
||||
<view class="u-flex color-666" @click="showOrder=!showOrder" style="align-items: baseline;">
|
||||
<text class="u-m-r-18">{{showOrder?'收起':'展开'}}</text>
|
||||
<view class="guodu" :class="{rotate:!showOrder}">
|
||||
<up-icon name="arrow-down" bold></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-16" v-if="showOrder">
|
||||
<view class="u-flex u-row-between item">
|
||||
<view class="color-666">商品总额</view>
|
||||
<view class="">¥99.99</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between item">
|
||||
<view class="color-666">实付金额</view>
|
||||
<view class="">¥{{item.payAmount}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between item">
|
||||
<view class="color-666">订单号</view>
|
||||
<view class="">{{item.orderNo}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between item">
|
||||
<view class="color-666">支付时间</view>
|
||||
<view class="">{{item.payTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import statusVue from '@/groupBuying/components/status.vue'
|
||||
@@ -156,6 +289,11 @@
|
||||
getRemainingHMS
|
||||
} from '@/utils/countdown.js'
|
||||
|
||||
function toPinIndex() {
|
||||
uni.redirectTo({
|
||||
url: '/groupBuying/index/index'
|
||||
})
|
||||
}
|
||||
const imgs = {
|
||||
bg: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/1/d21f2dfd7bec44618f2d5e4b88372b08.png',
|
||||
pin: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3947892924dd481782331513aff00eb3.png',
|
||||
@@ -241,10 +379,13 @@
|
||||
|
||||
onShareAppMessage(() => {
|
||||
console.log('onShareAppMessage')
|
||||
console.log(item)
|
||||
const query = `groupOrderNo=${item.groupOrderNo}&shopId=${item.shopId}`
|
||||
return wxShare({
|
||||
title: shareItem.wareJson.wareName,
|
||||
imageUrl: shareItem.goodsImg,
|
||||
query: `detailId=${shareItem.id}&shopId=${shareItem.shopId}`,
|
||||
title: item.wareJson.wareName,
|
||||
imageUrl: item.goodsImg,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -461,6 +602,16 @@
|
||||
background: #E8AD7B;
|
||||
color: #fff;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.share {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.rotate {
|
||||
@@ -486,7 +637,7 @@
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.success {
|
||||
.success-icon {
|
||||
width: 102rpx;
|
||||
height: 102rpx;
|
||||
}
|
||||
@@ -494,4 +645,162 @@
|
||||
.bg-fff {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bottom1 {
|
||||
margin: 0 28rpx;
|
||||
padding: 0;
|
||||
transform: translateY(-160rpx);
|
||||
background-color: transparent;
|
||||
|
||||
.time {
|
||||
padding: 18rpx 24rpx;
|
||||
background: #FFF4E2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
|
||||
.number {
|
||||
padding: 6rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #ED5A2E;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
margin-left: 18rpx;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
|
||||
.gap {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.goods {
|
||||
background-color: #fff;
|
||||
padding: 32rpx 24rpx 0;
|
||||
border-radius: 0;
|
||||
margin-top: 0;
|
||||
|
||||
.pin {
|
||||
width: 60rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
|
||||
.tuan-members {
|
||||
padding: 0 16rpx 0 0;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
background: #4C2828;
|
||||
color: #f5d9ad;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #ed5a2e;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.u-font-48 {
|
||||
font-size: 48rpx;
|
||||
}
|
||||
|
||||
.shop-box {
|
||||
background: #fff;
|
||||
padding: 32rpx 30rpx 28rpx 30rpx;
|
||||
border-radius: 0 0 16rpx 16rpx;
|
||||
}
|
||||
|
||||
.copy {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
margin-left: 22rpx;
|
||||
}
|
||||
|
||||
.shop {
|
||||
border-radius: 8rpx;
|
||||
background: #F8F8F8;
|
||||
padding: 16rpx 34rpx;
|
||||
}
|
||||
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.members {
|
||||
padding: 26rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 32rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.item {
|
||||
width: calc(100% / 3);
|
||||
display: flex;
|
||||
|
||||
.add-box {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border: 2rpx dashed #D9D9D9;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.share {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&:nth-of-type(3n) {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.absolute {
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.tuanzhang {
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #ED5A2E;
|
||||
color: #fff;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order {
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 16rpx;
|
||||
margin: 0;
|
||||
margin-top: 32rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
padding: 16rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -386,7 +386,14 @@
|
||||
{
|
||||
"path": "success/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "支付成功"
|
||||
"navigationBarTitleText": "支付成功",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "confirm-order/confirm-order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<image :src="imgs.big_orderFood" class="big_img"></image>
|
||||
</view>
|
||||
|
||||
<view class="groupBuying" v-if="allConfig.group" @click="toGroupBuying">
|
||||
<view class="groupBuying" @click="toGroupBuying">
|
||||
<view class="u-flex u-col-center">
|
||||
<image class="img" :src="imgs.groupBuying"></image>
|
||||
<view class="u-font-32 color-333 font-700 u-m-l-12">快乐拼单</view>
|
||||
@@ -58,9 +58,10 @@
|
||||
|
||||
<view class="u-font-28 color-999">一键分享,快速拼单</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="points" @click="toIntegralMall" v-if="allConfig.pointsMall">
|
||||
<view class="points" @click="toIntegralMall" >
|
||||
<view>
|
||||
<view class="title">积分乐园</view>
|
||||
<view class="desc">好物兑换 畅花积分</view>
|
||||
@@ -79,7 +80,7 @@
|
||||
<view class="title">充值</view>
|
||||
<view class="desc">充值享更多优惠</view>
|
||||
</view>
|
||||
<view class="item" @click="toFenxiao" v-if="allConfig.distribution">
|
||||
<view class="item" @click="toFenxiao">
|
||||
<image :src="imgs.share" class="img"></image>
|
||||
<view class="title">股东共享</view>
|
||||
<view class="desc">邀请好友,获得佣金</view>
|
||||
|
||||
Reference in New Issue
Block a user