<template>
	<view class="detail-page">
		<!-- 使用自定义导航栏 -->
		<custom-navbar title="服务详情" :show-back="true" :showUser="false" titleColor="#000" :show-headle="false"></custom-navbar>


		<!-- 主图区域 banner -->
		<view class="main-image-section">
			<swiper class="banner-swiper" circular :indicator-dots="false" :autoplay="false" :interval="3000"
				:duration="500" indicator-active-color="#fff" indicator-color="rgba(255, 255, 255, 0.6)">
				<swiper-item v-if="serviceInfo.video">
					<video :src="serviceInfo.video" v-if="serviceInfo.video && showVideo" id="myVideo"
						class="banner-image" :autoplay="true" :controls="false" :muted="isMuted"
						:enable-progress-gesture="false" :loop="true" object-fit="cover">
					</video>
					<view class="video-controls">
						<!-- <view class="control-btn" @click="togglePlay">
			  <image :src="isPlaying ? '/static/images/pause.png' : '/static/images/play.png'" class="control-icon"></image>
			</view> -->
						<view class="control-btn" @click="toggleMute">
							<image
								:src="isMuted ? 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b5cd6211-99fb-4ddc-b358-6e0fa74de9a6' : 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/802a82a1-9786-49e9-9647-28062486682f'"
								class="control-icon"></image>
						</view>
					</view>
					<text class="banner-tag">{{1}}/{{serviceInfo.photo.length + 1}}</text>
				</swiper-item>
				<swiper-item v-for="(item, index) in serviceInfo.photo" :key="index"
					@click="previewImage(serviceInfo.photo, index)">
					<image :src="item" mode="aspectFill" class="banner-image" referrer="no-referrer"></image>
					<text class="banner-tag"
						v-if="serviceInfo.video">{{index+2}}/{{serviceInfo.photo.length + 1}}</text>
					<text class="banner-tag" v-else>{{index+1}}/{{serviceInfo.photo.length}}</text>
				</swiper-item>
			</swiper>
		</view>

		<!-- 服务信息 -->
		<view class="service-header-price">
			<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cabdfdbd-aeff-42c5-993e-45520265ea60.png" class="service-header-price-bj"></image>
			<view class="service-price">
				<text class="price-symbol">¥</text>
				<text class="price-value">{{ serviceInfo.server_price}}</text>
				<text class="price-discount" v-if="serviceInfo.line_price">{{ serviceInfo.line_price }}</text>
			</view>
		</view>
		<view class="service-info">

			<view class="service-title">
				<text class="service-type">自营</text>
				<text class="title-text">{{serviceInfo.title}}</text>
			</view>
		</view>


		<!-- <view class="service-shop" v-if="serviceInfo.server_kind == 2">

			<view class="shop-info">
				<image class="shop-logo" :src="serviceInfo.shop_head_photo" mode="aspectFill"
					@click="goShopHome(serviceInfo.publish_user_id)"></image>
				<view class="shop-info-you">
					<text class="shop-name">{{serviceInfo.shop_name}}</text>
					<view class="stars"></view>
					<view class="shop-class-w">
						<text class="shop-class">主营：{{serviceInfo.shop_class.substr(1)}}</text>
					</view>

					<view class="shop-time" style="width:480rpx">
						<text class="shop-class">营业时间：{{serviceInfo.shop_business_time}}</text>
					</view>
				</view>
			</view>
			<view class="shop-cont">
				<view class="shop-cont-left">
					<view>
						<text class="shop-address">{{serviceInfo.shop_dependency}}{{serviceInfo.shop_address}}</text>
					</view>
					<view>
						<text class="shop-tell">电话:{{serviceInfo.phone}}</text>
					</view>
				</view>
				<view class="shop-cont-right">
					<image
						src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5ae95582-d1da-4243-b44d-e828c2b1929c"
						class="shop-headle" mode="aspectFit" @click="openMap">
					</image>
					<image
						src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dfd64c82-8ea7-478e-93b6-e65cdfbfaa71"
						class="shop-headle" mode="aspectFit" @click="goContact(serviceInfo.phone)"></image>
				</view>
			</view>
		</view> -->

		<!-- 手艺人区域 -->
		<!-- <view class="service-syr" v-if="serviceInfo.server_kind == 1">
			<image class="syr-head" v-if="syrInfo.head_photo" :src="syrInfo.head_photo" mode="aspectFill"></image>
			<view class="syr-info">
				<text class="syr-name">{{syrInfo.name}}</text>
			</view>
			<view class="look-btn" @click="goSyrHome(serviceInfo.publish_user_id)">
				<text class="look-text">进入逛逛</text>
			</view>
		</view> -->

		<serviceRadio v-model="serviceType" @change="radioChange"></serviceRadio>
		<selectStore v-if="serviceType ==2" :id="serviceInfo.id"></selectStore>
		<selectAdress v-if="serviceType ==1" :id="serviceInfo.id" :serviceInfo="serviceInfo"></selectAdress>

		<evaluationList :order_shop_id="serviceInfo.id" :order_shop_type="1" v-if="serviceInfo.id" @goList="goList">
		</evaluationList>


		<!-- 到家地址以及服务时间 -->
		<!-- <view class="user-choice" v-if="serviceInfo.server_kind == 1">
	  <view class="choice-item" @click="goAddressList">
		<text class="choice-tit">到家地址</text>
		<view class="choice-cont">
			<view class="address-left">
			  <image src="/static/images/position_icon.png" class="address-icon" mode=""></image>
			  <text class="choice-text">玉琢礼小区</text>
			</view>
			<image src="/static/images/arrow_right.png" class="enter-icon" mode="aspectFit"></image>
		</view>
	  </view>
	  <view class="choice-item">
	  	<text class="choice-tit">服务时间</text>
	  	<view class="choice-cont">
		  <text class="choice-text">三天内可预约</text>
	  	  <image src="/static/images/arrow_right.png" class="enter-icon" mode="aspectFit"></image>
	  	</view>
	  </view>
	</view> -->
		<!-- 评论区域 -->
		<!-- <view class="comments-section">
      <view class="section-title">
		<text class="section-num">评价({{comments.length}})</text>
		<view class="look-all">
			<text class="look">查看全部</text>
			<image src="/static/images/arrow_right.png" class="enter-icon" mode="aspectFit"></image>
		</view>
	  </view>
      <view class="comment-list">
        <view class="comment-item" v-for="(item, index) in comments" :key="index">
		  <view class="comment-left">
			<view class="comment-header">
			  <image :src="item.avatar" class="user-avatar"></image>
			  <view class="comment-user-info">
			    <text class="user-name">{{item.userName}}</text>
				<view class="user-two">
			      <text class="comment-tab">{{item.tab}}</text>
			      <text class="comment-type">{{item.type}}</text>
				</view>
			  </view>
			</view>
			<text class="comment-content text-overflow">{{item.content}}</text>
		  </view>
          <view class="comment-images" v-if="item.images && item.images.length">
            <image 
              :src="item.images[0]" 
              mode="aspectFill"
              class="comment-image"
            ></image>
          </view>
        </view>
      </view>
    </view> -->

		<!-- 项目说明 -->
		<view class="notice-section">
			<view class="section-title">
				<text class="section-tit">项目说明</text>
			</view>
			<view class="notice-content">
				<view class="notice-cont">
					<text class="notice-title">
						服务时长：
					</text>
					<text class="notice-text">
						{{serviceInfo.server_time}}分钟
					</text>
				</view>
				<view class="notice-cont" v-for="(item,i) in serviceInfo.detail" v-if="item.text && item.title">
					<text class="notice-title">
						{{item.title}}：
					</text>
					<text class="notice-text">
						{{item.text}}
					</text>
				</view>
			</view>
		</view>
		<!-- 图文详情 -->
		<imgAndText v-if="serviceInfo.graphic_details" :info="serviceInfo.graphic_details"></imgAndText>

		<!-- 步骤 -->
		<view class="notice-section">
			<view class="section-title">
				<text class="section-tit">项目步骤</text>
			</view>
			<view class="notice-content">
				<view class="notice-cont" v-for="(item,i) in serviceInfo.process">
					<text class="notice-title">
						{{item.title}}：
					</text>
					<text class="notice-text">
						{{item.text}}
					</text>
				</view>
			</view>
		</view>
		<!-- 订购须知 -->
		<view class="notice-section">
			<view class="section-title">
				<text class="section-tit">订购须知</text>
				<!-- <view class="section-tit-right">
		  <text class="rule-text">取消、退款、赔付规则</text>
		  <image src="/static/images/arrow_right.png" class="enter-icon" mode="aspectFit"></image>
		</view> -->
			</view>
			<view class="notice-content">
				<text class="notice-text">
					{{serviceInfo.purchasenotes}}
				</text>
			</view>
		</view>

		<!-- 底部按钮 -->
		<view class="bottom-bar">
			<!-- <view class="lianxi" @click="goContact(serviceInfo.phone)">
	  	<image src="/static/images/tell_icon.png" class="lianxi-icon" mode=""></image>
		<text class="lianxi-text">联系TA</text>
	  </view> -->
			<view class="submit-btn" 
				@click="submitOrder"
				:class="{
				'cannot-submit': syrInfo.order_taking == 2 || sjInfo.order_taking == 2,
				'disabled-btn': !isFormValid
				}">
				<text class="btn-text">立即预约</text>
			</view>
		</view>


		<!-- 获取权限提示匡内容 -->
		<view class="permission" :class="{ transform: isShowPer }">
			<text class="per-tit">美融融plus 对拨打电话权限申请说明</text>
			<text class="per-cont">当您需要联系商家或平台客服的时候，需要获取拨打电话权限。</text>
		</view>

		<selfPay ref="selfPayRef" :show="showPay" @change="e=>showPay=e.show" :serviceInfo="serviceInfo" :serviceType="serviceType">
		</selfPay>
	</view>
