<template>
	<view class="about" v-if="!loading">
		<view class="shop-info about-content" v-if="title === '商城介绍'">
			<rf-image :src="detail.logo || detail.adminLogo || ''"></rf-image>
			<view v-if="detail.siteName"
				><text>商城名称: </text><text>{{ detail.siteName }}</text></view
			>
			<view v-if="detail.copyrightInfo"
				><text>版权: </text><text>{{ detail.copyrightInfo }}</text></view
			>

			<view v-if="detail.phone"
				><text>手机号码: </text><text>{{ detail.phone }}</text></view
			>

		</view>
		<view class="shop-info " v-if="title === '注册协议'">
			<view class="about-content" v-if="detail.siteRegisterProtocol">
				<rf-parser lazy-load :html="detail.siteRegisterProtocol"></rf-parser>
			</view>
			<rf-empty
				:info="`暂无${title}`"
				v-if="!detail.siteRegisterProtocol && !loading"
			></rf-empty>
		</view>
		<view class="shop-info" v-if="title === '隐私协议'">
			<view class="about-content" v-if="detail.crowdFundingProtocol">
				<rf-parser lazy-load :html="detail.crowdFundingProtocol"></rf-parser>
			</view>
			<rf-empty
				:info="`暂无${title}`"
				v-if="!detail.crowdFundingProtocol && !loading"
			></rf-empty>
		</view>
		<view class="shop-info" v-if="title === '开店协议'">
			<view class="about-content" v-if="detail.storeRegisterProtocol">
				<rf-parser lazy-load :html="detail.storeRegisterProtocol"></rf-parser>
			</view>
			<rf-empty
				:info="`暂无${title}`"
				v-if="!detail.storeRegisterProtocol && !loading"
			></rf-empty>
		</view>
			<view class="shop-info" v-if="title === '充值协议'">
    			<view class="about-content" v-if="detail.storeOpenProtocol">
    				<rf-parser lazy-load :html="detail.storeOpenProtocol"></rf-parser>
    			</view>
    			<rf-empty
    				:info="`暂无${title}`"
    				v-if="!detail.storeOpenProtocol && !loading"
    			></rf-empty>
    		</view>
		<rf-empty :info="`暂无${title}`" v-if="!detail && !loading"></rf-empty>
		<!--加载动画-->
		<rfLoading isFullScreen :active="loading"></rfLoading>
	</view>
</template>

<script>
/**
 * @des 关于商城详情
 *
 * @author 237524947@qq.com
 * @date 2019-12-09 10:13
 * @copyright 2019
 */
import { querybaseinfoset } from '@/api/basic';
import { merchantView } from '@/api/merchant';
export default {
	data() {
		return {
			detail: {},
			title: null,
			loading: true
		};
	},
	onLoad(options) {
		this.initData(options);
	},
	methods: {
		// 数据初始化
		initData(options) {
			this.title = options.title;
			uni.setNavigationBarTitle({
				title: options.title
			});
			this.getConfigList(options.field);
		},
		// 获取商城详情
		async getConfigList(field) {

				await this.$http
					.get(`${querybaseinfoset}`, {
						field
					})
					.then(r => {
						this.loading = false;
						this.detail = r;

					})
					.catch(() => {
						this.loading = false;
					});

		}
	}
};
</script>
<style lang="scss">
page {
	background-color: $page-color-base;
	position: relative;
	.about {
		.shop-info {
			.about-content {
				padding: $spacing-lg;
			}
			text-align: center;
			image {
				margin-top: 100upx;
				width: 240upx;
				height: 240upx;
				border-radius: 50%;
			}
		}
	}
}
</style>
