123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>列表-发货仓库-创业帮</title>
- <meta name="keywords" content="列表-发货仓库-创业帮">
- <meta name="description" content="列表-发货仓库-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="列表-发货仓库-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgc-back pt0 ovh" style="padding-top:0;">
- <div class="warehouse" id="app">
- <van-nav-bar class="user_rank_explan_title user_title_normal f16" title="发货仓库" left-arrow @click-left="goback" v-if="toptitleisshow" v-cloak>
- <template #left> <img src="./static/images/icon-comback@2x.png" alt=""></template>
- </van-nav-bar>
- <van-search class="top_search" v-model="searchContent" show-action placeholder="根据仓库名称搜索" @search="onSearch">
- <template #action>
- <div class="searchcolor" @click="onSearch">搜索</div>
- </template>
- </van-search>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="list.length === 0 ? 'isnodata':''">
- <div class="warehouse-list" style="height:calc(100vh - 20px);" v-cloak>
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <van-list v-model="loading" :finished="finished" @load="onLoad" :immediate-check="false">
- <van-address-list v-model="chosenAddressId" :list="list" @select="onSelected"></van-address-list>
- </van-list>
- </div>
- </van-pull-refresh>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- searchContent:'',
- isnodata:false,
- toptitleisshow:false,
- active: 0,
- chosenAddressId: 0,
- list: [
- ],
- checkaddressId:'',
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- loading: false,
- finished: false,
- refreshing: false,
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.getwarehouselist();
- },
- methods: {
- onLoad() {
- this.pageinfo.PageNum++;
- this.getwarehouselist();
- console.log(2)
- },
- onRefresh() {
- this.pageinfo.PageNum = 0;
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.refreshing = false;
- this.pageinfo.PageNum = 1;
- this.getfirwarehouselist();
- },
- onSelected(item) {
- this.checkaddressId = item.Id;
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- async getwarehouselist(){
- //- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const BrandId = PublicLib.getCookieInfo('wareBrandId');
- const res = await getRequest('api/v1/storehouse/sendstores?t='+Math.random(6),JSON.stringify({UserId,...this.pageinfo,searchContent:this.searchContent,BrandId}));
- if(res.status !== '1') return tips('获取仓库列表失败,请重试!')
- //- PublicLib.HideLoading();
- if(res.data.length<this.pageinfo.PageSize) {
- this.finished = true;
- };
- this.list.push(...this.addressfn(res.data));
- this.loading = false;
- if(this.list.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- async getfirwarehouselist(){
- //- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const BrandId = PublicLib.getCookieInfo('wareBrandId');
- const res = await getRequest('api/v1/storehouse/sendstores?t='+Math.random(6),JSON.stringify({UserId,...this.pageinfo,searchContent:this.searchContent,BrandId}));
- if(res.status !== '1') return tips('获取仓库列表失败,请重试!')
- //- PublicLib.HideLoading();
- if(res.data.length<this.pageinfo.PageSize) {
- this.finished = true;
- };
- this.list = this.addressfn(res.data);
- this.loading = false;
- if(this.list.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- //- 地址列表处理函数
- addressfn(data){
- data.forEach((item,index)=>{
- item.name = item.StoreName+`(库存${item.LaveNum}台)`;
- item.address = item.Areas + item.Address ;
- item.tel = '';
- item.id = item.Id;
- })
- return data;
- },
- //- 确认按钮
- onClickButton(){
- if(this.checkaddressId === '') return tips('请选择发货仓库');
- PublicLib.putCookieInfo('warehouseId', this.checkaddressId);
- PublicLib.GoBack({Level:1});
- },
- onSearch(){
- this.list = [];
- this.getwarehouselist();
- },
- }
- });
- </script>
- </body>
- </html>
|