套餐问题修复
This commit is contained in:
4
App.vue
4
App.vue
@@ -36,8 +36,8 @@
|
||||
const store = useNavbarStore();
|
||||
await store.initNavbarHeight();
|
||||
getApp().globalData.websocket=null;
|
||||
const cartsStore=useCartsStore()
|
||||
cartsStore.isloading=false;
|
||||
// const cartsStore=useCartsStore()
|
||||
// cartsStore.isloading=false;
|
||||
});
|
||||
onShow(async () => {
|
||||
try {
|
||||
|
||||
@@ -1,54 +1,125 @@
|
||||
// 引入 request 文件
|
||||
import request from '@/common/api/request.js'
|
||||
import {prveUrl} from './config.js'
|
||||
import {
|
||||
prveUrl
|
||||
} from './config.js'
|
||||
|
||||
const orderPrveUrl = '/order'
|
||||
|
||||
let platformType = '';
|
||||
let payType = '';
|
||||
// #ifdef MP-WEIXIN
|
||||
platformType = 'wechat'
|
||||
payType = 'wechatPay'
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
platformType = 'alipay'
|
||||
payType = 'aliPay'
|
||||
// #endif
|
||||
|
||||
export const getPackage = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: prveUrl + '/user/package',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const getPackageDetail = (id) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/detail/'+id,
|
||||
method: 'get',
|
||||
})
|
||||
export const getPackageDetail = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/detail/' + data.id,
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const helpPage = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/help/page',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const order = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: prveUrl + '/user/package/order',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const createOrder = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const cancel = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/cancel',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: prveUrl + '/user/package/cancel',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const help = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/help',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: prveUrl + '/user/package/help',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const orderDetail = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/package/order/detail',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: prveUrl + '/user/package/order/detail',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const ppOrderPay = (data) => {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const openId = uni.cache.get('userInfo').wechatOpenId;
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
const openId = uni.cache.get('userInfo').alipayOpenId;
|
||||
// #endif
|
||||
return request({
|
||||
url: orderPrveUrl + '/user/ppOrder/pay',
|
||||
method: 'post',
|
||||
data: {
|
||||
platformType,
|
||||
payType,
|
||||
openId,
|
||||
...data
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
export const applyRefund = (data) => {
|
||||
return request({
|
||||
url: orderPrveUrl + '/user/ppOrder/applyRefund',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export const cancelRefund = (data) => {
|
||||
return request({
|
||||
url: orderPrveUrl + '/user/ppOrder/cancelRefund',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
<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>
|
||||
<image src="/static/icon/copy.png" class="u-m-l-24 copy"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -354,6 +354,7 @@
|
||||
|
||||
function getDetail() {
|
||||
Api.recordDetail(query).then(res => {
|
||||
console.log('getDetail',res)
|
||||
const wareJson = JSON.parse(res.wareJson)
|
||||
wareJson.wareImgs = wareJson.wareImgs.split(',').filter(v => v)
|
||||
res.wareJson = wareJson;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<text class="old-price">¥{{item.originalPrice}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<view class="u-m-t-16 text" v-if="item.limitBuyNum"> 限购{{item.limitBuyNum}}份 </view>
|
||||
<view class="u-m-t-16 text" v-if="item.limitBuyNum&&item.limitBuyNum!='-10086'"> 限购{{item.limitBuyNum}}份 </view>
|
||||
<view class="text u-m-t-10">已团:{{item.groupedNum||0}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
</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>
|
||||
<text class="stitle ">{{item.groupEndTime}}</text>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-32 u-col-center" v-if="showTime(item)">
|
||||
<text class="title">剩余成团时间:</text>
|
||||
@@ -413,13 +413,18 @@
|
||||
})
|
||||
})
|
||||
onShow(getData)
|
||||
onLoad(() => {
|
||||
onLoad((opt) => {
|
||||
const shopId=opt.shopId||uni.cache.get('shopId')
|
||||
query.shopId=shopId
|
||||
uni.cache.set('shopId',query.shopId)
|
||||
console.log('opt',opt);
|
||||
APIusershopInfodetail({
|
||||
shopId: uni.cache.get('shopId')
|
||||
shopId: shopId
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
shopInfo.value = res.shopInfo
|
||||
uni.cache.set('shopInfo', res.shopInfo)
|
||||
uni.cache.set('shopId', res.shopInfo.id)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -270,6 +270,110 @@
|
||||
|
||||
</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" style="border-radius: 16rpx;">
|
||||
<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 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">
|
||||
<text class="u-font-30">¥</text>
|
||||
<text class="u-font-48 font-bold">{{item.wareGroupPrice}} </text>
|
||||
</view>
|
||||
<view class="old-price u-m-l-32">
|
||||
<text>¥</text>
|
||||
<text>{{item.wareOriginalPrice}} </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="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="">¥{{item.payAmount}}</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>
|
||||
|
||||
@@ -330,7 +434,7 @@
|
||||
if (!res) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content :'当前商品已下架或者不存在',
|
||||
content: '当前商品已下架或者不存在',
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
uni.redirectTo({
|
||||
|
||||
13
pages.json
13
pages.json
@@ -427,9 +427,20 @@
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "confirm-order/confirm-order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "members/members",
|
||||
"style": {
|
||||
"navigationBarTitleText": "查看全部"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -87,8 +87,12 @@
|
||||
// }
|
||||
|
||||
function toDetail() {
|
||||
if(!pointsUser.value||!pointsUser.value.id){
|
||||
return
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value.id ||
|
||||
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value?pointsUser.value.id :
|
||||
'')
|
||||
})
|
||||
}
|
||||
|
||||
BIN
static/icon/copy.png
Normal file
BIN
static/icon/copy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -49,7 +49,7 @@ export const Storelogin = defineStore("login", {
|
||||
rawData: infoRes.rawData,
|
||||
source: "wechat",
|
||||
});
|
||||
console.log('res',res);
|
||||
console.log('APIuserlogin',res);
|
||||
if (res) {
|
||||
this.token = res.token;
|
||||
this.miniAppOpenId = res.userInfo
|
||||
@@ -96,8 +96,9 @@ export const Storelogin = defineStore("login", {
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
resolve(true)
|
||||
// #endif
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,44 +1,67 @@
|
||||
<template>
|
||||
<text class="status " :class="returnClass">{{status}}</text>
|
||||
<!-- 显示中文状态名称,而非原始英文值 -->
|
||||
<text class="status" :class="returnClass">{{ statusName }}</text>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props=defineProps({
|
||||
status:{
|
||||
default:''
|
||||
// 接收父组件传入的英文状态值(ing/wait_verify等)
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const list =ref( [{
|
||||
name: '全部',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
name: '待成团',
|
||||
value: '',
|
||||
class:'success'
|
||||
|
||||
// 状态映射表:英文值 → 中文名称 + 样式类
|
||||
const statusMap = ref([{
|
||||
name: '进行中', // 显示的中文
|
||||
value: 'ing', // 匹配的英文状态
|
||||
class: 'success' // 样式类
|
||||
},
|
||||
{
|
||||
name: '待核销',
|
||||
value: '',
|
||||
class:'warning'
|
||||
value: 'wait_verify',
|
||||
class: 'warning'
|
||||
},
|
||||
{
|
||||
name: '已核销',
|
||||
value: ''
|
||||
value: 'finish',
|
||||
class: 'primary' // 新增已核销专属样式
|
||||
},
|
||||
{
|
||||
name: '退款',
|
||||
value: '',
|
||||
class:'error'
|
||||
name: '退款中',
|
||||
value: 'refunding',
|
||||
class: 'error' // 退款中复用error样式
|
||||
},
|
||||
{
|
||||
name: '已退款',
|
||||
value: 'refund',
|
||||
class: 'disabled' // 已退款复用error样式
|
||||
},
|
||||
{
|
||||
name: '已取消',
|
||||
value: 'cancel',
|
||||
class: 'disabled' // 新增已取消样式
|
||||
},
|
||||
{
|
||||
name: '超时',
|
||||
value: 'timeout',
|
||||
class: 'disabled' // 超时复用已取消样式
|
||||
}
|
||||
])
|
||||
const returnClass=computed(()=>{
|
||||
const item=list.value.find(v=>props.status.includes(v.name))
|
||||
return item?item.class:''
|
||||
|
||||
// 计算要显示的中文名称
|
||||
const statusName = computed(() => {
|
||||
const item = statusMap.value.find(v => v.value === props.status)
|
||||
return item ? item.name : props.status // 未匹配到则显示原始值
|
||||
})
|
||||
|
||||
// 计算要绑定的样式类
|
||||
const returnClass = computed(() => {
|
||||
const item = statusMap.value.find(v => v.value === props.status)
|
||||
return item ? item.class : ''
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -46,21 +69,41 @@ import { computed } from 'vue'
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #333;
|
||||
font-size: 24rpx;
|
||||
|
||||
// 进行中
|
||||
&.success {
|
||||
border-color: rgba(123, 209, 54, 1);
|
||||
color: rgba(123, 209, 54, 1);
|
||||
background: rgba(123, 209, 54, 0.12);
|
||||
}
|
||||
&.warning{
|
||||
|
||||
// 待核销
|
||||
&.warning {
|
||||
border-color: rgba(255, 141, 40, 1);
|
||||
color: rgba(255, 141, 40, 1);
|
||||
background: rgba(255, 141, 40, 0.12);
|
||||
}
|
||||
|
||||
// 已核销(新增)
|
||||
&.primary {
|
||||
border-color: rgba(41, 148, 255, 1);
|
||||
color: rgba(41, 148, 255, 1);
|
||||
background: rgba(41, 148, 255, 0.12);
|
||||
}
|
||||
|
||||
// 退款中/已退款
|
||||
&.error {
|
||||
border-color: #FF1C1C;
|
||||
color: #FF1C1C;
|
||||
background: rgba(255, 28, 28, 0.18);
|
||||
}
|
||||
|
||||
// 已取消/超时(新增)
|
||||
&.disabled {
|
||||
border-color: rgba(153, 153, 153, 1);
|
||||
color: rgba(153, 153, 153, 1);
|
||||
background: rgba(153, 153, 153, 0.12);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
356
userPackage/confirm-order/confirm-order.vue
Normal file
356
userPackage/confirm-order/confirm-order.vue
Normal file
@@ -0,0 +1,356 @@
|
||||
<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 ">
|
||||
<view class="img-box">
|
||||
<up-image width="158rpx" height="158rpx" radius="14rpx" :src="item.goodsImg"></up-image>
|
||||
<view class="tag" v-if="item.tieredDiscount&&item.tieredDiscount.length>0">阶梯优惠</view>
|
||||
</view>
|
||||
<view class=" u-flex-1 u-p-l-16 u-flex u-row-between u-col-center">
|
||||
<view>
|
||||
<view class="font-bold u-line-2 u-font-32">{{item.packageName}}</view>
|
||||
<view style="max-width: 336rpx;" class="u-line-1 u-m-t-10 color-666">{{item.description}}</view>
|
||||
|
||||
</view>
|
||||
<view class="u-p-l-10 ">
|
||||
<!-- <view class="color-333 no-wrap">
|
||||
数量:{{item.number}}
|
||||
</view> -->
|
||||
<view class=" font-bold price ">
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{item.price}}</text>
|
||||
</view>
|
||||
<view class=" old-price">
|
||||
¥{{item.originPrice}}
|
||||
</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-32 up-border-top u-p-t-28 u-p-b-28">
|
||||
|
||||
<view class="u-flex u-row-between u-p-t-16 u-p-b-16">
|
||||
<text class="u-font-32 font-bold">支付方式</text>
|
||||
<text class="">微信支付</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="desc" v-if="item.tieredDiscount&&item.tieredDiscount.length>0">
|
||||
|
||||
<view class="u-flex u-row-between ">
|
||||
<view class="name">分享说明</view>
|
||||
<view class="u-flex color-666" @click="showDesc=!showDesc" style="align-items: baseline;">
|
||||
<text class="u-m-r-18">{{showDesc?'收起':'展开'}}</text>
|
||||
<view class="guodu" :class="{rotate:!showDesc}">
|
||||
<up-icon name="arrow-down" bold></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<template v-if="showDesc">
|
||||
<view class="u-m-t-26 text-center table" v-if="item.tieredDiscount">
|
||||
<view class="u-flex header color-666">
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">分享人数</view>
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">购买价格(元)</view>
|
||||
</view>
|
||||
<view class="u-flex row" v-for="(step,index) in item.tieredDiscount" :key="index">
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">{{step.peopleNum}}</view>
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">¥{{step.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-26">
|
||||
<view>
|
||||
分享期限(小时):{{item.expireHours}}
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
规定期限内的助力才会被计入
|
||||
</view>
|
||||
<view class="u-m-t-40">
|
||||
如何才是分享成功?被分享人只需要点击《助力》,提示助力成功后即可
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
</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/market/package.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 showDesc = ref(true)
|
||||
|
||||
const item = reactive({})
|
||||
onShow(() => {
|
||||
const data = uni.getStorageSync('group_buying_order')
|
||||
data.goodsImg = data.images[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: '支付中……'
|
||||
})
|
||||
let paramId = item.paramId
|
||||
if (!paramId) {
|
||||
paramId = await Api.createOrder({
|
||||
packageId: item.id,
|
||||
shopId: item.shopId,
|
||||
})
|
||||
}
|
||||
if (!paramId) {
|
||||
return uni.showToast({
|
||||
title: '创建订单失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
const openId = await getOpenId()
|
||||
uni.hideLoading()
|
||||
if (openId) {
|
||||
Api.ppOrderPay({
|
||||
paramId,
|
||||
shopId: item.shopId,
|
||||
number: item.number,
|
||||
openId
|
||||
}).then(orderRes => {
|
||||
pay(orderRes.payInfo).then(res => {
|
||||
console.log(res)
|
||||
|
||||
if (res) {
|
||||
uni.redirectTo({
|
||||
url: '/userPackage/order/detail?orderId=' + paramId + '&shopId=' +
|
||||
item.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.price) {
|
||||
return 0;
|
||||
}
|
||||
return BigNumber(item.number).times(item.price).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: 16rpx 34rpx;
|
||||
margin: 32rpx 30rpx;
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.img-box {
|
||||
position: relative;
|
||||
|
||||
.tag {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: #4C2828;
|
||||
border-radius: 12rpx 0 16rpx 0;
|
||||
color: #faeac6;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
padding: 4rpx 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 32rpx 46rpx;
|
||||
background-color: #fff;
|
||||
margin-top: 32rpx;
|
||||
|
||||
.name {
|
||||
font-weight: 700;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.table {
|
||||
border: 2rpx solid #EDEDED;
|
||||
border-radius: 8rpx;
|
||||
margin: 0 52rpx;
|
||||
|
||||
.header {
|
||||
background: #f8f8f88f;
|
||||
}
|
||||
|
||||
.row {
|
||||
border-top: 2rpx solid #EDEDED;
|
||||
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rotate {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -101,7 +101,7 @@
|
||||
</view>
|
||||
|
||||
|
||||
<view class="desc">
|
||||
<view class="desc" v-if="item.tieredDiscount&&item.tieredDiscount.length>0">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="name">分享说明</view>
|
||||
<view class="u-flex color-666" @click="showDesc=!showDesc" style="align-items: baseline;">
|
||||
@@ -126,13 +126,15 @@
|
||||
|
||||
<view class="u-m-t-26" >
|
||||
<view>
|
||||
分享期限(小时):4
|
||||
分享期限(小时):{{item.expireHours}}
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
规定期限内的助力才会被计入
|
||||
</view>
|
||||
<view class="u-m-t-40">
|
||||
如何才是分享成功?
被分享人只需要点击《助力》,提示助力成功后即可
|
||||
如何才是分享成功?被分享人只需要点击《助力》,提示助力成功后即可
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -158,10 +160,10 @@
|
||||
<template v-if="useDescShow">
|
||||
<view class="u-m-t-16 color-666">
|
||||
<view>
|
||||
1、可用时间段:04:00 - 16:07
|
||||
1、可用时间段:{{canuseTime}}
|
||||
</view>
|
||||
<view>
|
||||
2、其他使用说明:这里是其他使用说明
|
||||
<view v-if="item.otherDesc">
|
||||
2、其他使用说明:{{item.otherDesc}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -179,18 +181,21 @@
|
||||
<view class="title">商品详情</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<image class="w-full" v-for="(item,index) in item.imgs" :key="index" mode="widthFix" :src="item">
|
||||
<image class="w-full" v-for="(item,index) in item.detailImages" :key="index" mode="widthFix" :src="item">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="height: 140px"></view>
|
||||
<view class="fixed-bottom ">
|
||||
<view v-if="isCanExchange" class="btn" @click="exchangeClick">
|
||||
<!-- <view v-if="isCanExchange" class="btn" @click="exchangeClick">
|
||||
{{returnBtmText}}
|
||||
</view> -->
|
||||
<view v-if="isCanExchange" class="btn" @click="payExchange">
|
||||
{{returnBtmText}}
|
||||
</view>
|
||||
<view class="btn gray u-m-t-32" @click="createOrder">
|
||||
立即助力
|
||||
<view class="btn gray u-m-t-32" @click="createOrder" v-if="item.tieredDiscount&&item.tieredDiscount.length>0">
|
||||
发起助力
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -356,8 +361,9 @@
|
||||
}
|
||||
|
||||
async function createOrder(){
|
||||
Api.order({
|
||||
packageId:item.id
|
||||
Api.createOrder({
|
||||
packageId:item.id,
|
||||
shopId: item.shopId,
|
||||
}).then(res=>{
|
||||
if(res){
|
||||
uni.navigateTo({
|
||||
@@ -376,10 +382,9 @@
|
||||
uni.setStorageSync('group_buying_order', {
|
||||
...item,
|
||||
number: number.value,
|
||||
groupOrderNo: popupData.item ? popupData.item.groupOrderNo : '',
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/groupBuying/confirm-order/confirm-order'
|
||||
url: '/userPackage/confirm-order/confirm-order'
|
||||
})
|
||||
return
|
||||
await dingyue();
|
||||
@@ -459,7 +464,6 @@
|
||||
const query = reactive({
|
||||
shopId: '',
|
||||
id: '',
|
||||
groupOrderNo: ''
|
||||
})
|
||||
|
||||
|
||||
@@ -481,7 +485,7 @@
|
||||
}
|
||||
|
||||
function getDetail() {
|
||||
Api.getPackageDetail(query.id).then(res => {
|
||||
Api.getPackageDetail(query).then(res => {
|
||||
Object.assign(item, res)
|
||||
console.log(item)
|
||||
coverImgs.value = res.images
|
||||
@@ -552,15 +556,18 @@
|
||||
uni.showShareMenu()
|
||||
// #endif
|
||||
onShareAppMessage(() => {
|
||||
|
||||
const query = `id=${item.id}&shopId=${item.shopId}`
|
||||
return wxShare({
|
||||
title: item.wareName,
|
||||
imageUrl: coverImgs.value[0],
|
||||
path: '/groupBuying/goodsDetail/goodsDetail' + '?' + query,
|
||||
path: '/userPackage/goodsDetail/goodsDetail' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
|
||||
const canuseTime=computed(()=>{
|
||||
return item.useWeeks.join('、')+' '+item.useTimes
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</view>
|
||||
|
||||
<view class="u-flex u-col-center" v-if="tabs.sel==0">
|
||||
<up-search v-model="query.wareName" @search="refresh" @clear="refresh"
|
||||
<up-search v-model="query.packageName" @search="refresh" @clear="refresh"
|
||||
@custom="refresh"></up-search>
|
||||
<!-- <perpoleNumber v-model="query.groupPeopleNum"></perpoleNumber> -->
|
||||
</view>
|
||||
@@ -39,7 +39,7 @@
|
||||
<view class="item" v-for="(item,index) in list" :key="index" @click="toDetail(item)">
|
||||
<view class="relative img-box">
|
||||
<up-image width="218rpx" radius="16rpx" height="218rpx" :src="returnCoverImg(item)"></up-image>
|
||||
<view class="tag" v-if="item.tieredDiscount&&item.tieredDiscount.length">阶梯优惠</view>
|
||||
<view class="tag" v-if="isHasDiscount(item)">阶梯优惠</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-p-l-16" style="max-width: 416rpx;">
|
||||
<view class="u-line-1 name">{{item.packageName}}</view>
|
||||
@@ -48,9 +48,9 @@
|
||||
</view>
|
||||
<view class="sale-number">已售{{item.saleNum||0}}</view>
|
||||
<view class="info ">
|
||||
<view class="left u-flex u-col-center">
|
||||
<text class="u-font-24">最低到手</text>
|
||||
<text class="u-font-32 font-bold"> ¥{{item.price}}</text>
|
||||
<view class="left u-flex u-col-baseline">
|
||||
<text class="u-font-24" v-if="isHasDiscount(item)">最低到手</text>
|
||||
<text class="u-font-40 font-bold"> ¥{{minPrice(item)}}</text>
|
||||
<text class="color-999 old-price"> ¥{{item.originPrice}}</text>
|
||||
|
||||
</view>
|
||||
@@ -65,17 +65,57 @@
|
||||
<view class="orders" v-else-if="tabs.sel==1">
|
||||
<view class="item" v-for="(item,index) in list" :key="index" @click="toOrderDetail(item)">
|
||||
<view class="u-flex u-col-center u-row-between">
|
||||
<text class="numbers">{{item.groupPeopleNum}}人团</text>
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
</view>
|
||||
<view class="u-m-t-32 u-flex">
|
||||
<up-image width="154rpx" height="154rpx" :src="item.goodsImg"></up-image>
|
||||
<view class="img-box">
|
||||
<up-image width="174rpx" height="174rpx" radius="12rpx" :src="item.goodsImg"></up-image>
|
||||
<view class="tag" v-if="isHasDiscount(item)">阶梯优惠</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-flex u-p-l-30 u-col-center u-row-between">
|
||||
<view>
|
||||
<view class="">{{item.wareJson.wareName}}</view>
|
||||
<view class="u-m-t-34 price">¥{{item.payAmount}}</view>
|
||||
<view style="max-width: 336rpx;">
|
||||
<view class="u-line-2 font-bold u-font-32">{{item.packageName}}</view>
|
||||
<view class="u-line-1 u-m-t-10 color-666" >{{item.packageName}}
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
<view class="u-m-t-16">
|
||||
<template v-if="item.status=='ing'||item.status=='timeout'">
|
||||
<view class=" main-color main-color">
|
||||
当前到手
|
||||
</view>
|
||||
<view class=" font-bold price main-color u-m-t-4">
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{nowPrice(item)}}</text>
|
||||
</view>
|
||||
<view class=" main-color old-price" v-if="item">
|
||||
¥{{item.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<template v-if="item&&item.finalPrice">
|
||||
<view class=" font-bold price main-color" >
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{item.finalPrice}}</text>
|
||||
</view>
|
||||
<view class=" main-color old-price" >
|
||||
¥{{item.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class=" font-bold price main-color" >
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{item.price}}</text>
|
||||
</view>
|
||||
<view class=" main-color old-price" >
|
||||
¥{{item.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<text class="u-font-40 font-bold">x{{item.num}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -94,19 +134,24 @@
|
||||
<text class="stitle price">{{returnTime(item)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns" v-if="showBtns(item)">
|
||||
<template v-if="item.status=='待核销'">
|
||||
<view class="btn " @click.stop="lookCode(item)">查看券码</view>
|
||||
<button class="btn black" @click.stop="refund(item)">申请退款</button>
|
||||
<view class="btns" v-if="item&&item.status">
|
||||
|
||||
<template v-if="item.status=='ing'">
|
||||
<view class="btn " @click.stop="cancelOrder(item)">取消活动</view>
|
||||
<view class="btn " @click.stop="nowBuy(item)">立即购买</view>
|
||||
<button class="btn black" open-type="share" @click.stop="share(item)">分享</button>
|
||||
</template>
|
||||
<template v-else-if="item.status=='退款中'">
|
||||
<view class="btn " @click.stop="lookCode(item)">查看券码</view>
|
||||
<view class="btn black" @click.stop="cancelRefund(item)">取消退款</view>
|
||||
<template v-if="item.status=='timeout'">
|
||||
<view class="btn " @click.stop="cancelOrder(item)">取消活动</view>
|
||||
<view class="btn " @click.stop="nowBuy(item)">立即购买</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="btn " @click.stop="refund(item)" v-if="canRefund(item)">申请退款</view>
|
||||
<button open-type="share" class="btn black" @click.stop="share(item)"
|
||||
v-if="showShare(item)">邀请好友</button>
|
||||
<template v-if="item.status=='wait_verify'">
|
||||
<view class="btn " @click.stop="refund(item)">申请退款</view>
|
||||
<button class="btn black" @click.stop="lookCode(item)">查看券码</button>
|
||||
</template>
|
||||
<template v-if="item.status=='refunding'">
|
||||
<view class="btn " @click.stop="lookCode(item)">查看券码</view>
|
||||
<button class="btn black" @click.stop="cancelRefund(item)">取消退款</button>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
@@ -136,7 +181,7 @@
|
||||
} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/common/api/market/package.js'
|
||||
import perpoleNumber from './components/perpole-number.vue'
|
||||
import statusVue from '@/groupBuying/components/status.vue'
|
||||
import statusVue from '@/userPackage/components/status.vue'
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
@@ -147,6 +192,11 @@
|
||||
APIusershopInfodetail
|
||||
} from '@/common/api/member.js'
|
||||
|
||||
|
||||
// 判断是否有阶梯优惠
|
||||
function isHasDiscount(item) {
|
||||
return item.tieredDiscount && item.tieredDiscount.length
|
||||
}
|
||||
const canRefundStatus = ['待成团', '待核销']
|
||||
|
||||
function canRefund(item) {
|
||||
@@ -155,6 +205,7 @@
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const modalData = reactive({
|
||||
show: false,
|
||||
});
|
||||
@@ -189,20 +240,20 @@
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
name: '待成团',
|
||||
value: '待成团'
|
||||
name: '进行中',
|
||||
value: 'ing'
|
||||
},
|
||||
{
|
||||
name: '待核销',
|
||||
value: '待核销'
|
||||
value: 'wait_verify'
|
||||
},
|
||||
{
|
||||
name: '已核销',
|
||||
value: '已核销'
|
||||
value: 'finish'
|
||||
},
|
||||
{
|
||||
name: '退款',
|
||||
value: '退款'
|
||||
value: 'ref'
|
||||
},
|
||||
],
|
||||
sel: 0
|
||||
@@ -211,7 +262,7 @@
|
||||
const query = reactive({
|
||||
page: 1,
|
||||
size: 10,
|
||||
wareName: '',
|
||||
packageName: '',
|
||||
groupPeopleNum: '',
|
||||
shopId: uni.cache.get('shopId'),
|
||||
})
|
||||
@@ -227,6 +278,19 @@
|
||||
refresh()
|
||||
})
|
||||
|
||||
async function nowBuy(item) {
|
||||
uni.setStorageSync('group_buying_order', {
|
||||
...item,
|
||||
number: 1,
|
||||
price: nowPrice(item),
|
||||
paramId: item.id
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/userPackage/confirm-order/confirm-order'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function getData() {
|
||||
if (tabs.sel == 0) {
|
||||
Api.getPackage(query).then(res => {
|
||||
@@ -253,12 +317,9 @@
|
||||
status: status.value,
|
||||
}).then(res => {
|
||||
const newArr = (res.records || []).map(v => {
|
||||
const wareJson = JSON.parse(v.wareJson)
|
||||
wareJson.wareImgs = wareJson.wareImgs.split(',').filter(v => v)
|
||||
return {
|
||||
...v,
|
||||
goodsImg: wareJson.wareImgs[0],
|
||||
wareJson,
|
||||
goodsImg: v.images[0],
|
||||
}
|
||||
})
|
||||
|
||||
@@ -282,7 +343,7 @@
|
||||
|
||||
function toOrderDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/userPackage/detail/index?detailId=' + item.id + '&shopId=' + item.shopId
|
||||
url: '/userPackage/order/detail?orderId=' + item.id + '&shopId=' + item.shopId
|
||||
})
|
||||
}
|
||||
|
||||
@@ -294,12 +355,64 @@
|
||||
return item.images[0]
|
||||
}
|
||||
|
||||
function nowPrice(item) {
|
||||
|
||||
if (!item.tieredDiscount.length) {
|
||||
return 0
|
||||
}
|
||||
let nowStep = null
|
||||
for (let i in item.tieredDiscount) {
|
||||
const nowItem = item.tieredDiscount[i]
|
||||
const nextItem = item.tieredDiscount[i + 1]
|
||||
if (!nextItem) {
|
||||
if (item.shareNum >= nowItem.peopleNum) {
|
||||
nowStep = nowItem
|
||||
}
|
||||
} else {
|
||||
if (item.shareNum >= nowItem.peopleNum && item.shareNum < nextItem.peopleNum) {
|
||||
nowStep = nowItem
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('nowStep', nowStep);
|
||||
return nowStep ? nowStep.price : item.price
|
||||
}
|
||||
|
||||
|
||||
function refresh() {
|
||||
query.page = 1
|
||||
isEnd.value = false
|
||||
getData()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function cancelOrder(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否取消该活动?',
|
||||
showCancel: true,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
Api.cancel({
|
||||
orderId: item.id,
|
||||
}).then(res => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '取消成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
refresh()
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function refund(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
@@ -385,11 +498,11 @@
|
||||
onShareAppMessage(() => {
|
||||
console.log('onShareAppMessage')
|
||||
console.log(shareItem)
|
||||
const query = `groupOrderNo=${shareItem.groupOrderNo}&shopId=${shareItem.shopId}`
|
||||
const query = `orderId=${shareItem.id}&shopId=${shareItem.shopId}`
|
||||
return wxShare({
|
||||
title: shareItem.wareJson.wareName,
|
||||
title: shareItem.packageName,
|
||||
imageUrl: shareItem.goodsImg,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
path: '/userPackage/order/detail' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
@@ -417,6 +530,13 @@
|
||||
nowTime.value
|
||||
return getRemainingHMS(item)
|
||||
}
|
||||
|
||||
function minPrice(item) {
|
||||
if (!item || item.tieredDiscount <= 0) {
|
||||
return item.price
|
||||
}
|
||||
return item.tieredDiscount[item.tieredDiscount.length - 1].price
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -548,18 +668,28 @@
|
||||
background-size: cover;
|
||||
transform: translateY(-10rpx);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
width: 306rpx;
|
||||
padding: 16rpx 22rpx;
|
||||
color: #eb532a;
|
||||
flex: 1;
|
||||
}
|
||||
.old-price{
|
||||
|
||||
.old-price {
|
||||
text-decoration: line-through;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.right {
|
||||
background-color: #ED5A2E;
|
||||
border-radius: 0 16rpx 16rpx 0;
|
||||
padding-right: 10rpx;
|
||||
padding-left: 16rpx;
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.pin {
|
||||
width: 76rpx;
|
||||
@@ -618,13 +748,38 @@
|
||||
|
||||
.orders {
|
||||
padding: 0 26rpx 36rpx;
|
||||
|
||||
margin-top: 32rpx;
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #FFF;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.main-color {
|
||||
color: #eb532a;
|
||||
}
|
||||
|
||||
.img-box {
|
||||
position: relative;
|
||||
|
||||
.tag {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 16rpx 0;
|
||||
background: #4C2828;
|
||||
color: #faeac6;
|
||||
font-size: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.old-price {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.numbers {
|
||||
background-color: #ED5A2E;
|
||||
padding: 16rpx 30rpx;
|
||||
|
||||
72
userPackage/members/members.vue
Normal file
72
userPackage/members/members.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<view class="min-page color-333 u-font-28 ">
|
||||
<view class="u-font-32 font-bold ">助力人({{totalRow}}人)</view>
|
||||
<view class="list u-m-t-40">
|
||||
<view class="item" v-for="(item,index) in list" :key="index">
|
||||
<up-avatar size="140rpx" :src="item.userAvator"></up-avatar>
|
||||
<view class="u-m-t-16 u-line-1">{{item.userName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-empty v-if="!list.length" text="暂无助力人"></up-empty>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import { onReachBottom } from '@dcloudio/uni-app'
|
||||
import * as Api from '@/common/api/market/package.js'
|
||||
const query=reactive({
|
||||
page:1,size:10
|
||||
})
|
||||
|
||||
const totalRow=ref(0)
|
||||
const isEnd=ref(false)
|
||||
const list=ref([])
|
||||
function getList(){
|
||||
Api.helpPage(query).then(res=>{
|
||||
totalRow.value=res.totalRow||0
|
||||
isEnd.value= query.page>= res.totalPage*1 ?true :false
|
||||
if(query.page==1){
|
||||
list.value=res.records
|
||||
}else{
|
||||
list.value.push(...res.records)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onReachBottom(()=>{
|
||||
if(isEnd.value){
|
||||
return
|
||||
}
|
||||
query.page++
|
||||
getList()
|
||||
})
|
||||
onLoad((opt)=>{
|
||||
Object.assign(query,opt)
|
||||
getList()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.min-page{
|
||||
padding: 32rpx 52rpx;
|
||||
}
|
||||
.list{
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-column-gap: 28rpx;
|
||||
grid-row-gap: 32rpx;
|
||||
.item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
.u-line-1{
|
||||
max-width: 140rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,14 +1,14 @@
|
||||
<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" x>
|
||||
<view class="top" :style="topStyle">
|
||||
<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>
|
||||
@leftClick="back('/userPackage/index/index')" title-color="#fff"></up-navbar>
|
||||
<view class="u-flex info u-col-center">
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="time" v-if="item.status=='待成团'||item.wareGroupStatus=='ing'">
|
||||
<text class="color-666">剩余成团时间:</text>
|
||||
<view class="time u-flex u-row-center" v-if="item.status=='ing'">
|
||||
<text class="color-666">剩余助力时间:</text>
|
||||
<view class="u-font-32">
|
||||
<text class="number">{{returnNum(0)}}</text>
|
||||
<text class="gap">:</text>
|
||||
@@ -17,52 +17,92 @@
|
||||
<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>
|
||||
<template v-if="item.id">
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
</template>
|
||||
<template v-else>
|
||||
<statusVue v-if="item.wareGroupStatus=='ing'" status="待成团"></statusVue>
|
||||
<view v-else></view>
|
||||
</template>
|
||||
<view class="goods u-flex u-col-center" @click="toDetail(item.packageInfo)">
|
||||
<view class="img-box">
|
||||
<up-image width="174rpx" height="174rpx" radius="14rpx" :src="item.goodsImg"></up-image>
|
||||
<view class="tag" v-if="item.packageInfo&&item.packageInfo.tieredDiscount.length">
|
||||
阶梯优惠</view>
|
||||
</view>
|
||||
<view class=" u-flex-1 u-p-l-16 u-flex u-col-center u-row-between">
|
||||
<view v-if="item&&item.packageInfo" style="max-width: 326rpx;">
|
||||
<view class="font-bold u-font-32 u-line-2">{{item.packageInfo
|
||||
.packageName}}</view>
|
||||
|
||||
<view class="u-m-t-10 color-666 u-line-1">{{item.packageInfo.description}}</view>
|
||||
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-col-center">
|
||||
<view style="width: 356rpx;">
|
||||
<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">
|
||||
<text class="u-font-30">¥</text>
|
||||
<text class="u-font-48 font-bold">{{item.wareGroupPrice}} </text>
|
||||
<view>
|
||||
<template v-if="item.id&&item.isMyself">
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
</template>
|
||||
<template v-if="item.id&&!item.isMyself&&item.canHelp">
|
||||
<statusVue :status="item.status"></statusVue>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- 阶梯 -->
|
||||
<view v-if="isHasDiscount(item.packageInfo)" class="u-m-t-16">
|
||||
<template v-if="item.status=='ing'||item.status=='timeout'">
|
||||
<view class=" main-color">
|
||||
当前到手
|
||||
</view>
|
||||
<view class="old-price u-m-l-32">
|
||||
<text>¥</text>
|
||||
<text>{{item.wareOriginalPrice}} </text>
|
||||
<view class=" font-bold price main-color">
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{nowPrice}}</text>
|
||||
</view>
|
||||
<view class=" main-color old-price" v-if="item.packageInfo">
|
||||
¥{{item.packageInfo.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="item.finalPrice">
|
||||
<view class=" font-bold price main-color">
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{item.finalPrice}}</text>
|
||||
</view>
|
||||
<view class=" main-color old-price" v-if="item.packageInfo">
|
||||
¥{{item.packageInfo.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class=" font-bold price main-color" v-if="item.packageInfo">
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{item.packageInfo.price}}</text>
|
||||
</view>
|
||||
<view class="main-color old-price" v-if="item.packageInfo">
|
||||
¥{{item.packageInfo.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class=" font-bold price main-color" v-if="item.finalPrice">
|
||||
<text class="u-font-26"> ¥</text>
|
||||
<text class="u-font-40">{{item.finalPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-l-16 color-333 no-wrap" v-if="item.id">
|
||||
数量:{{item.num}}
|
||||
</view>
|
||||
<view class=" main-color old-price" v-if="item.packageInfo">
|
||||
¥{{item.packageInfo.originPrice}}
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="item.status">
|
||||
<view class="refund" v-if="item.status=='refunding'">已申请退款,需等待商家审核</view>
|
||||
<view class="refund" v-if="returnTime==='00:00:00'&&!item.isMyself">当前订单已失效</view>
|
||||
<view class="refund" v-if="item.status=='cancel'&&!item.isMyself">当前订单已失效</view>
|
||||
</template>
|
||||
|
||||
<view class="refund" v-if="item.status=='退款中'">已申请退款,需等待商家审核</view>
|
||||
<view class="shop-box">
|
||||
<view class="u-flex u-row-center u-flex-col u-col-center" v-if="item.status=='待核销'||item.status=='退款中'">
|
||||
<view class="u-flex u-row-center u-flex-col u-col-center"
|
||||
v-if="(item.status=='wait_verify'||item.status=='refunding')&&item.isMyself">
|
||||
<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 @click="copyText(item.verifyCode)" class="copy" src="/userPackage/static/image/copy.png">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
@@ -79,39 +119,127 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<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">
|
||||
<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 class="desc" v-if="isHasDiscount(item.packageInfo)">
|
||||
<view class="u-flex u-row-between" v-if="item.isMyself">
|
||||
<view class="name">已成功分享{{item.shareNum||0}}人</view>
|
||||
|
||||
|
||||
<view class="u-flex color-666" style="align-items: baseline;" v-if="item.status=='ing'" @click="uni.navigateTo({
|
||||
url:'/userPackage/members/members?recordId='+item.id
|
||||
})">
|
||||
<text>查看全部</text>
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-flex u-row-between" v-if="!item.isMyself&&item.status=='ing'">
|
||||
<view class="name">已成功分享{{item.shareNum||0}}人</view>
|
||||
|
||||
<view class="u-flex color-666" style="align-items: baseline;" v-if="item.status=='ing'" @click="uni.navigateTo({
|
||||
url:'/userPackage/members/members?recordId='+item.id
|
||||
})">
|
||||
<text>查看全部</text>
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<template v-if="item.status=='ing'&&item.isMyself">
|
||||
<view class="u-m-t-32 progress-box">
|
||||
<view class="progress" :style="{width:progressPercent+'%'}"></view>
|
||||
</view>
|
||||
<view class="u-m-t-12 u-flex u-row-between">
|
||||
<text class="color-666">已分享{{item.shareNum||0}}人</text>
|
||||
<view class="share-text" v-if="maxNum*1&&minPrice*1">
|
||||
<text v-if="progressPercent<100">分享{{maxNum}}人,</text>
|
||||
<text class="font-bold u-font-32">{{minPrice}}元</text>
|
||||
<text>即可购买</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view class="name">分享说明</view>
|
||||
<view class="u-flex color-666" @click="showDesc=!showDesc" style="align-items: baseline;">
|
||||
<text class="u-m-r-18">{{showDesc?'收起':'展开'}}</text>
|
||||
<view class="guodu" :class="{rotate:!showDesc}">
|
||||
<up-icon name="arrow-down" bold></up-icon>
|
||||
</view>
|
||||
<view class="u-line-1 u-m-t-16 color-000 text-center">{{user.userName}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="item" v-if="item.status=='待成团'">
|
||||
<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>
|
||||
<template v-if="showDesc">
|
||||
<view class="u-m-t-26 text-center table" v-if="item.packageInfo">
|
||||
<view class="u-flex header color-666">
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">分享人数</view>
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">购买价格(元)</view>
|
||||
</view>
|
||||
<view class="u-flex row" v-for="(step,index) in item.packageInfo.tieredDiscount"
|
||||
:key="index">
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">{{step.peopleNum}}</view>
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">¥{{step.price}}</view>
|
||||
</view>
|
||||
<view class="u-line-1 u-m-t-16 color-000 text-center">等待参团</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-26">
|
||||
<view v-if="item.packageInfo">
|
||||
分享期限(小时):{{item.packageInfo.expireHours}}
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
规定期限内的助力才会被计入
|
||||
</view>
|
||||
<view class="u-m-t-40">
|
||||
如何才是分享成功?被分享人只需要点击《助力》,提示助力成功后即可
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-if="!item.isMyself">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view class="name">分享说明</view>
|
||||
<view class="u-flex color-666" @click="showDesc=!showDesc" style="align-items: baseline;">
|
||||
<text class="u-m-r-18">{{showDesc?'收起':'展开'}}</text>
|
||||
<view class="guodu" :class="{rotate:!showDesc}">
|
||||
<up-icon name="arrow-down" bold></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center" v-if="item.wareGroupStatus=='ing'&&!item.id">
|
||||
<view class="pin-btn" @click="fastBuy">立即参与拼团</view>
|
||||
</view>
|
||||
|
||||
<template v-if="showDesc">
|
||||
<view class="u-m-t-26 text-center table" v-if="item.packageInfo">
|
||||
<view class="u-flex header color-666">
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">分享人数</view>
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">购买价格(元)</view>
|
||||
</view>
|
||||
<view class="u-flex row" v-for="(step,index) in item.packageInfo.tieredDiscount"
|
||||
:key="index">
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">{{step.peopleNum}}</view>
|
||||
<view class="u-flex-1 u-p-t-32 u-p-b-32">¥{{step.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-26">
|
||||
<view v-if="item.packageInfo">
|
||||
分享期限(小时):{{item.packageInfo.expireHours}}
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
规定期限内的助力才会被计入
|
||||
</view>
|
||||
<view class="u-m-t-40">
|
||||
如何才是分享成功?被分享人只需要点击《助力》,提示助力成功后即可
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
<template v-if="item.id">
|
||||
|
||||
|
||||
<template v-if=" isShowOrder(item) ">
|
||||
<view class="order">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold u-font-32">订单信息</view>
|
||||
@@ -124,13 +252,10 @@
|
||||
</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="">¥{{item.payAmount}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between item">
|
||||
|
||||
<view class="u-flex u-row-between item" v-if="item.finalPrice">
|
||||
<view class="color-666">实付金额</view>
|
||||
<view class="">¥{{item.payAmount}}</view>
|
||||
<view class="">¥{{item.finalPrice}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between item">
|
||||
<view class="color-666">订单号</view>
|
||||
@@ -140,11 +265,7 @@
|
||||
<view class="color-666">支付时间</view>
|
||||
<view class="">{{item.payTime}}</view>
|
||||
</view>
|
||||
<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>
|
||||
|
||||
<view class="u-flex u-row-between item" v-if="item.verifyTime">
|
||||
<view class="color-666">核销时间</view>
|
||||
<view class="">{{item.verifyTime}}</view>
|
||||
@@ -154,45 +275,68 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<view style="height: 100px;"></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>
|
||||
|
||||
<view class="btns" v-if="item&&item.id">
|
||||
<template v-if="item.isMyself">
|
||||
<template v-if="item.status=='ing'">
|
||||
<view class="btn" @click="cancel(item)">取消活动</view>
|
||||
<!-- <view class="btn" @click="fastBuy(item)">立即购买</view> -->
|
||||
<view class="btn" @click="payExchange(item)">立即购买</view>
|
||||
|
||||
<button class="btn main" open-type="share" @click.stop="share(item)">分享</button>
|
||||
|
||||
</template>
|
||||
|
||||
<template v-if="item.status=='timeout'">
|
||||
<view class="btn" @click="cancel(item)">取消活动</view>
|
||||
<view class="btn" @click="payExchange(item)">立即购买</view>
|
||||
</template>
|
||||
|
||||
<template v-if="item.status=='wait_verify'">
|
||||
<view class="btn " @click.stop="refund(item)">申请退款</view>
|
||||
</template>
|
||||
<template v-if="item.status=='refunding'">
|
||||
<button class="btn main" @click.stop="cancelRefund(item)">取消退款</button>
|
||||
</template>
|
||||
|
||||
</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 v-else-if="item.status=='ing'&&returnTime!='00:00:00'&&item.canHelp">
|
||||
<button class="btn main" @click.stop="help(item)">立即助力</button>
|
||||
</template>
|
||||
|
||||
<view class="btn" v-if="!item.isMyself&& !item.canHelp&&item.status=='ing'">已经助力过了</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 需要支付的弹窗 -->
|
||||
<up-popup :show="popupData.show" mode="bottom" closeOnClickOverlay @close="popupData.show = false">
|
||||
<view class="popup-content">
|
||||
<view class="popup-content-top u-flex u-row-right">
|
||||
<up-icon name="close" bold="" @click="popupData.show = false"></up-icon>
|
||||
</view>
|
||||
<view class="goods-info" v-if="item&&item.wareJson">
|
||||
<view class="goods-info" v-if="item&&item.packageInfo">
|
||||
<view class="u-flex">
|
||||
<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 u-line-1" v-if="item && item.wareJson">
|
||||
{{item.wareJson.wareName}}</view>
|
||||
<view class="u-font-32 font-bold u-line-1" v-if="item && item.packageInfo">
|
||||
{{item.packageInfo.packageName}}
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-12 color-666 u-line-2">{{item.wareJson.wareDetail}}</view>
|
||||
<view class="u-m-t-12 color-666 u-line-2">{{item.packageInfo.wareDetail}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="price">¥{{item.wareGroupPrice}}</view>
|
||||
<view class="old-price">¥{{item.wareOriginalPrice}}</view>
|
||||
<view class="limitBuyNum" v-if="item.wareJson.limitBuyNum">
|
||||
限购{{item.wareJson.limitBuyNum}} </view>
|
||||
<view class="price">¥{{nowPrice}}</view>
|
||||
<view class="old-price">¥{{item.packageInfo.originPrice}}</view>
|
||||
<view class="limitBuyNum" v-if="item.packageInfo.limitBuyNum">
|
||||
限购{{item.packageInfo.limitBuyNum}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -230,8 +374,8 @@
|
||||
import {
|
||||
back
|
||||
} from '@/utils/uniapp.js'
|
||||
import statusVue from '@/groupBuying/components/status.vue'
|
||||
import * as Api from '@/common/api/market/package.js'
|
||||
import statusVue from '@/userPackage/components/status.vue'
|
||||
import * as Api from '@/common/api/market/package.js'
|
||||
import {
|
||||
wxShare
|
||||
} from '@/utils/share.js'
|
||||
@@ -242,6 +386,28 @@
|
||||
import {
|
||||
getRemainingHMS
|
||||
} from '@/utils/countdown.js'
|
||||
const item = reactive({
|
||||
status: ''
|
||||
})
|
||||
|
||||
// 判断是否有阶梯优惠
|
||||
function isHasDiscount(item) {
|
||||
if (!item) {
|
||||
return false
|
||||
}
|
||||
return item.tieredDiscount && item.tieredDiscount.length
|
||||
}
|
||||
|
||||
|
||||
const canShowOrderStatus = ['wait_verify', 'finish', 'refunding', 'refund']
|
||||
|
||||
function isShowOrder(item) {
|
||||
if (!item.status) {
|
||||
return false
|
||||
}
|
||||
return item.isMyself && canShowOrderStatus.includes(item.status)
|
||||
}
|
||||
|
||||
|
||||
const imgs = {
|
||||
bg: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/1/d21f2dfd7bec44618f2d5e4b88372b08.png',
|
||||
@@ -251,18 +417,20 @@
|
||||
show: false,
|
||||
item: null
|
||||
});
|
||||
const showOrder = ref(true)
|
||||
const showDesc = ref(true)
|
||||
|
||||
const number = ref(1)
|
||||
|
||||
import {
|
||||
BigNumber
|
||||
} from "bignumber.js";
|
||||
const totalPrice = computed(() => {
|
||||
if (!item.wareGroupPrice) {
|
||||
return 0;
|
||||
}
|
||||
return BigNumber(number.value).times(item.wareGroupPrice).toNumber()
|
||||
})
|
||||
|
||||
function toDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/userPackage/goodsDetail/goodsDetail?id=' + item.id + '&shopId=' + item.shopId
|
||||
})
|
||||
}
|
||||
|
||||
function changeNumber(step) {
|
||||
if (step === '-') {
|
||||
@@ -273,13 +441,13 @@
|
||||
return
|
||||
}
|
||||
if (step === '+') {
|
||||
if (item.wareJson.limitBuyNum == -10086) {
|
||||
if (item.packageInfo.limitBuyNum == -10086) {
|
||||
number.value++
|
||||
return
|
||||
}
|
||||
if (number.value >= item.wareJson.limitBuyNum) {
|
||||
if (number.value >= item.packageInfo.limitBuyNum) {
|
||||
return uni.showToast({
|
||||
title: '最多可购买' + item.wareJson.limitBuyNum + '份',
|
||||
title: '最多可购买' + item.packageInfo.limitBuyNum + '份',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -292,19 +460,33 @@
|
||||
popupData.show = true
|
||||
}
|
||||
|
||||
function help(item) {
|
||||
Api.help({
|
||||
orderId: item.id
|
||||
}).then(res => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '助力成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
getDetail()
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function payExchange() {
|
||||
uni.setStorageSync('group_buying_order', {
|
||||
...item,
|
||||
...item.wareJson,
|
||||
...item.packageInfo,
|
||||
shopAddress: item.shopAddress,
|
||||
shopName: item.shopName,
|
||||
number: number.value,
|
||||
id: item.wareId || '',
|
||||
originalPrice: item.wareOriginalPrice,
|
||||
groupPrice: item.wareGroupPrice,
|
||||
wareImgs: item.wareJson.wareImgs.join(','),
|
||||
groupOrderNo: item.groupOrderNo || '',
|
||||
price: nowPrice.value,
|
||||
paramId: item.id
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/groupBuying/confirm-order/confirm-order'
|
||||
url: '/userPackage/confirm-order/confirm-order'
|
||||
})
|
||||
|
||||
}
|
||||
@@ -323,7 +505,6 @@
|
||||
const topStyle = {
|
||||
backgroundImage: 'url(' + imgs.bg + ')'
|
||||
}
|
||||
const showOrder = ref(true)
|
||||
|
||||
function copyText(text) {
|
||||
uni.setClipboardData({
|
||||
@@ -347,52 +528,8 @@
|
||||
console.log(opt)
|
||||
Object.assign(query, opt)
|
||||
console.log(query)
|
||||
await storelogin.actionslogin()
|
||||
getDetail()
|
||||
|
||||
}
|
||||
const item = reactive({})
|
||||
|
||||
function getDetail() {
|
||||
Api.orderDetail(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)
|
||||
uni.cache.set('shopId', item.shopId)
|
||||
if (!item.id && item.wareGroupStatus != 'ing') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '拼团已结束',
|
||||
showCancel: false,
|
||||
success() {
|
||||
uni.redirectTo({
|
||||
url: '/groupBuying/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
onLoad(init)
|
||||
|
||||
let timer = null
|
||||
let nowTime = ref(Date.now())
|
||||
timer = setInterval(() => {
|
||||
nowTime.value = Date.now()
|
||||
}, 1000)
|
||||
|
||||
const returnTime = computed(() => {
|
||||
nowTime.value
|
||||
return getRemainingHMS(item)
|
||||
})
|
||||
|
||||
function returnNum(index) {
|
||||
return returnTime.value.split(':')[index]
|
||||
}
|
||||
|
||||
|
||||
function refund(item) {
|
||||
uni.showModal({
|
||||
@@ -419,6 +556,75 @@
|
||||
})
|
||||
}
|
||||
|
||||
function getDetail() {
|
||||
Api.orderDetail(query).then(res => {
|
||||
if(!item.id ) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '记录不存在',
|
||||
showCancel: false,
|
||||
success() {
|
||||
uni.redirectTo({
|
||||
url: '/userPackage/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
res.packageInfo = res.packageInfo;
|
||||
res.goodsImg = res.packageInfo.images[0]
|
||||
Object.assign(item, res)
|
||||
console.log('item', item)
|
||||
uni.cache.set('shopId', item.shopId)
|
||||
})
|
||||
}
|
||||
onLoad(init)
|
||||
|
||||
onShow(async () => {
|
||||
await storelogin.actionslogin()
|
||||
getDetail()
|
||||
})
|
||||
|
||||
let timer = null
|
||||
let nowTime = ref(Date.now())
|
||||
timer = setInterval(() => {
|
||||
nowTime.value = Date.now()
|
||||
}, 1000)
|
||||
|
||||
const returnTime = computed(() => {
|
||||
nowTime.value
|
||||
return getRemainingHMS(item, 'expireTime')
|
||||
})
|
||||
|
||||
function returnNum(index) {
|
||||
return returnTime.value.split(':')[index]
|
||||
}
|
||||
|
||||
|
||||
function cancel(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否取消活动?',
|
||||
showCancel: true,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
Api.cancel({
|
||||
orderId: item.id,
|
||||
}).then(res => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '取消活动成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
getDetail()
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function cancelRefund(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
@@ -452,21 +658,94 @@
|
||||
onShareAppMessage(() => {
|
||||
console.log('onShareAppMessage')
|
||||
console.log(shareItem)
|
||||
const query = `groupOrderNo=${shareItem.groupOrderNo}&shopId=${shareItem.shopId}`
|
||||
const query = `orderId=${shareItem.id}&shopId=${shareItem.shopId}`
|
||||
return wxShare({
|
||||
title: shareItem.wareJson.wareName,
|
||||
title: shareItem.packageInfo.packageName,
|
||||
imageUrl: shareItem.goodsImg,
|
||||
path: '/groupBuying/detail/index' + '?' + query,
|
||||
path: '/userPackage/order/detail' + '?' + query,
|
||||
query,
|
||||
})
|
||||
})
|
||||
|
||||
const title=computed(()=>{
|
||||
if(!item.id&&item.wareGroupStatus=='ing'){
|
||||
return '拼团特惠'
|
||||
|
||||
const title = computed(() => {
|
||||
if (!item.isMyself) {
|
||||
return '助力好友'
|
||||
}
|
||||
return '订单详情'
|
||||
})
|
||||
|
||||
|
||||
|
||||
const nowStep = computed(() => {
|
||||
let nowStepItem = null
|
||||
if (!item.packageInfo) {
|
||||
return nowStepItem
|
||||
}
|
||||
if (!item.packageInfo.tieredDiscount.length) {
|
||||
return nowStepItem
|
||||
}
|
||||
for (let i in item.packageInfo.tieredDiscount) {
|
||||
const nowItem = item.packageInfo.tieredDiscount[i]
|
||||
const nextItem = item.packageInfo.tieredDiscount[i + 1]
|
||||
if (!nextItem) {
|
||||
if (item.shareNum >= nowItem.peopleNum) {
|
||||
nowStepItem = nowItem
|
||||
}
|
||||
} else {
|
||||
if (item.shareNum >= nowItem.peopleNum && item.shareNum < nextItem.peopleNum) {
|
||||
nowStepItem = nowItem
|
||||
}
|
||||
}
|
||||
}
|
||||
return nowStepItem
|
||||
})
|
||||
|
||||
|
||||
const progressPercent = computed(() => {
|
||||
if (!item.packageInfo) {
|
||||
return 0
|
||||
}
|
||||
if (!item.packageInfo.tieredDiscount.length) {
|
||||
return 0
|
||||
}
|
||||
if (!nowStep.value) {
|
||||
return 0
|
||||
}
|
||||
const index = item.packageInfo.tieredDiscount.findIndex(v => v.peopleNum)
|
||||
if (index != -1) {
|
||||
return (index + 1) / item.packageInfo.tieredDiscount.length * 100
|
||||
}
|
||||
return 0
|
||||
})
|
||||
const nowPrice = computed(() => {
|
||||
if (!item.packageInfo) {
|
||||
return 0
|
||||
}
|
||||
if (!item.packageInfo.tieredDiscount.length) {
|
||||
return 0
|
||||
}
|
||||
return nowStep.value ? nowStep.value.price : item.packageInfo.price
|
||||
})
|
||||
|
||||
const totalPrice = computed(() => {
|
||||
if (!item.packageInfo || !item.packageInfo.price) {
|
||||
return 0;
|
||||
}
|
||||
return BigNumber(number.value).times(nowPrice.value).toNumber()
|
||||
})
|
||||
|
||||
const maxNum = computed(() => {
|
||||
if (!item.packageInfo || item.packageInfo.tieredDiscount <= 0) {
|
||||
return 0
|
||||
}
|
||||
return item.packageInfo.tieredDiscount[item.packageInfo.tieredDiscount.length - 1].peopleNum
|
||||
})
|
||||
const minPrice = computed(() => {
|
||||
if (!item.packageInfo || item.packageInfo.tieredDiscount <= 0) {
|
||||
return 0
|
||||
}
|
||||
return item.packageInfo.tieredDiscount[item.packageInfo.tieredDiscount.length - 1].price
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -516,6 +795,10 @@
|
||||
background-color: #fff;
|
||||
padding: 22rpx 24rpx;
|
||||
|
||||
.main-color {
|
||||
color: #EB532A;
|
||||
}
|
||||
|
||||
.pin {
|
||||
width: 60rpx;
|
||||
height: 38rpx;
|
||||
@@ -534,7 +817,7 @@
|
||||
}
|
||||
|
||||
.old-price {
|
||||
color: #666666;
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
@@ -644,8 +927,8 @@
|
||||
|
||||
.btns {
|
||||
position: fixed;
|
||||
left: 87rpx;
|
||||
right: 87rpx;
|
||||
left: 28rpx;
|
||||
right: 28rpx;
|
||||
bottom: 0;
|
||||
padding-bottom: 60rpx;
|
||||
display: flex;
|
||||
@@ -697,6 +980,7 @@
|
||||
background: #FFF4E2;
|
||||
font-weight: 700;
|
||||
margin-bottom: 32rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
@@ -767,4 +1051,70 @@
|
||||
font-size: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 32rpx 46rpx;
|
||||
background-color: #fff;
|
||||
margin-top: 32rpx;
|
||||
|
||||
.name {
|
||||
font-weight: 700;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.table {
|
||||
border: 2rpx solid #EDEDED;
|
||||
border-radius: 8rpx;
|
||||
margin: 0 52rpx;
|
||||
|
||||
.header {
|
||||
background: #f8f8f88f;
|
||||
}
|
||||
|
||||
.row {
|
||||
border-top: 2rpx solid #EDEDED;
|
||||
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rotate {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
|
||||
.progress-box {
|
||||
background: rgba(255, 209, 191, 0.52);
|
||||
$height: 10rpx;
|
||||
height: $height;
|
||||
border-radius: $height;
|
||||
|
||||
.progress {
|
||||
height: $height;
|
||||
background: #EB532A;
|
||||
transition: all 0.3s;
|
||||
border-radius: $height;
|
||||
}
|
||||
}
|
||||
|
||||
.img-box {
|
||||
position: relative;
|
||||
|
||||
.tag {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 16rpx 0;
|
||||
background: #4C2828;
|
||||
color: #faeac6;
|
||||
font-size: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.share-text {
|
||||
color: #ED5A2E;
|
||||
}
|
||||
</style>
|
||||
BIN
userPackage/static/image/copy.png
Normal file
BIN
userPackage/static/image/copy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -5,9 +5,9 @@ import dayjs from "dayjs"
|
||||
* @param {Object} item - 包含groupEndTime的订单/拼团对象
|
||||
* @returns {number} 剩余时间(毫秒)
|
||||
*/
|
||||
function returnRemainingTime(item) {
|
||||
if (!item?.groupEndTime) return 0; // 容错:无结束时间则返回0
|
||||
return dayjs(item.groupEndTime).valueOf() - dayjs().valueOf();
|
||||
function returnRemainingTime(item,key) {
|
||||
if(!item[key]) return 0; // 容错:无结束时间则返回0
|
||||
return dayjs(item[key]).valueOf() - dayjs().valueOf();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ timer = setInterval(() => {
|
||||
}, 1000)
|
||||
|
||||
// 组合使用:获取格式化后的剩余时间
|
||||
export function getRemainingHMS(item) {
|
||||
const ms = returnRemainingTime(item);
|
||||
export function getRemainingHMS(item,key='groupEndTime') {
|
||||
const ms = returnRemainingTime(item,key);
|
||||
return formatTimeToHMS(ms);
|
||||
}
|
||||
Reference in New Issue
Block a user