refuelDetail.vue 25 KB

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