order-list.vue 26 KB

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