| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032 |
- <template>
- <view class="container">
- <view v-if="loading" class="loading-wrap">
- <text class="loading-text">加载中...</text>
- </view>
- <scroll-view v-else scroll-y class="content">
- <!-- Address Section -->
- <view class="section address-section" @click="openAddressPicker">
- <view v-if="selectedAddress" class="address-content">
- <view class="address-top">
- <text class="receiver-name">{{ selectedAddress.receiverName }}</text>
- <text class="receiver-phone">{{ formatPhone(selectedAddress.phone) }}</text>
- <text v-if="selectedAddress.isDefault === 1" class="default-badge">默认</text>
- </view>
- <text class="address-detail">
- {{ selectedAddress.province }}{{ selectedAddress.city }}{{ selectedAddress.district }}{{ selectedAddress.street }}
- </text>
- <text class="address-arrow">›</text>
- </view>
- <view v-else class="address-empty" @click.stop="goAddAddress">
- <text class="address-empty-icon">📍</text>
- <text class="address-empty-text">请选择收货地址</text>
- <text class="address-arrow">›</text>
- </view>
- </view>
- <!-- Purchase Info Section (when product requires it) -->
- <view class="section" v-if="requiredFields.length > 0">
- <text class="section-title">购买信息</text>
- <view
- v-for="field in requiredFields"
- :key="field.fieldKey"
- class="purchase-field-row"
- >
- <text class="purchase-field-label">
- {{ field.fieldName }}
- <text v-if="field.isRequired" class="required-mark">*</text>
- </text>
- <input
- v-model="purchaseForm[field.fieldKey]"
- class="purchase-field-input"
- :placeholder="'请输入' + field.fieldName + (field.isRequired ? '' : '(选填)')"
- :disabled="!!field.prefillValue"
- placeholder-style="color: #ccc; font-size: 26rpx;"
- />
- <text v-if="field.prefillValue" class="purchase-field-prefill">已填写</text>
- </view>
- </view>
- <!-- Order Items Section -->
- <view class="section">
- <text class="section-title">商品信息</text>
- <view
- v-for="item in items"
- :key="item.productId"
- class="order-item"
- >
- <image
- class="item-image"
- :src="getImageUrl(item.coverImage) || '/static/default-product.png'"
- mode="aspectFill"
- />
- <view class="item-info">
- <text class="item-name">{{ item.productName }}</text>
- <text v-if="item.specDesc" class="item-spec-desc">{{ item.specDesc }}</text>
- <text v-if="item.supplierName" class="item-supplier-name">供应商: {{ item.supplierName }}</text>
- <text class="item-qty">x{{ item.quantity }}</text>
- </view>
- <text class="item-price">{{ formatPriceWithSymbol(item.unitPrice) }}</text>
- </view>
- </view>
- <!-- Freight Section -->
- <view class="section">
- <view class="info-row">
- <text class="info-label">运费</text>
- <text class="info-value">{{ formatPriceWithSymbol(freight) }}</text>
- </view>
- </view>
- <!-- Member Upgrade Hint -->
- <view v-if="!isMember" class="section member-upgrade-section" @click="goUpgrade">
- <view class="member-upgrade-row">
- <text class="member-upgrade-icon">👑</text>
- <text class="member-upgrade-text">开通会员享全场商品专享价</text>
- <text class="member-upgrade-arrow">›</text>
- </view>
- </view>
- <!-- Coupon Section -->
- <view class="section coupon-section" @click="openCouponPicker">
- <view class="info-row">
- <text class="info-label">优惠券</text>
- <view class="coupon-selected" v-if="selectedCoupon">
- <text class="coupon-discount">-{{ formatPriceWithSymbol(selectedCoupon.value) }}</text>
- <text class="coupon-name-tag">{{ selectedCoupon.name }}</text>
- </view>
- <view class="coupon-placeholder" v-else>
- <text class="placeholder-text">选择优惠券</text>
- </view>
- <text class="address-arrow">›</text>
- </view>
- </view>
- <view v-if="!isMember" class="section member-coupon-hint">
- <view class="member-coupon-hint-content">
- <text class="hint-icon">👑</text>
- <text class="hint-text">加入会员可使用优惠券享更多优惠</text>
- </view>
- </view>
- <!-- Points Deduction Section -->
- <view class="section" v-if="userTotalPoints > 0">
- <view class="info-row">
- <text class="info-label">积分抵扣</text>
- <text class="points-balance">可用 {{ userTotalPoints }} 积分</text>
- </view>
- <view class="points-input-row">
- <input
- class="points-input"
- type="number"
- :value="pointsUsed"
- @input="onPointsInput"
- placeholder="输入使用积分"
- placeholder-style="color: #ccc; font-size: 26rpx;"
- />
- <text class="points-hint">≈ ¥{{ pointsYuanEquivalent }}</text>
- </view>
- <view class="points-tip">
- <text class="points-tip-text">1积分 = ¥0.01,最多使用 {{ maxPoints }} 积分</text>
- </view>
- </view>
- <!-- Remark Section -->
- <view class="section">
- <view class="info-row">
- <text class="info-label">备注</text>
- <input
- class="remark-input"
- v-model="remark"
- placeholder="选填,给商家留言"
- placeholder-style="color: #ccc; font-size: 26rpx;"
- />
- </view>
- </view>
- <view class="bottom-spacer"></view>
- </scroll-view>
- <!-- 优惠券选择器必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(优惠券弹窗不显示) -->
- <view class="modal-mask" v-if="showCouponPicker" @click="closeCouponPicker">
- <view class="coupon-picker" @click.stop>
- <view class="picker-header">
- <text class="picker-title">选择优惠券</text>
- <text class="picker-close" @click="closeCouponPicker">关闭</text>
- </view>
- <scroll-view scroll-y class="picker-list">
- <view
- v-for="coupon in availableCoupons"
- :key="coupon.id"
- class="picker-item"
- :class="selectedCoupon && selectedCoupon.id === coupon.id ? 'picker-item-active' : ''"
- @click="selectCoupon(coupon)"
- >
- <view class="picker-item-left">
- <text class="picker-item-value">{{ formatPriceWithSymbol(coupon.value) }}</text>
- </view>
- <view class="picker-item-right">
- <text class="picker-item-name">{{ coupon.name }}</text>
- <text class="picker-item-condition">{{ getConditionText(coupon.minSpend) }}</text>
- </view>
- <view class="picker-item-check" v-if="selectedCoupon && selectedCoupon.id === coupon.id">
- <text class="check-icon">✓</text>
- </view>
- </view>
- <view class="picker-empty" v-if="availableCoupons.length === 0">
- <text>暂无可用优惠券</text>
- </view>
- </scroll-view>
- <view class="picker-footer" v-if="selectedCoupon">
- <button class="picker-btn-remove" @click="removeCoupon">不使用优惠券</button>
- </view>
- </view>
- </view>
- <view class="bottom-bar">
- <view class="bottom-left">
- <text class="total-label">合计: </text>
- <text class="total-amount">{{ formatPriceWithSymbol(finalAmount) }}</text>
- <text v-if="selectedCoupon" class="total-original">{{ formatPriceWithSymbol(actualAmount + freight) }}</text>
- </view>
- <button
- :class="['submit-btn', submitting ? 'disabled' : '']"
- :disabled="submitting"
- @click="onSubmit"
- >提交订单</button>
- </view>
- </view>
- </template>
- <script>
- import config from '@/config.js'
- import { getCouponList, addressList, getProductRequiredFields, getMyMembership } from '../../../utils/api.js'
- export default {
- data() {
- return {
- items: [],
- selectedAddress: null,
- requiredFields: [], // 需要的购买信息字段
- purchaseForm: {}, // 用户填写的购买信息
- addressList: [],
- freight: 0,
- remark: '',
- loading: false,
- submitting: false,
- actualAmount: 0,
- coupons: [],
- selectedCoupon: null,
- showCouponPicker: false,
- pointsUsed: 0,
- userTotalPoints: 0,
- pointsLoading: false,
- isMember: false
- }
- },
- computed: {
- finalAmount() {
- var total = (this.actualAmount || 0) + (this.freight || 0)
- if (this.selectedCoupon) {
- total = total - this.selectedCoupon.value
- }
- total = total - (this.pointsUsed || 0)
- if (total < 0) total = 0
- return total
- },
- maxPoints() {
- var total = (this.actualAmount || 0) + (this.freight || 0)
- if (this.selectedCoupon) {
- total = total - this.selectedCoupon.value
- }
- if (total < 0) total = 0
- if (this.userTotalPoints < total) {
- return this.userTotalPoints
- }
- return total
- },
- pointsYuanEquivalent() {
- return (this.pointsUsed / 100).toFixed(2)
- },
- availableCoupons() {
- var self = this
- return this.coupons.filter(function(c) {
- if (c.status && c.status !== 'AVAILABLE') return false
- if (c.applicableTo && c.applicableTo !== 'ALL') return false
- if (c.minSpend && c.minSpend > self.actualAmount) return false
- return true
- })
- }
- },
- onLoad(options) {
- var that = this
- var stored = uni.getStorageSync('checkoutItems')
- if (stored && stored.length > 0) {
- this.items = stored
- this.calcAmount()
- } else if (options.productId) {
- // Load product directly from detail page
- var productData = {
- productId: parseInt(options.productId),
- productName: options.productName || '商品',
- coverImage: options.coverImage || '',
- unitPrice: parseInt(options.price) || 0,
- quantity: parseInt(options.quantity) || 1
- }
- if (options.skuId) {
- productData.skuId = parseInt(options.skuId)
- }
- this.items = [productData]
- this.calcAmount()
- }
- this.checkMemberStatus()
- this.loadDefaultAddress()
- this.loadRequiredFields()
- this.loadCoupons()
- this.loadUserPoints()
- },
- onShow() {
- // 从地址选择/编辑页返回后重新加载地址列表
- this.loadDefaultAddress()
- },
- methods: {
- calcAmount() {
- var total = 0
- for (var i = 0; i < this.items.length; i++) {
- total = total + (this.items[i].unitPrice * this.items[i].quantity)
- }
- this.actualAmount = total
- },
- async loadCoupons() {
- try {
- var res = await getCouponList()
- this.coupons = res.data || []
- } catch (e) {
- this.coupons = []
- }
- },
- openCouponPicker() {
- if (this.availableCoupons.length === 0 && !this.selectedCoupon) {
- uni.showToast({ title: '暂无可用优惠券', icon: 'none' })
- return
- }
- this.showCouponPicker = true
- },
- closeCouponPicker() {
- this.showCouponPicker = false
- },
- selectCoupon(coupon) {
- this.selectedCoupon = coupon
- this.showCouponPicker = false
- },
- removeCoupon() {
- this.selectedCoupon = null
- this.showCouponPicker = false
- },
- onPointsInput(e) {
- var val = parseInt(e.detail.value) || 0
- if (val < 0) val = 0
- var maxP = this.maxPoints
- if (val > maxP) {
- val = maxP
- uni.showToast({ title: '最多使用 ' + maxP + ' 积分', icon: 'none' })
- }
- this.pointsUsed = val
- },
- getConditionText(minSpend) {
- if (!minSpend || minSpend <= 0) return '无门槛'
- return '满' + (minSpend / 100).toFixed(2) + '元可用'
- },
- async loadDefaultAddress() {
- this.loading = true
- try {
- var res = await addressList()
- if (res.code === 200) {
- var list = res.data || []
- this.addressList = list
- // 如果当前已有选中地址,保持选中状态
- if (this.selectedAddress) {
- var stillExists = false
- for (var k = 0; k < list.length; k++) {
- if (list[k].id === this.selectedAddress.id) {
- stillExists = true
- break
- }
- }
- if (!stillExists) {
- this.selectedAddress = null
- }
- }
- if (!this.selectedAddress) {
- for (var i = 0; i < list.length; i++) {
- if (list[i].isDefault === 1) {
- this.selectedAddress = list[i]
- break
- }
- }
- if (!this.selectedAddress && list.length > 0) {
- this.selectedAddress = list[0]
- }
- }
- }
- } catch (e) {
- console.error(e)
- } finally {
- this.loading = false
- }
- },
- async loadRequiredFields() {
- if (this.items.length === 0) return
- var productId = this.items[0].productId
- try {
- var res = await getProductRequiredFields(productId)
- if (res.code === 200) {
- this.requiredFields = res.data || []
- this.autoFillPurchaseForm()
- }
- } catch (e) {
- console.error(e)
- }
- },
- autoFillPurchaseForm() {
- if (!this.selectedAddress || this.requiredFields.length === 0) return
- var form = {}
- for (var i = 0; i < this.requiredFields.length; i++) {
- var field = this.requiredFields[i]
- if (field.prefillValue) {
- form[field.fieldKey] = field.prefillValue
- } else {
- form[field.fieldKey] = ''
- }
- }
- this.purchaseForm = form
- },
- openAddressPicker() {
- if (this.addressList.length === 0) {
- uni.showToast({ title: '暂无地址,请先添加', icon: 'none' })
- return
- }
- uni.navigateTo({ url: '/pages/shop/address/address?selectMode=1' })
- },
- checkMemberStatus() {
- var that = this
- getMyMembership().then(function(res) {
- if (res.data && res.data.memberLevel) {
- that.isMember = res.data.memberLevel !== 'FREE'
- }
- }).catch(function() {})
- },
- goUpgrade() {
- uni.navigateTo({ url: '/pages/membership/upgrade' })
- },
- goAddAddress() {
- uni.navigateTo({ url: '/pages/shop/address-edit/address-edit' })
- },
- loadUserPoints() {
- var that = this
- uni.request({
- url: config.api('/api/user/info'),
- method: 'POST',
- data: {},
- header: {
- 'Content-Type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('token')
- },
- success: function(res) {
- if (res.data && res.data.code === 200) {
- that.userTotalPoints = res.data.data.totalPoints || 0
- }
- }
- })
- },
- onSubmit() {
- if (!this.selectedAddress) {
- uni.showToast({ title: '请选择收货地址', icon: 'none' })
- return
- }
- if (this.items.length === 0) {
- uni.showToast({ title: '请选择商品', icon: 'none' })
- return
- }
- this.submitting = true
- var orderItems = []
- for (var i = 0; i < this.items.length; i++) {
- var itemData = {
- productId: this.items[i].productId,
- quantity: this.items[i].quantity
- }
- if (this.items[i].skuId) {
- itemData.skuId = this.items[i].skuId
- }
- orderItems.push(itemData)
- }
- var that = this
- uni.request({
- url: config.api('/api/product/order/create'),
- method: 'POST',
- data: {
- items: orderItems,
- remark: this.remark,
- addressId: that.selectedAddress.id,
- purchaseInfo: that.purchaseForm,
- pointsUsed: that.pointsUsed
- },
- header: {
- 'Content-Type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('token')
- },
- success: function(res) {
- that.submitting = false
- if (res.data && res.data.code === 200) {
- var order = res.data.data
- uni.showToast({ title: '下单成功', icon: 'success' })
- uni.removeStorageSync('checkoutItems')
- var moneyAmount = order.moneyAmount != null ? order.moneyAmount : order.totalAmount
- var pointsUsed = order.pointsUsed || 0
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/shop/payment/payment?orderNo=' + order.orderNo + '&amount=' + moneyAmount + '&pointsUsed=' + pointsUsed
- })
- }, 1000)
- } else {
- uni.showToast({ title: res.data.message || '下单失败', icon: 'none' })
- }
- },
- fail: function() {
- that.submitting = false
- uni.showToast({ title: '网络请求失败', icon: 'none' })
- }
- })
- },
- formatPrice(price) {
- if (price === null || price === undefined) return '0.00'
- return (Number(price) / 100).toFixed(2)
- },
- formatPhone(phone) {
- if (!phone) return ''
- if (phone.length === 11) {
- return phone.substr(0, 3) + '****' + phone.substr(7)
- }
- return phone
- },
- getImageUrl: function(path) {
- return config.API_BASE_URL + path
- }
- }
- }
- </script>
- <style scoped>
- .container {
- min-height: 100vh;
- background: #f5f5f5;
- }
- .loading-wrap {
- display: flex;
- justify-content: center;
- padding-top: 200rpx;
- }
- .loading-text {
- font-size: 28rpx;
- color: #999;
- }
- .content {
- height: calc(100vh - 120rpx);
- }
- .section {
- background: #fff;
- margin: 20rpx;
- border-radius: 16rpx;
- padding: 24rpx;
- }
- .section-title {
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 20rpx;
- display: block;
- }
- .address-section {
- position: relative;
- }
- .address-content {
- position: relative;
- }
- .address-top {
- display: flex;
- align-items: center;
- margin-bottom: 10rpx;
- }
- .receiver-name {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- margin-right: 20rpx;
- }
- .receiver-phone {
- font-size: 26rpx;
- color: #666;
- }
- .default-badge {
- font-size: 20rpx;
- color: #F97316;
- background: #fff7e6;
- padding: 2rpx 12rpx;
- border-radius: 20rpx;
- margin-left: 12rpx;
- }
- .address-detail {
- font-size: 26rpx;
- color: #999;
- line-height: 1.5;
- }
- .address-arrow {
- position: absolute;
- right: 0;
- top: 50%;
- font-size: 40rpx;
- color: #ccc;
- transform: translateY(-50%);
- }
- .address-empty {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 30rpx 0;
- position: relative;
- }
- .address-empty-icon {
- font-size: 40rpx;
- margin-right: 12rpx;
- }
- .address-empty-text {
- font-size: 28rpx;
- color: #999;
- }
- .order-item {
- display: flex;
- align-items: center;
- padding: 16rpx 0;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .order-item:last-child {
- border-bottom: none;
- }
- .item-image {
- width: 80rpx;
- height: 80rpx;
- border-radius: 8rpx;
- background: #f0f0f0;
- margin-right: 16rpx;
- }
- .item-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-width: 0;
- }
- .item-name {
- font-size: 26rpx;
- color: #333;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin-bottom: 6rpx;
- }
- .item-spec-desc {
- font-size: 22rpx;
- color: #999;
- display: block;
- margin-top: 2rpx;
- }
- .item-supplier-name {
- font-size: 20rpx;
- color: #0EA5E9;
- display: block;
- margin-top: 2rpx;
- }
- .item-qty {
- font-size: 22rpx;
- color: #999;
- }
- .item-price {
- font-size: 26rpx;
- color: #F97316;
- font-weight: bold;
- margin-left: 16rpx;
- }
- .info-row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 8rpx 0;
- }
- .info-label {
- font-size: 26rpx;
- color: #999;
- }
- .info-value {
- font-size: 26rpx;
- color: #333;
- }
- .remark-input {
- flex: 1;
- text-align: right;
- font-size: 26rpx;
- color: #333;
- }
- /* ===== Coupon Section ===== */
- .coupon-section {
- position: relative;
- }
- .coupon-section:active {
- background: #fafafa;
- }
- .coupon-selected {
- display: flex;
- align-items: center;
- flex: 1;
- justify-content: flex-end;
- margin-right: 30rpx;
- }
- .coupon-discount {
- font-size: 26rpx;
- color: #F97316;
- font-weight: 600;
- margin-right: 12rpx;
- }
- .coupon-name-tag {
- font-size: 22rpx;
- color: #fff;
- background: #F97316;
- padding: 2rpx 12rpx;
- border-radius: 6rpx;
- max-width: 200rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .coupon-placeholder {
- flex: 1;
- text-align: right;
- margin-right: 30rpx;
- }
- .placeholder-text {
- font-size: 26rpx;
- color: #ccc;
- }
- .total-original {
- font-size: 22rpx;
- color: #bbb;
- text-decoration: line-through;
- margin-left: 8rpx;
- }
- /* ===== Member Upgrade Hint ===== */
- .member-upgrade-section {
- position: relative;
- }
- .member-upgrade-row {
- display: flex;
- align-items: center;
- }
- .member-upgrade-icon {
- font-size: 32rpx;
- margin-right: 12rpx;
- }
- .member-upgrade-text {
- flex: 1;
- font-size: 26rpx;
- color: #F97316;
- font-weight: 500;
- }
- .member-upgrade-arrow {
- font-size: 32rpx;
- color: #F97316;
- }
- /* ===== Member Coupon Hint ===== */
- .member-coupon-hint {
- margin-top: -10rpx;
- margin-bottom: 20rpx;
- }
- .member-coupon-hint-content {
- display: flex;
- align-items: center;
- padding: 20rpx 24rpx;
- background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
- border-radius: 16rpx;
- border: 1rpx solid #FED7AA;
- }
- .hint-icon {
- font-size: 32rpx;
- margin-right: 12rpx;
- }
- .hint-text {
- font-size: 24rpx;
- color: #C2410C;
- font-weight: 500;
- }
- /* ===== Coupon Picker Modal ===== */
- .modal-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0,0,0,0.5);
- z-index: 999;
- display: flex;
- align-items: flex-end;
- }
- .coupon-picker {
- background: #fff;
- border-radius: 24rpx 24rpx 0 0;
- width: 100%;
- max-height: 70vh;
- display: flex;
- flex-direction: column;
- }
- .picker-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx;
- border-bottom: 1rpx solid #eee;
- }
- .picker-title {
- font-size: 30rpx;
- font-weight: 600;
- color: #333;
- }
- .picker-close {
- font-size: 26rpx;
- color: #999;
- }
- .picker-list {
- max-height: 50vh;
- padding: 0 20rpx;
- }
- .picker-item {
- display: flex;
- align-items: center;
- padding: 24rpx 16rpx;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .picker-item:active {
- background: #fafafa;
- }
- .picker-item-active {
- background: #FFF7ED;
- }
- .picker-item-left {
- width: 120rpx;
- text-align: center;
- flex-shrink: 0;
- }
- .picker-item-value {
- font-size: 32rpx;
- font-weight: bold;
- color: #F97316;
- }
- .picker-item-right {
- flex: 1;
- margin: 0 16rpx;
- }
- .picker-item-name {
- font-size: 26rpx;
- color: #333;
- display: block;
- margin-bottom: 4rpx;
- }
- .picker-item-condition {
- font-size: 22rpx;
- color: #999;
- }
- .picker-item-check {
- width: 40rpx;
- height: 40rpx;
- background: #F97316;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- }
- .check-icon {
- color: #fff;
- font-size: 24rpx;
- font-weight: bold;
- }
- .picker-empty {
- text-align: center;
- padding: 60rpx 0;
- font-size: 26rpx;
- color: #999;
- }
- .picker-footer {
- padding: 20rpx;
- border-top: 1rpx solid #eee;
- }
- .picker-btn-remove {
- background: #f5f5f5;
- color: #666;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: none;
- }
- .picker-btn-remove::after {
- border: none;
- }
- .bottom-spacer {
- height: 140rpx;
- }
- .bottom-bar {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- height: 100rpx;
- background: #fff;
- border-top: 1rpx solid #eee;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 30rpx;
- z-index: 100;
- }
- .bottom-left {
- display: flex;
- align-items: baseline;
- }
- .total-label {
- font-size: 26rpx;
- color: #666;
- }
- .total-amount {
- font-size: 36rpx;
- color: #F97316;
- font-weight: bold;
- }
- .submit-btn {
- background: linear-gradient(135deg, #F97316, #FB923C);
- color: #fff;
- font-size: 28rpx;
- font-weight: bold;
- padding: 0 60rpx;
- height: 72rpx;
- line-height: 72rpx;
- border-radius: 36rpx;
- border: none;
- }
- .submit-btn::after {
- border: none;
- }
- .submit-btn.disabled {
- background: #ddd;
- color: #999;
- }
- .points-balance {
- font-size: 24rpx;
- color: #F97316;
- }
- .points-input-row {
- display: flex;
- align-items: center;
- margin-top: 16rpx;
- padding: 12rpx 0;
- border-top: 1rpx solid #f5f5f5;
- }
- .points-input {
- flex: 1;
- height: 60rpx;
- font-size: 28rpx;
- color: #333;
- background: #f9f9f9;
- border-radius: 8rpx;
- padding: 0 16rpx;
- }
- .points-hint {
- font-size: 24rpx;
- color: #999;
- margin-left: 12rpx;
- min-width: 100rpx;
- text-align: right;
- }
- .points-tip {
- margin-top: 8rpx;
- }
- .points-tip-text {
- font-size: 22rpx;
- color: #bbb;
- }
- .total-original {
- font-size: 24rpx;
- color: #bbb;
- text-decoration: line-through;
- margin-left: 8rpx;
- }
- /* ===== Purchase Info Fields ===== */
- .purchase-field-row {
- display: flex;
- align-items: center;
- padding: 16rpx 0;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .purchase-field-row:last-child {
- border-bottom: none;
- }
- .purchase-field-label {
- font-size: 26rpx;
- color: #333;
- width: 160rpx;
- flex-shrink: 0;
- }
- .required-mark {
- color: #f56c6c;
- }
- .purchase-field-input {
- flex: 1;
- font-size: 26rpx;
- color: #333;
- text-align: right;
- padding: 8rpx 0;
- }
- .purchase-field-input[disabled] {
- background: transparent;
- color: #999;
- }
- .purchase-field-prefill {
- font-size: 22rpx;
- color: #67c23a;
- margin-left: 8rpx;
- }
- </style>
|