index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class='content'>
  3. <view class='wrap'>
  4. <view class='flex align-items-flex-start justify-space-between'>
  5. <view class="flex">
  6. <view class="head_sculpture">
  7. <u--image :showLoading="true" :src="currectData.coverImage" width="80rpx" height="80rpx"
  8. shape="circle"></u--image>
  9. </view>
  10. <view>
  11. <view @click='switchShop' style='font-size:28rpx;'>{{currectData.shopNames}}
  12. <image src="@/static/image/yjt.png" mode=""
  13. style="margin-left:10rpx;width:12rpx;height: 21rpx;"></image>
  14. </view>
  15. <view style='color:#999;font-size:24rpx;'>{{currectData.detailedAddress}}</view>
  16. </view>
  17. </view>
  18. <view>
  19. <view class='caution' v-if='currectData.status!="显示中"&&currectData.status!="已隐藏"'>
  20. {{currectData.status}}
  21. </view>
  22. </view>
  23. </view>
  24. <view class='wrap'>
  25. <view>
  26. <view style='font-size:28rpx;'>店铺照片</view>
  27. <view style='flex-wrap: wrap;' class='flex'>
  28. <view class='shop_image' v-for='item in currectData.indoorImageArray'>
  29. <u--image :showLoading="true" :radius='10' :src="item" width="100rpx"
  30. height="100rpx"></u--image>
  31. </view>
  32. </view>
  33. </view>
  34. <view style='margin:20rpx 0 30rpx;'>
  35. <view class='switch_show flex' style='font-size:34rpx;'>
  36. <view :class='showStatus==0?"active":""' @click='switchShow(0)'>
  37. 商品展示({{currectData.displaysNum?currectData.displaysNum:0}})</view>
  38. <!-- <view :class='showStatus==1?"active":""' @click='switchShow(1)'>
  39. 团购({{currectData.groupNum?currectData.groupNum:0}})
  40. </view> -->
  41. </view>
  42. <view v-if='showStatus==0' style='font-size:28rpx;'>
  43. <view v-for='item in currectData.dishClassifyInfoList' v-show='item.dishesNum'>
  44. <view class=='flex justify-space-between'>
  45. <view>{{item.classifyName}}({{item.dishesNum}})</view>
  46. <view @click='up(item)' class="merchants_button">置顶</view>
  47. </view>
  48. <view style='flex-wrap: wrap;text-align:center;' class='flex'>
  49. <view style='margin:10rpx;' v-for='item1 in item.foodDishesInfoList'>
  50. <u--image :showLoading="true" :src="item1.dishImage" width="150rpx"
  51. height="150rpx"></u--image>
  52. <view>{{item1.dishName}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view v-if='showStatus==1'>
  58. <view style='margin:10rpx;' v-for='item1 in currectData.foodGroupInfoList'>
  59. <u--image v-if='item1.showImage' :showLoading="true" :src="item1.showImage" :width="width"
  60. :height="height"></u--image>
  61. <view>{{item1.groupTitle}}</view>
  62. <view class='flex justify-space-between align-item-center'>
  63. <view>{{item1.groupPrice}}</view>
  64. <view class='flex align-item-center'>
  65. <view>已收{{item1.soldNum}}.</view>
  66. <view>已用{{item1.usedNum}}.</view>
  67. <view>待用{{item1.notUseNum}}</view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view v-if='currectData.status=="显示中"||currectData.status=="已隐藏"' style='margin:20rpx;'
  75. class='flex justify-space-between'>
  76. <view class='merchants_button' @click='addfood'>添加菜品</view>
  77. <!-- <view class='merchants_button' @click='addGroupBuying'>添加团购</view> -->
  78. <view class='merchants_button' @click='shopSetting'>店铺设置</view>
  79. </view>
  80. <view v-else style='margin:20rpx;' class='flex justify-space-between'>
  81. <view v-if='currectData.status=="审核中"||currectData.status=="已禁用"' class='merchants_unable_button'>添加菜品
  82. </view>
  83. <view v-if='currectData.status=="审核中"||currectData.status=="已禁用"' class='merchants_unable_button'>添加团购
  84. </view>
  85. <view v-if='currectData.status=="审核中"||currectData.status=="已禁用"' class='merchants_unable_button'>店铺设置
  86. </view>
  87. <view v-if='currectData.status=="已驳回"'></view>
  88. <view v-if='currectData.status=="已驳回"' class='merchants_button' @click='editCateringindustry'>编辑店铺信息
  89. </view>
  90. <view v-if='currectData.status=="已驳回"'></view>
  91. </view>
  92. <u-picker immediateChange='true' title='选择店铺' @cancel='show = false' @confirm='shopConfirm' :show="show"
  93. :columns="columns" keyName="shopNames"></u-picker>
  94. </view>
  95. </template>
  96. <script>
  97. var that
  98. export default {
  99. data() {
  100. return {
  101. dataList: [],
  102. currectData: {},
  103. showStatus: 0,
  104. show: false,
  105. height: '',
  106. width: '',
  107. columns: []
  108. }
  109. },
  110. onLoad() {
  111. that = this
  112. },
  113. onShow() {
  114. this.height = (uni.getSystemInfoSync().windowWidth / 2);
  115. this.width = uni.getSystemInfoSync().windowWidth - 50;
  116. console.log(this.height)
  117. uni.showLoading({
  118. title: '加载中',
  119. mask: true
  120. })
  121. this.$request.baseRequest('admin.tourism.foodInfo', 'list', {
  122. commonId: uni.getStorageSync("userInfo").id,
  123. page: 1,
  124. limit: 9999
  125. }, failres => {
  126. uni.showToast({
  127. icon: "none",
  128. title: failres.errmsg,
  129. duration: 3000
  130. });
  131. uni.hideLoading()
  132. }).then(res => {
  133. for (var i = 0; i < res.data.items.length; i++) {
  134. if (res.data.items[i].indoorImage) {
  135. res.data.items[i].indoorImageArray = res.data.items[i].indoorImage.split(',')
  136. }
  137. if (res.data.items[i].foodGroupInfoList) {
  138. for (var q = 0; q < res.data.items[i].foodGroupInfoList.length; q++) {
  139. var data = res.data.items[i].foodGroupInfoList[q]
  140. if (data.dishImage) {
  141. var images = data.dishImage.split(',')
  142. data.showImage = images[0]
  143. }
  144. }
  145. }
  146. }
  147. this.columns = [res.data.items]
  148. this.dataList = res.data.items
  149. this.currectData = res.data.items[0]
  150. uni.hideLoading()
  151. })
  152. },
  153. methods: {
  154. up(item) {
  155. },
  156. shopConfirm(e) {
  157. console.log(e)
  158. this.currectData = e.value[0]
  159. this.show = false
  160. },
  161. switchShop() {
  162. this.show = true
  163. },
  164. switchShow(status) {
  165. this.showStatus = status
  166. },
  167. addfood() {
  168. uni.navigateTo({
  169. url: '/pageA/enter/myCateringdustry/addfood?foodId=' + this.currectData.id + '&shopNames=' +
  170. this.currectData.shopNames
  171. })
  172. },
  173. editCateringindustry() {
  174. uni.navigateTo({
  175. url: '/pageA/enter/myCateringdustry/edit?foodId=' + this.currectData.id
  176. })
  177. },
  178. addGroupBuying() {
  179. uni.navigateTo({
  180. url: '/pageA/enter/myCateringdustry/addGroupBuying?foodId=' + this.currectData.id +
  181. '&shopNames=' + this.currectData.shopNames
  182. })
  183. },
  184. shopSetting() {
  185. uni.setStorageSync('myCateringdustry', JSON.stringify(this.currectData))
  186. uni.navigateTo({
  187. url: '/pageA/enter/myCateringdustry/shopSetting/index?foodId=' + this.currectData.id +
  188. '&shopNames=' + this.currectData.shopNames
  189. })
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang='scss' scoped>
  195. .wrap {
  196. padding: 20rpx;
  197. }
  198. .head_sculpture {
  199. padding: 0 20rpx 20rpx 0;
  200. }
  201. .shop_image {
  202. margin: 10rpx;
  203. }
  204. .switch_show {
  205. .active {
  206. font-weight: 600;
  207. color: #5F7DE9;
  208. }
  209. }
  210. </style>