update publish
This commit is contained in:
parent
3e45c9350a
commit
61756ac875
@ -2,8 +2,33 @@
|
|||||||
<view id="release">
|
<view id="release">
|
||||||
<u-form :model="form" ref="uForm">
|
<u-form :model="form" ref="uForm">
|
||||||
<u-form-item label="标题" label-position="right"><u-input v-model="form.name" placeholder="请输入标题" /></u-form-item>
|
<u-form-item label="标题" label-position="right"><u-input v-model="form.name" placeholder="请输入标题" /></u-form-item>
|
||||||
|
<!-- form-data -->
|
||||||
|
<view class="titles">封面</view>
|
||||||
|
<u-upload
|
||||||
|
:form-data="coverformdata"
|
||||||
|
:max-count="1"
|
||||||
|
:header="header"
|
||||||
|
name="article_cover"
|
||||||
|
:action="action"
|
||||||
|
del-color="#ececec"
|
||||||
|
upload-text="选择图片"
|
||||||
|
del-bg-color="#fff"
|
||||||
|
:file-list="fileListA"
|
||||||
|
@on-success="uploadcover"
|
||||||
|
></u-upload>
|
||||||
<view class="titles">图片</view>
|
<view class="titles">图片</view>
|
||||||
<u-upload :action="action" del-color="#ececec" upload-text="选择图片" del-bg-color="#fff" :file-list="fileList"></u-upload>
|
<u-upload
|
||||||
|
:form-data="imgformdata"
|
||||||
|
name="article_image"
|
||||||
|
:header="header"
|
||||||
|
:action="action"
|
||||||
|
@on-success="uploadphoto"
|
||||||
|
del-color="#ececec"
|
||||||
|
upload-text="选择图片"
|
||||||
|
del-bg-color="#fff"
|
||||||
|
:max-count="5"
|
||||||
|
:file-list="fileListB"
|
||||||
|
></u-upload>
|
||||||
<!-- 标签 -->
|
<!-- 标签 -->
|
||||||
<view>
|
<view>
|
||||||
<view class="titles">标签</view>
|
<view class="titles">标签</view>
|
||||||
@ -14,7 +39,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 简介 -->
|
<!-- 简介 -->
|
||||||
<view class="titles">简介</view>
|
<view class="titles">简介</view>
|
||||||
<view class="titles_border"><textarea placeholder="请输入内容..."></textarea></view>
|
<view class="titles_border"><textarea placeholder="请输入内容..." v-model="form.intro"></textarea></view>
|
||||||
<!-- 底部弹框 商品选择 -->
|
<!-- 底部弹框 商品选择 -->
|
||||||
<view class="show_two">
|
<view class="show_two">
|
||||||
<u-popup v-model="show_two" mode="bottom" :closeable="true">
|
<u-popup v-model="show_two" mode="bottom" :closeable="true">
|
||||||
@ -41,20 +66,20 @@
|
|||||||
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
|
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 选择后的列表 -->
|
<!-- 选择后的列表 -->
|
||||||
<view class="List_tosign" v-for="list in arres_list">
|
<view class="List_tosign" v-for="list in shoplist">
|
||||||
<view><image :src="list.goods_image" mode="scaleToFill"></image></view>
|
<view><image :src="list.goods_image" mode="scaleToFill"></image></view>
|
||||||
<view>{{ list.goods_name }}</view>
|
<view>{{ list.goods_name }}</view>
|
||||||
<view><image src="../../static/image/tosign/delete.png" mode="widthFix" @click="delarr(list.goods_id)"></image></view>
|
<view><image src="../../static/image/tosign/delete.png" mode="widthFix" @click="delarr(list.goods_id)"></image></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 提交 -->
|
<!-- 提交 -->
|
||||||
<u-button class="custom-style" shape="circle" size="default">发表</u-button>
|
<u-button class="custom-style" shape="circle" size="default" @click="publish">发表</u-button>
|
||||||
</u-form>
|
</u-form>
|
||||||
<!-- 添加标签的按钮 -->
|
<!-- 添加标签的按钮 -->
|
||||||
<u-popup v-model="show" mode="center" border-radius="14">
|
<u-popup v-model="show" mode="center" border-radius="14">
|
||||||
<view class="text">创建属于你的标签吧</view>
|
<view class="text">创建属于你的标签吧</view>
|
||||||
<view class="u-inputes"><u-input v-model="form.name" /></view>
|
<view class="u-inputes"><u-input v-model="form.name" /></view>
|
||||||
<u-button class="custom-style-button" shape="circle" size="default">确定</u-button>
|
<u-button class="custom-style-button" shape="circle" size="default" @click="creattag">确定</u-button>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -69,8 +94,20 @@ export default {
|
|||||||
sex: ''
|
sex: ''
|
||||||
},
|
},
|
||||||
// 演示地址,请勿直接使用
|
// 演示地址,请勿直接使用
|
||||||
action: 'http://www.example.com/upload',
|
action: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
|
||||||
fileList: [],
|
coverformdata: {
|
||||||
|
name: 'article_cover'
|
||||||
|
},
|
||||||
|
imgformdata: {
|
||||||
|
name: 'article_image'
|
||||||
|
},
|
||||||
|
fileListA: [],
|
||||||
|
fileListB: [],
|
||||||
|
imgarrA: [],
|
||||||
|
imgarrB: [],
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
fileListes: [],
|
fileListes: [],
|
||||||
show: false,
|
show: false,
|
||||||
show_two: false,
|
show_two: false,
|
||||||
@ -82,8 +119,8 @@ export default {
|
|||||||
List_tosign: [],
|
List_tosign: [],
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
imgarr: [], //上传图片数组
|
imgarr: [], //上传图片数组
|
||||||
cover: '',//图文封面
|
cover: '', //图文封面
|
||||||
selectarr:[]//选中标签
|
selectarr: [] //选中标签
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -92,30 +129,38 @@ export default {
|
|||||||
this.getLiveSpec();
|
this.getLiveSpec();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
publish(){
|
||||||
|
console.log(this.imgarrA)
|
||||||
|
console.log(this.imgarrB)
|
||||||
|
console.log(this.selectarr)
|
||||||
|
console.log(this.form)
|
||||||
|
console.log(this.shoplist)
|
||||||
|
console.log(this.arres_list)
|
||||||
|
},
|
||||||
// 获取商品数组变化
|
// 获取商品数组变化
|
||||||
getshoplist(){
|
getshoplist() {
|
||||||
let arr = this.arres_list
|
let arr = this.arres_list;
|
||||||
let newarr = this.list
|
let newarr = this.list;
|
||||||
this.shoplist=[]
|
this.shoplist = [];
|
||||||
for(let index in arr){
|
for (let index in arr) {
|
||||||
for(let i in newarr){
|
for (let i in newarr) {
|
||||||
if(arr[index]==newarr[i].goods_id){
|
if (arr[index] == newarr[i].goods_id) {
|
||||||
this.shoplist.push(newarr[i])
|
this.shoplist.push(newarr[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(this.shoplist)
|
console.log(this.shoplist);
|
||||||
},
|
},
|
||||||
// 改变选中状态
|
// 改变选中状态
|
||||||
changeselect(num) {
|
changeselect(num) {
|
||||||
if(this.fileListes[num].state == true){
|
if (this.fileListes[num].state == true) {
|
||||||
this.fileListes[num].state=false
|
this.fileListes[num].state = false;
|
||||||
that.arres_list.splice(this.fileListes[num].id, 1);
|
that.arres_list.splice(this.fileListes[num].id, 1);
|
||||||
}else{
|
} else {
|
||||||
this.fileListes[num].state=true
|
this.fileListes[num].state = true;
|
||||||
this.selectarr.push(this.fileListes[num].id)
|
this.selectarr.push(this.fileListes[num].id);
|
||||||
}
|
}
|
||||||
console.log(this.selectarr)
|
console.log(this.selectarr);
|
||||||
},
|
},
|
||||||
// 获取标签
|
// 获取标签
|
||||||
getLiveSpec() {
|
getLiveSpec() {
|
||||||
@ -150,43 +195,17 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 上传封面
|
// 上传封面
|
||||||
uploadcover(path) {
|
uploadcover(data) {
|
||||||
uni.uploadFile({
|
let obj = data.data
|
||||||
url: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
|
obj.url = obj.file_path
|
||||||
filePath: tempFilePaths[0],
|
this.imgarrA.push(obj)
|
||||||
name: 'article_cover',
|
|
||||||
formData: {
|
|
||||||
name: 'article_cover'
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
Authorization: 'Bearer' + ' ' + token
|
|
||||||
},
|
|
||||||
success: uploadFileRes => {
|
|
||||||
let obj = JSON.parse(uploadFileRes.data);
|
|
||||||
that.cover = obj.data.file_name;
|
|
||||||
that.num++;
|
|
||||||
console.log(that.cover);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 上传封面
|
// 上传图片
|
||||||
uploadphoto(path) {
|
uploadphoto(data) {
|
||||||
uni.uploadFile({
|
console.log(data)
|
||||||
url: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
|
let obj = data.data
|
||||||
filePath: tempFilePaths[0],
|
obj.url = obj.file_path
|
||||||
name: 'article_image',
|
this.imgarrB.push(obj)
|
||||||
formData: {
|
|
||||||
name: 'article_image'
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
Authorization: 'Bearer' + ' ' + token
|
|
||||||
},
|
|
||||||
success: uploadFileRes => {
|
|
||||||
let obj = JSON.parse(uploadFileRes.data);
|
|
||||||
that.imgarr.push(obj.data);
|
|
||||||
console.log(that.imgarr);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
changes() {
|
changes() {
|
||||||
let that = this;
|
let that = this;
|
||||||
@ -213,8 +232,9 @@ export default {
|
|||||||
if (id == '') {
|
if (id == '') {
|
||||||
console.log('为空');
|
console.log('为空');
|
||||||
} else {
|
} else {
|
||||||
that.arres_list.splice(id, 1);
|
let index = that.arres_list.indexOf(id);
|
||||||
that.getshoplist()
|
that.arres_list.splice(index, 1);
|
||||||
|
that.getshoplist();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 增加直播商品
|
// 增加直播商品
|
||||||
@ -224,7 +244,7 @@ export default {
|
|||||||
console.log('为空');
|
console.log('为空');
|
||||||
} else {
|
} else {
|
||||||
that.arres_list.push(id);
|
that.arres_list.push(id);
|
||||||
that.getshoplist()
|
that.getshoplist();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tosign() {
|
tosign() {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
<u-form-item label="标题" label-position="right">
|
<u-form-item label="标题" label-position="right">
|
||||||
<u-input v-model="form.name" placeholder="请输入标题" />
|
<u-input v-model="form.name" placeholder="请输入标题" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<view class="titles">封面</view>
|
||||||
|
<u-upload :action="action" del-color="#ececec" upload-text="选择图片" del-bg-color="#fff" :file-list="fileList" ></u-upload>
|
||||||
<view class="titles">图片</view>
|
<view class="titles">图片</view>
|
||||||
<u-upload :action="action" del-color="#ececec" upload-text="选择图片" del-bg-color="#fff" :file-list="fileList" ></u-upload>
|
<u-upload :action="action" del-color="#ececec" upload-text="选择图片" del-bg-color="#fff" :file-list="fileList" ></u-upload>
|
||||||
<!-- 标签 -->
|
<!-- 标签 -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user