CooperationExchangeItem.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div style="width: 100%;margin-top: 20px;" class="initData">
  3. <ul>
  4. <li v-for="(item,index) in init" style="position: relative;" class="cursor" @click="toView('cooperationExchangeListDetails',item.baseActivityEntityId)" >
  5. <div style="width: 100%;height: 250px;">
  6. <img :src="'api/fileextend/pub/' + item.activityLogo + '?custom=460_200'" alt="" style="width: 100%;height: 100%;" v-if="item.activityLogo">
  7. <img :src="'api/file/pub/' + '/def/projectdefault.png'" alt="" style="width: 100%;height: 100%;" v-if="!item.activityLogo">
  8. </div>
  9. <div :class="item.activityType=='会员活动'?'yellow':item.activityType=='联盟活动'?'green':'red' " v-if="$i18n.locale=='en'">
  10. {{item.activityType=='会员活动'?'MemberActivities':item.activityType=='联盟活动'?'AllianceActivities':'CooperationActivities'}}
  11. </div>
  12. <div :class="item.activityType=='会员活动'?'yellow':item.activityType=='联盟活动'?'green':'red'" v-if="$i18n.locale=='zh'">
  13. {{item.activityType}}
  14. </div>
  15. <div style="padding: 10px 10px;">
  16. <div style="width: 100%;line-height: 25px;text-align: left;;font-weight: 700;">
  17. <div style="width: 100%;line-height: 25px;height:50px;font-weight: 700;
  18. -webkit-box-orient: vertical;
  19. position:relative;
  20. overflow: hidden;
  21. cursor: pointer;" >
  22. <!-- 活动名称 -->
  23. <span class="activityName">{{item.activityName}}</span>
  24. <div style="width: 100px;position: absolute;right: 100;height: 50px;display: inline-block;">
  25. <el-button :type="item.activityStatus=='未开始'?'success':
  26. item.activityStatus=='报名中'?'primary':item.activityStatus=='已结束'?'info':'warning'" round
  27. style="height: 24px;width:100%;line-height: 4px;padding:0 10px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
  28. @click="toView('cooperationExchangeListDetails',item.baseActivityEntityId)" v-if="$i18n.locale=='en'">
  29. {{item.activityStatus=='未开始'?'To be started':
  30. item.activityStatus=='报名中'?'Signing Up':item.activityStatus=='已结束'?'Endeded':'In the activity'}}
  31. </el-button>
  32. <el-button :type="item.activityStatus=='未开始'?'success':
  33. item.activityStatus=='报名中'?'primary':item.activityStatus=='已结束'?'info':'warning'" round
  34. style="width: 76px;height: 24px;line-height: 4px;"
  35. @click="toView('cooperationExchangeListDetails',item.baseActivityEntityId)" v-if="$i18n.locale=='zh'">
  36. <span style="margin-left: -5px;">{{item.activityStatus}}</span>
  37. </el-button>
  38. </div>
  39. </div>
  40. <div style="width: 100%;line-height: 35px;font-size: 14px;color: #666666;">
  41. <span style="margin-right: 15px;">{{$t('common.place')}}:{{item.activityCity}}</span>
  42. <span>{{$t('common.line')}}:
  43. <span :style="$i18n.locale=='en'?'font-size:13px;':''">{{formatDate(item.activityStartTime)}} - {{formatDate(item.activityEndTime)}}</span>
  44. </span>
  45. </div>
  46. </div>
  47. <div style="width: 100%;font-size: 14px;line-height: 25px;overflow: hidden;color: #666666;
  48. -webkit-box-orient: vertical;
  49. position:relative;
  50. line-height:1.4em;
  51. overflow: hidden;
  52. max-height:7em;cursor: pointer;" class="plate">
  53. {{item.activityIntroduce}}
  54. </div>
  55. </div>
  56. </li>
  57. </ul>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. name: 'CooperationExchangeItem',
  63. props:['init'],
  64. data () {
  65. return {
  66. }
  67. },
  68. mounted(){
  69. this.$forceUpdate();
  70. console.log(this.init)
  71. },
  72. watch:{
  73. },
  74. methods:{
  75. getIconUrl(url){
  76. return require("@/assets/img/cooperationExchange/"+url);
  77. },
  78. toView(router,json){
  79. let language = window.localStorage.getItem("locale")
  80. this.$store.commit('modify', router);
  81. window.localStorage.setItem('router', router);
  82. const { href } = this.$router.resolve({
  83. name: router,
  84. query: {
  85. key: json,
  86. language:language
  87. },
  88. });
  89. window.open(href, '_blank');
  90. // this.$router.push({name:router,query:{key:json}})
  91. },
  92. }
  93. }
  94. </script>
  95. <style scoped>
  96. .initData {
  97. }
  98. .initData ul {
  99. display: flex;
  100. justify-content: flex-start;
  101. flex-wrap:wrap;
  102. }
  103. .initData li {
  104. width: 48%;
  105. margin-right: 8px;
  106. margin-left: 8px;
  107. margin-bottom: 10px;
  108. float: left;
  109. }
  110. .initData li:nth-child(2n-1){
  111. /* margin-right: 15px; */
  112. }
  113. .yellow,
  114. .green,
  115. .red {
  116. position: absolute;
  117. top: 0;
  118. left: 0;
  119. /* min-width: 96px; */
  120. padding:0 20px;
  121. height: 32px;
  122. text-align: center;
  123. line-height: 32px;
  124. font-size: 14px;
  125. color: #fff;
  126. border-radius: 0 0 10px 0;
  127. }
  128. .yellow {
  129. background:rgba(255,153,0);
  130. }
  131. .green {
  132. background: rgba(102,204,1);
  133. }
  134. .red {
  135. background:rgba(224,32,32);
  136. }
  137. .activityName{
  138. width: 400px;
  139. display: inline-block;
  140. overflow: hidden;
  141. text-overflow: ellipsis;
  142. white-space: nowrap;
  143. }
  144. >>>.el-button{
  145. padding: none;
  146. }
  147. </style>