index.vue 11.9 KB
Newer Older
阮藤's avatar
阮藤 committed
1
<template>
2 3 4 5 6
  <view>
    <!-- 展示图 -->
    <view id="header" class="back_img">
      <u-navbar title="" :border-bottom="false" :background="background">
        <template slot="right">
DongRuifen's avatar
DongRuifen committed
7 8 9
          <view @click="searchCli" class="u-m-r-24 search">
            <image class="hs-img" src="../../static/images/home/search@2x.png" mode=""></image>
          </view>
10 11 12 13 14 15 16 17 18 19 20
        </template>
      </u-navbar>
    </view>
    <!-- 按钮 -->
    <view class="home_btn">
      <view class="" v-for="item in buts" @click="goCli(item.url)">
        <image class="hs-img-56" :src="item.img" mode=""></image>
        <view class="u-m-t-8">{{ item.name }}</view>
      </view>
    </view>
    <!-- 提示信息 -->
李星剑's avatar
李星剑 committed
21
    <view v-if="abolishIds.length > 0" class="u-m-t-20 tips background_d5aa7a u-font-28">
22 23 24 25
      <view>
        {{ abolishIds.length }}个委托单
        <span class="color_fff">等待确认寄样,请尽快确认!</span>
      </view>
李星剑's avatar
李星剑 committed
26
      <view class="color_fff btn u-p-l-10 u-p-r-10" @click="sampleConfirm">寄样确认</view>
27 28
    </view>
    <!-- 具体内容  我的面料 -->
DongRuifen's avatar
DongRuifen committed
29 30 31 32 33 34 35 36 37
    <view class="home_con u-m-t-20">
      <view class="home_con_tit">
        <view>
          <span class="u-font-32">我的面料</span>
          <span style="line-height: 0;" class="u-m-l-10 color_000 u-font-24">MY FABRIC</span>
        </view>
        <view class="u-font-24 color_d5aa7a" @click="seeFabric">查看更多</view>
      </view>
      <view class="home_con_fabric">
DongRuifen's avatar
DongRuifen committed
38 39 40 41 42
        <view class="home_con_content u-m-t-24" @click="detailFabric(item)" v-for="(item,index) in fiabricList" :key="index">
          <image v-if="index==0" class="hs-img" src="../../static/images/home/1@2x.png" mode="aspectFill"></image>
          <image v-if="index==1" class="hs-img" src="../../static/images/home/2@2x.png" mode="aspectFill"></image>
          <image v-if="index==2" class="hs-img" src="../../static/images/home/3@2x.png" mode="aspectFill"></image>
          <image v-if="index==3" class="hs-img" src="../../static/images/home/4@2x.png" mode="aspectFill"></image>
DongRuifen's avatar
DongRuifen committed
43 44 45 46
          <view class="home_con_content_font ov_hiden">{{ item.materialName }}</view>
        </view>
      </view>
    </view>
47 48 49 50
    <!-- 具体内容  我的订单 -->
    <view class="home_con u-m-t-20">
      <view class="home_con_tit">
        <view>
李星剑's avatar
李星剑 committed
51
          <span class="u-font-32" @click="pay">潜在客户</span>
李星剑's avatar
李星剑 committed
52
          <span class="u-m-l-10 color_000 u-font-24">MY ORDER</span>
53
        </view>
李星剑's avatar
李星剑 committed
54
        <!--				<view class="u-font-24 color_d5aa7a">查看更多</view>-->
55 56
      </view>
      <view class="home_con_order">
李星剑's avatar
李星剑 committed
57
        <view class="u-p-t-20  u-p-b-20 ">
DongRuifen's avatar
DongRuifen committed
58 59
          <u-search placeholder="请输入客户名称" v-model="keyWord" border-color="#e1e1e1" height="76"
            @search="searchPotentialCustomers" bg-color="#fff" :show-action="false"></u-search>
李星剑's avatar
李星剑 committed
60
        </view>
DongRuifen's avatar
DongRuifen committed
61
        <view class="item item--round" v-for="(item) in list" @click="$Router.push({
