order-list.vue 28 KB

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