Administrator 4 gadi atpakaļ
vecāks
revīzija
8f34967579

+ 3 - 2
src/main/resources/static/css/supplier-center/message.css

@@ -4,8 +4,9 @@ li{list-style:none}
  * PC端
  */
 @media screen and (min-width:768px){
-
-
+    .content .empty{box-sizing:border-box;padding:100px 0;text-align:center;color:#4A4F58;line-height:30px;font-size:16px;background-color:#FFF;}
+    .content .empty img{width:180px;height:180px;}
+    .content .empty a{color:#E15616;}
     .content{width: 100%;min-height: 370px;background-color: #FFFFFF;box-sizing: border-box;padding:0 20px 20px 20px;box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);margin:0 0 10px 0;}
     .content .title{width: 100%;height: 56px;border-bottom: solid 1px #e2e7ef;line-height: 56px;color: #22272e;font-size: 16px;}
     .content .section .section-top{width: 100%;height: 54px;float: left;box-sizing: border-box;padding: 9px 0;border-bottom: solid 1px #e2e7ef;}

+ 0 - 0
src/main/resources/static/css/supplier-center/shop/goods.css → src/main/resources/static/css/supplier-center/shop/brand.css


+ 4 - 33
src/main/resources/static/js/supplier-center/message.js

@@ -7,44 +7,15 @@ var helpSuggestion = new Vue({
         shopID: 0,
         degree:'',
         isCheckedAll:false,
-        messagesList:[
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false},
-            {title:'您有一笔订单等待支付,快去订单列表进行支付吧^_^。',addTime:' 2020-09-01 16:42:29',isCheck:false}
-        ],//新闻动态
+        messagesList:[],//新闻动态
     },
     methods: {
         GetMyPcCenterInfo:function(){
             var _self = this;
-            SupplierApi.GetMyPcCenterInfo({shopId:_self.shopID},function (response) {
+           UserApi.GetMymessageList({userId:_self.userId},function (response) {
                 if(response.code == 0){
-                    var data = response.data;
-                    _self.userInfo = data.user;
-                    _self.degree = data.degree;
-                    _self.unReadMessageCount = _self.showBadge(data.unReadMessageCount);
-                    _self.confirmedCount = _self.showBadge(data.confirmedCount);
-                    _self.paymentCount = _self.showBadge(data.paymentCount);
-                    _self.waitShipmentsCount = _self.showBadge(data.waitShipmentsCount);
-                    _self.shipmentsCount = _self.showBadge(data.shipmentsCount);
-                    _self.salesReturnCount = _self.showBadge(data.salesReturnCount);
-                    _self.productList = data.homePageAdvertiseList;
-                    _self.newsList = data.homePageInfoList;
-                    _self.isRequset = true;
+                    _self.messagesList = response.data;
+                    _self.isRequset = false;
                 }else{
                     CAIMEI.Alert(response.msg, '确定', false);
                 }

+ 161 - 0
src/main/resources/static/js/supplier-center/shop/brand.js

@@ -0,0 +1,161 @@
+jqMultipleShow("click", ".navList", ".tab", ".con");
+var Brandgoods =new Vue({
+    el:'#Brandgoods',
+    data:{
+      params:{
+             userID: '',
+             pageNum :1,
+             pageSize:10,
+             name:'',
+             status:''
+        },
+        brandobj:{
+            userID:'',
+            name:'',
+            logo:'',
+            description:''
+        },
+        title:'',
+        formData:new FormData(),
+        brandlist:[],
+        pageInput: '1',
+        listRecord: 0,
+        bgflag:false,
+        logoShow:false,
+        iconflag:true
+    },
+     computed: {
+        pageTotal: function () {
+            var total = Math.ceil(this.listRecord / this.params.pageSize);
+            return total > 0 ? total : 1;
+        },
+        showPageBtn: function () {
+            var total = Math.ceil(this.listRecord / this.params.pageSize);
+            total = total > 0 ? total : 1;
+            var index = this.params.pageNum, arr = [];
+            if (total <= 6) {
+                for (var i = 1; i <= total; i++) {
+                    arr.push(i);
+                }
+                return arr;
+            }
+            if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
+            if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
+            return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
+        }
+    },
+    methods:{
+        toPagination: function (pageNum) {
+            if (pageNum <= this.pageTotal) {
+                this.params.pageNum = pageNum;
+                this.BrandList(this.params);
+            }
+        },
+     checkNum: function () {
+        if (this.pageInput > this.pageTotal) {
+            this.pageInput = this.pageTotal;
+        } else if (this.pageInput < 1) {
+            this.pageInput = 1;
+        }
+    },
+      BrandList:function () {
+       var _this = this;
+        SupplierApi.brandList(_this.params,function (res) {
+            if(res.code==0){
+                 if(res.data.results && res.data.results.length>0){
+                     _this.brandlist=res.data.results;
+                     console.log(_this.brandlist)
+                     _this.listRecord = res.data.totalRecord;
+                 }else{
+                     _this.results = res.data.results;
+                     _this.listRecord = res.data.totalRecord;
+                 }
+            }
+        })
+      },
+      getstatus:function () { //状态
+        var _this = this;
+         _this.params.status=event.target.value;
+    },
+      queryBrand:function () { //查询
+        var _this = this;
+        _this.BrandList()
+      },
+    newBrand:function(){
+        var _this = this;
+        _this.bgflag = true;
+        _this.title = '添加新品牌'
+        },
+     submit:function(){ //确认提交新品牌
+          var _this = this;
+          console.log(_this.brandobj)
+          if(_this.brandobj.name ==''){
+            CAIMEI.dialog('请输入品牌名称')
+         }else {
+             SupplierApi.addBrand(_this.brandobj,function (res) {
+                 if (res.code==0){
+                  CAIMEI.Alert('提交成功,我们将会在1-2个工作日内审核','确定',true,function () {
+                      location.reload()
+                  });
+                   _this.closebg();
+                 } else if(res.code == -1){
+                     var errmsg = res.msg;
+                    if(errmsg.indexOf('请先登录') > -1) {
+                        CAIMEI.dialog('请先登录');
+                    } else if (errmsg.indexOf('已存在') > -1) {
+                        CAIMEI.dialog('有相同品牌存在,无需重复提交,详情请致电0755-22907771');
+                    } else {
+                        CAIMEI.dialog('网络错误,请稍后再试');
+                    }
+                 }
+               })
+             }
+        },
+    editBrand:function(item){
+         var _this = this;
+         _this.bgflag = true;
+          _this.title = '编辑新品牌';
+         _this.brandobj.name = item.name;
+         _this.brandobj.description=item.description;
+         if(item.logo !=''&& item.logo!=null){
+            _this.brandobj.logo=item.logo;
+            _this.logoShow = true;
+            _this.iconflag = false;
+         }else {
+            _this.logoShow = false;
+            _this.iconflag = true;
+         }
+          _this.brandobj.id=item.id;
+        },
+    closebg:function () {
+         var _this = this;
+            _this.bgflag = false;
+            _this.brandobj.name='';
+            _this.brandobj.description='';
+            _this.brandobj.logo='';
+            _this.logoShow = false;
+            _this.iconflag = true;
+
+        },
+    uploadlogo:function () { //上传品牌图片
+            var _this = this;
+            var inputDOM = _this.$refs.goodslogo;
+            var file = inputDOM.files;
+            _this.formData.append('file', file[0]);
+            SupplierApi.uploadimg(_this.formData,function(response){
+               _this.brandobj.logo = response.data;
+               _this.logoShow = true;
+               _this.iconflag = false;
+                event.target.value = '';
+            });
+        }
+    },
+    mounted:function () {
+        var _self = this;
+        if(globalUserData){
+              _self.params.userID = globalUserData.userId;
+              _self.brandobj.userID = globalUserData.userId;
+            }
+        _self.BrandList()
+    }
+})

+ 1 - 1
src/main/resources/templates/supplier-center/components/tableft.html

@@ -16,7 +16,7 @@
             <a href="/supplier/decoration.html">装扮主页</a>
             <a href="/supplier/release.html">发布商品</a>
             <a href="/supplier/goods.html">我的商品</a>
-            <a href="/supplier/goods.html">品牌管理</a>
+            <a href="/supplier/brand.html">品牌管理</a>
 
         </div>
     </div>

+ 5 - 1
src/main/resources/templates/supplier-center/message/list.html

@@ -36,7 +36,7 @@
                                 <a href="javascript:void(0);" class="btn" @class="signMessageFn">标为已读</a>
                             </div>
                         </div>
-                        <div class="section-content">
+                        <div class="section-content" v-if="messagesList.length > 0">
                             <div class="new-list" v-for="(item, index) in messagesList" :key="index">
                                 <div class="text">
                                     <i class="icon mIcon" :class="item.isCheck ? 'icon-gouxuan' : 'icon-weigouxuan'" @click="checkedItemFn(item)"></i>
@@ -45,6 +45,10 @@
                                 <div class="time">{{item.addTime}}</div>
                             </div>
                         </div>
+                        <div v-else class="empty">
+                            <img src="/img/common/empty.png">
+                            <div class="msg"><p>暂无数据</p></div>
+                        </div>
                     </div>
                 </div>
             </div>

+ 117 - 4
src/main/resources/templates/supplier-center/shop/brand.html

@@ -4,20 +4,133 @@
 <head>
     <title>采美365网-中国美业全方位线上交易服务互动平台,做美业,上采美</title>
     <template th:replace="components/head-link"></template>
-
+    <link th:href="@{/css/base/center.css(v=${version})}" rel="stylesheet" type="text/css">
+    <link th:href="@{/css/supplier-center/shop/brand.css(v=${version})}" rel="stylesheet" type="text/css">
 </head>
 <body>
 <!-- 引用头部 -->
 <template th:replace="components/header"></template>
-
+    <h1></h1>
 <!-- 我的采美 -->
-<div>
+<div id="Brandgoods">
+    <div class="navLayout" >
+        <div class="crumbs">
+            <span>我的店铺</span>
+            <span>&gt;</span>
+            <span>品牌管理</span>
+        </div>
+        <div class="wrap clear">
+            <!--左侧面包屑-->
+            <template th:replace="supplier-center/components/tableft"></template>
+            <div class="right">
+                <div class="head-top">
+                    <form action="">
+                        <div class='order-border'><span>品牌名称:</span><input type="text" id="name-buyer" v-model="params.name" class="Buyer" placeholder="请输入买家名称"> </div>
+                        <div>
+                            状态:
+                            <select name="" id="settlement-status" class="state" @change="getstatus($event)">
+                                <option value="">全部</option>
+                                <option value="0">待审核</option>
+                                <option value="1">审核通过</option>
+                                <option value="2">审核未通过</option>
+                            </select>
+                            </div>
+                            <div id="newBtn">
+                                <div class="query-btn" @click="queryBrand">搜索</div>
+                                <div class="addBrand" @click="newBrand">提交新品牌</div>
+                            </div>
+                    </form>
+                </div>
+                <div class="brand-list">
+                    <ul class="brand-title">
+                        <li>品牌名称</li>
+                        <li>品牌logo</li>
+                        <li>状态</li>
+                        <li>品牌描述</li>
+                        <li>提交时间</li>
+                        <li>操作</li>
+                    </ul>
+                    <div class="tbody">
+                        <ul v-for="item in brandlist">
+                            <li class="brand-name"><h3>{{item.name}}</h3></li>
+                            <li class="brand-logo">
+                                <img :src="item.logo" v-if="item.logo!=''&&item.logo!=null">
+                                <span v-else>暂无</span>
+                            </li>
+                            <li class="brand-status">
+                                <span class="font-red"  v-if="item.status ==0">待审核</span>
+                                <span class="font-blue" v-if="item.status ==1">审核通过</span>
+                                <span class="font-red" v-if="item.status ==2">审核未通过 <br>原因:{{item.auditNote}}</span>
+                            </li>
+                            <li class="brand-description">
+                                <span v-if="item.description ==''|| item.description==null">暂无</span>
+                                <span v-else>{{item.description}}</span>
 
+                            </li>
+                            <li class="brand-time">{{item.createDate}}</li>
+                            <li class="brand-edit" >
+                                <span v-if="item.status != 1" @click="editBrand(item)">编辑</span>
+                                <span v-else>无</span>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+                     <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
+                     <div class="pageWrap clear" v-if="isPC && pageTotal>1">
+                            <a v-if="params.pageNum>1" class="prev" @click="toPagination(params.pageNum*1-1)" href="javascript:void(0);"></a>
+                            <template v-for="n in showPageBtn">
+                                <a v-if="n" :class="{'on':(n==params.pageNum)}" @click="toPagination(n)" href="javascript:void(0);" v-text="n"></a>
+                                <span v-else>···</span>
+                            </template>
+                            <a v-if="params.pageNum<pageTotal" class="next" @click="toPagination(params.pageNum*1+1)" href="javascript:void(0);"></a>
+                            <span>共<b v-text="pageTotal>1?pageTotal:1"></b>页</span>
+                            <span>跳至</span>
+                            <input v-model="pageInput" @blur="checkNum()"/>
+                            <span>页</span>&nbsp;
+                            <a class="btn" href="javascript:void(0);" @click="toPagination(pageInput)">点击跳转</a>
+                     </div>
+            </div>
+        </div>
+         <div class="bg-brand" v-show="bgflag">
+             <div class="add-brand-box">
+                    <div class="modal-header">
+                        <span class="shou-address">{{title}}</span>
+                        <span class="close-modalForm" @click="closebg">x</span>
+                    </div>
+                    <div class="brand-content">
+                        <div class="brand-name">
+                            <span class="label"><em class="required">*</em> 品牌名称:</span>
+                            <input type="text" v-model="brandobj.name" placeholder="请输入品牌名称"/>
+                        </div>
+                        <div class="brand-img">
+                            <span class="label">品牌logo:</span>
+                            <div class="img-box upimg">
+                                <img class="center" :src="brandobj.logo" v-if="logoShow">
+                                <i class="icon mIcon add" v-if="iconflag"></i>
+                                <input type="file" ref="goodslogo" class="add-pic"  id="uploadfile" accept="image/*" @change="uploadlogo"/>
+                              </div>
+                            <p class="tishiyu">请上传<span class="font-color">jpg/png</span>格式的图片,大小不超过<span>5M</span> </p>
+                         </div>
+                        <div class="brand-description">
+                            <span class="label">品牌描述:</span>
+                             <textarea rows="" cols="" class="miaoshu" v-model="brandobj.description" placeholder="请描述品牌信息,不超过200字" maxlength="200" ></textarea>
+                        </div>
+                    </div>
+                     <div class="box-btn">
+                         <div class="btn-submit" @click="submit">提交</div>
+                          <div class="btn-cancel" @click="closebg">取消</div>
+                     </div>
+                </div>
+             </div>
+         </div>
+
+    </div>
 </div>
 
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
-
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/supplier.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/supplier-center/shop/brand.js(v=${version})}"></script>
 </body>
 </html>