李星剑's avatar
李星剑 committed
62 63 64 65
             path: '/pages/order/item',
             query:{
               id: item.enterpriseId
             }
DongRuifen's avatar
DongRuifen committed
66
           })">
李星剑's avatar
李星剑 committed
67 68
          <view class="u-font-32 u-m-b-8 u-line-1">{{ item.fullName }}</view>
          <view class="u-font-24">更新时间:{{ item.createTime }}</view>
69
        </view>
李星剑's avatar
李星剑 committed
70 71 72
        <!-- 加载更多 -->
        <u-loadmore v-if="!isEmpty" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
        <!-- 缺省页 -->
DongRuifen's avatar
DongRuifen committed
73
        <hs-empty v-if="isEmpty" tipText="没有数据" marginTop="100rpx" :image="emptyImage"></hs-empty>
74 75
      </view>
    </view>
李星剑's avatar
李星剑 committed
76 77

    <hs-tab-bar></hs-tab-bar>
78
  </view>
阮藤's avatar
阮藤 committed
79 80
</template>
<script>
DongRuifen's avatar
DongRuifen committed
81 82 83 84 85 86 87 88 89 90
  import HsTabBar from "../../components/hs-tab-bar/hs-tab-bar";
  export default {
    components: {
      HsTabBar
    },
    data() {
      return {
        emptyImage: require("@/static/images/components/empty/empty.png"),
        background: {
          backgroundColor: 'rgba(245,245,245,0)'
91
        },
DongRuifen's avatar
DongRuifen committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
        quantityNum: 0,
        exceptionNum: 0,
        abolishIds: [],
        // 我的面料
        fiabricList: [],
        buts: [{
            name: '面料建模',
            img: '../../static/images/home/fabricModeling@2x.png',
            url: '/pages/fabricModeling/modelingOrder'
          },
          {
            name: '搜款',
            img: '../../static/images/home/styleEntrustment@2x.png',
            url: '/pages/material/list'
          },
          {
            name: '上架管理',
            img: '../../static/images/home/styleManageme@2x.png',
            url: '/pages/material/entrustManagement'
          }
          // TODO 旧版本  可能以后会用到
          // {
          // 	name: '面料建模',
          // 	img: '../../static/images/home/fabricModeling@2x.png',
          // 	url: '/pages/fabricModeling/modelingOrder'
          // },
          // {
          // 	name: '款式委托',
          // 	img: '../../static/images/home/styleEntrustment@2x.png',
          // 	url: '/pages/home/styleEntrustment'
          // },
          // {
          // 	name: '检测委托',
          // 	img: '../../static/images/home/styleManageme@2x.png',
          // 	url: ''
          // },
          // {
          // 	name: '款式管理',
          // 	img: '../../static/images/home/testCommission@2x.png',
          // 	url: ''
          // }
        ],
李星剑's avatar
李星剑 committed
134

DongRuifen's avatar
DongRuifen committed
135 136 137 138 139 140 141
        keyWord: '',
        loadStatus: 'loadmore',
        pageOptions: {
          current: 1,
          size: 10,
        },
        list: []
李星剑's avatar
李星剑 committed
142
      };
DongRuifen's avatar
DongRuifen committed
143 144 145 146 147 148 149 150 151 152
    },
    computed: {
      isEmpty() {
        return this.list.length === 0
      }
    },
    onLoad() {
      // this.toBeSelectedQuantity();
      // this.orderTicketExceptionNum();
      // this.noSampleOrder();
DongRuifen's avatar
DongRuifen committed
153
      this.materialList();
DongRuifen's avatar
DongRuifen committed
154
      // 潜在客户
李星剑's avatar
李星剑 committed
155 156
      this.potentialCustomersPage();
    },
DongRuifen's avatar
DongRuifen committed
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
    onPageScroll(object) {
      let height = 486 / 2;
      if (object.scrollTop >= height) {
        this.background.backgroundColor = 'rgba(245,245,245,1)';
      } else {
        this.background.backgroundColor = 'rgba(245,245,245,0)';
      }
    },
    methods: {
      pay() {
        this.$Router.push({
          path: '/pages/webview/index'
        })
      },
      searchPotentialCustomers() {
        this.pageOptions = {
          current: 1,
          size: 10,
        };
        this.potentialCustomersPage();
      },
      // 潜在客户
      potentialCustomersPage() {
        this.loadStatus = 'loading';
        this.$http("stylelibraryorder.potentialCustomersPage", {
            ...this.pageOptions,
            customerName: this.keyWord,
            status: 0
          })
李星剑's avatar
李星剑 committed
186
          .then(res => {
DongRuifen's avatar
DongRuifen committed
187 188 189 190
            let {
              code,
              data
            } = res;
李星剑's avatar
李星剑 committed
191
            if (code === 200) {
DongRuifen's avatar
DongRuifen committed
192
              if (Object.keys(data).length > 0) {
李星剑's avatar
李星剑 committed
193 194
                this.list = data.records;
                this.pageOptions.pages = data.total;
DongRuifen's avatar
DongRuifen committed
195 196
                this.loadStatus = this.list.length < data.total ? 'loadmore' : 'nomore';
              } else {
李星剑's avatar
李星剑 committed
197 198 199 200 201
                this.list = []
                this.loadStatus = 'nomore';
              }
            }
          })
DongRuifen's avatar
DongRuifen committed
202 203 204 205 206 207
      },
      // 触底加载更多
      onReachBottom() {
        if (this.pageOptions.current < this.pageOptions.pages) {
          this.pageOptions.current += 1;
          this.potentialCustomersPage();
208
        }
DongRuifen's avatar
DongRuifen committed
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
      },
      // 选款总数
      toBeSelectedQuantity() {
        this.$http('orderTicket.toBeSelectedQuantity', {}).then(res => {
          let {
            code,
            data
          } = res;
          if (code == 200) {
            this.quantityNum = data;
          }
        });
      },
      // 异常总数
      orderTicketExceptionNum() {
        this.$http('orderTicket.orderTicketExceptionNum', {}).then(res => {
          let {
            code,
            data
          } = res;
          if (code == 200) {
            this.exceptionNum = data;
          }
        });
      },
      // 寄样单总数
      noSampleOrder() {
        this.$http('orderTicket.noSampleOrder', {}).then(res => {
          let {
            code,
            data
          } = res;
          if (code == 200) {
            this.abolishIds = data;
          }
        });
      },
      // 我的面料
      materialList() {
DongRuifen's avatar
DongRuifen committed
248
        this.$http('materialinfo.getMaterialList', {
DongRuifen's avatar
DongRuifen committed
249
          size: 4,
DongRuifen's avatar
DongRuifen committed
250 251
          "current": 1,
          "materialType": "面料",
DongRuifen's avatar
DongRuifen committed
252 253 254 255 256 257 258 259
          materialCode: '',
          materialName: ''
        }).then(res => {
          let {
            code,
            data
          } = res;
          if (code == 200) {
DongRuifen's avatar
DongRuifen committed
260
            this.fiabricList = data.page.records;
DongRuifen's avatar
DongRuifen committed
261 262 263 264 265 266 267 268 269 270 271
          }
        });
      },
      searchCli() {
        // 搜索面料===1  搜索建模===2
        this.$Router.push('/pages/home/search');
      },
      seeFabric() {
        this.$Router.push('/pages/home/fabricList');
      },
      detailFabric(data) {
DongRuifen's avatar
DongRuifen committed
272
        this.$Router.push('/pages/home/detail?id=' + data.id);
DongRuifen's avatar
DongRuifen committed
273 274 275 276 277 278 279 280 281 282 283 284
      },
      sampleConfirm() {
        this.$Router.push('/pages/home/sampleConfirmation?abolishIds=' + this.abolishIds);
      },
      goCli(url) {
        if (url) {
          this.$Router.push(url);
        } else {
          uni.showToast({
            title: '该功能正在开发中...',
            icon: 'none'
          })
285 286
        }
      }
李星剑's avatar
李星剑 committed
287
    }
DongRuifen's avatar
DongRuifen committed
288
  };
