|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="ni" v-if="item" @click="toDetail(item)">
|
|
|
+ <view class="ni" v-if="item" @click.prevent="toDetail(item)">
|
|
|
<view class="ni-top adfacjb">
|
|
|
<view class="ni-top-left adfac">
|
|
|
<image class="avatar" src="https://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png"></image>
|
|
|
@@ -31,11 +31,11 @@
|
|
|
<view class="tip-right">{{item?.provinceName||''}}{{item?.cityName||''}}</view>
|
|
|
</view>
|
|
|
<view class="bottom">
|
|
|
- <view class="btn" v-if="item.activeState==1&&item.signupState==1">取消报名</view>
|
|
|
- <view class="btn" v-if="item.activeState==1&&item.signupState==-1">立即报名</view>
|
|
|
- <view class="btn" v-if="item.activeState==2&&item.signupState==1">去签到</view>
|
|
|
- <view class="btn" v-if="item.activeState==3&&item.signupState==2">写档案</view>
|
|
|
- <view class="btn" v-if="item.activeState==3&&item.signupState==3">查看档案</view>
|
|
|
+ <view class="btn" @click.stop="handleCancel" v-if="(item.activeState==1||item.activeState===0)&&item.signupState==1">取消报名</view>
|
|
|
+ <view class="btn" @click.stop="toDetail(item)" v-if="item.activeState==1&&item.signupState==-1">立即报名</view>
|
|
|
+ <view class="btn" @click.stop="handleSignup" v-if="item.activeState==2&&item.signupState==1">去签到</view>
|
|
|
+ <view class="btn" @click.stop="handleFill" v-if="item.activeState==3&&item.signupState==2">写档案</view>
|
|
|
+ <view class="btn" @click.stop="handleReview" v-if="item.activeState==3&&item.signupState==3">查看档案</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -43,7 +43,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup name="NonprofitItem">
|
|
|
- import { ref } from 'vue'
|
|
|
+ import { ref, getCurrentInstance } from 'vue'
|
|
|
+ const { proxy } = getCurrentInstance()
|
|
|
|
|
|
const props = defineProps({
|
|
|
item:{
|
|
|
@@ -69,6 +70,67 @@
|
|
|
url:'/pagesNonprofit/nonprofitDetail?memberSignupId='+item?.memberSignupId
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ const emits = defineEmits(['handleCancel'])
|
|
|
+ const handleCancel = () => {
|
|
|
+ uni.showModal({
|
|
|
+ title:'温馨提示',
|
|
|
+ content:'确认取消本次报名吗?取消后可再次报名本活动。',
|
|
|
+ success: (res) => {
|
|
|
+ if(res.confirm){
|
|
|
+ proxy.$api.get(`/core/activity/signup/cancelSignupBySingle/${props.item?.memberSignupId}`).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return proxy.$showToast(res.msg)
|
|
|
+ emits('handleCancel')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const handleSignup = () => {
|
|
|
+ try{
|
|
|
+ uni.scanCode({
|
|
|
+ success: (res) => {
|
|
|
+ if(res.errMsg=='scanCode:ok'){
|
|
|
+ let r = res.result.replace(/^\uFEFF/, '');
|
|
|
+ let d = JSON.parse(r);
|
|
|
+ if(!d.hasOwnProperty('id')||!d) return proxy.$showToast('请扫描正确的活动签到码');
|
|
|
+
|
|
|
+ let { id } = d;
|
|
|
+ const userId = JSON.parse(uni.getStorageSync('userInfo'))?.id||'';
|
|
|
+ proxy.$api.post('/core/activity/signup/signinBySingle',{
|
|
|
+ activityId:id||'',
|
|
|
+ memberSignupId:props.item?.memberSignupId,
|
|
|
+ userId
|
|
|
+ }).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return proxy.$showToast('签到失败,请稍后再试')
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pagesHome/signSuccess'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else proxy.$showToast(res.errMsg)
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ proxy.$showToast('扫描异常,请稍后再试')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }catch(e){
|
|
|
+ proxy.$showToast('签到异常,请稍后再试')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const handleFill = () => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pagesHome/fillNonprofitArchives?activity='+encodeURIComponent(JSON.stringify(props.item))
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const handleReview = () => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pagesMy/archivesDetail?activityId='+props.item?.activityId+'&memberId='+props.item?.memberId
|
|
|
+ })
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|