index.vue 6.5 KB

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