order-list.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  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. ></header-back>
  11. <view class="order-section-top" :style="{ marginTop: navbarHeight + 'px' }">
  12. <scroll-view scroll-x scroll-with-animation class="tab-view" :scroll-left="scrollLeft">
  13. <view
  14. v-for="(item, index) in orderTabBar"
  15. :key="index"
  16. class="tab-bar-item"
  17. :class="[currentTab == index ? 'active' : '']"
  18. :data-current="index"
  19. @tap.stop="onClickTab"
  20. >
  21. <text class="tab-bar-title">{{ item.text }}</text>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. <swiper
  26. class="tab-content"
  27. :current="currentTab"
  28. duration="80"
  29. @animationfinish="onChange"
  30. :style="{ height: winHeight + 'px' }"
  31. >
  32. <swiper-item v-for="(tabItem, index) in orderTabBar" :key="index">
  33. <tui-skeleton
  34. v-if="skeletonShow"
  35. backgroundColor="#fafafa"
  36. borderRadius="10rpx"
  37. :isLoading="false"
  38. :loadingType="5"
  39. ></tui-skeleton>
  40. <scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower">
  41. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="tui-skeleton clearfix">
  42. <!-- 空白页 -->
  43. <empty
  44. v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
  45. :typeIndex="currentTab"
  46. :navbarHeight="navbarHeight"
  47. ></empty>
  48. <!-- 列表 -->
  49. <view v-else class="tui-order-content">
  50. <view
  51. class="tui-order-item"
  52. v-for="(order, orderIndex) in tabItem.orderList"
  53. :key="orderIndex"
  54. >
  55. <view class="order-title">
  56. <view class="order-title-t">
  57. <text
  58. class="bage-buss tui-skeleton-fillet"
  59. v-if="order.orderSubmitType == 3 || order.orderSubmitType == 4"
  60. >协销</text
  61. >
  62. <text
  63. class="bage-auto tui-skeleton-fillet"
  64. v-if="
  65. order.orderSubmitType == 0 ||
  66. order.orderSubmitType == 1 ||
  67. order.orderSubmitType == 2
  68. "
  69. >自主</text
  70. >
  71. <text class="bage-text tui-skeleton-fillet">订单编号:{{ order.orderNo }}</text>
  72. <image
  73. class="bage-icon"
  74. src="https://static.caimei365.com/app/img/icon/icon-type@3x.png"
  75. mode="widthFix"
  76. v-if="order.secondHandOrderFlag == 1"
  77. ></image>
  78. </view>
  79. <view class="order-title-b">
  80. <view class="order-title-btxt tui-skeleton-fillet"
  81. >下单时间:{{ order.orderTime }}</view
  82. >
  83. <view class="order-title-tip tui-skeleton-fillet">{{
  84. StateExpFormat(order.status)
  85. }}</view>
  86. </view>
  87. </view>
  88. <block v-for="(shop, sindex) in order.shopOrderList" :key="sindex">
  89. <view class="goods-title">
  90. <view v-if="shop.shopPromotion" class="floor-item-act">
  91. <view class="floor-tags">{{ shop.shopPromotion.name }}</view>
  92. </view>
  93. <view class="title-text" v-if="order.secondHandOrderFlag == 1"
  94. >{{ shop.shopName }}
  95. <label class="paymenttext" v-if="order.affirmPaymentFlag == 1"
  96. >已确认打款供应商</label
  97. >
  98. </view>
  99. <view
  100. class="title-text tui-skeleton-fillet"
  101. v-else
  102. @click="goShophome(shop)"
  103. >{{ shop.shopName }}<label class="iconfont icon-jinrudianpu"></label
  104. ></view>
  105. </view>
  106. <view
  107. class="goods-item"
  108. v-for="(pros, prosIndex) in shop.orderProductList"
  109. :key="prosIndex"
  110. @click.stop="detail(order.orderId)"
  111. >
  112. <view class="goods-pros-t">
  113. <view class="pros-img tui-skeleton-fillet">
  114. <image :src="pros.image" alt="" />
  115. <text class="tips" v-if="pros.productType == 2 || pros.productType == 1"
  116. >赠品</text
  117. >
  118. </view>
  119. <view class="pros-product clearfix">
  120. <view class="producttitle tui-skeleton-fillet">{{ pros.name }}</view>
  121. <view
  122. class="productspec tui-skeleton-fillet"
  123. v-if="pros.productCategory != 2"
  124. >规格:{{ pros.productUnit }}</view
  125. >
  126. <view class="productprice">
  127. <view
  128. class="price tui-skeleton-fillet"
  129. :class="
  130. pros.svipPriceFlag == 1 ||
  131. PromotionsFormat(pros.productPromotion)
  132. ? 'none'
  133. : ''
  134. "
  135. >
  136. <text>¥{{ pros.price | NumFormat }}</text>
  137. </view>
  138. <view class="count tui-skeleton-fillet">
  139. <text class="small">x</text>{{ pros.num }}
  140. </view>
  141. </view>
  142. <view class="floor-item-act">
  143. <template v-if="pros.productPromotion">
  144. <view
  145. v-if="PromotionsFormat(pros.productPromotion)"
  146. class="floor-tags"
  147. @click.stop="clickPopupShow(pros.productPromotion)"
  148. >
  149. {{ pros.productPromotion.name }}
  150. <text
  151. v-if="
  152. pros.productPromotion != null &&
  153. pros.productPromotion.type != 3
  154. "
  155. >
  156. :¥{{
  157. pros.productPromotion == null
  158. ? '0.00'
  159. : pros.productPromotion.touchPrice | NumFormat
  160. }}
  161. </text>
  162. </view>
  163. <view
  164. v-else-if="pros.productPromotion.type != 3"
  165. class="floor-tags"
  166. @click.stop="clickPopupShow(pros.productPromotion)"
  167. >{{ pros.productPromotion.name }}</view
  168. >
  169. </template>
  170. <template v-if="pros.svipPriceFlag == 1">
  171. <view class="svip-tags">
  172. <view class="tags">SVIP</view>
  173. <view class="price">{{ pros.svipPriceTag }}</view>
  174. </view>
  175. </template>
  176. </view>
  177. </view>
  178. </view>
  179. </view>
  180. </block>
  181. <view class="order-footer">
  182. <view class="order-footer-top" v-if="order.discountFee != 0"
  183. >经理折扣:¥{{ order.discountFee | NumFormat }}</view
  184. >
  185. <view class="order-footer-bot">
  186. <view class="count tui-skeleton-fillet">共{{ order.productCount }}件商品</view>
  187. <view
  188. class="money tui-skeleton-fillet"
  189. v-if="order.status == 31 || order.status == 32 || order.status == 33"
  190. >
  191. 已支付:<label style="color:#f94b4b ;"
  192. >¥{{ order.receiptAmount | NumFormat }}</label
  193. >
  194. </view>
  195. <view class="money tui-skeleton-fillet" v-else>
  196. 待付总额:<label style="color:#f94b4b ;"
  197. >¥{{ order.pendingPayments | NumFormat }}</label
  198. >
  199. </view>
  200. </view>
  201. </view>
  202. <!-- 底部button -->
  203. <order-button
  204. ref="orderButton"
  205. :status="order.status"
  206. :order="order"
  207. @buttonConfirm="handButtonConfirm"
  208. >
  209. </order-button>
  210. </view>
  211. <!--加载loadding-->
  212. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  213. <tui-nomore
  214. :visible="!pullUpOn"
  215. :backgroundColor="'#ffffff'"
  216. :text="nomoreText"
  217. ></tui-nomore>
  218. <!--加载loadding-->
  219. </view>
  220. </view>
  221. </scroll-view>
  222. </swiper-item>
  223. </swiper>
  224. <!-- 付款弹窗 -->
  225. <order-model
  226. v-if="isPayModel"
  227. :payModelData="payModelData"
  228. :modelType="modelType"
  229. @cancelConfirm="hanldCancelConfirm"
  230. @paymentConfirm="hanldPaymentConfirm"
  231. />
  232. <!-- 分享弹窗 -->
  233. <share-alert v-if="isShareModal" :orderId="btnoRderID" @shareConfirm="onShareAppMessage" />
  234. <!-- 透明模态层 -->
  235. <modal-layer v-if="isModalLayer"></modal-layer>
  236. <!-- 采美豆提示弹窗 -->
  237. <activityBean
  238. v-if="isActivityBean"
  239. :show="isActivityBean"
  240. :beansType="beansType"
  241. :beanNumber="beanNumber"
  242. @cancel="handleBeanlClick"
  243. ></activityBean>
  244. </view>
  245. </template>
  246. <script>
  247. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  248. import btSearch from '@/components/uni-search/bt-search.vue' //搜索
  249. import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
  250. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  251. import tuiNomore from '@/components/tui-components/nomore/nomore'
  252. import orderButton from '@/components/cm-module/orderDetails/orderListButton' //按钮
  253. import modalLayer from '@/components/modal-layer'
  254. import empty from '@/components/empty'
  255. import shareAlert from '@/components/cm-module/modelAlert/shareAlert' //分享弹窗
  256. import orderModel from '@/components/cm-module/modelAlert/order-alert' //付款弹窗
  257. import activityBean from '@/components/cm-module/activity/activityBean.vue'
  258. export default {
  259. components: {
  260. headerBack,
  261. empty,
  262. btSearch,
  263. tuiLoadmore,
  264. tuiNomore,
  265. orderButton,
  266. tuiSkeleton,
  267. modalLayer,
  268. shareAlert,
  269. orderModel,
  270. activityBean
  271. },
  272. data() {
  273. return {
  274. CustomBar: this.CustomBar, // 顶部导航栏高度
  275. orderTabBar: [
  276. { state: 0, text: '全部订单', orderList: [] },
  277. { state: 1, text: '待确认', orderList: [] },
  278. { state: 2, text: '待付款', orderList: [] },
  279. { state: 3, text: '待发货', orderList: [] },
  280. { state: 4, text: '已发货', orderList: [] },
  281. { state: 5, text: '退货/款', orderList: [] }
  282. ],
  283. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  284. systeminfo: this.setSysteminfo(), //获取设备信息
  285. nvabarData: {
  286. //顶部自定义导航
  287. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  288. showSearch: 1,
  289. title: '我的订单' // 导航栏 中间的标题
  290. },
  291. winHeight: '', //窗口高度
  292. currentTab: 0, //预设当前项的值
  293. scrollLeft: 0, //tab标题的滚动条位置
  294. userId: 0,
  295. orderData: [],
  296. btnoRderID: 0, //点击按钮传入的的订单ID
  297. pageNum: 1, //页数
  298. pageSize: 10, //条数
  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. hanldOrderData: {},
  313. modelType: 0,
  314. nomoreText: '上拉显示更多',
  315. isOnloadFlag: false,
  316. beansType: 1,
  317. beanNumber: 0,
  318. isActivityBean: false
  319. }
  320. },
  321. onLoad(e) {
  322. let self = this
  323. if (e.type === 'detele') {
  324. this.isDelete = true
  325. }
  326. this.currentTab = e.state
  327. this.isOnloadFlag = true
  328. this.getHeaderTopHeight() //设置自定义导航高度
  329. // 高度自适应
  330. uni.getSystemInfo({
  331. success: function(res) {
  332. let calc = res.windowHeight
  333. self.winHeight = calc - self.CustomBar
  334. }
  335. })
  336. },
  337. filters: {
  338. NumFormat(value) {
  339. //处理金额
  340. return Number(value).toFixed(2)
  341. }
  342. },
  343. methods: {
  344. goShophome(shop) {
  345. if(shop.shopType === 2){
  346. return
  347. }
  348. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shop.shopId}`)
  349. },
  350. // 滚动切换标签样式
  351. onChange: function(e) {
  352. let index = e.target.current || e.detail.current
  353. if (this.isClickChange) {
  354. this.currentTab = index
  355. this.isClickChange = false
  356. return
  357. }
  358. this.isClickChange = false
  359. this.currentTab = index
  360. this.checkCor()
  361. this.pageNum = 1
  362. this.pullUpOn = true //切换时隐藏
  363. this.loadding = false //切换时隐藏
  364. this.nomoreText = ''
  365. if (!this.isOnloadFlag) {
  366. this.getOrderDatainit(this.currentTab, 'tabChange')
  367. }
  368. },
  369. // 点击标题切换当前页时改变样式
  370. onClickTab: function(e) {
  371. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current
  372. if (this.currentTab === tabIndex) {
  373. return false
  374. } else {
  375. this.isClickChange = true
  376. this.currentTab = tabIndex
  377. this.pageNum = 1
  378. this.pullUpOn = true //切换时隐藏
  379. this.loadding = false //切换时隐藏
  380. this.getOrderDatainit(this.currentTab)
  381. }
  382. },
  383. //判断当前滚动超过一屏时,设置tab标题滚动条。
  384. checkCor: function() {
  385. if (this.currentTab > 3) {
  386. //这里距离按实际计算
  387. this.scrollLeft = 300
  388. } else {
  389. this.scrollLeft = 0
  390. }
  391. },
  392. getOrderDatainit(index, source) {
  393. /**
  394. * @订单初始化加载 仅加载第一页码
  395. * @param:orderState(订单状态:0全部,1待付款,2待发货,3已发货,4退货款)
  396. * @param:userId(用户ID)
  397. * @param:pageNum(页码数)
  398. * @param:pageSize(每页条数)
  399. * @param:organizeID(全局变量组织ID)
  400. */
  401. setTimeout(() => {
  402. this.skeletonShow = false
  403. this.isOnloadFlag = false
  404. }, 1500)
  405. let orderItem = this.orderTabBar[index]
  406. if (source === 'tabChange' && orderItem.loaded === true) {
  407. //tab切换只有第一次需要加载数据
  408. return
  409. }
  410. setTimeout(() => {
  411. this.$api.getStorage().then(resolve => {
  412. this.userId = resolve.userId ? resolve.userId : 0
  413. let params = { orderState: index, userId: this.userId, pageNum: 1, pageSize: this.pageSize }
  414. this.OrderService.QueryOrderList(params)
  415. .then(response => {
  416. let data = response.data
  417. let orderList = data.list.filter(item => {
  418. //添加不同状态下订单的表现形式
  419. item = Object.assign(item, this.StateExpFormat(item.status))
  420. return item
  421. })
  422. orderItem.orderList = []
  423. orderList.forEach(item => {
  424. orderItem.orderList.push(item)
  425. })
  426. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  427. this.$set(orderItem, 'loaded', true)
  428. this.hasNextPage = data.hasNextPage
  429. if (this.hasNextPage) {
  430. this.pullUpOn = false
  431. this.nomoreText = '上拉显示更多'
  432. } else {
  433. if (orderItem.orderList.length < 2) {
  434. this.pullUpOn = true
  435. } else {
  436. this.pullUpOn = false
  437. this.nomoreText = '已至底部'
  438. }
  439. }
  440. })
  441. .catch(error => {
  442. this.$util.msg(error.msg, 2000)
  443. })
  444. })
  445. }, 600)
  446. },
  447. getOnReachBottomData(index) {
  448. //上拉加载
  449. this.pageNum += 1
  450. let params = { orderState: index, userId: this.userId, pageNum: this.pageNum, pageSize: this.pageSize }
  451. this.OrderService.QueryOrderList(params)
  452. .then(response => {
  453. let data = response.data
  454. let orderItem = this.orderTabBar[index]
  455. this.hasNextPage = data.hasNextPage
  456. orderItem.orderList = orderItem.orderList.concat(data.list)
  457. this.pullFlag = false // 防上拉暴滑
  458. setTimeout(() => {
  459. this.pullFlag = true
  460. }, 500)
  461. if (this.hasNextPage) {
  462. this.pullUpOn = false
  463. this.nomoreText = '上拉显示更多'
  464. } else {
  465. this.loadding = false
  466. this.pullUpOn = false
  467. this.nomoreText = '已至底部'
  468. }
  469. })
  470. .catch(error => {
  471. this.$util.msg(error.msg, 2000)
  472. })
  473. },
  474. scrolltolower() {
  475. if (this.hasNextPage) {
  476. this.loadding = true
  477. this.pullUpOn = true
  478. this.getOnReachBottomData(this.currentTab)
  479. }
  480. },
  481. detail(orderId) {
  482. //订单详情跳转
  483. this.isModalLayer = true
  484. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderId=${orderId}`)
  485. },
  486. handButtonConfirm(data) {
  487. //获取点击
  488. this.handShowAlert(data)
  489. this.btnoRderID = data.orderId
  490. },
  491. handShowAlert(data) {
  492. //执行
  493. switch (data.type) {
  494. case 'delete':
  495. this.handOrderDetele(data.orderId)
  496. break
  497. case 'cancel':
  498. this.handCenceConfirm(data.orderId)
  499. break
  500. case 'query':
  501. this.isModalLayer = true
  502. this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + data.orderId)
  503. break
  504. case 'confirm':
  505. this.handOrderConfirm(data.orderId)
  506. break
  507. case 'pay':
  508. this.hanldOrderData = data.order
  509. this.getOrderPaymentValidation(data)
  510. break
  511. case 'confirmation':
  512. this.handOrderConfirmation(data.orderId)
  513. break
  514. case 'payment':
  515. this.hanldConfirmFn(data.orderId)
  516. break
  517. }
  518. },
  519. getOrderPaymentValidation(data) {
  520. //监听根据付款状态做操作
  521. this.OrderService.OrderPaymentValidation({ orderId: data.orderId })
  522. .then(response => {
  523. let data = response.data
  524. this.payModelData = data
  525. if(data.balanceFlag == 1){// 0可以走余额抵扣,1不能走余额抵扣
  526. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  527. }else{
  528. switch (data.code) {
  529. case 1:
  530. this.isPayModel = true
  531. this.modelType = 1
  532. break
  533. case 2:
  534. this.isPayModel = true
  535. this.modelType = 2
  536. break
  537. case -1:
  538. this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
  539. break
  540. default:
  541. if (data.onlinePayFlag == 1) {// 只能线下
  542. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.orderId}`)
  543. } else {
  544. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  545. }
  546. }
  547. }
  548. })
  549. .catch(error => {
  550. this.$util.msg(error.msg, 2000)
  551. })
  552. },
  553. hanldPaymentConfirm(data) {
  554. //余额抵扣跳转
  555. this.OrderService.OrderBalanceDeduction({ orderId: data.order.orderId })
  556. .then(response => {
  557. if (data.type === 2) {
  558. let _data = { orderId: data.order.orderId }
  559. this.$api.navigateTo(
  560. `/pages/user/order/success?type=deduction&data=${JSON.stringify({ data: _data })}`
  561. )
  562. } else {
  563. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.order.orderId}`)
  564. }
  565. })
  566. .catch(error => {
  567. this.$util.msg(error.msg, 2000)
  568. })
  569. },
  570. hanldCancelConfirm(data) {
  571. //不使用余额抵扣直接跳转收银台
  572. if (data.onlinePayFlag === 1) {// 只能线下
  573. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.orderId}`)
  574. } else {
  575. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  576. }
  577. },
  578. hanldConfirmFn(orderId) {
  579. //确认打款供应商
  580. this.$util.modal(
  581. '提示',
  582. '确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好?',
  583. '确定',
  584. '取消',
  585. true,
  586. () => {
  587. this.OrderService.confirmpayment({ orderId: orderId })
  588. .then(response => {
  589. this.$util.msg('确认成功', 2000, true, 'success')
  590. setTimeout(() => {
  591. this.getOrderDatainit(this.currentTab)
  592. }, 2000)
  593. })
  594. .catch(error => {
  595. this.$util.msg(error.msg, 2000)
  596. })
  597. }
  598. )
  599. },
  600. handOrderConfirm(orderId) {
  601. //确认收货
  602. this.$util.modal('提示', '是否确认收货', '确定', '取消', true, () => {
  603. this.OrderService.ConfirmReceipt({ orderId: orderId })
  604. .then(response => {
  605. this.beansType = 7
  606. this.beanNumber = 100
  607. this.isActivityBean = true
  608. })
  609. .catch(error => {
  610. this.$util.msg(error.msg, 2000)
  611. })
  612. })
  613. },
  614. handOrderConfirmation(orderId) {
  615. //确认订单
  616. this.$util.modal('提示', '确认此订单?', '确定', '取消', true, () => {
  617. this.OrderService.AffirmOrder({ orderId: orderId })
  618. .then(response => {
  619. this.$util.msg(response.msg, 2000, true, 'success')
  620. setTimeout(() => {
  621. this.getOrderDatainit(this.currentTab)
  622. }, 2000)
  623. })
  624. .catch(error => {
  625. this.$util.msg(error.msg, 2000)
  626. })
  627. })
  628. },
  629. handOrderDetele(orderId) {
  630. //删除订单
  631. this.$util.modal('提示', '确认删除该订单吗?', '确定', '取消', true, () => {
  632. this.OrderService.DeleteOrder({ orderId: orderId })
  633. .then(response => {
  634. this.$util.msg(response.msg, 2000, true, 'success')
  635. setTimeout(() => {
  636. this.getOrderDatainit(this.currentTab)
  637. }, 2000)
  638. })
  639. .catch(error => {
  640. this.$util.msg(error.msg, 2000)
  641. })
  642. })
  643. },
  644. handCenceConfirm(orderId) {
  645. //取消订单
  646. this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
  647. this.OrderService.CancelOrder({ orderId: orderId })
  648. .then(response => {
  649. this.$util.msg(response.msg, 2000, true, 'success')
  650. setTimeout(() => {
  651. this.getOrderDatainit(this.currentTab)
  652. }, 2000)
  653. })
  654. .catch(error => {
  655. this.$util.msg(error.msg, 2000)
  656. })
  657. })
  658. },
  659. handlSearchPath() {
  660. this.$api.navigateTo('/pages/search/search-order')
  661. },
  662. onShareAppMessage(res) {
  663. //分享转发
  664. this.isShareModal = false
  665. if (res.from === 'button') {
  666. // 来自页面内转发按钮
  667. }
  668. return {
  669. title: '您有新的分享订单,快来查看吧~',
  670. path: `/pages/user/order/order-sharelogin?orderId=${this.btnoRderID}&userId=${this.userId}`,
  671. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  672. }
  673. },
  674. orderPriceToFixed(n) {
  675. let price = ''
  676. price = n.toFixed(2)
  677. return price
  678. },
  679. getHeaderTopHeight() {
  680. // 状态栏高度
  681. let statusBarHeight = this.systeminfo.statusBarHeight
  682. let headerPosi = this.headerBtnPosi
  683. let btnPosi = {
  684. // 胶囊实际位置,坐标信息不是左上角原点
  685. height: headerPosi.height,
  686. width: headerPosi.width,
  687. // 胶囊top - 状态栏高度
  688. top: headerPosi.top - statusBarHeight,
  689. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  690. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  691. // 屏幕宽度 - 胶囊right
  692. right: this.systeminfo.screenWidth - headerPosi.right
  693. }
  694. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  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-top {
  1056. width: 100%;
  1057. height: 34rpx;
  1058. line-height: 34rpx;
  1059. font-size: $font-size-24;
  1060. color: #999999;
  1061. text-align: right;
  1062. }
  1063. .order-footer-bot {
  1064. width: 100%;
  1065. float: left;
  1066. height: 48rpx;
  1067. line-height: 48rpx;
  1068. font-size: $font-size-28;
  1069. color: $text-color;
  1070. .count {
  1071. width: 50%;
  1072. float: left;
  1073. text-align: left;
  1074. font-weight: bold;
  1075. }
  1076. .money {
  1077. width: 50%;
  1078. float: right;
  1079. text-align: right;
  1080. }
  1081. }
  1082. }
  1083. </style>