|
@@ -1,204 +1,918 @@
|
|
|
-<?php ?>
|
|
|
+<?php ?>
|
|
|
<!DOCTYPE html>
|
|
|
-<html lang="zh-CN">
|
|
|
+<html>
|
|
|
<head>
|
|
|
-
|
|
|
<meta charset="utf-8">
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
- <?php if(empty($is_layui) || (($is_layui instanceof \think\Collection || $is_layui instanceof \think\Paginator ) && $is_layui->isEmpty())): ?>
|
|
|
- <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
|
|
|
- <?php endif; ?>
|
|
|
- <link href="/static/plug/layui/css/layui.css" rel="stylesheet">
|
|
|
- <link href="/system/css/layui-admin.css" rel="stylesheet">
|
|
|
- <link href="/system/frame/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
|
|
|
- <link href="/system/frame/css/animate.min.css" rel="stylesheet">
|
|
|
- <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
|
|
|
- <script src="/system/frame/js/jquery.min.js"></script>
|
|
|
- <script src="/system/frame/js/bootstrap.min.js"></script>
|
|
|
- <script src="/static/plug/layui/layui.all.js"></script>
|
|
|
- <script>
|
|
|
- $eb = parent._mpApi;
|
|
|
- window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
|
|
|
- window.module="<?php echo app('http')->getName();?>";
|
|
|
- </script>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <title></title>
|
|
|
-
|
|
|
-<link href="/system/plug/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
|
|
|
-<link href="/system/module/wechat/news/css/style.css" type="text/css" rel="stylesheet">
|
|
|
-<link href="/system/frame/css/plugins/chosen/chosen.css" rel="stylesheet">
|
|
|
-<script type="text/javascript" src="/system/plug/umeditor/third-party/jquery.min.js"></script>
|
|
|
-<script type="text/javascript" src="/system/plug/umeditor/third-party/template.min.js"></script>
|
|
|
-<script type="text/javascript" charset="utf-8" src="/system/plug/umeditor/umeditor.config.js"></script>
|
|
|
-<script type="text/javascript" charset="utf-8" src="/system/plug/umeditor/umeditor.js"></script>
|
|
|
-<script src="/system/frame/js/ajaxfileupload.js"></script>
|
|
|
-<script src="/system/plug/validate/jquery.validate.js"></script>
|
|
|
-<script src="/system/frame/js/plugins/chosen/chosen.jquery.js"></script>
|
|
|
-<style>
|
|
|
- .wrapper-content {
|
|
|
- padding: 0 !important;
|
|
|
- }
|
|
|
-</style>
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
|
+ <link href="/system/frame/css/font-awesome.min.css" rel="stylesheet">
|
|
|
+ <link href="/system/plug/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
|
|
|
+ <script type="text/javascript" src="/system/plug/umeditor/third-party/jquery.min.js"></script>
|
|
|
+ <script type="text/javascript" src="/system/plug/umeditor/third-party/template.min.js"></script>
|
|
|
+ <script type="text/javascript" charset="utf-8" src="/system/plug/umeditor/umeditor.config.js"></script>
|
|
|
+ <script type="text/javascript" charset="utf-8" src="/system/plug/umeditor/umeditor.min.js"></script>
|
|
|
+ <script type="text/javascript" src="/system/plug/umeditor/lang/zh-cn/zh-cn.js"></script>
|
|
|
+ <link rel="stylesheet" href="/static/plug/layui/css/layui.css">
|
|
|
+ <script src="/static/plug/layui/layui.js"></script>
|
|
|
+ <script src="/static/plug/vue/dist/vue.min.js"></script>
|
|
|
+ <script src="/static/plug/axios.min.js"></script>
|
|
|
+ <script src="/system/module/widget/aliyun-oss-sdk-4.4.4.min.js"></script>
|
|
|
+ <script src="/system/module/widget/cos-js-sdk-v5.min.js"></script>
|
|
|
+ <script src="/system/module/widget/qiniu-js-sdk-2.5.5.js"></script>
|
|
|
+ <script src="/system/module/widget/plupload.full.min.js"></script>
|
|
|
+ <script src="/system/module/widget/videoUpload.js"></script>
|
|
|
+ <style>
|
|
|
+ .layui-form-item {
|
|
|
+ margin-bottom: 0px;
|
|
|
+ }
|
|
|
|
|
|
- <!--<script type="text/javascript" src="/static/plug/basket.js"></script>-->
|
|
|
-<script type="text/javascript" src="/static/plug/requirejs/require.js"></script>
|
|
|
-<?php ?>
|
|
|
-<script>
|
|
|
- var hostname = location.hostname;
|
|
|
- if(location.port) hostname += ':' + location.port;
|
|
|
- requirejs.config({
|
|
|
- map: {
|
|
|
- '*': {
|
|
|
- 'css': '/static/plug/requirejs/require-css.js'
|
|
|
- }
|
|
|
- },
|
|
|
- shim:{
|
|
|
- 'iview':{
|
|
|
- deps:['css!iviewcss']
|
|
|
- },
|
|
|
- 'layer':{
|
|
|
- deps:['css!layercss']
|
|
|
- }
|
|
|
- },
|
|
|
- baseUrl:'//'+hostname+'/',
|
|
|
- paths: {
|
|
|
- 'static':'static',
|
|
|
- 'system':'system',
|
|
|
- 'vue':'static/plug/vue/dist/vue.min',
|
|
|
- 'axios':'static/plug/axios.min',
|
|
|
- 'iview':'static/plug/iview/dist/iview.min',
|
|
|
- 'iviewcss':'static/plug/iview/dist/styles/iview',
|
|
|
- 'lodash':'static/plug/lodash',
|
|
|
- 'layer':'static/plug/layer/layer',
|
|
|
- 'layercss':'static/plug/layer/theme/default/layer',
|
|
|
- 'jquery':'static/plug/jquery/jquery.min',
|
|
|
- 'moment':'static/plug/moment',
|
|
|
- 'sweetalert':'static/plug/sweetalert2/sweetalert2.all.min',
|
|
|
- 'formCreate':'/static/plug/form-create/form-create.min',
|
|
|
+ .pictrueBox {
|
|
|
+ display: inline-block !important;
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
- basket: {
|
|
|
- excludes:['system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
|
|
|
-
|
|
|
+ .pictrue {
|
|
|
+ width: 60px;
|
|
|
+ height: 60px;
|
|
|
+ border: 1px dotted rgba(0, 0, 0, 0.1);
|
|
|
+ margin-right: 15px;
|
|
|
+ display: inline-block;
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
- });
|
|
|
-</script>
|
|
|
-<script type="text/javascript" src="/system/util/mpFrame.js"></script>
|
|
|
-
|
|
|
+
|
|
|
+ .pictrue img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upLoad {
|
|
|
+ width: 58px;
|
|
|
+ height: 58px;
|
|
|
+ line-height: 58px;
|
|
|
+ border: 1px dotted rgba(0, 0, 0, 0.1);
|
|
|
+ border-radius: 4px;
|
|
|
+ background: rgba(0, 0, 0, 0.02);
|
|
|
+ cursor: pointer;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rulesBox {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .layui-tab-content {
|
|
|
+ margin-top: 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ml110 {
|
|
|
+ margin: 18px 0 4px 110px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rules {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rules-btn-sm {
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ font-size: 12px;
|
|
|
+ width: 109px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rules-btn-sm input {
|
|
|
+ width: 79% !important;
|
|
|
+ height: 84% !important;
|
|
|
+ padding: 0 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ml10 {
|
|
|
+ margin-left: 10px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ml40 {
|
|
|
+ margin-left: 40px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .closes {
|
|
|
+ position: absolute;
|
|
|
+ left: 86%;
|
|
|
+ top: -18%;
|
|
|
+ }
|
|
|
+ .red {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ .layui-input-block .layui-video-box{
|
|
|
+ width: 22%;
|
|
|
+ height: 180px;
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color:
|
|
|
+ margin-top: 10px;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .layui-input-block .layui-video-box i{
|
|
|
+ color:
|
|
|
+ line-height: 180px;
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ display: inherit;
|
|
|
+ font-size: 50px;
|
|
|
+ }
|
|
|
+ .layui-input-block .layui-video-box .mark{
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 30px;
|
|
|
+ top: 0;
|
|
|
+ background-color: rgba(0,0,0,.5);
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .store_box{
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .info{
|
|
|
+ color:
|
|
|
+ padding-left: 10px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
</head>
|
|
|
-<body class="gray-bg">
|
|
|
-<div class="wrapper wrapper-content">
|
|
|
-
|
|
|
-<div class="row">
|
|
|
- <div class="col-sm-12 panel panel-default" >
|
|
|
- <div class="layui-card-header">
|
|
|
- <span class="">竞拍场添加</span>
|
|
|
- <button style="margin-left: 20px" type="button" class="layui-btn layui-btn-primary layui-btn-xs goBack">返回列表</button>
|
|
|
- </div>
|
|
|
- <div class="panel-body" style="padding: 30px">
|
|
|
- <form class="form-horizontal" id="signupForm">
|
|
|
- <div class="form-group">
|
|
|
- <div class="col-md-12">
|
|
|
- <div class="input-group">
|
|
|
- <span class="input-group-addon">名称</span>
|
|
|
- <input maxlength="50" style="width: 40%" placeholder="请在这里输入名称" name="title" class="layui-input" id="nickname" value="">
|
|
|
- <input type="hidden" id="id" value="">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
- <div class="grid-demo grid-demo-bg1">
|
|
|
- <div class="layui-form-item">
|
|
|
- <label class="layui-form-label">商品规格<i class="red">*</i></label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <input type="radio" name="status" value="0" title="使用"
|
|
|
- lay-filter="spec_type"
|
|
|
- :checked="formData.status == 0 ? true : false">
|
|
|
- <input type="radio" name="status" value="1" title="禁用"
|
|
|
- lay-filter="spec_type"
|
|
|
- :checked="formData.status == 1 ? true : false">
|
|
|
+<body>
|
|
|
+<div class="layui-fluid">
|
|
|
+ <div class="layui-row layui-col-space15" id="app" v-cloak="">
|
|
|
+ <div class="layui-card">
|
|
|
+ <div class="layui-card-header">
|
|
|
+ <span class="">竞拍添加</span>
|
|
|
+ <button style="margin-left: 20px" type="button" class="layui-btn layui-btn-primary layui-btn-xs" @click="goBack">返回列表</button>
|
|
|
+ </div>
|
|
|
+ <div class="layui-card-body">
|
|
|
+ <form class="layui-form" action="" v-cloak="">
|
|
|
+ <div class="layui-tab layui-tab-brief" lay-filter="docTabBrief">
|
|
|
+ <div class="layui-tab-content">
|
|
|
+ <div class="layui-tab-item layui-show">
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">商品名称<i class="red">*</i></label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input type="text" name="nickname" lay-verify="title" autocomplete="off"
|
|
|
+ placeholder="竞拍名称" class="layui-input" v-model="formData.nickname" maxlength="100">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">竞拍封面图<i class="red">*</i></label>
|
|
|
+ <div class="pictrueBox">
|
|
|
+ <div class="pictrue" v-if="formData.image" @click="uploadImage('image')">
|
|
|
+ <img :src="formData.image"></div>
|
|
|
+ <div class="upLoad" @click="uploadImage('image')" v-else>
|
|
|
+ <i class="layui-icon layui-icon-camera" class="iconfont"
|
|
|
+ style="font-size: 26px;"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">商品状态</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input type="radio" name="status" lay-filter="status" value="1" title="上架"
|
|
|
+ :checked="formData.status == 1 ? true : false">
|
|
|
+ <input type="radio" name="status" lay-filter="status" value="0" title="下架"
|
|
|
+ :checked="formData.status == 0 ? true : false">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">预约时间<i class="red ">*</i></label>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <input type="text" class="layui-input" name="time" id="time" value="" placeholder="-">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">进场时间<i class="red">*</i></label>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <input type="text" class="layui-input" name="rtime" id="rtime" value="" placeholder="-">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">排序<i class="red">*</i></label>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <input type="number" name="sort" lay-verify="title" autocomplete="off" class="layui-input" v-model="formData.sort" maxlength="100" value="0">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="layui-tab-item">
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <textarea type="text/plain" name="description" id="myEditor" style="width:100%;">{{formData.description}}</textarea>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-actions">
|
|
|
- <div class="row">
|
|
|
- <div class="col-md-offset-4 col-md-9">
|
|
|
- <button type="button" class="btn btn-w-m btn-info save">保存</button>
|
|
|
+ <div class="layui-tab-content">
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
+ <button class="layui-btn layui-btn-normal layui-btn-sm" id="submit" type="button" @click="handleSubmit()">提交</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<script src="/system/js/layuiList.js"></script>
|
|
|
-
|
|
|
+<script>
|
|
|
|
|
|
+ var id = <?php echo htmlentities($id); ?>;
|
|
|
+ layui.use('laydate', function(){
|
|
|
+ var laydate = layui.laydate;
|
|
|
|
|
|
-<script>
|
|
|
- UM.registerUI('selectimgs',function(name){
|
|
|
- var me = this;
|
|
|
- var $btn = $.eduibutton({
|
|
|
- icon : 'image',
|
|
|
- click : function(){
|
|
|
- createFrame('选择图片','<?php echo Url('widget.images/index'); ?>?fodder=editor');
|
|
|
- },
|
|
|
- title: '选择图片'
|
|
|
+ laydate.render({
|
|
|
+ elem: '#time'
|
|
|
+ ,type: 'time'
|
|
|
+ ,range: true
|
|
|
});
|
|
|
-
|
|
|
- this.addListener('selectionchange',function(){
|
|
|
-
|
|
|
- var state = this.queryCommandState(name);
|
|
|
- $btn.edui().disabled(state == -1).active(state == 1)
|
|
|
+ laydate.render({
|
|
|
+ elem: '#rtime'
|
|
|
+ ,type: 'time'
|
|
|
+ ,range: true
|
|
|
});
|
|
|
- return $btn;
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- function changeIMG(index,pic){
|
|
|
- $(".image_img").css('background-image',"url("+pic+")");
|
|
|
- $(".active").css('background-image',"url("+pic+")");
|
|
|
- $('#image_input').val(pic);
|
|
|
- }
|
|
|
-
|
|
|
- function insertEditor(list){
|
|
|
- console.log(list);
|
|
|
- um.execCommand('insertimage', list);
|
|
|
- }
|
|
|
-
|
|
|
- * 上传图片
|
|
|
- * */
|
|
|
- $('.upload_span').on('click',function (e) {
|
|
|
-
|
|
|
- createFrame('选择图片','<?php echo Url('widget.images/index'); ?>?fodder=image');
|
|
|
})
|
|
|
|
|
|
-
|
|
|
- * 编辑器上传图片
|
|
|
- * */
|
|
|
- $('.edui-icon-image').on('click',function (e) {
|
|
|
-
|
|
|
- createFrame('选择图片','<?php echo Url('widget.images/index'); ?>?fodder=image');
|
|
|
- })
|
|
|
+ new Vue({
|
|
|
+ el: '#app',
|
|
|
+ data: {
|
|
|
+ id:id,
|
|
|
+
|
|
|
+ cateList: [],
|
|
|
+
|
|
|
+ tempList: [],
|
|
|
+ upload:{
|
|
|
+ videoIng:false
|
|
|
+ },
|
|
|
+ formData: {
|
|
|
+ description: '',
|
|
|
+ status: '',
|
|
|
+ image:'',
|
|
|
+ time:'',
|
|
|
+ rtime:''
|
|
|
+ },
|
|
|
+ rule: {
|
|
|
+ slider_image: {
|
|
|
+ maxLength: 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ attr: [],
|
|
|
+ newRule: false,
|
|
|
+ radioRule: ['status'],
|
|
|
+ ruleList:[],
|
|
|
+ ruleIndex:-1,
|
|
|
+ progress: 0,
|
|
|
+ um: null,
|
|
|
+ form: null,
|
|
|
+ layTabId: 1,
|
|
|
+ ruleBool: id ? true : false,
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ 'formData.is_sub':function (n) {
|
|
|
+ if (n == 1) {
|
|
|
+ this.formHeader.push({title:'一级返佣(元)'});
|
|
|
+ this.formHeader.push({title:'二级级返佣(元)'});
|
|
|
+ } else {
|
|
|
+ this.formHeader.pop();
|
|
|
+ this.formHeader.pop();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'formData.spec_type':function (n) {
|
|
|
+ if (n) {
|
|
|
+ this.render();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ back:function(){
|
|
|
+ var that = this;
|
|
|
+ layui.use(['element'], function () {
|
|
|
+ layui.element.tabChange('docTabBrief', that.layTabId == 1 ? 1 : parseInt(that.layTabId) - 1);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ next:function(){
|
|
|
+ var that = this;
|
|
|
+ layui.use(['element'], function () {
|
|
|
+ layui.element.tabChange('docTabBrief', that.layTabId == 3 ? 3 : parseInt(that.layTabId) + 1);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goBack:function(){
|
|
|
+ location.href = this.U({c:'auction.auction',a:'index'});
|
|
|
+ },
|
|
|
+ U: function (opt) {
|
|
|
+ var m = opt.m || 'admin', c = opt.c || window.controlle || '', a = opt.a || 'index', q = opt.q || '',
|
|
|
+ p = opt.p || {};
|
|
|
+ var params = Object. keys(p).map(function (key) {
|
|
|
+ return key + '/' + p[key];
|
|
|
+ }).join('/');
|
|
|
+ var gets = Object.keys(q).map(function (key) {
|
|
|
+ return key+'='+ q[key];
|
|
|
+ }).join('&');
|
|
|
|
|
|
- $('.goBack').on('click', function (e) {
|
|
|
- location.href = '<?php echo Url('auction.auction/index'); ?>';
|
|
|
- })
|
|
|
+ return '/' + m + '/' + c + '/' + a + (params == '' ? '' : '/' + params) + (gets == '' ? '' : '?' + gets);
|
|
|
+ },
|
|
|
+
|
|
|
+ * 提示
|
|
|
+ * */
|
|
|
+ showMsg: function (msg, success) {
|
|
|
+ $('#submit').removeAttr('disabled').text('提交');
|
|
|
+ layui.use(['layer'], function () {
|
|
|
+ layui.layer.msg(msg, success);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addBrokerage:function(){
|
|
|
+ if (this.brokerage.brokerage >= 0 && this.brokerage.brokerage_two >= 0){
|
|
|
+ var that = this;
|
|
|
+ this.$set(this.formData,'attrs',this.formData.attrs.map(function (item) {
|
|
|
+ item.brokerage = that.brokerage.brokerage;
|
|
|
+ item.brokerage_two = that.brokerage.brokerage_two;
|
|
|
+ return item;
|
|
|
+ }));
|
|
|
+ } else {
|
|
|
+ return this.showMsg('请填写返佣金额在进行批量添加');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ batchClear:function(){
|
|
|
+ this.$set(this,'batchAttr',{
|
|
|
+ pic: '',
|
|
|
+ price: 0,
|
|
|
+ cost: 0,
|
|
|
+ ot_price: 0,
|
|
|
+ stock: 0,
|
|
|
+ bar_code: '',
|
|
|
+ weight: 0,
|
|
|
+ volume: 0,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ * 批量添加
|
|
|
+ * */
|
|
|
+ batchAdd:function(){
|
|
|
+ var that = this;
|
|
|
+ this.$set(this.formData,'attrs',this.formData.attrs.map(function (item) {
|
|
|
+ if (that.batchAttr.pic) {
|
|
|
+ item.pic = that.batchAttr.pic;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.price > 0){
|
|
|
+ item.price = that.batchAttr.price;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.cost > 0){
|
|
|
+ item.cost = that.batchAttr.cost;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.ot_price > 0){
|
|
|
+ item.ot_price = that.batchAttr.ot_price;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.stock > 0){
|
|
|
+ item.stock = that.batchAttr.stock;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.bar_code != ''){
|
|
|
+ item.bar_code = that.batchAttr.bar_code;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.weight > 0){
|
|
|
+ item.weight = that.batchAttr.weight;
|
|
|
+ }
|
|
|
+ if (that.batchAttr.volume > 0){
|
|
|
+ item.volume = that.batchAttr.volume;
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ }));
|
|
|
|
|
|
-
|
|
|
- * 提交图文
|
|
|
- * */
|
|
|
- $('.save').on('click',function(e){
|
|
|
- var nickname = $('#nickname').val();
|
|
|
- console.log(nickname);
|
|
|
- })
|
|
|
+ },
|
|
|
+
|
|
|
+ * 获取商品信息
|
|
|
+ * */
|
|
|
+ getProductInfo: function () {
|
|
|
+ var that = this;
|
|
|
+ that.requestGet(that.U({c:"store.StoreProduct",a:'get_product_info',q:{id:that.id}})).then(function (res) {
|
|
|
+ that.$set(that,'cateList',res.data.cateList);
|
|
|
+ that.$set(that,'tempList',res.data.tempList);
|
|
|
+ var productInfo = res.data.productInfo || {};
|
|
|
+ if(productInfo.id && that.id){
|
|
|
+ that.$set(that,'formData',productInfo);
|
|
|
+ that.generate();
|
|
|
+ }
|
|
|
+ that.getRuleList();
|
|
|
+ that.init();
|
|
|
+ }).catch(function (res) {
|
|
|
+ that.showMsg(res.msg);
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ * 给某个属性添加属性值
|
|
|
+ * @param item
|
|
|
+ * */
|
|
|
+ addDetail: function (item) {
|
|
|
+ if (!item.detailValue) return false;
|
|
|
+ if (item.detail.find(function (val) {
|
|
|
+ if(item.detailValue == val){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ })) {
|
|
|
+ return this.showMsg('添加的属性值重复');
|
|
|
+ }
|
|
|
+ item.detail.push(item.detailValue);
|
|
|
+ item.detailValue = '';
|
|
|
+ },
|
|
|
+
|
|
|
+ * 删除某个属性值
|
|
|
+ * @param item 父级循环集合
|
|
|
+ * @param inx 子集index
|
|
|
+ * */
|
|
|
+ deleteValue: function (item, inx) {
|
|
|
+ if (item.detail.length > 1) {
|
|
|
+ item.detail.splice(inx, 1);
|
|
|
+ } else {
|
|
|
+ return this.showMsg('请设置至少一个属性');
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ * 删除某条属性
|
|
|
+ * @param index
|
|
|
+ * */
|
|
|
+ deleteItem: function (index) {
|
|
|
+ this.formData.items.splice(index, 1);
|
|
|
+ },
|
|
|
+
|
|
|
+ * 删除某条属性
|
|
|
+ * @param index
|
|
|
+ * */
|
|
|
+ deleteAttrs: function (index) {
|
|
|
+ var that = this;
|
|
|
+ if(that.id > 0){
|
|
|
+ that.requestGet(that.U({c:"store.StoreProduct",a:'check_activity',q:{id:that.id}})).then(function (res) {
|
|
|
+ that.showMsg(res.msg);
|
|
|
+ }).catch(function (res) {
|
|
|
+ if (that.formData.attrs.length > 1) {
|
|
|
+ that.formData.attrs.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ return that.showMsg('请设置至少一个规则');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if (that.formData.attrs.length > 1) {
|
|
|
+ that.formData.attrs.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ return that.showMsg('请设置至少一个规则');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ * 创建属性
|
|
|
+ * */
|
|
|
+ createAttrName: function () {
|
|
|
+ if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
|
|
|
+ if (this.formData.items.find(function (val) {
|
|
|
+ if (val.value == this.formDynamic.attrsName) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }.bind(this))) {
|
|
|
+ return this.showMsg('添加的属性重复');
|
|
|
+ }
|
|
|
+ this.formData.items.push({
|
|
|
+ value: this.formDynamic.attrsName,
|
|
|
+ detailValue: '',
|
|
|
+ attrHidden: false,
|
|
|
+ detail: [this.formDynamic.attrsVal]
|
|
|
+ });
|
|
|
+ this.formDynamic.attrsName = '';
|
|
|
+ this.formDynamic.attrsVal = '';
|
|
|
+ this.newRule = false;
|
|
|
+ } else {
|
|
|
+ return this.showMsg('请添加完整的规格!');
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ * 删除图片
|
|
|
+ * */
|
|
|
+ deleteImage: function (key, index) {
|
|
|
+ var that = this;
|
|
|
+ if (index != undefined) {
|
|
|
+ that.formData[key].splice(index, 1);
|
|
|
+ that.$set(that.formData, key, that.formData[key]);
|
|
|
+ } else {
|
|
|
+ that.$set(that.formData, key, '');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ createFrame: function (title, src, opt) {
|
|
|
+ opt === undefined && (opt = {});
|
|
|
+ var h = 0;
|
|
|
+ if (window.innerHeight < 800 && window.innerHeight >= 700) {
|
|
|
+ h = window.innerHeight - 50;
|
|
|
+ } else if (window.innerHeight < 900 && window.innerHeight >= 800) {
|
|
|
+ h = window.innerHeight - 100;
|
|
|
+ } else if (window.innerHeight < 1000 && window.innerHeight >= 900) {
|
|
|
+ h = window.innerHeight - 150;
|
|
|
+ } else if (window.innerHeight >= 1000) {
|
|
|
+ h = window.innerHeight - 200;
|
|
|
+ } else {
|
|
|
+ h = window.innerHeight;
|
|
|
+ }
|
|
|
+ var area = [(opt.w || window.innerWidth / 2) + 'px', (!opt.h || opt.h > h ? h : opt.h) + 'px'];
|
|
|
+ layui.use('layer',function () {
|
|
|
+ return layer.open({
|
|
|
+ type: 2,
|
|
|
+ title: title,
|
|
|
+ area: area,
|
|
|
+ fixed: false,
|
|
|
+ maxmin: true,
|
|
|
+ moveOut: false,
|
|
|
+ anim: 5,
|
|
|
+ offset: 'auto',
|
|
|
+ shade: 0,
|
|
|
+ resize: true,
|
|
|
+ content: src,
|
|
|
+ move: '.layui-layer-title'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeIMG: function (name, value) {
|
|
|
+ if (this.getRule(name).maxLength !== undefined) {
|
|
|
+ var that = this;
|
|
|
+ value.map(function (v) {
|
|
|
+ that.formData[name].push(v);
|
|
|
+ });
|
|
|
+ this.$set(this.formData, name, this.formData[name]);
|
|
|
+ } else {
|
|
|
+ if(name == 'batchAttr.pic'){
|
|
|
+ this.batchAttr.pic = value;
|
|
|
+ } else {
|
|
|
+ if (name.indexOf('.') !== -1) {
|
|
|
+ var key = name.split('.');
|
|
|
+ if (key.length == 2){
|
|
|
+ this.formData[key[0]][key[1]] = value;
|
|
|
+ } else if(key.length == 3){
|
|
|
+ this.formData[key[0]][key[1]][key[2]] = value;
|
|
|
+ } else if(key.length == 4){
|
|
|
+ this.$set(this.formData[key[0]][key[1]][key[2]],key[3],value)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formData[name] = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getRule: function (name) {
|
|
|
+ return this.rule[name] || {};
|
|
|
+ },
|
|
|
+ uploadImage: function (name) {
|
|
|
+ return this.createFrame('选择图片',this.U({c:"widget.images",a:'index',p:{fodder:name}}),{h:545,w:900});
|
|
|
+ },
|
|
|
+ uploadVideo: function () {
|
|
|
+ if (this.videoLink) {
|
|
|
+ this.formData.video_link = this.videoLink;
|
|
|
+ } else {
|
|
|
+ $(this.$refs.filElem).click();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ delVideo: function () {
|
|
|
+ var that = this;
|
|
|
+ that.$set(that.formData, 'video_link', '');
|
|
|
+ },
|
|
|
+ insertEditor: function (list) {
|
|
|
+ this.um.execCommand('insertimage', list);
|
|
|
+ },
|
|
|
+ insertEditorVideo: function (src) {
|
|
|
+ this.um.setContent('<div><video style="width: 99%" src="'+src+'" class="video-ue" controls="controls" width="100"><source src="'+src+'"></source></video></div><br>',true);
|
|
|
+ },
|
|
|
+ getContent: function () {
|
|
|
+ return this.um.getContent();
|
|
|
+ },
|
|
|
+
|
|
|
+ * 监听radio字段
|
|
|
+ */
|
|
|
+ eeventRadio: function () {
|
|
|
+ var that = this;
|
|
|
+ that.radioRule.map(function (val) {
|
|
|
+ that.form.on('radio(' + val + ')', function (res) {
|
|
|
+ that.formData[val] = res.value;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ init: function () {
|
|
|
+ var that = this;
|
|
|
+ window.UMEDITOR_CONFIG.toolbar = [
|
|
|
+
|
|
|
+ 'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
|
|
|
+ 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
|
|
|
+ '| justifyleft justifycenter justifyright justifyjustify |',
|
|
|
+ 'link unlink | emotion selectimgs video | map',
|
|
|
+ '| horizontal print preview fullscreen', 'drafts', 'formula'
|
|
|
+ ];
|
|
|
+ UM.registerUI('selectimgs', function (name) {
|
|
|
+ var me = this;
|
|
|
+ var $btn = $.eduibutton({
|
|
|
+ icon: 'image',
|
|
|
+ click: function () {
|
|
|
+ that.createFrame('选择图片', "<?php echo Url('widget.images/index',['fodder'=>'editor']); ?>");
|
|
|
+ },
|
|
|
+ title: '选择图片'
|
|
|
+ });
|
|
|
|
|
|
-</script>
|
|
|
+ this.addListener('selectionchange', function () {
|
|
|
+
|
|
|
+ var state = this.queryCommandState(name);
|
|
|
+ $btn.edui().disabled(state == -1).active(state == 1)
|
|
|
+ });
|
|
|
+ return $btn;
|
|
|
|
|
|
+ });
|
|
|
+ UM.registerUI('video', function (name) {
|
|
|
+ var me = this;
|
|
|
+ var $btn = $.eduibutton({
|
|
|
+ icon: 'video',
|
|
|
+ click: function () {
|
|
|
+ that.createFrame('选择视频', "<?php echo Url('widget.video/index',['fodder'=>'video']); ?>");
|
|
|
+ },
|
|
|
+ title: '选择视频'
|
|
|
+ });
|
|
|
|
|
|
-</div>
|
|
|
+ this.addListener('selectionchange', function () {
|
|
|
+
|
|
|
+ var state = this.queryCommandState(name);
|
|
|
+ $btn.edui().disabled(state == -1).active(state == 1)
|
|
|
+ });
|
|
|
+ return $btn;
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ this.um = UM.getEditor('myEditor', {initialFrameWidth: '99%', initialFrameHeight: 400});
|
|
|
+ this.um.setContent(that.formData.description);
|
|
|
+ that.$nextTick(function () {
|
|
|
+ layui.use(['form','element'], function () {
|
|
|
+ that.form = layui.form;
|
|
|
+ that.form.render();
|
|
|
+ that.form.on('select(temp_id)', function (data) {
|
|
|
+ that.$set(that.formData, 'temp_id', data.value);
|
|
|
+ });
|
|
|
+ that.form.on('select(rule_index)', function (data) {
|
|
|
+ that.ruleIndex = data.value;
|
|
|
+ });
|
|
|
+ layui.element.on('tab(docTabBrief)', function(){
|
|
|
+ that.layTabId = this.getAttribute('lay-id');
|
|
|
+ });
|
|
|
+ that.eeventRadio();
|
|
|
+ });
|
|
|
+
|
|
|
+ layui.config({
|
|
|
+ base : '/static/plug/layui/'
|
|
|
+ }).extend({
|
|
|
+ selectN: './selectN',
|
|
|
+ }).use('selectM',function () {
|
|
|
+ var selectM = layui.selectM;
|
|
|
+ selectM({
|
|
|
+
|
|
|
+ elem: '#id'
|
|
|
+
|
|
|
+ ,data: that.cateList
|
|
|
+
|
|
|
+ ,selected: that.formData.id || []
|
|
|
+
|
|
|
+ ,max : 10
|
|
|
+ ,name: 'id'
|
|
|
+ ,model: 'formData.id'
|
|
|
+
|
|
|
+ ,delimiter: ','
|
|
|
+
|
|
|
+ ,field: {idName:'value',titleName:'label',statusName:'disabled'}
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ requestPost: function (url, data) {
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ axios.post(url, data).then(function (res) {
|
|
|
+ if (res.status == 200 && res.data.code == 200) {
|
|
|
+ resolve(res.data)
|
|
|
+ } else {
|
|
|
+ reject(res.data);
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ reject({msg:err})
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ requestGet: function (url) {
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ axios.get(url).then(function (res) {
|
|
|
+ if (res.status == 200 && res.data.code == 200) {
|
|
|
+ resolve(res.data)
|
|
|
+ } else {
|
|
|
+ reject(res.data);
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ reject({msg:err})
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ generates: function () {
|
|
|
+ var that = this;
|
|
|
+ that.generate(1);
|
|
|
+ },
|
|
|
+ generate: function (type = 0) {
|
|
|
+ var that = this;
|
|
|
+ this.requestPost(that.U({c:"store.StoreProduct",a:'is_format_attr',p:{id:that.id,type:type}}), {attrs:this.formData.items}).then(function (res) {
|
|
|
+ that.$set(that.formData, 'attrs', res.data.value);
|
|
|
+ that.$set(that, 'formHeader', res.data.header);
|
|
|
+ if (that.id && that.formData.is_sub == 1 && that.formData.spec_type == 1) {
|
|
|
+ that.formHeader.push({title:'一级返佣(元)'});
|
|
|
+ that.formHeader.push({title:'二级级返佣(元)'});
|
|
|
+ }
|
|
|
+ }).catch(function (res) {
|
|
|
+ return that.showMsg(res.msg);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSubmit:function () {
|
|
|
+ var that = this;
|
|
|
+ var time = $('#time').val();
|
|
|
+ var rtime = $('#rtime').val();
|
|
|
+ that.formData.time = time;
|
|
|
+ that.formData.rtime = rtime;
|
|
|
+ if (!that.formData['nickname']){
|
|
|
+ return that.showMsg('请填写名称');
|
|
|
+ }
|
|
|
+ if (!that.formData['image']){
|
|
|
+ return that.showMsg('请上传图片');
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!that.formData['time']){
|
|
|
+ return that.showMsg('请选择预约时间');
|
|
|
+ }
|
|
|
+ if (!that.formData['rtime']){
|
|
|
+ return that.showMsg('请选择进场时间');
|
|
|
+ }
|
|
|
+ $('#submit').attr('disabled', 'disabled').text('保存中...');
|
|
|
+ that.requestPost(that.U({c:'auction.auction',a:'save',p:{id:that.id}}),that.formData).then(function (res) {
|
|
|
+ that.confirm();
|
|
|
+ }).catch(function (res) {
|
|
|
+ that.showMsg(res.msg);
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ confirm: function(){
|
|
|
+ var that = this;
|
|
|
+ layui.use(['layer'], function () {
|
|
|
+ var layer = layui.layer;
|
|
|
+ layer.confirm(that.id ? '修改成功是否返回产品列表' : '添加成功是否返回产品列表', {
|
|
|
+ btn: ['返回列表',that.id ? '继续修改' : '继续添加']
|
|
|
+ }, function(){
|
|
|
+ location.href = that.U({c:'auction.auction',a:'index'});
|
|
|
+ }, function(){
|
|
|
+ location.reload();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ render:function(){
|
|
|
+ this.$nextTick(function(){
|
|
|
+ layui.use(['form'], function () {
|
|
|
+ layui.form.render('select');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleDragStart (e, item) {
|
|
|
+ this.dragging = item;
|
|
|
+ },
|
|
|
+ handleDragEnd (e, item) {
|
|
|
+ this.dragging = null
|
|
|
+ },
|
|
|
+ handleDragOver (e) {
|
|
|
+ e.dataTransfer.dropEffect = 'move'
|
|
|
+ },
|
|
|
+ handleDragEnter (e, item) {
|
|
|
+ e.dataTransfer.effectAllowed = 'move'
|
|
|
+ if (item === this.dragging) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var newItems = [...this.formData.activity];
|
|
|
+ var src = newItems.indexOf(this.dragging);
|
|
|
+ var dst = newItems.indexOf(item);
|
|
|
+ newItems.splice(dst, 0, ...newItems.splice(src, 1))
|
|
|
+ this.formData.activity = newItems;
|
|
|
+ },
|
|
|
+ getRuleList:function (type) {
|
|
|
+ var that = this;
|
|
|
+ that.requestGet(that.U({c:'store.StoreProduct',a:'get_rule'})).then(function (res) {
|
|
|
+ that.$set(that,'ruleList',res.data);
|
|
|
+ if(type !== undefined){
|
|
|
+ that.render();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addRule:function(){
|
|
|
+ return this.createFrame('添加商品规则',this.U({c:'store.StoreProductRule',a:'create'}));
|
|
|
+ },
|
|
|
+ allRule:function () {
|
|
|
+ if (this.ruleIndex != -1) {
|
|
|
+ var rule = this.ruleList[this.ruleIndex];
|
|
|
+ if (rule) {
|
|
|
+ this.ruleBool = true;
|
|
|
+ var rule_value = rule.rule_value.map(function (item) {
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ this.$set(this.formData,'items',rule_value);
|
|
|
+ this.$set(this.formData,'attrs',[]);
|
|
|
+ this.$set(this,'formHeader',[]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.showMsg('选择的属性无效');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ var that = this;
|
|
|
+ axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
|
+ that.getProductInfo();
|
|
|
+ window.$vm = that;
|
|
|
+ window.changeIMG = that.changeIMG;
|
|
|
+ window.insertEditor = that.insertEditor;
|
|
|
+ window.insertEditorVideo = that.insertEditorVideo;
|
|
|
+ window.successFun = function(){
|
|
|
+ that.getRuleList(1);
|
|
|
+ }
|
|
|
+ $(that.$refs.filElem).change(function () {
|
|
|
+ var inputFile = this.files[0];
|
|
|
+ that.requestPost(that.U({c:"widget.video",a:'get_signature'})).then(function (res) {
|
|
|
+ AdminUpload.upload(res.data.uploadType,{
|
|
|
+ token: res.data.uploadToken || '',
|
|
|
+ file: inputFile,
|
|
|
+ accessKeyId: res.data.accessKey || '',
|
|
|
+ accessKeySecret: res.data.secretKey || '',
|
|
|
+ bucketName: res.data.storageName || '',
|
|
|
+ region: res.data.storageRegion || '',
|
|
|
+ domain: res.data.domain || '',
|
|
|
+ uploadIng:function (progress) {
|
|
|
+ that.upload.videoIng = true;
|
|
|
+ that.progress = progress;
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+
|
|
|
+ that.$set(that.formData, 'video_link', res.url);
|
|
|
+ that.progress = 0;
|
|
|
+ that.upload.videoIng = false;
|
|
|
+ return that.showMsg('上传成功');
|
|
|
+ }).catch(function (err) {
|
|
|
+
|
|
|
+ console.info(err);
|
|
|
+ return that.showMsg('上传错误请检查您的配置');
|
|
|
+ });
|
|
|
+ }).catch(function (res) {
|
|
|
+ return that.showMsg(res.msg || '获取密钥失败,请检查您的配置');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+</script>
|
|
|
</body>
|
|
|
</html>
|
|
|
+<script>
|
|
|
+ import Layout from "../../../../../public/static/plug/iview/dist/iview";
|
|
|
+ export default {
|
|
|
+ components: {Layout}
|
|
|
+ }
|
|
|
+</script>
|