阮藤's avatar
阮藤 committed
289 290
</script>
<style lang="scss" scoped>
DongRuifen's avatar
DongRuifen committed
291 292 293 294 295 296 297 298 299 300 301 302
  .item--round {
    border-radius: 8rpx;
  }

  .item {
    padding: 36rpx 30px;
    height: 160rpx;
    background: url(~@/static/images/home/exhibition.png) no-repeat;
    background-size: 100% 100%;
    margin-bottom: 20rpx;
    color: #fff;
  }
李星剑's avatar
李星剑 committed
303

DongRuifen's avatar
DongRuifen committed
304 305
  .back_img {
    height: 486rpx;
306
    width: 100%;
DongRuifen's avatar
DongRuifen committed
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
    background: url(~@/static/images/home/exhibition.png) no-repeat;
    background-size: 100% 100%;
  }

  .home_top {
    position: relative;
    width: 100%;
    height: 486rpx;

    .home_top_out {
      position: absolute;
      top: 20rpx;
      width: 100%;
      padding: 0 20rpx;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .out {
        width: 32rpx;
        height: 32rpx;
      }
    }
  }

  .search {
    width: 60rpx;
    height: 60rpx;
  }

  .tips {
338
    display: flex;
DongRuifen's avatar
DongRuifen committed
339
    height: 80rpx;
340
    align-items: center;
DongRuifen's avatar
DongRuifen committed
341 342
    justify-content: space-around;
    padding: 0 20rpx;
343
  }
