AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

317 行
7.0 KiB

  1. <template>
  2. <view class="main">
  3. <u-navbar title="我的" size="16" :is-back="false" :background="{background: 'none'}" :border-bottom="false"
  4. title-color="#333"> </u-navbar>
  5. <view class="header">
  6. <view class="header-zuo">
  7. <u-avatar :src="photo?photo:'/static/images/avatar.png'" size="128"></u-avatar>
  8. </view>
  9. <view class="header-you">
  10. <view class="userName u-line-2">
  11. {{name}}
  12. </view>
  13. <view class="mobile">{{mobile}}</view>
  14. </view>
  15. </view>
  16. <view class="settingGroup">
  17. <navigator class="line" url="/pages/mine/messageList">
  18. <view class="title">
  19. <image src="/static/images/studyhots.png" mode=""></image>
  20. 消息通知
  21. <template v-if="count > 0">
  22. <view class="count">
  23. {{ count }}
  24. </view>
  25. </template>
  26. </view>
  27. <view class="right">
  28. <image src="/static/images/right-arrow.png" mode=""></image>
  29. </view>
  30. </navigator>
  31. <navigator class="line" url="/pages/mine/Myprofile">
  32. <view class="title">
  33. <image src="/static/images/setting.png" mode=""></image>
  34. 个人资料
  35. </view>
  36. <view class="right">
  37. <image src="/static/images/right-arrow.png" mode=""></image>
  38. </view>
  39. </navigator>
  40. <view class="line" @click="Changehepassword">
  41. <view class="title">
  42. <image src="/static/images/password.png" mode=""></image>
  43. 修改密码
  44. </view>
  45. <view class="right">
  46. <image src="/static/images/right-arrow.png" mode=""></image>
  47. </view>
  48. </view>
  49. <view class="line" @click="phone">
  50. <view class="title">
  51. <image src="/static/images/concat.png" mode=""></image>
  52. 联系客服
  53. </view>
  54. <view class="right">
  55. <image src="/static/images/right-arrow.png" mode=""></image>
  56. </view>
  57. </view>
  58. <!-- <view class="line" @click="help">
  59. <view class="title">
  60. <image src="/static/images/help-icon.png" mode=""></image>
  61. 帮助中心
  62. </view>
  63. <view class="right">
  64. <image src="/static/images/right-arrow.png" mode=""></image>
  65. </view>
  66. </view> -->
  67. <!-- <view class="line" @click="scan">
  68. <view class="title">
  69. <image src="/static/images/visitCode.png" mode=""></image>
  70. 访客登记码
  71. </view>
  72. <view class="right">
  73. <image src="/static/images/right-arrow.png" mode=""></image>
  74. </view>
  75. </view> -->
  76. <view class="loginout" @click="logout" style="border: none;">
  77. <view class="title">
  78. 退出登录
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. var app = getApp();
  86. var util = require("../../utils/util.js");
  87. var config = require("../../config");
  88. export default {
  89. data() {
  90. return {
  91. name: "",
  92. photo: "",
  93. mobile: "",
  94. count: 0, //
  95. };
  96. },
  97. onShow() {
  98. this.getTabBarBadge()
  99. var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
  100. this.name = userInfos.name,
  101. this.photo = userInfos.avatar,
  102. this.mobile = userInfos.username
  103. this.updateInit()
  104. },
  105. methods: {
  106. updateInit() {
  107. this.$u.get(config.service.notReadNum, {
  108. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  109. projectId: uni.getStorageSync('buildingID').id
  110. }).then(res => {
  111. this.count = res
  112. console.log(res)
  113. if (res > 0) {
  114. uni.setTabBarBadge({ //显示数字
  115. index: 4, //tabbar下标
  116. text: `${res}` //数字
  117. })
  118. } else {
  119. uni.removeTabBarBadge({
  120. index: 4
  121. })
  122. }
  123. }).catch(e => {
  124. uni.removeTabBarBadge({
  125. index: 4
  126. })
  127. })
  128. },
  129. //拨打电话
  130. phone() {
  131. wx.makePhoneCall({
  132. phoneNumber: '4008191707,8888' //仅为示例,并非真实的电话号码
  133. })
  134. },
  135. scan() {
  136. uni.navigateTo({
  137. url: "../mine/registerCode"
  138. })
  139. },
  140. help() {
  141. uni.navigateTo({
  142. url: "../mine/help/index"
  143. })
  144. },
  145. //修改密码
  146. Changehepassword() {
  147. uni.navigateTo({
  148. url: '/pages/mine/Changehepassword'
  149. });
  150. },
  151. //退出
  152. logout() {
  153. uni.showModal({
  154. title: '提示',
  155. content: '确定要退出?',
  156. cancelColor: "#999999",
  157. showCancel: true,
  158. success(res) {
  159. if (res.confirm) {
  160. uni.request({
  161. url: config.service.logout,
  162. header: {
  163. 'Authorization': 'Basic dGVzdDp0ZXN0',
  164. 'content-type': 'application/x-www-form-urlencoded'
  165. },
  166. method: "DELETE",
  167. success: function(result) {
  168. var data = result.data; //console.log("登录信息", data);
  169. if (data.data == true) {
  170. // app.Closewebsocke()
  171. uni.clearStorageSync(); //清除缓存
  172. uni.showToast({
  173. icon: "none",
  174. title: "退出成功"
  175. })
  176. uni.reLaunch({
  177. url: '/pages/login/index'
  178. });
  179. }
  180. },
  181. // 响应错误
  182. fail: function(loginResponseError) {
  183. util.showNone("网络异常,请重试");
  184. return false;
  185. }
  186. });
  187. }
  188. }
  189. });
  190. }
  191. }
  192. };
  193. </script>
  194. <style lang="scss" scoped>
  195. .main {
  196. width: 750rpx;
  197. height: 100vh;
  198. display: flex;
  199. flex-direction: column;
  200. background: url('https://static.quhouse.com/efadbd8a89f94e98b37eb59dc8074f83.png') no-repeat;
  201. background-size: 750rpx 600rpx;
  202. }
  203. .header {
  204. width: 670rpx;
  205. height: 248rpx;
  206. display: flex;
  207. align-items: center;
  208. background: url('https://static.quhouse.com/10fa8f6fe7fa4104a5c4149be4735311.png') no-repeat;
  209. background-size: 670rpx 248rpx;
  210. margin: 0 40rpx 60rpx;
  211. border-radius: 18rpx;
  212. box-shadow: 0 3rpx 10rpx #999;
  213. .header-zuo {
  214. width: 128rpx;
  215. height: 128rpx;
  216. margin-left: 40rpx;
  217. }
  218. .header-you {
  219. margin-left: 30rpx;
  220. .userName {
  221. margin-bottom: 20rpx;
  222. font-size: 36rpx;
  223. font-weight: 500;
  224. color: #fff;
  225. font-family: PingFangSC-Medium, PingFang SC;
  226. }
  227. .mobile {
  228. font-size: 30rpx;
  229. color: #fff;
  230. }
  231. }
  232. }
  233. .settingGroup {
  234. position: relative;
  235. margin-top: 30rpx;
  236. flex-grow: 1;
  237. display: flex;
  238. flex-direction: column;
  239. color: #333333;
  240. font-size: 30rpx;
  241. border-radius: 12rpx;
  242. .line {
  243. position: relative;
  244. height: 44rpx;
  245. margin: 0 50rpx 60rpx;
  246. display: flex;
  247. align-items: center;
  248. justify-content: space-between;
  249. .title {
  250. display: flex;
  251. align-items: center;
  252. width: 300rpx;
  253. height: 44rpx;
  254. line-height: 44rpx;
  255. font-size: 32rpx;
  256. font-family: PingFangSC-Regular, PingFang SC;
  257. font-weight: 400;
  258. color: #333333;
  259. image {
  260. width: 36rpx;
  261. height: 36rpx;
  262. margin-right: 20rpx;
  263. }
  264. .count {
  265. position: absolute;
  266. right: 34rpx;
  267. width: 44rpx;
  268. height: 44rpx;
  269. border-radius: 50%;
  270. background: red;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. color: #fff;
  275. font-size: 26rpx;
  276. }
  277. }
  278. .right {
  279. image {
  280. width: 12rpx;
  281. height: 28rpx;
  282. }
  283. }
  284. }
  285. .loginout {
  286. position: absolute;
  287. left: 40rpx;
  288. right: 40rpx;
  289. bottom: 50rpx;
  290. width: 670rpx;
  291. height: 92rpx;
  292. background: #F8F8F8;
  293. border-radius: 8rpx;
  294. display: flex;
  295. align-items: center;
  296. justify-content: center;
  297. }
  298. }
  299. </style>