|
@@ -1,51 +1,51 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
- <navigation-bar :title="title" background-color="#fff" front-color="#000000" />
|
|
|
|
-
|
|
|
|
- <u-button v-if="active==1" style="width: 20%;margin-left: 6px;" type="primary" @click="addGoods()">新增商品</u-button>
|
|
|
|
- <u-list v-if="active==1" class="list" width="100%" @scrolltolower="scrolltolower1">
|
|
|
|
|
|
+ <uni-nav-bar color="#fff" height="60" left-icon="back" @clickLeft="back()" @clickRight="rightClick()"
|
|
|
|
+ right-text="新增商品" :border="false" backgroundColor="#0081ff" title="商品管理" />
|
|
|
|
+ </u-navbar>
|
|
|
|
+
|
|
|
|
+ <u-list class="list" width="100%" @scrolltolower="scrolltolower">
|
|
<u-list-item v-for="(item, index) in goods" :key="index">
|
|
<u-list-item v-for="(item, index) in goods" :key="index">
|
|
- <view class="card" ><!-- @click="toDetails(item.id)" -->
|
|
|
|
- <view class="card-body">
|
|
|
|
- <image
|
|
|
|
- src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
|
|
|
|
- mode="aspectFill" class="img">
|
|
|
|
- </image>
|
|
|
|
- <view class="txt">
|
|
|
|
- <view style="font-size: 30rpx;height: 140rpx;">{{item.goodsName}}</view>
|
|
|
|
- <view class="piece">{{item.price}} 元</view>
|
|
|
|
- </view>
|
|
|
|
- <u-button class="custom-style" type="primary" @click="editGoods(item.id)">编辑</u-button>
|
|
|
|
- <u-button class="custom-style" type="error" @click.stop="deleteGoods(item.id)">删除</u-button>
|
|
|
|
|
|
+ <view class="item-box">
|
|
|
|
+ <view class="goods-item">
|
|
|
|
+ <u-row>
|
|
|
|
+ <u-col span="5" @click="toDetails(item.id)">
|
|
|
|
+ <u--image :showLoading="true" src="" width="270rpx" height="220rpx"></u--image>
|
|
|
|
+ </u-col>
|
|
|
|
+ <u-col span="7">
|
|
|
|
+ <view class="t1 txt" @click="toDetails(item.id)">
|
|
|
|
+ <text>{{item.goodsName}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="txt">
|
|
|
|
+ <text v-if="item.grossWeight">{{item.grossWeight}}吨</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="txt" v-if="item.tradeAreaName">
|
|
|
|
+ <u-tag style="width: 250rpx" :text="item.tradeAreaName" plain size="mini"></u-tag>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="t4">
|
|
|
|
+ <view class="price">¥{{item.price}}</view>
|
|
|
|
+ <view class="edit" @click="editGoods(item.id)">
|
|
|
|
+ <u-icon color="#fff" name="edit-pen-fill" size="30"></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="delete" @click="deleteGoods(item.id)">
|
|
|
|
+ <u-icon color="#fff" name="warning-fill" size="30"></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </u-col>
|
|
|
|
+ </u-row>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</u-list-item>
|
|
</u-list-item>
|
|
- <u-loadmore v-if="goods" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore" margin-bottom="50" />
|
|
|
|
</u-list>
|
|
</u-list>
|
|
-
|
|
|
|
- <u-list v-if="active==2" class="list" width="100%" @scrolltolower="scrolltolower2">
|
|
|
|
- <u-list-item v-for="(item, index) in orders" :key="index">
|
|
|
|
- <view class="card" ><!-- @click="toDetails(item.id)" -->
|
|
|
|
- <view class="card-body">
|
|
|
|
- <image
|
|
|
|
- src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
|
|
|
|
- mode="aspectFill" class="img">
|
|
|
|
- </image>
|
|
|
|
- <view class="txt">
|
|
|
|
- <view style="font-size: 30rpx;height: 140rpx;">{{item.goodsName}}</view>
|
|
|
|
- <view class="piece">{{item.price}} 元</view>
|
|
|
|
- </view>
|
|
|
|
- <u-button class="custom-style" type="primary" @click="orderConfirm(item.id,1)">确认</u-button>
|
|
|
|
- <u-button class="custom-style" type="warning" @click="orderConfirm(item.id,2)">拒绝</u-button>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </u-list-item>
|
|
|
|
- <u-loadmore v-if="orders" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore" margin-bottom="50" />
|
|
|
|
- </u-list>
|
|
|
|
-
|
|
|
|
- <order v-if="active==3"></order>
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<view class="tab">
|
|
<view class="tab">
|
|
- <view :class="active==item.id ? 'active-btn' : 'tabBtn'" v-for="item in tabList" :key="item.id" @click="tabClick(item.id)">{{item.name}}</view>
|
|
|
|
|
|
+ <!-- <view class="tabBtn" @click="BtnClick(1)">
|
|
|
|
+ <u-icon label="商品列表" size="30" color="#ef732a" labelColor="#ef732a" name="shopping"></u-icon>
|
|
|
|
+ </view> -->
|
|
|
|
+ <view class="tabBtn" @click="BtnClick()">
|
|
|
|
+ <u-icon label="订单列表" size="30" color="#1E90FF" labelColor="#1E90FF" name="order"></u-icon>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -59,18 +59,7 @@
|
|
goods: [],
|
|
goods: [],
|
|
orders: [],
|
|
orders: [],
|
|
item: {},
|
|
item: {},
|
|
- active: 1,
|
|
|
|
- title: '商品管理',
|
|
|
|
- tabList: [
|
|
|
|
- {
|
|
|
|
- id: 1,
|
|
|
|
- name: "商品列表"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 2,
|
|
|
|
- name: "订单列表"
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -114,139 +103,118 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- // 新增商品
|
|
|
|
- addGoods() {
|
|
|
|
- this.$common.to('/pages/goodsManage/oneMarket/addGoods')
|
|
|
|
- },
|
|
|
|
// 编辑商品
|
|
// 编辑商品
|
|
editGoods(id) {
|
|
editGoods(id) {
|
|
this.$common.to('/pages/goodsManage/oneMarket/editGoods?id='+id)
|
|
this.$common.to('/pages/goodsManage/oneMarket/editGoods?id='+id)
|
|
},
|
|
},
|
|
- scrolltolower1() {
|
|
|
|
|
|
+ scrolltolower() {
|
|
this.getTransitList()
|
|
this.getTransitList()
|
|
},
|
|
},
|
|
-
|
|
|
|
- // 订单列表
|
|
|
|
- getOrderTransitList() {
|
|
|
|
- this.form = {
|
|
|
|
- isOrders: 1,//是否已被下单[0=未被下单,1=已被下单]
|
|
|
|
- enterpriseConfirm: 0,//商铺确认情况[0=待确认,1=已确认,2=拒绝]
|
|
|
|
- goodsStatus: 1,//商品状态(0=下架,1=在售)
|
|
|
|
- }
|
|
|
|
- this.http.request({
|
|
|
|
- url: '/level-one-server/app/TbGoodsTransit/getTransitList',
|
|
|
|
- data: this.form,
|
|
|
|
- method: 'POST',
|
|
|
|
- success: resp => {
|
|
|
|
- console.log('resp',resp)
|
|
|
|
- this.orders = resp.data.data;
|
|
|
|
- /* this.orders.forEach((item, index) => {
|
|
|
|
- if (index === this.orders.length - 1) {
|
|
|
|
- this.loadmoreStatus = 'nomore'
|
|
|
|
- } else {
|
|
|
|
- this.loadmoreStatus = 'loadmore'
|
|
|
|
- }
|
|
|
|
- }) */
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ BtnClick(type) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/goodsManage/oneMarket/goodsOrders'
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- // 商家确认
|
|
|
|
- orderConfirm(id,status) {
|
|
|
|
- this.form = {
|
|
|
|
- id: id,
|
|
|
|
- //isOrders: 0,//是否已被下单[0=未被下单,1=已被下单]
|
|
|
|
- enterpriseConfirm: status,//商铺确认情况[0=待确认,1=已确认,2=拒绝]
|
|
|
|
- //goodsStatus: 1,//商品状态(0=下架,1=在售)
|
|
|
|
- }
|
|
|
|
- this.http.request({
|
|
|
|
- url: '/level-one-server/app/TbGoodsTransit/update',
|
|
|
|
- data: this.form,
|
|
|
|
- method: 'POST',
|
|
|
|
- success: resp => {
|
|
|
|
- console.log('resp',resp)
|
|
|
|
- uni.showToast({ title: '操作成功' });
|
|
|
|
- }
|
|
|
|
|
|
+ back() {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/index'
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- scrolltolower2() {
|
|
|
|
- this.getTransitList()
|
|
|
|
|
|
+ rightClick() {
|
|
|
|
+ this.$common.to('/pages/goodsManage/oneMarket/addGoods')
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- change(index) {
|
|
|
|
- console.log(index)
|
|
|
|
- this.active = index
|
|
|
|
- },
|
|
|
|
- tabClick(id) {
|
|
|
|
- this.active = id
|
|
|
|
- if(id==1) {
|
|
|
|
- this.title='商品管理'
|
|
|
|
- this.getTransitList()
|
|
|
|
- }else if(id==2) {
|
|
|
|
- this.title='订单确认'
|
|
|
|
- this.getOrderTransitList()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ }/* ,
|
|
|
|
+ onNavigationBarButtonTap(e) { //导航栏新增商品按钮
|
|
|
|
+ this.$common.to('/pages/goodsManage/oneMarket/addGoods')
|
|
|
|
+ } */
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
|
- .custom-style {
|
|
|
|
- width: 20%;
|
|
|
|
- height: 100rpx;
|
|
|
|
- font-size: 20rpx;
|
|
|
|
- }
|
|
|
|
|
|
+<style lang="scss">
|
|
|
|
+
|
|
.list {
|
|
.list {
|
|
- height: 90%;
|
|
|
|
|
|
+ height: auto;
|
|
border-radius: 10rpx;
|
|
border-radius: 10rpx;
|
|
- background-color: #fff;
|
|
|
|
|
|
+ margin: 15rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .card {
|
|
|
|
- padding: 10rpx;
|
|
|
|
|
|
+ .goods-item {
|
|
|
|
+ margin-bottom: 8rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .card-body {
|
|
|
|
- display: flex;
|
|
|
|
- height: 300rpx;
|
|
|
|
- width: 100%;
|
|
|
|
- /* border: #888 1rpx solid; */
|
|
|
|
- box-shadow: 1rpx 1rpx #888;
|
|
|
|
|
|
+ .item-box {
|
|
|
|
+ height: 230rpx;
|
|
|
|
+ width: 90%;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ border: 1rpx #FFF solid;
|
|
|
|
+ margin: 10rpx 0rpx;
|
|
border-radius: 10rpx;
|
|
border-radius: 10rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .img {
|
|
|
|
- height: 300rpx;
|
|
|
|
- width: 300rpx;
|
|
|
|
- margin-right: 10rpx;
|
|
|
|
|
|
+ .txt {
|
|
|
|
+ /* height: 50rpx; */
|
|
|
|
+ margin-bottom: 20rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .txt {
|
|
|
|
- padding: 10rpx;
|
|
|
|
- width: 300rpx;
|
|
|
|
|
|
+ .t1 {
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ word-wrap: break-word;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 1rpx;
|
|
|
|
+ right: 5rpx;
|
|
}
|
|
}
|
|
|
|
|
|
- .piece {
|
|
|
|
- margin: 50rpx 10rpx;
|
|
|
|
- color: red;
|
|
|
|
|
|
+ .t4 {
|
|
|
|
+ display: flex;
|
|
position: relative;
|
|
position: relative;
|
|
- top: 50rpx;
|
|
|
|
- /* left: 5rpx; */
|
|
|
|
|
|
+ bottom: 1rpx;
|
|
|
|
+ right: 5rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .price {
|
|
|
|
+ color: #ef732a;
|
|
|
|
+ width: 400rpx;
|
|
|
|
+ font-weight: bold;
|
|
}
|
|
}
|
|
- .tab{
|
|
|
|
- position: absolute;
|
|
|
|
|
|
+
|
|
|
|
+ .edit {
|
|
|
|
+ background-color: #0081ff;
|
|
|
|
+ width: 60rpx;
|
|
|
|
+ height: 60rpx;
|
|
|
|
+ border-radius: 30rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ }
|
|
|
|
+ .delete {
|
|
|
|
+ background-color: indianred;
|
|
|
|
+ width: 60rpx;
|
|
|
|
+ height: 60rpx;
|
|
|
|
+ border-radius: 30rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ }
|
|
|
|
+ .tab {
|
|
|
|
+ position: fixed;
|
|
bottom: 1rpx;
|
|
bottom: 1rpx;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100rpx;
|
|
height: 100rpx;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
- border-top: #CFCFCF 1rpx solid;
|
|
|
|
|
|
+ border-top: #ffffff 1rpx solid;
|
|
|
|
+ background-color: #ffffff;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
|
|
- .tabBtn{
|
|
|
|
|
|
+ .tabBtn {
|
|
width: 35%;
|
|
width: 35%;
|
|
height: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
display: flex;
|
|
@@ -254,13 +222,4 @@
|
|
justify-content: center;
|
|
justify-content: center;
|
|
margin: 0 30rpx;
|
|
margin: 0 30rpx;
|
|
}
|
|
}
|
|
- .active-btn{
|
|
|
|
- width: 35%;
|
|
|
|
- height: 100%;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: center;
|
|
|
|
- color: #fff;
|
|
|
|
- background-color: #00BFFF;
|
|
|
|
- }
|
|
|
|
</style>
|
|
</style>
|