active-config.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>活动配置-创业帮</title>
  6. <meta name="keywords" content="活动配置-创业帮">
  7. <meta name="description" content="活动配置-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="活动配置-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="pb0 ovh">
  18. <div class="active_config" id="app">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal" title="活动配置" v-if="toptitleisshow" @click-left="goback" left-arrow>
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="pl16 pr16 active_config_page ovx-y" v-show="isshow">
  23. <div class="title f16 c333">当前门店
  24. <div class="content c333 f14 mb">{{merchantname}}</div>
  25. </div>
  26. <div class="title f16 c333">是否实收100%
  27. <div class="content c333 f14 mb">
  28. <van-switch v-model="isreceived100" active-color="#FF8743" inactive-color="#e6e6e7"> </van-switch>
  29. </div>
  30. </div>
  31. <div class="isshow" v-if="!isreceived100">
  32. <div class="title f16 c333">订单参与门槛(元)
  33. <div class="content c333 f14 mb">
  34. <van-field class="mb12" v-model="ordercount" placeholder="请输入"></van-field>
  35. </div>
  36. </div>
  37. <div class="title f16 c333">商家实收(0-95%)
  38. <div class="content c333 f14 mb">
  39. <van-stepper v-model="merchantcount" integer min="0" max="95"> </van-stepper>
  40. </div>
  41. </div>
  42. <div class="title f16 c333">分红期限(天)
  43. <div class="content c333 f14 mb">
  44. <van-stepper v-model="bonuscount" min="1" max="365" integer> </van-stepper>
  45. </div>
  46. </div>
  47. <div class="title f16 c333">最大分红比例(0-100%)
  48. <div class="content c333 f14 mb">
  49. <van-stepper v-model="maxbonuscount" min="0" integer max="100"> </van-stepper>
  50. </div>
  51. </div>
  52. <div class="title f16 c333">单笔订单分红人数
  53. <div class="content c333 f14 mb">
  54. <van-stepper v-model="ordernum" min="1" max="30" integer> </van-stepper>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="subbtn abs pl16 pr16">
  60. <van-button color="#FF8743" round block @click="subconfig">提交</van-button>
  61. </div>
  62. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="examinedialogisshow" title="提交成功" :message="'生效时间:'+configdate" @confirm="goback"> </van-dialog>
  63. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="closedialogisshow" title="成功" message="活动关闭成功" @confirm="goback"> </van-dialog>
  64. </div>
  65. <script src="./static/js/klm-vv.min.js"></script>
  66. <script src="./static/js/klm-axios-config.js"></script>
  67. <script>
  68. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  69. // 可以通过下面的方式手动注册
  70. Vue.use(vant.Lazyload);
  71. // 在 #app 标签下渲染一个按钮组件
  72. let app = new Vue({
  73. el: '#app',
  74. data() {
  75. return {
  76. isshow:false,
  77. isnodata:false,
  78. toptitleisshow:false,
  79. merchantname:'商户名称',
  80. //- 滚动加载
  81. loading: false,
  82. finished: false,
  83. //- 刷新
  84. refreshing: false,
  85. pageinfo:{
  86. PageSize:10,
  87. PageNum:1
  88. },
  89. isreceived100:false,
  90. ordercount:'',
  91. merchantcount:0,
  92. bonuscount:0,
  93. maxbonuscount:0,
  94. ordernum:0,
  95. examinedialogisshow:false,
  96. closedialogisshow:false,
  97. configdate:'',
  98. };
  99. },
  100. created() {
  101. this.toptitleisshow = toptitleisshow;
  102. this.getmangementdetail();
  103. this.getmerchantdetail();
  104. },
  105. methods: {
  106. //- 商户活动参数
  107. async getmangementdetail(){
  108. let Id = PublicLib.getCookieInfo('userId');
  109. const res = await getRequest('/api/v1/merchantparamset/detail?t='+Math.random(6),JSON.stringify({Id}));
  110. if(res.status !== '1') return tips(res.info);
  111. this.isshow = true;
  112. this.isreceived100 = res.data.IsAll === 1 ? true: false;
  113. this.ordercount = res.data.MinPayMoney.toFixed(2);
  114. this.merchantcount = res.data.GetPercent;
  115. this.bonuscount = res.data.ProfitDays;
  116. this.maxbonuscount = res.data.DiviPercent;
  117. this.ordernum = res.data.DiviPersons;
  118. },
  119. //- 获取商户详情
  120. async getmerchantdetail(){
  121. let Id = PublicLib.getCookieInfo('userId');
  122. const res = await getRequest('/api/v1/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
  123. if(res.status !== '1') return tips(res.info);
  124. this.merchantname = res.data.Name;
  125. },
  126. //- 提交活动配置
  127. async subconfig(){
  128. let IsAll = 0;
  129. if(this.isreceived100){
  130. IsAll = 1
  131. } else{
  132. IsAll = 0
  133. };
  134. let Id = PublicLib.getCookieInfo('userId');
  135. const res = await postRequest('/api/v1/merchantparamset/set?t='+Math.random(6),JSON.stringify({Id,IsAll,MinPayMoney:this.ordercount,GetPercent:this.merchantcount,ProfitDays:this.bonuscount,DiviPercent:this.maxbonuscount,DiviPersons:this.ordernum}));
  136. if(res.status !== '1') return tips(res.info);
  137. //- 活动配置时间
  138. this.configdate = res.data.UpdateDate;
  139. if(IsAll === 1) {
  140. this.closedialogisshow = true;
  141. }else{
  142. this.examinedialogisshow = true;
  143. };
  144. },
  145. goback(){
  146. PublicLib.GoBack({Level:1});
  147. }
  148. }
  149. });
  150. </script>
  151. </body>
  152. </html>