other-demand.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view>
  3. <checkbox-group active-color="#00c28e" @change="radioGroupChange">
  4. <view class="w100 ptb-30 plr-36 flex flex-reverse" v-for="(item,i) in list" :key="i">
  5. <checkbox :value="item.value" :checked="item.checked">
  6. <text>{{item.name}}</text>
  7. </checkbox >
  8. </view>
  9. </checkbox-group>
  10. <view class="fixed-bottom pb-60 plr-36">
  11. <u-button type="primary" @click="submit">确认</u-button>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. list: [{
  20. name: '搬运服务(和司机商议定价)',
  21. checked: false,
  22. value: '1'
  23. },
  24. {
  25. name: '返程(附加40%路费)',
  26. checked: false,
  27. value:'2'
  28. },
  29. {
  30. name: '电梯房(和司机商议定价)',
  31. checked: false,
  32. value:'3'
  33. },
  34. {
  35. name: '小推车(免费)',
  36. checked: false,
  37. value:'4'
  38. },
  39. {
  40. name: '拍照回单(免费)',
  41. checked: false,
  42. value:'5'
  43. },
  44. {
  45. name: '纸质回单(商议价格)',
  46. checked: false,
  47. value:'6'
  48. },
  49. {
  50. name: '代收货款(免费;贷款上限一万元)',
  51. checked: false,
  52. value:'7'
  53. }],
  54. demand:'',
  55. name:''
  56. };
  57. },
  58. methods: {
  59. radioGroupChange(e) {
  60. console.log(e.detail.value);
  61. let arr = []
  62. this.list.forEach(item=>{
  63. if(item.value == e.detail.value[0]){
  64. arr.push(item.name.split('(')[0])
  65. }
  66. if(item.value == e.detail.value[1]){
  67. arr.push(item.name.split('(')[0])
  68. }
  69. })
  70. this.name = arr.toString()
  71. this.demand = e.detail.value.toString()
  72. },
  73. submit(){
  74. uni.$emit('demand',{
  75. demand: this.demand,
  76. demand_name: this.name
  77. })
  78. uni.navigateBack({
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. /deep/.u-primary-hover {
  86. background: linear-gradient(to right,#00b6b4,#00d496) !important;
  87. }
  88. /deep/.u-btn--primary--disabled {
  89. background-color: $bg-1 !important;
  90. }
  91. .flex-reverse {
  92. flex-direction: row-reverse;
  93. }
  94. checkbox{
  95. width: 100%;
  96. }
  97. /deep/uni-checkbox .uni-checkbox-wrapper{
  98. width: 100%;
  99. justify-content: space-between;
  100. flex-direction: row-reverse;
  101. }
  102. </style>