paylist.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <!-- <block v-for="(item, index) in list" :key="index">
  5. <view class="orderItem">
  6. <image class="goodImg"
  7. :src="item.type==0?item.pimage:'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/846cd1a69879ec4f551d44e87c7500bf.png'">
  8. </image>
  9. <view class="orderInfo">
  10. <view class="info1">
  11. <view>{{ item.type==0?item.pname:'提现'}}</view>
  12. <view :class="item.type==0?'color1':''">{{ item.type==0?'+'+item.money:'-'+item.money}}</view>
  13. </view>
  14. <view class="info3" v-if="item.type==0">
  15. <view>实付:¥{{ item.order_price }}</view>
  16. <view :class="true?'color1':''" v-if="item.score">+{{ item.score }}积分</view>
  17. </view>
  18. <view class="info2" v-if="item.type==0">
  19. <view>二级分销</view>
  20. </view>
  21. <view class="info2">
  22. <view >
  23. {{ parse.filterTime(item.createtime) }}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </block> -->
  29. <block v-for="(item, index) in list" :key="index">
  30. <view class="orderItem" v-if="item.type==0">
  31. <view class="info1">
  32. <view>{{ parse.filterTime(item.createtime) }}</view>
  33. <view>{{item.state==0?'未支付':item.state==1?'已支付':item.state==2?'已发货':item.state==3?'已收货':''}}</view>
  34. </view>
  35. <view class="orderinfo">
  36. <image :src="item.pimage">
  37. </image>
  38. <view class="orderdesc">
  39. <view class="desctop">
  40. <view>{{item.pname}}</view>
  41. <view >+{{item.score}}积分</view>
  42. </view>
  43. <view class="descbot">
  44. <view>购买人:{{item.nickname||''}}</view>
  45. <view>实付:¥{{item.order_price}}</view>
  46. </view>
  47. </view>
  48. </view>
  49. <block v-for="(item2,index2) in item.slist" :key="index2">
  50. <view class="ordertip" v-if="item2.lv !=-1">
  51. <view>{{item2.lv}}级分销:{{item2.nickname}} </view>
  52. <view>+{{item2.type==0?item2.num:item2.num+'积分'}}</view>
  53. </view>
  54. </block>
  55. </view>
  56. <view class="orderItem" v-if="item.type==1">
  57. <view class="info1">
  58. <view>{{ parse.filterTime(item.createtime) }}</view>
  59. </view>
  60. <view class="orderinfo1">
  61. <image
  62. src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/846cd1a69879ec4f551d44e87c7500bf.png">
  63. </image>
  64. <view class="cashtip">
  65. <view>
  66. 提现
  67. </view>
  68. <view>
  69. -{{item.money}}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </block>
  75. <view v-if="!list.length" style='color:#999;text-align:center;margin:150rpx 0;font-size:30rpx'>暂无数据</view>
  76. </view>
  77. </view>
  78. </template>
  79. <script module="parse" lang="wxs">
  80. module.exports = {
  81. filterTime: function(time) {
  82. console.log(time)
  83. var nowDate = getDate(time * 1000);
  84. var year = nowDate.getFullYear();
  85. var month = nowDate.getMonth() + 1;
  86. var date = nowDate.getDate();
  87. var hours = nowDate.getHours();
  88. var minutes = nowDate.getMinutes();
  89. var seconds = nowDate.getSeconds();
  90. month = month > 9 ? month : '0' + month;
  91. date = date > 9 ? date : '0' + date;
  92. hours = hours > 9 ? hours : '0' + hours;
  93. minutes = minutes > 9 ? minutes : '0' + minutes;
  94. seconds = seconds > 9 ? seconds : '0' + seconds;
  95. return year + '-' + month + '-' + date + " " + hours + ":" + minutes + ":" + seconds;
  96. }
  97. }
  98. </script>
  99. <script>
  100. // pages/backstage/index/index.js
  101. var app = getApp();
  102. // import { request } from '../../../utils/request.js';
  103. export default {
  104. data() {
  105. return {
  106. page: 1,
  107. pageSize: 10,
  108. list: [],
  109. loaded: false,
  110. };
  111. }
  112. /**
  113. * 生命周期函数--监听页面加载
  114. */
  115. ,
  116. onLoad: function(options) {
  117. this.getlist();
  118. },
  119. /**
  120. * 生命周期函数--监听页面初次渲染完成
  121. */
  122. onReady: function() {},
  123. /**
  124. * 生命周期函数--监听页面显示
  125. */
  126. onShow: function() {},
  127. /**
  128. * 生命周期函数--监听页面隐藏
  129. */
  130. onHide: function() {},
  131. /**
  132. * 生命周期函数--监听页面卸载
  133. */
  134. onUnload: function() {},
  135. /**
  136. * 页面相关事件处理函数--监听用户下拉动作
  137. */
  138. onPullDownRefresh: function() {
  139. this.init();
  140. this.getlist();
  141. uni.stopPullDownRefresh();
  142. },
  143. /**
  144. * 页面上拉触底事件的处理函数
  145. */
  146. onReachBottom: function() {
  147. this.loaded || this.getlist();
  148. },
  149. /**
  150. * 用户点击右上角分享
  151. */
  152. onShareAppMessage: function() {},
  153. methods: {
  154. async getlist() {
  155. var that = this;
  156. let res = await this.$api.request('/wallet/money_log', 'GET', {
  157. page: this.page,
  158. limit: this.pageSize
  159. });
  160. console.log(res)
  161. if (res) {
  162. if (res.data.length > 0) {
  163. this.list = this.list.concat(res.data);
  164. this.page++;
  165. } else {
  166. this.loaded = true
  167. this.$api.msg('没有更多数据');
  168. }
  169. }
  170. },
  171. init() {
  172. this.page = 1
  173. this.loaded = false
  174. this.list = []
  175. }
  176. }
  177. };
  178. </script>
  179. <style>
  180. page {
  181. background: #f4f5f9;
  182. }
  183. .content {
  184. margin: 26rpx;
  185. border-radius: 20rpx;
  186. }
  187. .orderItem {
  188. background: #fff;
  189. padding: 30rpx 20rpx;
  190. box-sizing: border-box;
  191. border-radius: 12rpx;
  192. margin-bottom: 24rpx;
  193. }
  194. .info1 {
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. margin-bottom: 12rpx;
  199. }
  200. .info1>view:nth-child(1) {
  201. font-size: 24rpx;
  202. color: #8E8E8E;
  203. }
  204. .info1>view:nth-child(2) {
  205. font-size: 24rpx;
  206. color: #7B9D3E;
  207. }
  208. .orderinfo {
  209. display: flex;
  210. align-items: center;
  211. padding-bottom: 36rpx;
  212. border-bottom: 1px solid #F0EDF1;
  213. }
  214. .orderinfo1 {
  215. display: flex;
  216. align-items: center;
  217. margin-top: 20rpx;
  218. }
  219. .orderinfo1>image {
  220. width: 100rpx;
  221. height: 100rpx;
  222. }
  223. .orderinfo>image {
  224. width: 100rpx;
  225. height: 100rpx;
  226. }
  227. .orderdesc {
  228. margin-left: 15rpx;
  229. flex: 1;
  230. }
  231. .desctop {
  232. display: flex;
  233. align-items: center;
  234. justify-content: space-between;
  235. margin-bottom: 10rpx;
  236. }
  237. .desctop>view:nth-child(1) {
  238. color: #010101;
  239. font-size: 28rpx;
  240. width: 280rpx;
  241. overflow: hidden;
  242. text-overflow: ellipsis;
  243. white-space: nowrap;
  244. }
  245. .desctop>view:nth-child(2) {
  246. font-size: 26rpx;
  247. font-weight: 700;
  248. color: #FB4C6F;
  249. }
  250. .descbot {
  251. display: flex;
  252. align-items: center;
  253. justify-content: space-between;
  254. }
  255. .descbot>view:nth-child(1) {
  256. color: #8E8E8E;
  257. font-size: 28rpx;
  258. width: 302rpx;
  259. overflow: hidden;
  260. text-overflow: ellipsis;
  261. white-space: nowrap;
  262. }
  263. .descbot>view:nth-child(2) {
  264. color: #8E8E8E;
  265. font-size: 24rpx;
  266. }
  267. .ordertip {
  268. margin: 20rpx 0 0;
  269. padding-left: 136rpx;
  270. box-sizing: border-box;
  271. display: flex;
  272. align-items: center;
  273. justify-content: space-between;
  274. }
  275. .ordertip>view:nth-child(1) {
  276. font-size: 24rpx;
  277. color: #8E8E8E;
  278. width: 350rpx;
  279. overflow: hidden;
  280. text-overflow: ellipsis;
  281. white-space: nowrap;
  282. }
  283. .ordertip>view:nth-child(2) {
  284. font-size: 26rpx;
  285. font-weight: 700;
  286. color: #FB4C6F;
  287. }
  288. .cashtip {
  289. flex: 1;
  290. margin-left: 14rpx;
  291. display: flex;
  292. align-items: center;
  293. justify-content: space-between;
  294. }
  295. .cashtip>view:nth-child(1) {
  296. font-size: 28rpx;
  297. color: #010101;
  298. font-weight: 700;
  299. }
  300. .cashtip>view:nth-child(2) {
  301. font-size: 26rpx;
  302. font-weight: 700;
  303. color: #010101;
  304. }
  305. </style>