refuelDetail.vue 24 KB

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