mySaleOrder.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <template>
  2. <!-- <app-layout :haveBackground="false"> -->
  3. <app-layout >
  4. <view class="page">
  5. <!-- <view style="background-color: #fff;position: fixed;top: 0;width: 100%;"> -->
  6. <view style="background-color: #fff;">
  7. <view class="main-left cross-center search" @click="toSearch">
  8. <image src="https://t17.9026.com/web/statics/image/index/search.png" mode=""></image>
  9. <view v-if="search.keyword || search.dateArr[0] || search.dateArr[1]" class=" main-left cross-center hjx-tc-222">
  10. <view v-if="search.dateArr[0]">{{search.dateArr[0]}}</view>
  11. <view v-if="search.dateArr[1]"><text v-if="search.dateArr[0]">至</text>{{search.dateArr[1]}}</view>
  12. <view v-if="search.keyword"><text v-if="search.dateArr[0] || search.dateArr[1]">,</text>{{search.keyword}}</view>
  13. </view>
  14. <view v-else class="hjx-tc-999">
  15. 搜索客户、商品名称、时间、订单号
  16. </view>
  17. </view>
  18. </view>
  19. <view style="background-color: #fff;position: sticky;top: 0;width: 100%;">
  20. <AppDropdownMenu :size="28" :selectedColor="getTheme.color" :checkboxColor="getTheme.color"
  21. :options="options[selectIndex]" :minWidth="750" @click="rangeItemClick" @close="rangeClose"
  22. ref="ddmRange">
  23. <view class="main-between">
  24. <view class="fui-filter__item" @tap="filterTap(0)">
  25. <text>{{range}}</text>
  26. <view class="fui-filter__icon cross-center" :class="{'fui-icon__ani':rangeShow}">
  27. <image style="width: 16rpx;height: 9rpx;margin:0 11rpx;"
  28. src="https://t17.9026.com/web/statics/image/index/arrow-down-bottom.png" mode="">
  29. </image>
  30. </view>
  31. </view>
  32. <view class="fui-filter__item" @tap="filterTap(1)">
  33. <text>{{range1}}</text>
  34. <view class="fui-filter__icon cross-center" :class="{'fui-icon__ani':rangeShow1}">
  35. <image style="width: 16rpx;height: 9rpx;margin:0 11rpx;"
  36. src="https://t17.9026.com/web/statics/image/index/arrow-down-bottom.png" mode="">
  37. </image>
  38. </view>
  39. </view>
  40. </view>
  41. </AppDropdownMenu>
  42. </view>
  43. <!-- </view> -->
  44. <view class="list">
  45. <view class="box" v-for="(item,index) in dataList" :key="index">
  46. <view class="main-between cross-center header">
  47. <view class="cross-center head" :class="{'border_bottom':true}">
  48. <image :src="item.user.avatar" mode=""></image>
  49. {{item.user.nickname}}{{item.user.estate_name?`-${item.user.estate_name}`:''}}
  50. </view>
  51. <!-- <view class="cross-center head1">
  52. <image src="https://t17.9026.com/web/statics/image/sale/1.png" mode=""></image>
  53. 客户楼盘绑定通知
  54. </view> -->
  55. <view class="main-between cross-center">
  56. <view class="order_status">{{item.status_text}}</view>
  57. <!-- <image class="del" src="https://t17.9026.com/web/statics/image/user-center/del.png" mode="">
  58. </image> -->
  59. </view>
  60. </view>
  61. <view class="center">
  62. <view class="main-between goods" v-for="(goods,index1) in item.detail" :key="index1" @click="$jump({open_type:'navigate',url:'/pages/goods/goods?id='+goods.goods_id})">
  63. <view class="main-left desc">
  64. <image class="goods-img" :src="goods.goods_info.pic_url"
  65. mode=""></image>
  66. <view>
  67. <view class="title t-omit-two">{{goods.goods_info.name}}</view>
  68. <view class="main-between price">
  69. <view>
  70. <text class="company">¥</text>
  71. <text>{{goods.unit_price}}</text>
  72. </view>
  73. <view>
  74. x{{goods.num}}
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- <view class="isopen cross-center">
  80. 收起
  81. <image src="https://t17.9026.com/web/statics/image/user-center/arrow-top.png" mode=""></image>
  82. </view> -->
  83. </view>
  84. <view class="main-between cross-bottom total_pay">
  85. <view class="order_number">订单号:{{item.order_no}}</view>
  86. <view><text>应付总</text><text>¥</text><text>{{item.total_price}}</text></view>
  87. </view>
  88. </view>
  89. <view class="main-between footer cross-center border_top">
  90. <template>
  91. <view class="date">{{item.updated_at.split(' ')[0]}}</view>
  92. <view class="main-around">
  93. <!-- <view class="kbtn">上传发票</view> -->
  94. <!-- <view class="kbtn" @click="$jump({'open_type':'navigate','url':'/pages/cart/cart'})">再次购买</view> -->
  95. <view class="kbtn" v-if="item.status===1 && isShowExpressButton(item)" @click="logistics(item)">查看物流</view>
  96. </view>
  97. </template>
  98. <!-- <template v-if="false">
  99. <view class="left">查看详情</view>
  100. <image style="width: 12rpx;height: 22rpx;"
  101. src="https://t17.9026.com/web/statics/image/index/arrow-right-gray.png" mode=""></image>
  102. </template> -->
  103. </view>
  104. </view>
  105. <view class="no-more" v-if="isNoMore && dataList.length>0">没有更多了...</view>
  106. <app-no-goods v-if="dataList.length===0" :title="`暂无订单`" background="#f7f7f7"></app-no-goods>
  107. </view>
  108. <template>
  109. <view class="safe-area-inset-bottom">
  110. <view :style="{height: '110rpx'}" class="nav-margin "
  111. :class="haveBackground ? 'app-layout-background' : ''"></view>
  112. </view>
  113. <app-tab-bar :page-count="0"></app-tab-bar>
  114. </template>
  115. </view>
  116. </app-layout>
  117. </template>
  118. <script>
  119. import {
  120. mapGetters,
  121. mapState
  122. } from 'vuex'
  123. import AppTabBar from '@/components/basic-component/app-tab-bar/app-tab-bar.vue';
  124. import AppDropdownMenu from '@/components/fui-dropdown-menu/fui-dropdown-menu.vue';
  125. import appNoGoods from '@/components/page-component/app-no-goods/app-no-goods.vue';
  126. export default {
  127. components: {
  128. AppTabBar,
  129. AppDropdownMenu,
  130. appNoGoods,
  131. },
  132. data() {
  133. return {
  134. dataList:[],
  135. options: [
  136. [
  137. // {
  138. // text: '订单状态',
  139. // value: 0,
  140. // checked: true
  141. // },
  142. {
  143. text: '全部',
  144. value: 0
  145. }, {
  146. text: '待付款',
  147. value: 1
  148. },{
  149. text: '待发货',
  150. value: 2
  151. },{
  152. text: '待收货',
  153. value: 3
  154. },{
  155. text: '已完成',
  156. value: 4
  157. },
  158. ],
  159. [{
  160. text: '全部客户',
  161. value: 0,
  162. checked: true
  163. }, {
  164. text: '已认证',
  165. value: 2
  166. }, {
  167. text: '未认证',
  168. value: 1
  169. }]
  170. ],
  171. range: '订单状态',
  172. status:0,
  173. range1: '全部客户',
  174. user_verify_status:0,
  175. selectIndex: 0,
  176. rangeShow: false,
  177. rangeShow1: false,
  178. search: {
  179. keyword: '',
  180. dateArr: []
  181. },
  182. isRequest: true, //防止数据重复加载
  183. page:1,
  184. isNoMore:false,
  185. timer:'',
  186. };
  187. },
  188. computed: {
  189. ...mapGetters('mallConfig', {
  190. getTheme: 'getTheme'
  191. }),
  192. ...mapState({
  193. info:state=>state.user.info
  194. })
  195. },
  196. onShow() {
  197. uni.hideHomeButton()
  198. this.timer=setTimeout(()=>{
  199. this.$storage.getStorage({
  200. key: 'search',
  201. success:(res)=> {
  202. this.search = res.data;
  203. let interval = setInterval(()=> {
  204. if (this.isRequest) {
  205. this.page = 1;
  206. this.getDataList()
  207. // this.$store.dispatch('gConfig/setTabBarBoolean', this.tabBarNavs.navs);
  208. }
  209. clearInterval(interval)
  210. }, 300);
  211. },
  212. fail:()=> {
  213. let interval = setInterval(()=> {
  214. if (this.isRequest) {
  215. this.page = 1;
  216. this.getDataList()
  217. // this.$store.dispatch('gConfig/setTabBarBoolean', this.tabBarNavs.navs);
  218. }
  219. clearInterval(interval)
  220. }, 300);
  221. }
  222. });
  223. }, 0)
  224. },
  225. onReachBottom() {
  226. if(!this.isNoMore){
  227. this.page++
  228. this.getDataList()
  229. }
  230. },
  231. methods: {
  232. toSearch() {
  233. uni.navigateTo({
  234. url: `/pages/order/search/search`
  235. })
  236. },
  237. // 物流信息
  238. logistics(orderDetail) {
  239. if (orderDetail.is_send == 1 && orderDetail.detailExpress.length == 0) {
  240. // 兼容
  241. let [id, express, express_no, customer_name, cover_pic] = [orderDetail.id, orderDetail.express, orderDetail.express_no, orderDetail.customer_name, orderDetail.detail[0].goods_info.pic_url];
  242. uni.navigateTo({
  243. url: `/pages/order/express-detail/express-detail?id=${id}&express=${express}&express_no=${express_no}&customer_name=${customer_name}&cover_pic=${cover_pic}`
  244. })
  245. } else if (orderDetail.is_send == 1 && orderDetail.detailExpress.length == 1 && orderDetail.send_type != 2) {
  246. let express = orderDetail.detailExpress[0].express;
  247. let express_no = orderDetail.detailExpress[0].express_no;
  248. let customer_name = orderDetail.detailExpress[0].customer_name;
  249. let cover_pic = orderDetail.detailExpress[0].expressRelation[0].orderDetail.goods_info.goods_attr.cover_pic;
  250. uni.navigateTo({
  251. url: `/pages/order/express-detail/express-detail?express=` + express + `&customer_name=` + customer_name + `&express_no=` + express_no + `&cover_pic=` + cover_pic
  252. })
  253. } else if (orderDetail.detailExpress.length >= 1) {
  254. uni.navigateTo({
  255. url: '/pages/order/express-list/express-list?order_id=' + orderDetail.id
  256. });
  257. }
  258. },
  259. isShowExpressButton: function(order) {
  260. if (order.is_send) {
  261. if (order.detailExpress.length == 1 && order.detailExpress[0].send_type == 2 && order.send_type == 0) {
  262. return false;
  263. }
  264. if (order.is_confirm == 0) {
  265. return true;
  266. }
  267. }
  268. return false;
  269. },
  270. getDataList(){
  271. this.isRequest = false;
  272. this.$showLoading()
  273. this.$request({
  274. url:this.$api.order.list,
  275. data:{
  276. status: this.status,
  277. keyword: this.search ? this.search.keyword : '',
  278. dateArr: this.search ? JSON.stringify(this.search.dateArr) : JSON.stringify([]),
  279. page: this.page,
  280. sale_id:this.info.salesperson_id,
  281. user_verify_status:this.user_verify_status,
  282. },
  283. method:'get'
  284. }).then(res=>{
  285. this.$hideLoading()
  286. if(res.code===0){
  287. if(this.page===1){
  288. this.dataList=res.data.list
  289. }else{
  290. this.dataList=this.dataList.concat(res.data.list)
  291. }
  292. if(res.data.list.length<20){
  293. this.isNoMore=true
  294. }
  295. }
  296. this.isRequest = true;
  297. })
  298. },
  299. filterTap(i) {
  300. this.selectIndex = i
  301. //显示下拉框
  302. this.$refs.ddmRange.show()
  303. this.selectIndex ? this.rangeShow1 = true : this.rangeShow = true
  304. },
  305. rangeItemClick(e) {
  306. if(this.selectIndex){
  307. this.range1 = e.text
  308. this.user_verify_status=e.value
  309. }else{
  310. this.range = e.text
  311. this.status=e.value
  312. }
  313. this.getDataList()
  314. this.rangeClose()
  315. },
  316. rangeClose() {
  317. this.selectIndex ? this.rangeShow1 = false : this.rangeShow = false
  318. },
  319. search(){
  320. this.page=1
  321. this.getDataList()
  322. }
  323. },
  324. onUnload() {
  325. clearTimeout(this.timer)
  326. }
  327. }
  328. </script>
  329. <style lang="scss" scoped>
  330. .page {
  331. min-height: 100vh;
  332. }
  333. .fui-filter__item {
  334. width: 100%;
  335. height: 88rpx;
  336. display: flex;
  337. align-items: center;
  338. justify-content: center;
  339. font-size: 30rpx;
  340. /* #ifdef H5 */
  341. cursor: pointer;
  342. /* #endif */
  343. background-color: #fff;
  344. }
  345. .fui-filter__icon {
  346. transition: all .15s linear;
  347. }
  348. .fui-icon__ani {
  349. transform: rotate(180deg);
  350. }
  351. .nav-margin {
  352. width: #{750rpx};
  353. }
  354. .search {
  355. width: 680rpx;
  356. height: 82rpx;
  357. // background: #FFFFFF;
  358. border: 1rpx solid #EEEEEE;
  359. border-radius: 82rpx;
  360. margin: 0 auto;
  361. padding-left: 22rpx;
  362. font-size: 24rpx;
  363. image {
  364. width: 22rpx;
  365. height: 22rpx;
  366. margin-right: 18rpx;
  367. }
  368. }
  369. .list {
  370. margin-top: 20rpx;
  371. }
  372. .box {
  373. width: 750rpx;
  374. height: auto;
  375. background: #ffffff;
  376. // border-radius: 6rpx;
  377. padding: 26rpx 31rpx;
  378. margin: 0 auto 20rpx;
  379. .border_bottom {
  380. border-bottom: 1px solid #eaeaea;
  381. }
  382. .border_top {
  383. border-top: 1px solid #eaeaea;
  384. }
  385. .header {
  386. padding-bottom: 21rpx;
  387. .head {
  388. max-width: 500rpx;
  389. height: 48rpx;
  390. background: #f6f6f6;
  391. border-radius: 24rpx;
  392. padding: 0 17rpx;
  393. overflow: hidden;
  394. image {
  395. width: 32rpx;
  396. height: 32rpx;
  397. margin-right: 14rpx;
  398. border-radius: 50%;
  399. }
  400. font-size: 24rpx;
  401. font-weight: 500;
  402. color: #666666;
  403. }
  404. .head1 {
  405. max-width: 500rpx;
  406. height: 48rpx;
  407. overflow: hidden;
  408. image {
  409. width: 45rpx;
  410. height: 45rpx;
  411. margin-right: 14rpx;
  412. border-radius: 50%;
  413. }
  414. font-size: 30rpx;
  415. font-weight: bold;
  416. color: #222222;
  417. }
  418. .order_status {
  419. text-align: right;
  420. font-size: 22rpx;
  421. font-weight: 500;
  422. color: #222222;
  423. }
  424. .del {
  425. width: 36rpx;
  426. height: 36rpx;
  427. }
  428. }
  429. .center {
  430. padding: 0 0 10rpx;
  431. .title {
  432. font-size: 30rpx;
  433. font-weight: bold;
  434. color: #222222;
  435. }
  436. .isopen {
  437. font-size: 24rpx;
  438. font-weight: bold;
  439. color: #a18353;
  440. image {
  441. width: 19rpx;
  442. height: 12rpx;
  443. margin-left: 8rpx;
  444. }
  445. }
  446. .center-text {
  447. margin-top: 20rpx;
  448. font-size: 24rpx;
  449. font-weight: 500;
  450. color: #999999;
  451. line-height: 34rpx;
  452. }
  453. .center-img {
  454. margin-top: 28rpx;
  455. image {
  456. width: 146rpx;
  457. height: 96rpx;
  458. border-radius: 12rpx;
  459. margin-right: 15rpx;
  460. }
  461. }
  462. .goods {
  463. // padding-top: 42rpx;
  464. // border-top: 1rpx solid #EAEAEA;
  465. .desc {
  466. width: 100%;
  467. height: 156rpx;
  468. // background: #F8F8F8;
  469. border-radius: 6rpx;
  470. padding: 18rpx 0 18rpx 0;
  471. .goods-img {
  472. width: 120rpx;
  473. height: 120rpx;
  474. border-radius: 8rpx;
  475. margin-right: 21rpx;
  476. }
  477. .title {
  478. width: 478rpx;
  479. font-size: 26rpx;
  480. font-weight: 500;
  481. color: #222222;
  482. line-height: 34rpx;
  483. }
  484. .price {
  485. width: 520rpx;
  486. font-size: 24rpx;
  487. font-weight: 500;
  488. color: #222222;
  489. line-height: 36rpx;
  490. .company {}
  491. }
  492. }
  493. }
  494. .total_pay {
  495. font-size: 24rpx;
  496. color: #222222;
  497. line-height: 34px;
  498. .order_number{
  499. font-size: 22rpx;
  500. font-weight: 500;
  501. color: #838584;
  502. }
  503. &>text:nth-child(1) {
  504. font-weight: 500;
  505. margin-right: 8rpx;
  506. }
  507. &>text:nth-child(2) {
  508. font-weight: 500;
  509. font-size: 20rpx;
  510. }
  511. &>text:nth-child(3) {
  512. font-weight: 600;
  513. }
  514. }
  515. }
  516. .footer {
  517. padding: 28rpx 0 0;
  518. .left {
  519. font-size: 28rpx;
  520. font-weight: 500;
  521. color: #666666;
  522. }
  523. .date {
  524. font-size: 22rpx;
  525. font-weight: 500;
  526. color: #838584;
  527. line-height: 34rpx;
  528. }
  529. .kbtn {
  530. width: 138rpx;
  531. height: 52rpx;
  532. border: 1rpx solid #999999;
  533. border-radius: 4rpx;
  534. font-size: 20rpx;
  535. font-weight: 500;
  536. color: #222222;
  537. text-align: center;
  538. line-height: 52rpx;
  539. margin-left: 20rpx;
  540. }
  541. }
  542. }
  543. .no-more {
  544. font-size: 24rpx;
  545. font-weight: 500;
  546. color: #666666;
  547. text-align: center;
  548. line-height: 80rpx;
  549. }
  550. </style>