order-list.vue 28 KB

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