Quellcode durchsuchen

Merge branch 'ch/dongwu1.3' of eta_mini/eta_mini_h5 into master_dw

leichen vor 3 Monaten
Ursprung
Commit
e0bf04193f
3 geänderte Dateien mit 184 neuen und 26 gelöschten Zeilen
  1. 5 1
      src/api/modules/user.js
  2. 91 13
      src/views/report/Detail.vue
  3. 88 12
      src/views/report/PDF.vue

+ 5 - 1
src/api/modules/user.js

@@ -9,6 +9,10 @@ export default{
   //用户绑定公众号
   userBindWxOfficial:params=>{
     return post('/wechat/subscribe',params)
+  },
+
+  // 申请认证
+  userApplyPermission:params=>{
+    return post('/user/apply/permission',params)
   }
-  
 }

+ 91 - 13
src/views/report/Detail.vue

@@ -127,16 +127,29 @@ function handleLoadContent(){
   renderContentList.value=renderContentList.value.concat(contentTotals.slice(page*pageSize,(page+1)*pageSize))
 }
 
+// 打电话按钮显示
+const callShow = ref(false)
+const phoneList = ref([])
+function handleCallShow() {
+  callShow.value = true
+  phoneList.value = userInfo.SellerDepartmentPhone || []
+  console.log(phoneList.value);
+  
+}
+function visiblechange(val) {
+  callShow.value = false
+}
+
 // 拨打电话
-function handleCallPhone() {
-  let tel = userInfo.SellerPhone
-  if (!tel) {
-    systemConfig.forEach(item => {
-      if (item.ConfKey === 'ServicePhone') {
-        tel = item.ConfVal
-      }
-    });
-  }
+function handleCallPhone(tel) {
+  visiblechange()
+  // if (!tel) {
+  //   systemConfig.forEach(item => {
+  //     if (item.ConfKey === 'ServicePhone') {
+  //       tel = item.ConfVal
+  //     }
+  //   });
+  // }
 
   var phoneLink = 'tel:' + tel;
   var link = document.createElement('a');
@@ -219,6 +232,22 @@ function handleGoLogin(){
   })
 }
 
+const isTips = ref(false)
+const tipsMsg = ref('')
+// 申请认证
+function handleApplyCertification() {
+  apiUser.userApplyPermission().then(res=>{
+    if(res.Ret===200){
+      isTips.value = true
+      tipsMsg.value = res.Msg
+    } else {
+      Message.error(res.Msg)
+    }
+  })
+}
+function handleTips () {
+  isTips.value = false
+}
 </script>
 
 <template>
