index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class='content'>
  3. <view class='flex align-items-flex-start justify-space-between'
  4. style="background: #fff;padding: 20rpx 20rpx 0 20rpx;">
  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='shop'>
  25. <view style="padding: 20rpx;background: #fff;">
  26. <view class="img-title">店铺照片</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 class="product">
  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' style="margin: 20rpx 0;">
  45. <view>{{item.classifyName}}({{item.dishesNum}})</view>
  46. <view @click='up(item)'>置顶</view>
  47. </view>
  48. <view style='flex-wrap: wrap;justify-content: space-between;' class='flex'>
  49. <view v-for='item1 in item.foodDishesInfoList' class="product-item">
  50. <u--image :showLoading="true" :src="item1.dishImage" width="30vw"
  51. height="30vw"></u--image>
  52. <view class="text-content">
  53. <view class="name">{{item1.dishName}}</view>
  54. <view class="price">¥{{item1.dishPrice}}</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view v-if='showStatus==1'>
  61. <view style='margin:10rpx;' v-for='item1 in currectData.foodGroupInfoList'>
  62. <u--image v-if='item1.showImage' :showLoading="true" :src="item1.showImage" :width="width"
  63. :height="height"></u--image>
  64. <view>{{item1.groupTitle}}</view>
  65. <view class='flex justify-space-between align-item-center'>
  66. <view>{{item1.groupPrice}}</view>
  67. <view class='flex align-item-center'>
  68. <view>已收{{item1.soldNum}}.</view>
  69. <view>已用{{item1.usedNum}}.</view>
  70. <view>待用{{item1.notUseNum}}</view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view v-if='currectData.status=="显示中"||currectData.status=="已隐藏"' class='flex justify-space-between bottom-fixed'>
  78. <view class='merchants_button' @click='addfood'>添加菜品</view>
  79. <!-- <view class='merchants_button' @click='addGroupBuying'>添加团购</view> -->
  80. <view class='merchants_button' @click='shopSetting'>店铺设置</view>
  81. </view>
  82. <view v-else style='margin:20rpx;' class='flex justify-space-between'>
  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=="审核中"||currectData.status=="已禁用"' class='merchants_unable_button'>店铺设置
  88. </view>
  89. <view v-if='currectData.status=="已驳回"'></view>
  90. <view v-if='currectData.status=="已驳回"' class='merchants_button' @click='editCateringindustry'>编辑店铺信息
  91. </view>
  92. <view v-if='currectData.status=="已驳回"'></view>
  93. </view>
  94. <u-picker immediateChange='true' title='选择店铺' @cancel='show = false' @confirm='shopConfirm' :show="show"
  95. :columns="columns" keyName="shopNames"></u-picker>
  96. </view>
  97. </template>
  98. <script>
  99. var that
  100. export default {
  101. data() {
  102. return {
  103. dataList: [],
  104. currectData: {
  105. coverImage: '',
  106. shopNames: '',
  107. detailedAddress: '',
  108. status: ''
  109. },
  110. showStatus: 0,
  111. show: false,
  112. height: '',
  113. width: '',
  114. columns: []
  115. }
  116. },
  117. onLoad() {
  118. that = this
  119. },
  120. onShow() {
  121. this.height = (uni.getSystemInfoSync().windowWidth / 2);
  122. this.width = uni.getSystemInfoSync().windowWidth - 50;
  123. console.log(this.height)
  124. uni.showLoading({
  125. title: '加载中',
  126. mask: true
  127. })
  128. this.$request.baseRequest('admin.tourism.foodInfo', 'list', {
  129. commonId: uni.getStorageSync("userInfo").id,
  130. page: 1,
  131. limit: 9999
  132. }, failres => {
  133. uni.showToast({
  134. icon: "none",
  135. title: failres.errmsg,
  136. duration: 3000
  137. });
  138. uni.hideLoading()
  139. }).then(res => {
  140. for (var i = 0; i < res.data.items.length; i++) {
  141. if (res.data.items[i].indoorImage) {
  142. res.data.items[i].indoorImageArray = res.data.items[i].indoorImage.split(',')
  143. }
  144. if (res.data.items[i].foodGroupInfoList) {
  145. for (var q = 0; q < res.data.items[i].foodGroupInfoList.length; q++) {
  146. var data = res.data.items[i].foodGroupInfoList[q]
  147. if (data.dishImage) {
  148. var images = data.dishImage.split(',')
  149. data.showImage = images[0]
  150. }
  151. }
  152. }
  153. }
  154. this.columns = [res.data.items]
  155. this.dataList = res.data.items
  156. this.currectData = res.data.items[0]
  157. uni.hideLoading()
  158. })
  159. },
  160. methods: {
  161. up(item) {
  162. },
  163. shopConfirm(e) {
  164. console.log(e)
  165. this.currectData = e.value[0]
  166. this.show = false
  167. },
  168. switchShop() {
  169. this.show = true
  170. },
  171. switchShow(status) {
  172. this.showStatus = status
  173. },
  174. addfood() {
  175. uni.navigateTo({
  176. url: '/pageA/enter/myCateringdustry/addfood?foodId=' + this.currectData.id + '&shopNames=' +
  177. this.currectData.shopNames
  178. })
  179. },
  180. editCateringindustry() {
  181. uni.navigateTo({
  182. url: '/pageA/enter/myCateringdustry/edit?foodId=' + this.currectData.id
  183. })
  184. },
  185. addGroupBuying() {
  186. uni.navigateTo({
  187. url: '/pageA/enter/myCateringdustry/addGroupBuying?foodId=' + this.currectData.id +
  188. '&shopNames=' + this.currectData.shopNames
  189. })
  190. },
  191. shopSetting() {
  192. uni.setStorageSync('myCateringdustry', JSON.stringify(this.currectData))
  193. uni.navigateTo({
  194. url: '/pageA/enter/myCateringdustry/shopSetting/index?foodId=' + this.currectData.id +
  195. '&shopNames=' + this.currectData.shopNames
  196. })
  197. }
  198. }
  199. }
  200. </script>
  201. <style lang='scss' scoped>
  202. .head_sculpture {
  203. margin-right: 20rpx;
  204. /* padding: 0 20rpx 20rpx 0; */
  205. }
  206. .shop_image {
  207. margin: 10rpx;
  208. }
  209. .switch_show {
  210. .active {
  211. font-weight: 600;
  212. color: #5F7DE9;
  213. }
  214. }
  215. .shop {
  216. /* margin-top: 20rpx;
  217. background: red; */
  218. .img-title {
  219. font-weight: 700;
  220. margin-bottom: 20rpx;
  221. }
  222. }
  223. .product {
  224. margin-top: 20rpx;
  225. background: #fff;
  226. padding: 20rpx;
  227. .product-item {
  228. margin-bottom: 20rpx;
  229. background: rgba(255, 255, 255, 0.7);
  230. box-shadow: 2px 3px 3px 1px rgba(187, 187, 187, 0.4);
  231. border-radius: 20rpx;
  232. .text-content {
  233. padding: 10rpx;
  234. .name {
  235. font-weight: 700;
  236. text-overflow: ellipsis;
  237. white-space: nowrap;
  238. overflow: hidden;
  239. width: 27vw;
  240. }
  241. .price {
  242. color: #F50808;
  243. }
  244. }
  245. }
  246. }
  247. .merchants_button {
  248. font-size: 32rpx;
  249. padding: 10rpx 40rpx;
  250. }
  251. .content{
  252. padding-bottom: 200rpx;
  253. }
  254. .bottom-fixed{
  255. position: fixed;
  256. bottom: 0;
  257. background: #fff;
  258. width: 100%;
  259. justify-content: space-evenly;
  260. padding: 40rpx;
  261. }
  262. </style>