liyongli 4 hónapja
szülő
commit
d4c5f97c9a

+ 23 - 7
src/tool/adList.js

@@ -21,14 +21,28 @@ document.addEventListener('DOMContentLoaded', function () {
     const slots = config.slots || []
     const D = new Date()
     const dateTime = D.getTime()
+    console.log(slots)
     for (let i = 0; i < slots.length; i++) {
       const v = slots[i]
       if (!v.creativesList || !v.creativesList.length) continue
       // 获取对应广告位置
       const ad_pos = document.querySelector('#sxtv-ad-' + v.slotId)
-      if (!ad_pos) return console.error('广告位置不存在:#sxtv-ad-' + v.slotId)
+      if (!ad_pos) {
+        console.error('广告位置不存在:#sxtv-ad-' + v.slotId)
+        continue
+      }
+      const gg = document.createElement('div')
+      gg.innerHTML =
+        '<svg t="1734493782806" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9775" width="32" height="32"><path d="M560.88 658.8h69.68v15.44h-69.68z" p-id="9776" fill="#515151"></path><path d="M698.24 451.44V200h-46.56v251.44H372.32V200h-46.56v251.44H186V824h651.92V451.44zM505.12 600H396.16v90.72L352 700.08v-33.92l8-2.4V575.2h54.24l-1.84-8.8h45.84l1.68 8.8h44.88z m162.72 96.48H524.4v-60h143.44z m5.36-64.48H518.88v-23.36h61.12v-11.28h-22.16l-2.88 8.48H520V582.4h8.72l5.52-13.76H568l-2.32 6.64h14.32v-8h38.64v8h49.04v22h-49.04v11.36h54.56z" p-id="9777" fill="#515151"></path></svg>'
+      gg.style.position = 'absolute'
+      gg.style.top = 0
+      gg.style.right = 3
+      gg.style.zIndex = 999999
+
       // 判定当前时间是否在creativesList的时间内
       const ele = document.createElement('div')
+      ele.style.position = 'relative'
+      ele.appendChild(gg)
       for (let o = 0; o < v.creativesList.length; o++) {
         const item = v.creativesList[o]
         const start = new Date(item.startDate + ' 00:00:00').getTime()
@@ -39,7 +53,7 @@ document.addEventListener('DOMContentLoaded', function () {
         const showType = item.showType
         let e =
           showType === 1
-            ? generateCarouselAd(item, D, v.slotId)
+            ? generateCarouselAd(item, D, v.slotId, v.width || 0, v.height || 0)
             : generateAlternateAd(item, D, v.slotId)
         if (e == -1) return
         ele.appendChild(e)
@@ -50,13 +64,14 @@ document.addEventListener('DOMContentLoaded', function () {
       ad_pos.style.width = (v.width || 0) + 'px'
       ad_pos.style.height = (v.height || 0) + 'px'
       ad_pos.style.border = 'none'
+      ad_pos.style.overflow = 'hidden'
 
       ad_pos.appendChild(ele)
     }
   }
 
   // 生成轮播广告
-  const generateCarouselAd = function (generateCarousel = {}, D, slotId) {
+  const generateCarouselAd = function (generateCarousel = {}, D, slotId, width, height) {
     const week = D.getDay() === 0 ? 7 : D.getDay()
     const timeInterval = (generateCarousel.timeInterval || '')
       .slice(week * 24, week * 24 + 25)
@@ -64,7 +79,7 @@ document.addEventListener('DOMContentLoaded', function () {
     const H = D.getHours()
     if (timeInterval[H] == 0) return -1
     const T = (generateCarousel.showIntervalTime || 5) * 1000
-    return createCarousel(generateCarousel.stuffsList, T, slotId)
+    return createCarousel(generateCarousel.stuffsList, T, slotId, width, height)
   }
 
   // 生成交替广告
@@ -223,7 +238,8 @@ document.addEventListener('DOMContentLoaded', function () {
   }
 
   // 轮播
-  function createCarousel(images, interval, slotId) {
+  function createCarousel(images, interval, slotId, width, height) {
+    console.log(images, interval, slotId, width, height)
     // 创建轮播图容器
     const carouselContainer = document.createElement('div')
     carouselContainer.style = `
@@ -237,8 +253,8 @@ document.addEventListener('DOMContentLoaded', function () {
     const imagesContainer = document.createElement('div')
     imagesContainer.style = `
       display: flex;
-      width: ${images.length * 100}%;
-      height: 100%;
+      width: ${images.length * width}px;
+      height: ${height}px;
       transition: transform 0.5s ease;
     `
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
src/tool/adList.min.js


+ 1 - 10
src/tool/index.html

@@ -9,16 +9,7 @@
 </head>
 
 <body>
-    <div id="sxtv-ad-1"></div>
-    <div id="sxtv-ad-2"></div>
-    <div id="sxtv-ad-3"></div>
-    <div id="sxtv-ad-5"></div>
-    <div id="sxtv-ad-6"></div>
-    <div id="sxtv-ad-7"></div>
-    <div id="sxtv-ad-8"></div>
-    <div id="sxtv-ad-9"></div>
-    <div id="sxtv-ad-10"></div>
-    <div id="sxtv-ad-11"></div>
+    <div id="sxtv-ad-17"></div>
 </body>
 
 </html>

+ 11 - 5
src/views/OriginalityPage.vue

@@ -34,6 +34,15 @@
     <el-table-column prop="endDate" label="结束日期" width="120" />
     <el-table-column label="操作">
       <template #default="scope">
+        <el-button
+          v-if="scope.row.creativeId"
+          link
+          size="small"
+          type="primary"
+          @click="() => linkSourceMaterial(scope.row.creativeId)"
+        >
+          关联素材
+        </el-button>
         <el-popconfirm
           title="确定删除该创意吗?"
           @confirm="deleteOriginalityFun(scope.row.creativeId)"
@@ -184,9 +193,6 @@
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="createOrUpdate">确定</el-button>
-        <el-button v-if="form.creativeId" type="primary" @click="linkSourceMaterial">
-          关联素材
-        </el-button>
       </el-form-item>
     </el-form>
   </el-dialog>
@@ -433,9 +439,9 @@ const changeStatus = (id: number, status: number, text: string) => {
   })
 }
 
-const linkSourceMaterial = () => {
+const linkSourceMaterial = (id: string | number) => {
   // 跳转到相关素材
-  router.push('/authorized/sourceMaterial?creativeId=' + form.value.creativeId)
+  router.push('/authorized/sourceMaterial?creativeId=' + id)
 }
 
 const publishAsTreeFunc = (id: number) => {

+ 7 - 5
src/views/SourceMaterialPage.vue

@@ -66,11 +66,13 @@
     </el-table-column>
     <el-table-column label="操作">
       <template #default="scope">
-        <el-popconfirm @confirm="deleteMaterialFunc(scope.row.stuffId)" title="确定删除该广告吗?">
-          <template #reference>
-            <el-button link type="primary" size="small">删除</el-button>
-          </template>
-        </el-popconfirm>
+        <div v-if="scope.row.status !== 10" style="display: inline-block">
+          <el-popconfirm @confirm="deleteMaterialFunc(scope.row.stuffId)" title="确定删除该广告吗?">
+            <template #reference>
+              <el-button link type="primary" size="small">删除</el-button>
+            </template>
+          </el-popconfirm>
+        </div>
         <el-popconfirm
           title="确定启用该素材吗?"
           v-if="scope.row.status == 6 || scope.row.status == 8 || scope.row.status == 4"

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott