index.vue 28 KB

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