create.vue 22 KB

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