Commit 4c0d73cc authored by Facius's avatar Facius

1.3第二轮bug修复

parent 2e5a6b05
<template> <template>
<view class="bottom-button"> <view class="bottom-button">
<view v-for="(item, index) in list" :class="['button-view', item.type]"> <view v-for="(item, index) in list" :class="['button-view', item.type]" :key="index">
<u-button :class="['list-button', item.type, {'one': list.length == 1}]" @click="handleClick(item)" <u-button :class="['list-button', item.type, {'one': list.length == 1}]" @click="handleClick(item)"
:hover-class="item.type == 'image' || item.disabled ? 'none' : ''" :hover-class="item.type == 'image' || item.disabled ? 'none' : ''"
:custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle"> :custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle">
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
// index: 跳转到我的订单页面之后第几个tab, // index: 跳转到我的订单页面之后第几个tab,
return [{ return [{
index: 3, index: 3,
title: '代签收', title: '待签收',
icon: process.uniEnv.qn_base_url + 'daiqianshou.png', icon: process.uniEnv.qn_base_url + 'daiqianshou.png',
imageStyle: 'width:48rpx;height:48rpx' imageStyle: 'width:48rpx;height:48rpx'
}, },
......
...@@ -53,7 +53,15 @@ ...@@ -53,7 +53,15 @@
}, },
computed: { computed: {
title() { title() {
return this.info.finished ? '退件完成' : '退件中' // 退件中:32 已打回,其他:退件中
var text = '退件中'
for (var item of this.info.items) {
if (item.status == 32) {
text = '已打回'
break
}
}
return this.info.finished ? '退件完成' : text
}, },
total() { // 合计 total() { // 合计
var i = 0 var i = 0
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
return { return {
'1': '待审核', '1': '待审核',
'10': '待发货', '10': '待发货',
'15': '代签收', '15': '待签收',
'20': '已签收', '20': '已签收',
'-1': '已驳回', '-1': '已驳回',
'1': '已取消' '1': '已取消'
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
}, },
imageUrl() { imageUrl() {
let item = this.info.items[0] || {} let item = this.info.items[0] || {}
return item.images ? item.images.split(',').shift() : this.placeholderImage return item.images ? process.uniEnv.systemUrl.apiUrl + item.images.split(',').shift() : this.placeholderImage
}, },
total() { // 合计 total() { // 合计
var i = 0 var i = 0
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
data() { data() {
return { return {
pageNumber: 0, pageNumber: 0,
pageSize: 20, pageSize: 10,
partsList: [], partsList: [],
currentIndex: 0, currentIndex: 0,
loadStatus: 'loading', loadStatus: 'loading',
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
overflow: auto; overflow: auto;
.load-more-view { .load-more-view {
margin-bottom: 68rpx; padding-bottom: 64rpx;
} }
.loading-view { .loading-view {
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
.fixed-button { .fixed-button {
position: fixed; position: fixed;
right: 20rpx; right: 20rpx;
bottom: 140rpx; bottom: 64rpx;
} }
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
total: 100, total: 100,
search: { search: {
pageNumber: 0, pageNumber: 0,
pageSize: 50, pageSize: 30,
accessType: 1, accessType: 1,
}, },
}; };
......
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
} }
.load-more-view { .load-more-view {
margin-bottom: 20rpx; padding-bottom: 64rpx;
} }
.loading-view { .loading-view {
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
.fixed-button { .fixed-button {
position: fixed; position: fixed;
right: 20rpx; right: 20rpx;
bottom: 140rpx; bottom: 64rpx;
} }
} }
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<view class="label-content"> <view class="label-content">
<view v-for="(label, index) in labels" :key="index" class="label-item"> <view v-for="(label, index) in labels" :key="index" class="label-item">
<!-- 选中为蓝底,非选中状态为灰底 --> <!-- 选中为蓝底,非选中状态为灰底 -->
<view :class="['label-normal', {'selected': label.id == selectedId}]" <view :class="['label-normal', {'selected': label[keys[type]] == selectedId}]"
@click="handleClick(label)"> @click="handleClick(label, index)">
<text class="label-text">{{label.name}}</text> <text class="label-text">{{label[nameKeys[type]]}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -28,7 +28,10 @@ ...@@ -28,7 +28,10 @@
if (e && e.selectedId) { // 有已选中标签的id if (e && e.selectedId) { // 有已选中标签的id
this.selectedId = e.selectedId this.selectedId = e.selectedId
} }
if (e && e.partnerCompanyId) { // 有合作商id,获取品牌标签 if (e && e.categoryId) { // 有品类
this.type = '9'
this.getBrandList(e.categoryId)
} else if (e && e.partnerCompanyId) { // 有合作商id,获取品牌标签
this.type = '2' this.type = '2'
this.loadFileLabel(e.partnerCompanyId) this.loadFileLabel(e.partnerCompanyId)
} else { // 无合作商id,获取合作商标签 } else { // 无合作商id,获取合作商标签
...@@ -40,22 +43,39 @@ ...@@ -40,22 +43,39 @@
titles() { titles() {
return { return {
'1': '合作商', '1': '合作商',
'2': '品牌' '2': '品牌',
'9': ' ' // 配件品牌
}
},
keys() {
return {
'1': 'id', // 合作商
'2': 'id', // 品牌
'9': 'brandId' // 配件品牌
}
},
nameKeys() {
return {
'1': 'name', // 合作商
'2': 'name', // 品牌
'9': 'brandName' // 配件品牌
} }
} }
}, },
methods: { methods: {
// 选中标签 // 选中标签
handleClick(label) { handleClick(label, index) {
this.selectedId = label.id this.selectedId = label[this.keys[this.type]]
// 向上个页面传值 // 向上个页面传值
var pages = getCurrentPages(); var pages = getCurrentPages();
if (pages.length >= 2) { if (pages.length >= 2) {
var page = pages[pages.length - 2]; var page = pages[pages.length - 2];
page.selectedItem= { page.selectedItem = {
type: this.type, type: this.type,
id: this.selectedId id: this.selectedId,
item: label,
index: index
} }
} }
...@@ -75,7 +95,35 @@ ...@@ -75,7 +95,35 @@
this.labels = res.data || [] this.labels = res.data || []
} }
}, },
// 获取品牌
getBrandList(categoryId) {
this.$u.api.getBrandList({categoryId: categoryId}).then(res => {
if (res.code === 200) {
this.labels = res.data || []
// const data = res.data
// if (data.length > 0) {
// let item, index
// this.brand = data.map((v, i) => {
// if (id && parseInt(id) === v.brandId) {
// item = v
// index = i
// }
// v.label = v.brandName
// return v
// })
// if (item && index) {
// this.selectBrand(item, index)
// this.scrollId = `brand${item.brandId}`
// } else {
// this.brandId = this.brand[0].brandId
// this.lists = []
// this.getPartsList()
// }
// }
}
})
},
} }
}; };
</script> </script>
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
<view class="label-content"> <scroll-view scroll-x class="label-content" :scroll-into-view="scrollId[key]">
<view v-for="(label, ind) in item" :key="ind" class="label-item"> <view v-for="(label, ind) in item" :key="ind" class="label-item" :id="idText + label.id">
<!-- 选中为蓝底,非选中状态为灰底 --> <!-- 选中为蓝底,非选中状态为灰底 -->
<view :class="['label-normal', {'selected': label.id == selected[key].id}]" @click="handleClick(key, label)"> <view :class="['label-normal', {'selected': label.id == selected[key].id}]" @click="handleClick(key, label)">
<text class="label-text">{{label.name}}</text> <text class="label-text">{{label.name}}</text>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</view> </view>
<!-- 无供应商、无品牌 --> <!-- 无供应商、无品牌 -->
<view class="tag-tip-view" v-else-if="item.length <= 0">{{'暂无' + items[key]}}</view> <view class="tag-tip-view" v-else-if="item.length <= 0">{{'暂无' + items[key]}}</view>
</view> </scroll-view>
</view> </view>
</template> </template>
<view class="file-title">文件列表</view> <view class="file-title">文件列表</view>
...@@ -72,6 +72,10 @@ ...@@ -72,6 +72,10 @@
selected: { // 选中的标签 selected: { // 选中的标签
'1': {}, // 选中的合作商 '1': {}, // 选中的合作商
'2': {} // 选中的品牌 '2': {} // 选中的品牌
},
scrollId: {
'1': '', // 选中的合作商view的id
'2': '' // 选中的品牌view的id
}, },
loading: false, // 文件列表加载中 loading: false, // 文件列表加载中
tapLoading: { tapLoading: {
...@@ -79,7 +83,7 @@ ...@@ -79,7 +83,7 @@
'2': true // 品牌加载中 '2': true // 品牌加载中
}, },
orderFile: false, // 是否是订单详情进来 orderFile: false, // 是否是订单详情进来
fileList: {}, // 文件地址缓存 {url最后一段: tmpPath} fileList: {}, // 文件地址缓存 {url最后一段: tmpPath}
}; };
}, },
computed: { computed: {
...@@ -122,6 +126,9 @@ ...@@ -122,6 +126,9 @@
// 列表无数据的提示文字 // 列表无数据的提示文字
tipText() { tipText() {
return (this.selected['2'].name || this.orderFile) ? '暂无文件' : '请选择品牌' return (this.selected['2'].name || this.orderFile) ? '暂无文件' : '请选择品牌'
},
idText() {
return 'item'
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -143,6 +150,7 @@ ...@@ -143,6 +150,7 @@
for (var item of this.labels[selectedItem.type]) { for (var item of this.labels[selectedItem.type]) {
if (item.id == selectedItem.id) { if (item.id == selectedItem.id) {
this.handleClick(selectedItem.type, item) this.handleClick(selectedItem.type, item)
this.scrollId[selectedItem.type] = this.idText + selectedItem.id
return return
} }
} }
...@@ -152,6 +160,7 @@ ...@@ -152,6 +160,7 @@
// 选中标签 // 选中标签
handleClick(key, label) { handleClick(key, label) {
this.selected[key] = label this.selected[key] = label
this.scrollId[key] = ''
if (key == '1') { // 合作商 if (key == '1') { // 合作商
this.selected['2'] = {} // 清空选中品牌标签 this.selected['2'] = {} // 清空选中品牌标签
this.list = [] // 清空文件列表 this.list = [] // 清空文件列表
...@@ -316,7 +325,7 @@ ...@@ -316,7 +325,7 @@
} else { } else {
return 'P' return 'P'
} }
} },
} }
}; };
</script> </script>
...@@ -359,15 +368,12 @@ ...@@ -359,15 +368,12 @@
} }
.label-content { .label-content {
width: 100%; width: 100%;
display: flex; white-space: nowrap;
align-items: center;
overflow-x: auto;
min-height: 104rpx;
.label-item { .label-item {
padding-right: 20rpx; padding-right: 20rpx;
flex-shrink: 0; flex-shrink: 0;
display: inline-block;
.label-normal { .label-normal {
height: 104rpx; height: 104rpx;
width: 200rpx; width: 200rpx;
......
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
<view :id="`brand${item.brandId}`" :class="['label-title', { selected: item.brandId === brandId }]" v-for="(item, index) in brand" :key="index" @click="selectBrand(item, index)">{{ item.label }}</view> <view :id="`brand${item.brandId}`" :class="['label-title', { selected: item.brandId === brandId }]" v-for="(item, index) in brand" :key="index" @click="selectBrand(item, index)">{{ item.label }}</view>
</scroll-view> </scroll-view>
</view> </view>
<view class="more u-flex"> <view class="more u-flex" @click="handleClick">
<picker mode="selector" :value="brandIndex" range-key="label" :range="brand" @click="show = true" @change="changeBrand"> <!-- <picker mode="selector" :value="brandIndex" range-key="label" :range="brand" @click="show = true" @change="changeBrand"> -->
<view class="more-text">更多</view> <view class="more-text">更多</view>
</picker> <!-- </picker> -->
<u-icon class="input-icon" color="#2272FF" name="arrow-right"></u-icon> <u-icon class="input-icon" color="#2272FF" name="arrow-right"></u-icon>
</view> </view>
</view> </view>
...@@ -139,6 +139,16 @@ export default { ...@@ -139,6 +139,16 @@ export default {
this.getCategaryList() this.getCategaryList()
} }
} }
},
onShow() {
let pages = getCurrentPages();
let page = pages[pages.length - 1];
let selectedItem = page.selectedItem;
if (selectedItem) {
page.selectedItem = null
this.selectBrand(selectedItem.item, selectedItem.index)
this.scrollId = `brand${selectedItem.id}`
}
}, },
methods: { methods: {
// 获取品类 // 获取品类
...@@ -211,8 +221,8 @@ export default { ...@@ -211,8 +221,8 @@ export default {
return v return v
}) })
this.lists = this.lists.concat(lists) this.lists = this.lists.concat(lists)
this.pageNumber++ this.pageNumber++
this.loadStatus = lists.length < this.pageNumber ? "nomore" : "loadmore" this.loadStatus = lists.length < this.pageSize ? "nomore" : "loadmore"
} else { } else {
this.loadStatus = "nomore" this.loadStatus = "nomore"
} }
...@@ -259,7 +269,11 @@ export default { ...@@ -259,7 +269,11 @@ export default {
if (this.loadStatus !== "nomore") { if (this.loadStatus !== "nomore") {
this.getPartsList(); this.getPartsList();
} }
}, },
// 点击更多
handleClick() {
this.$u.route({url: 'pages/order/document-tag' + '?categoryId=' + this.categaryId + '&selectedId=' + this.brandId})
},
// 加入申请 // 加入申请
apply(item, index) { apply(item, index) {
this.$set(this.lists[index], 'disabled', false) this.$set(this.lists[index], 'disabled', false)
......
...@@ -196,6 +196,10 @@ export default { ...@@ -196,6 +196,10 @@ export default {
this.$u.toast('配件明细和备注不能同时为空') this.$u.toast('配件明细和备注不能同时为空')
return false return false
} }
if (this.$u.test.isEmpty(this.selectedParts)) {
this.$u.toast('请添加配件数量')
return false
}
return true return true
}, },
/** /**
......
...@@ -85,19 +85,19 @@ ...@@ -85,19 +85,19 @@
this.$u.route({type:'back'}) this.$u.route({type:'back'})
} }
if(this.isReturn){ if(this.isReturn){
uni.switchTab({ // uni.switchTab({
url: '/pages/index/mine', // url: '/pages/index/mine',
complete: () => { // complete: () => {
this.$nextTick(()=>{ // this.$nextTick(()=>{
uni.navigateTo({ // uni.navigateTo({
url: 'pages/mine/warehouse/return' // url: 'pages/mine/warehouse/return'
}); // });
}) // })
} // }
});
// uni.redirectTo({
// url: 'pages/mine/warehouse/return'
// }); // });
uni.redirectTo({
url: 'pages/mine/warehouse/return'
});
// var pages = getCurrentPages(); // var pages = getCurrentPages();
// if(pages.length >= 4) { // if(pages.length >= 4) {
// var prevPage = pages[pages.length - 4]; // var prevPage = pages[pages.length - 4];
......
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