diningCar.vue 4.1 KB

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