2024-04-20 14:58:10 +08:00
|
|
|
|
<template>
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view style="background: #F1F2F8;" v-cloak>
|
2024-04-20 14:58:10 +08:00
|
|
|
|
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
|
|
|
|
|
<view style="padding-left: 15rpx;" @click="goBack()">
|
|
|
|
|
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="width: 83%;font-weight: bold;">
|
|
|
|
|
<text>活动详情</text>
|
2024-04-20 14:58:10 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</tn-nav-bar>
|
2025-03-21 16:50:18 +08:00
|
|
|
|
<view v-if="info!=''" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view style="padding: 30rpx;">
|
|
|
|
|
<image :src="apiImgUrl+info.activity_image"
|
|
|
|
|
style="display: block;width: 100%;border-radius: 20rpx 20rpx 0rpx 0rpx;" mode="widthFix"></image>
|
|
|
|
|
<view style="background-color: #ffffff;border-radius: 0rpx 0rpx 20rpx 20rpx;padding: 30rpx;">
|
|
|
|
|
<view style="font-size: 34rpx;font-weight: bold;">{{ info.activity_name }}</view>
|
|
|
|
|
<view style="font-size: 28rpx;color: #666666;margin-top: 20rpx;">
|
|
|
|
|
<text class="tn-icon-time"></text>
|
2025-03-21 16:50:18 +08:00
|
|
|
|
<text>{{formatTime(info.activity_start_time)}} - {{formatTime(info.activity_end_time)}}</text>
|
2024-07-10 18:13:57 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view style="font-size: 28rpx;color: #666666;margin-top: 20rpx;">
|
|
|
|
|
<text class="tn-icon-location" style="vertical-align: middle;"></text>
|
|
|
|
|
<text>{{ info.activity_location }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="margin-top: 20rpx;background-color: #ffffff;border-radius: 20rpx;padding: 30rpx;">
|
|
|
|
|
<view style="font-size: 34rpx;font-weight: 600;padding: 20rpx 0rpx;">活动介绍</view>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="ks_html" style="line-height: 50rpx;margin-top:20rpx">
|
|
|
|
|
<view v-if="info.video!=null&&info.video!=''">
|
|
|
|
|
<video :src="apiImgUrl+info.video" style="width: 100%;border-radius: 5rpx;"></video>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-html="info.activity_content"></view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-03-21 16:50:18 +08:00
|
|
|
|
<view v-if="info.activity_type==2" style="padding-bottom: 180rpx;padding:0rpx 30rpx;">
|
|
|
|
|
<view style="background-color: #ffffff;border-radius: 20rpx;padding: 30rpx;">
|
|
|
|
|
<view style="font-size: 34rpx;font-weight: 600;padding: 20rpx 0rpx;">问卷问题</view>
|
|
|
|
|
<tn-form labelPosition="top" :model="form" ref="form">
|
|
|
|
|
<template v-for="(item,index) in questionnaireList">
|
|
|
|
|
<tn-form-item v-if="item.type==2" :label="(index+1)+'、'+item.title+'(多选题)'" prop="hobby">
|
|
|
|
|
<tn-checkbox-group v-model="questionnaireList[index].topic" size="40"
|
|
|
|
|
activeColor="#82B2FF" wrap>
|
|
|
|
|
<tn-checkbox :name="op.name" v-for="(op,opi) in item.option">
|
|
|
|
|
{{ op.name }}、{{ op.val }}
|
|
|
|
|
</tn-checkbox>
|
|
|
|
|
</tn-checkbox-group>
|
|
|
|
|
</tn-form-item>
|
|
|
|
|
<tn-form-item v-if="item.type==1" :label="(index+1)+'、'+item.title+'(单选题)'" prop="danxuan">
|
|
|
|
|
<tn-radio-group v-model="questionnaireList[index].topic" size="40" activeColor="#82B2FF"
|
|
|
|
|
wrap>
|
|
|
|
|
<tn-radio :name="op.name" v-for="(op,opi) in item.option">
|
|
|
|
|
{{ op.name }}、{{ op.val }}
|
|
|
|
|
</tn-radio>
|
|
|
|
|
</tn-radio-group>
|
|
|
|
|
</tn-form-item>
|
|
|
|
|
<tn-form-item v-if="item.type==3" :label="(index+1)+'、'+item.title+'(问答题)'" prop="wenda">
|
|
|
|
|
<tn-input placeholder="请填写答案" v-model="questionnaireList[index].topic"
|
|
|
|
|
type="textarea" />
|
|
|
|
|
</tn-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</tn-form>
|
|
|
|
|
</view>
|
2024-07-30 18:16:46 +08:00
|
|
|
|
</view>
|
2025-03-21 16:50:18 +08:00
|
|
|
|
<view style="height: 300rpx;"></view>
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view
|
2025-03-21 16:50:18 +08:00
|
|
|
|
style="border-radius: 200rpx;background: #FFFFFF;position: fixed;bottom: 220rpx;right: 20rpx;padding: 20rpx;box-shadow: 0rpx 4rpx 25rpx 0rpx rgba(48,86,211,0.15);">
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view style="text-align: center;" class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between">
|
|
|
|
|
<view>
|
|
|
|
|
<button hover-class="none" open-type="share">
|
|
|
|
|
<view style="font-size: 42rpx;">
|
|
|
|
|
<text class="tn-icon-send"></text>
|
|
|
|
|
</view>
|
|
|
|
|
</button>
|
|
|
|
|
</view>
|
2024-07-30 18:16:46 +08:00
|
|
|
|
<view style="margin: 0px 40rpx;" @click="like">
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view style="font-size: 42rpx;">
|
2024-07-30 18:16:46 +08:00
|
|
|
|
<text v-if="info.like==1" class="tn-icon-praise-fill tn-color-red"></text>
|
|
|
|
|
<text v-if="info.like==2" class="tn-icon-praise"></text>
|
2024-07-10 18:13:57 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-07-30 18:16:46 +08:00
|
|
|
|
<view @click="favs">
|
2024-07-10 18:13:57 +08:00
|
|
|
|
<view style="font-size: 42rpx;">
|
2024-07-30 18:16:46 +08:00
|
|
|
|
<text v-if="info.fav==1" class="tn-icon-star-fill tn-color-orangeyellow"></text>
|
|
|
|
|
<text v-if="info.fav==2" class="tn-icon-star"></text>
|
2024-07-10 18:13:57 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-07-11 18:17:19 +08:00
|
|
|
|
<view
|
|
|
|
|
style="position: fixed;box-shadow: 0px -2px 4px 0px rgba(186,189,199,0.2);background: #FFFFFF;width: 100%;bottom: 0;padding:30rpx 60rpx 80rpx 60rpx;">
|
|
|
|
|
<view style="text-align: center;padding:0 30rpx;" v-if="info.activity_type==1">
|
|
|
|
|
<button class="mmy" hover-class="none" @click="application_add"
|
|
|
|
|
v-if="info.type=='进行中'">确认报名</button>
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='已结束'">报名已结束</button>
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='未开始'">报名未开始</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="text-align: center;padding:0 30rpx;" v-if="info.activity_type==2">
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='未开始'">问卷未开始</button>
|
|
|
|
|
<button class="mmy" hover-class="none" @click="option_add" v-if="info.type=='进行中'">确认提交</button>
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='已结束'">问卷已结束</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="text-align: center;padding:0 30rpx;" v-if="info.activity_type==3">
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='未开始'">捐助未开始</button>
|
2025-03-21 16:50:18 +08:00
|
|
|
|
<button class="mmy" hover-class="none" @click="juanMod=true;money=''"
|
|
|
|
|
v-if="info.type=='进行中'">我要捐助</button>
|
2024-07-11 18:17:19 +08:00
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='已结束'">捐助已结束</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="text-align: center;padding:0 30rpx;" v-if="info.activity_type==4">
|
|
|
|
|
<button class="mmy" hover-class="none" @click="peiMod=true" v-if="info.type=='进行中'">我要参加</button>
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='已结束'">报名已结束</button>
|
|
|
|
|
<button class="mmy" hover-class="none" :disabled="true" v-if="info.type=='未开始'">报名未开始</button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-04-20 14:58:10 +08:00
|
|
|
|
</view>
|
2025-03-21 16:50:18 +08:00
|
|
|
|
|
2024-05-14 10:20:09 +08:00
|
|
|
|
<tn-modal v-model="juanMod" :custom="true">
|
|
|
|
|
<view style="padding: 20rpx;text-align: center;font-size: 40rpx;">感谢您的捐助</view>
|
|
|
|
|
<tn-form :labelWidth="180">
|
|
|
|
|
<tn-form-item label="捐助金额">
|
2025-03-21 16:50:18 +08:00
|
|
|
|
<tn-input v-model="money" :maxLength="5" type="decimal" placeholder="请填写捐助金额" />
|
2024-05-14 10:20:09 +08:00
|
|
|
|
</tn-form-item>
|
|
|
|
|
</tn-form>
|
|
|
|
|
<view class="tn-flex tn-flex-row-center" style="margin-top: 50rpx;">
|
|
|
|
|
<tn-button @click="juanMod=false" backgroundColor="#E6E6E6" fontColor="#838383">我再想想</tn-button>
|
|
|
|
|
<tn-button @click="juanzhuDo" backgroundColor="#28B93D" fontColor="#ffffff"
|
2024-05-15 17:54:48 +08:00
|
|
|
|
style="margin-left: 70rpx;">确定捐助
|
|
|
|
|
</tn-button>
|
2024-05-14 10:20:09 +08:00
|
|
|
|
</view>
|
|
|
|
|
</tn-modal>
|
2024-05-14 18:14:14 +08:00
|
|
|
|
<tn-modal v-model="peiMod" :custom="true">
|
|
|
|
|
<view style="padding: 20rpx;text-align: center;font-size: 40rpx;">需要缴纳费用</view>
|
|
|
|
|
<view style="text-align: center;margin-top: 30rpx;">
|
|
|
|
|
<text style="font-size: 40rpx;">¥</text>
|
2024-05-15 17:54:48 +08:00
|
|
|
|
<text style="font-size: 70rpx;color: #26BB71;margin-left: 5rpx;font-weight: 600;">{{info.money}}</text>
|
2024-05-14 18:14:14 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="tn-flex tn-flex-row-center" style="margin-top: 50rpx;">
|
|
|
|
|
<tn-button @click="peiMod=false" backgroundColor="#E6E6E6" fontColor="#838383">我再想想</tn-button>
|
|
|
|
|
<tn-button @click="zhifuDo" backgroundColor="#28B93D" fontColor="#ffffff"
|
2024-05-15 17:54:48 +08:00
|
|
|
|
style="margin-left: 70rpx;">支付费用
|
|
|
|
|
</tn-button>
|
2024-05-14 18:14:14 +08:00
|
|
|
|
</view>
|
|
|
|
|
</tn-modal>
|
2024-06-04 18:04:09 +08:00
|
|
|
|
<tn-popup v-model="rightMod" mode="right" width="70%">
|
|
|
|
|
<tn-nav-bar :isBack="false" backTitle="" :alpha="true" :bottomShadow="false">
|
|
|
|
|
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
|
|
|
|
|
<view style="padding-left: 15rpx;" @click="rightMod = false">
|
|
|
|
|
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="tn-margin-top"
|
|
|
|
|
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
|
|
|
|
|
<tn-tabs :list="[{name:'报名详情'}]" :current="topCurrent" activeColor="#000" :bold="false"
|
|
|
|
|
:fontSize="24"></tn-tabs>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</tn-nav-bar>
|
|
|
|
|
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
|
|
|
|
<view v-if="info.list.length!=0" class="tn-flex tn-flex-center tn-flex-col-center"
|
2024-06-26 14:17:06 +08:00
|
|
|
|
v-for="(item,index) in info.list" @click="openUrl('/pages/packageA/user/my_card?id='+item.id)"
|
2024-06-04 18:04:09 +08:00
|
|
|
|
style="margin-top: 20rpx;padding: 20rpx;">
|
|
|
|
|
<view>
|
|
|
|
|
<image :src="apiImgUrl+item.photo_image"
|
|
|
|
|
style="width: 100rpx;height: 100rpx;border-radius: 50%"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="margin-left: 20rpx;">
|
|
|
|
|
<view style="font-size: 30rpx;font-weight: 600">{{item.nikename}}</view>
|
|
|
|
|
<view style="font-size: 24rpx;color: #999999;margin-top: 10rpx">{{item.position_name}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="info.list.length==0" style="text-align: center;padding-top: 40rpx">暂无</view>
|
|
|
|
|
</view>
|
|
|
|
|
</tn-popup>
|
2024-06-21 16:15:26 +08:00
|
|
|
|
<tn-modal v-model="showLogin" :custom="true">
|
|
|
|
|
<view style="text-align: center;">
|
|
|
|
|
<view style="font-size: 32rpx;font-weight: 600;">登陆提示</view>
|
|
|
|
|
<view style="margin-top: 40rpx;">请登录后参与活动!</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="text-align: center;margin-top: 40rpx;">
|
|
|
|
|
<tn-button open-type="getPhoneNumber" @getphonenumber="PhoneLogin" backgroundColor="#3377FF"
|
|
|
|
|
height="75rpx" width="500rpx" shape="round" fontColor="#ffffff">点击登陆</tn-button>
|
|
|
|
|
</view>
|
|
|
|
|
</tn-modal>
|
2024-04-20 14:58:10 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-05-08 18:14:41 +08:00
|
|
|
|
import {
|
|
|
|
|
eventInfo,
|
2024-05-15 17:54:48 +08:00
|
|
|
|
questionnaireFind,
|
|
|
|
|
applicationAdd,
|
|
|
|
|
questionnaireAdd,
|
2024-06-21 16:15:26 +08:00
|
|
|
|
moneyLogAdd,
|
2024-07-30 18:16:46 +08:00
|
|
|
|
wxphoneLogin,
|
|
|
|
|
likeDo,
|
|
|
|
|
favsDo,
|
|
|
|
|
likeRevoke,
|
|
|
|
|
favsRevoke
|
2024-05-08 18:14:41 +08:00
|
|
|
|
} from '@/util/api.js';
|
|
|
|
|
import store from '@/store/index.js'
|
2024-05-15 17:54:48 +08:00
|
|
|
|
|
2024-04-20 14:58:10 +08:00
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-06-21 16:15:26 +08:00
|
|
|
|
showLogin: false,
|
2024-05-14 10:20:09 +08:00
|
|
|
|
money: '',
|
|
|
|
|
juanMod: false,
|
2024-06-04 18:04:09 +08:00
|
|
|
|
rightMod: false,
|
2024-05-14 18:14:14 +08:00
|
|
|
|
peiMod: false, //培训付费
|
2024-05-15 17:54:48 +08:00
|
|
|
|
questionnaireList: [], //问卷列表
|
2024-05-14 10:20:09 +08:00
|
|
|
|
button: [{
|
|
|
|
|
text: '取消',
|
|
|
|
|
backgroundColor: '#E6E6E6',
|
|
|
|
|
fontColor: '#FFFFFF',
|
|
|
|
|
shape: 'round'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '确定',
|
|
|
|
|
backgroundColor: 'tn-bg-indigo',
|
|
|
|
|
fontColor: '#FFFFFF'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
form: {
|
|
|
|
|
wenda: '',
|
|
|
|
|
danxuan: '',
|
|
|
|
|
hobby: [],
|
|
|
|
|
},
|
2024-04-23 11:58:07 +08:00
|
|
|
|
topCurrent: 0,
|
2024-05-08 18:14:41 +08:00
|
|
|
|
id: 0,
|
2024-06-04 18:04:09 +08:00
|
|
|
|
info: {
|
|
|
|
|
list: []
|
|
|
|
|
},
|
2024-05-08 18:14:41 +08:00
|
|
|
|
apiImgUrl: this.$store.state.imgUrl
|
2024-04-20 14:58:10 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
2024-04-23 11:58:07 +08:00
|
|
|
|
// this.$wxshare({
|
|
|
|
|
// url: 'http://ysh.0rui.cn/#/pages/index/event_info',
|
|
|
|
|
// data: {
|
|
|
|
|
// url: window.location.href.split("#")[0],
|
|
|
|
|
// },
|
|
|
|
|
// share_data: {
|
|
|
|
|
// title: '河南省青年企业家协会开展走进开封市龙亭区暨产业考察交流活动',
|
|
|
|
|
// desc: '河南省青年企业家协会开展走进开封市龙亭区暨产业考察交流活动',
|
|
|
|
|
// imgUrl: 'http://ysh.0rui.cn/static/ser.png',
|
|
|
|
|
// link: "http://ysh.0rui.cn/#/pages/index/event_info", // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
|
|
|
|
// }
|
2024-04-20 14:58:10 +08:00
|
|
|
|
// })
|
2024-05-08 18:14:41 +08:00
|
|
|
|
// var id = this.$route.query.id;
|
|
|
|
|
// this.id = id;
|
|
|
|
|
// this.getEventInfo();
|
2024-07-30 18:16:46 +08:00
|
|
|
|
//1已点赞2未点赞
|
2024-05-08 18:14:41 +08:00
|
|
|
|
},
|
2024-05-31 18:06:24 +08:00
|
|
|
|
onShareAppMessage() { // 分享到微信好友
|
|
|
|
|
// 更多参数配置,参考文档
|
|
|
|
|
return {
|
|
|
|
|
title: this.info.activity_name,
|
2024-06-26 14:17:06 +08:00
|
|
|
|
path: '/pages/packageB/event/event_info?id=' + this.info.id + "&gid=" + store.state.Gid,
|
2024-05-31 18:06:24 +08:00
|
|
|
|
imageUrl: this.apiImgUrl + this.info.activity_image,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShareTimeline() { // 分享到朋友圈
|
|
|
|
|
return {
|
|
|
|
|
title: this.info.activity_name,
|
2024-06-26 14:17:06 +08:00
|
|
|
|
path: '/pages/packageB/event/event_info?id=' + this.info.id + "&gid=" + store.state.Gid,
|
2024-05-31 18:06:24 +08:00
|
|
|
|
imageUrl: this.apiImgUrl + this.info.activity_image,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2024-05-08 18:14:41 +08:00
|
|
|
|
onLoad(d) {
|
2024-06-21 16:15:26 +08:00
|
|
|
|
var uid = uni.getStorageSync('uid');
|
2024-05-08 18:14:41 +08:00
|
|
|
|
console.log(d);
|
|
|
|
|
this.id = d.id;
|
2024-06-21 16:15:26 +08:00
|
|
|
|
if (typeof(d.gid) != 'undefined') {
|
|
|
|
|
console.log(11111111);
|
|
|
|
|
store.commit('$tStore', {
|
|
|
|
|
name: 'Gid',
|
|
|
|
|
value: d.gid
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('Gid', d.gid);
|
|
|
|
|
}
|
|
|
|
|
if (!uid) {
|
|
|
|
|
getApp().getUserLogin((r) => {
|
|
|
|
|
console.log('---Login---', r);
|
2025-03-21 16:50:18 +08:00
|
|
|
|
this.getEventInfo();
|
2024-06-21 16:15:26 +08:00
|
|
|
|
})
|
2025-03-21 16:50:18 +08:00
|
|
|
|
}else{
|
|
|
|
|
this.getEventInfo();
|
2024-06-21 16:15:26 +08:00
|
|
|
|
}
|
2025-03-21 16:50:18 +08:00
|
|
|
|
|
2024-04-20 14:58:10 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-07-30 18:16:46 +08:00
|
|
|
|
like() {
|
|
|
|
|
var uid = uni.getStorageSync('uid');
|
|
|
|
|
if (!uid) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '请先登录',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.info.like == 2) {
|
|
|
|
|
likeDo({
|
|
|
|
|
member_id: uid,
|
|
|
|
|
related_id: this.id,
|
|
|
|
|
related_type: 'article',
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '赞成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
this.info.like = 1;
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
likeRevoke({
|
|
|
|
|
member_id: uid,
|
|
|
|
|
related_id: this.id,
|
|
|
|
|
related_type: 'article',
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '取消成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
this.info.like = 2;
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
favs() {
|
|
|
|
|
var uid = uni.getStorageSync('uid');
|
|
|
|
|
if (!uid) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '请先登录',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.info.fav == 2) {
|
|
|
|
|
favsDo({
|
|
|
|
|
member_id: uid,
|
|
|
|
|
related_id: this.id,
|
|
|
|
|
related_type: 'article',
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '收藏成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
this.info.fav = 1;
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
favsRevoke({
|
|
|
|
|
member_id: uid,
|
|
|
|
|
related_id: this.id,
|
|
|
|
|
related_type: 'article',
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '取消收藏成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
this.info.fav = 2;
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
2024-06-21 16:15:26 +08:00
|
|
|
|
PhoneLogin(d) {
|
|
|
|
|
console.log(d);
|
|
|
|
|
this.showLogin = false;
|
|
|
|
|
var openid = uni.getStorageSync('openid');
|
|
|
|
|
wxphoneLogin({
|
|
|
|
|
code: d.code,
|
|
|
|
|
openid: openid
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '登陆成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
uni.setStorageSync('uid', res.data.id);
|
|
|
|
|
uni.setStorageSync('userInfo', res.data);
|
|
|
|
|
this.userInfo = res.data;
|
|
|
|
|
this.login = true;
|
|
|
|
|
this.loginMod = false;
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '登陆失败!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-05-14 18:14:14 +08:00
|
|
|
|
zhifuDo() {
|
|
|
|
|
this.peiMod = false;
|
|
|
|
|
var uid = uni.getStorageSync('uid');
|
2024-05-15 17:54:48 +08:00
|
|
|
|
if (!uid) {
|
2025-03-21 16:50:18 +08:00
|
|
|
|
this.showLogin = true;
|
2024-05-15 17:54:48 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
2024-05-14 18:14:14 +08:00
|
|
|
|
applicationAdd({
|
|
|
|
|
association_id: store.state.Gid,
|
|
|
|
|
member_id: uid,
|
|
|
|
|
activity_id: this.id,
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '报名成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
2024-05-14 10:20:09 +08:00
|
|
|
|
juanzhuDo() {
|
|
|
|
|
this.juanMod = false;
|
2024-05-15 17:54:48 +08:00
|
|
|
|
var uid = uni.getStorageSync('uid');
|
|
|
|
|
if (!uid) {
|
2025-03-21 16:50:18 +08:00
|
|
|
|
this.showLogin = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.money == '' || this.money == 0) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '请填写金额!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
2024-05-15 17:54:48 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
moneyLogAdd({
|
|
|
|
|
association_id: store.state.Gid,
|
|
|
|
|
member_id: uid,
|
|
|
|
|
activity_id: this.id,
|
|
|
|
|
money: this.money
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '捐助成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
option_add() {
|
|
|
|
|
var uid = uni.getStorageSync('uid');
|
|
|
|
|
if (!uid) {
|
2025-03-21 16:50:18 +08:00
|
|
|
|
this.showLogin = true;
|
2024-05-15 17:54:48 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var that = this;
|
|
|
|
|
var uid = uni.getStorageSync('uid');
|
|
|
|
|
var key = this.questionnaireList.map((item, index) => {
|
|
|
|
|
if (!('topic' in item)) {
|
|
|
|
|
return '';
|
|
|
|
|
} else {
|
|
|
|
|
return {
|
|
|
|
|
activity_id: that.id,
|
|
|
|
|
topic_id: item.id,
|
|
|
|
|
member_id: uid,
|
|
|
|
|
option: Array.isArray(item.topic) ? item.topic.join(',') : item.topic,
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-14 10:20:09 +08:00
|
|
|
|
});
|
2024-05-15 17:54:48 +08:00
|
|
|
|
for (var i = 0; i < key.length; i++) {
|
|
|
|
|
if (key[i] == '') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '请填写第[' + (i + 1) + ']个问题',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
questionnaireAdd({
|
2024-05-21 18:16:48 +08:00
|
|
|
|
option: JSON.stringify(key),
|
|
|
|
|
activity_id: this.id,
|
|
|
|
|
member_id: uid,
|
|
|
|
|
association_id: store.state.Gid,
|
2024-05-15 17:54:48 +08:00
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
2024-05-14 10:20:09 +08:00
|
|
|
|
},
|
2024-05-08 18:14:41 +08:00
|
|
|
|
application_add() {
|
|
|
|
|
var uid = uni.getStorageSync('uid');
|
|
|
|
|
if (!uid) {
|
2025-03-21 16:50:18 +08:00
|
|
|
|
this.showLogin = true;
|
2024-05-08 18:14:41 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
applicationAdd({
|
|
|
|
|
association_id: store.state.Gid,
|
|
|
|
|
member_id: uid,
|
|
|
|
|
activity_id: this.id,
|
2024-06-21 16:15:26 +08:00
|
|
|
|
//application_time: new Date().toISOString().slice(0, 19).replace('T', ' ')
|
2024-05-08 18:14:41 +08:00
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '报名成功!',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getEventInfo() {
|
|
|
|
|
eventInfo({
|
|
|
|
|
association_id: store.state.Gid,
|
|
|
|
|
id: this.id
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
var key = res.data;
|
|
|
|
|
if (key.activity_content.indexOf("<img") != -1) {
|
|
|
|
|
key.activity_content = getApp().addWidthToImages(key.activity_content);
|
|
|
|
|
}
|
|
|
|
|
this.info = key;
|
2024-05-15 17:54:48 +08:00
|
|
|
|
if (this.info.activity_type == 2) {
|
|
|
|
|
this.getEventOption()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getEventOption() {
|
|
|
|
|
questionnaireFind({
|
|
|
|
|
activity_id: this.id
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
this.questionnaireList = res.data;
|
2024-05-08 18:14:41 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: error,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
})
|
2024-04-20 14:58:10 +08:00
|
|
|
|
},
|
2024-06-04 18:04:09 +08:00
|
|
|
|
openUrl(url) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: url
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-07-10 18:13:57 +08:00
|
|
|
|
formatTime(time) {
|
2025-03-21 16:50:18 +08:00
|
|
|
|
let date = time.split(" ")[0]; // 获取年月日
|
|
|
|
|
let hour = time.split(" ")[1].substring(0, 5); // 获取时分
|
|
|
|
|
return date + " " + hour;
|
2024-07-10 18:13:57 +08:00
|
|
|
|
},
|
2024-04-20 14:58:10 +08:00
|
|
|
|
goBack() {
|
|
|
|
|
if (getCurrentPages().length > 1) {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
} else {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/index/index'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-15 17:54:48 +08:00
|
|
|
|
},
|
2024-04-20 14:58:10 +08:00
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2024-05-14 10:20:09 +08:00
|
|
|
|
.mmy {
|
|
|
|
|
background-color: #F73909;
|
|
|
|
|
border-radius: 30px;
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
width: 100%;
|
|
|
|
|
color: #FFF;
|
|
|
|
|
line-height: 80rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
}
|
2024-07-10 18:13:57 +08:00
|
|
|
|
|
|
|
|
|
button::after {
|
|
|
|
|
border: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button {
|
|
|
|
|
position: relative;
|
|
|
|
|
display: block;
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
margin-right: auto;
|
|
|
|
|
padding-left: 0px;
|
|
|
|
|
padding-right: 0px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
text-align: center;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
line-height: 1.35;
|
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|