瀏覽代碼

style(client):优化设置样式

yizhiyang 10 月之前
父節點
當前提交
9c92a01d3c

+ 0 - 108
src/PageMine/setting/index copy.vue

@@ -1,108 +0,0 @@
-<template>
-  <view class="container">
-    <view class="main-out-box">
-      <view class="main-inner-box">
-        <u-cell-group :border="false">
-          <u-cell size="large" :border="false" icon="account-fill" title="个人信息" isLink
-            url="/PageMine/setting/personInformation" />
-          <!-- <u-cell size="large" :border="false" icon="fingerprint" title="安全中心" isLink
-            url="/pages/client/clientUser/mine/setting/personInfo" /> -->
-          <u-cell size="large" :border="false" icon="github-circle-fill" title="关于我们" isLink
-            url="/PageMine/setting/aboutUs" />
-          <u-cell size="large" :border="false" icon="file-text-fill" title="用户协议" isLink
-            url="/pages/webview/index?target=http://8.137.122.65:88/用户协议.html" />
-          <u-cell size="large" :border="false" icon="file-text" title="隐私政策" isLink
-            url="/pages/webview/index?target=http://8.137.122.65:88/隐私政策.html" />
-          <u-cell icon="integral-fill" title="版本信息" value="V0.0.1" />
-        </u-cell-group>
-      </view>
-    </view>
-
-    <!-- <view class="policy-out-box">
-      <view class="policy-inner-box">
-        <u-cell-group :border="false">
-          <u-cell size="large" :border="false" icon="level" title="切换身份" isLink @click="showSwitchDialog = true" />
-        </u-cell-group>
-      </view>
-    </view> -->
-
-    <u-modal :show="showSwitchDialog" :title="title" :content="content" @confirm="confirmSwitch"
-      @cancel="showSwitchDialog = false" :showCancelButton="true"></u-modal>
-
-    <view class="exit">
-      <u-button type="info" shape="circle" text="注销账号" class="button" />
-      <u-button type="primary" shape="circle" text="退出登录" @tap="logout" class="button" />
-    </view>
-  </view>
-</template>
-
-<script>
-  export default {
-    data() {
-      return {
-        showSwitchDialog: false,
-        title: '提醒',
-        content: '您确定要从用户端切换到商家端吗?',
-      };
-    },
-
-    methods: {
-      confirmSwitch() {
-        // this.showSwitchDialog = false;
-        // this.$store.dispatch('SwitchIdentity','MERCHANT')
-        // uni.navigateTo({
-        //   url: '/pages/merchant/mine/index',
-        // });
-      },
-      logout(){
-        this.$store.dispatch('Logout').then(()=>{
-          uni.navigateTo({
-            url: `pages/login/login`,
-          });
-        })
-      }
-    },
-  };
-</script>
-
-<style lang="scss" scoped>
-  .container {
-    min-height: 100vh;
-    background-color: #efefef;
-
-    .main-out-box {
-      padding: 20rpx 16rpx;
-      box-sizing: border-box;
-
-      .main-inner-box {
-        background-color: $uni-bg-color;
-        border-radius: 20rpx;
-      }
-    }
-
-    .policy-out-box {
-      padding: 50rpx 16rpx;
-      box-sizing: border-box;
-
-      .policy-inner-box {
-        background-color: $uni-bg-color;
-        border-radius: 20rpx;
-      }
-    }
-  }
-
-  .exit {
-    // display: flex;
-    // justify-content: space-around;
-    margin-top: 100rpx;
-  }
-
-  .button {
-    width: 500rpx;
-    margin-top: 45rpx;
-  }
-
-  ::v-deep .u-modal__title {
-    padding-top: 15px;
-  }
-</style>

+ 99 - 91
src/PageMine/setting/index.vue

@@ -1,108 +1,116 @@
 <template>
-  <view class="container">
-    <view class="main-out-box">
-      <view class="main-inner-box">
-        <u-cell-group :border="false">
-          <u-cell size="large" :border="false" icon="account-fill" title="个人信息" isLink
-            url="/PageMine/setting/personInformation" />
-          <!-- <u-cell size="large" :border="false" icon="fingerprint" title="安全中心" isLink
-            url="/pages/client/clientUser/mine/setting/personInfo" /> -->
-          <u-cell size="large" :border="false" icon="github-circle-fill" title="关于我们" isLink
-            url="/PageMine/setting/aboutUs" />
-          <u-cell size="large" :border="false" icon="file-text-fill" title="用户协议" isLink
-            url="/pages/webview/index?target=http://8.137.122.65:88/用户协议.html" />
-          <u-cell size="large" :border="false" icon="file-text" title="隐私政策" isLink
-            url="/pages/webview/index?target=http://8.137.122.65:88/隐私政策.html" />
-          <u-cell icon="integral-fill" title="版本信息" value="V0.0.1" />
-        </u-cell-group>
-      </view>
-    </view>
-
-    <!-- <view class="policy-out-box">
-      <view class="policy-inner-box">
-        <u-cell-group :border="false">
-          <u-cell size="large" :border="false" icon="level" title="切换身份" isLink @click="showSwitchDialog = true" />
-        </u-cell-group>
-      </view>
-    </view> -->
-
-    <u-modal :show="showSwitchDialog" :title="title" :content="content" @confirm="confirmSwitch"
-      @cancel="showSwitchDialog = false" :showCancelButton="true"></u-modal>
+  <view class="client-setting">
+    <page-navbar bgColor="#fff" title="设置"></page-navbar>
+    <base-card marginBottom="24rpx" padding="0 24rpx">
+      <u-cell-group v-for="(item, index) in LinkList1" :key="index" :border="false">
+        <u-cell :title="item.title" isLink :border="index !== 1" :url="item.url" />
+      </u-cell-group>
+    </base-card>
+    <base-card marginBottom="24rpx" padding="0 24rpx">
+      <u-cell-group v-for="(item, index) in LinkList2" :key="index" :border="false">
+        <u-cell :title="item.title" isLink :border="index !== 2" :url="item.url" />
+      </u-cell-group>
+    </base-card>
+    <base-card padding="0 24rpx">
+      <u-cell-group v-for="(item, index) in LinkList3" :key="index" :border="false">
+        <u-cell :title="item.title" isLink :border="index !== 1" :url="item.url" />
+      </u-cell-group>
+    </base-card>
 
-    <view class="exit">
-      <u-button type="info" shape="circle" text="注销账号" class="button" />
-      <u-button type="primary" shape="circle" text="退出登录" @tap="logout" class="button" />
+    <view>
+      <u-button text="切换角色" :customStyle="customStyleRole" @click="handleRole"></u-button>
+      <u-button text="退出登录" :customStyle="customStyleOut" @click="handleLogout"></u-button>
     </view>
   </view>
 </template>
 
 <script>
-  export default {
-    data() {
+export default {
+  data() {
+    return {
+      LinkList1: [
+        {
+          title: '个人信息',
+          url: '/PageMine/setting/personInformation',
+        },
+        {
+          title: '我的地址',
+          url: '',
+        },
+      ],
+      LinkList2: [
+        {
+          title: '用户协议',
+          url: '/pages/webview/index?target=http://8.137.122.65:88/用户协议.html',
+        },
+        {
+          title: '隐私协议',
+          url: '/pages/webview/index?target=http://8.137.122.65:88/隐私政策.html',
+        },
+        {
+          title: '注销账号',
+          url: '',
+        },
+      ],
+      LinkList3: [
+        {
+          title: '意见反馈',
+          url: '/PageMine/feedback?channelType',
+        },
+        {
+          title: '关于车旅程',
+          url: '/PageMine/setting/aboutUs',
+        },
+      ],
+    };
+  },
+  computed: {
+    customStyleOut() {
       return {
-        showSwitchDialog: false,
-        title: '提醒',
-        content: '您确定要从用户端切换到商家端吗?',
+        color: '#EB3636',
+        marginTop: '32rpx',
+        borderRadius: '16rpx',
+        height: '94rpx',
+        border: 'none',
+        fontSize: '30rpx',
       };
     },
-
-    methods: {
-      confirmSwitch() {
-        // this.showSwitchDialog = false;
-        // this.$store.dispatch('SwitchIdentity','MERCHANT')
-        // uni.navigateTo({
-        //   url: '/pages/merchant/mine/index',
-        // });
-      },
-      logout(){
-        this.$store.dispatch('Logout').then(()=>{
-          uni.navigateTo({
-            url: `pages/login/login`,
-          });
-        })
-      }
+    customStyleRole() {
+      return {
+        color: '#0C1223',
+        marginTop: '32rpx',
+        borderRadius: '16rpx',
+        height: '94rpx',
+        border: 'none',
+        fontSize: '30rpx',
+      };
+    },
+  },
+  methods: {
+    handleRole() {
+      this.$u.toast('该功能暂未开发,尽情期待!');
+      // this.$store.dispatch('SwitchIdentity', 'MERCHANT');
+      // uni.navigateTo({
+      //   url: '/pages/merchant/mine/index',
+      // });
     },
-  };
+    handleLogout() {
+      this.$store.dispatch('Logout').then(() => {
+        uni.navigateTo({
+          url: `pages/login/login`,
+        });
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .container {
-    min-height: 100vh;
-    background-color: #efefef;
-
-    .main-out-box {
-      padding: 20rpx 16rpx;
-      box-sizing: border-box;
-
-      .main-inner-box {
-        background-color: $uni-bg-color;
-        border-radius: 20rpx;
-      }
-    }
-
-    .policy-out-box {
-      padding: 50rpx 16rpx;
-      box-sizing: border-box;
-
-      .policy-inner-box {
-        background-color: $uni-bg-color;
-        border-radius: 20rpx;
-      }
-    }
-  }
-
-  .exit {
-    // display: flex;
-    // justify-content: space-around;
-    margin-top: 100rpx;
-  }
-
-  .button {
-    width: 500rpx;
-    margin-top: 45rpx;
-  }
+.client-setting {
+  padding: 20rpx 32rpx;
 
-  ::v-deep .u-modal__title {
-    padding-top: 15px;
+  ::v-deep .u-cell__title-text {
+    line-height: 50rpx !important;
   }
+}
 </style>

+ 0 - 73
src/components/base-button/base-button.vue

@@ -1,73 +0,0 @@
-<template>
-  <view class="base-button" :style="baseButtonStyle">
-    <u-button
-      :customStyle="buttonCustomStyle"
-      :color="color"
-      v-bind="$attrs"
-      v-on="$listeners"
-    ></u-button>
-  </view>
-</template>
-
-<script>
-export default {
-  props: {
-    buttonStyle: {
-      type: Object,
-      default: () => {
-        return {};
-      },
-    },
-    color: {
-      type: String,
-      default: '#2F7DCD',
-    },
-    left: {
-      type: String,
-      default: '',
-    },
-    right: {
-      type: String,
-      default: '',
-    },
-  },
-  data() {
-    return {
-      defStyle: {
-        borderRadius: '4rpx',
-        minWidth: '208rpx',
-        height: '88rpx',
-      },
-    };
-  },
-  computed: {
-    baseButtonStyle() {
-      return {
-        marginLeft: this.left,
-        marginRight: this.right,
-      };
-    },
-    buttonCustomStyle() {
-      return {
-        ...this.defStyle,
-        ...this.buttonStyle,
-      };
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.base-button {
-  width: 100%;
-  display: inline-block;
-
-  ::v-deep .u-button__text {
-    font-size: 34rpx !important;
-  }
-
-  ::v-deep .u-button--plain {
-    background-color: transparent;
-  }
-}
-</style>

+ 1 - 0
src/components/load-more/load-more.vue

@@ -6,6 +6,7 @@
 
 <script>
 export default {
+  name: 'load-more',
   props: {
     status: {
       type: String,

+ 5 - 6
src/pages.json

@@ -256,7 +256,7 @@
         {
           "path": "setting/index",
           "style": {
-            "navigationBarTitleText": "设置"
+            "navigationStyle": "custom"
           }
         },
         {
@@ -437,11 +437,10 @@
           }
         },
         {
-        	"path" : "mineModule/myPurse/detail",
-        	"style" : 
-        	{
-        		"navigationBarTitleText" : "余额明细"
-        	}
+          "path": "mineModule/myPurse/detail",
+          "style": {
+            "navigationBarTitleText": "余额明细"
+          }
         }
       ]
     }

+ 2 - 5
src/utils/request.js

@@ -11,10 +11,9 @@ import {
 
 // 每次请求都创建一个新的实例
 const instance = axios.create({
-  // baseURL: 'https://test.api.chelvc.com',
+  baseURL: 'https://test.api.chelvc.com',
   // baseURL: "http://192.168.68.77:11000",
-  // baseURL: "https://358175z5l5.yicp.fun",
-  baseURL: "http://localhost:11000",
+  // baseURL: "http://localhost:11000",
   timeout: 10000,
   adapter: UniAdapter,
 });
@@ -27,8 +26,6 @@ instance.interceptors.request.use(config => {
   if (store.getters.accessToken) {
     config.headers['Authorization'] = `Bearer ${getAccessToken()}`;
   }
-  // console.log('@@@@config', config);
-  // console.log('@@@@store.getters.app.system', store.getters.app.system);
   config.headers = {
     ...config.headers,
     platform: store.getters.app.system.osName.toUpperCase(),