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.
 
 
 

340 lines
8.3 KiB

  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/messageList">
  18. <view class="title" style="width: 21%;">
  19. <image src="/static/images/studyhot.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  20. 消息
  21. </view>
  22. <view class="right" style="display: flex;align-items: center;">
  23. <view class="count" v-if="count!=0">{{count}}</view>
  24. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  25. </view>
  26. </navigator>
  27. <template v-if="isPuqiang">
  28. <navigator class="line" url="/pages/mine/subscribe">
  29. <view class="title">
  30. <image src="/static/images/studyhot.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  31. 订阅消息
  32. </view>
  33. <view class="right">
  34. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  35. </view>
  36. </navigator>
  37. </template>
  38. <navigator class="line" url="/pages/mine/Myprofile">
  39. <view class="title">
  40. <image src="/static/images/setting.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  41. 编辑资料
  42. </view>
  43. <view class="right">
  44. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  45. </view>
  46. </navigator>
  47. <view class="line" @click="phone">
  48. <view class="title">
  49. <image src="/static/images/Customer.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  50. 客服电话
  51. </view>
  52. <view class="right">
  53. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  54. </view>
  55. </view>
  56. <view class="line" @click="scan">
  57. <view class="title" style="width: 220rpx;">
  58. <image src="/static/images/reg.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  59. 访客登记码
  60. </view>
  61. <view class="right">
  62. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  63. </view>
  64. </view>
  65. <view class="line" @click="Changehepassword">
  66. <view class="title">
  67. <image src="/static/images/password.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  68. 修改密码
  69. </view>
  70. <view class="right">
  71. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  72. </view>
  73. </view>
  74. <view class="line" @click="logout" style="border: none;">
  75. <view class="title">
  76. <image src="/static/images/exit.png" style="width: 36rpx;height: 36rpx;" mode=""></image>
  77. 退出登录
  78. </view>
  79. <view class="right">
  80. <image src="/static/images/arrow.png" style="width: 18rpx;height: 32rpx;" mode=""></image>
  81. </view>
  82. </view>
  83. </view>
  84. <u-tabbar activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList"></u-tabbar>
  85. </view>
  86. </template>
  87. <script>
  88. var app = getApp();
  89. var util = require("../../utils/util.js");
  90. var config = require("../../config");
  91. import tabbarList from '@/utils/tabbar.js'
  92. export default {
  93. data() {
  94. return {
  95. tabbarList: tabbarList,
  96. current: 0,
  97. tabList: [{
  98. name: '系统消息'
  99. },
  100. {
  101. name: '升级公告'
  102. },
  103. ],
  104. name: "",
  105. photo: "",
  106. mobile: "",
  107. count: 0,
  108. };
  109. },
  110. computed: {
  111. isPuqiang() {
  112. return config.service.host.indexOf('xitong.pachira.cn') == -1
  113. }
  114. },
  115. onShow() {
  116. var userInfos = uni.getStorageSync('weapp_session_userInfo_data');
  117. this.name = userInfos.name,
  118. this.photo = userInfos.picUrl,
  119. this.mobile = userInfos.loginName
  120. this.updateInit()
  121. this.initrealTimeStatistics()
  122. console.log(config.service.host.indexOf('xitong.pachira.cn') != -1)
  123. },
  124. methods: {
  125. //实时统计
  126. initrealTimeStatistics() {
  127. uni.request({
  128. url: config.service.realTimeStatistics,
  129. method: "POST",
  130. header: {
  131. 'content-type': 'application/json',
  132. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  133. },
  134. data: {
  135. houseId: uni.getStorageSync('buildingID').id
  136. },
  137. success: (data) => {
  138. if (data.data.data == null) {
  139. return
  140. } else {
  141. this.tabbarList[1].count = data.data.data.receivingCustomer || 0
  142. this.$forceUpdate()
  143. }
  144. },
  145. fail: () => {}
  146. })
  147. },
  148. updateInit() {
  149. uni.request({
  150. url: config.service.notReadNum,
  151. method: "GET",
  152. data: {
  153. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  154. projectId: uni.getStorageSync('buildingID').id,
  155. },
  156. header: {
  157. 'content-type': 'application/json',
  158. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  159. },
  160. success: (res) => {
  161. this.count = res.data.data
  162. this.tabbarList[3].count = res.data.data || 0
  163. }
  164. })
  165. },
  166. scan() {
  167. uni.navigateTo({
  168. url: "../mine/registerCode"
  169. })
  170. },
  171. //拨打电话
  172. phone() {
  173. wx.makePhoneCall({
  174. phoneNumber: '4008191707,8888' //仅为示例,并非真实的电话号码
  175. })
  176. },
  177. //修改密码
  178. Changehepassword() {
  179. uni.navigateTo({
  180. url: '/pages/mine/Changehepassword'
  181. });
  182. },
  183. //退出
  184. logout() {
  185. uni.showModal({
  186. title: '提示',
  187. content: '确定要退出?',
  188. cancelColor: "#999999",
  189. showCancel: true,
  190. success: (res) => {
  191. if (res.confirm) {
  192. uni.clearStorageSync(); //清除缓存
  193. this.$u.post('/user/exitSystem', {
  194. id: uni.getStorageSync('exitSystemId')
  195. })
  196. uni.showToast({
  197. icon: "none",
  198. title: "退出成功"
  199. })
  200. uni.reLaunch({
  201. url: '/pages/login/index'
  202. });
  203. }
  204. }
  205. });
  206. },
  207. // tosubscr(){
  208. // let that=this;
  209. // wx.login({
  210. // success (res) {
  211. // if (res.code) {
  212. // let appid ='wxd9748307889cbe0d';
  213. // let secret = 'cfc40d2b86b650e216e900a2c430cd2b'
  214. // let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' +res.code + '&grant_type=authorization_code';
  215. // uni.request({
  216. // url: url, // 请求路径
  217. // success: result => {
  218. // that.$u.get("/user/bindMessage",{
  219. // openId:result.data.openid,
  220. // loginName:that.mobile
  221. // }).then(data => {
  222. // console.log(data)
  223. // })
  224. // }
  225. // })
  226. // } else {
  227. // console.log('登录失败!' + res.errMsg)
  228. // }
  229. // }
  230. // })
  231. // // /pages/mine/subscribe
  232. // },
  233. }
  234. };
  235. </script>
  236. <style lang="scss" scoped>
  237. .count {
  238. background: red;
  239. width: 50rpx;
  240. height: 50rpx;
  241. border-radius: 40rpx;
  242. color: #FFFFFF;
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. font-size: 24rpx;
  247. margin-right: 20rpx;
  248. }
  249. .main {
  250. padding: 0 30rpx;
  251. background: #F8F8F8;
  252. display: flex;
  253. flex-direction: column;
  254. min-height: 100vh;
  255. padding-bottom: 40rpx;
  256. .backTop {
  257. background: #2671E2;
  258. position: absolute;
  259. left: 0;
  260. top: 0;
  261. width: 750rpx;
  262. height: 171rpx;
  263. }
  264. .box {
  265. background: #ffffff;
  266. }
  267. }
  268. .header {
  269. z-index: 2;
  270. width: 100%;
  271. height: 212rpx;
  272. border-radius: 12rpx;
  273. margin-top: 42rpx;
  274. display: flex;
  275. .header-zuo {
  276. width: 148rpx;
  277. height: 148rpx;
  278. margin-top: 32rpx;
  279. margin-left: 30rpx;
  280. }
  281. .header-you {
  282. margin-left: 20rpx;
  283. .userName {
  284. font-size: 36rpx;
  285. font-weight: 500;
  286. color: #303030;
  287. margin-top: 56rpx;
  288. }
  289. .mobile {
  290. font-size: 30rpx;
  291. color: #BDBDBD;
  292. margin-top: 20rpx;
  293. }
  294. }
  295. }
  296. .settingGroup {
  297. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  298. border-radius: 12rpx;
  299. margin-top: 30rpx;
  300. color: #333333;
  301. font-size: 30rpx;
  302. display: flex;
  303. flex-direction: column;
  304. .line {
  305. height: 118rpx;
  306. border-bottom: 1rpx solid #EEEEEE;
  307. margin: 0 38rpx 0 30rpx;
  308. display: flex;
  309. align-items: center;
  310. justify-content: space-between;
  311. .title {
  312. display: flex;
  313. align-items: center;
  314. width: 190rpx;
  315. justify-content: space-between;
  316. }
  317. }
  318. }
  319. </style>