init.vue 5.2 KB

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