123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512 |
- <template>
- <view class="order-submission">
- <navigator url="/pages/address/list?source=1" v-if="shippingType === 1" class="address">
- <view class="address-head">服务地址</view>
- <view v-if="addressData.phone" class="address-main">
- <image src="../../static/order/address.png" class="address-left"></image>
- <view class="address-text">{{ addressData.province }} {{ addressData.city }} {{ addressData.county }}
- {{ addressData.address }}
- </view>
- <image src="../../static/order/right.png" class="address-right"></image>
- </view>
- <view class="padding-tb-sm" v-else>
- 请选择配送地址
- </view>
- </navigator>
- <image class="a-bg"
- src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAAAFCAYAAAAaAWmiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/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v+8T3N3J8d3Hkey6I3re6Djvaam1v/urhswjdsQ2jf/kVJRI1xHdPrh1lltzTWUxXai5H07N74P7KettnPDQyjWtf/ohglyJfl7jz/drP+vDrzgYsLZdtP2PRnz6B/u4t9I+U9cYCH81hddoFuBG4bxNq7v9xSfh+G/H9wKkIwF5JkR38fF3VLb73dDXhpsYS8P0Vxve7MZ14E04EkX2SumDj40Lkjz2LS9x1nZVqcK1rh1L/GaiZDB1GYwGPRi9+sA4r63odGEjAoKTZS0mTwUtoS2sTPioc1jd64KJqNZXRP9EtLFrLT5KQOd6H1JtvQ/SUQ1CUC1Z/tjp5MgXn51bAfc1VpAUVb6pqi+bsqRlrOB0ITSI0kUa1IvF7JcribPbxZnt9BYIeBZm0ap1BO2yHLMOIxjH111chmDocXg9XzZFR4fD74e5cA9GtQEulbLGbfaNMvv4+BfG3hiet9wxlUeDGdDPn68uqXVgVKKezbiBN/HHYoTnrqlORkDx0BHr/ABzVVbknbZysZ3wnRVyda6HU1UIjvpt28p2C+T+GEtYeeEh3jqcdKjl2BcWY65q9UAQb+c6+k3iePnaS+P5Pq8spOJ38fJ09RVI1OFuWo6xtJXSD+J6xh++OHN8PEt8HxtNY4pbAczC+m2Rnh8V3J9Q0Fa4LeG97YQdehj4aoSL9NZiZNMTKStp6g5/x5NsW37vWQaS1WXzPHvjihzYS/lgshbeJ75WySHm7wNXXk8SbK/xutOX4ntHtYRxE0eJn6uARaGf6ie++7GPNxVkf/78AAwCn1+RYqusbZQAAAABJRU5ErkJggg=="></image>
- <view class="goods">
- <view class="goods-head flex">
- <view class="goods-head-text">服务时间</view>
- <view @click="selectTime" style="text-align: right;" class="goods-head-time text-cut padding-right-sm">
- {{ shippingType === 2 ? orderReqeust.predictTime.replaceAll('送达', '取货') : orderReqeust.predictTime }}
- </view>
- <image src="../../static/order/time-right.png" class="goods-head-right"></image>
- </view>
- <view class="goods-one" v-if="orderReqeust.productList.length ==1">
- <image class="goods-img"
- :src="(orderReqeust.productList[0].productAttrImg?JSON.parse(orderReqeust.productList[0].productAttrImg)[0].url:JSON.parse(orderReqeust.productList[0].productImg)[0].url)"></image>
- <view class="goods-text">
- <view class="goods-name">{{ orderReqeust.productList[0].productAttrName }}</view>
- <view class="goods-tag">
- <view class="goods-price"
- v-if="!orderReqeust.isIntegral && (orderReqeust.seckillId || orderReqeust.groupShopId)">
- ¥{{ orderReqeust.productList[0].price }}
- </view>
- <view class="goods-price"
- v-if="!orderReqeust.isIntegral && !orderReqeust.seckillId && !orderReqeust.groupShopId">
- ¥{{ isVip ? orderReqeust.productList[0].vipPrice : orderReqeust.productList[0].price }}
- </view>
- <view class="goods-price" style="color: red" v-if="orderReqeust.isIntegral">
- 积分{{ orderReqeust.productList[0].integral }}
- </view>
- <view class="goods-yprice">¥{{ orderReqeust.productList[0].otPrice }}</view>
- <view class="goods-number">×{{ orderReqeust.productList[0].cartNum }}</view>
- </view>
- </view>
- </view>
- <view class="goods-one" v-else>
- <view class="scroll_box">
- <scroll-view scroll-x="true">
- <block v-for="(item, index) in orderReqeust.productList" :key="index">
- <image class="goods-more-img"
- :src="(item.productAttrImg?JSON.parse(item.productAttrImg)[0].url:JSON.parse(item.productImg)[0].url)"></image>
- </block>
- </scroll-view>
- </view>
- <view class="goods-more-number">共{{ orderReqeust.totalNumber }}件</view>
- <image src="../../static/order/time-right.png" class="goods-more-right"></image>
- </view>
- </view>
- <view class="distribution">
- <view class="distribution-list distribution-list-bottom" v-if="shippingType === 2">
- <view class="distribution-text">联系人</view>
- <view class="distribution-price"><input type="text" v-model="orderReqeust.name"
- placeholder="请输入您的联系姓名"></view>
- </view>
- <view class="distribution-list distribution-list-bottom" v-if="shippingType === 2">
- <view class="distribution-text">联系电话</view>
- <view class="distribution-price"><input type="text" v-model="orderReqeust.phone"
- placeholder="请输入您的联系电话"></view>
- </view>
- <view class="distribution-list distribution-list-bottom"
- :class="{ 'disabled': !hasAvailableCoupons }"
- @click="hasAvailableCoupons ? toggleMask('show') : null"
- v-if="!orderReqeust.isIntegral">
- <view class="distribution-text">优惠券
- <!-- 新增最佳优惠标识 -->
- <view v-if="orderReqeust.coupon && orderReqeust.coupon.id === bestCouponId" class="best-coupon">
- 最佳优惠
- </view>
- </view>
- <view class="distribution-price" :style="{ color: hasAvailableCoupons ? 'red' : '#999' }">
- {{
- orderReqeust.coupon ? "-¥" + orderReqeust.coupon.couponPrice : (hasAvailableCoupons ? '选择优惠券' : '暂无优惠券')
- }}
- </view>
- </view>
-
- <view class="distribution-list">
- <view class="distribution-text">备注</view>
- <view class="distribution-price"><input type="text" v-model="orderReqeust.mono" placeholder="请输入备注信息">
- </view>
- </view>
-
- <view class="distribution-list distribution-list-bottom" v-if="shippingType === 1">
- <view class="distribution-text">加急费用(可选)</view>
- <view class="distribution-price">
- <input type="number" v-model.number="orderReqeust.urgentFee"
- placeholder="请输入加急费用"
- style="text-align: right;">
- <text style="margin-left: 10rpx;">元</text>
- </view>
- </view>
-
- <!-- 照片上传区域 -->
- <view class="distribution-list photo-upload-section distribution-list-bottom">
- <view class="distribution-text">订单照片</view>
- <view class="photo-upload-container">
- <view class="photo-list">
- <!-- 已上传的照片预览 -->
- <view
- v-for="(photo, index) in orderReqeust.photos"
- :key="index"
- class="photo-item"
- >
- <image :src="photo" class="photo-preview" mode="aspectFill" @click="previewPhoto(index)"></image>
- <view class="photo-delete" @click="deletePhoto(index)">
- <text class="photo-delete-icon">×</text>
- </view>
- </view>
-
- <!-- 添加照片按钮 -->
- <view
- v-if="orderReqeust.photos.length < 5"
- class="photo-add-btn"
- @click="choosePhoto"
- >
- <text class="photo-add-icon">+</text>
- <text class="photo-add-text">添加照片</text>
- </view>
- </view>
- <view class="photo-tips">最多可上传5张照片</view>
- </view>
- </view>
- </view>
- <view class="distribution">
- <view class="distribution-list distribution-list-bottom">
- <view class="distribution-text pay-text">支付方式</view>
- </view>
- <view v-if="!orderReqeust.isIntegral" class="distribution-list distribution-list-bottom"
- @click="changePayType('WX')">
- <view class="distribution-text">微信</view>
- <view class="distribution-price">
- <image
- :src="payType === 'WX'?'../../static/order/xuanzhong.png':'../../static/order/xuanzhong-no.png'"></image>
- </view>
- </view>
- <view v-if="!orderReqeust.isIntegral" class="distribution-list" @click="changePayType('BALANCE')">
- <view class="distribution-text">余额</view>
- <view class="distribution-price">
- <image
- :src="payType === 'BALANCE'?'../../static/order/xuanzhong.png':'../../static/order/xuanzhong-no.png'"></image>
- </view>
- </view>
- <view v-if="orderReqeust.isIntegral" class="distribution-list" @click="changePayType('INTEGRAL')">
- <view class="distribution-text">积分</view>
- <view class="distribution-price">
- <image
- :src="payType === 'INTEGRAL'?'../../static/order/xuanzhong.png':'../../static/order/xuanzhong-no.png'"></image>
- </view>
- </view>
- </view>
- <!-- 优惠券面板 -->
- <view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
- <view class="mask-content" @click.stop.prevent="stopPrevent">
- <!-- 优惠券页面,仿mt -->
- <view v-if="getAvailableCoupons().length === 0" class="no-coupon-tip">
- <text>暂无可用优惠券</text>
- </view>
- <view @click="selectCoupon(item)"
- v-if="(!item.categoryId && orderReqeust.totalPrice >= item.useMinPrice) || (item.categoryId && skuCategoryPriceMap[item.categoryId] && skuCategoryPriceMap[item.categoryId] > item.useMinPrice)"
- class="coupon-item" v-for="(item,index) in couponList" :key="index">
- <view class="con">
- <view class="left">
- <text class="title">{{ item.couponTitle }}</text>
- <text class="time">有效期至{{ item.endTime | dateFormat }}</text>
- </view>
- <view class="right">
- <text class="price">{{ item.couponPrice }}</text>
- <text>满{{ item.useMinPrice }}可用</text>
- </view>
-
- <view class="circle l"></view>
- <view class="circle r"></view>
- </view>
- <text class="tips">{{ item.categoryTitle ? '限' + item.categoryTitle + '可用' : '全品类可用' }}</text>
- </view>
- </view>
- </view>
- <!-- 底部 -->
- <view class="footer">
- <view class="priceClass">
- <view class="price-content">
- <text>总计</text>
- <text class="price-content-money">
- ¥{{ orderPriceData.actualPrice || 0 }}
- </text>
- <text class="price-content-money" style="color: red" v-if="orderReqeust.isIntegral === 1"> +
- 积分{{ orderReqeust.integral }}
- </text>
- </view>
- <view class="price-preferential">
- <text>已优惠:</text>
- <text>{{ jian(orderPriceData.productOriginalTotalPrice || 0, orderPriceData.actualPrice || 0) }}元</text>
- </view>
- </view>
- <view class="submit" @click="submit">
- 去付款
- </view>
- </view>
-
- <uni-popup ref="popup" type="bottom" :animation="true" style="z-index: 9999;">
- <view class="flex align-center justify-between" style="padding: 34rpx 30rpx;background-color: #F2F2F2;">
- <view style="font-size: 32rpx;line-height: 38rpx;color: #1B1C33;">选择到达时间</view>
- <view @click="checkTime" style="font-size: 32rpx;line-height: 38rpx;color: #2AAB34;">确定</view>
- </view>
- <view class="flex justify-between">
- <view style="width: 347rpx;height: 500rpx;background-color: #F2F2F2;">
- <view v-for="(date,index) in dayList" :key="index" @click="chooseDay(index)"
- :class="[index == dayIndex?'bg-white':'']"
- style="padding: 25rpx 84rpx 25rpx 59rpx;font-size: 32rpx;line-height: 38rpx;color: #1B1C33;">
- {{ date }}
- </view>
- </view>
- <view class="bg-white" style="width: 404rpx;height: 500rpx;padding-left: 52rpx;position: relative;">
- <scroll-view scroll-y="true" style="width: 404rpx;height: 500rpx;">
- <view v-for="(time,index) in timeList[dayIndex]" :key="index" @click="chooseTime(index)"
- :class="[index == timeIndex?'text-green':'']"
- class="solid-bottom" style="padding: 25rpx 0;font-size: 32rpx;line-height: 38rpx;">
- <text v-if="time.length > 2">{{ time }}</text>
- <text v-else>{{ time[0] + '-' + time[1] }}</text>
- </view>
- </scroll-view>
- <view
- style="position: absolute;bottom: 0;width: 404rpx;height: 53rpx;background-color: rgba(255,255,255,0.8);">
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import uniPopup from "@/components/uni-popup/uni-popup.vue"
- export default {
- data() {
- return {
- payType: 'WX',
- shippingType: 1,
- bestCouponId: null, // 最佳优惠券的 ID
- orderReqeust: {
- productList: [],
- totalotPrice: 0,
- totalPrice: 0, //商品折扣(仅算VIP和限时打折)后总价
- totalNumber: 0,//商品件数
- coupon: undefined,
- couponId: 0,
- mono: '',
- takeWay: '',
- freightPrice: 0,
- urgentFee: undefined, // 加急费用
- addressId: undefined,
- predictTime: '',
- phone: '',
- name: '',
- integral: 0,
- gainIntegral: 0,
- photos: [] // 订单照片数组
- },
- skuCategoryPriceMap: {},
- maskState: 0, //优惠券面板显示状态
- couponList: [],
- hasAvailableCoupons: false, // 是否有可用优惠券
- urgentFeeTimer: null, // 加急费用防抖定时器
- orderPriceData: { // 订单价格数据
- productTotalPrice: 0,
- productOriginalTotalPrice: 0,
- freightPrice: 0,
- urgentFee: 0,
- couponPrice: 0,
- actualPrice: 0
- },
- isVip: false,
- storageData: {
- address: ''
- },
- addressData: {
- consignee: '',
- phone: '',
- province: '',
- city: '',
- county: '',
- address: '',
- defaultAddress: false,
- },
- submiting: false,
- dayList: [],//配送时间
- dayIndex: 0,//选中配送时间
- timeList: [],
- timeIndex: 0,
- now: 0,//当前小时
- nowTime: 0,//当前分钟
- dateObj: {
- year: 0,
- today: 0,
- tomorrow: 1,
- afterTomo: 2
- }
- }
- },
- components: {uniPopup},
- computed: {
- // 动态计算照片区域高度
- photoContainerHeight() {
- const totalItems = this.orderReqeust.photos.length + (this.orderReqeust.photos.length < 5 ? 1 : 0) // 照片数量 + 添加按钮
- const rows = Math.ceil(totalItems / 2) // 每行2张,计算行数
- return rows * 200 + 'rpx' // 每行200rpx高度(包含180rpx照片高度 + 20rpx行间距)
- }
- },
- onShow() {
- this.isVip = this.$api.isVip()
- },
- onLoad(option) {
- //商品数据
- this.isVip = this.$api.isVip()
- const that = this
- if (option.takeway) {
- that.orderReqeust.takeWay = option.takeway
- }
- that.orderReqeust.productList = that.$api.globalData.productList;
- let totalotPrice = 0
- let totalPrice = 0
- let totalNumber = 0
- let skuCategoryPriceMap = {}
- that.orderReqeust.productList.forEach(item => {
- totalotPrice += item.otPrice * item.cartNum
- totalNumber += item.cartNum
- totalPrice += that.isVip ? (item.vipPrice * item.cartNum) : (item.price * item.cartNum)
- //构建category价格Map
- item.cateIdList.forEach(catItem => {
- if (skuCategoryPriceMap[catItem]) {
- skuCategoryPriceMap[catItem] += that.isVip ? (item.vipPrice * item.cartNum) : (item.price * item.cartNum)
- } else {
- skuCategoryPriceMap[catItem] = that.isVip ? (item.vipPrice) : (item.price)
- }
- })
- })
- that.skuCategoryPriceMap = skuCategoryPriceMap
- that.orderReqeust.totalotPrice = totalotPrice
- that.orderReqeust.totalNumber = totalNumber
- that.orderReqeust.totalPrice = totalPrice
- that.$api.request('get', 'coupon/app/getUserCoupons').then(res => {
- that.couponList = res.data
- that.hasAvailableCoupons = that.getAvailableCoupons().length > 0
- this.findBestCoupon(); // 找出最佳优惠券
- // 初始化价格计算
- that.calculateOrderPrice();
- })
-
- let addresses = uni.getStorageSync('addresses');
- that.$api.request('get', 'storage/position/getStorage', {storageId: that.$store.state.storageId}).then(res => {
- that.storageData = res.data
- if (addresses) {
- that.storageData.distance = addresses.distance
- }
- })
- //设置距离
-
- that.$api.request('get', 'address/app/getDefAddress').then(res => {
- if (res.data) {
- that.addressData = res.data
- }
- that.calcFreightPrice()
- })
-
- if (that.orderReqeust.productList.length === 1 && that.orderReqeust.productList[0].groupShopId) {
- //若是团购商品,则携带上团购信息
- that.orderReqeust.groupShopId = that.orderReqeust.productList[0].groupShopId
- //总价重置
- that.orderReqeust.totalPrice = that.orderReqeust.productList[0].price
- }
- if (that.orderReqeust.productList.length === 1 && that.orderReqeust.productList[0].seckillId) {
- //若是秒杀商品,则携带上秒杀信息
- that.orderReqeust.seckillId = that.orderReqeust.productList[0].seckillId
- //总价重置
- that.orderReqeust.totalPrice = that.orderReqeust.productList[0].price
- }
- if (that.orderReqeust.productList.length === 1 && that.orderReqeust.productList[0].isIntegral) {
- //若是积分商品,则携带上积分信息
- that.orderReqeust.isIntegral = that.orderReqeust.productList[0].isIntegral
- that.orderReqeust.integral = that.orderReqeust.productList[0].integral
- that.orderReqeust.payType = 'INTEGRAL'
- that.payType = 'INTEGRAL'
- }
- // 使用默认参数:8-22点,7天,1小时间隔
- // 可以根据需要调整参数:this.calcTime(minStartHour, maxEndHour, dayCount, intervalHour)
- this.calcTime()
- },
- methods: {
- findBestCoupon() {
- if (this.couponList.length > 0) {
- // 找出优惠力度最大的优惠券
- let bestCoupon = this.couponList.reduce((prev, curr) => {
- return prev.couponPrice > curr.couponPrice ? prev : curr;
- });
- this.bestCouponId = bestCoupon.id; // 存储最佳优惠券的 ID
- }
- },
- // 获取可用的优惠券列表
- getAvailableCoupons() {
- return this.couponList.filter(item => {
- return (!item.categoryId && this.orderReqeust.totalPrice >= item.useMinPrice) ||
- (item.categoryId && this.skuCategoryPriceMap[item.categoryId] && this.skuCategoryPriceMap[item.categoryId] > item.useMinPrice);
- });
- },
- // 计算订单价格
- calculateOrderPrice() {
- const that = this;
- const requestData = {
- ...that.orderReqeust,
- urgentFee: that.orderReqeust.urgentFee || 0
- };
-
- that.$api.request('post', 'order/app/calculateOrderPrice', JSON.stringify(requestData))
- .then(res => {
- that.orderPriceData = res.data;
- // 更新可用优惠券状态
- that.hasAvailableCoupons = that.getAvailableCoupons().length > 0;
- })
- .catch(err => {
- console.error('计算订单价格失败:', err);
- // 出错时使用默认值
- that.orderPriceData = {
- productTotalPrice: that.orderReqeust.totalPrice || 0,
- productOriginalTotalPrice: that.orderReqeust.totalotPrice || 0,
- freightPrice: that.orderReqeust.freightPrice || 0,
- urgentFee: that.orderReqeust.urgentFee || 0,
- couponPrice: that.orderReqeust.coupon ? that.orderReqeust.coupon.couponPrice : 0,
- actualPrice: (that.orderReqeust.totalPrice || 0) - (that.orderReqeust.coupon ? that.orderReqeust.coupon.couponPrice : 0) + (that.orderReqeust.freightPrice || 0) + (that.orderReqeust.urgentFee || 0)
- };
- });
- },
- showFreightMsg() {
- uni.showToast({
- title: this.orderReqeust.freightMsg, // 假设接口返回的 msg 存储在 freightMsg 中
- icon: 'none',
- duration: 2000
- });
- },
- // 选择支付方式
- changePayType(type) {
- this.payType = type
- },
-
- // 选择照片
- choosePhoto() {
- const remainingCount = 5 - this.orderReqeust.photos.length
- uni.chooseImage({
- count: remainingCount,
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
- success: (res) => {
- const tempFilePaths = res.tempFilePaths
- // 依次上传选中的照片
- tempFilePaths.forEach(filePath => {
- this.uploadPhoto(filePath)
- })
- },
- fail: (err) => {
- console.error('选择照片失败:', err)
- uni.showToast({
- title: '选择照片失败',
- icon: 'none'
- })
- }
- })
- },
-
- // 上传照片
- uploadPhoto(filePath) {
- this.$api.uploadImgByPath(filePath, (url) => {
- this.orderReqeust.photos.push(url)
- uni.showToast({
- title: '上传成功',
- icon: 'success'
- })
- })
- },
-
- // 预览照片
- previewPhoto(index) {
- uni.previewImage({
- urls: this.orderReqeust.photos,
- current: index
- })
- },
-
- // 删除照片
- deletePhoto(index) {
- uni.showModal({
- title: '确认删除',
- content: '确定要删除这张照片吗?',
- success: (res) => {
- if (res.confirm) {
- this.orderReqeust.photos.splice(index, 1)
- }
- }
- })
- },
- addressType: function (index) {
- this.shippingType = index
- this.calcFreightPrice()
- },
- //显示优惠券面板
- toggleMask(type) {
- let timer = type === 'show' ? 10 : 300;
- let state = type === 'show' ? 1 : 0;
- this.maskState = 2;
- setTimeout(() => {
- this.maskState = state;
- }, timer)
- },
- jia(arg1, arg2) {
- var r1, r2, m;
- try {
- r1 = arg1.toString().split(".")[1].length
- } catch (e) {
- r1 = 0
- }
- try {
- r2 = arg2.toString().split(".")[1].length
- } catch (e) {
- r2 = 0
- }
- m = Math.pow(10, Math.max(r1, r2));
- return (arg1 * m + arg2 * m) / m;
-
- },
- jian(arg2, arg1) {
- var r1, r2, m, n;
- try {
- r1 = arg1.toString().split(".")[1].length
- } catch (e) {
- r1 = 0
- }
- try {
- r2 = arg2.toString().split(".")[1].length
- } catch (e) {
- r2 = 0
- }
- m = Math.pow(10, Math.max(r1, r2));
- //lastmodifybydeeka
- //动态控制精度长度
- n = (r1 >= r2) ? r1 : r2;
- return ((arg2 * m - arg1 * m) / m).toFixed(n);
- },
- calcFreightPrice() {
- const that = this;
- if (that.addressData) {
- that.orderReqeust.addressId = that.addressData.id;
- }
- that.orderReqeust.storageId = that.$store.state.storageId;
-
- // 调用新的价格计算接口
- that.calculateOrderPrice();
- },
- numberChange(data) {
- this.number = data.number;
- },
- submit() {
- const that = this
- if (that.submiting) {
- return
- }
- if (this.shippingType === 1) {
- if (!this.addressData.id) {
- this.$api.msg('请选择配送地址')
- return
- }
- } else {
- if (!this.storageData) {
- this.$api.msg('未有仓库地址信息')
- return
- }
- if (!this.orderReqeust.name) {
- this.$api.msg('请填写您的联系姓名')
- return
- }
-
- if (!this.storageData.phone || this.storageData.phone.length !== 11) {
- this.$api.msg('请正确填写您的联系方式')
- return
- }
- }
- if (this.orderReqeust.freightPrice < 0 && !that.orderReqeust.isIntegral) {
- this.$api.msg('无法配送!最低配送为' + Math.abs(this.orderReqeust.freightPrice) + '元')
- return
- }
- uni.showLoading({})
- that.submiting = true
- if (that.addressData.id) {
- that.orderReqeust.addressId = that.addressData.id
- }
- that.orderReqeust.storageId = that.$store.state.storageId
- that.orderReqeust.shippingType = this.shippingType
- that.orderReqeust.channel = uni.getSystemInfoSync().platform
- that.orderReqeust.payType = that.payType
- if (that.payType === 'BALANCE') {
- that.$api.request('post', 'order/app/takeOrder',
- JSON.stringify(that.orderReqeust)
- , failres => {
- that.submiting = false
- that.$api.msg(failres.msg)
- }).then(res => {
- uni.redirectTo({
- url: '/pages/pay/success'
- })
- })
- return;
- }
- if (that.orderReqeust.isIntegral) {
- that.$api.request('post', 'order/app/takeOrder',
- JSON.stringify(that.orderReqeust)
- , failres => {
- that.submiting = false
- that.$api.msg(failres.msg)
- }).then(res => {
- uni.redirectTo({
- url: '/pages/pay/success'
- })
- })
- return;
- }
- that.$api.request('post', 'order/app/takeOrder',
- JSON.stringify(that.orderReqeust)
- , failres => {
- that.submiting = false
- that.$api.msg(failres.msg)
- }).then(res => {
- //提交订单成功后,无需再让用户提交订单
- // that.submiting = false
- // uni.redirectTo({
- // url: '/pages/pay/pay?orderno=' + res.data + '&price=' + that.orderReqeust.totalPrice
- // })
- that.confirm(res.data, that.orderPriceData.actualPrice || 0)
- })
-
- },
- selectCoupon(couponItem) {
- this.orderReqeust.couponId = couponItem.id
- this.orderReqeust.coupon = couponItem
- this.maskState = 0
- this.calculateOrderPrice()
- },
- stopPrevent() {
- },
- //打开选择时间的弹窗
- selectTime() {
- this.$refs.popup.open()
- },
- /**
- * 生成服务时间选项
- * @param {number} minStartHour - 最小开始时间(整点,0-23)
- * @param {number} maxEndHour - 最大结束时间(整点,0-23)
- * @param {number} dayCount - 天数(默认7天,包含今天)
- * @param {number} intervalHour - 间隔时间(默认1小时)
- */
- calcTime(minStartHour = 8, maxEndHour = 22, dayCount = 8, intervalHour = 1) {
- const date = new Date()
-
- const year = date.getFullYear()
- const month = date.getMonth() + 1
- const day = date.getDate()
- const currentHour = date.getHours()
-
- if (date.getHours() >= maxEndHour) {
- dayCount += 1
- }
-
- // 初始化数组
- this.dayList = []
- this.timeList = []
- this.dateObj = {year, month: month < 10 ? '0' + month : month}
-
- // 生成日期列表
- for (let i = 0; i < dayCount; i++) {
- const targetDate = new Date(year, month - 1, day + i)
- const targetMonth = targetDate.getMonth() + 1
- const targetDay = targetDate.getDate()
- const formatMonth = targetMonth < 10 ? '0' + targetMonth : targetMonth
- const formatDay = targetDay < 10 ? '0' + targetDay : targetDay
-
- let dayLabel = ''
- if (i === 0) {
- dayLabel = `今天${formatMonth}月${formatDay}日`
- this.dateObj.today = formatDay
- } else if (i === 1) {
- dayLabel = `明天${formatMonth}月${formatDay}日`
- this.dateObj.tomorrow = formatDay
- } else if (i === 2) {
- dayLabel = `后天${formatMonth}月${formatDay}日`
- this.dateObj.afterTomo = formatDay
- } else {
- const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
- const weekday = weekdays[targetDate.getDay()]
- dayLabel = `${weekday}${formatMonth}月${formatDay}日`
- }
-
- this.dayList.push(dayLabel)
- this.timeList[i] = []
- }
-
- // 生成时间段选项
- for (let dayIndex = 0; dayIndex < dayCount; dayIndex++) {
- let startHour = minStartHour
-
- // 如果是今天,需要特殊处理
- if (dayIndex === 0) {
- if (currentHour >= maxEndHour) {
- // 当前时间已过营业结束时间,今天不提供服务
- continue
- } else if (currentHour >= minStartHour) {
- // 当前时间在营业时间内,从下一个整点开始
- startHour = currentHour + 1
- // 如果还有可用时间段,添加"尽快到达"选项
- if (startHour <= maxEndHour) {
- this.timeList[0].push('尽快到达')
- }
- }
- // 如果当前时间在营业开始前,使用原本的minStartHour
- }
-
- // 生成时间段
- for (let hour = startHour; hour <= maxEndHour; hour += intervalHour) {
- const endHour = Math.min(hour + intervalHour, maxEndHour)
- if (endHour > hour) {
- const startTime = hour < 10 ? '0' + hour + ':00' : hour + ':00'
- const endTime = endHour < 10 ? '0' + endHour + ':00' : endHour + ':00'
- this.timeList[dayIndex].push([startTime, endTime])
- }
- }
- }
-
- // 移除没有可用时间段的天(从后往前删除,避免索引问题)
- for (let i = this.timeList.length - 1; i >= 0; i--) {
- if (this.timeList[i].length === 0) {
- this.dayList.splice(i, 1)
- this.timeList.splice(i, 1)
- }
- }
-
- // 设置默认选择(第一天的第一个时间段)
- if (this.dayList.length > 0) {
- // 找到第一个有时间段的天
- let firstAvailableDay = 0
- for (let i = 0; i < this.timeList.length; i++) {
- if (this.timeList[i].length > 0) {
- firstAvailableDay = i
- break
- }
- }
-
- if (this.timeList[firstAvailableDay] && this.timeList[firstAvailableDay].length > 0) {
- this.dayIndex = firstAvailableDay
- this.timeIndex = 0
-
- const firstDay = this.dayList[firstAvailableDay]
- const firstTime = this.timeList[firstAvailableDay][0]
-
- if (typeof firstTime === 'string') {
- // 尽快到达的情况
- const nextHour = currentHour + 1
- const estimatedTime = nextHour < 10 ? '0' + nextHour + ':00' : nextHour + ':00'
- this.orderReqeust.predictTime = `尽快到达(预计${estimatedTime}到达)`
-
- const targetDate = new Date(year, month - 1, day + firstAvailableDay, nextHour, 0)
- this.orderReqeust.predictDate = targetDate.getTime()
- } else {
- // 普通时间段的情况
- this.orderReqeust.predictTime = `${firstDay}${firstTime[0]}-${firstTime[1]}`
-
- const targetDate = new Date(year, month - 1, day + firstAvailableDay)
- const endTime = firstTime[1].split(':')
- targetDate.setHours(parseInt(endTime[0]), parseInt(endTime[1]))
- this.orderReqeust.predictDate = targetDate.getTime()
- }
- } else {
- // 如果没有任何可用时间段,设置明天的第一个时间段
- console.warn('No available time slots found, creating fallback option')
- this.orderReqeust.predictTime = '明天' + minStartHour + ':00-' + (minStartHour + 1) + ':00'
- }
- }
-
- // 保存当前时间信息
- this.now = currentHour
- this.nowTime = date.getMinutes()
-
- // 调试信息
- console.log('calcTime debug info:', {
- currentHour,
- minStartHour,
- maxEndHour,
- dayCount,
- intervalHour,
- dayListLength: this.dayList.length,
- timeListLength: this.timeList.length,
- timeList: this.timeList
- })
- },
- chooseDay(index) {
- this.dayIndex = index
- },
- chooseTime(index) {
- this.timeIndex = index
- },
- checkTime() {
- const selectedTime = this.timeList[this.dayIndex][this.timeIndex]
- const selectedDay = this.dayList[this.dayIndex]
-
- // 计算目标日期
- const today = new Date()
- const targetDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + this.dayIndex)
-
- if (typeof selectedTime === 'string' && selectedTime === '尽快到达') {
- // 尽快到达的情况
- const nextHour = this.now + 1
- const estimatedTime = nextHour < 10 ? '0' + nextHour + ':00' : nextHour + ':00'
- this.orderReqeust.predictTime = `尽快到达(预计${estimatedTime}到达)`
-
- targetDate.setHours(nextHour, 0, 0, 0)
- this.orderReqeust.predictDate = targetDate.getTime()
- } else {
- // 普通时间段的情况
- this.orderReqeust.predictTime = `${selectedDay}${selectedTime[0]}-${selectedTime[1]}`
-
- const endTime = selectedTime[1].split(':')
- targetDate.setHours(parseInt(endTime[0]), parseInt(endTime[1]), 0, 0)
- this.orderReqeust.predictDate = targetDate.getTime()
- }
-
- this.$refs.popup.close()
- console.log('Selected time:', this.orderReqeust)
- },
- //确认支付
- confirm(orderNo, totalPrice) {
- // ============微信支付代码 prod 开始============
- // #ifdef APP-PLUS
- this.$api.msg('演示环境不支持支付')
- return
- // #endif
- const that = this
- that.$api.request('get', 'order/app/wxPrepay', {
- orderId: orderNo
- }, failres => {
- that.submiting = false
- that.$api.msg(failres.msg)
- }).then(prepayRes => {
- uni.hideLoading()
- that.submiting = false
- let payParam = {};
- //#ifdef MP-WEIXIN
- payParam = {
- appId: prepayRes.data.appId,
- nonceStr: prepayRes.data.nonceStr,
- package: prepayRes.data.packageValue,
- timeStamp: prepayRes.data.timeStamp,
- signType: prepayRes.data.signType,
- paySign: prepayRes.data.paySign,
- }
- //#endif
- //#ifdef APP-PLUS
- payParam = {
- appid: prepayRes.data.appId,
- noncestr: prepayRes.data.nonceStr,
- package: prepayRes.data.packageValue,
- partnerid: prepayRes.data.partnerId,
- prepayid: prepayRes.data.prepayId,
- timestamp: parseInt(prepayRes.data.timeStamp),
- sign: prepayRes.data.sign,
- signType: 'MD5'
- }
- //#endif
- //#ifdef MP-WEIXIN || APP-PLUS
- uni.requestPayment({
- provider: 'wxpay',
- //#ifdef MP-WEIXIN
- ...payParam,
- //#endif
- //#ifdef APP-PLUS
- orderInfo: payParam,
- //#endif
- success: function (res) {
- uni.redirectTo({
- url: '/pages/pay/success'
- })
- },
- fail: function (res) {
- // console.log("支付过程失败");
- // that.$api.msg(JSON.stringify(res))
- },
- complete: function (res) {
- console.log("支付过程结束")
- }
- });
- //#endif
- //#ifdef H5
- that.$jweixin.chooseWXPay({
- nonceStr: prepayRes.data.nonceStr,
- timestamp: prepayRes.data.timeStamp,
- package: prepayRes.data.packageValue,
- signType: prepayRes.data.signType,
- paySign: prepayRes.data.paySign,
- success: (e) => {
- //支付成功
- uni.redirectTo({
- url: '/pages/pay/success'
- })
- },
- fail: function (res) {
- console.log("支付过程失败");
- that.$api.msg(JSON.stringify(res))
- },
- complete: function (res) {
- console.log("支付过程结束")
- }
- })
- //#endif
- })
- //============微信支付代码 prod 结束============
- //============微信支付代码 dev 开始============
- // uni.request({
- // url: this.$api.defConfig().baseUrl + '/cb/wxpay',
- // data: {
- // outTradeNo: orderNo,
- // transactionId:'test',
- // totalFee: Math.round(totalPrice * 100)
- // },
- // method: 'POST',
- // header: {
- // 'Content-Type': 'application/json; charset=UTF-8'
- // },
- // success: (res) => {
- // //代码回调-上线后注释代码-结束
- // uni.redirectTo({
- // url: '/pages/pay/success'
- // })
- // }
- // });
- //============微信支付代码 dev 结束============
-
- }
- },
- watch: {
- // 监听加急费用变化
- 'orderReqeust.urgentFee': {
- handler(newVal, oldVal) {
- if (newVal !== oldVal && this.orderReqeust.productList && this.orderReqeust.productList.length > 0) {
- // 防抖处理,避免频繁调用
- clearTimeout(this.urgentFeeTimer);
- this.urgentFeeTimer = setTimeout(() => {
- this.calculateOrderPrice();
- }, 500);
- }
- },
- immediate: false
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background: #F4F4F4;
- padding-bottom: 100upx;
- }
- .mask {
- display: flex;
- align-items: flex-end;
- position: fixed;
- left: 0;
- top: var(--window-top);
- bottom: 0;
- width: 100%;
- background: rgba(0, 0, 0, 0);
- z-index: 9995;
- transition: .3s;
-
- .mask-content {
- width: 100%;
- min-height: 30vh;
- max-height: 70vh;
- background: #f3f3f3;
- transform: translateY(100%);
- transition: .3s;
- overflow-y: scroll;
- }
-
- &.none {
- display: none;
- }
-
- &.show {
- background: rgba(0, 0, 0, .4);
-
- .mask-content {
- transform: translateY(0);
- }
- }
- }
- /* 无优惠券提示 */
- .no-coupon-tip {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 200upx;
- color: #999;
- font-size: 28upx;
- }
- /* 优惠券列表 */
- .coupon-item {
- display: flex;
- flex-direction: column;
- margin: 20upx 24upx;
- background: #fff;
-
- .con {
- display: flex;
- align-items: center;
- position: relative;
- height: 120upx;
- padding: 0 30upx;
-
- &:after {
- position: absolute;
- left: 0;
- bottom: 0;
- content: '';
- width: 100%;
- height: 0;
- border-bottom: 1px dashed #f3f3f3;
- transform: scaleY(50%);
- }
- }
-
- .left {
- display: flex;
- flex-direction: column;
- justify-content: center;
- flex: 1;
- overflow: hidden;
- height: 100upx;
- }
-
- .title {
- font-size: 32upx;
- color: $font-color-dark;
- margin-bottom: 10upx;
- }
-
- .time {
- font-size: 24upx;
- color: $font-color-light;
- }
-
- .right {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- font-size: 26upx;
- color: $font-color-base;
- height: 100upx;
- }
-
- .price {
- font-size: 44upx;
- color: $base-color;
-
- &:before {
- content: '¥';
- font-size: 34upx;
- }
- }
-
- .tips {
- font-size: 24upx;
- color: $font-color-light;
- line-height: 60upx;
- padding-left: 30upx;
- }
-
- .circle {
- position: absolute;
- left: -6upx;
- bottom: -10upx;
- z-index: 10;
- width: 20upx;
- height: 20upx;
- background: #f3f3f3;
- border-radius: 100px;
-
- &.r {
- left: auto;
- right: -6upx;
- }
- }
- }
- .address {
- padding: 36upx 30upx;
- background-color: #FFFFFF;
- overflow: hidden;
- }
- .address-head {
- color: #999999;
- font-size: 28upx;
- font-weight: 400;
- }
- .address-main {
- margin-top: 24upx;
- }
- .address-left {
- margin: 9upx 0;
- width: 24upx;
- height: 32upx;
- float: left;
- }
- .address-text {
- margin-left: 14upx;
- float: left;
- font-size: 36upx;
- color: #333333;
- font-weight: 500;
- }
- .address-right {
- margin: 11upx 20upx 11upx 0;
- width: 28upx;
- height: 28upx;
- float: right;
- }
- .address-distance {
- clear: both;
- margin-top: 10upx;
- color: #333333;
- font-size: 30upx;
- }
- .a-bg {
- display: block;
- width: 100%;
- height: 5upx;
- }
- .goods {
- margin-top: 20upx;
- background-color: #FFFFFF;
- overflow: hidden;
- }
- .goods-head {
- margin: 0 30upx;
- height: 100upx;
- padding: 30upx 0;
- border-bottom: 2upx solid #F1F1F1;
- }
- .goods-head-text {
- width: 294upx;
- float: left;
- color: #333333;
- font-size: 28upx;
- }
- .goods-head-time {
- width: 490upx;
- float: left;
- color: #2AAC34;
- font-size: 28upx;
- }
- .goods-head-right {
- margin-top: 8upx;
- width: 16upx;
- height: 24upx;
- float: left;
- }
- .goods-one {
- padding: 40upx 0 30upx 0;
- margin: 0 30upx;
- height: 190upx;
- }
- .scroll_box {
- width: 544upx;
- height: 110upx;
- float: left;
- overflow: hidden;
- }
- .scroll_box scroll-view {
- height: 110upx;
- width: 544upx;
- white-space: nowrap;
- }
- .goods-img {
- margin-top: 2upx;
- width: 118upx;
- height: 110upx;
- float: left;
- }
- .goods-more-img {
- margin-top: 2upx;
- width: 118upx;
- height: 110upx;
- display: inline-block;
- margin-right: 36upx;
- }
- .goods-more-number {
- width: 126upx;
- height: 110upx;
- line-height: 110upx;
- text-align: center;
- color: #1B1C33;
- font-size: 28upx;
- float: left;
- }
- .goods-more-right {
- margin-top: 43.5upx;
- width: 15upx;
- height: 23upx;
- float: left;
- }
- .goods-text {
- margin-top: 6upx;
- margin-left: 32upx;
- width: 538upx;
- height: 110upx;
- float: left;
- }
- .goods-name {
- width: 500upx;
- line-height: 44upx;
- overflow: hidden;
- color: #333333;
- font-size: 32upx;
- }
- .goods-tag {
- margin-top: 10upx;
- }
- .goods-price {
- float: left;
- color: #333333;
- font-size: 32upx;
- line-height: 44upx;
- }
- .goods-yprice {
- margin-left: 16upx;
- float: left;
- color: #AEAEAE;
- font-size: 24upx;
- line-height: 44upx;
- text-decoration: line-through;
- }
- .goods-number {
- float: right;
- color: #333333;
- font-size: 32upx;
- }
- .distribution {
- padding: 0 30upx;
- margin-top: 20upx;
- background-color: #FFFFFF;
- overflow: hidden;
- }
- .distribution-list {
- height: 100upx;
- line-height: 100upx;
- font-size: 28upx;
- clear: both;
- }
- .distribution-list-bottom {
- border-bottom: 2upx solid #F1F1F1;
- }
- .distribution-list.disabled {
- opacity: 0.5;
- color: #999;
- }
- .info-icon {
- width: 28upx;
- height: 28upx;
- margin-left: 10upx;
- vertical-align: middle;
- }
- .distribution-price {
- width: 490upx;
- float: left;
- text-align: right;
- color: #666666;
- }
- .distribution-price input {
- width: 490upx;
- height: 100upx;
- line-height: 100upx;
- overflow: hidden;
- text-align: right;
- }
- .pay-text {
- color: #333333;
- font-size: 32upx;
- }
- .distribution-price image {
- width: 40upx;
- height: 40upx;
- float: right;
- margin-top: 30upx;
- }
- .footer {
- position: fixed;
- left: 0;
- bottom: 0;
- z-index: 99;
- height: 98upx;
- width: 100%;
- background-color: #FFFFFF;
- }
- .priceClass {
- margin-left: 62upx;
- width: 448upx;
- float: left;
- }
- .price-content {
- height: 50upx;
- line-height: 50upx;
- margin-top: 10upx;
- color: #666666;
- font-size: 26upx;
- }
- .price-content-money {
- color: #2AAC34;
- font-size: 36upx;
- }
- .price-preferential {
- height: 36upx;
- line-height: 36upx;
- color: #AEAEAE;
- font-size: 20upx;
- }
- .submit {
- width: 240upx;
- float: left;
- line-height: 98upx;
- color: #FFFFFF;
- background-color: #2AAC34;
- text-align: center;
- }
- .order-submission .wrapper .shipping select {
- color: #999;
- padding-right: 0.15 * 100rpx;
- }
- .order-submission .wrapper .shipping .iconfont {
- font-size: 0.3 * 100rpx;
- color: #515151;
- }
- .order-submission .wrapper .item .discount input::placeholder {
- color: #ccc;
- }
- .distribution-text {
- width: 200upx;
- float: left;
- color: #333333;
- display: flex; // 使用 flex 布局
- align-items: center; // 垂直居中
- }
- .best-coupon {
- display: inline-block;
- padding: 4upx 8upx;
- background-color: #fff;
- border-radius: 4upx;
- color: red;
- font-size: 24upx;
- }
- /* 照片上传相关样式 */
- .photo-upload-section {
- flex-direction: row !important; /* 改为横向布局 */
- align-items: flex-start !important;
- height: auto !important; /* 覆盖distribution-list的固定高度 */
- line-height: normal !important; /* 覆盖distribution-list的固定行高 */
- padding: 30rpx 0 !important; /* 添加上下内边距 */
- }
- .photo-upload-container {
- flex: 1; /* 占据剩余空间 */
- margin-top: 50rpx;
- margin-left: 20rpx; /* 与文案保持间距 */
- min-height: 200rpx; /* 确保至少有200rpx高度 */
- }
- .photo-list {
- display: flex;
- flex-wrap: wrap;
- gap: 20rpx;
- align-content: flex-start;
- width: 100%;
- }
- .photo-item {
- position: relative;
- width: 120rpx; /* 固定正方形宽度 */
- height: 120rpx; /* 固定正方形高度 */
- margin-bottom: 20rpx; /* 行间距 */
- }
- .photo-preview {
- width: 100%;
- height: 100%;
- border-radius: 8rpx;
- border: 2rpx solid #e5e5e5;
- }
- .photo-delete {
- position: absolute;
- top: -10rpx;
- right: -10rpx;
- width: 40rpx;
- height: 40rpx;
- background-color: #ff4757;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .photo-delete-icon {
- color: #fff;
- font-size: 24rpx;
- font-weight: bold;
- }
- .photo-add-btn {
- width: 120rpx; /* 与photo-item保持一致 */
- height: 120rpx; /* 与photo-item保持一致 */
- margin-bottom: 20rpx; /* 与photo-item保持一致的行间距 */
- border: 2rpx dashed #ccc;
- border-radius: 8rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- background-color: #fafafa;
- }
- .photo-add-icon {
- font-size: 32rpx; /* 调小图标尺寸 */
- color: #999;
- margin-bottom: 4rpx; /* 减少间距 */
- }
- .photo-add-text {
- font-size: 20rpx; /* 调小文字尺寸 */
- color: #999;
- }
- .photo-tips {
- margin-top: 20rpx;
- font-size: 24rpx;
- color: #999;
- }
- </style>
|