Commit 4c0d73cc authored by Facius's avatar Facius

1.3第二轮bug修复

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