order-list.vue 31 KB

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