index.vue 6.8 KB

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