QualificationCertificate.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <div class="brand" style="padding-top: 25px; margin-bottom: -20px;">
  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="col-xs-offset-3 col-xs-2">
  12. <img src="/images/brandList/empty-cart.jpg">
  13. </div>
  14. <div class="col-xs-4 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. return this.$store.state.shop.storeInfo.store.data
  53. },
  54. user() {
  55. return this.$store.state.option.user
  56. },
  57. storeStatus () {
  58. return this.$store.state.option.storeStatus.data
  59. },
  60. emptyShow () {
  61. let loggedStatus = false
  62. if (this.user.logged && this.user.data.enterprise.uu) {
  63. if (this.storeStatus.uuid === this.storeInfo.uuid) {
  64. loggedStatus = true
  65. } else {
  66. loggedStatus = false
  67. }
  68. } else {
  69. loggedStatus = false
  70. }
  71. return loggedStatus
  72. }
  73. },
  74. methods: {
  75. showImg (imgUrl) {
  76. if (imgUrl.indexOf('.pdf') === -1) {
  77. this.qualifications.url = imgUrl
  78. this.isShow = true
  79. } else {
  80. window.open(imgUrl)
  81. }
  82. }
  83. },
  84. filters: {
  85. introduceFilter: function (title) {
  86. if (title === '') {
  87. return title
  88. }
  89. let len = 0
  90. let index = 0
  91. for (let i = 0; i < title.length; i++) {
  92. if (index === 0 && title.charAt(i).charCodeAt(0) > 255) {
  93. len = len + 2
  94. } else {
  95. len++
  96. }
  97. if (len > 240) {
  98. index = i
  99. break
  100. }
  101. }
  102. if (index > 0) {
  103. return title.substring(0, index) + '...'
  104. } else {
  105. return title
  106. }
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. /*查看大图*/
  113. #image-box .x-floating-wrap,.image-box .x-floating-wrap {
  114. position: fixed;
  115. z-index: 99998;
  116. background: #000;
  117. top: 0;
  118. left: 0;
  119. width: 100%;
  120. height: 100%;
  121. opacity: 0.5;
  122. }
  123. #image-box,.image-box{
  124. display:table; overflow:hidden; margin-left:50px; _position:relative; width: 1200px;height: 700px;
  125. position: fixed;
  126. top: 50%;
  127. margin-top: -350px;
  128. left: 50%;
  129. margin-left: -600px;
  130. z-index: 2000;
  131. }
  132. #image-box .x-floating,.image-box .x-floating {
  133. vertical-align:middle !important;
  134. display:table-cell;
  135. text-align:center;
  136. _position:absolute;
  137. _top:50%; _left:50%;
  138. top: inherit !important;
  139. left: inherit !important;
  140. }
  141. #image-box .x-floating img ,.image-box .x-floating img {
  142. margin: auto auto;
  143. max-width: 970px !important;
  144. max-height: 600px !important;
  145. -webkit-user-select: none;
  146. -moz-user-select: none;
  147. -ms-user-select: none;
  148. user-select: none;
  149. }
  150. #image-box .x-floating-wrap,.image-box .x-floating-wrap{
  151. z-index: 1000000 !important;
  152. }
  153. #item-content{
  154. color:#fff; display:inline-block; _position:relative; _top:-50%; _left:-50%;
  155. position: relative;
  156. z-index: 10000000;
  157. }
  158. #item-content div.x-close-wrap{
  159. position: absolute;
  160. right: -15px;
  161. line-height: 30px;
  162. top: -13px;
  163. color: #fff;
  164. width: 35px;
  165. height: 35px;
  166. background: rgba(0, 0, 0, 0.5);
  167. border-radius: 100%;
  168. opacity: 1;
  169. margin: 0;
  170. z-index: 100000;
  171. min-height: initial;
  172. text-align: center;
  173. }
  174. #item-content div.x-close-wrap a{
  175. position: relative;
  176. left: 0;
  177. bottom: 0;
  178. font-size: 34px;
  179. color: #fff;
  180. }
  181. #item-content div.x-close-wrap a:hover{
  182. color: #fff !important;
  183. }
  184. #item-content div.x-close-wrap:hover{
  185. cursor: pointer;
  186. opacity: .9;
  187. }
  188. #item-content div.x-close-wrap img{
  189. width: 30px !important;
  190. height: 30px !important;
  191. }
  192. #item-content .img{
  193. position: relative;
  194. z-index: 10;
  195. }
  196. /*查看大图结束*/
  197. .brand-content-list{
  198. width: 1190px;
  199. background: #fff;
  200. margin: 0 auto;
  201. margin-top: -50px;
  202. padding-left: 18px;
  203. .list-inline {
  204. width: 100%;
  205. height: 264px;
  206. margin: 0 auto;
  207. .store-box {
  208. width: 158px;
  209. height: 200px;
  210. text-align: center;
  211. vertical-align: middle;
  212. margin: 32px 0px 0px 40px;
  213. position: relative;
  214. &:hover{
  215. div:last-child {
  216. display: block;
  217. }
  218. }
  219. &:first-child {
  220. margin-left:112px;
  221. }
  222. div:first-child {
  223. img {
  224. margin-left: -3px;
  225. width: 156px;
  226. height: 200px;
  227. border: 1px solid #edf0f4;
  228. }
  229. }
  230. div:last-child {
  231. width: 176px;
  232. height: 218px;
  233. line-height: 218px;
  234. background: #6b6b6b;
  235. opacity: 0.5;
  236. position: absolute;
  237. top: -9px;
  238. left: -9px;
  239. display: none;
  240. color: #fff;
  241. span{
  242. color: #fff;
  243. &:first-child{
  244. margin-top: 30px;
  245. }
  246. }
  247. }
  248. }
  249. .active-empty{
  250. width: 100%;
  251. .text-center{
  252. text-align: center;
  253. margin-top: 30px;
  254. }
  255. .text-center .col-xs-2 img{
  256. margin: 65px 0 85px 205px;
  257. vertical-align: middle;
  258. }
  259. .text-center .txt-info{
  260. font-size: 14px;
  261. margin: 60px 0px 0px -50px;
  262. }
  263. .text-center .col-xs-4 p{
  264. color: #999;
  265. margin: 13px 0px 10px -6px;
  266. }
  267. .text-center .txt-info i{
  268. color: #5078cb;
  269. }
  270. .text-center .txt-info a{
  271. font-size: 14px;
  272. color: #5078cb;
  273. }
  274. .text-center .col-xs-5 img{
  275. margin-left: -235px;
  276. }
  277. }
  278. }
  279. }
  280. .shadow{
  281. width: 1190px;
  282. margin: 0 auto;
  283. img{
  284. position: relative;
  285. top: -10px;
  286. }
  287. }
  288. </style>