套餐问题修复
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user