123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>活动配置-创业帮</title>
- <meta name="keywords" content="活动配置-创业帮">
- <meta name="description" content="活动配置-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="活动配置-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="pb0 ovh">
- <div class="active_config" id="app">
- <van-nav-bar class="user_rank_explan_title user_title_normal" title="活动配置" v-if="toptitleisshow" @click-left="goback" left-arrow>
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="pl16 pr16 active_config_page ovx-y" v-show="isshow">
- <div class="title f16 c333">当前门店
- <div class="content c333 f14 mb">{{merchantname}}</div>
- </div>
- <div class="title f16 c333">是否实收100%
- <div class="content c333 f14 mb">
- <van-switch v-model="isreceived100" active-color="#FF8743" inactive-color="#e6e6e7"> </van-switch>
- </div>
- </div>
- <div class="isshow" v-if="!isreceived100">
- <div class="title f16 c333">订单参与门槛(元)
- <div class="content c333 f14 mb">
- <van-field class="mb12" v-model="ordercount" placeholder="请输入"></van-field>
- </div>
- </div>
- <div class="title f16 c333">商家实收(0-95%)
- <div class="content c333 f14 mb">
- <van-stepper v-model="merchantcount" integer min="0" max="95"> </van-stepper>
- </div>
- </div>
- <div class="title f16 c333">分红期限(天)
- <div class="content c333 f14 mb">
- <van-stepper v-model="bonuscount" min="1" max="365" integer> </van-stepper>
- </div>
- </div>
- <div class="title f16 c333">最大分红比例(0-100%)
- <div class="content c333 f14 mb">
- <van-stepper v-model="maxbonuscount" min="0" integer max="100"> </van-stepper>
- </div>
- </div>
- <div class="title f16 c333">单笔订单分红人数
- <div class="content c333 f14 mb">
- <van-stepper v-model="ordernum" min="1" max="30" integer> </van-stepper>
- </div>
- </div>
- </div>
- </div>
- <div class="subbtn abs pl16 pr16">
- <van-button color="#FF8743" round block @click="subconfig">提交</van-button>
- </div>
- <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>
- <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>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- isshow:false,
- isnodata:false,
- toptitleisshow:false,
- merchantname:'商户名称',
- //- 滚动加载
- loading: false,
- finished: false,
- //- 刷新
- refreshing: false,
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- isreceived100:false,
- ordercount:'',
- merchantcount:0,
- bonuscount:0,
- maxbonuscount:0,
- ordernum:0,
- examinedialogisshow:false,
- closedialogisshow:false,
- configdate:'',
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.getmangementdetail();
- this.getmerchantdetail();
- },
- methods: {
- //- 商户活动参数
- async getmangementdetail(){
- let Id = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/merchantparamset/detail?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips(res.info);
- this.isshow = true;
- this.isreceived100 = res.data.IsAll === 1 ? true: false;
- this.ordercount = res.data.MinPayMoney.toFixed(2);
- this.merchantcount = res.data.GetPercent;
- this.bonuscount = res.data.ProfitDays;
- this.maxbonuscount = res.data.DiviPercent;
- this.ordernum = res.data.DiviPersons;
- },
- //- 获取商户详情
- async getmerchantdetail(){
- let Id = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips(res.info);
- this.merchantname = res.data.Name;
- },
- //- 提交活动配置
- async subconfig(){
- let IsAll = 0;
- if(this.isreceived100){
- IsAll = 1
- } else{
- IsAll = 0
- };
- let Id = PublicLib.getCookieInfo('userId');
- 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}));
- if(res.status !== '1') return tips(res.info);
- //- 活动配置时间
- this.configdate = res.data.UpdateDate;
- if(IsAll === 1) {
- this.closedialogisshow = true;
- }else{
- this.examinedialogisshow = true;
- };
- },
- goback(){
- PublicLib.GoBack({Level:1});
- }
- }
- });
- </script>
- </body>
- </html>
|