merchant.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <div class="merchant">
  3. <div class="container">
  4. <div class="top clearfix">
  5. <div class="title">
  6. <p>High quality dealer</p>
  7. <h2>供应商列表</h2>
  8. <!-- <div class="count">
  9. <img src="/images/supplier/count.png" alt=""/>
  10. <div class="count_num">
  11. <span v-for="spCount in all" v-text="spCount"></span>
  12. </div>
  13. </div>-->
  14. </div>
  15. <div class="count">
  16. <img src="/images/supplier/count1.png" alt=""/>
  17. <div class="count_num">
  18. <span v-for="spCount in all" v-text="spCount"></span>
  19. </div>
  20. </div>
  21. <div class="search">
  22. <search-header :outerKeyword="searchCode" :similarUrl="similarUrl" :type="'supplier'" @searchAction="search" :placeholder="'品牌/类目/型号/公司名'"></search-header>
  23. </div>
  24. </div>
  25. <div class="list_info">
  26. <div class="empty" v-if="!list.content || list.content.length === 0">
  27. <img src="/images/supplier/icon/empty.png">
  28. <div class="supplier-empty-info">
  29. <p>暂无供应商信息</p>
  30. <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
  31. </div>
  32. </div>
  33. <ul class="list-inline">
  34. <li v-for="item in list.content" @click="jumpResource(item.enUU)">
  35. <div class="has_shop" v-if="item.isStore === 1">已开店</div>
  36. <div class="enterprise_name" v-text="item.enName">深圳英优软科技有限公司</div>
  37. <div class="select_btn" v-html="isInFrame ? '添加为<br/>供应商' : '查看<br/>更多'" @mouseleave="hasJump = false" @mouseenter="hasJump = true" @click="addResource(item.enUU)"></div>
  38. <div class="popups">
  39. <p>企业执照号:</p><p v-text="item.enBusinesscode ? item.enBusinesscode : '暂无信息'">1</p>
  40. <p>地址:</p><p v-text="item.enAddress ? item.enAddress : '暂无信息'">1</p>
  41. <p>邮箱:</p><p v-text="item.enEmail ? item.enEmail : '暂无信息'">h</p>
  42. <p>电话:</p><p v-text="item.enTel ? item.enTel : '暂无信息'">1</p>
  43. <p>行业:</p><p v-text="item.enIndustry ? item.enIndustry : '暂无信息'">1</p>
  44. </div>
  45. </li>
  46. </ul>
  47. <div style="float: right;">
  48. <page :total="list.totalElements" :page-size="pageParams.count"
  49. :current="pageParams.page" v-on:childEvent="handleCurrentChange">
  50. </page>
  51. </div>
  52. </div>
  53. <el-dialog
  54. title="提示"
  55. :visible.sync="hasDialog ">
  56. <div class="form_dialog">
  57. <p><span>供应商正在完善产品信息,</span>暂时不能查看更多。 </p>
  58. </div>
  59. <span slot="footer" class="dialog-footer">
  60. <a type="button" @click="hasDialog=false">我知道了</a>
  61. </span>
  62. </el-dialog>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import SearchHeader from '~components/common/PcSearchHeader.vue'
  68. import Page from '~components/common/page/pageComponent.vue'
  69. export default {
  70. name: 'MerchantView',
  71. data () {
  72. return {
  73. hasDialog: false,
  74. hasJump: false,
  75. searchCode: '',
  76. pageParams: {
  77. count: 20,
  78. page: 1
  79. },
  80. similarUrl: '/search/product/similarKeywords',
  81. type: ''
  82. }
  83. },
  84. components: {
  85. Page,
  86. SearchHeader
  87. },
  88. computed: {
  89. list () {
  90. return this.$store.state.supplier.merchant.merchant.data
  91. },
  92. all () {
  93. let count = this.$store.state.supplier.merchant.merchantAll.data
  94. let supplierCount = count.content ? count.totalElements + '' : '00000'
  95. return this.formatNumber(supplierCount, 5)
  96. }
  97. },
  98. methods: {
  99. // 供应商数字格式转换
  100. formatNumber (num, key) {
  101. let count = ('00000' + num).substr(-key)
  102. let _arr = []
  103. for (var i = 0; i < count.length; i++) {
  104. _arr.push(count[i])
  105. }
  106. return _arr
  107. },
  108. addResource (id) {
  109. if (this.isInFrame) {
  110. this.$http.get(`/basic/enterprise /${id}/info`)
  111. .then(res => {
  112. if (res.data) {
  113. window.open(this.$route.query.localPath + this.$route.query.erpPath + '?b2bdata=' + encodeURIComponent(JSON.stringify(res.data)))
  114. }
  115. })
  116. .catch(err => {
  117. console.log(err)
  118. })
  119. } else {
  120. this.isVaildSupplier(id)
  121. }
  122. },
  123. jumpResource (id) {
  124. if (!this.hasJump) {
  125. this.isVaildSupplier(id)
  126. }
  127. },
  128. // 判断是否有有效物料信息
  129. isVaildSupplier (id) {
  130. this.$http.get('vendor/introduction/product/count', {params: {vendUU: id}})
  131. .then(res => {
  132. if (res.data.count !== 0) {
  133. this.$router.push('supplier/' + id)
  134. } else {
  135. this.hasDialog = true
  136. }
  137. }, err => {
  138. console.log(err)
  139. })
  140. },
  141. search (type) {
  142. this.pageParams.page = 1
  143. this.searchCode = type.keyword
  144. this.type = type.type
  145. this.handleCurrentChange(1)
  146. },
  147. goodsSearch (type) {
  148. this.searchCode = type
  149. this.handleCurrentChange(1)
  150. },
  151. handleCurrentChange (type) {
  152. this.pageParams.page = type
  153. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: this.searchCode, field: this.type})
  154. }
  155. }
  156. }
  157. </script>
  158. <style type="text/scss" lang="scss">
  159. .merchant{
  160. background: #ecf1f1 url(/images/supplier/banner.jpg)no-repeat;
  161. border-top:3px solid #000;
  162. padding-bottom:25px;
  163. margin-top:-1.5em;
  164. .el-dialog{
  165. width: 290px!important;
  166. .el-dialog__header{
  167. background: #4290f7;
  168. line-height: 40px;
  169. padding: 0 20px 0;
  170. .el-dialog__title{
  171. color:#fff;
  172. }
  173. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  174. color:#fff;
  175. }
  176. }
  177. .el-dialog__body{
  178. padding: 10px 20px;
  179. }
  180. .el-dialog__footer{
  181. text-align: center;
  182. a{
  183. display:inline-block;
  184. background: #3c7cf5;
  185. color:#fff;
  186. font-size: 14px;
  187. line-height: 30px;
  188. height:30px;
  189. padding:0 10px;
  190. border-radius:5px;
  191. }
  192. }
  193. }
  194. .form_dialog{
  195. p{
  196. width:200px;
  197. font-size: 14px;
  198. color:#666666;
  199. margin:0 auto;
  200. padding-top:5px;
  201. line-height: 20px;
  202. span{
  203. color:#eb6054;
  204. }
  205. }
  206. }
  207. .top{
  208. padding-top:30px;
  209. margin-bottom:40px;
  210. .title{
  211. margin:0 auto;
  212. text-align: center;
  213. width:215px;
  214. border-bottom:1px solid #ff5151;
  215. color:#fff;
  216. padding-bottom: 3px;
  217. p{
  218. margin:0;
  219. }
  220. h2{
  221. font-size: 32px;
  222. margin:0;
  223. line-height: 46px;
  224. }
  225. &:before{
  226. content: '';
  227. display:block;
  228. position:relative;
  229. left:55px;
  230. top:63px;
  231. width:105px;
  232. height:1px;
  233. background: #ff8a00;
  234. }
  235. &:after{
  236. content: '';
  237. display:block;
  238. position:relative;
  239. left:55px;
  240. top:8px;
  241. width:105px;
  242. height:1px;
  243. background: #fff600;
  244. }
  245. }
  246. .count{
  247. position: relative;
  248. width: 200px;
  249. margin: 20px auto;
  250. margin-bottom: 0px;
  251. .count_num {
  252. position:absolute;
  253. top: 9px;
  254. left: 24px;
  255. span {
  256. display:inline-block;
  257. text-align: center;
  258. width: 20px;
  259. font-size: 28px;
  260. color: #0066e4;
  261. font-family: "Microsoft Yahei", "微软雅黑";
  262. font-weight: bold;
  263. }
  264. }
  265. }
  266. .search{
  267. float:right;
  268. width:370px;
  269. padding-top:50px;
  270. margin-right:10px;
  271. .btn{
  272. width:68px;
  273. background: #ffa200;
  274. color:#fff;
  275. }
  276. .title{
  277. width:100%;
  278. text-align: left;
  279. }
  280. }
  281. }
  282. .list_info{
  283. padding: 0 10px;
  284. min-height:300px;
  285. margin-bottom:100px;
  286. .empty{
  287. height:418px;
  288. border:15px solid #c4e9f9;
  289. background: #eef9fd;
  290. padding-top:165px;
  291. text-align: center;
  292. img{
  293. vertical-align: top;
  294. margin-right:15px;
  295. }
  296. .supplier-empty-info{
  297. display: inline-block;
  298. padding-top:10px;
  299. }
  300. }
  301. > ul{
  302. margin-left:5px;
  303. li{
  304. position:relative;
  305. vertical-align: top;
  306. width:267px;
  307. height:115px;
  308. border-radius:5px;
  309. margin-right:32px;
  310. margin-bottom:60px;
  311. background: #ffffff;
  312. box-shadow: 0 3px 10px rgba(0,0,0,.8);
  313. &:nth-child(4n) {
  314. margin-right:0;
  315. }
  316. &:after{
  317. content: '';
  318. display:block;
  319. position:absolute;
  320. top:99%;
  321. left:50%;
  322. z-index:200;
  323. width:88px;
  324. height:22px;
  325. margin-left:-44px;
  326. background: url(/images/supplier/icon/bottom_center_img.png)no-repeat;
  327. }
  328. .has_shop {
  329. position:absolute;
  330. right:0;
  331. top:0;
  332. width:68px;
  333. height:22px;
  334. background: url(/images/supplier/icon/top_right_img.png)no-repeat;
  335. color:#fff;
  336. font-weight: bold;
  337. text-align: center;
  338. line-height: 22px;
  339. }
  340. .enterprise_name{
  341. padding-top:15px;
  342. width:98%;
  343. overflow: hidden;
  344. text-overflow: ellipsis;
  345. white-space:nowrap;
  346. border-bottom:1px solid #b9def7;
  347. font-weight: bold;
  348. color:#1891e4;
  349. font-size: 18px;
  350. line-height: 48px;
  351. text-align: center;
  352. }
  353. .select_btn{
  354. position:absolute;
  355. bottom:-10px;
  356. left:50%;
  357. z-index:250;
  358. width:56px;
  359. height:56px;
  360. padding:10px 0;
  361. margin-left:-28px;
  362. text-align: center;
  363. line-height: 18px;
  364. background: #1891e4;
  365. border-radius:50%;
  366. color:#fff;
  367. }
  368. &:hover{
  369. cursor:pointer;
  370. .popups{
  371. top:99%;
  372. opacity:1;
  373. z-index:100;
  374. }
  375. }
  376. .popups{
  377. position:absolute;
  378. top:50px;
  379. left:0;
  380. background: #6c6c6c;
  381. width:267px;
  382. min-height:20px;
  383. padding:20px 15px 5px 10px;
  384. transition: all .5s ease;
  385. opacity: 0;
  386. color:#fff;
  387. overflow: hidden;
  388. p{
  389. float:left;
  390. margin: 0 !important;
  391. line-height: 18px;
  392. max-height:18px;
  393. overflow: hidden;
  394. text-overflow: ellipsis;
  395. white-space: nowrap;
  396. &:nth-child(2n-1){
  397. width:42px;
  398. }
  399. &:first-child{
  400. width:85px;
  401. }
  402. &:nth-child(2n){
  403. width:200px;
  404. }
  405. &:nth-child(2){
  406. width:155px;
  407. }
  408. &:nth-child(4){
  409. max-height:38px;
  410. overflow: hidden;
  411. white-space:pre-wrap;
  412. word-wrap:break-word;
  413. }
  414. &:last-child{
  415. overflow: hidden;
  416. text-overflow: ellipsis;
  417. white-space: nowrap;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }
  425. </style>