order-list.vue 29 KB

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