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

@@ -1,9 +1,9 @@
import store from '../store/index';
export default {
// qq 237524947 wx15d4269d3210863d
// BASEURI: 'http://192.168.3.9:8083/api/',
BASEURI: 'http://192.168.3.9:8083/api/',
// BASEURI: 'http://mall.yyundong.com/portalapi/api/',
BASEURI: 'http://192.168.3.116:8083/api/',
// BASEURI: 'http://192.168.3.116:8083/api/',
ADMINURI: 'http://mall.yyundong.com/adminapi/',
ESURI: 'http://www.yyundong.com:8081/',
h5Appid: 'wxb4660f37187c0b8e', // h5微信登录的appId 暂时测试用

View File

@@ -2,16 +2,32 @@
<view class="coupon-item">
<view class="coupon-money">
<view class="nick">{{item.name}}</view>
<view class="layof" :style="{color:theme}">{{item.amount}}</view>
<view class="end_time">{{item.endTime | formatCreateTime}}前使用</view>
<view>
<view class="demand">{{ item.minPoint }} {{ item.amount }}</view>
<view style="display: flex;flex-direction: row;
align-items: center; margin-top: 10px;">
<view class="layof" :style="{color:theme}">{{item.amount}}</view>
<view style="display: flex;flex-direction: column;flex: 1;" >
<view style="display: flex;flex-direction: row;">
<view class="demand">{{ item.minPoint }}{{ item.amount }}</view>
<view class="demand" style="margin-left: 5px;" >(限领{{item.perLimit}})</view>
</view>
<view>
<view class="end_time">有效期至{{item.endTime | formatCreateTime}}</view>
</view>
</view>
</view>
</view>
<view class="get-btn" :style="{color:color, borderColor:color, background:solid}" @click="acceptCoupon(item)">
立即领取</view>
<!-- <navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
:url='item.url' @click="useCoupon(item)">立即使用</navigator> -->
</view>
</template>
@@ -54,21 +70,21 @@
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
return formatDate(date, 'yyyy-MM-dd')
},
},
computed: {
...mapState(['hasLogin','hasVip', 'userInfo']),
...mapState(['hasLogin', 'hasVip', 'userInfo']),
},
methods: {
async acceptCoupon(item) {
if (this.hasLogin) {
if(this.hasVip){
if (this.hasVip) {
this.types = !this.types
uni.showLoading({
title: '请稍后'
});
let params = {
couponId: item.id
};
@@ -78,22 +94,22 @@
if (data) {
// this.$api.msg(data);
this.clickSubMethod(item)
}
uni.hideLoading();
}else{
} else {
uni.showModal({
title: '提示',
content: '您不属于惠农会员,暂不能领取此优惠券',
showCancel:false,
showCancel: false,
success: function(res) {
if (res.confirm) {
return;
}
}
}
});
}
} else {
uni.navigateTo({
url: '/pages/public/login'
@@ -115,63 +131,62 @@
<style lang='scss'>
.coupon-item {
width: 100%;
margin-left: 10px;
margin-right: 10px;
height: auto;
display: table;
display: flex;
border-radius: 10upx;
padding: 0 20upx;
margin-top: 22upx;
border: 1px solid #eeeeee;
position: relative;
background: -webkit-linear-gradient(left, hsla(134, 66%, 66%, 0.5), hsla(53, 98%, 50%, 0.5), tomato) no-repeat;
.coupon-money {
width: 465upx;
padding: 15px;
width: 520upx;
height: auto;
display: table;
float: left;
padding: 26upx 0;
display: flex;
flex-direction: column;
border-style: none dotted none none;
border-color: #eeeeee;
.nick {
width: 100%;
height: 50upx;
overflow: hidden;
/*溢出的部分隐藏*/
white-space: nowrap;
/*文本不换行*/
text-overflow: ellipsis;
/*ellipsis:文本溢出显示省略号(...clip不显示省略标记...),而是简单的裁切*/
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
color: #ffaa00;
font-size: 20px;
}
.tit {
/* .tit {
width: 100%;
height: 50upx;
line-height: 50upx;
font-size: $font-sm;
color: $font-color-999;
}
*/
.demand {
width: 100%;
height: 30upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
color: #DF5423;
}
.layof {
width: 100%;
height: 48upx;
line-height: 30upx;
font-size: 44upx;
color: #ff9000;
font-weight: bold;
margin-right: 20px;
}
.end_time {
width: 100%;
height: 30upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
color: #E24451;
}
}
@@ -196,7 +211,7 @@
width: 40upx;
height: 20upx;
position: absolute;
left: 460upx;
left: 500upx;
top: -1px;
border-radius: 0 0 40upx 40upx;
content: "";
@@ -210,7 +225,7 @@
width: 40upx;
height: 20upx;
position: absolute;
left: 460upx;
left: 500upx;
bottom: -1px;
border-radius: 40upx 40upx 0 0;
content: "";

View File

@@ -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;

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 {