index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view class="container">
  3. <view class="head-wrap">
  4. <view class="content">
  5. <view class="avatar-wrap" @tap="$Router.push('/pages/user/info/index')">
  6. <u-avatar :src="user_info.avatar" size="80"></u-avatar>
  7. </view>
  8. <view>
  9. <!-- 已登录 -->
  10. <view class="user-base" v-if="user_info.nickname">
  11. <view class="user-nickname">{{ user_info.nickname }}</view>
  12. <view class="btn-wrap">
  13. <view class="btn-content" @tap="$Router.push('/pages/user/settings/index')">设置</view>
  14. <view class="btn-content">认证</view>
  15. </view>
  16. </view>
  17. <!-- 未登录 -->
  18. <view class="clickLogin" v-else @tap="$Router.push('/pages/login/index')">点击登录/注册
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 收藏 -->
  23. <view class="Collect">
  24. <u-grid :border="false" col="4">
  25. <u-grid-item v-for="(listItem, listIndex) in list1" :key="listIndex" @tap="$Router.push(listItem.url)">
  26. <u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.name" :size="24" color="#fff" />
  27. <text class="grid-text">{{ listItem.title }}</text>
  28. </u-grid-item>
  29. </u-grid>
  30. </view>
  31. <!-- 我的订单 -->
  32. <!-- <view
  33. class="order-out-box"
  34. @tap="$Router.push('/pages/user/myOrder/index')"
  35. > -->
  36. <view class="order-out-box">
  37. <view class="order-inner-box">
  38. <u-grid :border="false" col="4" style="background-color: #fff">
  39. <u-grid-item v-for="(listItem, listIndex) in list2" :key="listIndex">
  40. <u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.name" :size="34"
  41. @tap="gotoOrder(listItem)"></u-icon>
  42. <text class="grid-text">{{ listItem.title }}</text>
  43. </u-grid-item>
  44. </u-grid>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 我的收益 -->
  49. <view class="income-out-box">
  50. <view class="income-inner-box">
  51. <view class="income-head">
  52. <text class="my-income">我的收益</text>
  53. <u-icon name="arrow-right" />
  54. </view>
  55. <view class="income-content">
  56. <u-grid :border="false" col="4" bgColor="#fff">
  57. <u-grid-item v-for="(listItem, listIndex) in incomeList" :key="listIndex">
  58. <view class="num-box">{{ listItem.num }}元</view>
  59. <view class="num-title">{{ listItem.title }}</view>
  60. </u-grid-item>
  61. </u-grid>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 预约列表 -->
  66. <view class="appointList">
  67. <u-cell icon="setting-fill" title="预约列表" isLink url="/pages/user/appoint/index" />
  68. </view>
  69. <view class="other-out-box">
  70. <view class="other-inner-box">
  71. <u-cell-group :border="false">
  72. <u-cell size="large" :border="false" icon="setting-fill" title="我的团队" isLink url="" @tap="$Router.push('/pages/user/mygroup/index')"></u-cell>
  73. <u-cell size="large" :border="false" icon="setting-fill" title="关于我们" isLink url="" @tap="$Router.push('/pages/user/aboutmy/index')"></u-cell>
  74. <!-- <u-cell size="large" :border="false" icon="setting-fill" title="隐私条款" isLink url="" @tap="$Router.push('/pages/user/privacypolicy/index')"></u-cell> -->
  75. <u-cell size="large" :border="false" icon="setting-fill" title="客服中心" isLink url="" @tap="$Router.push('/pages/user/servicecenter/index')"></u-cell>
  76. </u-cell-group>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. // import { mapGetters } from 'vuex';
  83. import { maintainUserInfo } from "@/api/mine.js"
  84. export default {
  85. data() {
  86. return {
  87. list1: [{
  88. name: 'photo',
  89. title: '收藏',
  90. url: '/pages/user/collect/list',
  91. },
  92. {
  93. name: 'lock',
  94. title: '积分',
  95. url: '/pages/user/score/index',
  96. },
  97. {
  98. name: 'star',
  99. title: '询价记录',
  100. url: '/pages/user/inquiry/index',
  101. },
  102. {
  103. name: 'hourglass',
  104. title: '优惠券',
  105. url: '/pages/user/coupon/index',
  106. },
  107. ],
  108. list2: [{
  109. name: 'photo',
  110. title: '我的订单',
  111. },
  112. {
  113. name: 'lock',
  114. title: '待付款',
  115. order: true,
  116. },
  117. {
  118. name: 'star',
  119. title: '已完成',
  120. },
  121. {
  122. name: 'hourglass',
  123. title: '待评价',
  124. },
  125. ],
  126. incomeList: [{
  127. num: '0.00',
  128. title: '总收益',
  129. },
  130. {
  131. num: '0.00',
  132. title: '本月收益',
  133. },
  134. {
  135. num: '0.00',
  136. title: '本周收益',
  137. },
  138. {
  139. num: '0.00',
  140. title: '可提现',
  141. },
  142. ],
  143. user_info:[] // 个人信息
  144. };
  145. },
  146. computed: {
  147. // ...mapGetters(['user_info']),
  148. },
  149. mounted() {
  150. this.handlerInitUserMessage()
  151. },
  152. methods: {
  153. // 获取当前用户信息
  154. handlerInitUserMessage(){
  155. maintainUserInfo().then(res=>{
  156. this.user_info = res.data
  157. // this.$store.dispatch("SET_MERCGANT_ID",res.data.id)
  158. })
  159. },
  160. gotoOrder(item) {
  161. if (item.order) {
  162. this.$Router.push('/pages/order/order');
  163. }
  164. },
  165. },
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. .container {
  170. padding-top: 5px;
  171. min-height: 100vh;
  172. background-color: #efefef;
  173. }
  174. /* 顶部登录 */
  175. .head-wrap {
  176. padding-top: 5px;
  177. margin-top: 5px;
  178. background-color: #347caf;
  179. height: 390rpx;
  180. .content {
  181. display: flex;
  182. padding: 38rpx 0 0 36rpx;
  183. box-sizing: border-box;
  184. .clickLogin {
  185. font-size: 48rpx;
  186. color: #ffffff;
  187. margin-top: 40rpx;
  188. margin-left: 20rpx;
  189. }
  190. .avatar-wrap {
  191. display: inline-block;
  192. }
  193. .user-base {
  194. margin-left: 10rpx;
  195. vertical-align: middle;
  196. display: flex;
  197. flex-direction: column;
  198. justify-content: space-evenly;
  199. .user-nickname {
  200. margin-top: 20rpx;
  201. font-size: 40rpx;
  202. color: #ffffff;
  203. }
  204. .btn-wrap {
  205. width: 160rpx;
  206. margin-top: 20rpx;
  207. display: flex;
  208. justify-content: space-between;
  209. .btn-content {
  210. font-size: 24rpx;
  211. padding: 0 16rpx;
  212. border-radius: 16rpx;
  213. background-color: #ffffff;
  214. }
  215. }
  216. }
  217. }
  218. .Collect {
  219. margin-top: 10rpx;
  220. // 宫格颜色
  221. .grid-text {
  222. font-size: 30rpx;
  223. color: #fff;
  224. margin-top: 5rpx;
  225. box-sizing: border-box;
  226. }
  227. }
  228. .order-out-box {
  229. margin-top: 30rpx;
  230. padding: 10rpx 16rpx;
  231. box-sizing: border-box;
  232. .order-inner-box {
  233. font-size: 30rpx;
  234. padding-bottom: 30rpx;
  235. background-color: $uni-bg-color;
  236. border-radius: 10rpx;
  237. }
  238. }
  239. }
  240. .income-out-box {
  241. margin-top: 110rpx;
  242. padding: 10rpx 16rpx;
  243. box-sizing: border-box;
  244. .income-inner-box {
  245. padding: 20rpx;
  246. background-color: $uni-bg-color;
  247. .income-head {
  248. display: flex;
  249. justify-content: space-between;
  250. .my-income {
  251. color: $uni-color-primary;
  252. font-size: 32rpx;
  253. font-weight: 600;
  254. }
  255. }
  256. .income-content {
  257. .num-box {
  258. padding: 20rpx 0;
  259. font-size: 36rpx;
  260. font-weight: 600;
  261. color: $uni-text-color;
  262. }
  263. .num-title {
  264. font-size: 28rpx;
  265. color: $uni-text-color-grey;
  266. }
  267. }
  268. }
  269. }
  270. .other-out-box {
  271. margin-top: 10rpx;
  272. padding: 20rpx 16rpx;
  273. box-sizing: border-box;
  274. .other-inner-box {
  275. background-color: $uni-bg-color;
  276. }
  277. }
  278. .appointList {
  279. background-color: #fff;
  280. margin: 10rpx 16rpx 0 16rpx;
  281. }
  282. </style>