2023-3-18
This commit is contained in:
@@ -20,11 +20,13 @@
|
||||
</view>
|
||||
<!-- 分类 -->
|
||||
<view class="cate-section">
|
||||
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005001')">
|
||||
<view class="cate-item"
|
||||
@click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005001')">
|
||||
<image src="/static/nywz_icon.png"></image>
|
||||
<text>农业物资</text>
|
||||
</view>
|
||||
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005000')">
|
||||
<view class="cate-item"
|
||||
@click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005000')">
|
||||
<image src="/static/shwz_icon.png"></image>
|
||||
<text>生活物资</text>
|
||||
</view>
|
||||
@@ -112,7 +114,15 @@
|
||||
</view> -->
|
||||
|
||||
<!-- 优惠券 https://s.click.taobao.com/OPh3c1w -->
|
||||
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000" ref="SubComponent"
|
||||
<view v-if='couponList && couponList.length>0' class="f-header m-t" @click="allAcceptCoupon">
|
||||
<image src="/static/youhuiquan.png"></image>
|
||||
<view class="tit-box">
|
||||
<text class="tit">有可领取优惠券</text>
|
||||
</view>
|
||||
<text class="get-btn">全部领取</text>
|
||||
</view>
|
||||
|
||||
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#EB331E" ref="SubComponent"
|
||||
@callParentMethod="callParentMethod"></coupon>
|
||||
|
||||
<!-- 团购楼层
|
||||
@@ -269,6 +279,7 @@
|
||||
} from 'vuex';
|
||||
import navBar from '@/components/zhouWei-navBar';
|
||||
import uniLoadMore from '@/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue';
|
||||
import index from '@/store/index.js';
|
||||
export default {
|
||||
components: {
|
||||
coupon,
|
||||
@@ -315,6 +326,7 @@
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh();
|
||||
}, 2000);
|
||||
|
||||
},
|
||||
onShareAppMessage() {},
|
||||
onLoad(ops) {
|
||||
@@ -361,7 +373,7 @@
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo']),
|
||||
...mapState(['hasLogin', 'hasVip', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
clickParentMethod() {
|
||||
@@ -390,7 +402,47 @@
|
||||
});
|
||||
this.getCouponList();
|
||||
},
|
||||
async allAcceptCoupon() {
|
||||
if (this.hasLogin) {
|
||||
if (this.hasVip) {
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = {
|
||||
// couponId: item.id
|
||||
};
|
||||
// this.clickSubMethod(item)
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
console.log("data?????", data);
|
||||
if (data) {
|
||||
// this.$api.msg(data);
|
||||
this.couponList = [];
|
||||
uni.showLoading({
|
||||
title: '领取成功'
|
||||
});
|
||||
this.getCouponList();
|
||||
}
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您不属于惠农会员,暂不能领取此优惠券',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
});
|
||||
}
|
||||
},
|
||||
async sysInfoMethod() {
|
||||
let params = {};
|
||||
// let list = this.$db.get('sysInfo')
|
||||
@@ -503,14 +555,14 @@
|
||||
pageSize: 4,
|
||||
productCategoryId: "",
|
||||
type: 1,
|
||||
newStatus:1,
|
||||
newStatus: 1,
|
||||
productAttributeCategoryId: ""
|
||||
};
|
||||
let groupHotGoodsList = await Api.apiCall('get', Api.goods.goodsList, params);
|
||||
if (groupHotGoodsList) {
|
||||
this.homeNewProductList = groupHotGoodsList.records;
|
||||
}
|
||||
console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
|
||||
},
|
||||
/**
|
||||
@@ -522,7 +574,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
pageSize: 4,
|
||||
productCategoryId: "",
|
||||
type: 1,
|
||||
recommandStatus:1,
|
||||
recommandStatus: 1,
|
||||
productAttributeCategoryId: ""
|
||||
};;
|
||||
let groupHotGoodsList = await Api.apiCall('get', Api.goods.goodsList, params);
|
||||
@@ -562,7 +614,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
*/
|
||||
async getCouponList() {
|
||||
let params = {
|
||||
pageSize: 3
|
||||
// pageSize: 3
|
||||
};
|
||||
let data = await Api.apiCall('get', Api.index.selectNotRecive, params);
|
||||
if (data) {
|
||||
@@ -769,21 +821,21 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
url: `../../pagesA/product/product?id=${id}`
|
||||
});
|
||||
},
|
||||
async acceptCoupon(item) {
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
// async acceptCoupon(item) {
|
||||
// uni.showLoading({
|
||||
// title: '请稍后'
|
||||
// });
|
||||
|
||||
let params = {
|
||||
couponId: item.id
|
||||
};
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.$api.msg(data);
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
// let params = {
|
||||
// couponId: item.id
|
||||
// };
|
||||
// let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
// console.log(data);
|
||||
// if (data) {
|
||||
// this.$api.msg(data);
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// },
|
||||
navToSkillDetailPage(item) {
|
||||
//测试数据没有写id,用title代替
|
||||
let id = item.id;
|
||||
@@ -1099,7 +1151,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.m-price {
|
||||
font-size: 16px;
|
||||
color: $font-color-light;
|
||||
@@ -1111,7 +1163,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
.f-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 140upx;
|
||||
height: 110upx;
|
||||
padding: 0upx 20upx;
|
||||
background: #fff;
|
||||
|
||||
@@ -1139,6 +1191,22 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.get-btn {
|
||||
width: 146upx;
|
||||
height: 52upx;
|
||||
line-height: 50upx;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 36upx;
|
||||
margin-top: -53upx;
|
||||
text-align: center;
|
||||
border-radius: 60upx;
|
||||
color: #ff9000;
|
||||
border: 1px solid #ff9000;
|
||||
font-size: $font-sm;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.icon-you {
|
||||
font-size: $font-lg + 2upx;
|
||||
color: $font-color-light;
|
||||
@@ -1202,12 +1270,13 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.m-price {
|
||||
font-size: 16px;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.pro-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1273,12 +1342,13 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.m-price {
|
||||
font-size: 16px;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.coupon_box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user