menu.vue 4.2 KB

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