order-list.vue 29 KB

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