diningCar.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view>
  3. <view class="boxWarp mb20px">
  4. <view class="box" style="height:100vh;">
  5. <my-swiper v-if="dinList.diningCarImg && dinList.diningCarImg.length"
  6. :datas="dinList.diningCarImg" />
  7. <div v-else>
  8. <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
  9. </u-empty>
  10. </div>
  11. <!-- <my-swiper :datas="dinList.diningCarImg" /> -->
  12. <view class="boxContent2" style="margin-top:-10%;">
  13. <view class="clearfix" style="margin-bottom: 10px;">
  14. <text class="fz26px" style="font-weight: bold;">{{dinList.name ? dinList.name : '无'}}</text>
  15. <u-line dashed></u-line>
  16. </view>
  17. <view class="flex-container">
  18. <text class="flex-item">营业状态</text>
  19. <u-tag class="flex-item tag-item" plain :text="dinList.openState ? '营业中' : '离线'"
  20. :type="dinList.openState ? 'success' : 'error'" size="mini"></u-tag>
  21. </view>
  22. <text>客服电话:{{dinList.customerPhone ? dinList.customerPhone : '无'}}</text>
  23. </view>
  24. <view class="footer">
  25. <u-button type="primary" shape="circle" icon="phone" text="拨打客服电话"
  26. color="linear-gradient(to right, #F54319, #FF6D20)" @click="call()"></u-button>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. img: 'https://cdn.uviewui.com/uview/album/1.jpg',
  37. orderinfo: {},
  38. dinList: {
  39. name: '23333',
  40. openState: 1,
  41. imageUrl: ''
  42. },
  43. swiperDatas: [{
  44. img: '../../static/banner1.jpg'
  45. }, {
  46. img: '../../static/banner2.png'
  47. }],
  48. }
  49. },
  50. onLoad(e) {
  51. this.fatchDate(e);
  52. },
  53. methods: {
  54. call() {
  55. if (this.dinList.customerPhone) {
  56. uni.makePhoneCall({
  57. phoneNumber: this.dinList.customerPhone
  58. });
  59. } else {
  60. uni.showToast({
  61. icon: 'none',
  62. title: '暂无商家电话'
  63. })
  64. }
  65. },
  66. async fatchDate(e) {
  67. console.log('e===========================e', e)
  68. var queryParmas = {
  69. id: e.id
  70. }
  71. console.log('idididididid', queryParmas)
  72. const result = await this.$request('post', '/sale/diningCar/queryDiningCarById', queryParmas, true)
  73. if (result) {
  74. console.log("result", result)
  75. this.dinList = result.data
  76. // this.dinList.diningCarImg = JSON.parse(result.data.diningCarImg)
  77. this.dinList.diningCarImg = JSON.parse(result.data.diningCarImg).map(item => {
  78. return {...item, img: item.url, ...(item.url ? {url: undefined} : {})};
  79. });
  80. console.log('this.dinList', this.dinList)
  81. console.log('this.dinList.diningCarImg', this.dinList.diningCarImg)
  82. }
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .font {
  89. font-family: "CustomFont";
  90. color: #fff;
  91. }
  92. .flex-container {
  93. display: flex;
  94. align-items: center;
  95. /* 垂直居中 */
  96. justify-content: flex-start;
  97. /* 水平左对齐 */
  98. }
  99. .flex-item {
  100. /* 根据需要设置text的宽度 */
  101. width: 100%;
  102. /* 或者其他适当的宽度 */
  103. }
  104. .tag-item {
  105. margin-left: auto;
  106. /* 将标签推到右边 */
  107. }
  108. .box {
  109. padding: 20rpx 0;
  110. // background-image: linear-gradient(#00a551 10%, #fff 30%);
  111. border-bottom-left-radius: 30rpx;
  112. border-bottom-right-radius: 30rpx;
  113. background-position: top;
  114. box-shadow: 0 0 5px 2px #ebebeb;
  115. background-repeat: no-repeat;
  116. }
  117. .linear2 {
  118. // background-image: linear-gradient(#00a551 20%, #fff 50%);
  119. background-image: url('{{dinList.imageUrl}}');
  120. // background-image: url('https://cdn.uviewui.com/uview/album/1.jpg');
  121. }
  122. .boxText {
  123. font-size: 28rpx;
  124. line-height: 40rpx;
  125. color: #c8c9cc;
  126. }
  127. .tabFlexBox {
  128. display: flex;
  129. text-align: center;
  130. // background-color: #fff;
  131. padding-bottom: 10rpx;
  132. }
  133. .tabFlexBox .tabFlexBoxItem {
  134. flex: 1;
  135. position: relative;
  136. }
  137. .tabFlexBox .tabFlexBoxItem .tabFlexBoxItemTitle {
  138. font-size: 36rpx;
  139. font-weight: bold;
  140. line-height: 80rpx;
  141. }
  142. .tabFlexBox .tabFlexBoxItem .tabFlexBoxItemDes {
  143. color: #c8c9cc;
  144. font-size: 28rpx;
  145. line-height: 40rpx;
  146. display: inline-block;
  147. padding: 0 20rpx;
  148. }
  149. .tabFlexBox .tabFlexBoxItem .tabFlexBoxItemLine {
  150. width: 1px;
  151. height: 50rpx;
  152. background-color: #c8c9cc;
  153. position: absolute;
  154. top: 50%;
  155. transform: translateY(-50%);
  156. right: 0;
  157. }
  158. .tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemTitle {
  159. color: #00a551;
  160. font-size: 40rpx;
  161. }
  162. .tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemDes {
  163. background-color: #00a551;
  164. border-radius: 20rpx;
  165. color: #fff;
  166. }
  167. .boxContent2 {
  168. border-radius: 60rpx;
  169. background-color: #fff;
  170. padding: 40rpx;
  171. position: relative; // 确保它相对于其父元素定位
  172. z-index: 2;
  173. }
  174. .carList {
  175. display: flex;
  176. // flex-wrap: wrap;
  177. }
  178. .footer {
  179. flex-direction: column;
  180. position: fixed;
  181. left: 5px;
  182. right: 5px;
  183. bottom: 10px;
  184. }
  185. </style>