diningCar.vue 3.6 KB

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