refuelDetail.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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?(distance/1000).toFixed(2):0}}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?(distance/1000).toFixed(2):0}}公里
  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. // '5154031457384536897'
  569. this.storeId = options.id
  570. this.queryStoreDetail(options.id)
  571. const eventChannel = this.getOpenerEventChannel();
  572. let that = this
  573. eventChannel.on('pay', function(data) {
  574. that.query.allowanceinfo[0].allowanceId = data.allowanceId
  575. that.query.allowanceinfo[0].allowanceType = data.allowanceType
  576. that.gun = data.gun
  577. that.numIndex =data.numIndex
  578. that.itemId = data.itemId
  579. that.num = data.num
  580. that.price.cityPrice = data.cityPrice,
  581. that.price.vipPrice = data.vipPrice,
  582. that.price.storePrice = data.storePrice,
  583. that.amount = data.amount
  584. that.couponName = data.couponName
  585. that.isChooseBack = true
  586. console.log('data', data);
  587. })
  588. }
  589. }
  590. </script>
  591. <style lang="scss" >
  592. .refuelDetail{
  593. background: #F5F5F6;
  594. height: 100vh;
  595. padding-bottom: 200rpx;
  596. .banner{
  597. width: 100%;
  598. height: 382rpx;
  599. }
  600. .tag-title{
  601. font-weight: 600;
  602. font-size: 32rpx;
  603. color: #EE4320;
  604. height: 220rpx;
  605. background: linear-gradient( 180deg, rgba(238,67,32,0.15) 0%, rgba(255,255,255,0) 100%);
  606. padding: 20rpx 24rpx;
  607. box-sizing: border-box;
  608. }
  609. .block{
  610. margin: 0 24rpx 20rpx;
  611. background: #fff;
  612. border-radius: 8rpx 8rpx 8rpx 8rpx;
  613. padding: 28rpx 24rpx ;
  614. }
  615. .content{
  616. margin-top: -142rpx;
  617. // min-height: 500rpx;
  618. // border-radius: 16rpx 16rpx 0 0;
  619. // position: relative;
  620. // z-index: 2;
  621. // background: #fff;
  622. // padding: 28rpx 24rpx;
  623. .shopInfo{
  624. background-image: url('@/static/white-map.png');
  625. background-repeat: no-repeat;
  626. background-size: 318rpx 295rpx;
  627. background-position: right top;
  628. .title-box{
  629. display: flex;
  630. align-items: flex-end;
  631. justify-content: space-between;
  632. .title{
  633. font-weight: 600;
  634. font-size: 32rpx;
  635. color: #222222;
  636. width: 500rpx;
  637. white-space: nowrap;
  638. overflow: hidden;
  639. text-overflow: ellipsis;
  640. margin-top: 10rpx;
  641. }
  642. .diatance-box{
  643. display: flex;
  644. align-items: center;
  645. font-weight: 400;
  646. font-size: 24rpx;
  647. color: #222222;
  648. .icon{
  649. width: 20rpx;
  650. height: 20rpx;
  651. margin-right: 8rpx;
  652. }
  653. }
  654. }
  655. .time{
  656. font-weight: 300;
  657. font-size: 24rpx;
  658. color: #AAAAAA;
  659. padding: 20rpx 0;
  660. border-bottom: 1rpx solid #F0F0F0;
  661. }
  662. .address{
  663. font-weight: 400;
  664. font-size: 24rpx;
  665. color: #222222;
  666. line-height: 40rpx;
  667. overflow: hidden;
  668. padding-right: 20rpx;
  669. text-overflow: ellipsis;
  670. /* 弹性伸缩盒子模型显示 */
  671. display: -webkit-box;
  672. /* 限制在一个块元素显示的文本的行数 */
  673. -webkit-line-clamp: 2;
  674. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  675. -webkit-box-orient: vertical;
  676. margin-top: 10rpx;
  677. }
  678. .address-box{
  679. display: flex;
  680. align-items: center;
  681. justify-content: space-between;
  682. // width: 702rpx;
  683. // height: 140rpx;
  684. // background-image: url('@/static/white-map.png');
  685. // background-repeat: repeat;
  686. // background-size: 100% 140rpx;
  687. box-sizing: border-box;
  688. padding-top: 20rpx;
  689. .distance{
  690. font-weight: 300;
  691. font-size: 24rpx;
  692. color: #AAAAAA;
  693. }
  694. .btn-box{
  695. display: flex;
  696. .btn+.btn{
  697. margin-left: 16rpx;
  698. }
  699. .btn{
  700. width: 120rpx;
  701. height: 52rpx;
  702. line-height: 52rpx;
  703. text-align: center;
  704. font-weight: 400;
  705. font-size: 24rpx;
  706. color: #222222;
  707. display: flex;
  708. align-items: center;
  709. .icon{
  710. width: 30rpx;
  711. height: 30rpx;
  712. padding-right: 10rpx;
  713. }
  714. }
  715. }
  716. }
  717. }
  718. .price-box{
  719. display: flex;
  720. align-items: center;
  721. justify-content: space-between;
  722. .price{
  723. font-weight: 600;
  724. font-size: 36rpx;
  725. color: #EE4320;
  726. display: flex;
  727. align-items: center;
  728. .label{
  729. font-size: 22rpx;
  730. }
  731. }
  732. .right-box{
  733. display: flex;
  734. align-items: center;
  735. .old-price{
  736. font-weight: 300;
  737. font-size: 24rpx;
  738. color: #AAAAAA;
  739. margin-left: 20rpx;
  740. }
  741. }
  742. }
  743. .block-title{
  744. font-weight: 600;
  745. font-size: 28rpx;
  746. color: #222222;
  747. padding-bottom: 24rpx;
  748. }
  749. .choose-box{
  750. display: flex;
  751. justify-content: space-between;
  752. .item{
  753. width: 316rpx;
  754. height: 80rpx;
  755. line-height: 80rpx;
  756. text-align: center;
  757. background: #F0F0F0;
  758. border-radius: 8rpx;
  759. font-weight: 600;
  760. font-size: 28rpx;
  761. color: #222222;
  762. position: relative;
  763. .icon{
  764. width: 32rpx;
  765. height: 32rpx;
  766. position: absolute;
  767. top: 50%;
  768. right: 24rpx;
  769. transform: translateY(-50%);
  770. }
  771. }
  772. .item.active{
  773. background: #FFF6F5;
  774. color: #FF4D3A;
  775. }
  776. }
  777. .input-box{
  778. position: relative;
  779. overflow: hidden;
  780. margin-top: 20rpx;
  781. width: 100%;
  782. height: 120rpx;
  783. line-height: 120rpx;
  784. border-radius: 16rpx;
  785. background: #F0F0F0;
  786. .price-input{
  787. position: absolute;
  788. top: 50%;
  789. left: 72rpx;
  790. height: 70rpx;
  791. line-height: 70rpx;
  792. width: 450rpx;
  793. transform: translateY(-50%);
  794. font-weight: bold;
  795. font-size: 32rpx;
  796. color: #222;
  797. box-sizing: border-box;
  798. }
  799. .placeholder{
  800. font-size: 32rpx;
  801. color: #AAAAAA;
  802. height: 64rpx;
  803. line-height: 64rpx;
  804. }
  805. .unit{
  806. position: absolute;
  807. top: 50%;
  808. left: 28rpx;
  809. transform: translateY(-50%);
  810. font-size: 32rpx;
  811. color: #222222;
  812. font-weight: bold;
  813. }
  814. }
  815. .order-box{
  816. padding: 0 24rpx;
  817. .item{
  818. display: flex;
  819. align-items: center;
  820. justify-content: space-between;
  821. padding: 24rpx 0;
  822. border-bottom: 1rpx solid #F0F0F0;
  823. .label{
  824. font-weight: 300;
  825. font-size: 28rpx;
  826. color: #222222;
  827. }
  828. .value-box{
  829. display: flex;
  830. align-items: center;
  831. .num{
  832. font-weight: 300;
  833. font-size: 28rpx;
  834. color: #AAAAAA;
  835. }
  836. }
  837. .value{
  838. font-weight: 300;
  839. font-size: 28rpx;
  840. color: #222222;
  841. margin-left: 20rpx;
  842. max-width: 400rpx;
  843. overflow: hidden;
  844. text-overflow: ellipsis;
  845. /* 弹性伸缩盒子模型显示 */
  846. display: -webkit-box;
  847. /* 限制在一个块元素显示的文本的行数 */
  848. -webkit-line-clamp: 1;
  849. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  850. -webkit-box-orient: vertical;
  851. }
  852. .gray{
  853. color: #AAAAAA!important;
  854. }
  855. .red{
  856. color: #EE4320!important;
  857. font-weight: 600!important;
  858. font-size: 28rpx!important;
  859. }
  860. }
  861. }
  862. }
  863. .buy-box {
  864. position: fixed;
  865. bottom: 0%;
  866. left: 0%;
  867. width: 100%;
  868. display: flex;
  869. align-items: center;
  870. justify-content: space-between;
  871. box-sizing: border-box;
  872. padding: 10rpx 30rpx env(safe-area-inset-bottom);
  873. border-top: 1rpx solid #EEEEEE;
  874. background: #fff;
  875. .total-price {
  876. display: flex;
  877. align-items: center;
  878. .label {
  879. color: #181818;
  880. font-size: 28rpx;
  881. }
  882. .price {
  883. font-size: 36rpx;
  884. font-weight: 800;
  885. color: #EE4320;
  886. margin-left: 10rpx;
  887. }
  888. }
  889. .btn {
  890. width: 280rpx;
  891. height: 80rpx;
  892. line-height: 80rpx;
  893. text-align: center;
  894. background: $uni-color-primary;
  895. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  896. border-radius: 46rpx 46rpx 46rpx 46rpx;
  897. font-weight: 800;
  898. color: #FFFFFF;
  899. font-size: 28rpx;
  900. margin: 0;
  901. }
  902. .btn.disabled{
  903. filter: grayscale(1);
  904. }
  905. }
  906. .map{
  907. position: absolute;
  908. top: -9999rpx;
  909. left: -9999rpx;
  910. }
  911. .u-popup__content{
  912. padding: 28rpx 24rpx;
  913. background: #F9F9F9 !important;
  914. .popup-title{
  915. font-weight: 600;
  916. font-size: 32rpx;
  917. color: #222222;
  918. }
  919. .item-box{
  920. width: 100%;
  921. background: #FFFFFF;
  922. border-radius: 16rpx 16rpx 16rpx 16rpx;
  923. margin-top: 20rpx;
  924. padding: 24rpx;
  925. box-sizing: border-box;
  926. .sub-title{
  927. font-weight: 600;
  928. font-size: 28rpx;
  929. color: #222222;
  930. margin-bottom: 20rpx;
  931. display: flex;
  932. align-items: flex-end;
  933. .notice{
  934. font-weight: 300;
  935. font-size: 24rpx;
  936. color: #AAAAAA;
  937. margin-left: 20rpx;
  938. }
  939. }
  940. .box{
  941. display: flex;
  942. flex-wrap: wrap;
  943. max-height: 600rpx;
  944. overflow: auto;
  945. .item{
  946. width: 148rpx;
  947. height: 52rpx;
  948. line-height: 52rpx;
  949. text-align: center;
  950. background: #F0F0F0;
  951. border-radius: 8rpx 8rpx 8rpx 8rpx;
  952. font-weight: 400;
  953. font-size: 28rpx;
  954. color: #222222;
  955. margin-bottom: 20rpx;
  956. margin-right: 20rpx;
  957. }
  958. .item.active{
  959. background: #FFF6F5;
  960. color: #EE4320;
  961. font-weight: bold;
  962. }
  963. .item.m0{
  964. margin-right: 0!important;
  965. }
  966. }
  967. }
  968. }
  969. }
  970. </style>