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

personal.vue 7.3 KiB

2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
2 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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. <!-- 底部导航栏 -->
  83. <!-- <u-tabbar :isBtnTop="false" :mid-button="true" activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList"></u-tabbar> -->
  84. </view>
  85. </template>
  86. <script>
  87. var app = getApp();
  88. var util = require("../../utils/util.js");
  89. var config = require("../../config");
  90. import tabbarList from '@/utils/tabbar.js'
  91. export default {
  92. data() {
  93. return {
  94. // tabbar配置项
  95. current: 0,
  96. tabbarList: tabbarList,
  97. //--- end --- tabbar配置项
  98. name: "",
  99. photo: "",
  100. mobile: "",
  101. count: 0, //
  102. };
  103. },
  104. onShow() {
  105. var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
  106. this.name = userInfos.name,
  107. this.photo = userInfos.avatar,
  108. this.mobile = userInfos.username
  109. this.updateInit()
  110. },
  111. methods: {
  112. updateInit() {
  113. this.$u.get(config.service.notReadNum, {
  114. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  115. projectId: uni.getStorageSync('buildingID').id
  116. }).then(res => {
  117. this.count = res
  118. console.log(res)
  119. if (res > 0) {
  120. uni.setTabBarBadge({ //显示数字
  121. index: 4, //tabbar下标
  122. text: `${res}` //数字
  123. })
  124. } else {
  125. uni.removeTabBarBadge({
  126. index: 4
  127. })
  128. }
  129. }).catch(e => {
  130. uni.removeTabBarBadge({
  131. index: 4
  132. })
  133. })
  134. },
  135. //拨打电话
  136. phone() {
  137. wx.makePhoneCall({
  138. phoneNumber: '4008191707,8888' //仅为示例,并非真实的电话号码
  139. })
  140. },
  141. scan() {
  142. uni.navigateTo({
  143. url: "../mine/registerCode"
  144. })
  145. },
  146. help() {
  147. uni.navigateTo({
  148. url: "../mine/help/index"
  149. })
  150. },
  151. //修改密码
  152. Changehepassword() {
  153. uni.navigateTo({
  154. url: '/pages/mine/Changehepassword'
  155. });
  156. },
  157. //退出
  158. logout() {
  159. uni.showModal({
  160. title: '提示',
  161. content: '确定要退出?',
  162. cancelColor: "#999999",
  163. showCancel: true,
  164. success(res) {
  165. if (res.confirm) {
  166. uni.request({
  167. url: config.service.logout,
  168. header: {
  169. 'Authorization': 'Basic dGVzdDp0ZXN0',
  170. 'content-type': 'application/x-www-form-urlencoded'
  171. },
  172. method: "DELETE",
  173. success: function(result) {
  174. var data = result.data; //console.log("登录信息", data);
  175. if (data.data == true) {
  176. // app.Closewebsocke()
  177. uni.clearStorageSync(); //清除缓存
  178. uni.showToast({
  179. icon: "none",
  180. title: "退出成功"
  181. })
  182. uni.reLaunch({
  183. url: '/pages/login/index'
  184. });
  185. }
  186. },
  187. // 响应错误
  188. fail: function(loginResponseError) {
  189. util.showNone("网络异常,请重试");
  190. return false;
  191. }
  192. });
  193. }
  194. }
  195. });
  196. }
  197. }
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. .main {
  202. width: 750rpx;
  203. height: 100vh;
  204. display: flex;
  205. flex-direction: column;
  206. background: url('https://static.quhouse.com/efadbd8a89f94e98b37eb59dc8074f83.png') no-repeat;
  207. background-size: 750rpx 600rpx;
  208. }
  209. .header {
  210. width: 670rpx;
  211. height: 248rpx;
  212. display: flex;
  213. align-items: center;
  214. background: url('https://static.quhouse.com/10fa8f6fe7fa4104a5c4149be4735311.png') no-repeat;
  215. background-size: 670rpx 248rpx;
  216. margin: 0 40rpx 60rpx;
  217. border-radius: 18rpx;
  218. box-shadow: 0 3rpx 10rpx #999;
  219. .header-zuo {
  220. width: 128rpx;
  221. height: 128rpx;
  222. margin-left: 40rpx;
  223. }
  224. .header-you {
  225. margin-left: 30rpx;
  226. .userName {
  227. margin-bottom: 20rpx;
  228. font-size: 36rpx;
  229. font-weight: 500;
  230. color: #fff;
  231. font-family: PingFangSC-Medium, PingFang SC;
  232. }
  233. .mobile {
  234. font-size: 30rpx;
  235. color: #fff;
  236. }
  237. }
  238. }
  239. .settingGroup {
  240. position: relative;
  241. margin-top: 30rpx;
  242. flex-grow: 1;
  243. display: flex;
  244. flex-direction: column;
  245. color: #333333;
  246. font-size: 30rpx;
  247. border-radius: 12rpx;
  248. .line {
  249. position: relative;
  250. height: 44rpx;
  251. margin: 0 50rpx 60rpx;
  252. display: flex;
  253. align-items: center;
  254. justify-content: space-between;
  255. .title {
  256. display: flex;
  257. align-items: center;
  258. width: 300rpx;
  259. height: 44rpx;
  260. line-height: 44rpx;
  261. font-size: 32rpx;
  262. font-family: PingFangSC-Regular, PingFang SC;
  263. font-weight: 400;
  264. color: #333333;
  265. image {
  266. width: 36rpx;
  267. height: 36rpx;
  268. margin-right: 20rpx;
  269. }
  270. .count {
  271. position: absolute;
  272. right: 34rpx;
  273. width: 44rpx;
  274. height: 44rpx;
  275. border-radius: 50%;
  276. background: red;
  277. display: flex;
  278. justify-content: center;
  279. align-items: center;
  280. color: #fff;
  281. font-size: 26rpx;
  282. }
  283. }
  284. .right {
  285. image {
  286. width: 12rpx;
  287. height: 28rpx;
  288. }
  289. }
  290. }
  291. .loginout {
  292. position: absolute;
  293. left: 40rpx;
  294. right: 40rpx;
  295. bottom: 50rpx;
  296. width: 670rpx;
  297. height: 92rpx;
  298. background: #F8F8F8;
  299. border-radius: 8rpx;
  300. display: flex;
  301. align-items: center;
  302. justify-content: center;
  303. }
  304. }
  305. </style>