red.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='commission-details'>
  4. <view class="nav">
  5. <view class="nav-item" :class="{'action': type == 1}" @click="getYjList(1)">
  6. 原始股
  7. </view>
  8. <view class="nav-item" :class="{'action': type == 2}" @click="getYjList(2)">
  9. 分红股
  10. </view>
  11. </view>
  12. <view class='sign-record'>
  13. <view class="top_num">
  14. 分红股:{{bonus_share}} &nbsp;&nbsp;&nbsp; 原始股:{{initial_share}}
  15. </view>
  16. <view class="box">
  17. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  18. <view class='list' @click="showDetail(item)">
  19. <view class='item'>
  20. <view class='listn'>
  21. <view class='itemn1 acea-row row-between-wrapper'>
  22. <view class="flex-g">
  23. <view class="mark">
  24. {{item.content}}
  25. </view>
  26. <view>{{item.create_time}}</view>
  27. </view>
  28. <template>
  29. <view class='num font-color' v-if="item.pm == 1">+{{item.shareholding}}
  30. </view>
  31. <view class='num' v-else>-{{item.shareholding}}</view>
  32. </template>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </block>
  38. <view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length > 0">
  39. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  40. </view>
  41. <view v-if="recordList.length == 0">
  42. <emptyPage title="暂无记录~"></emptyPage>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. lst
  52. } from '@/api/shareholder.js';
  53. import {
  54. toLogin
  55. } from '@/libs/login.js';
  56. import {
  57. mapGetters
  58. } from "vuex";
  59. import emptyPage from '@/components/emptyPage.vue'
  60. import colors from '@/mixins/color.js';
  61. export default {
  62. components: {
  63. emptyPage,
  64. },
  65. mixins: [colors],
  66. data() {
  67. return {
  68. type: 1,
  69. page: 1,
  70. limit: 15,
  71. loading: false,
  72. loadend: false,
  73. loadTitle: '加载更多',
  74. recordList: [],
  75. initial_share: 0,
  76. bonus_share: 0,
  77. };
  78. },
  79. computed: mapGetters(['isLogin']),
  80. onLoad(options) {
  81. this.type = options.type||1;
  82. if (!this.isLogin) {
  83. toLogin();
  84. }
  85. },
  86. onShow: function() {
  87. this.getRecordList();
  88. },
  89. methods: {
  90. getYjList(type) {
  91. let that = this;
  92. if (type == that.type) {
  93. return
  94. }
  95. that.type = type;
  96. that.page=1;
  97. that.loading = false
  98. that.loadend = false
  99. that.recordList = []
  100. that.getRecordList()
  101. },
  102. getRecordList: function() {
  103. let that = this;
  104. let page = that.page;
  105. let limit = that.limit;
  106. let recordType = that.recordType;
  107. if (that.loading) return;
  108. if (that.loadend) return;
  109. that.loading = true;
  110. that.loadTitle = '';
  111. lst({
  112. type: that.type,
  113. page: page,
  114. limit: limit
  115. }, recordType).then(res => {
  116. this.recordList = this.recordList.concat(res.data.list)
  117. let loadend = res.data.list.length < that.limit;
  118. that.bonus_share = +res.data.bonus_share;
  119. that.initial_share = +res.data.initial_share;
  120. that.loadend = loadend;
  121. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  122. that.page += 1;
  123. that.loading = false;
  124. }).catch(err => {
  125. that.loading = false;
  126. that.loadTitle = '加载更多';
  127. })
  128. },
  129. // 显示详细
  130. showDetail(item) {
  131. console.log(item);
  132. if (this.type == 6) {
  133. if (item.recharge) {
  134. uni.showModal({
  135. title: '充值订单',
  136. content: `用户ID:${item.recharge.uid},充值${item.recharge.price}获得销售业绩`,
  137. showCancel: false,
  138. });
  139. }
  140. if (item.subscribe) {
  141. const info = item.info[0];
  142. uni.showModal({
  143. title: '服务项目',
  144. content: `订单:${item.order_name},用户:${item.real_name},项目:${info.store_name},支付金额:${info.pay_price}`,
  145. showCancel: false,
  146. });
  147. }
  148. if (item.store) {
  149. uni.showModal({
  150. title: '普通商品',
  151. content: `订单:${item.order_id},用户:${item.store.real_name},支付金额:${item.store.pay_price}获得销售业绩`,
  152. showCancel: false,
  153. });
  154. }
  155. } else {
  156. if (item.mark) {
  157. uni.showModal({
  158. title: '详细说明',
  159. content: item.mark,
  160. showCancel: false,
  161. });
  162. } else if (item.content) {
  163. uni.showModal({
  164. title: '详细说明',
  165. content: item.content,
  166. showCancel: false,
  167. });
  168. }
  169. }
  170. },
  171. navto(url) {
  172. uni.navigateTo({
  173. url
  174. })
  175. },
  176. submitForm() {
  177. this.page = 1;
  178. this.limit = 20;
  179. this.loadend = false;
  180. this.status = false;
  181. this.$set(this, 'recordList', []);
  182. this.getRecordList();
  183. },
  184. },
  185. onReachBottom: function() {
  186. this.getRecordList();
  187. }
  188. }
  189. </script>
  190. <style scoped lang="scss">
  191. .box {
  192. border-radius: 14rpx;
  193. margin: 0 30rpx;
  194. overflow: hidden;
  195. }
  196. .sign-record {
  197. margin-top: 20rpx;
  198. }
  199. .top_num {
  200. padding: 10rpx 30rpx 30rpx 30rpx;
  201. font-size: 26rpx;
  202. color: #666;
  203. }
  204. .sign-record {
  205. .list {
  206. .item {
  207. .listn {
  208. .itemn1 {
  209. border-bottom: 1rpx solid #eee;
  210. padding: 22rpx 24rpx;
  211. flex-wrap: nowrap;
  212. .flex-g {
  213. flex-grow: 1;
  214. padding-right: 30rpx;
  215. .status {
  216. font-size: 28rpx;
  217. }
  218. }
  219. .name {
  220. font-size: 28rpx;
  221. color: #282828;
  222. margin-bottom: 10rpx;
  223. }
  224. .num {
  225. font-size: 36rpx;
  226. font-family: 'Guildford Pro';
  227. color: #16ac57;
  228. &.font-color {
  229. color: #e93323 !important;
  230. }
  231. }
  232. }
  233. }
  234. }
  235. }
  236. }
  237. .mark {
  238. margin-bottom: 10rpx;
  239. }
  240. .success {
  241. background: rgba(24, 144, 255, .1);
  242. color: #1890FF;
  243. }
  244. .default {
  245. background: #f5f5f5;
  246. color: #282828;
  247. }
  248. .error {
  249. background: rgba(233, 51, 35, .1);
  250. color: #E93323;
  251. }
  252. .nav {
  253. display: flex;
  254. justify-content: space-evenly;
  255. .nav-item {
  256. width: 50%;
  257. line-height: 80rpx;
  258. text-align: center;
  259. font-size: 28rpx;
  260. background-color: #fff;
  261. }
  262. .action {
  263. color: #1890FF;
  264. font-weight: bold;
  265. border-bottom: 2px solid #1890FF;
  266. font-size: 32rpx;
  267. }
  268. }
  269. </style>