From 1fbe48667e43005ce6883ae6df20a9ff59809af7 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 29 Aug 2023 15:47:04 +0800
Subject: [PATCH] jufu商城

---
 src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html |   67 ++++++++++++++++++++++++++++-----
 1 files changed, 57 insertions(+), 10 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html b/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html
index d47f681..bb73368 100644
--- a/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html
+++ b/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html
@@ -9,16 +9,32 @@
                             <label class="layui-form-label febs-form-item-require">价格:</label>
                             <div class="layui-form-mid layui-word-aux">当前价格:</div>
                             <div class="layui-input-inline">
-                                <input type="text" name="scorePrice" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" readonly>
+                                <input type="text" name="scorePrice" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input">
                             </div>
-                            <div class="layui-form-mid layui-word-aux">剩余:</div>
+                        </div>
+                    </div>
+                    <blockquote class="layui-elem-quote blue-border">提现设置,提现时,是否需要凭证</blockquote>
+                    <div class="layui-col-lg6">
+                        <label class="layui-form-label febs-form-item-require">需要凭证:</label>
+                        <div class="layui-input-block">
+                            <input type="radio" name="voucherOnOff" value="1" title="是"  lay-filter="hasVoucher"/>
+                            <input type="radio" name="voucherOnOff" value="2" title="否"  lay-filter="hasVoucher" checked />
+                        </div>
+                    </div>
+
+                    <div class="layui-form-item voucher-percent-input febs-hide">
+                        <label class="layui-form-label">凭证比例:</label>
+                        <div class="layui-input-block">
+                            <input type="text" name="voucherPercent" placeholder="" autocomplete="off" class="layui-input">
                         </div>
                     </div>
                     <div class="layui-card-footer">
                         <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="hlm-voucher-button-submit" id="submit">保存</button>
+                            <div class="layui-btn layui-btn-warm table-action" id="voucherButton">
+                                确认一键卖出
+                            </div>
                     </div>
                     <div class="layui-card-footer">
-                        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="hlm-voucher-button-submit" id="submit">确认一键卖出</button>
                     </div>
                 </div>
             </div>
@@ -38,12 +54,15 @@
         margin-bottom: 20px !important;
     }
 </style>
+
 <script data-th-inline="javascript" type="text/javascript">
     layui.use(['dropdown', 'jquery', 'febs', 'form', 'eleTree'], function () {
         var $ = layui.jquery,
             febs = layui.febs,
             form = layui.form,
-            hlmVoucherSet = [[${hlmVoucherSetDto}]],
+            $view = $('#hlm-voucher-button'),
+            hlmVoucherButton = [[${hlmVoucherButtonDto}]],
+            $voucherButton = $view.find('#voucherButton'),
             $view = $('#hlm-voucher-button');
 
         form.verify({
@@ -53,18 +72,46 @@
             ]
         });
 
-        initHlmVoucherSetValue();
+        initHlmVoucherButtonValue();
 
-        form.render();
+        $voucherButton.on('click', function () {
+            febs.modal.confirm('确认一键卖出', '点击【确定】,即强制卖出所有账户的一半积分凭证?', function () {
+                selaHalfVoucher();
+            });
+        });
 
-        function initHlmVoucherSetValue() {
-            form.val("hlm-voucher-button-form", {
-                "roleReleasePercent": hlmVoucherSet.roleReleasePercent
+
+        function selaHalfVoucher() {
+            febs.post(ctx + 'admin/system/selaHalfVoucher', null, function (res) {
+                febs.alert.success('设置成功');
+                return ;
             });
         }
 
+        form.on('radio(hasVoucher)', function(data){
+            if (data.value == 2) {
+                $('.voucher-percent-input').hide();
+            } else {
+                $('.voucher-percent-input').show();
+            }
+        });
+
+        form.render();
+
+        function initHlmVoucherButtonValue() {
+            form.val("hlm-voucher-button-form", {
+                "scorePrice": hlmVoucherButton.scorePrice,
+                "voucherOnOff": hlmVoucherButton.voucherOnOff,
+                "voucherPercent": hlmVoucherButton.voucherPercent,
+            });
+
+            if (hlmVoucherButton.voucherOnOff == 1) {
+                $(".voucher-percent-input").show();
+            }
+        }
+
         form.on('submit(hlm-voucher-button-submit)', function (data) {
-            febs.post(ctx + 'admin/system/hlmVoucherSet', data.field, function (res) {
+            febs.post(ctx + 'admin/system/hlmVoucherButton', data.field, function (res) {
                 febs.alert.success('设置成功');
                 return ;
             });

--
Gitblit v1.9.1