detail.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. <template>
  2. <view>
  3. <view class="map" v-if="[14,16,20,30].indexOf(orderDetail.status)>-1 && orderDetail.shippingType == 1">
  4. <map style="height: 600rpx;width:750rpx" show-location id="map" ref="map" :markers="markers" :polyline="polyline">
  5. </map>
  6. </view>
  7. <!-- 核销码显示区域 -->
  8. <view class="verification-code" v-if="orderDetail.status === 20 && orderDetail.shippingType == 2">
  9. <image :src="verificationCode" mode="widthFix" style="width: 300rpx; height: 300rpx"></image>
  10. <view class="code-text">核销码: {{ verificationText }}</view>
  11. <view class="code-hint">请向店员出示此核销码</view>
  12. </view>
  13. <!-- 核销码显示区域 -->
  14. <view class="state">
  15. <view class="state-text" v-if="orderDetail.status !== 10"
  16. :style="state === 5 || state === 8?'color:#1B1C33;font-size:20px':''">
  17. {{ orderDetail.orderType === 1 ? '(自提)' : '' }}{{ stateText }}
  18. </view>
  19. <view class="state-text" v-if="state === 0">
  20. {{ '等待支付 剩余' + num(minutes) }}:{{ num(seconds) }}
  21. </view>
  22. <view class="state-timeText">
  23. {{ state == 0 ? '逾期未支付将会自动取消' : '' }}
  24. {{ (state == 1 || state == 2) && orderDetail.shippingType == 1 ? '预约送达时间' : '' }}
  25. {{ (state == 1 || state == 2) && orderDetail.shippingType == 2 ? '预约取货时间' : '' }}
  26. {{ state == 3 || state == 4 ? '订单已完成' : '' }}
  27. {{ state == 5 ? '订单已取消' : '' }}
  28. {{ state == 8 ? '订单已取消' : '' }}
  29. {{ orderDetail.status == 12 ? '已拼单' + orderDetail.groupShopVo.alreadyBuyNumber + '件' : '' }}
  30. <!-- {{orderDetail.status==80&&orderDetail.status==90?'订单已取消':orderDetail.status==10&&orderDetail.status==12?'逾期未支付将会自动取消':orderDetail.status==40&&orderDetail.status==50?'订单已送达':orderDetail.status==70?'订单已取消':'预约送达时间 '}} -->
  31. </view>
  32. <view class="state-time">
  33. {{ (state == 1 || state == 2) && orderDetail.shippingType == 1 ? orderDetail.predictTime : '' }}
  34. {{ (state == 1 || state == 2) && orderDetail.shippingType == 2 ? orderDetail.predictTime.replaceAll('送达', '取货') : '' }}
  35. <!-- {{state == 3 || state == 4?'订单已完成':''}} -->
  36. {{ state == 3 || state == 4 || state == 5 || state == 8 ? orderDetail.updateTime : '' }}
  37. {{ orderDetail.status == 12 ? '拼团结束:' + orderDetail.groupShopVo.endTime : '' }}
  38. </view>
  39. <!-- 联系师傅按钮 - 在配送中显示 -->
  40. <view style="display: flex; justify-content: center; align-items: center; margin: 12px auto;">
  41. <view @click="contactRider" class="state-btn state-btn-contact" v-if="state === 2 || state === 1"
  42. style="margin: 12px auto;">
  43. 联系师傅
  44. </view>
  45. <view @click="refundOrder" class="state-btn state-btn-prohibit" v-if="state === 1 && !orderDetail.payIntegral"
  46. style="margin: 12px auto;">
  47. 申请退款
  48. </view>
  49. </view>
  50. <view style="display: flex; justify-content: center; align-items: center; margin: 12px auto;" v-if="state == 3">
  51. <view @click="orderAfterSales" class="state-btn state-btn-prohibit" style="margin: 12px auto;">
  52. 申请售后
  53. </view>
  54. <view @click="appraiseOrder" class="state-btn" style="margin: 12px auto;">
  55. 立即评价
  56. </view>
  57. </view>
  58. <view @click="orderAfterSales" class="state-btn state-btn-prohibit" v-if="orderDetail.status == 50"
  59. style="margin: 12px auto;">
  60. 申请售后
  61. </view>
  62. <view v-if="orderDetail.status === 10" style="display: flex;justify-content: center;">
  63. <view open-type="contact" class="state-btn state-btn-prohibit" style="width: 69px;"
  64. @click="naviageToPage('pages/service/service')">
  65. <button open-type="contact" class="contact-btn">客服</button>
  66. </view>
  67. <view @click="cancelOrder" class="state-btn state-btn-prohibit">
  68. 取消订单
  69. </view>
  70. <view @click="confirm" class="state-btn state-btn-ac">
  71. 立即付款
  72. </view>
  73. </view>
  74. </view>
  75. <view class="goods">
  76. <view class="goods-one" v-for="(item, index) in orderDetail.productList" :key="index">
  77. <image class="goods-img" :src="JSON.parse(item.img)[0].url"></image>
  78. <view class="goods-text">
  79. <view class="goods-tag">
  80. <view class="goods-name">{{ item.productTitle }}</view>
  81. <view class="goods-price">¥{{ item.price }}</view>
  82. </view>
  83. <view class="goods-number">×{{ item.num }}</view>
  84. </view>
  85. </view>
  86. <view v-if="orderDetail.couponPrice" class="yt-list-cell b-b">
  87. <text class="cell-tit clamp">
  88. 优惠券减
  89. </text>
  90. <text class="cell-tip red">
  91. -¥{{ orderDetail.couponPrice | priceFormat }}
  92. </text>
  93. </view>
  94. <view class="yt-list-cell b-b">
  95. <text class="cell-tit clamp" style="color: #333333;">加急费用</text>
  96. <text class="cell-tip">{{ orderDetail.urgentFee || '0.00' }}</text>
  97. </view>
  98. <view class="yt-list-cell b-b">
  99. <text class="cell-tit clamp" style="color: #333333;">合计</text>
  100. <text class="cell-tip" v-if="!orderDetail.payIntegral">¥{{ orderDetail.payPrice }}</text>
  101. <text class="cell-tip" style="color: red" v-if="orderDetail.payIntegral">积分{{ orderDetail.payIntegral }}
  102. </text>
  103. </view>
  104. </view>
  105. <!-- 配送信息 -->
  106. <view class="yt-list">
  107. <view class="yt-list-cell b-b">
  108. <text class="cell-tit clamp yt-list-title">地址信息</text>
  109. </view>
  110. <view class="yt-list-cell b-b">
  111. <text class="cell-tit clamp">联系地址</text>
  112. <text class="cell-tip">{{ orderDetail.userAddress }}</text>
  113. </view>
  114. <view class="yt-list-cell b-b">
  115. <text class="cell-tit clamp">联系人</text>
  116. <text class="cell-tip ">{{ orderDetail.realName }}</text>
  117. </view>
  118. <view class="yt-list-cell b-b">
  119. <text class="cell-tit clamp">期望时间</text>
  120. <text class="cell-tip ">{{ orderDetail.predictTime }}</text>
  121. </view>
  122. </view>
  123. <!-- 照片信息 -->
  124. <view class="yt-list" v-if="screenshotList.length > 0">
  125. <view class="yt-list-cell b-b">
  126. <text class="cell-tit clamp yt-list-title">照片信息</text>
  127. </view>
  128. <view class="screenshot-groups">
  129. <view class="screenshot-group" v-for="(group, groupKey) in groupedScreenshots" :key="groupKey">
  130. <view class="group-title">
  131. {{ groupKey }}
  132. </view>
  133. <view class="screenshot-grid">
  134. <view class="screenshot-item" v-for="(item, index) in group" :key="index" @click="previewImage(item.imageUrl)">
  135. <image class="screenshot-image" :src="item.imageUrl" mode="aspectFill"></image>
  136. <view class="screenshot-overlay">
  137. <view class="delete-btn" @click.stop="deleteScreenshot(item.id)">删除</view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 支付信息 -->
  145. <view class="yt-list">
  146. <view class="yt-list-cell b-b">
  147. <text class="cell-tit clamp yt-list-title">支付信息</text>
  148. </view>
  149. <view class="yt-list-cell b-b">
  150. <text class="cell-tit clamp">订单号</text>
  151. <text class="cell-tip">{{ orderDetail.orderId }}</text>
  152. </view>
  153. <view class="yt-list-cell b-b">
  154. <text class="cell-tit clamp">备注信息</text>
  155. <text class="cell-tip ">{{ orderDetail.remark }}</text>
  156. </view>
  157. <view class="yt-list-cell b-b">
  158. <text class="cell-tit clamp">支付方式</text>
  159. <text class="cell-tip ">{{ showPayment(orderDetail.payChannel) }}</text>
  160. </view>
  161. <view class="yt-list-cell b-b">
  162. <text class="cell-tit clamp">下单时间</text>
  163. <text class="cell-tip ">{{ orderDetail.createTime }}</text>
  164. </view>
  165. <view v-if="orderDetail.payTime" class="yt-list-cell b-b">
  166. <text class="cell-tit clamp">支付时间</text>
  167. <text class="cell-tip ">{{ orderDetail.payTime }}</text>
  168. </view>
  169. </view>
  170. <!-- 底部 -->
  171. <!-- <view class="footer">
  172. <view class="price-content">
  173. <text>实付款</text>
  174. <text class="price-tip">¥</text>
  175. <text class="price">{{orderDetail.actualPrice | priceFormat}}</text>
  176. </view>
  177. <text class="submit" @click="submit">提交订单</text>
  178. </view> -->
  179. </view>
  180. </template>
  181. <script>
  182. let riderTimer = null,
  183. timerInterval = null, // 添加定时器引用
  184. mapContext = null,
  185. riderLastLocation = null
  186. export default {
  187. filters: {
  188. priceFormat(price) {
  189. return price
  190. },
  191. dateFormat(time) {
  192. return 'temp'
  193. //return formatDate(new Date(time),'yyyy-MM-dd HH:mm')
  194. }
  195. },
  196. data() {
  197. return {
  198. verificationCode: '', // 核销码图片
  199. verificationText: '', // 核销码文本
  200. timeing: '2020-03-01 13:45',
  201. minutes: 0,
  202. seconds: 0,
  203. Total: 0,
  204. distributionFee: 123, //配送费
  205. // 配送信息
  206. DisInformation: {
  207. address: '广东省深证市中山大道1号星汇维港购物',
  208. contacts: '17671467812',
  209. expectedTime: '9月21日 13:20'
  210. },
  211. // 支付信息
  212. orderInformation: {
  213. orderNumber: '4567 8123 4567 890',
  214. information: '',
  215. paymentMethod: '微信支付',
  216. orderTime: '2018-04-28 13:58',
  217. paymentTime: '2018-04-28 13:58'
  218. },
  219. orderId: '',
  220. stateText: '', //状态文字说明
  221. orderDetail1: {
  222. skuList: [{
  223. img: 'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3529759643,1765872423&fm=26&gp=0.jpg',
  224. name: '芥蓝',
  225. price: 10,
  226. number: '2'
  227. },
  228. {
  229. img: 'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3529759643,1765872423&fm=26&gp=0.jpg',
  230. name: '芥蓝',
  231. price: 10,
  232. number: '2'
  233. }
  234. ],
  235. totalotPrice: 0,
  236. totalPrice: 0, //商品折扣(仅算VIP和限时打折)后总价
  237. coupon: undefined,
  238. mono: '',
  239. orderDetail: [],
  240. },
  241. orderDetail: {
  242. skuList: [],
  243. totalotPrice: 0,
  244. totalPrice: 0, //商品折扣(仅算VIP和限时打折)后总价
  245. coupon: undefined,
  246. mono: '',
  247. status: 20
  248. },
  249. statusMap: {
  250. 10: '未付款',
  251. 12: '等待团购活动结束',
  252. 14: '待配货',
  253. 16: '配货中',
  254. 20: '待出库',
  255. 30: '待收货',
  256. 32: '配送异常',
  257. 40: '待评价',
  258. 50: '已完成',
  259. 60: '退款中',
  260. 70: '已退款',
  261. 80: '已取消',
  262. 90: '已取消(系统)'
  263. },
  264. state: 4,
  265. markers: [{
  266. id: 1,
  267. longitude: null,
  268. latitude: null,
  269. iconPath: '../../static/icon/18.png',
  270. width: 40,
  271. height: 40
  272. },
  273. {
  274. id: 2,
  275. longitude: null,
  276. latitude: null,
  277. iconPath: '../../static/icon/08.png',
  278. width: 40,
  279. height: 40
  280. }
  281. ],
  282. polyline: [],
  283. screenshotList: [] // 照片列表
  284. }
  285. },
  286. watch: {
  287. second: {
  288. handler(newVal) {
  289. this.num(newVal)
  290. }
  291. },
  292. minute: {
  293. handler(newVal) {
  294. this.num(newVal)
  295. }
  296. },
  297. },
  298. computed: {
  299. includePoints() {
  300. // return this.markers.map(({
  301. // latitude,
  302. // longitude
  303. // }) => {
  304. // return {
  305. // latitude,
  306. // longitude
  307. // }
  308. // })
  309. const {
  310. latitude,
  311. longitude
  312. } = this.markers[1]
  313. return [{
  314. latitude,
  315. longitude
  316. }]
  317. },
  318. // 按用户类型和上传类型分组照片
  319. groupedScreenshots() {
  320. const groups = {}
  321. this.screenshotList.forEach(item => {
  322. const userTypeText = this.getUserTypeText(item.userType)
  323. const screenshotTypeText = this.getScreenshotTypeText(item.screenshotType)
  324. const timeText = item.uploadTime
  325. const groupKey = `${userTypeText}-${screenshotTypeText}-${timeText}`
  326. if (!groups[groupKey]) {
  327. groups[groupKey] = []
  328. }
  329. groups[groupKey].push(item)
  330. })
  331. return groups
  332. }
  333. },
  334. mounted() {
  335. const that = this
  336. uni.getLocation({
  337. success() {
  338. mapContext = uni.createMapContext('map', that)
  339. },
  340. fail(e) {
  341. uni.showModal({
  342. content: e
  343. })
  344. },
  345. complete() {
  346. that.loadData()
  347. }
  348. })
  349. },
  350. onLoad(option) {
  351. this.orderId = option.orderid
  352. },
  353. onUnload() {
  354. if (timerInterval) {
  355. clearInterval(timerInterval);
  356. timerInterval = null;
  357. }
  358. if (riderTimer) {
  359. clearTimeout(riderTimer)
  360. riderTimer = null
  361. }
  362. riderLastLocation = null
  363. },
  364. methods: {
  365. naviageToPage(page, title) {
  366. const that = this
  367. this.ismask = false
  368. if (title) {
  369. console.log(title, 'jinlai')
  370. title ? title : ''
  371. uni.navigateTo({
  372. url: page + '&title=' + title
  373. })
  374. } else {
  375. console.log(title)
  376. uni.navigateTo({
  377. url: page
  378. })
  379. }
  380. // console.log(that.categoryButtomList[index].title)
  381. },
  382. //申请退款
  383. //申请退款
  384. refundOrder() {
  385. const that = this
  386. uni.showModal({
  387. title: '申请退款',
  388. content: '请填写退款原因',
  389. editable: true, // 允许输入
  390. placeholderText: '请输入退款原因', // 输入框提示文字
  391. success: (e) => {
  392. if (e.confirm) {
  393. // 检查用户是否输入了退款原因
  394. if (!e.content || e.content.trim() === '') {
  395. that.$api.msg('请输入退款原因')
  396. return
  397. }
  398. // that.submiting = true
  399. that.$api.request('get', 'order/app/refund', {
  400. orderId: this.orderDetail.orderId,
  401. reason: e.content // 添加退款原因参数
  402. }, failres => {
  403. // that.submiting = false
  404. that.$api.msg(failres.msg)
  405. }).then(res => {
  406. that.loadData()
  407. // that.submiting = false
  408. // item.status = 80
  409. })
  410. }
  411. }
  412. })
  413. },
  414. //评价订单
  415. appraiseOrder() {
  416. uni.navigateTo({
  417. url: '/pages/order/appraise?orderid=' + this.orderDetail.id
  418. })
  419. },
  420. //申请售后
  421. orderAfterSales() {
  422. uni.navigateTo({
  423. url: "/pages/order/refund?id=" + this.orderDetail.id
  424. })
  425. },
  426. //取消订单
  427. cancelOrder(item) {
  428. const that = this
  429. uni.showModal({
  430. title: '取消?',
  431. content: '您确定要取消此订单吗?',
  432. success: (e) => {
  433. if (e.confirm) {
  434. // that.submiting = true
  435. that.$api.request('get', 'order/app/cancel', {
  436. orderId: this.orderDetail.orderId
  437. }, failres => {
  438. // that.submiting = false
  439. that.$api.msg(failres.msg)
  440. }).then(res => {
  441. that.loadData()
  442. // that.submiting = false
  443. // item.status = 80
  444. })
  445. }
  446. }
  447. })
  448. },
  449. // 倒计时
  450. num(n) {
  451. return n < 10 ? '0' + n : '' + n
  452. },
  453. timer() {
  454. var _this = this;
  455. this.countDown(); // 初始化倒计时
  456. // 清除之前的定时器
  457. if (this.timerInterval) {
  458. clearInterval(this.timerInterval);
  459. }
  460. this.timerInterval = setInterval(function () {
  461. if (_this.seconds === 0) {
  462. if (_this.minutes === 0) {
  463. clearInterval(_this.timerInterval);
  464. _this.autoCancelOrder(); // 时间到,自动取消订单
  465. return;
  466. }
  467. _this.minutes--;
  468. _this.seconds = 59;
  469. } else {
  470. _this.seconds--;
  471. }
  472. // 每分钟检查一次是否需要取消订单
  473. if (_this.seconds === 0 && _this.minutes % 1 === 0) {
  474. _this.countDown(); // 重新计算剩余时间,防止客户端时间不准
  475. }
  476. }, 1000);
  477. },
  478. sum() {
  479. var x = 0;
  480. for (var i = 0; i < this.orderDetail1.productList.length; ++i) {
  481. x += this.orderDetail1.productList[i].price;
  482. }
  483. console.log(x)
  484. this.Total = x
  485. },
  486. countDown() {
  487. const now = new Date().getTime();
  488. const createTime = new Date(this.orderDetail.createTime).getTime();
  489. const expireTime = createTime + (60000 * 15); // 15分钟后过期
  490. // 如果已经过期
  491. if (now >= expireTime) {
  492. this.minutes = 0;
  493. this.seconds = 0;
  494. this.autoCancelOrder(); // 自动取消订单
  495. return;
  496. }
  497. // 计算剩余时间
  498. const remainingTime = expireTime - now;
  499. this.minutes = Math.floor((remainingTime % (1000 * 60 * 60)) / (1000 * 60));
  500. this.seconds = Math.floor((remainingTime % (1000 * 60)) / 1000);
  501. // 如果剩余时间小于等于0,自动取消订单
  502. if (remainingTime <= 0) {
  503. this.minutes = 0;
  504. this.seconds = 0;
  505. this.autoCancelOrder();
  506. }
  507. },
  508. // 自动取消订单
  509. autoCancelOrder() {
  510. const that = this;
  511. if (this.orderDetail.status === 10) { // 只有未支付订单才需要取消
  512. that.$api.request('get', 'order/app/cancel', {
  513. orderId: this.orderDetail.orderId
  514. }, failres => {
  515. that.$api.msg(failres.msg);
  516. }).then(res => {
  517. //页面重新加载
  518. that.loadData(); // 刷新页面数据
  519. uni.showToast({
  520. title: '订单已自动取消',
  521. icon: 'none'
  522. });
  523. });
  524. }
  525. },
  526. //获取订单详情
  527. loadData() {
  528. const that = this
  529. that.$api.request('get', 'order/app/getOrderDetail', {
  530. orderId: that.orderId
  531. }).then(res => {
  532. that.orderDetail = res.data
  533. that.markers[0].longitude = res.data.longitude
  534. that.markers[0].latitude = res.data.latitude
  535. mapContext.moveToLocation({
  536. longitude: res.data.longitude,
  537. latitude: res.data.latitude
  538. })
  539. // 如果是自提订单且状态为待取货,获取核销码
  540. if (res.data.status === 20 && res.data.shippingType === 2) {
  541. that.getVerificationCode()
  542. }
  543. if (that.orderDetail.status === 10) {
  544. this.state = 0
  545. this.stateText = '待支付'
  546. this.timer()
  547. this.countDown()
  548. }
  549. if (res.data.status === 12) {
  550. this.state = 10
  551. this.stateText = '等待团购活动结束'
  552. }
  553. if (res.data.status === 14 || res.data.status === 16) {
  554. this.state = 1
  555. this.stateText = '派单中'
  556. this.getRiderLocation(res.data.postId, res.data.id)
  557. }
  558. if (res.data.status === 20 && res.data.shippingType === 1) {
  559. this.state = 1
  560. this.stateText = '待配送'
  561. this.getRiderLocation(res.data.postId, res.data.id)
  562. }
  563. if (res.data.status === 20 && res.data.shippingType === 2) {
  564. this.state = 1
  565. this.stateText = '待取货'
  566. }
  567. if (res.data.status === 30) {
  568. this.state = 2
  569. this.stateText = '配送中'
  570. this.getRiderLocation(res.data.postId, res.data.id)
  571. }
  572. if (res.data.status === 40) {
  573. this.state = 3
  574. this.stateText = '已完成'
  575. }
  576. if (res.data.status === 50) {
  577. this.state = 4
  578. this.stateText = '已完成'
  579. }
  580. if (res.data.status === 80 || res.data.status === 90) {
  581. this.state = 5
  582. this.stateText = '已取消'
  583. }
  584. if (res.data.status === 32) {
  585. this.state = 6
  586. this.stateText = '配送异常'
  587. }
  588. if (res.data.status === 60) {
  589. this.state = 7
  590. this.stateText = '退款中'
  591. }
  592. if (res.data.status === 70) {
  593. this.state = 8
  594. this.stateText = '已退款'
  595. }
  596. //this.sum()
  597. // 加载照片列表
  598. that.loadScreenshotList()
  599. })
  600. },
  601. getRiderLocation(riderId, orderId) {
  602. this.$api.request('get', 'order/app/riderLocation', {
  603. riderId: riderId,
  604. orderId: orderId
  605. }).then(({
  606. data
  607. }) => {
  608. this.riderLocation = data
  609. this.markers[1].longitude = data.longitude
  610. this.markers[1].latitude = data.latitude
  611. if (riderLastLocation !== (data.latitude + ',' + data.longitude)) {
  612. mapContext.includePoints({
  613. padding: [100],
  614. points: [{
  615. longitude: data.longitude,
  616. latitude: data.latitude
  617. }, {
  618. longitude: this.orderDetail.longitude,
  619. latitude: this.orderDetail.latitude
  620. }],
  621. fail(e) {
  622. console.log(e)
  623. },
  624. success(res) {
  625. console.log(res)
  626. }
  627. })
  628. this.getRoute()
  629. }
  630. riderLastLocation = data.latitude + ',' + data.longitude
  631. if (riderTimer) {
  632. clearTimeout(riderTimer)
  633. riderTimer = null
  634. }
  635. riderTimer = setTimeout(() => {
  636. this.getRiderLocation(riderId, orderId)
  637. }, 30 * 1000)
  638. })
  639. },
  640. // 获取核销码
  641. getVerificationCode() {
  642. this.$api.request('get', 'order/app/verificationCode', {
  643. orderId: this.orderId
  644. }).then(res => {
  645. this.verificationCode = 'data:image/png;base64,' + res.data.image;
  646. this.verificationText = res.data.code; // 显示核销码文本
  647. })
  648. },
  649. getRoute() {
  650. var that = this;
  651. this.$api.request('get', 'https://restapi.amap.com/v5/direction/bicycling', {
  652. key: that.$api.defConfig().mapKey,
  653. origin: this.orderDetail.longitude + ',' + this.orderDetail.latitude,
  654. destination: this.riderLocation.longitude + ',' + this.riderLocation.latitude,
  655. show_fields: 'polyline'
  656. }).then(res => {
  657. const steps = res.route.paths[0].steps
  658. this.polyline = [{
  659. points: [],
  660. color: '#5298ff',
  661. width: 5
  662. }]
  663. steps.forEach(({
  664. polyline
  665. }) => {
  666. const paths = polyline.split(';')
  667. paths.forEach(el => {
  668. const _ = el.split(',')
  669. this.polyline[0].points.push({
  670. latitude: _[1],
  671. longitude: _[0]
  672. })
  673. })
  674. })
  675. })
  676. },
  677. showPayment(val) {
  678. if (val === 'BALANCE') {
  679. return '余额支付'
  680. }
  681. if (val === 'INTEGRAL') {
  682. return '积分支付'
  683. }
  684. return '微信支付'
  685. },
  686. //确认支付
  687. confirm() {
  688. // #ifdef APP-PLUS
  689. this.$api.msg('演示环境不支持支付')
  690. return
  691. // #endif
  692. uni.showLoading({})
  693. const that = this
  694. that.$api.request('get', 'order/app/wxPrepay', {
  695. orderId: this.orderDetail.orderId
  696. }, failres => {
  697. that.submiting = false
  698. that.$api.msg(failres.msg)
  699. }).then(prepayRes => {
  700. uni.hideLoading()
  701. that.submiting = false
  702. //#ifdef MP-WEIXIN
  703. const payParam = {
  704. appId: prepayRes.data.appId,
  705. nonceStr: prepayRes.data.nonceStr,
  706. package: prepayRes.data.packageValue,
  707. timeStamp: prepayRes.data.timeStamp,
  708. signType: prepayRes.data.signType,
  709. paySign: prepayRes.data.paySign,
  710. }
  711. //#endif
  712. //#ifdef APP-PLUS
  713. const payParam = {
  714. appid: prepayRes.data.appId,
  715. noncestr: prepayRes.data.nonceStr,
  716. package: prepayRes.data.packageValue,
  717. partnerid: prepayRes.data.partnerId,
  718. prepayid: prepayRes.data.prepayId,
  719. timestamp: parseInt(prepayRes.data.timeStamp),
  720. sign: prepayRes.data.sign,
  721. signType: 'MD5'
  722. }
  723. //#endif
  724. //#ifdef MP-WEIXIN || APP-PLUS
  725. uni.requestPayment({
  726. provider: 'wxpay',
  727. //#ifdef MP-WEIXIN
  728. ...payParam,
  729. //#endif
  730. //#ifdef APP-PLUS
  731. orderInfo: payParam,
  732. //#endif
  733. success: function (res) {
  734. uni.redirectTo({
  735. url: '/pages/pay/success'
  736. })
  737. },
  738. fail: function (res) {
  739. // console.log("支付过程失败");
  740. // that.$api.msg(JSON.stringify(res))
  741. },
  742. complete: function (res) {
  743. console.log("支付过程结束")
  744. }
  745. });
  746. //#endif
  747. //#ifdef H5
  748. that.$jweixin.chooseWXPay({
  749. nonceStr: prepayRes.data.nonceStr,
  750. timestamp: prepayRes.data.timeStamp,
  751. package: prepayRes.data.packageValue,
  752. signType: prepayRes.data.signType,
  753. paySign: prepayRes.data.paySign,
  754. success: (e) => {
  755. //支付成功
  756. uni.redirectTo({
  757. url: '/pages/pay/success'
  758. })
  759. },
  760. fail: function (res) {
  761. console.log("支付过程失败");
  762. that.$api.msg(JSON.stringify(res))
  763. },
  764. complete: function (res) {
  765. console.log("支付过程结束")
  766. }
  767. })
  768. //#endif
  769. })
  770. },
  771. // 加载照片列表
  772. loadScreenshotList() {
  773. const that = this
  774. that.$api.request('get', 'order/screenshot/list/' + that.orderId).then(res => {
  775. that.screenshotList = res.data || []
  776. }).catch(err => {
  777. console.log('获取照片列表失败:', err)
  778. that.screenshotList = []
  779. })
  780. },
  781. // 获取用户类型文本
  782. getUserTypeText(userType) {
  783. const typeMap = {
  784. 1: '用户',
  785. 2: '师傅',
  786. 3: '管理员'
  787. }
  788. return typeMap[userType] || '未知'
  789. },
  790. // 获取上传类型文本
  791. getScreenshotTypeText(screenshotType) {
  792. const typeMap = {
  793. 0: '其他',
  794. 1: '创建订单',
  795. 2: '服务前',
  796. 3: '服务中',
  797. 4: '服务后',
  798. 5: '问题反馈'
  799. }
  800. return typeMap[screenshotType] || '未知'
  801. },
  802. // 预览图片
  803. previewImage(imageUrl) {
  804. uni.previewImage({
  805. urls: [imageUrl],
  806. current: imageUrl
  807. })
  808. },
  809. // 删除照片
  810. deleteScreenshot(id) {
  811. const that = this
  812. uni.showModal({
  813. title: '确认删除',
  814. content: '确定要删除这张照片吗?',
  815. success: (e) => {
  816. if (e.confirm) {
  817. that.$api.request('delete', 'order/screenshot/' + id).then(res => {
  818. that.$api.msg('删除成功')
  819. that.loadScreenshotList() // 重新加载照片列表
  820. }).catch(err => {
  821. that.$api.msg('删除失败')
  822. })
  823. }
  824. }
  825. })
  826. },
  827. // 联系师傅
  828. contactRider() {
  829. const that = this
  830. // 获取师傅联系信息
  831. that.$api.request('get', 'order/app/getRiderContact', {
  832. orderId: that.orderId
  833. }).then(res => {
  834. const riderInfo = res.data
  835. uni.showModal({
  836. title: '联系师傅',
  837. content: `师傅:${riderInfo.riderName}\n电话:${riderInfo.riderPhone}`,
  838. confirmText: '拨打电话',
  839. cancelText: '取消',
  840. success: (modalRes) => {
  841. if (modalRes.confirm) {
  842. // 拨打电话
  843. uni.makePhoneCall({
  844. phoneNumber: riderInfo.riderPhone,
  845. success: () => {
  846. console.log('拨打电话成功')
  847. },
  848. fail: (err) => {
  849. console.log('拨打电话失败', err)
  850. that.$api.msg('拨打电话失败')
  851. }
  852. })
  853. }
  854. }
  855. })
  856. }).catch(err => {
  857. that.$api.msg(err.msg || '获取师傅信息失败')
  858. })
  859. }
  860. }
  861. }
  862. </script>
  863. <style lang="scss">
  864. .verification-code {
  865. margin: 20px auto;
  866. text-align: center;
  867. padding: 20px;
  868. background: #fff;
  869. border-radius: 10px;
  870. }
  871. .code-text {
  872. margin-top: 10px;
  873. font-size: 18px;
  874. font-weight: bold;
  875. color: #333;
  876. }
  877. .code-hint {
  878. margin-top: 5px;
  879. font-size: 14px;
  880. color: #666;
  881. }
  882. page {
  883. background: $page-color-base;
  884. padding-bottom: 100upx;
  885. }
  886. .contact-btn {
  887. border: none;
  888. background-color: inherit;
  889. font-size: inherit;
  890. line-height: inherit;
  891. color: inherit;
  892. height: inherit;
  893. width: inherit;
  894. }
  895. .contact-btn::after {
  896. border: none;
  897. }
  898. .state {
  899. text-align: center;
  900. padding: 17px 0 12px;
  901. background-color: #fff;
  902. width: 100%;
  903. .state-text {
  904. font-size: 40upx;
  905. color: #2AAC34;
  906. }
  907. .state-timeText {
  908. color: #717171;
  909. font-size: 24upx;
  910. margin: 6px 0 2px;
  911. }
  912. .state-time {
  913. color: #1B1C33;
  914. font-size: 28upx;
  915. }
  916. .state-btn {
  917. width: 204upx;
  918. height: 68upx;
  919. line-height: 66upx;
  920. border-radius: 100px;
  921. margin: 0 auto;
  922. border: 1px solid #ddd;
  923. margin-top: 24upx;
  924. font-size: 15px;
  925. margin: 24upx 0 0 24upx;
  926. }
  927. .state-btn-prohibit {
  928. border-color: #C4C4CC;
  929. color: #C4C4CC;
  930. }
  931. .state-btn-ac {
  932. border-color: #2AAC34;
  933. color: #2AAC34;
  934. background-color: #2AAC34;
  935. color: #fff;
  936. }
  937. .state-btn-contact {
  938. border-color: #1890ff;
  939. color: #1890ff;
  940. background-color: #1890ff;
  941. color: #fff;
  942. }
  943. }
  944. .goods {
  945. margin-top: 20upx;
  946. background-color: #FFFFFF;
  947. overflow: hidden;
  948. .goods-one {
  949. padding: 40upx 0 30upx 0;
  950. margin: 0 30upx;
  951. height: 190upx;
  952. border-bottom: 1px solid #F1F1F1;
  953. }
  954. .goods-img {
  955. margin-top: 2upx;
  956. width: 118upx;
  957. height: 110upx;
  958. float: left;
  959. }
  960. .goods-text {
  961. margin-top: 6upx;
  962. margin-left: 32upx;
  963. width: 538upx;
  964. height: 110upx;
  965. float: left;
  966. }
  967. .goods-name {
  968. width: 500upx;
  969. line-height: 44upx;
  970. overflow: hidden;
  971. color: #333333;
  972. font-size: 32upx;
  973. }
  974. .goods-tag {
  975. margin-top: 10upx;
  976. display: flex;
  977. justify-content: space-between;
  978. align-items: center;
  979. }
  980. .goods-price {
  981. float: left;
  982. color: #333333;
  983. font-size: 32upx;
  984. line-height: 44upx;
  985. }
  986. .goods-yprice {
  987. margin-left: 16upx;
  988. float: left;
  989. color: #AEAEAE;
  990. font-size: 24upx;
  991. line-height: 44upx;
  992. text-decoration: line-through;
  993. }
  994. .goods-number {
  995. float: left;
  996. color: #333333;
  997. font-size: 32upx;
  998. }
  999. }
  1000. .address-section {
  1001. padding: 30upx 0;
  1002. background: #fff;
  1003. position: relative;
  1004. .order-content {
  1005. display: flex;
  1006. align-items: center;
  1007. }
  1008. .icon-shouhuodizhi {
  1009. flex-shrink: 0;
  1010. display: flex;
  1011. align-items: center;
  1012. justify-content: center;
  1013. width: 90upx;
  1014. color: #888;
  1015. font-size: 44upx;
  1016. }
  1017. .cen {
  1018. display: flex;
  1019. flex-direction: column;
  1020. flex: 1;
  1021. font-size: 28upx;
  1022. color: $font-color-dark;
  1023. }
  1024. .name {
  1025. font-size: 34upx;
  1026. margin-right: 24upx;
  1027. }
  1028. .address {
  1029. margin-top: 16upx;
  1030. margin-right: 20upx;
  1031. color: $font-color-light;
  1032. }
  1033. .icon-you {
  1034. font-size: 32upx;
  1035. color: $font-color-light;
  1036. margin-right: 30upx;
  1037. }
  1038. .a-bg {
  1039. position: absolute;
  1040. left: 0;
  1041. bottom: 0;
  1042. display: block;
  1043. width: 100%;
  1044. height: 5upx;
  1045. }
  1046. }
  1047. .goods-section {
  1048. margin-top: 16upx;
  1049. background: #fff;
  1050. padding-bottom: 1px;
  1051. .g-header {
  1052. display: flex;
  1053. align-items: center;
  1054. height: 84upx;
  1055. padding: 0 30upx;
  1056. position: relative;
  1057. }
  1058. .logo {
  1059. display: block;
  1060. width: 50upx;
  1061. height: 50upx;
  1062. border-radius: 100px;
  1063. }
  1064. .name {
  1065. font-size: 30upx;
  1066. color: $font-color-base;
  1067. margin-left: 24upx;
  1068. }
  1069. .g-item {
  1070. display: flex;
  1071. margin: 20upx 30upx;
  1072. image {
  1073. flex-shrink: 0;
  1074. display: block;
  1075. width: 140upx;
  1076. height: 140upx;
  1077. border-radius: 4upx;
  1078. }
  1079. .right {
  1080. flex: 1;
  1081. padding-left: 24upx;
  1082. overflow: hidden;
  1083. }
  1084. .title {
  1085. font-size: 30upx;
  1086. color: $font-color-dark;
  1087. }
  1088. .spec {
  1089. font-size: 26upx;
  1090. color: $font-color-light;
  1091. }
  1092. .price-box {
  1093. display: flex;
  1094. align-items: center;
  1095. font-size: 32upx;
  1096. color: $font-color-dark;
  1097. padding-top: 10upx;
  1098. .price {
  1099. margin-bottom: 4upx;
  1100. }
  1101. .number {
  1102. font-size: 26upx;
  1103. color: $font-color-base;
  1104. margin-left: 20upx;
  1105. }
  1106. }
  1107. .step-box {
  1108. position: relative;
  1109. }
  1110. }
  1111. }
  1112. .yt-list {
  1113. margin-top: 16upx;
  1114. background: #fff;
  1115. }
  1116. .yt-list-cell-bor {
  1117. border-bottom: 1px solid #F1F1F1;
  1118. }
  1119. .yt-list-cell {
  1120. display: flex;
  1121. align-items: center;
  1122. padding: 10upx 30upx 10upx 40upx;
  1123. line-height: 70upx;
  1124. position: relative;
  1125. &.cell-hover {
  1126. background: #fafafa;
  1127. }
  1128. &.b-b:after {
  1129. left: 30upx;
  1130. }
  1131. .cell-icon {
  1132. height: 32upx;
  1133. width: 32upx;
  1134. font-size: 22upx;
  1135. color: #fff;
  1136. text-align: center;
  1137. line-height: 32upx;
  1138. background: #f85e52;
  1139. border-radius: 4upx;
  1140. margin-right: 12upx;
  1141. &.hb {
  1142. background: #ffaa0e;
  1143. }
  1144. &.lpk {
  1145. background: #3ab54a;
  1146. }
  1147. }
  1148. .cell-more {
  1149. align-self: center;
  1150. font-size: 24upx;
  1151. color: $font-color-light;
  1152. margin-left: 8upx;
  1153. margin-right: -10upx;
  1154. }
  1155. .cell-tit {
  1156. flex: 1;
  1157. font-size: 26upx;
  1158. color: $font-color-light;
  1159. margin-right: 10upx;
  1160. }
  1161. .cell-tip {
  1162. font-size: 26upx;
  1163. color: $font-color-dark;
  1164. &.disabled {
  1165. color: $font-color-light;
  1166. }
  1167. &.active {
  1168. color: $base-color;
  1169. }
  1170. &.red {
  1171. color: $base-color;
  1172. }
  1173. }
  1174. &.desc-cell {
  1175. .cell-tit {
  1176. max-width: 90upx;
  1177. }
  1178. }
  1179. .desc {
  1180. flex: 1;
  1181. font-size: $font-base;
  1182. color: $font-color-dark;
  1183. }
  1184. .yt-list-title {
  1185. font-size: 16px;
  1186. font-family: PingFangSC-Medium, PingFang SC;
  1187. font-weight: 500;
  1188. color: rgba(51, 51, 51, 1);
  1189. }
  1190. }
  1191. /* 支付列表 */
  1192. .pay-list {
  1193. padding-left: 40upx;
  1194. margin-top: 16upx;
  1195. background: #fff;
  1196. .pay-item {
  1197. display: flex;
  1198. align-items: center;
  1199. padding-right: 20upx;
  1200. line-height: 1;
  1201. height: 110upx;
  1202. position: relative;
  1203. }
  1204. .icon-weixinzhifu {
  1205. width: 80upx;
  1206. font-size: 40upx;
  1207. color: #6BCC03;
  1208. }
  1209. .icon-alipay {
  1210. width: 80upx;
  1211. font-size: 40upx;
  1212. color: #06B4FD;
  1213. }
  1214. .icon-xuanzhong2 {
  1215. display: flex;
  1216. align-items: center;
  1217. justify-content: center;
  1218. width: 60upx;
  1219. height: 60upx;
  1220. font-size: 40upx;
  1221. color: $base-color;
  1222. }
  1223. .tit {
  1224. font-size: 32upx;
  1225. color: $font-color-dark;
  1226. flex: 1;
  1227. }
  1228. }
  1229. .footer {
  1230. position: fixed;
  1231. left: 0;
  1232. bottom: 0;
  1233. z-index: 995;
  1234. display: flex;
  1235. align-items: center;
  1236. width: 100%;
  1237. height: 90upx;
  1238. justify-content: space-between;
  1239. font-size: 30upx;
  1240. background-color: #fff;
  1241. z-index: 998;
  1242. color: $font-color-base;
  1243. box-shadow: 0 -1px 5px rgba(0, 0, 0, .1);
  1244. .price-content {
  1245. padding-left: 30upx;
  1246. }
  1247. .price-tip {
  1248. color: $base-color;
  1249. margin-left: 8upx;
  1250. }
  1251. .price {
  1252. font-size: 36upx;
  1253. color: $base-color;
  1254. }
  1255. .submit {
  1256. display: flex;
  1257. align-items: center;
  1258. justify-content: center;
  1259. width: 280upx;
  1260. height: 100%;
  1261. color: #fff;
  1262. font-size: 32upx;
  1263. background-color: $base-color;
  1264. }
  1265. }
  1266. /* 优惠券面板 */
  1267. .mask {
  1268. display: flex;
  1269. align-items: flex-end;
  1270. position: fixed;
  1271. left: 0;
  1272. top: var(--window-top);
  1273. bottom: 0;
  1274. width: 100%;
  1275. background: rgba(0, 0, 0, 0);
  1276. z-index: 9995;
  1277. transition: .3s;
  1278. .mask-content {
  1279. width: 100%;
  1280. min-height: 30vh;
  1281. max-height: 70vh;
  1282. background: #f3f3f3;
  1283. transform: translateY(100%);
  1284. transition: .3s;
  1285. overflow-y: scroll;
  1286. }
  1287. &.none {
  1288. display: none;
  1289. }
  1290. &.show {
  1291. background: rgba(0, 0, 0, .4);
  1292. .mask-content {
  1293. transform: translateY(0);
  1294. }
  1295. }
  1296. }
  1297. /* 优惠券列表 */
  1298. .coupon-item {
  1299. display: flex;
  1300. flex-direction: column;
  1301. margin: 20upx 24upx;
  1302. background: #fff;
  1303. .con {
  1304. display: flex;
  1305. align-items: center;
  1306. position: relative;
  1307. height: 120upx;
  1308. padding: 0 30upx;
  1309. &:after {
  1310. position: absolute;
  1311. left: 0;
  1312. bottom: 0;
  1313. content: '';
  1314. width: 100%;
  1315. height: 0;
  1316. border-bottom: 1px dashed #f3f3f3;
  1317. transform: scaleY(50%);
  1318. }
  1319. }
  1320. .left {
  1321. display: flex;
  1322. flex-direction: column;
  1323. justify-content: center;
  1324. flex: 1;
  1325. overflow: hidden;
  1326. height: 100upx;
  1327. }
  1328. .title {
  1329. font-size: 32upx;
  1330. color: $font-color-dark;
  1331. margin-bottom: 10upx;
  1332. }
  1333. .time {
  1334. font-size: 24upx;
  1335. color: $font-color-light;
  1336. }
  1337. .right {
  1338. display: flex;
  1339. flex-direction: column;
  1340. justify-content: center;
  1341. align-items: center;
  1342. font-size: 26upx;
  1343. color: $font-color-base;
  1344. height: 100upx;
  1345. }
  1346. .price {
  1347. font-size: 44upx;
  1348. color: $base-color;
  1349. &:before {
  1350. content: '¥';
  1351. font-size: 34upx;
  1352. }
  1353. }
  1354. .tips {
  1355. font-size: 24upx;
  1356. color: $font-color-light;
  1357. line-height: 60upx;
  1358. padding-left: 30upx;
  1359. }
  1360. .circle {
  1361. position: absolute;
  1362. left: -6upx;
  1363. bottom: -10upx;
  1364. z-index: 10;
  1365. width: 20upx;
  1366. height: 20upx;
  1367. background: #f3f3f3;
  1368. border-radius: 100px;
  1369. &.r {
  1370. left: auto;
  1371. right: -6upx;
  1372. }
  1373. }
  1374. }
  1375. /* 照片信息样式 */
  1376. .screenshot-groups {
  1377. padding: 0 30upx 20upx;
  1378. }
  1379. .screenshot-group {
  1380. margin-bottom: 30upx;
  1381. &:last-child {
  1382. margin-bottom: 0;
  1383. }
  1384. }
  1385. .group-title {
  1386. font-size: 30upx;
  1387. font-weight: 500;
  1388. color: #909399;
  1389. margin-bottom: 20upx;
  1390. padding: 10upx 0;
  1391. border-bottom: 1px solid #e5e5e5;
  1392. padding-left: 10upx;
  1393. }
  1394. .screenshot-grid {
  1395. display: flex;
  1396. flex-wrap: wrap;
  1397. gap: 20upx;
  1398. }
  1399. .screenshot-item {
  1400. position: relative;
  1401. width: calc(33.333% - 14upx);
  1402. aspect-ratio: 1;
  1403. border-radius: 8upx;
  1404. overflow: hidden;
  1405. box-shadow: 0 2upx 8upx rgba(0, 0, 0, 0.1);
  1406. .screenshot-image {
  1407. width: 100%;
  1408. height: 100%;
  1409. }
  1410. .screenshot-overlay {
  1411. position: absolute;
  1412. top: 0;
  1413. left: 0;
  1414. right: 0;
  1415. bottom: 0;
  1416. background: rgba(0, 0, 0, 0.3);
  1417. display: flex;
  1418. align-items: center;
  1419. justify-content: center;
  1420. opacity: 0;
  1421. transition: opacity 0.3s;
  1422. .delete-btn {
  1423. background-color: #ff3b30;
  1424. color: #fff;
  1425. padding: 8upx 16upx;
  1426. border-radius: 6upx;
  1427. font-size: 24upx;
  1428. }
  1429. }
  1430. &:hover .screenshot-overlay,
  1431. &:active .screenshot-overlay {
  1432. opacity: 1;
  1433. }
  1434. }
  1435. </style>