QualificationCertificate.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div>
  3. <div class="brand-content-list">
  4. <ul class="list-unstyled list-inline">
  5. <li class="store-box" v-if="storeInfo.qualifications || storeInfo.qualifications.length !== 0" v-for="(store, index) in storeInfo.qualifications.slice(0,5)">
  6. <div><img :src="store.resourceUrl.indexOf('.pdf')>0?'/images/store/common/pdf.jpg':store.resourceUrl"/></div>
  7. <a @click="showImg(store.resourceUrl)"><div class="Open"><i class="fa fa-search"></i>&nbsp;&nbsp;查看</div></a>
  8. </li>
  9. <li class="active-empty" v-if="!storeInfo.qualifications || storeInfo.qualifications.length == 0">
  10. <div class="text-center">
  11. <div class="show-img">
  12. <img src="/images/brandList/empty-cart.jpg">
  13. </div>
  14. <div class="txt-info">
  15. <p class="grey f16"> 暂无资质证明</p>
  16. <i class="iconfont" v-if="emptyShow === false">&#xe610;</i>&nbsp;<a href="/" v-if="emptyShow === false">返回首页</a>
  17. <img v-if="emptyShow === true" src="/images/brandList/upload.png">&nbsp;<a v-if="emptyShow === true" href="/vendor#/store/maintain" target="_blank">马上去上传</a>
  18. </div>
  19. </div>
  20. </li>
  21. </ul>
  22. </div>
  23. <!--<div class="shadow"><img src="/images/store/common/shadow.png"></div>-->
  24. <!--查看大图 begin-->
  25. <div id="image-box" v-if="isShow">
  26. <div class="x-floating-wrap"></div>
  27. <div class="x-floating">
  28. <div id="item-content">
  29. <div class="x-close-wrap" @click="isShow = false"><a href="javascript:void(0);">&times;</a></div>
  30. <div class="img"><img :src="qualifications.url"/></div>
  31. </div>
  32. </div>
  33. </div>
  34. <!--查看大图 end-->
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'qualification-certificate',
  40. data () {
  41. return {
  42. qualifications: {
  43. url: '',
  44. type: ''
  45. },
  46. type: 0,
  47. isShow: false
  48. }
  49. },
  50. computed: {
  51. storeInfo () {
  52. let storeInfo = this.baseUtils.deepCopy(this.$store.state.shop.storeInfo.store.data)
  53. if (storeInfo.qualifications && storeInfo.qualifications.length) {
  54. let tempQua = []
  55. storeInfo.qualifications.map(item => {
  56. if (item.type === 'APTITUDE') {
  57. tempQua.push(item)
  58. }
  59. })
  60. storeInfo.qualifications = tempQua
  61. }
  62. return storeInfo
  63. },
  64. user() {
  65. return this.$store.state.option.user
  66. },
  67. storeStatus () {
  68. return this.$store.state.option.storeStatus.data
  69. },
  70. emptyShow () {
  71. let loggedStatus = false
  72. if (this.user.logged && this.user.data.enterprise.uu) {
  73. if (this.storeStatus.uuid === this.storeInfo.uuid) {
  74. loggedStatus = true
  75. // this.storeInfo = this.storeStatus
  76. } else {
  77. loggedStatus = false
  78. }
  79. } else {
  80. loggedStatus = false
  81. }
  82. return loggedStatus
  83. }
  84. },
  85. methods: {
  86. showImg (imgUrl) {
  87. if (imgUrl.indexOf('.pdf') === -1) {
  88. this.qualifications.url = imgUrl
  89. this.isShow = true
  90. } else {
  91. window.open(imgUrl)
  92. }
  93. }
  94. },
  95. filters: {
  96. introduceFilter: function (title) {
  97. if (title === '') {
  98. return title
  99. }
  100. let len = 0
  101. let index = 0
  102. for (let i = 0; i < title.length; i++) {
  103. if (index === 0 && title.charAt(i).charCodeAt(0) > 255) {
  104. len = len + 2
  105. } else {
  106. len++
  107. }
  108. if (len > 240) {
  109. index = i
  110. break
  111. }
  112. }
  113. if (index > 0) {
  114. return title.substring(0, index) + '...'
  115. } else {
  116. return title
  117. }
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. /*查看大图*/
  124. #image-box .x-floating-wrap,.image-box .x-floating-wrap {
  125. position: fixed;
  126. z-index: 99998;
  127. background: #000;
  128. top: 0;
  129. left: 0;
  130. width: 100%;
  131. height: 100%;
  132. opacity: 0.5;
  133. }
  134. #image-box,.image-box{
  135. display:table; overflow:hidden; margin-left:50px; _position:relative; width: 1200px;height: 700px;
  136. position: fixed;
  137. top: 50%;
  138. margin-top: -350px;
  139. left: 50%;
  140. margin-left: -600px;
  141. z-index: 2000;
  142. }
  143. #image-box .x-floating,.image-box .x-floating {
  144. vertical-align:middle !important;
  145. display:table-cell;
  146. text-align:center;
  147. _position:absolute;
  148. _top:50%; _left:50%;
  149. top: inherit !important;
  150. left: inherit !important;
  151. }
  152. #image-box .x-floating img ,.image-box .x-floating img {
  153. margin: auto auto;
  154. max-width: 970px !important;
  155. max-height: 600px !important;
  156. -webkit-user-select: none;
  157. -moz-user-select: none;
  158. -ms-user-select: none;
  159. user-select: none;
  160. }
  161. #image-box .x-floating-wrap,.image-box .x-floating-wrap{
  162. z-index: 1000000 !important;
  163. }
  164. #item-content{
  165. color:#fff; display:inline-block; _position:relative; _top:-50%; _left:-50%;
  166. position: relative;
  167. z-index: 10000000;
  168. }
  169. #item-content div.x-close-wrap{
  170. position: absolute;
  171. right: -15px;
  172. line-height: 30px;
  173. top: -13px;
  174. color: #fff;
  175. width: 35px;
  176. height: 35px;
  177. background: rgba(0, 0, 0, 0.5);
  178. border-radius: 100%;
  179. opacity: 1;
  180. margin: 0;
  181. z-index: 100000;
  182. min-height: initial;
  183. text-align: center;
  184. }
  185. #item-content div.x-close-wrap a{
  186. position: relative;
  187. left: 0;
  188. bottom: 0;
  189. font-size: 34px;
  190. color: #fff;
  191. }
  192. #item-content div.x-close-wrap a:hover{
  193. color: #fff !important;
  194. }
  195. #item-content div.x-close-wrap:hover{
  196. cursor: pointer;
  197. opacity: .9;
  198. }
  199. #item-content div.x-close-wrap img{
  200. width: 30px !important;
  201. height: 30px !important;
  202. }
  203. #item-content .img{
  204. position: relative;
  205. z-index: 10;
  206. }
  207. /*查看大图结束*/
  208. .brand-content-list{
  209. /*width: 1190px;*/
  210. background: #fff;
  211. /* margin: 0 auto;
  212. margin-top: -50px;
  213. padding-left: 18px;*/
  214. width: 100%;
  215. .list-inline {
  216. width: 100%;
  217. margin: 0;
  218. overflow: hidden;
  219. .store-box {
  220. width: 154px;
  221. height: 217px;
  222. text-align: center;
  223. vertical-align: middle;
  224. margin: 35px auto 0;
  225. display: block;
  226. position: relative;
  227. float: left;
  228. margin-right: 48px;
  229. &:hover{
  230. div:last-child {
  231. display: block;
  232. }
  233. }
  234. /*&:first-child {
  235. margin-left:112px;
  236. }*/
  237. div:first-child {
  238. img {
  239. margin-left: -3px;
  240. width: 156px;
  241. height: 200px;
  242. border: 1px solid #edf0f4;
  243. }
  244. }
  245. div:last-child {
  246. width: 176px;
  247. height: 218px;
  248. line-height: 218px;
  249. background: #6b6b6b;
  250. opacity: 0.5;
  251. position: absolute;
  252. top: -9px;
  253. left: -9px;
  254. display: none;
  255. color: #fff;
  256. span{
  257. color: #fff;
  258. &:first-child{
  259. margin-top: 30px;
  260. }
  261. }
  262. }
  263. &:last-child{
  264. margin-right: 0;
  265. }
  266. }
  267. .active-empty{
  268. width: 100%;
  269. .text-center {
  270. overflow: hidden;
  271. text-align: center;
  272. margin: 85px auto;
  273. div{
  274. float: left;
  275. }
  276. div.show-img{
  277. margin-left: 350px;
  278. }
  279. div.txt-info {
  280. position: absolute;
  281. left: 470px;
  282. top: 108px;
  283. }
  284. }
  285. .text-center .col-xs-2 img{
  286. margin: 65px 0 85px 205px;
  287. vertical-align: middle;
  288. }
  289. .text-center .txt-info{
  290. font-size: 14px;
  291. margin: 30px 0 0 0;
  292. }
  293. .text-center .col-xs-4 p{
  294. color: #999;
  295. margin: 13px 0px 10px -6px;
  296. }
  297. .text-center .txt-info i{
  298. color: #5078cb;
  299. }
  300. .text-center .txt-info a{
  301. font-size: 14px;
  302. color: #5078cb;
  303. }
  304. .text-center .col-xs-5 img{
  305. margin-left: -235px;
  306. }
  307. }
  308. }
  309. }
  310. .shadow{
  311. width: 1190px;
  312. margin: 0 auto;
  313. img{
  314. position: relative;
  315. top: -10px;
  316. }
  317. }
  318. </style>