articleTwo.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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.uu)">
  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. console.log('12', this.$store.state.supplier.merchant.recommend.data)
  36. return this.$store.state.supplier.merchant.recommend.data
  37. }
  38. },
  39. methods: {
  40. jumpResource (id) {
  41. if (!this.hasJump) {
  42. this.isVaildSupplier(id)
  43. }
  44. },
  45. // 判断是否有有效物料信息
  46. isVaildSupplier (id) {
  47. this.$http.get('vendor/introduction/product/count', {params: {vendUU: id}})
  48. .then(res => {
  49. if (res.data.count !== 0) {
  50. this.$router.push('supplier/' + id)
  51. } else {
  52. this.hasDialog = true
  53. }
  54. }, err => {
  55. console.log(err)
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style type="text/scss" lang="scss">
  62. .supplier_two{
  63. position:relative;
  64. border:1px solid #ccc;
  65. border-radius:5px;
  66. padding-bottom:5px;
  67. margin-bottom:15px;
  68. background: #fff;
  69. min-height:300px;
  70. .el-dialog{
  71. width: 290px!important;
  72. .el-dialog__header{
  73. background: #4290f7;
  74. line-height: 40px;
  75. padding: 0 20px 0;
  76. display:block;
  77. .el-dialog__title{
  78. color:#fff;
  79. }
  80. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  81. color:#fff;
  82. }
  83. }
  84. .el-dialog__body{
  85. padding: 10px 20px;
  86. }
  87. .el-dialog__footer{
  88. text-align: center;
  89. a{
  90. display:inline-block;
  91. background: #3c7cf5;
  92. color:#fff;
  93. font-size: 14px;
  94. line-height: 30px;
  95. height:30px;
  96. padding:0 10px;
  97. border-radius:5px;
  98. }
  99. }
  100. }
  101. .form_dialog{
  102. p{
  103. width:200px;
  104. font-size: 14px;
  105. color:#666666;
  106. margin:0 auto;
  107. padding-top:5px;
  108. line-height: 20px;
  109. span{
  110. color:#eb6054;
  111. }
  112. }
  113. }
  114. .title{
  115. height:35px;
  116. text-align: center;
  117. background: #2496f1;
  118. margin-bottom:5px;
  119. span{
  120. line-height: 35px;
  121. font-size: 18px;
  122. color:#fff;
  123. }
  124. }
  125. ul{
  126. li{
  127. position:relative;
  128. padding: 0 10px;
  129. line-height: 50px;
  130. height:50px;
  131. color:#666;
  132. overflow: hidden;
  133. margin-bottom:10px;
  134. &:hover{
  135. cursor:pointer;
  136. color:#2496f1;
  137. }
  138. .img{
  139. float:left;
  140. width:50px;
  141. height:50px;
  142. vertical-align: middle;
  143. border:1px solid #ccc;
  144. img{
  145. width:100%;
  146. height:100%;
  147. vertical-align: top;
  148. }
  149. }
  150. .content_name{
  151. margin-left:60px;
  152. width:140px;
  153. overflow: hidden;
  154. text-overflow: ellipsis;
  155. white-space:nowrap;
  156. }
  157. }
  158. }
  159. }
  160. </style>