index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="promoter-order">
  4. <view class='promoterHeader bg-color'>
  5. <view class='headerCon acea-row row-between-wrapper'>
  6. <view>
  7. <view class='name'>{{$t(`累计推广订单`)}}</view>
  8. <view><text class='num'>{{count || 0}}</text>{{$t(`单`)}}</view>
  9. </view>
  10. <view class='iconfont icon-2'></view>
  11. </view>
  12. </view>
  13. <view class='list' v-if="recordList.length>0">
  14. <block v-for="(item,index) in recordList" :key="index">
  15. <view class='item'>
  16. <view class='title acea-row row-column row-center'>
  17. <view class='data'>{{item.time}}</view>
  18. <view>{{$t(`本月累计推广订单`)}}:{{item.count || 0}}{{$t(`单`)}}</view>
  19. </view>
  20. <view class='listn'>
  21. <block v-for="(child,indexn) in item.child" :key="indexn">
  22. <view class='itenm'>
  23. <view class='top acea-row row-between-wrapper'>
  24. <view class='pictxt acea-row row-between-wrapper'>
  25. <view class='pictrue'>
  26. <image :src='child.avatar'></image>
  27. </view>
  28. <view class='text line1'>{{child.nickname}}</view>
  29. </view>
  30. <view class='money' v-if="child.type == 'brokerage'">{{$t(`返佣`)}}:<text
  31. class='font-color'>{{$t(`¥`)}}{{child.number}}</text></view>
  32. <view class='money' v-else>{{$t(`暂未返佣`)}}:<text
  33. class='font-color'>{{$t(`¥`)}}{{child.number}}</text></view>
  34. </view>
  35. <view class='bottom'>
  36. <view><text class='name'>{{$t(`订单编号`)}}:</text>{{child.order_id}}</view>
  37. <view><text class='name'>{{$t(`下单时间`)}}:</text>{{child.time}}</view>
  38. <view class="more" v-if="child.children && child.children.length"
  39. @click="open(child)">
  40. {{child.open?$t(`收起`):$t(`更多`)}}
  41. <text class="iconfont"
  42. :class="child.open?'icon-xiangshang':'icon-xiangxia'"></text>
  43. </view>
  44. </view>
  45. <view class="more-record" v-if="child.open">
  46. <view class="more-record-list" v-for="(sp,indexs) in child.children"
  47. :key="indexs">
  48. <view class="more-record-box">
  49. <view><text class='name'>{{$t(`单号`)}}:</text>{{sp.order_id}}</view>
  50. <view class='money' v-if="sp.type == 'brokerage'">{{$t(`返佣`)}}:<text
  51. class='font-color'>{{$t(`¥`)}}{{sp.number}}</text></view>
  52. <view class='money' v-else>{{$t(`暂未返佣`)}}:<text
  53. class='font-color'>{{$t(`¥`)}}{{sp.number}}</text></view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </block>
  59. </view>
  60. </view>
  61. </block>
  62. </view>
  63. <view v-if="recordList.length == 0">
  64. <emptyPage :title="$t(`暂无推广订单~`)"></emptyPage>
  65. </view>
  66. </view>
  67. <!-- #ifdef MP -->
  68. <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
  69. <!-- #endif -->
  70. <!-- #ifndef MP -->
  71. <home></home>
  72. <!-- #endif -->
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. spreadOrder,
  78. divisionOrder
  79. } from '@/api/user.js';
  80. import {
  81. toLogin
  82. } from '@/libs/login.js';
  83. import {
  84. mapGetters
  85. } from "vuex";
  86. // #ifdef MP
  87. import authorize from '@/components/Authorize';
  88. // #endif
  89. import emptyPage from '@/components/emptyPage.vue'
  90. import home from '@/components/home';
  91. import colors from '@/mixins/color.js';
  92. export default {
  93. components: {
  94. // #ifdef MP
  95. authorize,
  96. // #endif
  97. emptyPage,
  98. home
  99. },
  100. mixins: [colors],
  101. data() {
  102. return {
  103. page: 1,
  104. limit: 8,
  105. status: false,
  106. recordList: [],
  107. times: [],
  108. recordCount: 0,
  109. count: 0,
  110. orderType: 0,
  111. isAuto: false, //没有授权的不会自动授权
  112. isShowAuth: false //是否隐藏授权
  113. };
  114. },
  115. computed: mapGetters(['isLogin']),
  116. onLoad(options) {
  117. if (this.isLogin) {
  118. this.orderType = options.type || 0
  119. this.getRecordOrderList(options.type);
  120. } else {
  121. toLogin();
  122. }
  123. },
  124. methods: {
  125. open(item) {
  126. item.open = !item.open
  127. },
  128. onLoadFun() {
  129. this.getRecordOrderList();
  130. },
  131. // 授权关闭
  132. authColse: function(e) {
  133. this.isShowAuth = e
  134. },
  135. getRecordOrderList() {
  136. let that = this;
  137. let page = that.page;
  138. let limit = that.limit;
  139. let status = that.status;
  140. if (status == true) return;
  141. let fun
  142. if (this.orderType) {
  143. fun = divisionOrder
  144. uni.setNavigationBarTitle({
  145. title: that.$t(`推广订单列表`)
  146. })
  147. } else {
  148. fun = spreadOrder
  149. }
  150. fun({
  151. page: page,
  152. limit: limit
  153. }).then(res => {
  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. res.data.list[j].open = false
  168. this.recordList[x].child.push(res.data.list[j])
  169. }
  170. }
  171. }
  172. that.count = res.data.count || 0;
  173. that.status = res.data.list.length < 8;
  174. that.page += 1;
  175. });
  176. }
  177. },
  178. onReachBottom() {
  179. this.getRecordOrderList();
  180. }
  181. }
  182. </script>
  183. <style scoped lang="scss">
  184. .promoter-order .list .item .title {
  185. height: 133rpx;
  186. padding: 0 30rpx;
  187. font-size: 26rpx;
  188. color: #999;
  189. }
  190. .promoter-order .list .item .title .data {
  191. font-size: 28rpx;
  192. color: #282828;
  193. margin-bottom: 5rpx;
  194. }
  195. .promoter-order .list .item .listn .itenm {
  196. background-color: #fff;
  197. // margin: 0 $uni-index-margin-row;
  198. border-radius: 8rpx;
  199. .more-record {
  200. color: #999;
  201. font-size: 24rpx;
  202. .more-record-list {
  203. padding: 20rpx 30rpx;
  204. border-top: 1px solid #f2f2f2;
  205. .more-record-box {
  206. display: flex;
  207. justify-content: space-between;
  208. }
  209. }
  210. }
  211. }
  212. .promoter-order .list .item .listn .itenm~.itenm {
  213. margin-top: 12rpx;
  214. }
  215. .promoter-order .list .item .listn .itenm .top {
  216. margin-left: 30rpx;
  217. padding-right: 30rpx;
  218. border-bottom: 1rpx solid #eee;
  219. height: 100rpx;
  220. }
  221. .promoter-order .list .item .listn .itenm .top .pictxt {
  222. width: 320rpx;
  223. }
  224. .promoter-order .list .item .listn .itenm .top .pictxt .text {
  225. width: 230rpx;
  226. font-size: 30rpx;
  227. color: #282828;
  228. }
  229. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
  230. width: 66rpx;
  231. height: 66rpx;
  232. }
  233. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
  234. width: 100%;
  235. height: 100%;
  236. border-radius: 50%;
  237. border: 3rpx solid #fff;
  238. box-sizing: border-box;
  239. box-shadow: 0 0 15rpx #aaa;
  240. }
  241. .promoter-order .list .item .listn .itenm .top .money {
  242. font-size: 28rpx;
  243. }
  244. .promoter-order .list .item .listn .itenm .bottom {
  245. padding: 20rpx 30rpx;
  246. font-size: 28rpx;
  247. color: #666;
  248. line-height: 1.6;
  249. position: relative;
  250. .more {
  251. font-size: 24rpx;
  252. position: absolute;
  253. right: 12rpx;
  254. bottom: 24rpx;
  255. .iconfont {
  256. font-size: 22rpx;
  257. margin-left: 5rpx;
  258. }
  259. }
  260. }
  261. .promoter-order .list .item .listn .itenm .bottom .name {
  262. color: #999;
  263. }
  264. </style>