order-list.vue 32 KB

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