liyongli 1 anno fa
parent
commit
4c3e417eee
2 ha cambiato i file con 26 aggiunte e 16 eliminazioni
  1. 3 9
      src/utils/tool.js
  2. 23 7
      src/view/finance/index.vue

+ 3 - 9
src/utils/tool.js

@@ -110,19 +110,13 @@ export async function canvasToImage(layers) {
     } else if (v.type === 'redius_image') {
       const img_lever_0 = await createDate(v.src0);
       const img_lever_1 = v.src1;
+      const w = (img_lever_0.width * v.height) / img_lever_0.height;
       ctx.drawImage(img_lever_1, 0, 0, layers.width, layers.height);
       ctx.save();
       ctx.beginPath();
-      ctx.arc(
-        v.arc_x,
-        v.arc_y,
-        v.width / 2,
-        0,
-        Math.PI * 2,
-        false
-      );
+      ctx.arc(v.arc_x, v.arc_y, v.width / 2, 0, Math.PI * 2, false);
       ctx.clip();
-      ctx.drawImage(img_lever_0, v.x, v.y, v.width, v.height);
+      ctx.drawImage(img_lever_0, v.x - (w - v.width) / 2, v.y, w, v.height);
       ctx.restore();
     } else if (v.type === 'text') {
       ctx.font = v.font;

+ 23 - 7
src/view/finance/index.vue

@@ -73,12 +73,16 @@
           <van-tab :title="_sort[key]" v-for="(v, key) in rankList" :key="key">
             <div class="SilkList">
               <van-cell-group inset>
-                <van-row>
+                <van-row style="margin: 0 1em;">
                   <van-col span="7">
                     <!-- 第二名 -->
                     <br />
                     <br />
-                    <img :src="v[1].cover" style="width: 100%" />
+                    <img
+                      @click="() => select_act(v[1])"
+                      :src="v[1].cover"
+                      style="width: 100%"
+                    />
                     <div class="van-ellipsis" style="text-align: center">
                       {{ v[1].name }}
                     </div>
@@ -88,7 +92,11 @@
                   </van-col>
                   <van-col span="10">
                     <!-- 第一名 -->
-                    <img :src="v[0].cover" style="width: 100%" />
+                    <img
+                      @click="() => select_act(v[0])"
+                      :src="v[0].cover"
+                      style="width: 100%"
+                    />
                     <div class="van-ellipsis" style="text-align: center">
                       {{ v[0].name }}
                     </div>
@@ -100,7 +108,11 @@
                     <!-- 第三名 -->
                     <br />
                     <br />
-                    <img :src="v[2].cover" style="width: 100%" />
+                    <img
+                      @click="() => select_act(v[2])"
+                      :src="v[2].cover"
+                      style="width: 100%"
+                    />
                     <div class="van-ellipsis" style="text-align: center">
                       {{ v[2].name }}
                     </div>
@@ -253,7 +265,7 @@
 <script setup>
 import { ref, reactive, watch, onMounted } from 'vue';
 import QRCode from 'qrcode';
-import { showDialog, showConfirmDialog, showToast } from 'vant';
+import { showDialog, showConfirmDialog, showToast, showNotify } from 'vant';
 import {
   getEnrollList,
   getEnrollRank,
@@ -306,6 +318,10 @@ let clod1 = null;
 let clod2 = null;
 let clod3 = null;
 
+const select_act = item => {
+  showNotify({ message: item.name, color: '#000000', background: '#ffffff' });
+};
+
 const getList = call => {
   loading.value = true;
   getEnrollList({
@@ -455,7 +471,7 @@ const cancel = async () => {
   const layers = {
     list: [
       {
-        type: 'image',
+        type: 'new_image',
         image,
         width: w,
         height: w,
@@ -622,7 +638,7 @@ const showGuize = () => {
 };
 
 const paiming = () => {
-  if (!config.isShanShiPin) return showToast('下载闪视频查看投票结果。');
+  //   if (!config.isShanShiPin) return showToast('下载闪视频查看投票结果。');
   getRankList(() => {
     showPaihang.value = true;
   });