articleTwo.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="supplier_two">
  3. <div class="title">
  4. <span>供应商推荐</span>
  5. </div>
  6. <ul class="list-unstyled">
  7. <li v-for="item in list.content" @click="jumpResource(item.enUU)">
  8. <div class="img">
  9. <img :src="item.enLogoUrl || '/images/all/default.png'">
  10. </div>
  11. <div class="content_name" v-text="item.enName">深圳英优软科技有限公司</div>
  12. </li>
  13. </ul>
  14. <el-dialog
  15. title="提示"
  16. :visible.sync="hasDialog ">
  17. <div class="form_dialog">
  18. <p><span>供应商正在完善产品信息,</span>暂时不能查看更多。 </p>
  19. </div>
  20. <span slot="footer" class="dialog-footer">
  21. <a type="button" @click="hasDialog=false">我知道了</a>
  22. </span>
  23. </el-dialog>
  24. </div>
  25. </template>
  26. <script>
  27. export default {
  28. data () {
  29. return {
  30. hasDialog: false
  31. }
  32. },
  33. computed: {
  34. list () {
  35. return this.$store.state.supplier.merchant.recommend.data
  36. }
  37. },
  38. methods: {
  39. jumpResource (id) {
  40. if (!this.hasJump) {
  41. this.isVaildSupplier(id)
  42. }
  43. },
  44. // 判断是否有有效物料信息
  45. isVaildSupplier (id) {
  46. this.$http.get('vendor/introduction/product/count', {params: {vendUU: id}})
  47. .then(res => {
  48. if (res.data.count !== 0) {
  49. this.$router.push('supplier/' + id)
  50. } else {
  51. this.hasDialog = true
  52. }
  53. }, err => {
  54. console.log(err)
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style type="text/scss" lang="scss">
  61. .supplier_two{
  62. position:relative;
  63. border:1px solid #ccc;
  64. border-radius:5px;
  65. padding-bottom:5px;
  66. margin-bottom:15px;
  67. background: #fff;
  68. min-height:300px;
  69. .el-dialog{
  70. width: 290px!important;
  71. .el-dialog__header{
  72. background: #4290f7;
  73. line-height: 40px;
  74. padding: 0 20px 0;
  75. .el-dialog__title{
  76. color:#fff;
  77. }
  78. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  79. color:#fff;
  80. }
  81. }
  82. .el-dialog__body{
  83. padding: 10px 20px;
  84. }
  85. .el-dialog__footer{
  86. text-align: center;
  87. a{
  88. display:inline-block;
  89. background: #3c7cf5;
  90. color:#fff;
  91. font-size: 14px;
  92. line-height: 30px;
  93. height:30px;
  94. padding:0 10px;
  95. border-radius:5px;
  96. }
  97. }
  98. }
  99. .form_dialog{
  100. p{
  101. width:200px;
  102. font-size: 14px;
  103. color:#666666;
  104. margin:0 auto;
  105. padding-top:5px;
  106. line-height: 20px;
  107. span{
  108. color:#eb6054;
  109. }
  110. }
  111. }
  112. .title{
  113. height:35px;
  114. text-align: center;
  115. background: #2496f1;
  116. margin-bottom:5px;
  117. span{
  118. line-height: 35px;
  119. font-size: 18px;
  120. color:#fff;
  121. }
  122. }
  123. ul{
  124. li{
  125. position:relative;
  126. padding: 0 10px;
  127. line-height: 50px;
  128. height:50px;
  129. color:#666;
  130. overflow: hidden;
  131. margin-bottom:10px;
  132. &:hover{
  133. cursor:pointer;
  134. color:#2496f1;
  135. }
  136. .img{
  137. float:left;
  138. width:50px;
  139. height:50px;
  140. vertical-align: middle;
  141. border:1px solid #ccc;
  142. img{
  143. width:100%;
  144. height:100%;
  145. vertical-align: top;
  146. }
  147. }
  148. .content_name{
  149. margin-left:60px;
  150. width:140px;
  151. overflow: hidden;
  152. text-overflow: ellipsis;
  153. white-space:nowrap;
  154. }
  155. }
  156. }
  157. }
  158. </style>