Jelajahi Sumber

feature(入室申请):添加上传缴费单、审核功能,工作流添加审核功能

wanglj 8 bulan lalu
induk
melakukan
d2c75a8868

+ 0 - 2
components.d.ts

@@ -8,7 +8,6 @@ export {}
 declare module 'vue' {
   export interface GlobalComponents {
     CustomForm: typeof import('./src/components/CustomForm.vue')['default']
-    Flow: typeof import('./src/components/Flow.vue')['default']
     FlowTable: typeof import('./src/components/FlowTable.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
@@ -26,7 +25,6 @@ declare module 'vue' {
     VanDialog: typeof import('vant/es')['Dialog']
     VanEmpty: typeof import('vant/es')['Empty']
     VanField: typeof import('vant/es')['Field']
-    VanFloatingBubble: typeof import('vant/es')['FloatingBubble']
     VanForm: typeof import('vant/es')['Form']
     VanIcon: typeof import('vant/es')['Icon']
     VanImage: typeof import('vant/es')['Image']

+ 3 - 3
src/layout/entry.vue

@@ -9,9 +9,9 @@
 <template>
   <router-view></router-view>
   <van-tabbar route :placeholder="true">
-    <van-tabbar-item replace to="/entry" icon="send-gift-o">入室申请</van-tabbar-item>
-    <van-tabbar-item replace to="/entry/mine" icon="coupon-o">我的入室</van-tabbar-item>
-    <van-tabbar-item replace to="/entry/appoint" icon="cluster-o">入室预约</van-tabbar-item>
+    <van-tabbar-item replace to="/entry/add" icon="send-gift-o">入室申请</van-tabbar-item>
+    <van-tabbar-item replace to="/entry" icon="coupon-o">我的入室</van-tabbar-item>
+    <!-- <van-tabbar-item replace to="/entry/appoint" icon="cluster-o">入室预约</van-tabbar-item> -->
   </van-tabbar>
 </template>
 

+ 18 - 19
src/router.ts

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-10 11:40:15
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-03-28 11:33:50
+ * @LastEditTime: 2025-04-16 10:58:21
  * @FilePath: \vue3-ts\src\router.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -98,7 +98,22 @@ const routes = [
       title: '仪器预约'
     }
   },
-
+  {
+    name: 'approvalDetail',
+    path: '/todo/detail',
+    component: () => import('/@/view/todo/detail.vue'),
+    meta: {
+      title: '审批详情'
+    }
+  },
+  {
+    name: 'entryDetail',
+    path: '/entry/detail',
+    component: () => import('/@/view/entry/detail.vue'),
+    meta: {
+      title: '入室详情'
+    }
+  },
   {
     path: '/',
     redirect: '/login',
@@ -128,14 +143,6 @@ const routes = [
           title: '待办事项'
         }
       },
-      {
-        name: 'approvalDetail',
-        path: '/todo/detail',
-        component: () => import('/@/view/todo/detail.vue'),
-        meta: {
-          title: '审批详情'
-        }
-      },
       {
         name: 'notice',
         path: '/notice',
@@ -214,15 +221,7 @@ const routes = [
         meta: {
           title: '新增入室申请'
         }
-      },
-      {
-        name: 'entryDetail',
-        path: '/entry/detail',
-        component: () => import('/@/view/entry/detail.vue'),
-        meta: {
-          title: '入室详情'
-        }
-      },
+      }
     ]
   },
   {

+ 2 - 1
src/stores/userInfo.ts

@@ -141,7 +141,8 @@ export const useUserInfo = defineStore('userInfo', {
         timestamp: this.sdkConfig.timestamp, // 必填,生成签名的时间戳
         nonceStr: this.sdkConfig.nonce_str, // 必填,生成签名的随机串
         signature: this.sdkConfig.signature, // 必填,签名
-        jsApiList: ['scanQRCode', 'chooseImage'] // 必填,需要使用的JS接口列表
+        jsApiList: ['scanQRCode', 'chooseImage'], // 必填,需要使用的JS接口列表
+        openTagList: ['wx-open-subscribe']
       })
       // wx.ready(function () {
       //   showDialog({

+ 34 - 0
src/utils/upload.ts

@@ -0,0 +1,34 @@
+/*
+ * @Author: wanglj wanglijie@dashoo.cn
+ * @Date: 2025-04-09 09:38:40
+ * @LastEditors: wanglj wanglijie@dashoo.cn
+ * @LastEditTime: 2025-04-11 14:57:55
+ * @FilePath: \labsop_scientific_h5\src\utils\upload.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+import axios from 'axios'
+import { Local } from './storage'
+export function handleUpload(file: File) {
+  return new Promise((resolve, reject) => {
+    const formData = new FormData()
+    formData.append('file', file)
+    console.log(formData, 'formData')
+    axios
+      .post(import.meta.env.VITE_UPLOAD, formData, {
+        headers: {
+          'Content-Type': 'multipart/form-data',
+          'Tenant': Local.get('Tenant')
+        }
+      })
+      .then((res) => {
+        if (res?.data.Code === 200) {
+          resolve(res.data.Data)
+        } else {
+          reject('上传失败')
+        }
+      })
+      .catch((err) => {
+        reject(err)
+      })
+  })
+}

+ 179 - 2
src/view/entry/detail.vue

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-29 14:15:09
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-03-29 14:51:56
+ * @LastEditTime: 2025-04-16 15:25:17
  * @FilePath: \labsop_h5\src\view\entry\detail.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -99,8 +99,69 @@
         <h4>审批记录</h4>
         <FlowTable :id="state.form.id" :businessCode="`${state.form.id}`" defCode="plat_platform_appoint" />
       </div>
+      <div class="card" v-if="state.form.appointStatus === '20'">
+        <van-form class="mb20" ref="formRef" required="auto">
+          <van-cell-group>
+            <van-field
+              v-model="state.auditForm.approveDesc"
+              label="审批意见"
+              placeholder="请输入审批意见"
+              :rules="[{ required: true, message: '请输入审批意见' }]"
+              rows="3"
+              type="textarea"
+            />
+            <van-field
+              v-model="state.auditForm.approveResult"
+              label="审批结果"
+              placeholder="请选择审批结果"
+              :rules="[{ required: true, message: '请选择审批结果' }]"
+            >
+              <template #input>
+                <van-radio-group v-model="state.auditForm.approveResult" direction="horizontal">
+                  <van-radio name="10">通过</van-radio>
+                  <van-radio name="20">不通过</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+          </van-cell-group>
+        </van-form>
+      </div>
     </div>
+    <van-action-bar v-if="state.form.appointStatus === '10'" placeholder>
+      <van-action-bar-icon icon="wap-home-o" text="首页" @click="onRouterPush('/home')" />
+      <van-action-bar-icon icon="send-gift-o" text="入室申请" @click="onRouterPush('/entry')" />
+      <van-action-bar-button class="w100" type="primary" text="上传缴费单" @click="openUpload()" />
+    </van-action-bar>
+    <van-action-bar v-else-if="state.form.appointStatus === '20'" placeholder>
+      <van-action-bar-icon icon="wap-home-o" text="首页" @click="onRouterPush('/home')" />
+      <van-action-bar-icon icon="send-gift-o" text="入室申请" @click="onRouterPush('/entry')" />
+      <van-action-bar-button class="w100" type="primary" text="审核" @click="onAudit()" />
+    </van-action-bar>
   </div>
+  <van-popup v-model:show="showBottom" round closeable position="bottom" :style="{ height: '90vh' }">
+    <template #default>
+      <div class="upload-container">
+        <div class="content">
+          <h4>上传须知</h4>
+          <p>
+            根据遵义医科大学附属医院临床医学公共实验中心要求,申请入室人员需要上传缴费单:通过审批后,点击缴费单按钮下载缴费单模板,打印并带到财务处完成缴费和确认后经财务盖章,将盖章的单据拍照上传。
+          </p>
+          <h4>信息上传</h4>
+          <div class="file-card">
+            <h4>缴费单</h4>
+            <van-uploader v-model="state.uploadForm.billList" :after-read="afterRead" preview-size="60" :preview-full-image="false" :max-count="1" />
+          </div>
+          <div class="file-card">
+            <h4>其它附件</h4>
+            <van-uploader v-model="state.uploadForm.fileList" :after-read="afterRead" preview-size="60" :preview-full-image="false" multiple />
+          </div>
+        </div>
+        <footer>
+          <van-button type="primary" class="w100" round @click="onSubmit">提交</van-button>
+        </footer>
+      </div>
+    </template>
+  </van-popup>
 </template>
 
 <script lang="ts" setup>
@@ -112,6 +173,8 @@
   import { getDictLabel } from '/@/utils/other'
   import { usePlatformAppointApi } from '/@/api/platform/appoint'
   import { useFlowApi } from '/@/api/execution/flow'
+  import { handleUpload } from '/@/utils/upload'
+  import { showNotify } from 'vant'
   const FlowTable = defineAsyncComponent(() => import('/@/components/FlowTable.vue'))
   const platformAppointApi = usePlatformAppointApi()
   const flowApi = useFlowApi()
@@ -120,6 +183,8 @@
   const dictApi = useDictApi()
   const apprList = ref<any[]>([])
   const userTypeList = ref(<RowDicDataType[]>[])
+  const showBottom = ref(false)
+  const formRef = ref()
   const state = reactive({
     detailsLoading: false,
     form: {
@@ -150,7 +215,18 @@
       molecularTime: null,
       platOtherNeed: '',
       createdName: '',
-      createdTime: ''
+      createdTime: '',
+      approveStatus: '',
+      appointStatus: ''
+    },
+    uploadForm: {
+      billList: [] as any[],
+      fileList: [] as any[]
+    },
+    auditForm: {
+      id: 0,
+      approveResult: '',
+      approveDesc: ''
     },
     queryParams: {
       pageNum: 1,
@@ -173,6 +249,74 @@
       state.form = res.data
     }
   }
+  const onRouterPush = (val: string) => {
+    router.push(val)
+  }
+  const openUpload = () => {
+    showBottom.value = true
+  }
+  const afterRead = async (files: any) => {
+    if (files.length) {
+      for (const file of files) {
+        file.status = 'uploading'
+        const [err, res]: ToResponse = await to(handleUpload(file.file))
+        if (err) {
+          file.status = 'failed'
+          return
+        }
+        file.status = 'success'
+        file.url = res
+        file.name = file.file.name
+      }
+    } else {
+      const file = files
+      file.status = 'uploading'
+      const [err, res]: ToResponse = await to(handleUpload(file.file))
+      if (err) {
+        file.status = 'failed'
+        return
+      }
+      file.status = 'success'
+      file.url = res
+      file.name = file.file.name
+    }
+  }
+  // 提交
+  const onSubmit = async () => {
+    const params = JSON.parse(JSON.stringify(state.uploadForm))
+    params.fileList = [...params.billList, ...params.fileList].map((item) => {
+      return {
+        fileName: item.name,
+        fileUrl: item.url
+      }
+    })
+    delete params.billList
+    params.appointId = state.form.id
+    const [err]: ToResponse = await to(platformAppointApi.createFile(params))
+    if (err) return
+    showNotify({
+      type: 'success',
+      message: '操作成功'
+    })
+    router.push({
+      path: '/entry'
+    })
+  }
+  const onAudit = async () => {
+    const [errValid] = await to(formRef.value.validate())
+    if (errValid) return
+    const params = JSON.parse(JSON.stringify(state.auditForm))
+    params.id = state.form.id
+    const [err]: ToResponse = await to(platformAppointApi.updateById(params))
+    if (err) return
+    showNotify({
+      type: 'success',
+      message: '操作成功'
+    })
+    router.push({
+      path: '/entry'
+    })
+  }
   onMounted(() => {
     const id = route.query.id ? +route.query.id : 0
     getDicts()
@@ -366,4 +510,37 @@
       border-top: 1px solid #f7f8fa;
     }
   }
+  .upload-container {
+    height: calc(100% - 40px);
+    padding: 20px 10px;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    .content {
+      flex: 1;
+      overflow-y: auto;
+      > h4 {
+        height: 18px;
+        line-height: 18px;
+        margin: 10px 0;
+        display: flex;
+        align-items: center;
+        &::before {
+          display: inline-block;
+          content: '';
+          width: 3px;
+          height: 18px;
+          background-color: #1c9bfd;
+          margin-right: 4px;
+          vertical-align: middle;
+        }
+      }
+      .file-card {
+        background: #fff;
+        h4 {
+          margin-bottom: 4px;
+        }
+      }
+    }
+  }
 </style>

+ 11 - 2
src/view/entry/index.vue

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-11 18:02:10
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-03-29 14:16:50
+ * @LastEditTime: 2025-04-16 16:19:33
  * @FilePath: \vant-demo-master\vant\vue3-ts\src\view\login\index.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -24,6 +24,15 @@
                 <van-tag v-else-if="item.approveStatus == 20" type="primary">审批中</van-tag>
                 <van-tag v-else-if="item.approveStatus == 30" type="success">审批通过</van-tag>
                 <van-tag v-else-if="item.approveStatus == 40" type="danger">审批退回</van-tag>
+                <!-- 05 待确认 10 待上传 20 待审核 30 已驳回 35 已撤回 40 待分配 50 可入室 60 已出室 -->
+                <van-tag v-if="item.appointStatus == '05'" class="ml4">待确认</van-tag>
+                <van-tag v-else-if="item.appointStatus == '10'" class="ml4">待上传</van-tag>
+                <van-tag v-else-if="item.appointStatus == '20'" type="primary" class="ml4">待审核</van-tag>
+                <van-tag v-else-if="item.appointStatus == '30'" type="danger" class="ml4">已驳回</van-tag>
+                <van-tag v-else-if="item.appointStatus == '35'" type="warning" class="ml4">已撤回</van-tag>
+                <van-tag v-else-if="item.appointStatus == '40'" class="ml4">待分配</van-tag>
+                <van-tag v-else-if="item.appointStatus == '50'" type="success" class="ml4">可入室</van-tag>
+                <van-tag v-else-if="item.appointStatus == '60'" class="ml4">已出室</van-tag>
               </header>
               <p class="inst-title">
                 <span>课题名称</span>
@@ -54,7 +63,7 @@
         </van-cell>
       </van-list>
     </div>
-    <van-floating-bubble v-model:offset="offset" icon="plus" @click="onClick" axis="y" />
+    <!-- <van-floating-bubble v-model:offset="offset" icon="plus" @click="onClick" axis="y" /> -->
   </div>
 </template>
 

+ 86 - 10
src/view/todo/detail.vue

@@ -2,7 +2,7 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-11 18:02:10
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-03-29 16:15:47
+ * @LastEditTime: 2025-04-16 14:02:44
  * @FilePath: \vant-demo-master\vant\vue3-ts\src\view\login\index.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -14,20 +14,51 @@
     </header>
     <h4>审批信息</h4>
     <van-cell-group>
-      <van-cell title="审批名称" :value="state.form.instTitle" />
-      <van-cell title="审批编号" :value="state.form.instTitle" />
-      <van-cell title="审批类型" :value="state.form.defName" />
-      <van-cell title="申请人" :value="state.form.startUserName" />
-      <van-cell title="申请时间" :value="state.form.startTime" />
+      <van-cell title="审批名称" title-class="cell-title" :value="state.form.instTitle" />
+      <van-cell title="审批编号" title-class="cell-title" :value="state.form.instTitle" />
+      <van-cell title="审批类型" title-class="cell-title" :value="state.form.defName" />
+      <van-cell title="申请人" title-class="cell-title" :value="state.form.startUserName" />
+      <van-cell title="申请时间" title-class="cell-title" :value="state.form.startTime" />
     </van-cell-group>
-    <h4>附件信息</h4>
+    <!-- <h4>附件信息</h4>
     <van-cell-group>
       <van-cell title="文件名称" :value="state.form.instTitle" />
       <van-cell title="文件类型" :value="state.form.instTitle" />
       <van-cell title="文件" :value="state.form.defName" />
-    </van-cell-group>
+    </van-cell-group> -->
     <h4>审批记录</h4>
     <FlowTable :id="state.form.id" :businessCode="state.form.businessCode" :defCode="state.form.defCode" />
+    <h4 v-if="state.type === 'approval'">审批意见</h4>
+    <van-form v-if="state.type === 'approval'" class="mb20" ref="formRef" required="auto">
+      <van-cell-group>
+        <van-field
+          v-model="state.approvalForm.approveOpinion"
+          label="审批意见"
+          placeholder="请输入审批意见"
+          :rules="[{ required: true, message: '请输入审批意见' }]"
+          rows="3"
+          type="textarea"
+        />
+        <van-field
+          v-model="state.approvalForm.approveResult"
+          label="审批结果"
+          placeholder="请选择审批结果"
+          :rules="[{ required: true, message: '请选择审批结果' }]"
+        >
+          <template #input>
+            <van-radio-group v-model="state.approvalForm.approveResult" direction="horizontal">
+              <van-radio name="pass">通过</van-radio>
+              <van-radio name="rejection">拒绝</van-radio>
+            </van-radio-group>
+          </template>
+        </van-field>
+      </van-cell-group>
+    </van-form>
+    <van-action-bar v-if="state.type === 'approval'" placeholder>
+      <van-action-bar-icon icon="wap-home-o" text="首页" @click="onRouterPush('/home')" />
+      <van-action-bar-icon icon="cluster-o" text="待办事项" @click="onRouterPush('/todo')" />
+      <van-action-bar-button class="w100" type="primary" text="提交" @click="onSave" />
+    </van-action-bar>
   </div>
 </template>
 
@@ -38,13 +69,16 @@
   import { useRouter, useRoute } from 'vue-router'
   import { useExecutionApi } from '/@/api/execution'
   import { useFlowApi } from '/@/api/execution/flow'
+import { showNotify } from 'vant'
   const FlowTable = defineAsyncComponent(() => import('/@/components/FlowTable.vue'))
   const executionApi = useExecutionApi()
   const flowApi = useFlowApi()
   const router = useRouter()
   const route = useRoute()
   const apprList = ref<any[]>([])
+  const formRef = ref()
   const state = reactive({
+    type: 'approval',
     form: {
       id: 0,
       defId: 0,
@@ -72,6 +106,10 @@
       formData: {},
       processTask: [],
       businessCode: ''
+    },
+    approvalForm: {
+      approveOpinion: '',
+      approveResult: 'pass'
     }
   })
   const onClickRight = () => {
@@ -93,9 +131,41 @@
     const arr = res?.data?.nodes || []
     apprList.value = arr
   }
+  const init = async (id: number) => {
+    const [err, res]: ToResponse = await to(executionApi.getInstanceById({ id }))
+    if (err) return
+    if (res?.data) {
+      state.form = res.data
+    }
+  }
+  const onRouterPush = (val: string, params?: any) => {
+    router.push({
+      path: val,
+      query: { ...params }
+    })
+  }
+  const onSave = async () => {
+    const [errValid] = await to(formRef.value.validate())
+    if (errValid) return
+    const params = {
+      taskId: state.form.taskId,
+      result: state.approvalForm.approveResult,
+      opinion: state.approvalForm.approveOpinion
+    }
+    const [err]: ToResponse = await to(executionApi.approve(params))
+    if (err) return
+    showNotify({
+      type: 'success',
+      message: '审批成功'
+    })
+    router.push({
+      path: '/todo'
+    })
+  }
   onMounted(() => {
-    state.form.id = route.query.id ? +route.query.id : 0
-    getFlowInstance()
+    const id = route.query.id ? +route.query.id : 0
+    state.type = route.query.type.toString()
+    init(id)
   })
 </script>
 
@@ -127,5 +197,11 @@
       justify-content: space-between;
       color: #333;
     }
+    :deep(.cell-title) {
+      flex: 0 0 80px;
+    }
+    .van-action-bar {
+      z-index: 2;
+    }
   }
 </style>

+ 24 - 11
src/view/todo/index.vue

@@ -2,13 +2,19 @@
  * @Author: wanglj wanglijie@dashoo.cn
  * @Date: 2025-03-11 18:02:10
  * @LastEditors: wanglj wanglijie@dashoo.cn
- * @LastEditTime: 2025-03-24 14:16:13
+ * @LastEditTime: 2025-04-16 14:03:07
  * @FilePath: \vant-demo-master\vant\vue3-ts\src\view\login\index.vue
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
 <template>
   <div class="app-container">
-    <van-list v-model:loading="state.loading" :finished="state.finished" finished-text="没有更多了" @load="onLoad">
+    <van-tabs v-model:active="state.status" @change="changeType">
+      <van-tab title="待我审批" name="approval"></van-tab>
+      <van-tab title="我发起的" name="start"></van-tab>
+      <van-tab title="审批历史" name="history"></van-tab>
+    </van-tabs>
+    <div class="list-container">
+      <van-list v-model:loading="state.loading" :finished="state.finished" finished-text="没有更多了" @load="onLoad">
       <van-cell v-for="item in state.list" :key="item" @click="toDetail(item.id)">
         <template #default>
           <div class="list">
@@ -28,6 +34,7 @@
         </template>
       </van-cell>
     </van-list>
+    </div>
   </div>
 </template>
 
@@ -43,8 +50,9 @@
   const router = useRouter()
   const route = useRoute()
   const state = reactive({
+    status: 'approval',
     queryParams: {
-      type: 'approval',
+      platformId: 1000103,
       pageNum: 1,
       pageSize: 10
     },
@@ -56,13 +64,21 @@
     router.go(-1)
   }
   const changeType = (str: string) => {
-    state.queryParams.type = str
+    state.list = []
     state.queryParams.pageNum = 1
     onLoad()
   }
   const onLoad = async () => {
-    const post = state.queryParams.type == 'approval' ? executionApi.getOwApproveList : newsApi.getNoticeList
-    const [err, res]: ToResponse = await to(post({ platformId: 1000103, noPage: true }))
+    let [err, res]: ToResponse = [null, undefined]
+    const tabs = state.status
+    if (tabs == 'start') {
+      ;[err, res] = await to(executionApi.getOwStartList(state.queryParams))
+    } else if (tabs == 'approval') {
+      ;[err, res] = await to(executionApi.getOwApproveList(state.queryParams))
+    } else if (tabs == 'history') {
+      // 审批历史
+      ;[err, res] = await to(executionApi.getOwnApprovedList(state.queryParams))
+    }
     if (err) return
     const list = res?.data?.list || []
     for(const item of list) {
@@ -78,15 +94,12 @@
     router.push({
       path: '/todo/detail',
       query: {
-        id
+        id,
+        type: state.status
       }
     })
   }
   onMounted(() => {
-    const type = route.query.type
-    if(type) {
-      state.queryParams.type = type as string
-    }
     onLoad()
   })
 </script>

+ 9 - 1
src/view/user/index.vue

@@ -50,7 +50,12 @@
       </div>
     </div>
     <footer>
-      <van-button class="w100" color="#1cb4fd" plain @click="onRouterPush('/user/password')">修改密码</van-button>
+      <!-- <wx-open-subscribe template="-pVpM6TH1oz1cZntEhGzQjmMMODF9tLLzh_1yjjWYSk" @success="handleSubscribe">
+        <component :is="'script'" type="text/wxtag-template">
+          <button class="w100 ">订阅</button>
+        </component>
+      </wx-open-subscribe> -->
+      <van-button class="w100 mt10" color="#1cb4fd" plain @click="onRouterPush('/user/password')">修改密码</van-button>
       <van-button class="w100 mt10" @click="signOut" type="primary">切换账号</van-button>
     </footer>
   </div>
@@ -76,6 +81,9 @@
       window.location.reload()
     })
   }
+  const handleSubscribe = (errMsg: any, subscribeDetails: any) => {
+    console.log(errMsg, subscribeDetails);
+  }
 </script>
 
 <style lang="scss" scoped>