Browse Source

修改操作端

xiaohaizhao 1 year ago
parent
commit
1720761c4e
6 changed files with 155 additions and 131 deletions
  1. 38 39
      App.vue
  2. 1 1
      components/bottomModules/bottom1.vue
  3. 1 1
      components/my_form.vue
  4. 101 86
      components/slideshow.vue
  5. 1 1
      utils/login.js
  6. 13 3
      utils/tool.js

+ 38 - 39
App.vue

@@ -1,32 +1,31 @@
 <script>
 export default {
-	onLaunch: function (options) {
-		console.log("onLaunch", options.query)
-		let { mount, setBar } = require("./utils/tool");
-		mount()
-		setBar()
-
-		/* uni.addInterceptor('navigateTo', {//监听跳转
+  onLaunch: function (options) {
+    console.log("onLaunch", options.query);
+    let { mount, setBar, setLink } = require("./utils/tool");
+    mount();
+    setBar();
+    setLink(this.globalData.systemclient);
+
+    /* uni.addInterceptor('navigateTo', {//监听跳转
 			success(e) {
 				console.log("监听页面跳转", e)
 			}
 		}) */
 
-		/* 	wx.onAppRoute((res) => {
+    /* 	wx.onAppRoute((res) => {
 				console.log("onAppRoute", res)
 			}) */
-	},
-	onShow: function () {
-
-	},
-	onHide: function () {
-
-	},
-	globalData: {
-		systemInitIsComplete: null,
-		HomePageStartRendering: [],
-	},
-}
+  },
+  onShow: function () {},
+  onHide: function () {},
+  globalData: {
+    systemInitIsComplete: null,
+    HomePageStartRendering: [],
+    systemclient: "demo",
+    // systemclient:'marketingtool',
+  },
+};
 </script>
 
 <style lang="scss">
