<script>
	import { get, post } from './Api/request.js'
	import { getShopInfo } from './components/common.js'
	
	export default {
		onLaunch: async function(options) {
			uni.removeStorageSync('liveId')
			// http://localhost:8082/web/?wxwork_userid=XiaoZhuShou9201#/pages/live/index?live_id=26&user_id=7319946&shopId=31
			let url = window.location.href.split('?')
			let length = url.length
			let Param = new URLSearchParams(url[length - 1])
			console.log('Param', Param)
			if(Param.get('shopId')) {
				uni.setStorageSync('orgin_shop_id', Param.get('shopId') * 1)
				let appId = uni.getStorageSync('appId')
				if(appId) {
					getShopInfo()
				}
			}
			
			uni.setStorageSync('from_page', window.location.href)
			
			let script = document.createElement('script');
			script.src = "https://tcsdk.com/player/tcplayer/release/v5.3.3/tcplayer.v5.3.3.min.js";
			document.head.appendChild(script);
		},
		onShow: function(options) {
			// #ifdef APP-PLUS
			uni.hideTabBar()
			// #endif
		},
		onHide: function() {
			
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-plus/index.scss";
	@import url("/static/icon/iconfont.css");
	@import url('https://tcsdk.com/player/tcplayer/release/v5.3.3/tcplayer.min.css');
	page {
		width: 100%;
		height: 100%;
		background: $uni-bg-color;
		overflow: auto;
		-webkit-text-size-adjust: 100%;
		font-family: 'Microsoft YaHei';
		position: static !important;
	}
	body{
		height: initial;
	}
	.tabbar .u-badge{
		position: absolute;
		left: 50%;
		margin-left: 4px;
		top: 4px;
	}
	uni-view uni-button, button {
		padding: 0;
		margin: 0;
		background-color: #fff;
	}
	button:after, uni-view uni-button:after{
		border:none;
	}
	.u-icon{
		display: inline-flex !important;
	}
	.u-transition{
		display: inline-block;
	}
	.u-tag-wrapper{
		display: inline-block;
	}
	.u-tag{
		display: inline-flex;
	}
	.u-tag+.u-tag {
	    margin-left: 4px;
	}
	.u-tag--mini{
		height: 18px !important;
		line-height: 18px !important;
		margin-right: 4px !important;
	}
	.solid{
		font-size: 22rpx;
		color: #888;
		border: 1rpx solid #999;
		display: inline-block;
		padding: 4rpx 8rpx;
		line-height: 1;
		border-radius: 3px;
	}
	.scrollbar::-webkit-scrollbar {
		width: 12px;
		height: 4px;
		color:#ffffff;
		display: block;
	}
	
	/*定义滚动条轨道 内阴影+圆角*/
	.scrollbar::-webkit-scrollbar-track {
		-webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
		box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
		border-radius: 6px;
		background-color:#FFFFFF;
		display: block;
	}
	
	/*定义滑块 内阴影+圆角*/
	.scrollbar::-webkit-scrollbar-thumb {
		border-radius: 6px;
		-webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
		box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
		background-color: #F14939;
		display: block;
	}
	.kuajing{
		background: linear-gradient(to bottom , #A500FF, #63009B);
		color: #fff;
		font-size: 22rpx;
		margin-right: 10rpx;
		display: inline-block;
		height: 32rpx;
		vertical-align: middle;
		width: 100rpx;
		border-radius: 6rpx;
		text-align: center;
		line-height: 32rpx;
	}
	.u-button{
		width: auto !important;
	}
	.u-number-box__plus, .u-number-box__minus{
		width: 25px !important;
		height: 25px !important;
	}
	.u-number-box__plus .u-icon__icon, .u-number-box__minus .u-icon__icon{
		font-size: 12px !important;
	}
	.u-number-box__input{
		background-color: #fff !important;
		height: 25px !important;
	}
	.flex3{
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.flex4{
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.flex5{
		display: flex;
		align-items: center;
	}
	.ellipsis{
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
	.ellipsis2{
		word-break: break-all;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}
	.welf{
		background: linear-gradient(to right , #FBE9CE, #FEDBAF);
		color: #444;
		font-size: 22rpx;
		margin-right: 10rpx;
		display: inline-block;
		height: 36rpx;
		vertical-align: middle;
		padding: 0 14rpx;
		border-radius: 6rpx;
		text-align: center;
		line-height: 36rpx;
		font-weight: 500;
	}
	.selfbuy{
		background: #FFCC13;
		color: #6F3405;
		font-size: 22rpx;
		margin-right: 10rpx;
		display: inline-block;
		height: 36rpx;
		vertical-align: middle;
		padding: 0 8rpx;
		border-radius: 6rpx;
		text-align: center;
		line-height: 36rpx;
		font-weight: 500;
	}
	.morez{
		margin-bottom: 10rpx;
		image{
			width: 45px;
			height: 18px;
			display: block;
			position: relative;
			z-index: 2;
		}
		.text{
			background-color: #FFE197;
			color: #77411F;
			line-height: 18px;
			padding: 0 8px 0 12px;
			font-size: 24rpx;
			border-radius: 0 5px 0 0;
			margin-left: -10px;
			font-weight: 600;
		}
		&.mini{
			image{
				width: 40px;
				height: 15px;
			}
			.text{
				font-size: 20rpx;
				line-height: 15px;
			}
		}
	}
	.mxjc{
		position: absolute;
		bottom: 10rpx;
		left: 12rpx;
		width: calc(100% - 24rpx);
		image{
			width: 67px;
			height: 17px;
		}
		.wb{
			background: #fff;
			padding: 10rpx 14rpx;
			line-height: 1;
			color: #3D3D3D;
			font-size: 18rpx;
			border-radius: 20rpx;
			box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
			width: fit-content;
			max-width: 100%;
			box-sizing: border-box;
		}
		&.mini{
			bottom: 6rpx;
			left: 8rpx;
			width: calc(100% - 16rpx);
			image{
				width: 46px;
				height: 11px;
			}
			.wb{
				padding: 4rpx 8rpx;
				font-size: 14rpx;
			}
		}
		&.large{
			image{
				width: 78px;
				height: 20px;
			}
			.wb{
				padding: 8rpx 12rpx;
				font-size: 22rpx;
			}
		}
	}
</style>
