list.vue 32 KB

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