You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

personal.vue 4.8 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="main">
  3. <view class="backTop"></view>
  4. <!-- 头部开始 -->
  5. <view class="header box">
  6. <view class="header-zuo">
  7. <u-avatar
  8. :src="photo?photo:'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/zkgj/headPicture.png'"
  9. size="148"></u-avatar>
  10. </view>
  11. <view class="header-you">
  12. <view class="userName">{{name}}</view>
  13. <view class="mobile">{{mobile}}</view>
  14. </view>
  15. </view>
  16. <view class="settingGroup box">
  17. <navigator class="line" url="/pages/mine/Myprofile">
  18. <view class="title">
  19. <image src="/static/images/setting.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  20. 编辑资料
  21. </view>
  22. <view class="right">
  23. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  24. </view>
  25. </navigator>
  26. <view class="line" @click="phone">
  27. <view class="title">
  28. <image src="/static/images/Customer.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  29. 客服电话
  30. </view>
  31. <view class="right">
  32. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  33. </view>
  34. </view>
  35. <view class="line" @click="Changehepassword">
  36. <view class="title">
  37. <image src="/static/images/password.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  38. 修改密码
  39. </view>
  40. <view class="right">
  41. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  42. </view>
  43. </view>
  44. <view class="line" @click="logout" style="border: none;">
  45. <view class="title">
  46. <image src="/static/images/exit.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  47. 退出登录
  48. </view>
  49. <view class="right">
  50. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. var app = getApp();
  58. var util = require("../../utils/util.js");
  59. var config = require("../../config");
  60. export default {
  61. data() {
  62. return {
  63. name: "",
  64. photo: "",
  65. mobile: "",
  66. };
  67. },
  68. onShow: function() {
  69. var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
  70. this.name = userInfos.name,
  71. this.photo = userInfos.avatar,
  72. this.mobile = userInfos.username
  73. },
  74. methods: {
  75. //拨打电话
  76. phone() {
  77. wx.makePhoneCall({
  78. phoneNumber: '4008191707,8888' //仅为示例,并非真实的电话号码
  79. })
  80. },
  81. //修改密码
  82. Changehepassword() {
  83. uni.navigateTo({
  84. url: '/pages/mine/Changehepassword'
  85. });
  86. },
  87. //退出
  88. logout() {
  89. uni.showModal({
  90. title: '提示',
  91. content: '确定要退出?',
  92. cancelColor: "#999999",
  93. showCancel: true,
  94. success(res) {
  95. if (res.confirm) {
  96. uni.request({
  97. url: config.service.logout,
  98. header: {
  99. 'Authorization': 'Basic dGVzdDp0ZXN0',
  100. 'content-type': 'application/x-www-form-urlencoded'
  101. },
  102. method: "DELETE",
  103. success: function(result) {
  104. var data = result.data; //console.log("登陆信息", data);
  105. if(data.data==true){
  106. app.Closewebsocke()
  107. uni.clearStorageSync(); //清除缓存
  108. uni.showToast({
  109. icon: "none",
  110. title: "退出成功"
  111. })
  112. uni.reLaunch({
  113. url: '/pages/login/index'
  114. });
  115. }
  116. },
  117. // 响应错误
  118. fail: function(loginResponseError) {
  119. util.showNone("网络异常,请重试");
  120. return false;
  121. }
  122. });
  123. }
  124. }
  125. });
  126. }
  127. }
  128. };
  129. </script>
  130. <style lang="scss" scoped>
  131. .main {
  132. padding: 0 30rpx;
  133. background: #F8F8F8;
  134. display: flex;
  135. flex-direction: column;
  136. min-height: 100vh;
  137. padding-bottom: 40rpx;
  138. .backTop {
  139. background: #2671E2;
  140. position: absolute;
  141. left: 0;
  142. top: 0;
  143. width: 750rpx;
  144. height: 171rpx;
  145. }
  146. .box {
  147. background: #ffffff;
  148. }
  149. }
  150. .header {
  151. z-index: 2;
  152. width: 100%;
  153. height: 212rpx;
  154. border-radius: 12rpx;
  155. margin-top: 42rpx;
  156. display: flex;
  157. .header-zuo {
  158. width: 148rpx;
  159. height: 148rpx;
  160. margin-top: 32rpx;
  161. margin-left: 30rpx;
  162. }
  163. .header-you {
  164. margin-left: 20rpx;
  165. .userName {
  166. font-size: 36rpx;
  167. font-weight: 500;
  168. color: #303030;
  169. margin-top: 56rpx;
  170. }
  171. .mobile {
  172. font-size: 30rpx;
  173. color: #BDBDBD;
  174. margin-top: 20rpx;
  175. }
  176. }
  177. }
  178. .settingGroup {
  179. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  180. border-radius: 12rpx;
  181. margin-top: 30rpx;
  182. color: #333333;
  183. font-size: 30rpx;
  184. display: flex;
  185. flex-direction: column;
  186. .line {
  187. height: 118rpx;
  188. border-bottom: 1rpx solid #EEEEEE;
  189. margin: 0 38rpx 0 30rpx;
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. .title {
  194. display: flex;
  195. align-items: center;
  196. width: 190rpx;
  197. justify-content: space-between;
  198. }
  199. }
  200. }
  201. </style>