setting.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view>
  3. <view class="index">
  4. <view class="input">
  5. <text class="left">客服热线</text>
  6. <view class="right" @tap="call">{{ info.phone }}</view>
  7. <text class="icon">&#xe60f;</text>
  8. </view>
  9. <view class="input" @tap="navigateTo('/pages/mine/opinion')">
  10. <text class="left">意见反馈</text>
  11. <view class="right"></view>
  12. <text class="icon">&#xe60f;</text>
  13. </view>
  14. <view class="input" @tap="navigateTo('/pages/mine/aboutUs')">
  15. <text class="left">关于我们</text>
  16. <view class="right"></view>
  17. <text class="icon">&#xe60f;</text>
  18. </view>
  19. <view class="input" style="border: none;" @tap="navigateTo('/pages/mine/agree')">
  20. <text class="left">用户协议</text>
  21. <view class="right"></view>
  22. <text class="icon">&#xe60f;</text>
  23. </view>
  24. </view>
  25. <button class="button" type="primary" @tap="logout">退出当帐号</button>
  26. </view>
  27. </template>
  28. <script>
  29. import helper from '../../common/helper.js';
  30. import api from '../../common/api.js';
  31. export default {
  32. data() {
  33. return {
  34. info: {}
  35. };
  36. },
  37. onLoad() {
  38. this.getInfo();
  39. },
  40. methods: {
  41. call() {
  42. uni.makePhoneCall({
  43. phoneNumber: this.info.phone
  44. });
  45. },
  46. navigateTo(url) {
  47. uni.navigateTo({
  48. url: url
  49. });
  50. },
  51. async getInfo() {
  52. let res = await api.getSetting();
  53. this.info = res.data;
  54. },
  55. logout() {
  56. api.logout();
  57. helper.clearUsetToken();
  58. uni.reLaunch({
  59. url: '/pages/login/login?switchTab=1&url=/pages/mine/mine'
  60. });
  61. }
  62. }
  63. };
  64. </script>
  65. <style lang="scss">
  66. page {
  67. background-color: #f7f7f7;
  68. }
  69. .index {
  70. border-top: 1px solid #e6e6e6;
  71. padding: 20upx 5%;
  72. background-color: #ffffff;
  73. }
  74. .input {
  75. display: flex;
  76. align-items: center;
  77. font-size: 26upx;
  78. padding: 30upx 0;
  79. border-bottom: 1px solid #e6e6e6;
  80. .left {
  81. width: 20%;
  82. }
  83. .icon {
  84. width: 10%;
  85. text-align: right;
  86. color: #b5b5b5;
  87. font-size: 26upx;
  88. }
  89. .right {
  90. width: 80%;
  91. text-align: right;
  92. color: #919191;
  93. image {
  94. width: 50upx;
  95. height: 50upx;
  96. border-radius: 50%;
  97. }
  98. }
  99. }
  100. .button {
  101. border-radius: 0px;
  102. margin-top: 20upx;
  103. font-size: 32upx;
  104. background-color: #ffffff;
  105. color: #101010;
  106. width: 90%;
  107. }
  108. .popup {
  109. height: 100%;
  110. width: 100%;
  111. }
  112. </style>