goods-select.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="slot">
  3. <view class="item" @click="openSkuSelect">
  4. <view class="info">
  5. <view class="label">已选:</view>
  6. <view class="value">{{ selectedSku.difference || '请选择规格' }}</view>
  7. </view>
  8. <view class="operate"><u-icon name="more-dot-fill" :color="iconColor"></u-icon></view>
  9. </view>
  10. <!-- <view class="item" @click="goAddressPage">
  11. <view class="info">
  12. <view class="label">送至</view>
  13. <view class="value">{{ selectedAddress.detail_address || '请选择地址' }}</view>
  14. </view>
  15. <view class="operate"><u-icon name="more-dot-fill" :color="iconColor"></u-icon></view>
  16. </view> -->
  17. <view class="item" v-if="expressInfo&&expressInfo.express_type">
  18. <!-- {{JSON.stringify(expressInfo)}} -->
  19. <view class="info" :class="{'red':['1','3','4'].includes(expressInfo.express_type)}">
  20. <!-- <view class="label">优惠:</view> -->
  21. <!-- "express_type": "1",//运费类型:1=全场包邮,2=全场不包邮,3=全场满x包邮,4=全场满x包邮偏远地区除外 -->
  22. <view class="value">{{expressInfo|filterExpresToTitle}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'goods-select',
  30. props: {
  31. selectedSku: {
  32. type: Object,
  33. default: () => {
  34. return {};
  35. }
  36. },
  37. selectedAddress: {
  38. type: Object,
  39. default: {}
  40. },
  41. expressInfo: {
  42. type: Object,
  43. default: ()=>{
  44. return {express_type:null}
  45. }
  46. }
  47. },
  48. data() {
  49. return {
  50. iconColor: this.$appTheme.appThemeTextGrayColor,
  51. addressInfo:{},
  52. };
  53. },
  54. computed: {
  55. },
  56. onLoad() {
  57. },
  58. filters:{
  59. filterExpresToTitle(e){
  60. switch (Number(e.express_type)){
  61. case 1:
  62. return "全场包邮"
  63. break;
  64. case 2:
  65. return "基础运费"+e.base_express_fee+"元"
  66. break;
  67. case 3:
  68. return "全场满"+e.min_buy_amount+"元包邮"
  69. break;
  70. case 4:
  71. return "全场满"+e.min_buy_amount+"包邮(偏远地区除外)"
  72. break;
  73. default:
  74. break;
  75. }
  76. }
  77. },
  78. methods: {
  79. // 通知打开sku选择框
  80. openSkuSelect() {
  81. this.$emit('openSku');
  82. },
  83. // 跳转收货地址页面
  84. goAddressPage() {
  85. uni.navigateTo({
  86. url: '/pages-mine/pages/address/list?isSelect=true&isBack=true'
  87. });
  88. }
  89. }
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. .slot {
  94. padding: 30rpx;
  95. background-color: #fff;
  96. margin-bottom: 16rpx;
  97. .item {
  98. display: flex;
  99. justify-content: space-between;
  100. align-items: center;
  101. margin-bottom: 30rpx;
  102. &:last-child {
  103. margin-bottom: 0;
  104. }
  105. .info {
  106. display: flex;
  107. align-items: center;
  108. .label {
  109. font-size: 28rpx;
  110. font-weight: 400;
  111. color: $app-theme-card-gray-deep-color;
  112. margin-right: 30rpx;
  113. }
  114. .value {
  115. font-size: 28rpx;
  116. font-weight: 400;
  117. color: $app-theme-text-black-color;
  118. }
  119. &.red{
  120. .value{
  121. color:$app-theme-text-money-color;
  122. }
  123. }
  124. }
  125. .operate {
  126. }
  127. }
  128. }
  129. </style>