Commit 34e63552 authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/fix_pdf' into 'master'

fix: 电子保单回显方式改变、首页ui调整、缴费记录跳转问题

See merge request !139
parents 1a65888d fb5f9474
...@@ -8,13 +8,7 @@ ...@@ -8,13 +8,7 @@
> >
<cr-tabbar-item v-for="(item, index) in tabbarData" :key="item.name"> <cr-tabbar-item v-for="(item, index) in tabbarData" :key="item.name">
<div class="mongo-tabbar-item"> <div class="mongo-tabbar-item">
<svg-icon <img class="mongo-tabbar-item-svg" :src="index === activeIdx ? item.activeImg : item.img">
:icon-class="[index === activeIdx ? item.activeIcon : item.icon]"
:class-name="[
{ 'mongo-tabbar-item-svg_active': index === activeIdx },
'mongo-tabbar-item-svg'
]"
/>
<span class="mongo-tabbar-item-name">{{ item.name }}</span> <span class="mongo-tabbar-item-name">{{ item.name }}</span>
</div> </div>
</cr-tabbar-item> </cr-tabbar-item>
...@@ -23,31 +17,47 @@ ...@@ -23,31 +17,47 @@
<script> <script>
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from "vuex";
import homeImg from "@/assets/images/home/tab_home@2x.png";
import homeActiveImg from "@/assets/images/home/tab_home_active@2x.png";
import goodsImg from "@/assets/images/home/tab_product@2x.png";
import goodsActiveImg from "@/assets/images/home/tab_product_active@2x.png";
import consultantImg from "@/assets/images/home/tab_consultant@2x.png";
import consultantActiveImg from "@/assets/images/home/tab_consultant_active@2x.png";
import userImg from "@/assets/images/home/tab_user@2x.png";
import userActiveImg from "@/assets/images/home/tab_user_active@2x.png";
const tabbarData = [ const tabbarData = [
{ {
name: "首页", name: "首页",
path: "/home", path: "/home",
icon: "home", img: homeImg,
activeIcon: "home-active" activeImg: homeActiveImg
// icon: "home",
// activeIcon: "home-active"
}, },
{ {
name: "产品", name: "产品",
path: "/goods", path: "/goods",
icon: "product", img: goodsImg,
activeIcon: "product-active" activeImg: goodsActiveImg
// icon: "product",
// activeIcon: "product-active"
}, },
{ {
name: "顾问", name: "顾问",
path: "/consultant", path: "/consultant",
icon: "counselor", img: consultantImg,
activeIcon: "counselor-active" activeImg: consultantActiveImg
// icon: "counselor",
// activeIcon: "counselor-active"
}, },
{ {
name: "我的", name: "我的",
path: "/user", path: "/user",
icon: "user", img: userImg,
activeIcon: "user-active" activeImg: userActiveImg
// icon: "user",
// activeIcon: "user-active"
} }
]; ];
...@@ -97,10 +107,6 @@ export default { ...@@ -97,10 +107,6 @@ export default {
&-svg { &-svg {
width: 28px; width: 28px;
height: 28px; height: 28px;
display: inline-block;
&_active {
display: none;
}
} }
&-name { &-name {
font-size: 10px; font-size: 10px;
...@@ -113,12 +119,6 @@ export default { ...@@ -113,12 +119,6 @@ export default {
.mongo-tabbar-item-name { .mongo-tabbar-item-name {
color: #000000; color: #000000;
} }
.mongo-tabbar-item-svg {
display: none;
&_active {
display: inline-block;
}
}
} }
} }
</style> </style>
...@@ -146,22 +146,22 @@ ...@@ -146,22 +146,22 @@
border-radius: 14px; border-radius: 14px;
.Hc-card-question { .Hc-card-question {
margin: 31px 0 2px; margin: 24px 130px 11px 0;
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #242629; color: #242629;
line-height: 31px; line-height: 23px;
display: block; display: block;
position: relative; position: relative;
z-index: 2; z-index: 2;
} }
.Hc-card-result { .Hc-card-result {
margin-bottom: 21px; margin-bottom: 15px;
padding: 3px 0 2px; padding: 3px 0 2px;
width: 124px; width: 124px;
text-align: center; text-align: center;
background: rgba(255, 103, 2, 1); background: #FF6702;
border-radius: 7px 3px 7px 3px; border-radius: 7px 3px 7px 3px;
font-size: 12px; font-size: 12px;
color: #FFFFFF; color: #FFFFFF;
......
...@@ -39,8 +39,12 @@ ...@@ -39,8 +39,12 @@
<div class="home-classroom"> <div class="home-classroom">
<p class="home-classroom-title">芒果小课堂</p> <p class="home-classroom-title">芒果小课堂</p>
<div class="home-classroom-card" @click="goArticle(0)"> <div class="home-classroom-card" @click="goArticle(0)">
<a :href="articleList[0].url" target="_blank" class="Hc-card-question"> <a
{{ articleList[0].title }} :href="articleList[0].url"
target="_blank"
class="Hc-card-question"
v-html="articleList[0].title"
>
</a> </a>
<p class="Hc-card-result">已有1.8万人认为有用</p> <p class="Hc-card-result">已有1.8万人认为有用</p>
<div <div
...@@ -77,13 +81,7 @@ ...@@ -77,13 +81,7 @@
<p>{{ item.title }}</p> <p>{{ item.title }}</p>
<p>芒果小课堂</p> <p>芒果小课堂</p>
</div> </div>
<cr-image <cr-image class="Hc-item-right" width="" height="" fit="cover" :src="item.img" />
class="Hc-item-right"
width=""
height=""
fit="cover"
src="@/assets/images/home/teacher@2x.png"
/>
</a> </a>
</div> </div>
<!-- <div class="home-phone"> <!-- <div class="home-phone">
...@@ -107,6 +105,8 @@ import settings from "@/api/settings"; ...@@ -107,6 +105,8 @@ import settings from "@/api/settings";
import { getRiskEvaluation } from "@/api/smartMeasure"; import { getRiskEvaluation } from "@/api/smartMeasure";
import localStorage from "@/service/localStorage"; import localStorage from "@/service/localStorage";
import { has } from "lodash-es"; import { has } from "lodash-es";
import qa_2_img from "@/assets/images/home/qa-2@2x.png";
import qa_3_img from "@/assets/images/home/qa-3@2x.png";
export default { export default {
name: "Home", name: "Home",
...@@ -123,16 +123,18 @@ export default { ...@@ -123,16 +123,18 @@ export default {
mongoToken: localStorage.get("mongoToken"), mongoToken: localStorage.get("mongoToken"),
articleList: [ articleList: [
{ {
title: "25~45岁间该怎么买保险", title: "有了医保,<br>还需要买商业保险吗?",
url: "https://mp.weixin.qq.com/s/yG_n8cnvsFd9NPIYZycYvg"
},
{
title: "有了医保,还需要买商业保险吗?",
url: "https://mp.weixin.qq.com/s/6GZTTDwwHMHaIKFib7QGfg" url: "https://mp.weixin.qq.com/s/6GZTTDwwHMHaIKFib7QGfg"
}, },
{ {
title: "常见保险有几类,作用是什么?", title: "常见保险有几类,作用是什么?",
url: "https://mp.weixin.qq.com/s/rIhVsxnxcxHfiYHIwq11hQ" url: "https://mp.weixin.qq.com/s/rIhVsxnxcxHfiYHIwq11hQ",
img: qa_2_img
},
{
title: "25~45岁间该怎么买保险",
url: "https://mp.weixin.qq.com/s/yG_n8cnvsFd9NPIYZycYvg",
img: qa_3_img
} }
], ],
report: {} report: {}
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
}, },
methods: { methods: {
showPdf() { showPdf() {
this.$router.push({ path: "/policy/virtual-detail", query: { url: this.data.policyUrl } }); this.$router.push({ path: "/policy/virtual-detail", query: { policySecId: this.data.policySecId } });
} }
}, },
computed: { computed: {
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
goNext() { goNext() {
const arr = ["6.2-3", "6.1-3", "6.3", "8", "9-5", "9-6", "10"]; const arr = ["6.2-3", "6.1-3", "6.3", "8", "9-5", "9-6", "10"];
const payTypeText = this.payTypeList?.find(v => v.value === this.payType); const payTypeText = this.payTypeList?.find(v => v.value === this.payType);
const isAClear = payTypeText.label === "一次交清"; const isAClear = payTypeText?.label === "一次交清";
if (arr.includes(this.cardConfig?.status)) { if (arr.includes(this.cardConfig?.status)) {
this.$router.push( this.$router.push(
`/policy/payment-record/${encodeURIComponent(this.policySecId)}/${ `/policy/payment-record/${encodeURIComponent(this.policySecId)}/${
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import pdf from "vue-pdf"; import pdf from "vue-pdf";
import config from "@/config"; import config from "@/config";
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import localStorage from "@/service/localStorage";
let CMAP_URL = "https://cdn.jsdelivr.net/npm/pdfjs-dist@2.5.207/cmaps/"; let CMAP_URL = "https://cdn.jsdelivr.net/npm/pdfjs-dist@2.5.207/cmaps/";
export default { export default {
...@@ -17,33 +18,30 @@ export default { ...@@ -17,33 +18,30 @@ export default {
}, },
data() { data() {
return { return {
url: "",
pdfUrl: "", pdfUrl: "",
pdfNumPages: null pdfNumPages: null
}; };
}, },
mounted() { mounted() {
this.setDetail(); this.pdfTask();
}, },
methods: { methods: {
...mapActions(["setIsLoading"]), ...mapActions(["setIsLoading"]),
setDetail() {
let { url } = this.$route.query;
if (!url?.startsWith("http")) url = `${config.basicHost}${url}`;
this.setIsLoading(true);
if (!url) this.$router.back();
this.url = url;
this.pdfTask();
},
pdfTask() { pdfTask() {
this.pdfUrl = pdf.createLoadingTask({ url: this.url, cMapUrl: CMAP_URL, cMapPacked: true }); const token = localStorage.get("mongoToken");
const policySecId = this.$route.query?.policySecId;
if (!policySecId || !token) this.$router.back();
const url = `${
config.basicHost
}policy/download?token=${token}&policySecId=${encodeURIComponent(policySecId)}`;
this.pdfUrl = pdf.createLoadingTask({ url, cMapUrl: CMAP_URL, cMapPacked: true });
this.pdfUrl.promise this.pdfUrl.promise
.then(pdf => { .then(pdf => {
this.pdfNumPages = pdf.numPages; this.pdfNumPages = pdf.numPages;
this.setIsLoading(false); this.setIsLoading(false);
}) })
.catch(err => { .catch(err => {
console.error(err); console.error("err", err);
}); });
} }
} }
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
query: { id: item.id, type: item.itype } query: { id: item.id, type: item.itype }
}); });
} else if (text === "电子保单") { } else if (text === "电子保单") {
this.$router.push({ path: "/policy/virtual-detail", query: { url: item.policyUrl } }); this.$router.push({ path: "/policy/virtual-detail", query: { policySecId: item.policySecId } });
} else if (text === "去支付") { } else if (text === "去支付") {
this.orderInfo = { this.orderInfo = {
payOrderNo: item?.payInfo?.payOrderNo, payOrderNo: item?.payInfo?.payOrderNo,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment