宋飞扬 hace 1 año
padre
commit
93e332f492

+ 2 - 1
src/pages/client/clientUser/mine/setting.vue

@@ -65,11 +65,11 @@
 
     <u-modal
       :show="showSwitchDialog"
-      showCancelButton="true"
       :title="title"
       :content="content"
       @confirm="confirmSwitch"
       @cancel="showSwitchDialog = false"
+      :showCancelButton="true"
     ></u-modal>
 
     <view class="exit">
@@ -97,6 +97,7 @@ export default {
 
   methods: {
     confirmSwitch() {
+      this.showSwitchDialog = false;
       uni.setStorageSync('tabbar_type', false);
       uni.navigateTo({
         url: '/pages/merchant/tabBar/mine/index',

+ 43 - 5
src/pages/client/tabBar/mine/TapList.vue

@@ -22,10 +22,20 @@
         :border="false"
         :icon="item.icon"
         :title="item.title"
-        isLink
+        :isLink="item.isLink"
         :url="item.url"
+        @click="handleCellClick(item)"
       />
     </view>
+
+    <u-modal
+      :show="showSwitchDialog"
+      :showCancelButton="true"
+      :title="title"
+      :content="content"
+      @confirm="confirmSwitch"
+      @cancel="showSwitchDialog = false"
+    ></u-modal>
   </view>
 </template>
 
@@ -53,34 +63,62 @@ export default {
           icon: 'setting-fill',
           title: '我的店铺',
           url: '',
+          isLink: false,
         },
         {
           id: '1',
           icon: 'setting-fill',
           title: '我的团队',
           url: '/pages/client/clientUser/myGroup',
+          isLink: true,
         },
         {
           id: '2',
           icon: 'setting-fill',
           title: '客服中心',
           url: '/pages/client/clientUser/serviceCenter',
+          isLink: true,
         },
         {
           id: '3',
           icon: 'setting-fill',
-          title: '关于我们',
-          url: '/pages/client/clientUser/mine/setting/aboutMine',
+          title: '意见反馈',
+          url: '/pages/client/clientUser/mine/setting/feedback',
+          isLink: true,
         },
         {
           id: '4',
           icon: 'setting-fill',
-          title: '意见反馈',
-          url: '/pages/client/clientUser/mine/setting/feedback',
+          title: '关于我们',
+          url: '/pages/client/clientUser/mine/setting/aboutMine',
+          isLink: true,
         },
       ],
+
+      showSwitchDialog: false,
+      title: '提醒',
+      content: '您确定要从用户端切换到商家端吗?',
     };
   },
+
+  methods: {
+    handleCellClick(item) {
+      console.log('item', item);
+      if (item.id == 0) {
+        this.showSwitchDialog = true;
+      } else {
+        console.log('点击了非链接项');
+      }
+    },
+
+    confirmSwitch() {
+      this.showSwitchDialog = false;
+      uni.setStorageSync('tabbar_type', false);
+      uni.navigateTo({
+        url: '/pages/merchant/tabBar/mine/index',
+      });
+    },
+  },
 };
 </script>
 

+ 1 - 1
src/pages/merchant/tabBar/mine/index.vue

@@ -148,7 +148,7 @@ export default {
   },
 
   onLoad() {
-    this.getHeight();
+    // this.getHeight();
   },
 
   methods: {

+ 25 - 11
src/pages/merchant/tabBar/mine/setting/index.vue

@@ -45,12 +45,19 @@
     </view>
 
     <view class="btn-box">
-      <button class="btn1" @click="showSwitchDialog = true">切换账号</button>
-      <button class="btn2" @click="loginout_show = true">退出登录</button>
+      <!-- <button class="btn1" @click="showSwitchDialog = true">切换身份</button>
+      <button class="btn2" @click="loginout_show = true">退出登录</button> -->
+      <u-button class="btn1" @click="showSwitchDialog = true" text="切换身份"></u-button>
+      <u-button
+        class="btn2"
+        @click="loginout_show = true"
+        type="primary"
+        text="退出登录"
+      ></u-button>
     </view>
     <u-modal
       :show="showSwitchDialog"
-      showCancelButton="true"
+      :showCancelButton="true"
       :title="title"
       :content="content"
       @confirm="confirmSwitch"
@@ -58,8 +65,9 @@
     ></u-modal>
     <u-modal
       :show="loginout_show"
-      :content="content"
-      showCancelButton="true"
+      :content="content1"
+      :title="title"
+      :showCancelButton="true"
       @confirm="handlerLoginOutConfirm"
       @cancel="loginout_show = false"
     ></u-modal>
@@ -73,7 +81,9 @@ export default {
       value: true,
       icon_size: 18,
       loginout_show: false,
-      content: '退出后店铺状态将变更为休息中,是否退出当前帐号',
+      content: '您确定要从商家端切换到用户端吗',
+      content1: '您确定要退出登录?确定将同时退出用户端哦',
+      title: '温馨提示',
       privacy_list: [
         {
           name: '应用权限说明',
@@ -124,6 +134,9 @@ export default {
     //点击退出登录
     handlerLoginOutConfirm() {
       this.loginout_show = false;
+      uni.navigateTo({
+        url: `pages/login/index`,
+      });
     },
   },
 };
@@ -154,22 +167,23 @@ export default {
   }
 }
 .btn-box {
-  width: 90%;
-  margin: 200rpx auto 0;
+  width: 70%;
+  margin: 100rpx auto 0;
   .btn1,
   .btn2 {
     padding: 20rpx;
     height: 80rpx;
     font-size: 28rpx;
     line-height: 40rpx;
+    border-radius: 35rpx;
   }
   .btn1 {
-    background-color: #5992bb;
-    color: #000;
+    // background-color: #5992bb;
+    // color: #000;
   }
   .btn2 {
     margin-top: 50rpx;
-    background-color: #e2e2e2;
+    // background-color: #e2e2e2;
   }
 }
 ::v-deep .u-modal__content__text.data-v-713d0fd3 {