</template>

<script>
	import {
		handleImgSize
	} from '@/utils/service.js'
	import request from '../../utils/request'
	import CustomNavbar from '@/components/custom-navbar/custom-navbar.vue'
	import _public from '../../utils/public'
	import locationService from '../../utils/locationService';
	import permissionUtils from '../../utils/per'
	import evaluationList from '@/pages/evaluate/components/evaluationList'
	import imgAndText from './components/imgAndText'
	import serviceRadio from './components/service-radio'
	import selectStore from './components/select-store'
	import selectAdress from './components/select-adress'
	import selfPay from './components/self-pay'

	export default {
		components: {
			CustomNavbar,
			evaluationList,
			imgAndText,
			serviceRadio,
			selectStore,
			selectAdress,
			selfPay,
		},
		data() {
			return {
				showPay: false,
				sjCount: 0, //商家列表个数
				syrCount: 0, //手艺人列表个数
				isShowPer: false,
				showVideo: false,
				time: '12:30',
				date: '今天',
				isMuted: true,
				serviceType: "",
				latitude: "38.366667",
				longitude: "117.333333",
				serviceInfo: {
					"id": null,
					"title": null,
					"server_price": null,
					"server_time": null,
					"line_price": null,
					"sales_num": 0,
					"photo": [],
					"video": null,
					"first_class_id": null,
					"second_class_id": null,
					"detail": [],
					"process": [],
					"purchase_notes": null,
					"publish_user_id": null,
					"server_kind": null,
					"state": null,
					"add_time": null,
					"approve_user_id": null,
					"approve_time": null,
					"is_hot": null,
					"is_delete": null,
					"doorto_price": null
				},
				syrInfo: {},
				sjInfo: {},
				videoContext: null,
				// 评价
				comments: [{
					userName: '山河*明月',
					avatar: '/static/images/avatar1.jpg',
					time: '2024-01-20',
					content: '工作非常专业，态度很好，第一次来，非常满意，下次还会来',
					images: ['/static/images/comment1.jpg', '/static/images/comment2.jpg'],
					tab: '超出期待',
					type: '双色法式美甲'
				}]
			}
		},

		computed: {
			isFormValid() {
			// 检查表单是否填写完成
			if (!this.serviceType) {
				return false;
			}
			
			if (this.serviceType == 2) {
				// 到店服务：检查是否选择了商家
				return Object.keys(this.$store.state.selectStore).length > 0;
			} else {
				// 到家服务：检查地址、人员、时间是否都已选择
				const hasAddress = Object.keys(this.$store.state.reservationAddress).length > 0;
				const hasSyr = Object.keys(this.$store.state.reservationSyr).length > 0;
				const hasTime = Object.keys(this.$store.state.reservationTime).length > 0;
				
				return hasAddress && hasSyr && hasTime;
			}
			}
		},
		
		beforeCreate() {
			// #ifdef APP-NVUE
			const domModule = uni.requireNativePlugin('dom')
			// 2. 加载 DINPro 粗体（700）
			domModule.addRule('fontFace', {
				fontFamily: 'DINPro', // 统一字体族名，通过 fontWeight 区分字重
				src: "url('static/Font/DIN-Bold.otf')",
				fontStyle: 'normal',
				fontWeight: '700' // 对应粗体，和 CSS 字重一致
			});

			// 3. 加载 DINPro 常规（400）
			domModule.addRule('fontFace', {
				fontFamily: 'DINPro', // 同一字体族名
				src: "url('static/Font/DIN-Regular.otf')",
				fontStyle: 'normal',
				fontWeight: '400' // 常规字重
			});

			// 4. 加载 DINPro 中等粗体（500）
			domModule.addRule('fontFace', {
				fontFamily: 'DINPro',
				src: "url('static/Font/DINPro-Medium.otf')",
				fontStyle: 'normal',
				fontWeight: '500' // 中等粗体
			});
			console.log('字体规则添加完成')
			// #endif
		},
		onLoad(option) {
			//清除选择的信息
			this.$store.commit("clearServiceState")
			//获取当前经纬度
			let addressRes = uni.getStorageSync("userAdrees") || getApp().globalData.addressRes;
			this.latitude = addressRes.latitude;
			this.longitude = addressRes.longitude;
			request.post('/user/serversSelf/details', {
				id: Number(option.id),
				province: addressRes.pcode,
				city: addressRes.cCode,
			}).then(res => {
				console.log(res)
				if (res.data.server_kind == 1) {
					this.getSyrDetail(res.data.publish_user_id)
				} else if (res.data.server_kind == 2) {
					this.getSjDetail(res.data.publish_user_id)
				}
				if (uni.getSystemInfoSync().platform === 'android') {
					this.$nextTick(() => {
						this.serviceInfo = res.data;
					});

				} else {
					this.serviceInfo = res.data;
				}
			})
		},
		mounted() {
			this.videoContext = uni.createVideoContext('myVideo', this); // 绑定 video 实例
		},
		onShow() {
			this.showVideo = true;
			if(this.$refs.selfPayRef){
				this.$refs.selfPayRef.clearSubmit()
			}
		},
		onHide() {
			this.showVideo = false;
		},
		methods: {
			//服务类型变换时
			radioChange(e) {
				if (e == 1) {
					// let obj = {
					// 	id:e,
					// 	userLngz:this.longitude,
					// 	userLat:this.latitude,
					// 	page:1,
					// 	limit:1,
					// }
					// request.post('/user/serversSelf/sjList',obj).then(res => {
					// 	if(res.code==200){
					// 		this.sjCount = res.data.count;
					// 	}else{
					// 		uni.showToast({
					// 			title: res.msg || "错误",
					// 			icon: "none",
					// 		});
					// 	}

					// }).catch(err => {
					// 	console.log(err)
					// })
				}
			},
			async goInvite() {
				let imageUrl =
					'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40'
				if (this.serviceInfo.photo[0]) {
					try {
						// 直接调用导入的函数，不要加 this
						const processedUrl = await handleImgSize(this.serviceInfo.photo[0]);
						console.log("处理后的图片地址：", processedUrl);
						// 赋值给组件数据
						imageUrl = processedUrl;
					} catch (err) {
						console.error("处理失败：", err);
					}
				}


				uni.share({
					provider: "weixin",
					scene: "WXSceneSession",
					type: 5,
					title: `${this.serviceInfo.title} ${this.serviceInfo.server_price}元(以详情为主)`,
					miniProgram: {
						id: 'gh_89c92e18b70b', // 小程序原始ID
						path: `/subPackages/service/detail?id=${this.serviceInfo.id}`, //小程序路径
						type: this.$store.state.wxShareType, // 正式版:0，测试版:1，体验版:2
						webUrl: "https://www.baidu.com/",
					},
					// href:"https://www.baidu.com/",
					imageUrl: imageUrl, // 分享主图（建议300*300以上）
					success: function(res) {
						console.log("success:" + JSON.stringify(res));
					},
					fail: function(err) {
						uni.share({
							provider: "weixin",
							scene: "WXSceneSession",
							type: 5,
							title: `${this.serviceInfo.title} ${this.serviceInfo.server_price}元(以详情为主)`,
							miniProgram: {
								id: 'gh_89c92e18b70b', // 小程序原始ID
								path: `/subPackages/service/detail?id=${this.serviceInfo.id}`, //小程序路径
								type: this.$store.state.wxShareType, // 正式版:0，测试版:1，体验版:2
								webUrl: "https://www.baidu.com/",
							},
							// href:"https://www.baidu.com/",
							imageUrl: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40', // 分享主图（建议300*300以上）
							success: function(res) {
								console.log("success:" + JSON.stringify(res));
							},
							fail: function(err) {
								console.log("fail:" + JSON.stringify(err));
							}
						});
					}
				});
			},
			goAddressList() {
				uni.navigateTo({
					url: '/subPackages/address/list?select=true'
				})
			},
			// 获取店铺或者手艺人详情
			getSyrDetail(id) {
				request.post('/user/syrdetail', {
					id
				}).then(res => {
					this.syrInfo = res.data;
				}).catch(err => {
					console.log(err)
				})
			},
			// 获取店铺详情
			getSjDetail(id) {
				request.post('/user/sjdetail', {
					id
				}).then(res => {
					this.sjInfo = res.data;
				}).catch(err => {
					console.log(err)
				})
			},
			//跳转评论列表
			goList() {
				uni.navigateTo({
					url: `/pages/evaluate/evaluationList?order_shop_id=${this.serviceInfo.id}&order_shop_type=1`
				})
			},
			// 跳转店铺详情
			goShopHome(id) {
				uni.navigateTo({
					url: '/pages/user/store-detail?id=' + id
				})
			},
			// 跳转手艺人详情
			goSyrHome(id) {
				uni.navigateTo({
					url: '/pages/user/syr-detail?id=' + id
				})
			},
			// 开启或关闭声音
			toggleMute() {
				this.isMuted = !this.isMuted;
			},
			previewImage(urls, current) {
				uni.previewImage({
					urls: urls,
					current: current
				})
			},
			submitOrder() {
				console.log('点击了', this.syrInfo, this.sjInfo)
				this.isLogin = uni.getStorageSync('accessToken') ? true : false;
				if (!this.isLogin) {
					uni.showModal({
						title: '登录提醒',
						content: '您暂未登录，无法预约服务，是否前去登录？',
						confirmColor: '#F1AC66',
						success(e) {
							if (e.confirm) {
								// uni.oprPresentLogin()
								uni.navigateTo({
									url: '/pages/blogPopup/blogPopup'
								});
							}
						}
					})
					return;
				};
				if (this.syrInfo.order_taking == 2 || this.sjInfo.order_taking == 2) return;
				if (!this.serviceType) {
					uni.showToast({
						title: "请选择服务类型",
						icon: "none",
					});
					return
				}
				if (this.serviceType == 2) {

					if (Object.keys(this.$store.state.selectStore).length == 0) {
						uni.showToast({
							title: "请选择商家",
							icon: "none",
						});
						return
					}
				} else {
					if (Object.keys(this.$store.state.reservationAddress).length == 0) {
						uni.showToast({
							title: "请选择到家地址",
							icon: "none",
						});
						return
					}
					if (Object.keys(this.$store.state.reservationSyr).length == 0) {
						uni.showToast({
							title: "请选择服务人员",
							icon: "none",
						});
						return
					}
					if (Object.keys(this.$store.state.reservationTime).length == 0) {
						uni.showToast({
							title: "请选择时间",
							icon: "none",
						});
						return
					}
				}
				this.showPay = true
			},
			// 显示权限说明弹窗
			showPermissionDialog(title, content) {
				return new Promise((resolve) => {
					uni.showModal({
						title,
						content,
						confirmText: '去开启',
						success(res) {
							resolve(res.confirm);
						}
					});
				});
			},
			async goContact(phone) {
				const systemInfo = uni.getSystemInfoSync();

				// #ifdef MP-WEIXIN
				// 小程序环境直接拨打电话
				uni.makePhoneCall({
					phoneNumber: phone
				});
				// #endif

				// #ifdef APP-PLUS
				// App 环境处理权限
				if (typeof plus !== 'undefined') {
					try {
						let permission = 'android.permission.CALL_PHONE';
						this.isShowPer = true;

						const firstRequest = !plus.storage.getItem(`perm_${permission}`);
						if (firstRequest) {
							this.isShowPer = true;
						}

						// 检查权限
						const {
							granted
						} = await permissionUtils.checkPermission('phone', '需要拨打电话权限，方便您联系商家或平台');
						if (granted) {
							this.isShowPer = false;
							uni.makePhoneCall({
								phoneNumber: phone
							});
							return;
						}

						this.isShowPer = false;
						// 显示权限说明弹窗
						const confirm = await this.showPermissionDialog(
							'拨打电话权限申请',
							'我们需要拨打电话权限，方便您联系商家或平台'
						);

						if (!confirm) return;

						// 请求权限
						const result = await permissionUtils.requestPermission('phone', '需要拨打电话权限，方便您联系商家或平台');
						if (result) {
							uni.makePhoneCall({
								phoneNumber: phone
							});
						} else {
							locationService.openAppSettings();
						}
					} catch (error) {
						console.log('权限处理失败:', error);
						// 降级处理：直接拨打电话
						uni.makePhoneCall({
							phoneNumber: phone
						});
					}
				} else {
					// 如果 plus 对象不存在，直接拨打电话
					uni.makePhoneCall({
						phoneNumber: phone
					});
				}
				// #endif
			},
			// 打开手机已有地图
			openMap() {
				let that = this;

				// 检查经纬度是否存在
				if (!that.serviceInfo.latitude || !that.serviceInfo.longitude) {
					uni.showToast({
						title: '地址信息不完整',
						icon: 'none'
					});
					return;
				}

				// #ifdef MP-WEIXIN
				uni.openLocation({
					latitude: parseFloat(that.serviceInfo.latitude),
					longitude: parseFloat(that.serviceInfo.longitude),
					name: that.serviceInfo.shop_name,
					address: that.serviceInfo.shop_address,
					success: function(res) {
						console.log('打开系统位置地图成功');
					},
					fail: function(error) {
						console.log('打开地图失败:', error);
						uni.showToast({
							title: '打开地图失败',
							icon: 'none'
						});
					}
				});
				// #endif

				// #ifdef APP-PLUS
				// 检查 plus 对象是否存在
				if (typeof plus !== 'undefined') {
					_public.goMap({
						latitude: parseFloat(that.serviceInfo.latitude),
						longitude: parseFloat(that.serviceInfo.longitude),
						name: that.serviceInfo.shop_name,
						address: that.serviceInfo.shop_address
					});
				} else {
					uni.showToast({
						title: '地图功能暂不可用',
						icon: 'none'
					});
				}
				// #endif
			},
		}
	}
