index.vue 33 KB

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