capital_invite.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <view class="page hongbao-page">
  3. <view class="content">
  4. <view class="hongbao-header">
  5. <view class="hongbao-header-view">
  6. <view class="header-top">
  7. <view class="top-left">
  8. <image :src="myPhoto" class="top-left-left"></image>
  9. <view class="top-left-right">
  10. <text class="hb-name">{{my_data.nickname}}</text>
  11. <view>
  12. <text style="font-size: 24upx;color:#bebebe;margin-right:7px" @click="showTimeList">{{timeName}}</text>
  13. <text style="font-size: 10upx;color:#bebebe" class="iconfont-im icon-sanjiao"></text>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="top-right" v-if="0">
  18. <view><text>收到红包</text><text class="top-right-num">{{info.get_count}} 个</text></view>
  19. <view><text>手气最佳</text><text class="top-right-num">{{info.best_count}} 次</text></view>
  20. </view>
  21. <view class="top-right">
  22. <view><text>余额</text><text class="top-right-num">{{info.user_money}} 元</text></view>
  23. </view>
  24. </view>
  25. <view class="header-bottom">
  26. <text>总流水</text><text class="hongbao-num">¥{{info.amount}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="capital-list"
  31. v-if="list.length">
  32. <view class="capital-item"
  33. v-for="(item) in list"
  34. :key="item.id">
  35. <view class="item-left">
  36. <text class="time-msg">{{item.explain}}</text>
  37. <text class="time">{{timestampFormat(item.create_time + '')}}</text>
  38. </view>
  39. <view class="item-right">
  40. <text class="add-money"
  41. :style="{color:item.record_type == 0 ? '#e6b141' : 'black'}">{{item.record_type == 0 ? -item.money : '+'+item.money}}</text>
  42. <text class="yue">
  43. <text style="margin-right: 8rpx;">余额</text>
  44. {{item.user_money}}
  45. </text>
  46. </view>
  47. </view>
  48. <uni-load-more :status="status"></uni-load-more>
  49. </view>
  50. </view>
  51. <uni-popup ref="popup2"
  52. type="bottom">
  53. <view class="but-view">
  54. <view class="but-top-view">
  55. <view v-for="item in timeList" :key="item.id" @click="getTimeHb(item.id,item.name)">{{item.name}}</view>
  56. </view>
  57. <view class="clone-but" @click="clonePopup">取消</view>
  58. </view>
  59. </uni-popup>
  60. </view>
  61. </template>
  62. <script>
  63. import uniLoadMore from "../../../components/uni-ui/uni-load-more/uni-load-more.vue";
  64. import _get from '../../../common/_get';
  65. import uniPopup from '../../../components/uni-popup/uni-popup.vue';
  66. import _action from '../../../common/_action';
  67. import _hook from '../../../common/_hook';
  68. import _data from '../../../common/_data';
  69. export default {
  70. computed: {
  71. status () {
  72. return this.pullUp == 0 ? 'more' : (this.pullUp == 1 ? 'loading' : '')
  73. },
  74. myPhoto(){
  75. return _data.staticPhoto() + this.my_data.photo;
  76. }
  77. },
  78. data () {
  79. return {
  80. info:{
  81. amount:'0.00',
  82. best_count:'0',
  83. get_count:'0',
  84. send_count:0,
  85. user_money:0,
  86. amount:0,
  87. },
  88. my_data:{},
  89. videPoup: false,
  90. get: 1,// 代表我发出还是收到
  91. time:4,
  92. pullUp: 0, //0加载更多 1 加载中 -1 加载完成
  93. page: 1,
  94. totallPage: 1,
  95. list: [
  96. ],
  97. timeName:'近三个月',
  98. type: '12',
  99. timeList:[{id:4,name:'近三个月'},{id:1,name:'本月'},{id:2,name:'上个月'},{id:3,name:'上上个月'}]
  100. }
  101. },
  102. onLoad (options) {
  103. uni.setNavigationBarTitle({
  104. title: '推广收益'
  105. })
  106. },
  107. onShow () {
  108. let _this = this;
  109. _hook.routeSonHook();
  110. this.getCapital('down');
  111. _get.getUserInfo({});
  112. uni.$on('data_user_info',function(data){
  113. _this.my_data = data;
  114. _data.data('user_info',data)
  115. });
  116. },
  117. components: {
  118. uniLoadMore,
  119. uniPopup
  120. },
  121. onReachBottom () {
  122. let _this = this;
  123. if (_this.pullUp == 0) {
  124. _this.page++;
  125. _this.pullUp = 1;
  126. this.getCapital('up');
  127. }
  128. },
  129. onPullDownRefresh () {
  130. this.pullUp = 0; //重置下拉
  131. this.page = 1;
  132. uni.startPullDownRefresh();
  133. this.getCapital('down', function () {
  134. uni.stopPullDownRefresh();
  135. });
  136. },
  137. methods: {
  138. // 发出和收到切换
  139. getHb(type){
  140. this.get= type
  141. this.page = 1;
  142. this.getCapital('down', function () {
  143. uni.stopPullDownRefresh();
  144. });
  145. },
  146. // 时间切换
  147. getTimeHb(time,name){
  148. this.timeName = name
  149. console.log(time)
  150. this.time = time;
  151. this.page = 1;
  152. let _this = this;
  153. this.getCapital('down', function () {
  154. _this.$refs.popup2.close();
  155. });
  156. },
  157. clonePopup(){
  158. this.$refs.popup2.close()
  159. },
  160. showTimeList () {
  161. console.log(55555)
  162. this.$refs.popup2.open()
  163. },
  164. getCapital (type, cb) {
  165. let _this = this;
  166. _get.getCapitalList({ page: this.page, type: 12,get:_this.get,time:_this.time }, function (res) {
  167. _this.totallPage = res.last_page;
  168. _this.info.amount = res.info.amount
  169. _this.info.user_money = res.info.user_money
  170. if (type == 'down') {
  171. _this.list = res.data;
  172. if (cb != undefined) cb();
  173. } else {
  174. if (_this.page > _this.totallPage) {
  175. _this.pullUp = -1;
  176. } else {
  177. _this.list = _this.list.concat(res.data)
  178. _this.pullUp = 0;
  179. }
  180. }
  181. _this.clonePopup()
  182. })
  183. },
  184. timestampFormat (time) {
  185. return _action.timestampFormat(time);
  186. },
  187. }
  188. }
  189. </script>
  190. <style>
  191. /*757575*/
  192. page {
  193. background-color: white;
  194. }
  195. .hongbao-header {
  196. padding: 40upx;
  197. }
  198. .hb-name{
  199. font-weight: bold;
  200. }
  201. .hongbao-page {
  202. display: flex;
  203. flex-direction: column;
  204. }
  205. .hongbao-page .content {
  206. padding-bottom: 100upx;
  207. }
  208. .hongbao-footer {
  209. height: 100upx;
  210. border-top: 1px solid #d3cdcd;
  211. position: fixed;
  212. display: flex;
  213. justify-content: space-between;
  214. bottom: 0;
  215. left: 0;
  216. right: 0;
  217. background: #ffffff;
  218. }
  219. .but-view {
  220. display: flex;
  221. flex-direction: column;
  222. padding: 40upx;
  223. }
  224. .but-top-view {
  225. display: flex;
  226. flex-direction: column;
  227. border-radius: 12upx;
  228. overflow: hidden;
  229. }
  230. .but-top-view view {
  231. width: 100%;
  232. background: #ffffff;
  233. display: flex;
  234. justify-content: center;
  235. align-items: center;
  236. height: 80upx;
  237. border-top: 1px solid #d3cdcd;
  238. }
  239. .clone-but{
  240. width: 100%;
  241. background: #ffffff;
  242. display: flex;
  243. justify-content: center;
  244. align-items: center;
  245. height: 80upx;
  246. border-radius: 12upx;
  247. margin-top: 30upx;
  248. }
  249. .hongbao-footer view {
  250. width: 50%;
  251. display: flex;
  252. align-items: center;
  253. justify-content: center;
  254. }
  255. .hongbao-footer text {
  256. height: 100%;
  257. display: flex;
  258. align-items: center;
  259. }
  260. .hongbao-footer .active text {
  261. border-top: 2px solid red;
  262. color: red;
  263. }
  264. .header-top {
  265. display: flex;
  266. height: 100upx;
  267. justify-content: space-between;
  268. }
  269. .top-left {
  270. display: flex;
  271. }
  272. .top-left-left {
  273. display: flex;
  274. align-items: center;
  275. justify-content: center;
  276. width: 100upx;
  277. background: chartreuse;
  278. border-radius: 10upx;
  279. height: 100%;
  280. margin-right: 20upx;
  281. }
  282. .top-left-right {
  283. display: flex;
  284. flex-direction: column;
  285. }
  286. .top-right-num {
  287. color: rebeccapurple;
  288. margin-left: 10upx;
  289. }
  290. .hongbao-header-view {
  291. height: 300upx;
  292. background: #f1edec;
  293. width: 100%;
  294. border-radius: 8upx;
  295. display: flex;
  296. justify-content: space-between;
  297. flex-direction: column;
  298. padding: 40upx;
  299. box-sizing: border-box;
  300. }
  301. .header-bottom {
  302. display: flex;
  303. align-items: center;
  304. }
  305. .hongbao-num {
  306. font-size: 46upx;
  307. font-weight: bold;
  308. }
  309. .item-left,
  310. .item-right {
  311. padding-bottom: 25upx;
  312. padding-top: 30upx;
  313. }
  314. .time,
  315. .yue {
  316. color: #757575;
  317. }
  318. .content .capital-list {
  319. display: flex;
  320. flex-direction: column;
  321. padding: 0upx 0upx 120upx 40upx;
  322. }
  323. .capital-list .capital-item {
  324. display: flex;
  325. flex-direction: row;
  326. justify-content: space-between;
  327. align-items: center;
  328. border-bottom: 1px solid #f2f2f2;
  329. }
  330. .item-right .add-money {
  331. margin-bottom: 15upx;
  332. font-size: 14px;
  333. font-weight: 500;
  334. }
  335. .sub-mone {
  336. margin-bottom: 15upx;
  337. font-size: 14px;
  338. font-weight: 500;
  339. color: #e6b141;
  340. }
  341. .item-left .time-msg {
  342. margin-bottom: 15upx;
  343. font-size: 14px;
  344. font-weight: 400;
  345. }
  346. .capital-list .capital-item .item-left {
  347. display: flex;
  348. flex-direction: column;
  349. }
  350. .capital-list .capital-item .item-right {
  351. display: flex;
  352. flex-direction: column;
  353. align-items: flex-end;
  354. padding-right: 40upx;
  355. }
  356. </style>