Browse Source

留言板

hangb 7 years ago
parent
commit
7bbd39830f

+ 6 - 4
assets/scss/common.scss

@@ -336,9 +336,11 @@ div.el-tree-node__content{
 .el-pagination{
   margin-bottom: 15px;
 }
-.componentDetail .el-dialog__wrapper .el-dialog--tiny{
-  width: 320px !important;
+// 留言板弹出框
+.dialog .el-dialog__header{
+  display: none;
 }
-.componentDetail .el-dialog__wrapper .el-dialog__body{
-  padding: 14px !important;
+.dialog .el-dialog__body{
+  padding: 0 !important;
 }
+

+ 92 - 0
components/common/image-upload/ImageUpload.vue

@@ -0,0 +1,92 @@
+<template>
+  <div>
+    <el-upload
+      action = "https://jsonplaceholder.typicode.com/posts/"
+      :on-preview="handlePictureCardPreview"
+      :on-remove="handleRemove"
+      list-type="picture-card"
+      :on-success="uploadSuccess">
+      <img src="/images/messageBoard/msg_uploadPic.png" alt="">
+    </el-upload>
+    <el-dialog v-model="dialogVisible" size="tiny">
+      <img :src="dialogImageUrl" width="100%" alt="">
+    </el-dialog>
+  </div>
+</template>
+<script>
+  export default {
+    data () {
+      return {
+        dialogImageUrl: '',
+        dialogVisible: false
+      }
+    },
+    methods: {
+      handleRemove (file, fileList) {
+        console.log(file)
+      },
+      handlePictureCardPreview (file) {
+        this.dialogImageUrl = file.url
+        this.dialogVisible = true
+      },
+      uploadSuccess (response, file, fileList) {
+        this.$emit('fileAction', file.url)
+      }
+    }
+  }
+</script>
+<style>
+  input[type="file"] {
+    display: none;
+  }
+  .el-upload--picture-card {
+    position: relative;
+    width: 82px;
+    height: 70px;
+    line-height: 70px;
+    background: transparent;
+    cursor: pointer;
+    border-radius: 0;
+    box-sizing: border-box;
+    border: none;
+  }
+  .el-upload--picture-card:hover {
+    border-color: transparent;
+    color: transparent;
+  }
+  .el-upload-list--picture-card .el-upload-list__item {
+    margin: 0;
+    width: 82px;
+    height: 70px;
+    border: 1px solid #999;
+    border-radius: 0;
+  }
+  .el-upload-list--picture-card .el-upload-list__item-thumbnail {
+    max-width: 82px;
+    max-height: 70px;
+  }
+  .el-upload-list__item.is-success .el-upload-list__item-status-label {
+    display: none;
+  }
+  [class*=" el-icon-"], [class^=el-icon-] {
+    font-size: 14px;
+  }
+  .el-icon-delete2 {
+    position: absolute;
+    top: 3px;
+    right: 3px;
+  }
+  .el-upload-list__item-preview .el-icon-view {
+    margin-right: 7px;
+  }
+  .el-upload-list__item-preview:after{
+    content: '查看';
+    font-size: 14px;
+  }
+  .el-upload-list--picture-card .el-upload-list__item-actions{
+    position: absolute;
+    left: 0;
+    top: 0;
+    text-align: right;
+  }
+</style>

+ 86 - 61
components/default/RightBar.vue

@@ -1,72 +1,92 @@
 <template>
-  <div class="right-bar">
-    <ul class="right-bar-center">
-      <li class="right-bar-item">
-        <a href="/user#/cart" class="title" target="_blank">
-          <i class="iconfont icon-shopping-cart icon-xlg"></i>
-        </a>
-        <div class="sidebar-menu"><a href="/user#/cart" title="我的购物车" target="_blank">我的购物车<em><span>(<span v-text="cartCount.count || 0"></span>)</span></em></a></div>
-      </li>
-      <li class="right-bar-item">
-        <a @click="onLeaveMessageClick()" class="title">
-          <i class="iconfont icon-liuyan icon-xlg"></i>
-        </a>
-        <div class="sidebar-menu"><a href="" title="留言板" target="_blank">留言板</a></div>
-      </li>
-      <li class="right-bar-item contact-menu">
-        <a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" target="_blank" class="title">
-          <i class="iconfont icon-kefu icon-xlg"></i>
-        </a>
-        <div class="contact-us sidebar-menu">
-          <p>在线客服:<img src="/images/all/songguo.png" /><a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" class="contact-btn" target="_blank">联系客服</a></p>
-          <p>服务电话:400-830-1818</p>
-          <p>服务邮箱:yrsc@usoftchina.com</p>
-          <p>工作时间:</p>
-          <p>周一至周五 9:00-18:00</p>
-        </div>
-      </li>
-    </ul>
-    <ul class="right-bar-bottom">
-      <li class="right-bar-item">
-        <a href="/user#/browsingHistory" class="title" target="_blank">
-          <i class="iconfont icon-zuji icon-xlg"></i>
-        </a>
-        <div class="sidebar-menu" v-if="!user.logged"><a href="/user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
-        <div class="sidebar-menu" v-if="user.logged && listMe(history).length == 0"><a href="/user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
-        <div class="foot-record sidebar-menu" v-if="user.logged && listMe(history).length > 0">
-          <h3><a href="">浏览历史</a></h3>
-          <dl>
-            <dd v-for="item in listMe(history)">
-                <a :href="'/store/' + item.storeid + '/' + item.batchCode" :title="item.code" v-text="item.code" v-if="item.status== 1"></a>
-                <a :title="item.code" v-text="item.code" v-if="item.status== 0" disabled="disabled"></a>
-                <div class="hover-shows">
-                    <em :class="{ 'off' : item.status== 0}"></em>
-                    <span :class="{ 'off' : item.status== 0}">失效</span>
-                    <a @click="deleteHistory(item,item.id)">&times;</a>
-                </div>
-            </dd>
-          </dl>
-        </div>
-      </li>
-      <li class="right-bar-item">
-        <a @click="toTop()" class="title">
-          <i class="iconfont icon-arrow-up icon-xlg"></i>
-        </a>
-        <div class="sidebar-menu"><a @click="toTop()" title="返回顶部" target="_blank">返回顶部</a></div>
-      </li>
-    </ul>
+  <div>
+    <div class="right-bar">
+      <ul class="right-bar-center">
+        <li class="right-bar-item">
+          <a href="user#/cart" class="title" target="_blank">
+            <i class="iconfont icon-shopping-cart icon-xlg"></i>
+          </a>
+          <div class="sidebar-menu"><a href="user#/cart" title="我的购物车" target="_blank">我的购物车<em><span>(<span v-text="cartCount.count || 0"></span>)</span></em></a></div>
+        </li>
+        <li class="right-bar-item">
+          <el-button type="text" @click="dialogVisible = true">
+          <a @click="onLeaveMessageClick()" class="title">
+            <i class="iconfont icon-liuyan icon-xlg"></i>
+          </a>
+          <div class="sidebar-menu"><a title="留言板" target="_blank">留言板</a></div>
+          </el-button>
+        </li>
+        <li class="right-bar-item contact-menu">
+          <a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" target="_blank" class="title">
+            <i class="iconfont icon-kefu icon-xlg"></i>
+          </a>
+          <div class="contact-us sidebar-menu">
+            <p>在线客服:<img src="/images/all/songguo.png" /><a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" class="contact-btn" target="_blank">联系客服</a></p>
+            <p>服务电话:400-830-1818</p>
+            <p>服务邮箱:yrsc@usoftchina.com</p>
+            <p>工作时间:</p>
+            <p>周一至周五 9:00-18:00</p>
+          </div>
+        </li>
+      </ul>
+      <ul class="right-bar-bottom">
+        <li class="right-bar-item">
+          <a href="http://www.usoftmall.com/user#/browsingHistory" class="title" target="_blank">
+            <i class="iconfont icon-zuji icon-xlg"></i>
+          </a>
+          <div class="sidebar-menu" v-if="!user.logged"><a href="user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
+          <div class="sidebar-menu" v-if="user.logged && listMe(history).length == 0"><a href="user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
+          <div class="foot-record sidebar-menu" v-if="user.logged && listMe(history).length > 0">
+            <h3><a href="">浏览历史</a></h3>
+            <dl>
+              <dd v-for="item in listMe(history)">
+                  <a :href="'/store/' + item.storeid + '/' + item.batchCode" :title="item.code" v-text="item.code" v-if="item.status== 1"></a>
+                  <a :title="item.code" v-text="item.code" v-if="item.status== 0" disabled="disabled"></a>
+                  <div class="hover-shows">
+                      <em :class="{ 'off' : item.status== 0}"></em>
+                      <span :class="{ 'off' : item.status== 0}">失效</span>
+                      <a @click="deleteHistory(item,item.id)">&times;</a>
+                  </div>
+              </dd>
+            </dl>
+          </div>
+        </li>
+        <li class="right-bar-item">
+          <a @click="toTop()" class="title">
+            <i class="iconfont icon-arrow-up icon-xlg"></i>
+          </a>
+          <div class="sidebar-menu"><a @click="toTop()" title="返回顶部" target="_blank">返回顶部</a></div>
+        </li>
+      </ul>
+    </div>
+    <el-dialog class="dialog"
+      :visible.sync="dialogVisible"
+      size="tiny">
+      <message-board @pageEvent="listenPage" @openBoardEvent="listenOpen"/>
+    </el-dialog>
   </div>
 </template>
 <script>
   import { scrollTo } from '~utils/scroll'
-
+  import MessageBoard from '~components/messageBoard/MessageBoard.vue'
   export default {
     name: 'right-bar',
     data () {
       return {
-        historyLength: []
+        historyLength: [],
+        dialogVisible: false,
+        dialogImageUrl: '',
+        page: 1,
+        count: 3,
+        currentPage: 1
       }
     },
+    created () {
+      this.$store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
+    },
+    components: {
+      MessageBoard
+    },
     computed: {
       user () {
         return this.$store.state.option.user
@@ -86,6 +106,13 @@
       })
     },
     methods: {
+      listenPage: function (p) {
+        this.page = p
+        this.$store.dispatch('getMessageBoardInformation', {page: this.page, count: 3})
+      },
+      listenOpen: function (flag) {
+        this.dialogVisible = flag
+      },
       listMe: function (list) {
         return list.filter(function (item) {
           return item.isDelete === 1
@@ -177,13 +204,11 @@
     border-bottom: #767575 1px solid;
     text-align: left;
     padding-left: 10px;
-    width: 100%;
+    width: 96%;
     display: inline-block;
     margin: 0 auto;
     font-size: 12px;
     height: 39px;
-    position: relative;
-    z-index: 1;
   }
   .right-bar ul li .foot-record h3:hover a{
     color: #fbb029;

+ 573 - 0
components/messageBoard/MessageBoard.vue

@@ -0,0 +1,573 @@
+<template>
+  <div class="messageBoard container" v-if="isOpen">
+    <div class="modal-header">
+      <h3 class="modal-title f18">
+        <span v-if="showHistory">留言板</span>
+        <span v-if="!showHistory">留言记录</span>
+      </h3>
+      <a @click="isOpendMessage"><i class="fa fa-remove"></i></a>
+    </div>
+    <div class="modal-body msg-body">
+      <div v-if="showHistory">
+        <h3>亲爱的&nbsp;<span v-text="user.userName || '游客'">&nbsp;&nbsp;</span> ,您的意见对我们很重要!</h3>
+        <form name="messageBoardForm" method="post">
+          <div class="txtArea">
+            <b class="first">*</b>
+            <textarea @keyup="textareaLength" placeholder="请将您在使用当前页面遇到的任何问题、建议或意见反馈给我们。注意:不要输入您的隐私信息,如:账户密码等。" v-model="messageBoard.question" maxlength="500"></textarea>
+            <span class="count_tip"><span v-text="txtVal"></span>/500</span>
+          </div>
+          <p><b>*</b>您的身份是:</p>
+          <p class="radioCheck">
+            <label for="buyer01" class="radioLabel">
+              <input type="radio" name="role" value="buyer" v-model="messageBoard.role" id="buyer01"/>
+              <label for="buyer01" class="txtContact"></label>
+              <span>我是买家</span>
+            </label>
+            <label for="buyer02" class="radioLabel">
+              <input type="radio" name="role" value="seller" v-model="messageBoard.role" id="buyer02" checked/>
+              <label for="buyer02" class="txtContact"></label>
+              <span>我是卖家</span>
+            </label>
+          </p>
+          <p><b>*</b>您反馈的内容类型是:</p>
+          <p class="radioCheck">
+            <label for="contentType01" class="radioLabel">
+              <input type="radio" name="type" value="展示效果" v-model="messageBoard.type" id="contentType01"/>
+              <label for="contentType01" class="txtContact"></label>
+              <span>展示效果</span>
+            </label>
+            <label for="contentType02" class="radioLabel">
+              <input type="radio" name="type" value="页面功能" v-model="messageBoard.type" id="contentType02" checked/>
+              <label for="contentType02" class="txtContact"></label>
+              <span>页面功能</span>
+            </label>
+            <label for="contentType03" class="radioLabel">
+              <input type="radio" name="type" value="异常报错" v-model="messageBoard.type" id="contentType03"/>
+              <label for="contentType03" class="txtContact"></label>
+              <span>异常报错</span>
+            </label>
+            <label for="contentType04" class="radioLabel">
+              <input type="radio" name="type" value="其他方面" v-model="messageBoard.type" id="contentType04"/>
+              <label for="contentType04" class="txtContact"></label>
+              <span>其他方面</span>
+            </label>
+          </p>
+          <p>&nbsp;&nbsp;&nbsp;添加图片:</p>
+          <div class="img-warp">
+            <div class="img-item">
+              <image-upload @fileAction="listenFile">
+                <img src="/images/messageBoard/msg_uploadPic.png" alt="">
+              </image-upload>
+            </div>
+            <div class="img-item">
+              <image-upload @fileAction="listenFile">
+                <img src="/images/messageBoard/msg_uploadPic.png" alt="">
+              </image-upload>
+            </div>
+            <div class="img-item">
+              <image-upload @fileAction="listenFile">
+                <img src="/images/messageBoard/msg_uploadPic.png" alt="">
+              </image-upload>
+            </div>
+            <div class="img-item">
+              <image-upload @fileAction="listenFile">
+                <img src="/images/messageBoard/msg_uploadPic.png" alt="">
+              </image-upload>
+            </div>
+            <div class="img-item">
+              <image-upload @fileAction="listenFile">
+                <img src="/images/messageBoard/msg_uploadPic.png" alt="">
+              </image-upload>
+            </div>
+          </div>
+          <p class="tip clearfix">提示:最多可上传五张图片,每张大小不超过500KB,仅支持JPG、PNG、GIF格式.</p>
+          <div v-if="!user.userUU">
+            <p><b>*</b>您当前尚未登录,请留下您的联系方式,我们会不定期发布一些有奖体验活动</p>
+            <div class="msg-message" v-if="!user.userUU">
+              <div class="msg-content">
+                <label>手机:</label>
+                <input type="text" name="userTel" v-model="messageBoard.userTel"  autocomplete="off" @keyup="checkMobile"/>
+                <span v-if="!isMobile"><i class="glyphicon glyphicon-info-sign x-icon-left"></i>请输入正确的号码</span>
+              </div>
+            </div>
+            <div class="msg-message" v-if="!user.userUU">
+              <div class="msg-content">
+                <label>邮箱:</label>
+                <input type="text" name="email" v-model="messageBoard.email"  autocomplete="off" @keyup="checkEmail"/>
+                <span v-if="!isEmail"><i class="glyphicon glyphicon-info-sign x-icon-left"></i>请输入正确的邮箱</span>
+              </div>
+            </div>
+          </div>
+          <button class="btn" @click="confirm">提交</button>
+        </form>
+      </div>
+      <div class="msg-table" v-else-if="!showHistory && user.userUU">
+        <div class="history" v-for="message in messageBoardCurrent.content">
+          <div class="form-group row">
+            <div class="col-xs-8">{{message.type}}</div>
+            <div class="msgDate col-xs-4">{{message.createDate | date}}</div>
+          </div>
+          <div class="question">
+            <span>问题:</span>
+            <span style="word-break: break-all">{{message.question}}</span>
+          </div>
+          <div class="answer" v-show="message.answer" style="margin-bottom: 10px;">
+            <span>回复:</span>
+            <span style="word-break: break-all">{{message.answer}}</span>
+          </div>
+        </div>
+        <div class="text-center" v-if="!messageBoardCurrent || messageBoardCurrent.length === 0">
+          <div>无留言记录</div>
+        </div>
+      </div>
+      <div class="page" v-if="!showHistory">
+        <page-component
+          :total="messageBoardCurrent.totalElements"
+          :page-size="pageParams.count"
+          :current="pageParams.page"
+          v-on:childEvent="listenPage">
+        </page-component>
+      </div>
+      <div class="msg-slide1" @click="isOpenHistory" v-if="showHistory">
+        <i class="fa fa-angle-left"></i><span>留言记录</span>
+      </div>
+      <div class="msg-slide2" @click="isHideHistory" v-if="!showHistory">
+        <i class="fa fa-angle-right"></i><span>关闭记录</span>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import ImageUpload from '~components/common/image-upload/ImageUpload.vue'
+  import PageComponent from '~components/common/page/PageComponent.vue'
+  export default {
+    name: 'messageBoard',
+    data () {
+      return {
+        pageParams: {
+          page: 1,
+          count: 3,
+          currentPage: 1,
+          dialogVisible: false
+        },
+        dialogImageUrl: [],
+        showHistory: true,
+        isOpen: true,
+        isLogin: false,
+        txtVal: 0,
+        isMobile: true,
+        isEmail: true
+      }
+    },
+    components: {
+      ImageUpload,
+      PageComponent
+    },
+    computed: {
+      messageBoard () {
+        console.log('messageBoard', this.$store.state.messageBoard.information.data)
+        return this.$store.state.messageBoard.information.data
+      },
+//      user () {
+//        return this.$store.state.messageBoardIsLogin.login.data
+//      },
+      user () {
+        return this.$store.state.option.user.data
+      },
+      messageBoardCurrent () {
+        return this.$store.state.messageBoardInformation.information.data
+      }
+    },
+    filters: {
+      date: function (num) {
+        const d = new Date(num)
+        const year = d.getFullYear()
+        const month = d.getMonth() + 1 < 10 ? '0' + d.getMonth() : '' + d.getMonth()
+        const day = d.getDay() < 10 ? '0' + d.getDay() : '' + d.getDay()
+        return year + '-' + month + '-' + day
+      }
+    },
+    methods: {
+      listenPage (page) {
+        this.pageParams.page = page
+        this.$emit('pageEvent', page)
+      },
+      listenFile (url) {
+        let obj = {}
+        obj.img = url
+        this.dialogImageUrl.push(obj)
+        console.log(this.dialogImageUrl)
+      },
+      isOpendMessage () {
+        this.$emit('openBoardEvent', false)
+      },
+      isOpenHistory () {
+        this.showHistory = !this.showHistory
+      },
+      isHideHistory () {
+        this.showHistory = !this.showHistory
+      },
+      textareaLength () {
+        this.txtVal = this.messageBoard.question.length
+      },
+       // 判断手机号
+      checkMobile () {
+        this.isMobile = (/^[\d]{8,11}$/).test(this.messageBoard.userTel)
+      },
+     // 判断邮箱
+      checkEmail () {
+        this.isEmail = (/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/).test(this.messageBoard.email)
+      },
+      confirm () {
+       // alert(message)
+       /* let imgs = []
+        if (message) {
+          imgs[index] = {'img': message.img}
+        } */
+        this.$store.dispatch('uploadMessageBoardInformation', {question: this.messageBoard.question, role: this.messageBoard.role, submitTitle: '【优软商城】IC电子元器件现货采购交易平台商城', submitUrl: window.location.href, type: this.messageBoard.type, imgs: this.dialogImageUrl, userTel: '13333333333'})
+      }
+    }
+  }
+</script>
+<style scoped>
+    /*分页*/
+  .page {
+    text-align: center;
+  }
+  .page .page-wrap{
+    float: none;
+  }
+  .page-wrap ul, .page-wrap div {
+    float: none !important;
+    display: inline-block;
+    margin: 0;
+  }
+  body,textarea,button.btn{
+    font-family: "MicrosoftYaHei Regual", "微软雅黑" !important;
+  }
+  .messageBoard {
+    width: 680px;
+    font-size: 14px;
+    background: #fff;
+  }
+  .messageBoard .modal-header {
+    position: relative;
+    background: url("/images/messageBoard/msg_nav.png") no-repeat left center;
+    min-height: 0;
+    padding: 11.5px;
+    text-align: center;
+  }
+  .messageBoard .modal-header i{
+    position: absolute;
+    top: 5px;
+    left: 650px;
+    font-size: 20px;
+    color: #fff;
+    cursor: pointer;
+  }
+  .messageBoard .modal-header>h3{
+    font-size: 18px;
+    color: #000;
+  }
+  .messageBoard .modal-header .modal-title {
+    margin-left: 30px;
+    text-align: center;
+    color: #fff;
+  }
+  .messageBoard .modal-header .modal-title span{
+    vertical-align: middle;
+  }
+  .messageBoard .modal-body {
+    padding: 10px;
+    min-height: 445px;
+    margin: 0 auto;
+    width: 680px;
+  }
+  .messageBoard .modal-body h3{
+    width: 680px;
+    text-align: center;
+    font-size: 14px;
+    color: #333;
+    margin: 0 0 10px 0;
+  }
+  .messageBoard .modal-body h3 span{
+    color: #5078cb;
+  }
+  .messageBoard .modal-body form{
+    width: 680px;
+    text-align: center;
+  }
+  .messageBoard .modal-body form .txtArea{
+    position: relative;
+  }
+  .messageBoard .modal-body form textarea {
+    padding: 10px 10px 20px 10px;
+    width: 576px;
+    height: 110px;
+    color: #333;
+    border: #c5c5c5 1px solid;
+    font-size: 13px;
+    letter-spacing: 1px;
+    line-height: 18px;
+  }
+  .messageBoard .modal-body form span.count_tip{
+    position: absolute;
+    bottom: 4px;
+    right: 55px;
+    display: inline-block;
+    width: 564px;
+    height: 20px;
+    color: #979797;
+    line-height: 20px;
+    font-size: 12px;
+    background: #fff;
+    text-align: right;
+    padding-right: 5px;
+  }
+  .messageBoard .modal-body form p{
+    padding-left: 40px;
+    text-align: left;
+    font-size: 14px;
+    margin: 5px;
+    color: #333;
+  }
+  .messageBoard .modal-body p.radioCheck{
+    padding-left: 65px;
+  }
+  .messageBoard .modal-body form input{
+    padding: 0 10px;
+    margin-left: 20px;
+    height: 30px;
+    width: 290px;
+    font-size: 14px;
+    color: #656565;
+    border: #c5c5c5 1px solid;
+    vertical-align: sub;
+  }
+  .messageBoard .modal-body form label{
+    margin-right: 25px;
+  }
+  .messageBoard .modal-body form .img-warp{
+    position: relative;
+    overflow: hidden;
+    width: 80%;
+    margin: 0 auto;
+    text-align: center;
+  }
+  .messageBoard .modal-body form div.img-item{
+    position: relative;
+    float: left;
+    margin-right: 23px;
+    width: 84px;
+    height: 70px;
+    cursor:  pointer;
+    border: #C9C9C9 1px solid;
+    font-size: 14px;
+  }
+  .messageBoard .modal-body form div.img-item:last-child{
+    margin-right: 0;
+  }
+  .messageBoard .modal-body form div.img-item input[type="file"]{
+    position: absolute;
+    top: 0;
+    left: -20px;
+    width: 84px;
+    height: 70px;
+    opacity: 0;
+  }
+  .messageBoard .modal-body form div.img-item img{
+    display: inline-block;
+    max-width: 80px;
+    max-height: 60px;
+    z-index: 10;
+    margin-top: 4px;
+  }
+  .messageBoard .modal-body form p.tip{
+    text-align: left;
+    color: #999;
+    font-size: 12px;
+    padding-left: 68px;
+  }
+  .messageBoard .modal-body form label{
+    margin-bottom: 10px;
+    font-size: 14px;
+    font-weight: normal;
+  }
+  .messageBoard .modal-body form input[type='text']{
+    width: 295px;
+  }
+  .messageBoard .modal-body form button{
+    margin: 10px auto;
+    width: 100px;
+    height: 35px;
+    background: #4777C6;
+    color: #fff;
+    border-radius: 0;
+    text-align: center;
+  }
+  .messageBoard .modal-body form .msg-message>label{
+    font-size: 14px;
+  }
+  .messageBoard .modal-body form .msg-message span{
+    margin: 0 auto;
+    font-size: 12px;
+    margin-left: 5px;
+  }
+  .messageBoard .modal-body form .input-style span{
+    color: #666;
+  }
+  .messageBoard .modal-body form .msg-message span i{
+    padding-right: 5px;
+    color: #4777C6;
+  }
+  .messageBoard .modal-body form b{
+    margin-right: 5px;
+    font-weight: bold;
+    color: #FF5A5C;
+  }
+  .messageBoard .modal-body form b.first{
+    position: relative;
+    top: -95px;
+    left: 2px;
+  }
+  .messageBoard .modal-body .history{
+    border-collapse: collapse;
+    margin: 10px auto;
+    padding: 0 20px;
+    width: 500px;
+    min-height: 105px;
+    font-size: 16px;
+    color: #333;
+    border-bottom: 1px dashed #c5c5c5;
+  }
+  .messageBoard .modal-body .msg-table{
+    /*position: absolute;*/
+    overflow: auto;
+    height: 372px;
+    width: 670px;
+    margin-top: 10px;
+  }
+  .messageBoard .modal-body .msg-table .form-group{
+    margin-bottom: 15px;
+  }
+  .messageBoard .modal-body .msgDate {
+    padding-right: 55px;
+    text-align: right;
+    font-size: 13px;
+  }
+  .messageBoard .modal-body .question{
+    margin-bottom: 10px;
+    font-size: 12px;
+    font-weight: normal;
+    list-style-type: none;
+    font-style: inherit;
+  }
+  .messageBoard .modal-body .answer{
+    margin-bottom: 10px;
+    color: #fa842d;
+    font-size: 12px;
+    font-weight: normal;
+    list-style-type: none;
+    font-style: inherit;
+  }
+  .messageBoard .msg-slide1{
+    position: absolute;
+    right: 0;
+    top: 50%;
+    width: 33px;
+    height: 100px;
+    margin-top: -50px;
+    background: url("/images/messageBoard/circle-left.png") no-repeat top right;
+    color: #fff;
+    cursor: pointer;
+  }
+  .messageBoard .msg-slide1 span{
+    display: inline-block;
+    width: 20px;
+    height: 40px;
+    padding-top: 16px;
+    margin-left: 13px;
+    text-align: center;
+    vertical-align: middle;
+  }
+  .messageBoard .msg-slide1 i{
+    position: absolute;
+    top: 50%;
+    left: 2px;
+    line-height: 20px;
+    margin-top: -10px;
+    font-size: 26px;
+  }
+  .messageBoard .msg-slide2{
+    width: 33px;
+    height: 100px;
+    position: absolute;
+    top: 50%;
+    left: 0;
+    margin-top: -50px;
+    background: url("/images/messageBoard/circle-right.png") no-repeat top right;
+    color: #fff;
+    cursor: pointer;
+  }
+
+  .messageBoard .msg-slide2 span{
+    display: inline-block;
+    width: 20px;
+    height: 40px;
+    padding-top: 16px;
+    margin-right: 13px;
+    text-align: center;
+    vertical-align: middle;
+  }
+  .messageBoard .msg-slide2 i{
+    position: absolute;
+    top: 50%;
+    right: 2px;
+    line-height: 20px;
+    margin-top: -10px;
+    font-size: 26px;
+  }
+  .msg-message{
+    text-align: left;
+    margin-bottom: 5px;
+    height: 30px;
+    line-height: 30px;
+  }
+  .msg-message .msg-content label{
+    margin-left: 75px;
+    margin-right: 0 !important;
+  }
+  .msg-message .modal-body div.txtArea{
+    padding-left: 55px;
+  }
+  .messageBoard .modal-body form p.radioLabel{
+    margin-bottom: 10px;
+  }
+  .radioLabel {
+    line-height: 20px;
+    cursor: pointer;
+    color: #666;
+  }
+  .radioLabel label{
+    width: 16px;
+    height: 16px;
+    background: url("/images/messageBoard/radio.png");
+    background-position: 0 -1px;
+    margin-right: 2px;
+    vertical-align: middle;
+    margin-bottom: 0 !important;
+    margin-right: 0 !important;
+  }
+  .radioLabel input[type="radio"]:checked + label {
+    background-position: -19px -1px;
+  }
+  .radioLabel input[type="radio"] + label + span {
+    margin-left: 5px;
+  }
+  .radioLabel input[type="radio"]:checked + label + span{
+    color: #5078cb;
+  }
+  .radioLabel input[type="radio"]{
+    display: none;
+  }
+</style>

+ 1 - 1
nuxt.config.js

@@ -107,5 +107,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/help**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**']
 }

+ 42 - 0
pages/messageBoard/messageBoard.vue

@@ -0,0 +1,42 @@
+<!--
+<template>
+  <div class="message">
+    <message-board @pageEvent="listenPage"/>
+  </div>
+</template>
+<script>
+  import MessageBoard from '~components/messageBoard/MessageBoard.vue'
+  export default {
+    components: {
+      MessageBoard
+    },
+    data () {
+      return {
+        page: 1,
+        count: 3,
+        currentPage: 1
+      }
+    },
+    fetch ({ store }) {
+      return Promise.all([
+        store.dispatch('userIsLogin'),
+        store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
+      ])
+    },
+    methods: {
+      listenPage: function (p) {
+        this.page = p
+        this.$store.dispatch('getMessageBoardInformation', {page: this.page, count: 3})
+      }
+    }
+  }
+</script>
+<style  scoped>
+ .message .el-dialog__header {
+    display: none;
+  }
+ .message .el-dialog__body {
+   padding: 0;
+ }
+</style>
+-->

+ 2 - 1
plugins/element-ui.js

@@ -1,8 +1,9 @@
 import Vue from 'vue'
-import { Breadcrumb, BreadcrumbItem, Tree, Pagination, Dialog } from 'element-ui'
+import { Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog } from 'element-ui'
 
 Vue.use(Breadcrumb)
 Vue.use(BreadcrumbItem)
 Vue.use(Tree)
 Vue.use(Pagination)
+Vue.use(Upload)
 Vue.use(Dialog)

BIN
static/images/messageBoard/circle-left.png


BIN
static/images/messageBoard/circle-right.png


BIN
static/images/messageBoard/msg_nav.png


BIN
static/images/messageBoard/msg_uploadPic.png


BIN
static/images/messageBoard/radio.png


+ 56 - 3
store/index.js

@@ -1,4 +1,4 @@
-import axios from '~plugins/axios'
+import axios from '~plugins/axios'
 
 // 获取品牌详情产品分类信息
 function loadBrandCategories ({commit}, params = {}) {
@@ -206,6 +206,16 @@ export const actions = {
         commit('componentInformation/GET_INFORMATION_FAILURE', err)
       })
   },
+  // 获取库存寄售店铺storeid
+  getUmallStoreId ({commit}) {
+    commit('componentUmallStoreId/REQUEST_STOREID')
+    return axios.get('/api/store-service/stores/UmallStore')
+      .then(response => {
+        commit('componentUmallStoreId/GET_STOREID_SUCCESS', response.data)
+      }, err => {
+        commit('componentUmallStoreId/GET_STOREID_FAILURE', err)
+      })
+  },
   // 品牌详情页面
   // 获得品牌详情信息
   loadBrandDetail ({commit, dispatch}, params = {}) {
@@ -249,11 +259,54 @@ export const actions = {
     commit('brandPages/REQUEST_PAGES', params)
     return axios.get('/api/product/PAGES/list', { params })
       .then(response => {
-        commit('brandPages/GET__SUCCESS', response.data)
+        commit('brandPages/GET_PAGES_SUCCESS', response.data)
+      }, err => {
+        commit('brandPages/GET_PAGES_FAILURE', err)
+      })
+  },
+  // 留言板
+  // 提交了留言板信息
+  uploadMessageBoardInformation ({commit}, params) {
+    commit('messageBoard/REQUEST_INFORMATION')
+    return axios.post('/api/operation/messageBoard', params)
+      .then(response => {
+        commit('messageBoard/GET_INFORMATION_SUCCESS', response.data)
+      }, err => {
+        commit('messageBoard/GET_INFORMATION_FAILURE', err)
+      })
+  },
+  // 验证用户是否登录
+  userIsLogin ({commit}) {
+    commit('messageBoardIsLogin/REQUEST_LOGIN')
+    return axios.get('/user/authentication')
+      .then(response => {
+        commit('messageBoardIsLogin/GET_LOGIN_SUCCESS', response.data)
+      }, err => {
+        commit('messageBoardIsLogin/GET_LOGIN_FAILURE', err)
+      })
+  },
+  // 获取留言记录信息
+  getMessageBoardInformation ({commit}, params) {
+    let sorting = {createDate: 'DESC'}
+    params.sorting = sorting
+    commit('messageBoardInformation/REQUEST_INFORMATION', params)
+    return axios.get('/operation/messageBoard/pageInfo/user', { params })
+      .then(response => {
+        commit('messageBoardInformation/GET_INFORMATION_SUCCESS', response.data)
       }, err => {
-        commit('brandPages/GET_COMPONENT_FAILURE', err)
+        commit('messageBoardInformation/GET_INFORMATION_FAILURE', err)
       })
   },
+  // // 上传图片
+  // uploadImg ({commit}) {
+  //   commit('uploadImg/REQUEST_IMG')
+  //   return axios.post('/api/images')
+  //     .then(response => {
+  //       commit('uploadImg/GET_IMG_SUCCESS', response.data)
+  //     }, err => {
+  //       commit('uploadImg/GET_IMG_FAILURE', err)
+  //     })
+  // },
   // 获取帮助中心信息
   loadHelpSnapsho ({ commit }, params = {}) {
     commit('help/REQUEST_SNAPSHO')

+ 18 - 0
store/messageBoard.js

@@ -0,0 +1,18 @@
+export const state = () => ({
+  information: {
+    fetching: false,
+    data: []
+  }
+})
+export const mutations = {
+  REQUEST_INFORMATION (state) {
+    state.information.fetching = true
+  },
+  GET_INFORMATION_FAILURE (state) {
+    state.information.fetching = false
+  },
+  GET_INFORMATION_SUCCESS (state, result) {
+    state.information.fetching = false
+    state.information.data = result
+  }
+}

+ 18 - 0
store/messageBoardInformation.js

@@ -0,0 +1,18 @@
+export const state = () => ({
+  information: {
+    fetching: false,
+    data: []
+  }
+})
+export const mutations = {
+  REQUEST_INFORMATION (state) {
+    state.information.fetching = true
+  },
+  GET_INFORMATION_FAILURE (state) {
+    state.information.fetching = false
+  },
+  GET_INFORMATION_SUCCESS (state, result) {
+    state.information.fetching = false
+    state.information.data = result
+  }
+}

+ 18 - 0
store/messageBoardIsLogin.js

@@ -0,0 +1,18 @@
+export const state = () => ({
+  login: {
+    fetching: false,
+    data: []
+  }
+})
+export const mutations = {
+  REQUEST_LOGIN (state) {
+    state.login.fetching = true
+  },
+  GET_LOGIN_FAILURE (state) {
+    state.login.fetching = false
+  },
+  GET_LOGIN_SUCCESS (state, result) {
+    state.login.fetching = false
+    state.login.data = result
+  }
+}