me.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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="navTo('/pages/me/set')">
  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="navTo('/pagesB/pages/server')">
  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="navTo('/pages/me/wallet')">
  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="navTo('/pages/me/balance')">
  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="goOrderDeatil(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="goOrderDeatil(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="nav(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. navTo(url) {
  151. uni.navigateTo({
  152. url
  153. });
  154. },
  155. toMyBox() {
  156. uni.switchTab({ url: '/pages/tabbar/box' });
  157. },
  158. //头部
  159. changeTop(index) {
  160. index == 0 ? uni.navigateTo({ url: '/pages/me/myBox' }) : uni.navigateTo({ url: '/pages/me/record' });
  161. },
  162. //去我的订单
  163. goOrderDeatil(index) {
  164. uni.navigateTo({ url: '/pages/me/order?type=' + index });
  165. },
  166. nav(item) {
  167. uni.navigateTo({
  168. url: item.url,
  169. fail() {
  170. uni.switchTab({
  171. url: item.url
  172. });
  173. }
  174. });
  175. },
  176. //获取个人信息
  177. getuserInfo() {
  178. this.$api
  179. .userinfo()
  180. .then(res => {
  181. if (res.code === 1) {
  182. this.info = res.data;
  183. }
  184. })
  185. .catch(res => {
  186. console.log(res);
  187. });
  188. },
  189. getbbs() {
  190. this.$api.myBox({ status: 1, page: 1, msg: '数据加载中' }).then(res => {
  191. console.log(res, '123456');
  192. this.bbs = res.data.total;
  193. });
  194. }
  195. },
  196. onShow() {
  197. this.getuserInfo();
  198. this.getbbs();
  199. }
  200. };
  201. </script>
  202. <style lang="scss">
  203. .vheigh {
  204. height: var(--status-bar-height);
  205. }
  206. .user-ts {
  207. padding-right: 27rpx;
  208. position: relative;
  209. z-index: 22;
  210. display: flex;
  211. flex-direction: column;
  212. align-items: center;
  213. image {
  214. width: 42rpx;
  215. height: 48rpx;
  216. }
  217. .user-ts-font {
  218. margin-top: 16rpx;
  219. font-size: 25rpx;
  220. font-family: PingFang SC;
  221. font-weight: bold;
  222. color: #fafafa;
  223. }
  224. }
  225. .top {
  226. width: 750rpx;
  227. height: 456rpx;
  228. background: url(https://www.chaomangdao.com/image/xxbj.png);
  229. background-size: 100%;
  230. .userBox {
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. }
  235. .userMoney {
  236. padding: 0 27rpx;
  237. display: flex;
  238. justify-content: space-between;
  239. align-items: center;
  240. .userMoney-item {
  241. width: 225rpx;
  242. height: 145rpx;
  243. position: relative;
  244. padding: 20rpx 16rpx;
  245. .userMoney-item-bg {
  246. position: absolute;
  247. top: 0;
  248. left: 0;
  249. right: 0;
  250. width: 225rpx;
  251. height: 145rpx;
  252. image {
  253. width: 100%;
  254. height: 100%;
  255. }
  256. }
  257. .userMoney-item-font {
  258. position: relative;
  259. z-index: 2;
  260. font-size: 24rpx;
  261. font-family: PingFang SC;
  262. font-weight: bold;
  263. color: #fafafa;
  264. }
  265. }
  266. }
  267. }
  268. .user-main {
  269. image {
  270. width: 100rpx;
  271. height: 100rpx;
  272. margin-right: 26rpx;
  273. border-radius: 50%;
  274. position: relative;
  275. left: 40rpx;
  276. top: 40rpx;
  277. }
  278. text {
  279. color: #000000;
  280. font-size: 36rpx;
  281. margin-left: 26rpx;
  282. }
  283. }
  284. .user-main .user-avatar {
  285. width: 180rpx;
  286. height: 180rpx;
  287. }
  288. .order {
  289. margin-top: 30rpx;
  290. padding: 0 30rpx;
  291. padding-bottom: 48rpx;
  292. .order-main {
  293. padding: 0 24rpx;
  294. margin-bottom: 20rpx;
  295. background: #ffffff;
  296. box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(51, 51, 51, 0.1);
  297. border-radius: 20rpx;
  298. .order-main_nav {
  299. border-bottom: 2rpx solid #f7f7f7;
  300. .order-main_nav_li {
  301. width: 50%;
  302. height: 86rpx;
  303. image {
  304. width: 44rpx;
  305. height: 44rpx;
  306. margin-right: 10rpx;
  307. }
  308. text {
  309. color: #000000;
  310. font-size: 28rpx;
  311. font-weight: bold;
  312. }
  313. }
  314. }
  315. .order-box {
  316. padding: 0 14rpx 30rpx 14rpx;
  317. .order-box-title {
  318. padding: 30rpx 0 35rpx 0;
  319. }
  320. .order-box-title-font {
  321. color: #010101;
  322. font-size: 28rpx;
  323. font-weight: bold;
  324. }
  325. .order-box-title-icon {
  326. image {
  327. width: 22rpx;
  328. height: 22rpx;
  329. margin-left: 10rpx;
  330. }
  331. text {
  332. color: #999999;
  333. font-size: 22rpx;
  334. }
  335. }
  336. .order-info {
  337. .order-info-item {
  338. flex-direction: column;
  339. image {
  340. width: 44rpx;
  341. height: 44rpx;
  342. margin-bottom: 10rpx;
  343. }
  344. text {
  345. color: #000000;
  346. font-size: 22rpx;
  347. }
  348. }
  349. }
  350. }
  351. }
  352. .order_con {
  353. background: #ffffff;
  354. padding: 0 30rpx;
  355. margin-bottom: 2rpx;
  356. box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(51, 51, 51, 0.1);
  357. border-radius: 20rpx;
  358. .order_con_head {
  359. padding: 30rpx 0;
  360. color: #010101;
  361. font-size: 28rpx;
  362. font-weight: bold;
  363. }
  364. .order_con_gold {
  365. padding: 22rpx 0 26rpx 0;
  366. border-top: 2rpx solid #f7f7f7;
  367. .order_con_gold_l {
  368. text {
  369. color: #010101;
  370. font-size: 28rpx;
  371. &:last-child {
  372. font-weight: bold;
  373. }
  374. }
  375. }
  376. .order_con_gold_btn {
  377. width: 100rpx;
  378. height: 44rpx;
  379. color: #ffffff;
  380. background: -webkit-linear-gradient(0deg, #89f7fe 0%, #66a6ff 100%);
  381. border-radius: 22rpx;
  382. }
  383. }
  384. }
  385. .tool {
  386. width: 692rpx;
  387. background: #ffffff;
  388. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  389. border-radius: 10rpx;
  390. margin: 20rpx auto 0;
  391. }
  392. .tool-box {
  393. width: calc(100% / 4);
  394. float: left;
  395. text-align: center;
  396. padding: 30rpx;
  397. margin-bottom: 2rpx;
  398. background: #ffffff;
  399. border-radius: 20rpx;
  400. .tool-box-item {
  401. image {
  402. width: 50rpx;
  403. height: 50rpx;
  404. display: block;
  405. margin: 0 auto;
  406. }
  407. text {
  408. color: #000000;
  409. font-size: 28rpx;
  410. margin-top: 20rpx;
  411. display: block;
  412. }
  413. }
  414. .tool-box_go {
  415. width: 22rpx;
  416. height: 22rpx;
  417. }
  418. }
  419. }
  420. .txmx {
  421. float: right;
  422. font-weight: 400;
  423. }
  424. .page-btm {
  425. clear: both;
  426. background-color: #f5f5f5;
  427. font-size: 26rpx;
  428. text-align: center;
  429. color: #d6d6d8;
  430. }
  431. </style>