<template>
	<view class="page">
		<navBar title="换新商品" :back="true" color="black" background="white" />

		<view class="con">
			<view class="item" v-for="(item,index) in list" @click="goDetail(item)">
				<view class="topBox">
					<image :src="picBase+item.cover" mode=""></image>
				</view>
				<view class="bottom">
					<view class="txt">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		<u-loadmore style="" loadmoreText="已经到底啦" color="#CCCCCC" lineColor="#CCCCCC" line />
	</view>
</template>

<script>
	import {
		getSerBackGoodsReq,
		getMallReq,
	} from '@/api/test/index.js'
	export default {
		components: {

		},
		data() {
			return {
				list: [],
				picBase: this.$picBase
			}
		},
		async onLoad(options) {

		},
		async onShow() {
			let res = await getMallReq({
				isAfterSale: 1
			})
			if (res.code == 0) {
				console.log('售后商品列表返回值:', res);
				this.list = res.data
			} else {
				uni.showToast({
					title: res.message,
					icon: 'none'
				})
			}
		},
		methods: {
			goDetail(item) {
				getApp().mallItem = item
				getApp().isSellBack = false
				uni.navigateTo({
					url: '/pages/my/actGoodsDetail/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>