<script>
|
export default {
|
data() {
|
return {
|
query: {
|
stationId: '',
|
stationName: '',
|
},
|
list: []
|
}
|
},
|
onLoad(options) {
|
this.getList()
|
// this.list = [{}, {}]
|
},
|
|
async onPullDownRefresh() {
|
this.page.current = 1
|
await this.getList()
|
uni.stopPullDownRefresh()
|
},
|
methods: {
|
async getList() {
|
this.$message.showLoading()
|
const {
|
code,
|
data
|
} = await this.$http.request('get', '/api/delivery/station/list', {
|
params: {
|
name: this.query.stationName
|
}
|
})
|
|
this.$message.hideLoading()
|
if (code == 0) {
|
this.list = data || []
|
}
|
},
|
|
toDetail(item) {
|
uni.navigateTo({
|
url: `/sub_pages/partner/delivery/delivery?stationId=${item.stationId}&stationName=${item.name}`
|
})
|
},
|
showAll(){
|
uni.navigateTo({
|
url: `/sub_pages/partner/delivery/delivery`
|
})
|
}
|
}
|
}
|
</script>
|
<template>
|
<!-- 列表页面 -->
|
<view class="page-delivery">
|
<view class="p15" style="min-height: calc(100vh - 260rpx);">
|
<view class="search-container m-t-12 flex">
|
<view class="flex1 input">
|
<u-input placeholder="请输入集货站名称" v-model="query.stationName">
|
<template slot="suffix">
|
<uni-icons color="#20613D" type="search" size="24" @click="getList"></uni-icons>
|
</template>
|
</u-input>
|
</view>
|
</view>
|
<view class="search-container m-t-12 flex">
|
<view class="m-l-a m-r-0 w-fit" @click="showAll" >查看全部>></view>
|
</view>
|
|
|
|
|
<no-data v-if="!list||list.length===0" style="width: 100%;"></no-data>
|
<view v-for="(item,index) in list" :key="index" class="m-b-24">
|
<view class="delivery-item bg-white br-4 p10 flex">
|
<view class="m-r-10">
|
<image src="/static/common/icon-station.png" class="icon-station m-r-10 img100 icon"></image>
|
</view>
|
<view class="flex1">
|
<view class="title">
|
{{ item.name }}
|
</view>
|
|
<view class="flex">
|
<view class="form-item flex1">
|
<view class="form-item-label">类型</view>
|
<view class="form-item-value">{{ item.typeStr || '-' }}</view>
|
</view>
|
<view class="form-item flex1">
|
<view class="form-item-label">供货数</view>
|
<view class="form-item-value t-red">{{ item.totalNum || '0' }}</view>
|
</view>
|
|
</view>
|
|
|
<view class="flex buttons">
|
<view class="button button-0 m-l-a m-r-0" @click="toDetail(item)">
|
查看详情
|
</view>
|
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
|
|
</view>
|
</template>
|
|
<style lang="scss" scoped>
|
.page-delivery {
|
.delivery-item {
|
.icon-station {
|
width: 72rpx;
|
height: 72rpx;
|
}
|
|
.title {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #000000;
|
line-height: 40rpx;
|
}
|
|
.form-item {
|
line-height: 40rpx;
|
font-size: 28rpx;
|
color: #666;
|
display: flex;
|
|
.form-item-label {
|
min-width: 120rpx;
|
}
|
|
.form-item-label::after {
|
content: ":";
|
margin-right: 20rpx;
|
}
|
}
|
|
.buttons {
|
display: flex;
|
margin-left: auto;
|
width: fit-content;
|
|
.button {
|
// width: 216rpx;
|
padding: 10rpx 20rpx;
|
line-height: 34rpx;
|
font-size: 24rpx;
|
height: 34rpx;
|
background: #20613D;
|
text-align: center;
|
border-radius: 30rpx;
|
|
}
|
|
.button-1 {
|
background: #fff;
|
color: #333;
|
border: 2rpx solid #333;
|
|
}
|
|
.button-0 {
|
color: #fff;
|
border: 2rpx solid #20613D;
|
}
|
}
|
}
|
|
.search-container {
|
display: flex;
|
margin: 12rpx 0rpx 20rpx 0rpx;
|
position: relative;
|
z-index: 1;
|
|
.input {
|
// flex: 1;
|
// max-width: 400rpx;
|
background-color: #fff !important;
|
// line-height: 58rpx;
|
// height: 58rpx;
|
border-radius: 8rpx;
|
}
|
|
.button {
|
min-width: 120rpx;
|
max-width: 120rpx;
|
margin-left: auto;
|
margin-right: 0rpx;
|
text-align: right;
|
line-height: 70rpx !important;
|
// height: 58rpx !important;
|
// display: flex;
|
}
|
}
|
}
|
</style>
|