sys vor 2 Jahren
Ursprung
Commit
93e812cea1

+ 1 - 1
api/common.js

@@ -1,4 +1,4 @@
-import {request} from './ajax.js'
+import {request} from '../service/ajax.js'
 
 const commonUrl = '/api/common/'
 // 发送短信

+ 1 - 1
api/goods.js

@@ -1,4 +1,4 @@
-import { request } from './ajax.js'
+import { request } from '../service/ajax.js'
 // 商品模块路由
 const goodsUrl = '/api/goods/'
 // 猜你喜欢

+ 1 - 1
api/login.js

@@ -1,4 +1,4 @@
-import {request} from './ajax.js'
+import {request} from '../service/ajax.js'
 
 const newsUrl = '/api/user/'
 // 登陆

+ 0 - 95
common/js/utils.js

@@ -1,95 +0,0 @@
-export const toInteger = function (num) {
-    // 取整
-    let toNum = "";
-    toNum = parseInt(num);
-    return toNum;
-}
-export const twoFloating = function (num) {
-    // 获取两位小数
-    let price = "";
-    price = num * 1;
-    price = String(price).split(".")[1];
-    if (price !== undefined && price.length === 1) {
-        price = `.${price}0`;
-    } else {
-        price === undefined ? (price = ".00") : (price = `.${price}`);
-    }
-    return price;
-}
-
-
-/**
- * 获取开发平台
- * @returns {string}
- */
-export const getPlatform = function () {
-    let platForm = undefined;
-    // #ifdef H5
-    platForm = 'H5';
-    //#endif
-    // #ifdef APP-PLUS
-    platForm = 'APP';
-    //#endif
-    // #ifdef APP-PLUS-NVUE
-    platForm = 'APP';
-    //#endif
-    // #ifdef APP-NVUE
-    platForm = 'APP';
-    //#endif
-    // #ifdef MP-WEIXIN
-    platForm = 'MP-WEIXIN';
-    //#endif
-    // #ifdef MP-ALIPAY
-    platForm = 'MP-ALIPAY';
-    //#endif
-    // #ifdef MP-BAIDU
-    platForm = 'MP-BAIDU';
-    //#endif
-    // #ifdef MP-TOUTIAO
-    platForm = 'MP-TOUTIAO';
-    //#endif
-    // #ifdef MP-LARK
-    platForm = 'MP-LARK';
-    //#endif
-    // #ifdef MP-QQ
-    platForm = 'MP-QQ';
-    //#endif
-    // #ifdef MP-KUAISHOU
-    platForm = 'MP-KUAISHOU';
-    //#endif
-    // #ifdef QUICKAPP-WEBVIEW
-    platForm = 'QUICKAPP-WEBVIEW';
-    //#endif
-    return platForm;
-
-}
-
-/**
- * 获取小程序胶囊居中对齐的高度
- */
-export const getNavHeight = function () {
-    let platForm = getPlatform();
-    if (platForm === 'MP-WEIXIN') {
-        let res = uni.getSystemInfoSync();
-        let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
-        let navHeight =
-            menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2;
-        return navHeight
-    } else {
-        return 44;
-    }
-}
-
-/**
- * 手机顶部高度
- */
-export const getPhoneTopHeight = function () {
-    let platForm = getPlatform();
-    if (platForm === 'MP-WEIXIN') {
-        let height = uni.getSystemInfoSync().statusBarHeight;
-        return height
-    } else {
-        return 0;
-    }
-
-}

+ 2 - 2
components/en-from/en-head/en-head-img.vue

@@ -18,8 +18,8 @@
 </template>
 
 <script>
