|
|
@@ -179,18 +179,15 @@
|
|
|
</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">绑定会馆</label>
|
|
|
- <div class="layui-input-inline">
|
|
|
- <select id="auction_gu_id" name="auction_gu_id" lay-verify="title" v-model="formData.auction_gu_id">
|
|
|
- {foreach $auction as $key=>$vo }
|
|
|
- <option value="{$vo.id}">{$vo.name}<option>
|
|
|
- {/foreach}
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="layui-form-item">
|
|
|
+ <label class="layui-form-label">场馆</label>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <select id="auction_gu_id" name="auction_gu_id" lay-verify="title" v-model="formData.auction_gu_id">
|
|
|
+ <option value="">请选择场馆</option>
|
|
|
+ {foreach $auction as $key=>$vo }
|
|
|
+ <option value="{$vo.id}">{$vo.name}<option>
|
|
|
+ {/foreach}
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -318,6 +315,24 @@
|
|
|
return false;
|
|
|
});
|
|
|
});
|
|
|
+</script>
|
|
|
+<script>
|
|
|
+
|
|
|
+ var id = {$id};
|
|
|
+ layui.use('laydate', function(){
|
|
|
+ var laydate = layui.laydate;
|
|
|
+
|
|
|
+ laydate.render({
|
|
|
+ elem: '#time'
|
|
|
+ ,type: 'time'
|
|
|
+ ,range: true
|
|
|
+ });
|
|
|
+ laydate.render({
|
|
|
+ elem: '#rtime'
|
|
|
+ ,type: 'time'
|
|
|
+ ,range: true
|
|
|
+ });
|
|
|
+ })
|
|
|
|
|
|
new Vue({
|
|
|
el: '#app',
|
|
|
@@ -340,7 +355,6 @@
|
|
|
anticipate: '',
|
|
|
sort: '',
|
|
|
auction_gu_id:''
|
|
|
-
|
|
|
},
|
|
|
rule: { //多图选择规则
|
|
|
slider_image: {
|
|
|
@@ -483,6 +497,8 @@
|
|
|
getProductInfo: function () {
|
|
|
var that = this;
|
|
|
that.requestGet(that.U({c:"auction.auction",a:'get_auction',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);
|
|
|
@@ -781,18 +797,29 @@
|
|
|
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();
|
|
|
- var status = $('#status').val();
|
|
|
var auction_gu_id = $('#auction_gu_id').val();
|
|
|
- that.formData.uid = auction_gu_id;
|
|
|
- that.formData.status = status;
|
|
|
that.formData.time = time;
|
|
|
that.formData.rtime = rtime;
|
|
|
+ that.formData.auction_gu_id = auction_gu_id;
|
|
|
if (!that.formData['auction_gu_id']){
|
|
|
- return that.showMsg('绑定会馆');
|
|
|
+ return that.showMsg('请绑定会馆');
|
|
|
}
|
|
|
if (!that.formData['nickname']){
|
|
|
return that.showMsg('请填写名称');
|
|
|
@@ -807,8 +834,8 @@
|
|
|
if (!that.formData['rtime']){
|
|
|
return that.showMsg('请选择进场时间');
|
|
|
}
|
|
|
- $('#submit').attr('disabled', 'disabled').text('修改中...');
|
|
|
- that.requestPost(that.U({c:'auction.auction',a:'update',p:{id:that.id}}),that.formData).then(function (res) {
|
|
|
+ that.formData.description = that.getContent();
|
|
|
+ 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);
|
|
|
@@ -819,8 +846,8 @@
|
|
|
var that = this;
|
|
|
layui.use(['layer'], function () {
|
|
|
var layer = layui.layer;
|
|
|
- layer.confirm(that.id ? '修改成功是否返回产品列表' : '修改成功是否返回产品列表', {
|
|
|
- btn: ['返回列表',that.id ? '继续修改' : '继续修改'] //按钮
|
|
|
+ layer.confirm(that.id ? '修改成功是否返回产品列表' : '添加成功是否返回产品列表', {
|
|
|
+ btn: ['返回列表',that.id ? '继续修改' : '继续添加'] //按钮
|
|
|
}, function(){
|
|
|
location.href = that.U({c:'auction.auction',a:'index'});
|
|
|
}, function(){
|
|
|
@@ -856,6 +883,15 @@
|
|
|
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'}));
|
|
|
},
|
|
|
@@ -878,14 +914,53 @@
|
|
|
},
|
|
|
mounted: function () {
|
|
|
var that = this;
|
|
|
+ axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
|
that.getProductInfo();
|
|
|
- window.changeIMG = that.changeIMG;
|
|
|
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>
|