jwyu 10 ماه پیش
والد
کامیت
79beec44c1
2فایلهای تغییر یافته به همراه30 افزوده شده و 28 حذف شده
  1. 3 1
      src/api/index.js
  2. 27 27
      src/views/report/Detail.vue

+ 3 - 1
src/api/index.js

@@ -55,8 +55,10 @@ _axios.interceptors.response.use(
       }, 100);
     }
     if(data.Ret===408){//token失效
-      wx.miniProgram.switchTab('/pages/index/index')
       Toast(data.Msg)
+      setTimeout(() => {
+        wx.miniProgram.switchTab({url:'/pages/user/index'})
+      }, 1000);
     }
     if(data.Ret===403){
       setTimeout(() => {

+ 27 - 27
src/views/report/Detail.vue

@@ -8,22 +8,22 @@ import apiUser from '@/api/modules/user'
 const route = useRoute()
 
 // 获取系统配置
-let systemConfig=null
-function getSystemConfig(){
-  apiCommon.systemConfig().then(res=>{
-    if(res.Ret===200){
-      systemConfig=res.Data
+let systemConfig = null
+function getSystemConfig() {
+  apiCommon.systemConfig().then(res => {
+    if (res.Ret === 200) {
+      systemConfig = res.Data
     }
   })
 }
 getSystemConfig()
 
 // 获取用户信息
-let userInfo=null
-function getUserInfo(){
-  apiUser.userInfo().then(res=>{
-    if(res.Ret===200){
-      userInfo=res.Data
+let userInfo = null
+function getUserInfo() {
+  apiUser.userInfo().then(res => {
+    if (res.Ret === 200) {
+      userInfo = res.Data
     }
   })
 }
@@ -46,7 +46,7 @@ async function getReportInfo() {
     reportCollected.value = res.Data.IsCollect || false
     if (res.Data.Status === 4) {
       formatIframeData()
-    }else{//无权限
+    } else {//无权限
       reportContent.value = reportInfo.value.ContentSub
     }
     nextTick(() => {
@@ -96,15 +96,15 @@ onBeforeUnmount(() => {
 
 // 拨打电话
 function handleCallPhone() {
-  let tel=''
-  if(reportStatus.value===3){
+  let tel = ''
+  if (reportStatus.value === 3) {
     systemConfig.forEach(item => {
-      if(item.ConfKey==='ServicePhone'){
-        tel=item.ConfVal
+      if (item.ConfKey === 'ServicePhone') {
+        tel = item.ConfVal
       }
     });
-  }else{
-    tel=userInfo.SellerPhone
+  } else {
+    tel = userInfo.SellerPhone
   }
 
   var phoneLink = 'tel:' + tel;
@@ -119,9 +119,9 @@ function handleCallPhone() {
 
 // 点击收藏
 async function handleCollect() {
-  const res = reportCollected.value ? apiReport.reportCollectCancel({ ReportId: Number(reportId) }) : await apiReport.reportCollect({ ReportId: Number(reportId) })
+  const res = reportCollected.value ? await apiReport.reportCollectCancel({ ReportId: Number(reportId) }) : await apiReport.reportCollect({ ReportId: Number(reportId) })
   if (res.Ret === 200) {
-    Message('success', reportCollected.value ? '取消收藏成功' : '收藏成功')
+    Message.success(reportCollected.value ? '取消收藏成功' : '收藏成功')
     reportCollected.value = !reportCollected.value
   }
 }
@@ -395,30 +395,30 @@ onUnmounted(() => {
         height: 18px !important;
       }
     }
-    .right-fix-box{
+    .right-fix-box {
       right: 17px;
       bottom: 65px;
-      .item{
+      .item {
         margin-top: 5px;
       }
-      .back-top-img{
+      .back-top-img {
         width: 50px;
         height: 50px;
       }
-      .collect-icon{
+      .collect-icon {
         width: 50px;
         height: 50px;
       }
     }
   }
-  .no-auth-wrap{
-    .opcity-box{
+  .no-auth-wrap {
+    .opcity-box {
       height: 65px;
     }
-    .content-box{
+    .content-box {
       padding-bottom: 100px;
     }
-    .icon{
+    .icon {
       width: 100px;
       height: 100px;
     }