@@ -324,21 +353,30 @@ function handleGoLogin(){
     <div class="content-box">
       <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
       <div class="text" v-if="reportStatus === 3">
-        您暂无权限查看,<br />请联系客服人员开通
+        您暂无权限查看,<br />请申请认证
       </div>
       <div class="text" v-if="reportStatus === 2">
-        您暂无该品种权限,<br />请联系销售人员开通!
+        您暂无该品种权限,<br />请联系客服人员开通!
       </div>
       <div class="text" v-if="reportStatus === 1">
-        您的权限已过期,<br />请联系销售人员开通!
+        您的权限已过期,<br />请联系客服人员开通!
       </div>
       <t-button
+        v-if="reportStatus !== 3"
         theme="primary"
         block
         style="width: 300px; margin: 30px auto"
-        @click="handleCallPhone"
+        @click="handleCallShow"
         >立即联系</t-button
       >
+      <t-button
+        v-else
+        theme="primary"
+        block
+        style="width: 300px; margin: 30px auto"
+        @click="handleApplyCertification"
+        >申请认证</t-button
+      >
     </div>
   </div>
   <!-- 未绑定 -->
@@ -360,6 +398,23 @@ function handleGoLogin(){
   </div>
   <!-- 免责声明 -->
   <disclaimers-wrap v-model:show="isShowMZSM" />
+  <t-dialog
+    :visible="isTips"
+    title="提示"
+    :content="tipsMsg"
+    confirm-btn="知道了"
+    @confirm="handleTips"
+  >
+  </t-dialog>
+  <t-popup
+    :visible="callShow"
+    placement="bottom"
+    @visiblechange="visiblechange"
+  > 
+    <div class="call-box">
+      <div class="phone-item" v-for="(item, index) in phoneList" :key="index" @click="handleCallPhone(item)">{{ item }}</div>
+    </div>
+  </t-popup>
 </template>
 
 <style lang="scss" scoped>
@@ -515,6 +570,18 @@ function handleGoLogin(){
     height: 200px;
   }
 }
+.call-box {
+  margin: 60px 0;
+  .phone-item {
+    font-size: var(--font-size-huge);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 100%;
+    height: 120px;
+  }
+}
+
 @media (max-width: 599px){
   .report-detail-page{
     .report-content-box{
@@ -616,5 +683,16 @@ function handleGoLogin(){
       height: 100px;
     }
   }
+  .call-box {
+    margin: 60px 0;
+    .phone-item {
+      font-size: 20px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 100%;
+      height: 120px;
+    }
+  }
 }
 </style>

+ 88 - 12
src/views/report/PDF.vue

@@ -58,17 +58,29 @@ async function getReportInfo() {
 }
 getReportInfo()
 
-
+// 打电话按钮显示
+const callShow = ref(false)
+const phoneList = ref([])
+function handleCallShow() {
+  callShow.value = true
+  phoneList.value = userInfo.SellerDepartmentPhone || []
+  console.log(phoneList.value);
+  
+}
+function visiblechange(val) {
+  callShow.value = false
+}
 // 拨打电话
-function handleCallPhone() {
-  let tel = userInfo.SellerPhone
-  if (!tel) {
-    systemConfig.forEach(item => {
-      if (item.ConfKey === 'ServicePhone') {
-        tel = item.ConfVal
-      }
-    });
-  }
+function handleCallPhone(tel) {
+  visiblechange()
+  // let tel = userInfo.SellerPhone
+  // if (!tel) {
+  //   systemConfig.forEach(item => {
+  //     if (item.ConfKey === 'ServicePhone') {
+  //       tel = item.ConfVal
+  //     }
+  //   });
+  // }
 
   var phoneLink = 'tel:' + tel;
   var link = document.createElement('a');
@@ -122,6 +134,22 @@ function handleGoLogin(){
     url:`/pages/login/index?redirectUrl=${redirectUrl}`
   })
 }
+const isTips = ref(false)
+const tipsMsg = ref('')
+// 申请认证
+function handleApplyCertification() {
+  apiUser.userApplyPermission().then(res=>{
+    if(res.Ret===200){
+      isTips.value = true
+      tipsMsg.value = res.Msg
+    } else {
+      Message.error(res.Msg)
+    }
+  })
+}
+function handleTips () {
+  isTips.value = false
+}
 
 </script>
 
@@ -166,7 +194,7 @@ function handleGoLogin(){
     <div class="content-box">
       <img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
       <div class="text" v-if="reportStatus === 3">
-        您暂无权限查看,<br />请联系客服人员开通
+        您暂无权限查看,<br />请申请认证
       </div>
       <div class="text" v-if="reportStatus === 2">
         您暂无该品种权限,<br />请联系销售人员开通!
@@ -175,12 +203,21 @@ function handleGoLogin(){
         您的权限已过期,<br />请联系销售人员开通!
       </div>
       <t-button
+        v-if="reportStatus !== 3"
         theme="primary"
         block
         style="width: 300px; margin: 30px auto"
-        @click="handleCallPhone"
+        @click="handleCallShow"
         >立即联系</t-button
       >
+      <t-button
+        v-else
+        theme="primary"
+        block
+        style="width: 300px; margin: 30px auto"
+        @click="handleApplyCertification"
+        >申请认证</t-button
+      >
     </div>
   </div>
   <!-- 未绑定 -->
@@ -202,6 +239,23 @@ function handleGoLogin(){
   </div>
   <!-- 免责声明 -->
   <disclaimers-wrap v-model:show="isShowMZSM" />
+  <t-dialog
+    :visible="isTips"
+    title="提示"
+    :content="tipsMsg"
+    confirm-btn="知道了"
+    @confirm="handleTips"
+  >
+  </t-dialog>
+  <t-popup
+    :visible="callShow"
+    placement="bottom"
+    @visiblechange="visiblechange"
+  > 
+    <div class="call-box">
+      <div class="phone-item" v-for="(item, index) in phoneList" :key="index" @click="handleCallPhone(item)">{{ item }}</div>
+    </div>
+  </t-popup>
 </template>
 
 <style lang="scss" scoped>
@@ -280,6 +334,17 @@ function handleGoLogin(){
     height: 200px;
   }
 }
+.call-box {
+  margin: 60px 0;
+  .phone-item {
+    font-size: var(--font-size-huge);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 100%;
+    height: 120px;
+  }
+}
 
 @media (min-width: 600px) {
   .report-detail-page {
@@ -325,6 +390,17 @@ function handleGoLogin(){
       height: 100px;
     }
   }
+  .call-box {
+    margin: 60px 0;
+    .phone-item {
+      font-size: 20px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 100%;
+      height: 120px;
+    }
+  }
 }
 
 .report-detail_hidden{