order-list.vue 31 KB

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