logistics-list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="container logistics clearfix">
  3. <view class="list-cell-item" :class="isACtive ? 'active' : ''" v-for="(item,index) in companyList" :key="index" >
  4. <view class="item-name">{{item.name}}</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:true,
  19. companyList:[
  20. {name:'顺丰快递'},
  21. {name:'申通快递'},
  22. {name:'韵达快递'},
  23. {name:'圆通快递'},
  24. {name:'中通快递'},
  25. {name:'德邦物流'},
  26. {name:'菜鸟裹裹'}
  27. ]
  28. }
  29. },
  30. onLoad(option){
  31. console.log(option)
  32. // this.initGetCartGoodsList();
  33. },
  34. computed: {
  35. ...mapState(['hasLogin','userInfo'])
  36. },
  37. methods:{
  38. initGetCartGoodsList(){//初始化购物车 index:1
  39. let params = {userID:this.userID}
  40. queryShoppingCartList(params).then(response =>{
  41. this.$store.commit('updateAllNum',response.data.cartQuantity)
  42. const responseData = response.data
  43. if(responseData.pageDate && responseData.pageDate.length > 0 ){
  44. this.productsList = responseData.pageDate;
  45. this.productsList.forEach((item,index) => {
  46. let productsListLength = item.productsList.length,
  47. invalidLength = 0;
  48. item.productsList.forEach(pros => {
  49. pros.shopID = item.shopID;
  50. if(pros.validFlag == '3' ) {invalidLength++;}
  51. })
  52. item.isDisabled = invalidLength === productsListLength;
  53. })
  54. } else {
  55. this.productsList = [];
  56. }
  57. }).catch(error =>{
  58. this.$util.msg(error.msg,2000);
  59. })
  60. },
  61. },
  62. onPullDownRefresh() {//下拉刷新
  63. // this.initGetCartGoodsList()
  64. // uni.stopPullDownRefresh()
  65. },
  66. onShow(){
  67. },
  68. }
  69. </script>
  70. <style lang="scss">
  71. page{
  72. background: #f7f7f7;
  73. height: auto;
  74. }
  75. .logistics{
  76. width: 702rpx;
  77. padding: 0 24rpx;
  78. border-top: 1px solid #F7F7F7;
  79. background-color: #FFFFFF;
  80. .list-cell-item{
  81. width: 702rpx;
  82. height: 88rpx;
  83. line-height: 88rpx;
  84. border-bottom: 1px solid #F7F7F7;
  85. &.active{
  86. .item-name{
  87. color: $color-system;
  88. }
  89. .item-icon{
  90. color: $color-system;
  91. }
  92. }
  93. .item-name{
  94. float: left;
  95. font-size: $font-size-28;
  96. color: $text-color;
  97. }
  98. .item-icon{
  99. width:88rpx;
  100. height: 88rpx;
  101. float: right;
  102. line-height: 88rpx;
  103. text-align: center;
  104. .icon-gou{
  105. font-size: $font-size-44;
  106. }
  107. }
  108. }
  109. }
  110. </style>