index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="promoter-order">
  4. <view class='header acea-row row-center-wrapper'>
  5. <view class='acea-row row-between-wrapper input'>
  6. <text class='iconfont icon-ic_search'></text>
  7. <input type='text' placeholder='搜索商品名称' @confirm="searchSubmitValue" confirm-type='search'
  8. name="search" placeholder-class='placeholder'></input>
  9. </view>
  10. </view>
  11. <timeSlot @changeTime="changeTime"></timeSlot>
  12. <view class='list' v-if="recordList.length>0">
  13. <view class="top_num">
  14. 共 <text class="main_color">{{total}}</text> 笔订单,获得佣金<text class="main_color">¥{{sum_brokerage}}</text>
  15. </view>
  16. <block v-for="(item,index) in recordList" :key="index">
  17. <view class='item'>
  18. <view class='listn'>
  19. <block v-for="(child,indexn) in item.child" :key="indexn">
  20. <view class='itenm'>
  21. <view class='top acea-row row-between-wrapper'>
  22. <view class='pictxt acea-row row-between-wrapper'>
  23. <view class='pictrue'>
  24. <image :src='child.avatar'></image>
  25. </view>
  26. <view class='text line1'>{{child.nickname}}</view>
  27. </view>
  28. <view class="acea-row row-middle">
  29. <view class="freeze acea-row row-center-wrapper" v-if="child.is_frozen">冻结</view>
  30. <view class='money' v-if="child.type == 'brokerage'">返佣:<text
  31. class='font-color'>¥{{child.number}}</text></view>
  32. <view class='money' v-else>暂未返佣:<text
  33. class='font-color'>¥{{child.number}}</text></view>
  34. </view>
  35. </view>
  36. <view class='bottom'>
  37. <view class="msg">
  38. <text class='name'>宝贝名称:</text>
  39. <view class="store_name line1">
  40. {{child.store_name}}
  41. </view>
  42. </view>
  43. <view v-if="child.type == 'brokerage'"><text
  44. class='name'>返佣时间:{{child.time}}</text></view>
  45. <view v-else><text class='name'>下单时间:{{child.time}}</text></view>
  46. </view>
  47. </view>
  48. </block>
  49. </view>
  50. </view>
  51. </block>
  52. </view>
  53. <view class="empty" v-if="recordList.length == 0">
  54. <emptyPage title="暂无推广订单~"></emptyPage>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. spreadOrder
  62. } from '@/api/user.js';
  63. import {
  64. toLogin
  65. } from '@/libs/login.js';
  66. import {
  67. mapGetters
  68. } from "vuex";
  69. import timeSlot from '@/components/timeSlot/index.vue'
  70. import emptyPage from '@/components/emptyPage.vue'
  71. import home from '@/components/home';
  72. import colors from '@/mixins/color.js';
  73. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  74. export default {
  75. components: {
  76. emptyPage,
  77. home,
  78. timeSlot
  79. },
  80. mixins: [colors],
  81. data() {
  82. return {
  83. sysHeight: sysHeight,
  84. page: 1,
  85. limit: 10,
  86. status: false,
  87. loading: false,
  88. recordList: [],
  89. times: [],
  90. time: '',
  91. recordCount: 0,
  92. count: 0,
  93. total:0,
  94. sum_brokerage:0,
  95. keyword: '',
  96. isAuto: false, //没有授权的不会自动授权
  97. isShowAuth: false, //是否隐藏授权
  98. start: 0,
  99. stop: 0
  100. };
  101. },
  102. computed: mapGetters(['isLogin']),
  103. onLoad() {
  104. if (this.isLogin) {
  105. this.getRecordOrderList();
  106. } else {
  107. toLogin()
  108. }
  109. },
  110. onShow() {
  111. uni.removeStorageSync('form_type_cart');
  112. },
  113. methods: {
  114. searchSubmitValue(e) {
  115. this.keyword = e ? e.detail.value : ''
  116. this.page = 1;
  117. this.limit = 20;
  118. this.status = false;
  119. this.$set(this, 'recordList', []);
  120. this.$set(this, 'times', []);
  121. this.getRecordOrderList()
  122. },
  123. changeTime(time) {
  124. this.start = time.start
  125. this.stop = time.stop
  126. this.searchSubmitValue()
  127. },
  128. onLoadFun() {
  129. this.getRecordOrderList();
  130. this.isShowAuth = false
  131. },
  132. // 授权关闭
  133. authColse: function(e) {
  134. this.isShowAuth = e
  135. },
  136. getRecordOrderList() {
  137. let that = this;
  138. let page = that.page;
  139. let limit = that.limit;
  140. let status = that.status;
  141. if (that.loading) return
  142. if (status == true) return;
  143. that.loading = true;
  144. spreadOrder({
  145. start: this.start,
  146. stop: this.stop,
  147. keyword: this.keyword,
  148. page: page,
  149. limit: limit
  150. }).then(res => {
  151. this.total = res.data.count;
  152. this.sum_brokerage = res.data.sum_brokerage;
  153. for (let i = 0; i < res.data.time.length; i++) {
  154. if (!this.times.includes(res.data.time[i].time)) {
  155. this.times.push(res.data.time[i].time)
  156. this.recordList.push({
  157. time: res.data.time[i].time,
  158. count: res.data.time[i].count,
  159. child: []
  160. })
  161. }
  162. }
  163. for (let x = 0; x < this.times.length; x++) {
  164. for (let j = 0; j < res.data.list.length; j++) {
  165. if (this.times[x] === res.data.list[j].time_key) {
  166. this.recordList[x].child.push(res.data.list[j])
  167. }
  168. }
  169. }
  170. that.count = res.data.count || 0;
  171. that.status = res.data.list.length < 5;
  172. that.page += 1;
  173. that.loading = false;
  174. }).catch(err=>{
  175. that.loading = false;
  176. });
  177. }
  178. },
  179. onReachBottom: function() {
  180. this.getRecordOrderList();
  181. }
  182. }
  183. </script>
  184. <style scoped lang="scss">
  185. .empty{
  186. margin: 20rpx;
  187. }
  188. .sys-title {
  189. z-index: 10;
  190. position: relative;
  191. height: 40px;
  192. line-height: 40px;
  193. font-size: 30rpx;
  194. color: #fff;
  195. background-color: var(--view-theme);
  196. // #ifdef MP || APP-PLUS
  197. text-align: center;
  198. // #endif
  199. }
  200. .sys-head {
  201. background-color: #fff;
  202. }
  203. .promoter-order .header {
  204. width: 100%;
  205. height: 96rpx;
  206. background-color: #fff;
  207. padding-top: 24rpx;
  208. }
  209. .promoter-order .header .input {
  210. width: 710rpx;
  211. height: 72rpx;
  212. background-color: #f5f5f5;
  213. border-radius: 50rpx;
  214. box-sizing: border-box;
  215. padding: 0 32rpx;
  216. }
  217. .promoter-order .header .input .iconfont {
  218. font-size: 32rpx;
  219. color: #999;
  220. }
  221. .promoter-order .header .input .placeholder {
  222. color: #ccc;
  223. }
  224. .promoter-order .header .input input {
  225. font-size: 26rpx;
  226. height: 100%;
  227. width: 597rpx;
  228. }
  229. .promoter-order .list .item .title {
  230. height: 133rpx;
  231. padding: 0 30rpx;
  232. font-size: 26rpx;
  233. color: #999;
  234. }
  235. .promoter-order .list .item .title .data {
  236. font-size: 28rpx;
  237. color: #282828;
  238. margin-bottom: 5rpx;
  239. }
  240. .promoter-order .list .item .listn .itenm {
  241. background-color: #fff;
  242. margin: 0 20rpx 20rpx 20rpx;
  243. border-radius: 14rpx;
  244. }
  245. .promoter-order .list .item .listn .itenm~.itenm {
  246. margin-top: 12rpx;
  247. }
  248. .promoter-order .list .item .listn .itenm .top {
  249. margin-left: 20rpx;
  250. padding-right: 20rpx;
  251. border-bottom: 1rpx solid #eee;
  252. height: 128rpx;
  253. .freeze{
  254. width: 72rpx;
  255. height: 40rpx;
  256. background: #FFF1E5;
  257. border-radius: 8rpx;
  258. font-size: 24rpx;
  259. color: #FF7D00;
  260. margin-right: 16rpx;
  261. }
  262. }
  263. .promoter-order .list .item .listn .itenm .top .pictxt {
  264. width: 320rpx;
  265. }
  266. .promoter-order .list .item .listn .itenm .top .pictxt .text {
  267. width: 240rpx;
  268. font-size: 30rpx;
  269. color: #333;
  270. }
  271. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
  272. width: 64rpx;
  273. height: 64rpx;
  274. }
  275. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
  276. width: 100%;
  277. height: 100%;
  278. border-radius: 50%;
  279. }
  280. .promoter-order .list .item .listn .itenm .top .money {
  281. font-size: 28rpx;
  282. .font-color{
  283. font-size: 32rpx;
  284. font-family: "Regular";
  285. }
  286. }
  287. .promoter-order .list .item .listn .itenm .bottom {
  288. padding: 28rpx 20rpx;
  289. font-size: 28rpx;
  290. color: #666;
  291. line-height: 1.6;
  292. .msg{
  293. display: flex;
  294. align-items: center;
  295. margin-bottom: 6rpx;
  296. }
  297. }
  298. .promoter-order .list .item .listn .itenm .bottom .name {
  299. color: #999999;
  300. }
  301. .promoter-order .list .item .listn .itenm .bottom .store_name {
  302. width: 450rpx;
  303. color: #666666;
  304. }
  305. .top_num{
  306. padding: 28rpx 20rpx;
  307. font-size: 24rpx;
  308. color: #999;
  309. }
  310. .main_color{
  311. color: #E93323;
  312. margin: 0 6rpx;
  313. }
  314. </style>