</script>

<style lang="less">
	.detail-page {
		padding-bottom: 120rpx;
	}

	/* 主图区域 */
	.main-image-section {
		position: relative;
		width: 750rpx;
		height: 750rpx;
		background-color: #999;
	}

	.banner-swiper {
		width: 750rpx;
		height: 750rpx;
	}

	.banner-image {
		width: 750rpx;
		height: 750rpx;
	}

	.banner-tag {
		font-size: 20rpx;
		font-weight: 500;
		color: #FFFFFF;
		padding: 6rpx 12rpx;
		background-color: rgba(0, 0, 0, 0.40);
		position: absolute;
		border-radius: 20rpx;
		right: 26rpx;
		bottom: 28rpx;
	}

	/* 服务信息 */
	.user-choice,
	.comments-section,
	.notice-section {
		background-color: #fff;
		padding: 24rpx;
		box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
		margin: 0 24rpx 24rpx;
		border-radius: 16rpx;
	}

	.service-header-price {
		margin: 20rpx 24rpx 0 24rpx;
		width: 702rpx;
		height: 97rpx;
		position: relative;

		// background-image: url("/static/images/background/headerBj.png");
		// background-position: top;
		// background-repeat: no-repeat;
		// background-size: cover;
		.service-header-price-bj {
			width: 702rpx;
			height: 97rpx;
			position: absolute;
			left: 0;
			top: 0;
		}

	}

	.service-info {
		margin: 0rpx 24rpx 0rpx 24rpx;
		background-color: #fff;
		box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
		padding-top: 10rpx;
		padding-bottom: 14rpx;
		border-radius: 16rpx 0rpx 16rpx 16rpx;
		transform: translateY(-16rpx);
	}

	.service-price {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: flex-end;
		padding-top: 10rpx;
		padding-left: 24rpx;

		.price-symbol {
			font-family: DINPro, DINPro;
			font-weight: bold;
			font-size: 24rpx;
			color: #ffffff;
			line-height: 31rpx;
			text-align: left;
			font-style: normal;
			margin-right: 6rpx;
			transform: translateY(-6rpx);
		}

		.price-value {
			font-family: DINPro, DINPro;
			font-weight: 500;
			font-size: 48rpx;
			color: #ffffff;
			line-height: 61rpx;
			text-align: left;
			font-style: normal;
		}

		.price-discount {
			margin-left: 16rpx;
			font-weight: 500;
			font-size: 24rpx;
			color: #ffffff;
			line-height: 33rpx;
			text-align: left;
			font-style: normal;
			text-decoration: line-through;
		}
	}



	.service-shop {
		margin: 0rpx 24rpx 24rpx 24rpx;
		background-color: #fff;
		box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.05);
		padding-top: 24rpx;
		/* padding-bottom: 5rpx; */
		border-radius: 16rpx;

	}

	.shop-info {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: flex-start;
		padding-bottom: 16rpx;
		border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
	}

	.shop-logo {
		width: 112rpx;
		height: 136rpx;
		background-color: #f5f5f5;
		margin-right: 20rpx;
		border-radius: 8rpx;
	}

	.shop-info-you {
		flex: 1;
		display: flex;
		flex-flow: column wrap;
		justify-content: flex-start;
		align-items: flex-start;
	}

	.shop-name {
		width: 100%;
		font-size: 28rpx;
		color: #3D3D3D;
		margin-bottom: 10rpx;
		font-weight: 500;
	}

	.shop-class-w {
		width: 100%;
		margin-bottom: 8rpx;
	}

	.shop-class {
		font-size: 24rpx;
		color: #666666;
	}

	.shop-time {
		width: 100%;
	}

	.shop-cont {
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: flex-start;
		padding-top: 16rpx;
	}

	.shop-cont-left {
		flex: 1;
		display: flex;
		flex-flow: column wrap;
		justify-content: flex-start;
		align-items: flex-start;
	}

	.shop-address,
	.shop-tell {
		font-size: 24rpx;
		color: #333333;
		margin-bottom: 8rpx;
		line-height: 1.4;
	}

	.shop-cont-right {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-end;
		align-items: center;
		margin-left: 20rpx;
	}

	.shop-headle {
		width: 40rpx;
		height: 40rpx;
		margin-left: 20rpx;
	}



	.service-title {
		padding: 0 24rpx;
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: baseline;
	}

	.service-type {
		font-size: 26rpx;
		color: #FFFFFF;
		background-color: rgba(232, 16, 30, 1);
		padding: 2rpx 10rpx;
		border-radius: 7rpx;
		margin-right: 12rpx;
		transform: translateY(-4rpx);
		/* line-height: 1; 确保行高一致 */
		/* height: 36rpx; 固定高度 */
		/* display: flex; */
		/* align-items: center; 文字垂直居中 */
		/* justify-content: center; 文字水平居中 */
		/* flex-shrink: 0; 防止标签被压缩 */
	}

	.title-text {
		flex: 1;
		font-size: 36rpx;
		color: #333333;
		font-weight: 500;
	}

	.service-tabs {
		display: flex;
	}

	.tab-item {
		height: 24rpx;
		line-height: 24rpx;
		font-size: 16rpx;
		color: #999999;
		background-color: #FFF2F2;
		padding: 0 8rpx;
		border-radius: 8rpx;
	}

	/* 到家地址以及可预约时间 */
	.choice-item {
		height: 90rpx;
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: center;
	}

	.choice-tit {
		font-size: 24rpx;
		color: #999999;
		margin-right: 16rpx;
	}

	.choice-cont {
		flex: 1;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
	}

	.address-left {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: center;
	}

	.choice-text {
		font-size: 24rpx;
		color: #666666;
	}

	.address-icon {
		width: 24rpx;
		height: 24rpx;
		margin-right: 8rpx;
	}

	.enter-icon {
		width: 24rpx;
		height: 24rpx;
		margin-left: 8rpx;
	}

	/* 手艺人区域 */
	.service-syr {
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
		margin: 0 24rpx 24rpx;
		background-color: #fff;
		box-shadow: rgba(0, 0, 0, 0.05);
		padding: 24rpx;
	}

	.syr-head {
		width: 104rpx;
		height: 104rpx;
		border-radius: 54rpx;
		margin-right: 10rpx;
	}

	.syr-info {
		flex: 1;
	}

	.syr-name {
		font-size: 28rpx;
		color: #3D3D3D;
	}

	.look-btn {
		margin: 27rpx;
		width: 130rpx;
		height: 56rpx;
		border: 1rpx solid #E8101E;
		display: flex;
		flex-flow: row nowrap;
		justify-content: center;
		align-items: center;
		border-radius: 28rpx;
	}

	.look-text {
		font-size: 28rpx;
		color: #E8101E;
	}

	/* 评论区域 */
	.section-title {
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
	}

	.section-num {
		font-size: 28rpx;
		font-weight: 500;
		color: #3D3D3D;
	}

	.look-all {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-end;
		align-items: center;
	}

	.look {
		font-size: 24rpx;
		color: #666666;
	}

	.comment-item {
		padding: 24rpx 0;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
	}

	.comment-item:last-child {
		padding-bottom: 0rpx;
	}

	.comment-header {
		display: flex;
		align-items: center;
		margin-bottom: 14rpx;
	}

	.user-avatar {
		width: 64rpx;
		height: 64rpx;
		border-radius: 32rpx;
		margin-right: 14rpx;
		background-color: #000;
	}

	.comment-user-info {
		flex: 1;
	}

	.user-name {
		font-size: 28rpx;
		color: #3D3D3D;
		margin-bottom: 10rpx;
	}

	.comment-tab {
		font-size: 16rpx;
		padding: 0 8rpx;
		border-radius: 12rpx;
		color: #E8101E;
		background-color: rgba(255, 148, 180, 0.50);
		margin-right: 8rpx;
	}

	.comment-type {
		font-size: 20rpx;
		color: #999999;
	}

	.comment-content {
		font-size: 22rpx;
		color: #333333;
		line-height: 1.5;
	}

	.comment-images {
		width: 154rpx;
		height: 154rpx;
		background-color: #000;
		margin-left: 56rpx;
	}

	.comment-image {
		width: 160rpx;
		height: 160rpx;
		border-radius: 8rpx;
	}

	/* 购买须知 */
	.section-tit {
		font-size: 28rpx;
		font-weight: 500;
		color: #3D3D3D;
	}

	.section-tit-right {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-end;
		align-items: center;
	}

	.rule-text {
		font-size: 28rpx;
		color: #D10F13;
	}

	.notice-item {
		margin-bottom: 24rpx;
	}

	.notice-title {
		font-size: 28rpx;
		color: #333;
		font-weight: 500;
	}

	.notice-content {
		margin-top: 32rpx;
	}

	.notice-cont {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: flex-start;
		margin-bottom: 16rpx;
	}

	.notice-cont:last-child {
		margin-bottom: 0;
	}

	.notice-text {
		flex: 1;
		font-size: 26rpx;
		color: #666;
	}

	/* 底部按钮 */
	.bottom-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		height: 156rpx;
		background-color: #FFFFFF;
		display: flex;
		flex-flow: row nowrap;
		align-items: center;
		justify-content: flex-end;
		/* padding-bottom: env(safe-area-inset-bottom); */
		border-top: 1rpx solid rgba(0, 0, 0, 0.10);
		padding: 0 38rpx;
		/* margin-bottom: 20rpx; */
	}

	.lianxi {
		display: flex;
		flex-flow: column nowrap;
		justify-content: center;
		align-items: center;
	}

	.lianxi-text {
		font-size: 16rpx;
		color: #666666;
	}

	.lianxi-icon {
		width: 34rpx;
		height: 34rpx;
		margin-bottom: 10rpx;
	}

	.submit-btn {
		width: 670rpx;
		height: 86rpx;
		background: #E8101E;
		border-radius: 50rpx;
		font-weight: 400;
		font-size: 34rpx;
		color: #FFFFFF;
		text-align: center;
		font-style: normal;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.disabled-btn {
		opacity: 0.5 !important;
		background-color: #E8101E; /* 保持原有颜色，只是降低透明度 */
	}

	.cannot-submit {
		background-color: #999999;
	}

	.service-shop {}

	.shop-info {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-start;
		align-items: center;
		padding: 0 24rpx 16rpx;
		border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
	}

	.shop-logo {
		width: 112rpx;
		height: 136rpx;
		background-color: #000;
		margin-right: 20rpx;
	}

	.shop-info-you {
		flex: 1;
		display: flex;
		flex-flow: column wrap;
		justify-content: space-between;
		align-items: flex-start;
		flex-wrap: wrap;
		flex-direction: row;
	}

	.shop-name {
		width: 480rpx;
		font-size: 28rpx;
		color: #3D3D3D;
		margin-bottom: 10rpx;
	}

	.shop-class-w {
		width: 480rpx;
	}

	.shop-class {
		margin-bottom: 8rpx;
	}

	.shop-class,
	.shop-time {
		font-size: 24rpx;
		color: #666666;
	}

	.shop-cont {
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
		padding: 16rpx 24rpx;
	}

	.shop-cont-left {
		display: flex;
		flex-flow: column wrap;
		justify-content: space-between;
		align-items: flex-start;
	}

	.shop-cont-right {
		display: flex;
		flex-flow: row nowrap;
		justify-content: flex-end;
		align-items: center;
	}

	.shop-address,
	.shop-tell {
		width: 430rpx;
		padding-right: 20rpx;
		font-size: 24rpx;
		line-height: 36rpx;
		color: #333333;
	}

	.shop-distance {
		font-size: 24rpx;
		color: #666666;
	}

	.shop-headle {
		width: 40rpx;
		height: 40rpx;
		margin-left: 60rpx;
	}



	.video-controls {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		height: 100rpx;
		display: flex;
		align-items: flex-start;
		justify-content: center;
		z-index: 3;
	}

	.control-btn {
		width: 60rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: rgba(0, 0, 0, 0.5);
		border-radius: 30rpx;
		margin: 20rpx 660rpx 0 0;
	}

	.control-icon {
		width: 40rpx;
		height: 40rpx;
	}

	/* H5适配 */
	/* #ifdef H5 */
	.bottom-bar {
		padding-bottom: 0;
	}

	/* #endif */

	/* APP适配 */
	/* #ifdef APP-PLUS */
	.detail-page {
		padding-bottom: 188rpx;
	}

	.permission.transform {
		top: 180rpx;
		opacity: 1;
		visibility: visible;
	}

	/* #endif */

	/* 小程序适配 */
	/* #ifdef MP-WEIXIN */
	.custom-navbar {
		background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
	}

	/* #endif */
</style>