selfBuy.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. define({
  2. name:"selfBuy",
  3. template:`
  4. <div id="selfBuy">
  5. <el-form>
  6. <div class="vue-main-title">
  7. <div class="vue-main-title-left"></div>
  8. <div class="vue-main-title-content">自购省商品设置</div>
  9. </div>
  10. <div style="margin:0 auto;width:80%;">
  11. <el-form-item class="rad" label="开启自购省" label-width="155px">
  12. <el-radio v-model="form.open_state" :label="1">开启</el-radio>
  13. <el-radio v-model="form.open_state" :label="0">关闭</el-radio>
  14. <div class="form-item_tips">如果不开启,该商品详情页不显示自购省信息,用户购买商品不能享受自购省</div>
  15. </el-form-item>
  16. <el-form-item class="rad" label="独立规则" label-width="155px">
  17. <el-radio v-model="form.goods_state" :label="1">开启</el-radio>
  18. <el-radio v-model="form.goods_state" :label="0">关闭</el-radio>
  19. </el-form-item>
  20. <div style="margin: 10px 0 0 155px;" v-for="(item,index) in form.rule" :key="index">
  21. <el-input v-model="item.discount_percent" maxlength="300" :min="0" oninput="if(value<0)value=0" type="number">
  22. <template slot="prepend">{{item.level_name}}</template>
  23. <template slot="append">%</template>
  24. </el-input>
  25. </div>
  26. </div>
  27. </el-form>
  28. </div>
  29. `,
  30. style:`
  31. #selfBuy input::-webkit-outer-spin-button,
  32. #selfBuy input::-webkit-inner-spin-button {
  33. -webkit-appearance: none;
  34. }
  35. #selfBuy input[type="number"] {
  36. -moz-appearance: textfield;
  37. }
  38. `,
  39. props: {
  40. form: {
  41. default() {
  42. return {}
  43. }
  44. }
  45. },
  46. data(){
  47. return{}
  48. },
  49. methods: {
  50. validate(){
  51. return {
  52. goods_state:this.form.goods_state,
  53. open_state:this.form.open_state,
  54. rule:this.form.rule
  55. }
  56. }
  57. },
  58. })