Browse Source

优化服务器配置

fanghuisheng 1 year ago
parent
commit
5ecdaaa28a

+ 3 - 4
src/pages/login.vue

@@ -270,12 +270,11 @@ function handlePrivacy() {
   // proxy.$tab.navigateTo(`/pages/common/textview/index1?title=${site.title}&content=${site.content}`);
 }
 
-/**
- * @onLoad
- */
-onLoad(() => {
+onShow(() => {
   env();
 });
+
+onLoad((options) => {});
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/pages/serveConfig.vue

@@ -126,7 +126,7 @@ function handleSubmit() {
  * @跳转登录
  */
 function navigateTo() {
-  proxy.$tab.redirectTo("/pages/serveConfigSelect");
+  proxy.$tab.navigateBack(1);
 }
 
 onLoad((options) => {});

+ 7 - 9
src/pages/serveConfigSelect.vue

@@ -1,7 +1,7 @@
 <template>
   <view id="serveConfig">
     <view class="top">
-      <u-icon name="arrow-left" size="17px" color="#000" :bold="true" @click="navigateTo"></u-icon>
+      <u-icon name="arrow-left" size="17px" color="#000" :bold="true" @click="navigateTo()"></u-icon>
     </view>
 
     <view class="content">
@@ -52,10 +52,6 @@ const dataList = reactive({
 const uForm = ref(null);
 const { radiolist, radiovalue } = toRefs(dataList);
 
-/**
- * @获取serveList
- */
-
 /**
  * @切换单选
  * @按钮点击事件
@@ -116,7 +112,7 @@ function serveClick(type) {
       },
     });
   } else if (type == 2) {
-    proxy.$tab.redirectTo("/pages/serveConfig");
+    proxy.$tab.navigateTo("/pages/serveConfig");
   }
 }
 
@@ -141,7 +137,7 @@ function handleSubmit() {
  * @跳转登录
  */
 function navigateTo() {
-  proxy.$tab.reLaunch("/pages/login");
+  proxy.$tab.navigateBack(1);
 }
 
 /**
@@ -150,14 +146,16 @@ function navigateTo() {
 function init() {
   let serveList = uni.getStorageSync("serveList");
   if (serveList.length > 0) {
-    radiovalue.value = serveList[0].radiovalue;
     radiolist.value = serveList[0].radiolist;
+    radiovalue.value = serveList[0].radiovalue;
   }
 }
 
-onLoad((options) => {
+onShow(() => {
   init();
 });
+
+onLoad((options) => {});
 </script>
 
 <style lang="scss" scoped>

+ 5 - 1
src/plugins/common.plugins.js

@@ -25,7 +25,11 @@ export default {
     return result;
   },
 
-
+  /**
+   * @复制粘贴板
+   * @param {*} param0 
+   * @returns 
+   */
   uniCopy({ content, success, error }) {
     if (!content) return error('复制的内容不能为空 !')
     content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串

+ 4 - 2
src/plugins/tab.plugins.js

@@ -24,7 +24,9 @@ export default {
     })
   },
   // 关闭当前页面,返回上一页面或多级页面
-  navigateBack() {
-    return uni.navigateBack()
+  navigateBack(value) {
+    return uni.navigateBack({
+      delta: value, //返回到需要执行方法的页面
+    })
   }
 }