Commit 04911744 authored by Facius's avatar Facius

优化

parent e59d6a50
......@@ -3,9 +3,9 @@
<view class="return-cell" @click="handleClick">
<view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text>
<view class="express-view">
<view class="express-view" @click.stop="$u.throttle(handleClickExpress, 500)">
<text>物流单号:</text>
<view class="order-file-right" @click="$u.throttle(handleClickExpress, 500)">
<view class="order-file-right">
<text>{{info.express.number}}</text>
<u-icon name="arrow-right"></u-icon>
</view>
......@@ -17,7 +17,7 @@
<image class="image-view" v-for="(item, index) in images" :key="index" :src="item"></image>
<view class="info-view" v-if="info.items.length == 1">
<view class="name-text">{{info.items[0].name}}</view>
<view>{{info.categoryName + '-' + info.brandName}}</view>
<view>{{info.items[0].categoryName + '-' + info.items[0].brandName}}</view>
</view>
</view>
<view class="count-view">共{{info.items.length}}种</view>
......@@ -166,13 +166,15 @@
},
methods: {
handleClick() {
console.log('--handleClick----')
this.$emit('action', this.info)
},
handleOperate() {
this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus)
},
handleClickExpress() {
this.$emit('express', this.info.id)
console.log('--handleClickExpress----')
this.$emit('express', this.info)
}
}
}
......
......@@ -44,7 +44,7 @@
},
computed: {
remarkText() {
return this.noteText || this.item.categoryName + '-' + this.item.brandName
return this.item.categoryName + '-' + this.item.brandName
},
imageUrl() {
return this.item.images ? process.uniEnv.systemUrl.apiUrl + this.item.images.split(',').shift() : this.placeholderImage
......
......@@ -5,8 +5,9 @@
</u-navbar>
<view class="content-view">
<view class="contacts-view">
<view>
<image class="image-view" :src="imageUrl"></image>
<view class="contacts-left-view">
<image class="image-view" :src="imageUrl"></image>
<view class="total-view">共{{total}}件</view>
</view>
<view class="right-view">
<view class="title-view">{{title}}</view>
......@@ -73,6 +74,14 @@
imageUrl() {
let item = this.info.items[0] || {}
return item.images ? item.images.split(',').shift() : this.placeholderImage
},
total() { // 合计
var i = 0
for (var item of this.info.items) {
i += item.quantity
}
return i
},
titleColor() {
switch (String(this.info.status)) {
......@@ -93,7 +102,7 @@
return i
},
placeholderImage() {
return process.uniEnv.qn_base_url + 'logo.png'
return process.uniEnv.qn_base_url + 'morentupian.png'
},
},
onLoad(e) {
......@@ -208,11 +217,27 @@
align-items: flex-start;
background-color: #FFFFFF;
border-radius: 12rpx;
.image-view {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
.contacts-left-view {
position: relative;
.image-view {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
position: relative;
}
.total-view {
position: absolute;
height: 32rpx;
border-radius: 16rpx;
font-size: 20rpx;
color: #FFFFFF;
background-color: rgba(0, 0, 0, 0.5);
bottom: 10rpx;
width: 100rpx;
text-align: center;
margin-left: 10rpx;
line-height: 32rpx;
}
}
.right-view {
......
......@@ -197,7 +197,7 @@
},
handleClickCell(info) {
this.setPageInfo(info)
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
......
......@@ -11,7 +11,7 @@
</view>
<view class="content-view">
<view class="contacts-view">
<view class="image-view"></view>
<image class="image-view" :src="shouhuodizhiImage"></image>
<view class="right-view">
<view class="contacts-top">
<text>{{info.express.name}}</text>
......@@ -92,12 +92,12 @@
},
titles() {
return {
'1': '待审核',
'10': '待发货',
'15': '代签收',
'20': '已签收',
'-1': '审核未通过',
'1': '已取消'
'1': '待审核',
'10': '待发货',
'15': '代签收',
'20': '已签收',
'-2': '审核未通过',
'-1': '已取消'
}
},
total() { // 合计
......@@ -109,7 +109,10 @@
return i
},
placeholderImage() {
return process.uniEnv.qn_base_url + 'logo.png'
return process.uniEnv.qn_base_url + 'morentupian.png'
},
shouhuodizhiImage() {
return process.uniEnv.qn_base_url + 'shouhuodizhi.png'
},
customStyle() {
return {
......@@ -123,8 +126,9 @@
detail() { // 详情
return {
'orderNumber': this.info.orderNumber,
'createTime': this.info.createTime,
'deliveryTime': this.info.express.deliveryTime,
'createTime': this.info.createTime ? this.$u.timeFormat(this.info.createTime, 'yyyy.mm.dd hh:MM:ss') : '',
'deliveryTime': this.info.express.deliveryTime ? this.$u.timeFormat(this.info.express.deliveryTime, 'yyyy.mm.dd hh:MM:ss') : '',
'applyRemark': this.info.applyRemark || '',
}
},
detailKey() { // 详情
......@@ -271,8 +275,6 @@
.image-view {
width: 72rpx;
height: 72rpx;
background-color: #2272FF;
border-radius: 36rpx;
}
.right-view {
......
......@@ -26,8 +26,8 @@
</view>
<template v-else>
<view class="list-item" v-for="(item, index) in partsList" :key="item.id">
<SpareCell :item="item" :noteText="noteText" :showChecked="showBounce"
@change="handleChange(index)" />
<SpareCell :item="item" :showChecked="showBounce"
@change="handleChange(index)"@numChange="handleNumChange($event, index)" />
</view>
<view class="load-more-view">
<u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7">
......@@ -117,7 +117,7 @@
}
},
customStyle() {
return 'background-color: #F4F5F7;padding: 0;'
return 'background-color: #F4F5F7;padding: 0rpx;'
},
searchButtonText() {
return this.searchedKeyword == this.keyword && this.keyword ? '取消' : '搜索'
......@@ -137,7 +137,10 @@
this.searchedKeyword = this.keyword
this.$u.api.reserveList(param).then((res) => {
if (res.code == 200) {
if (res.code == 200) {
for(var item of res.data) {
item.max = item.quantity
}
this.partsList = []
let list = res.data || []
for (var item of list) {
......@@ -179,6 +182,9 @@
},
handleChange(index) {
this.partsList[index].selected = !this.partsList[index].selected
},
handleNumChange(value, index) {
this.partsList[index].quantity = value
},
handleSubmit() {
const getSelected = (element) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment