cooperationExchange.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view class="rf-category">
  3. <view style="width:90%;height:99upx">
  4. <view class="leftArrow" @tap="back">
  5. <u-icon name="arrow-left" color="#fff" size="40"></u-icon>
  6. </view>
  7. <rf-search-bar2 @search="inputValue" icon="iconkuaijiecaidan" @tab="tabClick"
  8. :title=" i18n('return') " style="z-index: 99;" />
  9. </view>
  10. <!-- 轮播图 -->
  11. <view class="uni-padding-wrap">
  12. <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  13. :duration="duration">
  14. <swiper-item v-for="(item,index) in activityInfos" :key="index"
  15. v-if="item.logoFlag && item.logoFlag=='n'">
  16. <view style="padding: 10upx 20upx;">
  17. <view class="swiperImg" @click="toActivityInfo(item.baseActivityEntityId)">
  18. <image v-if="item.activityLogo" :src="websiteUrl+ item.activityLogo + '?custom=840_350'"
  19. alt="" style="width: 100%;height: 300upx;border-radius: 40upx;" />
  20. <image :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else
  21. style="width: 100%;height: 300upx;" />
  22. <text style="display: inline-block;">
  23. <text v-if="item.activityStatusDict=='0'"
  24. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  25. style="color: #ffffff; background-color:#32C5FF;">
  26. <text
  27. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Notstarted')}}</text>
  28. </text>
  29. <text v-if="item.activityStatusDict=='1'"
  30. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  31. style="color: #ffffff ;background-color:#32C5FF;">
  32. <text
  33. :style="$i18n.locale=='en'?'margin-left: 120upx;':'margin-left: 240upx;'">{{i18n('Registrationinprogress')}}</text>
  34. </text>
  35. <text v-if="item.activityStatusDict=='2'"
  36. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  37. style="color: #ffffff;background-color:#9B9B9B;">
  38. <text
  39. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Inaction')}}</text>
  40. </text>
  41. <text v-if="item.activityStatusDict=='3'"
  42. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  43. style="color: #ffffff;background-color:#9B9B9B;">
  44. <text
  45. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Finished')}}</text>
  46. </text>
  47. <text v-if="$i18n.locale=='zh'"
  48. :class="item.activityType=='会员活动'?'yellow':item.activityType=='联盟活动'?'green':'red'">
  49. <text style="">{{item.activityType}}</text>
  50. </text>
  51. <text v-if="$i18n.locale=='en'" style="padding-right: 250upx;margin-right: 200upx;"
  52. :class="item.activityType=='会员活动'?'yellow'
  53. :item.activityType=='联盟活动'?'green'
  54. :'red' ">
  55. <text style="margin-left: 10upx;">{{item.activityType=='会员活动'?'MemberActivities'
  56. :item.activityType=='联盟活动'?'AllianceActivities'
  57. :'CooperationActivities'}}</text>
  58. </text>
  59. </text>
  60. </view>
  61. <view class="recommend-bottom">
  62. <view class="recommend-activityName" @click="toActivityInfo(item.baseActivityEntityId)">
  63. {{item.activityName}}
  64. </view>
  65. <view class="recommend-bottom-time">
  66. <u-icon name="map" color="#D8D8D8" size="36" style="margin: 0px 26upx 0px 0px;">
  67. </u-icon>
  68. {{item.activityCity}} | {{formatDate(item.activityStartTime)}} -
  69. {{formatDate(item.activityEndTime)}}
  70. </view>
  71. </view>
  72. </view>
  73. </swiper-item>
  74. </swiper>
  75. </view>
  76. <!-- 分类列表 -->
  77. <!-- tabs -->
  78. <view class="uni-padding-wrap">
  79. <u-tabs :list="list" :current="current" @change="tabClick" gutter="50" bar-width="80"></u-tabs>
  80. <view v-if="activityInfo.length!=0">
  81. <view v-for="(item,index) in activityInfo" :key="index">
  82. <view style="margin: 18upx 20upx; ">
  83. <view class=" swiperImg" @click="toActivityInfo(item.baseActivityEntityId)">
  84. <image v-if="item.activityLogo" :src="websiteUrl+ item.activityLogo + '?custom=840_350'"
  85. alt="" style="width: 100%;height: 300upx;border-radius: 40upx;" />
  86. <image :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else
  87. style="width: 100%;height: 300upx;" />
  88. <text style="display: inline-block;">
  89. <text v-if="item.activityStatusDict=='0'"
  90. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  91. style="color: #ffffff; background-color:#32C5FF;">
  92. <text
  93. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Notstarted')}}</text>
  94. </text>
  95. <text v-if="item.activityStatusDict=='1'"
  96. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  97. style="color: #ffffff ;background-color:#32C5FF;">
  98. <text
  99. :style="$i18n.locale=='en'?'margin-left: 140upx;':'margin-left: 240upx;'">{{i18n('Registrationinprogress')}}</text>
  100. </text>
  101. <text v-if="item.activityStatusDict=='2'"
  102. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  103. style="color: #ffffff;background-color:#9B9B9B;">
  104. <text
  105. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Inaction')}}</text>
  106. </text>
  107. <text v-if="item.activityStatusDict=='3'"
  108. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  109. style="color: #ffffff;background-color:#9B9B9B;">
  110. <text
  111. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Finished')}}</text>
  112. </text>
  113. <text v-if="$i18n.locale=='zh'"
  114. :class="item.activityType=='会员活动'?'yellow':item.activityType=='联盟活动'?'green':'red'">
  115. <text style="">{{item.activityType}}</text>
  116. </text>
  117. <text v-if="$i18n.locale=='en'" style="padding-right: 250upx;margin-right: 200upx;"
  118. :class="item.activityType=='会员活动'?'yellow'
  119. :item.activityType=='联盟活动'?'green'
  120. :'red' ">
  121. <text style="margin-left: 10upx;">{{item.activityType=='会员活动'?'MemberActivities'
  122. :item.activityType=='联盟活动'?'AllianceActivities'
  123. :'CooperationActivities'}}</text>
  124. </text>
  125. </text>
  126. </view>
  127. <view class="recommend-bottom">
  128. <view class="recommend-activityName" @click="toActivityInfo(item.baseActivityEntityId)">
  129. {{item.activityName}}
  130. </view>
  131. <view>
  132. <u-icon name="map" color="#D8D8D8" size="36" style="margin: 0px 26upx 0px 0px;">
  133. </u-icon>
  134. {{item.activityCity}} | {{formatDate(item.activityStartTime)}} -
  135. {{formatDate(item.activityEndTime)}}
  136. </view>
  137. </view>
  138. </view>
  139. <view class="module-classify-border"></view>
  140. </view>
  141. </view>
  142. <view v-else>
  143. <view style="display: flex; justify-content: center;align-items: center;height: 667upx; ">
  144. <u-icon name="file-text" color="#a5a5a5" size="200" label-pos="bottom" label-size="36"
  145. :label="$i18n.locale==='zh'?'敬请期待':'Please waiting'"></u-icon>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- <view class="module-classify-border"></view> -->
  150. <u-modal v-model="show" @confirm="confirm" :show-cancel-button="true" :content="content"></u-modal>
  151. </view>
  152. </template>
  153. <script>
  154. import rfSearchBar2 from '@/components/rf-search-bar-xiangmu';
  155. export default {
  156. components: {
  157. rfSearchBar2,
  158. },
  159. data() {
  160. return {
  161. background: ['color1', 'color2', 'color3'],
  162. indicatorDots: true,
  163. autoplay: true,
  164. interval: 10000,
  165. duration: 500,
  166. activityInfo: [], // 活动信息
  167. activityInfos: [], // 所有活动信息
  168. current: 0,
  169. ActivitesId: "",
  170. Storage_data: "",
  171. token: "",
  172. show: false,
  173. content: '是否去注册/登录?',
  174. list: [{
  175. name: this.i18n('MemberActivities')
  176. },
  177. {
  178. name: this.$i18n.locale === 'zh' ? "联盟活动" : "Alliance Activities",
  179. }, {
  180. name: this.i18n('CooperationActivities')
  181. }
  182. ]
  183. };
  184. },
  185. async onShow() {
  186. this.getList();
  187. this.getActivitiesList();
  188. try {
  189. this.Storage_data = JSON.parse(uni.getStorageSync('user'));
  190. this.token = uni.getStorageSync('Auth-Token');
  191. } catch (e) {
  192. };
  193. },
  194. computed: {
  195. },
  196. onLoad(options) {
  197. this.current = options.id ? options.id : 0
  198. },
  199. methods: {
  200. // back() {
  201. // uni.navigateBack();
  202. // },
  203. back() {
  204. console.log("aaaaaaaa")
  205. uni.navigateTo({
  206. url: '../index/index'
  207. });
  208. },
  209. registration(id) {
  210. console.log('id', id);
  211. // this.token == undefined
  212. // console.log('token', this.token)
  213. // this.show = true;
  214. if (!this.token) {
  215. this.show = true;
  216. } else {
  217. this.$mRouter.push({
  218. route: `/pages/cooperationExchange/cooperationExchangeList/cooperationActiveRegistration?ActivitesId=${id}`
  219. });
  220. }
  221. },
  222. confirm() {
  223. // setTimeout(() => {
  224. // 3秒后自动关闭
  225. uni.navigateTo({
  226. url: `/pages/public/login`
  227. });
  228. this.show = false;
  229. // 如果不想关闭,而单是清除loading状态,需要通过ref手动调用方法
  230. // this.$refs.uModal.clearLoading();
  231. // }, 3000)
  232. },
  233. toActivityInfo(id) {
  234. console.log('id', id)
  235. this.$mRouter.push({
  236. route: `/pages/cooperationExchange/cooperationExchangeList/activitiesInfo?ActivitesId=${id}`
  237. });
  238. // uni.navigateTo({
  239. // url:"cooperationExchangeList/activitiesInfo?ActivitesId="+ActivitesId
  240. // })
  241. },
  242. tabClick(index) {
  243. this.current = index;
  244. this.getList();
  245. },
  246. async getList() {
  247. let page = {
  248. pageSize: 10,
  249. pageNo: 1,
  250. language: this.$i18n.locale.toUpperCase(),
  251. activityTypeDict: this.current,
  252. }
  253. const res = await this.$myRequest({
  254. url: '/project/activityInfos/showActivityInfos',
  255. data: {
  256. ...page
  257. }
  258. });
  259. this.activityInfo = [];
  260. this.activityInfo = res.data.activityInfos || [];
  261. console.log('+++++++', res.data);
  262. },
  263. async getActivitiesList() {
  264. let page = {
  265. pageSize: 10,
  266. pageNo: 1,
  267. language: this.$i18n.locale.toUpperCase(),
  268. }
  269. const res = await this.$myRequest({
  270. url: '/project/activityInfos/showActivityInfos',
  271. data: {
  272. ...page
  273. }
  274. });
  275. this.activityInfos = res.data.activityInfos;
  276. console.log(this.activityInfos, "大数据");
  277. },
  278. i18n(data) {
  279. return this.$t('common.' + data);
  280. },
  281. // 通用跳转
  282. navToSearch() {
  283. this.$mRouter.push({
  284. route: `/pages/index/search/search?data=${JSON.stringify(this.search)}`
  285. });
  286. },
  287. }
  288. };
  289. </script>
  290. <style lang="scss" scoped>
  291. .rf-category {
  292. background-color: $color-white;
  293. .uni-padding-wrap {
  294. // margin-top: 10upx;
  295. /* #ifdef APP-PLUS */
  296. margin-top: 51upx;
  297. /* #endif */
  298. }
  299. .swiper {
  300. height: 500upx;
  301. width: 750upx;
  302. }
  303. .swiperImg {
  304. width: 100%;
  305. height: 75%;
  306. position: relative;
  307. }
  308. .recommend-bottom {
  309. padding: 0upx 20upx 20upx;
  310. width: 100%;
  311. box-sizing: border-box;
  312. }
  313. .recommend-bottom-time {
  314. width: 710upx;
  315. font-size: 23upx;
  316. height: 36upx;
  317. line-height: 36upx;
  318. box-sizing: border-box;
  319. position: absolute;
  320. bottom: 36upx;
  321. }
  322. .recommend-activityName {
  323. // width: 80%;
  324. font-size: 28upx;
  325. font-family: PingFangSC-Medium, PingFang SC;
  326. font-weight: 400;
  327. color: #0B0B11;
  328. line-height: 50upx;
  329. padding-right: 10upx;
  330. overflow: hidden;
  331. white-space: nowrap;
  332. text-overflow: ellipsis;
  333. height: 50upx;
  334. margin-top: 20upx;
  335. margin-bottom: 16upx;
  336. }
  337. .activityStatus,
  338. .activityStatusEn {
  339. position: absolute;
  340. bottom: 12upx;
  341. left: 1upx;
  342. height: 48upx;
  343. width: 360upx;
  344. // text-align: right;
  345. font-size: 24upx;
  346. color: #fff;
  347. line-height: 48upx;
  348. z-index: 20upx;
  349. border-radius: 0upx 10upx 0upx 0upx;
  350. }
  351. .activityStatusEn {
  352. position: absolute;
  353. left: 150upx;
  354. }
  355. .activityStatus {
  356. // bottom: 12upx;
  357. }
  358. .yellow,
  359. .green,
  360. .red {
  361. position: absolute;
  362. bottom: 12upx;
  363. left: 0upx;
  364. /* min-width: 96px; */
  365. padding: 0 0upx;
  366. height: 48upx;
  367. width: 180upx;
  368. // text-align: center;
  369. line-height: 48upx;
  370. font-size: 24upx;
  371. color: #fff;
  372. border-radius: 10upx 100upx 0upx 0upx;
  373. padding-left: 24upx;
  374. // z-index: 50upx;
  375. }
  376. .yellow {
  377. background: rgb(255, 153, 0);
  378. }
  379. .green {
  380. background: rgb(102, 204, 1);
  381. }
  382. .red {
  383. padding-left: 18upx;
  384. background: rgb(224, 32, 32);
  385. }
  386. .module-classify-border {
  387. background-color: #ebebeb;
  388. height: 20upx;
  389. width: 750upx;
  390. }
  391. }
  392. </style>
  393. <style>
  394. /deep/ .swiper .uni-swiper-dots {
  395. left: initial;
  396. right: 0upx;
  397. bottom: 16upx;
  398. }
  399. </style>