123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <!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="pb0 ovh pt0">
- <div class="warehouse-mini" id="app" v-cloak style="height:100vh;background-color: #F6F6F6;">
- <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow title="小分仓" v-if="toptitleisshow" @click-left="goback">
- <template #left><img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <van-search class="top_search" v-model="searchContent" show-action placeholder="请输入创客编号或机具SN号后8位搜索" @search="onSearch">
- <template #action>
- <div class="df">
- <div class="searchcolor mr12" @click="onSearch">搜索</div>
- </div>
- </template>
- </van-search>
- <div class="ovh-x" ref="wrapper1">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;min-height:10vh;">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="!isdata"></van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="true" v-else>
- <div class="infoBox bgcfff" v-for="creator,creind in creatorList" v-if="creator.BrandList.length !== 0">
- <div class="userpanel df aic">
- <div class="imgbox tc mr12 df aic fl-dr-col"><img class="headportrait" :src="creator.HeadPhoto ? showHost + creator.HeadPhoto : 'http://ap.kexiaoshuang.com/default.png'" alt=""><img class="grade_rank" :src="gradephoto[creator.UserLevel-1]" alt=""></div>
- <div class="userinfo jcsb df fl-dr-col">
- <div class="name f14"> <span class="mr12">{{creator.UserName}}</span><span>{{creator.MakerCode}}</span></div>
- <div class="phonenumber f12 c999">{{creator.phoneNum}}</div>
- </div>
- <button class="c333 leftbtn f12" @click="takephone(creator.Mobile)">联系TA</button>
- </div>
- <div class="df jcsb fl-dr-col c000 mb6" v-for="(item,index) in creator.BrandList" :key="index">
- <div class="df aic"><img class="mr8 brandimg" :src="'./static/images/product-short'+item.Id+'.png'" alt="">
- <div class="f14 c333">{{item.Name}}</div>
- </div>
- <div class="df jcsb aic" v-for="i,ind in item.SnList" :key="i.Id">
- <div class="f12" style="width:4.1rem">{{i.SnNo}}</div>
- <div class="sendStatus" :class="{active : i.Status,'not-active': !i.Status}">{{i.Status ? '已确认' : '待确认'}}</div>
- <div class="btn f12" @click="withdraw(i,index,creind)">撤回</div>
- </div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </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>
- Vue.use(vant.Lazyload);
- let app = new Vue({
- el: '#app',
- data(){
- return{
- toptitleisshow,
- searchContent:'',
- refreshing:false,
- finished:false,
- loading:false,
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- gradephoto:[
- './static/images/grade-k1.png',
- './static/images/grade-k2.png',
- './static/images/grade-k3.png',
- './static/images/grade-k4.png',
- './static/images/grade-k5.png',
- './static/images/grade-k6.png',
- './static/images/grade-k7.png',
- './static/images/grade-k8.png',
- './static/images/grade-k9.png',
- ],
- creatorList:[
- ],
- isdata:false,
- }
- },
- created(){
- this.getminiWarehouse()
- },
- beforeUpdate(){
- this.$nextTick(()=>{
- this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 50}px`;
- })
- },
- methods:{
- goback(){
- PublicLib.GoBack({Level:1});
- },
- takephone(phonenum){
- PublicLib.PhoneCall(phonenum);
- },
- onLoad(){
- this.pageinfo.PageNum++;
- this.getminiWarehouse('onload');
- this.refreshing = false;
- },
- onRefresh(){
- this.loading = true;
- this.finished = false;
- this.pageinfo.PageNum = 1;
- this.getminiWarehouse();
- this.refreshing = false;
- },
- //获取列表
- async getminiWarehouse(type='refresh'){
- const that = this;
- let UserId = PublicLib.getCookieInfo('userId');
- let {PageSize,PageNum} = this.pageinfo
- const res = await getRequest('api/v1/pos/smallstorehouse/list?t='+Math.random(6),JSON.stringify({UserId,SearchKey:this.searchContent,PageSize,PageNum}));
- if(res.status !== '1') return tips('请求失败!请重试')
- if(res.status === '1'){
- if(res.data.length < PageSize){
- this.finished = true
- };
- if(type === 'onload'){
- this.creatorList = [...this.creatorList,...res.data];
- this.loading = false;
- };
- if(type === 'refresh'){
- this.creatorList = res.data;
- let isall = false;
- res.data.forEach(item=>{
- if(item.BrandList.length !== 0){
- isall = true;
- };
- });
- if(isall){
- that.isdata = true;
- }else{
- that.isdata = false;
- }
- };
- };
-
- },
- onSearch(){
- this.getminiWarehouse()
- },
- //撤回
- withdraw:undebounce(async function(item,index,creind){
- let delIndex = this.creatorList[creind].BrandList[index].SnList.findIndex((i)=> i.Id == item.Id);
- let UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('api/v1/pos/presendstockdetail/cancel?t='+Math.random(6),JSON.stringify({UserId,SnId:item.Id}));
- if(res.status !== '1') return tips('操作失败!请重试');
- if(res.status === '1'){
- this.creatorList[creind].BrandList[index].SnList.splice(delIndex,1);
- tips('撤回成功!');
- this.pageinfo.PageNum = 1;
- this.getminiWarehouse();
- };
- }),
- },
- })
- </script>
- </body>
- </html>
|