order-list.vue 30 KB

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