activitiesInfo.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <template>
  2. <view class="rf-category">
  3. <!-- <view class="bg"></view> -->
  4. <u-toast ref="uToast" />
  5. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle" back-icon-color="#fff" title-color="#fff"
  6. :title="i18n('ActivitiesInfo')" :background="background">
  7. <view slot="right" style="margin-right:20upx" v-if="isMobile">
  8. <u-icon name="share-fill" style="margin-right: 30upx;" color="white" size="50" @click="share"></u-icon>
  9. </view>
  10. </u-navbar>
  11. <view class="module-classify-border"></view>
  12. <view class="biaoTi">{{activityInfo.activityName}}</view>
  13. <view class="tuPian">
  14. <image :src="websiteUrl+ activityInfo.activityLogo + '?custom=600_260'" v-if="activityInfo.activityLogo"
  15. alt="" style="width: 690upx;height: 100%;"></image>
  16. <image :src="websiteUrl+'/def/projectdefault.png'" v-else alt="" style="width: 100%;height: 100%; "></image>
  17. <text style="display: inline-block;">
  18. <text v-if="activityInfo.activityStatusDict=='0'"
  19. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  20. style="color: #ffffff; background-color:#32C5FF;">
  21. <text
  22. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Notstarted')}}</text>
  23. </text>
  24. <text v-if="activityInfo.activityStatusDict=='1'"
  25. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  26. style="color: #ffffff ;background-color:#32C5FF;">
  27. <text
  28. :style="$i18n.locale=='en'?'margin-left: 120upx; ':'margin-left: 240upx;'">{{i18n('Registrationinprogress')}}</text>
  29. </text>
  30. <text v-if="activityInfo.activityStatusDict=='2'"
  31. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  32. style="color: #ffffff;background-color:#9B9B9B;">
  33. <text
  34. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Inaction')}}</text>
  35. </text>
  36. <text v-if="activityInfo.activityStatusDict=='3'"
  37. :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
  38. style="color: #ffffff;background-color:#9B9B9B;">
  39. <text
  40. :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Finished')}}</text>
  41. </text>
  42. <text v-if="$i18n.locale=='zh'"
  43. :class="activityInfo.activityType=='会员活动'?'yellow':activityInfo.activityType=='联盟活动'?'green':'red'">
  44. <text style=" margin-left: 18upx;">{{activityInfo.activityType}}</text>
  45. </text>
  46. <text v-if="$i18n.locale=='en'" style="padding-right: 250upx;margin-right: 200upx;"
  47. :class="activityInfo.activityType=='会员活动'?'yellow':activityInfo.activityType=='联盟活动'?'green':'red' ">
  48. <text style="margin-left: 10upx;">{{activityInfo.activityType=='会员活动'?'MemberActivities'
  49. :activityInfo.activityType=='联盟活动'?'AllianceActivities'
  50. :'CooperationActivities'}}</text>
  51. </text>
  52. </text>
  53. </view>
  54. <!-- <view class="recommend-bottom-address">
  55. <u-icon name="map" color="#D8D8D8" size="36" style="margin: 35upx 26upx 35upx 35upx;"></u-icon>
  56. <text
  57. style="padding: 29upx 0upx; min-width: 112upx; height: 44upx; font-size: 28upx; color: #333333;">{{this.$i18n.locale=='zh'?'活动地点':'Venue'}}</text>
  58. <text class="recommend-bottom-font">{{activityInfo.activityCity}}</text>
  59. </view> -->
  60. <!-- <view class="module-classify-border"></view> -->
  61. <!-- <view class="recommend-bottom-time">
  62. <u-icon name="calendar" color="#D8D8D8" size="40" style="margin: 35upx 26upx 35upx 35upx;"></u-icon>
  63. <text
  64. style="padding: 29upx 0upx; min-width: 112upx; height: 44upx; font-size: 28upx; color: #333333;">{{this.$i18n.locale=='zh'?'活动日期':'Activity date'}}</text>
  65. <text class="recommend-bottom-font">
  66. {{formatDate(activityInfo.activityStartTime)}} - {{formatDate(activityInfo.activityEndTime)}}
  67. </text>
  68. </view> -->
  69. <view class="module-classify-border"></view>
  70. <u-tabs :list="screenList" :current="current" @change="change" bar-width="120"></u-tabs>
  71. <cooperationActiveIntroduce v-show="current=='0'" :activityIntroduction="activityInfo.activityIntroduction">
  72. </cooperationActiveIntroduce>
  73. <cooperationActiveAgenda v-show="current=='1'" :programOutline="activityInfo.programOutline">
  74. </cooperationActiveAgenda>
  75. <cooperationActiveReview v-show="current=='2'" :activityInfo="activityInfo" :photos="photos">
  76. </cooperationActiveReview>
  77. <cooperationActiveResults v-show="current=='3'" :countryList="countryList" :id="activityInfo.id">
  78. </cooperationActiveResults>
  79. <view style="height: 103upx;width: 100%;"></view>
  80. <view
  81. style="height: 103upx;width: 100%;position: fixed;bottom: 0;box-shadow: 0px -4px 10px 0px rgba(0, 0, 0, 0.06);background-color: white;">
  82. <view style=" margin-left: 50upx;width: 100upx;height: 100%;padding-top: 10upx;float: left;">
  83. <view style="width: 180upx;text-align: center;" :style="{color: ifcommon==true?'#66A5FF':'#666666'}"
  84. @click="follow">
  85. <view style="height: 44upx;">
  86. <u-icon :name="ifcommon==true?'heart-fill':'heart'" size="44" style="line-height: 1"></u-icon>
  87. </view>
  88. <view>
  89. <text style="font-size: 20upx;line-height: 1">
  90. {{$i18n.locale == 'zh' ? (ifcommon === true ? "已关注" : "关注") : (ifcommon === true ? "Concerned" : " Follow")}}
  91. </text>
  92. </view>
  93. </view>
  94. </view>
  95. <view style="width: 430upx;height: 100%;padding: 15upx 0;margin-right: 30upx;float: right;">
  96. <view style="width: 100%;height: 100%;text-align: center;border-radius: 72upx;"
  97. :style="{backgroundColor:activityInfo.activityStatus=='未开始'?'#85ce61': activityInfo.activityStatus=='报名中'?'#409EFF':activityInfo.activityStatus=='已结束'?'#B3BCCC':'#E6A23C'}"
  98. @click="toRegistration" v-show="activityInfo.registtrationFlag=='y'">
  99. <text style="color: white;font-size: 28upx;line-height: 73upx;">
  100. {{$i18n.locale=='zh'?
  101. activityInfo.activityStatus:
  102. (activityInfo.activityStatus=='未开始'?'To be started': activityInfo.activityStatus=='报名中'?'Signing Up':activityInfo.activityStatus=='已结束'?'Endeded':'In the activity')}}
  103. </text>
  104. </view>
  105. </view>
  106. <view style="clear: both;"></view>
  107. </view>
  108. <!-- 8.8.20.112:19001
  109. -->
  110. <share v-show="ifShare == true" @closeShare="share" :show="ifShare" :title="$i18n.locale=='en'?activityInfo.activityType=='会员活动'?'MemberActivities'
  111. :activityInfo.activityType=='联盟活动'?'AllianceActivities'
  112. :'CooperationActivities':activityInfo.activityType" :summary="activityInfo.activityName"
  113. :href="'https://m.geidcp.com/#/pages/cooperationExchange/cooperationExchangeList/activitiesInfo?' + 'ActivitesId=' + baseActivityEntityId + '&language=' + $i18n.locale"
  114. :imageUrl="activityInfo.activityLogo?websiteUrl+ activityInfo.activityLogo + '?custom=600_260':'https://geidcp.com/api/file/pub/defaultCutPic/shareLogo.png'">
  115. </share>
  116. <!-- #ifdef H5 -->
  117. <rf-back-home></rf-back-home>
  118. <!-- #endif -->
  119. <u-modal v-model="show" :title="i18n('Tips')" :confirm-text="i18n('submit')" :cancel-text="i18n('cancel')"
  120. @confirm="settingConfirm" :content="$i18n.locale == 'zh' ? '是否登录?' : 'Log in?'" :show-cancel-button="true">
  121. </u-modal>
  122. </view>
  123. </template>
  124. <script>
  125. import {
  126. getSignature
  127. } from '@/api/meeting/meetingApply.js'
  128. import wxShare from '@/utils/wxShare.js'
  129. import cooperationActiveIntroduce from '@/pages/cooperationExchange/cooperationExchangeList/cooperationActiveIntroduce';
  130. import cooperationActiveAgenda from '@/pages/cooperationExchange/cooperationExchangeList/cooperationActiveAgenda';
  131. import cooperationActiveReview from '@/pages/cooperationExchange/cooperationExchangeList/cooperationActiveReview';
  132. import cooperationActiveResults from '@/pages/cooperationExchange/cooperationExchangeList/cooperationActiveResults';
  133. import share from '@/components/share'
  134. export default {
  135. components: {
  136. cooperationActiveIntroduce,
  137. cooperationActiveAgenda,
  138. cooperationActiveReview,
  139. cooperationActiveResults,
  140. share
  141. },
  142. data() {
  143. return {
  144. isMobile:false,
  145. baseActivityEntityId: '',
  146. background: ['color1', 'color2', 'color3'],
  147. indicatorDots: true,
  148. autoplay: true,
  149. interval: 2000,
  150. duration: 500,
  151. ifShare: false,
  152. activityInfo: {}, // 活动信息
  153. //activityInfos: [], // 所有活动信息
  154. current: 0,
  155. screenList: [],
  156. countryList: [],
  157. locale: '',
  158. photos: [],
  159. background: {
  160. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  161. },
  162. backStyle: {
  163. color: '#FFFFFF',
  164. },
  165. // activityIntroduction:'',
  166. // 收藏
  167. ifcommon: false,
  168. // 用户信息
  169. Storage_data: '',
  170. AuthToken: '',
  171. show: false,
  172. };
  173. },
  174. onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
  175. this.baseActivityEntityId = option.ActivitesId
  176. console.log("baseActivityEntityId:" + this.baseActivityEntityId); //打印出上个页面传递的参数。
  177. if (option.language) {
  178. uni.setStorageSync("language", option.language);
  179. this._i18n.locale = option.language;
  180. }
  181. let port = uni.getSystemInfoSync().platform
  182. switch (port) {
  183. case 'android':
  184. this.isMobile = true;
  185. break;
  186. case 'ios':
  187. this.isMobile = true;
  188. break;
  189. default:
  190. this.isMobile = false;
  191. break;
  192. }
  193. },
  194. async onShow() {
  195. // 获取登录状态和用户信息 开始
  196. this.AuthToken = uni.getStorageSync('Auth-Token');
  197. let user = uni.getStorageSync('user');
  198. if (user) {
  199. this.Storage_data = JSON.parse(user);
  200. }
  201. // 获取登录状态和用户信息 结束
  202. this.getList();
  203. // 获取关注状态 开始
  204. this.getMyCollecModel()
  205. // 获取关注状态 结束
  206. },
  207. computed: {
  208. token() {
  209. return 'Bearer ' + uni.getStorageSync('Auth-Token');
  210. }
  211. },
  212. methods: {
  213. wxRegister() {
  214. let href = window.location.href;
  215. console.log('wxRegister');
  216. console.log(href)
  217. let url = window.location.href.replace('#', 'guiguketan')
  218. console.log(url)
  219. getSignature(url).then((response) => {
  220. console.log('response========', response.data);
  221. //记录分享用户
  222. let link = "";
  223. // if (window.location.href.indexOf("?") != -1) {
  224. // link = window.location.href + "&recommend=" + response.data.userEedId;
  225. // } else {
  226. // link = window.location.href + "?recommend=" + response.data.userEedId;
  227. // }
  228. link = window.location.href;
  229. console.log("link");
  230. console.log(link);
  231. let option = {
  232. link: link,
  233. title: '合作组织会员活动系列精彩视频分享',
  234. summary: this.activityInfo.activityName,
  235. imgUrl: this.websiteUrl+ this.activityInfo.activityLogo + '?custom=600_260',
  236. };
  237. console.log('option');
  238. console.log(option);
  239. wxShare.wxRegister(response.data, option);
  240. });
  241. },
  242. share() {
  243. this.ifShare = !this.ifShare;
  244. },
  245. toPrevious() {
  246. uni.navigateTo({
  247. url: `/pages/cooperationExchange/cooperationExchange`
  248. })
  249. },
  250. change(index) {
  251. this.current = index;
  252. },
  253. async getList() {
  254. const res = await this.$myRequest({
  255. url: '/project/activityInfos/getById',
  256. data: {
  257. baseActivityEntityId: this.baseActivityEntityId,
  258. language: this.$i18n.locale.toUpperCase()
  259. }
  260. });
  261. this.activityInfo = res.data.activityInfos[0] || {};
  262. console.log("activityInfo:", this.activityInfo)
  263. // this.activityIntroduction=this.activityInfo.activityIntroduction;
  264. this.getSysAttachmentInfos();
  265. this.getPhotos();
  266. //配置微信公众号分享信息
  267. this.wxRegister();
  268. },
  269. i18n(data) {
  270. return this.$t('common.' + data);
  271. },
  272. // 通用跳转
  273. navToSearch() {
  274. this.$mRouter.push({
  275. route: `/pages/index/search/search?data=${JSON.stringify(this.search)}`
  276. });
  277. },
  278. async getSysAttachmentInfos() {
  279. let list = {
  280. attachmentBusinessId: this.activityInfo.id,
  281. attachmentBusinessType: 'activityInfo'
  282. };
  283. const res = await this.$myRequest({
  284. url: '/file/sysAttachmentInfos/search',
  285. data: {
  286. ...list
  287. }
  288. });
  289. this.countryList = res.data.attachmentInfos;
  290. console.log("countryList", res.data);
  291. if ("3" == this.activityInfo.activityStatusDict) {
  292. if (Object.keys(res.data).length == 0) {
  293. this.screenList = [{
  294. name: this.i18n('ActivityIntroduction')
  295. }, {
  296. name: this.i18n('ActivityAgenda')
  297. }, {
  298. name: this.i18n('ActivityReview')
  299. }];
  300. } else {
  301. this.screenList = [{
  302. name: this.i18n('ActivityIntroduction')
  303. }, {
  304. name: this.i18n('ActivityAgenda')
  305. }, {
  306. name: this.i18n('ActivityReview')
  307. }, {
  308. name: this.i18n('ActivityResults')
  309. }];
  310. }
  311. } else {
  312. this.screenList = [{
  313. name: this.i18n('ActivityIntroduction')
  314. }, {
  315. name: this.i18n('ActivityAgenda')
  316. }]
  317. }
  318. if (this.screenList.length >= 3) {
  319. this.change(2);
  320. }
  321. },
  322. async getPhotos() {
  323. var photoUrl = this.activityInfo.activityWonderfulReviewVideo;
  324. if ('' != photoUrl) {
  325. this.photos = photoUrl.split(',');
  326. this.photos.forEach((item, index) => {
  327. if ('' != item) {
  328. this.photos[index] = item;
  329. }
  330. });
  331. }
  332. console.log("photos", this.photos);
  333. },
  334. settingConfirm() {
  335. setTimeout(() => {
  336. // 3秒后自动关闭
  337. this.show = false;
  338. uni.navigateTo({
  339. url: '/pages/public/login'
  340. });
  341. // 如果不想关闭,而单是清除loading状态,需要通过ref手动调用方法
  342. // this.$refs.uModal.clearLoading();
  343. }, 500)
  344. },
  345. toRegistration() {
  346. if (this.AuthToken) {
  347. if (this.activityInfo.activityStatus == '报名中') {
  348. this.$mRouter.push({
  349. route: `/pages/cooperationExchange/cooperationExchangeList/cooperationActiveRegistration?id=${this.activityInfo.baseActivityEntityId}`,
  350. });
  351. }
  352. } else {
  353. this.show = true;
  354. }
  355. },
  356. //收藏
  357. follow() {
  358. if (this.AuthToken) {
  359. this.shareChange()
  360. } else {
  361. if (this.$i18n.locale == 'zh') {
  362. this.$refs.uToast.show({
  363. title: '请登录',
  364. type: 'warning',
  365. url: '/pages/public/login',
  366. params: {
  367. back: 1
  368. }
  369. })
  370. } else {
  371. this.$refs.uToast.show({
  372. title: 'please log in',
  373. type: 'warning',
  374. url: '/pages/public/login',
  375. params: {
  376. back: 1
  377. }
  378. })
  379. }
  380. }
  381. },
  382. async getMyCollecModel() {
  383. const that = this;
  384. if (this.AuthToken) {
  385. var users = this.Storage_data;
  386. let MyCollecModel = {
  387. modelType: 'activity',
  388. userId: users.userId,
  389. modelEntityId: this.activityInfo.baseActivityEntityId,
  390. }
  391. const res = await this.$myRequest({
  392. url: '/op/basePortalModelFollowInfos/followModelStatusByModelIdAndUserId',
  393. data: {
  394. modelId: this.activityInfo.baseActivityEntityId,
  395. modelType: 'activity',
  396. userId: users.id,
  397. }
  398. });
  399. if (res) {
  400. this.ifcommon = res.data;
  401. }
  402. }
  403. },
  404. // 关注操作方法
  405. shareChange() {
  406. if (this.ifcommon) {
  407. this.saveFollowModelDo("unfollow");
  408. } else {
  409. this.saveFollowModelDo("follow");
  410. }
  411. },
  412. async saveFollowModelDo(followType) {
  413. if (!this.AuthToken) {
  414. // 登录
  415. } else {
  416. var users = this.Storage_data;
  417. let MyCollecModel = {
  418. followType: followType,
  419. modelId: this.activityInfo.baseActivityEntityId,
  420. modelType: 'activity',
  421. userId: users.id,
  422. };
  423. const res = await this.$myRequest({
  424. url: '/op/basePortalModelFollowInfos/followModel',
  425. method: 'post',
  426. headers: {
  427. token: this.token
  428. },
  429. data: {
  430. followType: followType,
  431. modelId: this.activityInfo.baseActivityEntityId,
  432. modelType: 'activity',
  433. userId: users.id,
  434. }
  435. });
  436. if (res) {
  437. if (followType == 'unfollow') {
  438. if (this.$i18n.locale == 'zh') {
  439. this.$refs.uToast.show({
  440. title: '取消关注',
  441. type: 'success',
  442. })
  443. } else {
  444. this.$refs.uToast.show({
  445. title: 'Cancel concerned',
  446. type: 'success',
  447. })
  448. }
  449. } else {
  450. if (this.$i18n.locale == 'zh') {
  451. this.$refs.uToast.show({
  452. title: '已关注',
  453. type: 'success',
  454. })
  455. } else {
  456. this.$refs.uToast.show({
  457. title: 'Already concerned',
  458. type: 'success',
  459. })
  460. }
  461. }
  462. this.ifcommon = !this.ifcommon;
  463. }
  464. }
  465. },
  466. },
  467. }
  468. </script>
  469. <style lang="scss" scoped>
  470. .bg {
  471. position: fixed;
  472. top: 0;
  473. right: 0;
  474. bottom: 0;
  475. left: 0;
  476. background-color: #fff;
  477. z-index: -10;
  478. }
  479. .rf-category {
  480. background-color: $color-white;
  481. /* #ifdef APP-PLUS */
  482. // margin-top: calc(20upx + var(--status-bar-height));
  483. /* #endif */
  484. // .slot-wrap {
  485. // font-size: 28upx;
  486. // font-weight: 700;
  487. // line-height: 30upx;
  488. // color: #fff;
  489. // }
  490. .biaoTi {
  491. color: #0B0B11;
  492. font-size: 30upx;
  493. font-weight: 700;
  494. width: 570upx;
  495. line-height: 50upx;
  496. min-height: 50upx;
  497. margin: 10upx 145upx 10upx 35upx;
  498. }
  499. .tuPian {
  500. margin: 0upx 30upx;
  501. width: 750upx;
  502. height: 340upx;
  503. position: relative;
  504. border-radius: 10upx 10upx 0upx 10upx;
  505. // border-radius: 20upx;
  506. }
  507. .activityStatus,
  508. .activityStatusEn {
  509. position: absolute;
  510. bottom: 0upx;
  511. left: 1upx;
  512. height: 48upx;
  513. width: 360upx;
  514. // text-align: right;
  515. font-size: 24upx;
  516. color: #fff;
  517. line-height: 48upx;
  518. z-index: 20upx;
  519. border-radius: 0upx 10upx 0upx 0upx;
  520. }
  521. .activityStatusEn {
  522. position: absolute;
  523. bottom: 0upx;
  524. left: 150upx;
  525. }
  526. .activityStatus {
  527. bottom: 0upx;
  528. }
  529. .yellow,
  530. .green,
  531. .red {
  532. position: absolute;
  533. bottom: 0upx;
  534. left: 0upx;
  535. /* min-width: 96px; */
  536. padding: 0 0upx;
  537. height: 48upx;
  538. width: 200upx;
  539. // text-align: center;
  540. line-height: 48upx;
  541. font-size: 24upx;
  542. color: #fff;
  543. border-radius: 10upx 100upx 0upx 0upx;
  544. // z-index: 50upx;
  545. }
  546. .yellow {
  547. background: rgb(255, 153, 0);
  548. }
  549. .green {
  550. background: rgb(102, 204, 1);
  551. }
  552. .red {
  553. background: rgb(224, 32, 32);
  554. }
  555. .recommend-bottom-address {
  556. // padding: 20upx;
  557. color: #999999;
  558. height: 102upx;
  559. width: 750upx;
  560. }
  561. .recommend-bottom-time {
  562. // padding: 20upx;
  563. color: #999999;
  564. height: 102upx;
  565. width: 750upx;
  566. // padding-bottom: 30upx;
  567. }
  568. .recommend-bottom-font {
  569. font-size: 30upx;
  570. line-height: 40upx;
  571. margin: 29upx 0upx 29upx 38upx;
  572. color: #333333;
  573. }
  574. .module-classify-border {
  575. background-color: #f7f7f7;
  576. height: 20upx;
  577. }
  578. // .index-cate .index-cate-item {
  579. // margin: 20upx;
  580. // display: inline-block;
  581. // }
  582. }
  583. </style>