mine.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <view class="mine">
  3. <img src="../../static/mine/banner.png" class="banner" />
  4. <div class="info">
  5. <div class="headerandwelcome">
  6. <img src="../../static/mine/head.png" alt="" class="header" />
  7. <div class="weltxt">
  8. <span style="font-size: 48rpx; font-weight: 600">欢迎您!</span>
  9. <span style="font-size: 32rpx; margin-top: 5rpx">{{
  10. getUserLocalStorageInfo.username
  11. ? getUserLocalStorageInfo.username
  12. : "游客"
  13. }}</span>
  14. </div>
  15. </div>
  16. <div class="labelpage">
  17. <div class="labelpage_row" @click="toMineInfo">
  18. <div class="labelpage_text">
  19. <div class="labelpage_name">企业信息</div>
  20. <div class="labelpage_value">
  21. <img
  22. src="../../static/mine/youjiantou.png"
  23. style="width: 44rpx; height: 44rpx"
  24. alt=""
  25. />
  26. </div>
  27. </div>
  28. </div>
  29. <div class="labelpage_row">
  30. <div class="labelpage_text">
  31. <div class="labelpage_name">当前版本号</div>
  32. <div class="labelpage_value">v1.0.1</div>
  33. </div>
  34. </div>
  35. <div class="labelpage_row" @click="editPassWord()">
  36. <div class="labelpage_text">
  37. <div class="labelpage_name">密码修改</div>
  38. <div class="labelpage_value">
  39. <img
  40. src="../../static/mine/youjiantou.png"
  41. style="width: 44rpx; height: 44rpx"
  42. alt=""
  43. />
  44. </div>
  45. </div>
  46. </div>
  47. <div class="labelpage_row" @click="changeUserType">
  48. <div class="labelpage_text">
  49. <div class="labelpage_name">切换账号</div>
  50. <div class="labelpage_value">
  51. <img
  52. src="../../static/mine/youjiantou.png"
  53. style="width: 44rpx; height: 44rpx"
  54. alt=""
  55. />
  56. </div>
  57. </div>
  58. </div>
  59. <div class="labelpage_row" @click="outLogin()">
  60. <div class="labelpage_text">
  61. <div class="labelpage_name">退出账号</div>
  62. <div class="labelpage_value">
  63. <img
  64. src="../../static/mine/youjiantou.png"
  65. style="width: 44rpx; height: 44rpx"
  66. alt=""
  67. />
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <van-popup
  74. :show="show"
  75. @close="onClose"
  76. closeable
  77. position="bottom"
  78. custom-style="height:720rpx;"
  79. >
  80. <div class="userType">用户类型</div>
  81. <div class="choose">
  82. <div
  83. @click="chooseIdentity(1)"
  84. :class="isSelect === 1 ? 'select isselect' : 'select'"
  85. >
  86. <div>
  87. <img
  88. class="headerImg"
  89. src="./chooseIdentityImg/header1.png"
  90. alt=""
  91. />
  92. </div>
  93. <div class="name">企业上报</div>
  94. <div class="huan"><van-icon name="success" /></div>
  95. </div>
  96. <div
  97. @click="chooseIdentity(2)"
  98. :class="isSelect === 2 ? 'select isselect' : 'select'"
  99. class="select"
  100. style="margin-top: 20px"
  101. >
  102. <div>
  103. <img
  104. class="headerImg"
  105. src="./chooseIdentityImg/header2.png"
  106. alt=""
  107. />
  108. </div>
  109. <div class="name">属地核查</div>
  110. <div class="huan"><van-icon name="success" /></div>
  111. </div>
  112. <div
  113. @click="chooseIdentity(3)"
  114. :class="isSelect === 3 ? 'select isselect' : 'select'"
  115. class="select"
  116. style="margin-top: 20px"
  117. >
  118. <div>
  119. <img
  120. class="headerImg"
  121. src="./chooseIdentityImg/header3.png"
  122. alt=""
  123. />
  124. </div>
  125. <div class="name">部门检查</div>
  126. <div class="huan"><van-icon name="success" /></div>
  127. </div>
  128. </div>
  129. <div class="btnbox">
  130. <van-button class="btn" @click="goLogin">确认</van-button>
  131. </div>
  132. <!-- <van-picker :columns="columns" @cancel="onCancel" @confirm="onConfirm" show-toolbar/> -->
  133. </van-popup>
  134. </view>
  135. </template>
  136. <script>
  137. import {
  138. getUserInfo,
  139. getUserLocalStorageInfo,
  140. switchCommonUser,
  141. } from "@/js_sdk/http";
  142. export default {
  143. data() {
  144. return {
  145. userInfo: {},
  146. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  147. userType: true,
  148. show: false,
  149. isSelect: 1,
  150. columns: ["普通用户", "企业用户", "管理用户"],
  151. menuList: [
  152. {
  153. name: "我的收藏",
  154. img: require("./image/sc.png"),
  155. isNew: false,
  156. path: "/myCollection",
  157. },
  158. {
  159. name: "我的活动",
  160. img: require("./image/hd.png"),
  161. isNew: false,
  162. path: "/myActivities",
  163. },
  164. {
  165. name: "我的订单",
  166. img: require("./image/dd.png"),
  167. isNew: false,
  168. path: "/myOrder",
  169. },
  170. {
  171. name: "我的反馈",
  172. img: require("./image/fk.png"),
  173. isNew: false,
  174. path: "/feedback",
  175. },
  176. ],
  177. };
  178. },
  179. onLoad() {
  180. //option为object类型,会序列化上个页面传递的参数
  181. // this.getUserInfo(); //打印出上个页面传递的参数。
  182. },
  183. methods: {
  184. onClose() {
  185. console.log(123);
  186. this.show = false;
  187. },
  188. chooseIdentity(e) {
  189. this.isSelect = e;
  190. },
  191. toPath(item) {
  192. if (item.path) {
  193. uni.navigateTo({
  194. url: "/pages/subPackages/minePages" + item.path,
  195. });
  196. }
  197. },
  198. toMineInfo() {
  199. uni.navigateTo({
  200. url: "/pages/subPackages/minePages/mineInfo",
  201. });
  202. },
  203. toMineMsg() {
  204. uni.navigateTo({
  205. url: "/pages/subPackages/minePages/mineMessage",
  206. });
  207. },
  208. onCancel() {
  209. this.show = false;
  210. },
  211. onConfirm(e) {
  212. if (e.detail.value !== "普通用户") {
  213. uni.navigateTo({
  214. url: "/pages/login2/login?loginType=" + e.detail.value,
  215. success: function (e) {
  216. // uni.$emit('userType', 'OK')
  217. },
  218. });
  219. } else {
  220. let data = {
  221. id: this.getUserLocalStorageInfo.id,
  222. };
  223. switchCommonUser(data).then((e) => {
  224. if (e.errno === 0) {
  225. delete this.getUserLocalStorageInfo.userId;
  226. this.getUserLocalStorageInfo.userType = "3";
  227. this.getUserLocalStorageInfo.username = "";
  228. console.log(this.getUserLocalStorageInfo);
  229. wx.setStorageSync(
  230. "USERINFO",
  231. JSON.stringify(this.getUserLocalStorageInfo)
  232. );
  233. }
  234. // console.log(e.data.user);
  235. // uni.clearStorageSync();
  236. });
  237. }
  238. this.show = false;
  239. },
  240. changeUserType() {
  241. this.show = true;
  242. // uni.navigateTo({
  243. // url: "/pages/login2/login",
  244. // success: function (e) {
  245. // // uni.$emit('userType', 'OK')
  246. // },
  247. // });
  248. },
  249. outLogin() {
  250. wx.showModal({
  251. title: "提示!",
  252. content: "是否确认退出登录?",
  253. success: function (res) {
  254. if (res.confirm) {
  255. uni.clearStorageSync();
  256. uni.reLaunch({
  257. url: "/pages/login/login",
  258. });
  259. }
  260. },
  261. });
  262. },
  263. editPassWord() {
  264. uni.navigateBack();
  265. },
  266. async getUserInfo() {
  267. let data = await getUserInfo();
  268. this.userInfo = data.data;
  269. },
  270. },
  271. };
  272. </script>
  273. <style lang="scss">
  274. .mine {
  275. .userType {
  276. font-weight: bold;
  277. font-size: 36rpx;
  278. color: #333333;
  279. margin-top: 24rpx;
  280. margin-left: 36rpx;
  281. margin-bottom: 48rpx;
  282. }
  283. .btnbox {
  284. margin-top: 30rpx;
  285. width: 100%;
  286. display: flex;
  287. justify-content: center;
  288. .btn {
  289. button {
  290. width: 594rpx;
  291. height: 96rpx;
  292. background: #4c7af3;
  293. border-radius: 48rpx 48rpx 48rpx 48rpx;
  294. text-align: center;
  295. line-height: 96rpx;
  296. color: white;
  297. }
  298. text-align: center;
  299. }
  300. }
  301. .huan {
  302. width: 40rpx;
  303. height: 40rpx;
  304. border: 4rpx solid #c0c2c3;
  305. background: #ffffff;
  306. color: #c0c2c3;
  307. border-radius: 50%;
  308. text-align: center;
  309. line-height: 40rpx;
  310. }
  311. .choose {
  312. // position: absolute;
  313. // top: 800rpx;
  314. width: 100%;
  315. .headerImg {
  316. height: 88rpx;
  317. width: 88rpx;
  318. }
  319. .select {
  320. margin: auto;
  321. display: flex;
  322. align-items: center;
  323. justify-content: space-between;
  324. width: 654rpx;
  325. height: 128rpx;
  326. background: #f5f6f8;
  327. border-radius: 16rpx 16rpx 16rpx 16rpx;
  328. padding: 20rpx 32rpx;
  329. box-sizing: border-box;
  330. }
  331. .name {
  332. margin-right: 160px;
  333. }
  334. }
  335. .isselect {
  336. border: 2rpx solid #4c7af3;
  337. .huan {
  338. background: #4c7af3;
  339. color: white;
  340. }
  341. }
  342. }
  343. .banner {
  344. width: 100%;
  345. height: 100%;
  346. position: absolute;
  347. z-index: 1;
  348. }
  349. .headerandwelcome {
  350. margin-bottom: 52rpx;
  351. height: 120rpx;
  352. width: 100%;
  353. box-sizing: border-box;
  354. padding-left: 60rpx;
  355. }
  356. .info {
  357. position: absolute;
  358. //width: calc(100% - 64rpx);
  359. margin: auto;
  360. margin-top: 60rpx;
  361. z-index: 2;
  362. }
  363. .header {
  364. height: 120rpx;
  365. width: 120rpx;
  366. //margin-left: 15rpx;
  367. border-radius: 50%;
  368. float: left;
  369. }
  370. .weltxt {
  371. height: 120rpx;
  372. color: #ffffff;
  373. margin-left: 32rpx;
  374. display: flex;
  375. flex-direction: column;
  376. justify-content: center;
  377. float: left;
  378. color: black;
  379. }
  380. .cardBox {
  381. width: 686rpx;
  382. height: 100rpx;
  383. box-sizing: border-box;
  384. background: rgba(20, 33, 76, 1);
  385. border-radius: 16rpx 16rpx 0 0;
  386. display: flex;
  387. align-items: center;
  388. justify-content: space-between;
  389. padding: 0 32rpx;
  390. margin-left: 32rpx;
  391. .rightIcon {
  392. width: 36rpx;
  393. height: 36rpx;
  394. }
  395. .cardLeft {
  396. display: flex;
  397. align-items: center;
  398. }
  399. }
  400. .labelpage {
  401. width: 686rpx;
  402. margin-left: 32rpx;
  403. box-sizing: border-box;
  404. padding: 32rpx;
  405. border-radius: 12rpx 12rpx 12rpx 12rpx;
  406. background: #ffffff;
  407. }
  408. .labelpage_row {
  409. display: flex;
  410. align-items: center;
  411. height: 112rpx;
  412. width: 100%;
  413. width: 100%;
  414. border-bottom: 2rpx solid #e6e6e6;
  415. img {
  416. height: 44rpx;
  417. width: 44rpx;
  418. float: left;
  419. }
  420. .labelpage_text {
  421. width: 100%;
  422. height: 44rpx;
  423. line-height: 44rpx;
  424. float: left;
  425. }
  426. .labelpage_name {
  427. height: 44rpx;
  428. line-height: 44rpx;
  429. float: left;
  430. font-size: 34rpx;
  431. color: #081640;
  432. font-weight: 400;
  433. }
  434. .labelpage_value {
  435. height: 44rpx;
  436. line-height: 44rpx;
  437. float: right;
  438. font-size: 34rpx;
  439. color: #666666;
  440. font-weight: 400;
  441. }
  442. .border {
  443. margin-top: 48rpx;
  444. width: 100%;
  445. height: 1rpx;
  446. border-bottom: 2rpx solid #e6e6e6;
  447. float: left;
  448. }
  449. }
  450. .mineMenuBody {
  451. width: 686rpx;
  452. box-sizing: border-box;
  453. display: flex;
  454. justify-content: space-around;
  455. background: white;
  456. padding: 24rpx 0;
  457. margin: 24rpx 32rpx;
  458. border-radius: 2vw;
  459. .mineMenuItem {
  460. position: relative;
  461. display: flex;
  462. flex-direction: column;
  463. align-items: center;
  464. .redDoll {
  465. position: absolute;
  466. right: 0;
  467. top: 0;
  468. width: 16rpx;
  469. height: 16rpx;
  470. background: #f25551;
  471. border-radius: 50%;
  472. }
  473. .menuImg {
  474. width: 80rpx;
  475. height: 80rpx;
  476. }
  477. .menuName {
  478. color: #333333;
  479. font-size: 28rpx;
  480. margin-top: 8rpx;
  481. }
  482. }
  483. }
  484. </style>