menu.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="content">
  3. <view style="padding: 20rpx;">
  4. <view>
  5. <u-search placeholder="搜索美食" v-model="keyword" clearabled :show-action='false'></u-search>
  6. </view>
  7. <view class="head flex">
  8. <image :src="dataObj.coverImage" style="width:60rpx;height:60rpx;border-radius:50%;"></image>
  9. <view class="right">
  10. {{dataObj.shopNames}}
  11. </view>
  12. </view>
  13. <view class="wrap1" v-if="dataObj.dishClassifyInfoList&&dataObj.dishClassifyInfoList.length>0">
  14. <view class="item1" v-for="item in dataObj.dishClassifyInfoList"
  15. v-if="item.foodDishesInfoList&&item.foodDishesInfoList.length>0">
  16. <view style='font-weight:600;' class="row">
  17. {{item.classifyName}}
  18. </view>
  19. <view style='flex-wrap: wrap;' class="flex"
  20. v-if="item.foodDishesInfoList&&item.foodDishesInfoList.length>0">
  21. <view class="item2" v-for="item1 in item.foodDishesInfoList">
  22. <image :src="item1.dishImage" mode="" class="img"></image>
  23. <view class="bottom">
  24. <view class="name">
  25. {{item1.dishName}}
  26. </view>
  27. <view class="price" v-if="dataObj.lookFlag==0">
  28. ¥{{item1.dishPrice}}
  29. </view>
  30. <view class="" v-else>
  31. 暂无价格
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="bottom-wrap">
  40. <view class="left" :style='{width:dataObj.contactsPhone?"60vw":"100vw",}'>
  41. <text>营业时间:</text>
  42. <text>{{dataObj.startDate}}~{{dataObj.startDate}}</text>
  43. </view>
  44. <view @click='toTel' v-if='dataObj.contactsPhone' class="right flex align-item-center">
  45. <view style=''><u-icon name="phone" color='#fff' size="20"></u-icon></view>
  46. <view style="font-size: 36rpx;">电话订餐</view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. var that;
  53. export default {
  54. data() {
  55. return {
  56. keyword: '',
  57. dataObj: {
  58. shopNames: ''
  59. }
  60. };
  61. },
  62. onLoad(options) {
  63. that = this
  64. console.log(options.val)
  65. this.id = JSON.parse(options.val).id
  66. this.init()
  67. },
  68. methods: {
  69. toTel() {
  70. that.$request.baseRequest('admin.tourism.phoneRecordInfo', 'add', {
  71. phoneRecordInfo: JSON.stringify({
  72. commonId: uni.getStorageSync("userInfo").id,
  73. phone: this.dataObj.contactsPhone
  74. })
  75. }, failres => {
  76. uni.showToast({
  77. icon: "none",
  78. title: failres.errmsg,
  79. duration: 3000
  80. });
  81. }).then(res => {
  82. uni.makePhoneCall({
  83. phoneNumber: this.dataObj.contactsPhone, // 成功回调
  84. success: (res) => {
  85. console.log('调用成功!')
  86. },
  87. // 失败回调
  88. fail: (res) => {
  89. console.log('调用失败!')
  90. }
  91. })
  92. })
  93. },
  94. init() {
  95. uni.showLoading({
  96. title: '数据加载中'
  97. })
  98. that.$request.baseRequest('admin.tourism.foodInfo', 'list', {
  99. page: 1,
  100. limit: 10,
  101. id: this.id
  102. }, failres => {
  103. uni.showToast({
  104. icon: "none",
  105. title: failres.errmsg,
  106. duration: 3000
  107. });
  108. }).then(res => {
  109. uni.hideLoading()
  110. this.dataObj = res.data.items[0]
  111. console.log(this.dataObj)
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. page {
  119. background: #fff;
  120. }
  121. .content {
  122. box-sizing: border-box;
  123. background: #fff;
  124. padding-bottom: 200rpx;
  125. }
  126. .head {
  127. padding: 20rpx 0;
  128. .right {
  129. margin-left: 20rpx;
  130. }
  131. }
  132. .wrap1 {
  133. .item1 .row {
  134. position: relative;
  135. padding-left: 20rpx;
  136. margin: 20rpx;
  137. }
  138. .item1 .row:before {
  139. position: absolute;
  140. content: '';
  141. background: #fbb612;
  142. width: 6rpx;
  143. height: 40rpx;
  144. top: 2px;
  145. left: 0px;
  146. }
  147. .item2 {
  148. display: inline-block;
  149. width: calc(50vw - 40rpx);
  150. margin: 10rpx;
  151. box-shadow: 0px 1px 2px 0px #ccc;
  152. border-radius: 20rpx;
  153. .bottom {
  154. padding: 20rpx;
  155. .name {
  156. margin-bottom: 20rpx;
  157. }
  158. .price {
  159. color: #fbb612;
  160. }
  161. }
  162. }
  163. .img {
  164. border-radius: 20rpx 20rpx 0 0;
  165. width: calc(50vw - 40rpx);
  166. height: calc(50vw - 40rpx);
  167. // width: 344rpx;
  168. // height: 344rpx;
  169. }
  170. }
  171. .bottom-wrap {
  172. position: fixed;
  173. width: 100vw;
  174. bottom: 0;
  175. display: flex;
  176. background-color: red;
  177. .left {
  178. padding: 40rpx;
  179. background: #f7f4ed;
  180. width: 60vw;
  181. box-sizing: border-box;
  182. }
  183. .right {
  184. box-sizing: border-box;
  185. padding: 40rpx;
  186. width: 40vw;
  187. background: #fbb612;
  188. color: #fff;
  189. }
  190. }
  191. </style>