Преглед на файлове

Merge branch 'release/v5.4.1'

zengzhixiang преди 2 години
родител
ревизия
e129463381

+ 1 - 1
.env.test

@@ -10,7 +10,7 @@ API_URL_BROWSER = "/api"
 FILE_PREFIX = "/"
 FILE_HOST = "file.phone.androidscloud.com"
 FILE_PORT = 8121
-FILE_UPLOAD_KEY = "3dn9b4585511476691c6"
+FILE_UPLOAD_KEY = "13d0arghebcc4cm49cf04"
 FILE_HTTPS = true
 
 # 友盟统计

+ 9 - 0
app.html

@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html {{ HTML_ATTRS }}>
+  <head {{ HEAD_ATTRS }}>
+    {{ HEAD }}
+  </head>
+  <body {{ BODY_ATTRS }}>
+    {{ APP }}
+  </body>
+</html>

BIN
assets/image/activity/invite-user/bg-3@2x.png


BIN
assets/image/activity/invite-user/cybz-content-3@2x.png


BIN
assets/image/activity/invite-user/guide/Union.png


BIN
assets/image/activity/invite-user/guide/left.png


+ 4 - 0
assets/style/main.scss

@@ -4,4 +4,8 @@ html {
   // * {
   //   box-sizing: inherit;
   // }
+  // overscroll-behavior-y: contain;
+}
+body {
+  // overscroll-behavior-y: contain;
 }

+ 3 - 0
modules/postcss-px-to-viewport.js

@@ -12,8 +12,11 @@ export default function () {
     buildOptions.postcss.plugins = buildOptions.postcss.plugins || {};
 
     buildOptions.postcss.plugins['postcss-px-to-viewport'] = {
+      unitToConvert: 'px',
       viewportWidth: 375,
       unitPrecision: 10,
+      viewportUnit: 'vw',
+      mediaQuery: false,
     };
   });
 }

Файловите разлики са ограничени, защото са твърде много
+ 3251 - 650
package-lock.json


+ 1 - 2
package.json

@@ -74,8 +74,7 @@
     "postcss": "^8",
     "postcss-html": "^1.3.0",
     "postcss-loader": "^4",
-    "postcss-px-to-viewport": "^1.1.1",
-    "postcss-px-to-viewport-8-plugin": "^1.1.5",
+    "postcss-px-to-viewport": "https://github.com/evrone/postcss-px-to-viewport/tarball/master",
     "prettier": "^2.5.1",
     "stylelint": "^14.1.0",
     "stylelint-config-prettier": "^9.0.3",

+ 219 - 0
pages/activity/invite-user/guide-pc.vue

