From c3839f37ef25141d17a2f6e8935fedf140f8fc8d Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Thu, 16 Nov 2023 13:51:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=9B=A2=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=A0=B8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 + Utils/groupBuying.js | 13 +- .../groupVerify/groupVerify.vue | 266 +++++++++++++++++- 3 files changed, 268 insertions(+), 13 deletions(-) diff --git a/App.vue b/App.vue index 22be895..82a2902 100644 --- a/App.vue +++ b/App.vue @@ -7,10 +7,12 @@ // url: 'https://pay.dctpay.com/crest', // imgUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com', // redirectUrl:'https://pay.dctpay.com/cweb', + // hsgUrl:'https://hsg.dctpay.com', //测试 url: 'https://gratia-pay.dctpay.com/crest', imgUrl: 'https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com', redirectUrl:'https://gratia-pay.dctpay.com/cweb', + hsgUrl:'https://hsgcs.dctpay.com', userInfo: "", openId: '', h5code: '', diff --git a/Utils/groupBuying.js b/Utils/groupBuying.js index 8bf9cea..430efa2 100644 --- a/Utils/groupBuying.js +++ b/Utils/groupBuying.js @@ -3,7 +3,8 @@ import { } from './Request.js'; let app = getApp(); let base = app.globalData.url; - +let hsgCrest = app.globalData.hsgUrl+'/crest'; +let hsgOrder = app.globalData.hsgUrl+'/order'; //新增门店图片 export const insertStoreImg = params => { @@ -105,4 +106,14 @@ export const editStoreExtMsg = params => { //查询门店扩展信息 export const findStoreExtMsgByStoreId = params => { return POST('POST', `${base}/storeGroup/findStoreExtMsgByStoreId`, params).then(res => res.data); +} + +//查询获取团购内容code +export const getGroupContentByCode = params => { + return POST('GET', `${hsgCrest}/group/getGroupContentByCode`, params).then(res => res.data); +} + +//核销团购码 +export const gorOrderNotify = params => { + return POST('GET', `${hsgOrder}/groupOrder/gorOrderNotify`, params).then(res => res.data); } \ No newline at end of file diff --git a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue index 3201a0d..9cb453a 100644 --- a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue +++ b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue @@ -1,22 +1,264 @@ - \ No newline at end of file From 432f7667f50fcd4fe0b1739193cfbc628609cdf8 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Fri, 17 Nov 2023 16:14:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=9B=A2=E8=B4=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utils/groupBuying.js | 2 +- pages.json | 6 + .../merchant-details/merchant-details.vue | 2 +- pages/tabBar/home/home.vue | 4 + pages/welcome/welcome.vue | 8 +- .../groupProduct/groupProduct.vue | 6 +- .../groupProduct/groupProductAdd.vue | 98 +++- .../groupVerify/groupVerify.vue | 3 +- .../groupVerifyOrder/groupVerifyOrder.vue | 436 ++++++++++++++++++ .../storeMessage/storeMessage.vue | 21 +- 10 files changed, 562 insertions(+), 24 deletions(-) create mode 100644 subpackages/groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder.vue diff --git a/Utils/groupBuying.js b/Utils/groupBuying.js index 430efa2..9c8f3ef 100644 --- a/Utils/groupBuying.js +++ b/Utils/groupBuying.js @@ -105,7 +105,7 @@ export const editStoreExtMsg = params => { //查询门店扩展信息 export const findStoreExtMsgByStoreId = params => { - return POST('POST', `${base}/storeGroup/findStoreExtMsgByStoreId`, params).then(res => res.data); + return POST('GET', `${base}/storeGroup/findStoreExtMsgByStoreId`, params).then(res => res.data); } //查询获取团购内容code diff --git a/pages.json b/pages.json index 8314c87..a24c944 100644 --- a/pages.json +++ b/pages.json @@ -698,6 +698,12 @@ "navigationBarTitleText": "核销订单", "enablePullDownRefresh": false } + },{ + "path":"groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder", + "style": { + "navigationBarTitleText": "核销订单" + } + } ] diff --git a/pages/index/merchant-details/merchant-details.vue b/pages/index/merchant-details/merchant-details.vue index cbaa166..9939fa0 100644 --- a/pages/index/merchant-details/merchant-details.vue +++ b/pages/index/merchant-details/merchant-details.vue @@ -93,7 +93,7 @@ - + diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index db39bcb..638f462 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -156,6 +156,10 @@ title: '设备申请', url: '../../index/serviceApplicationList/serviceApplicationList', img: '../../../static/img/apply.png' + },{ + title: '核销订单', + url: '/subpackages/groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder', + img: '/static/img/apply.png' } ] return; diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index bfad874..a18fb9d 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -16,10 +16,10 @@ } }, onLoad(options) { - // uni.reLaunch({ - // url: '../tabBar/home/home' - // }) - // return + uni.reLaunch({ + url: '/pages/login/login' + }) + return let that = this; /* diff --git a/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue b/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue index 076e1af..5a9bad7 100644 --- a/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue +++ b/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue @@ -40,11 +40,11 @@ 价格 - {{productDetail.price}} + {{productDetail.price}}元 原价 - {{productDetail.originalPrice}} + {{productDetail.originalPrice}}元 限制 @@ -60,7 +60,7 @@ 有效期 - {{productDetail.validity}} + {{productDetail.validity.replace(',',"至")}} 图片 diff --git a/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue b/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue index dfd6598..f386425 100644 --- a/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue +++ b/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue @@ -37,11 +37,20 @@ - - 有效期: + + 有效时间: + + + + {{startdate?startdate:'请选择开始时间'}} + + + + {{enddate?enddate:'请选择结束时间'}} + - + 团购限制: @@ -64,7 +73,6 @@ - @@ -177,7 +185,10 @@ const app = getApp(); export default { data() { + const currentDate = this.getDate() return { + startdate: '', + enddate: '', reqUrl: app.globalData.url, //请求地址 imgUrl: app.globalData.imgUrl, //图片访问地址 status: '', //1.新增 2.编辑 @@ -217,10 +228,15 @@ return true }, isShowAdd() { - return true }, - + validity(){ + if(this.startdate&&this.enddate){ + return this.startdate+','+this.enddate + }else{ + return ''; + } + } }, onLoad(option) { @@ -248,6 +264,7 @@ this.findGroupServeRuleByGroup();//查询产品规则 } + console.log(option, "=======") }, components: { @@ -255,6 +272,56 @@ wybPopup }, methods: { + getDate(type) { + const date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + + if (type === 'start') { + year = year - 60; + } else if (type === 'end') { + year = year + 2; + } + month = month > 9 ? month : '0' + month;; + day = day > 9 ? day : '0' + day; + return `${year}-${month}-${day}`; + }, + //选择时间 + bindDateChange(e) { + if(this.enddate){ + if((new Date(this.enddate)).getTime()<(new Date(e.target.value)).getTime()){ + uni.showToast({ + icon:'none', + title:"开始时间不能大于结束时间", + duration:2000, + }) + this.startdate = ""; + return + } + + } + this.startdate = e.target.value; + + }, + bindDateChange1(e) { + + + if(this.startdate){ + if((new Date(this.startdate)).getTime()>(new Date(e.target.value)).getTime()){ + uni.showToast({ + icon:'none', + title:"开始时间不能大于结束时间", + duration:2000, + }) + this.enddate = ""; + return + } + + } + this.enddate = e.target.value; + + }, validate() { var reg = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2}$)/; if (!reg.test(this.productData.price) || this.productData.price == 0) { @@ -274,10 +341,19 @@ return false } - - + + if(!this.validity){ + uni.showToast({ + title: "请选择有效时间", + icon: "none" + }) + this.startdate = ""; + this.enddate = ""; + return false + } + this.productData.validity = this.validity; if (!this.productData.name || !this.productData.price || !this.productData.originalPrice || !this.productData.astrict || !this.productData - .serviceTime || !this.productData.validity) { + .serviceTime) { uni.showToast({ title: "请填写完整哦!", icon: "none" @@ -339,6 +415,8 @@ this.productData.img = res.return_data.img; this.productData.serviceTime = res.return_data.serviceTime; this.productData.validity = res.return_data.validity; + this.startdate = this.productData.validity.split(",")[0]; + this.enddate = this.productData.validity.split(",")[1]; this.productData.originalPrice = res.return_data.originalPrice; this.imgValue = this.productData.img.split(","); diff --git a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue index 9cb453a..4690802 100644 --- a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue +++ b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue @@ -159,7 +159,8 @@ mask:true, }) let params={ - groupCode:this.groupCode + groupCode:this.groupCode, + storeId:app.globalData.userInfo.store.id } gorOrderNotify(params).then(res=>{ uni.hideLoading(); diff --git a/subpackages/groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder.vue b/subpackages/groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder.vue new file mode 100644 index 0000000..88963ae --- /dev/null +++ b/subpackages/groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder.vue @@ -0,0 +1,436 @@ + + + + + \ No newline at end of file diff --git a/subpackages/groupBuyingConfiguration/storeMessage/storeMessage.vue b/subpackages/groupBuyingConfiguration/storeMessage/storeMessage.vue index 4d73c59..5fe4f15 100644 --- a/subpackages/groupBuyingConfiguration/storeMessage/storeMessage.vue +++ b/subpackages/groupBuyingConfiguration/storeMessage/storeMessage.vue @@ -15,18 +15,27 @@ placeholder-class="font15" :maxlength="999"> - 门店标签: + + 门店标签: + + (用'#'隔开)例如:可电话预订#可吸烟 + + placeholder="请输入门店标签" placeholder-class="font15" :maxlength="999"> - 门店关键词: + + 门店关键词: + + (用'#'隔开)例如:火锅#川菜 + + + placeholder="请输入门店关键词" placeholder-class="font15" :maxlength="999"> @@ -148,4 +157,8 @@ line-height: 50px; } } + + .group-title{ + width:80px; + } \ No newline at end of file From d464e329460aadfaf2ad53215d862c03ea6c76c5 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Fri, 17 Nov 2023 17:03:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=9B=A2=E8=B4=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/welcome/welcome.vue | 11 +++++++---- .../groupVerify/groupVerify.vue | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index a18fb9d..943825f 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -16,10 +16,13 @@ } }, onLoad(options) { - uni.reLaunch({ - url: '/pages/login/login' - }) - return + + + // uni.reLaunch({ + // // url: '/pages/login/login', + // url: '/subpackages/groupBuyingConfiguration/groupVerify/groupVerify?orderKey='+2925678915731387, + // }) + // return let that = this; /* diff --git a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue index 4690802..9f442e5 100644 --- a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue +++ b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue @@ -21,7 +21,7 @@ 限制 - {{detailData.astrict}} + {{detailData.astrict}} @@ -76,7 +76,7 @@ - {{detailData.validity || ''}} + {{detailData.validity.replace(',','至') || ''}} From 89a7fa337c129b289d24278c953c971266f30017 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Mon, 20 Nov 2023 13:51:50 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=9B=A2=E8=B4=AD=E6=A0=B8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groupProduct/groupProduct.vue | 1 + .../groupBuyingConfiguration/groupVerify/groupVerify.vue | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue b/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue index 5a9bad7..7fd031d 100644 --- a/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue +++ b/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue @@ -288,6 +288,7 @@ .titleWidth { width: 80px; text-align: center; + align-self: stretch; } .minheight40 { diff --git a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue index 9f442e5..c144f29 100644 --- a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue +++ b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue @@ -166,13 +166,13 @@ uni.hideLoading(); if (res.return_code == '000000') { uni.showToast({ - title: "核销成功", + title:res.return_data, icon: 'none', duration: 2000 }) - setTimeout(()=>{ - uni.navigateBack(); - },1000) + // setTimeout(()=>{ + // uni.navigateBack(); + // },1000) } else { uni.showToast({ From 094c46e7625dbb58cd4748517059a3fab8074806 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Wed, 22 Nov 2023 11:10:47 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=9B=A2=E8=B4=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/evan-steps/evan-step.vue | 5 +-- pages/welcome/welcome.vue | 11 +++++-- .../groupProduct/groupProduct.vue | 4 +-- .../groupProduct/groupProductAdd.vue | 32 +++++++++++-------- .../storeImg/storeImgAdd.vue | 18 ++++++++--- .../storeProduct/storeProductAdd.vue | 3 +- 6 files changed, 47 insertions(+), 26 deletions(-) diff --git a/components/evan-steps/evan-step.vue b/components/evan-steps/evan-step.vue index 172a7a2..c33e8ab 100644 --- a/components/evan-steps/evan-step.vue +++ b/components/evan-steps/evan-step.vue @@ -347,11 +347,11 @@ position: absolute; height: 30px; top: 0; - left: 30px; + left: 50%; /* #ifdef APP-NVUE */ right: -39px; /* #endif */ - padding: 0 0px 0 40px; + padding:0; /* #ifndef APP-NVUE */ display: flex; width: 100%; @@ -390,6 +390,7 @@ .evan-step__circle--horizontal { margin-left: 0px; + z-index: 1; } .evan-step__circle--finish {} diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index 943825f..9ae40c3 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -19,8 +19,8 @@ // uni.reLaunch({ - // // url: '/pages/login/login', - // url: '/subpackages/groupBuyingConfiguration/groupVerify/groupVerify?orderKey='+2925678915731387, + // url: '/pages/login/login', + // // url: '/subpackages/groupBuyingConfiguration/groupVerify/groupVerify?orderKey='+'4576027622249814', // }) // return @@ -104,11 +104,16 @@ // 0001扫码核销https://gratia-pay.dctpay.com/cweb?accountId=0001&key=123 if (app.globalData.accountId == '0001' && app.globalData.h5code){ let orderKey = uni.getStorageSync("urlKey"); - if(orderKey){ + if(orderKey&&this.userInfo.store.id){ uni.redirectTo({ url: '/subpackages/groupBuyingConfiguration/groupVerify/groupVerify?orderKey='+orderKey, }) return false; + }else{ + uni.redirectTo({ + url: '/pages/login/login' + }) + return false; } } return true; diff --git a/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue b/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue index 7fd031d..b22d910 100644 --- a/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue +++ b/subpackages/groupBuyingConfiguration/groupProduct/groupProduct.vue @@ -20,7 +20,7 @@ {{item.name}} {{item.price}} - {{item.status | filterStatus}} + {{item.status | filterStatus}} 操作 @@ -52,7 +52,7 @@ 状态 - {{productDetail.status | filterStatus}} + {{productDetail.status | filterStatus}} 使用时间 diff --git a/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue b/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue index f386425..e4301d7 100644 --- a/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue +++ b/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue @@ -85,7 +85,7 @@ {{item2.productName}} - {{item2.count}}份 + {{item2.productSpec}} @@ -108,9 +108,11 @@ - 上一步 + + 上一步 + @@ -374,6 +376,7 @@ return true }, clickToSave() { + if (this.merchart == 1) { /* 第一步:团购基本内容*/ if (!this.validate()) return; //校验是否有空 @@ -387,7 +390,10 @@ return } } - if(this.merchart == 2){} + if(this.merchart == 2){ + this.merchart = this.merchart+1; + return + } if(this.merchart==3){/* 第三步规则内容 */ if(!this.ruleData.content){ @@ -438,7 +444,7 @@ this.groupId = res.return_data.id; this.productDetail.groupId = res.return_data.id; this.ruleData.groupId = res.return_data.id; - this.merchart = 2; + this.merchart = this.merchart+1; } else { uni.showToast({ title: res.return_msg, @@ -452,17 +458,17 @@ /* 修改配置团购基本内容*/ editGroupContent() { editGroupContent(this.productData).then(res => { - let title; + if (res.return_code == '000000') { - title = res.return_data; + this.merchart = this.merchart+1; } else { - title = res.return_msg; + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) } - uni.showToast({ - title: title, - icon: 'none', - duration: 2000 - }) + this.merchart = 2; }) }, diff --git a/subpackages/groupBuyingConfiguration/storeImg/storeImgAdd.vue b/subpackages/groupBuyingConfiguration/storeImg/storeImgAdd.vue index fc77a5b..6b25430 100644 --- a/subpackages/groupBuyingConfiguration/storeImg/storeImgAdd.vue +++ b/subpackages/groupBuyingConfiguration/storeImg/storeImgAdd.vue @@ -68,11 +68,12 @@ return true }, isShowAdd(){ - if(this.imgValue.length>=1){ - return false - }else{ - return true - } + // if(this.imgValue.length>=1){ + // return false + // }else{ + // return true + // } + return true; }, }, @@ -167,6 +168,9 @@ //上传 uploadFile(imgURL) { const that = this; + uni.showLoading({ + title:'加载中...' + }) uni.uploadFile({ url: that.reqUrl + '/fileUpload/uploadfile', filePath: imgURL, @@ -175,8 +179,12 @@ }, name: 'files', success: function(uploadFileRes) { + uni.hideLoading(); that.getImgSignedUrl(JSON.parse(uploadFileRes.data) .return_data); + }, + fail: function() { + uni.hideLoading(); } }); }, diff --git a/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue b/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue index d010ded..9d7179a 100644 --- a/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue +++ b/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue @@ -14,7 +14,8 @@ class=" flex-1 " placeholder="请输入价格(保留两位小数)"> - 规格: + + 规格: