order-list.vue 31 KB

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