谢杰标 2 жил өмнө
parent
commit
1166daa51c

+ 84 - 0
components/nav-bar/nav-logo.vue

@@ -0,0 +1,84 @@
+<template>
+  <div>
+    <u-navbar
+      :class="title ? 'navbarL' : 'navbarC'"
+      :is-back="false"
+      :title="title"
+      :border-bottom="false"
+      title-color="#333333"
+      back-icon-color="#ffffff"
+    >
+      <view class="slot-wrap">
+        <!-- #ifdef H5 -->
+        <img :src="$method.splitImgHost(config.h5Logo)" alt="" srcset="" />
+        <!-- #endif -->
+        <!-- #ifdef MP-WEIXIN -->
+        <image
+          :src="$method.splitImgHost(config.h5Logo)"
+          @load="load"
+          :style="{ width: imgwidth + 'rpx', height: imgheight + 'rpx' }"
+        />
+        <!-- #endif -->
+      </view>
+    </u-navbar>
+  </div>
+</template>
+
+<script>
+import { mapGetters, mapActions } from "vuex";
+export default {
+  name: "NavLogo",
+  props: {
+    title: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      imgwidth: 0,
+      imgheight: 0,
+    };
+  },
+
+  mounted() {},
+  computed: {
+    ...mapGetters(["userInfo", "config"]),
+  },
+  methods: {
+    load(e) {
+      console.log(e.detail);
+      this.imgwidth = e.detail.width * 2;
+      this.imgheight = e.detail.height * 2;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.navbarL {
+  image {
+    margin-left: 30rpx;
+  }
+  img {
+    margin-left: 30rpx;
+  }
+}
+.navbarC {
+  /deep/ .u-navbar-inner {
+    margin-right: 0 !important;
+  }
+
+  .slot-wrap {
+    width: 100vw;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    image {
+      width: 178rpx;
+      height: 31rpx;
+    }
+  }
+}
+</style>

+ 3 - 0
main.js

@@ -24,6 +24,9 @@ import filters from './filters/index.js'
 import uView from "uview-ui";
 Vue.use(uView);
 
+import navLogo from "@/components/nav-bar/nav-logo.vue";
+Vue.component('navLogo', navLogo)
+
 // 全局过滤器
 Vue.filter('formate', filters['formDate'])
 

+ 3 - 15
pages/course/index.vue

@@ -1,19 +1,6 @@
 <template>
   <view>
-    <u-navbar
-      :is-back="false"
-      title="选课中心"
-      :border-bottom="false"
-      title-color="#333333"
-      back-icon-color="#ffffff"
-    >
-      <view class="slot-wrap">
-        <image
-          :src="$method.splitImgHost(config.h5Logo)"
-          style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
-        ></image>
-      </view>
-    </u-navbar>
+    <nav-logo title="选课中心"></nav-logo>
     <view v-show="!show">
       <view style="position: fixed; width: 100%; z-index: 999">
         <view class="check_ck">
@@ -394,7 +381,6 @@
 <script>
 import { mapGetters } from "vuex";
 export default {
-  components: {},
   data() {
     return {
       show: false,
@@ -458,6 +444,8 @@ export default {
         bId: 0,
         pId: 0,
       },
+      imgwidth: 0,
+      imgheight: 0,
     };
   },
   onPullDownRefresh() {

+ 3 - 46
pages/index/index.vue

@@ -1,16 +1,6 @@
 <template>
   <view class="index">
-    <u-navbar
-      class="navbar"
-      :is-back="false"
-      :border-bottom="false"
-      title-color="#333333"
-      back-icon-color="#ffffff"
-    >
-      <view class="slot-wrap">
-        <image :src="$method.splitImgHost(config.h5Logo)"></image>
-      </view>
-    </u-navbar>
+    <nav-logo></nav-logo>
     <view class="swiper">
       <swiper
         :indicator-dots="false"
@@ -412,6 +402,8 @@ export default {
       subIndex: 0,
       courSubjectId: "",
       optObj: {},
+      imgwidth: 0,
+      imgheight: 0,
     };
   },
   async onLoad(option) {
@@ -542,23 +534,6 @@ export default {
   },
   methods: {
     ...mapActions(["getUserInfo", "appCommonConfig"]),
-    // 公众号登录
-    OfficialLogin() {
-      console.log("公众号登录");
-      this.$http({
-        url: "/app/common/gzh_login",
-        method: "post",
-        data: {
-          code: this.optObj.code,
-        },
-        noToken: true,
-      }).then((res) => {
-        if (res.data.code == 200) {
-        } else {
-          this.$u.toast(res.data.msg);
-        }
-      });
-    },
     tobuy(item) {
       if (item.goodsType == 2) {
         uni.navigateTo({
@@ -1097,24 +1072,6 @@ page {
   white-space: nowrap;
 }
 .index {
-  .navbar {
-    /deep/ .u-navbar-inner {
-      margin-right: 0 !important;
-    }
-
-    .slot-wrap {
-      width: 100%;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-
-      image {
-        width: 178rpx;
-        height: 31rpx;
-      }
-    }
-  }
-
   .swiper {
     width: 100%;
     position: relative;

+ 3 - 14
pages/learn/index.vue

@@ -1,19 +1,6 @@
 <template>
   <view class="learnings">
-    <u-navbar
-      :is-back="false"
-      title="学习中心"
-      :border-bottom="false"
-      title-color="#333333"
-      back-icon-color="#ffffff"
-    >
-      <view class="slot-wrap">
-        <image
-          :src="$method.splitImgHost(config.h5Logo)"
-          style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
-        ></image>
-      </view>
-    </u-navbar>
+    <nav-logo title="学习中心"></nav-logo>
     <u-line color="#D6D6DB" />
     <view class="contents">
       <!-- <view class="diatance">
@@ -809,6 +796,8 @@ export default {
       appointTestShow: false, //预约考试弹窗
       appointTestList: [],
       appointItemIndex: {}, // 点击了哪项课程
+      imgwidth: 0,
+      imgheight: 0,
     };
   },
   filters: {

+ 1 - 14
pages/questionBank/index.vue

@@ -1,19 +1,6 @@
 <template>
   <view class="questionBank">
-    <u-navbar
-      :is-back="false"
-      title="题库中心"
-      :border-bottom="false"
-      title-color="#333333"
-      back-icon-color="#ffffff"
-    >
-      <view class="slot-wrap">
-        <image
-          :src="$method.splitImgHost(config.h5Logo)"
-          style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
-        ></image>
-      </view>
-    </u-navbar>
+    <nav-logo title="题库中心"></nav-logo>
     <!-- 有学习的课程 -->
     <view v-if="questionLists.length" class="had_courses">
       <!-- 我的题库 -->

+ 1 - 20
pages/wd/index.vue

@@ -1,20 +1,6 @@
 <template>
   <view style="height:100%">
-    <!-- <image mode="widthFix" :src="isLogin ? '/static/wd_bg_login.jpg' : '/static/wd_bg.jpg'" :class="isLogin ? 'login_full_img' : 'full_img'"></image> -->
-    <u-navbar
-      :is-back="false"
-      title="我的"
-      :border-bottom="false"
-      title-color="#333333"
-      back-icon-color="#ffffff"
-    >
-      <view class="slot-wrap">
-        <image
-          :src="$method.splitImgHost(config.h5Logo)"
-          style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
-        ></image>
-      </view>
-    </u-navbar>
+    <nav-logo title="我的"></nav-logo>
     <view v-if="isLogin" class="imgs_bg">
       <view class="infos">
         <image
@@ -158,11 +144,6 @@
       <view class="logout" @click="logout">退出</view>
     </view>
 
-    <!-- <u-navbar :is-back="false" title="我的" :border-bottom="false" background="{ background: '#ffffff',opacity:0.4; }" title-color="#ffffff" back-icon-color="#ffffff">
-			<view class="slot-wrap"><image src="/static/logo.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image></view>
-		</u-navbar> -->
-
-    <!-- <tab-bar v-model="current" :list="tabbarlist" :mid-button="true" :mid-button-size="50" class="tab_items"></tab-bar> -->
   </view>
 </template>
 

+ 3 - 0
pages3/polyv/detail.vue

@@ -2127,6 +2127,7 @@ export default {
       return {};
     },
     loadedmetadata(event) {
+      console.log(465456)
       if (this.hasStart) {
         // 防止loadedmetadata事件第二次触发
         return;
@@ -2821,6 +2822,7 @@ export default {
               uni.showToast({
                 icon: "none",
                 title: res.data.msg,
+                duration: 2000,
               });
               if (this.erJianErZao && code == 559) {
                 this.isReach = true;
@@ -3338,6 +3340,7 @@ export default {
             // console.log('拍照确定提交', this.photoHistoryList);
             this.postStudyRecord(); //提交记录
             if (this.erJianErZao && this.isReach) {
+              console.log("1校验")
               await this.postStudyRecord(1);
               this.photoPopup = false;
               this.uploadLock = false;

+ 3 - 15
pages4/shopping/shoppingCart.vue

@@ -1,19 +1,6 @@
 <template>
   <view>
-    <u-navbar
-      :is-back="false"
-      title="购物车"
-      :border-bottom="false"
-      title-color="#333333"
-      back-icon-color="#ffffff"
-    >
-      <view class="slot-wrap">
-        <image
-          :src="$method.splitImgHost(config.smallLogo)"
-          style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
-        ></image>
-      </view>
-    </u-navbar>
+    <nav-logo title="购物车"></nav-logo>
     <view v-show="isLogin">
       <view v-if="!list.length"
         ><u-empty text="购物车为空" margin-top="500" mode="car"></u-empty
@@ -289,6 +276,7 @@
 <script>
 import { mapGetters } from "vuex";
 import ClassTimeTip from "../../components/common/ClassTimeTip.vue";
+import navLogo from "../../components/nav-bar/nav-logo.vue";
 export default {
   data() {
     return {
@@ -597,7 +585,7 @@ export default {
       });
     },
   },
-  components: { ClassTimeTip },
+  components: { ClassTimeTip, navLogo },
 };
 </script>
 <style>