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 bc0cf09..61b8009 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 => { @@ -141,3 +142,15 @@ export const getALLCategory = params => { export const getStoreProduct = params => { return POST('GET', `${base}/storeProductCategory/getStoreProduct`, 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); +} + 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.json b/pages.json index 0cd4be8..9a22b1f 100644 --- a/pages.json +++ b/pages.json @@ -705,6 +705,11 @@ "enablePullDownRefresh": false } + },{ + "path":"groupBuyingConfiguration/groupVerifyOrder/groupVerifyOrder", + "style": { + "navigationBarTitleText": "核销订单" + } } ] 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 f1a6f52..91c110d 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -16,10 +16,12 @@ } }, onLoad(options) { + uni.reLaunch({ url: '../tabBar/home/home' }) return + let that = this; /* @@ -101,11 +103,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 076e1af..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}} 操作 @@ -40,11 +40,11 @@ 价格 - {{productDetail.price}} + {{productDetail.price}}元 原价 - {{productDetail.originalPrice}} + {{productDetail.originalPrice}}元 限制 @@ -52,7 +52,7 @@ 状态 - {{productDetail.status | filterStatus}} + {{productDetail.status | filterStatus}} 使用时间 @@ -60,7 +60,7 @@ 有效期 - {{productDetail.validity}} + {{productDetail.validity.replace(',',"至")}} 图片 @@ -288,6 +288,7 @@ .titleWidth { width: 80px; text-align: center; + align-self: stretch; } .minheight40 { diff --git a/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue b/subpackages/groupBuyingConfiguration/groupProduct/groupProductAdd.vue index dfd6598..e4301d7 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 @@ - @@ -77,7 +85,7 @@ {{item2.productName}} - {{item2.count}}份 + {{item2.productSpec}} @@ -100,9 +108,11 @@ - 上一步 + + 上一步 + @@ -177,7 +187,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 +230,15 @@ return true }, isShowAdd() { - return true }, - + validity(){ + if(this.startdate&&this.enddate){ + return this.startdate+','+this.enddate + }else{ + return ''; + } + } }, onLoad(option) { @@ -248,6 +266,7 @@ this.findGroupServeRuleByGroup();//查询产品规则 } + console.log(option, "=======") }, components: { @@ -255,6 +274,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 +343,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" @@ -298,6 +376,7 @@ return true }, clickToSave() { + if (this.merchart == 1) { /* 第一步:团购基本内容*/ if (!this.validate()) return; //校验是否有空 @@ -311,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){ @@ -339,6 +421,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(","); @@ -360,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, @@ -374,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/groupVerify/groupVerify.vue b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue index 3201a0d..c144f29 100644 --- a/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue +++ b/subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue @@ -1,22 +1,265 @@ - \ No newline at end of file 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/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/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 diff --git a/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue b/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue index a9c1aa5..beb6e57 100644 --- a/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue +++ b/subpackages/groupBuyingConfiguration/storeProduct/storeProductAdd.vue @@ -14,7 +14,8 @@ class=" flex-1 " placeholder="请输入价格(保留两位小数)"> - 规格: + + 规格: