123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- <template>
- <view class="rf-category">
- <view style="width:90%;height:99upx">
- <view class="leftArrow" @tap="back">
- <u-icon name="arrow-left" color="#fff" size="40"></u-icon>
- </view>
- <rf-search-bar2 @search="inputValue" icon="iconkuaijiecaidan" @tab="tabClick"
- :title=" i18n('return') " style="z-index: 99;" />
- </view>
- <!-- 轮播图 -->
- <view class="uni-padding-wrap">
- <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
- :duration="duration">
- <swiper-item v-for="(item,index) in activityInfos" :key="index"
- v-if="item.logoFlag && item.logoFlag=='n'">
- <view style="padding: 10upx 20upx;">
- <view class="swiperImg" @click="toActivityInfo(item.baseActivityEntityId)">
- <image v-if="item.activityLogo" :src="websiteUrl+ item.activityLogo + '?custom=840_350'"
- alt="" style="width: 100%;height: 300upx;border-radius: 40upx;" />
- <image :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else
- style="width: 100%;height: 300upx;" />
- <text style="display: inline-block;">
- <text v-if="item.activityStatusDict=='0'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff; background-color:#32C5FF;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Notstarted')}}</text>
- </text>
- <text v-if="item.activityStatusDict=='1'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff ;background-color:#32C5FF;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 120upx;':'margin-left: 240upx;'">{{i18n('Registrationinprogress')}}</text>
- </text>
- <text v-if="item.activityStatusDict=='2'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff;background-color:#9B9B9B;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Inaction')}}</text>
- </text>
- <text v-if="item.activityStatusDict=='3'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff;background-color:#9B9B9B;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Finished')}}</text>
- </text>
- <text v-if="$i18n.locale=='zh'"
- :class="item.activityType=='会员活动'?'yellow':item.activityType=='联盟活动'?'green':'red'">
- <text style="">{{item.activityType}}</text>
- </text>
- <text v-if="$i18n.locale=='en'" style="padding-right: 250upx;margin-right: 200upx;"
- :class="item.activityType=='会员活动'?'yellow'
- :item.activityType=='联盟活动'?'green'
- :'red' ">
- <text style="margin-left: 10upx;">{{item.activityType=='会员活动'?'MemberActivities'
- :item.activityType=='联盟活动'?'AllianceActivities'
- :'CooperationActivities'}}</text>
- </text>
- </text>
- </view>
- <view class="recommend-bottom">
- <view class="recommend-activityName" @click="toActivityInfo(item.baseActivityEntityId)">
- {{item.activityName}}
- </view>
- <view class="recommend-bottom-time">
- <u-icon name="map" color="#D8D8D8" size="36" style="margin: 0px 26upx 0px 0px;">
- </u-icon>
- {{item.activityCity}} | {{formatDate(item.activityStartTime)}} -
- {{formatDate(item.activityEndTime)}}
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- </view>
- <!-- 分类列表 -->
- <!-- tabs -->
- <view class="uni-padding-wrap">
- <u-tabs :list="list" :current="current" @change="tabClick" gutter="50" bar-width="80"></u-tabs>
- <view v-if="activityInfo.length!=0">
- <view v-for="(item,index) in activityInfo" :key="index">
- <view style="margin: 18upx 20upx; ">
- <view class=" swiperImg" @click="toActivityInfo(item.baseActivityEntityId)">
- <image v-if="item.activityLogo" :src="websiteUrl+ item.activityLogo + '?custom=840_350'"
- alt="" style="width: 100%;height: 300upx;border-radius: 40upx;" />
- <image :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else
- style="width: 100%;height: 300upx;" />
- <text style="display: inline-block;">
- <text v-if="item.activityStatusDict=='0'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff; background-color:#32C5FF;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Notstarted')}}</text>
- </text>
- <text v-if="item.activityStatusDict=='1'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff ;background-color:#32C5FF;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 140upx;':'margin-left: 240upx;'">{{i18n('Registrationinprogress')}}</text>
- </text>
- <text v-if="item.activityStatusDict=='2'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff;background-color:#9B9B9B;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Inaction')}}</text>
- </text>
- <text v-if="item.activityStatusDict=='3'"
- :class="$i18n.locale=='zh'?'activityStatus':'activityStatusEn'"
- style="color: #ffffff;background-color:#9B9B9B;">
- <text
- :style="$i18n.locale=='en'?'margin-left: 170upx;':'margin-left: 240upx;'">{{i18n('Finished')}}</text>
- </text>
- <text v-if="$i18n.locale=='zh'"
- :class="item.activityType=='会员活动'?'yellow':item.activityType=='联盟活动'?'green':'red'">
- <text style="">{{item.activityType}}</text>
- </text>
- <text v-if="$i18n.locale=='en'" style="padding-right: 250upx;margin-right: 200upx;"
- :class="item.activityType=='会员活动'?'yellow'
- :item.activityType=='联盟活动'?'green'
- :'red' ">
- <text style="margin-left: 10upx;">{{item.activityType=='会员活动'?'MemberActivities'
- :item.activityType=='联盟活动'?'AllianceActivities'
- :'CooperationActivities'}}</text>
- </text>
- </text>
- </view>
- <view class="recommend-bottom">
- <view class="recommend-activityName" @click="toActivityInfo(item.baseActivityEntityId)">
- {{item.activityName}}
- </view>
- <view>
- <u-icon name="map" color="#D8D8D8" size="36" style="margin: 0px 26upx 0px 0px;">
- </u-icon>
- {{item.activityCity}} | {{formatDate(item.activityStartTime)}} -
- {{formatDate(item.activityEndTime)}}
- </view>
- </view>
- </view>
- <view class="module-classify-border"></view>
- </view>
- </view>
- <view v-else>
- <view style="display: flex; justify-content: center;align-items: center;height: 667upx; ">
- <u-icon name="file-text" color="#a5a5a5" size="200" label-pos="bottom" label-size="36"
- :label="$i18n.locale==='zh'?'敬请期待':'Please waiting'"></u-icon>
- </view>
- </view>
- </view>
- <!-- <view class="module-classify-border"></view> -->
- <u-modal v-model="show" @confirm="confirm" :show-cancel-button="true" :content="content"></u-modal>
- </view>
- </template>
- <script>
- import rfSearchBar2 from '@/components/rf-search-bar-xiangmu';
- export default {
- components: {
- rfSearchBar2,
- },
- data() {
- return {
- background: ['color1', 'color2', 'color3'],
- indicatorDots: true,
- autoplay: true,
- interval: 10000,
- duration: 500,
- activityInfo: [], // 活动信息
- activityInfos: [], // 所有活动信息
- current: 0,
- ActivitesId: "",
- Storage_data: "",
- token: "",
- show: false,
- content: '是否去注册/登录?',
- list: [{
- name: this.i18n('MemberActivities')
- },
- {
- name: this.$i18n.locale === 'zh' ? "联盟活动" : "Alliance Activities",
- }, {
- name: this.i18n('CooperationActivities')
- }
- ]
- };
- },
- async onShow() {
- this.getList();
- this.getActivitiesList();
- try {
- this.Storage_data = JSON.parse(uni.getStorageSync('user'));
- this.token = uni.getStorageSync('Auth-Token');
- } catch (e) {
- };
- },
- computed: {
- },
- onLoad(options) {
- this.current = options.id ? options.id : 0
- },
- methods: {
- // back() {
- // uni.navigateBack();
- // },
- back() {
- console.log("aaaaaaaa")
- uni.navigateTo({
- url: '../index/index'
- });
- },
- registration(id) {
- console.log('id', id);
- // this.token == undefined
- // console.log('token', this.token)
- // this.show = true;
- if (!this.token) {
- this.show = true;
- } else {
- this.$mRouter.push({
- route: `/pages/cooperationExchange/cooperationExchangeList/cooperationActiveRegistration?ActivitesId=${id}`
- });
- }
- },
- confirm() {
- // setTimeout(() => {
- // 3秒后自动关闭
- uni.navigateTo({
- url: `/pages/public/login`
- });
- this.show = false;
- // 如果不想关闭,而单是清除loading状态,需要通过ref手动调用方法
- // this.$refs.uModal.clearLoading();
- // }, 3000)
- },
- toActivityInfo(id) {
- console.log('id', id)
- this.$mRouter.push({
- route: `/pages/cooperationExchange/cooperationExchangeList/activitiesInfo?ActivitesId=${id}`
- });
- // uni.navigateTo({
- // url:"cooperationExchangeList/activitiesInfo?ActivitesId="+ActivitesId
- // })
- },
- tabClick(index) {
- this.current = index;
- this.getList();
- },
- async getList() {
- let page = {
- pageSize: 10,
- pageNo: 1,
- language: this.$i18n.locale.toUpperCase(),
- activityTypeDict: this.current,
- }
- const res = await this.$myRequest({
- url: '/project/activityInfos/showActivityInfos',
- data: {
- ...page
- }
- });
- this.activityInfo = [];
- this.activityInfo = res.data.activityInfos || [];
- console.log('+++++++', res.data);
- },
- async getActivitiesList() {
- let page = {
- pageSize: 10,
- pageNo: 1,
- language: this.$i18n.locale.toUpperCase(),
- }
- const res = await this.$myRequest({
- url: '/project/activityInfos/showActivityInfos',
- data: {
- ...page
- }
- });
- this.activityInfos = res.data.activityInfos;
- console.log(this.activityInfos, "大数据");
- },
- i18n(data) {
- return this.$t('common.' + data);
- },
- // 通用跳转
- navToSearch() {
- this.$mRouter.push({
- route: `/pages/index/search/search?data=${JSON.stringify(this.search)}`
- });
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- .rf-category {
- background-color: $color-white;
- .uni-padding-wrap {
- // margin-top: 10upx;
- /* #ifdef APP-PLUS */
- margin-top: 51upx;
- /* #endif */
- }
- .swiper {
- height: 500upx;
- width: 750upx;
- }
- .swiperImg {
- width: 100%;
- height: 75%;
- position: relative;
- }
- .recommend-bottom {
- padding: 0upx 20upx 20upx;
- width: 100%;
- box-sizing: border-box;
- }
- .recommend-bottom-time {
- width: 710upx;
- font-size: 23upx;
- height: 36upx;
- line-height: 36upx;
- box-sizing: border-box;
- position: absolute;
- bottom: 36upx;
- }
- .recommend-activityName {
- // width: 80%;
- font-size: 28upx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 400;
- color: #0B0B11;
- line-height: 50upx;
- padding-right: 10upx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- height: 50upx;
- margin-top: 20upx;
- margin-bottom: 16upx;
- }
- .activityStatus,
- .activityStatusEn {
- position: absolute;
- bottom: 12upx;
- left: 1upx;
- height: 48upx;
- width: 360upx;
- // text-align: right;
- font-size: 24upx;
- color: #fff;
- line-height: 48upx;
- z-index: 20upx;
- border-radius: 0upx 10upx 0upx 0upx;
- }
- .activityStatusEn {
- position: absolute;
- left: 150upx;
- }
- .activityStatus {
- // bottom: 12upx;
- }
- .yellow,
- .green,
- .red {
- position: absolute;
- bottom: 12upx;
- left: 0upx;
- /* min-width: 96px; */
- padding: 0 0upx;
- height: 48upx;
- width: 180upx;
- // text-align: center;
- line-height: 48upx;
- font-size: 24upx;
- color: #fff;
- border-radius: 10upx 100upx 0upx 0upx;
- padding-left: 24upx;
- // z-index: 50upx;
- }
- .yellow {
- background: rgb(255, 153, 0);
- }
- .green {
- background: rgb(102, 204, 1);
- }
- .red {
- padding-left: 18upx;
- background: rgb(224, 32, 32);
- }
- .module-classify-border {
- background-color: #ebebeb;
- height: 20upx;
- width: 750upx;
- }
- }
- </style>
- <style>
- /deep/ .swiper .uni-swiper-dots {
- left: initial;
- right: 0upx;
- bottom: 16upx;
- }
- </style>
|