order-list.vue 30 KB

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