liyongli 1 tahun lalu
induk
melakukan
84ceb69014
1 mengubah file dengan 126 tambahan dan 4 penghapusan
  1. 126 4
      src/view/finance/index.vue

+ 126 - 4
src/view/finance/index.vue

@@ -123,6 +123,58 @@
         <van-field required v-model="login.code" type="digit" label="验证码" />
       </van-cell-group>
     </van-dialog>
+    <!-- 候选人详情框 -->
+    <van-dialog
+      v-model:show="hxrDialog"
+      confirm-button-text="分享"
+      cancel-button-text="投票"
+      showCancelButton
+      @confirm="shear_page"
+      @cancel="tp_btn"
+      style="padding: 5px"
+    >
+      <van-row>
+        <van-col span="5" style="text-align: center">
+          <van-image
+            round
+            width="3rem"
+            height="3rem"
+            :src="create_url_image(selectItem.workTitle)"
+          />
+        </van-col>
+        <van-col span="19">
+          <div class="van-ellipsis" v-text="selectItem.name"></div>
+          <div class="van-ellipsis unit" v-text="selectItem.university"></div>
+        </van-col>
+      </van-row>
+      <div style="position: relative" @click="toDetal(selectItem.file)">
+        <van-icon
+          size="50"
+          color="#fff"
+          name="play-circle-o"
+          style="
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+          "
+        />
+        <img
+          :src="create_url_image(selectItem.workTitle)"
+          style="width: 100%"
+        />
+      </div>
+    </van-dialog>
+
+    <van-share-sheet
+      v-model:show="showShare"
+      title="立即分享给好友"
+      :options="[
+        { name: '微信', icon: 'wechat' },
+        { name: '微信朋友圈', icon: 'wechat-moments' },
+      ]"
+      @select="onSelect"
+    />
   </div>
 </template>
 <script setup>
@@ -144,8 +196,11 @@ const w = window.$originData.orginParames.availWidth || 0;
 const operateId = window.$originData.orginParames.operateId;
 const width = (w - 16) / 2;
 const height = width * 0.57;
+const hxrDialog = ref(false);
 const showPaihang = ref(false);
 const showLogin = ref(false);
+const showShare = ref(false);
+const selectItem = ref({});
 
 const rankList = ref({});
 const orilist = ref([]);
@@ -221,6 +276,70 @@ const getRankList = Call => {
   });
 };
 
+const shear_page = () => {
+  // 分享
+  console.log(window.wx);
+  if (window.wx) showShare.value = true;
+  else showToast('请稍后');
+};
+let time_share = undefined;
+const onSelect = val => {
+  if (time_share) clearTimeout(time_share);
+  setTimeout(() => {
+    clearTimeout(time_share);
+    // 朋友圈
+    if(val.name === '朋友圈') window.WeixinJSBridge.invoke('shareTimeline', {
+      img_url: 'https://cxzx.smcic.net/topic/tool/img/silulogo.jpg',
+      //"img_width":"640",
+      //"img_height":"640",
+      link:
+        'https://cxzx.smcic.net/topic/activity/finance.html?id=' +
+        selectItem.value.id,
+      desc: selectItem.value.university,
+      title: selectItem.value.name,
+    });
+    // 微信
+    if(val.name === '微信') window.WeixinJSBridge.invoke('sendAppMessage', {
+      img_url: 'https://cxzx.smcic.net/topic/tool/img/silulogo.jpg',
+      link:
+        'https://cxzx.smcic.net/topic/activity/finance.html?id=' +
+        selectItem.value.id,
+      desc: selectItem.value.university,
+      title: selectItem.value.name,
+    });
+  }, 200);
+};
+
+const tp_btn = () => {
+  // 投票
+  if (!login.phone || login.phone.length < 11) return (showLogin.value = true); //如果没有手机号提示登录
+  showConfirmDialog({
+    message: '确定投票给' + selectItem.value.name + '么?',
+    beforeClose: type => {
+      if (type !== 'confirm') return true;
+      return new Promise(resolve => {
+        getVote({
+          target: [selectItem.value.phone],
+          source: login.phone,
+          client: config.isShanShiPin ? '闪视频' : '其他',
+          operateId,
+        })
+          .then(() => {
+            showToast('投票成功!');
+            resolve(true);
+          })
+          .catch(err => {
+            showToast(err.message || '投票失败!');
+            resolve(true);
+          });
+      });
+    },
+  });
+};
+const toDetal = file => {
+  location.href = file;
+};
+
 let time = null;
 watch(search, res => {
   if (time) clearTimeout(time);
@@ -325,16 +444,16 @@ const showGuize = () => {
         </p>
         <p>2、投票时间:2023年12月15日9:00至12月21日9:00(共7天)。</p>
         <p>
-            3、投票内容:网络短视频作品137件。(分为党建引领、金融知识类、风险防范、金融服务四大类),优秀宣讲员作品27件。
+          3、投票内容:网络短视频作品137件。(分为党建引领、金融知识类、风险防范、金融服务四大类),优秀宣讲员作品27件。
         </p>
         <p>
-            4、投票形式:通过微信H5或者闪视频APP进行线上投票,可分享拉票,助力你支持的作品、宣讲员登上排名。
+          4、投票形式:通过微信H5或者闪视频APP进行线上投票,可分享拉票,助力你支持的作品、宣讲员登上排名。
         </p>
         <p>
           5、投票须知:每个用户每日的票数固定,即可分散投票,也可集中投票,每人每天10票。
         </p>
         <p>
-            本次投票活动公开透明,排行榜实时更新,如有违法一经查实将取消参赛资格,最终解释权归主办方所有。
+          本次投票活动公开透明,排行榜实时更新,如有违法一经查实将取消参赛资格,最终解释权归主办方所有。
         </p>
       </div>
     ),
@@ -363,7 +482,10 @@ const formmate = num => {
 };
 
 const clickShowVideo = item => {
-  location.href = item.file;
+  //   location.href = item.file;
+  console.log(item);
+  selectItem.value = item || {};
+  hxrDialog.value = true;
 };
 </script>
 <style lang="scss">