index copy.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <Page title="我的" styleReset="backNone">
  3. <template v-slot:body>
  4. <div class="w-full h-full flex flex-col">
  5. <div class="px-4 py-6 flex justify-between items-center">
  6. <div class="flex items-center">
  7. <div class="bg-[#065985] text-[#fff] flex items-center justify-center profilePicture">
  8. <TranslationComponent :openId="userInfo.userInfo.name" />
  9. </div>
  10. <div class="ml-8 profilePicture-text">
  11. <TranslationComponent :openId="userInfo.userInfo.name" />
  12. </div>
  13. </div>
  14. </div>
  15. <!-- 列表 -->
  16. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  17. <div>当前版本</div>
  18. <div class="text-[#999]">{{ ['', '专业版本', '旗舰版本'][userInfo.userInfo?.company?.versionControl] }}</div>
  19. </div>
  20. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  21. <div>公司名称</div>
  22. <div class="text-[#999]">{{ userInfo.userInfo?.company?.companyName }}</div>
  23. </div>
  24. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  25. <div>账号角色</div>
  26. <div class="text-[#999]">{{ userInfo.userInfo?.roleName }}</div>
  27. </div>
  28. <div class="bg-white flex justify-between px-6 py-2 mb-1" v-if="userInfo.userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin">
  29. <div>{{ `绑定${isCorpWX ? '企业' : ''}微信` }}</div>
  30. <div class="text-[#999]">
  31. (
  32. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid == null) || (isWX && userInfo.userInfo.wxOpenid == null)">未绑定</span>
  33. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid != null) || (isWX && userInfo.userInfo.wxOpenid != null)">已绑定</span>
  34. )
  35. </div>
  36. </div>
  37. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  38. <div>有效日期</div>
  39. <div class="text-[#999]">{{ userInfo.userInfo?.company?.expirationDate }}</div>
  40. </div>
  41. <div class="bg-white flex justify-between px-6 py-2 mb-1" @click="instructions()">
  42. <div>使用说明</div>
  43. <div class="list-imgs">
  44. <img src="/src/assets/image/rightArrow.png">
  45. </div>
  46. </div>
  47. <!-- <div class="bg-white flex justify-between px-6 py-2 mb-1">
  48. <div>在线客服</div>
  49. <div class="list-imgs">
  50. <img src="/src/assets/image/rightArrow.png">
  51. </div>
  52. </div> -->
  53. <div class="bg-white flex justify-between px-6 py-2 mb-1" @click="applicationMarket()">
  54. <div>应用市场</div>
  55. <div class="list-imgs">
  56. <img src="/src/assets/image/rightArrow.png">
  57. </div>
  58. </div>
  59. <!-- 退出登录 -->
  60. <div class="w-full mb-40 px-24 mt-20" v-if="!isCorpWX">
  61. <van-button type="primary" @click="signOut" class="w-full">退出登录</van-button>
  62. </div>
  63. </div>
  64. </template>
  65. <template v-slot:footer>
  66. <Footer />
  67. </template>
  68. </Page>
  69. </template>
  70. <script setup>
  71. import { ref } from "vue";
  72. import { useLifecycle } from "@hooks/useCommon.js";
  73. import useRouterStore from "@store/useRouterStore.js";
  74. import useInfoStore from "@store/useInfoStore.js";
  75. import Footer from "@components/page/footer.vue";
  76. const router = useRouterStore()
  77. const userInfo = useInfoStore()
  78. const isCorpWX = ref(false)
  79. const isWX = ref(false)
  80. function instructions() {
  81. router.navigateTo({
  82. pathName: 'pdfPreview',
  83. })
  84. }
  85. function bindWeiXin() {
  86. //企业微信
  87. if (isCorpWX.value && userInfo.userInfo.corpwxUserid != null) {
  88. return;
  89. }
  90. //微信
  91. else if (isWX.value && userInfo.userInfo.wxOpenid != null) {
  92. return;
  93. }
  94. var appId = "wx1c1d8fc81bc073a8";//火石智能客户管家公众号
  95. var url = "https://mobcrm.ttkuaiban.com/api/wechat/bindWeiXin2?userId=" + userInfo.userInfo.id;//工时管家公众号授权回调页面
  96. if (isCorpWX.value) {
  97. appId = "ww4e237fd6abb635af"; //企业微信第三方的SUIT ID
  98. url = "https://crm.ttkuaiban.com/api/wxcorp/bindCorpWeiXin?userId=" + userInfo.userInfo.id;//授权回调页面
  99. }
  100. var weixinUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appId + "&redirect_uri=" + encodeURI(url) + "&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
  101. window.location.href = weixinUrl;
  102. }
  103. function signOut() {
  104. router.redirectTo({
  105. pathName: 'login',
  106. success: () => {
  107. localStorage.clear()
  108. sessionStorage.clear()
  109. window.location.reload();
  110. }
  111. })
  112. }
  113. function judgingTheEnvironment() {
  114. const currentEnvironment = navigator.userAgent.toLowerCase();
  115. isCorpWX.value = currentEnvironment.indexOf("wxwork") > 0 ? true : false
  116. isWX.value = currentEnvironment.indexOf("micromessenger") > 0 ? true : false
  117. }
  118. const applicationMarket = () => {
  119. window.location.href = 'https://www.ttkuaiban.com/appMarket.html'
  120. // window.open('https://www.ttkuaiban.com/appMarket.html', '_blank');
  121. }
  122. useLifecycle({
  123. load: () => {
  124. judgingTheEnvironment()
  125. }
  126. });
  127. </script>
  128. <style lang="scss" scoped>
  129. .backNone {
  130. background: linear-gradient(to bottom, #E0EFFF, #F8F8F8 30%) !important;
  131. :deep(.van-nav-bar) {
  132. background: none;
  133. }
  134. }
  135. .headPortrait {
  136. width: 80px;
  137. height: 80px;
  138. border-radius: 50%;
  139. position: relative;
  140. margin-top: 20px;
  141. margin-bottom: 10px;
  142. &::after {
  143. content: "";
  144. width: 24px;
  145. height: 24px;
  146. background-image: url('@/assets/image/camera.png');
  147. background-size: cover;
  148. position: absolute;
  149. bottom: 0;
  150. right: 0;
  151. }
  152. }
  153. .xinming {
  154. color: #000000;
  155. font-family: PingFang SC;
  156. font-weight: semibold;
  157. font-size: 18px;
  158. line-height: normal;
  159. letter-spacing: 0px;
  160. text-align: left;
  161. margin-bottom: 6px;
  162. text-align: center;
  163. }
  164. .profilePicture {
  165. width: 60px;
  166. height: 60px;
  167. border-radius: 50%;
  168. font-size: 16px;
  169. }
  170. .profilePicture-text {
  171. font-size: 16px;
  172. color: #065985;
  173. font-weight: bold;
  174. }
  175. .profilePicture-img {
  176. width: 24px;
  177. }
  178. .list-imgs {
  179. width: 14px;
  180. }
  181. </style>