add.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view>
  3. <view class="text-base padding-30 text-lg">
  4. 构建您的私域流量 牢牢锁住您的客户
  5. </view>
  6. <view class="bg-white padding-30 flex justify-between">
  7. <text class="bold">会员门槛</text>
  8. <text class="desc center">完成一笔任意金额交易即成会员</text>
  9. </view>
  10. <view class="card">
  11. <view class="title">
  12. <text class="bold">积分设置</text>
  13. <text class="desc center">积分为本平台通用,可在任意场景使用</text>
  14. </view>
  15. <view class="padding-30 u-border-bottom">
  16. <u-form :model="form" ref="uForm" label-width="180" label-align="right">
  17. <u-form-item label="积分兑率" :border-bottom="false">
  18. <view class="margin-left-20">
  19. <u-slider :min="1" height="10" v-model="value" active-color="#EF9944" :use-slot="true" >
  20. <view class="">
  21. <view class="" >
  22. <view class="badge-button">
  23. {{value}}
  24. </view>
  25. </view>
  26. </view>
  27. </u-slider>
  28. </view>
  29. </u-form-item>
  30. <u-form-item label="消费1元赠送" :border-bottom="false">
  31. <view class="center" style="justify-content: flex-start;margin-left: 20rpx;">
  32. <u-input type="digit" style="width: 90%;" height="60" :border="true" :clearable="false"
  33. v-model="form.consumeOnePoint" placeholder="请输入积分数" />
  34. <view class="cu-tag bg-color radius" style="height: 60rpx;">
  35. 积分
  36. </view>
  37. </view>
  38. </u-form-item>
  39. </u-form>
  40. </view>
  41. <view class="title" style="margin-top: 20rpx;">
  42. <text class="bold">积分价值</text>
  43. <text class="desc">1积分={{value / 100}}元</text>
  44. </view>
  45. <view class="desc" style="margin-top: 60rpx;" v-if="false">
  46. 提示:消费返利赠送积分比例建议不超过30%,如超过30%需要另外
  47. 进行申请,审批通过后即可。
  48. <text class="text-base">申请更高返利</text>
  49. <text class="cuIcon-right text-base"></text>
  50. </view>
  51. </view>
  52. <view class="tips">
  53. 从公域聚合投放到私域流量的沉淀,智能化数字化的数据管理,联兑通帮助企业在裂变获客、私域留存、营销转化、客户管理各个环节提供帮助和辅助,形成一个完整的私域闭环,能有效的提高企业的私域运营效率,减少了客户的流失以及提升产品的转化和复购。
  54. </view>
  55. <view class="center flex-direction" style="margin: 70rpx 0;">
  56. <view class="margin-bottom-30 text-sm">
  57. <text>提交代表已同意</text>
  58. <text style="color: #3099F1;">会员中心规则说明</text>
  59. </view>
  60. <view @click="confirmShow=true" class="cu-btn bg-color round" style="width: 70%;height: 90rpx;font-size: 36rpx;">
  61. 提交
  62. </view>
  63. </view>
  64. <u-modal :mask-close-able="true" v-model="confirmShow" @confirm="confirm" :confirm-text="isHigh?'重新设置':'确认'" confirm-color="#EF9944">
  65. <view class="slot-content">
  66. <text class="text-lg text-bold">消费1元赠送 {{form.consumeOnePoint}} 积分</text>
  67. <text class="text-lg text-bold">积分折合 {{pointsValue}} 元</text>
  68. <text v-if="isHigh" class="text-red margin-top-20 text-sm">*赠送积分价值高于系统风险阈值!</text>
  69. </view>
  70. </u-modal>
  71. <u-select confirm-color="#EF9944" v-model="show" :list="list"></u-select>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. data() {
  77. return {
  78. type:'',
  79. isHigh:false,
  80. value:1,
  81. show:false,
  82. confirmShow:false,
  83. list: [{
  84. value: '0.01',
  85. label: '10%'
  86. },
  87. {
  88. value: '0.02',
  89. label: '20%'
  90. },
  91. {
  92. value: '0.03',
  93. label: '30%'
  94. }
  95. ],
  96. form:{
  97. consumeOnePoint:'5'
  98. }
  99. }
  100. },
  101. computed:{
  102. pointsValue(){
  103. let data=this.$digital.floatMul( this.form.consumeOnePoint,(this.value / 100))
  104. if (data>0.3) {
  105. this.isHigh=true
  106. }else{
  107. this.isHigh=false
  108. }
  109. return data
  110. }
  111. },
  112. onLoad(options) {
  113. this.type=options.type || ''
  114. if (this.$isNotEmpty(this.type)) {
  115. uni.setNavigationBarTitle({
  116. title:'更改规则'
  117. })
  118. }
  119. },
  120. methods: {
  121. confirm(){
  122. if (this.$isEmpty(this.form.consumeOnePoint)) {
  123. this.$u.toast('请输入积分规则')
  124. return
  125. }
  126. this.confirmShow=false
  127. if (!this.isHigh) {
  128. this.submit()
  129. }
  130. },
  131. submit(){
  132. let id=this.vuex_mallId
  133. let params={
  134. id,
  135. sendPointUnit: this.form.consumeOnePoint,
  136. pointRate: this.value / 100,
  137. useMember: 1
  138. }
  139. this.$api.mall.submit(params).then(res=>{
  140. if (res.success) {
  141. this.$dialog.showModal('操作成功',false).then(res=>{
  142. uni.redirectTo({
  143. url:"/pages/member-center/member-center"
  144. })
  145. })
  146. }else{
  147. this.$u.toast(res.msg)
  148. }
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style>
  155. page {
  156. background-color: #f4f5f7;
  157. }
  158. </style>
  159. <style lang="scss">
  160. .slot-content{
  161. font-size: 28rpx;
  162. padding: 40rpx 0;
  163. display: flex;
  164. justify-content: center;
  165. align-items: center;
  166. flex-direction: column;
  167. line-height: 50rpx;
  168. }
  169. .bold {
  170. font-size: 34rpx;
  171. color: #1C1C1C;
  172. font-weight: 800;
  173. }
  174. .desc {
  175. color: #8f8f8f;
  176. font-size: 26rpx;
  177. font-weight: 400;
  178. line-height: 40rpx;
  179. }
  180. .bg-color {
  181. background-color: #EE9230;
  182. color: #FFFFFF;
  183. }
  184. .card {
  185. padding: 40rpx 30rpx;
  186. margin-top: 20rpx;
  187. background-color: #FFFFFF;
  188. .title {
  189. display: flex;
  190. justify-content: space-between;
  191. }
  192. }
  193. .tips {
  194. font-size: 24rpx;
  195. padding: 30rpx;
  196. line-height: 46rpx;
  197. color: #b3b3b3;
  198. }
  199. .badge-button {
  200. padding: 14rpx 16rpx;
  201. background-color: $base-color;
  202. color: #fff;
  203. border-radius: 10rpx;
  204. font-size: 22rpx;
  205. line-height: 1;
  206. }
  207. </style>