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 7.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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: function() {
  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. console.log(config.service.host.indexOf('xitong.pachira.cn') != -1)
  122. },
  123. methods: {
  124. updateInit() {
  125. uni.request({
  126. url: config.service.notReadNum,
  127. method: "GET",
  128. data: {
  129. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  130. projectId: uni.getStorageSync('buildingID').id,
  131. },
  132. header: {
  133. 'content-type': 'application/json',
  134. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  135. },
  136. success: (res) => {
  137. this.count = res.data.data
  138. this.tabbarList[3].count = res.data.data || 0
  139. }
  140. })
  141. },
  142. scan() {
  143. uni.navigateTo({
  144. url: "../mine/registerCode"
  145. })
  146. },
  147. //拨打电话
  148. phone() {
  149. wx.makePhoneCall({
  150. phoneNumber: '4008191707,8888' //仅为示例,并非真实的电话号码
  151. })
  152. },
  153. //修改密码
  154. Changehepassword() {
  155. uni.navigateTo({
  156. url: '/pages/mine/Changehepassword'
  157. });
  158. },
  159. //退出
  160. logout() {
  161. uni.showModal({
  162. title: '提示',
  163. content: '确定要退出?',
  164. cancelColor: "#999999",
  165. showCancel: true,
  166. success:(res) => {
  167. if (res.confirm) {
  168. uni.clearStorageSync(); //清除缓存
  169. this.$u.post('/user/exitSystem', {id: uni.getStorageSync('exitSystemId')})
  170. uni.showToast({
  171. icon: "none",
  172. title: "退出成功"
  173. })
  174. uni.reLaunch({
  175. url: '/pages/login/index'
  176. });
  177. }
  178. }
  179. });
  180. },
  181. // tosubscr(){
  182. // let that=this;
  183. // wx.login({
  184. // success (res) {
  185. // if (res.code) {
  186. // let appid ='wxd9748307889cbe0d';
  187. // let secret = 'cfc40d2b86b650e216e900a2c430cd2b'
  188. // let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' +res.code + '&grant_type=authorization_code';
  189. // uni.request({
  190. // url: url, // 请求路径
  191. // success: result => {
  192. // that.$u.get("/user/bindMessage",{
  193. // openId:result.data.openid,
  194. // loginName:that.mobile
  195. // }).then(data => {
  196. // console.log(data)
  197. // })
  198. // }
  199. // })
  200. // } else {
  201. // console.log('登录失败!' + res.errMsg)
  202. // }
  203. // }
  204. // })
  205. // // /pages/mine/subscribe
  206. // },
  207. }
  208. };
  209. </script>
  210. <style lang="scss" scoped>
  211. .count {
  212. background: red;
  213. width: 50rpx;
  214. height: 50rpx;
  215. border-radius: 40rpx;
  216. color: #FFFFFF;
  217. display: flex;
  218. justify-content: center;
  219. align-items: center;
  220. font-size: 24rpx;
  221. margin-right: 20rpx;
  222. }
  223. .main {
  224. padding: 0 30rpx;
  225. background: #F8F8F8;
  226. display: flex;
  227. flex-direction: column;
  228. min-height: 100vh;
  229. padding-bottom: 40rpx;
  230. .backTop {
  231. background: #2671E2;
  232. position: absolute;
  233. left: 0;
  234. top: 0;
  235. width: 750rpx;
  236. height: 171rpx;
  237. }
  238. .box {
  239. background: #ffffff;
  240. }
  241. }
  242. .header {
  243. z-index: 2;
  244. width: 100%;
  245. height: 212rpx;
  246. border-radius: 12rpx;
  247. margin-top: 42rpx;
  248. display: flex;
  249. .header-zuo {
  250. width: 148rpx;
  251. height: 148rpx;
  252. margin-top: 32rpx;
  253. margin-left: 30rpx;
  254. }
  255. .header-you {
  256. margin-left: 20rpx;
  257. .userName {
  258. font-size: 36rpx;
  259. font-weight: 500;
  260. color: #303030;
  261. margin-top: 56rpx;
  262. }
  263. .mobile {
  264. font-size: 30rpx;
  265. color: #BDBDBD;
  266. margin-top: 20rpx;
  267. }
  268. }
  269. }
  270. .settingGroup {
  271. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  272. border-radius: 12rpx;
  273. margin-top: 30rpx;
  274. color: #333333;
  275. font-size: 30rpx;
  276. display: flex;
  277. flex-direction: column;
  278. .line {
  279. height: 118rpx;
  280. border-bottom: 1rpx solid #EEEEEE;
  281. margin: 0 38rpx 0 30rpx;
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-between;
  285. .title {
  286. display: flex;
  287. align-items: center;
  288. width: 190rpx;
  289. justify-content: space-between;
  290. }
  291. }
  292. }
  293. </style>