order-list.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  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. switch (data.type) {
  511. case 'query':
  512. this.isModalLayer = true
  513. this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + data.orderId)
  514. break
  515. case 'delete':
  516. this.handOrderDetele(data.orderId)
  517. break
  518. case 'cancel':
  519. this.handCenceConfirm(data.orderId)
  520. break
  521. case 'confirm':
  522. this.handOrderConfirm(data.orderId)
  523. break
  524. case 'again':
  525. this.handOrderAgain(data.orderId)
  526. break
  527. }
  528. },
  529. handOrderAgain(orderId) {
  530. this.aganOrderId = orderId
  531. this.SellerService.SellerCreateOrderAgain({
  532. confirmFlag: 0,
  533. orderId: this.aganOrderId,
  534. serviceProviderId: this.serviceProviderId
  535. })
  536. .then(res => {
  537. if (res.code == 0) {
  538. this.$api.setStorage('orderUserInfo', {
  539. clubID: res.data.clubId,
  540. againBuyProductIds: res.data.productIds,
  541. userID: res.data.userId
  542. })
  543. this.$api.navigateTo('/pages/seller/cart/cart')
  544. }
  545. })
  546. .catch(error => {
  547. if (error.code == -3) {
  548. this.showAgan = true
  549. this.promptitle = error.msg
  550. this.failList = error.data
  551. } else if (error.code == -2) {
  552. this.$util.modal('', error.msg, '确定', '', false, () => {})
  553. } else {
  554. this.$util.msg(error.msg, 2000)
  555. }
  556. })
  557. },
  558. closeBtn() {
  559. //
  560. this.showAgan = false
  561. },
  562. cancelBtn() {
  563. // 再来一单弹窗
  564. this.SellerService.SellerCreateOrderAgain({
  565. serviceProviderId: this.serviceProviderId,
  566. orderId: this.aganOrderId,
  567. confirmFlag: 1
  568. }).then(res => {
  569. if (res.code == 0) {
  570. this.$api.navigateTo('/pages/seller/cart/cart')
  571. this.showAgan = false
  572. }
  573. })
  574. },
  575. handOrderConfirm(orderId) {
  576. //确认订单
  577. this.$util.modal('提示', '确认此订单?', '确定', '取消', true, () => {
  578. this.OrderService.AffirmOrder({ orderId: orderId })
  579. .then(response => {
  580. this.$util.msg(response.msg, 2000, true, 'success')
  581. setTimeout(() => {
  582. this.getOrderDatainit(this.currentTab)
  583. }, 2000)
  584. })
  585. .catch(error => {
  586. this.$util.msg(error.msg, 2000)
  587. })
  588. })
  589. },
  590. handOrderDetele(orderId) {
  591. //删除订单
  592. this.$util.modal('提示', '确认删除该订单吗?', '确定', '取消', true, () => {
  593. this.OrderService.DeleteOrder({ orderId: orderId })
  594. .then(response => {
  595. this.$util.msg(response.msg, 2000, true, 'success')
  596. setTimeout(() => {
  597. this.getOrderDatainit(this.currentTab)
  598. }, 2000)
  599. })
  600. .catch(error => {
  601. this.$util.msg(error.msg, 2000)
  602. })
  603. })
  604. },
  605. handCenceConfirm(orderId) {
  606. //取消订单
  607. this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
  608. this.OrderService.CancelOrder({ orderId: orderId })
  609. .then(response => {
  610. this.$util.msg(response.msg, 2000, true, 'success')
  611. setTimeout(() => {
  612. this.getOrderDatainit(this.currentTab)
  613. }, 2000)
  614. })
  615. .catch(error => {
  616. this.$util.msg(error.msg, 2000)
  617. })
  618. })
  619. },
  620. handlSearchPath() {
  621. this.$api.navigateTo('/pages/seller/search/search-order')
  622. },
  623. onShareAppMessage(res) {
  624. //分享转发
  625. this.isShareModal = false
  626. if (res.from === 'button') {
  627. // 来自页面内转发按钮
  628. // console.log(res.target)
  629. }
  630. return {
  631. title: '您有新的订单,请点击查看~',
  632. path: `/pages/user/order/order-sharelogin?orderId=${this.btnoRderID}&userId=${
  633. this.btnClubUserID
  634. }&serviceProviderId=${this.serviceProviderId}`,
  635. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  636. }
  637. },
  638. PromotionsFormat(promo) {
  639. //促销活动类型数据处理
  640. if (promo != null) {
  641. if (promo.type == 1 && promo.mode == 1) {
  642. return true
  643. } else {
  644. return false
  645. }
  646. }
  647. return false
  648. },
  649. //订单状态文字和颜色
  650. StateExpFormat(state) {
  651. let stateText = '',
  652. stateTextObject = {
  653. 0: '待确认',
  654. 4: '交易完成',
  655. 5: '订单完成',
  656. 6: '已关闭',
  657. 7: '交易全退',
  658. 77: '交易全退',
  659. 11: '待付款待发货',
  660. 12: '待付款部分发货',
  661. 13: '待付款已发货',
  662. 21: '部分付款待发货',
  663. 22: '部分付款部分发货',
  664. 23: '部分付款已发货',
  665. 31: '已付款待发货',
  666. 32: '已付款部分发货',
  667. 33: '已付款已发货',
  668. 111: '待付款待发货'
  669. }
  670. Object.keys(stateTextObject).forEach(key => {
  671. if (key == state) {
  672. stateText = stateTextObject[key]
  673. }
  674. })
  675. return stateText
  676. },
  677. orderPriceToFixed(n) {
  678. let price = ''
  679. price = n.toFixed(2)
  680. return price
  681. },
  682. getHeaderTopHeight() {
  683. // 状态栏高度
  684. let statusBarHeight = this.systeminfo.statusBarHeight
  685. let headerPosi = this.headerBtnPosi
  686. let btnPosi = {
  687. // 胶囊实际位置,坐标信息不是左上角原点
  688. height: headerPosi.height,
  689. width: headerPosi.width,
  690. // 胶囊top - 状态栏高度
  691. top: headerPosi.top - statusBarHeight,
  692. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  693. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  694. // 屏幕宽度 - 胶囊right
  695. right: this.systeminfo.screenWidth - headerPosi.right
  696. }
  697. this.navbarHeight = headerPosi.bottom + btnPosi.bottom // 原胶囊bottom + 现胶囊bottom
  698. },
  699. setHeaderBtnPosi() {
  700. // 获得胶囊按钮位置信息
  701. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  702. return headerBtnPosi
  703. },
  704. setSysteminfo() {
  705. let systeminfo
  706. uni.getSystemInfo({
  707. // 获取设备信息
  708. success: res => {
  709. systeminfo = res
  710. }
  711. })
  712. return systeminfo
  713. }
  714. },
  715. onPageScroll(e) {
  716. this.scrollTop = e.scrollTop
  717. },
  718. onShow() {
  719. this.isModalLayer = false
  720. this.getOrderDatainit(this.currentTab)
  721. }
  722. }
  723. </script>
  724. <style lang="scss">
  725. page {
  726. background-color: #ffffff;
  727. }
  728. /*tabbar start*/
  729. ::-webkit-scrollbar {
  730. width: 0;
  731. height: 0;
  732. color: transparent;
  733. }
  734. .order-section-top {
  735. width: 100%;
  736. position: fixed;
  737. top: 0;
  738. left: 0;
  739. z-index: 99;
  740. background: #ffffff;
  741. .tab-screen {
  742. height: 60rpx;
  743. width: 702rpx;
  744. padding: 10rpx 24rpx;
  745. border-top: 1px solid #f7f7f7;
  746. border-bottom: 1px solid #f7f7f7;
  747. display: flex;
  748. justify-content: center;
  749. justify-items: center;
  750. .tab-screen-item {
  751. flex: 1;
  752. height: 60rpx;
  753. border-radius: 10rpx;
  754. background: #f7f7f7;
  755. margin-right: 22rpx;
  756. line-height: 66rpx;
  757. font-size: $font-size-28;
  758. color: #333333;
  759. text-align: center;
  760. &.active {
  761. color: $color-system;
  762. }
  763. &:last-child {
  764. margin-right: 0;
  765. }
  766. }
  767. }
  768. }
  769. .tab-view::before {
  770. content: '';
  771. position: absolute;
  772. border-bottom: 1rpx solid #eaeef1;
  773. -webkit-transform: scaleY(0.5);
  774. transform: scaleY(0.5);
  775. bottom: 0;
  776. right: 0;
  777. left: 0;
  778. }
  779. .tab-view {
  780. width: 100%;
  781. height: 80rpx;
  782. overflow: hidden;
  783. box-sizing: border-box;
  784. background: #fff;
  785. white-space: nowrap;
  786. border-top: 1px solid #f7f7f7;
  787. }
  788. .tab-bar-item {
  789. padding: 0;
  790. height: 80rpx;
  791. min-width: 80rpx;
  792. line-height: 80rpx;
  793. margin: 0 28rpx;
  794. display: inline-block;
  795. text-align: center;
  796. box-sizing: border-box;
  797. &.active {
  798. border-bottom: 6rpx solid $color-system;
  799. }
  800. .tab-bar-title {
  801. height: 80rpx;
  802. line-height: 80rpx;
  803. font-size: $font-size-28;
  804. color: $text-color;
  805. }
  806. &.active .tab-bar-title {
  807. color: $color-system !important;
  808. }
  809. }
  810. .container {
  811. padding-bottom: env(safe-area-inset-bottom);
  812. height: auto;
  813. position: relative;
  814. }
  815. .tui-order-content {
  816. width: 100%;
  817. height: auto;
  818. }
  819. .tui-order-list {
  820. width: 100%;
  821. position: relative;
  822. }
  823. .tui-order-item {
  824. display: flex;
  825. flex-direction: column;
  826. width: 702rpx;
  827. padding: 20rpx 24rpx 0 24rpx;
  828. background: #fff;
  829. border-bottom: 20rpx solid #f7f7f7;
  830. }
  831. .order-title {
  832. width: 100%;
  833. height: auto;
  834. .order-title-name {
  835. width: 100%;
  836. height: 72rpx;
  837. border-bottom: 1px solid #f7f7f7;
  838. line-height: 72rpx;
  839. text-align: left;
  840. font-size: $font-size-28;
  841. color: #333333;
  842. }
  843. .order-title-t {
  844. width: 100%;
  845. height: 68rpx;
  846. float: left;
  847. line-height: 68rpx;
  848. position: relative;
  849. .bage-icon {
  850. width: 50rpx;
  851. height: 50rpx;
  852. display: block;
  853. position: absolute;
  854. right: 0;
  855. top: 9rpx;
  856. }
  857. .bage-buss {
  858. display: inline-block;
  859. width: 72rpx;
  860. height: 30rpx;
  861. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  862. border-radius: 4rpx;
  863. line-height: 30rpx;
  864. font-size: $font-size-22;
  865. text-align: center;
  866. color: #ffffff;
  867. }
  868. .bage-auto {
  869. display: inline-block;
  870. width: 72rpx;
  871. height: 30rpx;
  872. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  873. border-radius: 4rpx;
  874. line-height: 30rpx;
  875. font-size: $font-size-22;
  876. text-align: center;
  877. color: #ffffff;
  878. }
  879. .Rebate {
  880. display: inline-block;
  881. width: 72rpx;
  882. height: 32rpx;
  883. background: #ff7a51;
  884. border-radius: 6rpx;
  885. line-height: 32rpx;
  886. text-align: center;
  887. color: #ffffff;
  888. margin-top: 10rpx;
  889. font-size: $font-size-22;
  890. margin-right: 20rpx;
  891. }
  892. .bage-text {
  893. display: inline-block;
  894. font-size: $font-size-28;
  895. line-height: 68rpx;
  896. text-align: left;
  897. color: $text-color;
  898. margin-left: 10rpx;
  899. }
  900. }
  901. .order-title-b {
  902. width: 100%;
  903. height: 40rpx;
  904. float: left;
  905. margin-top: 8rpx;
  906. .order-title-btxt {
  907. float: left;
  908. font-size: $font-size-28;
  909. line-height: 40rpx;
  910. color: #999999;
  911. text-align: lef;
  912. }
  913. .order-title-tip {
  914. float: right;
  915. font-size: $font-size-28;
  916. line-height: 40rpx;
  917. text-align: right;
  918. color: #ff2a2a;
  919. }
  920. }
  921. }
  922. .goods-title {
  923. width: 100%;
  924. height: 56rpx;
  925. float: left;
  926. margin-top: 10rpx;
  927. .floor-item-act {
  928. height: 56rpx;
  929. text-align: center;
  930. box-sizing: border-box;
  931. float: left;
  932. padding: 10rpx 0;
  933. margin-right: 12rpx;
  934. }
  935. .title-text {
  936. width: 400rpx;
  937. overflow: hidden;
  938. text-overflow: ellipsis;
  939. white-space: nowrap;
  940. float: left;
  941. font-size: $font-size-28;
  942. color: $text-color;
  943. text-align: left;
  944. line-height: 56rpx;
  945. font-weight: bold;
  946. }
  947. }
  948. .goods-item {
  949. width: 100%;
  950. height: auto;
  951. }
  952. .goods-pros-t {
  953. width: 100%;
  954. height: auto;
  955. padding: 24rpx 0;
  956. .pros-img {
  957. float: left;
  958. width: 210rpx;
  959. height: 100%;
  960. border-radius: 10rpx;
  961. margin: 0 26rpx 0 0;
  962. position: relative;
  963. .tips {
  964. display: inline-block;
  965. width: 80rpx;
  966. height: 40rpx;
  967. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  968. line-height: 40rpx;
  969. text-align: center;
  970. font-size: $font-size-24;
  971. color: #ffffff;
  972. border-radius: 10rpx 0 10rpx 0;
  973. position: absolute;
  974. top: 0;
  975. left: 0;
  976. }
  977. image {
  978. width: 210rpx;
  979. height: 210rpx;
  980. border-radius: 10rpx;
  981. border: 1px solid #f3f3f3;
  982. }
  983. }
  984. }
  985. .pros-product {
  986. width: 460rpx;
  987. height: 100%;
  988. line-height: 36rpx;
  989. font-size: $font-size-26;
  990. position: relative;
  991. float: left;
  992. .producttitle {
  993. width: 100%;
  994. display: inline-block;
  995. height: auto;
  996. text-overflow: ellipsis;
  997. display: -webkit-box;
  998. word-break: break-all;
  999. -webkit-box-orient: vertical;
  1000. -webkit-line-clamp: 2;
  1001. overflow: hidden;
  1002. margin-bottom: 8rpx;
  1003. }
  1004. .productspec {
  1005. height: 36rpx;
  1006. color: #999999;
  1007. text-overflow: ellipsis;
  1008. display: -webkit-box;
  1009. word-break: break-all;
  1010. -webkit-box-orient: vertical;
  1011. -webkit-line-clamp: 1;
  1012. overflow: hidden;
  1013. }
  1014. .productprice {
  1015. height: 48rpx;
  1016. width: 100%;
  1017. float: left;
  1018. .price {
  1019. line-height: 48rpx;
  1020. font-size: $font-size-28;
  1021. width: 48%;
  1022. color: #ff2a2a;
  1023. float: left;
  1024. font-weight: bold;
  1025. }
  1026. .count {
  1027. height: 100%;
  1028. float: right;
  1029. position: relative;
  1030. .small {
  1031. color: #666666;
  1032. }
  1033. }
  1034. }
  1035. .floor-item-act {
  1036. width: 100%;
  1037. height: 56rpx;
  1038. text-align: center;
  1039. box-sizing: border-box;
  1040. float: left;
  1041. padding: 0 0 10rpx 0;
  1042. }
  1043. }
  1044. .order-footer {
  1045. width: 100%;
  1046. height: 78rpx;
  1047. float: left;
  1048. .order-footer-top {
  1049. width: 100%;
  1050. height: 34rpx;
  1051. line-height: 34rpx;
  1052. font-size: $font-size-24;
  1053. color: #999999;
  1054. text-align: right;
  1055. }
  1056. .order-footer-bot {
  1057. width: 100%;
  1058. float: left;
  1059. height: 48rpx;
  1060. line-height: 48rpx;
  1061. font-size: $font-size-28;
  1062. font-weight: bold;
  1063. color: $text-color;
  1064. .count {
  1065. width: 50%;
  1066. float: left;
  1067. text-align: left;
  1068. }
  1069. .money {
  1070. width: 50%;
  1071. float: right;
  1072. text-align: right;
  1073. }
  1074. }
  1075. }
  1076. .aganBj {
  1077. position: fixed;
  1078. left: 0;
  1079. top: 0;
  1080. bottom: 0;
  1081. width: 100%;
  1082. height: 100%;
  1083. background-color: rgba(0, 0, 0, 0.5);
  1084. z-index: 999999;
  1085. .alertAgan {
  1086. position: absolute;
  1087. top: 50%;
  1088. left: 50%;
  1089. transform: translate(-50%, -50%);
  1090. width: 580rpx;
  1091. background-color: #fff;
  1092. border-radius: 16rpx;
  1093. .title {
  1094. font-size: 30rpx;
  1095. color: #333333;
  1096. line-height: 42rpx;
  1097. padding: 30rpx;
  1098. display: block;
  1099. }
  1100. .goods {
  1101. padding: 0 30rpx;
  1102. .list {
  1103. padding: 10px 0;
  1104. border-bottom: 1rpx solid #e1e1e1;
  1105. margin: 10rpx 0;
  1106. .image-left {
  1107. width: 86rpx;
  1108. height: 86rpx;
  1109. border: 2rpx solid #e1e1e1;
  1110. border-radius: 6rpx;
  1111. display: inline-block;
  1112. vertical-align: middle;
  1113. }
  1114. .name-right {
  1115. display: inline-block;
  1116. width: 416rpx;
  1117. margin-left: 15rpx;
  1118. font-size: 26rpx;
  1119. color: #666666;
  1120. vertical-align: middle;
  1121. word-break: break-all;
  1122. overflow: hidden;
  1123. text-overflow: ellipsis;
  1124. display: -webkit-inline-box;
  1125. -webkit-line-clamp: 2;
  1126. -webkit-box-orient: vertical;
  1127. }
  1128. }
  1129. }
  1130. .BtnAll {
  1131. margin-top: 30rpx;
  1132. .btn {
  1133. display: inline-block;
  1134. width: 290rpx;
  1135. height: 90rpx;
  1136. line-height: 90rpx;
  1137. text-align: center;
  1138. &.closebtn {
  1139. border-radius: 0px 0px 0px 10px;
  1140. color: #999999;
  1141. background: #efefef;
  1142. }
  1143. &.cancel {
  1144. border-radius: 0px 0px 8px 0px;
  1145. background: $btn-confirm;
  1146. color: #fff;
  1147. }
  1148. }
  1149. }
  1150. }
  1151. }
  1152. </style>