index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view>
  3. <view v-if="isLogin && userInfo" class="imgs_bg">
  4. <view class="infos" @click="to('/pages/profile/index')">
  5. <image
  6. :src="
  7. userInfo.avatar
  8. ? $method.splitImgHost(userInfo.avatar, true)
  9. : defaultHead
  10. "
  11. ></image>
  12. <text>{{ userInfo.realname }}</text>
  13. </view>
  14. <view class="profit">
  15. <view class="profit-commis fl_b">
  16. <view class="profit-commis-money">{{
  17. (userInfo.cash + userInfo.usedCash + userInfo.freezeCash) | toFixed
  18. }}</view>
  19. <view class="profit-commis-btn" @click="to('/pages/cashout/index')"
  20. >提现</view
  21. >
  22. </view>
  23. <text>总佣金</text>
  24. <view class="profit-embody fl_b">
  25. <view>可提现:{{ userInfo.cash | toFixed }}元</view>
  26. <view>已提现:{{ userInfo.usedCash | toFixed }}元</view>
  27. </view>
  28. </view>
  29. <view class="about">
  30. <view
  31. class="fl_b about_item"
  32. @click="to(item.path)"
  33. v-for="(item, idx) in list"
  34. :key="idx"
  35. >
  36. <view class="fl">
  37. <image src="../../static/image/icon_partake.png" mode="" />
  38. <text>{{ item.title }}</text>
  39. </view>
  40. <image src="../../static/image/icon_more.png" mode="" />
  41. </view>
  42. </view>
  43. <view class="logout" @click="logout">退出</view>
  44. </view>
  45. <view class="login_wrap" v-if="!isLogin">
  46. <view class="login_text">欢迎来到业务员平台</view>
  47. <view class="login_text">您还没有登录哦~</view>
  48. <u-button
  49. :disabled="isUse"
  50. class="c_btn loginBtn"
  51. text="立即登录/注册"
  52. @click="jumpLogin"
  53. ></u-button>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import { mapGetters } from "vuex";
  59. export default {
  60. data() {
  61. return {
  62. isLogin: false,
  63. defaultHead: require("../../static/image/defhead.png"),
  64. list: [
  65. {
  66. title: "活动参与",
  67. icon: "../../static/image/icon_partake.png",
  68. path: "/pages/actlist/index",
  69. },
  70. {
  71. title: "佣金收益",
  72. icon: "../../static/image/icon_profit.png",
  73. path: "/pages/commission/index",
  74. },
  75. ],
  76. };
  77. },
  78. onLoad(option) {},
  79. onShow() {
  80. this.isLogin = this.$method.isLogin();
  81. if (this.isLogin) {
  82. !this.userInfo && this.$store.dispatch("getUserInfo");
  83. }
  84. },
  85. methods: {
  86. logout() {
  87. this.$store.commit("EXIT");
  88. this.isLogin = false;
  89. },
  90. jumpLogin() {
  91. uni.navigateTo({
  92. url: "/pages/login/login",
  93. });
  94. },
  95. to(path) {
  96. uni.navigateTo({
  97. url: path,
  98. });
  99. },
  100. },
  101. computed: {
  102. ...mapGetters(["userInfo"]),
  103. },
  104. };
  105. </script>
  106. <style>
  107. page {
  108. background-color: #f6f7fb;
  109. }
  110. </style>
  111. <style scoped lang="scss">
  112. .login_wrap {
  113. text-align: center;
  114. margin-top: 256rpx;
  115. .login_text {
  116. &:nth-of-type(1) {
  117. font-weight: bold;
  118. color: #222222;
  119. font-size: 48rpx;
  120. }
  121. &:nth-of-type(2) {
  122. font-weight: 500;
  123. color: #666666;
  124. font-size: 32rpx;
  125. margin: 32rpx 0 160rpx;
  126. }
  127. }
  128. .loginBtn {
  129. width: 86%;
  130. margin: 0 auto;
  131. }
  132. }
  133. .imgs_bg {
  134. padding: 0 32rpx;
  135. box-sizing: border-box;
  136. width: 100%;
  137. height: 429rpx;
  138. padding-top: 60rpx;
  139. background: linear-gradient(180deg, #3f8dfd 49%, rgba(0, 105, 255, 0) 100%);
  140. .infos {
  141. display: flex;
  142. align-items: center;
  143. image {
  144. width: 160rpx;
  145. height: 160rpx;
  146. border-radius: 50%;
  147. }
  148. text {
  149. font-weight: bold;
  150. color: #ffffff;
  151. font-size: 36rpx;
  152. padding-left: 24rpx;
  153. }
  154. }
  155. .profit {
  156. margin-top: 48rpx;
  157. background: url("../../static/image/profitbg.png") no-repeat;
  158. background-size: 100% 100%;
  159. padding: 40rpx 40rpx 50rpx;
  160. color: #2465c1;
  161. .profit-commis {
  162. font-size: 32rpx;
  163. .profit-commis-money {
  164. font-size: 72rpx;
  165. }
  166. .profit-commis-btn {
  167. width: 152rpx;
  168. height: 70rpx;
  169. background: #ffffff;
  170. border-radius: 120rpx;
  171. text-align: center;
  172. line-height: 70rpx;
  173. }
  174. }
  175. .profit-embody {
  176. margin-top: 56rpx;
  177. color: #5f83b8;
  178. font-size: 28rpx;
  179. }
  180. }
  181. .about {
  182. background: #ffffff;
  183. padding: 32rpx;
  184. margin-top: 32rpx;
  185. border-radius: 16rpx;
  186. .about_item {
  187. margin-bottom: 48rpx;
  188. &:last-child {
  189. margin-bottom: 0;
  190. }
  191. view {
  192. image {
  193. width: 56rpx;
  194. height: 56rpx;
  195. }
  196. text {
  197. padding-left: 20rpx;
  198. color: #24263d;
  199. font-weight: bold;
  200. font-size: 32rpx;
  201. }
  202. }
  203. image {
  204. width: 40rpx;
  205. height: 40rpx;
  206. }
  207. }
  208. }
  209. }
  210. .logout {
  211. text-align: center;
  212. font-size: 32rpx;
  213. margin-top: 56rpx;
  214. font-weight: bold;
  215. color: #3f8dfd;
  216. }
  217. </style>