From 2aa6e1de7380c3fec3bd496e2138ce2424891402 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Tue, 14 Oct 2025 15:12:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BA=97=E9=93=BA=E5=8C=85=E9=82=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/request.js | 8 +- subPackages/order/cartOrder.vue | 6 +- subPackages/techan/cartOrder.vue | 61 +++++++++++--- subPackages/techan/cartOrder1.vue | 62 +++++++++++---- subPackages/techan/detail.vue | 5 +- subPackages/techan/order.vue | 58 +++++++++++--- subPackages/user/rewardsCenter.vue | 123 +++++++++++++++++++++++++++++ 7 files changed, 278 insertions(+), 45 deletions(-) create mode 100644 subPackages/user/rewardsCenter.vue diff --git a/static/js/request.js b/static/js/request.js index cfb2213..39bf379 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -3,10 +3,10 @@ import store from '@/store'; // 定义 API URL // const DEV_API_URL = 'https://api.cloud.sz-trip.com'; -const DEV_API_URL = 'https://api.sutenong.com' -const PROD_API_URL = 'https://api.sutenong.com'; -// const DEV_API_URL = 'https://swsz.api.js-dyyj.com'; -// const PROD_API_URL = 'https://swsz.api.js-dyyj.com'; +// const DEV_API_URL = 'https://api.sutenong.com' +// const PROD_API_URL = 'https://api.sutenong.com'; +const DEV_API_URL = 'https://swsz.api.js-dyyj.com'; +const PROD_API_URL = 'https://swsz.api.js-dyyj.com'; const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL; // 获取token diff --git a/subPackages/order/cartOrder.vue b/subPackages/order/cartOrder.vue index e310039..0f63543 100644 --- a/subPackages/order/cartOrder.vue +++ b/subPackages/order/cartOrder.vue @@ -86,7 +86,11 @@ 运费: - ¥{{item.post/100}} + + {{item.postPrice/100}} + ¥{{item.post/100}} + 收货人信息: diff --git a/subPackages/techan/cartOrder.vue b/subPackages/techan/cartOrder.vue index 7408480..7d2d1d0 100644 --- a/subPackages/techan/cartOrder.vue +++ b/subPackages/techan/cartOrder.vue @@ -117,7 +117,9 @@ 运费 - {{!info.post?'免邮':info.post/100}} + {{info.postPrice/100}} + {{!info.post?'免邮':info.post/100}} @@ -403,25 +405,56 @@ export default { }) let param = [] + let consignee_id = null tempList.forEach(v=>{ - param.push({sku_id: v.sInfo.id, num: v.sInfo.buyNum, consignee_id:v.contacts.id}) + // param.push({sku_id: v.sInfo.id, num: v.sInfo.buyNum, consignee_id:v.contacts.id}) + param.push({ + type: v.pInfo.type, + product_id: v.pInfo.id, + sku_id: v.sInfo.id, + product_num: v.sInfo.buyNum, + use_type: 1, + post: v.contacts.id, + consignee_id: v.contacts.id, + }) + consignee_id = v.contacts.id }) - let data = JSON.stringify(param); + // 店铺满减前 // console.log(data); - this.flag = false; + // this.flag = false; - Promise.all(param.map(v=>_this.Post({...v},"/api/order/get_post_price"))).then(res=>{ - if (res) { - console.log("promise" ,res) - for(let i=0;i_this.Post({...v},"/api/order/get_post_price"))).then(res=>{ + // if (res) { + // console.log("promise" ,res) + // for(let i=0;i{this.flag = true;}) + // } + // }).finally(()=>{this.flag = true;}) + + // 店铺满减后 + if (consignee_id && param.length>0) { + let data = { + product_list: param, + consignee_id:consignee_id + }; + this.Post({ + method: 'POST', + data: JSON.stringify(data), + consignee_id:consignee_id + },"/api/order/get_post_price_new").then(res=>{ + let resData = res.data || [] + resData.forEach((x,i) => { + tempList[i].post = x.price - x.discount_price + tempList[i].postPrice = x.price + tempList[i].postDiscount = x.discount_price + }) + this.$forceUpdate() + }) + } }, - plus(sku) { this.$nextTick(() => { this.$store.commit("choseCoupon",""); @@ -585,6 +618,8 @@ export default { } else { param.use_type = 1 param.post = info.contacts.id + param.postPrice = param.postPrice + param.postDiscount = param.postDiscount } } if (info.is_user_post == 2) { diff --git a/subPackages/techan/cartOrder1.vue b/subPackages/techan/cartOrder1.vue index 4b3a96c..7c838c5 100644 --- a/subPackages/techan/cartOrder1.vue +++ b/subPackages/techan/cartOrder1.vue @@ -117,7 +117,9 @@ 运费 - {{!info.post?'免邮':info.post/100}} + {{info.postPrice/100}} + {{!info.post?'免邮':info.post/100}} @@ -394,23 +396,55 @@ export default { }) let param = [] + let consignee_id = null tempList.forEach(v=>{ - param.push({sku_id: v.sInfo.id, num: v.sInfo.buyNum, consignee_id:v.contacts.id}) + // param.push({sku_id: v.sInfo.id, num: v.sInfo.buyNum, consignee_id:v.contacts.id}) + param.push({ + type: v.pInfo.type, + product_id: v.pInfo.id, + sku_id: v.sInfo.id, + product_num: v.sInfo.buyNum, + use_type: 1, + post: v.contacts.id, + consignee_id: v.contacts.id, + }) + consignee_id = v.contacts.id }) - let data = JSON.stringify(param); + // 店铺满减前 // console.log(data); - this.flag = false; + // this.flag = false; - Promise.all(param.map(v=>_this.Post({...v},"/api/order/get_post_price"))).then(res=>{ - if (res) { - console.log("promise" ,res) - for(let i=0;i_this.Post({...v},"/api/order/get_post_price"))).then(res=>{ + // if (res) { + // console.log("promise" ,res) + // for(let i=0;i{this.flag = true;}) + // } + // }).finally(()=>{this.flag = true;}) + + // 店铺满减后 + if (consignee_id && param.length>0) { + let data = { + product_list: param, + consignee_id:consignee_id + }; + this.Post({ + method: 'POST', + data: JSON.stringify(data), + consignee_id:consignee_id + },"/api/order/get_post_price_new").then(res=>{ + let resData = res.data || [] + resData.forEach((x,i) => { + tempList[i].post = x.price - x.discount_price + tempList[i].postPrice = x.price + tempList[i].postDiscount = x.discount_price + }) + this.$forceUpdate() + }) + } }, plus(sku) { @@ -557,8 +591,6 @@ export default { }, // 预定 order() { - - let goods = []; for(let info of this.orderList) { let param = { @@ -578,6 +610,8 @@ export default { } else { param.use_type = 1 param.post = info.contacts.id + param.postPrice = param.postPrice + param.postDiscount = param.postDiscount } } if (info.is_user_post == 2) { diff --git a/subPackages/techan/detail.vue b/subPackages/techan/detail.vue index fdf1f9d..a94bff7 100644 --- a/subPackages/techan/detail.vue +++ b/subPackages/techan/detail.vue @@ -38,7 +38,10 @@ {{ info.price / 100 }} /份 - 已售{{info.sales_number || 0}}份 + + 全店满{{supplierInfo.sill_money/100||0}}包邮 | + 已售{{info.sales_number || 0}}份 + {{ info.title }} diff --git a/subPackages/techan/order.vue b/subPackages/techan/order.vue index 481bf79..62fdaf8 100644 --- a/subPackages/techan/order.vue +++ b/subPackages/techan/order.vue @@ -89,7 +89,9 @@ 运费 - {{!info.post?'免邮':info.post/100}} + {{info.postPrice/100}} + {{!info.post?'免邮':info.post/100}} @@ -365,23 +367,55 @@ export default { }) let param = [] + let consignee_id = null tempList.forEach(v=>{ - param.push({sku_id: v.sInfo.id, num: v.sInfo.buyNum, consignee_id:v.contacts.id}) + // param.push({sku_id: v.sInfo.id, num: v.sInfo.buyNum, consignee_id:v.contacts.id}) + param.push({ + type: v.pInfo.type, + product_id: v.pInfo.id, + sku_id: v.sInfo.id, + product_num: v.sInfo.buyNum, + use_type: 1, + post: v.contacts.id, + consignee_id: v.contacts.id, + }) + consignee_id = v.contacts.id }) - let data = JSON.stringify(param); + // 店铺满减前 // console.log(data); - this.flag = false; + // this.flag = false; - Promise.all(param.map(v=>_this.Post({...v},"/api/order/get_post_price"))).then(res=>{ - if (res) { - console.log("promise" ,res) - for(let i=0;i_this.Post({...v},"/api/order/get_post_price"))).then(res=>{ + // if (res) { + // console.log("promise" ,res) + // for(let i=0;i{this.flag = true;}) + // } + // }).finally(()=>{this.flag = true;}) + + // 店铺满减后 + if (consignee_id && param.length>0) { + let data = { + product_list: param, + consignee_id:consignee_id + }; + this.Post({ + method: 'POST', + data: JSON.stringify(data), + consignee_id:consignee_id + },"/api/order/get_post_price_new").then(res=>{ + let resData = res.data || [] + resData.forEach((x,i) => { + tempList[i].post = x.price - x.discount_price + tempList[i].postPrice = x.price + tempList[i].postDiscount = x.discount_price + }) + this.$forceUpdate() + }) + } }, plus(sku) { diff --git a/subPackages/user/rewardsCenter.vue b/subPackages/user/rewardsCenter.vue new file mode 100644 index 0000000..e17fde4 --- /dev/null +++ b/subPackages/user/rewardsCenter.vue @@ -0,0 +1,123 @@ + + + + + From 2176fc57573aaf891c873314137c3c530efb83f4 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Tue, 14 Oct 2025 15:34:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=85=91=E6=8D=A2=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 6 ++ subPackages/user/rewardsCenter.vue | 92 ++++++++++++++---------------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/pages.json b/pages.json index 125fc31..fc7fa14 100644 --- a/pages.json +++ b/pages.json @@ -78,6 +78,12 @@ "navigationBarTitleText" : "视频" } }, + { + "path":"user/rewardsCenter", + "style" : { + "navigationBarTitleText" : "兑换中心" + } + }, { "path": "ticket/index", "style": { diff --git a/subPackages/user/rewardsCenter.vue b/subPackages/user/rewardsCenter.vue index e17fde4..cc4b75d 100644 --- a/subPackages/user/rewardsCenter.vue +++ b/subPackages/user/rewardsCenter.vue @@ -1,20 +1,14 @@ @@ -33,7 +27,6 @@ console.log('提交的兑换码',this.password); let that = this that.password = that.password.trim() - that.$refs.popup.close() if (that.password== '') { uni.showToast({ title: '请输入优惠券领取卡号', @@ -46,8 +39,6 @@ }, "/api/coupon/getCoupon").then((res) => { console.log(res.code); if (res.code == 200) { - that.coupon = [] - this.getList(this.navList[0]) uni.showToast({ title: '兑换成功', icon: 'none' @@ -67,57 +58,62 @@ From be8293a420c3441419a791207315f374beefdd41 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Tue, 14 Oct 2025 16:10:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A2=86=E5=88=B8=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/coupon/coupon.vue | 20 ++++++++++++++++++++ subPackages/user/rewardsCenter.vue | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pages/coupon/coupon.vue b/pages/coupon/coupon.vue index 2bf6f89..7895561 100644 --- a/pages/coupon/coupon.vue +++ b/pages/coupon/coupon.vue @@ -10,6 +10,10 @@ + + 前往兑换中心 > + + @@ -95,4 +99,20 @@ } } } + + .goRewards{ + width: 400rpx; + height: 80rpx; + background: #FFFFFF; + border-radius: 40rpx; + font-weight: 500; + font-size: 31rpx; + color: #000000; + margin: 0 auto; + position: fixed; + bottom: 180rpx; + text-align: center; + line-height: 80rpx; + left: calc( 50% - 200rpx ); + } \ No newline at end of file diff --git a/subPackages/user/rewardsCenter.vue b/subPackages/user/rewardsCenter.vue index cc4b75d..bea06ec 100644 --- a/subPackages/user/rewardsCenter.vue +++ b/subPackages/user/rewardsCenter.vue @@ -35,8 +35,8 @@ return } that.Post({ - card_key: that.password - }, "/api/coupon/getCoupon").then((res) => { + key: that.password + }, "/api/coupon/get_coupon").then((res) => { console.log(res.code); if (res.code == 200) { uni.showToast({