personalCenter.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <view class="container">
  3. <view class="user-box">
  4. <view class="icon-name-box">
  5. <view class="icon-box">
  6. <cover-image class="icon" :src="`/static/chat-icon/${user.icon}.png`"></cover-image>
  7. </view>
  8. <view class="name-box">
  9. <view class="name" v-if="isLogin">
  10. <view class="text">
  11. {{user.username}}
  12. </view>
  13. <view class="iconfont icon-xiugai"></view>
  14. </view>
  15. <view class="function" v-else>
  16. <view class="function-item">
  17. 登录
  18. </view>/
  19. <view class="function-item">
  20. 注册
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="info-box">
  26. <view class="info-item-box">
  27. <view class="label">
  28. 任职机构:
  29. </view>
  30. <view class="text">
  31. {{isLogin ? user.employment : ''}}
  32. </view>
  33. </view>
  34. <view class="info-item-box">
  35. <view class="label">
  36. 机构备案证号:
  37. </view>
  38. <view class="text">
  39. {{isLogin ? user.recordCertificateNumber : ''}}
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="certificate-box">
  45. <view class="title-box">
  46. 我的证明
  47. </view>
  48. <view class="list-box">
  49. <view class="list-item-box" @click="onShowCreditCard(creditCard.id)">
  50. <CreditCard :isLogin="isLogin" :data="creditCard" @guide="onCreditCardGuideClick()"></CreditCard>
  51. </view>
  52. <view class="list-item-box" :class="[isLogin ? (user.zhongjierenzheng ? 'zhongjie-back' : 'zhongjie-back-zhiyin') : 'zhongjie-back-login']" @click="onZhongJieRenZhengClick(user.zhongjierenzheng)">
  53. </view>
  54. <view class="list-item-box" :class="[isLogin ? (user.anjierenzheng ? 'anjie-back' : 'anjie-back-zhiyin') : 'anjie-back-login']" @click="onAnJieRenZhengClick(user.anjierenzheng)">
  55. </view>
  56. </view>
  57. </view>
  58. <u-popup v-model="showCreditCard" mode="center">
  59. <view class="certificate-preview-box">
  60. <CreditCard :isLogin="isLogin" size="normal red" :data="creditCard"></CreditCard>
  61. </view>
  62. </u-popup>
  63. <view class="menu-box">
  64. <view class="menu-item-box" @click="onHuiFeiJiaoJiao()">
  65. <view class="icon-box">
  66. <view class="iconfont icon-qianbi"></view>
  67. </view>
  68. <view class="content-box">
  69. 会缴缴交
  70. </view>
  71. <view class="suffix-box">
  72. <view class="iconfont icon-chevron-right"></view>
  73. </view>
  74. </view>
  75. <view class="menu-item-box" @click="onWoDeDingDan()">
  76. <view class="icon-box">
  77. <view class="iconfont icon-dingdan"></view>
  78. </view>
  79. <view class="content-box">
  80. 我的订单
  81. </view>
  82. <view class="suffix-box">
  83. <view class="iconfont icon-chevron-right"></view>
  84. </view>
  85. </view>
  86. <view class="menu-item-box">
  87. <view class="icon-box">
  88. <view class="iconfont icon-xiazai"></view>
  89. </view>
  90. <view class="content-box">
  91. 视频缓存
  92. </view>
  93. <view class="suffix-box">
  94. <view class="iconfont icon-chevron-right"></view>
  95. </view>
  96. </view>
  97. <view class="menu-item-box">
  98. <view class="icon-box">
  99. <view class="iconfont icon-shoucang"></view>
  100. </view>
  101. <view class="content-box" @click="onWoDeShouChang()">
  102. 我的收藏
  103. </view>
  104. <view class="suffix-box">
  105. <view class="iconfont icon-chevron-right"></view>
  106. </view>
  107. </view>
  108. <view class="menu-item-box" @click="onChangJianWenTi()">
  109. <view class="icon-box">
  110. <view class="iconfont icon-anquan"></view>
  111. </view>
  112. <view class="content-box">
  113. 常见问题
  114. </view>
  115. <view class="suffix-box">
  116. <view class="iconfont icon-chevron-right"></view>
  117. </view>
  118. </view>
  119. <view class="menu-item-box" @click="onLianXiWoMen()">
  120. <view class="icon-box">
  121. <view class="iconfont icon-yonghuzu"></view>
  122. </view>
  123. <view class="content-box">
  124. 联系我们
  125. </view>
  126. <view class="suffix-box">
  127. <view class="iconfont icon-chevron-right"></view>
  128. </view>
  129. </view>
  130. <view class="menu-item-box">
  131. <view class="icon-box">
  132. <view class="iconfont icon-shezhi"></view>
  133. </view>
  134. <view class="content-box">
  135. 退出/切换账号
  136. </view>
  137. <view class="suffix-box">
  138. <view class="iconfont icon-chevron-right"></view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script setup>
  145. import CreditCard from '@/components/creditCard.vue'
  146. import { ref, computed } from 'vue'
  147. import { onLoad } from '@dcloudio/uni-app'
  148. import { getToken } from '@/utils/auth.js'
  149. // 用户信息
  150. const user = ref({
  151. icon: 'jiaoyu',
  152. username: '某某某',
  153. employment: '广州市xx地产有限公司',
  154. recordCertificateNumber: '123xxxx',
  155. zhongjierenzheng: true, // 中介认证
  156. anjierenzheng: true // 按揭认证
  157. })
  158. // 是否预览信用信息卡
  159. const showCreditCard = ref(false)
  160. // 信用信息卡
  161. const creditCard = ref({
  162. id: '1',
  163. number: 'GZ2028000001',
  164. name: '彭于晏',
  165. time: '2018年6月22日',
  166. publisher: '广州市住房和城乡建设委员会',
  167. photo: 'https://ok.166.net/reunionpub/1_20210628_17a5105e667995566.jpeg',
  168. qrCode: '/static/images/zhengshu/qrCode.png'
  169. })
  170. function onShowCreditCard(valid) {
  171. showCreditCard.value = false
  172. if (isLogin.value && valid) {
  173. showCreditCard.value = true
  174. }
  175. }
  176. // 信息信用卡-点击指引
  177. function onCreditCardGuideClick() {
  178. console.log('点击-信息信用卡指引');
  179. }
  180. // 中介认证点击
  181. function onZhongJieRenZhengClick(valid) {
  182. if (!isLogin.value) {
  183. return
  184. }
  185. if (valid) {
  186. uni.navigateTo({
  187. url: '/pages/certificateDetail/certificateDetail?type=zhongjie&title=广州市房地产中介从业人员水平认证证书'
  188. })
  189. } else {
  190. console.log('跳转中介认证报名指引');
  191. }
  192. }
  193. // 按揭认证点击
  194. function onAnJieRenZhengClick(valid) {
  195. if (!isLogin.value) {
  196. return
  197. }
  198. if (valid) {
  199. uni.navigateTo({
  200. url: '/pages/certificateDetail/certificateDetail?type=anjie&title=广州市房地产按揭从业人员水平认证证书'
  201. })
  202. } else {
  203. }
  204. }
  205. // 点击-会费缴交
  206. function onHuiFeiJiaoJiao() {
  207. uni.navigateTo({
  208. url: '/pages/huiFeiJiaoJiao/huiFeiJiaoJiao'
  209. })
  210. }
  211. // 点击-我的订单
  212. function onWoDeDingDan() {
  213. uni.navigateTo({
  214. url: '/pages/order/order'
  215. })
  216. }
  217. // 点击-我的收藏
  218. function onWoDeShouChang() {
  219. uni.navigateTo({
  220. url: '/pages/collect/collect'
  221. })
  222. }
  223. // 点击-常见问题
  224. function onChangJianWenTi() {
  225. console.log('点击-常见问题');
  226. }
  227. // 点击-联系我们
  228. function onLianXiWoMen() {
  229. console.log('点击-联系我们');
  230. }
  231. const isLogin = computed(() => {
  232. return true
  233. // return getToken() ? true : false
  234. })
  235. onLoad(() => {
  236. })
  237. </script>
  238. <style lang="scss" scoped>
  239. $certificate-width: 220rpx;
  240. $certificate-height: 300rpx;
  241. .container {
  242. height: 100vh;
  243. width: 100vw;
  244. padding: 0 20rpx;
  245. background: rgb(141, 204, 255);
  246. background: -moz-linear-gradient( 90deg, rgb(141, 204, 255) 10%, rgb(247, 247, 247) 30%);
  247. background: -webkit-linear-gradient(90deg, rgb(141, 204, 255) 10%, rgb(247, 247, 247) 30%);
  248. background: -o-linear-gradient( 90deg, rgb(141, 204, 255) 10%, rgb(247, 247, 247) 30%);
  249. background: -ms-linear-gradient( 90deg, rgb(141, 204, 255) 10%, rgb(247, 247, 247) 30%);
  250. background: linear-gradient( 180deg, rgb(141, 204, 255) 10%, rgb(247, 247, 247) 30%);
  251. .user-box {
  252. padding: 0 40rpx;
  253. .icon-name-box {
  254. display: flex;
  255. align-items: center;
  256. gap: 30rpx;
  257. margin-bottom: 15rpx;
  258. .icon-box {
  259. width: 90rpx;
  260. height: 90rpx;
  261. background-color: #fff;
  262. border-radius: 50%;
  263. overflow: hidden;
  264. -webkit-box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(168, 221, 239, 0.75);
  265. -moz-box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(168, 221, 239, 0.75);
  266. box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(168, 221, 239, 0.75);
  267. .icon {
  268. height: 100%;
  269. width: 100%;
  270. object-fit: cover;
  271. }
  272. }
  273. .name-box {
  274. font-size: $uni-title-font-size-1;
  275. letter-spacing: 5rpx;
  276. .name {
  277. display: flex;
  278. gap: 5rpx;
  279. .iconfont {
  280. font-size: $uni-font-size-3;
  281. }
  282. }
  283. .function {
  284. display: flex;
  285. gap: 5rpx;
  286. }
  287. }
  288. }
  289. .info-box {
  290. .info-item-box {
  291. display: flex;
  292. align-items: center;
  293. gap: 10rpx;
  294. margin-bottom: 10rpx;
  295. font-size: $uni-font-size-1;
  296. font-weight: bold;
  297. letter-spacing: 3rpx;
  298. }
  299. }
  300. }
  301. .certificate-box {
  302. padding: 0 20rpx;
  303. margin-top: 20rpx;
  304. .title-box {
  305. font-size: $uni-title-font-size-3;
  306. font-weight: bold;
  307. }
  308. .list-box {
  309. padding: 20rpx 50rpx;
  310. width: 100%;
  311. display: flex;
  312. gap: 130rpx;
  313. overflow-x: scroll;
  314. overflow-y: hidden;
  315. white-space:nowrap;
  316. .list-item-box {
  317. flex-shrink: 0;
  318. height: $certificate-height;
  319. width: $certificate-width;
  320. background-color: #fff;
  321. &:nth-child(1) {
  322. background-color: #fff;
  323. }
  324. }
  325. .zhongjie-back {
  326. @include backgroundImg('/static/images/zhengshu/zhongjie-back.png')
  327. }
  328. .zhongjie-back-login {
  329. @include backgroundImg('/static/images/zhengshu/zhongjie-back-login.png')
  330. }
  331. .zhongjie-back-zhiyin {
  332. @include backgroundImg('/static/images/zhengshu/zhongjie-back-zhiyin.png')
  333. }
  334. .anjie-back {
  335. @include backgroundImg('/static/images/zhengshu/anjie-back.png')
  336. }
  337. .anjie-back-login {
  338. @include backgroundImg('/static/images/zhengshu/anjie-back-login.png')
  339. }
  340. .anjie-back-zhiyin {
  341. @include backgroundImg('/static/images/zhengshu/anjie-back-zhiyin.png')
  342. }
  343. }
  344. }
  345. .certificate-preview-box {
  346. height: 65vh;
  347. width: 75vw;
  348. }
  349. .menu-box {
  350. padding: 20rpx 20rpx;
  351. margin: 10rpx 0;
  352. background-color: #fff;
  353. width: 100%;
  354. border-radius: $uni-card-border-radius;
  355. -webkit-box-shadow: 0px 0px 12rpx 0px rgba(50, 50, 50, 0.25);
  356. -moz-box-shadow: 0px 0px 12rpx 0px rgba(50, 50, 50, 0.25);
  357. box-shadow: 0px 0px 12rpx 0px rgba(50, 50, 50, 0.25);
  358. .menu-item-box {
  359. height: 100rpx;
  360. font-size: $uni-font-size-1;
  361. padding: 10rpx;
  362. display: flex;
  363. gap: 10rpx;
  364. align-items: center;
  365. border-radius: $uni-card-border-radius;
  366. &:active {
  367. background-color: $uni-bg-color-hover;
  368. }
  369. .icon-box {
  370. width: 5%;
  371. font-weight: bold;
  372. }
  373. .content-box {
  374. width: 75%;
  375. letter-spacing: 3rpx;
  376. }
  377. .suffix-box {
  378. width: 20%;
  379. text-align: right;
  380. }
  381. }
  382. }
  383. }
  384. </style>