create.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. <template>
  2. <view class="order-submission">
  3. <view class="allAddress">
  4. <view class="nav acea-row">
  5. <view style="width: 50%;" class="item font-color-red" :class="shippingType === 1 ? 'on' : 'on2'" @click="addressType(1)"></view>
  6. <view style="width: 50%;float: right;" class="item font-color-red" :class="shippingType === 2 ? 'on' : 'on2'" @click="addressType(2)"></view>
  7. </view>
  8. </view>
  9. <navigator url="/pages/address/list?source=1" v-if="shippingType === 1" class="address">
  10. <view class="address-head">订单配送至</view>
  11. <view v-if="addressData.phone" class="address-main">
  12. <image src="../../static/order/address.png" class="address-left"></image>
  13. <view class="address-text">{{addressData.province}} {{addressData.city}} {{addressData.county}}
  14. {{addressData.address}}</view>
  15. <image src="../../static/order/right.png" class="address-right"></image>
  16. </view>
  17. <view class="padding-tb-sm" v-else>
  18. 请选择配送地址
  19. </view>
  20. </navigator>
  21. <navigator v-if="shippingType === 2" class="address">
  22. <view class="address-head">订单配送至</view>
  23. <view v-if="storageData.address" class="address-main">
  24. <image src="../../static/order/address.png" class="address-left"></image>
  25. <view class="address-text">{{storageData.address}} {{storageData.phone}}</view>
  26. <view class="address-text" style="float: right;font-size: 28rpx;padding-top: 12rpx;">距离您 {{storageData.distance>1000 ? (storageData.distance/1000).toFixed(2)+'km' : storageData.distance+'m'}}</view>
  27. </view>
  28. <!-- <view class="address-distance">距离您732米</view> -->
  29. </navigator>
  30. <image class="a-bg" src="data:image/png;base64,iVBORw0KGgoAAAANS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SdK+f1RIqdRMqRXgrR90Dm+Dfsdn2+QYpeH7/8CBe+mAsq7nIsevKEjivgv1dQdzYUGH7dMlXe3FmwxZMTRyFgiZkW48mF0/XMYWqm75JfH8IUmPA1tlUMnHv+8T3N3J8d3Hkey6I3re6Djvaam1v/urhswjdsQ2jf/kVJRI1xHdPrh1lltzTWUxXai5H07N74P7KettnPDQyjWtf/ohglyJfl7jz/drP+vDrzgYsLZdtP2PRnz6B/u4t9I+U9cYCH81hddoFuBG4bxNq7v9xSfh+G/H9wKkIwF5JkR38fF3VLb73dDXhpsYS8P0Vxve7MZ14E04EkX2SumDj40Lkjz2LS9x1nZVqcK1rh1L/GaiZDB1GYwGPRi9+sA4r63odGEjAoKTZS0mTwUtoS2sTPioc1jd64KJqNZXRP9EtLFrLT5KQOd6H1JtvQ/SUQ1CUC1Z/tjp5MgXn51bAfc1VpAUVb6pqi+bsqRlrOB0ITSI0kUa1IvF7JcribPbxZnt9BYIeBZm0ap1BO2yHLMOIxjH111chmDocXg9XzZFR4fD74e5cA9GtQEulbLGbfaNMvv4+BfG3hiet9wxlUeDGdDPn68uqXVgVKKezbiBN/HHYoTnrqlORkDx0BHr/ABzVVbknbZysZ3wnRVyda6HU1UIjvpt28p2C+T+GEtYeeEh3jqcdKjl2BcWY65q9UAQb+c6+k3iePnaS+P5Pq8spOJ38fJ09RVI1OFuWo6xtJXSD+J6xh++OHN8PEt8HxtNY4pbAczC+m2Rnh8V3J9Q0Fa4LeG97YQdehj4aoSL9NZiZNMTKStp6g5/x5NsW37vWQaS1WXzPHvjihzYS/lgshbeJ75WySHm7wNXXk8SbK/xutOX4ntHtYRxE0eJn6uARaGf6ie++7GPNxVkf/78AAwCn1+RYqusbZQAAAABJRU5ErkJggg=="></image>
  31. <view class="goods">
  32. <view class="goods-head flex">
  33. <view class="goods-head-text">{{shippingType === 2?'取货时间':'送达时间'}}</view>
  34. <view @click="selectTime" style="text-align: right;" class="goods-head-time text-cut padding-right-sm">{{shippingType === 2?orderReqeust.predictTime.replaceAll('送达','取货'):orderReqeust.predictTime}}</view>
  35. <image src="../../static/order/time-right.png" class="goods-head-right"></image>
  36. </view>
  37. <view class="goods-one" v-if="orderReqeust.productList.length ==1">
  38. <image class="goods-img"
  39. :src="(orderReqeust.productList[0].productAttrImg?JSON.parse(orderReqeust.productList[0].productAttrImg)[0].url:JSON.parse(orderReqeust.productList[0].productImg)[0].url)"></image>
  40. <view class="goods-text">
  41. <view class="goods-name">{{orderReqeust.productList[0].productAttrName}}</view>
  42. <view class="goods-tag">
  43. <view class="goods-price" v-if="!orderReqeust.isIntegral && (orderReqeust.seckillId || orderReqeust.groupShopId)">¥{{orderReqeust.productList[0].price}}</view>
  44. <view class="goods-price" v-if="!orderReqeust.isIntegral && !orderReqeust.seckillId && !orderReqeust.groupShopId">¥{{isVip?orderReqeust.productList[0].vipPrice:orderReqeust.productList[0].price}}</view>
  45. <view class="goods-price" style="color: red" v-if="orderReqeust.isIntegral">积分{{orderReqeust.productList[0].integral}}</view>
  46. <view class="goods-yprice">¥{{orderReqeust.productList[0].otPrice}}</view>
  47. <view class="goods-number">×{{orderReqeust.productList[0].cartNum}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="goods-one" v-else>
  52. <view class="scroll_box">
  53. <scroll-view scroll-x="true">
  54. <block v-for="(item, index) in orderReqeust.productList" :key="index">
  55. <image class="goods-more-img" :src="(item.productAttrImg?JSON.parse(item.productAttrImg)[0].url:JSON.parse(item.productImg)[0].url)"></image>
  56. </block>
  57. </scroll-view>
  58. </view>
  59. <view class="goods-more-number">共{{orderReqeust.totalNumber}}件</view>
  60. <image src="../../static/order/time-right.png" class="goods-more-right"></image>
  61. </view>
  62. </view>
  63. <view class="distribution">
  64. <view class="distribution-list distribution-list-bottom" v-if="shippingType === 1">
  65. <view class="distribution-text">配送费</view>
  66. <view class="distribution-price">
  67. {{ orderReqeust.freightPrice < 0 ? 0 : orderReqeust.freightPrice }}元
  68. <uni-icons type="info" size="20" color="#999" @click="showFreightMsg"></uni-icons>
  69. </view>
  70. </view>
  71. <view class="distribution-list distribution-list-bottom" v-if="shippingType === 2">
  72. <view class="distribution-text">联系人</view>
  73. <view class="distribution-price"><input type="text" v-model="orderReqeust.name" placeholder="请输入您的联系姓名"></view>
  74. </view>
  75. <view class="distribution-list distribution-list-bottom" v-if="shippingType === 2">
  76. <view class="distribution-text">联系电话</view>
  77. <view class="distribution-price"><input type="text" v-model="orderReqeust.phone" placeholder="请输入您的联系电话"></view>
  78. </view>
  79. <view class="distribution-list distribution-list-bottom" @click="toggleMask('show')" v-if="!orderReqeust.isIntegral">
  80. <view class="distribution-text">优惠券
  81. <!-- 新增最佳优惠标识 -->
  82. <view v-if="orderReqeust.coupon && orderReqeust.coupon.id === bestCouponId" class="best-coupon">
  83. 最佳优惠
  84. </view>
  85. </view>
  86. <view class="distribution-price" style="color: red;">{{orderReqeust.coupon?"-¥"+orderReqeust.coupon.couponPrice : '选择优惠券'}}</view>
  87. </view>
  88. <view class="distribution-list">
  89. <view class="distribution-text">备注</view>
  90. <view class="distribution-price"><input type="text" v-model="orderReqeust.mono" placeholder="请输入备注信息"></view>
  91. </view>
  92. </view>
  93. <view class="distribution">
  94. <view class="distribution-list distribution-list-bottom">
  95. <view class="distribution-text pay-text">支付方式</view>
  96. </view>
  97. <view v-if="!orderReqeust.isIntegral" class="distribution-list distribution-list-bottom" @click="changePayType('WX')">
  98. <view class="distribution-text">微信</view>
  99. <view class="distribution-price">
  100. <image :src="payType === 'WX'?'../../static/order/xuanzhong.png':'../../static/order/xuanzhong-no.png'"></image>
  101. </view>
  102. </view>
  103. <view v-if="!orderReqeust.isIntegral" class="distribution-list" @click="changePayType('BALANCE')">
  104. <view class="distribution-text">余额</view>
  105. <view class="distribution-price">
  106. <image :src="payType === 'BALANCE'?'../../static/order/xuanzhong.png':'../../static/order/xuanzhong-no.png'"></image>
  107. </view>
  108. </view>
  109. <view v-if="orderReqeust.isIntegral" class="distribution-list" @click="changePayType('INTEGRAL')">
  110. <view class="distribution-text">积分</view>
  111. <view class="distribution-price">
  112. <image :src="payType === 'INTEGRAL'?'../../static/order/xuanzhong.png':'../../static/order/xuanzhong-no.png'"></image>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 优惠券面板 -->
  117. <view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
  118. <view class="mask-content" @click.stop.prevent="stopPrevent">
  119. <!-- 优惠券页面,仿mt -->
  120. <view @click="selectCoupon(item)" v-if="(!item.categoryId && orderReqeust.totalPrice >= item.useMinPrice) || (item.categoryId && skuCategoryPriceMap[item.categoryId] && skuCategoryPriceMap[item.categoryId] > item.useMinPrice)" class="coupon-item" v-for="(item,index) in couponList" :key="index">
  121. <view class="con">
  122. <view class="left">
  123. <text class="title">{{item.couponTitle}}</text>
  124. <text class="time">有效期至{{item.endTime | dateFormat}}</text>
  125. </view>
  126. <view class="right">
  127. <text class="price">{{item.couponPrice }}</text>
  128. <text>满{{item.useMinPrice }}可用</text>
  129. </view>
  130. <view class="circle l"></view>
  131. <view class="circle r"></view>
  132. </view>
  133. <text class="tips">{{item.categoryTitle?'限' + item.categoryTitle + '可用': '全品类可用'}}</text>
  134. </view>
  135. </view>
  136. </view>
  137. <!-- 底部 -->
  138. <view class="footer">
  139. <view class="priceClass">
  140. <view class="price-content"><text>总计</text>
  141. <text class="price-content-money">¥{{jia(orderReqeust.totalPrice - (orderReqeust.coupon?orderReqeust.coupon.couponPrice:0),orderReqeust.freightPrice<0?0:orderReqeust.freightPrice)}}</text>
  142. <text class="price-content-money" style="color: red" v-if="orderReqeust.isIntegral === 1"> + 积分{{orderReqeust.integral}}</text>
  143. </view>
  144. <view class="price-preferential"><text>已优惠:</text><text>{{jian(orderReqeust.totalotPrice,orderReqeust.totalPrice - (orderReqeust.coupon?orderReqeust.coupon.couponPrice:0)) }}元</text></view>
  145. </view>
  146. <view class="submit" @click="submit">
  147. 去付款
  148. </view>
  149. </view>
  150. <uni-popup ref="popup" type="bottom" :animation="true" style="z-index: 9999;">
  151. <view class="flex align-center justify-between" style="padding: 34rpx 30rpx;background-color: #F2F2F2;">
  152. <view style="font-size: 32rpx;line-height: 38rpx;color: #1B1C33;">选择送达时间</view>
  153. <view @click="checkTime" style="font-size: 32rpx;line-height: 38rpx;color: #2AAB34;">确定</view>
  154. </view>
  155. <view class="flex justify-between">
  156. <view style="width: 347rpx;height: 500rpx;background-color: #F2F2F2;">
  157. <view v-for="(date,index) in dayList" :key="index" @click="chooseDay(index)"
  158. :class="[index == dayIndex?'bg-white':'']"
  159. style="padding: 25rpx 84rpx 25rpx 59rpx;font-size: 32rpx;line-height: 38rpx;color: #1B1C33;">
  160. {{date}}
  161. </view>
  162. </view>
  163. <view class="bg-white" style="width: 404rpx;height: 500rpx;padding-left: 52rpx;position: relative;">
  164. <scroll-view scroll-y="true" style="width: 404rpx;height: 500rpx;">
  165. <view v-for="(time,index) in timeList[dayIndex]" :key="index" @click="chooseTime(index)"
  166. :class="[index == timeIndex?'text-green':'']"
  167. class="solid-bottom" style="padding: 25rpx 0;font-size: 32rpx;line-height: 38rpx;">
  168. <text v-if="index == 0 && dayIndex == 0 && dayList.length >= 3">{{time}}</text>
  169. <text v-else>{{time[0]+'-'+time[1]}}</text>
  170. </view>
  171. </scroll-view>
  172. <view style="position: absolute;bottom: 0;width: 404rpx;height: 53rpx;background-color: rgba(255,255,255,0.8);">
  173. </view>
  174. </view>
  175. </view>
  176. </uni-popup>
  177. </view>
  178. </template>
  179. <script>
  180. import uniPopup from "@/components/uni-popup/uni-popup.vue"
  181. export default {
  182. data() {
  183. return {
  184. payType: 'WX',
  185. shippingType: 1,
  186. bestCouponId: null, // 最佳优惠券的 ID
  187. orderReqeust: {
  188. productList: [],
  189. totalotPrice: 0,
  190. totalPrice: 0, //商品折扣(仅算VIP和限时打折)后总价
  191. totalNumber:0,//商品件数
  192. coupon: undefined,
  193. couponId: 0,
  194. mono: '',
  195. takeWay: '',
  196. freightPrice: 0,
  197. addressId: undefined,
  198. predictTime:'',
  199. phone:'',
  200. name:'',
  201. integral: 0,
  202. gainIntegral: 0
  203. },
  204. skuCategoryPriceMap: {},
  205. maskState: 0, //优惠券面板显示状态
  206. couponList: [],
  207. isVip: false,
  208. storageData: {
  209. address: ''
  210. },
  211. addressData: {
  212. consignee: '',
  213. phone: '',
  214. province: '',
  215. city: '',
  216. county: '',
  217. address: '',
  218. defaultAddress: false,
  219. },
  220. submiting: false,
  221. dayList:[],//配送时间
  222. dayIndex:0,//选中配送时间
  223. timeList:[],
  224. timeIndex:0,
  225. now:0,//当前小时
  226. nowTime:0,//当前分钟
  227. dateObj:{
  228. year: 0,
  229. today:0,
  230. tomorrow:1,
  231. afterTomo:2
  232. }
  233. }
  234. },
  235. components: {uniPopup},
  236. onShow() {
  237. this.isVip = this.$api.isVip()
  238. },
  239. onLoad(option) {
  240. //商品数据
  241. this.isVip = this.$api.isVip()
  242. const that = this
  243. if (option.takeway) {
  244. that.orderReqeust.takeWay = option.takeway
  245. }
  246. that.orderReqeust.productList = that.$api.globalData.productList;
  247. let totalotPrice = 0
  248. let totalPrice = 0
  249. let totalNumber = 0
  250. let skuCategoryPriceMap = {}
  251. that.orderReqeust.productList.forEach(item => {
  252. totalotPrice += item.otPrice * item.cartNum
  253. totalNumber += item.cartNum
  254. totalPrice += that.isVip ? (item.vipPrice * item.cartNum) : (item.price * item.cartNum)
  255. //构建category价格Map
  256. item.cateIdList.forEach(catItem => {
  257. if (skuCategoryPriceMap[catItem]) {
  258. skuCategoryPriceMap[catItem] += that.isVip ? (item.vipPrice * item.cartNum) : (item.price * item.cartNum)
  259. } else {
  260. skuCategoryPriceMap[catItem] = that.isVip ? (item.vipPrice) : (item.price)
  261. }
  262. })
  263. })
  264. that.skuCategoryPriceMap = skuCategoryPriceMap
  265. that.orderReqeust.totalotPrice = totalotPrice
  266. that.orderReqeust.totalNumber = totalNumber
  267. that.orderReqeust.totalPrice = totalPrice
  268. that.$api.request('get', 'coupon/app/getUserCoupons').then(res => {
  269. that.couponList = res.data
  270. this.findBestCoupon(); // 找出最佳优惠券
  271. })
  272. let addresses = uni.getStorageSync('addresses');
  273. that.$api.request('get', 'storage/position/getStorage',{storageId:that.$store.state.storageId}).then(res => {
  274. that.storageData = res.data
  275. if(addresses){
  276. that.storageData.distance = addresses.distance
  277. }
  278. })
  279. //设置距离
  280. that.$api.request('get', 'address/app/getDefAddress').then(res => {
  281. if(res.data){
  282. that.addressData = res.data
  283. }
  284. that.calcFreightPrice()
  285. })
  286. if (that.orderReqeust.productList.length === 1 && that.orderReqeust.productList[0].groupShopId) {
  287. //若是团购商品,则携带上团购信息
  288. that.orderReqeust.groupShopId = that.orderReqeust.productList[0].groupShopId
  289. //总价重置
  290. that.orderReqeust.totalPrice = that.orderReqeust.productList[0].price
  291. }
  292. if (that.orderReqeust.productList.length === 1 && that.orderReqeust.productList[0].seckillId) {
  293. //若是秒杀商品,则携带上秒杀信息
  294. that.orderReqeust.seckillId = that.orderReqeust.productList[0].seckillId
  295. //总价重置
  296. that.orderReqeust.totalPrice = that.orderReqeust.productList[0].price
  297. }
  298. if (that.orderReqeust.productList.length === 1 && that.orderReqeust.productList[0].isIntegral) {
  299. //若是积分商品,则携带上积分信息
  300. that.orderReqeust.isIntegral = that.orderReqeust.productList[0].isIntegral
  301. that.orderReqeust.integral = that.orderReqeust.productList[0].integral
  302. that.orderReqeust.payType = 'INTEGRAL'
  303. that.payType = 'INTEGRAL'
  304. }
  305. this.calcTime()
  306. },
  307. methods: {
  308. findBestCoupon() {
  309. if (this.couponList.length > 0) {
  310. // 找出优惠力度最大的优惠券
  311. let bestCoupon = this.couponList.reduce((prev, curr) => {
  312. return prev.couponPrice > curr.couponPrice ? prev : curr;
  313. });
  314. this.bestCouponId = bestCoupon.id; // 存储最佳优惠券的 ID
  315. }
  316. },
  317. showFreightMsg() {
  318. uni.showToast({
  319. title: this.orderReqeust.freightMsg, // 假设接口返回的 msg 存储在 freightMsg 中
  320. icon: 'none',
  321. duration: 2000
  322. });
  323. },
  324. // 选择支付方式
  325. changePayType(type) {
  326. this.payType = type
  327. },
  328. addressType: function(index) {
  329. this.shippingType = index
  330. this.calcFreightPrice()
  331. },
  332. //显示优惠券面板
  333. toggleMask(type) {
  334. let timer = type === 'show' ? 10 : 300;
  335. let state = type === 'show' ? 1 : 0;
  336. this.maskState = 2;
  337. setTimeout(() => {
  338. this.maskState = state;
  339. }, timer)
  340. },
  341. jia(arg1, arg2) {
  342. var r1, r2, m;
  343. try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
  344. try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
  345. m = Math.pow(10, Math.max(r1, r2));
  346. return (arg1 * m + arg2 * m) / m;
  347. },
  348. jian(arg2, arg1) {
  349. var r1, r2, m, n;
  350. try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
  351. try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
  352. m = Math.pow(10, Math.max(r1, r2));
  353. //lastmodifybydeeka
  354. //动态控制精度长度
  355. n = (r1 >= r2) ? r1 : r2;
  356. return ((arg2 * m - arg1 * m) / m).toFixed(n);
  357. },
  358. calcFreightPrice() {
  359. const that = this;
  360. if (that.addressData) {
  361. that.orderReqeust.addressId = that.addressData.id;
  362. }
  363. that.orderReqeust.storageId = that.$store.state.storageId;
  364. if (that.shippingType === 1 && !that.orderReqeust.isIntegral) {
  365. that.$api.request('post', 'order/app/getFreightMoney', JSON.stringify(that.orderReqeust))
  366. .then(res => {
  367. that.orderReqeust.freightPrice = res.data.totalPrice;
  368. that.orderReqeust.freightMsg = res.data.msg; // 存储 msg
  369. });
  370. } else {
  371. that.orderReqeust.freightPrice = 0;
  372. }
  373. },
  374. numberChange(data) {
  375. this.number = data.number;
  376. },
  377. submit() {
  378. const that = this
  379. if (that.submiting) {
  380. return
  381. }
  382. if(this.shippingType === 1){
  383. if(!this.addressData.id){
  384. this.$api.msg('请选择配送地址')
  385. return
  386. }
  387. }else {
  388. if(!this.storageData){
  389. this.$api.msg('未有仓库地址信息')
  390. return
  391. }
  392. if(!this.orderReqeust.name){
  393. this.$api.msg('请填写您的联系姓名')
  394. return
  395. }
  396. if (!this.storageData.phone || this.storageData.phone.length != 11) {
  397. this.$api.msg('请正确填写您的联系方式')
  398. return
  399. }
  400. }
  401. if(this.orderReqeust.freightPrice < 0 && !that.orderReqeust.isIntegral){
  402. this.$api.msg('无法配送!最低配送为'+ Math.abs(this.orderReqeust.freightPrice)+'元')
  403. return
  404. }
  405. uni.showLoading({})
  406. that.submiting = true
  407. if (that.addressData.id) {
  408. that.orderReqeust.addressId = that.addressData.id
  409. }
  410. that.orderReqeust.storageId = that.$store.state.storageId
  411. that.orderReqeust.shippingType = this.shippingType
  412. that.orderReqeust.channel = uni.getSystemInfoSync().platform
  413. that.orderReqeust.payType = that.payType
  414. if (that.payType === 'BALANCE') {
  415. that.$api.request('post', 'order/app/takeOrder',
  416. JSON.stringify(that.orderReqeust)
  417. , failres => {
  418. that.submiting = false
  419. that.$api.msg(failres.msg)
  420. }).then(res => {
  421. uni.redirectTo({
  422. url: '/pages/pay/success'
  423. })
  424. })
  425. return;
  426. }
  427. if (that.orderReqeust.isIntegral) {
  428. that.$api.request('post', 'order/app/takeOrder',
  429. JSON.stringify(that.orderReqeust)
  430. , failres => {
  431. that.submiting = false
  432. that.$api.msg(failres.msg)
  433. }).then(res => {
  434. uni.redirectTo({
  435. url: '/pages/pay/success'
  436. })
  437. })
  438. return;
  439. }
  440. that.$api.request('post', 'order/app/takeOrder',
  441. JSON.stringify(that.orderReqeust)
  442. , failres => {
  443. that.submiting = false
  444. that.$api.msg(failres.msg)
  445. }).then(res => {
  446. //提交订单成功后,无需再让用户提交订单
  447. // that.submiting = false
  448. // uni.redirectTo({
  449. // url: '/pages/pay/pay?orderno=' + res.data + '&price=' + that.orderReqeust.totalPrice
  450. // })
  451. that.confirm(res.data,(that.orderReqeust.totalPrice - (that.orderReqeust.coupon?that.orderReqeust.coupon.couponPrice:0) + parseFloat(that.orderReqeust.freightPrice)))
  452. })
  453. },
  454. selectCoupon(couponItem) {
  455. this.orderReqeust.couponId = couponItem.id
  456. this.orderReqeust.coupon = couponItem
  457. this.maskState = 0
  458. this.calcFreightPrice()
  459. },
  460. stopPrevent() {},
  461. //打开选择时间的弹窗
  462. selectTime(){
  463. this.$refs.popup.open()
  464. },
  465. //根据当前仓库营业时段及当前时间计算可供选择的送达时间
  466. calcTime() {
  467. var deliveryStart = this.$store.state.storageObj.deliveryStartTime.split(':')
  468. var deliveryStop = this.$store.state.storageObj.deliveryStopTime.split(':')
  469. var startHour = parseInt(deliveryStart[0])
  470. var startMin = parseInt(deliveryStart[1])
  471. var stopHour = parseInt(deliveryStop[0])
  472. var stopMin = parseInt(deliveryStop[1])
  473. var date = new Date()
  474. var year = date.getFullYear()
  475. var month = date.getMonth() + 1
  476. var day = date.getDate()
  477. // Create dates for today, tomorrow and after tomorrow
  478. var today = new Date(year, month - 1, day)
  479. var tomorrow = new Date(year, month - 1, day + 1)
  480. var afterTomo = new Date(year, month - 1, day + 2)
  481. // Get correct month and day for each date
  482. var todayMonth = today.getMonth() + 1
  483. var todayDay = today.getDate()
  484. var tomorrowMonth = tomorrow.getMonth() + 1
  485. var tomorrowDay = tomorrow.getDate()
  486. var afterTomoMonth = afterTomo.getMonth() + 1
  487. var afterTomoDay = afterTomo.getDate()
  488. // Format dates with leading zeros if needed
  489. var formatTodayMonth = todayMonth > 9 ? todayMonth : '0' + todayMonth
  490. var formatTodayDay = todayDay > 9 ? todayDay : '0' + todayDay
  491. var formatTomorrowMonth = tomorrowMonth > 9 ? tomorrowMonth : '0' + tomorrowMonth
  492. var formatTomorrowDay = tomorrowDay > 9 ? tomorrowDay : '0' + tomorrowDay
  493. var formatAfterTomoMonth = afterTomoMonth > 9 ? afterTomoMonth : '0' + afterTomoMonth
  494. var formatAfterTomoDay = afterTomoDay > 9 ? afterTomoDay : '0' + afterTomoDay
  495. this.dateObj.year = year
  496. this.dateObj.today = formatTodayDay
  497. this.dateObj.tomorrow = formatTomorrowDay
  498. this.dateObj.afterTomo = formatAfterTomoDay
  499. this.dateObj.month = formatTodayMonth // Use today's month as reference
  500. this.dayList = [
  501. '今天' + formatTodayMonth + '月' + formatTodayDay + '日',
  502. '明天' + formatTomorrowMonth + '月' + formatTomorrowDay + '日',
  503. '后天' + formatAfterTomoMonth + '月' + formatAfterTomoDay + '日'
  504. ]
  505. this.timeList[0] = ['尽快送达']
  506. this.timeList[1] = []
  507. for (var i = 0; i < stopHour - startHour; i++) {
  508. var time = startHour + i > 9 ? parseInt(startHour + i) : '0' + parseInt(startHour + i)
  509. this.timeList[1].push([time + ':00', time + ':30'])
  510. this.timeList[1].push([time + ':30', parseInt(parseInt(time) + 1) + ':00'])
  511. }
  512. if (startMin >= 30) {
  513. this.timeList[1].splice(0, 1)
  514. }
  515. //预计送达时间字符
  516. this.orderReqeust.predictTime = this.dayList[1] + this.timeList[1][0][0] + '-' + this.timeList[1][0][1]
  517. this.orderReqeust.predictDate = new Date(year + '-' + formatTomorrowMonth + '-' + formatTomorrowDay + ' ' + this.timeList[1][0][1]).getTime()
  518. this.timeList[2] = []
  519. for (var i = 0; i < stopHour - startHour; i++) {
  520. var time = startHour + i > 9 ? parseInt(startHour + i) : '0' + parseInt(startHour + i)
  521. this.timeList[2].push([time + ':00', time + ':30'])
  522. this.timeList[2].push([time + ':30', parseInt(parseInt(time) + 1) + ':00'])
  523. }
  524. if (startMin >= 30) {
  525. this.timeList[2].splice(0, 1)
  526. }
  527. var now = date.getHours()
  528. if (now < startHour) {
  529. now = startHour
  530. }
  531. var nowTime = date.getMinutes()
  532. this.nowTime = nowTime
  533. this.now = now
  534. if (now >= stopHour) {
  535. this.dayList.splice(0, 1)
  536. this.timeList.splice(0, 1)
  537. } else {
  538. this.timeList[0] = ['尽快送达']
  539. for (var i = 0; i < stopHour - now; i++) {
  540. var time = now + i > 9 ? now + i : '0' + parseInt(now + i)
  541. this.timeList[0].push([time + ':00', time + ':30'])
  542. this.timeList[0].push([time + ':30', parseInt(now + i + 1) + ':00'])
  543. }
  544. if (nowTime > 30) {
  545. this.timeList[0].splice(1, 2)
  546. var timeMine = nowTime - 30 > 9 ? parseInt(nowTime - 30) : '0' + parseInt(nowTime - 30)
  547. this.orderReqeust.predictTime = '尽快送达(预计' + parseInt(now + 1) + ':' + timeMine + '送达)'
  548. this.orderReqeust.predictDate = new Date(year + '-' + formatTodayMonth + '-' + formatTodayDay + ' ' + parseInt(now + 1) + ':' + timeMine).getTime()
  549. } else if (nowTime < 29) {
  550. this.orderReqeust.predictTime = '尽快送达(预计' + now + ':' + parseInt(nowTime + 30) + '送达)'
  551. this.orderReqeust.predictDate = new Date(year + '-' + formatTodayMonth + '-' + formatTodayDay + ' ' + now + ':' + parseInt(nowTime + 30)).getTime()
  552. } else if (nowTime == 30) {
  553. this.timeList[0].splice(1, 1)
  554. this.orderReqeust.predictTime = '尽快送达(预计' + parseInt(now + 1) + ':00送达)'
  555. this.orderReqeust.predictDate = new Date(year + '-' + formatTodayMonth + '-' + formatTodayDay + ' ' + parseInt(now + 1) + ':00').getTime()
  556. }
  557. }
  558. },
  559. chooseDay(index){
  560. this.dayIndex = index
  561. },
  562. chooseTime(index){
  563. this.timeIndex = index
  564. },
  565. checkTime(){
  566. //当天尽快送达
  567. if(this.dayIndex == 0 && this.timeIndex == 0 && this.dayList.length >= 3){
  568. if(this.nowTime > 30){
  569. var timeMine = this.nowTime - 30 > 9 ?parseInt(this.nowTime - 30):'0'+parseInt(this.nowTime - 30)
  570. this.orderReqeust.predictTime = '尽快送达(预计'+parseInt(this.now+1)+':'+ timeMine+'送达)'
  571. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.today+' '+parseInt(this.now+1)+':'+ timeMine).getTime()
  572. }else if(this.nowTime < 29){
  573. this.orderReqeust.predictTime = '尽快送达(预计'+this.now+':'+ parseInt(this.nowTime+30)+'送达)'
  574. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.today+' '+this.now+':'+ parseInt(this.nowTime+30)).getTime()
  575. }else if(this.nowTime == 30){
  576. this.orderReqeust.predictTime = '尽快送达(预计'+parseInt(this.now+1)+':00送达)'
  577. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.today+' '+parseInt(this.now+1)+':00').getTime()
  578. }
  579. this.$refs.popup.close()
  580. console.log(this.orderReqeust)
  581. return
  582. }
  583. //当天送达
  584. if(this.dayIndex == 0 && this.dayList.length >= 3){
  585. this.orderReqeust.predictTime = this.timeList[0][this.timeIndex][0]+'-'+this.timeList[0][this.timeIndex][1]
  586. console.log(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.today+' '+this.timeList[this.dayIndex][this.timeIndex][1])
  587. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.today+' '+this.timeList[this.dayIndex][this.timeIndex][1]).getTime()
  588. this.$refs.popup.close()
  589. console.log(this.orderReqeust)
  590. return
  591. }
  592. //明、后天送达
  593. this.orderReqeust.predictTime = this.dayList[this.dayIndex]+this.timeList[this.dayIndex][this.timeIndex][0]+'-'+this.timeList[this.dayIndex][this.timeIndex][1]
  594. if(this.dayList.length >= 3){
  595. if(this.dayIndex == 1){//明天
  596. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.tomorrow+' '+this.timeList[this.dayIndex][this.timeIndex][1]).getTime()
  597. }else if(this.dayIndex == 2){//后天
  598. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.afterTomo+' '+this.timeList[this.dayIndex][this.timeIndex][1]).getTime()
  599. }
  600. }else if(this.dayList.length >= 2){
  601. if(this.dayIndex == 0){//明天
  602. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.tomorrow+' '+this.timeList[this.dayIndex][this.timeIndex][1]).getTime()
  603. }else if(this.dayIndex == 1){//后天
  604. this.orderReqeust.predictDate = new Date(this.dateObj.year+'-'+this.dateObj.month+'-'+this.dateObj.afterTomo+' '+this.timeList[this.dayIndex][this.timeIndex][1]).getTime()
  605. }
  606. }
  607. this.$refs.popup.close()
  608. console.log(this.orderReqeust)
  609. },
  610. //确认支付
  611. confirm(orderNo,totalPrice) {
  612. // ============微信支付代码 prod 开始============
  613. // #ifdef APP-PLUS
  614. this.$api.msg('演示环境不支持支付')
  615. return
  616. // #endif
  617. const that = this
  618. that.$api.request('get', 'order/app/wxPrepay', {
  619. orderId : orderNo
  620. }, failres => {
  621. that.submiting = false
  622. that.$api.msg(failres.msg)
  623. }).then(prepayRes => {
  624. uni.hideLoading()
  625. that.submiting = false
  626. //#ifdef MP-WEIXIN
  627. const payParam = {
  628. appId: prepayRes.data.appId,
  629. nonceStr: prepayRes.data.nonceStr,
  630. package: prepayRes.data.packageValue,
  631. timeStamp: prepayRes.data.timeStamp,
  632. signType: prepayRes.data.signType,
  633. paySign: prepayRes.data.paySign,
  634. }
  635. //#endif
  636. //#ifdef APP-PLUS
  637. const payParam = {
  638. appid: prepayRes.data.appId,
  639. noncestr: prepayRes.data.nonceStr,
  640. package: prepayRes.data.packageValue,
  641. partnerid: prepayRes.data.partnerId,
  642. prepayid: prepayRes.data.prepayId,
  643. timestamp: parseInt(prepayRes.data.timeStamp),
  644. sign: prepayRes.data.sign,
  645. signType: 'MD5'
  646. }
  647. //#endif
  648. //#ifdef MP-WEIXIN || APP-PLUS
  649. uni.requestPayment({
  650. provider: 'wxpay',
  651. //#ifdef MP-WEIXIN
  652. ...payParam,
  653. //#endif
  654. //#ifdef APP-PLUS
  655. orderInfo: payParam,
  656. //#endif
  657. success: function(res) {
  658. uni.redirectTo({
  659. url: '/pages/pay/success'
  660. })
  661. },
  662. fail: function(res) {
  663. // console.log("支付过程失败");
  664. // that.$api.msg(JSON.stringify(res))
  665. },
  666. complete: function(res) {
  667. console.log("支付过程结束")
  668. }
  669. });
  670. //#endif
  671. //#ifdef H5
  672. that.$jweixin.chooseWXPay({
  673. nonceStr: prepayRes.data.nonceStr,
  674. timestamp: prepayRes.data.timeStamp,
  675. package: prepayRes.data.packageValue,
  676. signType: prepayRes.data.signType,
  677. paySign: prepayRes.data.paySign,
  678. success: (e) => {
  679. //支付成功
  680. uni.redirectTo({
  681. url: '/pages/pay/success'
  682. })
  683. },
  684. fail: function(res) {
  685. console.log("支付过程失败");
  686. that.$api.msg(JSON.stringify(res))
  687. },
  688. complete: function(res) {
  689. console.log("支付过程结束")
  690. }
  691. })
  692. //#endif
  693. })
  694. //============微信支付代码 prod 结束============
  695. //============微信支付代码 dev 开始============
  696. // uni.request({
  697. // url: this.$api.defConfig().baseUrl + '/cb/wxpay',
  698. // data: {
  699. // outTradeNo: orderNo,
  700. // transactionId:'test',
  701. // totalFee: Math.round(totalPrice * 100)
  702. // },
  703. // method: 'POST',
  704. // header: {
  705. // 'Content-Type': 'application/json; charset=UTF-8'
  706. // },
  707. // success: (res) => {
  708. // //代码回调-上线后注释代码-结束
  709. // uni.redirectTo({
  710. // url: '/pages/pay/success'
  711. // })
  712. // }
  713. // });
  714. //============微信支付代码 dev 结束============
  715. }
  716. }
  717. }
  718. </script>
  719. <style lang="scss">
  720. page {
  721. background: #F4F4F4;
  722. padding-bottom: 100upx;
  723. }
  724. .mask {
  725. display: flex;
  726. align-items: flex-end;
  727. position: fixed;
  728. left: 0;
  729. top: var(--window-top);
  730. bottom: 0;
  731. width: 100%;
  732. background: rgba(0, 0, 0, 0);
  733. z-index: 9995;
  734. transition: .3s;
  735. .mask-content {
  736. width: 100%;
  737. min-height: 30vh;
  738. max-height: 70vh;
  739. background: #f3f3f3;
  740. transform: translateY(100%);
  741. transition: .3s;
  742. overflow-y: scroll;
  743. }
  744. &.none {
  745. display: none;
  746. }
  747. &.show {
  748. background: rgba(0, 0, 0, .4);
  749. .mask-content {
  750. transform: translateY(0);
  751. }
  752. }
  753. }
  754. /* 优惠券列表 */
  755. .coupon-item {
  756. display: flex;
  757. flex-direction: column;
  758. margin: 20upx 24upx;
  759. background: #fff;
  760. .con {
  761. display: flex;
  762. align-items: center;
  763. position: relative;
  764. height: 120upx;
  765. padding: 0 30upx;
  766. &:after {
  767. position: absolute;
  768. left: 0;
  769. bottom: 0;
  770. content: '';
  771. width: 100%;
  772. height: 0;
  773. border-bottom: 1px dashed #f3f3f3;
  774. transform: scaleY(50%);
  775. }
  776. }
  777. .left {
  778. display: flex;
  779. flex-direction: column;
  780. justify-content: center;
  781. flex: 1;
  782. overflow: hidden;
  783. height: 100upx;
  784. }
  785. .title {
  786. font-size: 32upx;
  787. color: $font-color-dark;
  788. margin-bottom: 10upx;
  789. }
  790. .time {
  791. font-size: 24upx;
  792. color: $font-color-light;
  793. }
  794. .right {
  795. display: flex;
  796. flex-direction: column;
  797. justify-content: center;
  798. align-items: center;
  799. font-size: 26upx;
  800. color: $font-color-base;
  801. height: 100upx;
  802. }
  803. .price {
  804. font-size: 44upx;
  805. color: $base-color;
  806. &:before {
  807. content: '¥';
  808. font-size: 34upx;
  809. }
  810. }
  811. .tips {
  812. font-size: 24upx;
  813. color: $font-color-light;
  814. line-height: 60upx;
  815. padding-left: 30upx;
  816. }
  817. .circle {
  818. position: absolute;
  819. left: -6upx;
  820. bottom: -10upx;
  821. z-index: 10;
  822. width: 20upx;
  823. height: 20upx;
  824. background: #f3f3f3;
  825. border-radius: 100px;
  826. &.r {
  827. left: auto;
  828. right: -6upx;
  829. }
  830. }
  831. }
  832. .address {
  833. padding: 36upx 30upx;
  834. background-color: #FFFFFF;
  835. overflow: hidden;
  836. }
  837. .address-head {
  838. color: #999999;
  839. font-size: 28upx;
  840. font-weight: 400;
  841. }
  842. .address-main {
  843. margin-top: 24upx;
  844. }
  845. .address-left {
  846. margin: 9upx 0;
  847. width: 24upx;
  848. height: 32upx;
  849. float: left;
  850. }
  851. .address-text {
  852. margin-left: 14upx;
  853. float: left;
  854. font-size: 36upx;
  855. color: #333333;
  856. font-weight: 500;
  857. }
  858. .address-right {
  859. margin: 11upx 20upx 11upx 0;
  860. width: 28upx;
  861. height: 28upx;
  862. float: right;
  863. }
  864. .address-distance {
  865. clear: both;
  866. margin-top: 10upx;
  867. color: #333333;
  868. font-size: 30upx;
  869. }
  870. .a-bg {
  871. display: block;
  872. width: 100%;
  873. height: 5upx;
  874. }
  875. .goods {
  876. margin-top: 20upx;
  877. background-color: #FFFFFF;
  878. overflow: hidden;
  879. }
  880. .goods-head {
  881. margin: 0 30upx;
  882. height: 100upx;
  883. padding: 30upx 0;
  884. border-bottom: 2upx solid #F1F1F1;
  885. }
  886. .goods-head-text {
  887. width: 294upx;
  888. float: left;
  889. color: #333333;
  890. font-size: 28upx;
  891. }
  892. .goods-head-time {
  893. width: 490upx;
  894. float: left;
  895. color: #2AAC34;
  896. font-size: 28upx;
  897. }
  898. .goods-head-right {
  899. margin-top: 8upx;
  900. width: 16upx;
  901. height: 24upx;
  902. float: left;
  903. }
  904. .goods-one {
  905. padding: 40upx 0 30upx 0;
  906. margin: 0 30upx;
  907. height: 190upx;
  908. }
  909. .scroll_box{
  910. width: 544upx;
  911. height: 110upx;
  912. float: left;
  913. overflow:hidden;
  914. }
  915. .scroll_box scroll-view{
  916. height: 110upx;
  917. width: 544upx;
  918. white-space: nowrap;
  919. }
  920. .goods-img {
  921. margin-top: 2upx;
  922. width: 118upx;
  923. height: 110upx;
  924. float: left;
  925. }
  926. .goods-more-img{
  927. margin-top: 2upx;
  928. width: 118upx;
  929. height: 110upx;
  930. display: inline-block;
  931. margin-right: 36upx;
  932. }
  933. .goods-more-number{
  934. width: 126upx;
  935. height: 110upx;
  936. line-height: 110upx;
  937. text-align: center;
  938. color: #1B1C33;
  939. font-size: 28upx;
  940. float: left;
  941. }
  942. .goods-more-right{
  943. margin-top: 43.5upx;
  944. width: 15upx;
  945. height: 23upx;
  946. float: left;
  947. }
  948. .goods-text {
  949. margin-top: 6upx;
  950. margin-left: 32upx;
  951. width: 538upx;
  952. height: 110upx;
  953. float: left;
  954. }
  955. .goods-name {
  956. width: 500upx;
  957. line-height: 44upx;
  958. overflow: hidden;
  959. color: #333333;
  960. font-size: 32upx;
  961. }
  962. .goods-tag {
  963. margin-top: 10upx;
  964. }
  965. .goods-price {
  966. float: left;
  967. color: #333333;
  968. font-size: 32upx;
  969. line-height: 44upx;
  970. }
  971. .goods-yprice {
  972. margin-left: 16upx;
  973. float: left;
  974. color: #AEAEAE;
  975. font-size: 24upx;
  976. line-height: 44upx;
  977. text-decoration: line-through;
  978. }
  979. .goods-number {
  980. float: right;
  981. color: #333333;
  982. font-size: 32upx;
  983. }
  984. .distribution {
  985. padding: 0 30upx;
  986. margin-top: 20upx;
  987. background-color: #FFFFFF;
  988. overflow: hidden;
  989. }
  990. .distribution-list {
  991. height: 100upx;
  992. line-height: 100upx;
  993. font-size: 28upx;
  994. clear: both;
  995. }
  996. .distribution-list-bottom {
  997. border-bottom: 2upx solid #F1F1F1;
  998. }
  999. .info-icon {
  1000. width: 28upx;
  1001. height: 28upx;
  1002. margin-left: 10upx;
  1003. vertical-align: middle;
  1004. }
  1005. .distribution-price {
  1006. width: 490upx;
  1007. float: left;
  1008. text-align: right;
  1009. color: #666666;
  1010. }
  1011. .distribution-price input {
  1012. width: 490upx;
  1013. height: 100upx;
  1014. line-height: 100upx;
  1015. overflow: hidden;
  1016. text-align: right;
  1017. }
  1018. .pay-text {
  1019. color: #333333;
  1020. font-size: 32upx;
  1021. }
  1022. .distribution-price image {
  1023. width: 40upx;
  1024. height: 40upx;
  1025. float: right;
  1026. margin-top: 30upx;
  1027. }
  1028. .footer {
  1029. position: fixed;
  1030. left: 0;
  1031. bottom: 0;
  1032. z-index: 99;
  1033. height: 98upx;
  1034. width: 100%;
  1035. background-color: #FFFFFF;
  1036. }
  1037. .priceClass{
  1038. margin-left: 62upx;
  1039. width: 448upx;
  1040. float: left;
  1041. }
  1042. .price-content{
  1043. height: 50upx;
  1044. line-height: 50upx;
  1045. margin-top: 10upx;
  1046. color: #666666;
  1047. font-size: 26upx;
  1048. }
  1049. .price-content-money{
  1050. color: #2AAC34;
  1051. font-size: 36upx;
  1052. }
  1053. .price-preferential{
  1054. height: 36upx;
  1055. line-height: 36upx;
  1056. color: #AEAEAE;
  1057. font-size: 20upx;
  1058. }
  1059. .submit{
  1060. width: 240upx;
  1061. float: left;
  1062. line-height: 98upx;
  1063. color: #FFFFFF;
  1064. background-color: #2AAC34;
  1065. text-align: center;
  1066. }
  1067. .order-submission .wrapper .shipping select {
  1068. color: #999;
  1069. padding-right: 0.15 * 100rpx;
  1070. }
  1071. .order-submission .wrapper .shipping .iconfont {
  1072. font-size: 0.3 * 100rpx;
  1073. color: #515151;
  1074. }
  1075. .order-submission .allAddress {
  1076. width: 100%;
  1077. background-image: linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 100%);
  1078. background-image: -webkit-linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 100%);
  1079. background-image: -moz-linear-gradient(to bottom, #FFFFFF 0%, #FFFFFF 100%);
  1080. padding-top: 1 * 100rpx;
  1081. }
  1082. .order-submission .allAddress .nav {
  1083. margin: 0 auto;
  1084. padding: 0 30rpx;
  1085. width: 100%;
  1086. box-sizing: border-box;
  1087. }
  1088. .order-submission .allAddress .nav .item {
  1089. flex: 1;
  1090. position: relative;
  1091. }
  1092. .order-submission .allAddress .nav .item.on {
  1093. position: relative;
  1094. }
  1095. .order-submission .allAddress .nav .item.on:before {
  1096. position: absolute;
  1097. bottom: 0;
  1098. content: '骑手配送';
  1099. font-size: 0.28 * 100rpx;
  1100. display: block;
  1101. height: 0;
  1102. left: 0;
  1103. right: 0;
  1104. border-width: 0.4 * 100rpx;
  1105. border-style: solid;
  1106. border-color: #fff;
  1107. z-index: 9;
  1108. text-align: center;
  1109. line-height: 0.14 * 100rpx;
  1110. }
  1111. .order-submission .allAddress .nav .item:nth-of-type(2).on:before {
  1112. content: '到店自提';
  1113. border-width: 0.4 * 100rpx;
  1114. }
  1115. .order-submission .allAddress .nav .item.on2 {
  1116. position: relative;
  1117. }
  1118. .order-submission .allAddress .nav .item.on2:before {
  1119. position: absolute;
  1120. bottom: 0;
  1121. content: '到店自提';
  1122. font-size: 0.28 * 100rpx;
  1123. display: block;
  1124. height: 0;
  1125. left: 0;
  1126. right: 0;
  1127. border-width: 0.4 * 100rpx;
  1128. border-style: solid;
  1129. border-color: #d5e6e6;
  1130. text-align: center;
  1131. line-height: 0.14 * 100rpx;
  1132. }
  1133. .order-submission .allAddress .nav .item:nth-of-type(1).on2:before {
  1134. content: '骑手配送';
  1135. border-width: 0.4 * 100rpx;
  1136. }
  1137. .order-submission .allAddress .address {
  1138. width: 6.91 * 100rpx;
  1139. height: 1.5 * 100rpx;
  1140. margin: 0 auto;
  1141. box-sizing: border-box;
  1142. }
  1143. .order-submission .allAddress .line {
  1144. width: 7.1 * 100rpx;
  1145. margin: 0 auto;
  1146. }
  1147. .order-submission .wrapper .item .discount input::placeholder {
  1148. color: #ccc;
  1149. }
  1150. .distribution-text {
  1151. width: 200upx;
  1152. float: left;
  1153. color: #333333;
  1154. display: flex; // 使用 flex 布局
  1155. align-items: center; // 垂直居中
  1156. }
  1157. .best-coupon {
  1158. display: inline-block;
  1159. padding: 4upx 8upx;
  1160. background-color: #fff;
  1161. border-radius: 4upx;
  1162. color: red;
  1163. font-size: 24upx;
  1164. }
  1165. </style>