From 05b7feb91c71421e5c4e19c2a03210fdb7d4e358 Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Wed, 26 Jan 2022 12:25:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/submit-quotation/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/submit-quotation/index.vue b/pages/submit-quotation/index.vue index 9be9eef..6cde983 100644 --- a/pages/submit-quotation/index.vue +++ b/pages/submit-quotation/index.vue @@ -491,8 +491,8 @@ export default { } } var params = { - remark: this.quotationRemark, // 报价备注 ...this.upDataObj, + remark: this.quotationRemark, // 报价备注 userId: this.$store.state.userInfo.userId } return new Promise((resolve, reject) => { From 08f26a1bd99e588ce0611848458d26e0dc080066 Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Wed, 26 Jan 2022 13:03:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E6=8A=A5=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/quotation-details/index.vue | 134 ++++++++++++------------------ pages/submit-quotation/index.vue | 8 +- 2 files changed, 58 insertions(+), 84 deletions(-) diff --git a/pages/quotation-details/index.vue b/pages/quotation-details/index.vue index 06d6960..98f124a 100644 --- a/pages/quotation-details/index.vue +++ b/pages/quotation-details/index.vue @@ -26,50 +26,53 @@ - - - {{ items.brandName }}|{{ items.gramWeight }}|{{ items.length }}*{{ items.width }}|{{ items.quantity }} + + + + {{ items.brandName }} | {{ items.gramWeight }}g | {{ items.length }}*{{ items.width }} | {{ items.quantity }}张 + - + - 重量(吨): - {{ items.wight }} + 重量(吨): + {{ items.weight }} - 单价(元/吨): - {{ items.unitFee }} + 单价(元/吨): + {{ items.unitFee }} - 小计(元): - {{ items.totalPrice }} + 小计(元): + {{ items.totalPrice }} - - + + 备注信息: + {{ items.remark }} - + - 其他费用: - ¥ {{ upDataObj.otherFee }} + 其他费用: + ¥ {{ upDataObj.otherFee }} - 合计: - ¥ {{ upDataObj.totalAllPrice }} + 合计: + ¥ {{ upDataObj.totalAllPrice }} - + - 有效时间: - {{ upDataObj.enquiryValidTime }} + 有效时间: + {{ upDataObj.enquiryValidTime }} - - + + 报价备注: - 29号5点前能送达。 + {{ upDataObj.remark }} 注:禁止偷克重、抵纸换纸,否则将被平台严厉处罚!包括但不限于账号禁用。 @@ -112,6 +115,7 @@ export default { }, data() { return { + id: null, value: '', visible: true, title: 'picker-view', @@ -124,8 +128,13 @@ export default { } } }, - onLoad(Option) { - this.getDetail(Option.id) + onLoad(option) { + if (option.id) { + this.id = option.id + } + }, + onShow() { + this.id && this.getDetail(this.id) }, methods: { back, @@ -135,9 +144,6 @@ export default { .then((res) => { if (res) { this.upDataObj = res - var timeb = this.upDataObj.enquiryValidTime.split(' ') - var timeabs = timeb[1].split(':') - this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs) this.$set(this.upDataObj, 'otherFee', 0) this.$set(this.upDataObj, 'totalAllPrice', 0) this.priceFree() @@ -147,23 +153,6 @@ export default { reject(err) }) }, - // 商品操作按钮 - commodityModify(item) { - console.log(111) - this.$refs.popup.open('bottom') - }, - // 单价操作按钮 - priceModify() { - this.$refs.popupPrice.open('bottom') - }, - // 事件设置 - resetTime() { - this.$refs.popupTime.open('bottom') - }, - // 事件选择change事件 - bindChange(e) { - console.log(e.detail.value) - }, priceFree() { for (let i = 0; i < this.upDataObj.itemList.length; i++) { var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice) @@ -172,28 +161,11 @@ export default { this.upDataObj.otherFee = otherFee.toFixed(2) } }, - close() { - this.$refs.popup.close() - this.$refs.popupPrice.close() - }, - // 纸张选择下拉change事件 - onchange(e) { - console.log(e) - this.pickerValue = e.detail.value - }, - // 时间设置取消 - pickerCancel() { - this.$refs.popupTime.close() - }, - // 时间设置确认 - pickerSure() { - this.$refs.popupTime.close() - }, // 修改报价按钮 editPrice() { var params = { title: '修改报价', - id: this.upDataObj.id + id: this.upDataObj.id } go2('submit-quotation', params) } @@ -296,12 +268,12 @@ export default { margin-top: 20rpx; } } - .submit-contant { + .submit-content { background-color: #ffffff; // height: 368rpx; border-bottom: 2rpx solid rgba(221, 221, 221, 0.5); padding-bottom: 20rpx; - .submit-contant-head { + .submit-content-head { line-height: 90rpx; width: 750rpx; height: 90rpx; @@ -309,7 +281,7 @@ export default { display: flex; justify-content: space-between; } - .submit-contant-title { + .submit-content-title { font-family: PingFangSC-Semibold; font-size: 30rpx; color: rgba(0, 0, 0, 0.75); @@ -318,17 +290,17 @@ export default { font-weight: 600; padding: 0rpx 0rpx 0rpx 32rpx; } - .submit-contant-body { + .submit-content-body { line-height: 68rpx; padding-left: 32rpx; - .submit-contant-body-title { + .submit-content-body-title { font-family: PingFangSC-Regular; font-size: 28rpx; color: #555555; letter-spacing: 0; font-weight: 400; } - .submit-contant-body-subtitle { + .submit-content-body-subtitle { font-family: PingFangSC-Regular; font-size: 28rpx; color: #555555; @@ -337,15 +309,15 @@ export default { float: right; margin-right: 32rpx; } - .submit-contant-body-input { + .submit-content-body-input { margin-right: 32rpx; } - .submit-contant-body-inputClass { + .submit-content-body-inputClass { background-color: #f7f8fa; } } } - .submit-contant-order { + .submit-content-order { width: 750rpx; height: 90rpx; line-height: 90rpx; @@ -354,7 +326,7 @@ export default { padding-left: 32rpx; padding-right: 32rpx; justify-content: space-between; - .submit-contant-order-title { + .submit-content-order-title { width: 140rpx; height: 40rpx; font-family: PingFangSC-Regular; @@ -362,7 +334,7 @@ export default { color: rgba(0, 0, 0, 0.5); font-weight: 400; } - .submit-contant-order-subtitle { + .submit-content-order-subtitle { width: 101rpx; height: 40rpx; font-family: PingFangSC-Regular; @@ -372,7 +344,7 @@ export default { text-align: left; font-weight: 400; } - .submit-contant-order-money { + .submit-content-order-money { width: 172rpx; height: 42rpx; font-family: PingFangSC-Semibold; @@ -383,7 +355,7 @@ export default { font-weight: 600; } } - .submit-contant-time { + .submit-content-time { width: 750rpx; height: 88rpx; background: #ffffff; @@ -392,7 +364,7 @@ export default { padding-left: 32rpx; padding-right: 32rpx; justify-content: space-between; - .submit-contant-time-title { + .submit-content-time-title { width: 230rpx; height: 40rpx; font-size: 28rpx; @@ -400,7 +372,7 @@ export default { letter-spacing: 0; font-weight: 400; } - .submit-contant-time-subtitle { + .submit-content-time-subtitle { width: 56rpx; height: 40rpx; font-size: 28rpx; @@ -411,11 +383,11 @@ export default { cursor: pointer; } } - .submit-contant-remark { + .submit-content-remark { width: 750rpx; height: 88rpx; background: #ffffff; - .submit-contant-remark-title { + .submit-content-remark-title { font-family: PingFangSC-Regular; font-size: 30rpx; color: #000000; @@ -423,7 +395,7 @@ export default { font-weight: 400; padding: 28rpx 0rpx 0rpx 32rpx; } - .submit-contant-remark-input { + .submit-content-remark-input { background: #f7f8fa; border-radius: 20rpx; margin: 10rpx 32rpx 32rpx 32rpx; diff --git a/pages/submit-quotation/index.vue b/pages/submit-quotation/index.vue index ed0abbe..84480e8 100644 --- a/pages/submit-quotation/index.vue +++ b/pages/submit-quotation/index.vue @@ -99,7 +99,7 @@ 报价备注 - + @@ -248,7 +248,7 @@ export default { months.push(i + '小时') } return { - quotationRemark: '', + // quotationRemark: '', vModelValue: '', indicatorStyle: `height: 50px;`, visible: true, @@ -298,6 +298,8 @@ export default { this.$set(this.upDataObj, 'otherFee', 0) this.$set(this.upDataObj, 'totalAllPrice', 0) this.priceFree() + // 询价备注 + // this.quotationRemark = res.remark // 计算每个纸品的重量 for (let i = 0; i < this.upDataObj.itemList.length; i++) { let target = this.upDataObj.itemList[i] @@ -492,7 +494,7 @@ export default { } var params = { ...this.upDataObj, - remark: this.quotationRemark, // 报价备注 + // remark: this.quotationRemark, // 报价备注 userId: this.$store.state.userInfo.userId } return new Promise((resolve, reject) => { From a0cbce5aefc293b19aa66d3e0848cdac968bd629 Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Wed, 26 Jan 2022 13:23:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E4=BB=B7=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my-offer/index.vue | 31 ++++++++++++++++++++++---- pages/quotation-details/index.vue | 5 +++-- utils/index.js | 37 +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/pages/my-offer/index.vue b/pages/my-offer/index.vue index a3e2a91..53c3482 100644 --- a/pages/my-offer/index.vue +++ b/pages/my-offer/index.vue @@ -11,7 +11,9 @@ {{ items.belongEnterpriseName }} - {{ controlItems[items.orderStatus - 1] }} + + {{ controlItems[items.replyStatus] }} + @@ -27,7 +29,7 @@ - {{ items.deliveryDay }} + {{ transformTime(items.replyTime) }} ¥{{ items.totalPrice }} @@ -44,6 +46,7 @@ import { back, go2 } from '@/utils/hook.js' import uGap from '@/components/u-gap/u-gap.vue' import scrollList from '@/components/scroll-list/scroll-list.vue' import { getMyReplyList } from '@/apis/trade.js' +import { difTime } from '@/utils/index' export default { // props: { // queryOrderData: { @@ -63,7 +66,12 @@ export default { }, orderData: [], controlCurrent: 0, - controlItems: ['待付款', '待发货', '待收货', '已完成', '已关闭'], + controlItems: { + 30128: '待报价', + 30130: '已报价', + 30139: '已下单', + 30102: '已过期' + }, orderOption: { size: 10, auto: true, @@ -79,7 +87,6 @@ export default { } } }, - filters: {}, watch: { orderParams: { handler(val) { @@ -97,6 +104,22 @@ export default { this.getMyReplyListQuery() }, methods: { + transformTime(time) { + if (!time) { + return '-' + } + const { day, hours, minutes, seconds } = difTime(new Date(), time) + if (day > 0) { + return `${day}天前` + } + if (hours > 0) { + return `${hours}小时前` + } + if (minutes > 0) { + return `${minutes}分钟前` + } + return `${seconds}秒前` + }, back, // 获取我的报价 getMyReplyListQuery() { diff --git a/pages/quotation-details/index.vue b/pages/quotation-details/index.vue index 98f124a..e27d77b 100644 --- a/pages/quotation-details/index.vue +++ b/pages/quotation-details/index.vue @@ -4,7 +4,7 @@ 报价详情 - 修改报价 + 修改报价 @@ -124,7 +124,8 @@ export default { deliveryArea: '广东省/广州市/天河区', deliveryDay: '2021/12/29 12:30', enquiryValidTime: [12, 11, 10], - itemList: [] + itemList: [], + replyStatus: 30102 } } }, diff --git a/utils/index.js b/utils/index.js index 7d7a828..bbef794 100644 --- a/utils/index.js +++ b/utils/index.js @@ -160,3 +160,40 @@ export const makeSocket = async ({ pageInfo = '', retry = false }) => { export function round(number, precision) { return Math.round(+number + 'e' + precision) / Math.pow(10, precision) } + +/** + * {beyond:是否超出目标时间,day:天,hours:小时,minutes:分钟,seconds:秒钟} + * @param time 计算时间 + * @param target 对照时间 + * @returns 时间差对象 + */ +export const difTime = (time, target) => { + let begin = new Date(time).getTime() + // 兼容ios时间 + let end = new Date(target.replace(/-/g, '/')).getTime() + let beyond = begin < end ? false : true + let diff = Math.abs(begin - end) + // 计算天数 + let day = Math.floor(diff / (24 * 3600 * 1000)) + day != day ? (day = 0) : '' + diff = diff % (24 * 3600 * 1000) + // 计算小时数 + let hours = Math.floor(diff / (3600 * 1000)) + hours != hours ? (hours = 0) : '' + diff = diff % (3600 * 1000) + // 计算分钟数 + let minutes = Math.floor(diff / (60 * 1000)) + minutes != minutes ? (minutes = 0) : '' + diff = diff % (60 * 1000) + // 计算秒数 + let seconds = Math.floor(diff / 1000) + seconds != seconds ? (seconds = 0) : '' + diff = diff % 1000 + return { + beyond, + day, + hours, + minutes, + seconds + } +}