mine.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <view>
  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">{{ getUserLocalStorageInfo.username?getUserLocalStorageInfo.username:'游客' }}</span>
  10. </div>
  11. </div>
  12. <div class="cardBox" @tap="toMineMsg">
  13. <div class="cardLeft">
  14. <span style="color: #FFC97C;font-size: 28rpx">我的消息</span>
  15. <span style="color: #FFFFFF;font-size: 40rpx;margin-left: 18rpx">0</span>
  16. </div>
  17. <img src="./image/rightIcon.png" class="rightIcon">
  18. </div>
  19. <div class="mineMenuBody">
  20. <div v-for="item in menuList" class="mineMenuItem" @tap="toPath(item)">
  21. <div class="redDoll" v-show="item.isNew"></div>
  22. <img :src="item.img" class="menuImg" />
  23. <span class="menuName">{{ item.name }}</span>
  24. </div>
  25. </div>
  26. <div class="labelpage">
  27. <div
  28. class="labelpage_row"
  29. @click="toMineInfo"
  30. >
  31. <div class="labelpage_text">
  32. <div class="labelpage_name">企业信息</div>
  33. <div class="labelpage_value">
  34. <img
  35. src="../../static/mine/youjiantou.png"
  36. style="width: 44rpx; height: 44rpx"
  37. alt=""
  38. />
  39. </div>
  40. <div class="border"></div>
  41. </div>
  42. </div>
  43. <div class="labelpage_row"
  44. style="margin-top: 48rpx">
  45. <div class="labelpage_text">
  46. <div class="labelpage_name">当前版本号</div>
  47. <div class="labelpage_value">v1.0.1</div>
  48. <div class="border"></div>
  49. </div>
  50. </div>
  51. <div
  52. class="labelpage_row"
  53. style="margin-top: 48rpx"
  54. @click="editPassWord()"
  55. >
  56. <div class="labelpage_text">
  57. <div class="labelpage_name">密码修改</div>
  58. <div class="labelpage_value">
  59. <img
  60. src="../../static/mine/youjiantou.png"
  61. style="width: 44rpx; height: 44rpx"
  62. alt=""
  63. />
  64. </div>
  65. <div class="border"></div>
  66. </div>
  67. </div>
  68. <div
  69. class="labelpage_row"
  70. style="margin-top: 48rpx"
  71. @click="changeUserType"
  72. >
  73. <div class="labelpage_text">
  74. <div class="labelpage_name">切换账号</div>
  75. <div class="labelpage_value">
  76. <img
  77. src="../../static/mine/youjiantou.png"
  78. style="width: 44rpx; height: 44rpx"
  79. alt=""
  80. />
  81. </div>
  82. <div class="border"></div>
  83. </div>
  84. </div>
  85. <div
  86. class="labelpage_row"
  87. style="margin-top: 48rpx"
  88. @click="outLogin()"
  89. >
  90. <div class="labelpage_text">
  91. <div class="labelpage_name">退出账号</div>
  92. <div class="labelpage_value">
  93. <img
  94. src="../../static/mine/youjiantou.png"
  95. style="width: 44rpx; height: 44rpx"
  96. alt=""
  97. />
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <van-popup
  104. :show="show"
  105. position="bottom"
  106. custom-style="height: 40%;"
  107. >
  108. <van-picker :columns="columns" @cancel="onCancel" @confirm="onConfirm" show-toolbar/>
  109. </van-popup>
  110. </view>
  111. </template>
  112. <script>
  113. import { getUserInfo, getUserLocalStorageInfo } from "@/js_sdk/http";
  114. export default {
  115. data() {
  116. return {
  117. userInfo: {},
  118. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  119. userType: true,
  120. show:false,
  121. columns: ['普通用户', '企业用户', '管理用户'],
  122. menuList: [
  123. {
  124. name: '我的收藏',
  125. img: require('./image/sc.png'),
  126. isNew: false,
  127. path: '/myCollection'
  128. },
  129. {
  130. name: '我的活动',
  131. img: require('./image/hd.png'),
  132. isNew: false,
  133. path: '/myActivities'
  134. },
  135. {
  136. name: '我的订单',
  137. img: require('./image/dd.png'),
  138. isNew: false,
  139. path: '/myOrder'
  140. },
  141. {
  142. name: '我的反馈',
  143. img: require('./image/fk.png'),
  144. isNew: false,
  145. path: '/feedback'
  146. }
  147. ]
  148. };
  149. },
  150. onLoad() {
  151. //option为object类型,会序列化上个页面传递的参数
  152. // this.getUserInfo(); //打印出上个页面传递的参数。
  153. },
  154. methods: {
  155. toPath(item) {
  156. if (item.path) {
  157. uni.navigateTo({
  158. url:'/pages/subPackages/minePages' + item.path
  159. })
  160. }
  161. },
  162. toMineInfo(){
  163. uni.navigateTo({
  164. url:'/pages/subPackages/minePages/mineInfo'
  165. })
  166. },
  167. toMineMsg(){
  168. uni.navigateTo({
  169. url:'/pages/subPackages/minePages/mineMessage'
  170. })
  171. },
  172. onCancel(){
  173. this.show = false
  174. },
  175. onConfirm(e){
  176. if (e.detail.value !== '普通用户'){
  177. uni.navigateTo({
  178. url: "/pages/login2/login?loginType=" + e.detail.value,
  179. success: function (e) {
  180. // uni.$emit('userType', 'OK')
  181. },
  182. });
  183. }
  184. this.show = false
  185. },
  186. changeUserType() {
  187. this.show = true
  188. // uni.navigateTo({
  189. // url: "/pages/login2/login",
  190. // success: function (e) {
  191. // // uni.$emit('userType', 'OK')
  192. // },
  193. // });
  194. },
  195. outLogin() {
  196. wx.showModal({
  197. title: "提示!",
  198. content: "是否确认退出登录?",
  199. success: function (res) {
  200. if (res.confirm) {
  201. uni.clearStorageSync();
  202. uni.reLaunch({
  203. url: "/pages/login/login",
  204. });
  205. }
  206. },
  207. });
  208. },
  209. editPassWord() {
  210. uni.navigateTo({
  211. url: "/pages/subPackages/password/index",
  212. });
  213. },
  214. async getUserInfo() {
  215. let data = await getUserInfo();
  216. this.userInfo = data.data;
  217. },
  218. },
  219. };
  220. </script>
  221. <style lang="scss">
  222. .banner {
  223. width: 100%;
  224. height: 100%;
  225. position: absolute;
  226. z-index: 1;
  227. }
  228. .headerandwelcome {
  229. margin-bottom: 60rpx;
  230. height: 120rpx;
  231. width: 100%;
  232. padding-left: 60rpx;
  233. }
  234. .info {
  235. position: absolute;
  236. //width: calc(100% - 64rpx);
  237. margin: 60rpx 0 0 0;
  238. z-index: 2;
  239. }
  240. .header {
  241. height: 120rpx;
  242. width: 120rpx;
  243. //margin-left: 15rpx;
  244. border-radius: 50%;
  245. float: left;
  246. }
  247. .weltxt {
  248. height: 120rpx;
  249. color: #ffffff;
  250. margin-left: 32rpx;
  251. display: flex;
  252. flex-direction: column;
  253. justify-content: center;
  254. float: left;
  255. color: black;
  256. }
  257. .cardBox{
  258. width: 686rpx;
  259. height: 100rpx;
  260. box-sizing: border-box;
  261. background: rgba(20, 33, 76, 1);
  262. border-radius: 16rpx 16rpx 0 0;
  263. display: flex;
  264. align-items: center;
  265. justify-content: space-between;
  266. padding:0 32rpx;
  267. margin-left: 32rpx;
  268. .rightIcon{
  269. width: 36rpx;
  270. height: 36rpx;
  271. }
  272. .cardLeft{
  273. display: flex;
  274. align-items: center;
  275. }
  276. }
  277. .labelpage {
  278. width: 686rpx;
  279. margin-left: 32rpx;
  280. box-sizing: border-box;
  281. padding: 32rpx;
  282. border-radius: 12rpx 12rpx 12rpx 12rpx;
  283. background: #ffffff;
  284. }
  285. .labelpage_row {
  286. display: flex;
  287. align-items: center;
  288. height: 83rpx;
  289. width: 100%;
  290. img {
  291. height: 44rpx;
  292. width: 44rpx;
  293. float: left;
  294. margin-right: 12rpx;
  295. }
  296. .labelpage_text {
  297. width: 100%;
  298. height: 44rpx;
  299. line-height: 44rpx;
  300. float: left;
  301. }
  302. .labelpage_name {
  303. height: 44rpx;
  304. line-height: 44rpx;
  305. float: left;
  306. font-size: 34rpx;
  307. color: #081640;
  308. font-weight: 400;
  309. }
  310. .labelpage_value {
  311. height: 44rpx;
  312. line-height: 44rpx;
  313. float: right;
  314. font-size: 34rpx;
  315. color: #666666;
  316. font-weight: 400;
  317. }
  318. .border {
  319. margin-top: 48rpx;
  320. width: 100%;
  321. height: 1rpx;
  322. border-bottom: 2rpx solid #e6e6e6;
  323. float: left;
  324. }
  325. }
  326. .mineMenuBody {
  327. width: 686rpx;
  328. box-sizing: border-box;
  329. display: flex;
  330. justify-content: space-around;
  331. background: white;
  332. padding: 24rpx 0;
  333. margin: 24rpx 32rpx;
  334. border-radius: 2vw;
  335. .mineMenuItem {
  336. position: relative;
  337. display: flex;
  338. flex-direction: column;
  339. align-items: center;
  340. .redDoll {
  341. position: absolute;
  342. right: 0;
  343. top: 0;
  344. width: 16rpx;
  345. height: 16rpx;
  346. background: #f25551;
  347. border-radius: 50%;
  348. }
  349. .menuImg {
  350. width: 80rpx;
  351. height: 80rpx;
  352. }
  353. .menuName {
  354. color: #333333;
  355. font-size: 28rpx;
  356. margin-top: 8rpx;
  357. }
  358. }
  359. }
  360. </style>