From aef4ec3a145617e5fa2f922437da58ca3ceba0d5 Mon Sep 17 00:00:00 2001 From: Wik-T <812952667@qq.com> Date: Sun, 21 Nov 2021 21:29:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AF=B9=E6=8E=A5=E4=BC=98=E9=80=89=E5=95=86?= =?UTF-8?q?=E5=93=81=E4=B8=8B=E5=8D=95=202.=E6=96=B0=E5=A2=9E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E4=BC=98=E9=80=89=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 6 +- Utils/Api.js | 24 +- pages/goods/coupon-details/coupon-details.vue | 21 +- pages/goods/goods-list/goods-list.vue | 593 ++++++++++-------- pages/goods/goods.vue | 46 +- pages/goods/store-list/store-list.vue | 38 +- pages/order/confirmation.vue | 26 +- pages/tabBar/home/home.vue | 3 +- pages/user/order_details/order_details.vue | 132 +++- .../brand-classification.vue | 70 ++- subPages/preferred-goods/preferred-goods.vue | 74 ++- 11 files changed, 666 insertions(+), 367 deletions(-) diff --git a/App.vue b/App.vue index 7a477d6..ae6b2f8 100644 --- a/App.vue +++ b/App.vue @@ -26,7 +26,11 @@ latitude : '', balancePrice : '', balanceCardNo:'', - identificationCode:'' + identificationCode:'', + //门店ID + storeid:'', + //门店名字 + storename:'' }, onLaunch: function() { }, diff --git a/Utils/Api.js b/Utils/Api.js index 87c9c63..9bf983c 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -43,7 +43,7 @@ export const WXlogin = params => { export const OpenidGetUser = (openId, params) => { return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data); }; -//获取卡券列表 +//获取卡券,优选列表 export const getCouponList = params => { return POST('GET', `${base}/coupon/getCouponList`, params).then(res => res.data); }; @@ -58,7 +58,27 @@ export const getMerchantStoreById = params => { //根据门店ID 获取卡券 export const getCouponListByStoreId = params => { return POST('GET', `${base}/coupon/getCouponListByStoreId`, params).then(res => res.data); -} +} +//获取优选商品分类 +export const getListGoodsType = params => { + return POST('GET', `${base}/highGoodsType/getListGoodsType`, params).then(res => res.data); +} +//获取优选商品品牌列表 +export const getBrandByList = params => { + return POST('GET', `${base}/highBrand/getBrandByList`, params).then(res => res.data); +} +// 优选商品列表 +export const getBrandCouponList = params => { + return POST('GET', `${base}/coupon/getCouponList`, params).then(res => res.data); +} +//优选商品详情 +export const getPreByOrderIdId = params => { + return POST('GET', `${base}/orderPre/getPreByOrderIdId`, params).then(res => res.data); +} +//优选商品预约完成 +export const orderComplete = params => { + return POST('POST', `${base}/orderPre/orderComplete`, params).then(res => res.data); +} //卡券详情 export const getCouponById = params => { return POST('GET', `${base}/coupon/getCouponById`, params).then(res => res.data); diff --git a/pages/goods/coupon-details/coupon-details.vue b/pages/goods/coupon-details/coupon-details.vue index 08e9a7a..004f21e 100644 --- a/pages/goods/coupon-details/coupon-details.vue +++ b/pages/goods/coupon-details/coupon-details.vue @@ -28,25 +28,6 @@ :show-back-btn="true" > - - @@ -54,7 +35,7 @@ - {{couponDesInfo.couponCodeInfo.codeKey}} + {{couponDesInfo.couponCodeInfo.codeKey}} diff --git a/pages/goods/goods-list/goods-list.vue b/pages/goods/goods-list/goods-list.vue index e06335b..49aad80 100644 --- a/pages/goods/goods-list/goods-list.vue +++ b/pages/goods/goods-list/goods-list.vue @@ -1,130 +1,178 @@ - - - - - diff --git a/pages/goods/goods.vue b/pages/goods/goods.vue index e45aed8..808bf7f 100644 --- a/pages/goods/goods.vue +++ b/pages/goods/goods.vue @@ -38,8 +38,7 @@ - + {{goodsData[0].discountPrice *100}} 门市参考价: + + + + 点击去选择门店 + + {{storeName}} + + + 赠送卡券 @@ -89,7 +97,7 @@ {{ product.highCouponModel.couponName }} - 有效期至:201-05-15 22:59:59(待改) + 有效期至:{{product.highCouponModel.salesEndTime | formatDate('-')}} ¥{{ product.highCouponModel.discountPrice}} - + {{ product.highCouponModel.discountPrice*100}} - + {{ product.highCouponModel.salesPrice*100}} @@ -157,7 +163,9 @@ //商品描述html desid: '', imageUrl: app.globalData.imgUrl, - user: '' + user: '', + storeId: '', // 门店id + storeName: '' //门店名字 }; }, filters: { @@ -181,13 +189,20 @@ onLoad(option) { this.desid = option.id; this.user = app.globalData.userInfo; - this.getCouponById(); + this.getCouponById(); + app.globalData.storeid = ''; + app.globalData.storename = ''; // #ifdef MP //小程序隐藏返回按钮 this.showBack = false; // #endif //option为object类型,会序列化上个页面传递的参数 }, + onShow() { + this.storeId = app.globalData.storeid; + this.storeName = app.globalData.storename; + }, + onReady() { // this.calcAnchor(); //计算锚点高度,页面数据是ajax加载时,请把此行放在数据渲染完成事件中执行以保证高度计算正确 }, @@ -322,12 +337,19 @@ }, buy() { let that = this; - if(this.goodsData[0].stockCount == 0 && this.goodsData[0].couponSource !=4){ + if (this.goodsData[0].stockCount == 0 && this.goodsData[0].couponSource != 4) { uni.showToast({ title: '库存不足', icon: "none" }); return; + } + if(this.goodsData[0].reserveStatus && this.storeName == ''){ + uni.showToast({ + title: '请选择门店', + icon: "none" + }); + return; } uni.showToast({ title: '提交订单...', @@ -443,7 +465,7 @@ page { background-color: #f8f8f8; } - + button::after { border: none } @@ -695,8 +717,10 @@ .swiper-box { position: relative; width: 100%; + swiper { width: 100%; + swiper-item { image { width: 100%; diff --git a/pages/goods/store-list/store-list.vue b/pages/goods/store-list/store-list.vue index bbfe505..c123040 100644 --- a/pages/goods/store-list/store-list.vue +++ b/pages/goods/store-list/store-list.vue @@ -6,15 +6,15 @@ - + {{goods.storeName}} - 在线加油 + {{goods.operatorName}} {{goods.address}} - + @@ -48,7 +48,7 @@ this.getStoreListByCoupon(); }, onReachBottom() { - // this.getStoreListByCoupon(); + this.getStoreListByCoupon(); }, methods: { /** @@ -63,23 +63,25 @@ this.loadingText = '到底了'; return false; } - // let pagenum = this.pageNum; + let pagenum = this.pageNum; let params = { couponId: this.storeId, longitude: app.globalData.longitude, - latitude: app.globalData.latitude + latitude: app.globalData.latitude, + pageNum: pagenum, + pageSize: this.pageSize, } getStoreListByCoupon(params).then(res => { + uni.hideLoading(); if (res.return_code == '000000') { - this.storeList = res.return_data - setTimeout(function() { - uni.hideLoading(); - }, 2000); - // this.isNoMoreData = res.return_data.length == this.pageSize ? false : true; - // this.pageNum = res.return_data.length == this.pageSize ? ++pagenum : pagenum; - // this.storeList = this.storeList.concat(res.return_data); + this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; + this.storeList = this.storeList.concat(res.return_data.list); + if (res.return_data.total == (this.pageNum * this.pageSize)) { + this.isNoMoreData = true; + } + this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; } else { - uni.hideLoading() + this.storeList = []; } }) }, @@ -98,8 +100,12 @@ * 跳转门店详情 */ jumpdetails(e) { - uni.navigateTo({ - url: './store-details?id=' + e + // uni.navigateTo({ + // url: './store-details?id=' + e + // }) + app.globalData.storeid = e.id; + app.globalData.storename = e.storeName; + uni.navigateBack({ }) } } diff --git a/pages/order/confirmation.vue b/pages/order/confirmation.vue index cd46324..05831d4 100644 --- a/pages/order/confirmation.vue +++ b/pages/order/confirmation.vue @@ -205,7 +205,7 @@ orderId: '', jumpType: '', tongCardPrice: 0, - + storeId:'' }; }, @@ -399,14 +399,18 @@ } uni.showLoading({ title: '提交订单中...' - }) + }) + if(this.couponList.reserveStatus){ + this.storeId = app.globalData.storeid + } let goods = { "memDiscountId": this.memDiscountId, "identificationCode": app.globalData.identificationCode, "highChildOrderList": [{ "goodsType": 1, "goodsId": this.couponId, - "saleCount": 1 + "saleCount": 1, + "storeId": this.storeId }] } addOrder(goods).then(res => { @@ -475,7 +479,9 @@ uni.hideLoading(); uni.showToast({ title: '支付成功' - }) + }) + app.globalData.storeid = ''; + app.globalData.storename = ''; uni.reLaunch({ url: '../pay/success/success?id=' + that.couponId }); @@ -562,7 +568,9 @@ if (res.return_code == '000000') { uni.showToast({ title: '支付成功' - }) + }) + app.globalData.storeid = ''; + app.globalData.storename = ''; uni.reLaunch({ url: '../pay/success/success?id=' + this.couponId }); @@ -592,7 +600,9 @@ if (res.return_code == '000000') { uni.showToast({ title: '支付成功' - }) + }) + app.globalData.storeid = ''; + app.globalData.storename = ''; uni.reLaunch({ url: '../pay/success/success?id=' + this.couponId }); @@ -644,7 +654,9 @@ // 支付成功后的回调函数 uni.showToast({ title: '支付成功' - }) + }) + app.globalData.storeid = ''; + app.globalData.storename = ''; if (that.jumpType == 4) { uni.reLaunch({ url: '/pages/tabBar/user/user' diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index d5e26d8..8a968fa 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -675,8 +675,7 @@ } if (item.title == '电影票') { uni.navigateTo({ - // url: '/pages/tabBar/order/order?id=2' - url: '../../../subPages/preferred-goods/preferred-goods' + url: '/pages/tabBar/order/order?id=2' }) return; } diff --git a/pages/user/order_details/order_details.vue b/pages/user/order_details/order_details.vue index 2d9f7ae..a7a7900 100644 --- a/pages/user/order_details/order_details.vue +++ b/pages/user/order_details/order_details.vue @@ -189,7 +189,78 @@ - + + 预约订单详情 + + + + 预约状态 : + + + 预约中 + + + 预约成功 + + + 预约完成 + + + 预约失败 + + + 预约取消 + + + + + 预约订单号 : + + + {{preByOrderInfo.preOrderNo}} + + + + + 到店地点 : + + + {{preByOrderInfo.reachAddress}} + + + + + 到店时间 : + + + {{preByOrderInfo.reachTime | formatDate('-')}} + + + + + 预约失败说明 : + + + {{preByOrderInfo.statusFailDesc}} + + + + + 预约取消说明 : + + + {{preByOrderInfo.statusCancelDesc}} + + + + + + + + 预约完成 + + + @@ -211,7 +282,9 @@ @@ -74,8 +111,9 @@ } } } + .preimg { - width: 120px; + width: 120px; height: 80px; }