index.vue 7.5 KB

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