Browse Source

是否执法人员

master
蟑螂恶霸 2 years ago
parent
commit
b03a2f7b24
  1. 6
      src/router/enforce.js
  2. 2
      src/views/enforce/sign.vue
  3. 185
      src/views/enforceHome.vue
  4. 2
      src/views/enterprise/registrationEdit.vue

6
src/router/enforce.js

@ -41,6 +41,12 @@ const routes = [
name: "pdfView", name: "pdfView",
component: () => import("@/views/common/pdfvVew.vue"), component: () => import("@/views/common/pdfvVew.vue"),
}, },
// 无权限页
{
path: "/noAccess",
name: "noAccess",
component: () => import("@/views/noAccess.vue"),
},
]; ];
export { routes }; export { routes };

2
src/views/enforce/sign.vue

@ -150,7 +150,7 @@
</div> </div>
<Popup :visible="data.popupVisible" :content="data.popupContent" @close="closePopup" @reciveData="reciveData" /> <Popup :visible="data.popupVisible" :content="data.popupContent" @close="closePopup" @reciveData="reciveData" />
<PopupA :visible="data.popupVisible2" :content="data.popupContent2" @close="closePopup" @reciveData="reciveData2" /> <Popup :visible="data.popupVisible2" :content="data.popupContent2" @close="closePopup" @reciveData="reciveData2" />
<van-popup v-model:show="data.showItem" position="bottom" :style="{ height: '30%' }"> <van-popup v-model:show="data.showItem" position="bottom" :style="{ height: '30%' }">

185
src/views/enforceHome.vue

