order-list-retail.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  1. <template>
  2. <view class="container" :style="{paddingTop:(navbarHeight+82)+'px'}">
  3. <!-- 自定义返回 -->
  4. <header-back :systeminfo='systeminfo'
  5. :navbar-data='nvabarData'
  6. :headerBtnPosi ="headerBtnPosi"
  7. :isDelete="isDelete"
  8. :isUsertype="1"
  9. @goSearchPath="handlSearchPath">
  10. </header-back>
  11. <view class="order-section-top" :style="{marginTop:navbarHeight+'px'}">
  12. <scroll-view scroll-x scroll-with-animation class="tab-view" :scroll-left="scrollLeft">
  13. <view v-for="(item,index) in orderTabBar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']"
  14. :data-current="index" @tap.stop="onClickTab">
  15. <text class="tab-bar-title">{{item.text}}</text>
  16. <text class="line"></text>
  17. </view>
  18. </scroll-view>
  19. <view class="tab-screen">
  20. <view v-for="(item,index) in screenTabBar" :key="index" class="tab-screen-item" :class="[screenTab == index ? 'active' : '']"
  21. :data-current="index" @tap.stop="onClickScreenTab(index)">{{item.text}}</view>
  22. </view>
  23. </view>
  24. <swiper class="tab-content" :current="currentTab" duration="80" @animationfinish="onChange" :style="{height:winHeight+'px'}" >
  25. <swiper-item v-for="(tabItem,index) in orderTabBar" :key="index">
  26. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="false" :loadingType="5"></tui-skeleton>
  27. <scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower" :style="{height:winHeight+'px'}" >
  28. <view :class="{'tui-order-list':scrollTop >= 0}" class="tui-skeleton clearfix">
  29. <!-- 空白页 -->
  30. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0" :typeIndex="currentTab" :navbarHeight="navbarHeight"></empty>
  31. <!-- 列表 -->
  32. <view v-else class="tui-order-content">
  33. <view class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" >
  34. <view class="order-title">
  35. <view class="order-title-t">
  36. <text class="bage-text tui-skeleton-fillet"><text class="text">订单编号:</text>{{order.orderNo}}</text>
  37. </view>
  38. <view class="order-title-b">
  39. <view class="order-title-btxt tui-skeleton-fillet"><text class="text">下单时间:</text>{{order.orderTime}}</view>
  40. <view class="order-title-tip tui-skeleton-fillet">{{ StateExpFormat(order.status) }}</view>
  41. </view>
  42. </view>
  43. <block v-for="(shop,sindex) in order.shopOrderList" :key="sindex">
  44. <view class="goods-title">
  45. <view class="title-logo"><image :src="shop.shopLogo" mode=""></image></view>
  46. <view class="title-text tui-skeleton-fillet">{{shop.shopName}}</view>
  47. </view>
  48. <view class="goods-item" v-for="(pros,prosIndex) in shop.orderProductList" :key="prosIndex" @click.stop="detail(order.orderId)">
  49. <view class="goods-pros-t">
  50. <view class="pros-img tui-skeleton-fillet">
  51. <image :src="pros.productImage" alt="" />
  52. </view>
  53. <view class="pros-product clearfix">
  54. <view class="producttitle tui-skeleton-fillet">{{pros.name}}</view>
  55. <view class="productspec tui-skeleton-fillet" v-if="pros.productCategory!=2">规格:{{pros.productUnit}}</view>
  56. <view class="floor-item-act" v-if="pros.ladderPriceFlag === '1'">
  57. <text class="tag tag-01" v-if="!pros.heUserId">自营</text>
  58. <text class="tag tag-01" v-else>促销</text>
  59. <text class="tag tag-02" @click.stop="clickPopupShow(pros,2)">活动价</text>
  60. </view>
  61. <view class="productprice">
  62. <view class="price tui-skeleton-fillet"><text>¥{{pros.price | NumFormat}}</text></view>
  63. <view class="count tui-skeleton-fillet"><text class="small">x</text>{{pros.num}}</view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </block>
  69. <view class="order-footer">
  70. <view class="order-footer-bot">
  71. <view class="count tui-skeleton-fillet">共{{order.productCount}}件商品</view>
  72. <view class="money tui-skeleton-fillet" v-if="order.status==31||order.status==32||order.status==33">
  73. 已支付:<text class="color">¥{{ order.receiptAmount | NumFormat }}</text>
  74. </view>
  75. <view class="money tui-skeleton-fillet" v-else>
  76. 待付总额:<text class="color">¥{{ order.pendingPayments | NumFormat }}</text>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- 底部button -->
  81. <order-button v-if="order.userId == userId"
  82. 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="'#F7F7F7'" :text='nomoreText'></tui-nomore>
  91. <!--加载loadding-->
  92. </view>
  93. </view>
  94. </scroll-view>
  95. </swiper-item>
  96. </swiper>
  97. <!-- 操作弹窗 -->
  98. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel(1)" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
  99. <!-- 再次购买订单商品全部下架弹窗 -->
  100. <tui-modal :show="modal2" @click="handleClick2" @cancel="hideMobel(2)" shape="circle" content="订单内商品已全部下架,不能购买!" :button="button"></tui-modal>
  101. <!-- 再次购买部分商品失效弹窗 -->
  102. <tui-modal :show="modal3" @cancel="hideMobel(3)" :custom="true">
  103. <view class="tui-modal-custom">
  104. <view class="tui-modal-custom-text">
  105. <view class="title">以下商品已失效,不能进行购买;是否先将其他商品加入购物车?</view>
  106. <scroll-view scroll-y class="tui-modal-custom-list">
  107. <view class="custom-list" v-for="(invalid,index) in invalidList" :key="index">
  108. <view class="custom-list-image"><image :src="invalid.productImage" mode=""></image></view>
  109. <view class="custom-list-name">{{ invalid.name }}</view>
  110. </view>
  111. </scroll-view>
  112. </view>
  113. <view class="tui-modal-button">
  114. <button class="modal-button cancel" @click="hideMobel(3)">我再想想</button>
  115. <button class="modal-button confirm" @click="handleClick3">加入购物车</button>
  116. </view>
  117. </view>
  118. </tui-modal>
  119. <!-- 透明模态层 -->
  120. <modal-layer v-if='isModalLayer'></modal-layer>
  121. </view>
  122. </template>
  123. <script>
  124. import authorize from '@/common/config/authorize.js'
  125. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  126. import btSearch from '@/components/uni-search/bt-search.vue' //搜索
  127. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  128. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  129. import tuiNomore from "@/components/tui-components/nomore/nomore"
  130. import orderButton from '@/components/cm-module/orderDetails/orderListButton' //按钮
  131. import modalLayer from "@/components/modal-layer"
  132. import empty from "@/components/empty";
  133. export default {
  134. components: {
  135. headerBack,
  136. empty,
  137. btSearch,
  138. tuiLoadmore,
  139. tuiNomore,
  140. orderButton,
  141. tuiSkeleton,
  142. modalLayer,
  143. },
  144. data() {
  145. return {
  146. CustomBar:this.CustomBar,// 顶部导航栏高度
  147. orderTabBar: [{state: 0,text: '全部',orderList: []},
  148. {state: 1,text: '待付款',orderList: []},
  149. {state: 2,text: '待发货',orderList: []},
  150. {state: 3,text: '已发货',orderList: []},
  151. {state: 4,text: '退货/款',orderList: []}
  152. ],
  153. screenTabBar:[
  154. {type:0,text:'全部订单'},
  155. {type:1,text:'用户订单'},
  156. {type:2,text:'自身订单'}
  157. ],
  158. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  159. systeminfo: this.setSysteminfo(), //获取设备信息
  160. nvabarData: { //顶部自定义导航
  161. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  162. showSearch: 1,
  163. title: '我的订单', // 导航栏 中间的标题
  164. },
  165. winHeight: "", //窗口高度
  166. currentTab: 0, //预设当前项的值
  167. screenTab:0, //筛选预设当前项的值
  168. scrollLeft: 0 ,//tab标题的滚动条位置
  169. userId:0,
  170. orderData: [],
  171. btnoRderID: 0, //点击按钮传入的的订单ID
  172. pageNum: 1, //页数
  173. pageSize: 10, //条数
  174. scrollTop: 0,
  175. skeletonShow: true,
  176. isDelete:false,
  177. isClickChange: false,
  178. isModalLayer: false,
  179. isPayModel:false,
  180. loadding: false,
  181. pullUpOn: true,
  182. hasNextPage: false,
  183. pullFlag: true,
  184. navbarHeight:'',
  185. payModelData:{},
  186. hanldOrderData:{},
  187. modelType:0,
  188. nomoreText: '上拉显示更多',
  189. isOnloadFlag:false,
  190. modal:false,
  191. modal2:false,
  192. modal3:false,
  193. OperationType:'',
  194. contentModalText:'',
  195. button: [
  196. {
  197. text: '确定',
  198. type:'danger'
  199. }
  200. ],
  201. invalidList:[]
  202. }
  203. },
  204. onLoad(e) {
  205. let self = this;
  206. if(e.type ==='detele'){self.isDelete = true}
  207. self.currentTab = e.state
  208. self.isOnloadFlag = true
  209. self.getHeaderTopHeight()//设置自定义导航高度
  210. // 高度自适应
  211. uni.getSystemInfo({
  212. success: function(res) {
  213. let calc = res.windowHeight;
  214. self.winHeight = calc - self.CustomBar;
  215. }
  216. });
  217. },
  218. filters:{
  219. NumFormat(value) {//处理金额
  220. return Number(value).toFixed(2);
  221. },
  222. },
  223. methods: {
  224. goShophome(id){
  225. this.$api.navigateTo(`/supplier/pages/user/my-shop?shopId=${id}`)
  226. },
  227. // 滚动切换标签样式
  228. onChange: function(e) {
  229. let index = e.target.current || e.detail.current;
  230. if (this.isClickChange) {
  231. this.currentTab = index;
  232. this.isClickChange = false;
  233. return;
  234. }
  235. this.isClickChange = false;
  236. this.currentTab = index;
  237. this.checkCor();
  238. this.pageNum = 1
  239. this.pullUpOn = true //切换时隐藏
  240. this.loadding = false //切换时隐藏
  241. this.nomoreText = ''
  242. if(!this.isOnloadFlag){
  243. this.GetOrderDatainit(this.currentTab,'tabChange')
  244. }
  245. },
  246. // 点击标题切换当前页时改变样式
  247. onClickTab: function(e) {
  248. let tabIndex = e.target.dataset.current || e.currentTarget.dataset.current;
  249. if (this.currentTab === tabIndex) {
  250. return false;
  251. } else {
  252. this.isClickChange = true;
  253. this.currentTab = tabIndex
  254. this.pageNum = 1
  255. this.pullUpOn = true //切换时隐藏
  256. this.loadding = false //切换时隐藏
  257. this.GetOrderDatainit(this.currentTab)
  258. }
  259. },
  260. onClickScreenTab(index){
  261. this.screenTab = index
  262. this.pageNum = 1
  263. this.pullUpOn = true //切换时隐藏
  264. this.loadding = false //切换时隐藏
  265. this.nomoreText = ''
  266. this.GetOrderDatainit(this.currentTab)
  267. },
  268. //判断当前滚动超过一屏时,设置tab标题滚动条。
  269. checkCor: function() {
  270. if (this.currentTab > 3) {
  271. //这里距离按实际计算
  272. this.scrollLeft = 300
  273. } else {
  274. this.scrollLeft = 0
  275. }
  276. },
  277. GetOrderDatainit(index,source){
  278. /**
  279. * @订单初始化加载 仅加载第一页码
  280. * @param:orderState(订单状态:0全部,1待付款,2待发货,3已发货,4退货款)
  281. * @param:userId(用户ID)
  282. * @param:pageNum(页码数)
  283. * @param:pageSize(每页条数)
  284. * @param:organizeID(全局变量组织ID)
  285. */
  286. setTimeout(()=>{
  287. this.skeletonShow = false
  288. this.isOnloadFlag = false
  289. },1500)
  290. let orderItem = this.orderTabBar[index];
  291. let state = orderItem.state;
  292. if(source === 'tabChange' && orderItem.loaded === true){
  293. //tab切换只有第一次需要加载数据
  294. return;
  295. }
  296. setTimeout(()=>{
  297. this.$api.getStorage().then((resolve) =>{
  298. this.userId = resolve.userId
  299. this.OrderService.QueryOrderDealerList(
  300. {
  301. orderState:index,
  302. orderType:this.screenTab,
  303. userId:resolve.userId,
  304. pageNum:1,
  305. pageSize:this.pageSize,
  306. }
  307. )
  308. .then(response =>{
  309. let data = response.data
  310. //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
  311. let orderList = data.list.filter(item=>{
  312. //添加不同状态下订单的表现形式
  313. item = Object.assign(item, this.StateExpFormat(item.state));
  314. return item;
  315. });
  316. orderItem.orderList =[];
  317. orderList.forEach(item=>{
  318. orderItem.orderList.push(item);
  319. })
  320. this.$set(orderItem, 'loaded', true);
  321. this.hasNextPage = data.hasNextPage;
  322. if(this.hasNextPage){
  323. this.pullUpOn = false
  324. this.nomoreText = '上拉显示更多'
  325. }else{
  326. if(orderItem.orderList.length < 2){
  327. this.pullUpOn = true
  328. }else{
  329. this.pullUpOn = false
  330. this.nomoreText = '已至底部'
  331. }
  332. }
  333. }).catch(error =>{
  334. this.$util.msg(error.msg,2000);
  335. })
  336. })
  337. }, 600);
  338. },
  339. getOnReachBottomData(index){//上拉加载
  340. this.pageNum+=1
  341. this.OrderService.QueryOrderDealerList(
  342. {
  343. orderState:index,
  344. orderType:this.screenTab,
  345. userId:this.userId,
  346. pageNum:this.pageNum,
  347. pageSize:this.pageSize
  348. }
  349. )
  350. .then(response =>{
  351. let orderItem = this.orderTabBar[index];
  352. let data = response.data
  353. this.hasNextPage = data.hasNextPage;
  354. orderItem.orderList = orderItem.orderList.concat(data.list)
  355. this.pullFlag = false;// 防上拉暴滑
  356. setTimeout(()=>{this.pullFlag = true;},500)
  357. if(this.hasNextPage){
  358. this.pullUpOn = false
  359. this.nomoreText = '上拉显示更多'
  360. }else{
  361. this.loadding = false
  362. this.pullUpOn = false
  363. this.nomoreText = '已至底部'
  364. }
  365. }).catch(error =>{
  366. this.$util.msg(error.msg,2000)
  367. })
  368. },
  369. scrolltolower() {
  370. if(this.hasNextPage){
  371. this.loadding = true
  372. this.pullUpOn = true
  373. this.getOnReachBottomData(this.currentTab);
  374. }
  375. },
  376. detail(id) {//订单详情跳转
  377. this.isModalLayer = true;
  378. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderId=${id}`)
  379. },
  380. handButtonConfirm(data) {//获取点击
  381. this.hanldOrder = data
  382. this.btnoRderID = data.orderId
  383. this.OperationType = data.type
  384. this.handShowAlert(data)
  385. },
  386. handShowAlert(data) {//执行
  387. switch(data.type){
  388. case 'cancel':
  389. this.modal = true;
  390. this.contentModalText = '确认取消该订单吗?';
  391. break;
  392. case 'delete':
  393. this.modal = true;
  394. this.contentModalText = '确认删除该订单吗?';
  395. break;
  396. case 'confirm':
  397. this.modal = true;
  398. this.contentModalText = '是否确认收货?'
  399. break;
  400. case 'query':
  401. this.isModalLayer = true;
  402. this.$api.navigateTo('/pages/user/order/order-logistics?orderId='+data.orderId)
  403. break;
  404. case 'again':
  405. this.handBuyAgainInfo()
  406. break;
  407. case 'pay':
  408. this.MiniWxPayFor(data.order)
  409. break;
  410. }
  411. },
  412. handleClick(e) {//用户操作订单
  413. let index = e.index;
  414. if(index == 1){
  415. switch(this.OperationType){
  416. case 'delete':
  417. this.handOrderDetele(this.btnoRderID);
  418. break
  419. case 'cancel':
  420. this.handCenceConfirm(this.btnoRderID)
  421. break
  422. case 'confirm':
  423. this.handOrderConfirm(this.btnoRderID);
  424. break
  425. }
  426. }
  427. this.modal = false;
  428. },
  429. handleClick2(){
  430. this.modal2 = false;
  431. },
  432. handleClick3(){
  433. this.handShoppingAgainCart()
  434. this.modal3 = false
  435. },
  436. hideMobel(index) {
  437. switch(index){
  438. case 1:this.modal = false;break;
  439. case 2:this.modal2 = false;break;
  440. case 3:this.modal3 = false;break;
  441. }
  442. },
  443. handBuyAgainInfo(){//再次购买初始化查询订单商品信息
  444. this.OrderService.GetOrderBuyAgain(
  445. {
  446. orderId:this.btnoRderID,
  447. }
  448. )
  449. .then(response =>{
  450. this.handShoppingAgainCart()
  451. })
  452. .catch(error =>{
  453. if(error.data && error.data.length > 0){
  454. this.modal3 = true
  455. this.invalidList = error.data
  456. }else{
  457. this.modal2 = true
  458. }
  459. })
  460. },
  461. handShoppingAgainCart(){ //一键加入购物车
  462. this.ProductService.ShoppingAgainCart(
  463. {
  464. orderId:this.btnoRderID,
  465. }
  466. )
  467. .then(response => {
  468. this.ProductService.QueryShoppingQuantity({userId:this.userId}).then(response => {
  469. this.$api.switchTabTo('/pages/tabBar/cart/index');
  470. }).catch(error =>{
  471. console.log('查询购物车数量错误信息',error)
  472. })
  473. })
  474. .catch(error =>{
  475. this.$util.msg(error.msg,2000);
  476. })
  477. },
  478. handOrderConfirm (id){//确认收货
  479. this.OrderService.ConfirmReceipt({orderId:id}).then(response =>{
  480. this.$util.msg(response.msg,2000,true,'success');
  481. setTimeout(() => {
  482. this.GetOrderDatainit(this.currentTab)
  483. },2000)
  484. }).catch(error =>{
  485. this.$util.msg(error.msg,2000)
  486. })
  487. },
  488. handOrderDetele(id){//删除订单
  489. this.OrderService.DeleteOrder({orderId:id}).then(response =>{
  490. this.$util.msg(response.msg,2000,true,'success');
  491. setTimeout(() => {
  492. this.GetOrderDatainit(this.currentTab)
  493. },2000)
  494. }).catch(error =>{
  495. this.$util.msg(error.msg,2000)
  496. })
  497. },
  498. handCenceConfirm(id){//取消订单
  499. this.OrderService.CancelOrder({orderId:id}).then(response =>{
  500. this.$util.msg(response.msg,2000,true,'success');
  501. setTimeout(() => {
  502. this.GetOrderDatainit(this.currentTab)
  503. },2000)
  504. }).catch(error =>{
  505. this.$util.msg(error.msg,2000)
  506. })
  507. },
  508. MiniWxPayFor(data){
  509. this.PayService.PayOrderOnLineSwitch().then(response =>{
  510. if(response.data === 1 ){
  511. this.WeChatMiniWxPay(data)
  512. }else{
  513. this.$api.navigateTo(`/pages/user/order/order-payment?money=${data.payableAmount}`)
  514. }
  515. })
  516. },
  517. async WeChatMiniWxPay(data){
  518. const wechatCode = await authorize.getCode('weixin')
  519. this.PayService.WeChatMiniWxPay(
  520. {
  521. payAmount:data.payableAmount*100,
  522. payWay:"WEIXIN",
  523. code:wechatCode,
  524. orderId:data.orderId
  525. }
  526. )
  527. .then(response =>{
  528. let PayInfo = JSON.parse(response.data.data.payInfo);
  529. this.WxRequestPayment(PayInfo)
  530. })
  531. .catch(error =>{
  532. this.$util.msg(error.msg,2000)
  533. })
  534. },
  535. WxRequestPayment(data){
  536. let self = this
  537. wx.requestPayment({
  538. 'timeStamp': data.timeStamp,
  539. 'nonceStr': data.nonceStr,
  540. 'package': data.package,
  541. 'signType': data.signType,
  542. 'paySign': data.paySign,
  543. 'success':function(res){
  544. wx.reLaunch({url: '/pages/tabBar/index/index'});
  545. },
  546. 'fail':function(res){
  547. console.log(res)
  548. self.$api.redirectTo(`/pages/user/order/success?data=${JSON.stringify({data:self.hanldOrder.order})}`)
  549. },
  550. 'complete':function(res){
  551. }
  552. })
  553. },
  554. handlSearchPath(){
  555. this.$api.navigateTo('/pages/user/order/search-order')
  556. },
  557. orderPriceToFixed (n){
  558. let price ='';
  559. price = n.toFixed(2);
  560. return price
  561. },
  562. getHeaderTopHeight (){ // 状态栏高度
  563. let statusBarHeight = this.systeminfo.statusBarHeight
  564. let headerPosi = this.headerBtnPosi
  565. let btnPosi = { // 胶囊实际位置,坐标信息不是左上角原点
  566. height: headerPosi.height,
  567. width: headerPosi.width,
  568. // 胶囊top - 状态栏高度
  569. top: headerPosi.top - statusBarHeight,
  570. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  571. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  572. // 屏幕宽度 - 胶囊right
  573. right: this.systeminfo.screenWidth - headerPosi.right
  574. }
  575. this.navbarHeight= headerPosi.bottom + btnPosi.bottom// 原胶囊bottom + 现胶囊bottom
  576. },
  577. setHeaderBtnPosi (){
  578. // 获得胶囊按钮位置信息
  579. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  580. return headerBtnPosi
  581. },
  582. setSysteminfo (){
  583. let systeminfo;
  584. uni.getSystemInfo({ // 获取设备信息
  585. success: (res) => {
  586. systeminfo = res
  587. },
  588. })
  589. return systeminfo
  590. },
  591. PromotionsFormat(promo){//促销活动类型数据处理
  592. if(promo!=null){
  593. if(promo.type == 1 && promo.mode == 1){
  594. return true
  595. }else{
  596. return false
  597. }
  598. }
  599. return false
  600. },
  601. StateExpFormat(state){ //订单状态文字和颜色
  602. var HtmlStateText = '',
  603. stateTextObject={
  604. 4:'交易完成',
  605. 5:'订单完成',
  606. 6:'已关闭',
  607. 7:'交易全退',
  608. 77:'交易全退',
  609. 11:'待付款待发货',
  610. 12:'待付款部分发货',
  611. 13:'待付款已发货',
  612. 21:'部分付款待发货',
  613. 22:'部分付款部分发货',
  614. 23:'部分付款已发货',
  615. 31:'已付款待发货',
  616. 32:'已付款部分发货',
  617. 33:'已付款已发货',
  618. 111:'待付款待发货'
  619. };
  620. Object.keys(stateTextObject).forEach(function(key){
  621. if(key == state){
  622. HtmlStateText = stateTextObject[key]
  623. }
  624. });
  625. return HtmlStateText;
  626. }
  627. },
  628. onPageScroll(e) {
  629. this.scrollTop = e.scrollTop;
  630. },
  631. onShow() {
  632. this.isModalLayer = false;
  633. this.GetOrderDatainit(this.currentTab)
  634. // console.log(this.orderTabBar)
  635. }
  636. }
  637. </script>
  638. <style lang="scss">
  639. page{
  640. background-color: #FFFFFF;
  641. }
  642. /*tabbar start*/
  643. ::-webkit-scrollbar {
  644. width: 0;
  645. height: 0;
  646. color: transparent;
  647. }
  648. .order-section-top{
  649. width: 100%;
  650. position: fixed;
  651. top: 0;
  652. left: 0;
  653. z-index: 99;
  654. background: #FFFFFF;
  655. .tab-screen{
  656. height: 48rpx;
  657. width: 702rpx;
  658. padding: 20rpx 24rpx 30rpx 24rpx;
  659. .tab-screen-item{
  660. height: 48rpx;
  661. border-radius: 24rpx;
  662. background: #F7F7F7;
  663. margin-right: 48rpx;
  664. line-height: 48rpx;
  665. font-size: $font-size-26;
  666. color: #333333;
  667. text-align: center;
  668. padding: 0 24rpx;
  669. float: left;
  670. &.active{
  671. color: $color-system;
  672. background-color: #fff3f7;
  673. }
  674. &:last-child{
  675. margin-right: 0;
  676. }
  677. }
  678. }
  679. }
  680. .tab-view::before {
  681. content: '';
  682. position: absolute;
  683. border-bottom: 1rpx solid #eaeef1;
  684. -webkit-transform: scaleY(0.5);
  685. transform: scaleY(0.5);
  686. bottom: 0;
  687. right: 0;
  688. left: 0;
  689. }
  690. .tab-view {
  691. width: 100%;
  692. height: 80rpx;
  693. overflow: hidden;
  694. box-sizing: border-box;
  695. background: #fff;
  696. white-space: nowrap;
  697. }
  698. .tab-bar-item {
  699. padding: 0;
  700. height: 80rpx;
  701. min-width: 80rpx;
  702. line-height: 80rpx;
  703. margin: 0 28rpx;
  704. display: inline-block;
  705. text-align: center;
  706. box-sizing: border-box;
  707. position: relative;
  708. .tab-bar-title {
  709. height: 80rpx;
  710. line-height: 80rpx;
  711. font-size:$font-size-28;
  712. color: $text-color;
  713. }
  714. .line{
  715. width: 40rpx;
  716. height: 4rpx;
  717. border-radius: 2rpx;
  718. position: absolute;
  719. bottom: 8rpx;
  720. left: 50%;
  721. margin-left: -20rpx;
  722. background-color: #FFFFFF;
  723. }
  724. &.active {
  725. .line{
  726. background-color: $color-system;
  727. }
  728. .tab-bar-title {
  729. color: $color-system !important;
  730. }
  731. }
  732. }
  733. .container {
  734. padding-bottom: env(safe-area-inset-bottom);
  735. height: auto;
  736. position: relative;
  737. }
  738. .tui-order-content{
  739. width: 100%;
  740. height: auto;
  741. }
  742. .tui-order-list {
  743. width: 100%;
  744. position: relative;
  745. }
  746. .tui-order-item {
  747. display: flex;
  748. flex-direction: column;
  749. width: 702rpx;
  750. padding:20rpx 24rpx 0 24rpx;
  751. background: #fff;
  752. border-bottom: 20rpx solid #F7F7F7;
  753. }
  754. .order-title{
  755. width: 100%;
  756. height: auto;
  757. padding-bottom: 20rpx;
  758. border-bottom: 1px solid #e1e1e1;
  759. .order-title-t{
  760. width: 100%;
  761. height: 48rpx;
  762. float: left;
  763. line-height: 48rpx;
  764. position: relative;
  765. .bage-icon{
  766. width: 50rpx;
  767. height: 50rpx;
  768. display: block;
  769. position: absolute;
  770. right: 0;
  771. top: 9rpx;
  772. }
  773. .bage-text{
  774. display: inline-block;
  775. font-size: $font-size-28;
  776. line-height: 48rpx;
  777. text-align: left;
  778. color: $text-color;
  779. .text{
  780. color: #999999;
  781. }
  782. }
  783. }
  784. .order-title-b{
  785. width: 100%;
  786. height: 48rpx;
  787. float: left;
  788. margin-top: 8rpx;
  789. .order-title-btxt{
  790. float: left;
  791. font-size: $font-size-28;
  792. line-height: 48rpx;
  793. color: $text-color;
  794. text-align: left;
  795. .text{
  796. color: #999999;
  797. }
  798. }
  799. .order-title-tip{
  800. float: right;
  801. font-size: $font-size-28;
  802. line-height: 48rpx;
  803. text-align: right;
  804. color: #FF2A2A;
  805. }
  806. }
  807. }
  808. .goods-title{
  809. width: 100%;
  810. height: 56rpx;
  811. float: left;
  812. margin-top:10rpx;
  813. .title-logo{
  814. width: 56rpx;
  815. height: 56rpx;
  816. float: left;
  817. border-radius: 8rpx;
  818. border: 1px solid #e1e1e1;
  819. margin-right: 8rpx;
  820. image{
  821. border-radius: 8rpx;
  822. width: 56rpx;
  823. height: 56rpx;
  824. }
  825. }
  826. .title-text{
  827. width: 400rpx;
  828. overflow: hidden;
  829. text-overflow:ellipsis;
  830. white-space: nowrap;
  831. float: left;
  832. font-size: $font-size-28;
  833. color: $text-color;
  834. text-align: left;
  835. line-height: 56rpx;
  836. font-weight: bold;
  837. }
  838. }
  839. .goods-item{
  840. width: 100%;
  841. height: auto;
  842. }
  843. .goods-pros-t{
  844. width: 100%;
  845. height: auto;
  846. padding:24rpx 0;
  847. .pros-img{
  848. float: left;
  849. width: 210rpx;
  850. height: 100%;
  851. border-radius: 10rpx;
  852. margin:0 26rpx 0 0;
  853. position: relative;
  854. image{
  855. width: 210rpx;
  856. height: 210rpx;
  857. border-radius: 10rpx;
  858. border:1px solid #f3f3f3;
  859. }
  860. }
  861. }
  862. .pros-product{
  863. width: 460rpx;
  864. height: 100%;
  865. line-height: 36rpx;
  866. font-size: $font-size-26;
  867. position: relative;
  868. float: left;
  869. .producttitle{
  870. width: 100%;
  871. display: inline-block;
  872. height: auto;
  873. text-overflow:ellipsis;
  874. display: -webkit-box;
  875. word-break: break-all;
  876. -webkit-box-orient: vertical;
  877. -webkit-line-clamp: 2;
  878. overflow: hidden;
  879. margin-bottom: 8rpx;
  880. }
  881. .productspec{
  882. height: 36rpx;
  883. color: #999999;
  884. margin: 10rpx 0 0 0;
  885. }
  886. .productprice{
  887. height: 48rpx;
  888. width: 100%;
  889. float: left;
  890. margin-top: 10rpx;
  891. .price{
  892. line-height: 48rpx;
  893. font-size: $font-size-28;
  894. width: 48%;
  895. color: $color-system;
  896. float: left;
  897. font-weight: bold;
  898. &.disabled{
  899. color: #999999;
  900. text-decoration: line-through;
  901. }
  902. }
  903. .count{
  904. height: 100%;
  905. float: right;
  906. position: relative;
  907. .small{
  908. color: #666666;
  909. }
  910. }
  911. }
  912. .floor-item-act{
  913. width: 100%;
  914. height: 30rpx;
  915. margin-top: 8rpx;
  916. float: left;
  917. .tag{
  918. display: inline-block;
  919. height: 32rpx;
  920. font-size: 22rpx;
  921. line-height: 30rpx;
  922. text-align: center;
  923. color: #f83c6c;
  924. float: left;
  925. margin-right: 10rpx;
  926. &.tag-02{
  927. width: 80rpx;
  928. background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png)top center no-repeat;
  929. background-size: contain;
  930. }
  931. &.tag-01{
  932. width: 56rpx;
  933. color: #fff;
  934. background-color: #f83c6c;
  935. border-radius: 4rpx;
  936. }
  937. }
  938. }
  939. }
  940. .order-footer{
  941. width: 100%;
  942. height: 78rpx;
  943. float: left;
  944. margin-top: 20rpx;
  945. .order-footer-bot{
  946. width: 100%;
  947. float: left;
  948. height: 48rpx;
  949. line-height: 48rpx;
  950. font-size: $font-size-28;
  951. color: $text-color;
  952. .count{
  953. width: 50%;
  954. float: left;
  955. text-align: left;
  956. font-weight: bold;
  957. }
  958. .money{
  959. width: 50%;
  960. float: right;
  961. text-align: right;
  962. .color{
  963. color: $color-system;
  964. font-weight: bold;
  965. }
  966. }
  967. }
  968. }
  969. .tui-modal-custom-text{
  970. min-height: 300rpx;
  971. margin-bottom: 30rpx;
  972. .title{
  973. width: 100%;
  974. height: auto;
  975. font-size: $font-size-30;
  976. text-align: justify;
  977. color: #333333;
  978. line-height: 40rpx;
  979. margin-bottom: 30rpx;
  980. }
  981. .tui-modal-custom-list{
  982. width: 100%;
  983. height: 350rpx;
  984. overflow: hidden;
  985. .custom-list{
  986. width: 100%;
  987. height: 117rpx;
  988. box-sizing: border-box;
  989. float: left;
  990. padding: 15rpx 0;
  991. .custom-list-image{
  992. width: 86rpx;
  993. height: 86rpx;
  994. float: left;
  995. border-radius: 6rpx;
  996. box-sizing: border-box;
  997. border: 1px solid #e1e1e1;
  998. image{
  999. width: 84rpx;
  1000. height: 84rpx;
  1001. border-radius: 6rpx;
  1002. display: block;
  1003. }
  1004. }
  1005. .custom-list-name{
  1006. width: 400rpx;
  1007. height: 86rpx;
  1008. float: right;
  1009. line-height: 43rpx;
  1010. font-size: $font-size-26;
  1011. color: #666666;
  1012. text-overflow: ellipsis;
  1013. overflow: hidden;
  1014. display: -webkit-box;
  1015. -webkit-line-clamp: 2;
  1016. line-clamp: 2;
  1017. -webkit-box-orient: vertical;
  1018. }
  1019. }
  1020. }
  1021. }
  1022. .tui-modal-button{
  1023. width: 100%;
  1024. height: 72rpx;
  1025. display: flex;
  1026. .modal-button{
  1027. width: 200rpx;
  1028. height: 72rpx;
  1029. line-height: 72rpx;
  1030. border-radius: 36rpx;
  1031. box-sizing: border-box;
  1032. &.cancel{
  1033. border: 1px solid #b2b2b2;
  1034. background: #FFFFFF;
  1035. color: #333333;
  1036. }
  1037. &.confirm{
  1038. background: $btn-confirm;
  1039. color: #FFFFFF;
  1040. }
  1041. }
  1042. }
  1043. </style>