diningCar.vue 3.4 KB

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