order-list.vue 30 KB

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