wupengfei
2 天以前 74241f0beadb3140fb2585be6cf5fd269066120f
apps/cMiniApp/src/subpackages/mine/setting/setting.vue
@@ -1,16 +1,19 @@
<template>
  <PageLayout title="设置" class="setting-page-wrapper" hasBorder>
    <List>
      <ListItem title="登录账号">
      <!-- <ListItem title="登录账号">
        <template #extra>
          <div class="user-account">
            {{ userAccount }}
          </div>
        </template>
      </ListItem>
      </ListItem> -->
      <ListItem title="用户协议" @click="goMineUserPolicy"></ListItem>
      <ListItem title="隐私政策" @click="goPrivacyPolicy"></ListItem>
      <ListItem title="退出登录" @click="handleLoginout"></ListItem>
      <ListItem title="人工客服" @click="goMineService"></ListItem>
      <!-- <nut-button :open-type="'contact'" class="setting-page-service">人工客服</nut-button> -->
      <nut-button class="setting-page-service" @click="goMineService">人工客服</nut-button>
    </List>
  </PageLayout>
</template>
@@ -31,7 +34,7 @@
const queryClient = useQueryClient();
const userAccount = computed(() => {
  return addStarForString(userStore?.userDetail?.userName, 4, 8);
  return addStarForString(userStore?.userDetail?.name, 4, 8);
});
function goMineUserPolicy() {
@@ -51,16 +54,49 @@
      message: '确定要退出登录吗?',
    });
    userStore.logoutAndToHome();
    queryClient.removeQueries();
    queryClient.removeQueries({
      predicate: (query) => !query.queryKey.includes('taskServices/getOpenTaskInfos'),
    });
  } catch (error) {}
}
function goMineService() {
  // const encodedUrl = encodeURIComponent('https://work.weixin.qq.com/kfid/kfcd24e0c60fd91099');
  Taro.openCustomerServiceChat({
    extInfo: {
      // url: 'https://work.weixin.qq.com/kfid/kfcd24e0c60fd91099',
      url: `${RouterPath.setting}`,
    },
    corpId: 'wwc84cb8e0525c772f',
    // corpId: 'kfc2335f41fb4f0c0bc',
    fail: (res) => {
      Taro.showToast({
        title: res.errMsg,
        icon: 'none',
      });
    },
  });
}
</script>
<style lang="scss">
@import '@/styles/common.scss';
.user-account {
  color: boleGetCssVar('text-color', 'regular');
  font-size: 24px;
.setting-page-wrapper {
  .user-account {
    color: boleGetCssVar('text-color', 'regular');
    font-size: 24px;
  }
  .setting-page-service {
    height: 104px;
    padding-left: 28px;
    color: boleGetCssVar('text-color', 'primary');
    width: 100%;
    .nut-button__wrap {
      justify-content: flex-start;
    }
  }
}
</style>