jwyu 3 years ago
parent
commit
9a0ca00b1f

+ 1 - 0
index.html

@@ -4,6 +4,7 @@
     <meta charset="UTF-8" />
     <link rel="icon" href="/favicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
     <title>弘则研报</title>
   </head>

+ 7 - 0
src/api/http.js

@@ -1,6 +1,7 @@
 "use strict";
 import axios from "axios";
 import store from '@/store'
+import { ElMessage } from 'element-plus'
 
 // Full config:  https://github.com/axios/axios#request-config
 // axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
@@ -39,6 +40,12 @@ _axios.interceptors.response.use(
     }else{
       data=response.data
     }
+    if(data.code===401){//token失效
+      ElMessage.error('请重新登录')
+    }
+    if(data.code!==200&&data.code!==403&&data.code!==4001&&data.code!==401){
+      ElMessage.error(data.msg)
+    }
     return data;
   },
   function (error) {

+ 1 - 1
src/api/user.js

@@ -18,7 +18,7 @@ export const apiUserInfo=()=>{
  * @param real_name 姓名
  * @param source 来源:我的1、活动2、图库3、研报4
  * @param source_agent 来源平台:1:小程序、2:pc
- * @param fromPage 来源页面: '活动列表''活动详情'
+ * @param from_page 来源页面: '活动列表''活动详情'
  */
 export const apiApplyPermission=params=>{
 	return post('/user/apply',{...params,source_agent:2})

BIN
src/assets/location.png


+ 12 - 0
src/store/index.js

@@ -21,6 +21,11 @@ export default createStore({
       index:0,//当前播放第几个
       activityId:0,//活动的id
       paused:false,//当前音频播放状态
+    },
+
+    activityItemStatus:{//活动详情中某个活动点击了会议提醒\报名 更新列表状态
+      activityId:0,
+      type:'',// 会议、报名
     }
   },
   mutations: {
@@ -77,7 +82,14 @@ export default createStore({
       }else{
         state.audioData.paused=false
       }
+    },
+
+    // 更新活动列表某项状态
+    updateActivityStatus(state,e){
+      state.activityId=e.activityId
+      state.type=e.type
     }
+
   },
   actions: {
     // 获取个人信息

+ 33 - 3
src/views/activity/Detail.vue

@@ -156,7 +156,7 @@ const handleApply=()=>{
                     company_name:noAuth.data.customer_info.company_name,
                     real_name:noAuth.data.customer_info.name,
                     source:2,
-                    fromPage:'活动详情'
+                    from_page:'活动详情'
                 }).then((res)=>{
                     if(res.code===200){
                         console.log('主动申请成功');
@@ -185,7 +185,9 @@ const handleApply=()=>{
                 <span class="status-box status-end" v-if="info.activityState===3">已结束</span>
                 <h2 class="type-title">{{ info.activityTypeName }}</h2>
                 <div>主讲人:{{ info.speaker }}</div>
-                <div style="color: #b6b6b6; margin: 12px 0"> 活动时间:{{ formatActivityTime(info.startTime, info.endTime) }}</div>
+                <div style="color: #b6b6b6; margin: 12px 0"> 活动时间:{{ formatActivityTime(info.startTime, info.endTime) }}
+                    <span class="city-box" v-if="info.city">{{info.city}}</span>
+                </div>
                 <div class="report-name"> {{ info.reportName ? info.reportName.split("】")[1] : info.activityName }} </div>
             </div>
             <div class="con">
@@ -215,7 +217,16 @@ const handleApply=()=>{
                                 item.type == 'copy' && 'link',
                             ]"
                         >
-                            {{ item.text }}
+                            <template v-if="item.type=='tel'||item.type=='copy'">
+                            <el-popover
+                                placement="right-end"
+                                trigger="hover"
+                            >   
+                                <template #reference> {{ item.text }} </template>
+                                <template  #default><span @click="handleCopyTel(item.text)">复制{{item.type=='tel'?'号码':'链接'}}</span></template>
+                            </el-popover>
+                            </template>
+                            <template v-else>{{item.text}}</template>
                         </div>
                     </div>
                 </div>
@@ -254,6 +265,9 @@ const handleApply=()=>{
 </template>
 
 <style lang="scss" scoped>
+:deep(.el-popper){
+    min-width: 50px;
+}
 .activity-detail-page {
     padding-top: 30px;
     .main-box {
@@ -281,6 +295,22 @@ const handleApply=()=>{
             .status-end{
                 color: #333;
             }
+            .city-box{
+                color: #DAB37C;
+                font-size: 14px;
+                margin-left: 10px;
+                &::before{
+                    content: '';
+                    display: inline-block;
+                    width: 12px;
+                    height: 15px;
+                    background-image: url('../../assets/location.png');
+                    background-size: cover;
+                    margin-right: 5px;
+                    position: relative;
+                    top: 3px;
+                }
+            }
         }
         .type-title {
             font-size: 16px;

+ 44 - 1
src/views/activity/List.vue

@@ -1,5 +1,5 @@
 <script setup>
-import {reactive,ref} from 'vue'
+import {reactive,ref, watch} from 'vue'
 import { useRouter } from "vue-router";
 import {formatActivityTime} from './utils'
 
@@ -170,6 +170,33 @@ const handleGetAudio=async (item)=>{
 }
 
 
+// 监听详情的会议提醒\报名状态是否变化
+watch(
+    ()=>store.state.activityItemStatus.activityId,
+    ()=>{
+        console.log('更新列表项状态');
+        listData.list.forEach(item=>{
+            if(item.activityId==store.state.activityItemStatus.activityId){
+                if(store.state.activityItemStatus.type=='会议'){
+                    if(item.hasRemind===0){
+                        item.hasRemind=1
+                    }else{
+                        item.hasRemind=0
+                    }
+                }else{
+                    if(item.registerState===0){
+                        item.registerState=1
+                    }else{
+                        item.registerState=0
+                    }
+                }
+            }
+        })
+        
+    }
+)
+
+
 
 // 记录滚动条
 import {onActivated} from 'vue'
@@ -224,6 +251,7 @@ const aduioIconDefault=new URL('../../assets/audio-pause-3.png', import.meta.url
                         <h2 class="title">{{item.activityTypeName}}</h2>
                         <p class="speaker">主讲:{{item.speaker}}</p>
                     </div>
+                    <div v-if="item.firstActivityTypeId===3&&item.city" class="city-box">{{item.city}}</div>
                     <div class="flex bot">
                         <span class="time">{{formatActivityTime(item.startTime,item.endTime)}}</span>
                         <div>
@@ -351,6 +379,21 @@ const aduioIconDefault=new URL('../../assets/audio-pause-3.png', import.meta.url
                 .speaker{
                     margin: 0;
                 }
+                .city-box{
+                    color: #DAB37C;
+                    font-size: 14px;
+                    &::before{
+                        content: '';
+                        display: inline-block;
+                        width: 12px;
+                        height: 15px;
+                        background-image: url('../../assets/location.png');
+                        background-size: cover;
+                        margin-right: 5px;
+                        position: relative;
+                        top: 3px;
+                    }
+                }
                 .bot{
                     justify-content: space-between;
                     align-items: flex-end;

+ 2 - 2
src/views/activity/applyAuth.js

@@ -61,7 +61,7 @@ export const applyAuth=(res,type,source,fromPage)=>{
                         company_name:res.data.customer_info.company_name,
                         real_name:res.data.customer_info.name,
                         source:source,
-                        fromPage:fromPage
+                        from_page:fromPage
                     }).then((res)=>{
                         if(res.code===200){
                             console.log('主动申请成功');
@@ -100,7 +100,7 @@ export const applyAuth=(res,type,source,fromPage)=>{
                             company_name:res.data.customer_info.company_name,
                             real_name:res.data.customer_info.name,
                             source:source,
-                            fromPage:fromPage
+                            from_page:fromPage
                         }).then((res)=>{
                             if(res.code===200){
                                 console.log('主动申请成功');

+ 1 - 1
src/views/applyPermission/Apply.vue

@@ -69,7 +69,7 @@ const handleApply=(formEl)=>{
             permission:formData.permission.join(','),
             real_name:formData.name,
             source:Number(route.query.source)||0,
-            fromPage:route.query.fromPage
+            from_page:route.query.fromPage
         }).then(res=>{
             if(res.code===200){
                 ElMessage('申请成功')