<template>
	<!-- 物流详情 -->
	<view class="back">
		<view class="top">
			<view class="explain">{{i18n.Channelspecification}}</view>
			<view class="u-flex u-row-between" style='margin-top:32rpx'>
				<text class="mode">{{i18n.Billingmode}}</text>
				<text class='mode'>{{i18n.Ladder}}</text>
			</view>
			<view class="u-flex u-row-between" style='margin-top:32rpx'>
				<text class='mode'>{{i18n.Chargeableweight}}</text>
				<text class='mode'>{{weight}}kg</text>
			</view>
			<view class="u-flex u-row-between" style='margin-top:32rpx'>
				<text class='mode'>{{i18n.Estimatedcost}}</text>
				<text class='mode'>¥{{money}}</text>
			</view>
		</view>
		<view class="top" style="margin-top: 20rpx;">
			<view class="explain">{{i18n.Itemtype}}</view>
			<view class="" style='margin-top:32rpx'>
				<view class="" v-if="language=='zh-CN'">
					<u-parse :content="contenttop.content_cn"></u-parse>
				</view>
				<view class="" v-if="language=='en-US'">
					<u-parse :content="contenttop.content_en"></u-parse>
				</view>
				<view class="" v-if="language=='es-ES'">
					<u-parse :content="contenttop.content_es"></u-parse>
				</view>
				<view class="" v-if="language=='it-IT'">
					<u-parse :content="contenttop.content_ita"></u-parse>
				</view>
			</view>
			<view style='margin-top:32rpx' class="explain">{{i18n.Channelrule}}</view>
			<view class="" style='margin-top:32rpx'>
				<view class="" v-if="language=='zh-CN'">
					<u-parse :content="content.content_cn"></u-parse>
				</view>
				<view class="" v-if="language=='en-US'">
					<u-parse :content="content.content_en"></u-parse>
				</view>
				<view class="" v-if="language=='es-ES'">
					<u-parse :content="content.content_es"></u-parse>
				</view>
				<view class="" v-if="language=='it-IT'">
					<u-parse :content="content.content_ita"></u-parse>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				weight: '',
				money: '',
				language: 'zh-CN',
				content:'',
				contenttop:''
			};
		},
		onLoad(options) {
			this.weight = options.weight
			this.money = options.money
		},
		onShow() {
			this.agreementtop()
			this.agreement()
			if (uni.getStorageSync('language') != '') {
				this.language = uni.getStorageSync('language')
			}
		},
		computed: {
			i18n() {
				return this.$t('index')
			}
		},
		methods: {
			agreement() {
				uni.$u.http
					.get("/api/agreement?code=channel_rule")
					.then((res) => {
						this.content = res
					})
					.catch(() => {});
			},
			agreementtop() {
				uni.$u.http
					.get("/api/agreement?code=goods_type")
					.then((res) => {
						this.contenttop = res
					})
					.catch(() => {});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.back {
		width: 750rpx;
		background: #F4F4F4;
		padding: 20rpx 24rpx;
		box-sizing: border-box;

		.mode {
			font-family: SFPro, SFPro;
			font-weight: 400;
			font-size: 28rpx;
			color: #555555;
			line-height: 32rpx;
			text-align: center;
			font-style: normal;
		}

		.explain {
			font-family: PingFangSC, PingFang SC;
			font-weight: 600;
			font-size: 32rpx;
			color: #222222;
			line-height: 44rpx;
			text-align: left;
			font-style: normal;
		}

		.top {
			width: 702rpx;
			// height: 316rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			padding: 32rpx 20rpx;
			box-sizing: border-box;
		}

		// .bottom {
		// 	width: 702rpx;
		// 	// height: 912rpx;
		// 	background: #FFFFFF;
		// 	border-radius: 16rpx;
		// }
	}
</style>