merchant.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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>
  9. <div class="search">
  10. <div class="input-group">
  11. <input type="search" class="form-control" title="code" placeholder="名称/地址/行业/型号/品牌"
  12. v-model="searchCode" @keyup.13="goodsSearch(searchCode)" @search="goodsSearch(searchCode)"/>
  13. <span class="input-group-btn">
  14. <button type="button" class="btn" @click="goodsSearch(searchCode)">&nbsp;查 询</button>
  15. </span>
  16. </div>
  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, item.hasProduct)">
  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, item.hasProduct)"></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 Page from '~components/common/page/pageComponent.vue'
  62. export default {
  63. name: 'MerchantView',
  64. data () {
  65. return {
  66. hasDialog: false,
  67. hasJump: false,
  68. searchCode: '',
  69. pageParams: {
  70. count: 20,
  71. page: 1
  72. }
  73. }
  74. },
  75. components: {
  76. Page
  77. },
  78. computed: {
  79. isInFrame () {
  80. if (this.$route.query.type === 'erp') {
  81. return true
  82. }
  83. },
  84. list () {
  85. return this.$store.state.supplier.merchant.merchant.data
  86. }
  87. },
  88. methods: {
  89. addResource (id, type) {
  90. if (this.isInFrame) {
  91. this.$http.get(`/basic/enterprise /${id}/info`)
  92. .then(res => {
  93. if (res.data) {
  94. window.open(this.$route.query.localPath + this.$route.query.erpPath + '?b2bdata=' + encodeURIComponent(JSON.stringify(res.data)))
  95. }
  96. })
  97. .catch(err => {
  98. console.log(err)
  99. })
  100. } else {
  101. if (type === 1) {
  102. this.$router.push('supplier/' + id)
  103. } else {
  104. this.hasDialog = true
  105. }
  106. }
  107. },
  108. jumpResource (id, type) {
  109. if (!this.hasJump) {
  110. if (type === 1) {
  111. this.$router.push('supplier/' + id)
  112. } else {
  113. this.hasDialog = true
  114. }
  115. }
  116. },
  117. goodsSearch (type) {
  118. this.pageParams.page = 1
  119. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: type})
  120. },
  121. handleCurrentChange (type) {
  122. this.pageParams.page = type
  123. this.$store.dispatch('supplier/loadVendorList', {page: type, size: this.pageParams.count, keyword: this.searchCode})
  124. }
  125. }
  126. }
  127. </script>
  128. <style type="text/scss" lang="scss">
  129. .merchant{
  130. background: #ecf1f1 url(/images/supplier/banner.jpg)no-repeat;
  131. border-top:3px solid #000;
  132. padding-bottom:25px;
  133. margin-top:-1.5em;
  134. .el-dialog{
  135. width: 290px!important;
  136. .el-dialog__header{
  137. background: #4290f7;
  138. line-height: 40px;
  139. padding: 0 20px 0;
  140. .el-dialog__title{
  141. color:#fff;
  142. }
  143. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  144. color:#fff;
  145. }
  146. }
  147. .el-dialog__body{
  148. padding: 10px 20px;
  149. }
  150. .el-dialog__footer{
  151. text-align: center;
  152. a{
  153. display:inline-block;
  154. background: #3c7cf5;
  155. color:#fff;
  156. font-size: 14px;
  157. line-height: 30px;
  158. height:30px;
  159. padding:0 10px;
  160. border-radius:5px;
  161. }
  162. }
  163. }
  164. .form_dialog{
  165. p{
  166. width:200px;
  167. font-size: 14px;
  168. color:#666666;
  169. margin:0 auto;
  170. padding-top:5px;
  171. line-height: 20px;
  172. span{
  173. color:#eb6054;
  174. }
  175. }
  176. }
  177. .top{
  178. padding-top:30px;
  179. margin-bottom:40px;
  180. .title{
  181. margin:0 auto;
  182. text-align: center;
  183. width:215px;
  184. border-bottom:1px solid #ff5151;
  185. color:#fff;
  186. p{
  187. margin:0;
  188. }
  189. h2{
  190. font-size: 32px;
  191. margin:0;
  192. line-height: 46px;
  193. }
  194. &:before{
  195. content: '';
  196. display:block;
  197. position:relative;
  198. left:55px;
  199. top:61px;
  200. width:105px;
  201. height:1px;
  202. background: #ff8a00;
  203. }
  204. &:after{
  205. content: '';
  206. display:block;
  207. position:relative;
  208. left:55px;
  209. top:4px;
  210. width:105px;
  211. height:1px;
  212. background: #fff600;
  213. }
  214. }
  215. .search{
  216. float:right;
  217. width:310px;
  218. text-align: right;
  219. margin-right:10px;
  220. .btn{
  221. width:68px;
  222. background: #ffa200;
  223. color:#fff;
  224. }
  225. }
  226. }
  227. .list_info{
  228. padding: 0 10px;
  229. .empty{
  230. height:418px;
  231. border:15px solid #c4e9f9;
  232. background: #eef9fd;
  233. padding-top:165px;
  234. text-align: center;
  235. img{
  236. vertical-align: top;
  237. margin-right:15px;
  238. }
  239. .info{
  240. display: inline-block;
  241. padding-top:10px;
  242. }
  243. }
  244. > ul{
  245. margin-left:5px;
  246. li{
  247. position:relative;
  248. vertical-align: top;
  249. width:267px;
  250. height:115px;
  251. border-radius:5px;
  252. margin-right:32px;
  253. margin-bottom:60px;
  254. background: #ffffff;
  255. box-shadow: 0 3px 10px rgba(0,0,0,.8);
  256. &:nth-child(4n) {
  257. margin-right:0;
  258. }
  259. &:after{
  260. content: '';
  261. display:block;
  262. position:absolute;
  263. top:99%;
  264. left:50%;
  265. z-index:200;
  266. width:88px;
  267. height:22px;
  268. margin-left:-44px;
  269. background: url(/images/supplier/icon/bottom_center_img.png)no-repeat;
  270. }
  271. .has_shop {
  272. position:absolute;
  273. right:0;
  274. top:0;
  275. width:68px;
  276. height:22px;
  277. background: url(/images/supplier/icon/top_right_img.png)no-repeat;
  278. color:#fff;
  279. font-weight: bold;
  280. text-align: center;
  281. line-height: 22px;
  282. }
  283. .enterprise_name{
  284. padding-top:15px;
  285. width:98%;
  286. overflow: hidden;
  287. text-overflow: ellipsis;
  288. white-space:nowrap;
  289. border-bottom:1px solid #b9def7;
  290. font-weight: bold;
  291. color:#1891e4;
  292. font-size: 18px;
  293. line-height: 48px;
  294. text-align: center;
  295. }
  296. .select_btn{
  297. position:absolute;
  298. bottom:-10px;
  299. left:50%;
  300. z-index:250;
  301. width:56px;
  302. height:56px;
  303. padding:10px 0;
  304. margin-left:-28px;
  305. text-align: center;
  306. line-height: 18px;
  307. background: #1891e4;
  308. border-radius:50%;
  309. color:#fff;
  310. }
  311. &:hover{
  312. cursor:pointer;
  313. .popups{
  314. top:99%;
  315. opacity:1;
  316. z-index:100;
  317. }
  318. }
  319. .popups{
  320. position:absolute;
  321. top:50px;
  322. left:0;
  323. background: #6c6c6c;
  324. width:267px;
  325. min-height:20px;
  326. padding:20px 15px 5px 10px;
  327. transition: all .5s ease;
  328. opacity: 0;
  329. color:#fff;
  330. overflow: hidden;
  331. p{
  332. float:left;
  333. margin: 0 !important;
  334. line-height: 18px;
  335. max-height:18px;
  336. overflow: hidden;
  337. text-overflow: ellipsis;
  338. white-space: nowrap;
  339. &:nth-child(2n-1){
  340. width:42px;
  341. }
  342. &:first-child{
  343. width:85px;
  344. }
  345. &:nth-child(2n){
  346. width:200px;
  347. }
  348. &:nth-child(2){
  349. width:155px;
  350. }
  351. &:nth-child(4){
  352. max-height:38px;
  353. overflow: hidden;
  354. white-space:pre-wrap;
  355. word-wrap:break-word;
  356. }
  357. &:last-child{
  358. overflow: hidden;
  359. text-overflow: ellipsis;
  360. white-space: nowrap;
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. </style>