order-list.vue 30 KB

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