merchant.vue 11 KB

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