<template>
	<view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
		<tm-menubars title="消息列表" :shadow="0" :showback="true"></tm-menubars>
		<div class="zhuti">
			<tm-sheet class="kuang" style="padding-bottom: 30px !important;">
				<view style="width: 94%;margin:0 auto;" class="remen">
					<view v-for="(item,index) in listdata"  class="round-5 contone black mt-20" :class="index%2==0?'fl':'fr'" @click="goDetail(item.category_id)">
						<image class="logo" :src="item.image" mode="widthFix"></image>
						<view class="pa-15 text-size-s">
							<view class="text-overflow-2">
								<text class="text-size-lg">{{item.goods_name}}</text>
								<view class="text-gray mt-6">销量：{{item.stock_num}}</view>
							</view>
							<view class="mt-2 flex-between flex-center">
								<view class="touxiang mt-30">
									<text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
								</view>
								<view >
									<image @click="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
								</view>
							</view>
						</view>
					</view>
					<view style="clear: both;"></view>
					<view style="clear: both;" class="more ma-40 pt-40" @click="gengmore()" v-if="listdata.length!=0">
						<image src="/static/img/30.png" mode="widthFix"></image>
						<text class="text-size-s">下拉加载更多~</text>
					</view>
				</view>
			</tm-sheet>
			<view style="height:60px"></view>
		</div>
		<!-- 弹出层消息 -->
		<tm-message ref="toast"></tm-message>
	</view>
</template>	
<script>
import{myRequest} from '@/api/request.js'
export default {
	data() {
		return {
			typeclick:1,
			listdata:[],
			soId:'',
			page:1,
			pagesize:8
		};
	},
	onLoad(op) {
		console.log(op);
		this.soId=op.id
	},
	created() {
		this.sys = uni.getSystemInfoSync();
		// this.randouh()
		this.getSort()
	},
	methods: {
		gengmore(){
			// this.randouh()
		},
		jiarufuFun(data){
			uni.navigateTo({
				url: "/pages/gouwuche/index",
			})
			// console.log(data)
			// this.gouwuche.push(data)
		},
		getSort(){
			let that=this;
			myRequest({
				url:'/api/ShopGoods/childrenClassificationList',
				method:'post',
				data:{id:that.soId,page:that.page,pagesize:that.pagesize}
			}).then(res=>{
				if(res.data.code==200){
					console.log(res.data.data.data,'liebiao');
					that.listdata=res.data.data.data;
				}else{
					that.$refs.toast.show({
						model: 'error',
						label: res.data.msg
					})
				}
			})
		},
		goindex(){
			uni.navigateBack();
		},
		
		goDetail(id){
			uni.navigateTo({
				url:'/pages/shouyedetail/index?cartId='+id
			})
		},
		
		change(e){
			console.log(e)
		},
		sosoFun(){
		}
	},
}
</script>

<style lang="scss">
	/deep/ .tm-menubars .body{
		background-color: #1b1b1b !important;
	}
	/deep/ .zhuti{padding: 10px 10px;}
	/deep/ .kuang{margin:0 !important;padding: 0px !important;}
	/deep/ .icon-search{
		font-size: 23px !important;
		color: #8E8E93 !important;
	}
	/deep/ .tm-search{
		width: 66%;
		background-color: #414141 !important;
		border-radius: 10px;
	}
	/deep/ .tm-search .grey-darken-5{
		background-color: #414141 !important;
	}
	.dingwei{width: 21%;margin-top:3%;}
	.shuruk{width: 77%;}
	.sousuo{width:94%;margin:0 auto;}
	.quxiao{color: #707070;line-height: 47px;}
	.contone{width: 48%;}
	.logo{width: 100%;}
	.remenzan{width: 18px !important;margin-top: 10px;}
	.more{text-align: center;}
	.more image{margin-right: 10px;vertical-align: middle;width: 30px;}
</style>
