refuelDetail.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. <template>
  2. <view class="refuelDetail">
  3. <!-- <zs-header :background="background"></zs-header> -->
  4. <!-- <image class="banner" :src="info.logo" mode=""></image> -->
  5. <view class="tag-title">
  6. 超值优惠券·加油更便宜
  7. </view>
  8. <view class="content">
  9. <view class="block shopInfo">
  10. <view class="title-box">
  11. <view class="title">
  12. {{info.storeName}}
  13. </view>
  14. <view class="diatance-box">
  15. <image class="icon" src="../static/refuel/nav-icon-black.png" mode=""></image>
  16. {{(distance/1000).toFixed(2)}}km
  17. </view>
  18. </view>
  19. <view class="address">
  20. {{info.address}}
  21. </view>
  22. <view class="time">
  23. 营业时间 周一至周日 {{info.openTimeHourStart}}:00 - {{info.openTimeHourEnd}}:00
  24. </view>
  25. <view class="address-box">
  26. <view class="distance">
  27. 距离您{{(distance/1000).toFixed(2)}}公里
  28. </view>
  29. <view class="btn-box">
  30. <view class="btn" @click="handleNavigation">
  31. <image class="icon" src="../static/refuel/nav-icon.png" mode=""></image>
  32. 导航
  33. </view>
  34. <view class="btn" @click="handleCall">
  35. <image class="icon" src="../static/refuel/tel-icon.png" mode=""></image>
  36. 电话
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="price-box block">
  42. <view class="price">
  43. ¥{{price.vipPrice?(price.vipPrice/100).toFixed(2):'--'}}/L <view class="label">优惠价</view>
  44. </view>
  45. <view class="right-box">
  46. <view class="old-price">
  47. 油站价¥{{price.cityPrice?(price.storePrice/100).toFixed(2):'--'}}/L
  48. </view>
  49. <view class="old-price">
  50. 国标价¥{{price.cityPrice?(price.cityPrice/100).toFixed(2):'--'}}/L
  51. </view>
  52. </view>
  53. </view>
  54. <view class="block">
  55. <view class="block-title">
  56. 选择油号/油枪
  57. </view>
  58. <view class="choose-box">
  59. <view class="item" :class="[num?'active':'']" @click="hanleChoose">
  60. {{num||"请选择油号"}}
  61. <image class="icon" src="../static/shop-desc.png" mode=""></image>
  62. </view>
  63. <view class="item" :class="[gun?'active':'']" @click="hanleChoose">
  64. {{gun ? (gun + '号枪'):"请选择油枪"}}
  65. <image class="icon" src="../static/shop-desc.png" mode=""></image>
  66. </view>
  67. </view>
  68. <view class="input-box">
  69. <input class="price-input" type="digit" v-model="amount" placeholder-class="placeholder" placeholder-style="color:#AAAAAA;font-weight: 500;" placeholder="请输入加油金额,优惠价格计算" />
  70. <view class="unit">
  71. ¥
  72. </view>
  73. </view>
  74. </view>
  75. <view class="order-box block">
  76. <view class="item">
  77. <view class="label">
  78. 订单金额
  79. </view>
  80. <view class="value-box">
  81. <view class="num">
  82. 约{{(payInfo.litre/1000).toFixed(2)}}升
  83. </view>
  84. <view class="value">
  85. {{'¥'+ (payInfo.totalPrice/100).toFixed(2) }}
  86. </view>
  87. </view>
  88. </view>
  89. <view class="item">
  90. <view class="label">
  91. 服务费
  92. </view>
  93. <view class="value" :class="[!payInfo.totalPrice?'gray':'']">
  94. {{payInfo.totalPrice?'¥'+(payInfo.serviceFee/100).toFixed(2) : '输入金额后查看服务费'}}
  95. </view>
  96. </view>
  97. <view class="item">
  98. <view class="label">
  99. 优惠券减免金额
  100. </view>
  101. <view class="value" :class="[!payInfo.totalPrice?'gray':'',payInfo.promotionAmount?'red':'']">
  102. {{payInfo.totalPrice?'-¥'+(payInfo.promotionAmount/100).toFixed(2) : '输入金额后查看优惠金额'}}
  103. </view>
  104. </view>
  105. <view class="item">
  106. <view class="label">
  107. 优惠券
  108. </view>
  109. <view class="value gray" :class="[couponLabel.value?'red':'']" @click="chooseCoupon">
  110. {{payInfo.totalPrice? couponLabel.label : '输入金额后查看优惠券'}}
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <view class="buy-box">
  116. <view class="total-price">
  117. <view class="label">
  118. 合计:
  119. </view>
  120. <view class="price">
  121. ¥ {{(payInfo.realPrice/100).toFixed(2)}}
  122. </view>
  123. </view>
  124. <!-- <button class="btn" :class="[btnDisabled?'disabled':'']" type="default" :loading="loading" :disabled="btnDisabled" @click="handlePay">立即支付</button> -->
  125. <button class="btn" type="default" :loading="loading" :disabled="btnDisabled" @click="handlePay">立即支付</button>
  126. </view>
  127. <u-popup :show="show" round="16rpx" mode="bottom" @close="close">
  128. <view class="popup-title">
  129. 选择油号/油枪
  130. </view>
  131. <view class="item-box">
  132. <view class="sub-title">
  133. 选择油号
  134. </view>
  135. <view class="box">
  136. <view class="item" :class="[numIndex === index ?'active':'']" v-for="(item,index) in info.itemInfoList" :key="item.itemId" @click="handleTab(item,'',index)">
  137. {{item.itemName}}
  138. </view>
  139. </view>
  140. </view>
  141. <view class="item-box">
  142. <view class="sub-title">
  143. 选择油枪
  144. <view class="notice">
  145. 请与加油员确认油枪号
  146. </view>
  147. </view>
  148. <view class="box">
  149. <view class="item" :class="[gun == item ?'active':'',(index+1)%4 == 0?'m0':'']" v-for="(item,index) in gunList" :key="item" @click="handleTab(item,'gun')">
  150. {{item}}号
  151. </view>
  152. </view>
  153. </view>
  154. </u-popup>
  155. <map class="map" id="map"></map>
  156. </view>
  157. </template>
  158. <script>
  159. import { queryStoreDetail,queryCalPrice,queryNewOrder,queryOrderPromotionList } from '@/api/refuel.js';
  160. import {debounce} from '@/utils/tool.js'
  161. // 腾讯地图
  162. var QQMapWX = require('@/libs/qqmap-wx-jssdk.min.js');
  163. var qqmapsdk = new QQMapWX({key:'KX5BZ-B64RC-RO62W-AMWAZ-VVTC3-YAFXF'});
  164. export default {
  165. data() {
  166. return {
  167. type:1,
  168. map:null,
  169. show:false,
  170. loading:false,
  171. info:null,
  172. distance:0,
  173. itemId:'',//油号id
  174. num:'',//油号
  175. numIndex:undefined,//选择油号的index
  176. gun:'',//油枪
  177. price:{//选择的油号价格
  178. cityPrice:0,
  179. vipPrice:0,
  180. storePrice:0
  181. },
  182. storeId:'',
  183. amount:'',//输入金额
  184. payInfo:{//计算出来的金额
  185. discountPrice: 0,
  186. itemName: "",
  187. litre: 0,
  188. priceDetailVo: {deductionDetail: null, gunCoupon: null},
  189. promotionAmount: 0,
  190. realPrice: 0,
  191. serviceFee: 0,
  192. storeId: "",
  193. totalPrice: 0,
  194. },
  195. epId:'',//店铺id
  196. couponList:[],//可以优惠券列表
  197. query:{
  198. allowanceinfo: [
  199. {
  200. "allowanceId": "",
  201. "allowanceType": 2
  202. }
  203. ],
  204. amount:0,
  205. itemName :this.num,
  206. storeId:this.storeId,
  207. },
  208. couponName:0,//优惠券名称
  209. isChooseBack:false,//是否是选择优惠券返回
  210. }
  211. },
  212. watch: {
  213. amount:debounce(function(val){
  214. if(!val){
  215. this.payInfo = {//计算出来的金额
  216. discountPrice: 0,
  217. itemName: "",
  218. litre: 0,
  219. priceDetailVo: {deductionDetail: null, gunCoupon: null},
  220. promotionAmount: 0,
  221. realPrice: 0,
  222. serviceFee: 0,
  223. storeId: "",
  224. totalPrice: 0,
  225. }
  226. }
  227. this.queryOrderPromotionList().then(()=>{
  228. this.queryCalPrice()
  229. })
  230. // else if(!this.num||!this.gun){
  231. // uni.showToast({
  232. // title:'请选择油号/油枪',
  233. // icon:'none'
  234. // })
  235. // }else if(val<10){
  236. // uni.showToast({
  237. // title:'加油金额不能小于10',
  238. // icon:'none'
  239. // })
  240. // }
  241. })
  242. },
  243. computed: {
  244. btnDisabled(){
  245. if(!this.payInfo.realPrice || !this.num || !this.gun || this.loading || this.amount<10){
  246. return true
  247. }else{
  248. return false
  249. }
  250. },
  251. gunList() {
  252. if(this.numIndex == undefined){
  253. return []
  254. }else{
  255. return this.info.itemInfoList[this.numIndex].gunNoList
  256. }
  257. },
  258. // query(){
  259. // return {
  260. // allowanceinfo: [
  261. // {
  262. // "allowanceId": "",
  263. // "allowanceType": 0
  264. // }
  265. // ],
  266. // amount:this.amount*100,
  267. // itemName :this.num,
  268. // storeId:this.storeId,
  269. // }
  270. // },
  271. notice(){
  272. if(this.amount&&this.amount<10){
  273. return uni.showToast({
  274. title:'加油金额不能小于10',
  275. icon:'none'
  276. })
  277. }else if(!this.num||!this.gun){
  278. return uni.showToast({
  279. title:'请选择油号/油枪',
  280. icon:'none'
  281. })
  282. }else if(!this.amount){
  283. return uni.showToast({
  284. title:'请输入加油金额',
  285. icon:'none'
  286. })
  287. }
  288. else if(this.amount>999){
  289. this.amount = 999
  290. return uni.showToast({
  291. title:'加油最大金额999',
  292. icon:'none'
  293. })
  294. }
  295. },
  296. couponLabel(){
  297. if(this.couponList.length){
  298. if(this.couponName){
  299. return {label: `${this.couponName}`,value:true}
  300. }else{
  301. return {label: `有${this.couponList.length}张可用`,value:true}
  302. }
  303. }else{
  304. return {label: '暂无可用',value:false}
  305. }
  306. }
  307. },
  308. methods: {
  309. chooseCoupon(){
  310. if(this.couponList.length){
  311. let that = this
  312. uni.navigateTo({
  313. url:`/refuel/coupon?storeId=${this.storeId}`,
  314. success: function(res) {
  315. // 通过eventChannel向被打开页面传送数据
  316. let info = {
  317. allowanceId:that.query.allowanceinfo[0].allowanceId,
  318. allowanceType:that.query.allowanceinfo[0].allowanceType,
  319. gun:that.gun,
  320. numIndex:that.numIndex,
  321. itemId:that.itemId,
  322. num:that.num,
  323. cityPrice:that.price.cityPrice,
  324. vipPrice:that.price.vipPrice,
  325. storePrice:that.price.storePrice,
  326. amount:that.amount,
  327. epId:that.epId,
  328. couponName:that.couponName
  329. }
  330. res.eventChannel.emit('coupon',info)
  331. }
  332. })
  333. }
  334. },
  335. handleTab(item,type,index){
  336. if(type == 'gun'){
  337. this.gun = item
  338. this.show = false
  339. }else{
  340. this.gun = ''
  341. this.numIndex = index
  342. this.itemId = item.itemId
  343. this.num = item.itemName
  344. this.price.cityPrice = item.cityPrice
  345. this.price.vipPrice = item.vipPrice
  346. this.price.storePrice = item.storePrice
  347. }
  348. this.queryCalPrice()
  349. },
  350. handleNavigation() {
  351. uni.openLocation({
  352. latitude: this.info.lat,
  353. longitude: this.info.lon,
  354. name:this.info.storeName,
  355. address:this.info.address,
  356. success: function () {
  357. console.log('success');
  358. }
  359. });
  360. // this.map.openMapApp({
  361. // longitude:this.info.lon,
  362. // latitude:this.info.lat,
  363. // destination:this.info.storeName,
  364. // success(res){
  365. // console.log(res);
  366. // }
  367. // })
  368. },
  369. handleCall() {
  370. if(this.info.tel){
  371. uni.makePhoneCall({
  372. phoneNumber: this.info.tel //仅为示例
  373. });
  374. }else{
  375. uni.showToast({
  376. title:'商家没有预留电话',
  377. icon:'none'
  378. })
  379. }
  380. },
  381. hanleChoose(){
  382. this.show = true
  383. },
  384. close(){
  385. this.show = false
  386. },
  387. // 加油站详情
  388. queryStoreDetail(storeId){
  389. uni.showLoading({
  390. title:'加载中'
  391. })
  392. queryStoreDetail(storeId).then(res=>{
  393. uni.hideLoading()
  394. this.info = res.content
  395. this.getDistance()
  396. if(!this.itemId&&!this.num){//没使用优惠券时
  397. this.info.itemInfoList.map((item,index)=>{
  398. if(item.itemName == '92#'){
  399. this.numIndex = index
  400. this.itemId = item.itemId
  401. this.num = item.itemName
  402. this.price.cityPrice = item.cityPrice
  403. this.price.vipPrice = item.vipPrice
  404. this.price.storePrice = item.storePrice
  405. }
  406. })
  407. }
  408. })
  409. },
  410. queryOrderPromotionList(){
  411. return new Promise((resolve,reject)=>{
  412. queryOrderPromotionList({
  413. "orderAmount": this.amount*100,
  414. "storeId": this.storeId
  415. }).then(res=>{
  416. console.log(res);
  417. if(Array.isArray(res.content)&&res.content.length&&!this.isChooseBack){
  418. this.couponList = res.content
  419. this.couponName = res.content[0].promotionDesc
  420. this.query.allowanceinfo[0].allowanceId = res.content[0].allowanceId
  421. }
  422. else if(Array.isArray(res.content)){
  423. this.couponList = res.content
  424. }
  425. resolve()
  426. })
  427. })
  428. },
  429. queryCalPrice(){
  430. if(this.num&&this.gun&&this.amount>=10){
  431. uni.showLoading({
  432. title:'计算中'
  433. })
  434. let query = JSON.parse(JSON.stringify(this.query))
  435. query.amount = this.amount*100
  436. query.itemName = this.num,
  437. query.storeId = this.storeId,
  438. queryCalPrice(query).then(res=>{
  439. uni.hideLoading()
  440. if(res.state == 'Success'){
  441. this.payInfo = res.content
  442. }
  443. })
  444. }
  445. },
  446. getDistance(){
  447. let location = JSON.parse(uni.getStorageSync('location'))
  448. qqmapsdk.calculateDistance({from:{latitude:location.latitude,longitude:location.longitude},to:[{latitude:this.info.location[1],longitude:this.info.location[0]}],success:(res)=>{
  449. console.log(res);
  450. this.distance = res.result.elements[0].distance
  451. }})
  452. },
  453. getRad(d) {
  454. return d * Math.PI / 180.0;
  455. },
  456. /*参数:两地的经纬度数值*/
  457. getFlatternDistance(lat1, lng1, lat2, lng2) {
  458. var radLat1 = this.getRad(lat1);
  459. var radLat2 = this.getRad(lat2);
  460. var a = radLat1 - radLat2;
  461. var b = this.getRad(lng1) - this.getRad(lng2);
  462. var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
  463. Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
  464. s = s * 6378137.0;//地球半径 单位米;
  465. s = Math.round(s * 10000) / 10000; //输出为米
  466. s = s.toFixed(0)
  467. return s
  468. },
  469. handlePay(){
  470. let that = this
  471. let location = JSON.parse(uni.getStorageSync('location'))
  472. console.log('不能超过(米):',this.amount*1000,'距离加油站(米):',this.getFlatternDistance(location.latitude,location.longitude,this.info.lat,this.info.lon))
  473. // if(this.getFlatternDistance(location.latitude,location.longitude,this.info.lat,this.info.lon)>100000000){
  474. if(this.getFlatternDistance(location.latitude,location.longitude,this.info.lat,this.info.lon)>1000){
  475. return uni.showModal({
  476. title:'提示',
  477. content:'您当前距离加油站较远,请到达加油站后与加油员确定信息',
  478. confirmText:'刷新位置',
  479. success: function (res) {
  480. if (res.confirm) {
  481. uni.showLoading({
  482. title:'刷新中'
  483. })
  484. uni.getLocation({
  485. type: 'gcj02',
  486. success: (res) => {
  487. // 存储经纬度
  488. uni.setStorageSync('location',JSON.stringify({latitude:res.latitude,longitude:res.longitude}))
  489. uni.hideLoading()
  490. that.getDistance()
  491. }
  492. })
  493. }
  494. }
  495. })
  496. }
  497. this.loading = true
  498. let query = {
  499. "channel":'ZhongShu',
  500. "epId": this.epId,
  501. "itemName":this.num,
  502. "gunNo": this.gun,
  503. "itemId": this.itemId,
  504. "litre": this.payInfo.litre,
  505. "openExtra": "",
  506. "originalAmount": this.payInfo.totalPrice,
  507. "outNewUserFlag": "",
  508. "paymentAmount": this.payInfo.realPrice,
  509. "promotionInfo": this.query.allowanceinfo,
  510. "serviceFee": this.payInfo.serviceFee,
  511. "storeId":this.storeId,
  512. "storePrice": this.price.storePrice,
  513. "vipPrice": this.price.vipPrice
  514. }
  515. queryNewOrder(query).then(res=>{
  516. this.loading = false
  517. if(res.state == 'Success'){
  518. uni.navigateToMiniProgram({
  519. appId:"wx0d252f6ed9755862", // 滴滴加油小程序appId
  520. path: `packageA/pages/open-energy-pay/index?orderId=${res.content.xjOrderId}&tradeId=${res.content.tradeId}`, // 滴滴加油收银台页面地址,需要拼接orderId和tradeId
  521. envVersion: 'release' // 固定release
  522. })
  523. }
  524. })
  525. }
  526. },
  527. onReady() {
  528. this.map = uni.createMapContext("map", this);
  529. },
  530. onShow() {
  531. // if(!this.btnDisabled){
  532. // uni.reLaunch({
  533. // url:'/my/order/index'
  534. // })
  535. // }
  536. },
  537. onLoad(options) {
  538. this.epId = options.epId
  539. // '5154031457384536897'
  540. this.storeId = options.id
  541. this.queryStoreDetail(options.id)
  542. const eventChannel = this.getOpenerEventChannel();
  543. let that = this
  544. eventChannel.on('pay', function(data) {
  545. that.query.allowanceinfo[0].allowanceId = data.allowanceId
  546. that.query.allowanceinfo[0].allowanceType = data.allowanceType
  547. that.gun = data.gun
  548. that.numIndex =data.numIndex
  549. that.itemId = data.itemId
  550. that.num = data.num
  551. that.price.cityPrice = data.cityPrice,
  552. that.price.vipPrice = data.vipPrice,
  553. that.price.storePrice = data.storePrice,
  554. that.amount = data.amount
  555. that.couponName = data.couponName
  556. that.isChooseBack = true
  557. console.log('data', data);
  558. })
  559. }
  560. }
  561. </script>
  562. <style lang="scss" >
  563. .refuelDetail{
  564. background: #F5F5F6;
  565. height: 100vh;
  566. padding-bottom: 200rpx;
  567. .banner{
  568. width: 100%;
  569. height: 382rpx;
  570. }
  571. .tag-title{
  572. font-weight: 600;
  573. font-size: 32rpx;
  574. color: #EE4320;
  575. height: 220rpx;
  576. background: linear-gradient( 180deg, rgba(238,67,32,0.15) 0%, rgba(255,255,255,0) 100%);
  577. padding: 20rpx 24rpx;
  578. box-sizing: border-box;
  579. }
  580. .block{
  581. margin: 0 24rpx 20rpx;
  582. background: #fff;
  583. border-radius: 8rpx 8rpx 8rpx 8rpx;
  584. padding: 28rpx 24rpx ;
  585. }
  586. .content{
  587. margin-top: -142rpx;
  588. // min-height: 500rpx;
  589. // border-radius: 16rpx 16rpx 0 0;
  590. // position: relative;
  591. // z-index: 2;
  592. // background: #fff;
  593. // padding: 28rpx 24rpx;
  594. .shopInfo{
  595. background-image: url('@/static/white-map.png');
  596. background-repeat: no-repeat;
  597. background-size: 318rpx 295rpx;
  598. background-position: right top;
  599. .title-box{
  600. display: flex;
  601. align-items: flex-end;
  602. justify-content: space-between;
  603. .title{
  604. font-weight: 600;
  605. font-size: 32rpx;
  606. color: #222222;
  607. width: 500rpx;
  608. white-space: nowrap;
  609. overflow: hidden;
  610. text-overflow: ellipsis;
  611. margin-top: 10rpx;
  612. }
  613. .diatance-box{
  614. display: flex;
  615. align-items: center;
  616. font-weight: 400;
  617. font-size: 24rpx;
  618. color: #222222;
  619. .icon{
  620. width: 20rpx;
  621. height: 20rpx;
  622. margin-right: 8rpx;
  623. }
  624. }
  625. }
  626. .time{
  627. font-weight: 300;
  628. font-size: 24rpx;
  629. color: #AAAAAA;
  630. padding: 20rpx 0;
  631. border-bottom: 1rpx solid #F0F0F0;
  632. }
  633. .address{
  634. font-weight: 400;
  635. font-size: 24rpx;
  636. color: #222222;
  637. line-height: 40rpx;
  638. overflow: hidden;
  639. padding-right: 20rpx;
  640. text-overflow: ellipsis;
  641. /* 弹性伸缩盒子模型显示 */
  642. display: -webkit-box;
  643. /* 限制在一个块元素显示的文本的行数 */
  644. -webkit-line-clamp: 2;
  645. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  646. -webkit-box-orient: vertical;
  647. margin-top: 10rpx;
  648. }
  649. .address-box{
  650. display: flex;
  651. align-items: center;
  652. justify-content: space-between;
  653. // width: 702rpx;
  654. // height: 140rpx;
  655. // background-image: url('@/static/white-map.png');
  656. // background-repeat: repeat;
  657. // background-size: 100% 140rpx;
  658. box-sizing: border-box;
  659. padding-top: 20rpx;
  660. .distance{
  661. font-weight: 300;
  662. font-size: 24rpx;
  663. color: #AAAAAA;
  664. }
  665. .btn-box{
  666. display: flex;
  667. .btn+.btn{
  668. margin-left: 16rpx;
  669. }
  670. .btn{
  671. width: 120rpx;
  672. height: 52rpx;
  673. line-height: 52rpx;
  674. text-align: center;
  675. font-weight: 400;
  676. font-size: 24rpx;
  677. color: #222222;
  678. display: flex;
  679. align-items: center;
  680. .icon{
  681. width: 30rpx;
  682. height: 30rpx;
  683. padding-right: 10rpx;
  684. }
  685. }
  686. }
  687. }
  688. }
  689. .price-box{
  690. display: flex;
  691. align-items: center;
  692. justify-content: space-between;
  693. .price{
  694. font-weight: 600;
  695. font-size: 36rpx;
  696. color: #EE4320;
  697. display: flex;
  698. align-items: center;
  699. .label{
  700. font-size: 22rpx;
  701. }
  702. }
  703. .right-box{
  704. display: flex;
  705. align-items: center;
  706. .old-price{
  707. font-weight: 300;
  708. font-size: 24rpx;
  709. color: #AAAAAA;
  710. margin-left: 20rpx;
  711. }
  712. }
  713. }
  714. .block-title{
  715. font-weight: 600;
  716. font-size: 28rpx;
  717. color: #222222;
  718. padding-bottom: 24rpx;
  719. }
  720. .choose-box{
  721. display: flex;
  722. justify-content: space-between;
  723. .item{
  724. width: 316rpx;
  725. height: 80rpx;
  726. line-height: 80rpx;
  727. text-align: center;
  728. background: #F0F0F0;
  729. border-radius: 8rpx;
  730. font-weight: 600;
  731. font-size: 28rpx;
  732. color: #222222;
  733. position: relative;
  734. .icon{
  735. width: 32rpx;
  736. height: 32rpx;
  737. position: absolute;
  738. top: 50%;
  739. right: 24rpx;
  740. transform: translateY(-50%);
  741. }
  742. }
  743. .item.active{
  744. background: #FFF6F5;
  745. color: #FF4D3A;
  746. }
  747. }
  748. .input-box{
  749. position: relative;
  750. overflow: hidden;
  751. margin-top: 20rpx;
  752. width: 100%;
  753. height: 120rpx;
  754. line-height: 120rpx;
  755. border-radius: 16rpx;
  756. background: #F0F0F0;
  757. .price-input{
  758. position: absolute;
  759. top: 50%;
  760. left: 72rpx;
  761. height: 70rpx;
  762. line-height: 70rpx;
  763. width: 450rpx;
  764. transform: translateY(-50%);
  765. font-weight: bold;
  766. font-size: 32rpx;
  767. color: #222;
  768. box-sizing: border-box;
  769. }
  770. .placeholder{
  771. font-size: 32rpx;
  772. color: #AAAAAA;
  773. height: 64rpx;
  774. line-height: 64rpx;
  775. }
  776. .unit{
  777. position: absolute;
  778. top: 50%;
  779. left: 28rpx;
  780. transform: translateY(-50%);
  781. font-size: 32rpx;
  782. color: #222222;
  783. font-weight: bold;
  784. }
  785. }
  786. .order-box{
  787. padding: 0 24rpx;
  788. .item{
  789. display: flex;
  790. align-items: center;
  791. justify-content: space-between;
  792. padding: 24rpx 0;
  793. border-bottom: 1rpx solid #F0F0F0;
  794. .label{
  795. font-weight: 300;
  796. font-size: 28rpx;
  797. color: #222222;
  798. }
  799. .value-box{
  800. display: flex;
  801. align-items: center;
  802. .num{
  803. font-weight: 300;
  804. font-size: 28rpx;
  805. color: #AAAAAA;
  806. }
  807. }
  808. .value{
  809. font-weight: 300;
  810. font-size: 28rpx;
  811. color: #222222;
  812. margin-left: 20rpx;
  813. max-width: 400rpx;
  814. overflow: hidden;
  815. text-overflow: ellipsis;
  816. /* 弹性伸缩盒子模型显示 */
  817. display: -webkit-box;
  818. /* 限制在一个块元素显示的文本的行数 */
  819. -webkit-line-clamp: 1;
  820. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  821. -webkit-box-orient: vertical;
  822. }
  823. .gray{
  824. color: #AAAAAA!important;
  825. }
  826. .red{
  827. color: #EE4320!important;
  828. font-weight: 600!important;
  829. font-size: 28rpx!important;
  830. }
  831. }
  832. }
  833. }
  834. .buy-box {
  835. position: fixed;
  836. bottom: 0%;
  837. left: 0%;
  838. width: 100%;
  839. display: flex;
  840. align-items: center;
  841. justify-content: space-between;
  842. box-sizing: border-box;
  843. padding: 10rpx 30rpx env(safe-area-inset-bottom);
  844. border-top: 1rpx solid #EEEEEE;
  845. background: #fff;
  846. .total-price {
  847. display: flex;
  848. align-items: center;
  849. .label {
  850. color: #181818;
  851. font-size: 28rpx;
  852. }
  853. .price {
  854. font-size: 36rpx;
  855. font-weight: 800;
  856. color: #EE4320;
  857. margin-left: 10rpx;
  858. }
  859. }
  860. .btn {
  861. width: 280rpx;
  862. height: 80rpx;
  863. line-height: 80rpx;
  864. text-align: center;
  865. background: $uni-color-primary;
  866. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  867. border-radius: 46rpx 46rpx 46rpx 46rpx;
  868. font-weight: 800;
  869. color: #FFFFFF;
  870. font-size: 28rpx;
  871. margin: 0;
  872. }
  873. .btn.disabled{
  874. filter: grayscale(1);
  875. }
  876. }
  877. .map{
  878. position: absolute;
  879. top: -9999rpx;
  880. left: -9999rpx;
  881. }
  882. .u-popup__content{
  883. padding: 28rpx 24rpx;
  884. background: #F9F9F9 !important;
  885. .popup-title{
  886. font-weight: 600;
  887. font-size: 32rpx;
  888. color: #222222;
  889. }
  890. .item-box{
  891. width: 100%;
  892. background: #FFFFFF;
  893. border-radius: 16rpx 16rpx 16rpx 16rpx;
  894. margin-top: 20rpx;
  895. padding: 24rpx;
  896. box-sizing: border-box;
  897. .sub-title{
  898. font-weight: 600;
  899. font-size: 28rpx;
  900. color: #222222;
  901. margin-bottom: 20rpx;
  902. display: flex;
  903. align-items: flex-end;
  904. .notice{
  905. font-weight: 300;
  906. font-size: 24rpx;
  907. color: #AAAAAA;
  908. margin-left: 20rpx;
  909. }
  910. }
  911. .box{
  912. display: flex;
  913. flex-wrap: wrap;
  914. max-height: 600rpx;
  915. overflow: auto;
  916. .item{
  917. width: 148rpx;
  918. height: 52rpx;
  919. line-height: 52rpx;
  920. text-align: center;
  921. background: #F0F0F0;
  922. border-radius: 8rpx 8rpx 8rpx 8rpx;
  923. font-weight: 400;
  924. font-size: 28rpx;
  925. color: #222222;
  926. margin-bottom: 20rpx;
  927. margin-right: 20rpx;
  928. }
  929. .item.active{
  930. background: #FFF6F5;
  931. color: #EE4320;
  932. font-weight: bold;
  933. }
  934. .item.m0{
  935. margin-right: 0!important;
  936. }
  937. }
  938. }
  939. }
  940. }
  941. </style>