merchant.vue 9.2 KB

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