index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view class="index-agent o-h" v-if="!loadding">
  3. <!-- #ifdef MP-WEIXIN || APP-PLUS -->
  4. <view class="ww100" :style="'height:'+topBarTop()+'px;'"></view>
  5. <view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'">
  6. <view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view>
  7. <view class="fb">{{titel}}</view>
  8. </view>
  9. <!-- #endif -->
  10. <!--头部图片-->
  11. <view class="banner d-c-c d-c">
  12. <image :src="top_background" mode="widthFix"></image>
  13. </view>
  14. <!--是分销商-->
  15. <template v-if="is_agent && isData">
  16. <!--金额信息-->
  17. <view class="agent-wrap pr m-0-20" style="margin-top: 300rpx;">
  18. <view class="d-b-c border-b pb30 f28 lh150">
  19. <view>
  20. <text class="gray3 f32">用户名:</text>
  21. <text class="gray3 f32">{{ user.nickName }}</text>
  22. </view>
  23. <view>
  24. <text class="gray3 f32">{{ info_words.index.words.referee.value }}:</text>
  25. <text class="f32 gray3">{{ agent.referee ? agent.referee.nickName : '平台' }}</text>
  26. </view>
  27. </view>
  28. <view class="d-s-c p-30-0 top_dash">
  29. <view class="flex-1 d-c-c d-c">
  30. <view class="redF6">
  31. <text class="f24">¥</text>
  32. <text class="f40">{{ agent.money }}</text>
  33. </view>
  34. <view class="pt20 f26 gray3">{{ info_words.index.words.money.value }}</view>
  35. </view>
  36. <view class="flex-1 d-c-c d-c">
  37. <view class="">
  38. <text class="f24">¥</text>
  39. <text class="f40">{{ agent.freeze_money }}</text>
  40. </view>
  41. <view class="pt20 f28 gray3">{{ info_words.index.words.freeze_money.value }}</view>
  42. </view>
  43. <view class="flex-1 d-c-c d-c">
  44. <view class="">
  45. <text class="f24">¥</text>
  46. <text class="f40">{{ agent.total_money }}</text>
  47. </view>
  48. <view class="pt20 f28 gray3">{{ info_words.index.words.total_money.value }}</view>
  49. </view>
  50. </view>
  51. <view class="d-c-c pt30">
  52. <button type="primary" class="btn-gcred flex-1" @click="gotoCash">{{ info_words.index.words.cash.value }}</button>
  53. </view>
  54. </view>
  55. <!--图标入口-->
  56. <view class="agent-wrap m-0-20 p30 d-s-c f-w mt20 bg-white">
  57. <view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/cash/list/list')">
  58. <view>
  59. <image class="agent_index_img" src="../../../static/icon/icon-zijinmingxi.png" mode=""></image>
  60. </view>
  61. <text class="pt10 f26 mt20">{{ info_words.cash_list.title.value }}</text>
  62. </view>
  63. <view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/order/order')">
  64. <view>
  65. <image class="agent_index_img" src="../../../static/icon/icon-fenxiaodingdan.png" mode=""></image>
  66. </view>
  67. <text class="pt10 f26 mt20">{{ info_words.order.title.value }}</text>
  68. </view>
  69. <view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/team/team')">
  70. <view>
  71. <image class="agent_index_img" src="../../../static/icon/icon-tuandui.png" mode=""></image>
  72. </view>
  73. <text class="pt10 f26 mt20">{{ info_words.team.title.value }}</text>
  74. </view>
  75. <view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/qrcode/qrcode')">
  76. <view>
  77. <image class="agent_index_img" src="../../../static/icon/icon-erweima.png" mode=""></image>
  78. </view>
  79. <text class="pt10 f26 mt20">{{ info_words.qrcode.title.value }}</text>
  80. </view>
  81. </view>
  82. </template>
  83. <!--不是分销商-->
  84. <template v-if="!is_agent && isData">
  85. <view class="no-agent">
  86. <view class="mt50 p-0-20 red f34 tc">{{ info_words.index.words.not_agent.value }}</view>
  87. <view class="p30 mt30">
  88. <button type="primary" class="btn-gcred" @click="applyagent">{{ info_words.index.words.apply_now.value }}</button>
  89. </view>
  90. </view>
  91. </template>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. /*是否加载完成*/
  99. loadding: true,
  100. indicatorDots: true,
  101. autoplay: true,
  102. interval: 2000,
  103. duration: 500,
  104. /*0:不是分销商,1:分销商申请中,2:已经是分销商*/
  105. is_agent: false,
  106. isData: false,
  107. agent: {},
  108. /*顶部背景*/
  109. top_background: '',
  110. /*基本信息*/
  111. info_words: {},
  112. words: {},
  113. user: {},
  114. titel: ''
  115. };
  116. },
  117. onLoad(e) {
  118. if (e.is_agent) {
  119. this.is_agent = e.is_agent;
  120. }
  121. },
  122. onShow() {
  123. uni.showLoading({
  124. title: '加载中'
  125. });
  126. /*获取个人中心数据*/
  127. this.getData();
  128. },
  129. methods: {
  130. /*获取数据*/
  131. getData() {
  132. let self = this;
  133. self._get('user.agent/center', {}, function(data) {
  134. self.info_words = data.data.words;
  135. uni.setNavigationBarTitle({
  136. title: self.info_words.index.title.value != '' ? self.info_words.index.title.value : self.info_words.index.title
  137. .default
  138. });
  139. self.titel = data.data.words.index.title.value
  140. self.is_agent = data.data.is_agent;
  141. self.top_background = data.data.background;
  142. self.agent = data.data.agent;
  143. self.user = data.data.user;
  144. self.isData = true;
  145. self.loadding = false;
  146. uni.hideLoading();
  147. });
  148. },
  149. /*申请分销商*/
  150. applyagent() {
  151. this.gotoPage('/pages/agent/apply/apply');
  152. },
  153. /*去商城逛逛*/
  154. gotoShop() {
  155. this.gotoPage('/pages/index/index')
  156. },
  157. /*去提现*/
  158. gotoCash() {
  159. this.gotoPage('/pages/agent/cash/apply/apply');
  160. },
  161. goback() {
  162. uni.navigateBack();
  163. }
  164. }
  165. };
  166. </script>
  167. <style>
  168. page {
  169. background-color: #f2f2f2;
  170. }
  171. .index-agent .banner {
  172. position: absolute;
  173. width: 100%;
  174. z-index: 0;
  175. min-height: 167rpx;
  176. /* padding-bottom: 60rpx; */
  177. background-repeat: no-repeat;
  178. background-size: 100%;
  179. }
  180. .index-agent .banner image {
  181. width: 100%;
  182. }
  183. .no-agent {
  184. padding-top: 190rpx;
  185. }
  186. .no-agent-img {
  187. padding-top: 60rpx;
  188. }
  189. .no-agent-img image {
  190. width: 300rpx;
  191. }
  192. .agent-wrap {
  193. border-radius: 12rpx;
  194. background-position: -8px 52rpx;
  195. background-size: 100% 100%;
  196. background-image: radial-gradient(circle at 8px, transparent 0%, transparent 8px, #ffffff 8px, #ffffff 100%);
  197. padding: 31rpx 25rpx 36rpx 25rpx;
  198. }
  199. .index-agent .agent-wrap .iconfont {
  200. font-size: 60rpx;
  201. }
  202. .index-agent .btn-gcred {
  203. height: 88rpx;
  204. line-height: 88rpx;
  205. border-radius: 44rpx;
  206. }
  207. .reg180 {
  208. padding-right: 20rpx;
  209. text-align: right;
  210. transform: rotateY(180deg);
  211. position: absolute;
  212. bottom: 0;
  213. }
  214. .icon-jiantou {
  215. color: #FFFFFF;
  216. font-size: 30rpx;
  217. }
  218. .head_top {
  219. position: absolute;
  220. width: 100%;
  221. height: 30px;
  222. line-height: 30px;
  223. color: #FFFFFF;
  224. font-size: 32rpx;
  225. z-index: 2;
  226. }
  227. .top_dash {
  228. border-bottom: 1rpx dashed #D9D9D9;
  229. padding-bottom: 9px;
  230. }
  231. .agent_index_img {
  232. width: 90rpx;
  233. height: 90rpx;
  234. }
  235. </style>