index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <template>
  2. <view>
  3. <view class="top-cont">
  4. <image class="bg" src="@/static/image/bg_mine.png" mode="widthFix"></image>
  5. <view class="top-inner">
  6. <!-- 这里是状态栏 -->
  7. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  8. <view class="content">
  9. <view class="user-info">
  10. <view class="left">
  11. <view class="head-img">
  12. <image :src="user.avatar==null?'/static/image/my_heads_icon.png':user.avatar"
  13. mode="aspectFill">
  14. </image>
  15. <image class="gender"
  16. :src="isGirl==null?'/static/image/icon_girl.png':'/static/image/icon_boy.png'"
  17. mode="aspectFill"></image>
  18. </view>
  19. <view class="name-phone">
  20. <view class="x-f">
  21. <view class="name" v-if="UserInfo">{{user.nickname}}</view>
  22. <view class="name" v-else>请先登录</view>
  23. <view class="lable">办公室主任</view>
  24. <!-- <text>{{user.phone?utils.parsePhone(user.phone):'-'}}</text> -->
  25. </view>
  26. </view>
  27. <view class="txt">您已加入小蜜蜂1582天了~</view>
  28. </view>
  29. </view>
  30. <view class="task-list">
  31. <view class="item" v-for="(item,index) in tabs" :key="index" @click="openLink(item)">
  32. <view class="left">
  33. <image :src="item.icon" mode=""></image>
  34. <view class="title-l">{{item.name}}</view>
  35. </view>
  36. <view class="right">
  37. <image src="@/static/image/icon_my_more.png" mode=""></image>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. getOrderCount
  49. } from '@/api/storeOrder'
  50. import {
  51. getUserInfo
  52. } from '@/api/user'
  53. export default {
  54. data() {
  55. return {
  56. isGirl: false,
  57. count0: 0,
  58. count1: 0,
  59. count2: 0,
  60. afterSalesCount: 0,
  61. tabs: [
  62. // {
  63. // name: '我的积分',
  64. // num: 12,
  65. // icon: '/static/image/icon_my_points.png',
  66. // url: '/pages_user/points'
  67. // },
  68. {
  69. name: '个人信息',
  70. num: 3,
  71. icon: '/static/image/icon_my_information.png',
  72. url: '/pages_user/userInfo'
  73. },
  74. {
  75. name: '设置中心',
  76. num: 8,
  77. icon: '/static/image/icon_my_set.png',
  78. url: '/pages/auth/setting'
  79. },
  80. ],
  81. user: {
  82. isPromoter: 0,
  83. isWeixinAuth: 0,
  84. phone: "",
  85. nickname: "用户昵称",
  86. avatarUrl: "/static/images/detault_head.png"
  87. },
  88. // 状态栏的高度
  89. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  90. // 消息数量
  91. msgNum: 0,
  92. isShow: true,
  93. UserInfo: uni.getStorageSync('AppToken')
  94. };
  95. },
  96. onLoad() {
  97. console.log("onload")
  98. },
  99. onShow() {
  100. console.log("onshow")
  101. //this.getUserInfo();
  102. //this.getOrderCount();
  103. },
  104. onReachBottom() {
  105. console.log("onReachBottom")
  106. this.$refs.product.getGoodsProducts();
  107. },
  108. methods: {
  109. seeChange() {
  110. this.isShow = !this.isShow
  111. },
  112. callService() {
  113. uni.makePhoneCall({
  114. phoneNumber: "4000717770",
  115. success: function() {
  116. console.log('拨打电话成功');
  117. },
  118. fail() {
  119. console.log('打电话失败了');
  120. }
  121. })
  122. },
  123. getOrderCount() {
  124. getOrderCount().then(
  125. res => {
  126. if (res.code == 200) {
  127. this.count0 = res.count0;
  128. this.count1 = res.count1;
  129. this.count2 = res.count2;
  130. this.afterSalesCount = res.afterSalesCount;
  131. }
  132. },
  133. rej => {}
  134. );
  135. },
  136. openLink(item) {
  137. if (item.name == '用户协议') {
  138. this.openH5()
  139. return;
  140. }
  141. uni.navigateTo({
  142. url: item.url
  143. })
  144. // this.utils.isLogin().then(res => {
  145. // if(res){
  146. // uni.navigateTo({
  147. // url: url+'?userId='+this.user.userId
  148. // })
  149. // }
  150. // })
  151. },
  152. toManager() {
  153. // uni.navigateTo({
  154. // url: '/pages_company/index'
  155. // })
  156. if (this.utils.checkCompanyUserLoginState()) {
  157. uni.navigateTo({
  158. url: '/pages_company/index'
  159. })
  160. } else {
  161. uni.navigateTo({
  162. url: '/pages_company/auth/login'
  163. })
  164. }
  165. },
  166. openH5(url) {
  167. var requestPath = uni.getStorageSync('requestPath');
  168. uni.setStorageSync('url', requestPath + url);
  169. uni.navigateTo({
  170. url: '../home/web'
  171. })
  172. },
  173. getUserInfo() {
  174. getUserInfo().then(
  175. res => {
  176. if (res.code == 200) {
  177. if (res.user != null) {
  178. this.user = res.user;
  179. } else {
  180. this.utils.loginOut();
  181. }
  182. } else {
  183. uni.showToast({
  184. icon: 'none',
  185. title: "请求失败",
  186. });
  187. }
  188. },
  189. rej => {}
  190. );
  191. },
  192. // 跳转页面
  193. navgetTo(url) {
  194. this.utils.isLogin().then(res => {
  195. if (res) {
  196. uni.navigateTo({
  197. url: url + '?userId=' + this.user.userId
  198. })
  199. }
  200. })
  201. },
  202. // 查看订单
  203. showOrder(status) {
  204. uni.navigateTo({
  205. url: '/pages_user/user/storeOrder?status=' + status
  206. })
  207. }
  208. }
  209. }
  210. </script>
  211. <style lang="scss">
  212. .top-cont {
  213. width: 100%;
  214. height: 600rpx;
  215. position: relative;
  216. .bg {
  217. width: 100%;
  218. position: absolute;
  219. top: 0;
  220. left: 0;
  221. }
  222. .top-inner {
  223. width: 100%;
  224. height: 100%;
  225. position: absolute;
  226. top: 0;
  227. left: 0;
  228. z-index: 2;
  229. }
  230. }
  231. .content {
  232. background: linear-gradient(360deg, rgba(244, 249, 255, 0.6) 0%, #FFFFFF 100%);
  233. border-radius: 40rpx 40rpx 24rpx 24rpx;
  234. border: 2rpx solid #FFFFFF;
  235. margin-top: 222upx;
  236. align-items: center;
  237. justify-content: center;
  238. position: relative;
  239. .user-info {
  240. position: relative;
  241. top: -72rpx;
  242. left: 46rpx;
  243. z-index: 4;
  244. .left {
  245. position: relative;
  246. display: flex;
  247. flex-direction: column;
  248. .head-img {
  249. width: 112upx;
  250. height: 112upx;
  251. border-radius: 50%;
  252. margin-right: 32upx;
  253. border: 4upx solid #FFFFFF;
  254. position: relative;
  255. image {
  256. width: 112upx;
  257. height: 112upx;
  258. border-radius: 50%;
  259. }
  260. .gender {
  261. width: 36rpx;
  262. height: 36rpx;
  263. position: absolute;
  264. right: 0;
  265. bottom: 0;
  266. }
  267. }
  268. .name-phone {
  269. display: flex;
  270. align-items: flex-start;
  271. flex-direction: column;
  272. justify-content: space-around;
  273. margin-top: 30rpx;
  274. .name {
  275. font-size: 40upx;
  276. font-family: PingFang SC;
  277. font-weight: bold;
  278. color: #111111;
  279. line-height: 1;
  280. }
  281. text {
  282. font-family: PingFang SC, PingFang SC;
  283. font-weight: 600;
  284. font-size: 28rpx;
  285. }
  286. .lable {
  287. padding: 4rpx 16rpx;
  288. font-weight: 500;
  289. font-size: 22rpx;
  290. color: #FFFFFF;
  291. background: #FAAB0C;
  292. margin-left: 18rpx;
  293. border-radius: 38rpx 38rpx 38rpx 38rpx;
  294. }
  295. .phone {
  296. width: 220rpx;
  297. height: 48rpx;
  298. margin-top: 30upx;
  299. background: linear-gradient(90deg, #FEA501 0%, #FECB8A 100%);
  300. border-radius: 24rpx 24rpx 24rpx 24rpx;
  301. border: 1rpx solid #FEDDB9;
  302. display: flex;
  303. align-items: center;
  304. justify-content: center;
  305. text {
  306. font-size: 24upx;
  307. font-family: PingFang SC;
  308. font-weight: 500;
  309. color: #fff;
  310. line-height: 1;
  311. margin-left: 4rpx;
  312. }
  313. }
  314. }
  315. .txt {
  316. font-size: 28rpx;
  317. color: #666666;
  318. margin-top: 12rpx;
  319. }
  320. }
  321. .right {
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. .set {
  326. width: 48rpx;
  327. height: 48rpx;
  328. }
  329. }
  330. }
  331. .task-list {
  332. display: flex;
  333. align-items: center;
  334. flex-direction: column;
  335. justify-content: flex-start;
  336. width: 100%;
  337. .item {
  338. width: 100%;
  339. display: flex;
  340. align-items: center;
  341. justify-content: space-between;
  342. padding: 28rpx 24rpx;
  343. box-sizing: border-box;
  344. // margin-bottom: 24rpx;
  345. .left {
  346. display: flex;
  347. align-items: center;
  348. justify-content: center;
  349. image {
  350. width: 48rpx;
  351. height: 48rpx;
  352. margin-right: 32rpx;
  353. }
  354. .title-l {
  355. font-family: PingFang SC, PingFang SC;
  356. font-weight: 400;
  357. font-size: 32rpx;
  358. color: #333333;
  359. }
  360. }
  361. .right {
  362. display: flex;
  363. align-items: center;
  364. .num {
  365. text-align: center;
  366. width: 50rpx;
  367. height: 36rpx;
  368. line-height: 36rpx;
  369. background: rgba(56, 139, 255, 0.16);
  370. border-radius: 34rpx 34rpx 34rpx 34rpx;
  371. font-family: PingFang SC, PingFang SC;
  372. font-weight: 400;
  373. font-size: 24rpx;
  374. color: #388BFF;
  375. }
  376. image {
  377. width: 32rpx;
  378. height: 32rpx;
  379. margin-left: 12rpx;
  380. }
  381. }
  382. }
  383. }
  384. .used-tools {
  385. box-sizing: border-box;
  386. background: #FFFFFF;
  387. border-radius: 16upx;
  388. padding: 40upx 30upx;
  389. .title {
  390. font-size: 36upx;
  391. font-family: PingFang SC;
  392. font-weight: bold;
  393. color: #222222;
  394. line-height: 1;
  395. }
  396. .tools-list {
  397. margin-top: 50upx;
  398. display: flex;
  399. flex-wrap: wrap;
  400. width: 100%;
  401. .item {
  402. box-sizing: border-box;
  403. width: 25%;
  404. display: flex;
  405. flex-direction: column;
  406. align-items: center;
  407. justify-content: center;
  408. margin-bottom: 50upx;
  409. position: relative;
  410. image {
  411. width: 48upx;
  412. height: 48upx;
  413. }
  414. .text {
  415. font-size: 24upx;
  416. font-family: PingFang SC;
  417. font-weight: 500;
  418. color: #333;
  419. line-height: 1;
  420. margin-top: 20upx;
  421. }
  422. .contact-btn {
  423. display: inline-block;
  424. position: absolute;
  425. top: 0;
  426. left: 0;
  427. width: 100%;
  428. height: 100%;
  429. opacity: 0;
  430. }
  431. }
  432. }
  433. }
  434. .log-out {
  435. height: 88upx;
  436. line-height: 88upx;
  437. text-align: center;
  438. font-family: PingFang SC, PingFang SC;
  439. font-weight: 500;
  440. font-size: 28rpx;
  441. color: #666666;
  442. background: #FFFFFF;
  443. border-radius: 16upx;
  444. margin-top: 52upx;
  445. }
  446. }
  447. .sub-btn {
  448. position: absolute;
  449. width: 100%;
  450. height: 100%;
  451. opacity: 0;
  452. }
  453. .like-product {
  454. padding: 0 20rpx;
  455. }
  456. .banner {
  457. padding: 20rpx 20rpx 0rpx 20rpx;
  458. height: 200rpx;
  459. position: relative;
  460. display: flex;
  461. align-items: center;
  462. justify-content: center;
  463. image {
  464. width: 100%;
  465. height: 100%;
  466. border-radius: 16rpx 16rpx 16rpx 16rpx;
  467. }
  468. .tel_btn {
  469. width: 100%;
  470. height: 100%;
  471. top: 0upx;
  472. position: absolute;
  473. opacity: 0.0;
  474. }
  475. }
  476. </style>