index copy 2.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="personalCenter">
  3. <div class="personalCenter-top flex flex-col">
  4. <div class="px-4 flex justify-between items-center avatarSection">
  5. <div class="flex items-center">
  6. <div
  7. class="bg-[#fff] text-[#333] flex items-center justify-center profilePicture"
  8. >
  9. <TranslationComponent :openId="userInfo.userInfo.name" />
  10. </div>
  11. <div class="ml-8 profilePicture-text">
  12. <TranslationComponent :openId="userInfo.userInfo.name" /> <br />
  13. <div class="jobIdEtc">工号:{{ userInfo.userInfo.jobNumber ? userInfo.userInfo.jobNumber : '待配置' }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="flex-1 overflow-y-auto personalCenter-content">
  19. <div class="flex flex-row items-center justify-between">
  20. <div class="list-tile flex">
  21. <img src="../../../assets/image/dqbb.png" alt="" />
  22. <div class="list-tile-text">当前版本</div>
  23. </div>
  24. <div class="list-text">{{ ['', '专业版本', '旗舰版本'][userInfo.userInfo?.company?.versionControl] }}</div>
  25. </div>
  26. <div class="flex flex-row items-center justify-between" v-if="userInfo.userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin">
  27. <div class="list-tile flex">
  28. <img src="../../../assets/image/dqbb.png" alt="" />
  29. <div class="list-tile-text">{{ `绑定${isCorpWX ? '企业' : ''}微信` }}</div>
  30. </div>
  31. <div class="list-text">
  32. (
  33. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid == null) || (isWX && userInfo.userInfo.wxOpenid == null)">未绑定</span>
  34. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid != null) || (isWX && userInfo.userInfo.wxOpenid != null)">已绑定</span>
  35. )
  36. </div>
  37. </div>
  38. <div class="flex flex-row items-center justify-between mt-3">
  39. <div class="list-tile flex">
  40. <img src="../../../assets/image/gsmc.png" alt="" />
  41. <div class="list-tile-text">公司名称</div>
  42. </div>
  43. <div class="list-text">{{ userInfo.userInfo?.company?.companyName }}</div>
  44. </div>
  45. <div class="flex flex-row items-center justify-between mt-3">
  46. <div class="list-tile flex">
  47. <img src="../../../assets/image/dqzh.png" alt="" />
  48. <div class="list-tile-text">账号角色</div>
  49. </div>
  50. <div class="list-text">{{ userInfo.userInfo?.roleName }}</div>
  51. </div>
  52. <div class="flex flex-row items-center justify-between mt-3">
  53. <div class="list-tile flex">
  54. <img src="../../../assets/image/yxrq.png" alt="" />
  55. <div class="list-tile-text">有效日期</div>
  56. </div>
  57. <div class="list-text">{{ userInfo.userInfo?.company?.expirationDate }}</div>
  58. </div>
  59. <div class="flex flex-row items-center justify-between mt-3" @click="instructions()">
  60. <div class="list-tile flex">
  61. <img src="../../../assets/image/sysm.png" alt="" />
  62. <div class="list-tile-text">使用说明</div>
  63. </div>
  64. <img src="../../../assets/image/rightArrow.png" class="list-text-img"></img>
  65. </div>
  66. <div class="flex flex-row items-center justify-between mt-3" @click="applicationMarket()">
  67. <div class="list-tile flex">
  68. <img src="../../../assets/image/yysc.png" alt="" />
  69. <div class="list-tile-text">应用市场</div>
  70. </div>
  71. <img src="../../../assets/image/rightArrow.png" class="list-text-img"></img>
  72. </div>
  73. </div>
  74. <div><Footer /></div>
  75. </div>
  76. </template>
  77. <script setup>
  78. import { ref } from "vue";
  79. import { useLifecycle } from "@hooks/useCommon.js";
  80. import useRouterStore from "@store/useRouterStore.js";
  81. import useInfoStore from "@store/useInfoStore.js";
  82. import Footer from "@components/page/footer.vue";
  83. const router = useRouterStore();
  84. const userInfo = useInfoStore();
  85. const isCorpWX = ref(false);
  86. const isWX = ref(false);
  87. function instructions() {
  88. // router.navigateTo({
  89. // pathName: "pdfPreview",
  90. // });
  91. // 新窗口打开链接
  92. window.open("https://crm.ttkuaiban.com/upload/mobileUserManual.pdf");
  93. }
  94. function bindWeiXin() {
  95. //企业微信
  96. if (isCorpWX.value && userInfo.userInfo.corpwxUserid != null) {
  97. return;
  98. }
  99. //微信
  100. else if (isWX.value && userInfo.userInfo.wxOpenid != null) {
  101. return;
  102. }
  103. var appId = "wx1c1d8fc81bc073a8"; //火石智能客户管家公众号
  104. var url =
  105. "https://mobcrm.ttkuaiban.com/api/wechat/bindWeiXin2?userId=" +
  106. userInfo.userInfo.id; //工时管家公众号授权回调页面
  107. if (isCorpWX.value) {
  108. appId = "ww4e237fd6abb635af"; //企业微信第三方的SUIT ID
  109. url =
  110. "https://crm.ttkuaiban.com/api/wxcorp/bindCorpWeiXin?userId=" +
  111. userInfo.userInfo.id; //授权回调页面
  112. }
  113. var weixinUrl =
  114. "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
  115. appId +
  116. "&redirect_uri=" +
  117. encodeURI(url) +
  118. "&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
  119. window.location.href = weixinUrl;
  120. }
  121. function signOut() {
  122. router.redirectTo({
  123. pathName: "login",
  124. success: () => {
  125. localStorage.clear();
  126. sessionStorage.clear();
  127. window.location.reload();
  128. },
  129. });
  130. }
  131. function judgingTheEnvironment() {
  132. const currentEnvironment = navigator.userAgent.toLowerCase();
  133. isCorpWX.value = currentEnvironment.indexOf("wxwork") > 0 ? true : false;
  134. isWX.value = currentEnvironment.indexOf("micromessenger") > 0 ? true : false;
  135. }
  136. const applicationMarket = () => {
  137. window.location.href = "https://www.ttkuaiban.com/appMarket.html";
  138. // window.open('https://www.ttkuaiban.com/appMarket.html', '_blank');
  139. };
  140. useLifecycle({
  141. load: () => {
  142. judgingTheEnvironment();
  143. },
  144. });
  145. </script>
  146. <style lang="scss" scoped>
  147. .profilePicture {
  148. width: 70px;
  149. height: 70px;
  150. border-radius: 50%;
  151. font-size: 16px;
  152. font-weight: bold;
  153. }
  154. .profilePicture-text {
  155. font-size: 18px;
  156. color: #fff;
  157. }
  158. .profilePicture-img {
  159. width: 24px;
  160. }
  161. .list-imgs {
  162. width: 14px;
  163. }
  164. .personalCenter {
  165. width: 100%;
  166. height: 100vh;
  167. display: flex;
  168. flex-direction: column;
  169. background-color: #fff;
  170. }
  171. .personalCenter-top {
  172. width: 100%;
  173. height: 180px;
  174. background-image: url("../../../assets/image/grzxbjs.png");
  175. background-size: cover;
  176. }
  177. .avatarSection {
  178. padding: 52px 30px 0 30px;
  179. }
  180. .jobIdEtc {
  181. font-size: 13px;
  182. color: #92bdee;
  183. margin-top: 4px;
  184. }
  185. .personalCenter-content {
  186. width: 100%;
  187. border-top-left-radius: 15px;
  188. border-top-right-radius: 15px;
  189. background-color: #fff;
  190. position: relative;
  191. padding: 20px 26px 0 26px;
  192. top: -18px;
  193. }
  194. .list-text {
  195. color: #A6A6A6;
  196. font-weight: medium;
  197. font-size: 12px;
  198. position: relative;
  199. top: -3px;
  200. }
  201. .list-tile {
  202. color: #000000;
  203. font-weight: medium;
  204. font-size: 12px;
  205. }
  206. .list-tile img {
  207. width: 28px;
  208. }
  209. .list-tile-text{
  210. position: relative;
  211. top: 2px;
  212. margin-left: 10px;
  213. }
  214. .list-text-img {
  215. width: 16px;
  216. position: relative;
  217. top: -3px;
  218. }
  219. </style>