storeDetails.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="container-view">
  3. <view class="store-img-view" style="background-image: url('https://qiniu.bms16.com/FhG-xwyMdxPVjYNrxXnq5enGFT-2');background-repeat: no-repeat;background-size: 100% 500rpx;">
  4. </view>
  5. <view class="p-bg">
  6. <view class="store-info-view">
  7. <view class="store-name">{{storeInfo.shop_name}}</view>
  8. <view class="flex-row align-center" style="margin-bottom: 24rpx;">
  9. <view class="store-type">租车</view>
  10. <view class="store-type">租车</view>
  11. <view class="store-type">租车</view>
  12. <view class="store-num-type"> <text class="store-num">7</text> 款车型</view>
  13. <view class="store-phone" @tap="tapPhone"><img style="width: 84rpx;height: 64rpx;" src="https://qiniu.bms16.com/Ft0YA1JYmq66hdoeEN-PgBHy5vLa" alt=""></view>
  14. </view>
  15. <view class="flex-row flex-between">
  16. <view :class="isWorkTimer ? 'left_grid_2' : 'left_grid_1'">
  17. <view class="flex-row">
  18. <img style="width: 40rpx;height: 40rpx;"
  19. :src="!isWorkTimer ? 'https://zxappfile.bms16.com/zx_admin/cab_timer.png' : 'https://zxappfile.bms16.com/zx_admin/cab_timer_work.png'">
  20. <view :class="isWorkTimer ? 'grid_text_1' : 'grid_text_rest' ">{{isWorkTimer ? '营业中' : '已休息'}}
  21. </view>
  22. </view>
  23. <view class="grid_text_2">{{isWorkTimer}}</view>
  24. </view>
  25. <view @tap="bindToNav" class="right_grid flex-between">
  26. <view>
  27. <view class="cab_distance">
  28. 直线距您 600 m
  29. </view>
  30. <view class="cab_address">{{shopInfo.address}}</view>
  31. </view>
  32. <view >
  33. <img class="icon_grid_1" src="https://zxappfile.bms16.com/zx_admin/cab_nav.png">
  34. <view class="grid_nav">导航</view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <useGuidance/>
  40. <view class="unit-type-view">
  41. <view class="unit-type ">日租</view>
  42. <view class="unit-type unit-type-i">日租</view>
  43. <view class="unit-type ">日租</view>
  44. <view class="unit-type ">日租</view>
  45. </view>
  46. <view class="car-info-list-view">
  47. <view class="car-info-view align-center flex-row">
  48. <img class="car-img" src="https://qiniu.bms16.com/FsxOysJT2V3KNYev2YWadvjyKn2j" alt="">
  49. <view class="car-info">
  50. <view class="car-name flex-row">基础智能电动车</view>
  51. <view class="car-model-info">续航70km|重量54kg</view>
  52. <view class="flex-row flex-between">
  53. <view class="unit-type-price flex-row"><text style="margin-right: 8rpx;">日租</text><priceTool :price="50" :font_size="40"/></view>
  54. <view class="lease-btn">立即租</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
  63. <script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
  64. <script>
  65. var config = require('../../common/config.js');
  66. var common = require('../../common/common.js');
  67. var http = require('../../common/http.js');
  68. var storage = require('../../common/storage.js');
  69. import priceTool from '@/component/priceTool/priceTool';
  70. import UseGuidance from '@/component/useGuidance/useGuidance';
  71. export default {
  72. components: {
  73. priceTool,
  74. UseGuidance
  75. },
  76. data() {
  77. return {
  78. storeInfo:{},
  79. isWorkTimer:"00:00-23:59"
  80. };
  81. }
  82. /**
  83. * 生命周期函数--监听页面加载
  84. */
  85. ,
  86. onLoad: function(options) {
  87. console.log(options,'options');
  88. const shop_id = options.admin_id || ''
  89. this.loadStoreDetail(shop_id)
  90. },
  91. /**
  92. * 生命周期函数--监听页面显示
  93. */
  94. onShow: function() {
  95. },
  96. methods: {
  97. loadStoreDetail(shop_id){
  98. const me=this
  99. console.log(shop_id,'shop_id');
  100. http.postApi(config.API_NEAR_SHOP_INFO, {shop_id}, (resp) => {
  101. if (resp.data.code === 200) {
  102. me.setData({
  103. storeInfo:resp.data.data.info
  104. })
  105. }else{
  106. common.simpleToast(resp.data.msg)
  107. }
  108. })
  109. },
  110. tapPhone(){
  111. const me=this
  112. uni.showModal({
  113. content: `您是否要拨打电话${me.storeInfo.link_phone}?`,
  114. confirmText: '确定',
  115. success: (res) => {
  116. if (res.confirm) {
  117. me.clearTimer()
  118. uni.makePhoneCall({
  119. phoneNumber: me.storeInfo.link_phone,
  120. success() {},
  121. fail() {}
  122. })
  123. }
  124. },
  125. fail: (res) => {}
  126. })
  127. },
  128. bindToNav(){
  129. const {
  130. address,
  131. latitude,
  132. longitude,
  133. shop_name
  134. } = this.storeInfo
  135. uni.openLocation({
  136. latitude: latitude - 0,
  137. longitude: longitude - 0,
  138. scale: 15,
  139. name: shop_name,
  140. address: address,
  141. success: function (res) {},
  142. })
  143. },
  144. }
  145. };
  146. </script>
  147. <style>
  148. @import './storeDetails.css';
  149. </style>