|
@@ -1,10 +1,11 @@
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, onMounted } from "vue";
|
|
|
|
|
|
+import { ref, } from "vue";
|
|
import { apiReportDetail, apiRddpShareImg, } from '@/api/hzyb/report'
|
|
import { apiReportDetail, apiRddpShareImg, } from '@/api/hzyb/report'
|
|
import { apiApplyPermission, apiUserInfo } from '@/api/hzyb/user'
|
|
import { apiApplyPermission, apiUserInfo } from '@/api/hzyb/user'
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
import reportCancel from './components/reportCancel.vue'
|
|
import reportCancel from './components/reportCancel.vue'
|
|
|
|
+import {Dialog,Popup} from 'vant'
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
|
|
|
@@ -89,6 +90,50 @@ async function getReportDetail() {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const pupData=ref({
|
|
|
|
+ show:false,
|
|
|
|
+ content:'',//弹窗html字符串
|
|
|
|
+})
|
|
|
|
+// 发起申请
|
|
|
|
+async function handleGoApply(){
|
|
|
|
+ if(userInfo.value.is_bind===0){
|
|
|
|
+ Dialog.confirm({
|
|
|
|
+ title:'温馨提示',
|
|
|
|
+ message:'为了优化您的用户体验,\n 请登录后查看更多信息!',
|
|
|
|
+ confirmButtonText:'去登录',
|
|
|
|
+ confirmButtonColor:'#E6B77D',
|
|
|
|
+ cancelButtonColor:'#666'
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ wx.miniProgram.reLaunch({url:'/pages/login'})
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(reportInfo.value.permission_check.type=='apply'){
|
|
|
|
+ if(reportInfo.value.permission_check.customer_info.has_apply){// 已经申请过
|
|
|
|
+ pupData.value.show=true
|
|
|
|
+ pupData.value.content=`<p>您已提交过申请,请耐心等待</p>`
|
|
|
|
+ }else{
|
|
|
|
+ if(!reportInfo.value.permission_check.customer_info.status||reportInfo.value.permission_check.customer_info.status!='流失'||reportInfo.value.permission_check.customer_info.status!='关闭'){
|
|
|
|
+ wx.miniProgram.redirectTo({
|
|
|
|
+ url:"/pages-applyPermission/applyPermission?source=4&from_page=报告详情"
|
|
|
|
+ })
|
|
|
|
+ }else{//主动调一次申请权限接口
|
|
|
|
+ const res=await apiApplyPermission({
|
|
|
|
+ company_name:reportInfo.value.permission_check.customer_info.company_name,
|
|
|
|
+ real_name:reportInfo.value.permission_check.customer_info.name,
|
|
|
|
+ source:4,
|
|
|
|
+ from_page:'报告详情'
|
|
|
|
+ })
|
|
|
|
+ if(res.code===200){
|
|
|
|
+ pupData.value.show=true
|
|
|
|
+ pupData.value.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
|
|
|
|
+ getReportDetail()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
function initPage() {
|
|
function initPage() {
|
|
@@ -141,6 +186,17 @@ initPage()
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 申请提示弹窗 -->
|
|
|
|
+ <Popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
|
|
|
|
+ <div class="global-pup">
|
|
|
|
+ <div class="content">
|
|
|
|
+ <div v-html="pupData.content"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex bot">
|
|
|
|
+ <div @click="pupData.show=false">知道了</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </Popup>
|
|
<reportCancel v-if="isReportPublishCancel" />
|
|
<reportCancel v-if="isReportPublishCancel" />
|
|
</template>
|
|
</template>
|
|
|
|
|