加油站付款小程序,打印小票
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.6 KiB

6 months ago
  1. <template>
  2. <view>
  3. <view>
  4. <uni-drawer ref="mode1" mode="left" :width="200">
  5. <view class="bottom-line" style="line-height: 72rpx; margin: 0 52rpx;"
  6. v-for="ele in drawerData1" @click="oncuechange1(ele)">{{ ele.name }}</view>
  7. </uni-drawer>
  8. <uni-drawer ref="mode2" mode="left" :width="200">
  9. <view class="bottom-line" style="line-height: 72rpx; margin: 0 52rpx;"
  10. v-for="ele in drawerData2" @click="oncuechange2(ele)">{{ ele.name }}</view>
  11. </uni-drawer>
  12. <uni-drawer ref="mode3" mode="left" :width="200">
  13. <view class="bottom-line" style="line-height: 72rpx; margin: 0 52rpx;"
  14. v-for="ele in drawerData3" @click="oncuechange3(ele)">{{ ele.name }}</view>
  15. </uni-drawer>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. drawerData1: [],
  24. drawerData2: [],
  25. drawerData3: [],
  26. value: []
  27. }
  28. },
  29. methods: {
  30. open(categorys){
  31. this.value = []
  32. this.drawerData1 = categorys
  33. this.$refs.mode1.open()
  34. },
  35. oncuechange1(ele){
  36. this.value.push(ele.name)
  37. if (ele.node){
  38. this.drawerData2 = ele.node
  39. this.$refs.mode2.open()
  40. } else {
  41. this.clearAndEmit()
  42. }
  43. },
  44. oncuechange2(ele){
  45. this.value.push(ele.name)
  46. if (ele.node){
  47. this.drawerData3 = ele.node
  48. this.$refs.mode3.open()
  49. } else {
  50. this.clearAndEmit()
  51. }
  52. },
  53. oncuechange3(ele){
  54. this.value.push(ele.name)
  55. this.clearAndEmit()
  56. },
  57. clearAndEmit(ele){
  58. console.log("end", this.value.join(" "));
  59. this.$emit('changSuccess', this.value.join(" "))
  60. this.$refs.mode3.close()
  61. this.$refs.mode2.close()
  62. this.$refs.mode1.close()
  63. },
  64. }
  65. }
  66. </script>