goodsDetails.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  1. <template>
  2. <view>
  3. <view>
  4. <up-card
  5. title="志愿者介绍"
  6. :head-style="{ height: '80rpx', padding: '20rpx' }"
  7. >
  8. <template #body>
  9. <view class="card-container">
  10. <!-- 左侧图片 -->
  11. <image
  12. class="card-image"
  13. :src="listData.volunteerPicture"
  14. mode="aspectFill"
  15. ></image>
  16. <!-- 中间信息(姓名/类别等) -->
  17. <view class="card-info">
  18. <view class="info-item">姓名:{{ listData.name }}</view>
  19. <view class="info-item"
  20. >服务项目:{{ listData.businessTierName }}</view
  21. >
  22. <view v-if="serviceSubjectName != null" class="info-item"
  23. >类别:{{ listData.projectTypeName }}
  24. </view>
  25. <view class="Telephone"
  26. >服务时长:{{ listData.businessDuration }}</view
  27. >
  28. <view class="Telephone">电话:{{ listData.phonenumber }}</view>
  29. </view>
  30. <!-- 右上角评分 - 使用绝对定位 -->
  31. <view class="card-rating">4.5 评分</view>
  32. </view>
  33. </template>
  34. </up-card>
  35. <up-card
  36. title="技能介绍"
  37. :thumb="thumb"
  38. :head-style="{ height: '80rpx', padding: '20rpx' }"
  39. >
  40. <template #body>
  41. {{ listData.skillDescribe }}
  42. </template>
  43. </up-card>
  44. <up-card
  45. title="证书"
  46. :thumb="thumb"
  47. :head-style="{ height: '80rpx', padding: '20rpx' }"
  48. >
  49. <template #body>
  50. <view class="certificate">
  51. <image
  52. v-for="item in certificationPictures"
  53. :key="item"
  54. :src="item"
  55. mode=""
  56. style="width: 100%"
  57. class="certificate-img"
  58. ></image>
  59. </view>
  60. </template>
  61. </up-card>
  62. <!-- 固定底部按钮区 -->
  63. <view class="Wrap-btn">
  64. <uni-goods-nav
  65. :fill="true"
  66. :options="options"
  67. :buttonGroup="buttonGroup"
  68. @click="onClick"
  69. @buttonClick="buttonClick"
  70. />
  71. </view>
  72. </view>
  73. <!-- 底部第一层弹框 -->
  74. <view>
  75. <up-popup :show="show" @close="close" @open="open"> </up-popup>
  76. <up-popup v-model:show="show" @open="upPopupOpen">
  77. <view>
  78. <view class="Wrapper">
  79. <image src="/static/img/Location.png" class="Wrapper-img" />
  80. <span class="Wrapper-content">李四</span>
  81. <span class="Wrapper-content">重庆永川区</span>
  82. </view>
  83. <span style="margin-left: 15rpx; margin-top: 50rpx">重庆永川区</span>
  84. </view>
  85. <up-divider></up-divider>
  86. <view class="Wrap-content1">
  87. <up-avatar :src="src"></up-avatar>
  88. <text style="margin-top: 15rpx">¥{{ listData.businessPrice }}</text>
  89. </view>
  90. <view class="Wrap-info">
  91. <text style="margin-left: 10rpx">服务类别:</text>
  92. <up-text type="info" text="家庭教育"></up-text>
  93. </view>
  94. <view class="Wrap-content3">
  95. <text style="margin-left: 15rpx">服务周期:</text>
  96. <view style="margin-top: 25rpx">
  97. <uniDatetimePickerMy
  98. :modelValue="doorToDoorTime"
  99. :start="startDisabled"
  100. :end="endDisabled"
  101. type="daterange"
  102. ></uniDatetimePickerMy>
  103. </view>
  104. <view>
  105. <its-calendar
  106. v-if="show"
  107. :businessDuration="listData.businessDuration"
  108. :timeArr="doorToDoorTimeArr"
  109. :timeHostArr="timeHostArr"
  110. @getByDate="getByDate"
  111. @getByTime="getByTime"
  112. ></its-calendar>
  113. </view>
  114. </view>
  115. <view class="Wrap-content6">
  116. <text style="margin-left: 15rpx">备注:</text>
  117. <up-input
  118. placeholder="请输入内容"
  119. border="surround"
  120. v-model="remark"
  121. @change="change"
  122. ></up-input>
  123. </view>
  124. <view class="Wrap-detils-btn">
  125. <up-button
  126. type="primary"
  127. shape="circle"
  128. :customStyle="wrapqx"
  129. @click="handlCancel"
  130. >取消</up-button
  131. >
  132. <up-button
  133. type="error"
  134. shape="circle"
  135. :customStyle="wrapqx"
  136. @click="handleBuy"
  137. >
  138. 预约¥{{ computeMoney }}
  139. </up-button>
  140. </view>
  141. </up-popup>
  142. </view>
  143. <!-- 第二个弹框-->
  144. <up-popup v-model:show="showSecond">
  145. <view>
  146. <up-cell-group>
  147. <view
  148. @click="jumpToAddressSelect"
  149. style="display: flex; align-items: center; padding: 10px"
  150. >
  151. <up-icon name="more-dot-fill" size="16" />
  152. <view v-if="selectedAddress" style="margin-left: 8px; flex: 1">
  153. <view class="address-display">
  154. <text class="address-line">
  155. {{ selectedAddress.provinceName }}{{ selectedAddress.cityName
  156. }}{{ selectedAddress.districtName }}
  157. </text>
  158. <view class="contact-info">
  159. <text class="contact-name">{{ selectedAddress.name }}</text>
  160. <text class="contact-phone">{{
  161. selectedAddress.telephone
  162. }}</text>
  163. </view>
  164. </view>
  165. </view>
  166. <text v-else style="margin-left: 8px; font-size: 18px"
  167. >请选择服务地址</text
  168. >
  169. </view>
  170. <scroll-view scroll-y style="height: 460rpx">
  171. <view
  172. class="card-container"
  173. v-for="(item, index) in selectedTimes"
  174. :key="index"
  175. >
  176. <image
  177. class="card-image"
  178. :src="listData.volunteerPicture"
  179. mode="aspectFill"
  180. ></image>
  181. <view class="card-content">
  182. <view class="info-item"
  183. >服务项目:{{ listData.projectName }}</view
  184. >
  185. <view class="Telephone"
  186. >服务时长:{{ listData.businessDuration }}</view
  187. >
  188. <view class="date">日期:{{ item.date }}</view>
  189. <view class="time"> 时间:{{ item.time }} </view>
  190. </view>
  191. </view>
  192. </scroll-view>
  193. </up-cell-group>
  194. </view>
  195. <view class="Wrap-Payment">
  196. <!-- 支付金额 -->
  197. <view class="payment-header">
  198. <text class="payment-title">现在支付</text>
  199. <text class="payment-amount">¥{{ computeMoney }}</text>
  200. </view>
  201. <up-line></up-line>
  202. <!-- 钱包支付选项 -->
  203. <view class="payment-option">
  204. <view class="option-left">
  205. <image src="/static/钱包.png" class="payment-icon"></image>
  206. <text class="option-text">钱包</text>
  207. </view>
  208. <up-radio-group
  209. v-model="radiovalue1"
  210. placement="column"
  211. @change="handlePaymentMethodChange"
  212. >
  213. <up-radio
  214. :customStyle="{ marginLeft: 'auto' }"
  215. v-for="(item, index) in radiolist1"
  216. :key="index"
  217. :label="item.name"
  218. :name="item.name"
  219. ></up-radio>
  220. </up-radio-group>
  221. </view>
  222. <up-line></up-line>
  223. <!-- 微信支付选项 -->
  224. <view class="payment-option">
  225. <view class="option-left">
  226. <image src="/static/微信支付.png" class="payment-icon"></image>
  227. <text class="option-text">微信支付</text>
  228. </view>
  229. <up-radio-group
  230. v-model="radiovalue1"
  231. placement="column"
  232. @change="handlePaymentMethodChange"
  233. >
  234. <up-radio
  235. :customStyle="{ marginLeft: 'auto' }"
  236. v-for="(item, index) in radiolist2"
  237. :key="index"
  238. :label="item.name"
  239. :name="item.name"
  240. ></up-radio>
  241. </up-radio-group>
  242. </view>
  243. <up-line></up-line>
  244. <!-- 其他支付方式 -->
  245. <view class="other-payment"> 其他方式支付 > </view>
  246. <!-- 条款说明 -->
  247. <view class="terms-of-service">
  248. 我同意购买守则,取消政策和退款政策,我也同意支付以下所示的总金额(含服务费)。
  249. </view>
  250. </view>
  251. <view class="Wrap-detils-btn">
  252. <up-button
  253. type="primary"
  254. shape="circle"
  255. :customStyle="wrapqx"
  256. @click="closeSecond"
  257. >取消</up-button
  258. >
  259. <up-button
  260. type="error"
  261. shape="circle"
  262. :customStyle="wrapqx"
  263. @click="handlConfiRmpurchase"
  264. >
  265. 购买¥{{ computeMoney }}
  266. </up-button>
  267. </view>
  268. </up-popup>
  269. <view v-if="addressFlag" class="box">
  270. <addressComponent
  271. :modelValue="addressFlag"
  272. @update:modelValue="(val) => (addressFlag = val)"
  273. :addressInfo="addressInfo"
  274. @update:addressInfo="handleAddressUpdate"
  275. ></addressComponent>
  276. </view>
  277. </view>
  278. </template>
  279. <script setup>
  280. import { onLoad } from '@dcloudio/uni-app'
  281. import { onMounted, ref, reactive, computed } from 'vue'
  282. import {
  283. getDetailsvolunteerId,
  284. volunteerwork,
  285. volunteergetTimesByDate,
  286. ordersCreateOrder,
  287. coreUsersOrdersPayCancel,
  288. } from '@/api/volunteerDetailsApi/details.js'
  289. import itsCalendar from '@/components/its-calendar/its-calendar.vue'
  290. import uniDatetimePickerMy from '@/uni_modules/lic-uni-datetime-picker/components/lic-uni-datetime-picker/lic-uni-datetime-picker.vue'
  291. import addressComponent from '@/pages_home/components/volunteerSide/adresss.vue'
  292. const src = ref(
  293. 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'
  294. )
  295. const businessPrice = ref() //价格
  296. const addressId = ref('') //用户下单地址
  297. const volunteerId = ref('') // 存储志愿者ID
  298. const serviceCategory = ref('') //存储大类别
  299. const businessManagementId = ref('') //具体分类id
  300. const doorToDoorTimeArr = ref([]) // 完整时间范围
  301. const doorToDoorTime = ref([]) // 只具备开始、结束 时间
  302. const timeHostArr = ref([]) // 时间段数组
  303. const currentDate = ref([]) // 点击过的年月日数组数据
  304. const currentTime = ref('') // 最后一次点击时间的时间节点
  305. const selectedTimes = ref([]) // 存储所有选择的时间对象
  306. const totalTimes = ref(0) // 时间点 点击的次数
  307. const startDisabled = ref('')
  308. const endDisabled = ref('')
  309. const time = ref('')
  310. const listData = ref({})
  311. const show = ref(false) //第一层弹框
  312. const showSecond = ref(false) //第二层弹框
  313. const showThird = ref(false) //第二层弹框
  314. const showSum = ref(false)
  315. const remark = ref('') //备注
  316. const radiovalue1 = ref('苹果')
  317. const selectedAddress = ref(null)
  318. const addressFlag = ref(false)
  319. const paymentMethod = ref(1) // Add payment method ref with default value 1 (wallet)
  320. const addressInfo = ref(null)
  321. // Radio 单选框数据
  322. const radiolist1 = reactive([
  323. {
  324. name: '钱包支付',
  325. disabled: false,
  326. },
  327. ])
  328. const radiolist2 = reactive([
  329. {
  330. name: '微信支付',
  331. disabled: false,
  332. },
  333. ])
  334. // 详情底部立即购买弹框
  335. const buttonClick = (e) => {
  336. show.value = true // 打开弹框
  337. }
  338. // 详情页第一层弹框
  339. function open() {
  340. show.value = true
  341. }
  342. // 第一层弹框取消
  343. function close() {
  344. // 关闭逻辑,设置 show 为 false
  345. show.value = false
  346. }
  347. // 第一个弹框逻辑
  348. const handleBuy = () => {
  349. show.value = false // 关闭第一个弹框
  350. showSecond.value = true // 打开第二个弹框
  351. }
  352. // 第二层弹框取消
  353. function closeSecond() {
  354. // 关闭逻辑,设置 show 为 false
  355. showSecond.value = false
  356. show.value = true // 打开第一个弹框
  357. }
  358. const handlCancel = () => {
  359. show.value = false // 关闭第一个弹框
  360. selectedTimes.value = [] // 清空已选时间
  361. totalTimes.value = 0 // 重置点击次数
  362. }
  363. const jumpToAddressSelect = () => {
  364. addressFlag.value = true
  365. }
  366. // 新增:处理子组件传回的地址数据
  367. const handleAddressUpdate = (newAddress) => {
  368. selectedAddress.value = newAddress
  369. addressFlag.value = false // 关闭选择器
  370. }
  371. // 详情底部底部数据
  372. const options = ref([
  373. {
  374. icon: 'headphones',
  375. text: '客服',
  376. },
  377. {
  378. icon: 'shop',
  379. text: '收藏',
  380. },
  381. ])
  382. // 详情底部立即购买样式
  383. const buttonGroup = ref([
  384. {
  385. text: '立即购买',
  386. backgroundColor: 'red',
  387. color: '#fff',
  388. },
  389. ])
  390. // 底部帮助客服方法
  391. const onClick = (e) => {
  392. uni.showToast({
  393. title: `点击${e.content.text}`,
  394. icon: 'none',
  395. })
  396. }
  397. // 修改详情页底部样式
  398. const customStyle = {
  399. height: '70rpx',
  400. paddingLeft: '30rpx',
  401. width: '540rpx',
  402. }
  403. const wrapqx = {
  404. // height: '70rpx',
  405. width: '240rpx',
  406. }
  407. // 获取传递的参数
  408. onLoad(async (options) => {
  409. const option = JSON.parse(decodeURIComponent(options.params))
  410. const {
  411. volunteerId: id,
  412. serviceCategory: categoy,
  413. businessManagementId: manage,
  414. } = option
  415. volunteerId.value = id
  416. serviceCategory.value = categoy
  417. businessManagementId.value = manage
  418. const res = await getDetailsvolunteerId({
  419. volunteerId: id,
  420. serviceCategory: categoy,
  421. businessManagementId: manage,
  422. })
  423. listData.value = res.data || {}
  424. businessPrice.value = listData.value.businessPrice || 0
  425. })
  426. // 选择日期
  427. const getListTime = async () => {
  428. const params = {
  429. volunteerId: Number(volunteerId.value),
  430. }
  431. const res = await volunteerwork(params)
  432. if (res.data && res.data.length > 0) {
  433. doorToDoorTimeArr.value = res.data
  434. const newRes = [res.data[0], res.data[res.data.length - 1]]
  435. doorToDoorTime.value = newRes
  436. startDisabled.value = doorToDoorTime.value[0]
  437. endDisabled.value = doorToDoorTime.value[1]
  438. // 默认加载第一个日期的排班时间
  439. getByDate(res.data[0])
  440. } else {
  441. console.error('接口返回的日期范围为空')
  442. doorToDoorTimeArr.value = []
  443. timeHostArr.value = [] // 清空时间段
  444. }
  445. }
  446. // 获取志愿者排班时间
  447. const getByDate = async (date = doorToDoorTimeArr.value[0]) => {
  448. // 检查日期是否为空
  449. if (!date) {
  450. coannsole.error('日期为空,跳过获取排班时间')
  451. return
  452. }
  453. if (!volunteerId.value) {
  454. console.error('volunteerId 为空')
  455. return
  456. }
  457. const params = {
  458. volunteerId: volunteerId.value,
  459. date,
  460. }
  461. try {
  462. const res = await volunteergetTimesByDate(params)
  463. const TArr = res.data.map((item) => {
  464. // 初始化disabled变量
  465. let disabled = false
  466. if (item.hasReservation === 1) disabled = true
  467. let itemTime =
  468. item.timeStamp > 9999999999 ? item.timeStamp : item.timeStamp * 1000
  469. if (new Date().getTime() > itemTime) disabled = true
  470. return {
  471. ...item,
  472. hours: item.reservationTime,
  473. timeStamp: new Date(`${date} ${item.reservationTime}`).getTime() / 1000,
  474. date: date,
  475. // checked: false, // 每次点击请求时间后,延续之前选中状态,不初始化选中
  476. disabled,
  477. }
  478. })
  479. // 如果 doorToDoorTimeArr.value 为空,直接返回
  480. if (!doorToDoorTimeArr.value.length) {
  481. console.error('可选的日期范围为空')
  482. return
  483. }
  484. // 填充时间段数组
  485. timeHostArr.value = Array(doorToDoorTimeArr.value.length).fill(TArr)
  486. } catch (error) {
  487. console.error('获取排班时间失败:', error)
  488. }
  489. }
  490. const getByTime = (timeObj) => {
  491. if (timeObj.clicked) {
  492. return
  493. }
  494. if (timeObj.checked) {
  495. // 选中 添加到已选时间数组
  496. selectedTimes.value.push({
  497. date: timeObj.date,
  498. time: timeObj.hours,
  499. timestamp: timeObj.timeStamp,
  500. })
  501. } else {
  502. // 取消选中
  503. const index = selectedTimes.value.findIndex(
  504. (item) => item.timestamp === timeObj.timeStamp
  505. )
  506. selectedTimes.value.splice(index, 1)
  507. }
  508. totalTimes.value = selectedTimes.value.length // 更新点击次数
  509. }
  510. // 立即购买显示时执行
  511. const upPopupOpen = () => {
  512. //显示时初始化预存储信息数据
  513. selectedTimes.value = []
  514. totalTimes.value = 0
  515. currentTime.value = ''
  516. currentDate.value = []
  517. // 初始化disabled/checked 数据状态
  518. getByDate()
  519. }
  520. const computeMoney = computed(() => {
  521. return totalTimes.value * businessPrice.value
  522. })
  523. const certificationPictures = computed(() => {
  524. if (listData.value.certificationPicture) {
  525. return listData.value.certificationPicture.split(',')
  526. }
  527. return []
  528. })
  529. // 确认购买
  530. const handlConfiRmpurchase = () => {
  531. if (!selectedAddress.value) {
  532. uni.showToast({
  533. title: '请选择服务地址',
  534. icon: 'none',
  535. duration: 2000,
  536. })
  537. return // 阻止购买
  538. }
  539. // 如果有地址,执行购买逻辑
  540. proceedToPayment()
  541. }
  542. const proceedToPayment = async () => {
  543. try {
  544. // 定义要发送的数据
  545. const orderData = {
  546. orders: {
  547. // serviceOnePrice: businessPrice.value,
  548. // serviceTotalPrice: computeMoney.value,
  549. serviceCategory: serviceCategory.value,
  550. totalTimes: totalTimes.value,
  551. paymentMethod: paymentMethod.value,
  552. volunteerId: volunteerId.value,
  553. remark: remark.value,
  554. businessManagementId: businessManagementId.value,
  555. volunteerInfoId: listData.value.volunteerInfoId,
  556. addressId: selectedAddress.value.addressId,
  557. },
  558. workDateList: [],
  559. }
  560. // 转换所有选择的时间
  561. selectedTimes.value.forEach((item) => {
  562. orderData.workDateList.push({
  563. workDate: item.date,
  564. workStartTime: item.time,
  565. })
  566. })
  567. // 创建订单
  568. const res = await ordersCreateOrder(orderData)
  569. if (res.code !== 200) {
  570. throw new Error('创建订单失败')
  571. }
  572. // 保存订单号
  573. const mainOrderId = res.data.mainOrderId
  574. console.log('创建订单成功,订单号:', mainOrderId)
  575. // 如果是微信支付
  576. if (paymentMethod.value === 2) {
  577. return new Promise((resolve, reject) => {
  578. uni.requestPayment({
  579. ...res.data,
  580. package: res.data.packageValue,
  581. success: (payRes) => {
  582. console.log('支付成功:', payRes)
  583. if (payRes.errMsg === 'requestPayment:ok') {
  584. uni.showToast({
  585. title: '支付成功',
  586. icon: 'success',
  587. duration: 1500,
  588. mask: true,
  589. })
  590. setTimeout(() => {
  591. uni.reLaunch({
  592. url: '/pages/classify',
  593. })
  594. }, 1500)
  595. resolve(payRes)
  596. }
  597. },
  598. fail: async (payRes) => {
  599. console.log('支付失败或取消:', payRes)
  600. try {
  601. // 调用取消支付接口
  602. const cancelRes = await coreUsersOrdersPayCancel({ mainOrderId })
  603. console.log('取消支付接口调用成功:', cancelRes)
  604. if (payRes.errMsg === 'requestPayment:fail cancel') {
  605. uni.showToast({
  606. title: '已取消支付',
  607. icon: 'none',
  608. duration: 1500,
  609. mask: true,
  610. })
  611. } else {
  612. uni.showToast({
  613. title: '支付失败',
  614. icon: 'error',
  615. duration: 1500,
  616. mask: true,
  617. })
  618. }
  619. reject(payRes)
  620. } catch (error) {
  621. console.error('取消支付接口调用失败:', error)
  622. uni.showToast({
  623. title: '取消支付失败',
  624. icon: 'error',
  625. duration: 1500,
  626. mask: true,
  627. })
  628. reject(error)
  629. }
  630. }
  631. })
  632. })
  633. }
  634. // 如果是钱包支付
  635. if (paymentMethod.value === 1) {
  636. uni.showToast({
  637. title: '支付成功',
  638. icon: 'success',
  639. duration: 1500,
  640. mask: true,
  641. })
  642. setTimeout(() => {
  643. uni.reLaunch({
  644. url: '/pages/classify'
  645. })
  646. }, 1500)
  647. }
  648. } catch (error) {
  649. console.error('支付失败:', error)
  650. uni.showToast({
  651. title: '支付失败余额不足',
  652. icon: 'error',
  653. duration: 1500,
  654. mask: true,
  655. })
  656. }
  657. }
  658. // 修改支付方式
  659. const handlePaymentMethodChange = (value) => {
  660. if (value === '钱包支付') {
  661. paymentMethod.value = 1
  662. } else if (value === '微信支付') {
  663. paymentMethod.value = 2
  664. }
  665. }
  666. onMounted(async () => {
  667. await getListTime()
  668. })
  669. </script>
  670. <style scoped>
  671. /* 添加卡片样式 */
  672. .card-container {
  673. display: flex;
  674. padding: 20rpx;
  675. margin: 10rpx;
  676. background-color: #fff;
  677. border-radius: 10rpx;
  678. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  679. }
  680. .card-image {
  681. width: 120rpx;
  682. height: 120rpx;
  683. border-radius: 10rpx;
  684. margin-right: 20rpx;
  685. }
  686. .card-content {
  687. flex: 1;
  688. display: flex;
  689. flex-direction: column;
  690. justify-content: space-between;
  691. }
  692. .info-item,
  693. .Telephone,
  694. .date,
  695. .time {
  696. font-size: 26rpx;
  697. margin-bottom: 8rpx;
  698. }
  699. .box {
  700. height: 100vh;
  701. width: 100vw;
  702. position: fixed;
  703. top: 0;
  704. left: 0;
  705. z-index: 999999;
  706. background: red;
  707. }
  708. .card-container {
  709. display: flex;
  710. position: relative;
  711. padding: 20rpx;
  712. align-items: flex-start;
  713. background-color: #fff;
  714. border-radius: 12rpx;
  715. }
  716. /* 左侧图片 */
  717. .card-image {
  718. width: 240rpx;
  719. height: 340rpx;
  720. border-radius: 12rpx;
  721. margin-right: 30rpx;
  722. flex-shrink: 0;
  723. }
  724. /* 中间信息区域 */
  725. .card-info {
  726. flex: 1;
  727. padding-right: 100rpx;
  728. }
  729. .Telephone {
  730. white-space: nowrap;
  731. margin-bottom: 24rpx;
  732. font-size: 28rpx;
  733. line-height: 1.6;
  734. color: #333;
  735. }
  736. .info-item {
  737. margin-bottom: 24rpx;
  738. font-size: 28rpx;
  739. line-height: 1.6;
  740. color: #333;
  741. }
  742. /* 右上角评分 */
  743. .card-rating {
  744. position: absolute;
  745. top: 20rpx;
  746. right: 20rpx;
  747. background-color: #f8f8f8;
  748. padding: 6rpx 16rpx;
  749. border-radius: 20rpx;
  750. font-size: 24rpx;
  751. color: #ff9900;
  752. font-weight: bold;
  753. }
  754. /* 固定在页面底部 */
  755. .Wrap-btn {
  756. /* display: flex; */
  757. /* justify-content: flex-end; */
  758. /* align-items: center; */
  759. position: fixed;
  760. bottom: 0;
  761. width: 100%;
  762. background-color: white;
  763. padding: 40rpx 20rpx;
  764. box-shadow: -2rpx 5rpx rgba(0, 0, 0, 0.1);
  765. }
  766. .Wrapper {
  767. display: flex;
  768. align-items: center;
  769. gap: 10rpx;
  770. margin-top: 10rpx;
  771. }
  772. .Wrapper-img {
  773. width: 50rpx;
  774. height: 50rpx;
  775. margin-left: 10rpx;
  776. }
  777. .Wrapper-content {
  778. color: rgba(16, 16, 16, 1);
  779. font-size: 25rpx;
  780. font-family: PingFangSC-regular;
  781. line-height: 20rpx;
  782. }
  783. .Wrap-content1 {
  784. display: flex;
  785. justify-content: flex-start;
  786. margin-left: 10rpx;
  787. margin-top: 10rpx;
  788. }
  789. .Wrap-info {
  790. display: flex;
  791. justify-content: flex-start;
  792. margin-left: 10rpx;
  793. margin-top: 25rpx;
  794. }
  795. .Wrap-content3 {
  796. margin-top: 25rpx;
  797. }
  798. .Wrap-content4 {
  799. margin-top: 25rpx;
  800. }
  801. .Wrap-content5 {
  802. display: flex;
  803. justify-content: flex-start;
  804. margin-left: 10rpx;
  805. margin-top: 25rpx;
  806. }
  807. .Wrap-content6 {
  808. margin-top: 25rpx;
  809. }
  810. .Wrap-detils-btn {
  811. display: flex;
  812. justify-content: flex-end;
  813. align-items: center;
  814. margin-top: 25rpx;
  815. /* position: fixed;
  816. bottom: 0;
  817. width: 100%;
  818. background-color: white;
  819. padding: 40rpx 20rpx;
  820. box-shadow: -2rpx 5rpx rgba(0, 0, 0, 0.1); */
  821. }
  822. .Wrap-Payment {
  823. padding: 30rpx;
  824. background-color: #fff;
  825. }
  826. .payment-header {
  827. display: flex;
  828. justify-content: space-between;
  829. align-items: center;
  830. padding: 20rpx 0;
  831. }
  832. .payment-title {
  833. font-size: 32rpx;
  834. font-weight: bold;
  835. }
  836. .payment-amount {
  837. font-size: 36rpx;
  838. color: #ff4d4f;
  839. font-weight: bold;
  840. }
  841. .payment-option {
  842. display: flex;
  843. justify-content: space-between;
  844. align-items: center;
  845. padding: 30rpx 0;
  846. }
  847. .option-left {
  848. display: flex;
  849. align-items: center;
  850. }
  851. .payment-icon {
  852. width: 80rpx;
  853. height: 80rpx;
  854. margin-right: 20rpx;
  855. }
  856. .option-text {
  857. font-size: 30rpx;
  858. font-weight: bold;
  859. }
  860. .other-payment {
  861. padding: 30rpx 0;
  862. color: #1890ff;
  863. font-size: 28rpx;
  864. }
  865. .terms-of-service {
  866. padding: 30rpx 0;
  867. font-size: 24rpx;
  868. color: #999;
  869. line-height: 1.5;
  870. }
  871. .confirm-button {
  872. margin-top: 40rpx;
  873. }
  874. .certificate {
  875. display: flex;
  876. flex-direction: column;
  877. }
  878. .certificate-img {
  879. margin-bottom: 24rpx;
  880. }
  881. /* 第二层弹框 */
  882. .card-container {
  883. display: flex;
  884. flex-direction: row;
  885. align-items: flex-start;
  886. padding: 10px;
  887. }
  888. .card-image {
  889. width: 100px;
  890. /* Adjust as needed */
  891. height: 100px;
  892. /* Adjust as needed */
  893. border-radius: 8px;
  894. margin-right: 15px;
  895. object-fit: cover;
  896. }
  897. .card-content {
  898. flex: 1;
  899. display: flex;
  900. flex-direction: column;
  901. }
  902. .info-item,
  903. .Telephone,
  904. .date,
  905. .time {
  906. margin-bottom: 5px;
  907. font-size: 14px;
  908. color: #333;
  909. }
  910. .time span {
  911. margin-right: 8px;
  912. }
  913. .address-line {
  914. font-size: 14px;
  915. line-height: 20rpx;
  916. /* 行高20rpx */
  917. color: #333;
  918. /* 深色文字 */
  919. display: block;
  920. /* 确保独占一行 */
  921. margin-bottom: 30rpx;
  922. /* 下边距30rpx */
  923. }
  924. /* 联系人信息容器 */
  925. .contact-info {
  926. display: flex;
  927. gap: 20rpx;
  928. /* 姓名和电话之间的间距 */
  929. }
  930. /* 姓名样式 */
  931. .contact-name {
  932. font-size: 12px;
  933. color: #999;
  934. /* 灰色文字 */
  935. line-height: 20rpx;
  936. }
  937. /* 电话样式 */
  938. .contact-phone {
  939. font-size: 12px;
  940. color: #999;
  941. /* 灰色文字 */
  942. line-height: 20rpx;
  943. }
  944. </style>