my.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="box">
  3. <view class="header">
  4. <view class="headerPng">
  5. <image :src="headerImg" mode="" />
  6. </view>
  7. <!-- <view class="nickName">你的昵称</view> -->
  8. <view class="phone">{{ phone }}</view>
  9. </view>
  10. <view class="meauList">
  11. <!-- <view class="menu-item" @click="updateOTA()">
  12. <view class="meanLeft">
  13. <image src="../../static/update.png" mode="" />
  14. <text>OTA升级</text>
  15. </view>
  16. <view class="meanRight">
  17. <image src="../../static/arrTwo.png" mode="" />
  18. </view>
  19. </view> -->
  20. <view class="menu-item" @click="gotoShare('sure')">
  21. <view class="meanLeft">
  22. <image src="../../static/share.png" mode="" />
  23. <text>分享确认</text>
  24. </view>
  25. <view class="meanRight">
  26. <image src="../../static/arrTwo.png" mode="" />
  27. </view>
  28. </view>
  29. <view class="menu-item" @click="gotoShare('list')">
  30. <view class="meanLeft">
  31. <image src="../../static/list.png" mode="" />
  32. <text>分享记录</text>
  33. </view>
  34. <view class="meanRight">
  35. <image src="../../static/arrTwo.png" mode="" />
  36. </view>
  37. </view>
  38. <view class="menu-item" @click="goAbnormalInfo()">
  39. <view class="meanLeft">
  40. <image src="../../static/list.png" mode="" />
  41. <text>统计信息</text>
  42. </view>
  43. <view class="meanRight">
  44. <image src="../../static/arrTwo.png" mode="" />
  45. </view>
  46. </view>
  47. <!-- <view class="menu-item" @click="deaAccount()">
  48. <view class="meanLeft">
  49. <image src="../../static/logoff.png" mode="" />
  50. <text>注销账户</text>
  51. </view>
  52. <view class="meanRight">
  53. <image src="../../static/arrTwo.png" mode="" />
  54. </view>
  55. </view> -->
  56. </view>
  57. <view class="logoutBtn" @click="goLogout">退出登录</view>
  58. <!-- <tenMinutes v-if="isIniTenMinutes" /> -->
  59. <alarModel v-if="showModle" />
  60. </view>
  61. </template>
  62. <script>
  63. import MqttService from "../../utils/globalMqtt";
  64. export default {
  65. data() {
  66. return {
  67. headerImg: "../../static/headerInfo.png",
  68. phone: uni.getStorageSync("phone"),
  69. showModle: false,
  70. };
  71. },
  72. methods: {
  73. updateOTA() {
  74. uni.navigateTo({
  75. url: "/pagesA/OTA/OTA",
  76. });
  77. },
  78. gotoShare(shareType) {
  79. uni.navigateTo({
  80. url: "/pagesA/shareList/shareList?shareType=" + shareType,
  81. });
  82. },
  83. goLogout() {
  84. uni.showModal({
  85. title: "提示",
  86. content: "是否确认退出登录?",
  87. success: function (res) {
  88. if (res.confirm) {
  89. MqttService.disconnectAll();
  90. uni.clearStorageSync();
  91. uni.reLaunch({
  92. url: "/pagesA/loginNew/loginNew",
  93. });
  94. } else if (res.cancel) {
  95. }
  96. },
  97. });
  98. },
  99. deaAccount() {
  100. uni.showModal({
  101. content: "是否确认注销登录",
  102. complete: (res) => {
  103. if (res.confirm) {
  104. this.$http
  105. .post(
  106. "wap/user/wx/logout",
  107. { userId: uni.getStorageSync("userId") },
  108. {
  109. header: {
  110. "Content-Type":
  111. "application/json;charset=UTF-8",
  112. },
  113. }
  114. )
  115. .then((res) => {
  116. if (res.data.code == 200) {
  117. uni.showToast({
  118. title: "注销成功",
  119. icon: "success",
  120. duration: 1500,
  121. });
  122. uni.clearStorageSync();
  123. uni.reLaunch({
  124. url: "/pagesA/loginNew/loginNew",
  125. });
  126. } else {
  127. uni.showToast({
  128. title: res.data.message,
  129. icon: "none",
  130. duration: 1500,
  131. });
  132. }
  133. });
  134. }
  135. },
  136. });
  137. },
  138. serverchange() {
  139. uni.navigateTo({
  140. url: "/pagesA/serChange/serChange",
  141. });
  142. },
  143. goAbnormalInfo() {
  144. uni.navigateTo({
  145. url: "/pagesA/abnormalInfo/abnormalInfo",
  146. });
  147. },
  148. },
  149. onShow() {
  150. this.isIniTenMinutes = true;
  151. this.showModle = true;
  152. },
  153. onLoad() {},
  154. onHide() {
  155. this.showModle = false;
  156. },
  157. onUnload() {},
  158. };
  159. </script>
  160. <style lang="less" scoped>
  161. // Main Styles
  162. .box {
  163. padding: 10rpx 18rpx;
  164. width: 100vw;
  165. height: 100vh;
  166. background: linear-gradient(180deg, #faede2 0%, #f4f4f4 100%);
  167. box-sizing: border-box;
  168. .header {
  169. margin: 0 auto;
  170. width: 710rpx;
  171. height: 325rpx;
  172. background: linear-gradient(114.42deg, #a27867 0%, #74483d 100%),
  173. #ffffff;
  174. border-radius: 35rpx;
  175. box-sizing: border-box;
  176. .headerPng {
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. padding-top: 40rpx;
  181. image {
  182. width: 115rpx;
  183. height: 115rpx;
  184. border-radius: 50%;
  185. }
  186. }
  187. .nickName {
  188. margin-top: 30rpx;
  189. font-weight: 500;
  190. color: #ffffff;
  191. font-size: 38rpx;
  192. text-align: center;
  193. }
  194. .phone {
  195. margin-top: 40rpx;
  196. color: #ffffff;
  197. font-size: 32rpx;
  198. text-align: center;
  199. }
  200. }
  201. .meauList {
  202. width: 710rpx;
  203. margin: 18rpx auto 0 auto;
  204. background: #fff;
  205. border-radius: 37rpx;
  206. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  207. padding: 0;
  208. box-sizing: border-box;
  209. .menu-item {
  210. display: flex;
  211. align-items: center;
  212. justify-content: space-between;
  213. margin: 0 32rpx;
  214. padding: 32rpx 0;
  215. border-bottom: 1rpx solid #f0f0f0;
  216. &:last-child {
  217. border-bottom: none;
  218. }
  219. .meanLeft {
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. image {
  224. width: 38rpx;
  225. height: 38rpx;
  226. }
  227. text {
  228. margin-left: 10rpx;
  229. color: #111111;
  230. font-size: 32rpx;
  231. }
  232. }
  233. .meanRight image {
  234. width: 16rpx;
  235. height: 26rpx;
  236. }
  237. }
  238. }
  239. .logoutBtn {
  240. width: 710rpx;
  241. margin: 48rpx auto 0 auto;
  242. height: 88rpx;
  243. background: #fff;
  244. color: #b48a7c;
  245. font-size: 32rpx;
  246. border-radius: 30rpx;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  251. }
  252. }
  253. </style>