<template>
	<view class="page">

		<view class="list_info">
			<view class="item" v-for="(item,index) in list">
				<view class="avator">
					<image class="icon" :src="item.image" mode="aspectFill" />
				</view>
				<view class="left">
					<view class="name">{{item.name}}</view>
					<view class="jindu">
						<view class="bord">
							<view class="active" :style="'width:' + item.num_bfb + '%;'"></view>
						</view>
						<text class="tips">{{item.num_bfb}}%</text>
					</view>
				</view>
				<text class="right">
					<block v-if="item.status == 1">
						<view class="btn_submit">邀请助力</view>
					</block>
					<block v-if="item.status == 2">
						<view class="state" @click="onLinqu">待发货</view>
					</block>
					<block v-if="item.status == 9">
						<view class="state">已发货</view>
					</block>

				</text>
			</view>
			<view class="blankHeight"></view>
		</view>

		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				tab: 1,
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				list: []
			}
		},
		onLoad() {
			// setTimeout(function() {
			// 	uni.setNavigationBarColor({
			// 		frontColor: '#ffffff',
			// 		backgroundColor: '#00000000',
			// 		animation: {
			// 			duration: 400,
			// 			timingFunc: 'easeIn'
			// 		}
			// 	})
			// }, 200);
		},
		onShow() {
			this.loadData();
		},
		methods: {
			onBack() {},
			checkTab(tab) {
				this.tab = tab;
				// this.loadData();
			},
			onLinqu() {
				return;
				this.$refs['DialogBox'].confirm({
					title: '',
					content: '你还没有维护收货地址，请先维护收货地址！',
					DialogType: 'inquiry',
					btn1: '我知道了',
					btn2: '编辑地址',
					animation: 0
				}).then(() => {

					// getApp().globalData.skey = "";
					// uni.removeStorageSync("wapptoken")
					// uni.redirectTo({
					// 	url: '/pages/index/login',
					// })
					// uni.navigateBack();
					// uni.sendNativeEvent("logout","tt", function(e){
					// 	//关闭当前小程序
					// 	console.log("sendNativeEvent-----------回调"+JSON.stringify(e));
					// });
				})
			},
			scroll: function(e) {
				console.log(e)
				this.old.scrollTop = e.detail.scrollTop
			},
			loadData() {
				uni.request({
					url: this.$apiHost + '/Wish/getMyList',
					data: {
						uuid: getApp().globalData.uuid,
					},
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						console.log("res", res.data)
						this.list = res.data.list;
					}
				});
			},
		}
	}
</script>

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