add1.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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">(例:1 元= 10 积分)</text>
  18. </view>
  19. <view class="flex">
  20. <view class="center" style="width: 25%;">
  21. <text class="text-bold text-base" style="font-size: 40rpx;">1</text>
  22. <text style="margin: 0 20rpx;">元</text>
  23. <text style="margin: 0 20rpx;">=</text>
  24. </view>
  25. <view class="center" style="width: 45%;margin-left: 20rpx;">
  26. <u-input disabled type="digit" height="50" :border="true" :clearable="false" v-model="form.point" placeholder="请输入积分数"/>
  27. <view class="cu-tag bg-color radius">
  28. 积分
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="card margin-top-30">
  34. <view class="margin-bottom-20">
  35. <text class="title">积分规则</text>
  36. </view>
  37. <view class="flex">
  38. <view class="center" style="width: 25%;">
  39. <text>消费1元赠送</text>
  40. </view>
  41. <view class="center" style="width: 45%;margin-left: 20rpx;">
  42. <u-input disabled type="digit" height="50" :border="true" :clearable="false" v-model="form.consumeOnePoint" placeholder="请输入积分数"/>
  43. <view class="cu-tag bg-color radius">
  44. 积分
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="center flex-direction" style="position: fixed;bottom: 10%;width: 100%;">
  50. <view class="margin-bottom-30 text-sm">
  51. <text>提交代表已同意</text>
  52. <text style="color: #3099F1;">会员中心规则说明</text>
  53. </view>
  54. <view @click="submit" class="cu-btn bg-color round" style="width: 70%;height: 90rpx;font-size: 36rpx;">
  55. 提交
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. form:{
  65. point:'1',
  66. consumeOnePoint:'0.01'
  67. }
  68. }
  69. },
  70. methods: {
  71. submit(){
  72. if (this.$isEmpty(this.form.point)) {
  73. this.$u.toast('请输入积分数')
  74. return
  75. }
  76. if (this.$isEmpty(this.form.consumeOnePoint)) {
  77. this.$u.toast('请输入积分规则')
  78. return
  79. }
  80. let id=this.vuex_shopId
  81. let params={
  82. id,
  83. sendPointUnit: this.form.consumeOnePoint,
  84. pointRate: this.$digital.keepTwoDecimalFull(1/this.form.point),
  85. isOpenMember: 1
  86. }
  87. console.log(params);
  88. this.$api.shop.submit(params).then(res=>{
  89. if (res.success) {
  90. this.$dialog.showModal('创建成功',false).then(res=>{
  91. uni.redirectTo({
  92. url:"/pages/member/member"
  93. })
  94. })
  95. }else{
  96. this.$u.toast(res.msg)
  97. }
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. page{
  105. background-color: #F4F5F7;
  106. }
  107. .bg-color{
  108. background-color: #EE9230;
  109. color: #FFFFFF;
  110. }
  111. .build_title{
  112. color: #EE9230;
  113. font-size: 32rpx;
  114. }
  115. .card{
  116. border-radius: 24rpx;
  117. background-color: #FFFFFF;
  118. padding:25rpx 40rpx;
  119. display: flex;
  120. flex-direction: column;
  121. .title{
  122. font-weight: 800;
  123. font-size: 32rpx;
  124. margin-bottom: 20rpx;
  125. }
  126. .sub_title{
  127. font-size: 24rpx;
  128. color: #999;
  129. margin-left: 10rpx;
  130. }
  131. .desc{
  132. font-size: 26rpx;
  133. color: #666666;
  134. }
  135. }
  136. </style>