bding 8 ماه پیش
والد
کامیت
cb2b3a4ff1

+ 8 - 0
src/api/report.js

@@ -300,4 +300,12 @@ export const apiPublicBannerList = params=>{
  */
 export const bannerHistoryList = params=>{
     return get('/public/banner_history/list',params)
+}
+
+/**
+ * banner图获取报名二维码
+ * @returns 
+ */
+export const bannerGetQrcode = params=>{
+    return get('/public/banner/get_qrcode',params)
 }

+ 4 - 1
src/views/report/ChapterDetail.vue

@@ -383,7 +383,10 @@ const bannerClickHandler = async (item) => {
     router.push({
       path:'/report/disseminatePage',
       query: {
-        imgBg:item.jump_url_pc
+        imgBg: item.jump_url_pc,
+        enable: item.enable,
+        id: item.id,
+        title: item.remark
       }
     })
   }

+ 4 - 1
src/views/report/Detail.vue

@@ -440,7 +440,10 @@ const bannerClickHandler = async (item) => {
     router.push({
       path:'/report/disseminatePage',
       query: {
-        imgBg:item.jump_url_pc
+        imgBg: item.jump_url_pc,
+        enable: item.enable,
+        id: item.id,
+        title: item.remark
       }
     })
   }

+ 4 - 1
src/views/report/Index.vue

@@ -267,7 +267,10 @@ const bannerClickHandler = async (item) => {
       router.push({
         path:'/report/disseminatePage',
         query: {
-          imgBg:item.jump_url_pc
+          imgBg: item.jump_url_pc,
+          enable: item.enable,
+          id: item.id,
+          title: item.remark
         }
       })
     }

+ 40 - 3
src/views/report/disseminatePage.vue

@@ -1,16 +1,32 @@
 <script setup>
 import { ref, watch, nextTick } from "vue";
 import { useRoute } from "vue-router";
+import { useStore } from "vuex";
+import { bannerGetQrcode } from "@/api/report";
 
 const route = useRoute();
 const imgBg = ref("");
+const bannerId = ref("");
+const enable = ref("");
+const title = ref("");
+const store = useStore();
 
+
+const qrcodeImg = ref("");
+
+console.log(store.state.userInfo);
 watch(
   () => route.query.imgBg,
   (e) => {
     if (e) {
       nextTick(() => {
         imgBg.value = route.query.imgBg;
+        bannerId.value = route.query.id;
+        enable.value = route.query.enable;
+        title.value = route.query.title;
+        qrcodeImg.value = '';
+        console.log(enable.value);
+        enable.value == 1 && store.state.userInfo && getQrcCode();
       });
     }
   },
@@ -19,24 +35,45 @@ watch(
     deep: true,
   }
 );
+
+// // 获取code 二维码
+async function getQrcCode() {
+  const res = await bannerGetQrcode({
+    UserId: store.state.userInfo.user_id,
+    BannerId: bannerId.value,
+    Remark: title.value,
+  });
+  if (res.code == 200) {
+    qrcodeImg.value = res.data;
+  }
+}
 </script>
 
 <template>
   <div class="container-disseminate">
-    <img v-if="imgBg" :src="imgBg" alt="" />
+    <img class="bg-img" v-if="imgBg" :src="imgBg" alt="" />
+    <img class="qrcode-img" v-if="qrcodeImg" :src="qrcodeImg" alt="" />
   </div>
 </template>
 
 <style lang="scss" scoped>
 .container-disseminate {
+  position: relative;
   width: 100%;
   height: auto;
   display: flex;
   justify-content: center;
-  img {
-    margin-left: -50px;
+  .bg-img {
     width: 820px;
     height: 100%;
   }
+  .qrcode-img {
+    position: absolute;
+    width: 150px;
+    height: 150px;
+    left: 50%;
+    bottom: 90px;
+    transform: translateX(-50%);
+  }
 }
 </style>

+ 3 - 0
src/views/report/surveyHistory.vue

@@ -26,6 +26,9 @@ async function bannerSwiperHandler(item) {
       path: "/report/disseminatePage",
       query: {
         imgBg: item.jump_url_pc,
+        enable: item.enable,
+        id: item.id,
+        title: item.remark
       },
     });
   }