二维码识别完成

master
Lee-1203 2022-03-23 13:40:44 +08:00
parent 402803ae06
commit 9039cff63b
8 changed files with 166 additions and 31 deletions

View File

@ -45,6 +45,9 @@ import texta from '../views/home/plan/texta.vue'
import textb from '../views/home/plan/textb.vue' import textb from '../views/home/plan/textb.vue'
import textc from '../views/home/plan/textc.vue' import textc from '../views/home/plan/textc.vue'
// 测试路径
import demo from '../views/demo/index.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [
@ -53,6 +56,11 @@ const routes = [
name: 'start', name: 'start',
component: start component: start
}, },
{
path: '/demo',
name: 'demo',
component: demo
},
{ {
path: '/login', path: '/login',
name: 'login', name: 'login',

35
src/views/demo/index.vue Normal file
View File

@ -0,0 +1,35 @@
<template>
<div class="content main-content">
<div @click="goToAsk()"></div>
</div>
</template>
<script>
import * as dd from 'dingtalk-jsapi';
export default {
name: "demo",
data() {
return {
}
},
methods: {
goToAsk(){
dd.biz.util.openLink({
url: 'dingtalk://dingtalkclient/page/link?pc_slide=true&url=https%3A%2F%2Fh5.dingtalk.com%2Fservice-group%2Findex.html%3FjoinGroupCode%3Dp3cAnJVnxMMiPvkT1zJLiiup35T4nkdE3uNFJIiiUkGhZSCsiSL0qydvCuolCftWNT7C%23%2Fjoin-group',
onSuccess : function(res) {
//
console.log(res)
},
onFail : function(err) {
//
console.log(err)
}
});
},
}
}
</script>
<style scoped>
</style>

View File

@ -120,7 +120,7 @@
// //
downImg() { downImg() {
// postMessage // postMessage
dd.postMessage({name:'https://ypzy.emingren.com' + this.expertDetail.im_group_qr}); dd.postMessage({name:'downImg',url:'https://ypzy.emingren.com' + this.expertDetail.im_group_qr});
}, },
// //

View File

@ -54,7 +54,11 @@
</div> </div>
</div> </div>
</div> </div>
<div :class="{'ask-btn':true,'noservice':consult_amount==0}" @click="toAsk(expertDetail.id)"></div> <div :class="{'ask-btn':true,'noservice':consult_amount==0}" @click="downImg(host + expertDetail.im_group_qr)" v-if="ddEntrance == 'yes'">TA</div>
<div :class="{'ask-btn':true,'noservice':consult_amount==0}" v-else>
向TA提问
<span><img :src="host + expertDetail.im_group_qr" v-image-preview></span>
</div>
<!-- 领取咨询卡弹出框 --> <!-- 领取咨询卡弹出框 -->
<div class="my-confirm-bg" v-show="isConfirm" @click="isConfirm=!isConfirm"></div> <div class="my-confirm-bg" v-show="isConfirm" @click="isConfirm=!isConfirm"></div>
<div class="my-confirm" v-show="isConfirm"> <div class="my-confirm" v-show="isConfirm">
@ -77,12 +81,16 @@
expertCase: [], expertCase: [],
id: '', id: '',
consult_amount: 0, // consult_amount: 0, //
ddEntrance:'', //
} }
}, },
created() { created() {
this.isScroll = true; this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop); window.addEventListener("scroll", this.eventScrollTop);
this.id = this.$route.query.id; this.id = this.$route.query.id;
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount; this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount;
}, },
mounted() { mounted() {
@ -93,6 +101,15 @@
}, },
methods: { methods: {
//
downImg(url) {
if (this.consult_amount >= 1) {
// postMessage
dd.postMessage({name:'downImg',url: url});
}else if (this.consult_amount == 0){
this.isConfirm = true;
}
},
// //
getDetailData() { getDetailData() {
let that = this; let that = this;
@ -162,6 +179,9 @@
this.isConfirm = true; this.isConfirm = true;
} }
}, },
// //
eventScrollTop() { eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop; let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
@ -195,5 +215,13 @@
</script> </script>
<style scoped> <style scoped>
.ask-btn span{
display: block;
width: 100%;
height: 1rem;
position: relative;
z-index: 1;
margin-top: -1rem;
opacity: 0;
}
</style> </style>

View File

@ -47,7 +47,13 @@
</div> </div>
</div> </div>
<div class="expert-list-btns"> <div class="expert-list-btns">
<div :class="{'btn':true,'noservice':consult_amount==0}" @click="toAsk(item.id)">TA</div> <div :class="{'btn':true,'noservice':consult_amount==0}" @click="downImg(host + item.im_group_qr)" v-if="ddEntrance == 'yes'">TA</div>
<div :class="{'btn':true,'noservice':consult_amount==0}" v-else>
向TA提问
<span><img :src="host + item.im_group_qr" v-image-preview></span>
</div>
<!-- <div :class="{'btn':true,'noservice':consult_amount==0}" @click="toAsk(item.id)">TA</div> -->
<!-- <div :class="{'btn':true,'noservice':consult_amount==0}" @click="goToAsk(item.id)">TA</div> --> <!-- <div :class="{'btn':true,'noservice':consult_amount==0}" @click="goToAsk(item.id)">TA</div> -->
<div class="btn" @click="toDetail(item.id)"></div> <div class="btn" @click="toDetail(item.id)"></div>
</div> </div>
@ -83,7 +89,6 @@
<span @click="closeEV()"></span> <span @click="closeEV()"></span>
</div> </div>
</div> </div>
<!-- 底部 --> <!-- 底部 -->
<tabbar :current="2"></tabbar> <tabbar :current="2"></tabbar>
</div> </div>
@ -91,8 +96,6 @@
<script> <script>
import tabbar from '../../../components/tabbar.vue' import tabbar from '../../../components/tabbar.vue'
import 'dingtalk-jsapi/entry/mobile';
import openLink from 'dingtalk-jsapi/api/biz/util/openLink';
export default { export default {
name: "expert", name: "expert",
components: { components: {
@ -118,12 +121,15 @@
addrIndex: -1, addrIndex: -1,
isAddr: false, // isAddr: false, //
addrValue: '' , // addrValue: '' , //
ddEntrance:'', //
isPluralism: 0, // isPluralism: 0, //
} }
}, },
created() { created() {
this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount; this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount;
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
}, },
mounted() { mounted() {
this.getBanner(); this.getBanner();
@ -138,10 +144,18 @@
// }) // })
// .then(function (res) { // .then(function (res) {
// console.log(res.data.data.im_group_link,'') // console.log(res.data.data.im_group_link,'')
// // window.open(res.data.data.im_group_link); // window.open(res.data.data.im_group_link);
// openLink({ // dd.biz.util.openLink({
// url:res.data.data.im_group_link // url: res.data.data.im_group_link,
// }) // onSuccess : function(res) {
// //
// console.log(res)
// },
// onFail : function(err) {
// //
// console.log(err)
// }
// });
// }); // });
// }, // },
// //
@ -197,7 +211,8 @@
slogan: item.slogan, slogan: item.slogan,
keywords_list: item.keywords_list, keywords_list: item.keywords_list,
score: item.score, score: item.score,
comment_score: item.comment_score comment_score: item.comment_score,
im_group_qr: item.im_group_qr,
} }
newArray.push(obj); newArray.push(obj);
}) })
@ -265,6 +280,17 @@
} }
}, },
//
downImg(url) {
if (this.consult_amount >= 1) {
// postMessage
dd.postMessage({name:'downImg',url: url});
}else if (this.consult_amount == 0){
this.isConfirm = true;
}
},
// //
toDetail(id) { toDetail(id) {
this.$router.push({ this.$router.push({
@ -289,4 +315,15 @@
.banner img { .banner img {
width: 100%; width: 100%;
} }
.expert-list-btns span{
display: block;
width: 2.36rem;
height: 0.56rem;
border-radius: 0.28rem;
overflow: hidden;
position: relative;
z-index: 1;
margin-top: -0.56rem;
opacity: 0;
}
</style> </style>

View File

@ -35,9 +35,12 @@
<p><strong>张老师</strong></p> <p><strong>张老师</strong></p>
<p>北师大语言学应用硕士优朗高校面试课程首席讲师著名高校副教授中国先秦史学会国学双语研究会理事世界汉语大会国外教育部长随行翻译华尔街某金融公司CEO访谈节目现场口译官13年从业经验9年专注高校面试具备扎实的理论基础和实战经验</p> <p>北师大语言学应用硕士优朗高校面试课程首席讲师著名高校副教授中国先秦史学会国学双语研究会理事世界汉语大会国外教育部长随行翻译华尔街某金融公司CEO访谈节目现场口译官13年从业经验9年专注高校面试具备扎实的理论基础和实战经验</p>
<h2>授课联系老师</h2> <h2>单击以下二维码弹出后识别即可联系规划师</h2>
<div class="ewm"> <div class="ewm" @click="downImg()" v-if="ddEntrance == 'yes'">
<img src="../../../assets/images/home/plan/dysxewm.jpg" alt=""> <img src="http://aspevel.scdxtc.cn/img/dysxewm.jpg" alt="">
</div>
<div class="ewm" v-else>
<img src="http://aspevel.scdxtc.cn/img/dysxewm.jpg" v-image-preview alt="">
</div> </div>
</div> </div>
</div> </div>
@ -48,16 +51,22 @@
name: "texta", name: "texta",
data() { data() {
return { return {
ddEntrance:'', //
} }
}, },
beforeCreate() { beforeCreate() {
}, },
created() { created() {
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
}, },
methods: { methods: {
//
downImg() {
// postMessage
dd.postMessage({name:'downImg',url: 'http://aspevel.scdxtc.cn/img/dysxewm.jpg'});
},
} }
} }
</script> </script>

View File

@ -42,9 +42,12 @@
<p><strong>李老师</strong></p> <p><strong>李老师</strong></p>
<p>外国语言学及英语语言学硕士高校面试口语教材参编6年高校教学经验十多年丰富的面试口语教学经验对面试类问题分析有独到的见解面试思维应变力强善于快速开拓学员的面试思维短期内迅速提升学员综合能力</p> <p>外国语言学及英语语言学硕士高校面试口语教材参编6年高校教学经验十多年丰富的面试口语教学经验对面试类问题分析有独到的见解面试思维应变力强善于快速开拓学员的面试思维短期内迅速提升学员综合能力</p>
<h2>授课联系老师</h2> <h2>单击以下二维码弹出后识别即可联系规划师</h2>
<div class="ewm"> <div class="ewm" @click="downImg()" v-if="ddEntrance == 'yes'">
<img src="../../../assets/images/home/plan/dysxewm.jpg" alt=""> <img src="http://aspevel.scdxtc.cn/img/dysxewm.jpg" alt="">
</div>
<div class="ewm" v-else>
<img src="http://aspevel.scdxtc.cn/img/dysxewm.jpg" v-image-preview alt="">
</div> </div>
</div> </div>
</div> </div>
@ -55,16 +58,22 @@
name: "textb", name: "textb",
data() { data() {
return { return {
ddEntrance:'', //
} }
}, },
beforeCreate() { beforeCreate() {
}, },
created() { created() {
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
}, },
methods: { methods: {
//
downImg() {
// postMessage
dd.postMessage({name:'downImg',url: 'http://aspevel.scdxtc.cn/img/dysxewm.jpg'});
},
} }
} }
</script> </script>

View File

@ -38,9 +38,12 @@
<p><strong>Leo </strong></p> <p><strong>Leo </strong></p>
<p>英国海归硕士以最高等级学位毕业于两所英国TOP10顶尖大学并多次在国内英语风采大赛中获奖教学经验丰富深谙英文面试考核重难点授课颇具亲和力深受学员喜爱</p> <p>英国海归硕士以最高等级学位毕业于两所英国TOP10顶尖大学并多次在国内英语风采大赛中获奖教学经验丰富深谙英文面试考核重难点授课颇具亲和力深受学员喜爱</p>
<h2>授课联系老师</h2> <h2>单击以下二维码弹出后识别即可联系规划师</h2>
<div class="ewm"> <div class="ewm" @click="downImg()" v-if="ddEntrance == 'yes'">
<img src="../../../assets/images/home/plan/dysxewm.jpg" alt=""> <img src="http://aspevel.scdxtc.cn/img/dysxewm.jpg" alt="">
</div>
<div class="ewm" v-else>
<img src="http://aspevel.scdxtc.cn/img/dysxewm.jpg" v-image-preview alt="">
</div> </div>
</div> </div>
</div> </div>
@ -51,16 +54,22 @@
name: "textc", name: "textc",
data() { data() {
return { return {
ddEntrance:'', //
} }
}, },
beforeCreate() { beforeCreate() {
}, },
created() { created() {
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
}, },
methods: { methods: {
//
downImg() {
// postMessage
dd.postMessage({name:'downImg',url: 'http://aspevel.scdxtc.cn/img/dysxewm.jpg'});
},
} }
} }
</script> </script>