order-list.vue 31 KB

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