liyongli 2 år sedan
förälder
incheckning
241162282a

+ 8 - 2
public/index.html

@@ -4,8 +4,14 @@
 <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <script src="cxzx.smcic.net/topic/tool/js/index.min.js"></script>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
+    <script src="https://cdn.bootcdn.net/ajax/libs/eruda/2.5.0/eruda.min.js"></script>
+    <script>
+        window.eruda.init({
+            tool: ["console", "network", "info", "resource"],
+        });
+    </script>
+    <script src="https://cxzx.smcic.net/topic/highSpeed/index.min.js"></script>
 </head>
 
 <body>

+ 1 - 1
saveOSSAGitte.js

@@ -12,7 +12,7 @@ const { execSync } = require("child_process");
       execSync("git add .");
       execSync(`git commit -m "${process.argv[2] || '提交'}"`);
       execSync("git push -u origin master");
-      execSync("git push -u github master");
+    //   execSync("git push -u github master");
       console.log("上传git---完成");
     } catch (e) {
       console.log("上传git---失败");

+ 1 - 1
src/assets/css/base.css

@@ -5,5 +5,5 @@
 html,body{
     width: 100vw;
     height: 100vh;
-    font-family: 'Courier New', Courier, monospace;
+    font-family: "Microsoft Yahei", helvetica, sans-serif;
 }

BIN
src/assets/img/soundbyte.jpg


BIN
src/assets/img/title.png


+ 116 - 0
src/components/video.vue

@@ -0,0 +1,116 @@
+<template>
+  <div class="sgVideo">
+    <video
+      v-if="nouseVideo"
+      :src="props.url"
+      ref="Propaganda"
+      x-webkit-airplay="allow"
+      x5-video-player-type="h5"
+      x5-video-player-fullscreen="true"
+      x5-video-orientation="portraint"
+      x5-playsinline
+      loop
+      controls
+      onContextMenu="return false"
+      onSelectStart="return false"
+      @durationchange="durationchange"
+    ></video>
+    <iframe v-else :src="props.url" frameborder="0"></iframe>
+    <div class="mo" v-if="nouseVideo"></div>
+
+    <svg
+      t="1667978418661"
+      class="play"
+      viewBox="0 0 1024 1024"
+      version="1.1"
+      xmlns="http://www.w3.org/2000/svg"
+      p-id="2541"
+      :width="ScreenWidth * 0.1"
+      :height="ScreenWidth * 0.1"
+      @click="play"
+    >
+      <path
+        d="M512 74.666667C270.933333 74.666667 74.666667 270.933333 74.666667 512S270.933333 949.333333 512 949.333333 949.333333 753.066667 949.333333 512 753.066667 74.666667 512 74.666667z m0 810.666666c-204.8 0-373.333333-168.533333-373.333333-373.333333S307.2 138.666667 512 138.666667 885.333333 307.2 885.333333 512 716.8 885.333333 512 885.333333z"
+        p-id="2542"
+        fill="#e6e6e6"
+      ></path>
+      <path
+        d="M708.266667 465.066667l-234.666667-134.4c-8.533333-4.266667-17.066667-6.4-25.6-6.4-29.866667 0-53.333333 23.466667-53.333333 53.333333v268.8c0 8.533333 2.133333 19.2 6.4 25.6 10.666667 17.066667 27.733333 27.733333 46.933333 27.733333 8.533333 0 17.066667-2.133333 25.6-6.4l234.666667-134.4c8.533333-4.266667 14.933333-10.666667 19.2-19.2 6.4-12.8 8.533333-27.733333 4.266666-40.533333-2.133333-14.933333-10.666667-25.6-23.466666-34.133333z m-249.6 162.133333V396.8L661.333333 512l-202.666666 115.2z"
+        p-id="2543"
+        fill="#e6e6e6"
+      ></path>
+    </svg>
+  </div>
+</template>
+<script setup>
+// import { reactive } from "vue";
+import { ref, defineProps, onMounted } from "vue";
+import { isAndroid, isWechat } from "../utils/isTerminal";
+const props = defineProps({
+  url: {
+    type: String, //参数类型
+    default: String, //默认值
+    required: true, //是否必须传递
+  },
+});
+const nouseVideo = ref(!isWechat && isAndroid); // 判断是否在安卓浏览器环境下
+/**
+ * window.$originData.orginParames.title 页面标题
+ * window.$originData.orginParames.parameters 固定参数值
+ * window.$originData.urlParames url参数
+ */
+const ScreenWidth = ref(window.$originData.orginParames.availWidth);
+const Propaganda = ref(null);
+onMounted(() => {});
+function durationchange() {
+  const element = Propaganda.value;
+  if (element.duration <= 0) return;
+  element.currentTime = 0.01; // 防止微信浏览器不能加载封面
+
+  if (element.value) return;
+  const h = (element.videoHeight * ScreenWidth.value) / element.videoWidth;
+  element.style.marginTop = h * 0.3 * -1 + "px";
+  element.height = h * 1.6;
+  document.querySelector(".sgVideo").style.height = h + "px";
+}
+
+function play() {
+  console.log(
+    "-->",
+    document.getElementsByTagName("iframe")[0].contentWindow.document.body
+  );
+  if (nouseVideo.value) return;
+  Propaganda.value.play();
+  document.querySelector(".play").style.display = "none";
+}
+</script>
+<style scoped>
+.sgVideo > video,
+.sgVideo iframe {
+  pointer-events: none;
+  width: 100%;
+  background-color: #000;
+}
+.sgVideo {
+  position: relative;
+  overflow: hidden;
+}
+.sgVideo .play {
+  position: absolute;
+  z-index: 2;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+.sgVideo .mo {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 1;
+}
+video::-webkit-media-controls {
+  display: none !important;
+}
+</style>

+ 4 - 0
src/config/page.json

@@ -2,5 +2,9 @@
     "WorldCup": {
         "title": "世界杯",
         "parameters": {}
+    },
+    "Soundbyte":{
+        "title": "战马音浪,非同凡响",
+        "parameters": {}
     }
 }

+ 3 - 11
src/config/pageConfig.js

@@ -1,5 +1,5 @@
 const jsonData = require("./page.json");
-const { loadScript } = require("../utils/tool");
+// const { loadScript } = require("../utils/tool");
 
 /**
  * 解析地址url以及配置传参
@@ -20,6 +20,8 @@ export function getPageParameters() {
     urlParames: parames,
     orginParames: {
       ...jsonData[key],
+      availWidth: window.screen.availWidth,
+      availHeight: window.screen.availHeight,
       processBaseUrl: process.env.VUE_APP_REQ_URL,
       env: process.env.VUE_APP_ENV,
     },
@@ -34,16 +36,6 @@ export function environment() {
   switch (env) {
     case "Dev":
       console.log("--->开发环境下导入eruda");
-      loadScript(
-        "https://cdn.bootcdn.net/ajax/libs/eruda/2.5.0/eruda.min.js?" +
-          Date.now(),
-        function () {
-          window.eruda &&
-            window.eruda.init({
-              tool: ["console", "network", "info", "resource"],
-            });
-        }
-      );
       break;
   }
 }

+ 98 - 0
src/view/Soundbyte/index.js

@@ -0,0 +1,98 @@
+import App from "./index.vue";
+import "@/assets/js/common";
+import { createApp } from "vue";
+import { getPageParameters, environment } from "../../config/pageConfig";
+import {
+  isIpad,
+  isIpod,
+  isIphone,
+  isWindows,
+  isMac,
+} from "../../utils/isTerminal";
+// 判断环境
+environment();
+window.$originData = getPageParameters();
+document.title = window.$originData.orginParames.title || "";
+
+const getUser = () => {
+  window.$shanshipin = {};
+  // 判断闪视频登录状态
+  if (isWindows || isMac) return createApp(App).mount("#app");
+  // 获取登录信息
+  if (isIpad || isIpod || isIphone) {
+    if (!window.webkit) return createApp(App).mount("#app");
+    window.setUser = user => {
+      if (user == "{}")
+        return window.webkit.messageHandlers.iosJumpLogin.postMessage([]);
+      const u1 = JSON.parse(user || "{}");
+      window.webkit.messageHandlers.getAppInfo.postMessage([]);
+      window.setAppInfo = userJson => {
+        const u2 = JSON.parse(userJson || "{}");
+        window.$shanshipin = {
+          ...u1,
+          ...u2,
+        };
+        u1.UserId && createApp(App).mount("#app");
+      };
+    };
+
+    window.webkit.messageHandlers.tideGetUser.postMessage([]);
+  } else {
+    if (!window.TideApp) return createApp(App).mount("#app");
+    const u1 = JSON.parse(window.TideApp.getUser() || "{}");
+    console.log("u1", u1);
+    if (!u1.UserId) window.TideApp.login();
+    const u2 = JSON.parse(window.TideApp.getAppInfo() || "{}");
+    console.log("u2", u2);
+    window.$shanshipin = {
+      ...u1,
+      ...u2,
+    };
+    u1.UserId && createApp(App).mount("#app");
+  }
+};
+getUser();
+
+window.setUserSession = () => {
+  console.log("登录");
+  getUser();
+};
+
+// 分享
+document.addEventListener("weixin_Share_Init", () => {
+  window.weixin_Share_Init(
+    "战马音浪,非同凡响",
+    "",
+    "https://cxzx.smcic.net/topic/highSpeed/img/logo3.png"
+  );
+});
+
+var SL = new window.SmcicLogger("shanshipin", "c6124d95");
+SL.Util.SetUrl("https://collect.smcic.net:8443/");
+SL.Systematic.Init({
+  appid: "c6124d95",
+  channel: "shanshipin",
+  model: "",
+  os: "",
+  os_version: "",
+  carrier: "",
+  network_type: "",
+  ip: "",
+  app_name: "",
+  app_version: "",
+  build_version: "",
+  platform_type: "",
+});
+SL.Content.CommodityDetail({
+  commodity_detail_source: "活动",
+  commodity_id: "",
+  commodity_name: document.title,
+  publisher_name: "",
+  publisher_id: "",
+  review_count: 0,
+  comment_count: 0,
+  collect_count: 0,
+  share_count: 0,
+  like_count: 0,
+  tag: [],
+});

+ 281 - 0
src/view/Soundbyte/index.vue

@@ -0,0 +1,281 @@
+<template>
+  <div class="Soundbyte">
+    <van-image :width="topWidth" :height="topWidth / 1.7" :src="soundbyteJpg" />
+    <van-cell-group inset>
+      <van-nav-bar title="活动介绍" />
+      <p
+        style="
+          text-indent: 2em;
+          padding: 8px 8px 0 8px;
+          text-align: justify;
+          line-height: 1.5em;
+          font-size: 16px;
+        "
+      >
+        新学期伊始,依托陕西音乐广播强大社会影响力、收听率,以及深入年轻群体的《西安人的歌》,联合战马饮料,共同打造“星声代”校园音乐IP——【战马音浪·校园歌手大赛】。
+      </p>
+      <p
+        style="
+          text-indent: 2em;
+          padding: 0 8px 8px 8px;
+          text-align: justify;
+          line-height: 1.5em;
+          font-size: 16px;
+        "
+      >
+        赛事全程将通过闪视频APP、FM98.8《西安人的歌》深度挖掘“音乐、能量、青春、活力、潮流、极致”的精神内核,与热爱音乐的学生产生共鸣,为校园文化艺术生活赋能!
+      </p>
+    </van-cell-group>
+    <br />
+    <van-form @submit="onSubmit">
+      <van-cell-group inset>
+        <van-nav-bar title="报名信息" />
+        <van-field
+          required
+          v-model="from.name"
+          label="选手姓名"
+          placeholder="请输入用户名"
+          :rules="[{ validator: isString, message: '请输入正确内容' }]"
+        />
+        <van-field
+          required
+          v-model.number="from.tel"
+          label="联系方式"
+          type="tel"
+          maxlength="11"
+          placeholder="请输入手机号"
+          :rules="[{ validator: isNumber, message: '请输入正确内容' }]"
+        />
+        <van-field
+          required
+          v-model="from.university"
+          label="参赛院校"
+          placeholder="请输入院校名称"
+          :rules="[{ validator: isString, message: '请输入正确内容' }]"
+        />
+        <van-field
+          placeholder="上传作品"
+          required
+          label="上传作品"
+          :rules="[{ validator: isFile, message: '请输入正确内容' }]"
+        >
+          <template #input>
+            <van-uploader
+              accept="video/*"
+              v-model="from.file"
+              :max-count="1"
+              :max-size="524288000"
+              @oversize="filesize"
+            >
+              <template #preview-cover>
+                <van-icon
+                  color="#fff"
+                  size="40"
+                  @click="previewClick"
+                  name="play-circle-o play"
+                />
+              </template>
+            </van-uploader>
+          </template>
+        </van-field>
+        <div style="padding: 5px">
+          <van-button block type="danger" native-type="submit">
+            我要报名
+          </van-button>
+        </div>
+      </van-cell-group>
+    </van-form>
+    <br />
+
+    <div class="guize" @click="showGuize">活动规则</div>
+
+    <div
+      class="Preview"
+      :style="preview !== '' ? '' : 'z-index: -1;opacity: 0'"
+    >
+      <van-icon
+        name="close"
+        color="#fff"
+        size="30"
+        class="close"
+        @click="closePreview"
+      />
+      <video ref="previewVideo" controls :src="preview"></video>
+    </div>
+  </div>
+</template>
+<script setup>
+// import { onMounted, reactive } from "vue";
+import { ref, reactive } from "vue";
+import { Toast, Dialog } from "vant";
+import soundbyteJpg from "../../assets/img/soundbyte.jpg";
+/**
+ * window.$originData.orginParames.title 页面标题
+ * window.$originData.orginParames.parameters 固定参数值
+ * window.$originData.urlParames url参数
+ */
+const topWidth = ref(window.$originData.orginParames.availWidth);
+const preview = ref("");
+const previewVideo = ref(null);
+const shanshipin = window.$shanshipin || {};
+const from = reactive({
+  name: shanshipin.UserName || "",
+  tel:
+    !isNaN(shanshipin.Phone) && Number(shanshipin.Phone)
+      ? shanshipin.Phone
+      : "",
+  university: "",
+  file: [],
+});
+
+const filesize = () => Toast("超出文件大小限制");
+const previewClick = () => {
+  let getUrl = null;
+  const file = from.file[0].file;
+  if (window.createObjectURL != undefined) {
+    //basic
+    getUrl = window.createObjectURL(file);
+  } else if (window.URL != undefined) {
+    //window.URL 标准定义
+    getUrl = window.URL.createObjectURL(file);
+  } else if (window.webkitURL != undefined) {
+    //window.webkitURL是webkit的内核
+    //webkit or chrome
+    getUrl = window.webkitURL.createObjectURL(file);
+  }
+  preview.value = getUrl;
+  previewVideo.value.play();
+};
+const closePreview = () => {
+  preview.value = "";
+};
+
+const showGuize = () => {
+  Dialog.alert({
+    title: "活动规则",
+    messageAlign: "left",
+    confirmButtonText: "关闭",
+    message:
+      "1、报名时间:即日起至2022年11月26日。\n2、活动时间:11月16日 20:00--22:00。\n3、赛事举办形式:闪视频APP线上直播参赛。\n4、参与对象:西安各高校学生。\n5、参赛要求:曲风不限,自行准备演唱伴奏。\n6、评比规则:唱功为基本要求,结合现场舞台表现,演唱发挥进行综合评分。每所高校报名推选15-20人(组)进入半决赛,每场半决赛产生前五强,并根据个人综合表现评出“战马人物”,评委拥有1张决赛PASS卡。\n7、嘉宾评委:陕西广播电台音乐类主播/西安知名音乐人/歌手。",
+  });
+};
+
+const isString = v => {
+  return !!v && typeof v == "string" && isNaN(v);
+};
+const isNumber = v => {
+  return !!v && !isNaN(v);
+};
+const isFile = () => {
+  return from.file && from.file.length;
+};
+
+const onSubmit = () => {
+  if (!isFile) Toast("请上传作品");
+  console.log("--", from);
+  const oriData = new FormData();
+  oriData.append("name", from.name);
+  oriData.append("tel", from.tel);
+  oriData.append("university", from.university);
+  oriData.append("file", from.file[0]);
+
+  var xhttp;
+  Toast.loading({
+    message: "加载中...",
+    forbidClick: true,
+    duration: 0,
+  });
+  if (window.XMLHttpRequest) xhttp = new XMLHttpRequest();
+  else if (window.ActiveXObject)
+    xhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
+  xhttp.open("POST", "", true);
+  xhttp.setRequestHeader("Content-type", "application/json");
+  xhttp.send(JSON.stringify(oriData));
+  xhttp.onreadystatechange = function () {
+    if (this.readyState != 4) return;
+    Toast.clear();
+    if (this.status != 200) return Toast("请求失败 " + this.status);
+    let data = {};
+    try {
+      data = this.responseText || "";
+      console.log("--->", data);
+    } catch (err) {
+      Toast("请求失败");
+      console.error(err);
+    }
+  };
+};
+</script>
+<style>
+.Soundbyte {
+  width: 100vw;
+  min-height: 100vh;
+  background-color: #0c0000;
+  font-weight: 400;
+}
+.Soundbyte .van-hairline--bottom:after {
+  border-bottom-width: 0px;
+}
+.Soundbyte .van-nav-bar__content {
+  background-image: url("../../assets/img/title.png");
+  background-size: 100% 100%;
+  background-repeat: no-repeat;
+}
+.Soundbyte .van-nav-bar__title {
+  color: #f63634;
+  font-size: 23px;
+}
+.Soundbyte .van-button__text {
+  font-size: 15px;
+  font-weight: 400;
+}
+.Soundbyte .van-uploader__preview-cover {
+  background-color: #000;
+}
+.van-uploader__preview-cover video {
+  width: 100%;
+  height: 100%;
+}
+.Soundbyte .play {
+  position: relative;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+.Soundbyte .Preview {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background-color: rgba(0, 0, 0, 0.3);
+  z-index: 10;
+}
+.Soundbyte .Preview video {
+  position: absolute;
+  left: 0;
+  top: 50%;
+  transform: translateY(-50%);
+  width: 100vw;
+  max-width: 100vh;
+  background: #000;
+}
+.Soundbyte .Preview .close {
+  position: absolute;
+  right: 5px;
+  top: 5px;
+}
+.Soundbyte .guize {
+  background-color: #ff2c2c;
+  position: fixed;
+  right: 0;
+  top: 2em;
+  color: #fff;
+  font-weight: 400;
+  font-size: 16px;
+  padding: 3px 5px 3px 15px;
+  border-top-left-radius: 1em;
+  border-bottom-left-radius: 1em;
+  z-index: 11;
+}
+</style>

+ 9 - 11
src/view/WorldCup/index.js

@@ -1,11 +1,9 @@
-
-        import App from './index.vue'
-        import "@/assets/js/common"
-        import {createApp} from 'vue'
-        import {getPageParameters, environment} from "../../config/pageConfig"
-        // 判断环境
-        environment();
-        window.$originData = getPageParameters();
-        document.title = window.$originData.orginParames.title || "";
-        createApp(App).mount('#app');
-        
+import App from "./index.vue";
+import "@/assets/js/common";
+import { createApp } from "vue";
+import { getPageParameters, environment } from "../../config/pageConfig";
+// 判断环境
+environment();
+window.$originData = getPageParameters();
+document.title = window.$originData.orginParames.title || "";
+createApp(App).mount("#app");

+ 75 - 20
src/view/WorldCup/index.vue

@@ -1,21 +1,76 @@
+<template>
+  <div class="WorldCup">
+    <!-- 背景图 -->
+    <img
+      src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
+      style="width: 100%"
+    />
+    <!-- 宣传视频 -->
+    <!-- <video
+      preload="metadata"
+      crossorigin="anonymous"
+      class="video_fill"
+    >
+      您的浏览器不支持 video 标签
+    </video> -->
+    <gsVideo url="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" />
+    <!-- 活动介绍 -->
+    <div>
+      <van-cell-group>
+        <van-cell title="活动介绍" />
+      </van-cell-group>
+    </div>
+    <!-- 投稿区域 -->
+    <div>
+      <van-cell-group>
+        <van-cell title="投稿区域" />
+      </van-cell-group>
+    </div>
+    <!-- 投稿排行 -->
+    <div>
+      <van-cell-group>
+        <van-cell title="投稿排行" />
+      </van-cell-group>
+    </div>
+    <!-- 弹幕 -->
+    <div>
+      <van-cell-group inset>
+        <van-field v-model="sms" center clearable placeholder="请输入弹幕">
+          <template #button>
+            <van-button size="small" type="primary">发送</van-button>
+          </template>
+        </van-field>
+      </van-cell-group>
+    </div>
+    <!-- 冠军预测 -->
+    <div>
+      <van-cell-group>
+        <van-cell title="冠军预测" />
+      </van-cell-group>
+    </div>
+  </div>
+</template>
+<script setup>
+// import { reactive } from "vue";
+import { ref, onMounted } from "vue";
+import gsVideo from "@/components/video.vue";
+// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
+/**
+ * window.$originData.orginParames.title 页面标题
+ * window.$originData.orginParames.parameters 固定参数值
+ * window.$originData.urlParames url参数
+ */
+const sms = ref("");
 
-        <template>
-            <div class="WorldCup"></div>
-        </template>
-        <script setup>
-            // import { onMounted, reactive } from "vue";
-            // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
-            /**
-             * window.$originData.orginParames.title 页面标题
-             * window.$originData.orginParames.parameters 固定参数值
-             * window.$originData.urlParames url参数
-             */
-            console.log(window.$originData)
-        </script>
-        <style>
-            .WorldCup {
-                width: 100vw;
-                height: 100vh;
-            }
-        </style>
-        
+onMounted(() => {});
+
+
+</script>
+<style>
+.WorldCup {
+  width: 100vw;
+  height: 100vh;
+  font-size: 0;
+}
+
+</style>