| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817 |
- <template>
- <view class="affirm-page">
- <view class="affirm-view overscroll">
- <form>
- <view class="module-com">
- <view class="flex-space ghs-msg">
- {{ghsInfo.name}} {{ ghsInfo.telephone }}
- <i class="iconfont icondianhua1" @tap="toPhone(ghsInfo.telephone)"></i>
- </view>
- <view class="flex ghs-msg active">
- {{ ghsInfo.fullAddress }}
- </view>
- </view>
- <view class="module-com">
- <view class="commodity-view">
- <view class="commodity-list">
- <view class="commodity-item" :class="{'limit-exceed-item': isLimitExceededItem(item)}" v-for="(item, index) in selectList" :key="index">
- <image class="item-icon" :src="item.cover" mode="aspectFill" />
- <view class="item-info">
- <view class="item-row-top">
- <text class="item-name">{{ item.itemName }}</text>
- <view class="item-price-block">
- <view class="item-price-line">
- <text class="price-current">{{ affirmCommodityPriceParts[index].main }}</text>
- <text v-if="affirmCommodityPriceParts[index].showStrike" class="price-original">{{ affirmCommodityPriceParts[index].strike }}</text>
- </view>
- </view>
- </view>
- <view class="item-row-qty">
- <text v-if="item.bigCount > 0" class="qty-part qty-big">{{ item.bigCount }}{{ item.bigUnit }}</text>
- <text v-if="item.bigCount > 0 && item.smallCount > 0" class="qty-sep">·</text>
- <text v-if="item.smallCount > 0" class="qty-part qty-small">{{ item.smallCount }}{{ item.smallUnit }}</text>
- </view>
- <view v-if="isLimitExceededItem(item) || getLimitBuyPriceTip(item) || item.presell == 1" class="item-row-tips">
- <text v-if="isLimitExceededItem(item)" class="limit-exceed-tip">限购 {{ limitExceedLimitBuy }},超出 {{ limitExceedNum }}</text>
- <text v-if="getLimitBuyPriceTip(item)" class="limit-buy-price-tip">{{ getLimitBuyPriceTip(item) }}</text>
- <text v-if="item.presell == 1" class="presell-tip">预售花材下单不能退款</text>
- </view>
- </view>
- </view>
- </view>
- <view class="summary-bar">
- <view class="operate-view" @click="gobackEvent">
- <text class="iconfont icongouwuche"></text>返回修改
- </view>
- <view class="describe-view">
- <text class="price">共{{ allCountFun.bigLength }}扎,{{ allCountFun.weight }}公斤,合计 ¥{{ allPriceFun }}</text>
- </view>
- </view>
- </view>
- </view>
- <block v-if="ghsInfoLoaded">
- <view class="module-com input-line-wrap">
- <!-- 配送方式选择 -->
- <tui-list-cell class="line-cell" :hover="false" :arrow="false">
- <button
- v-for="(item, index) in visibleMethodList"
- :key="item.style"
- class="admin-button-com middle sh-method-btn"
- :class="[
- selectedMethodIndex === index ? 'blue' : 'default',
- item.name && item.name.length <= 2 ? 'sh-method-btn--short' : 'sh-method-btn--long'
- ]"
- @click="selectMethodByIndex(index)"
- >{{ item.name }}</button>
- </tui-list-cell>
- <!-- 配送方式说明 -->
- <tui-list-cell
- v-if="currentMethodExplains.length > 0"
- class="line-cell"
- :hover="false"
- :arrow="false"
- >
- <view>
- <view v-for="(exp, index) in currentMethodExplains" :key="index">
- <text :style="'width:100%;color:' + (Number(exp.color) === 2 ? 'red' : Number(exp.color) === 3 ? '#3385FF' : '#333333') + ';font-weight:' + (Number(exp.fontWeight) === 2 ? 'bold' : 'normal') + ';'">{{ exp.explain }}</text>
- </view>
- </view>
- </tui-list-cell>
- <!-- 物流填写/选择 -->
- <tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 3">
- <view class="tui-title">配送物流</view>
- <view class="wl-field-row">
- <input
- type="text"
- placeholder="请填写物流"
- v-model="form.wlName"
- @focus="onWlNameFocus"
- @input="onWlNameInput"
- placeholder-class="tui-placeholder"
- class="wl-name-input"
- />
- <button
- v-if="wlList.length > 0"
- class="admin-button-com middle wl-select-btn"
- @click="openWlSelect"
- >选择物流</button>
- </view>
- </tui-list-cell>
- <!-- 未达标提示:加运费/加包装费/不能下单 -->
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="showShMethodUnMeetWarning">
- <view>
- <text style="color: red;width:100%;font-weight: bold;font-size: 30upx;text-decoration: underline;">{{ shMethodUnMeetWarningText }}</text>
- </view>
- </tui-list-cell>
- <!-- 配送地址状态提示 -->
- <tui-list-cell v-if="form.sendType == 2 && ghsInfo.openIntraCity != 1" class="line-cell" :hover="false" :arrow="false">
- <view>
- <text v-if="ghsInfo.openIntraCity == 0" style="color: #3385FF;width:100%;font-size:30upx;font-weight:bold;">运费自理或到付(请联系客服)</text>
- <text v-if="ghsInfo.openIntraCity == 2" style="color: red;width:100%;font-size:30upx;font-weight:bold;">跑腿配送暂不可用,请选其它方式</text>
- </view>
- </tui-list-cell>
- <!-- 收货地址 -->
- <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="displayAddress" @click="modifyAddress">
- <view class="tui-title">收花地址</view>
- <view v-if="validAddress || ghsInfo.shopId==10649 || ghsInfo.shopId ==33668">
- <view style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width:420upx;"><text>{{ shopInfo.address }}</text></view>
- <view v-if="shopInfo.showAddress!=shopInfo.fullAddress" style="color:#848181;"><text>{{ shopInfo.showAddress }}</text></view>
- </view>
- <view v-else>
- <view><text style="color:red;font-weight:bold;font-size:30upx;">请填写您的地址</text></view>
- </view>
- </tui-list-cell>
- <!-- 跑腿平台报价列表 -->
- <tui-list-cell v-if="form.sendType == 2 && currentShMethod && Number(currentShMethod.calcType) == 0 && ghsInfo.openIntraCity == 1" class="line-cell" :hover="false">
- <view v-if="ghsInfo.openIntraCity == 1 && deliveryQuotes.length > 0" class="delivery-quotes-container">
- <view class="delivery-quotes-grid">
- <view
- v-for="(item, index) in deliveryQuotes"
- :key="index"
- class="delivery-quote-item"
- :class="{
- 'active': selectedDeliveryIndex === index,
- 'disabled': !item.isAble,
- 'fixed-width': deliveryQuotes.length <= 2
- }"
- @click="selectDelivery(item, index)"
- >
- <view class="platform-name">{{ item.displayName || item.name }}</view>
- <view class="platform-price">{{ item.priceText }}元</view>
- <view v-if="item.type" class="platform-type">{{ item.type }}</view>
- </view>
- </view>
- </view>
- <view v-else style="text-align: center; padding: 20upx 0;">
- <text v-if="validAddress">正在获取运费...</text>
- <text v-else style="color:red;font-weight:bold;font-size:32upx;" @click="modifyAddress">请完善收货地址</text>
- </view>
- </tui-list-cell>
- <!-- 距离展示 -->
- <tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 2 && Number(showDistance)>0">
- <view class="tui-title">距离</view>
- <text v-if="showDistance > 100" style="color: #3385FF">{{ (showDistance/1000).toFixed(1) }}公里</text>
- <text v-else style="color: #3385FF">{{ showDistance }} 米</text>
- </tui-list-cell>
- <!-- 跑腿费 -->
- <tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 2">
- <view class="tui-title">跑腿费</view>
- <view>
- <text :class="isFreePt ? 'delivery-price-free' : 'delivery-price-normal'">¥{{ form.sendCost }}</text>
- <text v-if="isFreePt" class="free-delivery-tag">¥0</text>
- <!-- 展示相对当前订单最接近的一条免运费条件,点击仍可看全部 -->
- <text class="delivery-policy-link" @click="showDeliveryPolicyModal">{{ nearestDeliveryPolicyText }}</text>
- </view>
- </tui-list-cell>
- <!-- 额外费用(包装费/运费) -->
- <tui-list-cell class="line-cell" :hover="false" v-if="showShMethodExtraFee">
- <view class="tui-title">{{ shMethodExtraFeeLabel }}</view>
- <text style="color: #3385FF">¥{{ shMethodExtraFeeAmount }}</text>
- </tui-list-cell>
- <!-- 总金额 -->
- <tui-list-cell class="line-cell" :hover="false" :arrow="false">
- <view class="tui-title">总金额</view>
- <text style="color: #3385FF">¥ {{ panelTotalPrice }}</text>
- </tui-list-cell>
- <!-- 配送日期 -->
- <tui-list-cell class="line-cell" :hover="false" :arrow="true">
- <view class="tui-title">配送日期</view>
- <picker mode="date" :value="sendTimeWant" @change="bindDateChange" style="width:400upx;">
- <view class="uni-input" v-if="sendTimeWant==''" style="color:#CCCCCC;">请选日期,默认当天</view>
- <view class="uni-input">{{ sendTimeWant }}</view>
- </picker>
- </tui-list-cell>
- <!-- 备注 -->
- <tui-list-cell class="line-cell" :hover="false" :arrow="false">
- <textarea style="height: 80upx" v-model="remark" placeholder="这里写备注"/>
- </tui-list-cell>
- </view>
- </block>
- </form>
- </view>
- <view class="under-bar">
- <view class="price-view">
- <text class="price-title">合计</text>
- <text class="price-number">¥<text class="large">{{ modifyPrice}}</text></text>
- <text v-if="allReachDiscountAmount > 0" class="price-discount-tip">省¥{{ parseFloat(allReachDiscountAmount) }}</text>
- </view>
- <button class="admin-button-com blue big" @click="affirmFormSubmit(0)">提交</button>
- </view>
- <uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
- <view style="font-size:32upx;margin:30upx 0 10upx 30upx;width:90vw;font-weight:bold;">以下库存不足,剩余的库存,是否都要?</view>
- <view v-if="!$util.isEmpty(lackList)" style="display:flex;padding:10upx 20upx 20upx 30upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:80vh;overflow:auto;width:90vw;font-size:32upx;">
- <view v-for="(item, index) in lackList" :key="index" style="width:100%;margin-top:10upx;">{{ item.name }}<text style="margin-left:20upx;font-weight:bold;color:red;">剩{{item.stock}}个</text></view>
- </view>
- <view style="width:90vw;margin:20upx 0 20upx 0;display:flex;align-items: center; justify-content: center;">
- <button class="admin-button-com big blue" style="width:190upx;" @click="gobackEvent">返回修改</button>
- <button class="admin-button-com big blue" style="width:190upx;" @click="closeRemind()">取消</button>
- <button class="admin-button-com big blue" style="width:190upx;" @click="affirmFormSubmit(1)">要</button>
- </view>
- </uni-popup>
- <uni-popup ref="deliveryPolicyPopup" type="center" background-color="#fff">
- <view class="policy-popup-content">
- <view class="policy-title">免运费条件</view>
- <scroll-view scroll-y="true" class="policy-scroll">
- <view class="policy-list">
- <block v-for="(item, index) in deliveryPolicyList" :key="index">
- <view class="policy-item">{{ item }}</view>
- </block>
- </view>
- </scroll-view>
- <view class="policy-btn" @click="closeDeliveryPolicy">知道了</view>
- </view>
- </uni-popup>
- <!-- 物流选择弹框:展示供货商配置的物流列表,选中后回填输入框 -->
- <uni-popup ref="wlPopupRef" background-color="#fff" type="center" :animation="false" class="wl-popup-wrap">
- <view class="wl-popup-content">
- <view class="wl-popup-title">请选择物流</view>
- <scroll-view scroll-y="true" class="wl-popup-scroll">
- <view class="wl-popup-list">
- <view v-for="(item, index) in wlList" :key="index" class="wl-popup-item">
- <button
- class="admin-button-com wl-option-btn"
- @click.stop="selectWl(item)"
- :class="{ selected: form.wlName === item.name }"
- >{{ item.name }}</button>
- </view>
- </view>
- </scroll-view>
- <view class="wl-popup-footer">
- <button class="admin-button-com big blue wl-popup-cancel-btn" @click="cancelWlSelect">取消</button>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import TuiListCell from "@/components/plugin/list-cell";
- import AppAvatarModule from "@/components/module/app-avatar";
- import SimpleAddress from "@/components/plugin/simple-address";
- import AppAreaSel from "@/components/app-area-sel";
- import AppCustomerSel from "@/components/app-customer-sel";
- import productMins from "@/mixins/cgProduct";
- import appFormRadioBtn from "@/components/app-formRadio-btn";
- import appAddressGroup from "@/components/app-address-group";
- import appFormSend from "@/components/app-form-send";
- import appSendTime from "@/components/app-send-time";
- const formUtil = require("@/utils/formValidation.js");
- import AppDatePicker from "@/components/app-date-picker";
- import { getGhsDataApi,getWlList,calcCustomPtFee } from "@/api/ghs";
- import { createOrder,getShMethod } from "@/api/purchase";
- import { mapActions, mapGetters } from "vuex";
- import { shopHouponHas } from '@/api/coupon'
- import {currentShop} from "@/api/shop"
- import { allDeliveryQuotes } from "@/api/express/delivery";
- import ModalModule from "@/components/plugin/modal";
- export default {
- name: "affirmGhs",
- components: {
- TuiListCell,
- AppAvatarModule,
- SimpleAddress,
- AppAreaSel,
- appSendTime,
- AppCustomerSel,
- appFormRadioBtn,
- appAddressGroup,
- appFormSend,
- AppDatePicker,
- ModalModule
- },
- mixins: [productMins],
- data() {
- return {
- isModel: false,
- pageType: "cg",
- ghsInfo:'',
- sendTimeWant:'',
- remark:'',
- form: {
- debt:1,//结算方式 1欠款订单 0正常订单
- shopId: "",
- shopName: "",
- receiveProvince: "",
- receiveCity: "",
- receiveFloor: "",
- receiveAddress: "",
- receiveLong: "",
- receiveLat: "",
- sendType: 0,
- transType:4,
- sendSide: "2",
- sendDate: "",
- sendCost: 0,
- customId: "",
- product: "",
- hbId: '0',
- packCost:0,
- wlName:'',
- wlId:0
- },
- lackExpend:0,
- hasHb:0,
- selectedHb:{couponAmount:0,hbId:0,couponSelInx:0},
- customData: {
- bigCount: 0,
- smallCount: 0
- },
- shopInfo:{
- lat:'',
- long:'',
- fullAddress:'',
- showAddress:'',
- address:''
- },
- wlList:[],
- wlSelData: {id:0,name:''},
- needAddPackCost:false,
- transCost:[],
- lackList:[],
- limitExceedProductId:'',
- limitExceedLimitBuy:'',
- limitExceedNum:'',
- showDistance:0,
- deliveryQuotes: [], // 跑腿平台报价列表
- selectedDeliveryIndex: -1, // 选中的报价索引
- selectedDeliveryData: null, // 选中的报价数据
- deliveryPolicyList: [], // 包配送政策列表
- validAddress:false,
- ghsInfoLoaded: false,
- methodList: [],
- /** 当前选中的配送方式下标,默认加载后选中第一项 */
- selectedMethodIndex: -1
- };
- },
- onLoad() {
- this.getGhsData(this.option.id)
- },
- onShow() {
- if(this.selectedHb.hbId && this.selectedHb.hbId > 0) {
- this.form.hbId = this.selectedHb.hbId
- }else{
- this.form.hbId = 0
- this.hasCoupon()
- }
- //修改地址重新返回页面时,重新获取当前门店信息
- this.modifyAddressToggle()
- },
- computed: {
- ...mapGetters(["getMerchantInfo", "getLoginInfo","getDictionariesInfo"]),
- visibleMethodList() {
- return (this.methodList || [])
- .filter(item => Number(item.status) === 1)
- .sort((a, b) => Number(a.sort) - Number(b.sort))
- },
- currentShMethod() {
- const list = this.visibleMethodList
- if (this.selectedMethodIndex >= 0 && this.selectedMethodIndex < list.length) {
- return list[this.selectedMethodIndex]
- }
- return null
- },
- showDeliveryPolicy() {
- const method = this.currentShMethod
- if (!method) return false
- let rules = method.reduceRules
- if (typeof rules === 'string') {
- try {
- rules = JSON.parse(rules)
- } catch (e) {
- rules = []
- }
- }
- return Array.isArray(rules) && rules.length > 0
- },
- showShMethodExtraFee() {
- const method = this.currentShMethod
- if (!method || !this.checkShMethodBelowMinimum(method)) {
- return false
- }
- const unMeet = Number(method.unMeet) || 0
- const fee = Number(method.unMeetFee) || 0
- return (unMeet === 0 || unMeet === 1) && fee > 0
- },
- /**
- * 未达配送方式最低消费时是否展示红色提示
- * unMeet:0 加运费、1 加包装费、2 不能下单
- */
- showShMethodUnMeetWarning() {
- const method = this.currentShMethod
- if (!method || !this.checkShMethodBelowMinimum(method)) {
- return false
- }
- const unMeet = Number(method.unMeet) || 0
- // 不能下单:直接提示
- if (unMeet === 2) {
- return true
- }
- // 加运费 / 加包装费:有费用时提示
- const fee = Number(method.unMeetFee) || 0
- return (unMeet === 0 || unMeet === 1) && fee > 0
- },
- shMethodExtraFeeLabel() {
- const method = this.currentShMethod
- if (!method) {
- return "包装费"
- }
- return Number(method.unMeet) === 1 ? "包装费" : "运费"
- },
- shMethodExtraFeeAmount() {
- if (!this.showShMethodExtraFee) {
- return 0
- }
- const method = this.currentShMethod
- return parseFloat(Number(method && method.unMeetFee) || 0)
- },
- /** 未达标红色文案:加运费/包装费金额,或不能下单 */
- shMethodUnMeetWarningText() {
- const method = this.currentShMethod
- if (!method) {
- return ""
- }
- const tips = []
- const minAmount = Number(method.minAmount) || 0
- const minNum = Number(method.minNum) || 0
- if (minAmount > 0) {
- tips.push("未满" + minAmount + "元")
- }
- if (minNum > 0) {
- tips.push("未满" + minNum + "扎")
- }
- const conditionText = tips.length > 0 ? tips.join("或") : "未达最低消费"
- const unMeet = Number(method.unMeet) || 0
- // unMeet=2:未满最低消费则禁止下单
- if (unMeet === 2) {
- return conditionText + ",不能下单"
- }
- // unMeet=0 加运费;unMeet=1 加包装费,并写出具体金额
- const fee = parseFloat(Number(method.unMeetFee) || 0)
- const feeLabel = unMeet === 1 ? "包装费" : "运费"
- return conditionText + ",加" + feeLabel + fee + "元"
- },
- currentMethodExplains() {
- const method = this.currentShMethod
- if (!method || !Array.isArray(method.explains)) {
- return []
- }
- return method.explains
- .filter(exp => exp && exp.explain)
- .sort((a, b) => Number(a.sort) - Number(b.sort))
- },
- runnerFeeAmount() {
- if (this.isFreePt) {
- return 0
- }
- return Number(this.form.sendCost) || 0
- },
- panelTotalPrice() {
- let price = Number(this.allPriceFun) || 0
- price += this.runnerFeeAmount
- price += this.shMethodExtraFeeAmount
- return parseFloat(price.toFixed(2))
- },
- /** 确认页列表每行价格展示(与 selectList 顺序一致) */
- affirmCommodityPriceParts() {
- const list = this.selectList || [];
- return list.map(item => this.getLimitBuyPriceDisplayParts(item));
- },
- displayAddress(){
- if(this.form.sendType != 1){
- return true
- }
- if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
- return true
- }
- return false
- },
- //判断是否免跑腿费
- isFreePt(){
- const method = this.currentShMethod
- if (!method) return false
- let rules = method.reduceRules
- if (typeof rules === 'string') {
- try {
- rules = JSON.parse(rules)
- } catch (e) {
- rules = []
- }
- }
- if (!Array.isArray(rules) || rules.length === 0) {
- return false
- }
- const flowerCount = Number(this.allCountFun.bigLength) || 0
- const flowerPrice = Number(this.allPriceFun) || 0
- const distanceInMeters = Number(this.showDistance) || 0
- for (const rule of rules) {
- const meetNum = Number(rule.meetNum) || 0
- const meetAmount = Number(rule.meetAmount) || 0
- const freeKm = Number(rule.freeKm) || 0
- const freeKmInMeters = freeKm * 1000
- if (freeKmInMeters > 0 && flowerCount >= meetNum && flowerPrice >= meetAmount && distanceInMeters <= freeKmInMeters) {
- return true
- }
- }
- return false
- },
- /**
- * 跑腿费旁展示文案:相对当前扎数/金额/距离,选一条最接近的免运费条件
- * 已满足优先;距离可达时按差额最小;都超距则选公里门槛最接近的
- */
- nearestDeliveryPolicyText() {
- const method = this.currentShMethod
- let rules = method && method.reduceRules
- if (typeof rules === "string") {
- try {
- rules = JSON.parse(rules)
- } catch (e) {
- rules = []
- }
- }
- if (!Array.isArray(rules) || rules.length === 0) {
- return "免运费条件"
- }
- const flowerCount = Number(this.allCountFun.bigLength) || 0
- const flowerPrice = Number(this.allPriceFun) || 0
- const distanceInMeters = Number(this.showDistance) || 0
- let bestText = ""
- let bestScore = Infinity
- rules.forEach(rule => {
- const meetNum = Number(rule.meetNum) || 0
- const meetAmount = Number(rule.meetAmount) || 0
- const freeKm = Number(rule.freeKm) || 0
- const freeKmInMeters = freeKm * 1000
- const text = this.formatReduceRuleText(rule)
- if (!text) {
- return
- }
- const numGap = Math.max(0, meetNum - flowerCount)
- const amountGap = Math.max(0, meetAmount - flowerPrice)
- const distanceOk = freeKmInMeters > 0 && distanceInMeters <= freeKmInMeters
- let score = 0
- if (numGap === 0 && amountGap === 0 && distanceOk) {
- // 已满足该规则,最优先展示
- score = 0
- } else if (distanceOk || freeKmInMeters <= 0) {
- // 距离可达:金额差 + 扎数差(1 扎按 50 元折算,便于同量纲比较接近程度)
- score = 1 + amountGap + numGap * 50
- } else {
- // 距离超限:排在可达规则之后,按超出米数再比差额
- score = 1000000 + (distanceInMeters - freeKmInMeters) + amountGap + numGap * 50
- }
- if (score < bestScore) {
- bestScore = score
- bestText = text
- }
- })
- return bestText || "免运费条件"
- },
- /**
- * 计算总金额
- * @returns {number}
- */
- modifyPrice(){
- return this.panelTotalPrice
- }
- },
- methods: {
- //初始化配送业务面板:拉取配送配置
- loadShMethods(ghsId) {
- getShMethod({ ghsId: ghsId }).then(res => {
- if (res.code == 1) {
- this.methodList = res.data && res.data.method ? res.data.method : []
- if (this.visibleMethodList.length > 0) {
- this.selectMethodByIndex(0)
- } else {
- this.selectedMethodIndex = -1
- }
- }
- })
- },
- checkShMethodBelowMinimum(method) {
- if (!method) {
- return false
- }
- const minAmount = Number(method.minAmount) || 0
- const minNum = Number(method.minNum) || 0
- if (minAmount <= 0 && minNum <= 0) {
- return false
- }
- const allPrice = Number(this.allPriceFun) || 0
- const bigLength = Number(this.allCountFun.bigLength) || 0
- return (minAmount > 0 && allPrice < minAmount) || (minNum > 0 && bigLength < minNum)
- },
- /** 按列表下标切换配送方式,并同步 sendType 供下单与条件展示 */
- selectMethodByIndex(index) {
- const list = this.visibleMethodList
- if (!list[index]) {
- return
- }
- this.selectedMethodIndex = index
- const sendType = Number(list[index].style)
- this.form.sendType = sendType
- //计算跑腿费,二种方式,一个通过跑腿接口,一个通过自定义计费
- this.calcPtFee()
- this.syncPackCostByMethod()
- },
- modifyAddressToggle(){
- currentShop().then(res=>{
- if(res.code == 1){
- this.shopInfo = res.data
- if(!this.$util.isEmpty(this.shopInfo.lat) && !this.$util.isEmpty(this.shopInfo.long) && !this.$util.isEmpty(this.shopInfo.address)){
- this.validAddress = true
- //计算跑腿费,二种方式,一个通过跑腿接口,一个通过自定义计费
- this.calcPtFee()
- }
- }
- })
- },
- //计算跑腿费,二种方式,一个通过跑腿接口,一个通过自定义计费
- calcPtFee(){
- if(this.form.sendType == 2 && this.validAddress && this.currentShMethod){
- if(Number(this.currentShMethod.calcType) == 0){
- this.getDeliveryQuotes()
- }else{
- this.getCustomPtFee()
- }
- }else{
- this.deliveryQuotes = []
- this.selectedDeliveryIndex = -1
- this.selectedDeliveryData = null
- this.form.sendCost = 0
- this.showDistance = 0
- }
- },
- /** 获取自定义计费跑腿费用与距离 */
- getCustomPtFee(){
- this.deliveryQuotes = []
- this.selectedDeliveryIndex = -1
- this.selectedDeliveryData = null
- const ghsId = this.option.id || (this.ghsInfo && this.ghsInfo.id) || 0
- calcCustomPtFee({ id: ghsId, sendType: 2 }).then(res => {
- if (res.code == 1 && res.data) {
- this.form.sendCost = parseFloat(res.data.sendCost) || 0
- this.showDistance = Number(res.data.distance) || 0
- } else {
- this.form.sendCost = 0
- this.showDistance = 0
- if (res.msg) {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- }).catch(() => {
- this.form.sendCost = 0
- this.showDistance = 0
- uni.showToast({ title: '获取自定义运费失败', icon: 'none' })
- })
- },
- /**
- * 将单条满减规则格式化为提示文案
- * @param {Object} rule - meetNum/meetAmount/freeKm
- * @returns {string}
- */
- formatReduceRuleText(rule) {
- if (!rule) {
- return ""
- }
- const meetNum = Number(rule.meetNum) || 0
- const meetAmount = Number(rule.meetAmount) || 0
- const freeKm = Number(rule.freeKm) || 0
- if (meetNum > 0 && meetAmount > 0) {
- return `满${meetNum}扎${meetAmount}元,${freeKm}公里免运费`
- }
- if (meetNum > 0) {
- return `满${meetNum}扎,${freeKm}公里内免运费`
- }
- if (meetAmount > 0) {
- return `满${meetAmount}元,${freeKm}公里内免运费`
- }
- if (freeKm > 0) {
- return `${freeKm}公里内免跑腿费`
- }
- return ""
- },
- // 展示包配送政策弹窗
- showDeliveryPolicyModal() {
- this.deliveryPolicyList = []
- const method = this.currentShMethod
- if (method) {
- let rules = method.reduceRules
- if (typeof rules === 'string') {
- try {
- rules = JSON.parse(rules)
- } catch (e) {
- rules = []
- }
- }
- if (Array.isArray(rules) && rules.length > 0) {
- rules.forEach(rule => {
- const text = this.formatReduceRuleText(rule)
- if (text) {
- this.deliveryPolicyList.push(text)
- }
- })
- }
- }
-
- if (this.deliveryPolicyList.length === 0) {
- uni.showToast({
- title: '暂无详细配送政策',
- icon: 'none'
- })
- return
- }
-
- this.$refs.deliveryPolicyPopup.open()
- },
- syncPackCostByMethod() {
- const method = this.currentShMethod
- if (method && this.checkShMethodBelowMinimum(method)) {
- const unMeet = Number(method.unMeet) || 0
- const fee = parseFloat(Number(method.unMeetFee) || 0)
- if ((unMeet === 0 || unMeet === 1) && fee > 0) {
- this.form.packCost = fee
- return
- }
- }
- this.form.packCost = 0
- },
- /** 聚焦物流输入框时清空,便于重新填写 */
- onWlNameFocus() {
- this.form.wlName = ""
- this.form.wlId = 0
- this.wlSelData = { id: 0, name: "" }
- },
- /** 手动输入物流名称时清除已选物流 id,避免与列表选项不一致 */
- onWlNameInput() {
- this.form.wlId = 0
- this.wlSelData = { id: 0, name: "" }
- },
- /** 打开物流选择弹框 */
- openWlSelect() {
- if (!this.wlList.length) {
- uni.showToast({ title: "暂无物流可选", icon: "none" })
- return
- }
- this.$refs.wlPopupRef.open("center")
- },
- /** 弹框内选中物流后回填到输入框 */
- selectWl(item) {
- this.wlSelData = item || { id: 0, name: "" }
- this.form.wlId = this.wlSelData.id
- this.form.wlName = this.wlSelData.name
- this.$refs.wlPopupRef.close()
- },
- /** 关闭物流选择弹框 */
- cancelWlSelect() {
- this.$refs.wlPopupRef.close()
- },
- ...mapActions(["initMerchantInfo"]),
- closeDeliveryPolicy() {
- this.$refs.deliveryPolicyPopup.close()
- },
- closeRemind(){
- this.$refs.selectFlowerNumRef.close()
- this.lackList = []
- },
- // 获取跑腿平台报价
- getDeliveryQuotes() {
- this.deliveryQuotes = []
- this.selectedDeliveryIndex = -1
- this.selectedDeliveryData = null
-
- allDeliveryQuotes({
- ghsId: this.option.id,
- totalPrice: this.allPriceFun,
- weight: this.allCountFun.weight,
- selectList: this.selectList,
- weight: 1, // 固定重量1kg,请后期根据实际需求修改。测试过后,所有平台都能在5kg的重量下,不会产生额外费用。
- remark: '',
- }).then(res => {
- if (res.code === 1 && res.data && res.data.deliveryList) {
- // 处理报价数据
- this.deliveryQuotes = res.data.deliveryList
- .filter(item => item.isAble !== false)
- .map(item => {
- // 价格从分转换为元
- const price = item.price ? (item.price / 100).toFixed(1) : '0.0'
-
- // 提取平台名称(去掉括号内的内容)
- let displayName = item.name
- let bracketContent = ''
- if (displayName && displayName.includes('(')) {
- bracketContent = displayName.split('(')[1].replace(')', '')
- displayName = displayName.split('(')[0].trim()
- }
- //滴滴特殊处理,括号里的内容作为类型
- if(item.en_name == 'didi' && bracketContent != ''){
- item.type = bracketContent
- }
-
- return {
- ...item,
- displayName: displayName,
- priceText: price,
- priceNumber: parseFloat(price),
- bracketContent: bracketContent
- }
- })
-
- // 自动选中第一个可用的报价
- const firstAvailableIndex = this.deliveryQuotes.findIndex(item => item.isAble)
- if (firstAvailableIndex !== -1) {
- this.selectDelivery(this.deliveryQuotes[firstAvailableIndex], firstAvailableIndex)
- }
- } else {
- uni.showToast({ title: '暂无跑腿可用', icon: 'none' })
- }
- }).catch(err => {
- uni.showToast({ title: '没有获取到跑腿费用', icon: 'none' })
- })
- },
- // 选择跑腿平台
- selectDelivery(item, index) {
- this.selectedDeliveryIndex = index
- this.selectedDeliveryData = item
- this.form.sendCost = item.priceNumber
- this.showDistance = item.distance || 0
- },
- modifyAddress(){
- this.$util.pageTo({ url: '/admin/shop/add?id='+this.getLoginInfo.admin.currentShopId})
- },
- customUpdate(item) {
- if(item.variety == 0){
- if(item.stock<=0){
- uni.showToast({title:'没有货了',icon:'none'})
- return
- }
- this.customNum({ ...item, bigCount: item.bigCount, smallCount: item.smallCount })
- }else{
- this.$msg('多颜色请返回列表修改')
- }
- },
- //自定义数量
- customNum(info) {
- this.isModel = true;
- this.customData = info;
- this.$nextTick(()=>{
- this.customData.smallCount = this.customData.smallCount==0?null:this.customData.smallCount;
- this.customData.bigCount = this.customData.bigCount==0?null:this.customData.bigCount;
- this.isFocus = true;
- if(Number(info.smallCount)>0){
- this.globalUnitType = 1
- }else{
- this.globalUnitType = 0
- }
- })
- },
- modalCancel() {
- this.isModel = false;
- this.customData = {};
- },
- affirm(val) {
- this.isFocus = false;
- this.isFocusOne = false;
- this.$nextTick(()=>{
- //取消
- if (val.index === 0) {
- if(this.customData.bigCount>0 || this.customData.smallCount>0){
- }else{
- this.delAllEvent(this.customData)
- }
- this.modalCancel();
- return false
- }
- //二个都不是数值
- if(/(^[1-9]\d*$)/.test(this.customData.bigCount) == false && /(^[1-9]\d*$)/.test(this.customData.smallCount) == false){
- this.delAllEvent(this.customData)
- this.modalCancel();
- return;
- }
- if(/(^[1-9]\d*$)/.test(this.customData.bigCount)){
- if(this.customData.bigCount<=0){
- uni.showToast({title:"数量要大于0",icon:"none"})
- return;
- }
- }
- if(/(^[1-9]\d*$)/.test(this.customData.smallCount)){
- if(this.customData.smallCount<=0){
- uni.showToast({title:"数量要大于0",icon:"none"})
- return;
- }
- }
- const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
- const ratioNum = Number(ratio);
- //超过库存时 设置为库存最大值 1
- if (Number(bigCount) * ratioNum + Number(smallCount) > Number(bigNum) * ratioNum + Number(smallNum)) {
- uni.showToast({
- title: '库存还剩'+bigNum,
- icon: "none"
- });
- } else {
- this.updateItemEvent(this.customData)
- this.modalCancel()
- }
- })
- },
- init() {
- let that = this
- this.getDetailData()
- getWlList({id:this.option.id}).then(res=>{
- if(res.code == 1){
- that.wlList = res.data.list ? res.data.list : []
- }
- })
- },
- addEvents(item) {
- if(item.variety == 0){
- const ratio = Number(item.ratio);
- if(this.offVerifyRepertory){
- if(item.stock<=0){
- uni.showToast({title:'没有货了',icon:'none'})
- return
- }
- if (Number(this.bigCount) * ratio + Number(this.smallCount) >Number(item.bigNum) * ratio + Number(item.smallNum)) {
- this.$msg("库存只剩"+item.bigNum);
- return
- }
- }
- this.addEvent(item)
- }else{
- this.$msg('多颜色请返回列表修改')
- }
- },
- delItem(item) {
- if(item.variety == 0){
- this.delEvent(item)
- }else{
- this.$msg('多颜色请返回列表修改')
- }
- },
- bindDateChange(e){
- let date = e.detail.value
- this.sendTimeWant = date
- },
- toPhone(phone){
- uni.makePhoneCall({
- phoneNumber: phone
- });
- },
- hasCoupon() {
- let amount = this.allPrice
- shopHouponHas({amount:amount,ghsId:this.option.id}).then(res => {
- this.hasHb = res.data.has
- }).catch(err => {})
- },
- getGhsData(id) {
- let that = this
- getGhsDataApi({id:id}).then(res => {
- that.ghsInfo = res.data
- that.transCost = that.ghsInfo.transCost ? that.ghsInfo.transCost : []
- if(that.ghsInfo.pfLevel && that.ghsInfo.pfLevel == 1){
- //昆明发货到全国
- let packCost = 0
- let weight = this.allCountFun.weight ? this.allCountFun.weight : 0
- if (that.ghsInfo.kmPackCost && !this.$util.isEmpty(that.ghsInfo.kmPackCost)){
- for (const ele of that.ghsInfo.kmPackCost) {
- let flagWeight = ele.num?ele.num:0
- if(Number(flagWeight)>=Number(weight)){
- that.form.packCost = ele.amount?parseFloat(Number(ele.amount)):0
- break
- }
- }
- }
- }else{
- //同城配送
- that.form.packCost = res.data.packCost?parseFloat(res.data.packCost):0
- }
- that.lackExpend = res.data.lackExpend?parseFloat(res.data.lackExpend):0
- that.form.wlName = res.data.customWlName ? res.data.customWlName : ''
- this.loadShMethods(id)
- that.ghsInfoLoaded = true
- })
- },
- countAllPrices(e){
- this.allPrices = this.allPrices+Number(this.form.sendCost)
- },
- getDetailData() {
- let data = uni.getStorageSync("modifyShopB")
- if (this.$util.isEmpty(data)){
- return
- }
- Object.keys(this.form).forEach((i, index) => {
- this.form[i] = data[i];
- });
- },
- confirmFn(options) {
- createOrder(options).then(res => {
- this.resetSelectInfoByType(this.pageType);
- this.resetLimitBuyInfoByType(this.pageType);
- const { data: { id, orderSn } } = res;
- let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
- uni.redirectTo({ url: url })
- });
- },
- affirmFormSubmit(direct){
- const product = this.selectList.map(ele => {
- return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId,weight:ele.weight,name:ele.name };
- })
- if(this.ghsInfo.pfLevel == 0){
-
- /** 提交前校验,失败时提示并返回 false */
- if (Number(this.form.sendType) === 3 && this.$util.isEmpty(this.form.wlName)) {
- this.$msg("请填选物流")
- return false
- }
- const method = this.currentShMethod
- if (method && Number(method.unMeet) === 2 && this.checkShMethodBelowMinimum(method)) {
- // 未满最低消费且不可下单时,提示具体需要的最低金额与数量
- const minAmount = Number(method.minAmount) || 0
- const minNum = Number(method.minNum) || 0
- const tips = []
- if (minAmount > 0) {
- tips.push(`满${minAmount}元`)
- }
- if (minNum > 0) {
- tips.push(`满${minNum}扎`)
- }
- const tipStr = tips.length > 0 ? `${tips.join("并且")}才能下单` : "未达到最低消费,不能下单"
- this.$msg(tipStr)
- return false
- }
-
- }
- //多颜色
- let xj = uni.getStorageSync("ghsColorItem"+this.ghsInfo.id)
- let getType = this.form.sendType == 2 ? 1 : 2
- //用于计划是否要包装费
- let itemTotalAmount = this.allPriceFun
- let params = {
- getType:getType,
- sendTimeWant:this.sendTimeWant,
- sendType:this.form.sendType,
- transType:this.form.transType,
- remark:this.remark,
- product:JSON.stringify(product),
- ghsId:this.ghsInfo.id,
- hbId: this.form.hbId,
- wlName:this.form.wlName,
- xj:JSON.stringify(xj),
- itemTotalAmount:itemTotalAmount,
- version:10,
- direct:direct
- }
-
- // 如果选择了跑腿配送并且有选中的平台数据,则添加配送平台信息
- if (this.form.sendType == 2 && this.selectedDeliveryData) {
- params.deliveryPlatform = this.selectedDeliveryData.en_name // 平台名称
- params.deliveryPrice = this.selectedDeliveryData.priceNumber // 报价金额
- params.deliveryDistance = this.showDistance // 配送距离
- params.deliveryBracketContent = this.selectedDeliveryData.bracketContent // 配送平台括号里的内容
- }
- let self = this;
- self.$util.confirmModal({content:'确认提交?'}, async () => {
- let pendingMsg = '';
- uni.showLoading({title: '加载中',mask:true})
- try {
- // hideError:避免 luch-request 在 showLoading 期间 showToast 被挡住
- const res = await createOrder(params, { hideError: true })
- if (!res || typeof res !== 'object') {
- pendingMsg = '提交失败,请重试'
- return
- }
- if(res.code == 1){
- this.limitExceedProductId = ''
- this.limitExceedLimitBuy = ''
- this.limitExceedNum = ''
- if(res.data.hasLackError && res.data.hasLackError == 1){
- this.lackList = res.data.lackList ? res.data.lackList : []
- this.$refs.selectFlowerNumRef.open('center')
- return
- }
- const {orderSn,realPrice,id} = res.data
- self.pageTo({url: '/pagesPurchase/wechatPay',query:{orderSn,realPrice,id}, type: 2})
- setTimeout(() => {
- self.removeMemory(self.ghsInfo.id)
- self.resetLimitBuyInfoByType(self.pageType)
- }, 600)
- return
- }
- if(res.code == -1 && res.data && String(res.data.productId || '') !== ''){
- this.limitExceedProductId = res.data.productId ? String(res.data.productId) : ''
- this.limitExceedLimitBuy = res.data.limitBuy ? String(res.data.limitBuy) : '0'
- this.limitExceedNum = res.data.exceed ? String(res.data.exceed) : '0'
- pendingMsg = res.msg || '累计已超出限购数'
- return
- }
- this.limitExceedProductId = ''
- this.limitExceedLimitBuy = ''
- this.limitExceedNum = ''
- if(res.msg){
- pendingMsg = res.msg
- }
- } catch (err) {
- pendingMsg = '提交失败,请重试'
- } finally {
- uni.hideLoading()
- if (pendingMsg) {
- // 小程序 hideLoading 后立即 showToast 可能不显示,需短暂延迟
- setTimeout(() => {
- self.$msg(pendingMsg)
- }, 100)
- }
- }
- })
- },
- isLimitExceededItem(item){
- if(!item || !this.limitExceedProductId){
- return false
- }
- return String(item.id) === String(this.limitExceedProductId)
- },
- numberAdd(arg1, arg2) {
- 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))
- n = (r1 >= r2) ? r1 : r2;
- return ((arg1 * m + arg2 * m) / m).toFixed(n);
- },
- NumberSub(arg1, arg2) {
- var re1, re2, m, n;
- try {
- re1 = arg1.toString().split(".")[1].length;
- } catch (e) {
- re1 = 0;
- }
- try {
- re2 = arg2.toString().split(".")[1].length;
- } catch (e) {
- re2 = 0;
- }
- m = Math.pow(10, Math.max(re1, re2));
- n = (re1 >= re2) ? re1 : re2;
- return ((arg1 * m - arg2 * m) / m).toFixed(n);
- },
- // 表单验证
- async formSubmit(e) {
- try {
- // 进行表单检查
- let formData = this.form;
- const product = this.selectList.map(ele => {
- return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
- });
- formData.product = JSON.stringify(product);
- if (!this.getMerchantInfo) {
- await this.initMerchantInfo();
- }
- formData.shopId = this.getMerchantInfo.id;
- let checkRes = formUtil.validation(formData, []);
- // 验证通过!
- if (!checkRes) {
- this.confirmFn(formData);
- } else {
- this.$msg(checkRes);
- }
- } catch (error) {
- console.log(999999, error);
- }
- },
- gobackEvent() {
- this.$util.pageTo({url: "/pagesPurchase/ghsProduct?id="+this.options.id,type: 2})
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .admin-button-com {
- margin-right: 15upx;
- }
- .affirm-page {
- position: relative;
- height: 100%;
- display: flex;
- flex-direction: column;
- /* #ifdef APP-PLUS */
- padding-bottom: 100upx;
- /* #endif */
- .affirm-view {
- flex: 1;
- padding: 20upx 20upx 100upx 20upx;
- background-color: #f0f2f6;
- .commodity-view {
- display: flex;
- flex-direction: column;
- .commodity-list {
- padding: 20upx;
- .commodity-item {
- display: flex;
- margin-bottom: 20upx;
- &.limit-exceed-item {
- border: 2upx solid #ff4d4f;
- border-radius: 12upx;
- padding: 12upx;
- box-sizing: border-box;
- }
- .item-icon {
- flex-shrink: 0;
- width: 140upx;
- height: 140upx;
- border-radius: 4upx;
- background-color: #f5f5f5;
- }
- .item-info {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- flex: 1;
- margin-left: 20upx;
- min-width: 0;
- .item-row-top {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- }
- .item-name {
- flex: 1;
- min-width: 0;
- padding-right: 16upx;
- color: #333333;
- font-size: 30upx;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- line-height: 1.3;
- }
- .item-price-block {
- flex-shrink: 0;
- display: flex;
- flex-direction: row;
- align-items: baseline;
- max-width: 48%;
- }
- .item-price-line {
- display: flex;
- flex-direction: row;
- align-items: baseline;
- }
- .price-current {
- font-size: 32upx;
- font-weight: bold;
- color: #333333;
- white-space: nowrap;
- line-height: 1.2;
- }
- .price-original {
- margin-left: 12upx;
- margin-top: 0;
- font-size: 29upx;
- color: #999999;
- text-decoration: line-through;
- white-space: nowrap;
- line-height: 1.2;
- }
- .item-row-qty {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- align-items: center;
- margin-top: 10upx;
- flex-wrap: wrap;
- }
- .qty-sep {
- margin: 0 8upx;
- color: #cccccc;
- font-size: 28upx;
- }
- .qty-part {
- font-size: 28upx;
- color: #666666;
- }
- .qty-big {
- font-size: 30upx;
- font-weight: bold;
- color: #3385ff;
- }
- .item-row-tips {
- display: flex;
- flex-direction: column;
- margin-top: 10upx;
- }
- .limit-exceed-tip {
- margin-top: 4upx;
- color: #ff4d4f;
- font-size: 24upx;
- font-weight: bold;
- line-height: 1.45;
- }
- .limit-buy-price-tip {
- margin-top: 4upx;
- color: #ff7a00;
- font-size: 24upx;
- font-weight: bold;
- line-height: 1.45;
- }
- .presell-tip {
- margin-top: 4upx;
- color: #e53935;
- font-size: 26upx;
- font-weight: bold;
- line-height: 1.45;
- }
- }
- }
- }
- .summary-bar {
- padding: 0 20upx;
- height: 90upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-top: 1px solid #eeeeee;
- .operate-view {
- display: flex;
- align-items: center;
- color: #3385ff;
- font-size: 30upx;
- font-weight:bold;
- .iconfont {
- margin-right: 20upx;
- font-size: 40upx;
- }
- }
- .describe-view {
- display: flex;
- align-items: center;
- color: #333;
- font-size: 24upx;
- .price {
- font-weight: bold;
- font-size: 30upx;
- }
- }
- }
- }
- .module-com {
- background-color: #fff;
- margin-bottom: 20upx;
- border-radius: 10upx;
- overflow: hidden;
- padding-top: 20upx;
- .ghs-msg{
- padding: 0 20upx 20upx;
- font-size: 32upx;
- &.active{
- color: #868686;
- font-size: 24upx;
- }
- i{color: #62ed73;font-size: 48upx}
- }
- .member-wrap {
- .member-det {
- font-size: 24upx;
- margin-left: 20upx;
- }
- }
- .remark-wrap {
- align-items: flex-start;
- .remark {
- height: 240upx;
- }
- }
- }
- }
- .under-bar {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20upx;
- width: 100%;
- height: 100upx;
- background-color: #fff;
- box-shadow: 0upx -1px 6upx 0upx rgba(4, 0, 0, 0.06);
- /* #ifdef APP-PLUS */
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 999;
- /* #endif */
- /* #ifdef MP-WEIXIN */
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 999;
- /* #endif */
- .price-view {
- display: flex;
- align-items: center;
- font-size: 24upx;
- .price-title {
- color: #333;
- }
- .price-number {
- margin: 0 20upx;
- color: #ff2842;
- .large {
- font-size: 40upx;
- }
- }
- .price-discount-tip {
- font-size: 28upx;
- color: #ff7a00;
- font-weight: bold;
- white-space: nowrap;
- }
- }
- .admin-button-com {
- width: 200upx;
- }
- }
- .coupon_box{
- flex: 1;
- text-align: right;
- padding-right: 45upx;
- .has-hb{
- background:red;
- color:white;
- border:1upx solid red;
- border-radius: 30upx;
- font-size:20upx;
- padding:5upx 15upx 5upx 15upx;
- }
- .selected{
- color:red;
- float:left;
- }
- }
- .select-cmd_bx {
- & .kc {
- color: #999999;
- font-size: 28upx;
- font-weight: 400;
- margin-bottom: 60upx;
- text-align: center;
- margin-top: 10upx;
- }
- & .num_bx {
- display: flex;
- align-items: center;
- justify-content:center;
- margin-bottom: 80upx;
- & > input {
- width: 280upx;
- height: 80upx;
- border: 1px solid #dddddd;
- border-radius: 4upx;
- text-align: center;
- font-size: 40upx;
- }
- }
- }
- }
- /* 跑腿平台报价样式 */
- .delivery-quotes-container {
- width: 100%;
- margin-top: 20upx;
- }
- .delivery-quotes-grid {
- display: flex;
- flex-wrap: wrap;
- gap: 10upx;
- padding: 0;
- width: 100%;
- }
- .delivery-quote-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- flex: 0 0 calc(33% - 7upx);
- width: calc(33% - 7upx);
- min-height: 140upx;
- padding: 16upx 10upx;
- margin-bottom: 5upx;
- background: #FFFFFF;
- border: 2upx solid #DDDDDD;
- border-radius: 8upx;
- box-sizing: border-box;
- transition: all 0.3s;
-
- // 当只有1-2项时使用固定宽度
- &.fixed-width {
- flex: 0 0 220rpx;
- width: 220rpx;
- }
-
- .platform-name {
- font-size: 26upx;
- color: #333;
- font-weight: bold;
- margin-bottom: 8upx;
- text-align: center;
- line-height: 1.3;
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- word-break: break-all;
- }
-
- .platform-price {
- font-size: 30upx;
- color: #333;
- font-weight: bold;
- margin-bottom: 4upx;
- }
-
- .platform-type {
- font-size: 20upx;
- color: #868686;
- margin-top: 4upx;
- text-align: center;
- line-height: 1.3;
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- word-break: break-all;
- }
-
- // 选中状态
- &.active {
- background: #09C567;
- border-color: #09C567;
-
- .platform-name,
- .platform-price {
- color: #FFFFFF;
- }
-
- .platform-type {
- color: rgba(255, 255, 255, 0.85);
- }
- }
-
- // 不可用状态
- &.disabled {
- opacity: 0.5;
- background: #F5F5F5;
-
- .platform-name,
- .platform-price,
- .platform-type {
- color: #CCCCCC;
- }
- }
- }
- /* 跑腿费价格样式 */
- .delivery-price-normal {
- color: #3385FF;
- }
- .delivery-price-free {
- color: #999;
- text-decoration: line-through;
- }
- .free-delivery-tag {
- color: #3385FF;
- margin-left: 20upx;
- }
- .delivery-policy-link {
- color: rgb(201, 52, 52);
- font-size: 28upx;
- margin-left: 20upx;
- font-weight: bold;
- text-decoration: underline;
- }
- .policy-icon {
- font-size: 28upx;
- margin-left: 4upx;
- }
- .policy-popup-content {
- width: 600upx;
- background-color: #fff;
- border-radius: 20upx;
- padding: 30upx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .policy-title {
- font-size: 34upx;
- font-weight: bold;
- color: #333;
- margin-bottom: 30upx;
- }
- .policy-scroll {
- width: 100%;
- max-height: 50vh;
- margin-bottom: 30upx;
- }
- .policy-list {
- width: 100%;
- }
- .policy-item {
- font-size: 30upx;
- color: #666;
- margin-bottom: 20upx;
- text-align: left;
- line-height: 1.5;
- display: list-item;
- list-style-type: disc;
- margin-left: 40upx;
- }
- .policy-btn {
- width: 50%;
- height: 80upx;
- line-height: 80upx;
- text-align: center;
- background-color: #3385ff;
- color: #fff;
- font-size: 32upx;
- border-radius: 40upx;
- }
- /* 配送业务面板样式 */
- .wl-field-row {
- display: flex;
- flex-direction: row;
- align-items: center;
- flex: 1;
- justify-content: flex-end;
- min-width: 0;
- }
- .wl-name-input {
- flex: 1;
- min-width: 0;
- text-align: left;
- }
- .wl-select-btn {
- margin-left: 16upx;
- flex-shrink: 0;
- }
- .wl-popup-content {
- width: 680upx;
- max-width: 90vw;
- background: #fff;
- border-radius: 20upx;
- overflow: hidden;
- }
- .wl-popup-title {
- padding: 30upx 30upx 10upx;
- font-size: 30upx;
- font-weight: bold;
- color: #333;
- }
- .wl-popup-scroll {
- max-height: 60vh;
- }
- .wl-popup-list {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- padding: 20upx 20upx 10upx;
- }
- .wl-popup-item {
- margin-bottom: 20upx;
- margin-right: 12upx;
- }
- .wl-option-btn {
- min-width: 160upx;
- padding: 0 27upx;
- height: 80upx;
- font-size: 32upx;
- font-weight: bold;
- border-radius: 16upx;
- background: #f0f2f6;
- color: #333;
- border: 2upx solid #e0e0e0;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .wl-option-btn.selected,
- .wl-option-btn:active {
- background: #3385ff;
- color: #fff;
- border-color: #3385ff;
- }
- .wl-popup-footer {
- padding: 10upx 0 30upx;
- text-align: center;
- }
- .wl-popup-cancel-btn {
- width: 210upx;
- }
- .sh-method-btn {
- width: 115upx;
- height: 100upx;
- margin-right: 15upx;
- }
- .sh-method-btn:last-child {
- margin-right: 0;
- }
- .sh-method-btn--short {
- line-height: 60upx;
- }
- .sh-method-btn--long {
- line-height: 32upx;
- }
- .wl-popup-wrap {
- z-index: 99999;
- }
- </style>
|