xuxueyang
2024-09-12 18d59ca85b2bc9ccac4a90203c3b2486acf3b113
sub_pages/customer/trade/trade.vue
@@ -1,22 +1,37 @@
<template>
   <view class="container-trade" :style="{'min-height':hidefooter?'':'calc(100vh - 20rpx)'}">
      <view class="search-container m-t-12 flex" v-if="!hidefooter">
         <view class="flex m-r-20">
         <!-- <view class="flex m-r-20">
            <view class="m-r-10" style="line-height: 80rpx;" @click="changeSearchType">
               {{type=='category'?'按分类':'按店铺'}}
            </view>
            <u-icon name="arrow-down"></u-icon>
         </view> -->
         <view class="flex m-r-20">
            <um-dropdown width="200rpx" style="line-height: 80rpx;" @change="fnChange" :defaultIndex="def" rangeKey="label" :optionList="typeList"></um-dropdown>
         </view>
         <view class="flex1 input">
            <u-input :placeholder="type==='category'?'请输入分类名称':'请输入店铺名称'" v-model="query.name" clearable
            <!-- <u-input :placeholder="type==='category'?'请输入分类名称':'请输入店铺名称'" v-model="query.name" clearable
               @confirm="buttonSearchFlow" @clear="()=>{
               $nextTick(()=>{buttonSearchFlow()})
            }">
               <template slot="suffix">
                  <uni-icons color="#20613D" type="search" size="24" @click="buttonSearchFlow"></uni-icons>
               </template>
            </u-input> -->
            <u-input :placeholder="search_home_placeholder" v-model="search_flow" clearable @confirm="buttonSearchFlow" @clear="()=>{
               $nextTick(()=>{buttonSearchFlow()})
            }">
               <!-- <u--text text="http://" slot="prefix" margin="0 3px 0 0" type="tips"></u--text> -->
               <template slot="suffix">
                  <uni-icons color="#20613D" type="search" size="24" @click="buttonSearchFlow"></uni-icons>
               </template>
            </u-input>
         </view>
      </view>
      <view class="canteen-items" :style="{'min-height':hidefooter?'':'calc(100vh - 340rpx)'}">
@@ -126,6 +141,18 @@
            },
            currentCategory: {},
            type: 'category', //supplier
            def: 0,
            typeList:[
               {
                  label: '按鲜花',
                  value: 'flower',
               },
               {
                  label: '按店铺',
                  value: 'supplier',
               },
            ],
            search_home_placeholder:"请输入花名",
         }
@@ -192,6 +219,28 @@
         })
      },
      methods: {
         fnChange(e) {
            this.type = e.value
            if (this.type == 'flower') {
               this.search_home_placeholder = '请输入花名'
               uni.setNavigationBarTitle({
                 title: '搜鲜花',
                 success: function() {
                   // console.log('标题搜鲜花修改成功');
                 }
               });
            } else {
               this.search_home_placeholder = '请输入店铺名'
               uni.setNavigationBarTitle({
                 title: '搜店铺',
                 success: function() {
                   // console.log('标题搜店铺修改成功');
                 }
               });
            }
         },
         changeSearchType() {
            if (this.type == 'category') {
               this.type = 'supplier'