index.vue 7.2 KB

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