card2.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="">
  3. <view class="empty-page" v-if="vuex_agenter_type == '普通用户'">
  4. <image src="@/static/icon/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/icon/topromote.png',
  80. name:'去推广',
  81. path:'/pagesB/pages/agent/draw-poster'
  82. },
  83. {
  84. icon:'/static/icon/mypromote.png',
  85. name:'我的推广',
  86. path:'/pagesB/pages/agent/myPromote'
  87. },
  88. {
  89. icon:'/static/icon/myearnings.png',
  90. name:'我的收益',
  91. path:'/pagesB/pages/agent/myIncome/myIncome'
  92. },
  93. {
  94. icon:'/static/icon/bank.png',
  95. name:'我的银行卡',
  96. path:'/pagesB/pages/userBank/userBank'
  97. },
  98. {
  99. icon:'/static/icon/records.png',
  100. name:'提现记录',
  101. path:'/pagesB/pages/withdraw/records'
  102. },
  103. ]
  104. }
  105. },
  106. watch:{
  107. vuex_userId(){
  108. if (this.$isNotEmpty(this.vuex_userId)) {
  109. this.fetchStatistics()
  110. }
  111. }
  112. },
  113. created() {
  114. this.fetchStatistics()
  115. },
  116. methods:{
  117. login(){
  118. this.$emit('login')
  119. },
  120. view(){
  121. uni.navigateTo({
  122. url:"/pagesB/pages/agent/agentDetail"
  123. })
  124. },
  125. fetchStatistics(){
  126. let params={
  127. userId:this.vuex_userId
  128. }
  129. this.$api.agenter.statistics(params).then(res=>{
  130. this.info=res.data
  131. })
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .btn-withdraw{
  138. position: absolute;
  139. right: -30rpx;
  140. top: 26rpx;
  141. .btn{
  142. padding: 16rpx 38rpx;
  143. background-color: #FFE6CD;
  144. color: #EF9944;
  145. }
  146. }
  147. .page{
  148. background-color: #f6f6f6;
  149. height: 80vh;
  150. display: flex;
  151. margin: 20rpx;
  152. flex-direction: column;
  153. justify-content: flex-start;
  154. align-items: center;
  155. .card{
  156. overflow: hidden;
  157. position: relative;
  158. padding:40rpx 40rpx;
  159. width: 100%;
  160. border-radius: 20rpx;
  161. background-image: linear-gradient(#1F2349,#465274);
  162. display: flex;
  163. flex-direction: column;
  164. justify-content: space-between;
  165. .top{
  166. color: #FFFFFF;
  167. display: flex;
  168. image{
  169. border-radius: 50%;
  170. width: 60rpx;
  171. height: 60rpx;
  172. }
  173. }
  174. .bottom{
  175. width: 100%;
  176. padding-top: 30rpx;
  177. display: flex;
  178. text-align: center;
  179. justify-content: space-around;
  180. view{
  181. text-align: center;
  182. display: flex;
  183. flex-direction: column;
  184. text:first-child{
  185. color: #A9ADB4;
  186. font-size: 26rpx;
  187. margin-bottom: 10rpx;
  188. }
  189. text:last-child{
  190. font-size: 34rpx;
  191. color: #F3D4B4;
  192. }
  193. }
  194. }
  195. }
  196. .menu{
  197. margin-top: 30rpx;
  198. width: 100%;
  199. background-color: #FFFFFF;
  200. border-radius: 20rpx;
  201. padding: 0 20rpx;
  202. .title{
  203. padding-top: 30rpx;
  204. padding-left: 20rpx;
  205. font-weight: 800;
  206. font-size: 34rpx;
  207. }
  208. .item{
  209. border-bottom: 1rpx solid #EFEFEF;
  210. padding:30rpx 20rpx;
  211. color: #252525;
  212. font-size: 30rpx;
  213. display: flex;
  214. justify-content: space-between;
  215. }
  216. .item:last-child{
  217. border: none;
  218. }
  219. }
  220. }
  221. .empty-page{
  222. background-color: #f6f6f6;
  223. height: 70vh;
  224. width: 100%;
  225. display: flex;
  226. flex-direction: column;
  227. justify-content: center;
  228. align-items: center;
  229. image{
  230. width: 280rpx;
  231. height: 240rpx;
  232. }
  233. .tips{
  234. margin-top: 20rpx;
  235. display: flex;
  236. flex-direction: column;
  237. justify-content: center;
  238. align-items: center;
  239. text:first-child{
  240. font-size: 32rpx;
  241. font-weight: 800;
  242. }
  243. text:last-child{
  244. margin-top: 20rpx;
  245. color: #999;
  246. font-size: 26rpx;
  247. }
  248. }
  249. .btn{
  250. width: 250rpx;
  251. margin-top: 100rpx;
  252. background-color: #F6F6F6;
  253. border: 1rpx solid #EF9944;
  254. color: #EF9944;
  255. }
  256. }
  257. </style>