图文视频发布,文章选择删除逻辑没有处理完,需要继续处理
This commit is contained in:
parent
2ed7b6798b
commit
3e45c9350a
@ -4,12 +4,14 @@
|
||||
const install = (Vue, vm) => {
|
||||
// 此处没有使用传入的params参数
|
||||
let api = {
|
||||
// 获取标签
|
||||
getLiveSpec(){
|
||||
return vm.$u.get("Streaming/getLiveSpec")
|
||||
},
|
||||
login({member_name,member_password}){
|
||||
return vm.$u.get("/Login/expertLogin",{member_name,member_password})
|
||||
},
|
||||
// 创建标签
|
||||
createLivesp({spec_name}){
|
||||
return vm.$u.post("Streaming/createLivesp",{spec_name})
|
||||
},
|
||||
|
@ -200,6 +200,15 @@ export default {
|
||||
// 投诉骑手
|
||||
reportcar(type) {
|
||||
let that = this;
|
||||
if(this.clickstate==false){
|
||||
this.clickstate=true
|
||||
}else{
|
||||
this.$refs.uToast.show({
|
||||
title: "不能重复提交",
|
||||
type: 'error'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (that.reportcontent == '') {
|
||||
this.$refs.uToast.show({
|
||||
title: "投诉内容不能为空",
|
||||
@ -207,20 +216,25 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log(that.reportinfo)
|
||||
|
||||
this.$u.api.reportorder({
|
||||
order_id: that.reportinfo.order_id,
|
||||
takeawayer_id: that.reportinfo.takeawayer_id,
|
||||
order_list: that.reportinfo.order_list,
|
||||
content: that.reportcontent
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
// 恢复可点击状态
|
||||
this.clickstate=false
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
// 提交后清空选择
|
||||
that.reportinfo=null
|
||||
that.reportcontent = ""
|
||||
// 提示修改成功
|
||||
that.showComplaint = true;
|
||||
}
|
||||
});
|
||||
@ -282,7 +296,6 @@ export default {
|
||||
type: type,
|
||||
page: that.num
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
|
@ -61,7 +61,8 @@ export default {
|
||||
zhanghaoA: '18953829598 ',
|
||||
mimaA: '123456',
|
||||
url: '',
|
||||
state:0
|
||||
state:0,
|
||||
clickstate:false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -87,18 +88,30 @@ export default {
|
||||
},
|
||||
loading() {},
|
||||
logins() {
|
||||
// 判断是否可以点击
|
||||
if(this.clickstate==false){
|
||||
this.clickstate=true
|
||||
}else{
|
||||
this.$refs.uToast.show({
|
||||
title: "不能重复提交",
|
||||
type: 'error'
|
||||
});
|
||||
return
|
||||
}
|
||||
// 清除本地存储才可以正常登陆(具体原因没有仔细检查)
|
||||
uni.clearStorage();
|
||||
// 账号登录1达人0商家
|
||||
if(this.state==1){
|
||||
this.$u.api.login({ member_name: this.zhanghaoA, member_password: this.mimaA }).then(res => {
|
||||
console.log(res);
|
||||
if (res.errCode != 0) {
|
||||
// 恢复按钮可点击状态
|
||||
this.clickstate=false
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
|
||||
uni.setStorageSync('token', res.data.token);
|
||||
uni.setStorageSync('userinfo', res.data);
|
||||
uni.setStorageSync('rongyun', res.data.rongcloud_token);
|
||||
@ -109,8 +122,9 @@ export default {
|
||||
});
|
||||
}else{
|
||||
this.$u.api.shoplogin({ member_name: this.zhanghao, member_password: this.mima }).then(res => {
|
||||
console.log(res);
|
||||
if (res.errCode != 0) {
|
||||
// 恢复按钮可点击状态
|
||||
this.clickstate=false
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
|
@ -8,7 +8,9 @@
|
||||
<view>
|
||||
<view class="titles">标签</view>
|
||||
<view class="form-view" @click="show_add()">+ 新建标签</view>
|
||||
<view class="form-view" v-for="(item, index) in fileListes" :key="index">{{ item }}</view>
|
||||
<view :class="[item.state == true ? 'active' : '', 'form-view']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 简介 -->
|
||||
<view class="titles">简介</view>
|
||||
@ -18,7 +20,7 @@
|
||||
<u-popup v-model="show_two" mode="bottom" :closeable="true">
|
||||
<view class="title"><text>选择商品</text></view>
|
||||
<!-- 商品列表 -->
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll" >
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll">
|
||||
<view class="listes_shoping" v-for="(item, index) in list" :key="index">
|
||||
<view>
|
||||
<u-checkbox-group>
|
||||
@ -39,10 +41,10 @@
|
||||
<image class="images" src="../../static/image/tosign/bhottom.png"></image>
|
||||
</view>
|
||||
<!-- 选择后的列表 -->
|
||||
<view class="List_tosign" v-if="List_tosign != ''">
|
||||
<view><image src="../../static/image/tosign/tosigin(5).png" mode="scaleToFill"></image></view>
|
||||
<view>木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
|
||||
<view><image src="../../static/image/tosign/delete.png" mode="widthFix"></image></view>
|
||||
<view class="List_tosign" v-for="list in arres_list">
|
||||
<view><image :src="list.goods_image" mode="scaleToFill"></image></view>
|
||||
<view>{{ list.goods_name }}</view>
|
||||
<view><image src="../../static/image/tosign/delete.png" mode="widthFix" @click="delarr(list.goods_id)"></image></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提交 -->
|
||||
@ -69,36 +71,127 @@ export default {
|
||||
// 演示地址,请勿直接使用
|
||||
action: 'http://www.example.com/upload',
|
||||
fileList: [],
|
||||
fileListes: ['美妆', '博主穿搭', '美妆', '美妆', '美妆', '美妆', '美妆', '博主穿搭'],
|
||||
fileListes: [],
|
||||
show: false,
|
||||
show_two: false,
|
||||
filesList: [],
|
||||
arres_list: [],
|
||||
shoplist: [],
|
||||
checked: false,
|
||||
list: [],
|
||||
List_tosign: [],
|
||||
scrollTop: 0
|
||||
scrollTop: 0,
|
||||
imgarr: [], //上传图片数组
|
||||
cover: '',//图文封面
|
||||
selectarr:[]//选中标签
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// 定义删除数组的方法
|
||||
Array.prototype.remove = function(val) {
|
||||
var index = this.indexOf(val);
|
||||
if (index > -1) {
|
||||
this.splice(index, 1);
|
||||
}
|
||||
};
|
||||
// 缓存取选择好的数据
|
||||
this.tosign();
|
||||
this.getLiveSpec();
|
||||
},
|
||||
methods: {
|
||||
// 获取商品数组变化
|
||||
getshoplist(){
|
||||
let arr = this.arres_list
|
||||
let newarr = this.list
|
||||
this.shoplist=[]
|
||||
for(let index in arr){
|
||||
for(let i in newarr){
|
||||
if(arr[index]==newarr[i].goods_id){
|
||||
this.shoplist.push(newarr[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.shoplist)
|
||||
},
|
||||
// 改变选中状态
|
||||
changeselect(num) {
|
||||
if(this.fileListes[num].state == true){
|
||||
this.fileListes[num].state=false
|
||||
that.arres_list.splice(this.fileListes[num].id, 1);
|
||||
}else{
|
||||
this.fileListes[num].state=true
|
||||
this.selectarr.push(this.fileListes[num].id)
|
||||
}
|
||||
console.log(this.selectarr)
|
||||
},
|
||||
// 获取标签
|
||||
getLiveSpec() {
|
||||
let that = this;
|
||||
this.$u.api.getLiveSpec({}).then(res => {
|
||||
console.log(res);
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
let arr = res.data;
|
||||
for (let index in arr) {
|
||||
arr[index].state = false;
|
||||
}
|
||||
console.log(arr);
|
||||
that.fileListes = arr;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 创建标签
|
||||
addLiveSpec() {
|
||||
this.$u.api.createLivesp({}).then(res => {
|
||||
console.log(res);
|
||||
if (res.data.live_stataes == 0) {
|
||||
this.$u.route({
|
||||
url: `/pages/${url}`
|
||||
});
|
||||
} else {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 上传封面
|
||||
uploadcover(path) {
|
||||
uni.uploadFile({
|
||||
url: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
|
||||
filePath: tempFilePaths[0],
|
||||
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) {
|
||||
uni.uploadFile({
|
||||
url: 'https://dmmall.sdbairui.com/storeapi/Upload/uploadFile',
|
||||
filePath: tempFilePaths[0],
|
||||
name: 'article_image',
|
||||
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() {
|
||||
let that = this;
|
||||
that.show_two = false;
|
||||
console.log(that.arres_list);
|
||||
// 过滤数组
|
||||
that.arres_list = [...new Set(that.arres_list)];
|
||||
console.log(that.arres_list);
|
||||
},
|
||||
show_add() {
|
||||
console.log(this.show);
|
||||
@ -109,11 +202,10 @@ export default {
|
||||
let id = e.name;
|
||||
if (e.value == true) {
|
||||
this.pushes(id);
|
||||
}else{
|
||||
this.delarr(id)
|
||||
} else {
|
||||
this.delarr(id);
|
||||
}
|
||||
console.log(this.arres_list)
|
||||
|
||||
console.log(this.arres_list);
|
||||
},
|
||||
// 删除直播商品
|
||||
delarr(id) {
|
||||
@ -121,7 +213,8 @@ export default {
|
||||
if (id == '') {
|
||||
console.log('为空');
|
||||
} else {
|
||||
that.arres_list.remove(id);
|
||||
that.arres_list.splice(id, 1);
|
||||
that.getshoplist()
|
||||
}
|
||||
},
|
||||
// 增加直播商品
|
||||
@ -131,22 +224,22 @@ export default {
|
||||
console.log('为空');
|
||||
} else {
|
||||
that.arres_list.push(id);
|
||||
that.getshoplist()
|
||||
}
|
||||
},
|
||||
tosign() {
|
||||
console.log('111');
|
||||
this.$u.api.canselectgood({}).then(res => {
|
||||
console.log(res);
|
||||
if(res.data.live_stataes==0){
|
||||
if (res.data.live_stataes == 0) {
|
||||
this.$u.route({
|
||||
url: `/pages/${url}`
|
||||
});
|
||||
}else{
|
||||
let arr = res.data.list
|
||||
for(let index in arr){
|
||||
arr[index].checked=false
|
||||
} else {
|
||||
let arr = res.data.list;
|
||||
for (let index in arr) {
|
||||
arr[index].checked = false;
|
||||
}
|
||||
this.list = arr
|
||||
this.list = arr;
|
||||
}
|
||||
});
|
||||
// try {
|
||||
@ -177,6 +270,9 @@ export default {
|
||||
margin-bottom: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.active {
|
||||
background: red;
|
||||
}
|
||||
.scroll {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
|
Loading…
Reference in New Issue
Block a user