articleTwo.vue 4.1 KB

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