app-formRadio-btn.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <tui-list-cell class="line-cell code-wrap" :hover="false">
  3. <view class="tui-title">{{ title }}</view>
  4. <view>
  5. <button
  6. v-for="(item, index) in selectOptions"
  7. :key="index"
  8. @click="changeWay(index, item)"
  9. :class="[
  10. 'admin-button-com',
  11. 'mini-btn',
  12. currenSelect == item.id ? 'blue' : 'default'
  13. ]"
  14. >
  15. {{ item.name }}
  16. </button>
  17. </view>
  18. </tui-list-cell>
  19. </template>
  20. <script>
  21. import TuiListCell from "@/components/plugin/list-cell";
  22. export default {
  23. name: "AppFormRadioBtn",
  24. components: {
  25. TuiListCell
  26. },
  27. props: {
  28. title: {
  29. type: String,
  30. default: ""
  31. },
  32. currenSelect: {
  33. style: String,
  34. default: "1"
  35. },
  36. selectOptions: {
  37. type: Array, //1自取 2本店送 3快递送
  38. default: () => [
  39. { name: "自取", id: "1" },
  40. { name: "本店送", id: "2" },
  41. { name: "快递送", id: "3" }
  42. ]
  43. }
  44. },
  45. methods: {
  46. changeWay(index, item) {
  47. this.$emit("update:currenSelect", item.id);
  48. this.$emit("selectBack", { index: index, item: item });
  49. }
  50. }
  51. };
  52. </script>
  53. <style lang="scss" scoped>
  54. .admin-button-com {
  55. margin-right: 20upx;
  56. }
  57. // 公共
  58. .line-cell {
  59. .tui-title {
  60. width: 210upx;
  61. color: $fontColor2;
  62. }
  63. .tui-input {
  64. width: calc(100% - 210upx);
  65. font-size: 28upx;
  66. }
  67. .tui-placeholder {
  68. color: #ccc;
  69. }
  70. .phcolor {
  71. color: #ccc;
  72. }
  73. }
  74. </style>