-	import { upLoadingFileOss } from "@/common/js/upLoadingFile";
-	import tools from '@/common/js/tools.js'
+	import { upLoadingFileOss } from "@/service/upLoadingFile";
+	import tools from '@/service/tools.js'
 
 	export default {
 		props:{

+ 2 - 2
components/en-from/en-upload/en-upload.vue

@@ -35,8 +35,8 @@
 </template>
 
 <script>
-import tools from "@/common/js/tools";
-import {upLoadingFileOss} from "@/common/js/upLoadingFile";
+import tools from "@/service/tools";
+import {upLoadingFileOss} from "@/service/upLoadingFile";
 
 export default {
   components:{

+ 38 - 4
components/en-list/en-list.vue

@@ -1,11 +1,11 @@
 <template>
   <view class="list">
-    <Blank v-if="list.length<0"></Blank>
+    <Blank v-if="list.length<=0"></Blank>
     <view class="scroll-view" v-else>
-      <scroll-view class="scroll-list" scroll-y="true" style="height: 100%;" @scrolltolower="onReachScollBottom"
+      <scroll-view class="scroll-list" scroll-y="true" :style="listStyle" @scrolltolower="onReachScollBottom"
                    :scroll-top="scrollTop" @scroll="scroll">
         <slot name="listInfo" v-bind:pagingData="list"></slot>
-        <view class="toMore" v-show="isAjax">加载中-----</view>
+        <view class="toMore" v-show="isAjax">加载中...</view>
       </scroll-view>
     </view>
 
@@ -17,6 +17,15 @@ import Blank from 'components/en-utils/en-blank/en-blank'
 
 export default {
   components: {Blank},
+  props:{
+    'height':{
+      default:''
+    },
+    'isAll':{
+      type:Boolean,
+      default:false
+    }
+  },
   data() {
     return {
       list: [],
@@ -24,12 +33,37 @@ export default {
       page: 1,
       total: null,
       isAjax: false,
+      listStyle:{
+        'height':'calc(100vh - env(safe-area-inset-bottom))'
+      }
+    }
+  },
+  watch: {
+    'height':function (){
+      this.setHeight()
+    },
+    'isAll':function () {
+      this.setHeight()
     }
   },
   mounted() {
     this.getList()
+    this.setHeight()
   },
   methods: {
+    setHeight(){
+      if(this.isAll){
+        this.listStyle.height='100vh'
+      }else {
+        if(this.height){
+          if(this.height>0){
+            this.listStyle.height='calc(100vh - env(safe-area-inset-bottom) - '+this.height+'rpx)'
+          }else if(this.height<0){
+            this.listStyle.height='calc(100vh - env(safe-area-inset-bottom) + '+(this.height*-1)+'rpx)'
+          }
+        }
+      }
+    },
     scroll: function (e) {
       this.scrollTop = e.detail.scrollTop
     },
@@ -55,7 +89,7 @@ export default {
       })
       this.total = total
       this.isAjax = false
-      ++this.page;
+      ++this.page
     }
 
   },

+ 1 - 1
components/en-utils/en-nav/en-nav.vue

@@ -28,7 +28,7 @@
 </template>
 
 <script>
-  import tools from "@/common/js/tools";
+  import tools from "@/service/tools";
 
   export default {
     name: "en-nav",

+ 1 - 1
main.js

@@ -4,7 +4,7 @@ import App from './App'
 import {
 	router,
 	RouterMount
-} from './common/router/router.js' //路径换成自己的
+} from './service/router.js' //路径换成自己的
 Vue.use(router)
 // #ifndef VUE3
 import Vue from 'vue'

+ 2 - 2
api/ajax.js → service/ajax.js

@@ -1,5 +1,5 @@
-import tools from "@/common/js/tools";
-import store from '@/store/index'
+import tools from "@/service/tools";
+import store from '@/store'
 let BASE_URL ='https://' + process.uniEnv.baseUrl;
 
 

+ 0 - 0
common/js/components.js → service/components.js


+ 2 - 2
common/js/permission.js → service/permission.js

@@ -1,4 +1,4 @@
-import store from '@/store/index'
+import store from '@/store'
 
 /**
  * 判定认证
@@ -14,4 +14,4 @@ export const isToken = function () {
     });
     return false;
   }
-}
+}

+ 1 - 4
common/router/router.js → service/router.js

@@ -1,8 +1,5 @@
 // router.js
 import { RouterMount, createRouter } from 'uni-simple-router';
-import tools from '@/common/js/tools'
-import store from '@/store/index'
-import { getPlatform } from '@/common/js/utils'
 const router = createRouter({
     platform: process.env.VUE_APP_PLATFORM,
     routes: [...ROUTES]
@@ -41,4 +38,4 @@ router.afterEach((to, from) => {
 export {
     router,
     RouterMount
-}
+}

+ 0 - 0
common/js/tools.js → service/tools.js


+ 0 - 0
common/js/upLoadingFile.js → service/upLoadingFile.js


+ 1 - 1
store/modules/user.js

@@ -1,5 +1,5 @@
 
-import tools from "@/common/js/tools";
+import tools from "@/service/tools";
 
 const state = {
   token: uni.getStorageSync('token') || '',