buffeyu 4 years ago
parent
commit
e34b1753d7
4 changed files with 125 additions and 90 deletions
  1. 31
      pages/my-offer/index.vue
  2. 139
      pages/quotation-details/index.vue
  3. 8
      pages/submit-quotation/index.vue
  4. 37
      utils/index.js

31
pages/my-offer/index.vue

@ -11,7 +11,9 @@
<view v-for="(items, index) in orderData" :key="index" @click="myPriceInfo(items)"> <view v-for="(items, index) in orderData" :key="index" @click="myPriceInfo(items)">
<view class="list-border list-title-line"> <view class="list-border list-title-line">
<text class="list-title">{{ items.belongEnterpriseName }}</text> <text class="list-title">{{ items.belongEnterpriseName }}</text>
<text class="list-title-Subtitle">{{ controlItems[items.orderStatus - 1] }}</text>
<text class="list-title-Subtitle" :style="{ color: controlItems[items.replyStatus] == '已过期' ? '#888888' : '#FF5368' }">
{{ controlItems[items.replyStatus] }}
</text>
</view> </view>
<view class="list-border list-info-line" v-for="(item, index) in items.itemList" :key="index"> <view class="list-border list-info-line" v-for="(item, index) in items.itemList" :key="index">
<view class="list-info" :class="index === items.itemList.length ? 'list-border' : ''"> <view class="list-info" :class="index === items.itemList.length ? 'list-border' : ''">
@ -27,7 +29,7 @@
</view> </view>
<view class="list-border list-bottom-contant"> <view class="list-border list-bottom-contant">
<view> <view>
<text class="list-time">{{ items.deliveryDay }}</text>
<text class="list-time">{{ transformTime(items.replyTime) }}</text>
</view> </view>
<view class=""> <view class="">
<text class="list-title-Subtitle">¥{{ items.totalPrice }}</text> <text class="list-title-Subtitle">¥{{ items.totalPrice }}</text>
@ -44,6 +46,7 @@ import { back, go2 } from '@/utils/hook.js'
import uGap from '@/components/u-gap/u-gap.vue' import uGap from '@/components/u-gap/u-gap.vue'
import scrollList from '@/components/scroll-list/scroll-list.vue' import scrollList from '@/components/scroll-list/scroll-list.vue'
import { getMyReplyList } from '@/apis/trade.js' import { getMyReplyList } from '@/apis/trade.js'
import { difTime } from '@/utils/index'
export default { export default {
// props: { // props: {
// queryOrderData: { // queryOrderData: {
@ -63,7 +66,12 @@ export default {
}, },
orderData: [], orderData: [],
controlCurrent: 0, controlCurrent: 0,
controlItems: ['待付款', '待发货', '待收货', '已完成', '已关闭'],
controlItems: {
30128: '待报价',
30130: '已报价',
30139: '已下单',
30102: '已过期'
},
orderOption: { orderOption: {
size: 10, size: 10,
auto: true, auto: true,
@ -79,7 +87,6 @@ export default {
} }
} }
}, },
filters: {},
watch: { watch: {
orderParams: { orderParams: {
handler(val) { handler(val) {
@ -97,6 +104,22 @@ export default {
this.getMyReplyListQuery() this.getMyReplyListQuery()
}, },
methods: { 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, back,
// //
getMyReplyListQuery() { getMyReplyListQuery() {

139
pages/quotation-details/index.vue

@ -4,7 +4,7 @@
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title=""> <uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="submit-title">报价详情</view> <view class="submit-title">报价详情</view>
<view slot="left"></view> <view slot="left"></view>
<view slot="right" class="edit-price" v-if="upDataObj.replyStatus !== 30102" @click="editPrice()">修改报价</view>
<view slot="right" class="edit-price" v-if="![30139, 30102].includes(upDataObj.replyStatus)" @click="editPrice()">修改报价</view>
</uni-nav-bar> </uni-nav-bar>
</view> </view>
<view class="submit-main"> <view class="submit-main">
@ -26,50 +26,53 @@
</view> </view>
</view> </view>
<uGap></uGap> <uGap></uGap>
<view class="submit-contant" v-for="(items, index) in upDataObj.itemList" :key="index">
<view class="submit-contant-head">
<view class="submit-contant-title">{{ items.brandName }}|{{ items.gramWeight }}|{{ items.length }}*{{ items.width }}|{{ items.quantity }}</view>
<view class="submit-content" v-for="(items, index) in upDataObj.itemList" :key="index">
<view class="submit-content-head">
<view class="submit-content-title">
{{ items.brandName }} | {{ items.gramWeight }}g | {{ items.length }}*{{ items.width }} | {{ items.quantity }}
</view>
</view> </view>
<view class="submit-contant-body">
<view class="submit-content-body">
<view class=""> <view class="">
<text class="submit-contant-body-title">重量()</text>
<text class="submit-contant-body-subtitle">{{ items.wight }}</text>
<text class="submit-content-body-title">重量()</text>
<text class="submit-content-body-subtitle">{{ items.weight }}</text>
</view> </view>
<view> <view>
<text class="submit-contant-body-title">单价(/)</text>
<text class="submit-contant-body-subtitle">{{ items.unitFee }}</text>
<text class="submit-content-body-title">单价(/)</text>
<text class="submit-content-body-subtitle">{{ items.unitFee }}</text>
</view> </view>
<view> <view>
<text class="submit-contant-body-title">小计()</text>
<text class="submit-contant-body-subtitle">{{ items.totalPrice }}</text>
<text class="submit-content-body-title">小计()</text>
<text class="submit-content-body-subtitle">{{ items.totalPrice }}</text>
</view> </view>
<view class="submit-contant-body-input">
<uni-easyinput :disabled="true" maxlength="100" class="submit-contant-body-inputClass" v-model="value" placeholder="请输入内容"></uni-easyinput>
<view class="flex-row-center-start">
<text class="submit-content-body-title">备注信息</text>
<text class="submit-content-body-subtitle">{{ items.remark }}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="submit-contant-order">
<view class="submit-content-order">
<view class=""> <view class="">
<text class="submit-contant-order-title">其他费用</text>
<text class="submit-contant-order-subtitle">¥ {{ upDataObj.otherFee }}</text>
<text class="submit-content-order-title">其他费用</text>
<text class="submit-content-order-subtitle">¥ {{ upDataObj.otherFee }}</text>
</view> </view>
<view class=""> <view class="">
<text class="submit-contant-order-title">合计</text>
<text class="submit-contant-order-money">¥ {{ upDataObj.totalAllPrice }}</text>
<text class="submit-content-order-title">合计</text>
<text class="submit-content-order-money">¥ {{ upDataObj.totalAllPrice }}</text>
</view> </view>
</view> </view>
<uGap></uGap> <uGap></uGap>
<view class="submit-contant-time">
<view class="submit-content-time">
<view class=""> <view class="">
<text class="submit-contant-time-title">有效时间</text>
<text class="submit-contant-time-title">{{ upDataObj.enquiryValidTime }}</text>
<text class="submit-content-time-title">有效时间</text>
<text class="submit-content-time-title">{{ upDataObj.enquiryValidTime }}</text>
</view> </view>
</view> </view>
<uGap></uGap> <uGap></uGap>
<view class="submit-contant-remark">
<view class="submit-contant-remark-title">
<view class="submit-content-remark">
<view class="submit-content-remark-title">
<text>报价备注:</text> <text>报价备注:</text>
<text>29号5点前能送达</text>
<text>{{ upDataObj.remark }}</text>
</view> </view>
</view> </view>
<view class="tips"><text>禁止偷克重抵纸换纸否则将被平台严厉处罚包括但不限于账号禁用</text></view> <view class="tips"><text>禁止偷克重抵纸换纸否则将被平台严厉处罚包括但不限于账号禁用</text></view>
@ -112,6 +115,7 @@ export default {
}, },
data() { data() {
return { return {
id: null,
value: '', value: '',
visible: true, visible: true,
title: 'picker-view', title: 'picker-view',
@ -120,12 +124,18 @@ export default {
deliveryArea: '广东省/广州市/天河区', deliveryArea: '广东省/广州市/天河区',
deliveryDay: '2021/12/29 12:30', deliveryDay: '2021/12/29 12:30',
enquiryValidTime: [12, 11, 10], enquiryValidTime: [12, 11, 10],
itemList: []
itemList: [],
replyStatus: 30102
} }
} }
}, },
onLoad(Option) {
this.getDetail(Option.id)
onLoad(option) {
if (option.id) {
this.id = option.id
}
},
onShow() {
this.id && this.getDetail(this.id)
}, },
methods: { methods: {
back, back,
@ -135,9 +145,6 @@ export default {
.then((res) => { .then((res) => {
if (res) { if (res) {
this.upDataObj = 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, 'otherFee', 0)
this.$set(this.upDataObj, 'totalAllPrice', 0) this.$set(this.upDataObj, 'totalAllPrice', 0)
this.priceFree() this.priceFree()
@ -147,23 +154,6 @@ export default {
reject(err) 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() { priceFree() {
for (let i = 0; i < this.upDataObj.itemList.length; i++) { for (let i = 0; i < this.upDataObj.itemList.length; i++) {
var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice) var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice)
@ -172,28 +162,11 @@ export default {
this.upDataObj.otherFee = otherFee.toFixed(2) 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() { editPrice() {
var params = { var params = {
title: '修改报价', title: '修改报价',
id: this.upDataObj.id
id: this.upDataObj.id
} }
go2('submit-quotation', params) go2('submit-quotation', params)
} }
@ -296,12 +269,12 @@ export default {
margin-top: 20rpx; margin-top: 20rpx;
} }
} }
.submit-contant {
.submit-content {
background-color: #ffffff; background-color: #ffffff;
// height: 368rpx; // height: 368rpx;
border-bottom: 2rpx solid rgba(221, 221, 221, 0.5); border-bottom: 2rpx solid rgba(221, 221, 221, 0.5);
padding-bottom: 20rpx; padding-bottom: 20rpx;
.submit-contant-head {
.submit-content-head {
line-height: 90rpx; line-height: 90rpx;
width: 750rpx; width: 750rpx;
height: 90rpx; height: 90rpx;
@ -309,7 +282,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.submit-contant-title {
.submit-content-title {
font-family: PingFangSC-Semibold; font-family: PingFangSC-Semibold;
font-size: 30rpx; font-size: 30rpx;
color: rgba(0, 0, 0, 0.75); color: rgba(0, 0, 0, 0.75);
@ -318,17 +291,17 @@ export default {
font-weight: 600; font-weight: 600;
padding: 0rpx 0rpx 0rpx 32rpx; padding: 0rpx 0rpx 0rpx 32rpx;
} }
.submit-contant-body {
.submit-content-body {
line-height: 68rpx; line-height: 68rpx;
padding-left: 32rpx; padding-left: 32rpx;
.submit-contant-body-title {
.submit-content-body-title {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #555555; color: #555555;
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
} }
.submit-contant-body-subtitle {
.submit-content-body-subtitle {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 28rpx; font-size: 28rpx;
color: #555555; color: #555555;
@ -337,15 +310,15 @@ export default {
float: right; float: right;
margin-right: 32rpx; margin-right: 32rpx;
} }
.submit-contant-body-input {
.submit-content-body-input {
margin-right: 32rpx; margin-right: 32rpx;
} }
.submit-contant-body-inputClass {
.submit-content-body-inputClass {
background-color: #f7f8fa; background-color: #f7f8fa;
} }
} }
} }
.submit-contant-order {
.submit-content-order {
width: 750rpx; width: 750rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
@ -354,7 +327,7 @@ export default {
padding-left: 32rpx; padding-left: 32rpx;
padding-right: 32rpx; padding-right: 32rpx;
justify-content: space-between; justify-content: space-between;
.submit-contant-order-title {
.submit-content-order-title {
width: 140rpx; width: 140rpx;
height: 40rpx; height: 40rpx;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
@ -362,7 +335,7 @@ export default {
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
font-weight: 400; font-weight: 400;
} }
.submit-contant-order-subtitle {
.submit-content-order-subtitle {
width: 101rpx; width: 101rpx;
height: 40rpx; height: 40rpx;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
@ -372,7 +345,7 @@ export default {
text-align: left; text-align: left;
font-weight: 400; font-weight: 400;
} }
.submit-contant-order-money {
.submit-content-order-money {
width: 172rpx; width: 172rpx;
height: 42rpx; height: 42rpx;
font-family: PingFangSC-Semibold; font-family: PingFangSC-Semibold;
@ -383,7 +356,7 @@ export default {
font-weight: 600; font-weight: 600;
} }
} }
.submit-contant-time {
.submit-content-time {
width: 750rpx; width: 750rpx;
height: 88rpx; height: 88rpx;
background: #ffffff; background: #ffffff;
@ -392,7 +365,7 @@ export default {
padding-left: 32rpx; padding-left: 32rpx;
padding-right: 32rpx; padding-right: 32rpx;
justify-content: space-between; justify-content: space-between;
.submit-contant-time-title {
.submit-content-time-title {
width: 230rpx; width: 230rpx;
height: 40rpx; height: 40rpx;
font-size: 28rpx; font-size: 28rpx;
@ -400,7 +373,7 @@ export default {
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
} }
.submit-contant-time-subtitle {
.submit-content-time-subtitle {
width: 56rpx; width: 56rpx;
height: 40rpx; height: 40rpx;
font-size: 28rpx; font-size: 28rpx;
@ -411,11 +384,11 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.submit-contant-remark {
.submit-content-remark {
width: 750rpx; width: 750rpx;
height: 88rpx; height: 88rpx;
background: #ffffff; background: #ffffff;
.submit-contant-remark-title {
.submit-content-remark-title {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 30rpx; font-size: 30rpx;
color: #000000; color: #000000;
@ -423,7 +396,7 @@ export default {
font-weight: 400; font-weight: 400;
padding: 28rpx 0rpx 0rpx 32rpx; padding: 28rpx 0rpx 0rpx 32rpx;
} }
.submit-contant-remark-input {
.submit-content-remark-input {
background: #f7f8fa; background: #f7f8fa;
border-radius: 20rpx; border-radius: 20rpx;
margin: 10rpx 32rpx 32rpx 32rpx; margin: 10rpx 32rpx 32rpx 32rpx;

8
pages/submit-quotation/index.vue

@ -99,7 +99,7 @@
<view class="submit-content-remark"> <view class="submit-content-remark">
<view class="submit-content-remark-title">报价备注</view> <view class="submit-content-remark-title">报价备注</view>
<view class=""> <view class="">
<uni-easyinput maxlength="200" type="textarea" class="submit-content-remark-input" v-model="quotationRemark" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput maxlength="200" type="textarea" class="submit-content-remark-input" v-model="upDataObj.remark" placeholder="请输入内容"></uni-easyinput>
</view> </view>
</view> </view>
<qn-footer fixed height="120rpx" v-if="upDataObj.replyStatus !== 30102"> <qn-footer fixed height="120rpx" v-if="upDataObj.replyStatus !== 30102">
@ -248,7 +248,7 @@ export default {
months.push(i + '小时') months.push(i + '小时')
} }
return { return {
quotationRemark: '',
// quotationRemark: '',
vModelValue: '', vModelValue: '',
indicatorStyle: `height: 50px;`, indicatorStyle: `height: 50px;`,
visible: true, visible: true,
@ -298,6 +298,8 @@ export default {
this.$set(this.upDataObj, 'otherFee', 0) this.$set(this.upDataObj, 'otherFee', 0)
this.$set(this.upDataObj, 'totalAllPrice', 0) this.$set(this.upDataObj, 'totalAllPrice', 0)
this.priceFree() this.priceFree()
//
// this.quotationRemark = res.remark
// //
for (let i = 0; i < this.upDataObj.itemList.length; i++) { for (let i = 0; i < this.upDataObj.itemList.length; i++) {
let target = this.upDataObj.itemList[i] let target = this.upDataObj.itemList[i]
@ -491,8 +493,8 @@ export default {
} }
} }
var params = { var params = {
remark: this.quotationRemark, //
...this.upDataObj, ...this.upDataObj,
// remark: this.quotationRemark, //
userId: this.$store.state.userInfo.userId userId: this.$store.state.userInfo.userId
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

37
utils/index.js

@ -160,3 +160,40 @@ export const makeSocket = async ({ pageInfo = '', retry = false }) => {
export function round(number, precision) { export function round(number, precision) {
return Math.round(+number + 'e' + precision) / Math.pow(10, 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
}
}
Loading…
Cancel
Save