index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <base-drawer mode="bottom" :visible="visible" background-color="transparent" mask maskClosable @close="closeDrawer">
  3. <view class="edit-price rd-t-40rpx" v-if="goodsInfo.attr_value">
  4. <view class="title">修改价格/库存
  5. <view class="close acea-row row-center-wrapper" @tap="closeDrawer">
  6. <text class="iconfont icon-guanbi"></text>
  7. </view>
  8. </view>
  9. <view class="list">
  10. <view class="item acea-row row-between-wrapper">
  11. <view>成本价</view>
  12. <input type="number" :placeholder="'请填写成本价'" placeholder-class="placeholder" v-model="goodsInfo.attr_value.cost" />
  13. </view>
  14. <view class="item acea-row row-between-wrapper">
  15. <view>划线价</view>
  16. <input type="number" :placeholder="'请填写划线价'" placeholder-class="placeholder" v-model="goodsInfo.attr_value.otPrice" />
  17. </view>
  18. <view class="item acea-row row-between-wrapper">
  19. <view>售价</view>
  20. <input type="number" :placeholder="'请填写售价'" placeholder-class="placeholder" v-model="goodsInfo.attr_value.price" />
  21. </view>
  22. <view class="item acea-row row-between-wrapper" v-if="isPaidMember">
  23. <view>会员价</view>
  24. <input type="number" :placeholder="'请填写会员价'" placeholder-class="placeholder" v-model="goodsInfo.attr_value.vipPrice" />
  25. </view>
  26. <view class="item acea-row row-between-wrapper">
  27. <view>库存</view>
  28. <input type="number" :placeholder="'请填写库存'" placeholder-class="placeholder" v-model="goodsInfo.attr_value.stock" />
  29. </view>
  30. </view>
  31. <view v-if="goodsInfo.spec_type" class="bnt acea-row row-center-wrapper" @tap="defineSpec">确定</view>
  32. <view v-else class="bnt acea-row row-center-wrapper" @tap="define">保存</view>
  33. </view>
  34. </base-drawer>
  35. </template>
  36. <script>
  37. import baseDrawer from '@/components/tui-drawer/tui-drawer.vue';
  38. export default {
  39. components:{
  40. baseDrawer
  41. },
  42. props:{
  43. visible: {
  44. type: Boolean,
  45. default: false,
  46. },
  47. goodsInfo: {
  48. type: Object,
  49. default: () => {}
  50. },
  51. isPaidMember:{
  52. type: Boolean,
  53. default: false,
  54. }
  55. },
  56. data: function() {
  57. return {
  58. };
  59. },
  60. methods:{
  61. defineSpec(){
  62. let info = this.goodsInfo.attr_value;
  63. if(info.cost || info.price || info.otPrice || info.stock||info.vipPrice){
  64. this.$emit('successChange',info);
  65. }else{
  66. this.$util.Tips({
  67. title: '修改类容至少填写一项'
  68. });
  69. }
  70. },
  71. define(){
  72. let data = {
  73. attr_value:[]
  74. }
  75. data.attr_value.push(this.goodsInfo.attr_value)
  76. this.$emit('successChange');
  77. },
  78. closeDrawer() {
  79. this.$emit('closeDrawer');
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .edit-price{
  86. background-color: #fff;
  87. padding-bottom: 60rpx;
  88. .title{
  89. text-align: center;
  90. height: 108rpx;
  91. line-height: 108rpx;
  92. font-size: 32rpx;
  93. font-family: PingFang SC, PingFang SC;
  94. font-weight: 600;
  95. color: #333333;
  96. position: relative;
  97. padding: 0 30rpx;
  98. .close{
  99. width: 36rpx;
  100. height: 36rpx;
  101. line-height: 36rpx;
  102. background: #EEEEEE;
  103. border-radius: 50%;
  104. position: absolute;
  105. right: 30rpx;
  106. top:38rpx;
  107. .iconfont {
  108. font-weight: 300;
  109. font-size: 20rpx;
  110. }
  111. }
  112. }
  113. .list{
  114. padding: 0 10rpx 0 30rpx;
  115. .item{
  116. font-size: 28rpx;
  117. font-family: PingFang SC, PingFang SC;
  118. font-weight: 400;
  119. color: #333333;
  120. height: 72rpx;
  121. margin-bottom: 32rpx;
  122. box-sizing: border-box;
  123. input {
  124. text-align: right;
  125. font-size: 28rpx;
  126. height: 100%;
  127. padding-right: 20rpx;
  128. }
  129. .placeholder{
  130. font-size: 28rpx;
  131. padding-right: 20rpx;
  132. }
  133. }
  134. }
  135. .bnt{
  136. font-size: 26rpx;
  137. font-family: PingFang SC, PingFang SC;
  138. font-weight: 500;
  139. color: #FFFFFF;
  140. width: 710rpx;
  141. height: 72rpx;
  142. background: #2A7EFB;
  143. border-radius: 50rpx;
  144. margin: 72rpx auto 0 auto;
  145. }
  146. }
  147. </style>