goodsDetails.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  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. serviceStartDate: '2025-04-18',
  552. startTime: '8:00',
  553. serviceDuration: 4,
  554. paymentMethod: paymentMethod.value,
  555. volunteerId: volunteerId.value,
  556. remark: remark.value,
  557. businessManagementId: businessManagementId.value,
  558. volunteerInfoId: listData.value.volunteerInfoId,
  559. addressId: selectedAddress.value.addressId,
  560. },
  561. workDateList: [],
  562. }
  563. // 转换所有选择的时间
  564. selectedTimes.value.forEach((item) => {
  565. orderData.workDateList.push({
  566. workDate: item.date,
  567. workStartTime: item.time,
  568. })
  569. })
  570. // 创建订单
  571. const res = await ordersCreateOrder(orderData)
  572. if (res.code !== 200) {
  573. throw new Error('创建订单失败')
  574. }
  575. // 保存订单号
  576. const mainOrderId = res.data.mainOrderId
  577. console.log('创建订单成功,订单号:', mainOrderId)
  578. // 如果是微信支付
  579. if (paymentMethod.value === 2) {
  580. return new Promise((resolve, reject) => {
  581. uni.requestPayment({
  582. ...res.data,
  583. package: res.data.packageValue,
  584. success: (payRes) => {
  585. console.log('支付成功:', payRes)
  586. if (payRes.errMsg === 'requestPayment:ok') {
  587. uni.showToast({
  588. title: '支付成功',
  589. icon: 'success',
  590. duration: 1500,
  591. mask: true,
  592. })
  593. setTimeout(() => {
  594. uni.reLaunch({
  595. url: '/pages/classify',
  596. })
  597. }, 1500)
  598. resolve(payRes)
  599. }
  600. },
  601. fail: async (payRes) => {
  602. console.log('支付失败或取消:', payRes)
  603. try {
  604. // 调用取消支付接口
  605. const cancelRes = await coreUsersOrdersPayCancel({ mainOrderId })
  606. console.log('取消支付接口调用成功:', cancelRes)
  607. if (payRes.errMsg === 'requestPayment:fail cancel') {
  608. uni.showToast({
  609. title: '已取消支付',
  610. icon: 'none',
  611. duration: 1500,
  612. mask: true,
  613. })
  614. } else {
  615. uni.showToast({
  616. title: '支付失败',
  617. icon: 'error',
  618. duration: 1500,
  619. mask: true,
  620. })
  621. }
  622. reject(payRes)
  623. } catch (error) {
  624. console.error('取消支付接口调用失败:', error)
  625. uni.showToast({
  626. title: '取消支付失败',
  627. icon: 'error',
  628. duration: 1500,
  629. mask: true,
  630. })
  631. reject(error)
  632. }
  633. }
  634. })
  635. })
  636. }
  637. // 如果是钱包支付
  638. if (paymentMethod.value === 1) {
  639. uni.showToast({
  640. title: '支付成功',
  641. icon: 'success',
  642. duration: 1500,
  643. mask: true,
  644. })
  645. setTimeout(() => {
  646. uni.reLaunch({
  647. url: '/pages/classify'
  648. })
  649. }, 1500)
  650. }
  651. } catch (error) {
  652. console.error('支付失败:', error)
  653. uni.showToast({
  654. title: '支付失败余额不足',
  655. icon: 'error',
  656. duration: 1500,
  657. mask: true,
  658. })
  659. }
  660. }
  661. // 修改支付方式
  662. const handlePaymentMethodChange = (value) => {
  663. if (value === '钱包支付') {
  664. paymentMethod.value = 1
  665. } else if (value === '微信支付') {
  666. paymentMethod.value = 2
  667. }
  668. }
  669. onMounted(async () => {
  670. await getListTime()
  671. })
  672. </script>
  673. <style scoped>
  674. /* 添加卡片样式 */
  675. .card-container {
  676. display: flex;
  677. padding: 20rpx;
  678. margin: 10rpx;
  679. background-color: #fff;
  680. border-radius: 10rpx;
  681. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  682. }
  683. .card-image {
  684. width: 120rpx;
  685. height: 120rpx;
  686. border-radius: 10rpx;
  687. margin-right: 20rpx;
  688. }
  689. .card-content {
  690. flex: 1;
  691. display: flex;
  692. flex-direction: column;
  693. justify-content: space-between;
  694. }
  695. .info-item,
  696. .Telephone,
  697. .date,
  698. .time {
  699. font-size: 26rpx;
  700. margin-bottom: 8rpx;
  701. }
  702. .box {
  703. height: 100vh;
  704. width: 100vw;
  705. position: fixed;
  706. top: 0;
  707. left: 0;
  708. z-index: 999999;
  709. background: red;
  710. }
  711. .card-container {
  712. display: flex;
  713. position: relative;
  714. padding: 20rpx;
  715. align-items: flex-start;
  716. background-color: #fff;
  717. border-radius: 12rpx;
  718. }
  719. /* 左侧图片 */
  720. .card-image {
  721. width: 240rpx;
  722. height: 340rpx;
  723. border-radius: 12rpx;
  724. margin-right: 30rpx;
  725. flex-shrink: 0;
  726. }
  727. /* 中间信息区域 */
  728. .card-info {
  729. flex: 1;
  730. padding-right: 100rpx;
  731. }
  732. .Telephone {
  733. white-space: nowrap;
  734. margin-bottom: 24rpx;
  735. font-size: 28rpx;
  736. line-height: 1.6;
  737. color: #333;
  738. }
  739. .info-item {
  740. margin-bottom: 24rpx;
  741. font-size: 28rpx;
  742. line-height: 1.6;
  743. color: #333;
  744. }
  745. /* 右上角评分 */
  746. .card-rating {
  747. position: absolute;
  748. top: 20rpx;
  749. right: 20rpx;
  750. background-color: #f8f8f8;
  751. padding: 6rpx 16rpx;
  752. border-radius: 20rpx;
  753. font-size: 24rpx;
  754. color: #ff9900;
  755. font-weight: bold;
  756. }
  757. /* 固定在页面底部 */
  758. .Wrap-btn {
  759. /* display: flex; */
  760. /* justify-content: flex-end; */
  761. /* align-items: center; */
  762. position: fixed;
  763. bottom: 0;
  764. width: 100%;
  765. background-color: white;
  766. padding: 40rpx 20rpx;
  767. box-shadow: -2rpx 5rpx rgba(0, 0, 0, 0.1);
  768. }
  769. .Wrapper {
  770. display: flex;
  771. align-items: center;
  772. gap: 10rpx;
  773. margin-top: 10rpx;
  774. }
  775. .Wrapper-img {
  776. width: 50rpx;
  777. height: 50rpx;
  778. margin-left: 10rpx;
  779. }
  780. .Wrapper-content {
  781. color: rgba(16, 16, 16, 1);
  782. font-size: 25rpx;
  783. font-family: PingFangSC-regular;
  784. line-height: 20rpx;
  785. }
  786. .Wrap-content1 {
  787. display: flex;
  788. justify-content: flex-start;
  789. margin-left: 10rpx;
  790. margin-top: 10rpx;
  791. }
  792. .Wrap-info {
  793. display: flex;
  794. justify-content: flex-start;
  795. margin-left: 10rpx;
  796. margin-top: 25rpx;
  797. }
  798. .Wrap-content3 {
  799. margin-top: 25rpx;
  800. }
  801. .Wrap-content4 {
  802. margin-top: 25rpx;
  803. }
  804. .Wrap-content5 {
  805. display: flex;
  806. justify-content: flex-start;
  807. margin-left: 10rpx;
  808. margin-top: 25rpx;
  809. }
  810. .Wrap-content6 {
  811. margin-top: 25rpx;
  812. }
  813. .Wrap-detils-btn {
  814. display: flex;
  815. justify-content: flex-end;
  816. align-items: center;
  817. margin-top: 25rpx;
  818. /* position: fixed;
  819. bottom: 0;
  820. width: 100%;
  821. background-color: white;
  822. padding: 40rpx 20rpx;
  823. box-shadow: -2rpx 5rpx rgba(0, 0, 0, 0.1); */
  824. }
  825. .Wrap-Payment {
  826. padding: 30rpx;
  827. background-color: #fff;
  828. }
  829. .payment-header {
  830. display: flex;
  831. justify-content: space-between;
  832. align-items: center;
  833. padding: 20rpx 0;
  834. }
  835. .payment-title {
  836. font-size: 32rpx;
  837. font-weight: bold;
  838. }
  839. .payment-amount {
  840. font-size: 36rpx;
  841. color: #ff4d4f;
  842. font-weight: bold;
  843. }
  844. .payment-option {
  845. display: flex;
  846. justify-content: space-between;
  847. align-items: center;
  848. padding: 30rpx 0;
  849. }
  850. .option-left {
  851. display: flex;
  852. align-items: center;
  853. }
  854. .payment-icon {
  855. width: 80rpx;
  856. height: 80rpx;
  857. margin-right: 20rpx;
  858. }
  859. .option-text {
  860. font-size: 30rpx;
  861. font-weight: bold;
  862. }
  863. .other-payment {
  864. padding: 30rpx 0;
  865. color: #1890ff;
  866. font-size: 28rpx;
  867. }
  868. .terms-of-service {
  869. padding: 30rpx 0;
  870. font-size: 24rpx;
  871. color: #999;
  872. line-height: 1.5;
  873. }
  874. .confirm-button {
  875. margin-top: 40rpx;
  876. }
  877. .certificate {
  878. display: flex;
  879. flex-direction: column;
  880. }
  881. .certificate-img {
  882. margin-bottom: 24rpx;
  883. }
  884. /* 第二层弹框 */
  885. .card-container {
  886. display: flex;
  887. flex-direction: row;
  888. align-items: flex-start;
  889. padding: 10px;
  890. }
  891. .card-image {
  892. width: 100px;
  893. /* Adjust as needed */
  894. height: 100px;
  895. /* Adjust as needed */
  896. border-radius: 8px;
  897. margin-right: 15px;
  898. object-fit: cover;
  899. }
  900. .card-content {
  901. flex: 1;
  902. display: flex;
  903. flex-direction: column;
  904. }
  905. .info-item,
  906. .Telephone,
  907. .date,
  908. .time {
  909. margin-bottom: 5px;
  910. font-size: 14px;
  911. color: #333;
  912. }
  913. .time span {
  914. margin-right: 8px;
  915. }
  916. .address-line {
  917. font-size: 14px;
  918. line-height: 20rpx;
  919. /* 行高20rpx */
  920. color: #333;
  921. /* 深色文字 */
  922. display: block;
  923. /* 确保独占一行 */
  924. margin-bottom: 30rpx;
  925. /* 下边距30rpx */
  926. }
  927. /* 联系人信息容器 */
  928. .contact-info {
  929. display: flex;
  930. gap: 20rpx;
  931. /* 姓名和电话之间的间距 */
  932. }
  933. /* 姓名样式 */
  934. .contact-name {
  935. font-size: 12px;
  936. color: #999;
  937. /* 灰色文字 */
  938. line-height: 20rpx;
  939. }
  940. /* 电话样式 */
  941. .contact-phone {
  942. font-size: 12px;
  943. color: #999;
  944. /* 灰色文字 */
  945. line-height: 20rpx;
  946. }
  947. </style>