From 8dadbd49a9840e9f70d01e33e061bd543ee7d9f2 Mon Sep 17 00:00:00 2001 From: jinna Date: Wed, 23 Aug 2023 13:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E8=AE=A2=E5=8D=95=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/pages_zhentou/form/form.vue | 78 ++++++-- pages/pages_zhentou/order/checkOrder.vue | 215 +++++++++++++++++++---- pages/pages_zhentou/order/express.vue | 18 +- 3 files changed, 266 insertions(+), 45 deletions(-) diff --git a/pages/pages_zhentou/form/form.vue b/pages/pages_zhentou/form/form.vue index 2381388..7d17bef 100644 --- a/pages/pages_zhentou/form/form.vue +++ b/pages/pages_zhentou/form/form.vue @@ -159,6 +159,7 @@ export default { data() { return { + phoneNumber:'', imgPrefix: getApp().globalData.imgPrefix, isShowLink:false, fontsize: 12, @@ -279,38 +280,38 @@ // 枕头软硬度 posData: [{ text: '偏硬', - value: '1' + value: 1 }, { text: '适中', - value: '2' + value: 2 }, { text: '偏软', - value: '3' + value: 3 }], // 枕头材质 matData: [{ text: '羽丝绒枕', - value: '1' + value: 1 }, { text: '草本植物枕(荞麦、决明子等)', - value: '2' + value: 2 }, { text: '乳胶枕', - value: '3' + value: 3 }, { text: '慢回弹记忆枕', - value: '4' + value: 4 }, { text: '软管枕', - value: '5' + value: 5 }, { text: '其他', - value: '6' + value: 6 }, ], cerData: [{ @@ -335,9 +336,8 @@ } }, onShow(){ - console.log(getApp().globalData) }, - onLoad() { + onLoad(options) { // let srceenNunber=15; //因设计图是1920所有把设计图分为19.2份,所以html字体大小为100px let that = this; @@ -365,9 +365,65 @@ }; // console.log(this.a) this.getData() + console.log(options) + if(options.phone){ + this.phoneNumber = options.phone + this.getInfo() + } }, methods: { + // 获取表单信息 + getInfo(){ + uni.request({ + // this.phoneNumber + url:getApp().globalData.baseUrl + '/blade-desk/custom-made-info/get-newest?phone=13214521014' , + method:'GET', + header:{ + 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') + }, + success:(res) =>{ + console.log(res) + if(res.data.code == 200){ + this.valiFormData = { + username:res.data.data.username == '-1' ? '' : res.data.data.username, + ageRange:res.data.data.ageRange == '-1' ? '' : res.data.data.ageRange, + height:res.data.data.height == '-1' ? '' : res.data.data.height, + neckLength:res.data.data.neckLength == '-1' ? '' : res.data.data.neckLength, + neckShoulderWidth:res.data.data.neckShoulderWidth == '-1' ? '' : res.data.data.neckShoulderWidth, + pillowHardness:res.data.data.pillowHardness == '-1' ? '' : res.data.data.pillowHardness, + pillowMaterial:res.data.data.pillowMaterial == '-1' ? '' : res.data.data.pillowMaterial, + sleepingPosture:res.data.data.sleepingPosture == '-1' ? '' : res.data.data.sleepingPosture, + status:res.data.data.status == '-1' ? '' : res.data.data.status, + weight:res.data.data.weight == '-1' ? '' : res.data.data.weight, + address:res.data.data.detail == '-1' ? '' : res.data.data.detail, + sleepLength:res.data.data.sleepLength == '-1' ? '' : res.data.data.sleepLength, + cervicalVertebra:res.data.data.cervicalVertebra == '-1' ? '' : res.data.data.cervicalVertebra, + otherNeed:res.data.data.otherNeed == '-1' ? '' : res.data.data.otherNeed, + phone:res.data.data.phone == '-1' ? '' : res.data.data.phone + } + this.province = res.data.data.province == '-1' ? '' :res.data.data.province; + this.city = res.data.data.city == '-1' ? '' :res.data.data.city; + this.district = res.data.data.district == '-1' ? '' :res.data.data.district; + // this.getCurrentArea(this.province) + } + } + }) + }, + // getCurrentArea(value){ + // this.allCityData.map((item,index) =>{ + // if(item.province == value){ + // this.multiIndex[0] = index + // item.citys.map((item1,index1) =>{ + // this.locationArr[1].push(item.city); + // if(item1.city == this.city){ + + // } + // }) + + // } + // }) + // }, toggle(type) { this.$refs.popup.open(type) }, diff --git a/pages/pages_zhentou/order/checkOrder.vue b/pages/pages_zhentou/order/checkOrder.vue index 833435c..eb1867e 100644 --- a/pages/pages_zhentou/order/checkOrder.vue +++ b/pages/pages_zhentou/order/checkOrder.vue @@ -4,28 +4,28 @@

壹人壹枕

-

待付款

-

待发货

-

待收货

-

已完成

-

已取消

+

待付款

+

待发货

+

待收货

+

已完成

+

已取消

-

易旅家居壹人壹枕枕头科学化定制

+

{{orderData.goodsName}}

- 共1件 + 共{{orderData.goodsNum}}件 699.0 + style="font-size: 28rpx;color: #333;">{{orderData.goodsPrice}}

- +

实付款

699.0

+ style="font-size: 34rpx;">{{orderData.goodsPrice}}

@@ -47,37 +47,38 @@

订单信息

下单人: - yuky + {{orderData.buyerName}}

订单编号: - 230415-48478941514632 + {{orderData.orderNo}}

-

+

支付时间: - 2023/8/21 15:33 + {{orderData.paymentTime}}

-

+

收货时间: - 2023/8/21 15:33 + {{orderData.transactionTime}}

- + 售后服务 -

查看物流

-

确认收货

-

取消订单

-

立即支付

-

完善定制信息

-

删除订单

-

再次定制

+

查看物流

+

确认收货

+

取消订单

+

立即支付

+ +

完善定制信息

+

删除订单

+

再次定制

@@ -87,18 +88,172 @@ data() { return { imgPrefix: getApp().globalData.imgPrefix, - orderData:{status:5,content:''}, + orderData:{}, + orderId:'' } }, - onload(options) { - const item = JSON.parse(decodeURIComponent(option.item)); - console.log(item) + onLoad(options) { + this.orderId = options.id; + this.getDetail() + console.log(options) + console.log('进入模块') }, methods: { + // 获取物流详情 + getDetail(){ + uni.request({ + // + this.orderId + url: getApp().globalData.baseUrl + '/blade-desk/order/detail?id=' + this.orderId, + method:'GET', + header:{ + 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') + }, + success: (res) => { + console.log(res) + if(res.data.code == 200){ + this.orderData = res.data.data; + }else{ + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + + } + }) + }, + // 取消订单 + cancelOrder(){ + uni.showModal({ + title: '提示', + content: '确认取消该订单?', + success: (res) => { + if (res.confirm) { + uni.request({ + url:getApp().globalData.baseUrl + '/blade-desk/order/cancel?id=' + this.orderId, + method:'POST', + header:{ + 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') + }, + success: (res) => { + console.log(res) + if(res.data.code == 200){ + uni.showToast({ + title: '订单取消成功', + icon: 'none' + }) + setTimeout(() =>{ + uni.navigateBack() + },500) + + }else{ + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + } + }) + } else if (res.cancel) { + + } + } + }); + }, + // 确认收货 + handleConfirm(){ + let params = { + id:this.orderId + } + uni.showModal({ + title: '提示', + content: '确认收到该商品了吗?', + success: (res) => { + if (res.confirm) { + uni.request({ + url:getApp().globalData.baseUrl + '/blade-desk/order/confirmReceive?id=' + this.orderId, + method:"POST", + header:{ + 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') + }, + success:(res) =>{ + console.log(res) + if(res.data.code == 200){ + uni.showToast({ + title: '收货成功', + icon: 'none' + }) + setTimeout(() =>{ + uni.navigateBack() + },500) + }else{ + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + } + }) + } else if (res.cancel) { + + } + } + }); + }, // 查看物流 handleWuliu(){ uni.navigateTo({ - url:"/pages/pages_zhentou/order/express" + url:"/pages/pages_zhentou/order/express?logisticsNo=" + this.orderData.logisticsNo + '&company=' + this.orderData.logisticsCompany + '&companyCode=' + this.orderData.logisticsCompanyCode + }) + }, + // 删除订单 + handleDelete(){ + uni.showModal({ + title: '提示', + content: '确认删除订单吗?', + success: (res) => { + if (res.confirm) { + uni.request({ + url:getApp().globalData.baseUrl + '/blade-desk/order/remove?ids=' + this.orderId, + method:"POST", + header:{ + 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') + }, + success: (res) => { + console.log(res) + if(res.data.code == 200){ + uni.showToast({ + title: '订单删除成功', + icon: 'none' + }) + setTimeout(() =>{ + uni.navigateBack() + },500) + }else{ + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + } + }) + } else if (res.cancel) { + } + } + }); + }, + // 点击再次定制按钮,跳转到提交订单页面 + clickCustom(){}, + // 完善定制信息,跳转表单页面 + handleInfo(){ + uni.navigateTo({ + url:"/pages/pages_zhentou/form/form?phone=" + this.orderData.buyerPhone + }) + }, + // 跳转售后服务 + returnToServe(){ + uni.navigateTo({ + url:"/pages/pages_zhentou/contact/contact" }) }, } diff --git a/pages/pages_zhentou/order/express.vue b/pages/pages_zhentou/order/express.vue index b95ba25..029a3ea 100644 --- a/pages/pages_zhentou/order/express.vue +++ b/pages/pages_zhentou/order/express.vue @@ -2,10 +2,10 @@ - 顺丰快递 + {{company}} - SH189165496411 + {{logisticsNo}} @@ -76,10 +76,20 @@ context: '【丽江市】 【丽江华坪县】(0888-8834031) 的 P1陈平(15108866686) 已揽收', time: '2023-08-14 19:01:18' } - ] + ], + logisticsNo:'', + company:'', + companyCode:'', } }, - onLoad() { + onLoad(options) { + console.log(options) + this.logisticsNo = options.logisticsNo; + this.company = options.company; + this.companyCode = options.companyCode; + if(this.logisticsNo){ + this.getInfo() + } // this.getInfo() }, methods: {