order-list.vue 30 KB

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