list.vue 32 KB

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