mine.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <template>
  2. <view class="container">
  3. <view class="head-wrap">
  4. <view class="content">
  5. <view class="avatar-wrap">
  6. <u-avatar :src="user_info.avatar" @click="onClickAvatar" size="80"></u-avatar>
  7. </view>
  8. <view class="user-nickname">
  9. <u--text
  10. size="18"
  11. bold
  12. :text="user_info.nickname ? user_info.nickname : 'fadsfdaf'"
  13. ></u--text>
  14. <u--text size="12" text="欢迎加入车旅程"></u--text>
  15. </view>
  16. <view>
  17. <!-- 已登录 -->
  18. <!-- <view class="user-base" v-if="user_info.nickname"> -->
  19. <view class="user-base">
  20. <view class="btn-wrap">
  21. <u-icon
  22. size="30"
  23. @tap="$Router.push('/pages/client/clientUser/setting')"
  24. name="setting"
  25. ></u-icon>
  26. </view>
  27. </view>
  28. <!-- 未登录 -->
  29. <!-- <view class="clickLogin" v-else @tap="$Router.push('/pages/login/index')">
  30. 点击登录/注册
  31. </view> -->
  32. </view>
  33. </view>
  34. <!-- 收藏 -->
  35. <view class="Collect">
  36. <u-grid :border="false" col="4">
  37. <u-grid-item
  38. v-for="(listItem, listIndex) in collectList"
  39. :key="listIndex"
  40. @tap="$Router.push(listItem.url)"
  41. >
  42. <u-icon
  43. :customStyle="{ paddingTop: 20 + 'rpx' }"
  44. :name="listItem.name"
  45. :size="24"
  46. color="#fff"
  47. />
  48. <text class="grid-text">{{ listItem.title }}</text>
  49. </u-grid-item>
  50. </u-grid>
  51. </view>
  52. <view class="order-out-box">
  53. <view class="order-inner-box">
  54. <u-grid :border="false" col="4" style="background-color: #fff">
  55. <u-grid-item
  56. v-for="(listItem, listIndex) in oderList"
  57. :key="listIndex"
  58. @tap="gotoOrder(listItem)"
  59. >
  60. <u-icon
  61. :customStyle="{ paddingTop: 20 + 'rpx' }"
  62. :name="listItem.name"
  63. :size="34"
  64. ></u-icon>
  65. <text class="grid-text">{{ listItem.title }}</text>
  66. </u-grid-item>
  67. </u-grid>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 我的收益 -->
  72. <view class="income-out-box">
  73. <view class="income-inner-box" @click="handlerSkipMyProfit">
  74. <view class="income-head">
  75. <text class="my-income">我的收益</text>
  76. <u-icon name="arrow-right" />
  77. </view>
  78. <view class="income-content">
  79. <u-grid :border="false" col="4" bgColor="#fff">
  80. <u-grid-item v-for="(listItem, listIndex) in incomeList" :key="listIndex">
  81. <view class="num-box">{{ listItem.num }}元</view>
  82. <view class="num-title">{{ listItem.title }}</view>
  83. </u-grid-item>
  84. </u-grid>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 预约列表 -->
  89. <view class="appointList">
  90. <u-cell icon="setting-fill" title="预约列表" isLink url="/pages/client/clientUser/appoint" />
  91. <u-cell icon="setting-fill" title="我的店铺" isLink />
  92. </view>
  93. <view class="other-out-box">
  94. <view class="other-inner-box">
  95. <u-cell-group :border="false">
  96. <u-cell
  97. v-for="(item, index) in listData"
  98. :key="index"
  99. size="large"
  100. :border="false"
  101. :icon="item.icon"
  102. :title="item.title"
  103. isLink
  104. :url="item.url"
  105. ></u-cell>
  106. </u-cell-group>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import { maintainUserInfo } from '@/api/client/mine.js';
  113. export default {
  114. data() {
  115. return {
  116. collectList: [
  117. {
  118. name: 'photo',
  119. title: '收藏',
  120. url: '/pages/client/clientUser/collectList',
  121. },
  122. {
  123. name: 'lock',
  124. title: '积分',
  125. url: '/pages/client/clientUser/myScore',
  126. },
  127. {
  128. name: 'star',
  129. title: '询价记录',
  130. url: '/pages/client/clientUser/inquiryList',
  131. },
  132. {
  133. name: 'hourglass',
  134. title: '优惠券',
  135. url: '/pages/client/clientUser/coupon',
  136. },
  137. ],
  138. oderList: [
  139. {
  140. name: 'photo',
  141. title: '我的订单',
  142. type: 0,
  143. },
  144. {
  145. name: 'lock',
  146. title: '待付款',
  147. type: 1,
  148. },
  149. {
  150. name: 'star',
  151. title: '已完成',
  152. type: 2,
  153. },
  154. {
  155. name: 'hourglass',
  156. title: '待评价',
  157. type: 3,
  158. },
  159. ],
  160. incomeList: [
  161. {
  162. num: '0.00',
  163. title: '总收益',
  164. },
  165. {
  166. num: '0.00',
  167. title: '本月收益',
  168. },
  169. {
  170. num: '0.00',
  171. title: '本周收益',
  172. },
  173. {
  174. num: '0.00',
  175. title: '可提现',
  176. },
  177. ],
  178. listData: [
  179. {
  180. id: '0',
  181. icon: 'setting-fill',
  182. title: '我的团队',
  183. url: '/pages/client/clientUser/myGroup',
  184. },
  185. {
  186. id: '2',
  187. icon: 'setting-fill',
  188. title: '客服中心',
  189. url: '/pages/client/clientUser/serviceCenter',
  190. },
  191. {
  192. id: '3',
  193. icon: 'setting-fill',
  194. title: '商务合作',
  195. url: '/pages/client/clientUser/serviceCenter',
  196. },
  197. {
  198. id: '3',
  199. icon: 'setting-fill',
  200. title: '意见反馈',
  201. url: '/pages/client/clientUser/serviceCenter',
  202. },
  203. ],
  204. user_info: [], // 个人信息
  205. };
  206. },
  207. mounted() {
  208. this.handlerInitUserMessage();
  209. },
  210. methods: {
  211. // 获取当前用户信息
  212. handlerInitUserMessage() {
  213. maintainUserInfo().then(res => {
  214. this.user_info = res.data;
  215. });
  216. },
  217. // 点击头像
  218. onClickAvatar() {},
  219. // 点击跳转到全部订单
  220. gotoOrder(item) {
  221. uni.navigateTo({
  222. url: `/pages/client/clientPackage/orderAll?type=${item.type}`,
  223. });
  224. },
  225. // 点击跳转到我的收益
  226. handlerSkipMyProfit() {
  227. uni.navigateTo({
  228. url: '/pages/client/clientUser/myProfit',
  229. });
  230. },
  231. },
  232. };
  233. </script>
  234. <style lang="scss" scoped>
  235. .container {
  236. min-height: 100vh;
  237. background-color: #efefef;
  238. }
  239. /* 顶部登录 */
  240. .head-wrap {
  241. background-color: #c8c9cc;
  242. height: 390rpx;
  243. padding-top: 40rpx;
  244. .content {
  245. display: flex;
  246. justify-content: space-between;
  247. padding: 38rpx 0 0 36rpx;
  248. box-sizing: border-box;
  249. .user-nickname {
  250. margin-left: -185rpx;
  251. margin-top: 50rpx;
  252. }
  253. .clickLogin {
  254. font-size: 48rpx;
  255. color: #ffffff;
  256. margin-top: 40rpx;
  257. margin-left: 20rpx;
  258. }
  259. .avatar-wrap {
  260. display: inline-block;
  261. }
  262. .user-base {
  263. margin-left: 10rpx;
  264. vertical-align: middle;
  265. display: flex;
  266. flex-direction: column;
  267. justify-content: space-evenly;
  268. .btn-wrap {
  269. width: 160rpx;
  270. margin-top: 40rpx;
  271. }
  272. }
  273. }
  274. .Collect {
  275. margin-top: 10rpx;
  276. // 宫格颜色
  277. .grid-text {
  278. font-size: 30rpx;
  279. color: #fff;
  280. margin-top: 5rpx;
  281. box-sizing: border-box;
  282. }
  283. }
  284. .order-out-box {
  285. margin-top: 30rpx;
  286. padding: 10rpx 16rpx;
  287. box-sizing: border-box;
  288. .order-inner-box {
  289. font-size: 30rpx;
  290. padding-bottom: 30rpx;
  291. background-color: $uni-bg-color;
  292. border-radius: 10rpx;
  293. }
  294. }
  295. }
  296. .income-out-box {
  297. margin-top: 110rpx;
  298. padding: 10rpx 16rpx;
  299. box-sizing: border-box;
  300. .income-inner-box {
  301. padding: 20rpx;
  302. background-color: $uni-bg-color;
  303. .income-head {
  304. display: flex;
  305. justify-content: space-between;
  306. .my-income {
  307. color: $uni-color-primary;
  308. font-size: 32rpx;
  309. font-weight: 600;
  310. }
  311. }
  312. .income-content {
  313. .num-box {
  314. padding: 20rpx 0;
  315. font-size: 36rpx;
  316. font-weight: 600;
  317. color: $uni-text-color;
  318. }
  319. .num-title {
  320. font-size: 28rpx;
  321. color: $uni-text-color-grey;
  322. }
  323. }
  324. }
  325. }
  326. .other-out-box {
  327. margin-top: 10rpx;
  328. padding: 20rpx 16rpx;
  329. box-sizing: border-box;
  330. .other-inner-box {
  331. background-color: $uni-bg-color;
  332. }
  333. }
  334. .appointList {
  335. background-color: #fff;
  336. margin: 10rpx 16rpx 0 16rpx;
  337. }
  338. </style>