foodItem.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <view class="thumb-boxR">
  4. <myImage class="goodimage" :mysrc="foodImag" mymode="scaleToFill"></myImage>
  5. <view class="msText">
  6. <text class="dianpuming" >{{name}}</text>
  7. <view class="buyBT" style="background-color: #FEFCED;">
  8. <!-- <image class="xingxing" src="/static/images/dianzan@3x.png" mode="heightFix"></image> -->
  9. <text class="peisongsuoming" style="color: #988233;">{{introduce}}</text>
  10. </view>
  11. <text class="peisongsuoming">{{$t('comp.yuexiao')}}300+</text>
  12. <view class="buyBTSB">
  13. <text class="peisongsuoming">{{$formPr(price+otherPrice)}}{{$t('locale.huobidw')}}</text>
  14. <view class="rconten">
  15. <image v-if="shuliang>0" class="imageRJ" src="/static/images/jian@3x.png" mode="aspectFit" @click="jiajian(-1)"></image>
  16. <text v-if="shuliang>0" class="textR">{{shuliang}}</text>
  17. <image class="imageR" src="/static/images/plus-circle-fill@3x.png" mode="aspectFit" @click="jiajian(1)"></image>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. // var tempsp={
  26. // "shangpin":shangpinlist[j],
  27. // "sku":tempSKU,
  28. // "otherPrice":otherPrice,
  29. // "shuliang":shuliang
  30. // }
  31. export default {
  32. name:"foodItem",
  33. props: {
  34. food:'',
  35. shuliang:0,
  36. otherPrice:0,
  37. },
  38. data() {
  39. return {
  40. foodImag:'',
  41. name:'',
  42. price:0,
  43. introduce:''
  44. };
  45. },
  46. watch: {
  47. food(val){
  48. this.foodImag = this.food.shangpin.image;
  49. this.name = this.food.shangpin.name;
  50. this.price = this.food.shangpin.price;
  51. this.introduce = this.food.shangpin.introduce;
  52. }
  53. },
  54. methods:{
  55. jiajian(e){
  56. this.$emit('Ejiajian',e);
  57. },
  58. },
  59. }
  60. </script>
  61. <style>
  62. .thumb-boxR {
  63. width: 90%;
  64. margin-left: 5%;
  65. display: flex;
  66. align-items: center;
  67. justify-content: flex-start;
  68. flex-direction: row;
  69. margin-top:12rpx;
  70. background-color: white;
  71. border-radius: 8rpx;
  72. }
  73. .goodimage{
  74. border-radius: 8rpx;
  75. width: 180rpx;
  76. height:140rpx;
  77. }
  78. .msText{
  79. width: 500rpx;
  80. padding-left: 10rpx;
  81. font-size: 22rpx;
  82. line-height: 32rpx;
  83. }
  84. .dianpuming{
  85. font-size: 30rpx;
  86. line-height: 32rpx;
  87. height: 32rpx;
  88. font-weight: bold;
  89. }
  90. .buyBTSB{
  91. display: flex;
  92. flex-direction: row;
  93. justify-content:space-between;
  94. align-items: center;
  95. }
  96. .buyBT{
  97. display: flex;
  98. flex-direction: row;
  99. justify-content:flex-start;
  100. align-items: center;
  101. }
  102. .xingxing{
  103. width: 34rpx;
  104. height: 34rpx;
  105. }
  106. .peisongsuoming{
  107. font-size: 26rpx;
  108. line-height: 38rpx;
  109. height: 38rpx;
  110. color: dimgray;
  111. }
  112. .rconten{
  113. margin-left: auto;
  114. display:flex;
  115. flex-direction: row;
  116. align-items: center;
  117. }
  118. .imageRJ{
  119. width: 56rpx;
  120. height: 56rpx;
  121. margin-right: 8rpx;
  122. }
  123. .imageR{
  124. width: 50rpx;
  125. height: 50rpx;
  126. margin-right: 30rpx;
  127. }
  128. .textR{
  129. margin-left: 6rpx;
  130. margin-right: 6rpx;
  131. }
  132. </style>