my.vue 7.7 KB

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