| | |
| | | <template> |
| | | <view class="prodcut-list-wrap"> |
| | | <scroll-view scroll-y="true" :style="'height:' + scrollviewHigh + 'px;'" class="scroll-Y" lower-threshold="50" |
| | | <scroll-view scroll-y="true" :style="'height:' + (scrollviewHigh - 120) + 'px;'" class="scroll-Y" lower-threshold="50" |
| | | @scrolltolower="scrolltolowerFunc"> |
| | | <view class="shop"> |
| | | <view class="shop_head"> |
| | |
| | | <view class="shop_body" v-if="!loading"> |
| | | <view class="shop_body_l_item" v-for="(item,index) in product_list" :key="index" > |
| | | <view class="d-s-c mb20"> |
| | | <view class="shop_body_l_item_img"> |
| | | <view class="shop_body_l_item_img" @click="editProduct(item.product_id)"> |
| | | <image class="item_img" :src="item.product_image" mode="aspectFill"></image> |
| | | </view> |
| | | <view class=" flex-1"> |
| | | <view class="shop_body_l_item_info_title h1">{{item.product_name}}</view> |
| | | <view class="shop_body_l_item_info_title h1" @click="editProduct(item.product_id)">{{item.product_name}}</view> |
| | | <view class="shop_body_l_item_info_price h2 red">¥<text class="h1">{{item.product_price}}</text></view> |
| | | <view class="d-b-c"> |
| | | <view>库存:{{item.product_stock}}</view> |
| | | <button class='shop_body_b_btn edit-btn' @click="editProduct(item.product_id)">编辑</button> |
| | | <button v-if="type_active=='sell'" type="warn" class='shop_body_b_btn' @click="operation(item.product_id,20)">下架</button> |
| | | <text v-if="type_active=='audit'" class="audit_txt">审核中</text> |
| | | <button v-if="type_active=='lower'" type="warn" class='shop_body_b_btn' @click="operation(item.product_id,10)">上架</button> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="d-c-c p30" v-if="product_list.length==0 && !loading"> |
| | | <text class="iconfont icon-wushuju"></text> |
| | | <text class="cont">亲,暂无相关记录哦</text> |
| | | </view> |
| | | <uni-load-more v-else :loadingType="loadingType"></uni-load-more> |
| | | </view> |
| | | <view class="d-c-c p30" v-if="product_list.length==0 && !loading"> |
| | | <text class="iconfont icon-wushuju"></text> |
| | | <text class="cont">亲,暂无相关记录哦</text> |
| | | </view> |
| | | <uni-load-more v-else :loadingType="loadingType"></uni-load-more> |
| | | </scroll-view> |
| | | |
| | | <!-- 添加商品按钮 --> |
| | | <view class="add-product-btn" @click="addProduct"> |
| | | <text class="btn-text">+ 添加商品</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | self.getData(self.type_active); |
| | | |
| | | }) |
| | | }, |
| | | |
| | | // 添加商品 |
| | | addProduct() { |
| | | uni.navigateTo({ |
| | | url: '/pages/user/my_shop/product_add?shop_supplier_id=' + this.shop_supplier_id |
| | | }); |
| | | }, |
| | | |
| | | // 编辑商品 |
| | | editProduct(product_id) { |
| | | uni.navigateTo({ |
| | | url: '/pages/user/my_shop/product_edit?product_id=' + product_id + '&shop_supplier_id=' + this.shop_supplier_id |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | font-size: 23rpx; |
| | | margin-right: 26rpx; |
| | | } |
| | | |
| | | /* 添加商品按钮样式 */ |
| | | .add-product-btn { |
| | | width: 90%; |
| | | height: 70rpx; |
| | | background-color: #e62423; |
| | | color: #fff; |
| | | border-radius: 35rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin: 20rpx auto; |
| | | font-size: 28rpx; |
| | | box-shadow: 0 4rpx 10rpx rgba(230, 36, 35, 0.3); |
| | | } |
| | | |
| | | .btn-text { |
| | | color: #fff; |
| | | } |
| | | |
| | | /* 编辑按钮样式 */ |
| | | .edit-btn { |
| | | background-color: #409eff; |
| | | color: #fff; |
| | | } |
| | | </style> |