promoter_order.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view>
  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' v-if="type==1">累积未结算订单</view>
  8. <view class='name' v-else>累积已结算推广订单</view>
  9. <view><text class='num'>{{recordCount || 0}}</text>单</view>
  10. </view>
  11. <view class='iconfont icon-2'>
  12. <image v-if="type==1" src="https://hy.liuniu946.com/app/img/dsh.png" mode=""></image>
  13. <image v-if="type==0" src="https://hy.liuniu946.com/app/img/ysh.png" mode=""></image>
  14. </view>
  15. </view>
  16. </view>
  17. <view class='list' v-if="recordList.length>0">
  18. <block v-for="(item,index) in recordList" :key="index">
  19. <view class='item' @click="goDetail(item)">
  20. <view class='listn'>
  21. <view class='itenm'>
  22. <view class='top acea-row row-between-wrapper'>
  23. <view class='pictxt acea-row row-between-wrapper'>
  24. <view class='pictrue'>
  25. <image v-if="item.avatar" :src='item.avatar'></image>
  26. <image v-else class="avatar" src="/static/images/f.png"></image>
  27. </view>
  28. <view class='text line1'>{{item.nickname}}</view>
  29. </view>
  30. <view class='money' v-if="type == 0 && item.number">返佣:<text
  31. class='font-color'>¥{{item.number}}</text></view>
  32. <view class='money' v-else-if="type==1 && item.maybeBrokerage">预计返佣:<text
  33. class='font-color'>¥{{item.maybeBrokerage}}</text></view>
  34. <view class='money' v-else>订单金额:<text class='font-color'>¥{{item.order_detail.pay_price}}</text>
  35. </view>
  36. </view>
  37. <view class='bottom'>
  38. <view><text class='name'>订单编号:</text>{{item.order_id}}</view>
  39. <view><text class='name'>下单时间:</text>{{item.time}}</view>
  40. </view>
  41. <view class="shop-box">
  42. <view class="title">
  43. {{item.order_info[0].cart_info.productInfo.store_name}}
  44. </view>
  45. <view class="shop-img">
  46. <image :src="item.order_info[0].cart_info.productInfo.image" mode=""></image>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </block>
  53. </view>
  54. <view v-if="recordList.length == 0">
  55. <emptyPage title="暂无推广订单~"></emptyPage>
  56. </view>
  57. </view>
  58. <!-- #ifdef MP -->
  59. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
  60. <!-- #endif -->
  61. </view>
  62. </template>
  63. <script>
  64. import {
  65. spreadOrder,
  66. spreadInfo
  67. } from '@/api/user.js';
  68. import {
  69. toLogin
  70. } from '@/libs/login.js';
  71. import {
  72. mapGetters
  73. } from "vuex";
  74. import emptyPage from '@/components/emptyPage.vue'
  75. export default {
  76. components: {
  77. emptyPage
  78. },
  79. data() {
  80. return {
  81. page: 1,
  82. limit: 8,
  83. status: false,
  84. recordList: [],
  85. recordCount: 0,
  86. userInfo: '',
  87. type: 0,
  88. statuss: 0,
  89. };
  90. },
  91. computed: mapGetters(['isLogin']),
  92. onLoad(e) {
  93. console.log(e)
  94. this.type = e.type;
  95. if(this.type == 1) {
  96. this.statuss = 0
  97. }else {
  98. this.statuss = 1
  99. }
  100. this.getRecordOrderList();
  101. },
  102. methods: {
  103. goDetail(e) {
  104. let b = e.order_detail
  105. uni.removeStorageSync('orderInfo')
  106. let arr = []
  107. e.order_info.forEach(item => {
  108. arr.push(item.cart_info)
  109. })
  110. b.cartInfo = arr
  111. uni.setStorageSync('orderInfo',b)
  112. uni.navigateTo({
  113. url: '/pages/order/orderDetail?oid=1'
  114. });
  115. },
  116. spreadInfo() {
  117. spreadInfo().then(res => {
  118. this.userInfo = res.data
  119. });
  120. },
  121. getRecordOrderList: function() {
  122. let that = this;
  123. let page = that.page;
  124. let limit = that.limit;
  125. let status = that.status;
  126. let recordList = that.recordList;
  127. let statuss = that.statuss
  128. console.log(recordList, '22222');
  129. let recordListNew = [];
  130. let lst = [];
  131. let sum = 0;
  132. if (status == true) return;
  133. spreadOrder({
  134. page: page,
  135. limit: limit,
  136. status: statuss
  137. }).then(res => {
  138. console.log(res, 'ere')
  139. let len = res.data.list ? res.data.list.length : 0;
  140. let recordListData = res.data.list;
  141. let list = res.data.list
  142. console.log(list)
  143. // for (let i = 0; i < list.length; i++) {
  144. // for (let j = 0; j < res.data.list[i].child.length; j++) {
  145. // if (res.data.list[i].child[j].type == 'pay_money' && that.type == 1) {
  146. // sum = sum + 1;
  147. // lst.push(res.data.list[i].child[j])
  148. // }
  149. // if (res.data.list[i].child[j].type == 'brokerage' && that.type == 0) {
  150. // sum = sum + 1;
  151. // lst.push(res.data.list[i].child[j])
  152. // }
  153. // }
  154. // }
  155. for(let i = 0;i<list.length;i++) {
  156. for(let j = 0; j<res.data.list[i].child.length; j++) {
  157. sum++
  158. lst.push(res.data.list[i].child[j])
  159. }
  160. }
  161. that.recordCount = sum || 0;
  162. recordListNew = recordList.concat(lst);
  163. that.status = limit > len;
  164. that.page += 1;
  165. that.$set(that, 'recordList', recordListNew);
  166. // console.log(recordListNew,'recordList');
  167. });
  168. }
  169. },
  170. onReachBottom() {
  171. this.getRecordOrderList();
  172. }
  173. }
  174. </script>
  175. <style scoped lang="scss">
  176. .iconfont image {
  177. opacity: 0.8;
  178. width: 120rpx;
  179. height: 120rpx;
  180. }
  181. .money {
  182. color: red;
  183. }
  184. .shop-box {
  185. margin-top: -20rpx;
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. // text-align: center;
  190. .title {
  191. text-overflow: ellipsis;
  192. white-space: nowrap;
  193. overflow: hidden;
  194. width: 550rpx;
  195. }
  196. .shop-img {
  197. margin-top: -80rpx;
  198. margin-right: 50rpx;
  199. width: 80rpx;
  200. height: 80rpx;
  201. border-radius: 20%;
  202. overflow: hidden;
  203. image {
  204. width: 100%;
  205. height: 100%;
  206. }
  207. }
  208. }
  209. .item {
  210. overflow: hidden;
  211. border-radius: 20rpx;
  212. margin: 10rpx;
  213. }
  214. .headerCon .name {
  215. margin-bottom: 10rpx;
  216. font-size: 32rpx;
  217. }
  218. .headerCon {
  219. padding: 20rpx;
  220. color: #fff;
  221. border-bottom-left-radius: 20rpx;
  222. border-bottom-right-radius: 20rpx;
  223. background-color: #f75022;
  224. height: 240rpx;
  225. }
  226. .promoter-order .list .item {
  227. margin-bottom: 20rpx;
  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. }
  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. box-shadow: 0 0 15rpx #aaa;
  271. }
  272. .promoter-order .list .item .listn .itenm .top .money {
  273. font-size: 28rpx;
  274. }
  275. .promoter-order .list .item .listn .itenm .bottom {
  276. padding: 20rpx 30rpx;
  277. font-size: 28rpx;
  278. color: #666;
  279. line-height: 1.6;
  280. }
  281. .promoter-order .list .item .listn .itenm .bottom .name {
  282. color: #999;
  283. }
  284. </style>