@ -8,10 +8,10 @@
<!-- 中间 --> <!-- 中间 -->
<div class="warp_body"> <div class="warp_body">
<div class="logobox"></div> <div class="logobox"></div>
<div class="streamer" @click="" > <div class="streamer" @click="">
<i></i> <i></i>
<span class="marquee"> <span class="marquee">
<span class="scroll-text" v-for="(item, index) in carouselList" >{{ item.planName }}</span> <span class="scroll-text" v-for="(item, index) in carouselList">{{ item.planName }}</span>
</span> </span>
</div> </div>
@ -58,120 +58,129 @@
import Vconsolefrom from 'vconsole'; import Vconsolefrom from 'vconsole';
import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home'; import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home';
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce"; import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const { useCommon } = $globalStore;
const router = useRouter(); const {useCommon} = $globalStore;
const route = useRoute(); const router = useRouter();
var carouselList = reactive([]); // 轮播列表 const route = useRoute();
let boutique = reactive([]); // 精品数据 var carouselList = reactive([]); // 轮播列表
let recommend = reactive([]); // 推荐 let boutique = reactive([]); // 精品数据
let freshMap = reactive({ let recommend = reactive([]); // 推荐
let freshMap = reactive({
refreshLoad: false, // 是否刷新 refreshLoad: false, // 是否刷新
listLoading: false, // 是否加载中 listLoading: false, // 是否加载中
listFinished: false, // 是否加载完成标识 listFinished: false, // 是否加载完成标识
}); });
const data = reactive({}); const data = reactive({});
const adviceList = reactive([]); const adviceList = reactive([]);
const boutiqueAttr = reactive({ const boutiqueAttr = reactive({
columnNum: 4, columnNum: 4,
itemClass: "boutique_item", itemClass: "boutique_item",
goodsCradclass: "boutique-crad", goodsCradclass: "boutique-crad",
}); // 商品卡片展示 }); // 商品卡片展示
//获取轮播 //获取轮播
const getCarousel = async () => { const getCarousel = async () => {
// const res = await useHome.getCarousel(); // const res = await useHome.getCarousel();
// if (res?.code === 20000) { // if (res?.code === 20000) {
// carouselList = res?.data; // carouselList = res?.data;
// } // }
}; };
//精品 //精品
const boutiqueGoods = async () => { const boutiqueGoods = async () => {
// const res = await useHome.boutiqueGoods(); // const res = await useHome.boutiqueGoods();
// if (res?.code === 20000) { // if (res?.code === 20000) {
// boutique = res?.data; // boutique = res?.data;
// } // }
}; };
/**扫码入企 */ /**扫码入企 */
const toScanCodeView = async() =>{ const toScanCodeView = async () => {
router.push({ path: "/enforce/scanQrCode" }); router.push({path: "/enforce/scanQrCode"});
}; };
const toRegistrationListView = async() =>{ const toRegistrationListView = async () => {
router.push({ router.push({
path: "/historyCheck", path: "/historyCheck",
}); });
} }
const toComplaintView = async() =>{ const toComplaintView = async () => {
router.push({ router.push({
path: "/enterprise/complaint", path: "/enterprise/complaint",
}); });
} }
const toAnalyseView = async() =>{ const toAnalyseView = async () => {
router.push({ router.push({
path: "/analyse", path: "/analyse",
}); });
} }
const toNoticeView = async() =>{ const toNoticeView = async () => {
router.push({ router.push({
path: "/enforce/enforceNotice", path: "/enforce/enforceNotice",
}); });
} }
const queryList = () =>{ const queryList = () => {
queryEnforcementInspectionProgramListNoPermission({},success =>{ queryEnforcementInspectionProgramListNoPermission({}, success => {
console.log(success) console.log(success)
if(success.data.length > 4 ){ if (success.data.length > 4) {
for (let i = 0; i <= 3; i++) { for (let i = 0; i <= 3; i++) {
carouselList.push(success.data[i]); carouselList.push(success.data[i]);
} }
}else{ } else {
carouselList = success.data; carouselList = success.data;
} }
console.log(carouselList) console.log(carouselList)
},error =>{ }, error => {
}) })
} }
//下拉刷新 //下拉刷新
const onRefresh = () => { const onRefresh = () => {
freshMap.listFinished = false; freshMap.listFinished = false;
freshMap.listLoading = true; freshMap.listLoading = true;
freshMap.refreshLoad = true; freshMap.refreshLoad = true;
// Promise.all([getCarousel(), boutiqueGoods(), recommendGoods()]).then(() => { // Promise.all([getCarousel(), boutiqueGoods(), recommendGoods()]).then(() => {
// freshMap.refreshLoad = false; // freshMap.refreshLoad = false;
// }); // });
}; };
// 触底加载 // 触底加载
const onLoad = () => { const onLoad = () => {
// recommendGoods(true); // recommendGoods(true);
}; };
onMounted(() => { onMounted(() => {
new Vconsolefrom(); new Vconsolefrom();
let fullUrl = window.location.href; 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='));
// getSzyptLoginAuth(route?.query?.code,success =>{ // getSzyptLoginAuth(route?.query?.code,success =>{
getSzyptLoginAuth(code,success =>{ getSzyptLoginAuth(code, success => {
console.log(success.data) console.log(success.data)
useCommon.SET_USER_ID(success.data.userId); useCommon.SET_USER_ID(success.data.userId);
},error =>{
// 如果不是执法用户 则跳转
if (!success.data.lawOfficer) {
router.push(
{
path: "/noAccess"
});
}
}, error => {
}) })
getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{ getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber}, success => {
if(!(success.data == null && success.data.length == 0)){ if (!(success.data == null && success.data.length == 0)) {
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber); useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber);
} }
},error =>{ }, error => {
}) })
queryList(); queryList();
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.home { .home {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
@ -183,6 +192,7 @@ onMounted(() => {
background: url("../assets/images/bg_el.jpg"); background: url("../assets/images/bg_el.jpg");
background-size: cover; background-size: cover;
overflow-x: hidden; overflow-x: hidden;
.carousel_box { .carousel_box {
height: 150px; height: 150px;
width: 100%; width: 100%;
@ -196,12 +206,15 @@ onMounted(() => {
position: absolute; position: absolute;
width: 100%; width: 100%;
bottom: 1%; bottom: 1%;
.boutique_body { .boutique_body {
padding: 0px 0px 10px 0px; padding: 0px 0px 10px 0px;
display: flex; display: flex;
justify-content: center; justify-content: center;
}; }
.box-qr-code{ ;
.box-qr-code {
width: 90%; width: 90%;
text-align: right; text-align: right;
height: 3.66667rem; height: 3.66667rem;
@ -209,13 +222,15 @@ onMounted(() => {
border-radius: 10px; border-radius: 10px;
background: url("../assets/images/item_scan.png"); background: url("../assets/images/item_scan.png");
background-size: cover; background-size: cover;
.box-qr-code-text{
.box-qr-code-text {
margin: 0.35rem 0.5rem 0 0; margin: 0.35rem 0.5rem 0 0;
display: block; display: block;
font-size: 17px font-size: 17px
} }
} }
.box-info{
.box-info {
width: 52%; width: 52%;
text-align: right; text-align: right;
height: 3.66667rem; height: 3.66667rem;
@ -224,13 +239,14 @@ onMounted(() => {
background: url("../assets/images/item_checkc.png"); background: url("../assets/images/item_checkc.png");
background-size: cover; background-size: cover;
.box-info-text{ .box-info-text {
margin: 0.35rem 0.5rem 0 0; margin: 0.35rem 0.5rem 0 0;
display: block; display: block;
font-size: 17px font-size: 17px
} }
} }
.box-complaint{
.box-complaint {
width: 36%; width: 36%;
text-align: right; text-align: right;
height: 3.66667rem; height: 3.66667rem;
@ -239,7 +255,8 @@ onMounted(() => {
margin-left: 2%; margin-left: 2%;
background: url("../assets/images/item_count.png"); background: url("../assets/images/item_count.png");
background-size: cover; background-size: cover;
.box-complaint-text{
.box-complaint-text {
margin: 0.35rem 0.5rem 0 0; margin: 0.35rem 0.5rem 0 0;
display: block; display: block;
font-size: 17px font-size: 17px
@ -252,10 +269,10 @@ onMounted(() => {
width: 100%; width: 100%;
} }
} }
} }
.streamer, .noticbox { .streamer, .noticbox {
display: flex; display: flex;
position: absolute; position: absolute;
top: calc(1% + 10vh); top: calc(1% + 10vh);
@ -271,9 +288,9 @@ onMounted(() => {
line-height: 1.0rem; line-height: 1.0rem;
white-space: nowrap; white-space: nowrap;
box-sizing: content-box; box-sizing: content-box;
} }
.noticbox { .noticbox {
top: 33%; top: 33%;
right: 0; right: 0;
padding: 0 0.2rem; padding: 0 0.2rem;
@ -282,9 +299,9 @@ onMounted(() => {
background-color: rgba(249, 238, 219, .7); background-color: rgba(249, 238, 219, .7);
border-radius: 0.5rem 0 0 0.5rem; border-radius: 0.5rem 0 0 0.5rem;
color: #000; color: #000;
} }
.streamer > i, .noticbox > i { .streamer > i, .noticbox > i {
display: inline-block; display: inline-block;
position: relative; position: relative;
top: 0.18rem; top: 0.18rem;
@ -293,36 +310,42 @@ onMounted(() => {
height: 0.6rem; height: 0.6rem;
background: url("../assets/images/icon_notice.png") no-repeat; background: url("../assets/images/icon_notice.png") no-repeat;
background-size: auto 100%; background-size: auto 100%;
} }
.noticbox > i { .noticbox > i {
top: 0.1rem; top: 0.1rem;
margin: 0 0.2rem 0 0; margin: 0 0.2rem 0 0;
width: 0.8rem; width: 0.8rem;
height: 0.8rem; height: 0.8rem;
background: url("../assets/images/icon_notice3.png") no-repeat; background: url("../assets/images/icon_notice3.png") no-repeat;
background-size: auto 100%; background-size: auto 100%;
} }
.streamer .marquee { .streamer .marquee {
display: inline-block; display: inline-block;
width: calc(100% - 1rem); /* 或者你想要的宽度 */ width: calc(100% - 1rem); /* 或者你想要的宽度 */
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
::v-deep .scroll-text { ::v-deep .scroll-text {
display: inline-block; display: inline-block;
padding-left: 100%; /* 初始时隐藏在右侧 */ padding-left: 100%; /* 初始时隐藏在右侧 */
animation: marquee 5s linear infinite; /* 设置动画 */ animation: marquee 5s linear infinite; /* 设置动画 */
} }
@keyframes marquee { @keyframes marquee {
0% { transform: translateX(0); } /* 动画开始时 */ 0% {
100% { transform: translateX(-100%); } /* 动画结束时,文字完全移动到左侧并重新开始 */ transform: translateX(0);
} }
/* 动画开始时 */
100% {
transform: translateX(-100%);
}
/* 动画结束时,文字完全移动到左侧并重新开始 */
}
.noticbox span.new { .noticbox span.new {
display: block; display: block;
position: absolute; position: absolute;
top: 0.1rem; top: 0.1rem;
@ -331,9 +354,9 @@ onMounted(() => {
height: 0.2rem; height: 0.2rem;
background: #ff1414; background: #ff1414;
border-radius: 50%; border-radius: 50%;
} }
.logobox { .logobox {
position: relative; position: relative;
top: 4%; top: 4%;
left: 5%; left: 5%;
@ -342,5 +365,5 @@ onMounted(() => {
height: 10vh; height: 10vh;
background: url("../assets/images/logo.png") no-repeat; background: url("../assets/images/logo.png") no-repeat;
background-size: 100% auto; background-size: 100% auto;
} }
</style> </style>

2
src/views/enterprise/registrationEdit.vue

@ -134,7 +134,7 @@
</div> </div>
<Popup :visible="data.popupVisible" :content="data.popupContent" @close="closePopup" @reciveData="reciveData" /> <Popup :visible="data.popupVisible" :content="data.popupContent" @close="closePopup" @reciveData="reciveData" />
<PopupA :visible="data.popupVisible2" :content="data.popupContent2" @close="closePopup" @reciveData="reciveData2" /> <Popup :visible="data.popupVisible2" :content="data.popupContent2" @close="closePopup" @reciveData="reciveData2" />
<van-popup v-model:show="data.showItem" position="bottom" :style="{ height: '30%' }"> <van-popup v-model:show="data.showItem" position="bottom" :style="{ height: '30%' }">

Loading…
Cancel
Save