card2.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="">
  3. <view class="empty-page" v-if="vuex_agenter_type == '普通用户'">
  4. <image src="@/static/agent/empty.png" mode=""></image>
  5. <block v-if="!$isEmpty(vuex_userId)">
  6. <view class="tips">
  7. <text>您当前还不是代理身份</text>
  8. <text>快去查看代理权益吧~</text>
  9. </view>
  10. <view class="cu-btn btn round" @click="view">
  11. 点击查看
  12. </view>
  13. </block>
  14. <block v-else>
  15. <view class="tips">
  16. <text>当前用户还未登录</text>
  17. <text>快去登录查看代理权益吧~</text>
  18. </view>
  19. <view class="cu-btn btn round" @click="login">
  20. 点击登录
  21. </view>
  22. </block>
  23. </view>
  24. <view class="page" v-else>
  25. <view class="card">
  26. <view class="top">
  27. <image :src="info.agenterAvatar" ></image>
  28. <view class="center text-lg" style="margin-left: 20rpx;margin-right: 10rpx;">{{info.agenterName}}</view>
  29. <view class="center margin-left-10">
  30. <view class="cu-tag btn-bg-color sm" style="border-radius: 20rpx 20rpx 20rpx 0;padding: 10rpx;">
  31. {{info.agenterType}}
  32. </view>
  33. </view>
  34. </view>
  35. <view class="bottom">
  36. <view >
  37. <text>今日收益</text>
  38. <text class="text-price">{{info.todayEarning}}</text>
  39. </view>
  40. <view @click="$jump('/pagesB/pages/agent/myIncome/myIncome')" style="margin: 0 50rpx;">
  41. <text>总收益</text>
  42. <text class="text-price">{{info.totalEarning}}</text>
  43. </view>
  44. <view @click="$jump('/pagesB/pages/agent/myPromote')">
  45. <text>我的推广</text>
  46. <text >{{info.promoteNum}}</text>
  47. </view>
  48. </view>
  49. <view @click="$jump('/pagesB/pages/withdraw/withdraw')" class="btn-withdraw">
  50. <view class="cu-btn round sm btn" style="font-size: 26rpx;">
  51. 提现
  52. </view>
  53. </view>
  54. </view>
  55. <view class="menu">
  56. <view class="title">推广服务</view>
  57. <view class="margin-top-30">
  58. <view @click="$jump(item.path)" class="item" v-for="(item,index) in menuList" :key="index">
  59. <view class="center">
  60. <image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;" :src="item.icon"></image>
  61. <text>{{item.name}}</text>
  62. </view>
  63. <view class="center">
  64. <text class="cuIcon-right"></text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. export default{
  74. data(){
  75. return{
  76. info:{},
  77. menuList:[
  78. {
  79. icon:'/static/agent/topromote.png',
  80. name:'去推广',
  81. path:'/pagesB/pages/agent/promote'
  82. },
  83. {
  84. icon:'/static/agent/mypromote.png',
  85. name:'我的推广',
  86. path:'/pagesB/pages/agent/myPromote'
  87. },
  88. {
  89. icon:'/static/agent/myearnings.png',
  90. name:'我的收益',
  91. path:'/pagesB/pages/agent/myIncome/myIncome'
  92. },
  93. {
  94. icon:'/static/icon/bank1.png',
  95. name:'我的银行卡',
  96. path:'/pagesB/pages/userBank/userBank'
  97. },
  98. {
  99. icon:'/static/icon/bank1.png',
  100. name:'提现记录',
  101. path:'/pagesB/pages/withdraw/records'
  102. },
  103. ]
  104. }
  105. },
  106. created() {
  107. this.fetchStatistics()
  108. },
  109. methods:{
  110. login(){
  111. this.$emit('login')
  112. },
  113. view(){
  114. uni.navigateTo({
  115. url:"/pages/agent/agentDetail"
  116. })
  117. },
  118. fetchStatistics(){
  119. let params={
  120. userId:this.vuex_userId
  121. }
  122. this.$api.agenter.statistics(params).then(res=>{
  123. this.info=res.data
  124. })
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .btn-withdraw{
  131. position: absolute;
  132. right: -30rpx;
  133. top: 26rpx;
  134. .btn{
  135. padding: 16rpx 38rpx;
  136. background-color: #FFE6CD;
  137. color: #EF9944;
  138. }
  139. }
  140. .page{
  141. background-color: #f6f6f6;
  142. height: 80vh;
  143. display: flex;
  144. margin: 20rpx;
  145. flex-direction: column;
  146. justify-content: flex-start;
  147. align-items: center;
  148. .card{
  149. overflow: hidden;
  150. position: relative;
  151. padding:40rpx 40rpx;
  152. width: 100%;
  153. border-radius: 20rpx;
  154. background-image: linear-gradient(#1F2349,#465274);
  155. display: flex;
  156. flex-direction: column;
  157. justify-content: space-between;
  158. .top{
  159. color: #FFFFFF;
  160. display: flex;
  161. image{
  162. border-radius: 50%;
  163. width: 60rpx;
  164. height: 60rpx;
  165. }
  166. }
  167. .bottom{
  168. width: 100%;
  169. padding-top: 30rpx;
  170. display: flex;
  171. text-align: center;
  172. justify-content: space-around;
  173. view{
  174. text-align: center;
  175. display: flex;
  176. flex-direction: column;
  177. text:first-child{
  178. color: #A9ADB4;
  179. font-size: 26rpx;
  180. margin-bottom: 10rpx;
  181. }
  182. text:last-child{
  183. font-size: 34rpx;
  184. color: #F3D4B4;
  185. }
  186. }
  187. }
  188. }
  189. .menu{
  190. margin-top: 30rpx;
  191. width: 100%;
  192. background-color: #FFFFFF;
  193. border-radius: 20rpx;
  194. padding: 0 20rpx;
  195. .title{
  196. padding-top: 30rpx;
  197. padding-left: 20rpx;
  198. font-weight: 800;
  199. font-size: 34rpx;
  200. }
  201. .item{
  202. border-bottom: 1rpx solid #EFEFEF;
  203. padding:30rpx 20rpx;
  204. color: #252525;
  205. font-size: 30rpx;
  206. display: flex;
  207. justify-content: space-between;
  208. }
  209. .item:last-child{
  210. border: none;
  211. }
  212. }
  213. }
  214. .empty-page{
  215. background-color: #f6f6f6;
  216. height: 70vh;
  217. width: 100%;
  218. display: flex;
  219. flex-direction: column;
  220. justify-content: center;
  221. align-items: center;
  222. image{
  223. width: 280rpx;
  224. height: 240rpx;
  225. }
  226. .tips{
  227. margin-top: 20rpx;
  228. display: flex;
  229. flex-direction: column;
  230. justify-content: center;
  231. align-items: center;
  232. text:first-child{
  233. font-size: 32rpx;
  234. font-weight: 800;
  235. }
  236. text:last-child{
  237. margin-top: 20rpx;
  238. color: #999;
  239. font-size: 26rpx;
  240. }
  241. }
  242. .btn{
  243. width: 250rpx;
  244. margin-top: 100rpx;
  245. background-color: #F6F6F6;
  246. border: 1rpx solid #EF9944;
  247. color: #EF9944;
  248. }
  249. }
  250. </style>