create.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. <template>
  2. <view class="page client-theme client-subpage">
  3. <view v-if="pageLoading" class="page-loading-wrap">
  4. <ClientSkeleton variant="detail" :rows="3" />
  5. </view>
  6. <template v-else>
  7. <view class="client-subpage-hero create-hero">
  8. <text class="client-subpage-hero__title">确认订单</text>
  9. <text class="client-subpage-hero__sub">核对商品、地址与支付方式</text>
  10. </view>
  11. <view class="create-body">
  12. <view class="address-card">
  13. <view class="addr-left">
  14. <image class="addr-icon" :src="ICON_COORDINATE" mode="aspectFit" />
  15. </view>
  16. <view class="addr-main">
  17. <view class="addr-top">
  18. <text class="addr-title">收货地址</text>
  19. <text class="addr-edit" @click.stop="goSelectAddress">修改 ›</text>
  20. </view>
  21. <view v-if="selectedAddress" class="addr-content">
  22. <view class="addr-person-row">
  23. <text class="addr-person-name">{{ selectedAddress.contactPerson }}</text>
  24. <text class="addr-phone">{{ selectedAddress.contactPhone }}</text>
  25. </view>
  26. <text class="addr-detail">{{ fullAddress(selectedAddress) }}</text>
  27. </view>
  28. <view v-else class="addr-empty">
  29. <text class="addr-empty-text">请先添加收货地址</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="address-card">
  34. <view class="addr-main">
  35. <view class="addr-top">
  36. <text class="addr-title">支付方式</text>
  37. </view>
  38. <radio-group class="pay-group" @change="onPaymentMethodChange">
  39. <label class="pay-row">
  40. <text class="pay-text">线上支付({{ autoCancelMinutesText }}分钟未支付,自动取消)</text>
  41. <radio value="online" :checked="paymentMethod === 'online'" color="#07c160" />
  42. </label>
  43. <label class="pay-row">
  44. <text class="pay-text">线下支付</text>
  45. <radio value="offline" :checked="paymentMethod === 'offline'" color="#07c160" />
  46. </label>
  47. </radio-group>
  48. </view>
  49. </view>
  50. <view class="section">
  51. <view class="section-title"><text>商品明细</text></view>
  52. <view v-if="cartItemsForOrder.length === 0" class="empty-box">
  53. <text>购物车为空</text>
  54. </view>
  55. <view v-else>
  56. <view v-for="item in cartItemsForOrder" :key="item.id" class="cart-item order-line">
  57. <view class="item-image sq-product-thumb sq-product-thumb--sm" @click="goProductView(item.productId)">
  58. <ClientImageLoader :src="item.imageUrl || IMG_DEFAULT_PRODUCT" mode="aspectFill" radius="20rpx" />
  59. </view>
  60. <view class="item-info" @click="goProductView(item.productId)">
  61. <text class="item-name">{{ item.productName }}</text>
  62. <text class="item-unit">{{ formatMeasureText(item.measureValue, item.unitName) }}</text>
  63. <view class="item-bottom">
  64. <text class="item-price">¥{{ formatPrice(item.price) }}</text>
  65. <view class="quantity-control">
  66. <view class="qty-btn" @click.stop="updateQuantity(item.id, -1)">
  67. <text>-</text>
  68. </view>
  69. <text class="qty-num">{{ item.quantity }}</text>
  70. <view class="qty-btn" @click.stop="updateQuantity(item.id, 1)">
  71. <text>+</text>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="item-delete" @click.stop="removeItem(item.id)">
  77. <image class="item-delete-icon" :src="ICON_DELETE" mode="aspectFit" />
  78. </view>
  79. </view>
  80. <view class="total-row">
  81. <text>合计(元)</text>
  82. <text class="total">¥{{ totalText }}</text>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="section">
  87. <view class="section-title"><text>备注</text></view>
  88. <textarea
  89. v-model="remark"
  90. class="remark"
  91. placeholder="选填:配送说明等"
  92. maxlength="200"
  93. />
  94. </view>
  95. </view>
  96. <view class="footer">
  97. <view class="footer-sum">
  98. <text class="label">应付(元)</text>
  99. <text class="price">¥{{ totalText }}</text>
  100. </view>
  101. <button
  102. class="submit-btn"
  103. :class="{ 'is-disabled': !canSubmit }"
  104. @click="submitOrder"
  105. >
  106. {{ submitting ? '提交中...' : '提交订单' }}
  107. </button>
  108. </view>
  109. <ProductDetailOverlay
  110. :show="showProductOverlay"
  111. :product-id="overlayProductId"
  112. bottom-mode="cart"
  113. @close="closeProductOverlay"
  114. />
  115. </template>
  116. </view>
  117. </template>
  118. <script setup>
  119. import { ref, computed, onMounted, onUnmounted } from 'vue'
  120. import { onLoad, onShow } from '@dcloudio/uni-app'
  121. import { useUserStore } from '@/stores/user'
  122. import { useCartStore } from '@/stores/cart'
  123. import { request, parseResponseJson } from '@/utils/request'
  124. import { formatYuan } from '@/utils/format'
  125. import ProductDetailOverlay from '@/components/client/product-detail-overlay.vue'
  126. import ClientSkeleton from '@/components/client/client-skeleton.vue'
  127. import ClientImageLoader from '@/components/client/client-image-loader.vue'
  128. import { IMG_DEFAULT_PRODUCT, staticAssetUrl } from '@/utils/staticAsset'
  129. import { on as busOn, off as busOff } from '@/utils/bus'
  130. import { ensurePriceRealtimeConnected, checkActivePriceVersionOnce } from '@/utils/price-realtime'
  131. const userStore = useUserStore()
  132. const cartStore = useCartStore()
  133. const addresses = ref([])
  134. const selectedAddressId = ref('')
  135. const SELECTED_DELIVERY_ADDRESS_ID_KEY = 'sq_selected_delivery_address_id'
  136. const selectedAddress = computed(() => {
  137. const byId = addresses.value.find((a) => a.id === selectedAddressId.value)
  138. if (byId) return byId
  139. return addresses.value.find((a) => a.isDefault) || addresses.value[0] || null
  140. })
  141. const remark = ref('')
  142. const paymentMethod = ref('online')
  143. const submitting = ref(false)
  144. const pageLoading = ref(true)
  145. const autoCancelMinutes = ref(30)
  146. const selectedCartIds = ref([])
  147. const hasSelectedCartIdsParam = ref(false)
  148. // 确认订单页“删除”仅影响本页展示,不影响购物车
  149. const excludedCartIds = ref(new Set())
  150. const cartItemsForOrder = computed(() => {
  151. const excluded = excludedCartIds.value
  152. if (!hasSelectedCartIdsParam.value) return cartStore.items.filter((i) => !excluded.has(i.id))
  153. const set = new Set(selectedCartIds.value)
  154. return cartStore.items.filter((i) => set.has(i.id) && !excluded.has(i.id))
  155. })
  156. const totalText = computed(() => formatYuan(cartItemsForOrder.value.reduce((sum, i) => sum + i.amount, 0)))
  157. const autoCancelMinutesText = computed(() => String(autoCancelMinutes.value || 30))
  158. const canSubmit = computed(() => !!selectedAddressId.value && cartItemsForOrder.value.length > 0 && !submitting.value)
  159. const ICON_COORDINATE = staticAssetUrl('coordinate.svg')
  160. const ICON_DELETE = staticAssetUrl('delete.svg')
  161. function onPaymentMethodChange(e) {
  162. const value = (e && e.detail && e.detail.value ? String(e.detail.value) : '').toString()
  163. if (value === 'online' || value === 'offline') paymentMethod.value = value
  164. }
  165. function formatPrice(price) {
  166. return formatYuan(price)
  167. }
  168. function formatMeasureText(measureValue, unitName) {
  169. const unitText = (unitName || '').trim()
  170. if (measureValue == null || measureValue === '') {
  171. return unitText ? `- ${unitText}` : '-'
  172. }
  173. const num = Number(measureValue)
  174. if (!Number.isNaN(num)) {
  175. const measureText = String(num).replace(/\.?0+$/, '')
  176. return unitText ? `${measureText} ${unitText}` : measureText
  177. }
  178. const measureText = String(measureValue).trim()
  179. return unitText ? `${measureText} ${unitText}` : measureText || '-'
  180. }
  181. function fullAddress(addr) {
  182. return `${addr.province || ''}${addr.city || ''}${addr.district || ''}${addr.detailAddress || ''}`
  183. }
  184. async function loadAddresses() {
  185. try {
  186. const res = await request({
  187. url: '/mini/client/addresses',
  188. method: 'GET',
  189. data: { page: 1, pageSize: 100 }
  190. })
  191. const body = parseResponseJson(res)
  192. if (body.code !== 200) return
  193. const payload = body.data
  194. const list = Array.isArray(payload)
  195. ? payload
  196. : Array.isArray(payload && payload.list)
  197. ? payload.list
  198. : []
  199. addresses.value = list
  200. const storedId = uni.getStorageSync(SELECTED_DELIVERY_ADDRESS_ID_KEY) || ''
  201. const storedAddr = storedId ? list.find((a) => a.id === storedId) : null
  202. const def = list.find((a) => a.isDefault) || list[0] || null
  203. selectedAddressId.value = (storedAddr && storedAddr.id) || (def && def.id) || ''
  204. if (selectedAddressId.value) {
  205. uni.setStorageSync(SELECTED_DELIVERY_ADDRESS_ID_KEY, selectedAddressId.value)
  206. }
  207. } catch {
  208. uni.showToast({ title: '加载地址失败', icon: 'none' })
  209. }
  210. }
  211. async function loadAutoCancelMinutes() {
  212. try {
  213. const res = await request({
  214. url: '/web/admin/system-config/get/auto_cancel_minutes',
  215. method: 'GET'
  216. })
  217. const body = parseResponseJson(res)
  218. const raw = body && body.code === 200 && body.data ? body.data.value : null
  219. const minutes = Number(raw)
  220. if (Number.isFinite(minutes) && minutes > 0) {
  221. autoCancelMinutes.value = Math.floor(minutes)
  222. } else {
  223. autoCancelMinutes.value = 30
  224. }
  225. } catch {
  226. autoCancelMinutes.value = 30
  227. }
  228. }
  229. function goSelectAddress() {
  230. uni.navigateTo({ url: '/pages/client/address/select' })
  231. }
  232. async function submitOrder() {
  233. if (submitting.value) return
  234. if (cartItemsForOrder.value.length === 0) {
  235. uni.showToast({ title: '购物车为空', icon: 'none' })
  236. return
  237. }
  238. if (!selectedAddressId.value) {
  239. uni.showToast({ title: '请选择收货地址', icon: 'none' })
  240. return
  241. }
  242. submitting.value = true
  243. // 以“当前确认页剩余商品”为准(支持确认页临时删除)
  244. const orderedCartIds = cartItemsForOrder.value.map(i => i.id)
  245. try {
  246. let res
  247. if (hasSelectedCartIdsParam.value) {
  248. const plRes = await request({ url: '/mini/client/price-list/current', method: 'GET' })
  249. const plBody = parseResponseJson(plRes)
  250. const priceListId = plBody.code === 200 ? (plBody.data && plBody.data.id ? plBody.data.id : '') : ''
  251. if (!priceListId) {
  252. uni.showToast({ title: '当前区域无生效价格清单', icon: 'none' })
  253. return
  254. }
  255. res = await request({
  256. url: '/mini/client/orders',
  257. method: 'POST',
  258. data: {
  259. priceListId,
  260. addressId: selectedAddressId.value,
  261. paymentMethod: paymentMethod.value,
  262. remark: remark.value || undefined,
  263. items: cartItemsForOrder.value.map((i) => ({
  264. productId: i.productId,
  265. quantity: i.quantity
  266. }))
  267. }
  268. })
  269. } else {
  270. res = await request({
  271. url: '/mini/client/orders/from-cart',
  272. method: 'POST',
  273. data: {
  274. addressId: selectedAddressId.value,
  275. paymentMethod: paymentMethod.value,
  276. remark: remark.value || undefined
  277. }
  278. })
  279. }
  280. const body = parseResponseJson(res)
  281. if (body.code === 200 && body.data && body.data.orderId) {
  282. if (hasSelectedCartIdsParam.value) {
  283. await cartStore.batchRemove(orderedCartIds)
  284. } else {
  285. await cartStore.fetchCart()
  286. }
  287. uni.redirectTo({
  288. url: `/pages/client/order/pay/pay?id=${encodeURIComponent(body.data.orderId)}&from=create`
  289. })
  290. } else {
  291. uni.showToast({ title: body.message || '下单失败', icon: 'none' })
  292. }
  293. } catch {
  294. uni.showToast({ title: '网络异常', icon: 'none' })
  295. } finally {
  296. submitting.value = false
  297. }
  298. }
  299. function goAddAddress() {
  300. uni.navigateTo({ url: '/pages/client/address/address' })
  301. }
  302. async function updateQuantity(cartId, delta) {
  303. const item = cartStore.items.find((i) => i.id === cartId)
  304. if (!item) return
  305. const newQuantity = item.quantity + delta
  306. if (newQuantity <= 0) {
  307. const next = new Set(excludedCartIds.value)
  308. next.add(cartId)
  309. excludedCartIds.value = next
  310. return
  311. }
  312. await cartStore.updateQuantity(cartId, newQuantity)
  313. }
  314. async function removeItem(cartId) {
  315. uni.showModal({
  316. title: '提示',
  317. content: '确定删除该商品?',
  318. success: async (res) => {
  319. if (!res.confirm) return
  320. const next = new Set(excludedCartIds.value)
  321. next.add(cartId)
  322. excludedCartIds.value = next
  323. }
  324. })
  325. }
  326. // 商品详情弹窗
  327. const showProductOverlay = ref(false)
  328. const overlayProductId = ref('')
  329. function goProductView(productId) {
  330. if (!productId) return
  331. overlayProductId.value = productId
  332. showProductOverlay.value = true
  333. }
  334. function closeProductOverlay() {
  335. showProductOverlay.value = false
  336. }
  337. onMounted(async () => {
  338. userStore.checkLoginStatus()
  339. if (!userStore.isLoggedIn) {
  340. uni.reLaunch({ url: '/pages/login/login' })
  341. return
  342. }
  343. if (!userStore.isClient) {
  344. uni.showToast({ title: '仅客户可访问', icon: 'none' })
  345. setTimeout(() => userStore.navigateToHome(), 1200)
  346. return
  347. }
  348. try {
  349. await cartStore.fetchCart()
  350. if (cartStore.isEmpty) {
  351. uni.showToast({ title: '请先加购商品', icon: 'none' })
  352. setTimeout(() => uni.switchTab({ url: '/pages/client/home/home' }), 800)
  353. return
  354. }
  355. await Promise.all([loadAddresses(), loadAutoCancelMinutes()])
  356. } finally {
  357. pageLoading.value = false
  358. }
  359. })
  360. onShow(() => {
  361. userStore.checkLoginStatus()
  362. // 返回收货地址选择页后,刷新当前选中地址显示
  363. if (!userStore.isLoggedIn) return
  364. if (!userStore.isClient) return
  365. void ensurePriceRealtimeConnected()
  366. void checkActivePriceVersionOnce()
  367. void cartStore.fetchCart()
  368. void loadAddresses()
  369. })
  370. onLoad((options) => {
  371. const raw = options?.cartIds
  372. if (typeof raw === 'string') {
  373. let decoded = raw.trim()
  374. for (let i = 0; i < 2; i += 1) {
  375. try {
  376. const next = decodeURIComponent(decoded)
  377. if (next === decoded) break
  378. decoded = next
  379. } catch {
  380. break
  381. }
  382. }
  383. hasSelectedCartIdsParam.value = true
  384. selectedCartIds.value = decoded
  385. .split(',')
  386. .map(s => s.trim())
  387. .filter(Boolean)
  388. } else {
  389. hasSelectedCartIdsParam.value = false
  390. selectedCartIds.value = []
  391. }
  392. excludedCartIds.value = new Set()
  393. })
  394. const onPriceListUpdated = () => {
  395. // 与首页/购物车一致:价格清单更新后,确认订单明细与金额应立即重算
  396. void cartStore.fetchCart()
  397. }
  398. onMounted(() => {
  399. busOn('price_list_updated', onPriceListUpdated)
  400. uni.$on && uni.$on('price_list_updated', onPriceListUpdated)
  401. })
  402. onUnmounted(() => {
  403. busOff('price_list_updated', onPriceListUpdated)
  404. uni.$off && uni.$off('price_list_updated', onPriceListUpdated)
  405. })
  406. </script>
  407. <style lang="scss" scoped>
  408. .page {
  409. min-height: 100vh;
  410. background: var(--c-bg);
  411. padding-bottom: 0;
  412. box-sizing: border-box;
  413. }
  414. .page-loading-wrap {
  415. flex: 1;
  416. min-height: 0;
  417. }
  418. .create-scroll {
  419. flex: 1;
  420. min-height: 0;
  421. height: 0;
  422. width: 100%;
  423. box-sizing: border-box;
  424. }
  425. .create-body {
  426. padding: 24rpx 32rpx;
  427. padding-bottom: calc(220rpx + constant(safe-area-inset-bottom));
  428. padding-bottom: calc(220rpx + env(safe-area-inset-bottom, 0px));
  429. box-sizing: border-box;
  430. }
  431. .section {
  432. background: var(--c-card);
  433. border-radius: var(--c-radius-card);
  434. border: 1rpx solid var(--c-border);
  435. padding: 24rpx;
  436. margin-bottom: 24rpx;
  437. }
  438. .section-title {
  439. display: flex;
  440. justify-content: space-between;
  441. align-items: center;
  442. font-size: 30rpx;
  443. font-weight: 700;
  444. margin-bottom: 20rpx;
  445. .link {
  446. font-size: 26rpx;
  447. color: var(--c-brand-green);
  448. }
  449. }
  450. .address-card {
  451. display: flex;
  452. background: var(--c-card);
  453. border-radius: var(--c-radius-card);
  454. border: 1rpx solid var(--c-border);
  455. padding: 22rpx 20rpx;
  456. margin-bottom: 18rpx;
  457. box-shadow: none;
  458. box-sizing: border-box;
  459. .addr-left {
  460. width: 56rpx;
  461. display: flex;
  462. justify-content: center;
  463. padding-top: 4rpx;
  464. .addr-icon {
  465. width: 34rpx;
  466. height: 34rpx;
  467. }
  468. }
  469. .addr-main {
  470. flex: 1;
  471. min-width: 0;
  472. }
  473. .addr-top {
  474. display: flex;
  475. justify-content: space-between;
  476. align-items: center;
  477. margin-bottom: 10rpx;
  478. .addr-title {
  479. font-size: 28rpx;
  480. color: var(--c-text);
  481. font-weight: 700;
  482. }
  483. .addr-edit {
  484. font-size: 24rpx;
  485. color: var(--c-brand-green);
  486. }
  487. }
  488. .addr-content {
  489. .addr-person-row {
  490. display: flex;
  491. align-items: center;
  492. flex-wrap: wrap;
  493. gap: 12rpx;
  494. margin-bottom: 6rpx;
  495. }
  496. .addr-person-name {
  497. font-size: 26rpx;
  498. color: var(--c-text);
  499. }
  500. .addr-phone {
  501. font-size: 26rpx;
  502. color: var(--c-text);
  503. }
  504. .addr-detail {
  505. display: block;
  506. font-size: 24rpx;
  507. color: var(--c-muted);
  508. line-height: 1.4;
  509. word-break: break-all;
  510. }
  511. }
  512. .addr-empty {
  513. padding: 12rpx 0 6rpx;
  514. .addr-empty-text {
  515. font-size: 26rpx;
  516. color: var(--c-muted);
  517. }
  518. }
  519. }
  520. .cart-item {
  521. display: flex;
  522. padding: 20rpx 0;
  523. position: relative;
  524. border-bottom: 1rpx solid rgba(220, 235, 228, 0.65);
  525. &:last-child {
  526. border-bottom: none;
  527. }
  528. }
  529. .item-image {
  530. width: 160rpx;
  531. height: 160rpx;
  532. border-radius: 20rpx;
  533. overflow: hidden;
  534. background: linear-gradient(145deg, #f4fbf8, #e4f6ef);
  535. flex-shrink: 0;
  536. image {
  537. width: 100%;
  538. height: 100%;
  539. }
  540. }
  541. .item-info {
  542. flex: 1;
  543. display: flex;
  544. flex-direction: column;
  545. justify-content: space-between;
  546. margin-left: 20rpx;
  547. min-width: 0;
  548. padding-right: 20rpx;
  549. }
  550. .item-name {
  551. display: block;
  552. font-size: 28rpx;
  553. color: var(--c-text);
  554. line-height: 1.45;
  555. word-break: break-word;
  556. overflow-wrap: break-word;
  557. padding-right: 52rpx;
  558. }
  559. .item-unit {
  560. font-size: 24rpx;
  561. color: var(--c-muted);
  562. margin-top: 8rpx;
  563. padding-right: 52rpx;
  564. }
  565. .item-bottom {
  566. display: flex;
  567. justify-content: space-between;
  568. align-items: center;
  569. margin-top: 16rpx;
  570. }
  571. .item-price {
  572. font-size: 32rpx;
  573. color: var(--c-danger);
  574. font-weight: bold;
  575. }
  576. .quantity-control {
  577. display: flex;
  578. align-items: center;
  579. justify-content: flex-end;
  580. margin-left: auto;
  581. .qty-btn {
  582. width: 48rpx;
  583. height: 48rpx;
  584. border: 2rpx solid #b9decf;
  585. border-radius: 999rpx;
  586. display: flex;
  587. align-items: center;
  588. justify-content: center;
  589. font-size: 28rpx;
  590. color: var(--c-brand-green);
  591. background: #ffffff;
  592. &:active {
  593. background: rgba(220, 235, 228, 0.45);
  594. }
  595. }
  596. .qty-num {
  597. min-width: 60rpx;
  598. text-align: center;
  599. font-size: 28rpx;
  600. color: var(--c-text);
  601. }
  602. }
  603. .item-delete {
  604. position: absolute;
  605. top: 20rpx;
  606. right: 20rpx;
  607. padding: 10rpx;
  608. }
  609. .item-delete-icon {
  610. width: 36rpx;
  611. height: 36rpx;
  612. }
  613. .empty-box {
  614. padding: 40rpx 0;
  615. text-align: center;
  616. color: var(--c-muted);
  617. font-size: 26rpx;
  618. }
  619. .mini-btn {
  620. margin-top: 20rpx;
  621. font-size: 26rpx;
  622. color: var(--c-brand-green);
  623. background: var(--c-brand-green-soft);
  624. }
  625. .addr-row {
  626. display: flex;
  627. align-items: flex-start;
  628. padding: 16rpx 0;
  629. border-bottom: 1rpx solid rgba(220, 235, 228, 0.65);
  630. }
  631. .addr-info {
  632. flex: 1;
  633. margin-left: 12rpx;
  634. }
  635. .addr-line {
  636. font-size: 28rpx;
  637. color: var(--c-text);
  638. display: block;
  639. }
  640. .addr-detail {
  641. font-size: 24rpx;
  642. color: #909399;
  643. margin-top: 8rpx;
  644. display: block;
  645. }
  646. .line-item {
  647. display: flex;
  648. justify-content: space-between;
  649. padding: 16rpx 0;
  650. border-bottom: 1rpx solid rgba(220, 235, 228, 0.65);
  651. }
  652. .line-main .name {
  653. font-size: 28rpx;
  654. color: var(--c-text);
  655. display: block;
  656. }
  657. .line-main .sub {
  658. font-size: 24rpx;
  659. color: #909399;
  660. margin-top: 6rpx;
  661. display: block;
  662. }
  663. .amt {
  664. font-size: 28rpx;
  665. color: var(--c-text);
  666. }
  667. .total-row {
  668. display: flex;
  669. justify-content: space-between;
  670. padding-top: 20rpx;
  671. font-size: 28rpx;
  672. }
  673. .total {
  674. color: var(--c-danger);
  675. font-weight: bold;
  676. font-size: 32rpx;
  677. }
  678. .remark {
  679. width: 100%;
  680. min-height: 120rpx;
  681. font-size: 26rpx;
  682. padding: 16rpx;
  683. background: #f8fcfa;
  684. border: 1rpx solid rgba(220, 235, 228, 0.65);
  685. border-radius: 20rpx;
  686. box-sizing: border-box;
  687. }
  688. .footer {
  689. position: fixed;
  690. left: 0;
  691. right: 0;
  692. bottom: 0;
  693. background: #fff;
  694. padding: 20rpx 32rpx;
  695. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  696. display: flex;
  697. align-items: center;
  698. justify-content: flex-start;
  699. border-top: 1rpx solid var(--c-border);
  700. box-shadow: none;
  701. z-index: 20;
  702. }
  703. .footer-sum {
  704. display: flex;
  705. align-items: center;
  706. gap: 12rpx;
  707. flex: 1;
  708. min-width: 0;
  709. }
  710. .footer-sum .label {
  711. font-size: 26rpx;
  712. color: var(--c-muted);
  713. }
  714. .footer-sum .price {
  715. font-size: 36rpx;
  716. color: var(--c-danger);
  717. font-weight: bold;
  718. }
  719. .submit-btn {
  720. font-size: 28rpx;
  721. padding: 0 48rpx;
  722. height: 80rpx;
  723. line-height: 80rpx;
  724. border-radius: 40rpx;
  725. margin-left: auto;
  726. width: auto;
  727. flex: 0 0 auto;
  728. border: none;
  729. box-shadow: none;
  730. color: #ffffff;
  731. background: linear-gradient(145deg, var(--c-barley-yellow), #e4b458);
  732. }
  733. .submit-btn::after {
  734. border: none;
  735. }
  736. :deep(.submit-btn.van-button--primary) {
  737. background: linear-gradient(145deg, var(--c-barley-yellow), #e4b458) !important;
  738. color: #ffffff !important;
  739. border-color: #d6a343 !important;
  740. }
  741. :deep(.submit-btn.van-button--primary.van-button--disabled) {
  742. background: linear-gradient(145deg, var(--c-barley-yellow), #e4b458) !important;
  743. color: #ffffff !important;
  744. border-color: #d6a343 !important;
  745. opacity: 0.6;
  746. }
  747. .pay-group {
  748. display: flex;
  749. flex-direction: column;
  750. width: 100%;
  751. }
  752. .submit-btn.is-disabled,
  753. .submit-btn[disabled] {
  754. opacity: 0.6;
  755. }
  756. .pay-row {
  757. display: flex;
  758. flex-direction: row;
  759. align-items: center;
  760. justify-content: space-between;
  761. width: 100%;
  762. padding: 10rpx 0;
  763. box-sizing: border-box;
  764. &:last-child {
  765. padding-bottom: 0;
  766. }
  767. &:first-child {
  768. padding-top: 0;
  769. }
  770. }
  771. .pay-text {
  772. flex: 1;
  773. min-width: 0;
  774. padding-right: 24rpx;
  775. font-size: 28rpx;
  776. color: #303133;
  777. line-height: 1.45;
  778. }
  779. </style>