phone.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view>
  3. <hx-navbar left-text="绑定手机号" defaultBackUrl="security"></hx-navbar>
  4. <view class="content margin-top" v-if="currentPhone.length">
  5. <view class="flex justify-center">
  6. <image class="" src="/static/img/user/phone2.png" mode=""></image>
  7. </view>
  8. <view class="margin-top">
  9. <text class="text-black">
  10. 绑定的手机号:{{currentPhone}}
  11. </text>
  12. </view>
  13. <!-- #ifdef APP-PLUS -->
  14. <view class="margin-top"> <text class="text-gray ">
  15. 已启用手机通讯录匹配,点击下方按钮可查看手机通讯录中哪些朋友注册了{{appName}}
  16. </text>
  17. </view>
  18. <button class="cu-btn lg bg-green text-white margin-top" style="width: 100%;" @click="hrefTo('address_book')">查看手机通讯录</button>
  19. <!-- #endif -->
  20. <button class="cu-btn bg-white lg text-green margin-top" style="width: 100%;" @click="hrefTo('update_phone')">更换手机号</button>
  21. </view>
  22. <view class="content margin-top" v-else>
  23. <view class="flex justify-center">
  24. <image class="" src="/static/img/user/phone.png" mode=""></image>
  25. </view>
  26. <view class="margin-top">
  27. <text class="text-black">
  28. 你还没有绑定手机
  29. </text>
  30. </view>
  31. <!-- #ifdef APP-PLUS -->
  32. <view class="margin-top"> <text class="text-gray ">
  33. 已启用手机通讯录匹配,点击下方按钮可查看手机通讯录中哪些朋友注册了{{appName}}
  34. </text>
  35. </view>
  36. <button class="cu-btn lg bg-yellow text-white margin-top" style="width: 100%;" @click="hrefTo('address_book')">查看手机通讯录</button>
  37. <!-- #endif -->
  38. <button class="cu-btn bg-yellow lg text-white margin-top" style="width: 100%;" @click="hrefTo('bind_phone')">绑定手机号</button>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. mapState
  45. } from 'vuex';
  46. export default {
  47. data() {
  48. return {
  49. appName: '',
  50. currentPhone: '',
  51. }
  52. },
  53. onLoad(){
  54. let that = this;
  55. that.appName = that.$conf.appName;
  56. that.currentPhone = this.userData.member.mobile
  57. },
  58. computed:{
  59. ...mapState(['userData'])
  60. },
  61. methods: {
  62. hrefTo(url){
  63. if(url.length>0){
  64. uni.navigateTo({
  65. url: url
  66. });
  67. }
  68. }
  69. }
  70. }
  71. </script>
  72. <style>
  73. .content{
  74. padding: 24upx;
  75. text-align: center;
  76. }
  77. .content image{
  78. text-align: center;
  79. width: 240upx;
  80. height: 240upx;
  81. margin-top: 30upx;
  82. margin-bottom: 30upx;
  83. }
  84. </style>