diningList.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="mt20px">
  3. <view class="contain">
  4. <view class="box" :class="{ 'boxed-border': showBorder }">
  5. <view class="container">
  6. <view class="text-container">
  7. <view class="flex-item">{{dingName}}</view>
  8. <u-tag plain :text="tags ? '营业中' : '离线'" :type="tags ? 'success' : 'error'" size="mini"></u-tag>
  9. </view>
  10. <view class="icon-container">
  11. <u-icon name="plus-circle" size="24" @click="call"></u-icon>
  12. <u-icon style="margin-left: 10px;" name="info-circle" size="24" @click="btnIC"></u-icon>
  13. </view>
  14. </view>
  15. <view :class="{ 'btnbor': showBorder }" v-if="showBorder">
  16. <u-tag text="镂空" bgColor='#FF6D20' borderColor='#FF6D20' icon="map"></u-tag>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. tags: 1,
  27. showBorder: false,
  28. dingName: '23333',
  29. orderinfo: {},
  30. tableData: []
  31. }
  32. },
  33. created() {
  34. this.fatchDate()
  35. },
  36. methods: {
  37. call() {
  38. if (this.orderinfo.shopCall) {
  39. uni.makePhoneCall({
  40. phoneNumber: this.orderinfo.shopCall
  41. });
  42. } else {
  43. uni.showToast({
  44. icon: 'none',
  45. title: '暂无商家电话'
  46. })
  47. }
  48. },
  49. btnIC() {
  50. uni.navigateTo({
  51. url: `/pages/diningCar/diningCar`
  52. })
  53. },
  54. fatchDate() {
  55. //const result = await this.$request('get', '/diningCar/{id}')
  56. const result = this.$request('get', '/diningCar/queryDiningCar')
  57. if (result) {
  58. console.log('result', result.data)
  59. this.tableData = result.data
  60. }
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .box {
  67. padding: 20rpx 20rpx 0;
  68. height: 80px;
  69. border-bottom-left-radius: 30rpx;
  70. border-bottom-right-radius: 30rpx;
  71. background-position: top;
  72. box-shadow: 0 0 5px 2px #ebebeb;
  73. background-repeat: no-repeat;
  74. border-radius: 20rpx;
  75. background-color: #fff;
  76. }
  77. .boxed-border {
  78. border: 1px solid #FF6D20;
  79. /* 边框样式 */
  80. padding: 20rpx 20rpx 0;
  81. border-radius: 20rpx;
  82. /* 添加圆角 */
  83. .btnbor {
  84. margin-right: -11px;
  85. margin-top: -3px;
  86. float: right;
  87. }
  88. }
  89. .box:hover {
  90. border: 1px solid #FF6D20;
  91. /* 鼠标悬停时显示边框 */
  92. }
  93. .box:active {
  94. border: 1px solid #F54319;
  95. /* 鼠标按下时显示另一种边框颜色 */
  96. }
  97. .container {
  98. display: flex;
  99. /* 使用 Flexbox 布局 */
  100. justify-content: space-between;
  101. /* 子元素之间留有空白 */
  102. }
  103. .text-container {
  104. display: flex;
  105. flex-direction: column;
  106. align-items: flex-start;
  107. /* 左对齐 */
  108. }
  109. .flex-item {
  110. margin-bottom: 10px;
  111. }
  112. .tag-item {
  113. margin-left: auto;
  114. /* 将标签推到右边 */
  115. }
  116. .icon-container {
  117. display: flex;
  118. /* 使用 Flexbox 布局 */
  119. flex-direction: row;
  120. /* 水平排列子元素 */
  121. justify-content: flex-end;
  122. /* 子元素右对齐 */
  123. margin-top: -30px;
  124. gap: 10px; /* 设置图标之间的距离 */
  125. }
  126. </style>