<template>
	<view>
		<back></back>
		<u-image @load="load" :src="src"
			mode="widthFix"></u-image>
		<view v-if="show" class="bottom-bar" style="background-color: #5034c5;margin-top: -30rpx;">
			<button class="cu-btn round text-bold"
				style="width: 100%;height: 100upx;font-size: 36upx;background-color: #f9b12b;color: #5034C6;"
				@click="nav">加入代理</button>
		</view>
		<loading ref="loading" type="3" />
	</view>
</template>

<script>
	import back from "../../comps/back.vue"
	export default {
		components: {
			back
		},
		data() {
			return {
				src:'',
				show: false
			}
		},
		onLoad(options) {
			this.$refs.loading.showLoading()
			this.fetchDetail()
			if (this.$isNotEmpty(options.scene)) {
				let salesmanId = decodeURIComponent(options.scene)
				salesmanId && this.$cache.put('salesmanId', salesmanId)
			}
		},
		methods: {
			fetchDetail() {
				let params = {
					paramKey: 'agent_detail' || '-1'
				}
				this.$api.wxApp.appParams(params).then(res => {
					this.src=res.data.paramValue
				})
			},
			nav() {
				uni.navigateTo({
					url: "agent"
				})
			},
			load() {
				this.show = true
				this.$refs.loading.hide()
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
