index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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: 5,
  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. //#ifndef MP
  109. toLogin();
  110. //#endif
  111. //#ifdef MP
  112. this.isShowAuth = true;
  113. //#endif
  114. }
  115. },
  116. onShow() {
  117. uni.removeStorageSync('form_type_cart');
  118. },
  119. methods: {
  120. searchSubmitValue(e) {
  121. this.keyword = e ? e.detail.value : ''
  122. this.page = 1;
  123. this.limit = 20;
  124. this.status = false;
  125. this.$set(this, 'recordList', []);
  126. this.$set(this, 'times', []);
  127. this.getRecordOrderList()
  128. },
  129. changeTime(time) {
  130. this.start = time.start
  131. this.stop = time.stop
  132. this.searchSubmitValue()
  133. },
  134. onLoadFun() {
  135. this.getRecordOrderList();
  136. this.isShowAuth = false
  137. },
  138. // 授权关闭
  139. authColse: function(e) {
  140. this.isShowAuth = e
  141. },
  142. getRecordOrderList() {
  143. let that = this;
  144. let page = that.page;
  145. let limit = that.limit;
  146. let status = that.status;
  147. if (that.loading) return
  148. if (status == true) return;
  149. that.loading = true;
  150. spreadOrder({
  151. start: this.start,
  152. stop: this.stop,
  153. keyword: this.keyword,
  154. page: page,
  155. limit: limit
  156. }).then(res => {
  157. this.total = res.data.count;
  158. this.sum_brokerage = res.data.sum_brokerage;
  159. for (let i = 0; i < res.data.time.length; i++) {
  160. if (!this.times.includes(res.data.time[i].time)) {
  161. this.times.push(res.data.time[i].time)
  162. this.recordList.push({
  163. time: res.data.time[i].time,
  164. count: res.data.time[i].count,
  165. child: []
  166. })
  167. }
  168. }
  169. for (let x = 0; x < this.times.length; x++) {
  170. for (let j = 0; j < res.data.list.length; j++) {
  171. if (this.times[x] === res.data.list[j].time_key) {
  172. this.recordList[x].child.push(res.data.list[j])
  173. }
  174. }
  175. }
  176. that.count = res.data.count || 0;
  177. that.status = res.data.list.length < 5;
  178. that.page += 1;
  179. that.loading = false;
  180. }).catch(err=>{
  181. that.loading = false;
  182. });
  183. }
  184. },
  185. onReachBottom: function() {
  186. this.getRecordOrderList();
  187. }
  188. }
  189. </script>
  190. <style scoped lang="scss">
  191. .sys-title {
  192. z-index: 10;
  193. position: relative;
  194. height: 40px;
  195. line-height: 40px;
  196. font-size: 30rpx;
  197. color: #fff;
  198. background-color: var(--view-theme);
  199. // #ifdef MP || APP-PLUS
  200. text-align: center;
  201. // #endif
  202. }
  203. .sys-head {
  204. background-color: #fff;
  205. }
  206. .promoter-order .header {
  207. width: 100%;
  208. height: 96rpx;
  209. background-color: var(--view-theme);
  210. border-bottom: 1rpx solid #f5f5f5;
  211. }
  212. .promoter-order .header .input {
  213. width: 700rpx;
  214. height: 60rpx;
  215. background-color: #f5f5f5;
  216. border-radius: 50rpx;
  217. box-sizing: border-box;
  218. padding: 0 25rpx;
  219. }
  220. .promoter-order .header .input .iconfont {
  221. font-size: 35rpx;
  222. color: #555;
  223. }
  224. .promoter-order .header .input .placeholder {
  225. color: #999;
  226. }
  227. .promoter-order .header .input input {
  228. font-size: 26rpx;
  229. height: 100%;
  230. width: 597rpx;
  231. }
  232. .promoter-order .list .item .title {
  233. height: 133rpx;
  234. padding: 0 30rpx;
  235. font-size: 26rpx;
  236. color: #999;
  237. }
  238. .promoter-order .list .item .title .data {
  239. font-size: 28rpx;
  240. color: #282828;
  241. margin-bottom: 5rpx;
  242. }
  243. .promoter-order .list .item .listn .itenm {
  244. background-color: #fff;
  245. margin: 20rpx 30rpx;
  246. border-radius: 14rpx;
  247. }
  248. .promoter-order .list .item .listn .itenm~.itenm {
  249. margin-top: 12rpx;
  250. }
  251. .promoter-order .list .item .listn .itenm .top {
  252. margin-left: 30rpx;
  253. padding-right: 30rpx;
  254. border-bottom: 1rpx solid #eee;
  255. height: 100rpx;
  256. }
  257. .promoter-order .list .item .listn .itenm .top .pictxt {
  258. width: 320rpx;
  259. }
  260. .promoter-order .list .item .listn .itenm .top .pictxt .text {
  261. width: 230rpx;
  262. font-size: 30rpx;
  263. color: #282828;
  264. }
  265. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
  266. width: 66rpx;
  267. height: 66rpx;
  268. }
  269. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
  270. width: 100%;
  271. height: 100%;
  272. border-radius: 50%;
  273. border: 3rpx solid #fff;
  274. box-sizing: border-box;
  275. }
  276. .promoter-order .list .item .listn .itenm .top .money {
  277. font-size: 28rpx;
  278. }
  279. .promoter-order .list .item .listn .itenm .bottom {
  280. padding: 20rpx 30rpx;
  281. font-size: 28rpx;
  282. color: #666;
  283. line-height: 1.6;
  284. .msg{
  285. display: flex;
  286. align-items: center;
  287. }
  288. }
  289. .promoter-order .list .item .listn .itenm .bottom .name {
  290. color: #999999;
  291. }
  292. .promoter-order .list .item .listn .itenm .bottom .store_name {
  293. width: 450rpx;
  294. color: #666666;
  295. }
  296. .top_num{
  297. padding: 30rpx 30rpx 0;
  298. font-size: 26rpx;
  299. color: #666;
  300. }
  301. .main_color{
  302. color: #E93323;
  303. }
  304. </style>