affirm.vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169
  1. <template>
  2. <view class="app-content">
  3. <view class="affirm-page">
  4. <view class="affirm-view overscroll">
  5. <form>
  6. <view class="module-com">
  7. <view class="commodity-view">
  8. <view class="commodity-list">
  9. <template v-if="!$util.isEmpty(selectList)">
  10. <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
  11. <!-- #ifdef APP-PLUS -->
  12. <image class="item-icon" :src="item.cover" />
  13. <!-- #endif -->
  14. <!-- #ifdef MP-WEIXIN -->
  15. <image class="item-icon" :src="item.cover" />
  16. <!-- #endif -->
  17. <view class="item-info">
  18. <view class="info-line">
  19. <text class="item-name">
  20. {{ item.name||'' }}
  21. <text v-if="item.variety && item.variety ==1" class="show-color"></text>
  22. </text>
  23. <text class="item-price">
  24. <text class="unit">¥</text>
  25. <text class="price">{{ parseFloat(item.userPrice)||0 }}</text>
  26. </text>
  27. </view>
  28. <view style="text-align:right;position: relative;">
  29. <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-if="item.bigCount > 0">¥{{ parseFloat((Number(item.bigCount)*Number(item.userPrice)).toFixed(2)) }}</text>
  30. <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-else>¥{{ parseFloat((Number(item.smallCount)*Number(item.userPrice)).toFixed(2)) }}</text>
  31. <view class="open-bx" >
  32. <i class="iconfont iconjian" @click="reduceItemFn(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
  33. <text class="num" @click="showAddModelFn(item)">
  34. <text v-if="item.bigCount > 0" style="font-size:24upx;font-weight:bold;color:#3385ff;">{{ item.bigCount }}</text>
  35. <text v-if="item.smallCount > 0" style="font-size:24upx;">{{ item.smallCount }}</text>
  36. </text>
  37. <i class="iconfont iconzeng" @click="addItemFn(item)"></i>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. </view>
  44. <view class="summary-bar">
  45. <view class="operate-view" v-if="isScanEnv" @click="removeFromSave(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
  46. <view class="operate-view" v-else @click="gobackEvent" style="font-size:32upx;font-weight:bold;"><text class="iconfont icongouwuche" style="margin-right:5upx;"></text>返回修改</view>
  47. <view class="describe-view">
  48. <text>合计 ¥{{ allPrice }}</text>
  49. </view>
  50. </view>
  51. <view class="summary-bar">
  52. <view class="operate-view" v-if="isScanEnv"><text class="iconfont iconzeng"></text>手动添加花材</view>
  53. <view class="operate-view" v-if="isScanEnv == false"><text> </text></view>
  54. <view class="describe-view">
  55. <text>{{ selectList.length }}种</text>
  56. <text v-if="Number(allCount.bigLength)>0">,{{allCount.bigLength?parseFloat(allCount.bigLength):0}}扎</text>
  57. <text v-if="Number(allCount.smallLength)>0">,{{allCount.smallLength?parseFloat(allCount.smallLength):0}}支</text>
  58. <text v-if="Number(allCount.weight)>0">,{{allCount.weight?parseFloat(allCount.weight):0}}公斤</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx" >
  64. <template slot="customContent">
  65. <view class="select-cmd_bx" v-if="customData">
  66. <view class="kc">
  67. <text class="unit_price">库存 {{ parseFloat(customData.stock) }}</text>
  68. <text class="unit_price" v-if="customData.property==1 || (customData.property==0 && customData.priceType==1)"> ¥{{ parseFloat(customData.price) }}</text>
  69. <text class="unit_price" v-else>--</text>
  70. </view>
  71. <view class="num_bx">
  72. <input style="width: 430upx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="单价" :disabled="false" />
  73. <text style="font-size:35upx;font-weight:bold;color:#666666;">元</text>
  74. </view>
  75. <view class="num_bx">
  76. <!-- #ifdef APP-PLUS -->
  77. <input style="width: 430upx" v-model="customData.bigCount" v-if="globalUnitType == 0" type="number" />
  78. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">扎</text>
  79. <input style="width: 430upx" v-model="customData.smallCount" v-if="globalUnitType == 1" type="number" />
  80. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">支</text>
  81. <!-- #endif -->
  82. <!-- #ifdef MP-WEIXIN -->
  83. <input style="width: 430upx" v-model="customData.bigCount" v-if="globalUnitType == 0" :focus="isAddInputFocus" type="number" />
  84. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">扎</text>
  85. <input style="width: 430upx" v-model="customData.smallCount" v-if="globalUnitType == 1" :focus="isAddInputFocus" type="number" />
  86. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">支</text>
  87. <!-- #endif -->
  88. <!-- 只有花材 property == 1 才给显示切换功能 -->
  89. <image @click="switchGlobalUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" v-if="customData.property == 1"
  90. style="width:86upx;height:86upx;position:relative;top:-60upx;right:0upx;" mode="widthFix"></image>
  91. </view>
  92. </view>
  93. </template>
  94. </modal-module>
  95. <view class="module-com input-line-wrap">
  96. <view>
  97. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  98. <view class="tui-title">客户</view>
  99. <view class="tui-input">
  100. {{ form.customName||'请选择' }}
  101. </view>
  102. </tui-list-cell>
  103. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="Number(customInfo.balance)>0">
  104. <view class="tui-title">余额</view>
  105. <view class="tui-input" style="color:#3385FF;font-weight:bold;">
  106. ¥{{ parseFloat(customInfo.balance) }}
  107. <text v-if="Number(customInfo.balance)>Number(modifyPrice)" style="margin-left:30upx;">余额充足,已用余额支付</text>
  108. </view>
  109. </tui-list-cell>
  110. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  111. <view class="tui-title">收款方式</view>
  112. <button style="margin-right:10upx;height:70upx;line-height:46upx;" @click="form.hasPay = 0" class="admin-button-com mini-btn" :class="form.hasPay == 0 ? 'blue' : 'default'">扫码</button>
  113. <button style="margin-right:10upx;height:70upx;line-height:46upx;" @click="form.hasPay = 4" class="admin-button-com mini-btn" :class="form.hasPay == 4 ? 'blue' : 'default'">余额</button>
  114. <button style="margin-right:10upx;height:70upx;line-height:46upx;" @tap="form.hasPay = 1" class="admin-button-com mini-btn" :class="form.hasPay == 1 ? 'blue' : 'default'">线下</button>
  115. <button style="margin-right:0upx;height:70upx;line-height:46upx;" @click="form.hasPay = 2" class="admin-button-com mini-btn" :class="form.hasPay == 2 ? 'blue' : 'default'">挂账</button>
  116. </tui-list-cell>
  117. <tui-list-cell class="line-cell" :arrow="false" v-if="form.hasPay == 0">
  118. <view class="tui-title">扫码</view>
  119. <view class="tui-input" style="color:#3385ff;">扫码付款、分享小程序付款 选扫码</view>
  120. </tui-list-cell>
  121. <tui-list-cell class="line-cell" :arrow="false" v-if="form.hasPay == 2">
  122. <view class="tui-title">挂账</view>
  123. <view class="tui-input" style="color:#3385ff;">客户要赊账欠款的 选挂账</view>
  124. </tui-list-cell>
  125. <tui-list-cell class="line-cell" :arrow="false" v-if="form.hasPay == 4">
  126. <view class="tui-title">余额</view>
  127. <view class="tui-input" style="color:#3385ff;">使用余额支付</view>
  128. </tui-list-cell>
  129. <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.hasPay == 1">
  130. <view class="tui-title">线下渠道</view>
  131. <picker mode="selector" :value="payWayindex" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input">
  132. <view class="uni-input" v-if="form.payWay == 0">线下微信(收款码)</view>
  133. <view class="uni-input" v-else-if="form.payWay == 1">线下支付宝(收款码)</view>
  134. <view class="uni-input" v-else-if="form.payWay == 4">现金</view>
  135. <view class="uni-input" v-else-if="form.payWay == 5">银行卡</view>
  136. <view class="uni-input" v-else style="color:#CCCCCC;">请选择</view>
  137. </picker>
  138. </tui-list-cell>
  139. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  140. <view class="tui-title">配送方式</view>
  141. <button style="margin-right:10upx;height:70upx;line-height:46upx;" @tap="setSendType(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">自取</button>
  142. <button style="margin-right:10upx;height:70upx;line-height:46upx;" @tap="setSendType(0)" class="admin-button-com mini-btn" :class="form.sendType == 0 ? 'blue' : 'default'">自配送</button>
  143. <button style="margin-right:10upx;height:70upx;line-height:46upx;" @click="setSendType(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">跑腿</button>
  144. <button style="margin-right:0upx;height:70upx;line-height:46upx;" @click="setSendType(3)" class="admin-button-com mini-btn" :class="form.sendType == 3 ? 'blue' : 'default'">物流</button>
  145. </tui-list-cell>
  146. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="form.sendType == 1">
  147. <view class="tui-title">取货状态</view>
  148. <button @tap="form.getGoods = 1" class="admin-button-com middle" style="width:140upx;" :class="form.getGoods == 1? 'blue' : 'default'">已取货</button>
  149. <button @click="form.getGoods = 0" class="admin-button-com middle" style="width:140upx;" :class="form.getGoods == 0 ? 'blue' : 'default'">未取货</button>
  150. </tui-list-cell>
  151. <view v-if="form.sendType == 2">
  152. <view v-if="openIntraCity == 1" class="delivery-section">
  153. <!-- 客户地址信息 -->
  154. <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click.stop="updateCustomAddress()">
  155. <view class="tui-title" style="width:120upx;">客户地址</view>
  156. <view class="address-box">
  157. <view v-if="$util.isEmpty(customInfo.long) || $util.isEmpty(customInfo.lat) || $util.isEmpty(customInfo.address)" class="addr-main" style="color:red;font-size:29upx;font-weight:bold;">
  158. 地址不完整,请修改
  159. </view>
  160. <view v-else>
  161. <view class="addr-main">{{ customInfo.address }}</view>
  162. <view class="addr-sub">{{ customInfo.showAddress }}</view>
  163. </view>
  164. </view>
  165. </tui-list-cell>
  166. <tui-list-cell class="line-cell" :hover="false">
  167. <view v-if="deliveryQuotes.length > 0" class="delivery-quotes-container">
  168. <view class="delivery-quotes-grid">
  169. <view
  170. v-for="(item, index) in deliveryQuotes"
  171. :key="index"
  172. class="delivery-quote-item"
  173. :class="{
  174. 'active': selectedDeliveryIndex === index,
  175. 'disabled': !item.isAble,
  176. 'fixed-width': deliveryQuotes.length <= 2
  177. }"
  178. @click="selectDelivery(item, index)"
  179. >
  180. <view class="platform-name">{{ item.displayName || item.name }}</view>
  181. <view class="platform-price">{{ item.priceText }}元</view>
  182. <view v-if="item.type" class="platform-type">{{ item.type }}</view>
  183. </view>
  184. </view>
  185. </view>
  186. <view v-else class="empty-quotes-view">
  187. <text v-if="$util.isEmpty(customInfo.long) || $util.isEmpty(customInfo.lat) || $util.isEmpty(customInfo.address)" style="color:red;" @click.stop="updateCustomAddress()">请先修改客户地址</text>
  188. <text v-else>正在获取运费...</text>
  189. </view>
  190. </tui-list-cell>
  191. <tui-list-cell class="line-cell" :hover="false">
  192. <view class="tui-title">距离</view>
  193. <view class="distance-box">
  194. <text v-if="showDistance > 100" class="blue-text">{{ (showDistance/1000).toFixed(1) }}公里</text>
  195. <text v-else class="blue-text">{{ showDistance }} 米</text>
  196. </view>
  197. </tui-list-cell>
  198. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  199. <view class="tui-title title-reduction" style="width: 150upx;">满减规则</view>
  200. <button @tap="changeReductionRule(0)" class="admin-button-com mini-btn btn-reduction" :class="form.reductionRule == 0 ? 'active' : 'default'">没有</button>
  201. <button @tap="changeReductionRule(1)" class="admin-button-com mini-btn btn-reduction" :class="form.reductionRule == 1 ? 'active' : 'default'">花材满减</button>
  202. <button @tap="changeReductionRule(2)" class="admin-button-com mini-btn btn-reduction-last" :class="form.reductionRule == 2 ? 'active' : 'default'">花束满减</button>
  203. </tui-list-cell>
  204. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  205. <view class="tui-title">运费</view>
  206. <view v-if="form.reductionRule == 1 && isHcMapRule()">
  207. <input type="digit" placeholder="请填写运费" v-model="form.customSendCost" placeholder-class="tui-placeholder" style="border:1upx solid #eee;color:#3385FF;width:300upx;height:70upx;text-align:center;" />
  208. </view>
  209. <view v-else-if="form.reductionRule == 2">
  210. <view v-if="isHsMapRule()">
  211. <input type="digit" placeholder="请填写运费" v-model="form.customSendCost" placeholder-class="tui-placeholder" style="border:1upx solid #eee;color:#3385FF;width:300upx;height:70upx;text-align:center;" />
  212. </view>
  213. <view v-else>
  214. <input type="digit" placeholder="请填写运费" v-model="form.sendCost" placeholder-class="tui-placeholder" style="border:1upx solid #eee;color:#3385FF;width:300upx;height:70upx;text-align:center;" />
  215. </view>
  216. </view>
  217. <view v-else>
  218. <input type="digit" placeholder="请填写运费" v-model="form.sendCost" placeholder-class="tui-placeholder" style="border:1upx solid #eee;color:#3385FF;width:300upx;height:70upx;text-align:center;" />
  219. </view>
  220. </tui-list-cell>
  221. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  222. <view class="tui-title">呼叫跑腿</view>
  223. <button @tap="form.callErrand = 0" class="admin-button-com middle btn-call" :class="form.callErrand == 0? 'active' : 'default'">先不要叫</button>
  224. <button @tap="form.callErrand = 1" class="admin-button-com middle btn-call" :class="form.callErrand == 1 ? 'active' : 'default'">现在就叫</button>
  225. </tui-list-cell>
  226. <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
  227. <view class="tui-title">取件时间</view>
  228. <view class="time-action-view" @click.stop="openTimePicker">
  229. <text>{{ pickupTime.label || '立即取件' }}</text>
  230. <text class="iconfont iconxiangyou icon-arrow-right"></text>
  231. </view>
  232. </tui-list-cell>
  233. <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
  234. <view class="tui-title">重量</view>
  235. <view>
  236. <WeightInput v-model="form.weight" />
  237. </view>
  238. </tui-list-cell>
  239. <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
  240. <view class="tui-title">跑腿备注</view>
  241. <RemarkInput v-model="form.deliveryRemark" />
  242. </tui-list-cell>
  243. </view>
  244. <view v-else class="delivery-section">
  245. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  246. <view class="tui-title">运费</view>
  247. <input type="digit" placeholder="请填写运费" v-model="form.sendCost" />
  248. </tui-list-cell>
  249. </view>
  250. </view>
  251. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  252. <view class="tui-title">打印小票</view>
  253. <button @tap="form.needPrint = 2" class="admin-button-com middle" style="width:140upx;" :class="form.needPrint == 2? 'blue' : 'default'">不打印</button>
  254. <button @click="form.needPrint = 1" class="admin-button-com middle" style="width:140upx;" :class="form.needPrint == 1 ? 'blue' : 'default'">打印</button>
  255. </tui-list-cell>
  256. <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="hasAvailableHb">
  257. <view class="tui-title">红包</view>
  258. <hb-select
  259. :hbData="hbData"
  260. :totalPrice="preDiscountPrice"
  261. v-model="selectedHbId"
  262. @change="(hb) => { selectedHb = hb }"
  263. ></hb-select>
  264. </tui-list-cell>
  265. <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
  266. <view class="tui-title">
  267. <text>合计金额</text>
  268. </view>
  269. <text style="color: #3385FF;width:170upx;">¥{{parseFloat(systemPrice)}}</text>
  270. <button @tap="showDiscount()" class="admin-button-com middle default" style="width:140upx;">打折</button>
  271. <text v-if="discountValue>0 && discountValue<1">{{ (Number(discountValue)*10).toFixed(1) }}折</text>
  272. </tui-list-cell>
  273. <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
  274. <view v-if="form.hasPay == 2" class="tui-title">应收金额</view>
  275. <view v-else-if="form.hasPay == 3" class="tui-title">余额扣减</view>
  276. <view v-else class="tui-title">{{form.forward==0?'实收':'实付'}}金额</view>
  277. <input style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;" type="digit" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
  278. <text v-if="modifyPrice > 0 && modifyPrice > systemPrice" style="font-size:25upx;margin-left:20upx;color:red;">人工包装费 ¥{{parseFloat((modifyPrice-systemPrice).toFixed(2))}}</text>
  279. <text v-if="modifyPrice > 0 && modifyPrice < systemPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((systemPrice-modifyPrice).toFixed(2))}}</text>
  280. </tui-list-cell>
  281. <tui-list-cell class="line-cell" :hover="false" :arrow="true">
  282. <view class="tui-title" v-if="form.sendType == 1">取花日期</view>
  283. <view class="tui-title" v-else>配送日期</view>
  284. <view class="uni-input" v-if="form.reachDate==''" @click="bindReachDateChange">
  285. <view style="width:410upx;font-size:32upx;color:#CCCCCC;">默认当天</view>
  286. </view>
  287. <view class="uni-input" @click="bindReachDateChange">
  288. <view style="width:410upx;font-size:32upx;">{{form.reachDate}}</view>
  289. </view>
  290. </tui-list-cell>
  291. <tui-list-cell class="line-cell" :hover="false" :arrow="true">
  292. <view class="tui-title" v-if="form.sendType == 1">取花时间</view>
  293. <view class="tui-title" v-else>配送时间</view>
  294. <view class="uni-input" style="width:450upx;font-size:32upx;" @click="openTimePopup">{{form.reachPeriod}}</view>
  295. </tui-list-cell>
  296. <tui-list-cell class="line-cell" :arrow="true">
  297. <div class="tui-title">开单人</div>
  298. <picker mode="selector" :value="form.getStaffId" :range="staffList" range-key="name" @change="kdChange" class="tui-input" >
  299. <input v-model="form.getStaffId" name="getStaffId" type="text" hidden />
  300. <div style="padding:6upx 0 6upx 0;" v-if="form.getStaffName!=''">{{form.getStaffName}}</div>
  301. <div v-else style="padding:6upx 0 6upx 0;color:#CCCCCC;">默认本人</div>
  302. </picker>
  303. </tui-list-cell>
  304. <tui-list-cell class="line-cell" :hover="false" :arrow="true">
  305. <view class="tui-title">账单日期</view>
  306. <view class="uni-input" v-if="form.historyDate==''" @click="bindHistoryDateChange">
  307. <view style="width:410upx;font-size:32upx;color:#CCCCCC;">默认当天</view>
  308. </view>
  309. <view class="uni-input" @click="bindHistoryDateChange">
  310. <view style="width:410upx;font-size:32upx;">{{form.historyDate}}</view>
  311. </view>
  312. </tui-list-cell>
  313. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  314. <view class="tui-title">备注</view>
  315. <textarea style="height:80upx;z-index:0" v-model="form.remark" placeholder-class="remark-class" placeholder="选填" />
  316. </tui-list-cell>
  317. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="reduceStock == 0">
  318. <view class="tui-title">通知制作</view>
  319. <button @tap="form.needWork = 0;" class="admin-button-com middle" style="width:170upx;" :class="form.needWork == 0? 'blue' : 'default'">不要</button>
  320. <button @click="form.needWork = 1;" class="admin-button-com middle" style="width:170upx;" :class="form.needWork == 1 ? 'blue' : 'default'">需要</button>
  321. </tui-list-cell>
  322. <!-- 如果是扣除库存方式开单,不显示售后付款选项 -->
  323. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="reduceStock == 0">
  324. <view class="tui-title">订单类型</view>
  325. <button @tap="form.forward = 0;" class="admin-button-com middle" style="width:170upx;" :class="form.forward == 0? 'blue' : 'default'">收入订单</button>
  326. <button @click="form.forward = 1;" class="admin-button-com middle" style="width:170upx;" :class="form.forward == 1 ? 'blue' : 'default'">红冲订单</button>
  327. </tui-list-cell>
  328. </view>
  329. </view>
  330. </form>
  331. </view>
  332. <view class="under-bar">
  333. <view class="price-view">
  334. <text class="price-title">
  335. <text></text>
  336. </text>
  337. <text class="price-number"><text class="large">{{form.forward==0?'':'-'}}¥{{ modifyPrice }}</text></text>
  338. </view>
  339. <!-- <text style="font-size:30upx;right:100upx;">当前在<text style="font-weight:bold;color:red;margin-left:5upx;font-size:32upx;">{{currentShop.shopName}}</text></text> -->
  340. <button class="admin-button-com blue big" @click="confirmSubmit">提交</button>
  341. </view>
  342. <view v-if="isScanEnv" @click="changeGet" style="width:125upx;height:125upx;display:flex;justify-content:center;align-items:center;font-size:60upx;
  343. background:#3385ff;color:white;z-index:9999;position:fixed;bottom:230upx;right:40upx;border-radius:60upx;">{{calc=='add'?'+':'-'}}</view>
  344. <uni-popup ref="diffPriceRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  345. <view style="display:flex;padding:40upx 20upx 20upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
  346. <block v-if="!$util.isEmpty(diffPriceList)">
  347. <view v-for="(item, index) in diffPriceList" :key="index"
  348. style="font-size:32upx;color:red;font-weight:bold;margin-top:10upx;">
  349. <text>{{item.name}}</text>
  350. <text style="margin-left:25upx;">系统售价 ¥{{item.price?parseFloat(item.price):0}}</text>
  351. <text style="margin-left:25upx;">您开价 ¥{{item.kdPrice?parseFloat(item.kdPrice):0}}</text>
  352. </view>
  353. </block>
  354. <view style="margin-top:20upx;font-size:28upx;font-weight:bold;">
  355. <view>以上花材,开单价和系统售价不一样,确认提交吗?</view>
  356. </view>
  357. <view style="text-align:center;margin-top:30upx;width:100%;">
  358. <button class="admin-button-com big default" @click="returnCheck()">返回修改</button>
  359. <button style="margin-left:20upx;" @click="forceCommit()" class="admin-button-com big blue">确认提交</button>
  360. </view>
  361. </view>
  362. </uni-popup>
  363. <!-- 配送时间选择弹框 -->
  364. <uni-popup ref="timePopup" type="bottom" background-color="#fff">
  365. <view class="time-picker-popup">
  366. <view class="popup-header">
  367. <text class="popup-title">选择配送时间</text>
  368. <text class="popup-close" @click="closeTimePopup">×</text>
  369. </view>
  370. <view class="time-sections">
  371. <!-- 小时选择 -->
  372. <view class="time-section">
  373. <view class="section-title">小时</view>
  374. <view class="hours-wrapper">
  375. <scroll-view
  376. scroll-y="true"
  377. class="hours-scroll"
  378. enhanced="true"
  379. show-scrollbar="true"
  380. >
  381. <view class="hours-buttons">
  382. <button
  383. v-for="(hour, index) in timeOptions[0]"
  384. :key="index"
  385. class="time-button"
  386. :class="{ active: selectedHour == hour }"
  387. @click="selectedHour = hour"
  388. >{{ hour }}</button>
  389. </view>
  390. </scroll-view>
  391. </view>
  392. </view>
  393. <!-- 分钟选择 -->
  394. <view class="time-section">
  395. <view class="section-title">分钟</view>
  396. <view class="minutes-wrapper">
  397. <scroll-view
  398. scroll-y="true"
  399. class="minutes-scroll"
  400. enhanced="true"
  401. show-scrollbar="true"
  402. >
  403. <view class="minutes-buttons">
  404. <button
  405. v-for="(minute, index) in timeOptions[1]"
  406. :key="index"
  407. class="time-button"
  408. :class="{ active: selectedMinute == minute }"
  409. @click="selectedMinute = minute"
  410. >{{ minute }}</button>
  411. </view>
  412. </scroll-view>
  413. </view>
  414. </view>
  415. </view>
  416. <!-- 操作按钮 -->
  417. <view class="popup-footer">
  418. <button class="footer-button default" @click="closeTimePopup">取消</button>
  419. <button class="footer-button blue" @click="confirmTime">确认</button>
  420. </view>
  421. </view>
  422. </uni-popup>
  423. <uni-popup ref="discountRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  424. <view class="discount-popup-container">
  425. <!-- 标题 -->
  426. <view class="discount-popup-title">选择打折</view>
  427. <!-- 快捷折扣按钮 -->
  428. <view class="discount-quick-buttons">
  429. <button
  430. v-for="(item, index) in discountList"
  431. :key="index"
  432. @click="setDiscount(item.value)"
  433. :class="['discount-quick-btn', { active: discountValue === item.value }]"
  434. >
  435. {{ item.name }}
  436. </button>
  437. </view>
  438. <!-- 分割线 -->
  439. <view class="discount-divider"></view>
  440. <!-- 自定义输入 -->
  441. <view class="discount-custom-section">
  442. <view class="discount-custom-label">自定义折扣</view>
  443. <view class="discount-custom-input-group">
  444. <input v-model="customDiscount" type="digit" placeholder="85折请填0.85" class="discount-custom-input" />
  445. <button class="admin-button-com middle blue" @click="setCustomDiscount">确认</button>
  446. </view>
  447. </view>
  448. <!-- 操作按钮 -->
  449. <view class="discount-action-buttons">
  450. <button class="admin-button-com middle default" @click="cancelDiscount" > 取消 </button>
  451. </view>
  452. </view>
  453. </uni-popup>
  454. <uni-popup ref="remindForwardRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  455. <view class="forward-popup-content">
  456. <view class="popup-title">
  457. 确认售后付款单
  458. </view>
  459. <view class="option-group">
  460. <view class="option-label">退货方式</view>
  461. <view class="button-group">
  462. <button @click="form.forwardStock = 1" class="admin-button-com big" :class="form.forwardStock == 1 ? 'blue' : 'default'">货不退回</button>
  463. <button @tap="form.forwardStock = 0" class="admin-button-com big" :class="form.forwardStock == 0? 'blue' : 'default'">货退回来</button>
  464. </view>
  465. </view>
  466. <view class="option-group">
  467. <view class="option-label">线下付款方式</view>
  468. <view class="button-group">
  469. <button @tap="forwardPayWay = 0" class="admin-button-com middle" :class="forwardPayWay == 0? 'blue' : 'default'">微信</button>
  470. <button @click="forwardPayWay = 1" class="admin-button-com middle" :class="forwardPayWay == 1 ? 'blue' : 'default'">支付宝</button>
  471. <button @tap="forwardPayWay = 4" class="admin-button-com middle" :class="forwardPayWay == 4? 'blue' : 'default'">现金</button>
  472. <button @click="forwardPayWay = 5" class="admin-button-com middle" :class="forwardPayWay == 5 ? 'blue' : 'default'">银行卡</button>
  473. </view>
  474. <view class="payment-notice">
  475. 请线下转账给客户
  476. </view>
  477. </view>
  478. <view class="popup-footer">
  479. <button class="admin-button-com big default" @click="cancelForward()">取消</button>
  480. <button class="admin-button-com big blue" @click="confirmForward()">确认</button>
  481. </view>
  482. </view>
  483. </uni-popup>
  484. <!-- 账单日期选择器蒙板 -->
  485. <view v-if="showPicker" class="date-picker-mask" @click="showPicker = false"></view>
  486. <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
  487. <!-- 配送日期选择器蒙板 -->
  488. <view v-if="reachDatePickerShow" class="date-picker-mask" @click="reachDatePickerShow = false"></view>
  489. <mx-date-picker :show="reachDatePickerShow" format="yyyy-mm-dd" type="date" :value="reachDatePickerValue" :show-tips="true" @confirm="confirmReachDatePicker" @cancel="reachDatePickerShow = false" />
  490. <!-- 取件时间选择器 -->
  491. <TimePicker ref="timePicker" :bottomOffset="80" @confirm="handleTimeConfirm" />
  492. </view>
  493. </view>
  494. </template>
  495. <script>
  496. import TuiListCell from "@/components/plugin/list-cell";
  497. import productMins from "@/mixins/product";
  498. import { createOrder } from "@/api/order/index";
  499. import { getAllStaff } from "@/api/shop-admin"
  500. import { mapActions, mapGetters } from "vuex";
  501. import { getCustomInfo} from "@/api/custom"
  502. import { quickOrderAllDeliveryQuotes } from '@/api/express/delivery'
  503. import { getAvailableHb } from "@/api/hb"
  504. import ModalModule from "@/components/plugin/modal"
  505. import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
  506. import TimePicker from '@/components/plugin/TimePicker';
  507. import WeightInput from '@/components/delivery-input/weight-input.vue';
  508. import RemarkInput from '@/components/delivery-input/remark-input.vue';
  509. import HbSelect from './components/hb-select.vue';
  510. import dayjs from 'dayjs';
  511. export default {
  512. name: "affirm",
  513. components: {
  514. TuiListCell,
  515. ModalModule,
  516. MxDatePicker,
  517. TimePicker,
  518. WeightInput,
  519. RemarkInput,
  520. HbSelect
  521. },
  522. mixins: [productMins],
  523. data () {
  524. return {
  525. defaultPickerDate:'',
  526. showPicker: false,
  527. reachDatePickerShow: false,
  528. reachDatePickerValue: '',
  529. discountList:[{name:'1折',value:0.1},{name:'2折',value:0.2},{name:'3折',value:0.3},{name:'4折',value:0.4},{name:'5折',value:0.5},{name:'6折',value:0.6},{name:'7折',value:0.7},{name:'8折',value:0.8},{name:'9折',value:0.9},{name:'不打折',value:1}],
  530. discountValue:0,
  531. customDiscount:'',
  532. autoLoad: false,
  533. staffList:[],
  534. payWayList:[{name:"线下微信",id:0},{name:"线下支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
  535. payWayindex:0,
  536. form: {
  537. shopId: "",
  538. shopName: "",
  539. receiveProvince: "",
  540. receiveCity: "",
  541. receiveFloor: "",
  542. receiveAddress: "",
  543. receiveLong: "",
  544. receiveLat: "",
  545. sendType: 1,
  546. sendSide: "2",
  547. sendDate: "",
  548. reachDate: "",
  549. reachPeriod: "12:00",
  550. historyDate:"",
  551. sendCost: "", //系统默认运费
  552. customSendCost: 0, //自设置的运费
  553. customId: "",
  554. packCost:"",
  555. product: "",
  556. remark:"",
  557. payWay:0,
  558. needPrint:2,
  559. getGoods:1,
  560. hasPay:0,
  561. getStaffName:'',
  562. dealPrice:0,
  563. forward:0,
  564. needWork:0,
  565. forwardStock:1,
  566. fromType:1,//门店来的订单
  567. reductionRule: 0,
  568. callErrand: 0, //现在呼叫 0 晚点呼叫 1
  569. weight: 1,
  570. deliveryRemark: '',
  571. },
  572. showCustomer: false,
  573. customInfo:{discount:1,balance:0},
  574. isUpdateAddress: false,
  575. customData: { bigCount: 0, smallCount: 0, userPrice: 0 },
  576. isAddModel:false,
  577. checkStock:true,
  578. xjData:{},
  579. xjDataInfo:{},
  580. modifyPrice:'',
  581. isScanEnv:false,
  582. calc:'add',
  583. diffPriceList:[],
  584. currentShop:{default:0},
  585. openIntraCity: 0,
  586. hcFreeKm: 0, //跑腿免费公里数
  587. hcMap: [], //花材满减规则
  588. hsFreeKm: 0, //花束免费公里数
  589. hsAddFee: 0, //花束满减规则
  590. deliveryQuotes: [], // 跑腿平台报价列表
  591. selectedDeliveryIndex: -1,
  592. selectedDeliveryData: null,
  593. showDistance: 0,
  594. forwardPayWay:0,//不影响原有的form.payWay方式,重新定义一个
  595. reduceStock:0,
  596. timeOptions: [['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],['00', '05', '10','15','20','25','30','35','40','45','50','55']],
  597. selectedHour: '12', // 选中的小时
  598. selectedMinute: '00', // 选中的分钟
  599. pickupTime: {
  600. label: '立即取件',
  601. value: dayjs().format('YYYY-MM-DD HH:mm'),
  602. },
  603. hbData:[], // 可用红包数据
  604. selectedHbId: null, // 选中的红包ID
  605. selectedHb: null, // 选中的红包对象
  606. //-------------
  607. // 重量输入防抖定时器
  608. weightDebounceTimer: null,
  609. };
  610. },
  611. onLoad (option) {
  612. this.option = option
  613. this.kdType = option.kdType
  614. let that = this
  615. this.initMerchantInfo().then((data) => {
  616. uni.setNavigationBarTitle({ title: data.name })
  617. that.currentShop = data.shopInfo
  618. that.openIntraCity = data.openIntraCity
  619. that.hcFreeKm = data.hcFreeKm
  620. try {
  621. that.hcMap = typeof data.hcMap === 'string' ? JSON.parse(data.hcMap) : data.hcMap
  622. } catch (e) {
  623. that.hcMap = []
  624. }
  625. that.hsFreeKm = data.hsFreeKm
  626. try {
  627. that.hsAddFee = data.hsAddFee
  628. } catch (e) {
  629. that.hsAddFee = 0
  630. }
  631. })
  632. if(Number(option.customId) > 0){
  633. this.form.customId = option.customId
  634. this.getCustomDetail();
  635. //用于混入product的已选中花材!!!!!
  636. this.selectJobId = option.customId
  637. this.selectJobType = 'bill'
  638. }
  639. //默认欠款是首选项
  640. this.form.hasPay = 0
  641. // 初始化支付方式索引
  642. this.payWayindex = 0
  643. // #ifdef APP-PLUS
  644. if(this.$util.isScanEnv()){
  645. this.isScanEnv = true
  646. }
  647. //#endif
  648. //如果是扣除库存方式开单,不显示售后付款选项
  649. this.reduceStock = this.option.reduceStock?this.option.reduceStock:0
  650. //如果扣除库存方法,付款方式默认选择挂账,这样方便提交
  651. if(this.reduceStock == 1){
  652. this.form.hasPay = 2
  653. }
  654. },
  655. onShow(){
  656. if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
  657. this.showCustomer = true;
  658. }
  659. //获取所有在职员工
  660. getAllStaff().then(res=>{
  661. if(res.code == 1){
  662. this.staffList = res.data.list
  663. }
  664. })
  665. //获取跑腿平台报价
  666. if(this.openIntraCity == 1 && this.form.sendType == 2){
  667. if(this.isUpdateAddress){
  668. this.getCustomDetail().then(() => {
  669. this.getDeliveryQuotes()
  670. });
  671. }else{
  672. this.getDeliveryQuotes()
  673. }
  674. }
  675. //获取可用红包数据
  676. this.getHbData()
  677. },
  678. onUnload(){
  679. uni.removeStorageSync('newClient')
  680. uni.$off('listenGetScanCode')
  681. // 页面卸载时清除定时器
  682. if (this.weightDebounceTimer) {
  683. clearTimeout(this.weightDebounceTimer);
  684. this.weightDebounceTimer = null;
  685. }
  686. },
  687. watch: {
  688. // 监听重量变化
  689. 'form.weight'(newVal) {
  690. // 清除之前的定时器
  691. if (this.weightDebounceTimer) {
  692. clearTimeout(this.weightDebounceTimer);
  693. this.weightDebounceTimer = null;
  694. }
  695. // 如果有运力列表且值变化了,清空运力列表
  696. if (this.deliveryQuotes.length > 0) {
  697. this.clearDeliveryList();
  698. }
  699. // 设置新的定时器,1秒后自动加载运力
  700. this.weightDebounceTimer = setTimeout(() => {
  701. // 只有当重量值有效时才自动加载
  702. if (newVal && Number(newVal) > 0 && this.form.sendType == 2) {
  703. this.handleLoadDelivery();
  704. }
  705. }, 1000);
  706. },
  707. // 监听取件时间变化
  708. pickupTime: {
  709. handler() {
  710. if (this.deliveryQuotes.length > 0) {
  711. this.clearDeliveryList();
  712. }
  713. if (this.form.sendType == 2) {
  714. this.getDeliveryQuotes();
  715. }
  716. },
  717. deep: true
  718. },
  719. // 监听备注变化
  720. 'form.deliveryRemark'() {
  721. if (this.deliveryQuotes.length > 0) {
  722. this.clearDeliveryList();
  723. }
  724. if (this.form.sendType == 2) {
  725. this.getDeliveryQuotes();
  726. }
  727. },
  728. systemPrice: {
  729. handler(val) {
  730. this.modifyPrice = val
  731. },
  732. immediate: true
  733. }
  734. },
  735. computed: {
  736. ...mapGetters(["getMerchantInfo", "getMyShopInfo", "getLoginInfo"]),
  737. // 计算不含红包的总价(含运费)
  738. preDiscountPrice() {
  739. let totalPrice = this.allPrice.toFixed(2)
  740. let finalPrice = Number(totalPrice)
  741. if(this.form.sendType == 2){
  742. const sendCost = Number(this.form.sendCost)
  743. if(this.form.reductionRule == 0){
  744. finalPrice = finalPrice + sendCost
  745. }else if(this.form.reductionRule == 1){
  746. if(this.isHcMapRule()){
  747. finalPrice = finalPrice + Number(this.form.customSendCost)
  748. }else{
  749. finalPrice = finalPrice + sendCost
  750. }
  751. }else if(this.form.reductionRule == 2){
  752. if(this.isHsMapRule()){
  753. finalPrice = finalPrice + Number(this.form.customSendCost)
  754. }else{
  755. finalPrice = finalPrice + sendCost
  756. }
  757. }
  758. }
  759. return parseFloat(finalPrice.toFixed(2))
  760. },
  761. // 是否有可用红包
  762. hasAvailableHb() {
  763. if (!this.hbData || this.hbData.length === 0) return false
  764. const price = this.preDiscountPrice
  765. return this.hbData.some(item => {
  766. const min = Number(item.minConsume) || 0
  767. return price >= min
  768. })
  769. },
  770. // 合计金额
  771. systemPrice(){
  772. let finalPrice = this.preDiscountPrice
  773. // 减去红包金额
  774. if(this.hasAvailableHb && this.selectedHb){
  775. finalPrice = finalPrice - Number(this.selectedHb.amount)
  776. }
  777. if(finalPrice < 0) finalPrice = 0
  778. return parseFloat(finalPrice.toFixed(2))
  779. },
  780. // labourCost(){
  781. // let cost = 0
  782. // if(Number(this.modifyPrice) > Number(this.systemPrice)){
  783. // cost = Number(this.modifyPrice) - Number(this.systemPrice)
  784. // cost = Number(cost).toFixed(2)
  785. // }
  786. // return cost
  787. // }
  788. },
  789. methods: {
  790. init () {},
  791. ...mapActions(["initMerchantInfo"]),
  792. checkMapRule(type){
  793. const distanceInMeters = Number(this.showDistance) || 0
  794. const freeKm = type === 'hc' ? this.hcFreeKm : this.hsFreeKm
  795. const freeKmInMeters = (Number(freeKm) || 0) * 1000
  796. if(distanceInMeters <= freeKmInMeters){
  797. console.log('满足免费公里数条件', type,distanceInMeters,freeKmInMeters)
  798. return true
  799. }
  800. let map = type === 'hc' ? this.hcMap : ''
  801. if(map && Array.isArray(map) && map.length > 0){
  802. const flowerCount = this.allCount.bigLength || 0
  803. const flowerPrice = this.allPrice || 0
  804. for(const rule of map){
  805. const ruleNum = Number(rule.num) || 0
  806. const rulePrice = Number(rule.price) || 0
  807. const ruleDistance = (Number(rule.distance) || 0) * 1000
  808. if(flowerCount >= ruleNum && flowerPrice >= rulePrice && distanceInMeters <= ruleDistance){
  809. console.log('满足满减条件',flowerCount,ruleNum,flowerPrice, rulePrice,distanceInMeters,ruleDistance)
  810. return true
  811. }
  812. }
  813. }else{
  814. const addFee = distanceInMeters - freeKmInMeters
  815. if(addFee > 0){
  816. //花束满减规则 -- 每超出1公里,加收 hsAddFee 元(不足1公里按1公里计算)
  817. const addFeePrice = Math.ceil(addFee / 1000) * this.hsAddFee
  818. console.log('addFeePrice---', addFeePrice)
  819. //this.form.sendCost = addFeePrice
  820. return false
  821. }
  822. return true
  823. }
  824. return false
  825. },
  826. isHcMapRule(){
  827. return this.checkMapRule('hc')
  828. },
  829. isHsMapRule(){
  830. return this.checkMapRule('hs')
  831. },
  832. changeReductionRule(rule) {
  833. this.form.reductionRule = rule;
  834. if(rule == 0){
  835. // 选中报价卡片
  836. this.form.sendCost = this.selectedDeliveryData.priceNumber
  837. }else if(rule == 1){
  838. if(this.isHcMapRule()){
  839. this.form.sendCost = this.selectedDeliveryData.priceNumber
  840. }else{
  841. this.form.sendCost = 0
  842. }
  843. }else if(rule == 2) {
  844. const distanceInMeters = Number(this.showDistance) || 0
  845. const freeKmInMeters = (Number(this.hsFreeKm) || 0) * 1000
  846. const diff = distanceInMeters - freeKmInMeters
  847. let addFeePrice = 0
  848. if(diff > 0){
  849. addFeePrice = Math.ceil(diff / 1000) * this.hsAddFee
  850. }
  851. this.form.sendCost = addFeePrice
  852. }
  853. },
  854. setSendType (type) {
  855. this.form.sendType = type
  856. if (type !== 2) {
  857. this.form.sendCost = ""
  858. // 切换到其他配送方式时清空报价数据
  859. this.deliveryQuotes = []
  860. this.selectedDeliveryIndex = -1
  861. this.selectedDeliveryData = null
  862. } else {
  863. // 如果切换回跑腿,且之前有获取过但被清空了,可能需要重新获取,或者保持现状等待用户操作
  864. // 这里根据 affirmGhs 的逻辑,如果在此处重新获取,可能需要在 onShow 或其他地方触发
  865. if(this.openIntraCity == 1 && type == 2){
  866. this.getDeliveryQuotes()
  867. }
  868. }
  869. },
  870. bindHistoryDateChange(){
  871. this.showPicker = true
  872. },
  873. confirmPicker(e) {
  874. this.form.historyDate = e.value
  875. this.showPicker = false
  876. },
  877. bindReachDateChange(){
  878. this.reachDatePickerShow = true
  879. this.reachDatePickerValue = this.form.reachDate
  880. },
  881. confirmReachDatePicker(e) {
  882. this.form.reachDate = e.value
  883. this.reachDatePickerShow = false
  884. },
  885. bindDateChange(e){
  886. let date = e.detail.value
  887. this.form.reachDate = date
  888. },
  889. bindTimeChange(event){
  890. let val = event.detail.value
  891. let before = Number(val[0])
  892. let after = Number(val[1])
  893. let timeOptions = this.timeOptions
  894. this.form.reachPeriod = timeOptions[0][before]+':'+timeOptions[1][after]
  895. },
  896. openTimePopup() {
  897. // 初始化为当前选中的时间
  898. const [hour, minute] = this.form.reachPeriod.split(':')
  899. this.selectedHour = hour
  900. this.selectedMinute = minute
  901. this.$refs.timePopup.open()
  902. },
  903. // 关闭时间选择弹框
  904. closeTimePopup() {
  905. this.$refs.timePopup.close()
  906. },
  907. // 确认时间选择
  908. confirmTime() {
  909. this.form.reachPeriod = `${this.selectedHour}:${this.selectedMinute}`
  910. this.closeTimePopup()
  911. },
  912. showDiscount(){
  913. this.$refs.discountRef.open('center')
  914. },
  915. setDiscount(num){
  916. this.discountValue = Number(num)
  917. let price = Number(this.systemPrice)*Number(num)
  918. price = parseFloat(price.toFixed(2))
  919. this.modifyPrice = price
  920. this.customDiscount = ''
  921. this.$refs.discountRef.close()
  922. },
  923. setCustomDiscount(){
  924. const value = parseFloat(this.customDiscount)
  925. if(isNaN(value) || value < 0 || value > 1){
  926. this.$msg('请输入0到1之间的有效折扣值')
  927. return
  928. }
  929. this.setDiscount(value)
  930. },
  931. cancelDiscount(){
  932. this.customDiscount = ''
  933. this.$refs.discountRef.close()
  934. },
  935. beginScan(){
  936. console.log('beginScan')
  937. let that = this
  938. uni.scanCode({
  939. scanType: ['barCode'],
  940. success: function (res) {
  941. that.takeItem(res.result)
  942. }
  943. })
  944. },
  945. changeGet(){
  946. this.calc = this.calc == 'add' ? 'sub' : 'add'
  947. },
  948. reduceItemFn(item) {
  949. if(item && item.variety == 1 && this.selectJobType == 'bill'){
  950. this.$msg('多颜色花材,请返回修改')
  951. return false
  952. }
  953. this.kdType = 'HIT';
  954. this.replaceItemFn(item,0,'sub')
  955. },
  956. addItemFn (item) {
  957. if(item && item.variety == 1 && this.selectJobType == 'bill'){
  958. this.$msg('多颜色花材,请返回修改')
  959. return false
  960. }
  961. this.kdType = 'HIT';
  962. this.replaceItemFn(item,0,'add')
  963. },
  964. kdChange(e){
  965. let index = e.detail.value
  966. if(!this.$util.isEmpty(this.staffList)){
  967. if(this.staffList[index]){
  968. this.form.getStaffName = this.staffList[index].name
  969. this.form.getStaffId = this.staffList[index].id
  970. }
  971. }
  972. },
  973. payWayChange(e){
  974. let index = e.detail.value
  975. this.payWayindex = index
  976. this.form.payWay = this.payWayList[index].id
  977. },
  978. // 根据支付方式ID更新索引
  979. updatePayWayIndex(){
  980. const index = this.payWayList.findIndex(item => item.id === this.form.payWay)
  981. this.payWayindex = index >= 0 ? index : 0
  982. },
  983. setPayWay(payWay){
  984. this.form.payWay = payWay
  985. this.updatePayWayIndex()
  986. },
  987. forceCommit(){
  988. this.form.dealPrice = 1
  989. this.formSubmit()
  990. },
  991. showForward(){
  992. this.$refs.remindForwardRef.open('center')
  993. },
  994. cancelForward(){
  995. this.$refs.remindForwardRef.close()
  996. },
  997. confirmForward(){
  998. //售后付款单,只能走线下模式
  999. this.form.hasPay = 1
  1000. this.form.payWay = this.forwardPayWay
  1001. this.submitOrder()
  1002. },
  1003. confirmSubmit(){
  1004. if(this.form.forward == 1){
  1005. this.showForward()
  1006. }else{
  1007. this.submitOrder()
  1008. }
  1009. },
  1010. submitOrder() {
  1011. let self = this;
  1012. let name = '确认提交'
  1013. if(this.form.hasPay == 0){
  1014. name = '确认扫码?'
  1015. }else if(this.form.hasPay == 1){
  1016. name = '确认线下付款?'
  1017. if(this.form.forward == 1){
  1018. name = '确认开售后付款单?'
  1019. }
  1020. }else if(this.form.hasPay == 2){
  1021. name = '确认挂账?'
  1022. }else if(this.form.hasPay == 4){
  1023. name = '确认余额支付?'
  1024. }else{
  1025. name = '确认提交'
  1026. }
  1027. self.$util.confirmModal({content:name},() => {
  1028. self.formSubmit()
  1029. })
  1030. },
  1031. validateForm() {
  1032. if(Number(this.modifyPrice) <= 0){
  1033. this.$msg('收款金额必须大于0');
  1034. return false
  1035. }
  1036. return true
  1037. },
  1038. async formSubmit () {
  1039. if(!this.validateForm()) return;
  1040. let that = this
  1041. let formData = this.form;
  1042. const product = this.selectList.map((ele) => {
  1043. let unitType = Number(ele.bigCount)>0 ? 0 : 1
  1044. let num = Number(ele.bigCount)>0 ? Number(ele.bigCount) : Number(ele.smallCount)
  1045. let unitPrice = ele.userPrice ? ele.userPrice : 0
  1046. return {productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount, classId: ele.classId,
  1047. itemId: ele.itemId, unitPrice:unitPrice,remark:ele.remark,property:ele.property,unitType:unitType,num:num}
  1048. }
  1049. );
  1050. formData.product = JSON.stringify(product);
  1051. if (!this.getMerchantInfo) {
  1052. await this.initMerchantInfo();
  1053. }
  1054. formData.shopId = this.getMerchantInfo.id;
  1055. let params = {...formData,modifyPrice: this.modifyPrice}; //labourCost:this.labourCost
  1056. // 如果选择了跑腿配送并且有选中的平台数据,则添加配送平台信息
  1057. if (this.form.sendType == 2 && this.selectedDeliveryData) {
  1058. params.deliveryPlatform = this.selectedDeliveryData.en_name // 平台名称
  1059. params.deliveryPrice = this.selectedDeliveryData.priceNumber // 报价金额
  1060. params.deliveryDistance = this.showDistance // 配送距离
  1061. params.deliveryBracketContent = this.selectedDeliveryData.bracketContent // 配送平台括号里的内容
  1062. params.deliveryAllParams = this.selectedDeliveryData; // 配送平台所有参数
  1063. if(this.form.callErrand == 1){
  1064. params.pickupTime = this.pickupTime.value
  1065. }
  1066. }
  1067. if(this.form.callErrand == 1){
  1068. if(this.form.sendType == 2 && this.form.hasPay == 0){
  1069. this.$msg('待付款,暂不支持马上发跑腿')
  1070. return false
  1071. }
  1072. if (this.$util.isEmpty(this.customInfo.long) || this.$util.isEmpty(this.customInfo.lat) || this.$util.isEmpty(this.customInfo.address)) {
  1073. this.$msg('客户地址不完整,不支持马上发跑腿')
  1074. return false
  1075. }
  1076. }
  1077. // 添加红包ID
  1078. if(this.hasAvailableHb && this.selectedHbId){
  1079. params.hbId = this.selectedHbId
  1080. params.hbAmount = this.selectedHb.amount
  1081. }
  1082. //多颜色
  1083. let xj = uni.getStorageSync("xj"+this.option.customId)
  1084. //orderType 开单类型,1商品开单 2花材开单
  1085. params = {...params,xj:JSON.stringify(xj),orderType:2}
  1086. //扣减库存
  1087. let orderId = this.option.orderId ? this.option.orderId : 0
  1088. let book = this.option.book ? this.option.book : 0
  1089. let reduceStock = this.option.reduceStock?this.option.reduceStock:0
  1090. params = {...params,orderId:orderId,book:book,reduceStock:reduceStock,version:3}
  1091. //console.log(params)
  1092. uni.showLoading({mask:true})
  1093. createOrder(params).then((res) => {
  1094. uni.hideLoading()
  1095. if(res.code == 1){
  1096. if(res.data.respondType && res.data.respondType == 'priceError'){
  1097. that.diffPriceList = res.data.diff
  1098. that.$refs.diffPriceRef.open('bottom')
  1099. return
  1100. }
  1101. this.removeFromSaveDirect()
  1102. if(res.data && res.data.id){
  1103. const {data: { id, orderSn,actPrice }} = res;
  1104. if(this.form.hasPay == 0){
  1105. this.$util.pageTo({ url: '/admin/billing/toPay',type:2,query: {orderId:id,orderSn:orderSn,actPrice:actPrice}})
  1106. }else{
  1107. if(this.form.forward == 1){
  1108. this.$util.pageTo({ url: '/admin/refund/shPayRemind?orderId='+id,type:2})
  1109. }else{
  1110. this.$util.pageTo({ url: '/admin/billing/result?orderId='+id,type:2})
  1111. }
  1112. }
  1113. }else{
  1114. this.$msg('提交失败')
  1115. }
  1116. }
  1117. })
  1118. },
  1119. returnCheck(){
  1120. this.$refs.diffPriceRef.close()
  1121. },
  1122. gobackEvent () {
  1123. let customId = this.option.customId ? this.option.customId : 0
  1124. let customName = this.option.customName ? this.option.customName : ''
  1125. let reduceStock = this.option.reduceStock?this.option.reduceStock:0
  1126. let orderId = this.option.orderId ? this.option.orderId : 0
  1127. let book = this.option.book ? this.option.book : 0
  1128. let fromType = this.option.fromType ? this.option.fromType : 'item'
  1129. if(fromType == 'item'){
  1130. this.$util.pageTo({url: '/admin/billing/index2?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
  1131. }else{
  1132. this.$util.pageTo({url: '/admin/billing/hs?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
  1133. }
  1134. },
  1135. getDeliveryQuotes(){
  1136. //如果客户地址缺少经纬度或地址,任何一个,则不要请求后端询价接口
  1137. if (this.$util.isEmpty(this.customInfo.long) || this.$util.isEmpty(this.customInfo.lat) || this.$util.isEmpty(this.customInfo.address)) {
  1138. return;
  1139. }
  1140. this.deliveryQuotes = []
  1141. this.selectedDeliveryIndex = -1
  1142. this.selectedDeliveryData = null
  1143. quickOrderAllDeliveryQuotes({
  1144. totalPrice: this.allPrice,
  1145. weight: this.form.weight,
  1146. remark: this.form.deliveryRemark,
  1147. customId: this.option.customId,
  1148. pickupTime: this.pickupTime.value,
  1149. }).then(res=>{
  1150. if(res.code == 1 && res.data && res.data.deliveryList){
  1151. // 处理报价数据
  1152. this.deliveryQuotes = res.data.deliveryList
  1153. .filter(item => item.isAble !== false)
  1154. .map(item => {
  1155. // 价格从分转换为元
  1156. const price = item.price ? (item.price / 100).toFixed(1) : '0.0'
  1157. // 提取平台名称(去掉括号内的内容)
  1158. let displayName = item.name || ''
  1159. let bracketContent = ''
  1160. if (displayName && displayName.indexOf('(') !== -1) {
  1161. const parts = displayName.split('(');
  1162. if(parts.length > 1) {
  1163. displayName = parts[0].trim();
  1164. bracketContent = parts[1].replace(')', '');
  1165. }
  1166. }
  1167. //滴滴特殊处理,括号里的内容作为类型
  1168. if(item.en_name == 'didi' && bracketContent != ''){
  1169. item.type = bracketContent
  1170. }
  1171. return {
  1172. ...item,
  1173. displayName: displayName,
  1174. priceText: price,
  1175. priceNumber: parseFloat(price),
  1176. bracketContent: bracketContent
  1177. }
  1178. })
  1179. // 自动选中第一个可用的报价
  1180. const firstAvailableIndex = this.deliveryQuotes.findIndex(item => item.isAble)
  1181. if (firstAvailableIndex !== -1) {
  1182. this.selectDelivery(this.deliveryQuotes[firstAvailableIndex], firstAvailableIndex)
  1183. }
  1184. }else{
  1185. uni.showToast({ title: '暂无跑腿可用', icon: 'none' })
  1186. }
  1187. }).catch(err=>{
  1188. this.$msg('获取跑腿平台报价失败')
  1189. console.log('获取跑腿平台报价失败:', err)
  1190. this.deliveryQuotes = []
  1191. })
  1192. },
  1193. // 选择跑腿平台
  1194. selectDelivery(item, index) {
  1195. this.selectedDeliveryIndex = index
  1196. this.selectedDeliveryData = item
  1197. this.form.sendCost = item.priceNumber
  1198. this.showDistance = item.distance || 0
  1199. },
  1200. openTimePicker() {
  1201. this.$refs.timePicker.open();
  1202. },
  1203. handleTimeConfirm(time) {
  1204. this.pickupTime = time;
  1205. },
  1206. getCustomDetail(){
  1207. let that = this
  1208. return getCustomInfo({ id: that.option.customId }).then(res => {
  1209. that.form.customName = res.data.custom.name
  1210. that.customInfo = res.data.custom
  1211. that.$forceUpdate()
  1212. if(Number(that.customInfo.balance)>Number(that.modifyPrice) && that.form.hasPay!=4){
  1213. //客户余额充足,自动切换使用余额
  1214. that.form.hasPay = 4
  1215. }
  1216. })
  1217. },
  1218. updateCustomAddress(){
  1219. this.isUpdateAddress = true;
  1220. this.$util.pageTo({ url: '/admin/member/modify?id='+this.customInfo.id+'&name='+this.customInfo.name })
  1221. },
  1222. handleLoadDelivery() {
  1223. // 校验重量是否填写
  1224. if (!this.form.weight || Number(this.form .weight) <= 0) {
  1225. this.$msg('请先填写货物重量');
  1226. return;
  1227. }
  1228. // 执行加载运力
  1229. this.getDeliveryQuotes();
  1230. },
  1231. // 清空运力列表
  1232. clearDeliveryList() {
  1233. this.deliveryQuotes = [];
  1234. this.selectedDeliveryIndex = -1;
  1235. this.selectedDeliveryData = null;
  1236. },
  1237. getHbData(){
  1238. getAvailableHb({customId:this.option.customId, shopId:this.currentShop.id}).then(res=>{
  1239. if(res.code == 1){
  1240. this.hbData = res.data
  1241. }
  1242. })
  1243. }
  1244. }
  1245. };
  1246. </script>
  1247. <style lang="scss" scoped>
  1248. .discount-quick-btn {
  1249. width: 120upx;
  1250. height: 120upx;
  1251. border-radius: 12upx;
  1252. border: 2upx solid #ddd;
  1253. background-color: #f9f9f9;
  1254. font-size: 32upx;
  1255. font-weight: 500;
  1256. color: #333;
  1257. display: flex;
  1258. align-items: center;
  1259. justify-content: center;
  1260. transition: all 0.2s ease;
  1261. padding: 0;
  1262. line-height: 1;
  1263. white-space: nowrap;
  1264. &.active {
  1265. border-color: #3385ff;
  1266. background-color: #3385ff;
  1267. color: #fff;
  1268. }
  1269. }
  1270. .discount-popup-container {
  1271. width: 600upx;
  1272. padding: 30upx;
  1273. box-sizing: border-box;
  1274. }
  1275. .discount-popup-title {
  1276. font-size: 32upx;
  1277. font-weight: bold;
  1278. margin-bottom: 30upx;
  1279. text-align: center;
  1280. color: #333;
  1281. }
  1282. .discount-quick-buttons {
  1283. display: flex;
  1284. flex-wrap: wrap;
  1285. justify-content: center;
  1286. gap: 15upx;
  1287. margin-bottom: 30upx;
  1288. }
  1289. .discount-divider {
  1290. height: 1upx;
  1291. background-color: #f0f0f0;
  1292. margin: 20upx 0;
  1293. }
  1294. .discount-custom-section {
  1295. margin-bottom: 30upx;
  1296. }
  1297. .discount-custom-label {
  1298. font-size: 28upx;
  1299. font-weight: 500;
  1300. margin-bottom: 15upx;
  1301. color: #333;
  1302. }
  1303. .discount-custom-input-group {
  1304. display: flex;
  1305. gap: 10upx;
  1306. align-items: center;
  1307. }
  1308. .discount-custom-input {
  1309. flex: 1;
  1310. border: 1upx solid #ddd;
  1311. border-radius: 8upx;
  1312. padding: 12upx;
  1313. font-size: 28upx;
  1314. box-sizing: border-box;
  1315. min-height: 70upx;
  1316. line-height: 45upx;
  1317. }
  1318. .discount-action-buttons {
  1319. display: flex;
  1320. gap: 15upx;
  1321. justify-content: center;
  1322. }
  1323. .admin-button-com {
  1324. margin-right: 30upx;
  1325. &.active {
  1326. background-color: #09C567 !important;
  1327. color: #fff !important;
  1328. border: 1upx solid #09C567 !important;
  1329. }
  1330. }
  1331. .payment-buttons {
  1332. display: flex;
  1333. flex-direction: column;
  1334. gap: 20upx;
  1335. width: 100%;
  1336. .button-row {
  1337. display: flex;
  1338. justify-content: flex-start;
  1339. gap: 30upx;
  1340. .admin-button-com {
  1341. flex: 0 0 180upx;
  1342. margin-right: 0;
  1343. }
  1344. }
  1345. }
  1346. .affirm-page {
  1347. position: relative;
  1348. height: 100%;
  1349. display: flex;
  1350. flex-direction: column;
  1351. .affirm-view {
  1352. flex: 1;
  1353. margin-bottom:90upx;
  1354. padding: 20upx;
  1355. background-color: #f0f2f6;
  1356. .commodity-view {
  1357. display: flex;
  1358. flex-direction: column;
  1359. .commodity-list {
  1360. padding: 20upx;
  1361. .commodity-item {
  1362. display: flex;
  1363. margin-bottom: 20upx;
  1364. .item-icon {
  1365. flex-shrink: 0;
  1366. width: 140upx;
  1367. height: 140upx;
  1368. }
  1369. .item-info {
  1370. display: flex;
  1371. flex-direction: column;
  1372. justify-content: center;
  1373. flex: 1;
  1374. margin-left: 20upx;
  1375. .info-line {
  1376. margin-bottom: 20upx;
  1377. display: flex;
  1378. justify-content: space-between;
  1379. align-items: flex-end;
  1380. .item-name {
  1381. color: #333333;
  1382. font-size: 28upx;
  1383. font-weight:bold;
  1384. .show-color{
  1385. display:inline-block;
  1386. width:25upx;
  1387. height:25upx;
  1388. background-color:rgb(9, 199, 9);
  1389. border-radius:15upx;
  1390. border:none;
  1391. margin-left:16upx;
  1392. }
  1393. }
  1394. .item-price {
  1395. color: #333;
  1396. font-size: 22upx;
  1397. .price {
  1398. font-size: 32upx;
  1399. font-weight: bold;
  1400. }
  1401. }
  1402. }
  1403. & .open-bx {
  1404. align-items: center;
  1405. & .iconfont {
  1406. color: #3385ff;
  1407. font-size: 50upx;
  1408. }
  1409. & > .num {
  1410. display: inline-block;
  1411. width: 120upx;
  1412. height:45upx;
  1413. text-align:center;
  1414. margin: 0 8upx;
  1415. color: #868686;
  1416. border-radius: 22upx;
  1417. background-color: #f5f5f5;
  1418. padding: 3upx 0;
  1419. font-size: 25upx;
  1420. }
  1421. }
  1422. }
  1423. }
  1424. }
  1425. .summary-bar {
  1426. padding: 0 20upx;
  1427. height: 90upx;
  1428. display: flex;
  1429. align-items: center;
  1430. justify-content: space-between;
  1431. border-top: 1upx solid #eeeeee;
  1432. .operate-view {
  1433. display: flex;
  1434. align-items: center;
  1435. color: #3385ff;
  1436. font-size: 26upx;
  1437. .iconfont {
  1438. margin-right: 20upx;
  1439. font-size: 40upx;
  1440. }
  1441. }
  1442. .describe-view {
  1443. display: flex;
  1444. align-items: center;
  1445. color: #333;
  1446. font-size: 28upx;
  1447. font-weight:bold;
  1448. .price {
  1449. margin-left:8upx;
  1450. color:red;
  1451. }
  1452. }
  1453. }
  1454. }
  1455. .module-com {
  1456. background-color: #fff;
  1457. margin-bottom: 20upx;
  1458. border-radius: 10upx;
  1459. overflow: hidden;
  1460. }
  1461. }
  1462. .under-bar {
  1463. z-index:99999;
  1464. display: flex;
  1465. justify-content: space-between;
  1466. align-items: center;
  1467. padding: 0 10upx;
  1468. position: fixed;
  1469. bottom:0;
  1470. @media screen and (max-width: 1100px) {
  1471. width: 100%;
  1472. }
  1473. height: 100upx;
  1474. background-color: #fff;
  1475. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  1476. .price-view {
  1477. display: flex;
  1478. align-items: center;
  1479. font-size: 24upx;
  1480. .price-title {
  1481. color: #333;
  1482. }
  1483. .price-number {
  1484. margin: 0 8upx;
  1485. color: #ff2842;
  1486. .large {
  1487. font-size:34upx;
  1488. font-weight:bold;
  1489. }
  1490. }
  1491. }
  1492. .admin-button-com {
  1493. width: 200upx;
  1494. }
  1495. }
  1496. .select-cmd_bx {
  1497. & .kc {
  1498. color: #999999;
  1499. font-size: 28upx;
  1500. font-weight: 400;
  1501. margin-bottom: 40upx;
  1502. text-align: center;
  1503. margin-top: 30upx;
  1504. .unit_price{
  1505. padding-right:25upx;
  1506. }
  1507. }
  1508. & .num_bx {
  1509. display: flex;
  1510. align-items: center;
  1511. margin-bottom: 40upx;
  1512. & > input {
  1513. width: 212upx;
  1514. height: 80upx;
  1515. border: 1upx solid #dddddd;
  1516. border-radius: 4upx;
  1517. text-align: center;
  1518. margin-right: 24upx;
  1519. font-size: 40upx;
  1520. }
  1521. }
  1522. }
  1523. }
  1524. .class-popup-style{
  1525. z-index:99999;
  1526. }
  1527. .forward-popup-content {
  1528. padding: 40upx;
  1529. min-width: 700upx;
  1530. .popup-title {
  1531. font-size: 34upx;
  1532. font-weight: bold;
  1533. color: #333;
  1534. text-align: center;
  1535. margin-bottom: 40upx;
  1536. line-height: 1.4;
  1537. }
  1538. .option-group {
  1539. margin-bottom: 40upx;
  1540. .option-label {
  1541. font-size: 28upx;
  1542. color: #666;
  1543. margin-bottom: 20upx;
  1544. font-weight: 500;
  1545. }
  1546. .button-group {
  1547. display: flex;
  1548. flex-wrap: wrap;
  1549. justify-content: space-between;
  1550. gap: 15upx;
  1551. .admin-button-com {
  1552. margin-right: 0;
  1553. flex: 1;
  1554. min-width: 140upx;
  1555. &:first-child {
  1556. margin-left: 0;
  1557. }
  1558. &:last-child {
  1559. margin-right: 0;
  1560. }
  1561. }
  1562. }
  1563. .payment-notice {
  1564. text-align: center;
  1565. font-size: 34upx;
  1566. margin-top: 30upx;
  1567. padding: 15upx 20upx;
  1568. background-color: #f5f5f5;
  1569. border-radius: 8upx;
  1570. }
  1571. }
  1572. .popup-footer {
  1573. display: flex;
  1574. justify-content: center;
  1575. gap: 60upx;
  1576. margin-top: 40upx;
  1577. padding-top: 30upx;
  1578. border-top: 1upx solid #eee;
  1579. .admin-button-com {
  1580. margin-right: 0;
  1581. min-width: 160upx;
  1582. }
  1583. }
  1584. }
  1585. .remark-class{
  1586. z-index:0;
  1587. color:#CCCCCC;
  1588. }
  1589. .warning-price{
  1590. color:red;
  1591. }
  1592. /* 日期选择器蒙板 */
  1593. .date-picker-mask {
  1594. position: fixed;
  1595. top: 0;
  1596. left: 0;
  1597. right: 0;
  1598. bottom: 0;
  1599. background-color: rgba(0, 0, 0, 0.5);
  1600. z-index: 99;
  1601. animation: fadeIn 0.3s ease-in-out;
  1602. }
  1603. @keyframes fadeIn {
  1604. from {
  1605. opacity: 0;
  1606. }
  1607. to {
  1608. opacity: 1;
  1609. }
  1610. }
  1611. @keyframes fadeOut {
  1612. from {
  1613. opacity: 1;
  1614. }
  1615. to {
  1616. opacity: 0;
  1617. }
  1618. }
  1619. /* 时间选择弹窗样式 */
  1620. .time-picker-popup {
  1621. width: 100%;
  1622. background: #fff;
  1623. border-radius: 20upx 20upx 0 0;
  1624. display: flex;
  1625. flex-direction: column;
  1626. max-height: 99vh;
  1627. padding:0 0 110upx 0;
  1628. }
  1629. .popup-header {
  1630. display: flex;
  1631. justify-content: space-between;
  1632. align-items: center;
  1633. margin-bottom: 0;
  1634. padding: 30upx 20upx 20upx 20upx;
  1635. border-bottom: 2upx solid #f0f2f6;
  1636. flex-shrink: 0;
  1637. }
  1638. .popup-title {
  1639. font-size: 36upx;
  1640. color: #333;
  1641. font-weight: bold;
  1642. }
  1643. .popup-close {
  1644. font-size: 48upx;
  1645. color: #999;
  1646. line-height: 1;
  1647. cursor: pointer;
  1648. }
  1649. .time-sections {
  1650. display: flex;
  1651. flex-direction: column;
  1652. gap: 20upx;
  1653. margin-bottom: 0;
  1654. flex: 1;
  1655. padding: 20upx 20upx 0 20upx;
  1656. overflow: hidden;
  1657. }
  1658. .time-section {
  1659. flex: 1;
  1660. display: flex;
  1661. flex-direction: column;
  1662. min-height: 200upx;
  1663. .section-title {
  1664. font-size: 28upx;
  1665. color: #333;
  1666. font-weight: 600;
  1667. margin-bottom: 12upx;
  1668. text-align: left;
  1669. }
  1670. }
  1671. .hours-wrapper {
  1672. width: 100%;
  1673. flex: 1;
  1674. background: #f8f9fa;
  1675. border: 2upx solid #e9ecef;
  1676. border-radius: 8upx;
  1677. position: relative;
  1678. overflow: hidden;
  1679. display: flex;
  1680. flex-direction: column;
  1681. min-height: 150upx;
  1682. }
  1683. .minutes-wrapper {
  1684. width: 100%;
  1685. flex: 1;
  1686. background: #f8f9fa;
  1687. border: 2upx solid #e9ecef;
  1688. border-radius: 8upx;
  1689. position: relative;
  1690. overflow: hidden;
  1691. display: flex;
  1692. flex-direction: column;
  1693. min-height: 150upx;
  1694. }
  1695. .hours-scroll,
  1696. .minutes-scroll {
  1697. width: 100%;
  1698. height: 100%;
  1699. padding: 8upx;
  1700. box-sizing: border-box;
  1701. }
  1702. .hours-buttons,
  1703. .minutes-buttons {
  1704. display: flex;
  1705. flex-wrap: wrap;
  1706. gap: 8upx;
  1707. justify-content: flex-start;
  1708. }
  1709. .time-button {
  1710. width: calc(25% - 6upx);
  1711. height: 73upx;
  1712. display: flex;
  1713. align-items: center;
  1714. justify-content: center;
  1715. background: #ffffff;
  1716. border: 2upx solid #e9ecef;
  1717. border-radius: 6upx;
  1718. font-size: 26upx;
  1719. color: #666;
  1720. box-sizing: border-box;
  1721. transition: all 0.2s;
  1722. flex-shrink: 0;
  1723. &.active {
  1724. background: #3385FF;
  1725. border-color: #3385FF;
  1726. color: #fff;
  1727. font-weight: 500;
  1728. }
  1729. &:active {
  1730. background: #e8f5ff;
  1731. }
  1732. }
  1733. .popup-footer {
  1734. display: flex;
  1735. gap: 12upx;
  1736. padding: 15upx 20upx 20upx 20upx;
  1737. border-top: 2upx solid #f0f2f6;
  1738. flex-shrink: 0;
  1739. .footer-button {
  1740. flex: 1;
  1741. height: 93upx;
  1742. display: flex;
  1743. align-items: center;
  1744. justify-content: center;
  1745. border: none;
  1746. border-radius: 8upx;
  1747. font-size: 28upx;
  1748. font-weight: 500;
  1749. transition: all 0.2s;
  1750. &.default {
  1751. background: #f5f5f5;
  1752. color: #666;
  1753. }
  1754. &.blue {
  1755. background: #3385FF;
  1756. color: #fff;
  1757. }
  1758. &:active {
  1759. opacity: 0.8;
  1760. }
  1761. }
  1762. }
  1763. /* 跑腿平台报价样式 */
  1764. .delivery-quotes-container {
  1765. width: 100%;
  1766. margin-top: 10upx;
  1767. }
  1768. .delivery-quotes-scroll {
  1769. /* 滚动已移除 */
  1770. }
  1771. .delivery-quotes-grid {
  1772. display: flex;
  1773. flex-wrap: wrap;
  1774. gap: 10upx;
  1775. padding: 0;
  1776. width: 100%;
  1777. }
  1778. .delivery-quote-item {
  1779. display: flex;
  1780. flex-direction: column;
  1781. align-items: center;
  1782. justify-content: center;
  1783. flex: 0 0 calc(33% - 7upx);
  1784. width: calc(33% - 7upx);
  1785. min-height: 140upx;
  1786. padding: 12upx 10upx;
  1787. margin-bottom: 5upx;
  1788. background: #FFFFFF;
  1789. border: 2upx solid #DDDDDD;
  1790. border-radius: 8upx;
  1791. box-sizing: border-box;
  1792. transition: all 0.3s;
  1793. // 当只有1-2项时使用固定宽度
  1794. &.fixed-width {
  1795. flex: 0 0 220upx;
  1796. width: 220upx;
  1797. }
  1798. .platform-name {
  1799. font-size: 24upx;
  1800. color: #333;
  1801. font-weight: bold;
  1802. margin-bottom: 8upx;
  1803. text-align: center;
  1804. line-height: 1.3;
  1805. max-width: 100%;
  1806. overflow: hidden;
  1807. text-overflow: ellipsis;
  1808. display: -webkit-box;
  1809. -webkit-line-clamp: 2;
  1810. line-clamp: 2;
  1811. -webkit-box-orient: vertical;
  1812. word-break: break-all;
  1813. }
  1814. .platform-price {
  1815. font-size: 25upx;
  1816. color: #333;
  1817. font-weight: bold;
  1818. margin-bottom: 4upx;
  1819. }
  1820. .platform-type {
  1821. font-size: 19upx;
  1822. color: #868686;
  1823. margin-top: 4upx;
  1824. text-align: center;
  1825. line-height: 1.3;
  1826. max-width: 100%;
  1827. overflow: hidden;
  1828. text-overflow: ellipsis;
  1829. display: -webkit-box;
  1830. -webkit-line-clamp: 2;
  1831. line-clamp: 2;
  1832. -webkit-box-orient: vertical;
  1833. word-break: break-all;
  1834. }
  1835. // 选中状态
  1836. &.active {
  1837. background: #09C567;
  1838. border-color: #09C567;
  1839. .platform-name,
  1840. .platform-price {
  1841. color: #FFFFFF;
  1842. }
  1843. .platform-type {
  1844. color: rgba(255, 255, 255, 0.85);
  1845. }
  1846. }
  1847. // 不可用状态
  1848. &.disabled {
  1849. opacity: 0.5;
  1850. background: #F5F5F5;
  1851. .platform-name,
  1852. .platform-price,
  1853. .platform-type {
  1854. color: #CCCCCC;
  1855. }
  1856. }
  1857. }
  1858. /* 跑腿费价格样式 */
  1859. .delivery-price-normal {
  1860. color: #3385FF;
  1861. }
  1862. .delivery-price-free {
  1863. color: #999;
  1864. text-decoration: line-through;
  1865. }
  1866. .free-delivery-tag {
  1867. color: #3385FF;
  1868. margin-left: 5upx;
  1869. }
  1870. .delivery-policy-link {
  1871. color: rgb(201, 52, 52);
  1872. font-size: 30upx;
  1873. margin-left: 30upx;
  1874. font-weight:bold;
  1875. text-decoration: underline;
  1876. }
  1877. .policy-icon {
  1878. font-size: 28upx;
  1879. margin-left: 4upx;
  1880. }
  1881. .policy-popup-content {
  1882. width: 600upx;
  1883. background-color: #fff;
  1884. border-radius: 20upx;
  1885. padding: 30upx;
  1886. display: flex;
  1887. flex-direction: column;
  1888. align-items: center;
  1889. }
  1890. .policy-title {
  1891. font-size: 34upx;
  1892. font-weight: bold;
  1893. color: #333;
  1894. margin-bottom: 30upx;
  1895. }
  1896. .policy-scroll {
  1897. width: 100%;
  1898. max-height: 50vh;
  1899. margin-bottom: 30upx;
  1900. }
  1901. .policy-list {
  1902. width: 100%;
  1903. }
  1904. .policy-item {
  1905. font-size: 30upx;
  1906. color: #666;
  1907. margin-bottom: 20upx;
  1908. text-align: left;
  1909. line-height: 1.5;
  1910. display: list-item;
  1911. list-style-type: disc;
  1912. margin-left: 40upx;
  1913. }
  1914. .policy-btn {
  1915. width: 50%;
  1916. height: 80upx;
  1917. line-height: 80upx;
  1918. text-align: center;
  1919. background-color: #3385ff;
  1920. color: #fff;
  1921. font-size: 32upx;
  1922. border-radius: 40upx;
  1923. }
  1924. .delivery-section {
  1925. border: 4upx solid #2ECE7E;
  1926. margin: 8upx 20upx;
  1927. border-radius: 8upx;
  1928. }
  1929. .empty-quotes-view {
  1930. height: 50upx;
  1931. display: flex;
  1932. flex-direction: column;
  1933. justify-content: center;
  1934. align-items: center;
  1935. }
  1936. .error-tips {
  1937. color: red;
  1938. font-weight: bold;
  1939. font-size: 32upx;
  1940. }
  1941. .distance-box {
  1942. display: flex;
  1943. align-items: center;
  1944. }
  1945. .blue-text {
  1946. color: #3385FF;
  1947. }
  1948. .title-reduction {
  1949. width: 150upx;
  1950. }
  1951. .btn-reduction {
  1952. margin-right: 12upx;
  1953. height: 70upx;
  1954. line-height: 46upx;
  1955. }
  1956. .btn-reduction-last {
  1957. margin-right: 0upx;
  1958. height: 70upx;
  1959. line-height: 46upx;
  1960. }
  1961. .strike-through {
  1962. text-decoration: line-through;
  1963. }
  1964. .btn-call {
  1965. width: 170upx;
  1966. }
  1967. .time-action-view {
  1968. display: flex;
  1969. align-items: center;
  1970. color: #049E2C;
  1971. font-size: 28upx;
  1972. }
  1973. .icon-arrow-right {
  1974. font-size: 24upx;
  1975. color: #049E2C;
  1976. margin-left: 5upx;
  1977. }
  1978. .address-box {
  1979. flex: 1;
  1980. text-align: center;
  1981. display: flex;
  1982. flex-direction: column;
  1983. justify-content: center;
  1984. align-items: center;
  1985. .addr-main {
  1986. font-size: 32upx;
  1987. color: #333;
  1988. }
  1989. .addr-sub {
  1990. font-size: 28upx;
  1991. color: #999;
  1992. margin-top: 6upx;
  1993. }
  1994. }
  1995. </style>