refuelDetail.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view class="refuelDetail">
  3. <zs-header :background="background"></zs-header>
  4. <image class="banner" src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/657c35e3cae1326607ea9ed2/ext/SHOP_INFO/1977.jpg_wh300.jpg/7.jpg" mode=""></image>
  5. <view class="content">
  6. <view class="title">
  7. 中国石化富源加油站
  8. </view>
  9. <view class="time">
  10. 营业时间 周一至周日 00:00-24:00
  11. </view>
  12. <view class="distance">
  13. 距离您5.6公里 驾车24分钟
  14. </view>
  15. <view class="address-box">
  16. <view class="address">
  17. 毓秀路街道延安中路13号(喷水池地
  18. 铁站K出口旁)
  19. </view>
  20. <view class="btn-box">
  21. <view class="btn" @click="handleNavigation">
  22. 导航
  23. </view>
  24. <view class="btn" @click="handleCall">
  25. 电话
  26. </view>
  27. </view>
  28. </view>
  29. <view class="price-box">
  30. <view class="price">
  31. 优惠加油 ¥7.89/L
  32. </view>
  33. <view class="old-price">
  34. 国标价¥7.89/L
  35. </view>
  36. </view>
  37. <view class="choose-box">
  38. <view class="item" @click="hanleChoose">
  39. 请选择油号
  40. <image class="icon" src="../static/shop-desc.png" mode=""></image>
  41. </view>
  42. <view class="item" @click="hanleChoose">
  43. 请选择油枪
  44. <image class="icon" src="../static/shop-desc.png" mode=""></image>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="buy-box">
  49. <button class="buy-btn" type="default" @click="">立即支付</button>
  50. </view>
  51. <u-popup :show="show" round="16rpx" mode="bottom" @close="close">
  52. <view class="popup-title">
  53. 选择油号/油枪
  54. </view>
  55. <view class="item-box">
  56. <view class="sub-title">
  57. 选择油号
  58. </view>
  59. <view class="box">
  60. <view class="item">
  61. 92#
  62. </view>
  63. <view class="item active">
  64. 95#
  65. </view>
  66. <view class="item">
  67. 98#
  68. </view>
  69. </view>
  70. </view>
  71. <view class="item-box">
  72. <view class="sub-title">
  73. 选择油枪
  74. </view>
  75. <view class="box">
  76. <view class="item active">
  77. 1
  78. </view>
  79. <view class="item">
  80. 2
  81. </view>
  82. <view class="item">
  83. 3
  84. </view>
  85. <view class="item m0">
  86. 4
  87. </view>
  88. <view class="item">
  89. 5
  90. </view>
  91. </view>
  92. </view>
  93. </u-popup>
  94. <map class="map" id="map"></map>
  95. </view>
  96. </template>
  97. <script>
  98. export default {
  99. data() {
  100. return {
  101. background:false,
  102. map:null,
  103. show:false,
  104. }
  105. },
  106. methods: {
  107. handleNavigation() {
  108. this.map.openMapApp({
  109. longitude:104.117262,
  110. latitude:30.598726,
  111. destination:'目的地',
  112. success(res){
  113. }
  114. })
  115. },
  116. handleCall() {
  117. uni.makePhoneCall({
  118. phoneNumber: '10086' //仅为示例
  119. });
  120. },
  121. hanleChoose(){
  122. this.show = true
  123. },
  124. close(){
  125. this.show = false
  126. }
  127. },
  128. onPageScroll(e) {
  129. if (e.scrollTop >= 50) {
  130. this.background = true
  131. } else {
  132. this.background = false
  133. }
  134. },
  135. onReady() {
  136. this.map = uni.createMapContext("map", this);
  137. }
  138. }
  139. </script>
  140. <style lang="scss" >
  141. .refuelDetail{
  142. .banner{
  143. width: 100%;
  144. height: 382rpx;
  145. }
  146. .content{
  147. margin-top: -20rpx;
  148. min-height: 500rpx;
  149. border-radius: 16rpx 16rpx 0 0;
  150. position: relative;
  151. z-index: 2;
  152. background: #fff;
  153. padding: 28rpx 24rpx;
  154. .title{
  155. font-weight: 600;
  156. font-size: 32rpx;
  157. color: #222222;
  158. }
  159. .time{
  160. font-weight: 300;
  161. font-size: 24rpx;
  162. color: #AAAAAA;
  163. padding: 20rpx 0;
  164. border-bottom: 1rpx solid #F0F0F0;
  165. }
  166. .distance{
  167. font-weight: 300;
  168. font-size: 24rpx;
  169. color: #AAAAAA;
  170. padding: 20rpx 0;
  171. }
  172. .address-box{
  173. display: flex;
  174. align-items: center;
  175. justify-content: space-between;
  176. width: 702rpx;
  177. height: 140rpx;
  178. background-image: url('@/static/white-map.png');
  179. background-repeat: repeat;
  180. background-size: 100% 140rpx;
  181. box-sizing: border-box;
  182. padding: 36rpx 24rpx;
  183. .address{
  184. font-weight: 600;
  185. font-size: 24rpx;
  186. color: #222222;
  187. line-height: 40rpx;
  188. overflow: hidden;
  189. padding-right: 20rpx;
  190. text-overflow: ellipsis;
  191. /* 弹性伸缩盒子模型显示 */
  192. display: -webkit-box;
  193. /* 限制在一个块元素显示的文本的行数 */
  194. -webkit-line-clamp: 2;
  195. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  196. -webkit-box-orient: vertical;
  197. }
  198. .btn-box{
  199. display: flex;
  200. .btn+.btn{
  201. margin-left: 16rpx;
  202. }
  203. .btn{
  204. width: 120rpx;
  205. height: 52rpx;
  206. line-height: 52rpx;
  207. text-align: center;
  208. background: #E2ECFF;
  209. border-radius: 26rpx 26rpx 26rpx 26rpx;
  210. font-weight: 300;
  211. font-size: 28rpx;
  212. color: #3879F9;
  213. }
  214. }
  215. }
  216. .price-box{
  217. display: flex;
  218. align-items: center;
  219. justify-content: space-between;
  220. padding: 20rpx 0;
  221. .price{
  222. font-weight: 600;
  223. font-size: 28rpx;
  224. color: #222222;
  225. }
  226. .old-price{
  227. font-weight: 300;
  228. font-size: 24rpx;
  229. color: #AAAAAA;
  230. }
  231. }
  232. .choose-box{
  233. display: flex;
  234. justify-content: space-between;
  235. .item{
  236. width: 340rpx;
  237. height: 80rpx;
  238. line-height: 80rpx;
  239. text-align: center;
  240. background: #F0F0F0;
  241. border-radius: 8rpx;
  242. font-weight: 600;
  243. font-size: 28rpx;
  244. color: #222222;
  245. position: relative;
  246. .icon{
  247. width: 32rpx;
  248. height: 32rpx;
  249. position: absolute;
  250. top: 50%;
  251. right: 24rpx;
  252. transform: translateY(-50%);
  253. }
  254. }
  255. .item.active{
  256. background: #FFF6F5;
  257. color: #FF4D3A;
  258. }
  259. }
  260. }
  261. .buy-box{
  262. position: fixed;
  263. bottom: 0%;
  264. left: 0%;
  265. width: 100%;
  266. background: #fff;
  267. padding: 10rpx 24rpx env(safe-area-inset-bottom);
  268. border-top: 1rpx solid #EEEEEE;
  269. box-sizing: border-box;
  270. .buy-btn{
  271. width: 702rpx;
  272. height: 80rpx;
  273. line-height: 80rpx;
  274. text-align: center;
  275. background: $uni-color-primary;
  276. border-radius: 40rpx;
  277. font-weight: 600;
  278. font-size: 28rpx;
  279. color: #FFFFFF;
  280. }
  281. }
  282. .map{
  283. position: absolute;
  284. top: -9999rpx;
  285. left: -9999rpx;
  286. }
  287. .u-popup__content{
  288. padding: 28rpx 24rpx;
  289. background: #F9F9F9 !important;
  290. .popup-title{
  291. font-weight: 600;
  292. font-size: 32rpx;
  293. color: #222222;
  294. }
  295. .item-box{
  296. width: 100%;
  297. background: #FFFFFF;
  298. border-radius: 16rpx 16rpx 16rpx 16rpx;
  299. margin-top: 20rpx;
  300. padding: 24rpx;
  301. box-sizing: border-box;
  302. .sub-title{
  303. font-weight: 600;
  304. font-size: 28rpx;
  305. color: #222222;
  306. margin-bottom: 20rpx;
  307. }
  308. .box{
  309. display: flex;
  310. flex-wrap: wrap;
  311. .item{
  312. width: 148rpx;
  313. height: 52rpx;
  314. line-height: 52rpx;
  315. text-align: center;
  316. background: #F0F0F0;
  317. border-radius: 8rpx 8rpx 8rpx 8rpx;
  318. font-weight: 400;
  319. font-size: 28rpx;
  320. color: #222222;
  321. margin-bottom: 20rpx;
  322. margin-right: 20rpx;
  323. }
  324. .item.active{
  325. background: #FFF6F5;
  326. color: #EE4320;
  327. }
  328. .item.m0{
  329. margin-right: 0!important;
  330. }
  331. }
  332. }
  333. }
  334. }
  335. </style>