search-order.vue 28 KB

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