AI销管
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.
 
 
 
 

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