order-list.vue 27 KB

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