qifengquan 1 tahun lalu
induk
melakukan
d2b7b916ae

+ 1 - 1
application/admin/controller/user/User.php

@@ -139,7 +139,7 @@ class User extends Backend
                     'customization'=>$params['customization'],
                     'number_goods'=>1,
                     'status'=>1,
-                    'deploy_type'=>1,
+                    'deploy_type'=>$params['deploy_type'],
                     'deploy'=>$params['deploy'],
                     'valid_time'=>$params['valid_time'],
                     'market'=>$params['market']

+ 11 - 2
application/admin/view/user/user/detail.html

@@ -65,9 +65,18 @@
         </div>
     </div>
     <div class="form-group">
+        <label for="c-username" class="control-label col-xs-12 col-sm-2">部署方式</label>
+        <div class="col-xs-12 col-sm-4">
+            <select id="c-deploy_type" data-rule="required" class="form-control selectpicker" name="row[deploy_type]">
+                <option data-type="0" value="0">自己部署</option>
+                <option data-type="1" value="1">授权部署</option>
+            </select>
+        </div>
+    </div>
+    <div class="form-group" id="deploy" style="display: none">
         <label for="c-username" class="control-label col-xs-12 col-sm-2">部署信息</label>
         <div class="col-xs-12 col-sm-4">
-            <input id="deploy" class="form-control" name="row[deploy]" type="text" value="">
+            <input id="c-deploy" class="form-control" name="row[deploy]" type="text" value="">
         </div>
     </div>
 
@@ -79,4 +88,4 @@
         <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
     </div>
 </div>
-</form>
+</form>

+ 10 - 1
public/assets/js/backend/user/user.js

@@ -97,7 +97,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Controller.api.bindevent();
         },
         detail: function () {
-            Controller.api.bindevent();
+            Controller.api.bindevent(
+                $(document).on('change', '#c-deploy_type', function () {
+                    if($(this).val() == 1){
+                        $('#deploy').css('display','block')
+                    }else{
+                        $('#deploy').css('display','none')
+                        $('#c-deploy').val('')
+                    }
+                })
+            );
         },
         coupon: function () {
             Controller.api.bindevent();