order-list.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  1. <template>
  2. <view class="container" :style="{ paddingTop: navbarHeight + 'px' }">
  3. <!-- 自定义返回 -->
  4. <header-back
  5. :systeminfo="systeminfo"
  6. :navbar-data="nvabarData"
  7. :headerBtnPosi="headerBtnPosi"
  8. :isDelete="isDelete"
  9. @goSearchPath="handlSearchPath"
  10. />
  11. <tui-skeleton
  12. v-if="skeletonShow"
  13. backgroundColor="#fafafa"
  14. borderRadius="10rpx"
  15. :isLoading="true"
  16. :loadingType="5"
  17. />
  18. <template v-else>
  19. <view class="order-section-top" :style="{ marginTop: navbarHeight + 'px' }">
  20. <scroll-view scroll-x scroll-with-animation class="tab-view" :scroll-left="scrollLeft">
  21. <view
  22. v-for="(item, index) in orderTabBar"
  23. :key="index"
  24. class="tab-bar-item"
  25. :class="[currentTab == index ? 'active' : '']"
  26. :data-current="index"
  27. @tap.stop="onClickTab"
  28. >
  29. <text class="tab-bar-title">{{ item.text }}</text>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. <swiper
  34. class="tab-content"
  35. :current="currentTab"
  36. duration="80"
  37. @animationfinish="onChange"
  38. :style="{ height: winHeight + 'px' }"
  39. >
  40. <swiper-item v-for="(tabItem, index) in orderTabBar" :key="index">
  41. <scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower">
  42. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="tui-skeleton clearfix">
  43. <!-- 空白页 -->
  44. <empty
  45. v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
  46. :typeIndex="currentTab"
  47. :navbarHeight="navbarHeight"
  48. />
  49. <!-- 列表 -->
  50. <view v-else class="tui-order-content">
  51. <view
  52. class="tui-order-item"
  53. v-for="(order, orderIndex) in tabItem.orderList"
  54. :key="orderIndex"
  55. >
  56. <view class="order-title">
  57. <view class="order-title-t">
  58. <text
  59. class="bage-buss tui-skeleton-fillet"
  60. v-if="order.orderSubmitType == 3 || order.orderSubmitType == 4"
  61. >协销</text
  62. >
  63. <text
  64. class="bage-auto tui-skeleton-fillet"
  65. v-if="
  66. order.orderSubmitType == 0 ||
  67. order.orderSubmitType == 1 ||
  68. order.orderSubmitType == 2
  69. "
  70. >自主</text
  71. >
  72. <text class="bage-text tui-skeleton-fillet">订单编号:{{ order.orderNo }}</text>
  73. <image
  74. class="bage-icon"
  75. src="https://static.caimei365.com/app/img/icon/icon-type@3x.png"
  76. mode="widthFix"
  77. v-if="order.secondHandOrderFlag == 1"
  78. ></image>
  79. </view>
  80. <view class="order-title-b">
  81. <view class="order-title-btxt tui-skeleton-fillet"
  82. >下单时间:{{ order.orderTime }}</view
  83. >
  84. <view class="order-title-tip tui-skeleton-fillet">{{
  85. StateExpFormat(order.status)
  86. }}</view>
  87. </view>
  88. </view>
  89. <view class="goods-title">
  90. <view v-if="order.shopPromotion" class="floor-item-act">
  91. <view class="floor-tags">{{ order.shopPromotion.name }}</view>
  92. </view>
  93. <view class="title-text" v-if="order.secondHandOrderFlag == 1"
  94. >{{ order.shopName }}
  95. <label class="paymenttext" v-if="order.affirmPaymentFlag == 1"
  96. >已确认打款供应商</label
  97. >
  98. </view>
  99. <view class="title-text tui-skeleton-fillet" v-else @click="goShophome(order)"
  100. >{{ order.shopName }}<label class="iconfont icon-jinrudianpu"></label
  101. ></view>
  102. </view>
  103. <view
  104. class="goods-item"
  105. v-for="(pros, prosIndex) in order.orderProductList"
  106. :key="prosIndex"
  107. @click.stop="detail(order.shopOrderId)"
  108. >
  109. <view class="goods-pros-t">
  110. <view class="pros-img tui-skeleton-fillet">
  111. <image :src="pros.image" alt="" />
  112. <text class="tips" v-if="pros.productType == 2 || pros.productType == 1"
  113. >赠品</text
  114. >
  115. </view>
  116. <view class="pros-product clearfix">
  117. <view class="producttitle tui-skeleton-fillet">{{ pros.name }}</view>
  118. <view
  119. class="productspec tui-skeleton-fillet"
  120. v-if="pros.productCategory != 2"
  121. >规格:{{ pros.productUnit }}</view
  122. >
  123. <view class="productprice">
  124. <view
  125. class="price tui-skeleton-fillet"
  126. :class="
  127. pros.svipPriceFlag == 1 ||
  128. PromotionsFormat(pros.productPromotion)
  129. ? 'none'
  130. : ''
  131. "
  132. >
  133. <text>¥{{ pros.price | NumFormat }}</text>
  134. </view>
  135. <view class="count tui-skeleton-fillet">
  136. <text class="small">x</text>{{ pros.num }}
  137. </view>
  138. </view>
  139. <view class="floor-item-act">
  140. <template v-if="pros.productPromotion">
  141. <view
  142. v-if="PromotionsFormat(pros.productPromotion)"
  143. class="floor-tags"
  144. @click.stop="clickPopupShow(pros.productPromotion)"
  145. >
  146. {{ pros.productPromotion.name }}
  147. <text
  148. v-if="
  149. pros.productPromotion != null &&
  150. pros.productPromotion.type != 3
  151. "
  152. >
  153. :¥{{
  154. pros.productPromotion == null
  155. ? '0.00'
  156. : pros.productPromotion.touchPrice | NumFormat
  157. }}
  158. </text>
  159. </view>
  160. <view
  161. v-else-if="pros.productPromotion.type != 3"
  162. class="floor-tags"
  163. @click.stop="clickPopupShow(pros.productPromotion)"
  164. >{{ pros.productPromotion.name }}</view
  165. >
  166. </template>
  167. <template v-if="pros.svipPriceFlag == 1">
  168. <view class="svip-tags">
  169. <view class="tags">SVIP</view>
  170. <view class="price">{{ pros.svipPriceTag }}</view>
  171. </view>
  172. </template>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. <view class="order-footer">
  178. <view class="order-footer-bot">
  179. <view class="count tui-skeleton-fillet">共{{ order.itemCount }}件商品</view>
  180. <view
  181. class="money tui-skeleton-fillet"
  182. v-if="order.status == 31 || order.status == 32 || order.status == 33"
  183. >
  184. 已支付:<label style="color:#f94b4b ;"
  185. >¥{{ order.receiptAmount | NumFormat }}</label
  186. >
  187. </view>
  188. <view class="money tui-skeleton-fillet" v-else>
  189. 待付总额:<label style="color:#f94b4b ;"
  190. >¥{{ order.obligation | NumFormat }}</label
  191. >
  192. </view>
  193. </view>
  194. </view>
  195. <!-- 底部button -->
  196. <cm-list-button
  197. ref="orderButton"
  198. :status="order.status"
  199. :order="order"
  200. @buttonConfirm="handButtonConfirm"
  201. />
  202. </view>
  203. <!--加载loadding-->
  204. <tui-loadmore :visible="loadding" :index="3" type="black"/>
  205. <tui-nomore
  206. :visible="!pullUpOn"
  207. :backgroundColor="'#ffffff'"
  208. :text="nomoreText"
  209. />
  210. <!--加载loadding-->
  211. </view>
  212. </view>
  213. </scroll-view>
  214. </swiper-item>
  215. </swiper>
  216. </template>
  217. <!-- 付款弹窗 -->
  218. <cm-orderpay-popup
  219. v-if="isPayModel"
  220. :payModelData="payModelData"
  221. :modelType="modelType"
  222. @cancelConfirm="hanldCancelConfirm"
  223. @paymentConfirm="hanldPaymentConfirm"
  224. />
  225. <!-- 分享弹窗 -->
  226. <cm-share-popup :shopOrderId="handleShopOrderId" v-if="isShareModal" @shareConfirm="onShareAppMessage" />
  227. <!-- 采美豆提示弹窗 -->
  228. <activityBean
  229. v-if="isActivityBean"
  230. :show="isActivityBean"
  231. :beansType="beansType"
  232. :beanNumber="beanNumber"
  233. @cancel="handleBeanlClick"
  234. />
  235. <!-- 提示弹窗 -->
  236. <tui-modal
  237. :show="modal"
  238. @click="handleClick"
  239. :content="contentModalText"
  240. :button="modalButton"
  241. color="#333"
  242. :size="32"
  243. shape="circle"
  244. :maskClosable="false"
  245. />
  246. <!-- 透明模态层 -->
  247. <modal-layer v-if="isModalLayer" />
  248. </view>
  249. </template>
  250. <script>
  251. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  252. import btSearch from '@/components/uni-search/bt-search.vue' //搜索
  253. import modalLayer from '@/components/modal-layer'
  254. import empty from '@/components/empty'
  255. import cmListButton from './components/cm-list-button' //底部按钮
  256. import cmSharePopup from './components/cm-share-popup' //分享弹窗
  257. import cmOrderpayPopup from './components/cm-orderpay-popup' //付款弹窗
  258. import activityBean from '@/components/cm-module/activity/activityBean.vue'
  259. export default {
  260. components: {
  261. headerBack,
  262. empty,
  263. modalLayer,
  264. btSearch,
  265. cmListButton,
  266. cmSharePopup,
  267. cmOrderpayPopup,
  268. activityBean
  269. },
  270. data() {
  271. return {
  272. CustomBar: this.CustomBar, // 顶部导航栏高度
  273. orderTabBar: [
  274. { state: 0, text: '全部订单', orderList: [] },
  275. { state: 1, text: '待确认', orderList: [] },
  276. { state: 2, text: '待付款', orderList: [] },
  277. { state: 3, text: '待发货', orderList: [] },
  278. { state: 4, text: '已发货', orderList: [] },
  279. { state: 5, text: '退货/款', orderList: [] }
  280. ],
  281. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  282. systeminfo: this.setSysteminfo(), //获取设备信息
  283. nvabarData: {
  284. //顶部自定义导航
  285. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  286. showSearch: 1,
  287. title: '我的订单' // 导航栏 中间的标题
  288. },
  289. winHeight: '', //窗口高度
  290. currentTab: 0, //预设当前项的值
  291. scrollLeft: 0, //tab标题的滚动条位置
  292. listQuery: {
  293. orderState: 0,
  294. userId: 0,
  295. pageNum: 1,
  296. pageSize: 10
  297. },
  298. orderData: [],
  299. scrollTop: 0,
  300. skeletonShow: true,
  301. isDelete: false,
  302. isClickChange: false,
  303. isShareModal: false, //控制分享弹窗
  304. isModalLayer: false,
  305. isPayModel: false,
  306. loadding: false,
  307. pullUpOn: true,
  308. hasNextPage: false,
  309. pullFlag: true,
  310. navbarHeight: '',
  311. payModelData: {},
  312. modelType: 0,
  313. nomoreText: '上拉显示更多',
  314. isOnloadFlag: false,
  315. beansType: 1,
  316. beanNumber: 0,
  317. isActivityBean: false,
  318. handleShopOrderId: 0, //点击按钮传入的的子订单ID
  319. handleModelEven: 0,
  320. modal: false,
  321. contentModalText: '订单查询失败,请稍候重试~', //操作文字提示语句
  322. modalButton: [
  323. {
  324. text: '取消',
  325. type: 'gray',
  326. plain: true //是否空心
  327. },
  328. {
  329. text: '确定',
  330. customStyle: {
  331. color: '#fff',
  332. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  333. },
  334. plain: false
  335. }
  336. ]
  337. }
  338. },
  339. onLoad(e) {
  340. let self = this
  341. if (e.type === 'detele') {
  342. this.isDelete = true
  343. }
  344. this.currentTab = e.state
  345. this.isOnloadFlag = true
  346. this.getHeaderTopHeight() //设置自定义导航高度
  347. this.initStorage()
  348. },
  349. filters: {
  350. NumFormat(value) {
  351. //处理金额
  352. return Number(value).toFixed(2)
  353. }
  354. },
  355. methods: {
  356. async initStorage() {
  357. //初始化
  358. const usrInfo = await this.$api.getStorage()
  359. this.listQuery.userId = usrInfo.userId ? usrInfo.userId : 0
  360. this.getOrderDatainit(this.currentTab)
  361. },
  362. // 滚动切换标签样式
  363. onChange: function(e) {
  364. let index = e.target.current || e.detail.current
  365. if (this.isClickChange) {
  366. this.currentTab = index
  367. this.isClickChange = false
  368. return
  369. }
  370. this.isClickChange = false
  371. this.currentTab = index
  372. this.checkCor()
  373. this.pullUpOn = true //切换时隐藏
  374. this.loadding = false //切换时隐藏
  375. this.nomoreText = ''
  376. if (!this.isOnloadFlag) {
  377. this.getOrderDatainit(this.currentTab, 'tabChange')
  378. }
  379. },
  380. // 点击标题切换当前页时改变样式
  381. onClickTab(e) {
  382. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current
  383. if (this.currentTab === tabIndex) {
  384. return false
  385. } else {
  386. this.isClickChange = true
  387. this.currentTab = tabIndex
  388. this.pullUpOn = true //切换时隐藏
  389. this.loadding = false //切换时隐藏
  390. this.getOrderDatainit(this.currentTab)
  391. }
  392. },
  393. //判断当前滚动超过一屏时,设置tab标题滚动条。
  394. checkCor() {
  395. if (this.currentTab > 3) {
  396. //这里距离按实际计算
  397. this.scrollLeft = 300
  398. } else {
  399. this.scrollLeft = 0
  400. }
  401. },
  402. async getOrderDatainit(index, source) {
  403. let orderItem = this.orderTabBar[index]
  404. if (source === 'tabChange' && orderItem.loaded === true) {
  405. //tab切换只有第一次需要加载数据
  406. return
  407. }
  408. try {
  409. this.listQuery.pageNum = 1
  410. this.listQuery.orderState = index
  411. const res = await this.OrderService.QueryOrderList(this.listQuery)
  412. const data = res.data
  413. const orderList = data.list.filter(item => {
  414. //添加不同状态下订单的表现形式
  415. item = Object.assign(item, this.StateExpFormat(item.status))
  416. return item
  417. })
  418. orderItem.orderList = []
  419. orderList.forEach(item => {
  420. orderItem.orderList.push(item)
  421. })
  422. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  423. this.$set(orderItem, 'loaded', true)
  424. this.hasNextPage = data.hasNextPage
  425. if (this.hasNextPage) {
  426. this.pullUpOn = false
  427. this.nomoreText = '上拉显示更多'
  428. } else {
  429. if (orderItem.orderList.length < 2) {
  430. this.pullUpOn = true
  431. } else {
  432. this.pullUpOn = false
  433. this.nomoreText = '已至底部'
  434. }
  435. }
  436. this.skeletonShow = false
  437. this.isOnloadFlag = false
  438. } catch (error) {
  439. this.$util.msg(error.msg, 2000)
  440. }
  441. },
  442. async getOnReachBottomData(index) {
  443. //上拉加载
  444. try {
  445. this.listQuery.pageNum += 1
  446. this.listQuery.orderState = index
  447. const res = await this.OrderService.QueryOrderList(this.listQuery)
  448. const data = res.data
  449. const orderItem = this.orderTabBar[index]
  450. this.hasNextPage = data.hasNextPage
  451. orderItem.orderList = orderItem.orderList.concat(data.list)
  452. this.pullFlag = false // 防上拉暴滑
  453. setTimeout(() => {
  454. this.pullFlag = true
  455. }, 500)
  456. if (this.hasNextPage) {
  457. this.pullUpOn = false
  458. this.nomoreText = '上拉显示更多'
  459. } else {
  460. this.loadding = false
  461. this.pullUpOn = false
  462. this.nomoreText = '已至底部'
  463. }
  464. } catch (error) {
  465. this.$util.msg(error.msg, 2000)
  466. }
  467. },
  468. handButtonConfirm(data) {
  469. //获取点击
  470. this.handleShopOrderId = data.shopOrderId
  471. switch (data.type) {
  472. case 'cancel': //取消订单
  473. this.modal = true
  474. this.contentModalText = '确认取消该订单吗?'
  475. this.handleModelEven = 1
  476. break
  477. case 'confirm': //确认收货
  478. this.modal = true
  479. this.contentModalText = '确认收货吗?'
  480. this.handleModelEven = 2
  481. break
  482. case 'delete': //删除订单
  483. this.modal = true
  484. this.contentModalText = '确认删除该订单吗?'
  485. this.handleModelEven = 3
  486. break
  487. case 'confirmation': // 确认订单
  488. this.modal = true
  489. this.contentModalText = '确认此订单吗?'
  490. this.handleModelEven = 4
  491. break
  492. case 'payment': //打款给供应商
  493. this.modal = true
  494. this.contentModalText = '确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好!'
  495. this.handleModelEven = 5
  496. break
  497. case 'pay':
  498. this.getOrderPaymentValidation(data)
  499. break
  500. case 'query':
  501. this.isModalLayer = true
  502. this.$api.navigateTo('/pages/user/order/order-logistics?shopOrderId=' + data.shopOrderId)
  503. break
  504. }
  505. },
  506. handleClick(e) {
  507. //确认操作
  508. if (e.index == 1) {
  509. switch (this.handleModelEven) {
  510. case 1: //取消订单
  511. this.cancelOrder(this.handleShopOrderId)
  512. break
  513. case 2: //确认收货
  514. this.confirmReceipt(this.handleShopOrderId)
  515. break
  516. case 3: //删除订单
  517. this.deleteOrder(this.handleShopOrderId)
  518. break
  519. case 4: //确认订单
  520. this.affirmOrder(this.handleShopOrderId)
  521. break
  522. case 5: //打款给供应商
  523. this.confirmpayment(this.handleShopOrderId)
  524. break
  525. }
  526. }
  527. this.modal = false
  528. },
  529. //取消订单
  530. async cancelOrder(shopOrderId) {
  531. try {
  532. const res = await this.OrderService.CancelOrder({ shopOrderId: shopOrderId, userIdentity: 0 })
  533. this.$util.msg(res.msg, 2000, true, 'success')
  534. setTimeout(() => {
  535. this.getOrderDatainit(this.currentTab)
  536. }, 2000)
  537. } catch (error) {
  538. this.$util.msg(error.msg, 2000)
  539. }
  540. },
  541. //确认收货
  542. async confirmReceipt(shopOrderId) {
  543. try {
  544. const res = await this.OrderService.ConfirmReceipt({ shopOrderId: shopOrderId })
  545. this.beansType = 7
  546. this.beanNumber = 100
  547. this.isActivityBean = true
  548. } catch (error) {
  549. this.$util.msg(error.msg, 2000)
  550. }
  551. },
  552. //删除订单
  553. async deleteOrder(shopOrderId) {
  554. try {
  555. const res = await this.OrderService.DeleteOrder({ shopOrderId: shopOrderId })
  556. this.$util.msg(res.msg, 2000, true, 'success')
  557. setTimeout(() => {
  558. this.getOrderDatainit(this.currentTab)
  559. }, 2000)
  560. } catch (error) {
  561. this.$util.msg(error.msg, 2000)
  562. }
  563. },
  564. //确认订单
  565. async affirmOrder(shopOrderId) {
  566. try {
  567. const res = await this.OrderService.AffirmOrder({ shopOrderId: shopOrderId })
  568. this.$util.msg(res.msg, 2000, true, 'success')
  569. setTimeout(() => {
  570. this.getOrderDatainit(this.currentTab)
  571. }, 2000)
  572. } catch (error) {
  573. this.$util.msg(error.msg, 2000)
  574. }
  575. },
  576. //确认打款给供应商
  577. async confirmpayment(shopOrderId) {
  578. try {
  579. const res = await this.OrderService.confirmpayment({ shopOrderId: shopOrderId })
  580. this.$util.msg(res.msg, 2000, true, 'success')
  581. setTimeout(() => {
  582. this.getOrderDatainit(this.currentTab)
  583. }, 2000)
  584. } catch (error) {
  585. this.$util.msg(error.msg, 2000)
  586. }
  587. },
  588. //监听根据付款状态做操作
  589. async getOrderPaymentValidation(data) {
  590. try {
  591. const res = await this.OrderService.OrderPaymentValidation({ shopOrderId: data.shopOrderId })
  592. const data = res.data
  593. this.payModelData = data
  594. if (data.balanceFlag == 1) {
  595. // 0可以走余额抵扣,1不能走余额抵扣
  596. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  597. } else {
  598. switch (data.code) {
  599. case 1:
  600. this.isPayModel = true
  601. this.modelType = 1
  602. break
  603. case 2:
  604. this.isPayModel = true
  605. this.modelType = 2
  606. break
  607. case -1:
  608. this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
  609. break
  610. default:
  611. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  612. }
  613. }
  614. } catch (error) {
  615. this.$util.msg(error.msg, 2000)
  616. }
  617. },
  618. //余额抵扣跳转
  619. async hanldPaymentConfirm(data) {
  620. try {
  621. await this.OrderService.OrderBalanceDeduction({ shopOrderId: data.order.shopOrderId })
  622. const data = { shopOrderId: data.order.shopOrderId }
  623. if (data.type === 2) {
  624. this.$api.navigateTo(
  625. `/pages/user/order/success?type=deduction&data=${JSON.stringify({ data: data })}`
  626. )
  627. } else {
  628. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.order.orderId}`)
  629. }
  630. } catch (error) {
  631. this.$util.msg(error.msg, 2000)
  632. }
  633. },
  634. hanldCancelConfirm(data) {
  635. //不使用余额抵扣直接跳转收银台
  636. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  637. },
  638. goShophome(order) {
  639. if (order.shopType === 2) {
  640. return
  641. }
  642. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${order.shopId}`)
  643. },
  644. detail(shopOrderId) {
  645. //订单详情跳转
  646. this.isModalLayer = true
  647. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&shopOrderId=${shopOrderId}`)
  648. },
  649. handlSearchPath() {
  650. this.$api.navigateTo('/pages/user/order/search-order')
  651. },
  652. onShareAppMessage(res) {
  653. //分享转发
  654. this.isShareModal = false
  655. if (res.from === 'button') {
  656. // 来自页面内转发按钮
  657. }
  658. return {
  659. title: '您有新的分享订单,快来查看吧~',
  660. path: `/pages/user/order/order-sharelogin?shopOrderId=${this.handleShopOrderId}&userId=${this.userId}`,
  661. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  662. }
  663. },
  664. scrolltolower() {
  665. if (this.hasNextPage) {
  666. this.loadding = true
  667. this.pullUpOn = true
  668. this.getOnReachBottomData(this.currentTab)
  669. }
  670. },
  671. getHeaderTopHeight() {
  672. // 状态栏高度
  673. let self = this
  674. let statusBarHeight = this.systeminfo.statusBarHeight
  675. let headerPosi = this.headerBtnPosi
  676. let btnPosi = {
  677. // 胶囊实际位置,坐标信息不是左上角原点
  678. height: headerPosi.height,
  679. width: headerPosi.width,
  680. // 胶囊top - 状态栏高度
  681. top: headerPosi.top - statusBarHeight,
  682. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  683. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  684. // 屏幕宽度 - 胶囊right
  685. right: this.systeminfo.screenWidth - headerPosi.right
  686. }
  687. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  688. // 高度自适应
  689. uni.getSystemInfo({
  690. success: function(res) {
  691. let calc = res.windowHeight
  692. self.winHeight = calc - self.CustomBar
  693. }
  694. })
  695. },
  696. setHeaderBtnPosi() {
  697. // 获得胶囊按钮位置信息
  698. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  699. return headerBtnPosi
  700. },
  701. setSysteminfo() {
  702. let systeminfo
  703. uni.getSystemInfo({
  704. // 获取设备信息
  705. success: res => {
  706. systeminfo = res
  707. }
  708. })
  709. return systeminfo
  710. },
  711. PromotionsFormat(promo) {
  712. //促销活动类型数据处理
  713. if (promo != null) {
  714. if (promo.type == 1 && promo.mode == 1) {
  715. return true
  716. } else {
  717. return false
  718. }
  719. }
  720. return false
  721. },
  722. StateExpFormat(state) {
  723. //订单状态文字和颜色
  724. var HtmlStateText = '',
  725. stateTextObject = {
  726. 0: '待确认',
  727. 4: '交易完成',
  728. 5: '订单完成',
  729. 6: '已关闭',
  730. 7: '交易全退',
  731. 77: '交易全退',
  732. 11: '待付款待发货',
  733. 12: '待付款部分发货',
  734. 13: '待付款已发货',
  735. 21: '部分付款待发货',
  736. 22: '部分付款部分发货',
  737. 23: '部分付款已发货',
  738. 31: '已付款待发货',
  739. 32: '已付款部分发货',
  740. 33: '已付款已发货',
  741. 111: '待付款待发货'
  742. }
  743. Object.keys(stateTextObject).forEach(function(key) {
  744. if (key == state) {
  745. HtmlStateText = stateTextObject[key]
  746. }
  747. })
  748. return HtmlStateText
  749. },
  750. handleBeanlClick() {
  751. //关闭采美豆弹窗
  752. this.isActivityBean = false
  753. this.getOrderDatainit(this.currentTab)
  754. }
  755. },
  756. onPageScroll(e) {
  757. this.scrollTop = e.scrollTop
  758. },
  759. onShow() {
  760. this.isModalLayer = false
  761. this.getOrderDatainit(this.currentTab)
  762. }
  763. }
  764. </script>
  765. <style lang="scss">
  766. /*tabbar start*/
  767. ::-webkit-scrollbar {
  768. width: 0;
  769. height: 0;
  770. color: transparent;
  771. }
  772. .order-section-top {
  773. width: 100%;
  774. position: fixed;
  775. top: 0;
  776. left: 0;
  777. z-index: 99;
  778. background: #ffffff;
  779. }
  780. .tab-view::before {
  781. content: '';
  782. position: absolute;
  783. border-bottom: 1rpx solid #eaeef1;
  784. -webkit-transform: scaleY(0.5);
  785. transform: scaleY(0.5);
  786. bottom: 0;
  787. right: 0;
  788. left: 0;
  789. }
  790. .tab-view {
  791. width: 100%;
  792. height: 80rpx;
  793. overflow: hidden;
  794. box-sizing: border-box;
  795. background: #fff;
  796. white-space: nowrap;
  797. border-top: 1px solid #f7f7f7;
  798. }
  799. .tab-bar-item {
  800. padding: 0;
  801. height: 80rpx;
  802. min-width: 80rpx;
  803. line-height: 80rpx;
  804. margin: 0 28rpx;
  805. display: inline-block;
  806. text-align: center;
  807. box-sizing: border-box;
  808. }
  809. .tab-bar-title {
  810. height: 80rpx;
  811. line-height: 80rpx;
  812. font-size: $font-size-28;
  813. color: $text-color;
  814. }
  815. .active {
  816. border-bottom: 6rpx solid $color-system;
  817. }
  818. .active .tab-bar-title {
  819. color: $color-system !important;
  820. }
  821. /*tabbar end*/
  822. .scoll-y {
  823. height: 100%;
  824. }
  825. page {
  826. background: #f7f7f7;
  827. }
  828. .container {
  829. padding-bottom: env(safe-area-inset-bottom);
  830. height: auto;
  831. position: relative;
  832. }
  833. .tui-order-content {
  834. width: 100%;
  835. height: auto;
  836. }
  837. .tui-order-list {
  838. margin-top: 90rpx;
  839. width: 100%;
  840. position: relative;
  841. }
  842. .tui-order-item {
  843. display: flex;
  844. flex-direction: column;
  845. width: 702rpx;
  846. padding: 20rpx 24rpx 0 24rpx;
  847. background: #fff;
  848. border-bottom: 20rpx solid #f7f7f7;
  849. }
  850. .order-title {
  851. width: 100%;
  852. height: auto;
  853. .order-title-t {
  854. width: 100%;
  855. height: 68rpx;
  856. float: left;
  857. line-height: 68rpx;
  858. position: relative;
  859. .bage-icon {
  860. width: 50rpx;
  861. height: 50rpx;
  862. display: block;
  863. position: absolute;
  864. right: 0;
  865. top: 9rpx;
  866. }
  867. .bage-buss {
  868. display: inline-block;
  869. width: 72rpx;
  870. height: 30rpx;
  871. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  872. border-radius: 4rpx;
  873. line-height: 30rpx;
  874. font-size: $font-size-22;
  875. text-align: center;
  876. color: #ffffff;
  877. }
  878. .bage-auto {
  879. display: inline-block;
  880. width: 72rpx;
  881. height: 30rpx;
  882. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  883. border-radius: 4rpx;
  884. line-height: 30rpx;
  885. font-size: $font-size-22;
  886. text-align: center;
  887. color: #ffffff;
  888. }
  889. .bage-text {
  890. display: inline-block;
  891. font-size: $font-size-28;
  892. line-height: 68rpx;
  893. text-align: left;
  894. color: $text-color;
  895. margin-left: 10rpx;
  896. }
  897. }
  898. .order-title-b {
  899. width: 100%;
  900. height: 40rpx;
  901. float: left;
  902. margin-top: 8rpx;
  903. .order-title-btxt {
  904. float: left;
  905. font-size: $font-size-28;
  906. line-height: 40rpx;
  907. color: #999999;
  908. text-align: lef;
  909. }
  910. .order-title-tip {
  911. float: right;
  912. font-size: $font-size-28;
  913. line-height: 40rpx;
  914. text-align: right;
  915. color: #ff2a2a;
  916. }
  917. }
  918. }
  919. .goods-title {
  920. width: 100%;
  921. height: 56rpx;
  922. float: left;
  923. margin-top: 10rpx;
  924. .floor-item-act {
  925. height: 56rpx;
  926. text-align: center;
  927. box-sizing: border-box;
  928. float: left;
  929. padding: 10rpx 0;
  930. margin-right: 12rpx;
  931. }
  932. .title-text {
  933. width: 400rpx;
  934. overflow: hidden;
  935. text-overflow: ellipsis;
  936. white-space: nowrap;
  937. float: left;
  938. font-size: $font-size-28;
  939. color: $text-color;
  940. text-align: left;
  941. line-height: 56rpx;
  942. font-weight: bold;
  943. .iconfont {
  944. color: #999999;
  945. font-size: 28rpx;
  946. margin-left: 10rpx;
  947. }
  948. .paymenttext {
  949. color: #f9a94b;
  950. font-size: $font-size-22;
  951. margin-left: 20rpx;
  952. }
  953. }
  954. }
  955. .goods-item {
  956. width: 100%;
  957. height: auto;
  958. }
  959. .goods-pros-t {
  960. width: 100%;
  961. height: auto;
  962. padding: 24rpx 0;
  963. .pros-img {
  964. float: left;
  965. width: 210rpx;
  966. height: 100%;
  967. border-radius: 10rpx;
  968. margin: 0 26rpx 0 0;
  969. position: relative;
  970. .tips {
  971. display: inline-block;
  972. width: 80rpx;
  973. height: 40rpx;
  974. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  975. line-height: 40rpx;
  976. text-align: center;
  977. font-size: $font-size-24;
  978. color: #ffffff;
  979. border-radius: 10rpx 0 10rpx 0;
  980. position: absolute;
  981. top: 0;
  982. left: 0;
  983. }
  984. image {
  985. width: 210rpx;
  986. height: 210rpx;
  987. border-radius: 10rpx;
  988. border: 1px solid #f3f3f3;
  989. }
  990. }
  991. }
  992. .pros-product {
  993. width: 460rpx;
  994. height: 100%;
  995. line-height: 36rpx;
  996. font-size: $font-size-26;
  997. position: relative;
  998. float: left;
  999. .producttitle {
  1000. width: 100%;
  1001. display: inline-block;
  1002. height: auto;
  1003. text-overflow: ellipsis;
  1004. display: -webkit-box;
  1005. word-break: break-all;
  1006. -webkit-box-orient: vertical;
  1007. -webkit-line-clamp: 2;
  1008. overflow: hidden;
  1009. margin-bottom: 8rpx;
  1010. }
  1011. .productspec {
  1012. height: 36rpx;
  1013. color: #999999;
  1014. margin: 30rpx 0;
  1015. }
  1016. .productprice {
  1017. height: 48rpx;
  1018. width: 100%;
  1019. float: left;
  1020. .price {
  1021. line-height: 48rpx;
  1022. font-size: $font-size-28;
  1023. width: 48%;
  1024. color: #ff2a2a;
  1025. float: left;
  1026. font-weight: bold;
  1027. &.none {
  1028. text-decoration: line-through;
  1029. color: #999999;
  1030. }
  1031. }
  1032. .count {
  1033. height: 100%;
  1034. float: right;
  1035. position: relative;
  1036. .small {
  1037. color: #666666;
  1038. }
  1039. }
  1040. }
  1041. .floor-item-act {
  1042. width: 100%;
  1043. height: 56rpx;
  1044. text-align: center;
  1045. box-sizing: border-box;
  1046. float: left;
  1047. padding: 0 0 10rpx 0;
  1048. }
  1049. }
  1050. .order-footer {
  1051. width: 100%;
  1052. height: 78rpx;
  1053. float: left;
  1054. margin-top: 20rpx;
  1055. .order-footer-bot {
  1056. width: 100%;
  1057. float: left;
  1058. height: 48rpx;
  1059. line-height: 48rpx;
  1060. font-size: $font-size-28;
  1061. color: $text-color;
  1062. .count {
  1063. width: 50%;
  1064. float: left;
  1065. text-align: left;
  1066. font-weight: bold;
  1067. }
  1068. .money {
  1069. width: 50%;
  1070. float: right;
  1071. text-align: right;
  1072. }
  1073. }
  1074. }
  1075. </style>