order-list.vue 29 KB

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