logistics-list.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="container logistics clearfix">
  3. <view class="list-cell-item" :class="selectID == item.id ? 'active' : ''" v-for="(item,index) in companyList" :key="item.id" @click="checkLogics(item)">
  4. <view class="item-name">{{item.label}}</view>
  5. <view class="item-icon"><text class="iconfont icon-gou"></text></view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import authorize from '@/common/config/authorize.js'
  11. import { mapState,mapMutations } from 'vuex';
  12. import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js"
  13. export default{
  14. data(){
  15. return{
  16. CustomBar:this.CustomBar,// 顶部导航栏高度
  17. isIphoneX:this.$store.state.isIphoneX,
  18. isACtive:false,
  19. companyList:[],
  20. selectID:'',
  21. }
  22. },
  23. onLoad(option){
  24. this.selectID = option.selectID
  25. this.initGetLogisticsCompany();
  26. },
  27. computed: {
  28. ...mapState(['hasLogin','userInfo'])
  29. },
  30. methods:{
  31. initGetLogisticsCompany(){//查询物流公司列表
  32. let params = {userID:this.userID}
  33. this.ShopService.GetLogisticsCompany({}).then(response =>{
  34. this.companyList = response.data
  35. }).catch(error =>{
  36. this.$util.msg(error.msg,2000);
  37. })
  38. },
  39. checkLogics(item){//选择物流
  40. uni.setStorageSync('selectLogics',item)
  41. var pages = getCurrentPages();
  42. var prevPage = pages[pages.length - 2]; //上一个页面
  43. prevPage.setData({select:'select'})
  44. uni.navigateBack();
  45. }
  46. },
  47. onPullDownRefresh() {//下拉刷新
  48. this.initGetLogisticsCompany()
  49. uni.stopPullDownRefresh()
  50. },
  51. onShow(){
  52. },
  53. }
  54. </script>
  55. <style lang="scss">
  56. page{
  57. background: #f7f7f7;
  58. height: auto;
  59. }
  60. .logistics{
  61. width: 702rpx;
  62. padding: 0 24rpx;
  63. border-top: 1px solid #F7F7F7;
  64. background-color: #FFFFFF;
  65. .list-cell-item{
  66. width: 702rpx;
  67. height: 88rpx;
  68. line-height: 88rpx;
  69. border-bottom: 1px solid #F7F7F7;
  70. &.active{
  71. .item-name{
  72. color: $color-system;
  73. }
  74. .item-icon{
  75. color: $color-system;
  76. }
  77. }
  78. .item-name{
  79. float: left;
  80. font-size: $font-size-28;
  81. color: $text-color;
  82. }
  83. .item-icon{
  84. width:88rpx;
  85. height: 88rpx;
  86. float: right;
  87. line-height: 88rpx;
  88. text-align: center;
  89. .icon-gou{
  90. font-size: $font-size-44;
  91. }
  92. }
  93. }
  94. }
  95. </style>