二维码识别完成

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 textc from '../views/home/plan/textc.vue'
// 测试路径
import demo from '../views/demo/index.vue'
Vue.use(VueRouter)
const routes = [
@ -53,6 +56,11 @@ const routes = [
name: 'start',
component: start
},
{
path: '/demo',
name: 'demo',
component: demo
},
{
path: '/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() {
// 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 :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" v-show="isConfirm">
@ -77,12 +81,16 @@
expertCase: [],
id: '',
consult_amount: 0, //
ddEntrance:'', //
}
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
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;
},
mounted() {
@ -93,6 +101,15 @@
},
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() {
let that = this;
@ -162,6 +179,9 @@
this.isConfirm = true;
}
},
//
eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
@ -195,5 +215,13 @@
</script>
<style scoped>
.ask-btn span{
display: block;
width: 100%;
height: 1rem;
position: relative;
z-index: 1;
margin-top: -1rem;
opacity: 0;
}
</style>

View File

@ -47,7 +47,13 @@
</div>
</div>
<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" @click="toDetail(item.id)"></div>
</div>
@ -83,7 +89,6 @@
<span @click="closeEV()"></span>
</div>
</div>
<!-- 底部 -->
<tabbar :current="2"></tabbar>
</div>
@ -91,8 +96,6 @@
<script>
import tabbar from '../../../components/tabbar.vue'
import 'dingtalk-jsapi/entry/mobile';
import openLink from 'dingtalk-jsapi/api/biz/util/openLink';
export default {
name: "expert",
components: {
@ -118,12 +121,15 @@
addrIndex: -1,
isAddr: false, //
addrValue: '' , //
ddEntrance:'', //
isPluralism: 0, //
}
},
created() {
this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount;
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
},
mounted() {
this.getBanner();
@ -138,10 +144,18 @@
// })
// .then(function (res) {
// console.log(res.data.data.im_group_link,'')
// // window.open(res.data.data.im_group_link);
// openLink({
// url:res.data.data.im_group_link
// })
// window.open(res.data.data.im_group_link);
// dd.biz.util.openLink({
// 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,
keywords_list: item.keywords_list,
score: item.score,
comment_score: item.comment_score
comment_score: item.comment_score,
im_group_qr: item.im_group_qr,
}
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) {
this.$router.push({
@ -289,4 +315,15 @@
.banner img {
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>

View File

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

View File

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

View File

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