<template>
	<!-- 电影票首页 -->
	<view class="content">
		<view class="stote-Logo">
			<image class="img" src="https://img.agrimedia.cn/chwl%2Fv2%2Ffilm-bgs.png" mode="widthFix"></image>
		</view>
		<view class="stote-operate">
			<view class="Stote-Infor">
				<view class="Stote-Infor-order">
					<navigator url="/pages/film/filmIndex" hover-class="none">
						<view class="Stote-Infor-order-Status">
							<view class="img-box">
								<image class="img" src="https://img.agrimedia.cn/chwl%2Fv2%2F20220919-105839.png"></image>
							</view>
						</view>
					</navigator>
					<view class="Stote-Infor-order-OrderS" @tap="oreder">
						<view class="img-box">
							<image class="img" src="https://img.agrimedia.cn/chwl%2Fv2%2F20220919-105844.png"></image>
						</view>
					</view>
				</view>
				<view class="service" @tap="location">
					<image class="img" src="https://img.agrimedia.cn/chwl%2Fv2%2F20220919-105847.png"></image>
				</view>
			</view>
		</view>
		
		<b-load :show="loading" width="79" height="80" background="rgba(0,0,0,0.3)" type="load"></b-load>
		<u-modal :show="show" @confirm="show = false" title="温馨提示" content='部分影院出票时间可能滞后，请提前进行预定，避免出票失败或电影开始后仍未出票'></u-modal>
	</view>
</template>

<script>
	// 共用混入
	import mixin from '@/static/js/mixin/mixin.js';
	// 客服链接
	import {
		DYPCHAT
	} from '@/static/js/serviceurl.js';
	import { getCityId, getFilmCity } from '@/request/film/index.js';
	import { mapGetters, mapMutations } from 'vuex';
	export default {
		mixins:[mixin],
		data() {
			return {
				loading: true,
				// 温馨提示
				show:true
			}
		},
		onLoad() {
			this.getCity();
			this.SETBRANDINFOR({
				brand_id: 19,
				brand_name:'电影票'
			});
			// 设置微信分享标识
			this.$wx.miniProgram.postMessage({
				data:{
					title: '电影票——天天带女朋友看电影的神器！影院，享受不一样！',
					imageUrl:'https://img.agrimedia.cn/chwl/dyp/dypshare.jpg',
					ISH5:true,
					CallbackUrl:'https://jc.agrimedia.cn/privilege/pages/restaurant/index/index_dyp',
				}
			});
		},
		computed: {
			...mapGetters({
				// 获取用户设备定位的地址
				UserArae2: 'GetcityInfor',
				// 获取品牌Id
				BrandInfor: 'shopping/BrandInfor',
			}),
		},
		methods:{
			...mapMutations({
				SETFILMDATA: 'SETFILMDATA',
				SETBRANDINFOR: 'shopping/SETBRANDINFOR'
			}),
			// 订单
			oreder(){
				uni.navigateTo({
					url:'/pages/film/filmForm'
				})
			},
			/**
			 * @跳转客服
			 * */
			service() {
				window.location.href = DYPCHAT;
				return
				uni.openCustomerServiceChat({
					extInfo: {
						url: DYPCHAT,
					},
					corpId: 'ww4f46b491a045158c',
			
					success(e) {
						// console.log(e)
					},
					fail(e) {
						// console.log(e)
					}
				})
			},
			
			/**
			 * @获取城市ID
			 * */
			getCity() {
				let city = this.UserArae2.city.replace("市", "");	
				getFilmCity().then((res) => {
					res.data.map(item => {
						if (item.cityName == city) {
							// 首先获取电影城市ID
							const FilmCity = {
								cityId: item.cityId,
								cityName: item.cityName,
								regionName: "",
								regionId: ""
							}
							this.loading = false;
							this.SETFILMDATA(FilmCity);
						}
					})
				});
			},
		}
	}
</script>

<style lang="scss">
	page {
		max-height: 100%;
		min-height: 100%;
		height: 100%;
	}

	.content {
		width: 100%;
		height: 100vh;
		position: relative;
		overflow: hidden;
	}
	.stote-Logo {
		.img {
			width: 100%;
			height: 100vh !important;
			vertical-align: bottom;
		}
	}

	.stote-operate {
		width: 100%;
		min-height: 60vh;
		height: auto;
		box-sizing: border-box;
		position: absolute;
		bottom: 0rpx;
	}

	.Stote-Infor {
		width: 100%;
		min-height: 60vh;
		border-radius: 20rpx 20rpx 0rpx 0rpx;
		padding: 32rpx;
		box-sizing: border-box;
		backdrop-filter: blur(24px);
		border-top: 1rpx solid rgba(255,255,255,0.39);
		background: rgba(255,255,255,0.17);
		backdrop-filter: blur(24px);
		&-order {
			display: flex;
			justify-content: space-between;
			margin-bottom: 24rpx;

			&-Status,
			&-OrderS {
				width: 310rpx;
				height: 340rpx;
				border-radius: 15rpx;
				// padding: 32rpx;
				box-sizing: border-box;
				position: relative;

				.img-box {
					width: 100%;
					height: 100%;
					position: absolute;
					right: 0;
					bottom: 0;
					.img {
						width: 100%;
						height: 100%;
					}
				}

				&-Title {
					font-size: $FONTSIZE36;
					color: #000000;
					line-height: 80rpx;
					font-weight: 700;
				}

				&-text {
					font-size: $FONTSIZE25;
					color: $THEMECOLOR4;
				}
			}
		}

		.service {
			width: 100%;
			height: 180rpx;
			&-img {
				width: 100%;
				height: 180rpx;
			}
			.img {
				width: 100%;
				height: 180rpx;
			}
			.icon-chat {
				display: flex;
				align-items: center;
			}
			.text {
				font-size: $FONTSIZE36;
				font-weight: 700;
				flex: 1;
				box-sizing: border-box;
			}

		}
	}
</style>
