income.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <view class="app">
  3. <view class="header">
  4. <view class="header_inner">
  5. <image src="../../static/order/clock.png"></image>
  6. <text class="txt1">累计收益<text class="txt2">{{ countIncome }}</text></text>
  7. </view>
  8. <view class="tip"></view>
  9. </view>
  10. <view class="goods" v-for="(item, index) in list" :key="index">
  11. <view class="goods_tit">
  12. <text class="txt3">订单号:{{ item.orderNo }}</text>
  13. <text class="txt4" style="font-size: small;">配送费:{{ item.freightPrice }} 元</text>
  14. </view>
  15. <view class="count">
  16. <view class="count_item">
  17. <text class="txt3">配送时间</text>
  18. <text class="txt4">{{ item.finishTime }}</text>
  19. </view>
  20. <view class="count_item">
  21. <text class="txt3">收货地址</text>
  22. <text class="txt4">{{ item.address }}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import uniPopup from "@/components/uni-popup/uni-popup.vue";
  30. import {
  31. mapState,
  32. mapMutations
  33. } from 'vuex';
  34. export default {
  35. components: {
  36. uniPopup
  37. },
  38. computed: {
  39. ...mapState(['token', 'userInfo'])
  40. },
  41. data() {
  42. return {
  43. count:0,
  44. list: [], // 任务列表
  45. pageNo:1, // 页码
  46. pageSize: 10, // 页数
  47. loadData: false,// 列表加载中
  48. finish: false, // 列表全部加载完成
  49. countIncome: 0
  50. }
  51. },
  52. onLoad() {
  53. this.selectMoney()
  54. },
  55. onHide() {
  56. clearInterval(this.interval)
  57. },
  58. //上拉加载
  59. onReachBottom() {
  60. let that = this;
  61. if(that.userInfo.state && !that.finish){
  62. uni.showNavigationBarLoading()
  63. this.selectMoney()
  64. }
  65. },
  66. methods: {
  67. closePop(){
  68. this.$refs.popup.close()
  69. },
  70. open() {
  71. this.$refs.popup.open()
  72. },
  73. copy(msg){
  74. uni.setClipboardData({
  75. data: msg,
  76. success: function () {
  77. uni.showToast({
  78. title:'复制成功',
  79. icon:'none',
  80. duration:1500
  81. })
  82. }
  83. });
  84. },
  85. selectMoney() {
  86. let that = this;
  87. let params = {
  88. riderId: that.userInfo.id,
  89. pageNum: this.pageNo,
  90. limit: this.pageSize
  91. }
  92. that.request("get","rider/task/income", that.token,params).then(res => {
  93. if (res.code == 200) {
  94. let newList = res.rows;
  95. newList.forEach(item => {
  96. if(item.gmtUpdate) {
  97. if(typeof(item.gmtUpdate) === 'number'){
  98. item.finishTime = that.dateFtt('yyyy-MM-dd hh:mm:ss', new Date(item.gmtUpdate))
  99. }
  100. }
  101. })
  102. that.list = that.list.concat(newList);
  103. that.finish = newList.length <= res.total;
  104. if(newList.length !== 0){
  105. that.pageNo++;
  106. }
  107. that.loadData = false; // 获取结束
  108. }else {
  109. that.loadData = false; // 获取结束
  110. }
  111. })
  112. that.request("get","rider/task/countIncome",that.token,params).then(res => {
  113. if (res.code == 200) {
  114. this.countIncome = res.data;
  115. }
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped>
  122. scroll-view {
  123. white-space: nowrap;
  124. height: 110rpx;
  125. width: 100%;
  126. margin-top: 42rpx;
  127. box-sizing: border-box;
  128. }
  129. .popup_mask{
  130. width: 690rpx;
  131. padding: 0 30rpx;
  132. height: 500rpx;
  133. background-color: #FFFFFF;
  134. border-top-left-radius: 24rpx;
  135. border-top-right-radius: 24rpx;
  136. padding-bottom: 6rpx;
  137. }
  138. .popup_mask_tit{
  139. height: 104rpx;
  140. line-height: 104rpx;
  141. position: relative;
  142. }
  143. .pop_t1{
  144. font-size: 32rpx;
  145. color: #333333;
  146. font-weight: bold;
  147. }
  148. .pop_t2{
  149. font-size: 28rpx;
  150. color: #1B1C33;
  151. margin-left: 40rpx;
  152. }
  153. .popup_mask_tit image{
  154. width: 30rpx;
  155. height: 30rpx;
  156. position: absolute;
  157. right: 20rpx;
  158. top: 38rpx;
  159. }
  160. .pop_item{
  161. height: 184rpx;
  162. border-bottom: 2rpx solid #F1F1F1;
  163. display: flex;
  164. flex-direction: row;
  165. }
  166. .pop_item_l{
  167. width: 520rpx;
  168. height: 184rpx;
  169. display: flex;
  170. flex-direction: row;
  171. }
  172. .item_l_l{
  173. width: 168rpx;
  174. height: 148rpx;
  175. padding-top: 36rpx;
  176. }
  177. .item_l_r{
  178. width: 452rpx;
  179. height: 148rpx;
  180. padding-top: 36rpx;
  181. }
  182. .pop_item_r{
  183. width: 150rpx;
  184. height: 148rpx;
  185. padding-top: 36rpx;
  186. font-size: 32rpx;
  187. color: #333333;
  188. font-weight: bold;
  189. text-align: right;
  190. }
  191. .pil_img{
  192. width: 118rpx;
  193. height: 110rpx;
  194. }
  195. .item_l_r view{
  196. font-size: 32rpx;
  197. color: #333333;
  198. }
  199. .test {
  200. width: 220upx;
  201. height: 220upx;
  202. display: inline-block;
  203. background-color: red;
  204. }
  205. .app {
  206. background-color: #F6F6F6;
  207. }
  208. .header {
  209. text-align: center;
  210. background-color: #FFFFFF;
  211. }
  212. .header_inner {
  213. display: inline-block;
  214. padding-top: 90rpx;
  215. }
  216. .header_inner image {
  217. width: 48rpx;
  218. height: 48rpx;
  219. position: relative;
  220. top: 8rpx;
  221. }
  222. .txt1 {
  223. font-size: 40rpx;
  224. color: #000000;
  225. font-weight: bold;
  226. margin-left: 24rpx;
  227. }
  228. .txt2 {
  229. color: #3662DD;
  230. padding-left: 20rpx;
  231. }
  232. .tip {
  233. text-align: center;
  234. font-size: 32rpx;
  235. color: #717171;
  236. padding-top: 24rpx;
  237. padding-bottom: 70rpx;
  238. }
  239. .goods {
  240. margin-top: 20rpx;
  241. background-color: #FFFFFF;
  242. padding: 0 30rpx;
  243. }
  244. .goods_tit {
  245. height: 86rpx;
  246. line-height: 86rpx;
  247. border-bottom: 2rpx solid #F1F1F1;
  248. font-size: 28rpx;
  249. color: #333333;
  250. font-weight: bold;
  251. }
  252. .goods_details {
  253. height: 194rpx;
  254. display: flex;
  255. flex-direction: row;
  256. }
  257. .detials_l {
  258. width: 496rpx;
  259. height: 194rpx;
  260. }
  261. .detials_r {
  262. width: 174rpx;
  263. height: 194rpx;
  264. }
  265. .details_img {
  266. display: inline-block;
  267. width: 118rpx;
  268. height: 110rpx;
  269. margin-right: 36rpx;
  270. }
  271. .detials_r_inner {
  272. height: 110rpx;
  273. margin-top: 42rpx;
  274. line-height: 110rpx;
  275. font-size: 28rpx;
  276. color: #1B1C33;
  277. position: relative;
  278. }
  279. .detials_r_inner image {
  280. width: 44rpx;
  281. height: 10rpx;
  282. position: absolute;
  283. right: 0;
  284. top: 48rpx;
  285. }
  286. .count {
  287. margin-top: 20rpx;
  288. padding: 0 30rpx;
  289. background-color: #FFFFFF;
  290. }
  291. .count_item {
  292. height: 99rpx;
  293. line-height: 99rpx;
  294. border-bottom: 2rpx solid #F1F1F1;
  295. font-size: 28rpx;
  296. }
  297. .txt3,
  298. .txt5 {
  299. font-weight: bold;
  300. color: #333333;
  301. }
  302. .txt4 {
  303. color: #666666;
  304. float: right;
  305. }
  306. .nobor {
  307. border: none;
  308. }
  309. .txt6 {
  310. color: #999999;
  311. font-weight: normal;
  312. }
  313. .txt7 {
  314. font-weight: normal;
  315. color: #333333;
  316. }
  317. </style>