123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <template>
- <div class="activity">
- <div v-for="(item, index) in activityList" class="activityItem" @tap="toDetail(item)">
- <img :src="item.annexArray[0]" class="itemBg" />
- <div class="activityItemRight">
- <div class="activityItemRightTop">
- <span class="activityItemRightName">{{ item.activityName }}</span>
- <!-- <span class="activityItemRightType">{{ item.releaseStatus==='1'?'已发布':item.releaseStatus==='2'?'已下架':'未发布' }}</span>-->
- </div>
- <div class="canyu">{{item.registrationNumbers}}人参与</div>
- <div class="activityItemRightBottom">
- <div class="shoucang" @tap.stop="clickColl(index)">
- <img :src="item.collectorsStatus==='2' ? heartSel : heart" class="scImg" /> 收藏
- </div>
- <div
- :class="item.statusName === '报名中' ? 'baoming' : 'baoming2'"
- @tap.stop="baoming(item)"
- >
- {{ item.statusName === '报名中'? "去报名" : "报名结束" }}
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { getUserPower, getUserLocalStorageInfo, activityList, homeActivityClickCollect,getByCodes} from "@/js_sdk/http";
- export default {
- name: "activity",
- props: {
- faMsg: {
- type: String,
- default: ''
- }
- },
- data() {
- return {
- heartSel: "https://www.idea-co-sf.com/gardenProduct/image/heartSel.png",
- heart: "https://www.idea-co-sf.com/gardenProduct/image/heart.png",
- activityList: [
- // {
- // name: "互联网私募如何入门?",
- // type: "培训活动",
- // img: "https://www.idea-co-sf.com/gardenProduct/image/img1.png",
- // isColl: true,
- // isSign: true,
- // },
- // {
- // name: "公募基金中的大数据啊啊啊?",
- // type: "活动",
- // img: "https://www.idea-co-sf.com/gardenProduct/image/img2.png",
- // isColl: false,
- // isSign: true,
- // },
- // {
- // name: "年度小艾杯篮球赛开...?",
- // type: "体育",
- // img: "https://www.idea-co-sf.com/gardenProduct/image/img3.png",
- // isColl: false,
- // isSign: false,
- // },
- ],
- search: {
- // createdBy: getUserLocalStorageInfo().userId,
- pageNum: 1,
- pageSize: 10
- },
- };
- },
- onShow(){
- },
- mounted(){
- this.getList()
- },
- methods: {
- clickColl(index) {
- if (this.activityList[index].collectorsStatus==='2'){
- this.activityList[index].collectorsStatus='1'
- }else{
- this.activityList[index].collectorsStatus='2'
- }
- homeActivityClickCollect({
- id: this.activityList[index].id,
- createdBy: getUserLocalStorageInfo().userId,
- collectorsStatus: this.activityList[index].collectorsStatus
- }).then(res => {
- });
- },
- getList(){
- this.activityList = []
- activityList(this.search).then(res=>{
- if (res.errno == 0){
- this.activityList = res.data.rows
- }
- // console.log(res)
- })
- },
- baoming(item) {
- if (item.statusName === '报名中') {
- if (getUserLocalStorageInfo().userType == 3) {
- uni.showModal({
- title: "提示",
- cancelText: "暂不",
- confirmText: "去切换",
- content: "您还不是企业用户,请切换登录身份后再进行相关操作。",
- success: function (res) {
- if (res.confirm) {
- uni.navigateTo({
- url: "/pages/login2/login",
- success: function (e) {
- // uni.$emit('userType', 'OK')
- },
- });
- } else if (res.cancel) {
- console.log("用户点击取消");
- }
- },
- });
- }else{
- console.log(2222)
- uni.navigateTo({
- url:'/pages/subPackages/parkActivity/activeApplication?activityId=' + item.id + '&url=' + item.annexArray[0]
- })
- }
- }
- },
- toDetail(item){
- console.log(this.faMsg)
- if (this.faMsg === 'home'){
- uni.navigateTo({
- url:'/pages/subPackages/parkActivity/index'
- })
- }
- }
- },
- };
- </script>
- <style lang="scss">
- .activity {
- margin: 0 auto;
- .activityItem {
- width: 686rpx;
- height: 216rpx;
- background: #f5f7fa;
- padding: 0 24rpx;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- border-radius: 16rpx;
- margin: 12rpx 0;
- .itemBg {
- width: 220rpx;
- height: 160rpx;
- }
- .activityItemRight {
- display: flex;
- flex-direction: column;
- margin-left: 24rpx;
- .activityItemRightTop {
- width: 420rpx;
- display: flex;
- justify-content: space-between;
- .activityItemRightName {
- width: 280rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- color: #18172a;
- font-size: 28rpx;
- }
- .activityItemRightType {
- padding: 2rpx 12rpx;
- background: rgba(3, 101, 249, 0.2);
- color: rgba(3, 101, 249, 1);
- border-radius: 4rpx;
- font-size: 24rpx;
- }
- }
- .canyu {
- font-size: 28rpx;
- color: rgba(102, 102, 102, 1);
- margin: 14rpx 0;
- }
- .activityItemRightBottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .shoucang {
- display: flex;
- align-items: center;
- font-size: 28rpx;
- color: rgba(141, 146, 155, 1);
- .scImg {
- width: 32rpx;
- height: 28rpx;
- margin-right: 8rpx;
- }
- }
- .baoming {
- width: 160rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- background: linear-gradient(316deg, #84aaff 0%, #0365f9 100%);
- border-radius: 32rpx;
- font-size: 28rpx;
- color: white;
- }
- .baoming2 {
- width: 160rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- background: rgba(226, 232, 239, 1);
- border-radius: 32rpx;
- font-size: 28rpx;
- color: rgba(141, 146, 155, 1);
- }
- }
- }
- }
- }
- </style>
|