Browse Source

应对拍摄临时提交

master
蟑螂恶霸 2 years ago
parent
commit
8c781543ea
  1. 2
      src/views/Home.vue
  2. 183
      src/views/enforce/scanQrCode.vue
  3. 14
      src/views/enforceHome.vue

2
src/views/Home.vue

@ -147,7 +147,7 @@
onMounted(() => {
// console.log(useCommon.phonenumber)
// useCommon.SET_USER_PHONENUMBER(success.data.phonenumber);
new Vconsolefrom();
// new Vconsolefrom();
const access_key = '6374106c5eb449a4ad6c2430f30796e6';
const access_secret = '434fec85aa5846e88bbeb8fac6cf6d7f';

183
src/views/enforce/scanQrCode.vue

@ -17,10 +17,10 @@
<div class="white-body">
<div class="carousel_box">
<div class="box-scan-one">
<span class="box-scan-text">扫一扫<br />企业二维码</span>
<span class="box-scan-text">扫一扫<br/>企业二维码</span>
</div>
<div class="box-scan-two">
<span class="box-scan-text">即可查看<br />企业信息</span>
<span class="box-scan-text">即可查看<br/>企业信息</span>
</div>
</div>
<div class="boutique_box">
@ -28,7 +28,7 @@
<div class="boutique_body">
<!-- <goodsCard :goodsList="boutique" :cardAttr="boutiqueAttr"></goodsCard> -->
<div class="box-qr-code" @click="toScanPageView">
<!-- <img src="../../assets/images/scan.png" />
<!-- <img src="../../assets/images/scan.png" />
<span class="box-qr-code-text">执法监督码</span>-->
</div>
</div>
@ -53,50 +53,51 @@
<script setup name="Home">
// import Vconsole from "vconsole";
import { showFailToast } from 'vant';
import {getEnterpriseMerchantAuthorization} from '@/api/Home';
import {checkIsExists} from '@/api/enterprise';
import {szyptGetToken} from "../../api/Home";
import wx from "weixin-js-sdk";
const { useCommon } = $globalStore;
const router = useRouter();
let carouselList = reactive([]); // 轮播列表
let boutique = reactive([]); // 精品数据
let recommend = reactive([]); // 推荐
let freshMap = reactive({
import {showFailToast} from 'vant';
import {getEnterpriseMerchantAuthorization} from '@/api/Home';
import {checkIsExists} from '@/api/enterprise';
import {szyptGetToken} from "../../api/Home";
import wx from "weixin-js-sdk";
const {useCommon} = $globalStore;
const router = useRouter();
let carouselList = reactive([]); // 轮播列表
let boutique = reactive([]); // 精品数据
let recommend = reactive([]); // 推荐
let freshMap = reactive({
refreshLoad: false, // 是否刷新
listLoading: false, // 是否加载中
listFinished: false, // 是否加载完成标识
});
const data = reactive({});
const boutiqueAttr = reactive({
});
const data = reactive({});
const boutiqueAttr = reactive({
columnNum: 4,
itemClass: "boutique_item",
goodsCradclass: "boutique-crad",
}); // 商品卡片展示
}); // 商品卡片展示
//获取轮播
const getCarousel = async () => {
//获取轮播
const getCarousel = async () => {
// const res = await useHome.getCarousel();
// if (res?.code === 20000) {
// carouselList = res?.data;
// }
};
};
//精品
const boutiqueGoods = async () => {
//精品
const boutiqueGoods = async () => {
// const res = await useHome.boutiqueGoods();
// if (res?.code === 20000) {
// boutique = res?.data;
// }
};
};
const openScan = () => {
const openScan = () => {
let fullUrl = window.location.href;
let code = fullUrl.substring(fullUrl.indexOf('code=')+5, fullUrl.indexOf('&state='));
let code = fullUrl.substring(fullUrl.indexOf('code=') + 5, fullUrl.indexOf('&state='));
let paramUrl = window.location.href.split("#")[0];
let param = { code: code, url: paramUrl };
szyptGetToken(param,success =>{
let param = {code: code, url: paramUrl};
szyptGetToken(param, success => {
let resMsg = success.data;
console.log(resMsg);
wx.config({
@ -120,9 +121,10 @@ const openScan = () => {
wx.error((res) => {
console.log("获取失败");
});
},error =>{});
};
const ClickScan = () => {
}, error => {
});
};
const ClickScan = () => {
wx.scanQRCode({
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
@ -130,24 +132,24 @@ const ClickScan = () => {
// 页面跳转
console.log("=========== 扫码返回 ===========")
console.log(res)
checkIsExists(res,success=>{
console.log(success.data)
if(success.data){
// checkIsExists(res, success => {
// console.log(success.data)
// if (success.data) {
router.push({
path:"/enterpriseScanPreview",
query:{
path: "/enterpriseScanPreview",
query: {
enterpriseNumber: res.resultStr
}
})
}else{
showFailToast('企业信息不存在,请确认二维码是否正确!');
router.push({
path:"/enforce/scanQrCode",
})
}
},error =>{
})
// } else {
// showFailToast('企业信息不存在,请确认二维码是否正确!');
// router.push({
// path: "/enforce/scanQrCode",
// })
// }
// }, error => {
//
// })
// router.push({
// path: "/enterpriseScanPreview",
// query: {
@ -159,66 +161,66 @@ const ClickScan = () => {
console.log('err', res);
},
});
};
};
const toScanPageView = async() =>{
const toScanPageView = async () => {
openScan();
// router.push({
// path: "/enforce/scanPage_szy",
// query: {}
// });
};
};
const toNoScanView = async() =>{
const toNoScanView = async () => {
router.push({
path: "/enforce/noScan",
query: {}
});
};
};
const toRegistrationListView = async() =>{
const toRegistrationListView = async () => {
router.push({
path: "/enterprise/registrationList",
});
}
const toComplaintView = async() =>{
}
const toComplaintView = async () => {
router.push({
path: "/enterprise/complaint",
});
}
}
//下拉刷新
const onRefresh = () => {
//下拉刷新
const onRefresh = () => {
freshMap.listFinished = false;
freshMap.listLoading = true;
freshMap.refreshLoad = true;
// Promise.all([getCarousel(), boutiqueGoods(), recommendGoods()]).then(() => {
// freshMap.refreshLoad = false;
// });
};
};
// 触底加载
const onLoad = () => {
// 触底加载
const onLoad = () => {
// recommendGoods(true);
};
};
onMounted(() => {
onMounted(() => {
// new Vconsole();
getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{
if(!(success.data == null && success.data.length == 0)){
getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber}, success => {
if (!(success.data == null && success.data.length == 0)) {
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber);
}
},error =>{
}, error => {
})
})
})
// 返回
const goBack = () => {
// 返回
const goBack = () => {
router.go(-1);
};
};
</script>
<style lang="less" scoped>
.home {
.home {
display: flex;
flex-direction: column;
height: 100%;
@ -229,6 +231,7 @@ const goBack = () => {
background-image: linear-gradient(to bottom, #ebf3fb, transparent);
background-size: cover;
position: relative;
.carousel_box {
position: relative;
top: 2%;
@ -238,7 +241,7 @@ const goBack = () => {
background-size: 60%;
opacity: 0.75;
.box-scan-one , .box-scan-two{
.box-scan-one, .box-scan-two {
position: absolute;
top: 30%;
left: 15%;
@ -246,14 +249,16 @@ const goBack = () => {
width: 30%;
font-size: 0.4rem;
color: #999;
.box-scan-text{
.box-scan-text {
margin-top: 70%;
display: block;
width: 100%;
text-align: center
}
}
.box-scan-two{
.box-scan-two {
left: auto;
right: 12.5%;
}
@ -271,8 +276,10 @@ const goBack = () => {
padding: 0px 0px 10px 0px;
display: flex;
justify-content: center;
};
.box-qr-code{
}
;
.box-qr-code {
width: 52%;
text-align: right;
height: 7rem;
@ -283,19 +290,21 @@ const goBack = () => {
// background-size: cover;
// border-radius: 50%;
// background-image: url("@/assets/images/scan.png");
.box-qr-code-text{
.box-qr-code-text {
margin-right: 25%;
margin-top: 70%;
display: block;
font-size: 0.45333rem;
}
img{
img {
position: absolute;
top: 0%;
left: 34%;
}
}
.box-info{
.box-info {
width: 52%;
text-align: right;
height: 3.66667rem;
@ -304,14 +313,15 @@ const goBack = () => {
background: url("@/assets/images/item_check.png");
background-size: cover;
.box-info-text{
.box-info-text {
margin-right: 3%;
margin-top: 2%;
display: block;
font-size: 17px
}
}
.box-complaint{
.box-complaint {
width: 36%;
text-align: right;
height: 3.66667rem;
@ -320,7 +330,8 @@ const goBack = () => {
margin-left: 2%;
background: url("@/assets/images/item_complain.png");
background-size: cover;
.box-complaint-text{
.box-complaint-text {
margin-right: 5%;
margin-top: 3%;
display: block;
@ -334,21 +345,21 @@ const goBack = () => {
width: 100%;
}
}
}
}
.white-body {
.white-body {
margin: 0 4%;
width: 92%;
height: 96%;
background-color: #fff;
border-radius: 0.25remnpm;
}
border-radius: 0.25 remnpm;
}
.nocode {
.nocode {
width: 100%;
color: #fb7905;
font-size: 0.45rem;
text-align: center;
line-height: 3;
}
}
</style>

14
src/views/enforceHome.vue

@ -153,7 +153,7 @@
};
onMounted(() => {
new Vconsolefrom();
// new Vconsolefrom();
let fullUrl = window.location.href;
let code = fullUrl.substring(fullUrl.indexOf('code=') + 5, fullUrl.indexOf('&state='));
// getSzyptLoginAuth(route?.query?.code,success =>{
@ -162,12 +162,12 @@
useCommon.SET_USER_ID(success.data.userId);
// 如果不是执法用户 则跳转
if (!success.data.lawOfficer) {
router.push(
{
path: "/noAccess"
});
}
// if (!success.data.lawOfficer) {
// router.push(
// {
// path: "/noAccess"
// });
// }
}, error => {
})

Loading…
Cancel
Save