index.vue 6.4 KB

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