order-list.vue 32 KB

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