<template>
|
<view class="u-page">
|
<view class="u-demo-block-2">
|
<u-cell-group>
|
<u-cell v-for="(item, index) in list" :key="index"
|
>
|
<view slot="icon" class="f10">
|
<u-icon name="account"></u-icon>
|
</view>
|
<view slot="title" class="cell-title">{{ item.name }}</view>
|
<view slot="label" class="cell-lable">{{ item.contact }} {{ item.phone }}</view>
|
<view slot="value" class="cell-value" >
|
<u-icon name="edit-pen" @click="handleEdit(item)" size="40"></u-icon>
|
<u-icon name="trash" @click="handleDel(item)" size="40"></u-icon>
|
</view>
|
</u-cell>
|
</u-cell-group>
|
|
<u-button type="primary" text="新增" customStyle="margin-top: 50px; width:100%;" @click="handleAdd"></u-button>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
listApi:'/api/supplierSub/sub/all',
|
};
|
},
|
onLoad(options) {},
|
onShow() {
|
this.getList();
|
},
|
async onPullDownRefresh() {
|
this.getList();
|
},
|
methods: {
|
|
handleEdit(item) {
|
uni.navigateTo({
|
url: `/sub_pages/supplier/sub-account/sub-account-reg?id=${item.id}`
|
})
|
},
|
async handleDel(item) {
|
await this.$message.confirm('确定要删除吗?')
|
const {
|
code
|
} = await this.$http.request('post', `/api/supplierSub/delete/${item.id}`, {
|
data: {
|
|
}
|
})
|
if (code == 0) {
|
uni.$u.toast('删除成功');
|
this.getList();
|
} else {
|
|
}
|
|
},
|
handleAdd() {
|
uni.navigateTo({
|
url: '/sub_pages/supplier/sub-account/sub-account-reg'
|
})
|
},
|
// getList(refresh = false) {
|
// // /api/supplier/delivery
|
// if (this.currentInfo.id && (this.currentInfo.id !== this.cacheUserId || refresh)) {
|
// this.cacheUserId = this.currentInfo.id;
|
// let that = this;
|
// setTimeout(() => {
|
// //其他统计
|
// // #ifdef PUB_SUPPLIER
|
// this.$http.request('get', '/v2/wallet/supplier', {}).then(res => {
|
// if (res.code === 0) {
|
// that.wallet = res.data || {};
|
// }
|
// });
|
// // #endif
|
// }, 200);
|
// }
|
// }
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
.u-page {
|
font-size: 14px;
|
.image-icon {
|
width: 30rpx;
|
height: 30rpx;
|
}
|
|
.u-button--plain.data-v-3bf2dba7 {
|
background-color: #00BCD4 !important;
|
}
|
|
.u-button--plain.u-button--primary.data-v-3bf2dba7 {
|
color: #FFFFFF;
|
}
|
|
.u-button--primary.data-v-3bf2dba7 {
|
color: #fff;
|
border-color: #00BCD4 !important;
|
border-width: 1px;
|
border-style: solid;
|
border-radius: 10rpx;
|
width: 200rpx;
|
}
|
|
.u-demo-block {
|
padding: 10rpx;
|
background-color: #FFFFFF;
|
border-radius: 50rpx;
|
background-color: #00AF68;
|
margin: 20rpx;
|
|
.tixian {
|
margin-top: 30rpx;
|
margin-bottom: 30rpx;
|
}
|
}
|
|
.u-demo-block-2 {
|
margin: 30rpx;
|
padding: 10rpx;
|
background-color: #FFFFFF;
|
border-radius: 10rpx;
|
}
|
|
.title {
|
text-align: center;
|
font-size: 30rpx;
|
color: #909399;
|
margin: 10rpx;
|
}
|
|
.grid-text-white {
|
color: white;
|
}
|
|
.grid-text {
|
font-size: 14px;
|
color: #909399;
|
padding: 10rpx 0 20rpx 0rpx;
|
/* #ifndef APP-PLUS */
|
box-sizing: border-box;
|
/* #endif */
|
}
|
|
.statis_val {
|
font-size: 16px;
|
color: black;
|
// font-weight: bold;
|
}
|
|
.margin-10 {
|
margin: 10rpx;
|
}
|
.cell-title{
|
font-size: 12px;
|
}
|
.cell-lable{
|
font-size: 10px;
|
color: gray;
|
}
|
.cell-value{
|
display: flex;
|
justify-content: space-between;
|
width: 50px;
|
}
|
}
|
</style>
|
|