me.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <template>
  2. <view class="contant">
  3. <!-- S 头部 -->
  4. <view class="top">
  5. <view class="vheight"></view>
  6. <!-- 用户 -->
  7. <view class="userBox">
  8. <view class="user-main flexs" @click="goSet">
  9. <view class="user-avatar"><image :src="info.avatar" mode="aspectFill"></image></view>
  10. <text>{{ info.nickname }}</text>
  11. </view>
  12. <view class="user-ts" @click="zxkf()">
  13. <image src="../../static/image/tabbar/ts.png"></image>
  14. <view class="user-ts-font">投诉</view>
  15. </view>
  16. </view>
  17. <view class="userMoney">
  18. <view class="userMoney-item" @click="goWallet">
  19. <view class="userMoney-item-bg"><image src="../../static/image/tabbar/jinbi.png" mode=""></image></view>
  20. <view class="userMoney-item-font">金币</view>
  21. <view class="userMoney-item-font">{{ info.coin || 0 }}</view>
  22. </view>
  23. <view class="userMoney-item" @click="goYue">
  24. <view class="userMoney-item-bg"><image src="../../static/image/tabbar/yuee.png" mode=""></image></view>
  25. <view class="userMoney-item-font">余额</view>
  26. <view class="userMoney-item-font">{{ info.money || 0 }}</view>
  27. </view>
  28. <view class="userMoney-item" @click="toMyBox()">
  29. <view class="userMoney-item-bg"><image src="../../static/image/tabbar/baobei.png" mode=""></image></view>
  30. <view class="userMoney-item-font">宝贝数</view>
  31. <view class="userMoney-item-font">{{ bbs }}</view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- E 头部-->
  36. <!-- 中间 -->
  37. <view class="order">
  38. <view class="order-main">
  39. <view class="order-box">
  40. <view class="order-box-title flex">
  41. <view class="order-box-title-font">我的订单</view>
  42. <view class="order-box-title-icon flexs" @click="order(0)">
  43. <text>全部订单</text>
  44. <image src="/static/image/publice/jinruer@2x.png" mode=""></image>
  45. </view>
  46. </view>
  47. <view class="order-info flex">
  48. <view class="order-info-item center" v-for="(item, index) in orderList" :key="index" @click="order(index)">
  49. <image :src="item.image" mode=""></image>
  50. <text>{{ item.name }}</text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="tool">
  56. <view class="tool-box center" v-for="(item, index) in footerList" :key="index" @click="changeFooter(item)">
  57. <view class="tool-box-item">
  58. <image :src="item.image" mode=""></image>
  59. <text>{{ item.name }}</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="page-btm" style="padding-top: 20rpx;">©2022 海南恒智文化传媒有限公司 版权所有</view>
  65. <!-- <view class="page-btm" @click="gocx" style="padding-bottom: 10rpx;">浙ICP备2021013190号-9</view> -->
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. topList: [
  73. {
  74. image: '/static/image/me/hegui@2x.png',
  75. name: '我的盒柜',
  76. url: ''
  77. },
  78. {
  79. image: '/static/image/me/jilu.png',
  80. name: '开箱记录',
  81. url: ''
  82. }
  83. ],
  84. orderList: [
  85. {
  86. image: '/static/image/me/daifahuo@2x.png',
  87. name: '待发货'
  88. },
  89. {
  90. image: '/static/image/me/yifahuo@2x.png',
  91. name: '已发货'
  92. },
  93. {
  94. image: '/static/image/me/succed.png',
  95. name: '已完成'
  96. }
  97. ],
  98. footerList: [
  99. {
  100. image: '/static/image/me/hegui@2x.png',
  101. name: '我的盒柜',
  102. url: '/pages/tabbar/box'
  103. },
  104. {
  105. image: '/static/image/me/jilu.png',
  106. name: '开箱记录',
  107. url: '/pages/me/record'
  108. },
  109. {
  110. image: '/static/image/me/yue@2x.png',
  111. name: '我的余额',
  112. url: '/pages/me/balance'
  113. },
  114. // {
  115. // image:'/static/image/me/shoucang@2x.png',
  116. // name:'提现',
  117. // url:'/pages/me/deposit'
  118. // },
  119. {
  120. image: '/static/image/me/shoucang@2x.png',
  121. name: '我的收藏',
  122. url: '/pages/me/coll'
  123. },
  124. {
  125. image: '/static/image/me/fenxiang@2x.png',
  126. name: '分享赚钱',
  127. url: '/pagesA/pages/invite'
  128. },
  129. {
  130. image: '/static/image/me/dizhi@2x.png',
  131. name: '收货地址',
  132. url: '/pages/me/address'
  133. },
  134. {
  135. image: '/static/image/me/kf1.png',
  136. name: '联系客服',
  137. url: '/pagesB/pages/server'
  138. },
  139. {
  140. image: '/static/image/me/shezhi@2x.png',
  141. name: '设置',
  142. url: '/pages/me/set'
  143. }
  144. ],
  145. info: {}, //个人信息
  146. bbs: 0
  147. };
  148. },
  149. methods: {
  150. goSet() {
  151. uni.navigateTo({ url: '/pages/me/set' });
  152. },
  153. //去我的金币
  154. goWallet() {
  155. uni.navigateTo({ url: '/pages/me/wallet' });
  156. },
  157. //去我的余额
  158. goYue() {
  159. uni.navigateTo({ url: '/pages/me/balance' });
  160. },
  161. //去提现明细
  162. txmx() {
  163. uni.navigateTo({ url: '/pagesA/pages/invite' });
  164. },
  165. toMyBox() {
  166. // this.$refs['result-popup'].close();
  167. uni.switchTab({ url: '/pages/tabbar/box' });
  168. },
  169. //去充值
  170. recharge() {
  171. uni.navigateTo({ url: '/pages/me/recharge' });
  172. },
  173. //跳转客服
  174. zxkf: () => uni.navigateTo({ url: '/pagesB/pages/server' }),
  175. //头部
  176. changeTop(index) {
  177. index == 0 ? uni.navigateTo({ url: '/pages/me/myBox' }) : uni.navigateTo({ url: '/pages/me/record' });
  178. },
  179. //去我的订单
  180. order(index) {
  181. uni.navigateTo({ url: '/pages/me/order?type=' + index });
  182. },
  183. changeFooter(item) {
  184. uni.navigateTo({
  185. url: item.url,
  186. fail() {
  187. uni.switchTab({
  188. url: item.url
  189. });
  190. }
  191. });
  192. },
  193. //获取个人信息
  194. getInfo() {
  195. this.$api
  196. .userinfo()
  197. .then(res => {
  198. if (res.code === 1) {
  199. this.info = res.data;
  200. }
  201. })
  202. .catch(res => {
  203. console.log(res);
  204. });
  205. },
  206. getbbs() {
  207. this.$api.myBox({ status: 1, page: 1, msg: '数据加载中' }).then(res => {
  208. console.log(res, '123456');
  209. this.bbs = res.data.total;
  210. });
  211. }
  212. },
  213. onShow() {
  214. this.getInfo();
  215. this.getbbs();
  216. }
  217. };
  218. </script>
  219. <style lang="scss">
  220. .vheigh {
  221. height: var(--status-bar-height);
  222. }
  223. .user-ts {
  224. padding-right: 27rpx;
  225. position: relative;
  226. z-index: 22;
  227. display: flex;
  228. flex-direction: column;
  229. align-items: center;
  230. image {
  231. width: 42rpx;
  232. height: 48rpx;
  233. }
  234. .user-ts-font {
  235. margin-top: 16rpx;
  236. font-size: 25rpx;
  237. font-family: PingFang SC;
  238. font-weight: bold;
  239. color: #fafafa;
  240. }
  241. }
  242. .top {
  243. width: 750rpx;
  244. height: 456rpx;
  245. background: url(https://www.chaomangdao.com/image/xxbj.png);
  246. background-size: 100%;
  247. .userBox {
  248. display: flex;
  249. justify-content: space-between;
  250. align-items: center;
  251. }
  252. .userMoney {
  253. padding: 0 27rpx;
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. .userMoney-item {
  258. width: 225rpx;
  259. height: 145rpx;
  260. position: relative;
  261. padding: 20rpx 16rpx;
  262. .userMoney-item-bg {
  263. position: absolute;
  264. top: 0;
  265. left: 0;
  266. right: 0;
  267. width: 225rpx;
  268. height: 145rpx;
  269. image {
  270. width: 100%;
  271. height: 100%;
  272. }
  273. }
  274. .userMoney-item-font {
  275. position: relative;
  276. z-index: 2;
  277. font-size: 24rpx;
  278. font-family: PingFang SC;
  279. font-weight: bold;
  280. color: #fafafa;
  281. }
  282. }
  283. }
  284. }
  285. .user-main {
  286. image {
  287. width: 100rpx;
  288. height: 100rpx;
  289. margin-right: 26rpx;
  290. border-radius: 50%;
  291. position: relative;
  292. left: 40rpx;
  293. top: 40rpx;
  294. }
  295. text {
  296. color: #000000;
  297. font-size: 36rpx;
  298. margin-left: 26rpx;
  299. }
  300. }
  301. .user-main .user-avatar {
  302. width: 180rpx;
  303. height: 180rpx;
  304. }
  305. .order {
  306. margin-top: 30rpx;
  307. padding: 0 30rpx;
  308. padding-bottom: 48rpx;
  309. .order-main {
  310. padding: 0 24rpx;
  311. margin-bottom: 20rpx;
  312. background: #ffffff;
  313. box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(51, 51, 51, 0.1);
  314. border-radius: 20rpx;
  315. .order-main_nav {
  316. border-bottom: 2rpx solid #f7f7f7;
  317. .order-main_nav_li {
  318. width: 50%;
  319. height: 86rpx;
  320. image {
  321. width: 44rpx;
  322. height: 44rpx;
  323. margin-right: 10rpx;
  324. }
  325. text {
  326. color: #000000;
  327. font-size: 28rpx;
  328. font-weight: bold;
  329. }
  330. }
  331. }
  332. .order-box {
  333. padding: 0 14rpx 30rpx 14rpx;
  334. .order-box-title {
  335. padding: 30rpx 0 35rpx 0;
  336. }
  337. .order-box-title-font {
  338. color: #010101;
  339. font-size: 28rpx;
  340. font-weight: bold;
  341. }
  342. .order-box-title-icon {
  343. image {
  344. width: 22rpx;
  345. height: 22rpx;
  346. margin-left: 10rpx;
  347. }
  348. text {
  349. color: #999999;
  350. font-size: 22rpx;
  351. }
  352. }
  353. .order-info {
  354. .order-info-item {
  355. flex-direction: column;
  356. image {
  357. width: 44rpx;
  358. height: 44rpx;
  359. margin-bottom: 10rpx;
  360. }
  361. text {
  362. color: #000000;
  363. font-size: 22rpx;
  364. }
  365. }
  366. }
  367. }
  368. }
  369. .order_con {
  370. background: #ffffff;
  371. padding: 0 30rpx;
  372. margin-bottom: 2rpx;
  373. box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(51, 51, 51, 0.1);
  374. border-radius: 20rpx;
  375. .order_con_head {
  376. padding: 30rpx 0;
  377. color: #010101;
  378. font-size: 28rpx;
  379. font-weight: bold;
  380. }
  381. .order_con_gold {
  382. padding: 22rpx 0 26rpx 0;
  383. border-top: 2rpx solid #f7f7f7;
  384. .order_con_gold_l {
  385. text {
  386. color: #010101;
  387. font-size: 28rpx;
  388. &:last-child {
  389. font-weight: bold;
  390. }
  391. }
  392. }
  393. .order_con_gold_btn {
  394. width: 100rpx;
  395. height: 44rpx;
  396. color: #ffffff;
  397. background: -webkit-linear-gradient(0deg, #89f7fe 0%, #66a6ff 100%);
  398. border-radius: 22rpx;
  399. }
  400. }
  401. }
  402. .tool {
  403. width: 692rpx;
  404. background: #ffffff;
  405. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  406. border-radius: 10rpx;
  407. margin: 20rpx auto 0;
  408. }
  409. .tool-box {
  410. width: calc(100% / 4);
  411. float: left;
  412. text-align: center;
  413. padding: 30rpx;
  414. margin-bottom: 2rpx;
  415. background: #ffffff;
  416. border-radius: 20rpx;
  417. .tool-box-item {
  418. image {
  419. width: 50rpx;
  420. height: 50rpx;
  421. display: block;
  422. margin: 0 auto;
  423. }
  424. text {
  425. color: #000000;
  426. font-size: 28rpx;
  427. margin-top: 20rpx;
  428. display: block;
  429. }
  430. }
  431. .tool-box_go {
  432. width: 22rpx;
  433. height: 22rpx;
  434. }
  435. }
  436. }
  437. .txmx {
  438. float: right;
  439. font-weight: 400;
  440. }
  441. .page-btm {
  442. clear: both;
  443. background-color: #f5f5f5;
  444. font-size: 26rpx;
  445. text-align: center;
  446. color: #d6d6d8;
  447. }
  448. </style>