order-list.vue 30 KB

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