order-list-retail.vue 39 KB

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