2023-3-18

This commit is contained in:
2023-03-18 17:08:47 +08:00
parent b9ee4510db
commit a1abdfe8a7
8 changed files with 1128 additions and 94 deletions

View File

@@ -28,9 +28,11 @@
</navigator>
<view class="goods-section">
<view class="g-header b-b">
<text class="name" v-if="groupActivity">团购-{{groupActivity.name}}</text>
</view>
<!-- <image class="logo"
src="http://yjlive160322.oss-cn-beijing.aliyuncs.com/mall/images/20190807/QQ%E5%9B%BE%E7%89%8720190807191952.jpg">
</image>
<text class="name"> {{ cartPromotionItemList.length }}件商品</text>
<text class="name" v-if="groupActivity">团购-{{groupActivity.name}}</text> -->
<!-- 商品列表 -->
<view class="g-item" v-for="(item, index) in cartPromotionItemList" :key="index">
<image :src="item.productPic"></image>
@@ -66,8 +68,8 @@
<text class="cell-tip active">选择优惠券</text>
<text class="cell-more wanjia wanjia-gengduo-d"></text>
</view>
<view class="yt-list-cell b-b" v-if="coupon">
<text class="cell-tit clamp">商家促销</text>
<view class="yt-list-cell b-b" v-if="couponList.length > 0">
<text class="cell-tit clamp">{{coupon.name}}</text>
<view class="cell-tip hb" v-if="coupon.minPoint">{{coupon.minPoint}}{{coupon.amount}}</view>
<text class="cell-tip disabled" v-if="!coupon">暂无可用优惠</text>
</view>
@@ -78,14 +80,14 @@
<text class="cell-tit clamp">商品金额</text>
<text class="cell-tip">{{ calcAmount.totalAmount }}</text>
</view>
<view class="yt-list-cell b-b" v-if="groupActivity">
<!-- <view class="yt-list-cell b-b" v-if="groupActivity">
<text class="cell-tit clamp">活动金额</text>
<text class="cell-tip">{{ groupActivity.price }}</text>
</view>
<view class="yt-list-cell b-b" v-if="calcAmount.promotionAmount>0">
<text class="cell-tit clamp">优惠金额</text>
<text class="cell-tip red">-{{ calcAmount.promotionAmount }}</text>
</view>
</view> -->
<view class="yt-list-cell b-b" v-if="coupon.amount>0">
<text class="cell-tit clamp">优惠券抵扣</text>
<text class="cell-tip red">-{{ coupon.amount }}</text>
@@ -270,11 +272,13 @@
}
}
/* if (!data || !data.cartPromotionItemList){
uni.switchTab({
url: '/pages/index/index'
});
} */
// if (!data || !data.cartPromotionItemList){
// uni.switchTab({
// url: '/pages/index/index'
// });
// }
this.cartPromotionItemList = data.cartPromotionItemList
console.log('cartPromotionItemList' + this.cartPromotionItemList);
/* this.memberIntegration=data.memberIntegration; */
this.basicGiftsList = data.basicGiftsList;
@@ -303,6 +307,11 @@
}
console.log("优惠券", data.couponHistoryDetailList);
this.couponList = data.couponHistoryDetailList;
if (this.couponList.length > 0) {
this.coupon = this.couponList[0].coupon
}
this.memberReceiveAddressList = data.memberReceiveAddressListaddress;
},
@@ -542,6 +551,7 @@
.g-item {
display: flex;
padding-top: 15px;
margin: 20upx 30upx;
image {
@@ -573,7 +583,7 @@
align-items: center;
font-size: 32upx;
color: $font-color-dark;
padding-top: 10upx;
padding-top: 25upx;
.price {
margin-bottom: 4upx;
@@ -582,7 +592,7 @@
.number {
font-size: 26upx;
color: $font-color-base;
margin-left: 20upx;
margin-left: 30upx;
}
}

View File

@@ -9,8 +9,7 @@
<text class="name">{{ addressData.name }}</text>
<text class="mobile">{{ addressData.phoneNumber }}</text>
</view>
<text
class="address">{{ addressData.region }}-{{ addressData.detailAddress }}</text>
<text class="address">{{ addressData.region }}-{{ addressData.detailAddress }}</text>
</view>
<view class="cen" v-else>
<text>请设置收货地址</text>
@@ -29,13 +28,13 @@
</navigator>
<view class="goods-section" v-for="(item1, index1) in confirmOrderResultList" :key="index1">
<view class="g-header b-b">
<!-- <view class="g-header b-b">
<image class="logo"
src="http://yjlive160322.oss-cn-beijing.aliyuncs.com/mall/images/20190807/QQ%E5%9B%BE%E7%89%8720190807191952.jpg">
</image>
<text class="name"> {{ item1.cartPromotionItemList.length }}件商品,店铺 {{item1.storeName }}</text>
<text class="name"> {{ item1.cartPromotionItemList.length }}件商品</text>
<text class="name" v-if="groupActivity">团购-{{groupActivity.name}}</text>
</view>
</view> -->
<!-- 商品列表 -->
<view class="g-item" v-for="(item, index) in item1.cartPromotionItemList" :key="index">
<image :src="item.productPic"></image>
@@ -48,6 +47,21 @@
</view>
</view>
</view>
<!-- 优惠明细 -->
<view class="yt-list">
<view class="yt-list-cell b-b" v-if="couponList.length > 0" @click="toggleMask('show')">
<view class="cell-icon"></view>
<text class="cell-tit clamp">优惠券</text>
<text class="cell-tip active">选择优惠券</text>
<text class="cell-more wanjia wanjia-gengduo-d"></text>
</view>
<view class="yt-list-cell b-b">
<text class="cell-tit clamp">{{coupon.name}}</text>
<view class="cell-tip hb" v-if="coupon.minPoint">{{coupon.minPoint}}{{coupon.amount}}</view>
<text class="cell-tip disabled" v-if="!coupon">暂无可用优惠</text>
</view>
</view>
<!-- 金额明细 -->
<view class="yt-list">
<view class="yt-list-cell b-b">
@@ -60,6 +74,10 @@
<text class="cell-tip red">-{{ item1.calcAmount.promotionAmount }}</text>
</view>
<view class="yt-list-cell b-b" v-if="coupon.amount>0">
<text class="cell-tit clamp">优惠券抵扣</text>
<text class="cell-tip red">-{{ coupon.amount }}</text>
</view>
<!-- <view class="yt-list-cell b-b" v-if="memberIntegration>0">
<text class="cell-tit clamp">积分抵扣</text>
<text class="cell-tip red">-{{ memberIntegration }}</text>
@@ -84,18 +102,45 @@
<view class="price-content">
<text>实付款</text>
<text class="price-tip"></text>
<text class="price">{{ totalPayAmount }}</text>
<text class="price">{{ (totalPayAmount-coupon.amount) | numFilter}}</text>
</view>
<text class="submit" @click="submit">提交订单</text>
</view>
<!-- 优惠券面板 -->
<view class="mask" :class="maskState === 0 ? 'none' : maskState === 1 ? 'show' : ''" @click="toggleMask">
<view class="mask-content" @click.stop.prevent="stopPrevent">
<!-- 优惠券页面仿mt -->
<view class="coupon-item" v-if="couponList.length > 0" v-for="(item, index) in couponList" :key="index">
<view class="con" @click="selectCoupon(item)">
<view class="left">
<text class="title">{{ item.coupon.name }}</text>
<text class="time">有效期至{{item.coupon.endTime | formatCreateTime}}</text>
</view>
<view class="right">
<text class="price">{{ item.coupon.amount }}</text>
<text>{{item.coupon.minPoint}}可用</text>
</view>
<view class="circle l"></view>
<view class="circle r"></view>
</view>
<text class="tips">限新用户使用</text>
</view>
</view>
</view>
</view>
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import {
formatDate
} from '@/common/date';
import {
mapState
} from 'vuex';
@@ -207,6 +252,9 @@
}
}
console.log("data>>>>>", data);
this.totalPayAmount = data.totalPayAmount;
/* this.memberIntegration=data.memberIntegration; */
this.basicGiftsList = data.basicGiftsList;
@@ -234,13 +282,30 @@
this.addressId = this.addressData.id;
}
this.couponList = data.couponHistoryDetailList;
console.log("优惠券", data.confirmOrderResultList[0].couponHistoryDetailList);
this.couponList = data.confirmOrderResultList[0].couponHistoryDetailList;
if (this.couponList.length > 0) {
this.coupon = this.couponList[0].coupon
}
this.memberReceiveAddressList = data.memberReceiveAddressListaddress;
},
computed: {
...mapState(['hasLogin', 'userInfo'])
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
numFilter(value) {
// 截取当前数据到小数点后两位
let realVal = parseFloat(value).toFixed(2)
return realVal
}
},
methods: {
getSource() {
let source = Api.source;
@@ -439,7 +504,7 @@
.goods-section {
margin-top: 16upx;
background: #fff;
padding-bottom: 1px;
padding-bottom: 150px;
.g-header {
display: flex;
@@ -726,6 +791,7 @@
display: flex;
flex-direction: column;
margin: 20upx 24upx;
padding-top: 15px;
background: #fff;
.con {