hml 2 سال پیش
والد
کامیت
fd7eef1892
5فایلهای تغییر یافته به همراه296 افزوده شده و 16 حذف شده
  1. 74 0
      purchase_H5/public/mobile.html
  2. 47 0
      purchase_H5/src/mobile.js
  3. 23 0
      purchase_H5/src/mobile.vue
  4. 124 0
      purchase_H5/src/views/indexMobile.vue
  5. 28 16
      purchase_H5/vue.config.js

+ 74 - 0
purchase_H5/public/mobile.html

@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html lang="">
+
+<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, minimum-scale=1.0, maximum-scale=1.0, viewport-fit=cover" />
+  <meta name="apple-mobile-web-app-capable" content="yes" />
+  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+  <meta http-equiv="x-ua-compatible" content="IE=edge" />
+  <meta name="format-detection" content="telephone=no" />
+  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+  <title></title>
+</head>
+
+<style>
+  body {
+    /* IOS禁止微信调整字体大小 */
+    -webkit-text-size-adjust: 100% !important;
+    text-size-adjust: 100% !important;
+    -moz-text-size-adjust: 100% !important;
+  }
+</style>
+<script src="./jquery-3.6.0.min.js"></script>
+<body>
+  <noscript>
+    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
+      Please enable it to continue.</strong>
+  </noscript>
+  <div id="mobile"></div>
+  <script>
+    window.addEventListener('load', function () {
+      if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
+        handleFontSize();
+      } else {
+        if (document.addEventListener) {
+          document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
+        } else if (document.attachEvent) {
+          document.attachEvent("WeixinJSBridgeReady", handleFontSize);
+          document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
+        }
+      }
+
+      function handleFontSize() {
+        // 设置网页字体为默认大小
+        WeixinJSBridge.invoke('setFontSizeCallback', {
+          'fontSize': 0
+        });
+        // 重写设置网页字体大小的事件
+        WeixinJSBridge.on('menu:setfont', function () {
+          WeixinJSBridge.invoke('setFontSizeCallback', {
+            'fontSize': 0
+          });
+        });
+      }
+    })
+  </script>
+  <script src="./QQVideoWoBridge.js" type="text/javascript"></script>
+  <!-- <script src="./VuePageVisitor.js" type="text/javascript"></script> -->
+  <script src="./vconsole.min.js"></script>
+  <script>
+    const searchURL = location.search; // 获取到URL中的参数串
+    const params = new URLSearchParams(searchURL);
+    const valueObj = Object.fromEntries(params); // 转换为普通对象
+    if (valueObj.abcd == 1) {
+      var vConsole = new window.VConsole();
+    }
+  </script>
+</body>
+
+
+</html>

+ 47 - 0
purchase_H5/src/mobile.js

@@ -0,0 +1,47 @@
+import Vue from 'vue'
+import mobile from './mobile.vue';
+import router from './router'
+import store from './store'
+import md5 from 'js-md5';
+import sensors from "./util/sensors";
+import 'lib-flexible'
+import NP from 'number-precision';
+import 'vant/lib/index.css';
+import filters from './common/filter'
+import './common/loadVant'
+import './common/loadTemps';
+import VueWechatTitle from 'vue-wechat-title'
+import {
+  Overlay,
+  Popup,
+  ActionSheet,
+  RadioGroup,
+  CellGroup,
+  Cell,
+  Radio,
+  Field,
+  NoticeBar,
+  Checkbox,
+  Swipe,
+  SwipeItem
+} from 'vant';
+Vue.use(Swipe).use(SwipeItem).use(Overlay).use(Popup).use(ActionSheet).use(CellGroup).use(RadioGroup).use(Cell).use(Radio).use(Field).use(NoticeBar).use(Checkbox)
+
+Vue.config.productionTip = false
+
+// 全局过滤器
+Object.keys(filters).forEach(filterName => {
+  Vue.filter(filterName, filters[filterName])
+});
+Vue.use(VueWechatTitle)
+
+// 神策埋点
+Vue.prototype.$sensors = sensors
+Vue.prototype.$md5 = md5;
+Vue.prototype.$NP = NP;
+
+new Vue({
+  router,
+  store,
+  render: h => h(mobile)
+}).$mount('#mobile')

+ 23 - 0
purchase_H5/src/mobile.vue

@@ -0,0 +1,23 @@
+<template>
+  <div id="app">
+    <keep-alive>
+      <mobile-view></mobile-view>
+    </keep-alive>
+  </div>
+</template>
+<script>
+import mobileView from './views/indexMobile.vue'
+export default {
+  components: { mobileView },
+  name: "mobile",
+  data () {
+    return {
+      title: "畅视流量会员包",
+    };
+  },
+};
+</script>
+<style lang="scss">
+@import "./styles/normalize.scss";
+@import "./styles/common.scss";
+</style>

+ 124 - 0
purchase_H5/src/views/indexMobile.vue