@@ -36,27 +35,27 @@ export default {
 
 body,
 page {
-	background: #F7F7F7;
-	font-size: 14px;
+  background: #f7f7f7;
+  font-size: 14px;
 }
 
 /deep/.u-tabs {
-	height: 44px;
-	// background: #052E5D;
-	background: #FFFFFF;
-
-	.u-tabs__wrapper__nav {
-		height: 44px;
-		align-items: center;
-
-		.u-tabs__wrapper__nav__item {
-			height: 44px;
-			flex-shrink: 0 !important;
-
-			.u-tabs__wrapper__nav__item__text {
-				font-size: 15px;
-			}
-		}
-	}
+  height: 44px;
+  // background: #052E5D;
+  background: #ffffff;
+
+  .u-tabs__wrapper__nav {
+    height: 44px;
+    align-items: center;
+
+    .u-tabs__wrapper__nav__item {
+      height: 44px;
+      flex-shrink: 0 !important;
+
+      .u-tabs__wrapper__nav__item__text {
+        font-size: 15px;
+      }
+    }
+  }
 }
 </style>

+ 1 - 1
components/bottomModules/bottom1.vue

@@ -194,7 +194,7 @@ export default {
           .basic({
             id: 20240520110702,
             content: {
-              systemclient: "marketingtool",
+              systemclient: getApp().globalData.systemclient,
               code: e.detail.code,
             },
           })

+ 1 - 1
components/my_form.vue

@@ -623,7 +623,7 @@ export default {
           .basic({
             id: 20240520110702,
             content: {
-              systemclient: "marketingtool",
+              systemclient: getApp().globalData.systemclient,
               code: e.detail.code,
             },
           })

+ 101 - 86
components/slideshow.vue

@@ -1,100 +1,115 @@
 <template>
-    <view>
-        <view v-if="list.length">
-            <swiper :style="{
-                width: tovw(width),
-                height: tovw(height),
-            }" :autoplay="autoplay" :interval="interval" circular>
-                <swiper-item class="swiper-item" v-for="(item, index) in list" :key="item.list">
-                    <u--image @click="onClick(index)" :src="item.cover" :width="tovw(width)" :height="tovw(height)"
-                        mode="aspectFill" :lazy-load="true">
-                        <template v-slot:loading>
-                            <u-loading-icon color="red"></u-loading-icon>
-                        </template>
-                    </u--image>
-                </swiper-item>
-            </swiper>
-        </view>
-        <view style="height: 10px;" v-else-if="empty" />
+  <view>
+    <view v-if="list.length">
+      <swiper
+        :style="{
+          width: tovw(width),
+          height: tovw(height),
+        }"
+        :autoplay="autoplay"
+        :interval="interval"
+        circular
+      >
+        <swiper-item
+          class="swiper-item"
+          v-for="(item, index) in list"
+          :key="item.list"
+        >
+          <u--image
+            @click="onClick(index)"
+            :src="item.cover"
+            :width="tovw(width)"
+            :height="tovw(height)"
+            mode="aspectFill"
+            :lazy-load="true"
+          >
+            <template v-slot:loading>
+              <u-loading-icon color="red"></u-loading-icon>
+            </template>
+          </u--image>
+        </swiper-item>
+      </swiper>
     </view>
+    <view style="height: 10px" v-else-if="empty" />
+  </view>
 </template>
 
 <script>
 import { viewImage } from "../utils/settleFiles";
 
 export default {
-    name: 'slideshow',
-    props: {
-        autoplay: {
-            type: Boolean,
-            default: true
-        },
-        interval: {
-            type: [Number, String],
-            default: 5000
-        },
-        empty: {
-            type: Boolean,
-            default: false
-        }
+  name: "slideshow",
+  props: {
+    autoplay: {
+      type: Boolean,
+      default: true,
     },
-    data() {
-        return {
-            width: 375,
-            height: 500,
-            list: [],
-        }
+    interval: {
+      type: [Number, String],
+      default: 5000,
     },
-    methods: {
-        getBanners(locations, systemclient = 'marketingtool') {
-            return new Promise((resolve, reject) => {
-                this.$Http.basic({
-                    "id": "20240426154302",
-                    "content": {
-                        systemclient,
-                        locations,
-                        date: Date.now()
-                    }
-                }).then(res => {
-                    console.log("获取广告位" + locations, res)
-                    resolve(res.msg)
-                    if (this.cutoff(res.msg)) return;
-                    try {
-                        let list = res.data[locations[0]];
-                        if (list.length) {
-                            if (list[0].dimensional) {
-                                let dimensional = list[0].dimensional.split("*")
-                                this.width = dimensional[0] - 0;
-                                this.height = dimensional[1] - 0;
-                            };
-                            this.list = list.map(v => {
-                                v.cover = this.getSpecifiedImage(v.attinfos[0], 'compressed')
-                                return v
-                            })
-                        }
-                    } catch (error) {
-                    }
-                })
-            })
-        },
-        onClick(index) {
-            let item = this.list[index];
-            console.log("点击广告图", index, item)
-            if (item.hyperlink) {
-                uni.navigateTo({
-                    url: item.hyperlink,
-                    fail: (fail) => {
-                        console.log("跳转失败原因", fail)
-                        viewImage(item.attinfos[0].url)
-                    },
-                })
-            } else {
-                viewImage(item.attinfos[0].url)
-            }
-        }
-
+    empty: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      width: 375,
+      height: 500,
+      list: [],
+    };
+  },
+  methods: {
+    getBanners(locations, systemclient = "marketingtool") {
+      return new Promise((resolve, reject) => {
+        this.$Http
+          .basic({
+            id: "20240426154302",
+            content: {
+              systemclient,
+              locations,
+              date: Date.now(),
+            },
+          })
+          .then((res) => {
+            console.log("获取广告位" + locations, res);
+            resolve(res.msg);
+            if (this.cutoff(res.msg)) return;
+            try {
+              let list = res.data[locations[0]];
+              if (list.length) {
+                if (list[0].dimensional) {
+                  let dimensional = list[0].dimensional.split("*");
+                  this.width = dimensional[0] - 0;
+                  this.height = dimensional[1] - 0;
+                }
+                this.list = list.map((v) => {
+                  v.cover = this.getSpecifiedImage(v.attinfos[0], "compressed");
+                  return v;
+                });
+              }
+            } catch (error) {}
+          });
+      });
+    },
+    onClick(index) {
+      let item = this.list[index];
+      console.log("点击广告图", index, item);
+      if (item.hyperlink) {
+        uni.navigateTo({
+          url: item.hyperlink,
+          fail: (fail) => {
+            console.log("跳转失败原因", fail);
+            viewImage(item.attinfos[0].url);
+          },
+        });
+      } else {
+        viewImage(item.attinfos[0].url);
+      }
     },
-}
+  },
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 1 - 1
utils/login.js

@@ -93,7 +93,7 @@ class Login {
                 success(res) {
                     Vue.prototype.$Http.loginbywechat({
                         wechat_code: res.code,
-                        "systemclient": "marketingtool"
+                        "systemclient": getApp().globalData.systemclient
                     }).then(res => {
                         console.log("微信登录", res)
                         if (Vue.prototype.cutoff(res.msg)) return resolve(false);

+ 13 - 3
utils/tool.js

@@ -27,9 +27,18 @@ function setBar() {
     })
 }
 
-function mount() {
-    Vue.prototype.qrCodePrefix = "https://www.jiushengboard.cc/";
+function setLink(systemclient = "marketingtool") {
+    switch (systemclient) {
+        case "demo":
+            Vue.prototype.qrCodePrefix = "https://www.jiushengboard.cc/";
+            break;
+        case "marketingtool":
+            Vue.prototype.qrCodePrefix = "https://lsa.cnyunl.com/";
+            break;
+    }
+}
 
+function mount() {
     Vue.prototype.getLocation = (isHighAccuracy = false) => {
         return new Promise((resolve, reject) => {
             let that = this;
@@ -306,5 +315,6 @@ function mount() {
 
 module.exports = {
     mount,
-    setBar
+    setBar,
+    setLink
 }