<!-- pages/member/CommodityManagement/CommodityManagement.wxml -->
<view class="goods-manage">
	<van-search  value="{{ goods_name }}"   bind:search="onSearch"
  bind:cancel="onCancel" placeholder="请输入商品名称" bind:change="onChange" />
	<view class="release-goods">
		<view class="release-a">
			<icon class="iconfont icon-block"></icon>
		</view>
		<view class="span">商品数量：{{goods_length}}</view>
		<view class="release-b" catchtap="routeTake">
			<view class="span">发布商品</view>
		</view>
	</view>
	<view class="goods-list">
		<view class="goods-list" wx:for="{{commodity_data}}"  wx:key="index">
			<view class="goods-a">
				<image wx:if="{{type ==='store'}}" src="{{item.change_thumb}}" mode='widthFix' />
				<image wx:if="{{type ==='supplier'}}" src="{{item.change_thumb}}" mode='widthFix' />
			</view>
			<view class="ul goods-b">
				<view class="title-box">
					<view class="li name">
						{{item.title}}
					</view>
					<view wx:if="{{type ==='store'&&goods_audit!= 1}}" class="p {{item.status===0?'red':'gray'}}" data-index="{{index}}"
								data-item="{{item}}" catchtap="changeGoodsStatus">
						<text class="span">点击</text>
						{{item.status === 0 ?'上架':'下架'}}
					</view>
					<view wx:if="{{type !=='store'&& goods_audit!= 1}}" class="p {{item.status===1?'red':'gray'}}" catchtap="changeGoodsStatus"
								data-index="{{index}}" data-item="{{item}}">
						{{item.status === 1 ?'上架':'下架'}}
					</view>
				</view>
				<view class="li status {{item.status===1?'red':'gray'}}" wx:if="{{type==='store'}}">
					状态：{{item.status === 1 ?'上架':'下架'}}
				</view>
				<view class="li price">
					<text class="span">{{language['money']}}</text>
					{{item.price}}
				</view>
				<view class="li info">
					<view class="font">库存：{{item.stock}}</view>
					<view class="font">销量：{{item.virtual_sales+item.real_sales}}</view>
					<view class="span morebtn" data-index="{{index}}" catchtap="moreEvent">
						<icon class="iconfont icon-more"></icon>
					</view>
					<view class="more" wx:if="{{item.edit_active}}">
						<view class="top">
							<view class="ul">
								<view class="li" data-index="{{index}}" catchtap="editJumpEvent">
									<icon class="iconfont icon-edit"></icon>
									<view class="span">编辑</view>
								</view>
								<view class="li" data-index="{{index}}" catchtap="commodityDelete">
									<icon class="iconfont icon-delete"></icon>
									<view class="span">删除</view>
								</view>
							</view>
						</view>
						<view class="bottom">
							<view class="icon">
								<icon class="iconfont icon-down"></icon>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</view>