DongRuifen's avatar
DongRuifen committed
344 345

  .home_btn {
346
    width: 100%;
DongRuifen's avatar
DongRuifen committed
347
    height: 180rpx;
348
    display: flex;
DongRuifen's avatar
DongRuifen committed
349 350 351 352
    justify-content: space-around;
    align-items: center;
    text-align: center;
    background: #fff;
353
  }
DongRuifen's avatar
DongRuifen committed
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401

  .home_con {
    width: 100%;
    box-sizing: border-box;
    padding: 30rpx;
    background: #fff;

    .home_con_tit {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
    }

    .home_con_fabric {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
    }

    .home_con_order {
      // display: flex;
      // flex-wrap: wrap;
      // justify-content: space-between;
    }
  }

  .home_con_content {
    position: relative;
    width: 48%;
    height: 160rpx;
    border-radius: 8rpx;
    overflow: hidden;

    // background-image: url(../../static/images/home/1@2x.png);
    .home_con_content_font {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: 60rpx;
      line-height: 60rpx;
      box-sizing: border-box;
      padding: 0 10rpx;
      background: rgba(255, 255, 255, 0.8);
    }
  }

  .home_con_content_order {
402
    display: flex;
DongRuifen's avatar
DongRuifen committed
403
    align-items: center;
404
    justify-content: space-between;
DongRuifen's avatar
DongRuifen committed
405 406 407 408 409 410 411 412 413 414 415 416 417
    height: 160rpx;
    border-radius: 8rpx;
    overflow: hidden;

    .order_tit {
      flex-direction: column;
      display: flex;
      justify-content: center;
      padding: 20rpx;
      flex: 1;
      height: 100%;
      background: rgba(172, 166, 166, 0.5);
    }
418
  }
DongRuifen's avatar
DongRuifen committed
419 420 421 422 423

  .ov_hiden {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
424
  }
DongRuifen's avatar
DongRuifen committed
425 426 427 428 429 430

  .btn {
    line-height: 50rpx;
    text-align: center;
    height: 50rpx;
    border: 1rpx solid #fff;
431
  }
DongRuifen's avatar
DongRuifen committed
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450

  .color_000 {
    color: rgba(0, 0, 0, 0.2);
  }

  .color_d5aa7a {
    color: #d5aa7a;
  }

  .color_dda973 {
    color: #dda973;
  }

  .color_fff {
    color: #fff;
  }

  .background_d5aa7a {
    background: #d5aa7a;
451
  }
DongRuifen's avatar
DongRuifen committed
452
</style>