order-list.vue 30 KB

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