mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 07:29:48 +08:00
uniapp【修复】: 拼团订单分享按钮后续逻辑不通
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 积分兑换价格 -->
|
<!-- 积分兑换价格 -->
|
||||||
<Point :flex="true" :data="props.goodsDetailData?.product" fontSize="24rpx"></Point>
|
<Point v-if="!props.isActivityGoods" :flex="true" :data="props.goodsDetailData?.product" fontSize="24rpx"></Point>
|
||||||
|
|
||||||
<view class="name-box" v-if="props.goodsDetailData?.name || props.goodsDetailData?.brief">
|
<view class="name-box" v-if="props.goodsDetailData?.name || props.goodsDetailData?.brief">
|
||||||
<view class="name">{{ props.goodsDetailData?.name }}</view>
|
<view class="name">{{ props.goodsDetailData?.name }}</view>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<lpainterText :text="'截止:' + state.shareData.endTime"
|
<lpainterText :text="'截止:' + state.shareData.endTime"
|
||||||
css="color: #212121; background: #ffb400; padding:8rpx 20rpx;border-radius:12rpx" />
|
css="color: #212121; background: #ffb400; padding:8rpx 20rpx;border-radius:12rpx" />
|
||||||
</lpainterView>
|
</lpainterView>
|
||||||
<lpainterView css="margin-top: 30rpx; font-size: 26rpx; color: #8c5400">
|
<lpainterView css="width: 570rpx;margin-top: 30rpx; font-size: 26rpx; color: #8c5400">
|
||||||
<lpainterText :text="state.shareData.brief"
|
<lpainterText :text="state.shareData.brief"
|
||||||
css=" background: #fff4d9; padding:8rpx 20rpx; border-radius:12rpx" />
|
css=" background: #fff4d9; padding:8rpx 20rpx; border-radius:12rpx" />
|
||||||
</lpainterView>
|
</lpainterView>
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
if (state.shareType == ShareEnum.goods) {
|
if (state.shareType == ShareEnum.goods) {
|
||||||
/** 获取商品详情 */
|
/** 获取商品详情 */
|
||||||
getGoodsDetail(query)
|
getGoodsDetail(query)
|
||||||
} else if (state.shareType == ShareEnum.pinTuan || state.shareType === ShareEnum.addPinTuan) {
|
} else if (state.shareType == ShareEnum.pinTuan || state.shareType == ShareEnum.addPinTuan) {
|
||||||
/** 获取活动拼团详情 */
|
/** 获取活动拼团详情 */
|
||||||
getActivityPinTuan(query);
|
getActivityPinTuan(query);
|
||||||
} else if (state.shareType == ShareEnum.serviceGoods) {
|
} else if (state.shareType == ShareEnum.serviceGoods) {
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
state.shareData.mktprice = goodsDetail.data?.mktprice;
|
state.shareData.mktprice = goodsDetail.data?.mktprice;
|
||||||
|
|
||||||
state.shareData.showPinTuanArguments = true;
|
state.shareData.showPinTuanArguments = true;
|
||||||
state.shareData.endTime = goodsDetail.data?.groupEndTime;
|
state.shareData.endTime = goodsDetail.data?.pinTuanRule?.endTime;
|
||||||
state.shareData.peopleNumber = goodsDetail.data?.pinTuanRule?.peopleNumber;
|
state.shareData.peopleNumber = goodsDetail.data?.pinTuanRule?.peopleNumber;
|
||||||
} else {
|
} else {
|
||||||
handleShowToast(goodsDetail.msg, 'none', () => {
|
handleShowToast(goodsDetail.msg, 'none', () => {
|
||||||
|
|||||||
@@ -86,3 +86,80 @@
|
|||||||
background-color: #d33123;
|
background-color: #d33123;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.pinTuan-popup-box{
|
||||||
|
padding: 40rpx;
|
||||||
|
.time-title{
|
||||||
|
font-size: 27rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 5rpx;
|
||||||
|
}
|
||||||
|
.time{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.teams-box{
|
||||||
|
margin-top: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
.img-box{
|
||||||
|
position: relative;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.tit{
|
||||||
|
position: absolute;
|
||||||
|
top: -5rpx;
|
||||||
|
left: -10rpx;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: #d33123;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 22rpx;
|
||||||
|
z-index: 98;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
-webkit-transform: scale(0.8);
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
.img{
|
||||||
|
display: block;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border: 1px solid #d33123;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.need-peo{
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
border: 1px dashed #e1e1e1;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.tit{
|
||||||
|
margin: auto;
|
||||||
|
color: #d1d1d1;
|
||||||
|
font-size: 27rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.peo-box{
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
.peo{
|
||||||
|
color: #d33123;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn-box{
|
||||||
|
margin: 40rpx auto 0;
|
||||||
|
background-color: #d33123;
|
||||||
|
font-size: 27rpx;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
justify-content: center;
|
||||||
|
width: 400rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
<view class="tit">单独购买</view>
|
<view class="tit">单独购买</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn buy" @click="handleMultipleBuy">
|
<view class="btn buy" @click="handleMultipleBuy()">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="num">¥{{ state.goodsDetailData.pinTuanPrice }}</view>
|
<view class="num">¥{{ state.goodsDetailData.pinTuanPrice }}</view>
|
||||||
<view class="tit">发起拼团</view>
|
<view class="tit">发起拼团</view>
|
||||||
@@ -66,6 +66,31 @@
|
|||||||
:isShowAddCartBtn="false" :buyNowNowloading="loading" @handleChangePopup="handleChangePopup"
|
:isShowAddCartBtn="false" :buyNowNowloading="loading" @handleChangePopup="handleChangePopup"
|
||||||
@handleBuyNow="handleBuyNow" :btnBuyTitlt="state.btnBuyTitlt">
|
@handleBuyNow="handleBuyNow" :btnBuyTitlt="state.btnBuyTitlt">
|
||||||
</GoodsDetailSkuPopup>
|
</GoodsDetailSkuPopup>
|
||||||
|
|
||||||
|
<!-- 分享进来的参与拼团弹框 -->
|
||||||
|
<uv-popup ref="pinTuanPopup" mode="bottom" :closeable="true">
|
||||||
|
<view class="pinTuan-popup-box">
|
||||||
|
<view class="time-title">剩余时间:</view>
|
||||||
|
<view class="time">
|
||||||
|
<uv-count-down :time="state.teamInfo.lastTime * 1000" :autoStart="true" :millisecond="true" format="DD天HH时mm分ss秒"></uv-count-down>
|
||||||
|
</view>
|
||||||
|
<view class="teams-box">
|
||||||
|
<view class="img-box" v-for="item,index in state.teamInfo.teams" :key="index">
|
||||||
|
<text class="tit" v-if="item.recordId == item.teamId">拼主</text>
|
||||||
|
<image class="img" :src="item.userAvatar"></image>
|
||||||
|
</view>
|
||||||
|
<view class="need-peo" v-if="state.teamInfo?.teamNums" v-for="item in state.teamInfo?.teamNums" :key="item">
|
||||||
|
<text class="tit">?</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="peo-box">
|
||||||
|
还差 <text class="peo">{{ state.teamInfo?.teamNums || '' }}</text> 人,赶快拼单吧
|
||||||
|
</view>
|
||||||
|
<view class="btn-box" @click="handleJoinGroupBuy">
|
||||||
|
参与拼团
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uv-popup>
|
||||||
</view>
|
</view>
|
||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
@@ -97,6 +122,9 @@
|
|||||||
/** 获取购物车数据 */
|
/** 获取购物车数据 */
|
||||||
const cartStore = useCartStore();
|
const cartStore = useCartStore();
|
||||||
|
|
||||||
|
/** 分享进来的参与拼团弹框 */
|
||||||
|
const pinTuanPopup = ref();
|
||||||
|
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
id : number;
|
id : number;
|
||||||
goodsDetailData : any,
|
goodsDetailData : any,
|
||||||
@@ -201,6 +229,7 @@
|
|||||||
const teamInfo : Response<any> = await queryOrderPinTuanTeamInfo({ teamId, });
|
const teamInfo : Response<any> = await queryOrderPinTuanTeamInfo({ teamId, });
|
||||||
if (teamInfo.status) {
|
if (teamInfo.status) {
|
||||||
state.teamInfo = teamInfo?.data;
|
state.teamInfo = teamInfo?.data;
|
||||||
|
pinTuanPopup.value.open();
|
||||||
} else {
|
} else {
|
||||||
handleShowToast(teamInfo.msg)
|
handleShowToast(teamInfo.msg)
|
||||||
}
|
}
|
||||||
@@ -222,21 +251,32 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 拼团购买 */
|
/** 拼团购买统一调用 */
|
||||||
const handleMultipleBuy = () => {
|
const handlePinTuan = (title?:string)=>{
|
||||||
_useLoginStore.checkLogin(() => {
|
_useLoginStore.checkLogin(() => {
|
||||||
state.teamId = 0;
|
|
||||||
state.showSku = true;
|
state.showSku = true;
|
||||||
state.isSingleBuy = false;
|
state.isSingleBuy = false;
|
||||||
state.btnBuyTitlt = '发起拼团';
|
state.btnBuyTitlt = title || '发起拼团';
|
||||||
state.goodsDetailData.skuList.sku_list = state.activitySkuList;
|
state.goodsDetailData.skuList.sku_list = state.activitySkuList;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 去拼单 */
|
/** 弹框中的按钮参与拼团购买 */
|
||||||
|
const handleJoinGroupBuy = ()=>{
|
||||||
|
pinTuanPopup.value.close();
|
||||||
|
handlePinTuan('参与拼团');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 拼团购买 */
|
||||||
|
const handleMultipleBuy = () => {
|
||||||
|
state.teamId = 0;
|
||||||
|
handlePinTuan()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 去拼单购买 */
|
||||||
const handleSplicingOrders = (teamId : number) => {
|
const handleSplicingOrders = (teamId : number) => {
|
||||||
state.teamId = teamId;
|
state.teamId = teamId;
|
||||||
handleMultipleBuy();
|
handlePinTuan('去拼单');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 关闭sku弹框 */
|
/** 关闭sku弹框 */
|
||||||
|
|||||||
@@ -99,10 +99,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad, onShareAppMessage, onShareTimeline, onPullDownRefresh } from '@dcloudio/uni-app';
|
import { onLoad, onShareAppMessage, onShareTimeline, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import { querySolitaireDetail, queryShare, queryAddCart, queryRemoveCart } from '@/core/api';
|
import { querySolitaireDetail, queryAddCart, queryRemoveCart } from '@/core/api';
|
||||||
import { ShareClientEnum, ShareModelEnum, ShareEnum, EmptyEnum, PaymentTypeEnum, AddCartEnum } from '@/core/enum';
|
import { ShareClientEnum, ShareModelEnum, ShareEnum, EmptyEnum, PaymentTypeEnum, AddCartEnum } from '@/core/enum';
|
||||||
import type { Response } from '@/core/models';
|
import type { Response } from '@/core/models';
|
||||||
import { UserToken, shareUrl } from '@/core/consts'
|
import { shareUrl } from '@/core/consts'
|
||||||
import { useShopConfigStore, useLoginStore } from '@/core/store';
|
import { useShopConfigStore, useLoginStore } from '@/core/store';
|
||||||
import { handleShowToast, handleRouteNavigateTo, getShareUrl } from '@/core/utils';
|
import { handleShowToast, handleRouteNavigateTo, getShareUrl } from '@/core/utils';
|
||||||
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
|
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="share-box">
|
<view class="share-box">
|
||||||
<uv-button type="success" size="small">
|
<uv-button type="success" size="small" @click="handleInviteFriends">
|
||||||
<uv-icon name="share" color="#fff" labelColor="#fff" label="立即邀请好友拼单" labelSize="14px"
|
<uv-icon name="share" color="#fff" labelColor="#fff" label="立即邀请好友拼单" labelSize="14px"
|
||||||
labelPos="right" size="18"></uv-icon>
|
labelPos="right" size="18"></uv-icon>
|
||||||
</uv-button>
|
</uv-button>
|
||||||
@@ -351,19 +351,26 @@
|
|||||||
text="联系客服"></uv-button>
|
text="联系客服"></uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 分享弹框 -->
|
||||||
|
<CoreshopShare :show="state.showShare" :shareType="ShareEnum.addPinTuan"
|
||||||
|
:goodsDetailData="state.shareDetailData" @handleClosePopup="handleToggleShowShare"></CoreshopShare>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</coreshop-page>
|
</coreshop-page>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad ,onShareAppMessage,onShareTimeline} from '@dcloudio/uni-app';
|
||||||
import { queryOrderDetails, queryOrderPinTuanTeamInfo, queryCheckInvoice, queryOrderConfirm, queryOrderShippingList, queryCancelOrder } from '@/core/api';
|
import { queryOrderDetails, queryOrderPinTuanTeamInfo, queryCheckInvoice, queryOrderConfirm, queryOrderShippingList, queryCancelOrder } from '@/core/api';
|
||||||
import type { Response } from '@/core/models';
|
import type { Response } from '@/core/models';
|
||||||
import { handleShowToast, handleRouteNavigateTo } from '@/core/utils';
|
import { handleShowToast, handleRouteNavigateTo, getShareUrl } from '@/core/utils';
|
||||||
import { OrderStatusEnum, OrderPayStatusEnum, PayMethodCodeEnum, OrderShipStatusEnum, ShowInvoiceEnum, OrderConfirmStatusEnum, PinTuanStatusEnum, OrderAllStatusTypeEnum } from '@/core/enum';
|
import { OrderStatusEnum, OrderPayStatusEnum, ShareEnum, ShareClientEnum, ShareModelEnum, PayMethodCodeEnum, OrderShipStatusEnum, ShowInvoiceEnum, OrderConfirmStatusEnum, PinTuanStatusEnum, OrderAllStatusTypeEnum } from '@/core/enum';
|
||||||
import { useShopConfigStore } from '@/core/store';
|
import { useShopConfigStore } from '@/core/store';
|
||||||
|
import { shareUrl } from '@/core/consts';
|
||||||
import GoodsDetailRecommend from '@/pages/components/goods-detail/components/goods-detail-recommend/goods-detail-recommend.vue';
|
import GoodsDetailRecommend from '@/pages/components/goods-detail/components/goods-detail-recommend/goods-detail-recommend.vue';
|
||||||
import uQRCode from '@/core/utils/uqrcode.js';
|
import uQRCode from '@/core/utils/uqrcode.js';
|
||||||
|
import CoreshopShare from '@/components/coreshop-share/coreshop-share.vue';
|
||||||
|
|
||||||
interface QueryParams {
|
interface QueryParams {
|
||||||
orderId : string;
|
orderId : string;
|
||||||
@@ -384,6 +391,9 @@
|
|||||||
deliveryInfo : any;
|
deliveryInfo : any;
|
||||||
pickupCode : string;
|
pickupCode : string;
|
||||||
codeSrc : string;
|
codeSrc : string;
|
||||||
|
showShare : boolean;
|
||||||
|
shareUrl:string;
|
||||||
|
shareDetailData:any;
|
||||||
}>({
|
}>({
|
||||||
orderDetail: {},
|
orderDetail: {},
|
||||||
orderId: '',
|
orderId: '',
|
||||||
@@ -393,6 +403,9 @@
|
|||||||
deliveryInfo: {},
|
deliveryInfo: {},
|
||||||
pickupCode: "",
|
pickupCode: "",
|
||||||
codeSrc: "",
|
codeSrc: "",
|
||||||
|
showShare: false,
|
||||||
|
shareUrl:"",
|
||||||
|
shareDetailData:{},
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad((query : QueryParams) => {
|
onLoad((query : QueryParams) => {
|
||||||
@@ -481,6 +494,12 @@
|
|||||||
const teamInfo : Response<any> = await queryOrderPinTuanTeamInfo({ orderId, });
|
const teamInfo : Response<any> = await queryOrderPinTuanTeamInfo({ orderId, });
|
||||||
if (teamInfo.status) {
|
if (teamInfo.status) {
|
||||||
state.teamInfo = teamInfo?.data;
|
state.teamInfo = teamInfo?.data;
|
||||||
|
state.shareDetailData = {
|
||||||
|
pinTuanRule:{id:teamInfo?.data?.ruleId},
|
||||||
|
id:state.orderDetail?.items[0]?.goodsId,
|
||||||
|
teamId:teamInfo?.data?.teamId,
|
||||||
|
groupId:teamInfo?.data?.ruleId
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
handleShowToast(teamInfo.msg)
|
handleShowToast(teamInfo.msg)
|
||||||
}
|
}
|
||||||
@@ -663,6 +682,44 @@
|
|||||||
handleShowToast(checkInvoice.msg)
|
handleShowToast(checkInvoice.msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 邀请好友拼单 */
|
||||||
|
const handleInviteFriends = async () => {
|
||||||
|
/** 获取分享url */
|
||||||
|
state.shareUrl = await getShareUrl({
|
||||||
|
client: ShareClientEnum.wxMiNiProgram,
|
||||||
|
url: shareUrl,
|
||||||
|
type: ShareModelEnum.url,
|
||||||
|
page: ShareEnum.addPinTuan,
|
||||||
|
params: {
|
||||||
|
goodsId: state.orderDetail?.items[0]?.goodsId,
|
||||||
|
teamId:state.teamInfo.teamId,
|
||||||
|
groupId:state.teamInfo.ruleId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
state.showShare = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 分享弹框显示与否 */
|
||||||
|
const handleToggleShowShare = () => {
|
||||||
|
state.showShare = !state.showShare;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 分享 */
|
||||||
|
onShareAppMessage(() => {
|
||||||
|
return {
|
||||||
|
title: state.orderDetail?.items[0]?.name,
|
||||||
|
imageUrl: state.orderDetail?.items[0]?.imageUrl,
|
||||||
|
path: state.shareUrl
|
||||||
|
}
|
||||||
|
});
|
||||||
|
onShareTimeline(() => {
|
||||||
|
return {
|
||||||
|
title: state.orderDetail?.items[0]?.name,
|
||||||
|
imageUrl: state.orderDetail?.items[0]?.imageUrl,
|
||||||
|
path: state.shareUrl
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './detail.scss';
|
@import './detail.scss';
|
||||||
|
|||||||
Reference in New Issue
Block a user