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