order-list.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909
  1. <template>
  2. <view class="container" :style="{paddingTop:navbarHeight+'px'}">
  3. <!-- 自定义返回 -->
  4. <header-back :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :isDelete="isDelete" @goSearchPath="handlSearchPath"></header-back>
  5. <view class="order-section-top" :style="{marginTop:navbarHeight+'px'}">
  6. <scroll-view scroll-x scroll-with-animation class="tab-view" :scroll-left="scrollLeft">
  7. <view v-for="(item,index) in orderTabBar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']"
  8. :data-current="index" @tap.stop="onClickTab">
  9. <text class="tab-bar-title">{{item.text}}</text>
  10. </view>
  11. </scroll-view>
  12. </view>
  13. <swiper class="tab-content" :current="currentTab" duration="80" @animationfinish="onChange" :style="{height:winHeight+'px'}" >
  14. <swiper-item v-for="(tabItem,index) in orderTabBar" :key="index">
  15. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="false" :loadingType="5"></tui-skeleton>
  16. <scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower">
  17. <view :class="{'tui-order-list':scrollTop >= 0}" class="tui-skeleton clearfix">
  18. <!-- 空白页 -->
  19. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0" :typeIndex="currentTab" :navbarHeight="navbarHeight"></empty>
  20. <!-- 列表 -->
  21. <view v-else class="tui-order-content">
  22. <view class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" >
  23. <view class="order-title">
  24. <view class="order-title-t">
  25. <text class="bage-buss tui-skeleton-fillet" v-if="order.orderSubmitType == 3 || order.orderSubmitType == 4">协销</text>
  26. <text class="bage-auto tui-skeleton-fillet" v-if="order.orderSubmitType == 0 || order.orderSubmitType == 1 || order.orderSubmitType == 2">自主</text>
  27. <text class="bage-text tui-skeleton-fillet">订单号:{{order.orderNo}}</text>
  28. <image class="bage-icon" src="http://static-b.caimei365.com/app/img/icon/icon-type@3x.png" mode="widthFix" v-if="order.secondHandOrderFlag == 1"></image>
  29. </view>
  30. <view class="order-title-b">
  31. <view class="order-title-btxt tui-skeleton-fillet">下单时间:{{order.orderTime}}</view>
  32. <view class="order-title-tip tui-skeleton-fillet">{{ StateExpFormat(order.status) }}</view>
  33. </view>
  34. </view>
  35. <block v-for="(shop,sindex) in order.shopOrderList" :key="sindex">
  36. <view class="goods-title">
  37. <view v-if="shop.shopPromotion" class="floor-item-act">
  38. <view class="floor-tags">{{shop.shopPromotion.name}}</view>
  39. </view>
  40. <view class="title-text" v-if="order.secondHandOrderFlag==1">{{shop.shopName}}</view>
  41. <view class="title-text tui-skeleton-fillet" v-else @click="goShophome(shop.shopID)">{{shop.shopName}}<label class="iconfont icon-jinrudianpu"></label></view>
  42. </view>
  43. <view class="goods-item" v-for="(pros,prosIndex) in shop.orderProductList" :key="prosIndex" @click.stop="detail(order.orderID)">
  44. <view class="goods-pros-t">
  45. <view class="pros-img tui-skeleton-fillet">
  46. <image :src="pros.productImage" alt="" />
  47. <text class="tips" v-if="pros.productType ==2 || pros.productType ==1">赠品</text>
  48. </view>
  49. <view class="pros-product clearfix">
  50. <view class="producttitle tui-skeleton-fillet">{{pros.name}}</view>
  51. <view class="productspec tui-skeleton-fillet" v-if="pros.productCategory!=2">规格:{{pros.productUnit}}</view>
  52. <view class="productprice">
  53. <view class="price tui-skeleton-fillet">
  54. <text>¥{{pros.price | NumFormat}}</text>
  55. </view>
  56. <view class="count tui-skeleton-fillet">
  57. <text class="small">x</text>{{pros.num}}
  58. </view>
  59. </view>
  60. <view class="floor-item-act" v-if=" pros.productPromotion!=null ">
  61. <view v-if="PromotionsFormat(pros.productPromotion)" class="floor-tags">
  62. {{pros.productPromotion.name}}
  63. <text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
  64. :¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
  65. </text>
  66. </view>
  67. <view v-else-if="pros.productPromotion.type !=3" class="floor-tags">{{pros.productPromotion.name}}</view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </block>
  73. <view class="order-footer">
  74. <view class="order-footer-top" v-if="order.discountFee!=0">经理折扣:¥{{order.discountFee | NumFormat}}</view>
  75. <view class="order-footer-bot">
  76. <view class="count tui-skeleton-fillet">共{{order.productCount}}件商品</view>
  77. <view class="money tui-skeleton-fillet" v-if="order.status==31||order.status==32||order.status==33">已支付:<label style="color:#f94b4b ;">¥{{ order.receiptAmount | NumFormat }}</label></view>
  78. <view class="money tui-skeleton-fillet" v-else>待付总额:<label style="color:#f94b4b ;">¥{{ order.pendingPayments | NumFormat }}</label></view>
  79. </view>
  80. </view>
  81. <!-- 底部button -->
  82. <order-button ref="orderButton"
  83. :status="order.status"
  84. :order="order"
  85. @buttonConfirm="handButtonConfirm">
  86. </order-button>
  87. </view>
  88. <!--加载loadding-->
  89. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  90. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  91. <!--加载loadding-->
  92. </view>
  93. </view>
  94. </scroll-view>
  95. </swiper-item>
  96. </swiper>
  97. <!-- 付款弹窗 -->
  98. <order-model v-if="isPayModel"
  99. :payModelData="payModelData"
  100. :modelType='modelType'
  101. @cancelConfirm = "hanldCancelConfirm"
  102. @paymentConfirm ='hanldPaymentConfirm'/>
  103. <!-- 分享弹窗 -->
  104. <share-alert v-if="isShareModal" :orderID="btnoRderID" @shareConfirm ='onShareAppMessage' />
  105. <!-- 透明模态层 -->
  106. <modal-layer v-if='isModalLayer'></modal-layer>
  107. </view>
  108. </template>
  109. <script>
  110. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  111. import btSearch from '@/components/uni-search/bt-search.vue' //搜索
  112. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  113. import tuiListCell from "@/components/tui-components/list-cell/list-cell"
  114. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  115. import tuiNomore from "@/components/tui-components/nomore/nomore"
  116. import orderButton from '@/components/cm-module/orderDetails/orderListButton' //按钮
  117. import modalLayer from "@/components/modal-layer"
  118. import empty from "@/components/empty";
  119. import shareAlert from '@/components/cm-module/modelAlert/shareAlert' //分享弹窗
  120. import orderModel from '@/components/cm-module/modelAlert/order-alert' //付款弹窗
  121. export default {
  122. components: {
  123. headerBack,
  124. empty,
  125. btSearch,
  126. tuiListCell,
  127. tuiLoadmore,
  128. tuiNomore,
  129. orderButton,
  130. tuiSkeleton,
  131. modalLayer,
  132. shareAlert,
  133. orderModel
  134. },
  135. data() {
  136. return {
  137. CustomBar:this.CustomBar,// 顶部导航栏高度
  138. orderTabBar: [{state: 0,text: '全部订单',orderList: []},
  139. {state: 1,text: '待确认',orderList: []},
  140. {state: 2,text: '待付款',orderList: []},
  141. {state: 3,text: '待发货',orderList: []},
  142. {state: 4,text: '已发货',orderList: []},
  143. {state: 5,text: '退货/款',orderList: []}
  144. ],
  145. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  146. systeminfo: this.setSysteminfo(), //获取设备信息
  147. nvabarData: { //顶部自定义导航
  148. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  149. showSearch: 1,
  150. title: '我的订单', // 导航栏 中间的标题
  151. },
  152. winHeight: "", //窗口高度
  153. currentTab: 0, //预设当前项的值
  154. scrollLeft: 0 ,//tab标题的滚动条位置
  155. userID:0,
  156. orderData: [],
  157. btnoRderID: 0, //点击按钮传入的的订单ID
  158. pageNum: 1, //页数
  159. pageSize: 10, //条数
  160. scrollTop: 0,
  161. skeletonShow: true,
  162. isDelete:false,
  163. isClickChange: false,
  164. isShareModal: false,//控制分享弹窗
  165. isModalLayer: false,
  166. isPayModel:false,
  167. loadding: false,
  168. pullUpOn: true,
  169. hasNextPage: false,
  170. pullFlag: true,
  171. navbarHeight:'',
  172. payModelData:{},
  173. hanldOrderData:{},
  174. modelType:0,
  175. nomoreText: '上拉显示更多',
  176. isOnloadFlag:false,
  177. }
  178. },
  179. onLoad(e) {
  180. let self = this;
  181. if(e.type ==='detele'){self.isDelete = true}
  182. self.currentTab = e.state
  183. self.isOnloadFlag = true
  184. self.getHeaderTopHeight()//设置自定义导航高度
  185. // 高度自适应
  186. uni.getSystemInfo({
  187. success: function(res) {
  188. let calc = res.windowHeight;
  189. self.winHeight = calc - self.CustomBar;
  190. }
  191. });
  192. },
  193. filters:{
  194. NumFormat(value) {//处理金额
  195. return Number(value).toFixed(2);
  196. },
  197. },
  198. methods: {
  199. goShophome(id){
  200. this.$api.navigateTo(`/supplier/pages/user/my-shop?shopId=${id}`)
  201. },
  202. // 滚动切换标签样式
  203. onChange: function(e) {
  204. let index = e.target.current || e.detail.current;
  205. if (this.isClickChange) {
  206. this.currentTab = index;
  207. this.isClickChange = false;
  208. return;
  209. }
  210. this.isClickChange = false;
  211. this.currentTab = index;
  212. this.checkCor();
  213. this.pageNum = 1
  214. this.pullUpOn = true //切换时隐藏
  215. this.loadding = false //切换时隐藏
  216. this.nomoreText = ''
  217. if(!this.isOnloadFlag){
  218. this.getOrderDatainit(this.currentTab,'tabChange')
  219. }
  220. },
  221. // 点击标题切换当前页时改变样式
  222. onClickTab: function(e) {
  223. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current;
  224. if (this.currentTab === tabIndex) {
  225. return false;
  226. } else {
  227. this.isClickChange = true;
  228. this.currentTab = tabIndex
  229. this.pageNum = 1
  230. this.pullUpOn = true //切换时隐藏
  231. this.loadding = false //切换时隐藏
  232. this.getOrderDatainit(this.currentTab)
  233. }
  234. },
  235. //判断当前滚动超过一屏时,设置tab标题滚动条。
  236. checkCor: function() {
  237. if (this.currentTab > 3) {
  238. //这里距离按实际计算
  239. this.scrollLeft = 300
  240. } else {
  241. this.scrollLeft = 0
  242. }
  243. },
  244. getOrderDatainit(index,source){
  245. /**
  246. * @订单初始化加载 仅加载第一页码
  247. * @param:orderState(订单状态:0全部,1待付款,2待发货,3已发货,4退货款)
  248. * @param:userID(用户ID)
  249. * @param:pageNum(页码数)
  250. * @param:pageSize(每页条数)
  251. * @param:organizeID(全局变量组织ID)
  252. */
  253. setTimeout(()=>{
  254. this.skeletonShow = false
  255. this.isOnloadFlag = false
  256. },1500)
  257. let orderItem = this.orderTabBar[index];
  258. let state = orderItem.state;
  259. if(source === 'tabChange' && orderItem.loaded === true){
  260. //tab切换只有第一次需要加载数据
  261. return;
  262. }
  263. setTimeout(()=>{
  264. this.$api.getStorage().then((resolve) =>{
  265. this.userID = resolve.userID
  266. let params = {orderState:index,userId:this.userID,pageNum:1,pageSize:this.pageSize};
  267. this.OrderService.QueryOrderList(params).then(response =>{
  268. let orderList = response.data.results.filter(item=>{
  269. //添加不同状态下订单的表现形式
  270. item = Object.assign(item, this.StateExpFormat(item.state));
  271. return item;
  272. });
  273. orderItem.orderList =[];
  274. orderList.forEach(item=>{
  275. orderItem.orderList.push(item);
  276. })
  277. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  278. this.$set(orderItem, 'loaded', true);
  279. this.hasNextPage = response.data.hasNextPage;
  280. if(this.hasNextPage){
  281. this.pullUpOn = false
  282. this.nomoreText = '上拉显示更多'
  283. }else{
  284. if(orderItem.orderList.length < 2){
  285. this.pullUpOn = true
  286. }else{
  287. this.pullUpOn = false
  288. this.nomoreText = '已至底部'
  289. }
  290. }
  291. }).catch(error =>{
  292. this.$util.msg(error.msg,2000);
  293. })
  294. })
  295. }, 600);
  296. },
  297. getOnReachBottomData(index){//上拉加载
  298. this.pageNum+=1
  299. let params = {orderState:index,userId:this.userID,pageNum:this.pageNum,pageSize:this.pageSize};
  300. this.OrderService.QueryOrderList(params).then(response =>{
  301. let orderItem = this.orderTabBar[index];
  302. let resData = response.data.results
  303. this.hasNextPage = response.data.hasNextPage;
  304. orderItem.orderList = orderItem.orderList.concat(resData)
  305. this.pullFlag = false;// 防上拉暴滑
  306. setTimeout(()=>{this.pullFlag = true;},500)
  307. if(this.hasNextPage){
  308. this.pullUpOn = false
  309. this.nomoreText = '上拉显示更多'
  310. }else{
  311. this.loadding = false
  312. this.pullUpOn = false
  313. this.nomoreText = '已至底部'
  314. }
  315. }).catch(error =>{
  316. this.$util.msg(error.msg,2000)
  317. })
  318. },
  319. scrolltolower() {
  320. if(this.hasNextPage){
  321. this.loadding = true
  322. this.pullUpOn = true
  323. this.getOnReachBottomData(this.currentTab);
  324. }
  325. },
  326. detail(id) {//订单详情跳转
  327. console.log(id)
  328. this.isModalLayer = true;
  329. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderID=${id}`)
  330. },
  331. handButtonConfirm(data) {//获取点击
  332. this.handShowAlert(data)
  333. this.btnoRderID = data.orderId
  334. },
  335. handShowAlert(data) {//执行
  336. switch(data.type){
  337. case 'delete':
  338. this.handOrderDetele(data.orderId);
  339. break
  340. case 'cancel':
  341. this.handCenceConfirm(data.orderId)
  342. break
  343. case 'query':
  344. this.isModalLayer = true;
  345. this.$api.navigateTo('/pages/user/order/order-logistics?orderID='+data.orderId)
  346. break
  347. case 'confirm':
  348. this.handOrderConfirm(data.orderId);
  349. break
  350. case 'pay':
  351. this.hanldOrderData = data.order;
  352. this.getOrderPaymentValidation(data)
  353. break
  354. case 'confirmation':
  355. this.handOrderConfirmation(data.orderId);
  356. break
  357. case 'payment':
  358. this.hanldConfirmFn(data.orderId);
  359. break
  360. }
  361. },
  362. getOrderPaymentValidation(data){//监听根据付款状态做操作
  363. this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
  364. let dataCode = response.data.code
  365. this.payModelData = response.data
  366. switch(dataCode){
  367. case 1:
  368. this.isPayModel = true;
  369. this.modelType = 1
  370. break;
  371. case 2:
  372. this.isPayModel = true;
  373. this.modelType = 2
  374. break;
  375. case -1:
  376. this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
  377. break;
  378. default:
  379. if(response.data.onlinePayFlag == '1'){
  380. this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${response.data.pendingPayments}&orderID=${data.orderId}`)
  381. }else{
  382. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
  383. }
  384. }
  385. }).catch(error =>{
  386. this.$util.msg(error.msg,2000)
  387. })
  388. },
  389. hanldPaymentConfirm(data){//余额抵扣跳转
  390. this.OrderService.OrderBalanceDeduction({orderId:data.order.orderId}).then(response =>{
  391. if(data.type === 2){
  392. let _data = {orderID:data.order.orderId}
  393. this.$api.navigateTo(`/pages/user/order/success?type=deduction&data=${JSON.stringify({data:_data})}`)
  394. }else{
  395. if(data.order.onlinePayFlag === '1'){
  396. this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderID=${data.order.orderId}`)
  397. }else{
  398. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
  399. }
  400. }
  401. }).catch(error =>{
  402. this.$util.msg(error.msg,2000)
  403. })
  404. },
  405. hanldCancelConfirm(data){//不使用余额抵扣直接跳转收银台
  406. if(data.onlinePayFlag == '1'){
  407. this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${this.hanldOrderData.pendingPayments}&orderID=${data.orderId}`)
  408. }else{
  409. this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
  410. }
  411. },
  412. hanldConfirmFn (orderId){//确认打款供应商
  413. this.$util.modal('提示','确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好?','确定','取消',true,() =>{
  414. this.OrderService.confirmpayment({orderID:orderId,userId:this.userID}).then(response =>{
  415. this.$util.msg('确认成功',2000,true,'success');
  416. setTimeout(() => {
  417. this.getOrderDatainit(this.currentTab)
  418. },2000)
  419. }).catch(error =>{
  420. this.$util.msg(error.msg,2000)
  421. })
  422. })
  423. },
  424. handOrderConfirm (id){//确认收货
  425. this.$util.modal('提示','是否确认收货','确定','取消',true,() =>{
  426. this.OrderService.ConfirmReceipt({orderID:id}).then(response =>{
  427. this.$util.msg(response.msg,2000,true,'success');
  428. setTimeout(() => {
  429. this.getOrderDatainit(this.currentTab)
  430. },2000)
  431. }).catch(error =>{
  432. this.$util.msg(error.msg,2000)
  433. })
  434. })
  435. },
  436. handOrderConfirmation (id){//确认订单
  437. this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
  438. this.OrderService.AffirmOrder({orderID:id}).then(response =>{
  439. this.$util.msg(response.msg,2000,true,'success');
  440. setTimeout(() => {
  441. this.getOrderDatainit(this.currentTab)
  442. },2000)
  443. }).catch(error =>{
  444. this.$util.msg(error.msg,2000)
  445. })
  446. })
  447. },
  448. handOrderDetele(id){//删除订单
  449. this.$util.modal('提示','确认删除该订单吗?','确定','取消',true,() =>{
  450. this.OrderService.DeleteOrder({orderID:id}).then(response =>{
  451. this.$util.msg(response.msg,2000,true,'success');
  452. setTimeout(() => {
  453. this.getOrderDatainit(this.currentTab)
  454. },2000)
  455. }).catch(error =>{
  456. this.$util.msg(error.msg,2000)
  457. })
  458. })
  459. },
  460. handCenceConfirm(id){//取消订单
  461. this.$util.modal('提示','确认取消该订单吗?','确定','取消',true,() =>{
  462. this.OrderService.CancelOrder({orderID:id}).then(response =>{
  463. this.$util.msg(response.msg,2000,true,'success');
  464. setTimeout(() => {
  465. this.getOrderDatainit(this.currentTab)
  466. },2000)
  467. }).catch(error =>{
  468. this.$util.msg(error.msg,2000)
  469. })
  470. })
  471. },
  472. handlSearchPath(){
  473. this.$api.navigateTo('/pages/search/search-order')
  474. },
  475. onShareAppMessage (res){//分享转发
  476. this.isShareModal = false
  477. if (res.from === 'button') {// 来自页面内转发按钮
  478. }
  479. return {
  480. title: '您有新的分享订单,快来查看吧~',
  481. path: `/pages/user/order/order-sharelogin?orderID=${this.btnoRderID}&userID=${this.userID}`,
  482. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  483. }
  484. },
  485. orderPriceToFixed (n){
  486. let price ='';
  487. price = n.toFixed(2);
  488. return price
  489. },
  490. getHeaderTopHeight (){ // 状态栏高度
  491. let statusBarHeight = this.systeminfo.statusBarHeight
  492. let headerPosi = this.headerBtnPosi
  493. let btnPosi = { // 胶囊实际位置,坐标信息不是左上角原点
  494. height: headerPosi.height,
  495. width: headerPosi.width,
  496. // 胶囊top - 状态栏高度
  497. top: headerPosi.top - statusBarHeight,
  498. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  499. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  500. // 屏幕宽度 - 胶囊right
  501. right: this.systeminfo.screenWidth - headerPosi.right
  502. }
  503. this.navbarHeight= headerPosi.bottom + btnPosi.bottom// 原胶囊bottom + 现胶囊bottom
  504. },
  505. setHeaderBtnPosi (){
  506. // 获得胶囊按钮位置信息
  507. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  508. return headerBtnPosi
  509. },
  510. setSysteminfo (){
  511. let systeminfo;
  512. uni.getSystemInfo({ // 获取设备信息
  513. success: (res) => {
  514. systeminfo = res
  515. },
  516. })
  517. return systeminfo
  518. },
  519. PromotionsFormat(promo){//促销活动类型数据处理
  520. if(promo!=null){
  521. if(promo.type == 1 && promo.mode == 1){
  522. return true
  523. }else{
  524. return false
  525. }
  526. }
  527. return false
  528. },
  529. StateExpFormat(state){ //订单状态文字和颜色
  530. var HtmlStateText = '',
  531. stateTextObject={
  532. 0:'待确认',
  533. 4:'交易完成',
  534. 5:'订单完成',
  535. 6:'已关闭',
  536. 7:'交易全退',
  537. 77:'交易全退',
  538. 11:'待付款待发货',
  539. 12:'待付款部分发货',
  540. 13:'待付款已发货',
  541. 21:'部分付款待发货',
  542. 22:'部分付款部分发货',
  543. 23:'部分付款已发货',
  544. 31:'已付款待发货',
  545. 32:'已付款部分发货',
  546. 33:'已付款已发货',
  547. 111:'待付款待发货'
  548. };
  549. Object.keys(stateTextObject).forEach(function(key){
  550. if(key == state){
  551. HtmlStateText = stateTextObject[key]
  552. }
  553. });
  554. return HtmlStateText;
  555. }
  556. },
  557. onPageScroll(e) {
  558. this.scrollTop = e.scrollTop;
  559. },
  560. onShow() {
  561. this.isModalLayer = false;
  562. this.getOrderDatainit(this.currentTab)
  563. }
  564. }
  565. </script>
  566. <style lang="scss">
  567. /*tabbar start*/
  568. ::-webkit-scrollbar {
  569. width: 0;
  570. height: 0;
  571. color: transparent;
  572. }
  573. .order-section-top{
  574. width: 100%;
  575. position: fixed;
  576. top: 0;
  577. left: 0;
  578. z-index: 99;
  579. background: #FFFFFF;
  580. }
  581. .tab-view::before {
  582. content: '';
  583. position: absolute;
  584. border-bottom: 1rpx solid #eaeef1;
  585. -webkit-transform: scaleY(0.5);
  586. transform: scaleY(0.5);
  587. bottom: 0;
  588. right: 0;
  589. left: 0;
  590. }
  591. .tab-view {
  592. width: 100%;
  593. height: 80rpx;
  594. overflow: hidden;
  595. box-sizing: border-box;
  596. background: #fff;
  597. white-space: nowrap;
  598. border-top: 1px solid #F7F7F7;
  599. }
  600. .tab-bar-item {
  601. padding: 0;
  602. height: 80rpx;
  603. min-width: 80rpx;
  604. line-height: 80rpx;
  605. margin: 0 28rpx;
  606. display: inline-block;
  607. text-align: center;
  608. box-sizing: border-box;
  609. }
  610. .tab-bar-title {
  611. height: 80rpx;
  612. line-height: 80rpx;
  613. font-size:$font-size-28;
  614. color: $text-color;
  615. }
  616. .active {
  617. border-bottom: 6rpx solid $color-system;
  618. }
  619. .active .tab-bar-title {
  620. color: $color-system !important;
  621. }
  622. /*tabbar end*/
  623. .scoll-y {
  624. height: 100%;
  625. }
  626. page{
  627. background: #F7F7F7;
  628. }
  629. .container {
  630. padding-bottom: env(safe-area-inset-bottom);
  631. height: auto;
  632. position: relative;
  633. }
  634. .tui-order-content{
  635. width: 100%;
  636. height: auto;
  637. }
  638. .tui-order-list {
  639. margin-top: 90rpx;
  640. width: 100%;
  641. position: relative;
  642. }
  643. .tui-order-item {
  644. display: flex;
  645. flex-direction: column;
  646. width: 702rpx;
  647. padding:20rpx 24rpx 0 24rpx;
  648. background: #fff;
  649. border-bottom: 20rpx solid #F7F7F7;
  650. }
  651. .order-title{
  652. width: 100%;
  653. height: auto;
  654. .order-title-t{
  655. width: 100%;
  656. height: 68rpx;
  657. float: left;
  658. line-height: 68rpx;
  659. position: relative;
  660. .bage-icon{
  661. width: 50rpx;
  662. height: 50rpx;
  663. display: block;
  664. position: absolute;
  665. right: 0;
  666. top: 9rpx;
  667. }
  668. .bage-buss{
  669. display: inline-block;
  670. width: 72rpx;
  671. height: 30rpx;
  672. background:radial-gradient(circle,rgba(255,39,180,1) 0%,rgba(193,77,245,1) 100%);
  673. border-radius: 4rpx;
  674. line-height: 30rpx;
  675. font-size: $font-size-22;
  676. text-align: center;
  677. color: #FFFFFF;
  678. }
  679. .bage-auto{
  680. display: inline-block;
  681. width: 72rpx;
  682. height: 30rpx;
  683. background:radial-gradient(circle,rgba(255,180,39,1) 0%,rgba(245,142,77,1) 100%);
  684. border-radius: 4rpx;
  685. line-height: 30rpx;
  686. font-size: $font-size-22;
  687. text-align: center;
  688. color: #FFFFFF;
  689. }
  690. .bage-text{
  691. display: inline-block;
  692. font-size: $font-size-28;
  693. line-height: 68rpx;
  694. text-align: left;
  695. color: $text-color;
  696. margin-left: 10rpx;
  697. }
  698. }
  699. .order-title-b{
  700. width: 100%;
  701. height: 40rpx;
  702. float: left;
  703. margin-top: 8rpx;
  704. .order-title-btxt{
  705. float: left;
  706. font-size: $font-size-28;
  707. line-height: 40rpx;
  708. color: #999999;
  709. text-align: lef
  710. }
  711. .order-title-tip{
  712. float: right;
  713. font-size: $font-size-28;
  714. line-height: 40rpx;
  715. text-align: right;
  716. color: #FF2A2A;
  717. }
  718. }
  719. }
  720. .goods-title{
  721. width: 100%;
  722. height: 56rpx;
  723. float: left;
  724. margin-top:10rpx;
  725. .floor-item-act{
  726. height: 56rpx;
  727. text-align: center;
  728. box-sizing: border-box;
  729. float: left;
  730. padding: 10rpx 0;
  731. margin-right: 12rpx;
  732. .floor-tags{
  733. height: 28rpx;
  734. border-radius: 6rpx;
  735. background-color: #FFFFFF;
  736. line-height: 28rpx;
  737. color: $color-system;
  738. text-align: center;
  739. display: inline-block;
  740. padding:0 16rpx;
  741. font-size: $font-size-20;
  742. border: 1px solid #E15616;
  743. float: left;
  744. }
  745. }
  746. .title-text{
  747. width: 400rpx;
  748. overflow: hidden;
  749. text-overflow:ellipsis;
  750. white-space: nowrap;
  751. float: left;
  752. font-size: $font-size-28;
  753. color: $text-color;
  754. text-align: left;
  755. line-height: 56rpx;
  756. font-weight: bold;
  757. .iconfont{
  758. color: #999999;
  759. font-size: 28rpx;
  760. margin-left: 10rpx;
  761. }
  762. }
  763. }
  764. .goods-item{
  765. width: 100%;
  766. height: auto;
  767. }
  768. .goods-pros-t{
  769. width: 100%;
  770. height: auto;
  771. padding:24rpx 0;
  772. .pros-img{
  773. float: left;
  774. width: 210rpx;
  775. height: 100%;
  776. border-radius: 10rpx;
  777. margin:0 26rpx 0 0;
  778. position: relative;
  779. .tips{
  780. display: inline-block;
  781. width: 80rpx;
  782. height: 40rpx;
  783. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  784. line-height: 40rpx;
  785. text-align: center;
  786. font-size: $font-size-24;
  787. color: #FFFFFF;
  788. border-radius:10rpx 0 10rpx 0 ;
  789. position: absolute;
  790. top:0;
  791. left: 0;
  792. }
  793. image{
  794. width: 210rpx;
  795. height: 210rpx;
  796. border-radius: 10rpx;
  797. border:1px solid #f3f3f3;
  798. }
  799. }
  800. }
  801. .pros-product{
  802. width: 460rpx;
  803. height: 100%;
  804. line-height: 36rpx;
  805. font-size: $font-size-26;
  806. position: relative;
  807. float: left;
  808. .producttitle{
  809. width: 100%;
  810. display: inline-block;
  811. height: auto;
  812. text-overflow:ellipsis;
  813. display: -webkit-box;
  814. word-break: break-all;
  815. -webkit-box-orient: vertical;
  816. -webkit-line-clamp: 2;
  817. overflow: hidden;
  818. margin-bottom: 8rpx;
  819. }
  820. .productspec{
  821. height: 36rpx;
  822. color: #999999;
  823. margin: 30rpx 0;
  824. }
  825. .productprice{
  826. height: 48rpx;
  827. width: 100%;
  828. float: left;
  829. .price{
  830. line-height: 48rpx;
  831. font-size: $font-size-28;
  832. width: 48%;
  833. color: #FF2A2A;
  834. float: left;
  835. font-weight: bold;
  836. }
  837. .count{
  838. height: 100%;
  839. float: right;
  840. position: relative;
  841. .small{
  842. color: #666666;
  843. }
  844. }
  845. }
  846. .floor-item-act{
  847. width: 100%;
  848. height: 56rpx;
  849. text-align: center;
  850. box-sizing: border-box;
  851. float: left;
  852. padding:0 0 10rpx 0;
  853. .floor-tags{
  854. height: 28rpx;
  855. border-radius: 6rpx;
  856. background-color: #FFFFFF;
  857. line-height: 28rpx;
  858. color: $color-system;
  859. text-align: center;
  860. display: inline-block;
  861. padding:0 16rpx;
  862. font-size: $font-size-20;
  863. border: 1px solid #E15616;
  864. float: left;
  865. }
  866. }
  867. }
  868. .order-footer{
  869. width: 100%;
  870. height: 78rpx;
  871. float: left;
  872. margin-top: 20rpx;
  873. .order-footer-top{
  874. width: 100%;
  875. height: 34rpx;
  876. line-height: 34rpx;
  877. font-size: $font-size-24;
  878. color: #999999;
  879. text-align: right;
  880. }
  881. .order-footer-bot{
  882. width: 100%;
  883. float: left;
  884. height: 48rpx;
  885. line-height: 48rpx;
  886. font-size: $font-size-28;
  887. color: $text-color;
  888. .count{
  889. width: 50%;
  890. float: left;
  891. text-align: left;
  892. font-weight: bold;
  893. }
  894. .money{
  895. width: 50%;
  896. float: right;
  897. text-align: right;
  898. }
  899. }
  900. }
  901. </style>