search-order.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. <template>
  2. <view class="search-container">
  3. <!-- <or-search :theme="themeClass" @getSearchText="getSearchText"></or-search> -->
  4. <view class="search-main">
  5. <view class="search">
  6. <view class="search-input">
  7. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  8. <input
  9. maxlength="20"
  10. focus
  11. type="text"
  12. value=""
  13. confirm-type="search"
  14. @focus="onFocus"
  15. @input="onShowClose"
  16. @confirm="subMitSearch()"
  17. placeholder="请输入商品关键词"
  18. v-model.trim="listQuery.searchWord"
  19. />
  20. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  21. </view>
  22. <view class="search-btn" @click="subMitSearch()">搜索</view>
  23. </view>
  24. </view>
  25. <view class="search-container-history" v-if="!isShowWrapper">
  26. <view :class="'s-' + themeClass" v-if="serachRecordList.length > 0">
  27. <view class="header">
  28. 搜索历史 <text class="iconfont icon-shanchu" @click="confirmDetele"></text>
  29. </view>
  30. <view class="list">
  31. <view
  32. v-for="(item, index) in serachRecordList"
  33. :key="index"
  34. @click="keywordsClick(item.searchWord)"
  35. >{{ item.searchWord }}</view
  36. >
  37. </view>
  38. </view>
  39. </view>
  40. <view
  41. class=" order-container"
  42. v-if="isShowWrapper"
  43. :style="{ overflow: 'auto', height: showSkeleton ? windowHeight + 'px' : 'auto' }"
  44. >
  45. <scroll-view
  46. class="tui-skeleton"
  47. :style="{ height: scrollHeight + 'px' }"
  48. @scrolltolower="scrolltolower"
  49. scroll-y
  50. >
  51. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="tui-skeleton clearfix">
  52. <!-- 空白页 -->
  53. <empty v-if="isShowEmpty" :navbarHeight="navbarHeight"></empty>
  54. <!-- 列表 -->
  55. <view v-else class="tui-order-content">
  56. <view
  57. class="tui-order-item"
  58. v-for="(order, orderIndex) in orderList"
  59. :key="orderIndex"
  60. @click.stop="detail(order.orderId)"
  61. >
  62. <view class="order-title">
  63. <view class="order-title-t">
  64. <text
  65. class="bage-buss tui-skeleton-fillet"
  66. v-if="order.orderSubmitType == 3 || order.orderSubmitType == 4"
  67. >协销</text
  68. >
  69. <text
  70. class="bage-auto tui-skeleton-fillet"
  71. v-if="
  72. order.orderSubmitType == 0 ||
  73. order.orderSubmitType == 1 ||
  74. order.orderSubmitType == 2
  75. "
  76. >自主</text
  77. >
  78. <text class="bage-text tui-skeleton-fillet">订单编号:{{ order.orderNo }}</text>
  79. <image
  80. class="bage-icon"
  81. src="https://static.caimei365.com/app/img/icon/icon-type@3x.png"
  82. mode="widthFix"
  83. v-if="order.secondHandOrderFlag == 1"
  84. ></image>
  85. </view>
  86. <view class="order-title-b">
  87. <view class="order-title-btxt tui-skeleton-fillet"
  88. >下单时间:{{ order.orderTime }}</view
  89. >
  90. <view class="order-title-tip tui-skeleton-fillet">{{
  91. StateExpFormat(order.status)
  92. }}</view>
  93. </view>
  94. </view>
  95. <block v-for="(shop, index) in order.shopOrderList" :key="index">
  96. <view class="goods-title">
  97. <view v-if="shop.shopPromotion" class="floor-item-act">
  98. <view class="floor-tags">{{ shop.shopPromotion.name }}</view>
  99. </view>
  100. <view class="title-text tui-skeleton-fillet">{{ shop.shopName }}</view>
  101. </view>
  102. <view
  103. class="goods-item"
  104. v-for="(pros, prosIndex) in shop.orderProductList"
  105. :key="prosIndex"
  106. >
  107. <view class="goods-pros-t">
  108. <view class="pros-img tui-skeleton-fillet">
  109. <image :src="pros.image" alt="" />
  110. <text class="tips" v-if="pros.productType == 2 || pros.productType == 1"
  111. >赠品</text
  112. >
  113. </view>
  114. <view class="pros-product">
  115. <view class="producttitle tui-skeleton-fillet">{{ pros.name }}</view>
  116. <view
  117. class="productspec tui-skeleton-fillet"
  118. v-if="pros.productCategory != 2"
  119. >规格:{{ pros.productUnit }}</view
  120. >
  121. <view class="productprice">
  122. <view
  123. class="price tui-skeleton-fillet"
  124. :class="
  125. pros.svipPriceFlag == 1 ||
  126. PromotionsFormat(pros.productPromotion)
  127. ? 'none'
  128. : ''
  129. "
  130. >
  131. <text>¥{{ pros.price | NumFormat }}</text>
  132. </view>
  133. <view class="count tui-skeleton-fillet">
  134. <text class="small">x</text>{{ pros.num }}
  135. </view>
  136. </view>
  137. <view class="floor-item-act">
  138. <template v-if="pros.productPromotion">
  139. <view
  140. v-if="PromotionsFormat(pros.productPromotion)"
  141. class="floor-tags"
  142. @click.stop="clickPopupShow(pros.productPromotion)"
  143. >
  144. {{ pros.productPromotion.name }}
  145. <text
  146. v-if="
  147. pros.productPromotion != null &&
  148. pros.productPromotion.type != 3
  149. "
  150. >
  151. :¥{{
  152. pros.productPromotion == null
  153. ? '0.00'
  154. : pros.productPromotion.touchPrice | NumFormat
  155. }}
  156. </text>
  157. </view>
  158. <view
  159. v-else-if="pros.productPromotion.type != 3"
  160. class="floor-tags"
  161. @click.stop="clickPopupShow(pros.productPromotion)"
  162. >{{ pros.productPromotion.name }}</view
  163. >
  164. </template>
  165. <template v-if="pros.svipPriceFlag == 1">
  166. <view class="svip-tags">
  167. <view class="tags">SVIP</view>
  168. <view class="price">{{ pros.svipPriceTag }}</view>
  169. </view>
  170. </template>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. </block>
  176. <view class="order-footer">
  177. <view class="order-footer-top" v-if="order.discountFee != 0"
  178. >经理折扣:¥{{ order.discountFee | NumFormat }}</view
  179. >
  180. <view class="order-footer-bot">
  181. <view class="count tui-skeleton-fillet">共{{ order.productCount }}件商品</view>
  182. <view
  183. class="money tui-skeleton-fillet"
  184. v-if="order.status == 31 || order.status == 32 || order.status == 33"
  185. >
  186. 已支付:<label style="color:#f94b4b ;"
  187. >¥{{ order.receiptAmount | NumFormat }}</label
  188. >
  189. </view>
  190. <view class="money tui-skeleton-fillet" v-else>
  191. 待付总额:<label style="color:#f94b4b ;"
  192. >¥{{ order.pendingPayments | NumFormat }}</label
  193. >
  194. </view>
  195. </view>
  196. </view>
  197. <!-- 底部button -->
  198. <cm-list-button
  199. ref="orderButton"
  200. :status="order.status"
  201. :order="order"
  202. :onlinePayFlag="order.onlinePayFlag"
  203. @buttonConfirm="handButtonConfirm"
  204. />
  205. </view>
  206. <!--加载loadding-->
  207. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  208. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  209. <!--加载loadding-->
  210. </view>
  211. </view>
  212. </scroll-view>
  213. </view>
  214. <!-- 付款弹窗 -->
  215. <cm-orderpay-popup
  216. v-if="isPayModel"
  217. :payModelData="payModelData"
  218. :modelType="modelType"
  219. @cancelConfirm="hanldCancelConfirm"
  220. @paymentConfirm="hanldPaymentConfirm"
  221. />
  222. <!-- 分享弹窗 -->
  223. <cm-share-popup :orderId="btnoRderID" v-if="isShareModal" @shareConfirm="onShareAppMessage" />
  224. <!-- 采美豆提示弹窗 -->
  225. <activityBean
  226. v-if="isActivityBean"
  227. :show="isActivityBean"
  228. :beansType="beansType"
  229. :beanNumber="beanNumber"
  230. @cancel="handleBeanlClick"
  231. />
  232. <!-- 透明模态层 -->
  233. <modal-layer v-if="isModalLayer"/>
  234. </view>
  235. </template>
  236. <script>
  237. import orSearch from '@/components/uni-search/or-search.vue'
  238. import empty from '@/components/empty'
  239. import modalLayer from '@/components/modal-layer'
  240. import cmListButton from './components/cm-list-button' //底部按钮
  241. import cmSharePopup from './components/cm-share-popup' //分享弹窗
  242. import cmPrderpayPopup from './components/cm-orderpay-popup' //付款弹窗
  243. import activityBean from '@/components/cm-module/activity/activityBean.vue'
  244. const defaultListQuery = {
  245. pageNum: 1, // 页码
  246. pageSize: 10, // 每页条数
  247. userId: 0, // 用户Id
  248. searchWord: '' // 搜索关键词
  249. }
  250. export default {
  251. components: {
  252. orSearch,
  253. empty,
  254. modalLayer,
  255. cmListButton,
  256. cmSharePopup,
  257. cmPrderpayPopup,
  258. activityBean
  259. },
  260. data() {
  261. return {
  262. listQuery: Object.assign({}, defaultListQuery),
  263. themeClass: 'block',
  264. isShowClose: false, // 是否显示清空输入框图标
  265. isSearchHistory: false, // 是都显示搜索历史
  266. serachRecordList: [],
  267. isShowWrapper: false,
  268. isModallayer: false,
  269. isShowEmpty: false,
  270. windowHeight: '',
  271. showSkeleton: true,
  272. orderList: [],
  273. btnoRderID: 0, // 点击按钮传入的的订单ID
  274. scrollTop: 0,
  275. skeletonShow: true,
  276. isShareModal: false, // 控制分享弹窗
  277. isCenceModal: false, // 控制取消订单弹窗
  278. isShowDelModal: false, // 控制删除订单弹窗
  279. isModalLayer: false,
  280. loadding: false,
  281. pullUpOn: true,
  282. hasNextPage: false,
  283. pullFlag: true,
  284. navbarHeight: '',
  285. nomoreText: '上拉显示更多',
  286. scrollHeight: '',
  287. beansType: 1,
  288. beanNumber: 0,
  289. isActivityBean: false,
  290. payModelData: {},
  291. }
  292. },
  293. onLoad() {
  294. this.initGetSerachRecord()
  295. },
  296. filters: {
  297. NumFormat(value) {
  298. //处理金额
  299. return Number(value).toFixed(2)
  300. }
  301. },
  302. methods: {
  303. subMitSearch() {
  304. if (this.listQuery.searchWord == '') {
  305. this.$util.msg('请输入商品关键词', 2000)
  306. } else {
  307. this.commodityList = []
  308. this.getOrderDatainit()
  309. }
  310. },
  311. async initGetSerachRecord() {
  312. const userInfo = await this.$api.getStorage()
  313. this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
  314. this.OrderService.SearchOrderHistory({ userId: this.listQuery.userId })
  315. .then(response => {
  316. this.serachRecordList = response.data
  317. if (this.serachRecordList.length > 0) {
  318. this.isSearchHistory = true
  319. } else {
  320. this.isSearchHistory = false
  321. }
  322. })
  323. .catch(error => {
  324. this.$util.msg(error.msg, 2000)
  325. })
  326. },
  327. onShowClose() {
  328. //输入框失去焦点时触发
  329. this.inputEmpty(this.listQuery.searchWord)
  330. },
  331. onFocus() {
  332. //输入框获取焦点时触发
  333. this.inputEmpty(this.listQuery.searchWord)
  334. this.initGetSerachRecord()
  335. },
  336. delInputText() {
  337. //清除输入框内容
  338. this.listQuery.searchWord = ''
  339. this.isShowClose = false
  340. this.isShowWrapper = false
  341. this.inputEmpty(this.listQuery.searchWord)
  342. this.initGetSerachRecord()
  343. },
  344. keywordsClick(item) {
  345. //关键词搜索与历史搜索
  346. this.listQuery.searchWord = item
  347. this.isShowClose = true
  348. this.subMitSearch()
  349. },
  350. confirmDetele() {
  351. //清空历史记录
  352. this.$util.modal('提示', '确定删除历史记录?', '确定', '取消', true, () => {
  353. this.OrderService.ClearOrderHistory({ userId: this.listQuery.userId })
  354. .then(response => {
  355. this.$util.msg('删除记录成功', 2000, true, 'success')
  356. this.serachRecordList = []
  357. })
  358. .catch(error => {
  359. this.$util.msg(error.msg, 2000)
  360. })
  361. })
  362. },
  363. inputEmpty(val) {
  364. this.isShowWrapper = false
  365. if (val != '') {
  366. this.isShowClose = true
  367. } else {
  368. this.isShowClose = false
  369. }
  370. },
  371. getOrderDatainit(index, source) {
  372. this.OrderService.SearchOrderInfo(this.listQuery)
  373. .then(response => {
  374. this.isShowWrapper = true
  375. this.showSkeleton = true
  376. let data = response.data
  377. if (data && data.list.length > 0) {
  378. let filrerData = data.list.filter(item => {
  379. //添加不同状态下订单的表现形式
  380. item = Object.assign(item, this.StateExpFormat(item.status))
  381. return item
  382. })
  383. this.orderList = []
  384. filrerData.forEach(item => {
  385. this.orderList.push(item)
  386. })
  387. this.hasNextPage = data
  388. if (this.hasNextPage) {
  389. this.pullUpOn = false
  390. this.nomoreText = '上拉显示更多'
  391. } else {
  392. if (this.orderList.length < 2) {
  393. this.pullUpOn = true
  394. } else {
  395. this.pullUpOn = false
  396. this.nomoreText = '已至底部'
  397. }
  398. }
  399. this.isShowEmpty = false
  400. } else {
  401. this.isShowEmpty = true
  402. }
  403. })
  404. .catch(error => {
  405. this.$util.msg(error.msg, 2000)
  406. })
  407. },
  408. getOnReachBottomData() {
  409. //上拉加载
  410. this.listQuery.pageNum += 1
  411. this.OrderService.SearchOrderInfo(this.listQuery)
  412. .then(response => {
  413. let data = response.data
  414. this.hasNextPage = data.hasNextPage
  415. this.orderList = this.orderList.concat(data.list)
  416. this.pullFlag = false // 防上拉暴滑
  417. setTimeout(() => {
  418. this.pullFlag = true
  419. }, 500)
  420. if (this.hasNextPage) {
  421. this.pullUpOn = false
  422. this.nomoreText = '上拉显示更多'
  423. } else {
  424. this.loadding = false
  425. this.pullUpOn = false
  426. this.nomoreText = '已至底部'
  427. }
  428. })
  429. .catch(error => {
  430. this.$util.msg(error.msg, 2000)
  431. })
  432. },
  433. scrolltolower() {
  434. if (this.hasNextPage) {
  435. this.loadding = true
  436. this.pullUpOn = true
  437. this.showSkeleton = false
  438. this.getOnReachBottomData()
  439. }
  440. },
  441. detail(orderId) {
  442. //订单详情跳转
  443. this.isModalLayer = true
  444. this.$api.navigateTo(`/pages/user/order/order-details?state=${this.currentTab}&orderId=${orderId}`)
  445. },
  446. handButtonConfirm(data) {
  447. //获取点击
  448. this.handShowAlert(data)
  449. this.btnoRderID = data.orderId
  450. },
  451. handShowAlert(data) {
  452. //执行
  453. switch (data.type) {
  454. case 'delete':
  455. this.handOrderDetele(data.orderId)
  456. break
  457. case 'cancel':
  458. this.handCenceConfirm(data.orderId)
  459. break
  460. case 'query':
  461. this.isModalLayer = true
  462. this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + data.orderId)
  463. break
  464. case 'confirm':
  465. this.handOrderConfirm(data.orderId)
  466. break
  467. case 'pay':
  468. this.hanldOrderData = data.order
  469. this.getOrderPaymentValidation(data)
  470. break
  471. case 'confirmation':
  472. this.handOrderConfirmation(data.orderId)
  473. break
  474. case 'payment':
  475. this.hanldConfirmFn(data.orderId)
  476. break
  477. }
  478. },
  479. getOrderPaymentValidation(data) {
  480. //监听根据付款状态做操作
  481. this.OrderService.OrderPaymentValidation({ orderId: data.orderId })
  482. .then(response => {
  483. let data = response.data
  484. this.payModelData = data
  485. if(data.balanceFlag == 1){// 0可以走余额抵扣,1不能走余额抵扣
  486. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  487. }else{
  488. switch (data.code) {
  489. case 1:
  490. this.isPayModel = true
  491. this.modelType = 1
  492. break
  493. case 2:
  494. this.isPayModel = true
  495. this.modelType = 2
  496. break
  497. case -1:
  498. this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
  499. break
  500. default:
  501. if (data.onlinePayFlag == 1) {// 只能线下
  502. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.orderId}`)
  503. } else {
  504. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  505. }
  506. }
  507. }
  508. })
  509. .catch(error => {
  510. this.$util.msg(error.msg, 2000)
  511. })
  512. },
  513. hanldPaymentConfirm(data) {
  514. //余额抵扣跳转
  515. this.OrderService.OrderBalanceDeduction({ orderId: data.order.orderId })
  516. .then(response => {
  517. if (data.type === 2) {
  518. let _data = { orderId: data.order.orderId }
  519. this.$api.navigateTo(
  520. `/pages/user/order/success?type=deduction&data=${JSON.stringify({ data: _data })}`
  521. )
  522. } else {
  523. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.order.orderId}`)
  524. }
  525. })
  526. .catch(error => {
  527. this.$util.msg(error.msg, 2000)
  528. })
  529. },
  530. hanldCancelConfirm(data) {
  531. //不使用余额抵扣直接跳转收银台
  532. if (data.onlinePayFlag === 1) {// 只能线下
  533. this.$api.navigateTo(`/pages/user/order/order-payunder?orderId=${data.orderId}`)
  534. } else {
  535. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${data.orderId}`)
  536. }
  537. },
  538. hanldConfirmFn(orderId) {
  539. //确认打款供应商
  540. this.$util.modal(
  541. '提示',
  542. '确定委托采美平台打款给供应商吗?确定之前请务必确保货品完好?',
  543. '确定',
  544. '取消',
  545. true,
  546. () => {
  547. this.OrderService.confirmpayment({ orderId: orderId })
  548. .then(response => {
  549. this.$util.msg('确认成功', 2000, true, 'success')
  550. setTimeout(() => {
  551. this.getOrderDatainit(this.currentTab)
  552. }, 2000)
  553. })
  554. .catch(error => {
  555. this.$util.msg(error.msg, 2000)
  556. })
  557. }
  558. )
  559. },
  560. handOrderConfirm(orderId) {
  561. //确认收货
  562. this.$util.modal('提示', '是否确认收货', '确定', '取消', true, () => {
  563. this.OrderService.ConfirmReceipt({ orderId: orderId })
  564. .then(response => {
  565. this.beansType = 7
  566. this.beanNumber = 100
  567. this.isActivityBean = true
  568. })
  569. .catch(error => {
  570. this.$util.msg(error.msg, 2000)
  571. })
  572. })
  573. },
  574. handOrderConfirmation(orderId) {
  575. //确认订单
  576. this.$util.modal('提示', '确认此订单?', '确定', '取消', true, () => {
  577. this.OrderService.AffirmOrder({ orderId: orderId })
  578. .then(response => {
  579. this.$util.msg(response.msg, 2000, true, 'success')
  580. setTimeout(() => {
  581. this.getOrderDatainit(this.currentTab)
  582. }, 2000)
  583. })
  584. .catch(error => {
  585. this.$util.msg(error.msg, 2000)
  586. })
  587. })
  588. },
  589. handOrderDetele(orderId) {
  590. //删除订单
  591. this.$util.modal('提示', '确认删除该订单吗?', '确定', '取消', true, () => {
  592. this.OrderService.DeleteOrder({ orderId: orderId })
  593. .then(response => {
  594. this.$util.msg(response.msg, 2000, true, 'success')
  595. setTimeout(() => {
  596. this.getOrderDatainit(this.currentTab)
  597. }, 2000)
  598. })
  599. .catch(error => {
  600. this.$util.msg(error.msg, 2000)
  601. })
  602. })
  603. },
  604. handCenceConfirm(orderId) {
  605. //取消订单
  606. this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
  607. this.OrderService.CancelOrder({ orderId: orderId , userIdentity : 0})
  608. .then(response => {
  609. this.$util.msg(response.msg, 2000, true, 'success')
  610. setTimeout(() => {
  611. this.getOrderDatainit(this.currentTab)
  612. }, 2000)
  613. })
  614. .catch(error => {
  615. this.$util.msg(error.msg, 2000)
  616. })
  617. })
  618. },
  619. onShareAppMessage(res) {
  620. //分享转发
  621. this.isShareModal = false
  622. if (res.from === 'button') {
  623. // 来自页面内转发按钮
  624. }
  625. return {
  626. title: '您有新的分享订单,快来查看吧~',
  627. path: `/pages/user/order/order-sharelogin?orderID=${this.btnoRderID}&userId=${this.listQuery.userId}`,
  628. imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
  629. }
  630. },
  631. setScrollHeight() {
  632. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  633. this.windowHeight = windowHeight - 1
  634. this.scrollHeight = windowHeight - 1
  635. },
  636. PromotionsFormat(promo) {
  637. //促销活动类型数据处理
  638. if (promo != null) {
  639. if (promo.type == 1 && promo.mode == 1) {
  640. return true
  641. } else {
  642. return false
  643. }
  644. }
  645. return false
  646. },
  647. StateExpFormat(state) {
  648. //订单状态文字和颜色
  649. var HtmlStateText = '',
  650. stateTextObject = {
  651. 0: '待确认',
  652. 4: '交易完成',
  653. 5: '订单完成',
  654. 6: '已关闭',
  655. 7: '交易全退',
  656. 77: '交易全退',
  657. 11: '待付款待发货',
  658. 12: '待付款部分发货',
  659. 13: '待付款已发货',
  660. 21: '部分付款待发货',
  661. 22: '部分付款部分发货',
  662. 23: '部分付款已发货',
  663. 31: '已付款待发货',
  664. 32: '已付款部分发货',
  665. 33: '已付款已发货',
  666. 111: '待付款待发货'
  667. }
  668. Object.keys(stateTextObject).forEach(function(key) {
  669. if (key == state) {
  670. HtmlStateText = stateTextObject[key]
  671. }
  672. })
  673. return HtmlStateText
  674. },
  675. handleBeanlClick() {
  676. //关闭采美豆弹窗
  677. this.isActivityBean = false
  678. this.getOrderDatainit()
  679. }
  680. },
  681. onPageScroll(e) {
  682. this.scrollTop = e.scrollTop
  683. },
  684. onShow() {
  685. this.setScrollHeight()
  686. }
  687. }
  688. </script>
  689. <style lang="scss">
  690. @import '@/uni.scss';
  691. page {
  692. background-color: #f7f7f7 !important;
  693. }
  694. .search {
  695. width: 702rpx;
  696. height: 70rpx;
  697. padding: 12rpx 24rpx;
  698. border-bottom: 1px solid #f0f0f0;
  699. position: fixed;
  700. top: 0;
  701. left: 0;
  702. background: #ffffff;
  703. z-index: 1001;
  704. .search-input {
  705. width: 448rpx;
  706. height: 70rpx;
  707. padding: 0 68rpx;
  708. line-height: 70rpx;
  709. border-radius: 40rpx;
  710. position: relative;
  711. background: #f0f0f0;
  712. float: left;
  713. .icon-iconfonticonfontsousuo1 {
  714. font-size: 36rpx;
  715. color: #8a8a8a;
  716. position: absolute;
  717. left: 24rpx;
  718. z-index: 10;
  719. }
  720. .icon-shanchu1 {
  721. font-size: 36rpx;
  722. color: #8a8a8a;
  723. position: absolute;
  724. right: 24rpx;
  725. top: 0;
  726. padding: 0 10rpx;
  727. z-index: 10;
  728. }
  729. input {
  730. width: 448rpx;
  731. height: 70rpx;
  732. background-color: #f0f0f0;
  733. font-size: 26rpx;
  734. }
  735. }
  736. .search-btn {
  737. width: 118rpx;
  738. height: 70rpx;
  739. line-height: 70rpx;
  740. color: $color-system;
  741. font-size: 30rpx;
  742. text-align: center;
  743. float: left;
  744. }
  745. .voice-icon {
  746. width: 36rpx;
  747. height: 36rpx;
  748. padding: 16rpx 20rpx 16rpx 0;
  749. position: absolute;
  750. left: 16rpx;
  751. top: 4rpx;
  752. z-index: 10;
  753. }
  754. }
  755. .search-container {
  756. padding-top: 106rpx;
  757. }
  758. .s-block {
  759. background: #ffffff;
  760. .header {
  761. font-size: 32rpx;
  762. padding: 40rpx 24rpx 22rpx 24rpx;
  763. line-height: 42rpx;
  764. font-size: 30rpx;
  765. font-weight: bold;
  766. position: relative;
  767. .icon-shanchu {
  768. font-size: 36rpx;
  769. color: #333333;
  770. float: right;
  771. padding: 0 10rpx;
  772. z-index: 10;
  773. font-weight: normal;
  774. }
  775. }
  776. .list {
  777. display: flex;
  778. flex-wrap: wrap;
  779. padding-bottom: 40rpx;
  780. view {
  781. color: #8a8a8a;
  782. font-size: 24rpx;
  783. box-sizing: border-box;
  784. text-align: center;
  785. height: 48rpx;
  786. line-height: 48rpx;
  787. border-radius: 24rpx;
  788. margin: 12rpx;
  789. padding: 0 30rpx;
  790. overflow: hidden;
  791. white-space: nowrap;
  792. text-overflow: ellipsis;
  793. background-color: #f3f3f3;
  794. }
  795. }
  796. }
  797. .s-circle {
  798. margin-top: 30rpx;
  799. .header {
  800. font-size: 32rpx;
  801. padding: 30rpx;
  802. border-bottom: 2rpx solid #f9f9f9;
  803. position: relative;
  804. image {
  805. width: 36rpx;
  806. height: 36rpx;
  807. padding: 10rpx;
  808. position: absolute;
  809. right: 40rpx;
  810. top: 24rpx;
  811. }
  812. }
  813. .list {
  814. display: flex;
  815. flex-wrap: wrap;
  816. padding: 0 30rpx 20rpx;
  817. view {
  818. padding: 8rpx 30rpx;
  819. margin: 20rpx 30rpx 0 0;
  820. font-size: 28rpx;
  821. color: #8a8a8a;
  822. background-color: #f7f7f7;
  823. box-sizing: border-box;
  824. text-align: center;
  825. border-radius: 20rpx;
  826. }
  827. }
  828. }
  829. .wanted-block {
  830. margin-top: 30rpx;
  831. .header {
  832. font-size: 32rpx;
  833. padding: 30rpx;
  834. }
  835. .list {
  836. display: flex;
  837. flex-wrap: wrap;
  838. view {
  839. width: 50%;
  840. color: #8a8a8a;
  841. font-size: 28rpx;
  842. box-sizing: border-box;
  843. text-align: center;
  844. padding: 20rpx 0;
  845. border-top: 2rpx solid #fff;
  846. border-left: 2rpx solid #fff;
  847. background-color: #f7f7f7;
  848. overflow: hidden;
  849. white-space: nowrap;
  850. text-overflow: ellipsis;
  851. }
  852. }
  853. }
  854. .wanted-circle {
  855. margin-top: 30rpx;
  856. .header {
  857. font-size: 32rpx;
  858. padding: 30rpx;
  859. }
  860. .list {
  861. display: flex;
  862. flex-wrap: wrap;
  863. padding: 0 30rpx 20rpx;
  864. view {
  865. padding: 8rpx 30rpx;
  866. margin: 20rpx 30rpx 0 0;
  867. font-size: 28rpx;
  868. color: #8a8a8a;
  869. background-color: #f7f7f7;
  870. box-sizing: border-box;
  871. text-align: center;
  872. border-radius: 20rpx;
  873. }
  874. }
  875. }
  876. .order-container {
  877. scroll-view {
  878. height: 100%;
  879. overflow: scroll;
  880. }
  881. }
  882. .container {
  883. padding-bottom: env(safe-area-inset-bottom);
  884. height: auto;
  885. position: relative;
  886. }
  887. .tui-order-content {
  888. width: 100%;
  889. height: auto;
  890. }
  891. .tui-order-list {
  892. width: 100%;
  893. position: relative;
  894. }
  895. .tui-order-item {
  896. display: flex;
  897. flex-direction: column;
  898. width: 702rpx;
  899. padding: 20rpx 24rpx 0 24rpx;
  900. background: #fff;
  901. border-bottom: 20rpx solid #f7f7f7;
  902. }
  903. .order-title {
  904. width: 100%;
  905. height: auto;
  906. .order-title-t {
  907. width: 100%;
  908. height: 68rpx;
  909. float: left;
  910. line-height: 68rpx;
  911. position: relative;
  912. .bage-icon {
  913. width: 50rpx;
  914. height: 50rpx;
  915. display: block;
  916. position: absolute;
  917. right: 0;
  918. top: 9rpx;
  919. }
  920. .bage-buss {
  921. display: inline-block;
  922. width: 72rpx;
  923. height: 30rpx;
  924. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  925. border-radius: 4rpx;
  926. line-height: 30rpx;
  927. font-size: $font-size-22;
  928. text-align: center;
  929. color: #ffffff;
  930. }
  931. .bage-auto {
  932. display: inline-block;
  933. width: 72rpx;
  934. height: 30rpx;
  935. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  936. border-radius: 4rpx;
  937. line-height: 30rpx;
  938. font-size: $font-size-22;
  939. text-align: center;
  940. color: #ffffff;
  941. }
  942. .bage-text {
  943. display: inline-block;
  944. font-size: $font-size-28;
  945. line-height: 68rpx;
  946. text-align: left;
  947. color: $color-system;
  948. margin-left: 10rpx;
  949. }
  950. }
  951. .order-title-b {
  952. width: 100%;
  953. height: 40rpx;
  954. float: left;
  955. margin-top: 8rpx;
  956. .order-title-btxt {
  957. float: left;
  958. font-size: $font-size-28;
  959. line-height: 40rpx;
  960. color: #999999;
  961. text-align: lef;
  962. }
  963. .order-title-tip {
  964. float: right;
  965. font-size: $font-size-28;
  966. line-height: 40rpx;
  967. text-align: right;
  968. color: #ff2a2a;
  969. }
  970. }
  971. }
  972. .goods-title {
  973. width: 100%;
  974. height: 56rpx;
  975. float: left;
  976. margin-top: 10rpx;
  977. .floor-item-act {
  978. height: 56rpx;
  979. text-align: center;
  980. box-sizing: border-box;
  981. float: left;
  982. padding: 10rpx 0;
  983. margin-right: 12rpx;
  984. }
  985. .title-text {
  986. width: 400rpx;
  987. overflow: hidden;
  988. text-overflow: ellipsis;
  989. white-space: nowrap;
  990. float: left;
  991. font-size: $font-size-28;
  992. color: $text-color;
  993. text-align: left;
  994. line-height: 56rpx;
  995. font-weight: bold;
  996. }
  997. }
  998. .goods-item {
  999. width: 100%;
  1000. height: auto;
  1001. }
  1002. .goods-pros-t {
  1003. display: flex;
  1004. align-items: center;
  1005. width: 100%;
  1006. height: 217rpx;
  1007. padding: 24rpx 0;
  1008. .pros-img {
  1009. float: left;
  1010. width: 210rpx;
  1011. height: 100%;
  1012. border-radius: 10rpx;
  1013. margin: 0 26rpx 0 0;
  1014. position: relative;
  1015. .tips {
  1016. display: inline-block;
  1017. width: 80rpx;
  1018. height: 40rpx;
  1019. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  1020. line-height: 40rpx;
  1021. text-align: center;
  1022. font-size: $font-size-24;
  1023. color: #ffffff;
  1024. border-radius: 10rpx 0 10rpx 0;
  1025. position: absolute;
  1026. top: 0;
  1027. left: 0;
  1028. }
  1029. image {
  1030. width: 210rpx;
  1031. height: 210rpx;
  1032. border-radius: 10rpx;
  1033. border: 1px solid #f3f3f3;
  1034. }
  1035. }
  1036. }
  1037. .pros-product {
  1038. width: 468rpx;
  1039. height: 100%;
  1040. line-height: 36rpx;
  1041. font-size: $font-size-26;
  1042. position: relative;
  1043. .producttitle {
  1044. width: 100%;
  1045. display: inline-block;
  1046. height: auto;
  1047. text-overflow: ellipsis;
  1048. display: -webkit-box;
  1049. word-break: break-all;
  1050. -webkit-box-orient: vertical;
  1051. -webkit-line-clamp: 2;
  1052. overflow: hidden;
  1053. margin-bottom: 8rpx;
  1054. }
  1055. .productspec {
  1056. height: 36rpx;
  1057. color: #999999;
  1058. }
  1059. .productprice {
  1060. height: 48rpx;
  1061. position: absolute;
  1062. width: 100%;
  1063. bottom: 0;
  1064. .price {
  1065. line-height: 48rpx;
  1066. font-size: $font-size-28;
  1067. width: 48%;
  1068. color: #ff2a2a;
  1069. float: left;
  1070. font-weight: bold;
  1071. &.none {
  1072. text-decoration: line-through;
  1073. color: #999999;
  1074. }
  1075. }
  1076. .count {
  1077. height: 100%;
  1078. float: right;
  1079. position: relative;
  1080. .small {
  1081. color: #666666;
  1082. }
  1083. }
  1084. }
  1085. .floor-item-act {
  1086. width: 100%;
  1087. height: 56rpx;
  1088. text-align: center;
  1089. box-sizing: border-box;
  1090. float: left;
  1091. padding: 0 0 10rpx 0;
  1092. }
  1093. }
  1094. .order-footer {
  1095. width: 100%;
  1096. height: 78rpx;
  1097. float: left;
  1098. .order-footer-top {
  1099. width: 100%;
  1100. height: 34rpx;
  1101. line-height: 34rpx;
  1102. font-size: $font-size-24;
  1103. color: #999999;
  1104. text-align: right;
  1105. }
  1106. .order-footer-bot {
  1107. width: 100%;
  1108. float: left;
  1109. height: 48rpx;
  1110. line-height: 48rpx;
  1111. font-size: $font-size-28;
  1112. font-weight: bold;
  1113. color: $text-color;
  1114. .count {
  1115. width: 50%;
  1116. float: left;
  1117. text-align: left;
  1118. }
  1119. .money {
  1120. width: 50%;
  1121. float: right;
  1122. text-align: right;
  1123. }
  1124. }
  1125. }
  1126. </style>