@@ -0,0 +1,219 @@
+<template>
+  <div class="bg-guide">
+    <v-carousel :show-arrows="false" cycle interval="3000" height="120" hide-delimiter-background class="w345h120" delimiter-icon="mdi-minus">
+      <v-carousel-item v-for="item in topADList" :key="item.id">
+        <img :src="item.imgUrls[0]" style="width: 100%;height: 100%;" alt="" @click="playAd(item)">
+      </v-carousel-item>
+    </v-carousel>
+    <v-tabs v-model="tab" color="#3666F2" background-color="transparent" style="height: 42px;">
+      <v-tab v-for="item in videoList" :key="item.plateId" style="height: 42px;">{{item.plateName}}</v-tab>
+      <v-tabs-items v-model="tab">
+        <v-tab-item v-for="(item, num) in videoList" :key="item.plateId" style="background: #FAFAFA;min-height: calc(100vh - 162px);padding: 10px;">
+          <v-container>
+            <v-row>
+              <v-col v-for="(ele, i) in item.videoCourseList" :key="ele.id" xl="2" lg="2" md="3" sm="3" xs="4" class="video-card">
+                <img class="w165h148" :src="videoURL(ele.coverImageKey)" @click="play(item, ele, num, i)" />
+              </v-col>
+            </v-row>
+          </v-container>
+        </v-tab-item>
+      </v-tabs-items>
+    </v-tabs>
+    <div v-show="showVideo" class="videobox">
+      <div v-for="e in videoList" :key="e.plateId">
+        <video 
+          v-for="element in e.videoCourseList" :id="'el-video-' + element.id" :key="element.id" :class="element.isShow ? '' : 'hide'" controls :src="videoURL(element.videoKey)" preload="auto" webkit-playsinline="true"
+          playsinline="true" x-webkit-airplay="allow" x5-video-player-type="h5-page" x5-video-player-fullscreen="true" x5-video-orientation="portraint" style="object-fit:contain">
+        </video>
+      </div>
+    </div>
+    <img v-if="showVideo" class="wh24" src="~/assets/image/activity/invite-user/guide/Union.png" alt="" @click="close">
+  </div>
+</template>
+
+<script>
+import { fileKeyToUrl } from '@/plugins/file-center.js';
+export default {
+  name: 'GuidePc',
+  auth: false,
+  data() {
+    return {
+      tab: null,
+      videoList: [],
+      topADList: [],
+      token: '',
+      showVideo: false,
+      index: 0,
+      idx: 0
+    }
+  },
+  fetch() {
+    this.token = this.$route.query.token;
+  },
+  computed: {
+    videoURL() {
+      return (key) => {
+        return fileKeyToUrl(key)
+      }
+    }
+  },
+  created() {
+    this.getActiveInfo()
+    this.getAdInfoByAdPlace()
+  },
+  methods: {
+    close() {
+      this.showVideo = false
+      this.videoList[this.index].videoCourseList[this.idx].isShow = false
+      const elVideo = document.getElementById('el-video-' + this.videoList[this.index].videoCourseList[this.idx].id)
+      elVideo.pause()
+    },
+    async getActiveInfo() {
+      const res = await this.$axios.$get('/activity/videoCourse/client/list');
+      this.videoList = res.data;
+      res.data.forEach(item => {
+        item.videoCourseList.forEach(ele => {
+          ele.isShow = false
+        })
+      });
+    },
+    async getAdInfoByAdPlace() {
+      const data = {
+        adPlace: 20,
+        os: 0
+      }
+      const res = await this.$axios.$post('/public/v5/advertising/getAdInfoByAdPlace', data);
+      this.topADList = res.data;
+    },
+    play(item, ele, index, idx) {
+      this.showVideo = true
+      this.videoList[index].videoCourseList[idx].isShow = true
+      this.index = index
+      this.idx = idx
+      const elVideo = document.getElementById('el-video-' + ele.id)
+      elVideo.addEventListener("ended", () => {
+        elVideo.pause();
+        this.showVideo = false
+        this.videoList[index].videoCourseList[idx].isShow = false
+      });
+      elVideo.addEventListener("play", () => {
+        this.submit(item, ele, 1)
+      });
+    },
+    playAd(item) {
+      this.submit(item, '', 2)
+      if (item.actionType === '1' || item.actionType === '3' || item.actionType === '5' || item.actionType === '6') {
+        window.open(item.clickUrl, '_blank')
+      } else if (item.actionType === '4') {
+        window.open(item.deeplink, '_blank')
+      }
+    },
+    submit(item, ele, flag) {
+      const data = flag === 1 ? { id: ele.id, plateId: item.plateId, type: flag, videoId: ele.id } : { type: 2, adId: item.id, adName: item.title }
+      this.$axios.$post('/activity/videoCourse/statistics/save', data, { headers: { Authorization: this.token } });
+    }
+  }
+}
+</script>
+<style lang="scss">
+@media (min-width: 0px) {
+  .bg-guide {
+    & .v-tabs-bar {
+      height: 42px !important;
+    }
+    .v-btn--icon.v-size--small {
+      height: 15px;
+      width: 15px;
+    }
+  }
+}
+</style>
+<style lang="scss" scoped>
+.bgFAFAFA {
+  background: #fafafa;
+}
+@media (min-width: 0px) {
+  .wh24 {
+    width: 24px;
+    height: 24px;
+    position: fixed;
+    right: 20px;
+    top: 20px;
+    z-index: 4;
+  }
+  .hide {
+    display: none;
+  }
+  .videobox {
+    position: fixed;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    background: #1c1c1e;
+    z-index: 2;
+    width: 100vw;
+    height: 100vh;
+    overflow: hidden;
+  }
+
+  .videobox video {
+    height: 100vh;
+    width: 100vw;
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 3;
+  }
+  .video-card {
+    width: 165px;
+    height: 148px;
+    border-radius: 5px;
+    position: relative;
+    display: inline-block;
+    padding: 0;
+    margin-bottom: 10px;
+    z-index: 1;
+    & .video-card-title {
+      width: 100%;
+      height: 45px;
+      line-height: 45px;
+      text-align: center;
+      font-size: 14px;
+      font-weight: 500;
+      color: #1c1c1e;
+      background: #fff;
+      border-radius: 0 0 9px 9px;
+      position: absolute;
+      left: 0;
+      bottom: 0;
+    }
+  }
+  .bg-guide {
+    min-height: 100vh;
+    overflow: hidden;
+    & .v-tab {
+      font-size: 12px;
+      min-width: 88px;
+    }
+    & .v-tabs-bar {
+      height: 42px !important;
+    }
+  }
+  .w345h120 {
+    width: 345px;
+    height: 120px;
+    margin: 10px auto;
+    display: block;
+    background: #fafafa;
+    border-radius: 5px;
+  }
+  .w165h148 {
+    width: 165px;
+    height: 148px;
+    margin: 0 auto;
+    display: block;
+    border-radius: 10px;
+  }
+}
+</style>

