add.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view>
  3. <view class="margin-30">
  4. <text class="build_title">构建您的私域流量</text>
  5. </view>
  6. <view class="card">
  7. <text class="title">会员门槛</text>
  8. <text class="desc">完成一笔任意金额交易即成会员</text>
  9. </view>
  10. <view class="card margin-top-30">
  11. <text class="title">积分使用范围</text>
  12. <text class="desc">通用(可在任意场景使用)</text>
  13. </view>
  14. <view class="card margin-top-30">
  15. <view class="margin-bottom-20">
  16. <text class="title">积分价值</text>
  17. <text class="sub_title">(例:1000积分=10元)</text>
  18. </view>
  19. <view class="flex">
  20. <view class="center" style="width: 45%;">
  21. <u-input height="50" :border="true" :clearable="false" v-model="form.point" placeholder="请输入积分数"/>
  22. <view class="cu-tag bg-color radius">
  23. 积分
  24. </view>
  25. </view>
  26. <view class="center" style="margin: 0 20rpx;">
  27. <text>=</text>
  28. </view>
  29. <view class="center" style="width: 45%;">
  30. <u-input height="50" :border="true" :clearable="false" v-model="form.pointValue" placeholder="请输入积分值" />
  31. <view class="cu-tag bg-color radius">
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="card margin-top-30">
  37. <view class="margin-bottom-20">
  38. <text class="title">积分规则</text>
  39. </view>
  40. <view class="flex">
  41. <view class="center">
  42. <text>消费1元赠送</text>
  43. </view>
  44. <view class="center" style="width: 45%;margin-left: 20rpx;">
  45. <u-input height="50" :border="true" :clearable="false" v-model="form.consumeOnePoint" placeholder="请输入积分数"/>
  46. <view class="cu-tag bg-color radius">
  47. 积分
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="center flex-direction" style="margin-top: 280rpx;">
  53. <view class="margin-bottom-30 text-sm">
  54. <text>提交代表已同意</text>
  55. <text style="color: #3099F1;">会员中心规则说明</text>
  56. </view>
  57. <view @click="submit" class="cu-btn bg-color round" style="width: 70%;height: 90rpx;font-size: 36rpx;">
  58. 提交
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. form:{
  68. point:'',
  69. pointValue:'',
  70. consumeOnePoint:''
  71. }
  72. }
  73. },
  74. methods: {
  75. submit(){
  76. if (this.$isEmpty(this.form.point)) {
  77. this.$u.toast('请输入积分数')
  78. return
  79. }
  80. if (this.$isEmpty(this.form.pointValue)) {
  81. this.$u.toast('请输入积分值')
  82. return
  83. }
  84. if (this.$isEmpty(this.form.consumeOnePoint)) {
  85. this.$u.toast('请输入积分规则')
  86. return
  87. }
  88. this.form.id=this.vuex_mallId
  89. this.$api.memberCenter.create(this.form).then(res=>{
  90. if (res.success) {
  91. const selectedMall = this.$cache.get("selectedMall")
  92. this.$cache.put("selectedMall",Object.assign(selectedMall,this.form))
  93. this.$dialog.showModal('创建成功',false).then(res=>{
  94. this.$jump('/pages/member-center/member-center')
  95. })
  96. }else{
  97. this.$u.toast(res.msg)
  98. }
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. page{
  106. background-color: #F4F5F7;
  107. }
  108. .bg-color{
  109. background-color: #EE9230;
  110. color: #FFFFFF;
  111. }
  112. .build_title{
  113. color: #EE9230;
  114. font-size: 32rpx;
  115. }
  116. .card{
  117. border-radius: 24rpx;
  118. background-color: #FFFFFF;
  119. padding:25rpx 40rpx;
  120. display: flex;
  121. flex-direction: column;
  122. .title{
  123. font-weight: 800;
  124. font-size: 32rpx;
  125. margin-bottom: 20rpx;
  126. }
  127. .sub_title{
  128. font-size: 24rpx;
  129. color: #999;
  130. margin-left: 10rpx;
  131. }
  132. .desc{
  133. font-size: 26rpx;
  134. color: #666666;
  135. }
  136. }
  137. </style>