index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. <template>
  2. <view>
  3. <view class="tui-mybg-box">
  4. <view class="tui-header-center">
  5. <image :src="agentinfo.touxiang || '/static/images/my/mine_def_touxiang_3x.png'" class="tui-avatar"
  6. @tap="navigateTo('/pagesA/my/userInfo/userInfo')"></image>
  7. <view class="tui-info">
  8. <view class="tui-nickname">
  9. {{agentinfo.title}}
  10. </view>
  11. <view class="tui-explain">邀请码:{{agentinfo.agent_code}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="tui-content-box">
  16. <view class="tui-box tui-assets-box">
  17. <tui-list-cell padding="0" unlined :hover="false">
  18. <view class="tui-cell-header">
  19. <view class="tui-cell-title">我的收益</view>
  20. </view>
  21. </tui-list-cell>
  22. <view class="tui-order-list tui-assets-list">
  23. <view class="tui-order-item">
  24. <view class="tui-assets-num"><text>{{agentinfo.total_income}}</text></view>
  25. <view class="tui-assets-text">总收入</view>
  26. </view>
  27. <view class="tui-order-item">
  28. <view class="tui-assets-num">
  29. <text>{{agentinfo.income}}</text>
  30. </view>
  31. <view class="tui-assets-text">本月收入</view>
  32. </view>
  33. <view class="tui-order-item">
  34. <view class="tui-assets-num">
  35. <text>{{agentinfo.income}}</text>
  36. </view>
  37. <view class="tui-assets-text">可提现</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="tui-box tui-tool-box">
  42. <view class="tui-order-list tui-flex-wrap">
  43. <view class="tui-tool-item">
  44. <view class="tui-icon-box" @tap="navigateTo('/pagesA/my/fx/poster')">
  45. <image src="/static/images/mall/my/QRcode.png" class="tui-tool-icon"></image>
  46. </view>
  47. <view class="tui-tool-text">推广海报</view>
  48. </view>
  49. <view class="tui-tool-item" @tap="navigateTo('/pagesA/my/fx/setagentcode')">
  50. <view class="tui-icon-box">
  51. <tui-icon name="attestation" :size="28" color="#333333"></tui-icon>
  52. </view>
  53. <view class="tui-tool-text">设置邀请码</view>
  54. </view>
  55. <view class="tui-tool-item" @tap="navigateTo('/pagesA/my/fx/team')">
  56. <view class="tui-icon-box">
  57. <image src="/static/images/mall/my/sub_account.png" class="tui-tool-icon"></image>
  58. </view>
  59. <view class="tui-tool-text">我的团队</view>
  60. </view>
  61. <view class="tui-tool-item" @tap="navigateTo('/pagesA/my/fx/commisionlog')">
  62. <view class="tui-icon-box">
  63. <image src="/static/images/mall/my/icon_ticket_3x.png" class="tui-tool-icon"></image>
  64. </view>
  65. <view class="tui-tool-text">返佣明细</view>
  66. </view>
  67. <view class="tui-tool-item" @tap="navigateTo('/pagesA/my/fx/teamOrder')">
  68. <view class="tui-icon-box">
  69. <image src="/static/images/mall/my/icon_kaipiao_3x.png" class="tui-tool-icon"></image>
  70. </view>
  71. <view class="tui-tool-text">分佣订单</view>
  72. </view>
  73. <view class="tui-tool-item" @tap="navigateTo('/pagesA/my/withdraw/withdrawlog?mo=agent')">
  74. <view class="tui-icon-box">
  75. <image src="/static/images/mall/my/icon_zhihuan_3x.png" class="tui-tool-icon"></image>
  76. </view>
  77. <view class="tui-tool-text">提现记录</view>
  78. </view>
  79. <view v-if="agentinfo.is_submitaudit!=1" class="tui-tool-item" @tap="navigateTo('/pagesA/my/withdraw/withdraw?mo=agent')">
  80. <view class="tui-icon-box">
  81. <image src="/static/images/mall/my/icon_fanxian_3x.png" class="tui-tool-icon"></image>
  82. </view>
  83. <view class="tui-tool-text">提现</view>
  84. </view>
  85. <view v-if="agentinfo.is_submitaudit!=1" class="tui-tool-item" @tap="navigateTo('/pagesA/my/memberbankcard/memberbankcard')">
  86. <view class="tui-icon-box">
  87. <image src="/static/images/mall/my/myCoupon.png" class="tui-tool-icon"></image>
  88. </view>
  89. <view class="tui-tool-text">提现帐号</view>
  90. </view>
  91. </view>
  92. </view>
  93. <!--为你推荐-->
  94. <block v-if="recommendgoods.length>0">
  95. <tui-divider :size="28" :bold="true" color="#333" width="50%">猜你喜欢</tui-divider>
  96. <view class="tui-product-list">
  97. <view class="tui-product-container">
  98. <block v-for="(item, index) in recommendgoods" :key="index">
  99. <!--商品列表-->
  100. <view class="tui-pro-item" hover-class="hover" :hover-start-time="150"
  101. @tap="navigateTo('/pages/goodsDetail/goodsDetail?id='+item.id)">
  102. <image :src="item.pic" class="tui-pro-img" mode="widthFix" />
  103. <view class="tui-pro-content">
  104. <view class="tui-pro-tit">{{ item.name }}</view>
  105. <view>
  106. <view class="tui-pro-price">
  107. <text v-if="item.is_points_goods==1" class="tui-sale-price">{{lang.points}}:{{ item.pay_points }}</text>
  108. <text v-if="item.is_points_goods!=1" class="tui-sale-price">¥{{ item.price }}</text>
  109. <text v-if="item.costs>0" class="tui-factory-price">¥{{ item.costs }}</text>
  110. </view>
  111. <view class="tui-pro-pay">{{ item.sale_count }}人付款</view>
  112. </view>
  113. </view>
  114. </view>
  115. </block>
  116. </view>
  117. </view>
  118. </block>
  119. </view>
  120. </view>
  121. </template>
  122. <script>
  123. export default {
  124. data() {
  125. return {
  126. lang:{},
  127. top: 0, //标题图标距离顶部距离
  128. opacity: 0,
  129. scrollTop: 0.5,
  130. agentinfo: [],
  131. recommendgoods: []
  132. };
  133. },
  134. onLoad: function(options) {
  135. let _this = this;
  136. let obj = {};
  137. // #ifdef MP-WEIXIN
  138. obj = wx.getMenuButtonBoundingClientRect();
  139. // #endif
  140. // #ifdef MP-BAIDU
  141. obj = swan.getMenuButtonBoundingClientRect();
  142. // #endif
  143. // #ifdef MP-ALIPAY
  144. my.hideAddToDesktopMenu();
  145. // #endif
  146. uni.getSystemInfo({
  147. success: res => {
  148. this.width = obj.left || res.windowWidth;
  149. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44;
  150. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6;
  151. this.scrollH = res.windowWidth * 0.6;
  152. }
  153. });
  154. _this.$request.get('Lang.getlang').then(res => {
  155. if (res.errno == 0) {
  156. _this.lang = res.data;
  157. }
  158. });
  159. _this.$request.get('Goods.recommend').then(res => {
  160. if (res.errno == 0) {
  161. _this.recommendgoods = res.data;
  162. }
  163. });
  164. },
  165. onShow() {
  166. let _this = this;
  167. _this.$request.get('agent.check', {
  168. samkey: (new Date()).valueOf()
  169. }).then(res => {
  170. if (res.errno == 0) {
  171. if(!res.data.id){
  172. uni.showModal({
  173. title: '提示',
  174. content: res.msg,
  175. showCancel: false,
  176. //是否显示取消按钮
  177. success: function (res) {
  178. if (res.cancel) {//点击取消,默认隐藏弹框
  179. } else {
  180. _this.sam.navigateTo("/pages/login/reg?ptype=agent");
  181. }
  182. }
  183. });
  184. }else{
  185. _this.agentinfo = res.data;
  186. }
  187. }
  188. });
  189. },
  190. methods: {
  191. navigateTo(url) {
  192. uni.navigateTo({
  193. url: url
  194. });
  195. },
  196. initNavigation(e) {
  197. this.opacity = e.opacity;
  198. this.top = e.top;
  199. },
  200. opacityChange(e) {
  201. this.opacity = e.opacity;
  202. }
  203. },
  204. onPageScroll(e) {
  205. this.scrollTop = e.scrollTop;
  206. },
  207. onPullDownRefresh() {
  208. setTimeout(() => {
  209. uni.stopPullDownRefresh();
  210. }, 200);
  211. },
  212. onReachBottom: function() {
  213. }
  214. };
  215. </script>
  216. <style>
  217. .tui-set-box {
  218. display: flex;
  219. align-items: center;
  220. justify-content: space-between;
  221. }
  222. .tui-icon-box {
  223. position: relative;
  224. }
  225. .tui-icon-setup {
  226. margin-left: 8rpx;
  227. }
  228. .tui-badge {
  229. position: absolute;
  230. font-size: 24rpx;
  231. height: 32rpx;
  232. min-width: 20rpx;
  233. padding: 0 6rpx;
  234. border-radius: 40rpx;
  235. right: 10rpx;
  236. top: -5rpx;
  237. transform: scale(0.8) translateX(60%);
  238. transform-origin: center center;
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. z-index: 10;
  243. }
  244. .tui-badge-red {
  245. background: #f74d54;
  246. color: #fff;
  247. }
  248. .tui-badge-white {
  249. background: #fff;
  250. color: #f74d54;
  251. }
  252. .tui-badge-dot {
  253. position: absolute;
  254. height: 12rpx;
  255. width: 12rpx;
  256. border-radius: 50%;
  257. right: -12rpx;
  258. top: 0;
  259. background: #f74d54;
  260. }
  261. .tui-mybg-box {
  262. width: 100%;
  263. height: 264rpx;
  264. position: relative;
  265. background-color: #e41f19;
  266. }
  267. .tui-my-bg {
  268. width: 100%;
  269. height: 464rpx;
  270. display: block;
  271. }
  272. .tui-header-center {
  273. position: absolute;
  274. width: 100%;
  275. height: 128rpx;
  276. left: 0;
  277. top: 18rpx;
  278. padding: 0 30rpx;
  279. box-sizing: border-box;
  280. display: flex;
  281. align-items: center;
  282. }
  283. .tui-avatar {
  284. flex-shrink: 0;
  285. width: 128rpx;
  286. height: 128rpx;
  287. border-radius: 50%;
  288. display: block;
  289. }
  290. .tui-info {
  291. width: 60%;
  292. padding-left: 30rpx;
  293. }
  294. .tui-nickname {
  295. font-size: 30rpx;
  296. font-weight: 500;
  297. color: #fff;
  298. display: flex;
  299. align-items: center;
  300. }
  301. .tui-img-vip {
  302. width: 56rpx;
  303. height: 24rpx;
  304. margin-left: 18rpx;
  305. }
  306. .tui-explain {
  307. width: 80%;
  308. font-size: 24rpx;
  309. font-weight: 400;
  310. color: #fff;
  311. opacity: 0.75;
  312. padding-top: 8rpx;
  313. white-space: nowrap;
  314. overflow: hidden;
  315. text-overflow: ellipsis;
  316. }
  317. .tui-btn-edit {
  318. flex-shrink: 0;
  319. padding-right: 22rpx;
  320. }
  321. .tui-header-btm {
  322. width: 100%;
  323. padding: 0 30rpx;
  324. box-sizing: border-box;
  325. position: absolute;
  326. left: 0;
  327. top: 280rpx;
  328. display: flex;
  329. align-items: center;
  330. justify-content: space-between;
  331. color: #fff;
  332. }
  333. .tui-btm-item {
  334. flex: 1;
  335. display: flex;
  336. flex-direction: column;
  337. align-items: center;
  338. justify-content: center;
  339. }
  340. .tui-btm-num {
  341. font-size: 32rpx;
  342. font-weight: 600;
  343. position: relative;
  344. }
  345. .tui-btm-text {
  346. font-size: 24rpx;
  347. opacity: 0.85;
  348. padding-top: 4rpx;
  349. }
  350. .tui-content-box {
  351. width: 100%;
  352. padding: 0 30rpx;
  353. box-sizing: border-box;
  354. position: relative;
  355. top: -100rpx;
  356. z-index: 10;
  357. }
  358. .tui-box {
  359. width: 100%;
  360. background: #fff;
  361. box-shadow: 0 3rpx 20rpx rgba(183, 183, 183, 0.1);
  362. border-radius: 30rpx;
  363. overflow: hidden;
  364. }
  365. .tui-order-box {
  366. height: 208rpx;
  367. }
  368. .tui-cell-header {
  369. width: 100%;
  370. height: 74rpx;
  371. padding: 0 26rpx;
  372. box-sizing: border-box;
  373. display: flex;
  374. align-items: center;
  375. justify-content: space-between;
  376. }
  377. .tui-cell-title {
  378. font-size: 30rpx;
  379. line-height: 30rpx;
  380. font-weight: 600;
  381. color: #333;
  382. }
  383. .tui-cell-sub {
  384. font-size: 26rpx;
  385. font-weight: 400;
  386. color: #999;
  387. padding-right: 28rpx;
  388. }
  389. .tui-order-list {
  390. width: 100%;
  391. height: 134rpx;
  392. padding: 0 30rpx;
  393. box-sizing: border-box;
  394. display: flex;
  395. align-items: center;
  396. }
  397. .tui-order-item {
  398. flex: 1;
  399. display: flex;
  400. flex-direction: column;
  401. align-items: center;
  402. }
  403. .tui-order-text,
  404. .tui-tool-text {
  405. font-size: 26rpx;
  406. font-weight: 400;
  407. color: #666;
  408. padding-top: 4rpx;
  409. }
  410. .tui-tool-text {
  411. font-size: 24rpx;
  412. }
  413. .tui-order-icon {
  414. width: 56rpx;
  415. height: 56rpx;
  416. display: block;
  417. }
  418. .tui-assets-box {
  419. height: 178rpx;
  420. margin-top: 20rpx;
  421. }
  422. .tui-assets-list {
  423. height: 84rpx;
  424. }
  425. .tui-assets-num {
  426. font-size: 38rpx;
  427. font-weight: 500;
  428. color: #333;
  429. font-weight: bold;
  430. position: relative;
  431. }
  432. .tui-assets-text {
  433. font-size: 24rpx;
  434. font-weight: 400;
  435. color: #666;
  436. padding-top: 6rpx;
  437. }
  438. .tui-tool-box {
  439. margin-top: 20rpx;
  440. }
  441. .tui-flex-wrap {
  442. flex-wrap: wrap;
  443. height: auto;
  444. padding-bottom: 30rpx;
  445. }
  446. .tui-tool-item {
  447. width: 25%;
  448. display: flex;
  449. align-items: center;
  450. justify-content: center;
  451. flex-direction: column;
  452. padding-top: 30rpx;
  453. }
  454. .tui-tool-icon {
  455. width: 64rpx;
  456. height: 64rpx;
  457. display: block;
  458. }
  459. .tui-badge-icon {
  460. width: 66rpx;
  461. height: 30rpx;
  462. position: absolute;
  463. right: 0;
  464. transform: translateX(88%);
  465. top: -15rpx;
  466. }
  467. /*为你推荐*/
  468. .tui-product-list {
  469. display: flex;
  470. justify-content: space-between;
  471. flex-direction: row;
  472. flex-wrap: wrap;
  473. box-sizing: border-box;
  474. }
  475. .tui-product-container {
  476. width: 100%;
  477. display: flex;
  478. flex-direction: row;
  479. flex-wrap: wrap;
  480. }
  481. .tui-pro-item {
  482. background: #fff;
  483. box-sizing: border-box;
  484. overflow: hidden;
  485. border-radius: 12rpx;
  486. width: 48%;
  487. margin-left: 1%;
  488. margin-right: 1%;
  489. margin-bottom: 2%;
  490. }
  491. .tui-pro-img {
  492. width: 100%;
  493. display: block;
  494. }
  495. .tui-pro-content {
  496. display: flex;
  497. flex-direction: column;
  498. justify-content: space-between;
  499. box-sizing: border-box;
  500. padding: 20rpx;
  501. }
  502. .tui-pro-tit {
  503. color: #2e2e2e;
  504. font-size: 26rpx;
  505. word-break: break-all;
  506. overflow: hidden;
  507. text-overflow: ellipsis;
  508. display: -webkit-box;
  509. -webkit-box-orient: vertical;
  510. -webkit-line-clamp: 2;
  511. }
  512. .tui-pro-price {
  513. padding-top: 18rpx;
  514. }
  515. .tui-sale-price {
  516. font-size: 34rpx;
  517. font-weight: 500;
  518. color: #e41f19;
  519. }
  520. .tui-factory-price {
  521. font-size: 24rpx;
  522. color: #a0a0a0;
  523. text-decoration: line-through;
  524. padding-left: 12rpx;
  525. }
  526. .tui-pro-pay {
  527. padding-top: 10rpx;
  528. font-size: 24rpx;
  529. color: #656565;
  530. }
  531. </style>