You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
301 lines
6.1 KiB
301 lines
6.1 KiB
<template>
|
|
<view class="goods">
|
|
<view class="search">
|
|
<view class="box">
|
|
<!-- <image src="/static/news/icon-search.png"></image>
|
|
<input type="search" placeholder="搜索订单" /> -->
|
|
<u-search height="50" @search="getListAfter" @custom="getListAfter" placeholder="商品名称"
|
|
v-model="keyword"></u-search>
|
|
</view>
|
|
</view>
|
|
<view class="goods-bd">
|
|
<view class="li" v-for="(i,index) in list" :key="index" v-if="list.length>0">
|
|
<view class="b">
|
|
<view class="item">
|
|
<view class="pic">
|
|
<image mode="aspectFill" :src="i.goods_image" />
|
|
</view>
|
|
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
|
<view class="info">
|
|
<view class="title">{{i.goods_name}}</view>
|
|
<view class="sku">
|
|
{{i.selling_point}}
|
|
</view>
|
|
<view class="fd">
|
|
<view class="price">¥<text>{{i.goods_price_max}}</text></view>
|
|
<view class="kc">库存{{i.stock_total}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="a">
|
|
<view class="status">商品状态:{{i.status==10?'上架':i.status==20?'下架':'未知'}}</view>
|
|
<view class="btn" @click.prevent="delHandle(i)">删除</view>
|
|
</view>
|
|
</view>
|
|
<u-empty text="暂无数据显示哦~" v-else mode="list"></u-empty>
|
|
</view>
|
|
<view class="goods-fd">
|
|
<view class="c" @click="toPage()">批量删除</view>
|
|
</view>
|
|
<u-toast ref="uToast" />
|
|
<u-modal v-model="show" content="确定删除此商品吗" :show-cancel-button="true" @cancel="show=false"
|
|
@confirm="delConfirm"></u-modal>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import * as newFunApi from '@/api/newFun'
|
|
export default {
|
|
data() {
|
|
return {
|
|
show: false,
|
|
list: [],
|
|
keyword: "",
|
|
total: 1,
|
|
pageNum: 1,
|
|
selected: {},
|
|
};
|
|
},
|
|
methods: {
|
|
toPage() {
|
|
uni.navigateTo({
|
|
url: "/pages/news/goods/del"
|
|
})
|
|
},
|
|
getListAfter() {
|
|
this.list = [];
|
|
this.getList()
|
|
},
|
|
async getList() {
|
|
uni.showLoading({
|
|
title: "加载中"
|
|
})
|
|
let {
|
|
status,
|
|
message,
|
|
data
|
|
} = await newFunApi.storeKeeperList({
|
|
goodsNo: "",
|
|
page: this.pageNum,
|
|
listType: "all",
|
|
goodsName: this.keyword
|
|
});
|
|
if (status == 200) {
|
|
uni.hideLoading();
|
|
this.list = this.list.concat(data.list.data)
|
|
this.total = data.list.total
|
|
}
|
|
},
|
|
async delConfirm() {
|
|
console.log(this.selected)
|
|
let goodsIds = []
|
|
goodsIds.push(this.selected.goods_id)
|
|
console.log(goodsIds)
|
|
let {
|
|
status,
|
|
message,
|
|
data
|
|
} = await newFunApi.delGoods({
|
|
goodsIds: goodsIds
|
|
});
|
|
|
|
if (status == 200) {
|
|
uni.hideLoading();
|
|
this.$toast('删除成功')
|
|
this.getListAfter()
|
|
}
|
|
},
|
|
delHandle(item) {
|
|
this.selected = item;
|
|
this.show = true
|
|
},
|
|
},
|
|
onReady() {
|
|
this.getList();
|
|
},
|
|
onReachBottom() {
|
|
if (this.list.length <= this.total) {
|
|
this.pageNum++;
|
|
this.getList();
|
|
}
|
|
},
|
|
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
::v-deep .u-input,
|
|
::v-deep .u-content {
|
|
background-color: #fff !important;
|
|
}
|
|
|
|
::v-deep .u-search {
|
|
width: 640rpx !important;
|
|
}
|
|
|
|
::v-deep .u-empty {
|
|
padding: 100rpx 0;
|
|
}
|
|
|
|
.goods {
|
|
padding: 0 0 130rpx;
|
|
overflow: hidden;
|
|
|
|
&-fd {
|
|
width: 100%;
|
|
padding: 20rpx;
|
|
overflow: hidden;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-sizing: border-box;
|
|
position: fixed;
|
|
left: 0;
|
|
bottom: 0;
|
|
z-index: 999;
|
|
background-color: #fff;
|
|
|
|
.c {
|
|
width: 630rpx;
|
|
line-height: 80rpx;
|
|
background: #FF564A;
|
|
border-radius: 80rpx;
|
|
text-align: center;
|
|
font-size: 28rpx;
|
|
font-weight: 500;
|
|
color: #FFFFFF;
|
|
}
|
|
}
|
|
|
|
.search {
|
|
width: 750rpx;
|
|
padding: 35rpx;
|
|
box-sizing: border-box;
|
|
|
|
.box {
|
|
padding: 15rpx 25rpx;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
align-items: center;
|
|
background: #fff;
|
|
border-radius: 60rpx;
|
|
|
|
image {
|
|
width: 28rpx;
|
|
height: 28rpx;
|
|
margin-right: 22rpx;
|
|
}
|
|
|
|
input {
|
|
flex: 1;
|
|
font-size: 28rpx;
|
|
line-height: 30rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
&-bd {
|
|
padding: 0 30rpx;
|
|
overflow: hidden;
|
|
|
|
.a {
|
|
padding: 15rpx 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
|
|
.status {
|
|
font-size: 28rpx;
|
|
font-weight: 400;
|
|
color: #B6B6B6;
|
|
}
|
|
|
|
.btn {
|
|
width: 148rpx;
|
|
line-height: 64rpx;
|
|
background: #FFFFFF;
|
|
border-radius: 64rpx;
|
|
text-align: center;
|
|
border: 1px solid #F55349;
|
|
font-size: 28rpx;
|
|
font-weight: 400;
|
|
color: #F55349;
|
|
}
|
|
}
|
|
|
|
.li {
|
|
overflow: hidden;
|
|
background-color: #fff;
|
|
padding: 0 30rpx;
|
|
margin-top: 15rpx;
|
|
|
|
&:first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.item {
|
|
padding: 20rpx 0;
|
|
overflow: hidden;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
border-bottom: 1px solid #EFEFEF;
|
|
|
|
.pic {
|
|
width: 160rpx;
|
|
height: 160rpx;
|
|
margin-right: 20rpx;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
.info {
|
|
flex: 1;
|
|
max-width: 400rpx;
|
|
margin-right: 20rpx;
|
|
|
|
.title {
|
|
font-size: 28rpx;
|
|
font-weight: 400;
|
|
color: #000000;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.sku {
|
|
line-height: 48rpx;
|
|
margin-top: 10rpx;
|
|
font-size: 28rpx;
|
|
font-weight: 400;
|
|
color: #7C7C7C;
|
|
}
|
|
|
|
.fd {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-top: 20rpx;
|
|
|
|
.price {
|
|
font-size: 32rpx;
|
|
font-weight: 400;
|
|
color: #ED2B00;
|
|
}
|
|
|
|
.kc {
|
|
font-size: 28rpx;
|
|
font-weight: 400;
|
|
color: #B6B6B6;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|