list.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. <template>
  2. <view class="container mine clearfix">
  3. <view class="tui-header-box first" :style="{ height: CustomBar + 6 + 'px' }">
  4. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 20 + 'px' }"></view>
  5. <view class="header-sit">
  6. <text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  7. <text class="header-sit-text">收款列表</text>
  8. <text class="iconfont icon-iconfonticonfontsousuo1" @click.stop="rDrawer"></text>
  9. </view>
  10. </view>
  11. <view class="tui-header-tabs day clearfix" :style="{ top: CustomBar + 6 + 'px' }">
  12. <view class="main one">
  13. <view
  14. class="main-item one"
  15. v-for="(item, index) in listTabs"
  16. :key="index"
  17. :class="{ active: currents == index }"
  18. @click="tabClick(1, index, item.type)"
  19. >
  20. <view class="text">{{ item.name }}</view>
  21. </view>
  22. </view>
  23. <view class="main day" v-if="currents == 0">
  24. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  25. <view
  26. class="main-item tab"
  27. v-for="(item, index) in listTabsType"
  28. :key="index"
  29. :class="{ tabActive: tabCurrents == index }"
  30. @click="tabClick(2, index, item.type)"
  31. >
  32. <view class="text">{{ item.name }}</view>
  33. </view>
  34. </scroll-view>
  35. </view>
  36. <view class="main day" v-if="currents == 1">
  37. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  38. <view
  39. class="main-item tab small"
  40. v-for="(item, index) in listNoTbasType"
  41. :key="index"
  42. :class="{ tabActive: tabCurrents == index }"
  43. @click="tabClick(3, index, item.type)"
  44. >
  45. <view class="text">{{ item.name }}</view>
  46. </view>
  47. </scroll-view>
  48. </view>
  49. <view class="main day" v-if="currents == 2 || currents == 3">
  50. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  51. <view
  52. class="main-item tab"
  53. v-for="(item, index) in listReturnType"
  54. :key="index"
  55. :class="{ tabActive: tabCurrents == index }"
  56. @click="tabClick(2, index, item.type)"
  57. >
  58. <view class="text">{{ item.name }}</view>
  59. </view>
  60. </scroll-view>
  61. </view>
  62. </view>
  63. <tui-skeleton
  64. v-if="skeletonShow"
  65. backgroundColor="#fafafa"
  66. borderRadius="10rpx"
  67. :isLoading="true"
  68. :loadingType="7"
  69. />
  70. <view
  71. class="user-section"
  72. v-else
  73. :style="{
  74. top: CustomBar + 105 + 'px',
  75. left: 0 + 'px'
  76. }"
  77. >
  78. <view class="header-content">
  79. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  80. <!-- 空白页 -->
  81. <empty v-if="isEmpty" :typeIndex="currents" :navbarHeight="navbarHeight"></empty>
  82. <!-- 列表 -->
  83. <view v-else class="tui-order-content">
  84. <view class="tui-order-item" v-for="(receipt, payIndex) in payList" :key="payIndex">
  85. <view class="list-title" @click.stop="receiptDetail(receipt)">
  86. <view class="list-title-t">
  87. <view class="list-title-tip">
  88. <text class="badges">{{ receipt.receiptType | formatReceiptType }}</text>
  89. <text class="badgesb" v-if="receipt.secondHandOrderFlag == 1">二手</text>
  90. <text class="badgesa" v-if="receipt.receiptType == 2 && receipt.newReceiptType">
  91. {{ receipt.newReceiptType | formatNewReceiptType }}
  92. </text>
  93. </view>
  94. <view
  95. class="list-title-num"
  96. :style="{ color: formatColor(receipt.receiptStatus) }"
  97. >{{ receipt.receiptStatusText }}</view
  98. >
  99. </view>
  100. <view class="list-title-b">
  101. 收款金额:<text class="text">¥{{ receipt.receiptAmount | NumFormat }}</text>
  102. </view>
  103. <view class="list-title-b" v-if="receipt.associateAmount">
  104. 关联金额:<text class="text">¥{{ receipt.associateAmount | NumFormat }}</text>
  105. </view>
  106. <view class="list-title-b">
  107. 收款类型:<text class="text">{{ receipt.payTypeText }}</text>
  108. </view>
  109. <view class="list-title-b">
  110. 收款时间:<text class="text">{{ receipt.receiptDate }}</text>
  111. </view>
  112. <view class="list-title-b" v-if="receipt.reviewDate">
  113. 审核时间:<text class="text">{{ receipt.reviewDate }}</text>
  114. </view>
  115. <view class="list-title-b" v-if="userName">
  116. 客户名称:<text class="text">{{ receipt.userName }}</text>
  117. </view>
  118. <template v-if="receipt.smsContent">
  119. <view class="list-title-b">收款短信:</view>
  120. <view class="list-title-b sms">
  121. <text class="text">{{ receipt.smsContent }}</text>
  122. </view>
  123. </template>
  124. </view>
  125. <button
  126. class="list-shaore"
  127. open-type="share"
  128. :data-receipt="receipt"
  129. v-if="USER_TYPE != 1 && receipt.receiptType != 3"
  130. >
  131. <text class="iconfont icon-fenxiang"></text>
  132. </button>
  133. <!-- 底部button -->
  134. <list-button
  135. ref="listButton"
  136. :status="receipt.receiptStatus"
  137. :dataInfo="receipt"
  138. v-if="handlebBtnVisible"
  139. @buttonConfirm="handButtonConfirm"
  140. >
  141. </list-button>
  142. </view>
  143. <!--加载loadding-->
  144. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  145. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text="nomoreText"></tui-nomore>
  146. <!--加载loadding-->
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <!-- 口头返佣按钮 -->
  152. <view
  153. class="tui-icon-button"
  154. v-if="currents == 2 && returnBtnVisible"
  155. @click="toNoSms('/pages/relation/return/list')"
  156. >
  157. <text class="iconfont icon-jiahao"></text>
  158. </view>
  159. <!--右抽屉-->
  160. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  161. <view class="d-container clearfix" :style="{ paddingTop: CustomBar + 10 + 'px' }">
  162. <view class="drawer-main">
  163. <view class="drawer-main-name">日期</view>
  164. <view class="drawer-main-time">
  165. <view class="drawer-main-time-input">
  166. <picker
  167. mode="date"
  168. :value="date"
  169. :start="startDate"
  170. :end="endDate"
  171. @change="bindStartDateChange"
  172. >
  173. <text class="input-text">{{ listQuery.startDate }}</text>
  174. </picker>
  175. <text class="iconfont icon-riqi"></text>
  176. </view>
  177. <view class="line">-</view>
  178. <view class="drawer-main-time-input">
  179. <picker
  180. mode="date"
  181. :value="date"
  182. :start="startDate"
  183. :end="endDate"
  184. @change="bindEndDateChange"
  185. >
  186. <text class="input-text">{{ listQuery.endDate }}</text>
  187. </picker>
  188. <text class="iconfont icon-riqi"></text>
  189. </view>
  190. </view>
  191. <view class="drawer-main-name">收款短信(全匹配)</view>
  192. <view class="drawer-main-textarea">
  193. <textarea class="textarea" placeholder="收款短信内容..." v-model="listQuery.smsContent" />
  194. </view>
  195. </view>
  196. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  197. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  198. <view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
  199. </view>
  200. </view>
  201. </tui-drawer>
  202. <!-- 弹窗 -->
  203. <tui-modal
  204. :show="modal"
  205. @click="handleClick"
  206. @cancel="hideMobel"
  207. :content="contentModalText"
  208. color="#333"
  209. :size="32"
  210. shape="circle"
  211. :maskClosable="false"
  212. />
  213. <!--设非订单款项弹窗 -->
  214. <tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel1" :custom="true" fadeIn>
  215. <view class="tui-modal-custom">
  216. <view class="tui-prompt-title">非订单款项</view>
  217. <view class="tui-prompt-textarea">
  218. <textarea
  219. :class="modal1 ? 'show' : 'none'"
  220. class="textarea"
  221. placeholder="请填写说明(必填)"
  222. v-model="noOrderReason"
  223. />
  224. </view>
  225. <view class="tui-prompt-flex">
  226. <view class="btn btn-cancel" @click="hideMobel1">取消</view>
  227. <view class="btn btn-confirm" @click="handleClick1">确定</view>
  228. </view>
  229. </view>
  230. </tui-modal>
  231. </view>
  232. </template>
  233. <script>
  234. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  235. import listButton from '@/components/cm-module/orderDetails/list-button' //按钮
  236. import modalLayer from '@/components/modal-layer'
  237. import empty from '@/components/empty'
  238. import {
  239. defaultAllTabs,
  240. defaultServiceTabs,
  241. listTabsType,
  242. listReturnType,
  243. listNoTbasType
  244. } from '@/utils/config.tabs.js'
  245. import { mapState, mapMutations } from 'vuex'
  246. const defaultListQuery = {
  247. endDate: '', //筛选结束时间
  248. pageNum: 1, //页码
  249. pageSize: 10, //每页数量
  250. receiptStatus: 0, //收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
  251. receiptType: 1, //收款款项类型:1订单款,2非订单款,3返佣款 , 5供应商退款
  252. smsContent: '', //收款短信
  253. startDate: '' //筛选开始时间
  254. }
  255. export default {
  256. components: {
  257. listButton,
  258. empty
  259. },
  260. data() {
  261. const currentDate = this.getDate({
  262. format: true
  263. })
  264. return {
  265. CustomBar: this.CustomBar, // 顶部导航栏高度
  266. isIphoneX: this.$store.state.isIphoneX,
  267. skeletonShow: true,
  268. listTabs: [], // 收款款项类型
  269. listTabsType: listTabsType, //收款状态:
  270. listReturnType: listReturnType, //收款状态:
  271. listNoTbasType: listNoTbasType, //非订单筛选类别:
  272. date: currentDate,
  273. currents: 0,
  274. tabCurrents: 0,
  275. listQuery: Object.assign({}, defaultListQuery),
  276. operateParams: {
  277. id: 0,
  278. receiptType: 0,
  279. delFlag: 0
  280. },
  281. payList: [],
  282. noOrderReason: '', //设置费订单款备注
  283. scrollTop: 0,
  284. isEmpty: false,
  285. loadding: false,
  286. pullUpOn: true,
  287. hasNextPage: false,
  288. pullFlag: true,
  289. navbarHeight: '',
  290. nomoreText: '上拉显示更多',
  291. contentModalText: '', //操作文字提示语句
  292. modal: false,
  293. modal1: false,
  294. rightDrawer: false,
  295. hanldReceipt: {}, //储存监听收款信息
  296. handleOperId: 0, //操作类型
  297. height: 64, //header高度
  298. top: 0, //标题图标距离顶部距离
  299. scrollH: 0, //滚动总高度
  300. opcity: 1
  301. }
  302. },
  303. onLoad() {
  304. let obj = {}
  305. uni.getSystemInfo({
  306. success: res => {
  307. this.width = obj.left || res.windowWidth
  308. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  309. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  310. this.scrollH = res.windowWidth * 0.6
  311. }
  312. })
  313. },
  314. computed: {
  315. ...mapState(['USER_TYPE', 'handlebBtnVisible', 'returnBtnVisible', 'handleListTabs']),
  316. startDate() {
  317. return this.getDate('start')
  318. },
  319. endDate() {
  320. return this.getDate('end')
  321. }
  322. },
  323. methods: {
  324. async initGetStotage() {
  325. this.listTabs = this.handleListTabs
  326. this.getOrderDatainit()
  327. },
  328. getOrderDatainit() {
  329. this.initListQuery()
  330. this.OrderService.orderReceiptList(this.listQuery)
  331. .then(response => {
  332. let data = response.data
  333. if (data.list && data.list.length > 0) {
  334. this.isEmpty = false
  335. this.hasNextPage = response.data.hasNextPage
  336. this.payList = data.list
  337. this.pullFlag = false
  338. setTimeout(() => {
  339. this.pullFlag = true
  340. }, 500)
  341. if (this.hasNextPage) {
  342. this.pullUpOn = false
  343. this.nomoreText = '上拉显示更多'
  344. } else {
  345. if (this.payList.length < 4) {
  346. this.pullUpOn = true
  347. this.loadding = false
  348. } else {
  349. this.pullUpOn = false
  350. this.loadding = false
  351. this.nomoreText = '已至底部'
  352. }
  353. }
  354. } else {
  355. this.isEmpty = true
  356. }
  357. this.skeletonShow = false
  358. })
  359. .catch(error => {
  360. this.$util.msg(error.msg, 2000)
  361. })
  362. },
  363. getOnReachBottomData() {
  364. //上拉加载
  365. this.listQuery.pageNum += 1
  366. this.OrderService.orderReceiptList(this.listQuery)
  367. .then(response => {
  368. let data = response.data
  369. if (data.list && data.list.length > 0) {
  370. this.hasNextPage = data.hasNextPage
  371. this.payList = this.payList.concat(data.list)
  372. this.pullFlag = false // 防上拉暴滑
  373. setTimeout(() => {
  374. this.pullFlag = true
  375. }, 500)
  376. if (this.hasNextPage) {
  377. this.pullUpOn = false
  378. this.nomoreText = '上拉显示更多'
  379. } else {
  380. this.pullUpOn = false
  381. this.loadding = false
  382. this.nomoreText = '已至底部'
  383. }
  384. }
  385. })
  386. .catch(error => {
  387. this.$util.msg(error.msg, 2000)
  388. })
  389. },
  390. receiptDetail(receipt) {
  391. switch (receipt.receiptType) {
  392. case 1: // 1:订单 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
  393. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  394. // 订单待确认
  395. this.$api.navigateTo(`/pages/relation/ordinary/index?id=${receipt.id}`)
  396. } else if (receipt.receiptStatus == 2) {
  397. // 待审核
  398. this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${receipt.id}`)
  399. } else if (receipt.receiptStatus == 3) {
  400. // 审核通过
  401. this.$api.navigateTo(`/pages/relation/ordinary/detail?id=${receipt.id}`)
  402. }
  403. break
  404. case 2: // 2:非订单
  405. this.$api.navigateTo(`/pages/relation/nonorder/detail?id=${receipt.id}`)
  406. break
  407. case 3: // 3:返佣
  408. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  409. // 返佣待确认
  410. this.$api.navigateTo(`/pages/relation/return/index?id=${receipt.id}`)
  411. } else if (receipt.receiptStatus == 2) {
  412. this.$api.navigateTo(`/pages/relation/return/detail?id=${receipt.id}`)
  413. }
  414. break
  415. case 5: // 4:供应商退款
  416. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  417. // 返佣待确认
  418. this.$api.navigateTo(`/pages/relation/refund/index?id=${receipt.id}`)
  419. } else if (receipt.receiptStatus == 2) {
  420. this.$api.navigateTo(`/pages/relation/refund/detail?id=${receipt.id}`)
  421. }
  422. break
  423. }
  424. },
  425. handButtonConfirm(data) {
  426. //获取点击操作
  427. console.log('data', data)
  428. this.handShowAlert(data.handleAction, data.receipt)
  429. },
  430. handShowAlert(handleAction, receipt) {
  431. //执行
  432. switch (handleAction.handleId) {
  433. case 0: // 作废
  434. this.contentModalText = '该款项将作废,请重新识别收款短信!'
  435. this.modal = true
  436. break
  437. case 1: // 设为普通款
  438. this.contentModalText = '确认将该款项设为普通款项?'
  439. this.modal = true
  440. break
  441. case 2: // 设为非订单款
  442. this.$api.navigateTo(`/pages/relation/nonorder/add?id=${receipt.id}`)
  443. break
  444. case 3: // 设为返佣款
  445. this.contentModalText = '确认将该款项设为返佣款项?'
  446. this.modal = true
  447. break
  448. case 4: // 设为供应商退款
  449. this.contentModalText = '确认将该款项设为供应商退款?'
  450. this.modal = true
  451. break
  452. }
  453. this.hanldReceipt = receipt
  454. this.handleOperId = handleAction.handleId
  455. },
  456. handleClick(e) {
  457. // 确定操作
  458. let index = e.index
  459. if (index == 1) {
  460. switch (this.handleOperId) {
  461. case 0: // 作废
  462. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  463. break
  464. case 1: // 设为普通款
  465. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  466. break
  467. case 3: // 设为返佣款
  468. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  469. break
  470. case 4: // 设为供应商退款
  471. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  472. break
  473. }
  474. }
  475. this.modal = false
  476. },
  477. handleClick1() {
  478. // 确认设为非订单款项
  479. console.log('handleOperId', this.handleOperId)
  480. console.log('hanldReceipt', this.hanldReceipt)
  481. if (this.noOrderReason == '') {
  482. this.$util.msg('请输入设为非订单款项说明!', 2000)
  483. return
  484. }
  485. this.modal1 = false
  486. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  487. },
  488. handReceiptConfirm(handleOperId, hanldReceipt) {
  489. //操作款项
  490. this.operateParams.id = hanldReceipt.id
  491. switch (
  492. this.handleOperId // 设置接口参数
  493. ) {
  494. case 0: // 作废
  495. this.operateParams.delFlag = 1
  496. this.operateParams.receiptType = hanldReceipt.receiptType
  497. break
  498. case 1: // 设为普通款
  499. this.operateParams.receiptType = 1
  500. break
  501. case 2: // 设为非订单款
  502. this.operateParams.receiptType = 2
  503. this.operateParams.noOrderReason = this.noOrderReason
  504. break
  505. case 3: // 设为返佣款
  506. this.operateParams.receiptType = 3
  507. break
  508. case 4: // 设为供应商退款
  509. this.operateParams.receiptType = 5
  510. break
  511. }
  512. this.OrderService.orderReceiptOperate(this.operateParams)
  513. .then(response => {
  514. this.$util.msg(response.msg, 2000, true, 'success')
  515. setTimeout(() => {
  516. this.getOrderDatainit()
  517. }, 2000)
  518. })
  519. .catch(error => {
  520. this.$util.msg(error.msg, 2000)
  521. })
  522. },
  523. handSearchConfirm() {
  524. this.getOrderDatainit()
  525. this.rightDrawer = false
  526. },
  527. hideMobel() {
  528. this.modal = false
  529. },
  530. hideMobel1() {
  531. this.modal1 = false
  532. },
  533. formatColor(state) {
  534. //设置邀请码状态亚瑟
  535. let stateColor = '',
  536. stateColorObject = {
  537. 1: '#ff7900',
  538. 2: '#4cd964',
  539. 3: '#19be6b',
  540. 4: '#ed3f14',
  541. 5: '#F74D54'
  542. }
  543. Object.keys(stateColorObject).forEach(function(key) {
  544. if (key == state) {
  545. stateColor = stateColorObject[key]
  546. }
  547. })
  548. return stateColor
  549. },
  550. getDate(type) {
  551. const date = new Date()
  552. let year = date.getFullYear()
  553. let month = date.getMonth() + 1
  554. let day = date.getDate()
  555. if (type === 'start') {
  556. year = year - 1
  557. } else if (type === 'end') {
  558. year = year + 1
  559. }
  560. month = month > 9 ? month : '0' + month
  561. day = day > 9 ? day : '0' + day
  562. return `${year}-${month}-${day}`
  563. },
  564. bindStartDateChange(event) {
  565. //开始时间
  566. this.listQuery.startDate = event.detail.value
  567. },
  568. bindEndDateChange(event) {
  569. //结束时间
  570. this.listQuery.endDate = event.detail.value
  571. },
  572. rDrawer() {
  573. //弹出抽屉
  574. this.rightDrawer = true
  575. },
  576. closeDrawer(e) {
  577. //关闭抽屉
  578. this.rightDrawer = false
  579. },
  580. tabClick(num, index, type) {
  581. switch (num) {
  582. case 1: // 订单款
  583. this.isEmpty = false
  584. this.pullUpOn = true
  585. this.currents = index
  586. this.listQuery.receiptType = type
  587. this.listQuery.receiptStatus = 0
  588. this.listQuery.startDate = ''
  589. this.listQuery.endDate = ''
  590. this.listQuery.smsContent = ''
  591. this.listQuery.newReceiptType = ''
  592. this.getOrderDatainit()
  593. this.tabCurrents = 0
  594. break
  595. case 2:
  596. this.isEmpty = false
  597. this.pullUpOn = true
  598. this.tabCurrents = index
  599. this.listQuery.startDate = ''
  600. this.listQuery.endDate = ''
  601. this.listQuery.smsContent = ''
  602. this.listQuery.receiptStatus = type
  603. this.getOrderDatainit()
  604. break
  605. case 3: // 非订单款类别选项
  606. this.isEmpty = false
  607. this.pullUpOn = true
  608. this.tabCurrents = index
  609. this.listQuery.startDate = ''
  610. this.listQuery.endDate = ''
  611. this.listQuery.smsContent = ''
  612. this.listQuery.newReceiptType = type
  613. this.getOrderDatainit()
  614. break
  615. }
  616. },
  617. toNoSms(url) {
  618. this.$api.navigateTo(url)
  619. },
  620. navBack() {
  621. uni.navigateBack({
  622. delta: 1
  623. })
  624. },
  625. initListQuery() {
  626. // 初始化
  627. this.payList = []
  628. this.loadding = true
  629. this.pullUpOn = true
  630. this.listQuery.pageNum = 1
  631. },
  632. formatReceiptType(value) {
  633. //订单状态文字和颜色
  634. var HtmlStateText = '',
  635. stateTextObject = {
  636. 1: '订单款',
  637. 2: '非订单款',
  638. 3: '返佣款',
  639. 4: '订单款或者非订单款',
  640. 5: '供应商退款'
  641. }
  642. Object.keys(stateTextObject).forEach(function(key) {
  643. if (key == value) {
  644. HtmlStateText = stateTextObject[key]
  645. }
  646. })
  647. return HtmlStateText
  648. }
  649. },
  650. onPageScroll(e) {
  651. //实时获取到滚动的值
  652. },
  653. onReachBottom() {
  654. if (this.hasNextPage) {
  655. this.loadding = true
  656. this.pullUpOn = true
  657. this.getOnReachBottomData()
  658. }
  659. },
  660. onPullDownRefresh() {
  661. setTimeout(() => {
  662. this.getOrderDatainit()
  663. uni.stopPullDownRefresh()
  664. }, 200)
  665. },
  666. onShareAppMessage(res) {
  667. //分享购买优惠券
  668. const receipt = res.target.dataset.receipt
  669. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  670. if (res.from === 'button') {
  671. // console.log('来自页面内转发按钮')
  672. return {
  673. title: `¥${receipt.receiptAmount.toFixed(2)} | ${receipt.receiptDate} | ${
  674. receipt.receiptStatusText
  675. }(${receiptTypeText})`,
  676. path: `/pages/login/login-share?id=${receipt.id}`,
  677. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  678. }
  679. }
  680. },
  681. onShow() {
  682. this.initGetStotage()
  683. }
  684. }
  685. </script>
  686. <style lang="scss">
  687. @import '@/uni.scss';
  688. page {
  689. background: #f7f7f7;
  690. }
  691. .tui-header-box {
  692. width: 100%;
  693. background: #ffffff;
  694. z-index: 999;
  695. position: fixed;
  696. top: 0;
  697. left: 0;
  698. background-size: cover;
  699. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  700. }
  701. .tui-header-tabs {
  702. width: 100%;
  703. height: auto;
  704. margin-bottom: 40rpx;
  705. padding: 20rpx;
  706. background: #4688fa;
  707. box-sizing: border-box;
  708. position: fixed;
  709. z-index: 999;
  710. border-radius: 0 0 10rpx 10rpx;
  711. &.day {
  712. background: #ffffff;
  713. padding: 20rpx 0rpx;
  714. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  715. }
  716. .title {
  717. font-size: $font-size-36;
  718. line-height: 60rpx;
  719. color: #fff;
  720. font-weight: bold;
  721. margin-bottom: 20rpx;
  722. }
  723. .main {
  724. width: 100%;
  725. height: 80rpx;
  726. &.day {
  727. height: 80rpx;
  728. box-sizing: border-box;
  729. padding: 20rpx 10rpx;
  730. border-top: 1px solid #efefef;
  731. .scroll-view_H {
  732. white-space: nowrap;
  733. width: 100%;
  734. height: 80rpx;
  735. }
  736. }
  737. &.one {
  738. }
  739. .main-item {
  740. float: left;
  741. text-align: center;
  742. color: #ffffff;
  743. box-sizing: border-box;
  744. &.one {
  745. width: 25%;
  746. .text {
  747. width: 100%;
  748. height: 80rpx;
  749. line-height: 80rpx;
  750. display: block;
  751. float: left;
  752. font-size: $font-size-28;
  753. color: #666666;
  754. text-align: center;
  755. font-weight: 600;
  756. font-family: '正楷';
  757. }
  758. }
  759. &.tab {
  760. width: 140rpx;
  761. border-radius: 30rpx;
  762. background: #f7f7f7;
  763. margin: 0 10rpx;
  764. padding: 0 20rpx;
  765. .text {
  766. width: 100%;
  767. height: 50rpx;
  768. line-height: 50rpx;
  769. display: block;
  770. float: left;
  771. font-size: $font-size-24;
  772. color: #666666;
  773. text-align: center;
  774. }
  775. &.small {
  776. width: auto;
  777. border-radius: 30rpx;
  778. background: #f7f7f7;
  779. margin: 0 5rpx;
  780. padding: 0 18rpx;
  781. .text {
  782. width: 100%;
  783. height: 50rpx;
  784. line-height: 50rpx;
  785. display: block;
  786. float: left;
  787. font-size: $font-size-22;
  788. color: #666666;
  789. text-align: center;
  790. }
  791. &.tabActive {
  792. .text {
  793. color: $btn-confirm;
  794. }
  795. }
  796. }
  797. }
  798. &.active {
  799. .text {
  800. color: $btn-confirm;
  801. font-size: $font-size-28;
  802. position: relative;
  803. &::before {
  804. content: '';
  805. width: 60rpx;
  806. height: 4rpx;
  807. background: $btn-confirm;
  808. position: absolute;
  809. left: 50%;
  810. bottom: 0;
  811. margin-left: -30rpx;
  812. }
  813. }
  814. }
  815. &.tabActive {
  816. .text {
  817. color: $btn-confirm;
  818. }
  819. }
  820. }
  821. }
  822. }
  823. .header-top {
  824. width: 100%;
  825. font-size: 16px;
  826. font-weight: 500;
  827. height: 32px;
  828. display: flex;
  829. align-items: center;
  830. justify-content: center;
  831. position: relative;
  832. padding: 0 40rpx;
  833. }
  834. .header-sit {
  835. width: 100%;
  836. box-sizing: border-box;
  837. height: 80rpx;
  838. line-height: 80rpx;
  839. box-sizing: border-box;
  840. color: #ffffff;
  841. .header-sit-text {
  842. text-align: left;
  843. font-size: $font-size-40;
  844. font-weight: 600;
  845. font-family: '正楷';
  846. }
  847. .icon-fanhui {
  848. display: block;
  849. width: 80rpx;
  850. height: 80rpx;
  851. float: left;
  852. text-align: center;
  853. line-height: 80rpx;
  854. font-size: 42rpx;
  855. }
  856. .icon-iconfonticonfontsousuo1 {
  857. font-size: 42rpx;
  858. margin-left: 30rpx;
  859. }
  860. }
  861. .mine {
  862. width: 100%;
  863. height: 100%;
  864. position: relative;
  865. }
  866. .user-section {
  867. position: absolute;
  868. width: 100%;
  869. }
  870. .header-content {
  871. width: 100%;
  872. height: auto;
  873. position: relative;
  874. background-color: #f7f7f7;
  875. .tui-header-btm {
  876. width: 100%;
  877. padding: 0 30rpx;
  878. box-sizing: border-box;
  879. display: flex;
  880. align-items: center;
  881. justify-content: space-between;
  882. color: #fff;
  883. }
  884. .tui-btm-item {
  885. flex: 1;
  886. display: flex;
  887. flex-direction: column;
  888. align-items: center;
  889. justify-content: center;
  890. }
  891. .tui-btm-num {
  892. font-size: 32rpx;
  893. font-weight: 600;
  894. position: relative;
  895. }
  896. .tui-btm-text {
  897. font-size: 24rpx;
  898. opacity: 0.85;
  899. padding-top: 4rpx;
  900. }
  901. }
  902. .uni-badge--small {
  903. -webkit-transform: scale(0.8);
  904. -ms-transform: scale(0.8);
  905. transform: scale(0.8);
  906. -webkit-transform-origin: center center;
  907. -ms-transform-origin: center center;
  908. transform-origin: center center;
  909. }
  910. .uni-badge {
  911. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  912. -webkit-box-sizing: border-box;
  913. box-sizing: border-box;
  914. font-size: 12px;
  915. line-height: 1;
  916. display: inline-block;
  917. padding: 3px 6px;
  918. color: #333;
  919. border-radius: 100px;
  920. background-color: #f1f1f1;
  921. }
  922. .uni-badge-error {
  923. color: #fff;
  924. background-color: #dd524d;
  925. }
  926. .tui-order-list {
  927. margin-top: 24rpx;
  928. width: 100%;
  929. position: relative;
  930. box-sizing: border-box;
  931. padding: 0 20rpx;
  932. }
  933. .tui-order-content {
  934. width: 100%;
  935. height: auto;
  936. }
  937. .tui-order-item {
  938. display: flex;
  939. flex-direction: column;
  940. width: 100%;
  941. padding: 20rpx 20rpx;
  942. background: #fff;
  943. margin-bottom: 24rpx;
  944. border-radius: 10rpx;
  945. position: relative;
  946. .list-shaore {
  947. width: 80rpx;
  948. height: 80rpx;
  949. line-height: 80rpx;
  950. text-align: center;
  951. position: absolute;
  952. right: 0;
  953. top: 0;
  954. background: transparent;
  955. border-radius: 0;
  956. border: 0;
  957. margin: 0;
  958. .iconfont {
  959. font-size: 48rpx;
  960. color: $color-system;
  961. }
  962. }
  963. }
  964. .list-title {
  965. width: 100%;
  966. height: auto;
  967. .list-title-t {
  968. width: 100%;
  969. height: 50rpx;
  970. float: left;
  971. font-size: $font-size-28;
  972. padding-bottom: 10rpx;
  973. margin-bottom: 10rpx;
  974. .list-title-num {
  975. float: left;
  976. text-align: left;
  977. color: #999999;
  978. margin-left: 30rpx;
  979. line-height: 40rpx;
  980. font-size: $font-size-24;
  981. }
  982. .list-title-tip {
  983. float: left;
  984. .badges {
  985. display: block;
  986. float: left;
  987. padding: 0 15rpx;
  988. height: 36rpx;
  989. line-height: 36rpx;
  990. border-radius: 18rpx;
  991. background: #ecf5ff;
  992. font-size: $font-size-22;
  993. text-align: center;
  994. color: #409eff;
  995. }
  996. .badgesa {
  997. display: block;
  998. float: left;
  999. padding: 0 15rpx;
  1000. height: 36rpx;
  1001. line-height: 36rpx;
  1002. border-radius: 18rpx;
  1003. background: #f0f9eb;
  1004. font-size: $font-size-22;
  1005. text-align: center;
  1006. color: #67c23a;
  1007. margin-left: 24rpx;
  1008. }
  1009. .badgesb {
  1010. display: block;
  1011. float: left;
  1012. padding: 0 15rpx;
  1013. height: 36rpx;
  1014. line-height: 36rpx;
  1015. border-radius: 18rpx;
  1016. background: #f4f4f5;
  1017. font-size: $font-size-22;
  1018. text-align: center;
  1019. color: #909399;
  1020. margin-left: 24rpx;
  1021. }
  1022. }
  1023. }
  1024. .list-title-b {
  1025. width: 100%;
  1026. height: 40rpx;
  1027. float: left;
  1028. font-size: $font-size-24;
  1029. line-height: 40rpx;
  1030. color: #666666;
  1031. text-align: left;
  1032. .text {
  1033. color: #999999;
  1034. }
  1035. &.sms {
  1036. height: auto;
  1037. }
  1038. }
  1039. }
  1040. .d-container {
  1041. width: 580rpx;
  1042. padding: 80rpx 0;
  1043. .drawer-main {
  1044. width: 100%;
  1045. height: auto;
  1046. box-sizing: border-box;
  1047. float: left;
  1048. .drawer-main-name {
  1049. width: 100%;
  1050. height: 80rpx;
  1051. line-height: 80rpx;
  1052. text-align: left;
  1053. font-size: $font-size-26;
  1054. color: #333333;
  1055. box-sizing: border-box;
  1056. padding: 0 20rpx;
  1057. font-weight: bold;
  1058. }
  1059. .drawer-main-time {
  1060. width: 100%;
  1061. height: 56rpx;
  1062. box-sizing: border-box;
  1063. .line {
  1064. color: #999999;
  1065. float: left;
  1066. line-height: 56rpx;
  1067. }
  1068. .drawer-main-time-input {
  1069. width: 228rpx;
  1070. height: 56rpx;
  1071. background: #f7f7f7;
  1072. border-radius: 28rpx;
  1073. box-sizing: border-box;
  1074. padding: 0 20rpx;
  1075. line-height: 56rpx;
  1076. float: left;
  1077. margin: 0 20rpx;
  1078. position: relative;
  1079. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  1080. .input-text {
  1081. display: block;
  1082. height: 56rpx;
  1083. font-size: 26rpx;
  1084. color: #666666;
  1085. }
  1086. .icon-riqi {
  1087. color: $color-system;
  1088. display: block;
  1089. width: 40rpx;
  1090. height: 56rpx;
  1091. position: absolute;
  1092. right: 10rpx;
  1093. top: 0;
  1094. line-height: 56rpx;
  1095. }
  1096. }
  1097. }
  1098. .drawer-main-textarea {
  1099. width: 100%;
  1100. height: 160rpx;
  1101. box-sizing: border-box;
  1102. padding: 0 20rpx;
  1103. background: #ffffff;
  1104. border-radius: 8rpx;
  1105. .textarea {
  1106. width: 100%;
  1107. height: 100%;
  1108. background: #f7f7f7;
  1109. box-sizing: border-box;
  1110. padding: 20rpx 20rpx;
  1111. font-size: $font-size-24;
  1112. border-radius: 8rpx;
  1113. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  1114. }
  1115. }
  1116. }
  1117. .drawer-input {
  1118. width: 100%;
  1119. float: left;
  1120. box-sizing: border-box;
  1121. padding: 24rpx 10rpx 0 10rpx;
  1122. border: 1px solid rgba(0, 0, 0, 0.2);
  1123. border-radius: 4rpx;
  1124. position: relative;
  1125. background-color: #ffffff;
  1126. &.btn {
  1127. border: none;
  1128. display: flex;
  1129. position: fixed;
  1130. left: 0;
  1131. bottom: 0;
  1132. }
  1133. .drawer-btn {
  1134. width: 210rpx;
  1135. height: 84rpx;
  1136. border-radius: 42rpx;
  1137. background: $btn-confirm;
  1138. line-height: 84rpx;
  1139. text-align: center;
  1140. font-size: $font-size-26;
  1141. color: #ffffff;
  1142. flex: 1;
  1143. margin: 0 10rpx;
  1144. &.comfrim {
  1145. background: $btn-confirm;
  1146. }
  1147. &.clear {
  1148. background: #f7f7f7;
  1149. color: #999999;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. .tui-icon-button {
  1155. width: 80rpx;
  1156. height: 80rpx;
  1157. line-height: 80rpx;
  1158. text-align: center;
  1159. border-radius: 50%;
  1160. background: linear-gradient(45deg, #1cbbb4 0%, #0081ff 100%);
  1161. box-shadow: 0 8rpx 8rpx 0 rgba(86, 119, 252, 0.2);
  1162. position: fixed;
  1163. bottom: 120rpx;
  1164. right: 20rpx;
  1165. .icon-jiahao {
  1166. font-size: $font-size-44;
  1167. color: #ffffff;
  1168. }
  1169. }
  1170. .tui-prompt-title {
  1171. line-height: 44rpx;
  1172. text-align: center;
  1173. }
  1174. .tui-prompt-textarea {
  1175. width: 100%;
  1176. height: 160rpx;
  1177. box-sizing: border-box;
  1178. background: #f7f7f7;
  1179. border-radius: 8rpx;
  1180. padding: 15rpx 20rpx;
  1181. margin-top: 10rpx;
  1182. .textarea {
  1183. width: 100%;
  1184. height: 100%;
  1185. font-size: $font-size-26;
  1186. &.none {
  1187. display: none;
  1188. }
  1189. }
  1190. }
  1191. .tui-prompt-flex {
  1192. width: 100%;
  1193. height: 70rpx;
  1194. display: flex;
  1195. margin-top: 20rpx;
  1196. .btn {
  1197. flex: 1;
  1198. line-height: 70rpx;
  1199. font-size: $font-size-26;
  1200. text-align: center;
  1201. color: #ffffff;
  1202. border-radius: 33rpx;
  1203. margin: 0 24rpx;
  1204. &.btn-cancel {
  1205. background: #f7f7f7;
  1206. color: #999999;
  1207. }
  1208. &.btn-confirm {
  1209. background: $color-system;
  1210. }
  1211. }
  1212. }
  1213. </style>