xuxy
2024-06-26 563a0f248d37b8820cdb3e46479d7c8c891b3386
sub_pages/farmer/flower-manage/flower-manage.vue
文件名从 pages/farmer/flower-manage/flower-manage.vue 修改
@@ -61,8 +61,10 @@
               <view class="buttons">
                  <view class="button" @click.stop="toDetail(item)">编辑</view>
                  <view class="button" @click.stop="buttonStatus(item,'off')" v-if="item.status=='UP'">下架</view>
                  <view class="button" @click.stop="buttonStatus(item,'up')" v-if="item.status=='OFF'">上架</view>
                  <view class="button" @click.stop="buttonStatus(item,'FORCE_OFF')"
                     v-if="item.status=='FORCE_UP'">下架</view>
                  <view class="button" @click.stop="buttonStatus(item,'FORCE_UP')"
                     v-if="item.status=='FORCE_OFF'">上架</view>
                  <view class="button" @click.stop="openValue(item,'price')">价格</view>
                  <view class="button" @click.stop="openValue(item,'stock')">库存</view>
                  <view class="button" @click.stop="toDetailAdd(item)">复制</view>
@@ -77,16 +79,35 @@
      <!-- 判断是否到底了,自动吧 -->
      <footer-msg :more="page.total>0&&page.total>page.current*page.size"></footer-msg>
      <uni-popup ref="popup_input" type="bottom">
         <view class="component-popup_input">
      <uni-popup ref="popup_input" type="bottom" :mask-click="false">
         <view class="component-popup_input white w-fit" style="padding-bottom: 0rpx;padding: 0px;">
            <view class="p20" style="padding-bottom: 10rpx;">
               <view class="title" v-if="currentInputKey=='price'">
                  修改价格
               </view>
               <view class="title" v-if="currentInputKey=='stock'">
                  修改库存
               </view>
            <!-- 输入框-->
               <!-- 输入框-->
               <view class="flex w-fit">
            <u-input class="bg-white"  v-model="content" :placeholder="inputplaceholder" type="digit" v-if="currentInputKey=='price'"/>
            <u-input  class="bg-white"  v-model="content" :placeholder="inputplaceholder" type="number" v-if="currentInputKey=='stock'"/>
                  <u-input v-model="content" :placeholder="inputplaceholder" type="digit"
                     style="max-width: 390rpx;background-color: #F2F2F2;" v-if="currentInputKey=='price'" />
                  <view v-if="currentInputKey=='price'" class="m-l-10" style="line-height: 78rpx;">元</view>
                  <u-input v-model="content" :placeholder="inputplaceholder" type="number"
                     style="max-width: 390rpx;background-color: #F2F2F2;" v-if="currentInputKey=='stock'" />
               </view>
            </view>
            <!-- 提交按钮 -->
            <view class="button-green" @click="submitValue">提交</view>
            <view class="line-gray" style="margin-bottom: 0px;"></view>
            <view class="flex">
               <u-button type="default" class="w-fit  flex1 " text="取消"
                  @click="()=>{$refs.popup_input.close()}"></u-button>
               <view class="component-line-vert"></view>
               <u-button type="default" class="w-fit flex1 topic-font" t text="确定" @click="submitValue"></u-button>
            </view>
         </view>
      </uni-popup>
   </view>
@@ -103,27 +124,37 @@
            content: '',
            currentInputDto: {},
            currentInputKey: '',
            inputplaceholder:'',
            inputplaceholder: '',
         }
      },
      onLoad(options) {
         this.type = options.type || 'all'
         var title = ''
         //todo 根据type切换查询条件
         if (this.type === 'delete') {
            this.listApi = '/api/supplier/flower/list/rc'
            title = '商品管理-已删除'
         } else {
            this.listApi = '/api/supplier/flower/list'
            this.query.status = ''
            if (this.type === 'inpass') {
               this.query.status = 'PENDING'
               title = '商品管理-待审核'
            }
            if (this.type === 'in') {
               this.query.status = 'UP'
               title = '商品管理-已上架'
            }
            if (this.type === 'unpass') {
               this.query.status = 'REJECT'
               title = '商品管理-审核拒绝'
            }
         }
         if (title) {
            uni.setNavigationBarTitle({
               title: title
            })
         }
         this.getList()
      },
@@ -141,7 +172,7 @@
            this.content = item[key] || ''
            this.currentInputDto = item
            this.currentInputKey = key
            this.inputplaceholder = key=='price'&&'请输入价格(元)' || key=='stock'&&'请输入库存(整数)'  || '请输入'
            this.inputplaceholder = key == 'price' && '请输入价格(元)' || key == 'stock' && '请输入库存(整数)' || '请输入'
            this.$refs.popup_input.open('top')
         },
         async submitValue() {
@@ -186,7 +217,7 @@
            })
         },
         async buttonStatus(item, status) {
            await this.$message.confirm(`确定${status==='off'?'下降':'上架'}此商品吗`)
            await this.$message.confirm(`确定${status==='FORCE_OFF'?'下降':'上架'}此商品吗`)
            this.$message.showLoading()
            this.$http.request('get', '/api/supplier/flower/list/' + status, {
               params: {
@@ -196,7 +227,7 @@
               if (res.code == 0) {
                  this.$message.showToast('操作成功')
                  item.status = status
                  item.statusStr = (status == 'off' ? '下架' : '上架')
                  item.statusStr = (status == 'FORCE_OFF' ? '下架' : '上架')
               }
            }).finally(() => {
               this.$message.hideLoading()
@@ -335,16 +366,18 @@
            // min-width: 90rpx;
            flex: 4;
            // max-width: 90rpx;
            margin-left:14rpx;
            margin-right:14rpx;
            margin-left: 14rpx;
            margin-right: 14rpx;
         }
         .button:first-child {
            margin-left: 0rpx
         }
         .button:last-child {
            margin-right: 0rpx
         }
         .button-add {
            background-image: url('@/static/images/farmer/flower/flower-mange-icon-add-flower.png');