+ 282 - 0
pages/activity/invite-user/guide.vue

@@ -0,0 +1,282 @@
+<template>
+  <div class="bg2C2C2D">
+    <v-carousel :show-arrows="false" cycle interval="3000" height="120" hide-delimiter-background class="w345h120" delimiter-icon="mdi-minus">
+      <v-carousel-item v-for="item in topADList" :key="item.id">
+        <img :src="item.imgUrls[0]" style="width: 100%;height: 100%;" alt="" @click="playAd(item)">
+      </v-carousel-item>
+    </v-carousel>
+    <div v-for="(item, num) in videoList" :key="item.plateId">
+      <div class="fs16">{{item.plateName}}</div>
+      <div :class="item.displayMode === 1 ? 'jcjc-list' : 'jjjc-list'">
+        <div v-for="(ele, i) in item.videoCourseList" :key="ele.id" class="video-card">
+          <img 
+            class="w165h148" :src="videoURL(ele.coverImageKey)" @click="play(item, ele, num, i)" />
+        </div>
+      </div>
+    </div>
+    <div v-show="showVideo" class="videobox">
+      <div v-for="e in videoList" :key="e.plateId">
+        <video
+          v-for="element in e.videoCourseList" :id="'el-video-' + element.id" :key="element.id" :class="element.isShow ? '' : 'hide'" controls :src="videoURL(element.videoKey)" preload="auto" webkit-playsinline="true" playsinline="true" x-webkit-airplay="allow" x5-video-player-type="h5-page" x5-video-player-fullscreen="true" x5-video-orientation="portraint"
+          style="object-fit:contain">
+        </video>
+      </div>
+    </div>
+    <img v-if="showVideo" class="wh24" src="~/assets/image/activity/invite-user/guide/Union.png" alt="" @click="close">
+  </div>
+</template>
+
+<script>
+import { fileKeyToUrl } from '@/plugins/file-center.js';
+export default {
+  name: 'Guide',
+  auth: false,
+  data() {
+    return {
+      videoList: [],
+      topADList: [],
+      token: '',
+      showVideo: false,
+      index: 0,
+      idx: 0
+    }
+  },
+  async fetch() {
+    if (this.$userAgent.isAndroid) {
+      this.token = await window.native.getToken();
+    } else {
+      this.token = this.$route.query.token;
+    }
+  },
+  computed: {
+    videoURL() {
+      return (key) => {
+        return fileKeyToUrl(key)
+      }
+    }
+  },
+  created() {
+    this.getActiveInfo()
+    this.getAdInfoByAdPlace()
+  },
+  methods: {
+    close() {
+      this.showVideo = false
+      this.videoList[this.index].videoCourseList[this.idx].isShow = false
+      const elVideo = document.getElementById('el-video-' + this.videoList[this.index].videoCourseList[this.idx].id)
+      elVideo.pause()
+    },
+    async getActiveInfo() {
+      const res = await this.$axios.$get('/activity/videoCourse/client/list');
+      res.data.forEach(item => {
+        item.videoCourseList.forEach(ele => {
+          ele.isShow = false
+        })
+      });
+      this.videoList = res.data
+    },
+    async getAdInfoByAdPlace() {
+      const data = {
+        adPlace: 20,
+        os: this.$userAgent.isAndroid ? 0 : this.$userAgent.isIos ? 1 : 3
+      }
+      const res = await this.$axios.$post('/public/v5/advertising/getAdInfoByAdPlace', data);
+      this.topADList = res.data;
+    },
+    play(item, ele, index, idx) {
+      this.showVideo = true
+      this.videoList[index].videoCourseList[idx].isShow = true
+      this.index = index
+      this.idx = idx
+      const elVideo = document.getElementById('el-video-' + ele.id)
+      elVideo.addEventListener("ended", () => {
+        elVideo.pause();
+        this.showVideo = false
+        this.videoList[index].videoCourseList[idx].isShow = false
+      });
+      elVideo.addEventListener("play", () => {
+        this.submit(item, ele, 1)
+      });
+    },
+    playAd(item) {
+      if (item.actionType === '1' || item.actionType === '3' || item.actionType === '5' || item.actionType === '6') {
+        window.open(item.clickUrl, '_blank')
+      } else if (item.actionType === '4') {
+        if (this.$userAgent.isIos) {
+          window.open(item.deeplink, '_blank')
+        } else if (this.$userAgent.isAndroid) {
+          window.open('qq://' + item.deeplink, '_blank')
+        } else {
+          window.open(item.deeplink, '_blank')
+        }
+      }
+      this.submit(item, '', 2)
+    },
+    submit(item, ele, flag) {
+      const data = flag === 1 ? { id: ele.id, plateId: item.plateId, type: flag, videoId: ele.id } : { type: 2, adId: item.id, adName: item.title }
+      this.$axios.$post('/activity/videoCourse/statistics/save', data, {headers: {Authorization: this.token}});
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.hide {
+  display: none;
+}
+.videobox {
+  position: fixed;
+  left: 0;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  background: #000;
+  z-index: 2;
+  width: 100vw;
+  height: 100vh;
+  overflow: hidden;
+}
+
+.wh24 {
+  width: 24px;
+  height: 24px;
+  margin: 10px auto;
+  position: fixed;
+  bottom: 0;
+  left: 50%;
+  margin-left: -12px;
+  z-index: 4;
+}
+
+.videobox video {
+  height: calc(100vh - 44px);
+  width: 100vw;
+  position: absolute;
+  left: 0;
+  top: 0;
+  z-index: 3;
+}
+.video-player--is-cssfullscreen {
+  position: fixed !important;
+  left: 0 !important;
+  top: 0 !important;
+  width: 100% !important;
+  height: 100% !important;
+  z-index: 999;
+}
+.video-card {
+  width: 165px;
+  height: 148px;
+  border-radius: 5px;
+  position: relative;
+  margin-bottom: 10px;
+  z-index: 1;
+  & .video-card-title {
+    width: 100%;
+    height: 45px;
+    line-height: 45px;
+    text-align: center;
+    font-size: 14px;
+    font-weight: 500;
+    color: #1c1c1e;
+    background: #fff;
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    border-radius: 0 0 9px 9px;
+  }
+}
+.bg2C2C2D {
+  background-color: #1c1c1e;
+  min-height: 100vh;
+  overflow: hidden;
+}
+.w345h120 {
+  width: 345px;
+  height: 120px;
+  margin: 15px;
+  border-radius: 5px;
+}
+.fs16 {
+  font-weight: 500;
+  color: #ffffff;
+  font-size: 16px;
+  margin-left: 15px;
+  display: flex;
+  align-items: center;
+}
+.jcjc-list {
+  padding: 0 15px;
+  overflow-x: scroll;
+  overflow-y: hidden;
+  display: flex;
+  margin: 15px 0;
+  .video-card {
+    margin-right: 10px;
+    &:last-child {
+      margin-right: 0;
+    }
+  }
+}
+.fs16::before {
+  content: '';
+  display: inline-block;
+  width: 6px;
+  height: 14px;
+  background: #3b7fff;
+  border-radius: 3px 3px 3px 3px;
+  opacity: 1;
+  margin-right: 6px;
+}
+.w144h140 {
+  width: 144px;
+  height: 140px;
+  margin-right: 10px;
+}
+.w144h140:last-child {
+  margin-right: 0;
+}
+.jjjc-list {
+  display: flex;
+  flex-flow: wrap;
+  justify-content: space-between;
+  padding: 15px;
+}
+.w165h148 {
+  width: 165px;
+  height: 148px;
+  object-fit: contain;
+  margin-bottom: 15px;
+  border-radius: 10px;
+}
+.return {
+  width: 42px;
+  height: 42px;
+  margin-left: 20px;
+  margin-bottom: 40px;
+  &.out {
+    border-radius: 50%;
+    padding: 1px;
+    background: linear-gradient(
+      46deg,
+      rgba(48, 49, 53, 1),
+      rgba(113, 116, 127, 1)
+    );
+    box-shadow: 0px 9px 17px 0px rgba(0, 0, 0, 0.5);
+  }
+  .in {
+    width: 40px;
+    height: 40px;
+    border-radius: 50%;
+    background: linear-gradient(180deg, #232427 0%, #4b4c52 100%);
+    opacity: 1;
+    text-align: center;
+    line-height: 40px;
+  }
+
+  img {
+    width: 16px;
+    height: 16px;
+  }
+}
+</style>

+ 60 - 14
pages/activity/invite-user/index.vue

@@ -3,21 +3,14 @@
     <activity-invite-user-box class="box1">
       <template #title>参与步骤</template>
       <v-img
-        v-if="type === 1"
         class="cybz-content"
-        src="~/assets/image/activity/invite-user/cybz-content@2x.png"
-      />
-      <v-img
-        v-else-if="type === 2"
-        class="cybz-content"
-        src="~/assets/image/activity/invite-user/cybz-content-2@2x.png"
+        :src="returnContent ? returnContent.img : null"
       />
       <div class="cybz-content-text">
         <div class="cybz-content-text-item">分享好友</div>
         <div class="cybz-content-text-item">邀请购买云机</div>
         <div class="cybz-content-text-item">
-          <template v-if="type === 1">返星币换现金</template>
-          <template v-else-if="type === 2">返云手机时长</template>
+          {{ returnContent ? returnContent.content : '' }}
         </div>
       </div>
       <v-btn class="share-button" rounded @click="share()">
@@ -229,6 +222,32 @@ export default {
     // },
   },
   computed: {
+    returnContent() {
+      return {
+        1: {
+          img: require('@/assets/image/activity/invite-user/cybz-content@2x.png'),
+          content: '返星币换现金',
+        },
+        2: {
+          img: require('@/assets/image/activity/invite-user/cybz-content-2@2x.png'),
+          content: '返云机时长',
+        },
+        3: {
+          img: require('@/assets/image/activity/invite-user/cybz-content-3@2x.png'),
+          content: '返积分',
+        },
+      }[this.type];
+    },
+    // contentImg() {
+    //   return {
+    //     1: require('@/assets/image/activity/invite-user/cybz-content@2x.png'),
+    //     2: require('@/assets/image/activity/invite-user/cybz-content-2@2x.png'),
+    //     3: require('@/assets/image/activity/invite-user/cybz-content-3@2x.png'),
+    //   }[this.type];
+    // },
+    // returnContent() {
+    //   return { 1: '返星币换现金', 2: '返云机时长', 3: '返积分' }[this.type];
+    // },
     codeHasMore() {
       return (
         this.codeTotal < 0 ||
@@ -280,6 +299,29 @@ export default {
             // { label: '可提现星币数量', value: this.data.withdrawStarCoinNum },
           ];
         }
+        case 3: {
+          return [
+            {
+              label: '今日获取的积分',
+              value: this.data.todayIncomeIntegral,
+            },
+            { label: '总积分', value: this.data.totalIncomeIntegral },
+            {
+              label: '今日购买订单数',
+              value: this.data.todayBuyOrderSuccessCount,
+            },
+            { label: '累计推广订单', value: this.data.totalBuyOrderCount },
+            {
+              label: '今日购买成功客户',
+              value: this.data.todayBuyOrderSuccessCount,
+            },
+            {
+              label: '累计购买成功客户',
+              value: this.data.totalBuyOrderSuccessCount,
+            },
+            // { label: '可提现星币数量', value: this.data.withdrawStarCoinNum },
+          ];
+        }
         default: {
           return [];
         }
@@ -311,7 +353,7 @@ export default {
       }
       return {
         title: '双子星APP',
-        desc: '分享好友购买云机套餐,返星币换现金',
+        desc: `分享好友购买云机套餐,${this.returnContent?.content}`,
         link: this.shareUrl,
         imgUrl: location.origin + require('~/assets/image/logo.png'),
       };
@@ -402,9 +444,11 @@ export default {
       }
     },
     async getActivityRules() {
-      const agreementCoding = { 1: 'iuserrules01', 2: 'iuserrules02' }[
-        this.type
-      ];
+      const agreementCoding = {
+        1: 'iuserrules01',
+        2: 'iuserrules02',
+        3: 'iuserrules03',
+      }[this.type];
       if (agreementCoding) {
         const res = await this.$axios.$get(
           '/public/v5/agreementApi/content/getContentByType',
@@ -448,13 +492,15 @@ export default {
   // padding-bottom: 30px;
   padding-bottom: env(safe-area-inset-bottom, 30px);
   background-color: #9525e3;
-
   &.bg-1 {
     background-image: url('~/assets/image/activity/invite-user/bg@2x.png');
   }
   &.bg-2 {
     background-image: url('~/assets/image/activity/invite-user/bg-2@2x.png');
   }
+  &.bg-3 {
+    background-image: url('~/assets/image/activity/invite-user/bg-3@2x.png');
+  }
 }
 
 // .box {

+ 3 - 0
pages/activity/invite-user/register.vue

@@ -170,6 +170,9 @@ export default {
   &.type-2 {
     background-image: url('~/assets/image/activity/invite-user/bg-2@2x.png');
   }
+  &.type-3 {
+    background-image: url('~/assets/image/activity/invite-user/bg-3@2x.png');
+  }
 }
 // .box {
 //   width: 373px;

+ 36 - 0
pages/test/clipboard.vue

@@ -8,10 +8,17 @@
     <div v-else class="">
       <span>当前环境不支持 window.navigator.clipboard</span>
     </div>
+    <div class="">
+      <div class="">copy-to-clipboard</div>
+      <v-btn @click="syncCopy()">同步写入剪贴板</v-btn>
+      <v-btn @click="asyncCopy()">异步写入剪贴板</v-btn>
+    </div>
   </div>
 </template>
 
 <script>
+import copy from 'copy-to-clipboard';
+
 export default {
   auth: false,
   data() {
@@ -40,6 +47,35 @@ export default {
         this.$toast.error(`读取失败 ${error.message}`);
       }
     },
+    syncCopy() {
+      try {
+        const now = Date.now();
+        const res = copy(now, {
+          debug: true,
+          message: 'Press #{key} to copy',
+        });
+
+        if (!res) throw new Error('写入失败');
+        this.$toast.success(`写入成功 ${now}`);
+      } catch (error) {
+        this.$toast.error(`写入失败 ${error.message}`);
+      }
+    },
+    async asyncCopy() {
+      try {
+        await new Promise((resolve) => setTimeout(resolve, 1000));
+        const now = Date.now();
+        const res = copy(now, {
+          debug: true,
+          message: 'Press #{key} to copy',
+        });
+
+        if (!res) throw new Error('写入失败');
+        this.$toast.success(`写入成功 ${now}`);
+      } catch (error) {
+        this.$toast.error(`写入失败 ${error.message}`);
+      }
+    },
   },
 };
 </script>

+ 11 - 11
plugins/file-center.js

@@ -3,17 +3,17 @@ import qs from 'qs';
 // import url from 'url';
 
 
-let baseURL;
-if (process.env.NODE_ENV === 'development') {
-  // 开发环境通过本地代理
-  // baseURL = process.env.FILE_PREFIX;
-  baseURL = '/file';
-} else {
-  // 部署环境通过域名直连
-  baseURL = `http${process.env.FILE_HTTPS === 'true' ? 's' : ''}://${
-    process.env.FILE_HOST
-  }:${process.env.FILE_PORT}/${process.env.FILE_PREFIX}`;
-}
+// let baseURL;
+// if (process.env.NODE_ENV === 'development') {
+//   // 开发环境通过本地代理
+//   // baseURL = process.env.FILE_PREFIX;
+//   baseURL = '/file';
+// } else {
+//   // 部署环境通过域名直连
+// }
+const baseURL = `http${process.env.FILE_HTTPS === 'true' ? 's' : ''}://${
+  process.env.FILE_HOST
+}:${process.env.FILE_PORT}/${process.env.FILE_PREFIX}`;
 
 
 

+ 14 - 17
pnpm-lock.yaml

@@ -42,8 +42,7 @@ specifiers:
   postcss: ^8
   postcss-html: ^1.3.0
   postcss-loader: ^4
-  postcss-px-to-viewport: ^1.1.1
-  postcss-px-to-viewport-8-plugin: ^1.1.5
+  postcss-px-to-viewport: https://github.com/evrone/postcss-px-to-viewport/tarball/master
   prettier: ^2.5.1
   stylelint: ^14.1.0
   stylelint-config-prettier: ^9.0.3
@@ -115,8 +114,7 @@ devDependencies:
   postcss: 8.4.16
   postcss-html: 1.4.1
   postcss-loader: 4.3.0_yqfl5gugdirklt5o2w2kmcv77i
-  postcss-px-to-viewport: 1.1.1
-  postcss-px-to-viewport-8-plugin: 1.1.5
+  postcss-px-to-viewport: '@github.com/evrone/postcss-px-to-viewport/tarball/master_postcss@8.4.16'
   prettier: 2.6.2
   stylelint: 14.8.5
   stylelint-config-prettier: 9.0.3_stylelint@14.8.5
@@ -9369,19 +9367,6 @@ packages:
       postcss-selector-parser: 5.0.0
     dev: false
 
-  /postcss-px-to-viewport-8-plugin/1.1.5:
-    resolution: {integrity: sha512-qM6x2NyGbRj8R15o/LCbw5hacU+XK1s80zTvWgLjHsOP8B9P1KbDZbNS11BG6/WPut8LR8DvEU5iKw8JnQn9MQ==}
-    dependencies:
-      object-assign: 4.1.1
-    dev: true
-
-  /postcss-px-to-viewport/1.1.1:
-    resolution: {integrity: sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==}
-    dependencies:
-      object-assign: 4.1.1
-      postcss: 8.4.16
-    dev: true
-
   /postcss-reduce-initial/4.0.3:
     resolution: {integrity: sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==}
     engines: {node: '>=6.9.0'}
@@ -12274,3 +12259,15 @@ packages:
   /yocto-queue/0.1.0:
     resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
     engines: {node: '>=10'}
+
+  '@github.com/evrone/postcss-px-to-viewport/tarball/master_postcss@8.4.16':
+    resolution: {tarball: https://github.com/evrone/postcss-px-to-viewport/tarball/master}
+    id: '@github.com/evrone/postcss-px-to-viewport/tarball/master'
+    name: postcss-px-to-viewport
+    version: 1.1.1
+    peerDependencies:
+      postcss: '>=5.0.2'
+    dependencies:
+      object-assign: 4.1.1
+      postcss: 8.4.16
+    dev: true

+ 8 - 3
static/screenAndroid/WXdraw.js

@@ -229,9 +229,9 @@ function doConnectDirectives() {
       return;
     }
     if (result.type === 'payInitiateEvent') {
-      var url = window.location.href;
-      url = url.split('/');
-      var baseUrl = url[0] + '//' + url[2];
+      // var url = window.location.href;
+      // url = url.split('/');
+      // var baseUrl = url[0] + '//' + url[2];
       $.ajax({
         url: baseUrl + '/api/pay/third/order',
         data: JSON.stringify({
@@ -319,6 +319,11 @@ function doConnectDirectives() {
 
       return;
     }
+
+    if (result.type === 'reProduceText') {
+      // 接收到云机剪贴板复制事件
+      window.copyToClipboard(result.data.text);
+    }
   };
 }
 $('body').on('click', function () {

+ 39 - 20
static/screenAndroid/WXtrialInterface.html

@@ -46,6 +46,7 @@
     <script src="../static/lib/swiper/swiper-bundle.js"></script> -->
     <script src="../static/lib/doT-1.1.3/doT.min.js"></script>
     <script src="../static/lib/qs.js"></script>
+    <script src="../static/lib/copy-to-clipboard.js"></script>
   </head>
 
   <body class="scroll h-player" style="overscroll-behavior: contain">
@@ -63,7 +64,7 @@
       {{~}}
     </template>
     <template id="template-shear">
-      {{? it.length}}
+      {{? it.length }}
       <div class="title">
         剪贴板
         <div class="btn-clear">清空</div>
@@ -129,7 +130,7 @@
           <div class="menu-btn PictureQuality avit" data-id="3">标清</div>
           <div class="menu-btn PictureQuality" data-id="2">极速</div>
         </div>
-        <!-- <div class="">
+        <!-- <div class="open-set-phone-size-dialog-btn-wrap">
           <div class="menu-btn" id="open-set-phone-size-dialog-btn">
             <span>分辨率</span>
           </div>
@@ -1702,6 +1703,10 @@
           systemBuriedPoint('激活码-强制关闭-继续观看');
         }
       });
+      window.onbeforeunload = function () {
+        wsss.close();
+        ws.close();
+      };
       // 埋点
       function systemBuriedPoint(pointName) {
         $.ajax({
@@ -1733,10 +1738,7 @@
           });
         }
       }
-      window.onbeforeunload = function () {
-        ws.close();
-        wsss.close();
-      };
+
       function updatePhoneSizeListHtml() {
         const templatePhoneSizeItem = doT.template(
           $('#template-phone-size-item').html().replace(/&amp;/g, '&'),
@@ -1753,7 +1755,9 @@
         });
         $('#phone-size-list').html(phoneSizeListItemsHtml);
       }
-      $('#open-set-phone-size-dialog-btn').on('click', function (e) {
+
+      $('#open-set-phone-size-dialog-btn').on('click', async function (e) {
+        !window.phoneSizeList.length && (await getPhoneSizeList());
         window.activePhoneSize = window.currentPhoneSize;
         updatePhoneSizeListHtml();
         $('#set-phone-size-dialog').addClass('show');
@@ -1771,8 +1775,8 @@
       // 选中的分辨率
       // window.activePhoneSize = window.currentPhoneSize;
 
-      function getPhoneSizeList() {
-        return $.ajax({
+      async function getPhoneSizeList() {
+        const response = await $.ajax({
           url:
             baseUrl + '/api/resources/v5/machine/resolution/getResolvingPower',
           headers: {
@@ -1783,18 +1787,29 @@
           data: {
             userCardId,
           },
-        }).then(function (response) {
-          return response.data.map(function (v) {
-            return {
-              id: v.id,
-              dpi: v.dpi,
-              width: v.width,
-              height: v.high,
-            };
-          });
         });
-      }
 
+        const phoneSizeList = response.data.map(function (v) {
+          return {
+            id: v.id,
+            dpi: v.dpi,
+            width: v.width,
+            height: v.high,
+          };
+        });
+        window.phoneSizeList = phoneSizeList;
+
+        // 关联上当前云机分辨率
+        const currentPhoneSize = phoneSizeList.find(function (v) {
+          return (
+            window.currentPhoneSize &&
+            v.width === window.currentPhoneSize.width &&
+            v.height === window.currentPhoneSize.height &&
+            v.dpi === window.currentPhoneSize.dpi
+          );
+        });
+        window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
+      }
       /*
       getPhoneSizeList().then(function (phoneSizeList) {
         window.phoneSizeList = phoneSizeList;
@@ -1812,7 +1827,6 @@
         // return updatePhoneSizeListHtml();
       });
       */
-
       // const phoneSizeListSwiper = new Swiper('#phone-size-list-swiper', {
       //   direction: 'vertical',
       //   slidesPerView: 'auto',
@@ -1845,6 +1859,7 @@
             },
           }),
         );
+        // XXX: 去除了,改为中台发送
         // 通知其他在线端
         // wsss.send(
         //   JSON.stringify({
@@ -1870,6 +1885,10 @@
       // });
       $('#phone-size-list').on('click', '.phone-size-item', function (e) {
         const data = $(e.currentTarget).data();
+        // console.log(
+        //   '🚀 ~ file: WXtrialInterface.html ~ line 1494 ~ data',
+        //   data,
+        // );
         window.activePhoneSize = data;
         updatePhoneSizeListHtml();
         // setPhoneSize(data.width, data.height);

+ 12 - 3
static/screenIos/WXdraw.js

@@ -237,9 +237,9 @@ function doConnectDirectives() {
       return;
     }
     if (result.type === 'payInitiateEvent') {
-      var url = window.location.href;
-      url = url.split('/');
-      var baseUrl = url[0] + '//' + url[2];
+      // var url = window.location.href;
+      // url = url.split('/');
+      // var baseUrl = url[0] + '//' + url[2];
       $.ajax({
         url: baseUrl + '/api/pay/third/order',
         data: JSON.stringify({
@@ -327,6 +327,15 @@ function doConnectDirectives() {
 
       return;
     }
+
+    if (result.type === 'reProduceText') {
+      // 接收到云机剪贴板复制事件
+      // window.copyToClipboard(result.data.text);
+
+      if (navigator.clipboard) {
+        navigator.clipboard.writeText(result.data.text);
+      }
+    }
   };
 }
 $('body').on('click', function () {

+ 26 - 12
static/screenIos/WXtrialInterface.html

@@ -47,6 +47,7 @@
     <script src="../static/lib/swiper/swiper-bundle.js"></script> -->
     <script src="../static/lib/doT-1.1.3/doT.min.js"></script>
     <script src="../static/lib/qs.js"></script>
+    <script src="../static/lib/copy-to-clipboard.js"></script>
   </head>
 
   <body class="scroll h-player" style="overscroll-behavior: contain">
@@ -1554,7 +1555,8 @@
         $('#phone-size-list').html(phoneSizeListItemsHtml);
       }
 
-      $('#open-set-phone-size-dialog-btn').on('click', function (e) {
+      $('#open-set-phone-size-dialog-btn').on('click', async function (e) {
+        !window.phoneSizeList.length && (await getPhoneSizeList());
         window.activePhoneSize = window.currentPhoneSize;
         updatePhoneSizeListHtml();
         $('#set-phone-size-dialog').addClass('show');
@@ -1572,8 +1574,8 @@
       // 选中的分辨率
       // window.activePhoneSize = window.currentPhoneSize;
 
-      function getPhoneSizeList() {
-        return $.ajax({
+      async function getPhoneSizeList() {
+        const response = await $.ajax({
           url:
             baseUrl + '/api/resources/v5/machine/resolution/getResolvingPower',
           headers: {
@@ -1584,16 +1586,28 @@
           data: {
             userCardId,
           },
-        }).then(function (response) {
-          return response.data.map(function (v) {
-            return {
-              id: v.id,
-              dpi: v.dpi,
-              width: v.width,
-              height: v.high,
-            };
-          });
         });
+
+        const phoneSizeList = response.data.map(function (v) {
+          return {
+            id: v.id,
+            dpi: v.dpi,
+            width: v.width,
+            height: v.high,
+          };
+        });
+        window.phoneSizeList = phoneSizeList;
+
+        // 关联上当前云机分辨率
+        const currentPhoneSize = phoneSizeList.find(function (v) {
+          return (
+            window.currentPhoneSize &&
+            v.width === window.currentPhoneSize.width &&
+            v.height === window.currentPhoneSize.height &&
+            v.dpi === window.currentPhoneSize.dpi
+          );
+        });
+        window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
       }
       /*
       getPhoneSizeList().then(function (phoneSizeList) {

Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
static/static/lib/copy-to-clipboard.js