自主项目,食堂系统,前端uniapp
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.

110 lines
2.5 KiB

  1. <template>
  2. <view class="content">
  3. <view class="card" v-for="(item, index) in list" :key="index">
  4. <view class="lf-color-black lf-font-bold">{{ item.title }}</view>
  5. <view class="lf-row-between lf-m-t-30">
  6. <view>订购数</view>
  7. <view class="lf-color-black">{{ item.orderNum }}</view>
  8. </view>
  9. <view class="lf-row-between lf-m-t-30">
  10. <view>实到数</view>
  11. <view class="lf-flex">
  12. <input class="input" placeholder="0" type="number" :value="item.realNum" @blur="inputBlur(index, 'realNum', $event)" />
  13. <text class="lf-color-black"></text>
  14. </view>
  15. </view>
  16. <view class="lf-row-between lf-m-t-30">
  17. <view>实收数</view>
  18. <view class="lf-flex">
  19. <input class="input" placeholder="0" type="number" :value="item.receiptsNum" @blur="inputBlur(index, 'receiptsNum', $event)" />
  20. <text class="lf-color-black"></text>
  21. </view>
  22. </view>
  23. </view>
  24. <button class="btn" @click="comfirm">确认收货</button>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data(){
  30. return {
  31. list: [{
  32. title: '大白菜 / 长叶子 / 斤',
  33. orderNum: '300斤',
  34. realNum: '',
  35. receiptsNum: ''
  36. },{
  37. title: '拌凉菜 / 好好次 / 斤',
  38. orderNum: '100斤',
  39. realNum: '',
  40. receiptsNum: ''
  41. },{
  42. title: '你是真的菜 / 菜鸡 / 斤',
  43. orderNum: '1000吨',
  44. realNum: '',
  45. receiptsNum: ''
  46. }]
  47. }
  48. },
  49. onLoad(){
  50. },
  51. methods: {
  52. inputBlur(current, key, event){
  53. console.log("inputBlur", current, key, event);
  54. this.list[current][key] = event.detail.value;
  55. },
  56. comfirm(){
  57. // 使用延迟器,以防input还没有赋值成功
  58. setTimeout(() => {
  59. console.log("comfirm", this.list);
  60. this.$msg('确认收货成功!');
  61. }, 100);
  62. }
  63. }
  64. }
  65. </script>
  66. <style>
  67. page{
  68. background-color: #F6F6F6;
  69. overflow-x: hidden;
  70. }
  71. </style>
  72. <style lang="scss" scoped="scoped">
  73. .content{
  74. display: flex;
  75. align-items: center;
  76. flex-wrap: wrap;
  77. flex-direction: column;
  78. }
  79. .card{
  80. width: 686rpx;
  81. height: auto;
  82. background-color: #FFFFFF;
  83. border-radius: 20rpx;
  84. margin-top: 30rpx;
  85. font-size: 28rpx;
  86. box-sizing: border-box;
  87. padding: 30rpx;
  88. color: #777777;
  89. .input{
  90. width: 88rpx;
  91. border-bottom: 1rpx solid #e5e5e5;
  92. margin-right: 14rpx;
  93. text-align: center;
  94. color: #222222;
  95. }
  96. }
  97. .btn{
  98. width: 686rpx;
  99. background-color: #11D189;
  100. margin-top: 30rpx;
  101. margin-bottom: 30rpx;
  102. color: #FFFFFF;
  103. }
  104. /deep/.placeholder-class{
  105. color: #777777;
  106. }
  107. </style>