@@ -0,0 +1,124 @@
+<template>
+  <div id="box" class="home">
+    <div :is="this.$store.state.tempName"></div>
+  </div>
+</template>
+<script>
+export default {
+  name: "home",
+  data () {
+    return {
+      imgUrl: process.env.VUE_APP_IMGS_URL,
+      template: "",
+    };
+  },
+  created () {
+    this.$nextTick(() => {
+      window.addEventListener('message', messageEvent => {
+        const data = messageEvent.data
+        if (data.template && data.template !== '') {
+          this.pageData(data)
+        }
+      })
+    })
+  },
+
+
+  methods: {
+    pageData (data) {
+      // this.$router.go(0)
+      // this.template = data.template
+      this.$store.commit('setTempName', data.template)
+      let mainProduct = {
+        activeType: "69",
+        bannerPics: [data.productJson.bannerImg, data.productJson.jsonImg, data.productJson.upImg, data.productJson.topImg,],
+        bgColor: [data.productJson.pageBgcol, '', data.productJson.orderBgcol, data.productJson.orderBdcol],
+        cacheSeatOne: [{
+          dongHua: "",
+          memberUrl: "",
+          proC: {
+            e: data.productJson.hideCol,
+            s: data.productJson.pageTextcol
+          },
+          productV: data.productJson.productV,
+          rushC: {
+            e: data.productJson.orderTextcol,
+            s: data.productJson.orderNumcol,
+          },
+          tabC: {
+            e: data.productJson.tabVicecol,
+            s: data.productJson.tabMaincol,
+          },
+        }],
+        cpid: "bilibl",
+        createTime: "2022-02-23 15:23:34",
+        discountInfo: null,
+        flowJumpUrl: "https://www.baidu.com",
+        givePhoneInfo: "<p><strong>产品</strong> 哔哩哔哩流量会员合约包</p><p><strong>资费</strong> <strong>首月0.01元,次月起25元/月</strong></p><p><strong>内容</strong> 15GB定向流量+哔哩哔哩大会员</p><p><strong>合约</strong> <strong>本产品合约期为6个月,第六个月方可退订,用户在合约期内解除合约时,<s> </s>需补足首月优惠金额,切在原合约期结束后方能再次退订</strong></p>",
+        guidancePic: {
+          c: data.productJson.orderImg,
+          p: data.productJson.explainImg
+        },
+        id: data.item.primaryProductId,
+        isCompositeProduct: 0,   //是否复合产品
+        logoPic: data.productJson.logoPic,
+        manualInfo: "活动说明",
+        memberName: "会员信息",
+        orderingInfo: "<h2><span style=\"color: rgb(0, 138, 0);\">产品订购说明</span></h2>",
+        originalPrice: 25,
+        pageTitle: data.productJson.pageTitle,
+        productName: "测试产品V2",
+        productType: null,
+        promotionPic: null,
+        pushJumpUrl: null,
+        remark: "测试V2",
+        remark1: null,
+        remark2: null,
+        remark3: data.productJson.remark3,
+        spid: "979",
+        themeColor: [data.productJson.btnTopcol, data.productJson.btnBotcol],
+      }
+      let pageData = {
+        mainProduct: mainProduct,
+        channl: {
+          channelKey: "464c87375658",
+          channelName: "新策略H5整合测试",
+          fullCode: "173966823233",
+        },
+        recommend: data.item.recommendStrategyIds,
+        remarks: data.extJson, //策略信息
+        viceJson: data.viceJson, //副产品json
+        otherJson: data.otherJson, //备用json
+        strategyInfo: {
+          activityLogo: data.item.activityLogo,
+          activityType: data.item.activityType,
+          directCharge: null,
+          extJson: data.extJson,
+          id: null,
+          linkUrl: data.item.linkUrl,
+          maskText: data.item.maskText,
+          posterPhoto: data.item.posterPhoto,
+          primaryProductId: data.item.primaryProductId,
+          primarySpid: "1234",
+          productInfo: [],
+          promotePhoto: data.item.promotePhoto,
+          recommendStrategyList: data.item.recommendStrategyIds,
+          strategyName: data.item.strategyName,
+          strategyStatus: data.item.strategyStatus,
+          strategyType: data.item.strategyType,
+          templateCode: data.template,
+          templateId: data.item.templateId,
+          templateName: "",
+          testGroupId: null,
+          testId: null,
+          unsubscribeStrategyList: data.item.unsubscribeStrategyIds,
+          viceProductStrategyList: data.item.viceProductIds,
+        }
+      };
+      this.$store.commit("setPageData", pageData);
+    }
+  },
+};
+</script>
+<style lang="scss">
+</style>

+ 28 - 16
purchase_H5/vue.config.js

@@ -13,7 +13,19 @@ module.exports = {
           '^/test/face': '/'
         }
       }
-    }
+    },
+  },
+  pages: {
+    mobile: {
+      entry: 'src/mobile.js',
+      template: 'public/mobile.html',
+      filename: 'mobile.html'
+    },
+    index: {
+      entry: 'src/main.js',
+      template: 'public/index.html',
+      filename: 'index.html'
+    },
   },
   chainWebpack: config => {
     config.plugins.delete('prefetch')
@@ -34,21 +46,21 @@ module.exports = {
       }
     }
   },
-    configureWebpack: config => {
-        const plugins = [];
-        // 服务器也要相应开启gzip
-        plugins.push(
-            new CompressionWebpackPlugin({
-                algorithm: 'gzip',
-                test: /\.(js|css)$/, // 匹配文件名
-                threshold: 10000, // 对超过10k的数据压缩
-                deleteOriginalAssets: false, // 不删除源文件
-                minRatio: 0.8 // 压缩比
-            })
-        )
+  configureWebpack: config => {
+    const plugins = [];
+    // 服务器也要相应开启gzip
+    plugins.push(
+      new CompressionWebpackPlugin({
+        algorithm: 'gzip',
+        test: /\.(js|css)$/, // 匹配文件名
+        threshold: 10000, // 对超过10k的数据压缩
+        deleteOriginalAssets: false, // 不删除源文件
+        minRatio: 0.8 // 压缩比
+      })
+    )
 
-        return {
-            plugins
-        }
+    return {
+      plugins
     }
+  }
 }