yuanmingze hai 2 meses
pai
achega
bcd21cbdea

+ 2 - 2
src/pages-auth/settlement-channel-sign/index.vue

@@ -450,8 +450,8 @@ const certFn = async () => {
 
   const res = await batchChannelCertApi(data)
 
-  if (res.code !== 0) {
-    showToast(res.msg || '签约失败')
+  if (res.code !== 0 || res.data.commonCertStatus === 'FAIL_SIGN') {
+    showToast(res.msg || res.data.errMsg || '签约失败')
     return
   }
 

+ 63 - 0
src/pages-common/web-view/index.vue

@@ -0,0 +1,63 @@
+<template>
+  <view class="web-view-page">
+    <web-view v-if="webViewUrl" :src="webViewUrl" />
+  </view>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+
+import { onLoad } from '@dcloudio/uni-app'
+
+interface PageQuery {
+  url?: string
+  title?: string
+}
+
+const DEFAULT_TITLE = '详情'
+
+const webViewUrl = ref('')
+
+const safeDecodeURIComponent = (value: string): string => {
+  try {
+    return decodeURIComponent(value)
+  } catch (error) {
+    console.error('decodeURIComponent error:', error)
+    return value
+  }
+}
+
+const setPageTitle = (title?: string): void => {
+  const pageTitle = title ? safeDecodeURIComponent(title) : DEFAULT_TITLE
+
+  uni.setNavigationBarTitle({
+    title: pageTitle,
+  })
+}
+
+onLoad((query: PageQuery) => {
+  setPageTitle(query?.title)
+
+  if (!query?.url) {
+    uni.showToast({
+      title: '链接地址不存在',
+      icon: 'none',
+    })
+
+    uni.navigateBack({
+      delta: 1,
+    })
+
+    return
+  }
+
+  webViewUrl.value = safeDecodeURIComponent(query.url)
+})
+</script>
+
+<style lang="scss" scoped>
+.web-view-page {
+  width: 100%;
+  height: 100vh;
+}
+</style>

+ 7 - 0
src/pages.json

@@ -50,6 +50,13 @@
             "navigationBarTitleText": "签名",
             "navigationStyle": "default"
           }
+        },
+        {
+          "path": "web-view/index",
+          "style": {
+            "navigationBarTitleText": "web",
+            "navigationStyle": "default"
+          }
         }
       ]
     },

+ 33 - 2
src/pages/mine/index.vue

@@ -140,7 +140,11 @@
             <view class="common-grid-text">消息通知</view>
           </view>
 
-          <view class="common-grid-item common-grid-item-osais">
+          <view
+            class="common-grid-item common-grid-item-osais"
+            v-if="showOSAIS"
+            @click.stop="goOSAIS"
+          >
             <image
               class="common-grid-icon"
               src="https://yy-cloud-oss-public.oss-cn-beijing.aliyuncs.com/image/osais-logo.png"
@@ -171,7 +175,10 @@ import { computed, ref } from 'vue'
 
 import { onShow } from '@dcloudio/uni-app'
 
-import { getInternalMsgCountUnreadApi } from '@/services/modules/mine/common'
+import {
+  getInternalMsgCountUnreadApi,
+  taxLocationEntranceApi,
+} from '@/services/modules/mine/common'
 
 import { useUserStore } from '@/stores/modules/user'
 
@@ -187,6 +194,11 @@ const isLoggedIn = computed(() => userStore.isLoggedIn)
 const currentUserInfo = computed(() => userStore.currentUserInfo)
 const isBlacklisted = computed(() => userStore.isBlacklisted)
 
+const showOSAIS = computed(() => {
+  const certList = currentUserInfo.value?.certList || []
+  return certList.some((item) => item.gigType === 'OSAIS' && item.commonCertStatus === 'CERT')
+})
+
 const hasUnreadNotification = ref(false)
 const companyList = ref<{ name: string; color: string }[]>([])
 const handleCompanyShow = ref(false)
@@ -250,6 +262,25 @@ const navigateTo = (path?: string) => {
   })
 }
 
+const goOSAIS = async () => {
+  if (!checkBeforeNavigate()) return
+  const certList = currentUserInfo.value?.certList || []
+  const curr = certList.find((item) => item.gigType === 'OSAIS' && item.commonCertStatus === 'CERT')
+  if (!curr) return
+
+  const res = await taxLocationEntranceApi(curr.subjectLocation)
+  if (res.code === 0 && res.data) {
+    uni.navigateTo({
+      url: `/pages-common/web-view/index?url=${encodeURIComponent(res.data)}&title=奥塞斯`,
+    })
+  } else {
+    uni.showToast({
+      title: '获取奥塞斯入口失败',
+      icon: 'none',
+    })
+  }
+}
+
 const getRolesName = (roles: number[]) => {
   const role = roles?.[0] || 0
   const roleItem = rolesList.find((item) => item.value === role)

+ 6 - 0
src/services/modules/mine/common/index.ts

@@ -30,3 +30,9 @@ export const getInternalMsgCountUnreadApi = () => {
     sendType: 2,
   })
 }
+
+export const taxLocationEntranceApi = (subjectLocation: string) => {
+  return http.get<string>('/admin/user-sign-cert/sign/tax-location-entrance', {
+    subjectLocation: subjectLocation,
+  })
+}