card2.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="">
  3. <view class="empty-page" v-if="vuex_agenter_type == 0">
  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="https://thirdwx.qlogo.cn/mmopen/vi_32/q6EwR5U6zFp8bYbUWb9HmFc5Q3R88x13Q0ZtOcVK5lO8AmtibQDRcuMA2Y7CmyuMCr6icceM3QibIKN2icAAxSvjpA/132" ></image>
  28. <view class="center text-lg" style="margin-left: 20rpx;margin-right: 10rpx;">黄明潘</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. 代理商
  32. </view>
  33. </view>
  34. </view>
  35. <view class="bottom">
  36. <view >
  37. <text>今日收益</text>
  38. <text class="text-price">108.00</text>
  39. </view>
  40. <view style="margin: 0 50rpx;">
  41. <text>总收益</text>
  42. <text class="text-price">888.00</text>
  43. </view>
  44. <view >
  45. <text>我的推广</text>
  46. <text >98</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="menu">
  51. <view class="title">推广服务</view>
  52. <view class="margin-top-30">
  53. <view @click="$jump(item.path)" class="item" v-for="(item,index) in menuList" :key="index">
  54. <view class="center">
  55. <image style="width: 38rpx;height: 38rpx;margin-right: 10rpx;" :src="item.icon"></image>
  56. <text>{{item.name}}</text>
  57. </view>
  58. <view class="center">
  59. <text class="cuIcon-right"></text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default{
  69. data(){
  70. return{
  71. menuList:[
  72. {
  73. icon:'/static/agent/topromote.png',
  74. name:'去推广',
  75. path:''
  76. },
  77. {
  78. icon:'/static/agent/mypromote.png',
  79. name:'我的推广',
  80. path:'/pages/agent/myPromote'
  81. },
  82. {
  83. icon:'/static/agent/myearnings.png',
  84. name:'我的收益',
  85. path:''
  86. },
  87. ]
  88. }
  89. },
  90. created() {
  91. this.judgeAgenterType()
  92. },
  93. methods:{
  94. login(){
  95. this.$emit('login')
  96. },
  97. view(){
  98. uni.navigateTo({
  99. url:"/pages/agent/agentDetail"
  100. })
  101. },
  102. judgeAgenterType(){
  103. if (this.$isEmpty(this.vuex_userId)) {
  104. return
  105. }
  106. let params={
  107. userId:this.vuex_userId,
  108. enabled:1
  109. }
  110. this.$api.agenter.list(params).then(res=>{
  111. if (!this.$isEmpty(res.data.records)) {
  112. let item=res.data.records[0]
  113. let type=this.$isEmpty(item.agenterTypeId)?2:1
  114. this.$u.vuex('vuex_agenter_type',type)
  115. }
  116. })
  117. },
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .page{
  123. background-color: #f6f6f6;
  124. height: 80vh;
  125. display: flex;
  126. margin: 20rpx;
  127. flex-direction: column;
  128. justify-content: flex-start;
  129. align-items: center;
  130. .card{
  131. padding:30rpx 40rpx;
  132. width: 100%;
  133. border-radius: 20rpx;
  134. background-image: linear-gradient(#1F2349,#465274);
  135. display: flex;
  136. flex-direction: column;
  137. justify-content: space-between;
  138. .top{
  139. color: #FFFFFF;
  140. display: flex;
  141. image{
  142. border-radius: 50%;
  143. width: 60rpx;
  144. height: 60rpx;
  145. }
  146. }
  147. .bottom{
  148. width: 100%;
  149. padding-top: 30rpx;
  150. display: flex;
  151. text-align: center;
  152. justify-content: space-around;
  153. view{
  154. text-align: center;
  155. display: flex;
  156. flex-direction: column;
  157. text:first-child{
  158. color: #A9ADB4;
  159. font-size: 26rpx;
  160. margin-bottom: 10rpx;
  161. }
  162. text:last-child{
  163. font-size: 34rpx;
  164. color: #F3D4B4;
  165. }
  166. }
  167. }
  168. }
  169. .menu{
  170. margin-top: 30rpx;
  171. width: 100%;
  172. background-color: #FFFFFF;
  173. border-radius: 20rpx;
  174. padding: 0 20rpx;
  175. .title{
  176. padding-top: 30rpx;
  177. padding-left: 20rpx;
  178. font-weight: 800;
  179. font-size: 34rpx;
  180. }
  181. .item{
  182. border-bottom: 1rpx solid #EFEFEF;
  183. padding:30rpx 20rpx;
  184. color: #252525;
  185. font-size: 30rpx;
  186. display: flex;
  187. justify-content: space-between;
  188. }
  189. .item:last-child{
  190. border: none;
  191. }
  192. }
  193. }
  194. .empty-page{
  195. background-color: #f6f6f6;
  196. height: 70vh;
  197. width: 100%;
  198. display: flex;
  199. flex-direction: column;
  200. justify-content: center;
  201. align-items: center;
  202. image{
  203. width: 280rpx;
  204. height: 240rpx;
  205. }
  206. .tips{
  207. margin-top: 20rpx;
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: center;
  211. align-items: center;
  212. text:first-child{
  213. font-size: 32rpx;
  214. font-weight: 800;
  215. }
  216. text:last-child{
  217. margin-top: 20rpx;
  218. color: #999;
  219. font-size: 26rpx;
  220. }
  221. }
  222. .btn{
  223. width: 250rpx;
  224. margin-top: 100rpx;
  225. background-color: #F6F6F6;
  226. border: 1rpx solid #EF9944;
  227. color: #EF9944;
  228. }
  229. }
  230. </style>