作者 lihongjuan

修改直播路径的参数

不能预览此文件类型
... ... @@ -164,10 +164,10 @@
>
<!-- v-clipboard:error="onError" -->
</div>
<div class="flexone dianitem" @click="save(item)">
<!-- <div class="flexone dianitem" @click="save(item)">
<img src="../../../assets/download.png" alt class="dianzanimg" />
<span class="number">一键保存</span>
</div>
</div> -->
</div>
</div>
</van-list>
... ... @@ -280,15 +280,15 @@ export default {
images: [],
startPosition: 0,
showcomment: false,
socialId: '',
socialId: "",
comment_id: "",
textcomment: '',
textcomment: "",
shortcomment: [],
allcomment: [],
showcommentlist: [],
defaultlen: false,
dateinit: '请输入',
fasong: '',
dateinit: "请输入",
fasong: "",
navarrsec: [],
selnavsec: -1
};
... ... @@ -308,7 +308,7 @@ export default {
this.images = item.images_arr;
if (this.images.length == 0) {
this.nophoto = true;
setTimeout(function () {
setTimeout(function() {
that.nophoto = false;
}, 1500);
} else {
... ... @@ -337,10 +337,10 @@ export default {
// 显示消息弹出层
messageshow(index, item) {
console.log(item)
console.log(item);
this.showcomment = true;
this.socialId = item.id
this.getcommentlist()
this.socialId = item.id;
this.getcommentlist();
},
// 获取消息列表
getcommentlist() {
... ... @@ -352,45 +352,41 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.allcomment = res.data.social;
console.log('434', that.allcomment)
console.log("434", that.allcomment);
that.shortcomment = res.data.social.slice(0, 5);
if (that.fasong == 1) {
if (that.defaultlen == true) {
that.defaultlen = true;
that.showcommentlist = that.shortcomment
that.showcommentlist = that.shortcomment;
} else {
that.defaultlen = false;
that.showcommentlist = that.allcomment
that.showcommentlist = that.allcomment;
}
} else {
if (res.data.social.length > 5) {
that.defaultlen = true
that.defaultlen = true;
}
that.showcommentlist = that.shortcomment
that.showcommentlist = that.shortcomment;
}
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
replay(item, index) {
console.log(item)
console.log(item);
this.dateinit = item.user_info.nickname;
this.comment_id = item.id
this.comment_id = item.id;
},
sendtext() {
let that = this;
if (this.textcomment == '') {
Toast("请输入评论内容")
return false
if (this.textcomment == "") {
Toast("请输入评论内容");
return false;
}
var url = "/api/social/comment_send";
let param = {
... ... @@ -401,54 +397,46 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
Toast("发送成功")
that.sortlist.forEach(function (value, index, arrray) {
Toast("发送成功");
that.sortlist.forEach(function(value, index, arrray) {
if (value.id == that.socialId) {
value.comment_count = value.comment_count + 1
value.comment_count = value.comment_count + 1;
}
})
});
that.sortlist = that.sortlist;
// that.showcomment = false;
that.fasong = 1;
that.textcomment = '';
that.textcomment = "";
that.getcommentlist();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
Toast(err.msg)
Toast(err.msg);
});
},
seemorecomment() {
this.showcommentlist = this.allcomment;
this.defaultlen = false
this.defaultlen = false;
},
// 查看更多
seemore(item, index) {
console.log(9999)
console.log(9999);
let that = this;
that.sortlist.forEach(function (value, index, array) {
console.log(value)
that.sortlist.forEach(function(value, index, array) {
console.log(value);
if (value.id == item.id) {
if (value.more == true) {
value.show = !value.show
value.show = !value.show;
}
}
})
});
that.sortlist = that.sortlist;
that.$forceUpdate()
that.$forceUpdate();
},
onLoad() {
let that = this;
console.log(888);
... ... @@ -477,15 +465,15 @@ export default {
// 播放视频
entervideo(url) {
console.log(344803)
console.log(url)
console.log(344803);
console.log(url);
this.$router.push({
path: '/videoplay',
path: "/videoplay",
query: { url: url }
})
});
},
hidecomment() {
this.showcomment = false
this.showcomment = false;
},
// 收藏
collect(index, item) {
... ... @@ -498,7 +486,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
if (item.is_favorite == 0) {
item.is_favorite = 1;
... ... @@ -516,7 +504,7 @@ export default {
that.sortlist = that.sortlist;
that.$forceUpdate();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -532,7 +520,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
if (item.is_good == 0) {
item.is_good = 1;
... ... @@ -550,13 +538,13 @@ export default {
that.sortlist = that.sortlist;
that.$forceUpdate();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 复制文本
copytext() { },
copytext() {},
selectnav(id, index) {
let that = this;
this.selnav = index;
... ... @@ -589,13 +577,13 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
let obj = {
id: '',
sort_name: '全部',
}
id: "",
sort_name: "全部"
};
res.data.unshift(obj);
let len = res.data.length;
that.navarr = res.data.slice(0, 5);
... ... @@ -603,7 +591,7 @@ export default {
that.sort_id = res.data[0].id;
that.getsocidtylist();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -618,24 +606,23 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.sortlist = that.sortlist.concat(res.data.social);
that.sortlist.forEach(function (value, index, array) {
value.show = true
that.sortlist.forEach(function(value, index, array) {
value.show = true;
if (value.description.length > 66) {
value.more = true
value.more = true;
} else {
value.more = false
value.more = false;
}
})
});
that.sortlist = that.sortlist;
that.this_page = res.data.this_page;
that.total_page = res.data.total_page;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
}
... ...
... ... @@ -4,7 +4,12 @@
<div class="changeitemleft">头像</div>
<div class="changeitemright flexone">
<img :src="avatar" alt class="headimg" />
<input type="file" class="shangtu" accept="image/*" @change="afterRead" />
<input
type="file"
class="shangtu"
accept="image/*"
@change="afterRead"
/>
<!-- <input type="file" class="shangtu" @click="afterRead" /> -->
<!-- <van-uploader v-model="fileList" multiple="false" :after-read="afterRead" :max-count="1" /> -->
<img src="../../../assets/grayrow.png" alt class="yourow" />
... ... @@ -24,7 +29,7 @@
</template>
<script>
import Vue from 'vue';
import Vue from "vue";
import { Toast, Uploader, Loading } from "vant";
import "vant/lib/index.css";
... ... @@ -37,28 +42,27 @@ export default {
username: "",
avatar: "",
fileList: [],
chuanimage: '',
chuanimage: "",
cardzheng: false
};
},
created() {
document.title = '唐元集公众号'
document.title = "唐元集公众号";
this.username = this.$route.query.username;
this.avatar = this.$route.query.avatar;
console.log(this.avatar)
console.log(this.avatar);
let obj = {
url: this.avatar
}
this.fileList.push(obj)
};
this.fileList.push(obj);
},
methods: {
// 上传图片
afterRead(e) {
console.log(e)
console.log(e);
let file = e.target.files[0];
let that = this;
that.cardzheng = true
that.cardzheng = true;
var formdata = new FormData();
formdata.append("file", file);
... ... @@ -70,45 +74,47 @@ export default {
that.$uploadFile
.post(url, formdata)
.then(function (res) {
that.cardzheng = false
.then(function(res) {
that.cardzheng = false;
console.log(res);
that.cardzheng = false;
let url = "http://tangyuanji.t.brotop.cn" + res.data.url;
that.avatar = url
that.chuanimage = res.data.url
that.avatar = url;
that.chuanimage = res.data.url;
})
.catch(err => {
console.log(err);
});
},
save() {
let that = this;
if (that.chuanimage == '' && that.cardzheng == false) {
Toast("请上传图片")
return false
}
if (that.chuanimage == '' && that.cardzheng == true) {
Toast("图片正在上传中")
return false
// if (that.chuanimage == '' && that.cardzheng == false) {
// Toast("请上传图片")
// return false
// }
if (that.chuanimage == "" && that.cardzheng == true) {
Toast("图片正在上传中");
return false;
}
var url = "/api/user/profile?avatar=" + that.chuanimage + '&nickname=' + that.username;
var url =
"/api/user/profile?avatar=" +
that.chuanimage +
"&nickname=" +
that.username;
let param = {
avatar: that.chuanimage,
nickname: that.username
};
console.log(param)
console.log(param);
that.$axios
.get(url)
.then(function (res) {
.then(function(res) {
console.log(res);
Toast("保存成功");
that.$router.go(-1);
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
}
... ...
... ... @@ -18,8 +18,13 @@
<img src="../../../assets/xiaolian.png" alt class="xiaoimg" />
<div class="introtitlename" style="font-size:0.28rem">
亲爱的
<span style="font-size:0.28rem;font-weight:bold">{{ result.name }},</span>
<span style="font-size:0.28rem;font-weight:bold">{{result.agent_name}}</span>邀您深度了解唐元集!
<span style="font-size:0.28rem;font-weight:bold"
>{{ result.name }},</span
>
<span style="font-size:0.28rem;font-weight:bold">{{
result.agent_name
}}</span
>邀您深度了解唐元集!
</div>
</div>
</div>
... ... @@ -30,7 +35,7 @@
<div class="textleftheng"></div>
<div class="textyuan"></div>
</div>
<div class="textname">{{intended.company_title}}</div>
<div class="textname">{{ intended.company_title }}</div>
<div class="textleft flexone">
<div class="textkyuan"></div>
<div class="textrightheng"></div>
... ... @@ -47,7 +52,7 @@
<div class="textleftheng"></div>
<div class="textyuan"></div>
</div>
<div class="textname">{{intended.intelligence_title}}</div>
<div class="textname">{{ intended.intelligence_title }}</div>
<div class="textleft flexone">
<div class="textkyuan"></div>
<div class="textrightheng"></div>
... ... @@ -71,7 +76,12 @@
<!-- 弹层 -->
<div class="register" v-if="showshare">
<div class="fenwrap">
<img src="../../../assets/chahao.png" alt class="chahao" @click="hideshare" />
<img
src="../../../assets/chahao.png"
alt
class="chahao"
@click="hideshare"
/>
<div class="fenimg">
<img src="../../../assets/fenimg.png" alt />
<div class="fenname">结果已出,立即分享给朋友</div>
... ... @@ -88,8 +98,8 @@
<script>
import wx from "jweixin-1.6.0";
import Vue from 'vue';
import { ImagePreview } from 'vant';
import Vue from "vue";
import { ImagePreview } from "vant";
Vue.use(ImagePreview);
export default {
data() {
... ... @@ -104,25 +114,25 @@ export default {
images: [],
startPosition: 0,
shareshow: false,
baseurl: '',
intended: ''
baseurl: "",
intended: ""
};
},
created() {
this.baseurl = 'http://' + location.host;
document.title = '唐元集公众号'
this.baseurl = "http://" + location.host;
document.title = "唐元集公众号";
this.subid = this.$route.query.subid;
let type = localStorage.getItem("type")
let type = localStorage.getItem("type");
if (type == 1) {
this.showshare = true
this.showshare = true;
}
this.getresult();
this.getcompanyintro();
this.getzizhi();
this.getappid();
this.getintence()
this.getintence();
console.log(this.intended)
console.log(this.intended);
},
beforeRouteEnter(to, from, next) {
var u = navigator.userAgent;
... ... @@ -137,27 +147,26 @@ export default {
},
methods: {
hidesharek() {
this.shareshow = false
this.shareshow = false;
},
getintence() {
let that = this
console.log(99999)
var result = ""
let that = this;
console.log(99999);
var result = "";
var url = "/api/user/intended";
let param = {};
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
result = res.data
localStorage.setItem("intended", JSON.stringify(res.data.intended))
that.intended = JSON.parse(localStorage.getItem("intended"))
result = res.data;
localStorage.setItem("intended", JSON.stringify(res.data.intended));
that.intended = JSON.parse(localStorage.getItem("intended"));
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 获取appid
getappid() {
... ... @@ -170,8 +179,8 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
console.log(res, 'hahahahaiaioaioaio4');
.then(function(res) {
console.log(res, "hahahahaiaioaioaio4");
wx.config({
debug: false,
appId: res.data.jssdk.appId, // 和获取Ticke的必须一样------必填,公众号的唯一标识
... ... @@ -182,31 +191,29 @@ export default {
jsApiList: [
"showOptionMenu",
"updateAppMessageShareData",
"updateTimelineShareData",
"updateTimelineShareData"
]
});
wx.ready(function () {
wx.ready(function() {
wx.showOptionMenu();
});
that.sharetofriend();
})
that.sharetofriend()
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 分享给朋友
sharetofriend() {
var that = this;
localStorage.setItem("type", '')
localStorage.setItem("type", "");
// 处理验证失败的信息
wx.error(function (res) {
wx.error(function(res) {
logUtil.printLog("验证失败返回的信息:", res);
});
// 处理验证成功的信息
wx.ready(function () {
wx.ready(function() {
// alert(window.location.href.split('#')[0]);
// var share_title = that.sharemsg.title;
// if (share_title.indexOf("${title}") >= 0) {
... ... @@ -227,11 +234,13 @@ export default {
// }
// 分享到朋友圈
wx.updateTimelineShareData({
title: '分享', // 分享标题
link: that.baseurl +
title: "唐元集邀请函", // 分享标题
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
imgUrl:
"http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png",
// imgUrl: that.details.details.img
// ? that.details.details.img
... ... @@ -239,13 +248,13 @@ export default {
// 分享图标
// desc: that.sharemsg.content,
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
console.log("suss");
logUtil.printLog("分享到朋友圈成功返回的信息为:", res);
that.showMsg("分享成功!");
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
console.log("err");
logUtil.printLog("取消分享到朋友圈返回的信息为:", res);
... ... @@ -253,13 +262,14 @@ export default {
}),
// 分享给朋友
wx.updateAppMessageShareData({
title: '分享', // 分享标题
desc: '分享', // 分享描述
title: "唐元集邀请函", // 分享标题
desc: "", // 分享描述
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
imgUrl:
"http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png",
// imgUrl: that.details.details.img
// ? that.details.details.img
... ... @@ -267,11 +277,11 @@ export default {
// 分享图标
type: "", // 分享类型,music、video或link,不填默认为link
dataUrl: "", // 如果type是music或video,则要提供数据链接,默认为空
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
logUtil.printLog("分享给朋友成功返回的信息为:", res);
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
logUtil.printLog("取消分享给朋友返回的信息为:", res);
}
... ... @@ -279,18 +289,14 @@ export default {
});
},
previewimg(imgarr, index) {
console.log(imgarr, index);
let arr = []
imgarr.forEach(function (value, index, array) {
arr.push(value.image)
})
let arr = [];
imgarr.forEach(function(value, index, array) {
arr.push(value.image);
});
this.index = index + 1;
console.log(this.index)
console.log(this.index);
this.images = arr;
this.show = true;
this.startPosition = index;
... ... @@ -305,7 +311,7 @@ export default {
// 确定分享
sueshare() {
this.showshare = false;
this.shareshow = true
this.shareshow = true;
},
hideshare() {
this.showshare = false;
... ... @@ -324,12 +330,12 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.img_arr = res.data.img_arr;
console.log(that.result);
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -343,16 +349,14 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.result = res.data.result;
console.log(that.result);
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -365,11 +369,11 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.company = res.data.company;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
}
... ...
... ... @@ -16,8 +16,13 @@
<img src="../../../assets/xiaolian.png" alt class="xiaoimg" />
<div class="introtitlename" style="font-size:0.28rem">
亲爱的
<span style="font-size:0.28rem;font-weight:bold">{{ result.name }},</span>
<span style="font-size:0.28rem;font-weight:bold">{{result.agent_name}}</span> 邀您深度了解唐元集!
<span style="font-size:0.28rem;font-weight:bold"
>{{ result.name }},</span
>
<span style="font-size:0.28rem;font-weight:bold">{{
result.agent_name
}}</span>
邀您深度了解唐元集!
</div>
</div>
</div>
... ... @@ -28,7 +33,7 @@
<div class="textleftheng"></div>
<div class="textyuan"></div>
</div>
<div class="textname">{{intended.company_title}}</div>
<div class="textname">{{ intended.company_title }}</div>
<div class="textleft flexone">
<div class="textkyuan"></div>
<div class="textrightheng"></div>
... ... @@ -44,7 +49,7 @@
<div class="textleftheng"></div>
<div class="textyuan"></div>
</div>
<div class="textname">{{intended.product_intro_title}}</div>
<div class="textname">{{ intended.product_intro_title }}</div>
<div class="textleft flexone">
<div class="textkyuan"></div>
<div class="textrightheng"></div>
... ... @@ -58,7 +63,12 @@
<!-- 弹层 -->
<div class="register" v-if="showshare">
<div class="fenwrap">
<img src="../../../assets/chahao.png" alt class="chahao" @click="hideshare" />
<img
src="../../../assets/chahao.png"
alt
class="chahao"
@click="hideshare"
/>
<div class="fenimg">
<img src="../../../assets/fenimg.png" alt />
<div class="fenname">结果已出,立即分享给朋友</div>
... ... @@ -82,10 +92,10 @@ export default {
company: "",
product: "",
result: "",
intended: '',
intended: "",
showshare: false,
shareshow: false,
baseurl: ''
baseurl: ""
};
},
beforeRouteEnter(to, from, next) {
... ... @@ -100,47 +110,43 @@ export default {
}
},
created() {
this.baseurl = 'http://' + location.host;
let type = localStorage.getItem("type")
this.baseurl = "http://" + location.host;
let type = localStorage.getItem("type");
if (type == 1) {
this.showshare = true;
}
document.title = '唐元集公众号'
document.title = "唐元集公众号";
this.subid = this.$route.query.subid;
this.getcompanyintro();
this.getresult();
this.getappid();
this.getintence()
this.getintence();
},
mounted() {
window.scrollTo(0, 0);
},
methods: {
hidesharek() {
this.shareshow = false
this.shareshow = false;
},
getintence() {
let that = this
console.log(99999)
var result = ""
let that = this;
console.log(99999);
var result = "";
var url = "/api/user/intended";
let param = {};
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
result = res.data
localStorage.setItem("intended", JSON.stringify(res.data.intended))
result = res.data;
localStorage.setItem("intended", JSON.stringify(res.data.intended));
that.intended = JSON.parse(localStorage.getItem("intended"));
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 获取appid
getappid() {
... ... @@ -153,8 +159,8 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
console.log(res, 'hahahahaiaioaioaio4');
.then(function(res) {
console.log(res, "hahahahaiaioaioaio4");
wx.config({
debug: false,
appId: res.data.jssdk.appId, // 和获取Ticke的必须一样------必填,公众号的唯一标识
... ... @@ -165,37 +171,38 @@ export default {
jsApiList: [
"showOptionMenu",
"updateAppMessageShareData",
"updateTimelineShareData",
"updateTimelineShareData"
]
});
wx.ready(function () {
wx.ready(function() {
wx.showOptionMenu();
});
that.sharetofriend();
})
that.sharetofriend()
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 分享给朋友
sharetofriend() {
var that = this;
localStorage.setItem("type", '')
localStorage.setItem("type", "");
// 处理验证失败的信息
wx.error(function (res) {
wx.error(function(res) {
logUtil.printLog("验证失败返回的信息:", res);
});
// 处理验证成功的信息
wx.ready(function () {
wx.ready(function() {
// 分享到朋友圈
wx.updateTimelineShareData({
title: '分享', // 分享标题
link: that.baseurl +
title: "唐元集邀请函", // 分享标题
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
imgUrl:
"http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png",
// imgUrl: that.details.details.img
// ? that.details.details.img
... ... @@ -203,13 +210,13 @@ export default {
// 分享图标
// desc: that.sharemsg.content,
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
console.log("suss");
logUtil.printLog("分享到朋友圈成功返回的信息为:", res);
that.showMsg("分享成功!");
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
console.log("err");
logUtil.printLog("取消分享到朋友圈返回的信息为:", res);
... ... @@ -217,13 +224,14 @@ export default {
}),
// 分享给朋友
wx.updateAppMessageShareData({
title: '分享', // 分享标题
desc: '分享', // 分享描述
title: "唐元集邀请函", // 分享标题
desc: "", // 分享描述
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
imgUrl:
"http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png",
// imgUrl: that.details.details.img
// ? that.details.details.img
... ... @@ -231,11 +239,11 @@ export default {
// 分享图标
type: "", // 分享类型,music、video或link,不填默认为link
dataUrl: "", // 如果type是music或video,则要提供数据链接,默认为空
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
logUtil.printLog("分享给朋友成功返回的信息为:", res);
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
logUtil.printLog("取消分享给朋友返回的信息为:", res);
}
... ... @@ -243,22 +251,18 @@ export default {
});
},
hideshare() {
this.showshare = false
this.showshare = false;
},
// 立即分享
sueshare() {
this.showshare = false;
this.shareshow = true
this.shareshow = true;
},
back() {
this.$router.go(-1)
this.$router.go(-1);
},
getresult() {
let that = this;
var url = "/api/user/assistance_result";
let param = {
... ... @@ -267,18 +271,15 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
that.result = res.data.result;
console.log(that.result);
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 下一页
next() {
console.log(44);
... ... @@ -296,18 +297,15 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.company = res.data.company;
that.product = res.data.product;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
}
}
};
</script>
... ...
... ... @@ -154,14 +154,14 @@
>复制</span
>
</div>
<div class="flexone dianitem" @click="save(item)">
<!-- <div class="flexone dianitem" @click="save(item)">
<img
src="../../../assets/download.png"
alt
class="dianzanimg"
/>
<span class="number">一键保存</span>
</div>
</div> -->
<div class="flexone dianitem" @click="del(item)">
<img src="../../../assets/delim.png" alt class="dianzanimg" />
... ... @@ -251,7 +251,7 @@
import Vue from "vue";
import { List, Toast, ImagePreview } from "vant";
import { Dialog } from 'vant';
import { Dialog } from "vant";
Vue.use(ImagePreview);
... ... @@ -263,37 +263,35 @@ export default {
loading: false,
finished: false,
page: 1,
total_page: '',
this_page: '',
total_page: "",
this_page: "",
images: [],
index: 0,
startPosition: 0,
show: false,
nophoto: false,
showcomment: false,
socialId: '',
socialId: "",
comment_id: "",
textcomment: '',
textcomment: "",
shortcomment: [],
allcomment: [],
showcommentlist: [],
defaultlen: false,
dateinit: '请输入',
fasong: ''
}
dateinit: "请输入",
fasong: ""
};
},
created() {
this.gettiezilist()
this.gettiezilist();
},
methods: {
// 显示消息弹出层
messageshow(index, item) {
console.log(item)
console.log(item);
this.showcomment = true;
this.socialId = item.id
this.getcommentlist()
this.socialId = item.id;
this.getcommentlist();
},
// 获取消息列表
getcommentlist() {
... ... @@ -305,48 +303,44 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.allcomment = res.data.social;
console.log('434', that.allcomment)
console.log("434", that.allcomment);
that.shortcomment = res.data.social.slice(0, 5);
if (that.fasong == 1) {
if (that.defaultlen == true) {
that.defaultlen = true;
that.showcommentlist = that.shortcomment
that.showcommentlist = that.shortcomment;
} else {
that.defaultlen = false;
that.showcommentlist = that.allcomment
that.showcommentlist = that.allcomment;
}
} else {
if (res.data.social.length > 5) {
that.defaultlen = true
that.defaultlen = true;
}
that.showcommentlist = that.shortcomment
that.showcommentlist = that.shortcomment;
}
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
replay(item, index) {
console.log(item)
console.log(item);
this.dateinit = item.user_info.nickname;
this.comment_id = item.id
this.comment_id = item.id;
},
hidecomment() {
this.showcomment = false
this.showcomment = false;
},
sendtext() {
let that = this;
if (this.textcomment == '') {
Toast("请输入评论内容")
return false
if (this.textcomment == "") {
Toast("请输入评论内容");
return false;
}
var url = "/api/social/comment_send";
let param = {
... ... @@ -357,54 +351,48 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
Toast("发送成功")
that.list.forEach(function (value, index, arrray) {
Toast("发送成功");
that.list.forEach(function(value, index, arrray) {
if (value.id == that.socialId) {
value.comment_count = value.comment_count + 1
value.comment_count = value.comment_count + 1;
}
})
});
that.list = that.list;
// that.showcomment = false;
that.fasong = 1;
that.textcomment = '';
that.textcomment = "";
that.getcommentlist();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
Toast(err.msg)
Toast(err.msg);
});
},
seemorecomment() {
this.showcommentlist = this.allcomment;
this.defaultlen = false
this.defaultlen = false;
},
// 查看更多
seemore(item, index) {
console.log(9999)
console.log(9999);
let that = this;
that.list.forEach(function (value, index, array) {
console.log(value)
that.list.forEach(function(value, index, array) {
console.log(value);
if (value.id == item.id) {
if (value.more == true) {
value.show = !value.show
value.show = !value.show;
}
}
})
});
that.list = that.list;
that.$forceUpdate()
that.$forceUpdate();
},
back() {
this.$router.go(-1)
this.$router.go(-1);
},
onCopy(e) {
Toast("文案复制成功");
... ... @@ -420,9 +408,9 @@ export default {
this.images = item.images_arr;
if (this.images.length == 0) {
this.nophoto = true;
setTimeout(function () {
that.nophoto = false
}, 1500)
setTimeout(function() {
that.nophoto = false;
}, 1500);
} else {
this.index = 0;
this.show = true;
... ... @@ -436,11 +424,10 @@ export default {
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
let newpage = that.page;
newpage++;
that.page = newpage;
console.log(9999)
console.log(9999);
that.gettiezilist();
// 加载状态结束
that.loading = false;
... ... @@ -453,22 +440,21 @@ export default {
// 播放视频
entervideo(url) {
console.log(344803)
console.log(url)
console.log(344803);
console.log(url);
this.$router.push({
path: '/videoplay',
path: "/videoplay",
query: { url: url }
})
});
},
del(item) {
this.social_id = item.id;
Dialog.confirm({
title: '是否删除帖子',
title: "是否删除帖子"
})
.then((res) => {
console.log(3489348)
let that = this
.then(res => {
console.log(3489348);
let that = this;
var url = "/api/user/social_del";
let param = {
social_id: that.social_id
... ... @@ -476,22 +462,19 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
Toast("删除成功")
Toast("删除成功");
that.page = 1;
that.list = [];
that.gettiezilist()
that.gettiezilist();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
// on confirm
})
.catch((res) => {
.catch(res => {
// on cancel
});
},
... ... @@ -505,49 +488,45 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.list = that.list.concat(res.data.social)
that.list.forEach(function (value, index, array) {
value.show = true
that.list = that.list.concat(res.data.social);
that.list.forEach(function(value, index, array) {
value.show = true;
if (value.description.length > 66) {
value.more = true
value.more = true;
} else {
value.more = false
value.more = false;
}
})
});
that.list = that.list;
that.this_page = res.data.this_page;
that.total_page = res.data.total_page
console.log(that.list)
that.total_page = res.data.total_page;
console.log(that.list);
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 查看更多
seemore(item, index) {
console.log(9999)
console.log(9999);
let that = this;
that.list.forEach(function (value, index, array) {
console.log(value)
that.list.forEach(function(value, index, array) {
console.log(value);
if (value.id == item.id) {
if (value.more == true) {
value.show = !value.show
value.show = !value.show;
}
}
})
});
that.list = that.list;
that.$forceUpdate()
that.$forceUpdate();
},
previewimg(index, indexk) {
console.log(index, indexk);
this.index = indexk;
... ... @@ -568,7 +547,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
if (item.is_favorite == 0) {
item.is_favorite = 1;
... ... @@ -586,7 +565,7 @@ export default {
that.list = that.list;
that.$forceUpdate();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -594,7 +573,7 @@ export default {
zanclick(index, item) {
let that = this;
console.log(item.id);
console.log(item.deletetime)
console.log(item.deletetime);
var url = "/api/user/good";
let param = {
... ... @@ -604,34 +583,30 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
if (item.is_good == 0) {
item.is_good = 1;
that.list[index].is_good = 1;
that.list[index].good_count =
that.list[index].good_count + 1;
that.list[index].good_count = that.list[index].good_count + 1;
Toast("点赞成功");
} else if (item.is_good == 1) {
item.is_good = 1;
Toast("取消点赞成功");
that.list[index].is_good = 0;
that.list[index].good_count =
that.list[index].good_count - 1;
that.list[index].good_count = that.list[index].good_count - 1;
}
that.list = that.list;
that.$forceUpdate();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
}
}
}
};
</script>
<style scoped>
@import "../../../style/usercenter.css";
.dianitem {
... ...
... ... @@ -67,7 +67,7 @@
<img src="../../../assets/sucai.png" alt />
</div>
<span class="kaiketext">素材</span>
<span class="kaiketext">素材中心</span>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
... ... @@ -180,16 +180,15 @@ export default {
this.$router.push({
path: "/userzhibo",
query: {
id: id,
name: lesson.title
id: id
}
});
localStorage.setItem("coursename", lesson.title);
} else if (this.lesson.type == 2) {
this.$router.push({
path: "/userlubo",
query: {
id: id,
name: lesson.title
id: id
}
});
}
... ...
... ... @@ -13,7 +13,7 @@
</div>
</div>
<div class="nodata" v-if="recordlist.length==0">暂无聊天记录</div>
<div class="nodata" v-if="recordlist.length == 0">暂无聊天记录</div>
<van-pull-refresh
v-model="isLoading"
@refresh="onRefresh"
... ... @@ -35,18 +35,18 @@
</div>-->
<div>
<div v-for="(item,index) in recordlist" :key="index">
<div class="messageitem flex" v-if="item.user_id!=user_id">
<div v-for="(item, index) in recordlist" :key="index">
<div class="messageitem flex" v-if="item.user_id != user_id">
<div class="messageitemleft">
<img :src="item.avatar" alt />
</div>
<div class="messageitemright" v-if="item.type==1">
<div class="messagecontent">{{item.data}}</div>
<div class="messageitemright" v-if="item.type == 1">
<div class="messagecontent">{{ item.data }}</div>
</div>
<div
class="messageitemright imgright"
v-if="item.type==2"
v-if="item.type == 2"
@click="previewimg(item.data)"
>
<div class="messagecontent">
... ... @@ -56,38 +56,47 @@
</div>
</div>
<div class="messageitemright" v-if="item.type==3">
<div class="messageitemright" v-if="item.type == 3">
<div
class="messagecontent"
:style="{width:1.7+'rem'}"
v-if="item.times>0&&item.times<5"
@click="audioplay(item,index)"
:style="{ width: 1.7 + 'rem' }"
v-if="item.times > 0 && item.times < 5"
@click="audioplay(item, index)"
>
<div class="voice">
<div class="bg" :class="item.sel==true?'voicePlay':''"></div>
<div class="miaoshuk">{{item.times}}'</div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshuk">{{ item.times }}'</div>
</div>
</div>
<div
class="messagecontent"
:style="{width:2+'rem'}"
v-if="item.times>=5&&item.times<15"
@click="audioplay(item,index)"
:style="{ width: 2 + 'rem' }"
v-if="item.times >= 5 && item.times < 15"
@click="audioplay(item, index)"
>
<div class="voice">
<div class="bg" :class="item.sel==true?'voicePlay':''"></div>
<div class="miaoshuk">{{item.times}}'</div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshuk">{{ item.times }}'</div>
</div>
</div>
<div
class="messagecontent"
:style="{width:4.5+'rem'}"
v-if="item.times>=15"
@click="audioplay(item,index)"
:style="{ width: 4.5 + 'rem' }"
v-if="item.times >= 15"
@click="audioplay(item, index)"
>
<div class="voice">
<div class="bg" :class="item.sel==true?'voicePlay':''"></div>
<div class="miaoshuk">{{item.times}}'</div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshuk">{{ item.times }}'</div>
</div>
</div>
</div>
... ... @@ -95,17 +104,21 @@
<div
class="messageitem messageitemk flex"
v-if="item.user_id==user_id"
v-if="item.user_id == user_id"
:id="item.idkk"
@touchstart="gotouchstart(item)"
@touchmove="gotouchmove"
@touchend="gotouchend(item)"
>
<div class="messageitemrightk" v-if="item.type==1">
<div class="messagecontentk">{{item.data}}</div>
<div class="messageitemrightk" v-if="item.type == 1">
<div class="messagecontentk">{{ item.data }}</div>
</div>
<div class="messageitemrightk" v-if="item.type==2" @click="previewimg(item.data)">
<div
class="messageitemrightk"
v-if="item.type == 2"
@click="previewimg(item.data)"
>
<div class="messagecontentk">
<div class="contentimg">
<img :src="item.data" alt />
... ... @@ -114,38 +127,47 @@
</div>
<!-- v-clipboard:copy="that.serverId"
v-clipboard:success="onCopy"-->
<div class="messageitemrightk" v-if="item.type==3">
<div class="messageitemrightk" v-if="item.type == 3">
<div
class="messagecontentk yuyink"
:style="{width:1+'rem'}"
v-if="item.times>0&&item.times<5"
@click="audioplay(item,index)"
:style="{ width: 1 + 'rem' }"
v-if="item.times > 0 && item.times < 5"
@click="audioplay(item, index)"
>
<div class="voice voiceright">
<div class="bg" :class="item.sel==true?'voicePlay':''"></div>
<div class="miaoshu">{{item.times}}'</div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshu">{{ item.times }}'</div>
</div>
</div>
<div
class="messagecontentk yuyink"
:style="{width:2+'rem'}"
v-if="item.times>=5&&item.times<15"
@click="audioplay(item,index)"
:style="{ width: 2 + 'rem' }"
v-if="item.times >= 5 && item.times < 15"
@click="audioplay(item, index)"
>
<div class="voice voiceright">
<div class="bg" :class="item.sel==true?'voicePlay':''"></div>
<div class="miaoshu">{{item.times}}'</div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshu">{{ item.times }}'</div>
</div>
</div>
<div
class="messagecontentk yuyink"
:style="{width:4.5+'rem'}"
v-if="item.times>=15"
@click="audioplay(item,index)"
:style="{ width: 4.5 + 'rem' }"
v-if="item.times >= 15"
@click="audioplay(item, index)"
>
<div class="voice voiceright">
<div class="bg" :class="item.sel==true?'voicePlay':''"></div>
<div class="miaoshu">{{item.times}}'</div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshu">{{ item.times }}'</div>
</div>
</div>
</div>
... ... @@ -175,19 +197,49 @@
<img src="../../../assets/yuyin.png" alt />
</div>
<div class="writermessage">
<input type="text" placeholder="写留言" @input="entertext" :value="text" />
<input
type="text"
placeholder="写留言"
@input="entertext"
:value="text"
/>
</div>
<div class="sendk" @click="send">发送</div>
</div>
<div class="messagebot messagebotk flextwo" v-else>
<img src="../../../assets/yuyin.png" alt class="zhibobtn" @click="changeword" />
<img src="../../../assets/pic.png" alt class="zhibobtn" @click="choseimg" />
<img src="../../../assets/luyin.png" alt class="yuyinbtn" @click="yuyin" />
<img
src="../../../assets/yuyin.png"
alt
class="zhibobtn"
@click="changeword"
/>
<img
src="../../../assets/pic.png"
alt
class="zhibobtn"
@click="choseimg"
/>
<img
src="../../../assets/luyin.png"
alt
class="yuyinbtn"
@click="yuyin"
/>
<div class style="position:relative">
<input type="file" accept="audio/*" @change="afterRead" class="upuinpin" />
<input
type="file"
accept="audio/*"
@change="afterRead"
class="upuinpin"
/>
<img src="../../../assets/shangchuan.png" alt class="zhibobtn" />
</div>
<img src="../../../assets/kaiguan.png" alt class="zhibobtn" @click="stopbtn" />
<img
src="../../../assets/kaiguan.png"
alt
class="zhibobtn"
@click="stopbtn"
/>
</div>
</div>
<!-- <div class="manypeople">
... ... @@ -293,7 +345,7 @@ import Vue from "vue";
import { PullRefresh, Toast, Dialog, Loading } from "vant";
Vue.use(PullRefresh);
Vue.use(Toast);
Vue.use(Loading)
Vue.use(Loading);
var timer = null;
export default {
data() {
... ... @@ -320,35 +372,34 @@ export default {
group_count: "",
// 直播列表
page: 1,
this_page: '',
total_page: '',
this_page: "",
total_page: "",
isLoading: false,
recordlist: [],
baseurl: "",
height: '',
hei: '600px',
target: '',
yuyintype: '',
stopurl: '',
height: "",
hei: "600px",
target: "",
yuyintype: "",
stopurl: "",
stopindex: 0,
playlocalid: '',
playlocalid: "",
cardzheng: false,
coursename: ''
coursename: ""
};
},
created() {
// 获取个人中心
this.getuserinfo()
this.getuserinfo();
// alert(location.host)
this.baseurl = 'http://' + location.host
this.baseurl = "http://" + location.host;
let div = this.$refs["message-list"];
// alert(1111)
// alert(this.baseurl+
// "/redirect.html?shareRedirect=" +
// encodeURIComponent(window.location.href))
this.coursename = this.$route.query.name
this.coursename = this.$route.query.name;
document.title = "唐元集公众号";
this.id = this.$route.query.id;
// 获取appid
... ... @@ -356,21 +407,15 @@ export default {
this.getlubodetail();
this.initWebSocket();
// 获取直播列表
this.getzhibolist()
this.getzhibolist();
},
mounted() {
let that = this;
let that = this
console.log(that.target, '99997878666')
console.log(that.target, "99997878666");
},
watch: {
},
watch: {},
beforeRouteEnter(to, from, next) {
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
... ... @@ -385,24 +430,21 @@ export default {
methods: {
// 上传音频
afterRead(e) {
console.log(e)
console.log(e);
let file = e.target.files[0];
let that = this;
that.cardzheng = true
that.cardzheng = true;
var formdata = new FormData();
formdata.append("file", file);
var url = "/api/common/upload";
that.$uploadFile
.post(url, formdata)
.then(function (res) {
that.cardzheng = false
console.log(res)
.then(function(res) {
that.cardzheng = false;
console.log(res);
let objdata = {
lesson_id: that.id,
type: 3,
... ... @@ -413,14 +455,11 @@ export default {
objdata = JSON.stringify(objdata);
that.websocketsend(objdata);
})
.catch(err => {
console.log(err);
Toast(err.msg)
Toast(err.msg);
});
},
//获取个人中心
... ... @@ -428,34 +467,27 @@ export default {
let that = this;
var url = "/api/user/index";
let param = {
};
let param = {};
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.user_id = res.data.id
that.user_id = res.data.id;
})
.catch(function (err) {
});
.catch(function(err) {});
},
// 列表自动滚到到底部
toBottom() {
// let listContainer = document.getElementById('messagebox')
let div = this.$refs["message-list"];
console.log(div.scrollHeight, 8887766543)
console.log(div.style.height, 9999)
console.log(div.scrollHeight, 8887766543);
console.log(div.style.height, 9999);
this.height = div.clientHeight
this.height = div.clientHeight;
div.scrollTop = div.scrollHeight
div.scrollTop = div.scrollHeight;
// let height = div.offsetHeight
// console.log(height, 9999888888)
// const listContainer = this.$refs["message-list"];
... ... @@ -497,7 +529,6 @@ export default {
console.log(that.page);
that.getzhibolist();
}
}, 1000);
},
... ... @@ -505,6 +536,7 @@ export default {
getappid() {
let that = this;
console.log(34734894890);
// let urlk = window.location.href;
let urlk = window.location.href;
var url = "/api/user/wechat_jssdk";
let param = {
... ... @@ -513,7 +545,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
wx.config({
debug: false,
... ... @@ -538,25 +570,22 @@ export default {
]
});
that.sharetofriend()
that.sharetofriend();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 分享给朋友
sharetofriend() {
var that = this;
// 处理验证失败的信息
wx.error(function (res) {
wx.error(function(res) {
logUtil.printLog("验证失败返回的信息:", res);
});
// 处理验证成功的信息
wx.ready(function () {
wx.ready(function() {
// alert(window.location.href.split('#')[0]);
// var share_title = that.sharemsg.title;
// if (share_title.indexOf("${title}") >= 0) {
... ... @@ -577,11 +606,13 @@ export default {
// }
// 分享到朋友圈
wx.updateTimelineShareData({
title: '分享', // 分享标题
link: that.baseurl +
title: "分享", // 分享标题
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
imgUrl:
"http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png",
// imgUrl: that.details.details.img
// ? that.details.details.img
... ... @@ -589,13 +620,13 @@ export default {
// 分享图标
// desc: that.sharemsg.content,
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
console.log("suss");
logUtil.printLog("分享到朋友圈成功返回的信息为:", res);
that.showMsg("分享成功!");
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
console.log("err");
logUtil.printLog("取消分享到朋友圈返回的信息为:", res);
... ... @@ -603,13 +634,14 @@ export default {
}),
// 分享给朋友
wx.updateAppMessageShareData({
title: '分享', // 分享标题
desc: '分享', // 分享描述
title: "分享", // 分享标题
desc: "分享", // 分享描述
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
imgUrl:
"http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png",
// imgUrl: that.details.details.img
// ? that.details.details.img
... ... @@ -617,11 +649,11 @@ export default {
// 分享图标
type: "", // 分享类型,music、video或link,不填默认为link
dataUrl: "", // 如果type是music或video,则要提供数据链接,默认为空
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
logUtil.printLog("分享给朋友成功返回的信息为:", res);
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
logUtil.printLog("取消分享给朋友返回的信息为:", res);
}
... ... @@ -631,21 +663,21 @@ export default {
// 上传图片
choseimg() {
let that = this
let that = this;
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
success: function(res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
wx.uploadImage({
localId: localIds[0], // 需要上传的图片的本地ID,由chooseImage接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
var serverId = res.serverId; // 返回图片的服务器端ID
that.serverId = res.serverId;
that.upload()
that.upload();
}
});
}
... ... @@ -654,8 +686,8 @@ export default {
upload() {
let that = this;
console.log(34734894890)
alert(that.serverId)
console.log(34734894890);
alert(that.serverId);
var url = "/api/user/upload_media";
let param = {
type: 1,
... ... @@ -664,7 +696,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.videourl = res.data.media;
let objdata = {
... ... @@ -678,25 +710,24 @@ export default {
// alert(objdata);
that.websocketsend(objdata);
// alert(that.videourl)
})
.catch(function (err) {
alert(err)
.catch(function(err) {
alert(err);
console.log(err);
});
},
// 预览图片
previewimg(url) {
let arr = [];
arr.push(url)
arr.push(url);
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: arr// 需要预览的图片http链接列表
urls: arr // 需要预览的图片http链接列表
});
},
// 隐藏遮罩层
hide() {
let that = this
let that = this;
this.beginlushow = false;
this.zhengzailu = false;
this.luprocess = false;
... ... @@ -732,7 +763,7 @@ export default {
// 开始录制
yuyin() {
this.beginlushow = true;
this.yuyintype = 1
this.yuyintype = 1;
},
// 开始录制
// 开始录音
... ... @@ -748,7 +779,7 @@ export default {
console.log(that.time);
}, 1000);
wx.startRecord({
success: function (res) {
success: function(res) {
// alert(JSON.stringify(res))
consoel.log(res, 99977775655);
// alert('成功调起录音')
... ... @@ -758,7 +789,7 @@ export default {
// }, 1000)
// that.vicoeEnd()
},
cancel: function () {
cancel: function() {
// alert("用户拒绝授权录音");
}
});
... ... @@ -773,7 +804,7 @@ export default {
clearInterval(timer);
wx.stopRecord({
success: function (res) {
success: function(res) {
var localId = res.localId;
that.localId = res.localId;
that.upyuyin();
... ... @@ -788,7 +819,7 @@ export default {
},
// 结束本次上传
hideshangchuan() {
this.shanghcuanshow = false
this.shanghcuanshow = false;
},
// 发送语音
sendyuyin() {
... ... @@ -796,8 +827,7 @@ export default {
let that = this;
this.shanghcuanshow = false
this.shanghcuanshow = false;
that.luprocess = false;
// this.issuccess = true
let objdata = {
... ... @@ -817,10 +847,9 @@ export default {
shangyuyin() {
let that = this;
this.shanghcuanshow = false
this.shanghcuanshow = false;
that.luprocess = false;
this.issuccess = true
this.issuccess = true;
let objdata = {
lesson_id: this.id,
type: 3,
... ... @@ -838,7 +867,7 @@ export default {
wx.uploadVoice({
localId: that.localId, // 需要上传的音频的本地ID,由stopRecord接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
var serverId = res.serverId; // 返回音频的服务器端ID
that.serverId = res.serverId;
// alert(that.serverId);
... ... @@ -856,27 +885,25 @@ export default {
},
// 停止直播
stopbtn() {
this.overzhibo = true
this.overzhibo = true;
},
canclesure() {
this.overzhibo = false
this.overzhibo = false;
},
surezhibo() {
let that = this;
that.overzhibo = false
that.overzhibo = false;
let objdata = {
lesson_id: this.id,
type: 3,
user_id: this.user_id,
times: that.time,
data: '', is_end: 1
data: "",
is_end: 1
};
objdata = JSON.stringify(objdata);
// alert(objdata);
this.websocketsend(objdata);
},
// 获取录播详情
... ... @@ -890,12 +917,11 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.is_self = res.data.lesson.is_self;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -919,12 +945,16 @@ export default {
this.initWebSocket();
},
websocketonmessage(e) {
//数据接收
let that = this;
if (this.number == 0) {
let obj = { lesson_id: this.id, user_id: this.user_id, is_group: 1, first: 1 };
let obj = {
lesson_id: this.id,
user_id: this.user_id,
is_group: 1,
first: 1
};
obj = JSON.stringify(obj);
console.log(obj);
this.websocketsend(obj);
... ... @@ -933,14 +963,14 @@ export default {
}
this.number = this.number + 1;
this.number = this.number;
let datak = e.data
let datak = e.data;
console.log(e, 88890999);
console.log(e.data)
console.log(e.data);
// alert(e.data)
// alert(e.data.first)
let data = JSON.parse(e.data);
// alert(data)
console.log(data)
console.log(data);
that.group_count = data.group_count;
// 接收数据重新渲染列表
if (data.lesson_id != undefined) {
... ... @@ -948,34 +978,29 @@ export default {
that.group_count = redata.group_count;
if (redata.code == 9) {
that.recordlist.forEach(function (value, index, array) {
that.recordlist.forEach(function(value, index, array) {
if (value.id == redata.id) {
that.recordlist.splice(index, 1)
that.recordlist.splice(index, 1);
that.recordlist = that.recordlist;
that.$forceUpdate()
that.$forceUpdate();
}
})
});
} else if (redata.code == 0) {
Toast(redata.msg)
Toast(redata.msg);
} else if (redata.code == 1) {
that.recordlist.push(redata);
that.recordlist = that.recordlist;
that.$forceUpdate();
that.$nextTick(() => {
var div = document.getElementById('messagebox');
var div = document.getElementById("messagebox");
var div = document.getElementsByClassName("messageitem");
let len = div.length;
len = len - 1;
div[len].scrollIntoView()
})
div[len].scrollIntoView();
});
} else if (redata.code == 2) {
that.$router.go(-1)
that.$router.go(-1);
}
}
},
websocketsend(Data) {
... ... @@ -990,7 +1015,7 @@ export default {
// 获取直播列表
getzhibolist() {
let that = this;
console.log(34734894890)
console.log(34734894890);
var url = "/api/user/lesson_chat_record";
let param = {
lesson_id: that.id,
... ... @@ -999,86 +1024,79 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
console.log(res, '直播列表');
.then(function(res) {
console.log(res, "直播列表");
if (that.page == 1) {
// 页面滚动到某一个位置
let len = res.data.record.length;
len = len - 1
res.data.record.forEach(function (value, index, array) {
len = len - 1;
res.data.record.forEach(function(value, index, array) {
if (index == len) {
value.idkk = 'targetboxk'
value.idkk = "targetboxk";
that.$nextTick(() => {
setTimeout(() => {
let targetbox = document.getElementById('targetboxk');
let targetbox = document.getElementById("targetboxk");
that.target = targetbox.offsetTop;
document.body.scrollTop = that.target;
// document.getElementById('targetbox').scrollTop = that.target
document.getElementById("targetboxk").scrollIntoView();
})
})
});
});
}
})
});
}
// 拼接数组倒叙
var arr = [...res.data.record, ...that.recordlist];
that.recordlist = arr
that.recordlist.forEach(function (value, index, array) {
value.sel = false
})
that.recordlist = that.recordlist
that.this_page = res.data.this_page
that.recordlist = arr;
that.recordlist.forEach(function(value, index, array) {
value.sel = false;
});
that.recordlist = that.recordlist;
that.this_page = res.data.this_page;
that.total_page = res.data.total_page;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
audioplay(item, index) {
let that = this;
console.log(item)
console.log(item);
// 播放某一个语音
// that.recordlist[index].sel = !that.recordlist[index].sel;
that.recordlist.forEach(function (value, indexk, array) {
that.recordlist.forEach(function(value, indexk, array) {
if (index == indexk) {
that.recordlist[indexk].sel = !that.recordlist[indexk].sel;
} else {
that.recordlist[indexk].sel = false
that.recordlist[indexk].sel = false;
}
})
});
that.recordlist = that.recordlist;
that.$forceUpdate();
console.log(that.recordlist)
console.log(that.recordlist);
if (this.recordlist[index].sel == true) {
// 开始播放
let localId = ''
let localId = "";
wx.downloadVoice({
serverId: item.data, // 需要下载的音频的服务器端ID,由uploadVoice接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
localId = res.localId; // 返回音频的本地ID
that.playlocalid = localId;
that.recordlist[index].localId = localId;
that.recordlist = that.recordlist;
that.$forceUpdate()
that.$forceUpdate();
wx.playVoice({
localId: localId // 需要播放的音频的本地ID,由stopRecord接口获得
})
});
}
});
// if (this.recordlist[index].data != that.stopurl) {
... ... @@ -1087,20 +1105,15 @@ export default {
// isShowProgressTips: 1, // 默认为1,显示进度提示
// success: function (res) {
// wx.stopVoice({
// localId: res.localId // 需要停止的音频的本地ID,由stopRecord接口获得
// });
// }
// });
// }
} else if (this.recordlist[index].sel == false) {
// 停止播放
wx.stopVoice({
... ... @@ -1109,16 +1122,15 @@ export default {
}
// 监听播放停止播放下一个
wx.onVoicePlayEnd({
success: function (res) {
success: function(res) {
var localId = res.localId; // 返回音频的本地ID
that.recordlist.forEach(function (value, index, array) {
that.recordlist.forEach(function(value, index, array) {
if (localId == value.localId) {
value.sel = false
value.sel = false;
}
})
that.recordlist = that.recordlist
});
that.recordlist = that.recordlist;
that.$forceUpdate();
... ... @@ -1126,31 +1138,27 @@ export default {
if (that.recordlist[index].data != undefined) {
if (that.recordlist[index].type == 3) {
that.recordlist[index].sel = true
that.recordlist[index].sel = true;
wx.downloadVoice({
serverId: that.recordlist[index].data, // 需要下载的音频的服务器端ID,由uploadVoice接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
let localId = res.localId; // 返回音频的本地ID
that.recordlist[index].localId = localId;
that.recordlist[index].sel = true;
that.recordlist = that.recordlist;
that.$forceUpdate()
that.$forceUpdate();
wx.playVoice({
localId: localId // 需要暂停的音频的本地ID,由stopRecord接口获得
});
}
});
}
}
that.recordlist = that.recordlist;
that.$forceUpdate()
that.$forceUpdate();
}
});
},
// 发送文字
send() {
... ... @@ -1162,24 +1170,23 @@ export default {
times: 0,
data: this.text
};
console.log(objdata)
console.log(objdata);
objdata = JSON.stringify(objdata);
// alert(objdata)
this.websocketsend(objdata);
this.text = ''
this.text = "";
// ws.send(objdata);
},
gotouchstart(item) {
let that = this;
clearTimeout(timeOutEvent);//清除定时器
clearTimeout(timeOutEvent); //清除定时器
timeOutEvent = 0;
timeOutEvent = setTimeout(function () {
timeOutEvent = setTimeout(function() {
Dialog.confirm({
title: '是否删除帖子',
title: "是否删除帖子"
})
.then((res) => {
console.log(item.id)
.then(res => {
console.log(item.id);
let objdata = {
id: item.id,
lesson_id: item.lesson_id,
... ... @@ -1189,40 +1196,36 @@ export default {
data: item.data,
is_del: 1
};
console.log(objdata)
console.log(objdata);
objdata = JSON.stringify(objdata);
// alert(objdata)
that.websocketsend(objdata);
that.recordlist.forEach(function (value, index, array) {
that.recordlist.forEach(function(value, index, array) {
if (value.id == item.id) {
that.recordlist.splice(index, 1)
that.recordlist.splice(index, 1);
that.recordlist = that.recordlist;
that.$forceUpdate()
that.$forceUpdate();
}
});
})
})
.catch((res) => {
.catch(res => {
// on cancel
});
//执行长按要执行的内容,
}, 600);//这里设置定时
}, 600); //这里设置定时
},
//手释放,如果在500毫秒内就释放,则取消长按事件,此时可以执行onclick应该执行的事件
gotouchend() {
clearTimeout(timeOutEvent);
if (timeOutEvent != 0) {
//这里写要执行的内容(尤如onclick事件)
}
},
//如果手指有移动,则取消所有事件,此时说明用户只是要移动而不是长按
gotouchmove() {
clearTimeout(timeOutEvent);//清除定时器
clearTimeout(timeOutEvent); //清除定时器
timeOutEvent = 0;
},
}
}
};
</script>
... ...
... ... @@ -52,7 +52,10 @@
@click="audioplay(item, index)"
>
<div class="voice">
<div class="bg" :class="item.sel == true ? 'voicePlay' : ''"></div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshuk">{{ item.times }}'</div>
</div>
</div>
... ... @@ -63,7 +66,10 @@
@click="audioplay(item, index)"
>
<div class="voice">
<div class="bg" :class="item.sel == true ? 'voicePlay' : ''"></div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshuk">{{ item.times }}'</div>
</div>
</div>
... ... @@ -74,7 +80,10 @@
@click="audioplay(item, index)"
>
<div class="voice">
<div class="bg" :class="item.sel == true ? 'voicePlay' : ''"></div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshuk">{{ item.times }}'</div>
</div>
</div>
... ... @@ -93,7 +102,11 @@
<div class="messagecontentk">{{ item.data }}</div>
</div>
<div class="messageitemrightk" v-if="item.type == 2" @click="previewimg(item.data)">
<div
class="messageitemrightk"
v-if="item.type == 2"
@click="previewimg(item.data)"
>
<div class="messagecontentk">
<div class="contentimg">
<img :src="item.data" alt />
... ... @@ -110,7 +123,10 @@
@click="audioplay(item, index)"
>
<div class="voice voiceright">
<div class="bg" :class="item.sel == true ? 'voicePlay' : ''"></div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshu">{{ item.times }}'</div>
</div>
</div>
... ... @@ -121,7 +137,10 @@
@click="audioplay(item, index)"
>
<div class="voice voiceright">
<div class="bg" :class="item.sel == true ? 'voicePlay' : ''"></div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshu">{{ item.times }}'</div>
</div>
</div>
... ... @@ -132,7 +151,10 @@
@click="audioplay(item, index)"
>
<div class="voice voiceright">
<div class="bg" :class="item.sel == true ? 'voicePlay' : ''"></div>
<div
class="bg"
:class="item.sel == true ? 'voicePlay' : ''"
></div>
<div class="miaoshu">{{ item.times }}'</div>
</div>
</div>
... ... @@ -148,12 +170,20 @@
<!-- 底部导航 -->
<div class="messagebot messagebotkk flexone" v-if="is_self == 0 && isbot == true">
<div
class="messagebot messagebotkk flexone"
v-if="is_self == 0 && isbot == true"
>
<div class="messagebotleft">
<img src="../../../assets/yuyin.png" alt />
</div>
<div class="writermessage">
<input type="text" placeholder="写留言" @input="entertext" :value="text" />
<input
type="text"
placeholder="写留言"
@input="entertext"
:value="text"
/>
</div>
<div class="sendk" @click="send">发送</div>
</div>
... ... @@ -163,20 +193,50 @@
<img src="../../../assets/yuyin.png" alt />
</div>
<div class="writermessage">
<input type="text" placeholder="写留言" @input="entertext" :value="text" />
<input
type="text"
placeholder="写留言"
@input="entertext"
:value="text"
/>
</div>
<div class="sendk" @click="send">发送</div>
</div>
<div class="messagebot messagebotk flextwo" v-else>
<img src="../../../assets/yuyin.png" alt class="zhibobtn" @click="changeword" />
<img src="../../../assets/pic.png" alt class="zhibobtn" @click="choseimg" />
<img src="../../../assets/luyin.png" alt class="yuyinbtn" @click="yuyin" />
<img
src="../../../assets/yuyin.png"
alt
class="zhibobtn"
@click="changeword"
/>
<img
src="../../../assets/pic.png"
alt
class="zhibobtn"
@click="choseimg"
/>
<img
src="../../../assets/luyin.png"
alt
class="yuyinbtn"
@click="yuyin"
/>
<div class style="position:relative">
<input type="file" accept="audio/*" @change="afterRead" class="upuinpin" />
<input
type="file"
accept="audio/*"
@change="afterRead"
class="upuinpin"
/>
<img src="../../../assets/shangchuan.png" alt class="zhibobtn" />
</div>
<img src="../../../assets/kaiguan.png" alt class="zhibobtn" @click="stopbtn" />
<img
src="../../../assets/kaiguan.png"
alt
class="zhibobtn"
@click="stopbtn"
/>
</div>
</div>
<div class="manypeople">
... ... @@ -331,7 +391,7 @@ export default {
this.getuserinfo();
this.baseurl = "http://" + location.host;
let div = this.$refs["message-list"];
document.title = this.$route.query.name;
document.title = localStorage.getItem("coursename");
this.id = this.$route.query.id;
// 获取appid
this.getappid();
... ... @@ -372,7 +432,7 @@ export default {
that.$uploadFile
.post(url, formdata)
.then(function (res) {
.then(function(res) {
that.cardzheng = false;
console.log(res);
let objdata = {
... ... @@ -400,11 +460,11 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.user_id = res.data.id;
})
.catch(function (err) { });
.catch(function(err) {});
},
// 视频上拉加载
... ... @@ -456,7 +516,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res, "jssdkjsskd");
wx.config({
debug: false,
... ... @@ -483,22 +543,20 @@ export default {
that.sharetofriend();
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
// 分享给朋友
sharetofriend() {
var that = this;
// 处理验证失败的信息
wx.error(function (res) {
wx.error(function(res) {
logUtil.printLog("验证失败返回的信息:", res);
});
// 处理验证成功的信息
wx.ready(function () {
wx.ready(function() {
// alert(window.location.href.split('#')[0]);
// var share_title = that.sharemsg.title;
// if (share_title.indexOf("${title}") >= 0) {
... ... @@ -533,13 +591,13 @@ export default {
// 分享图标
// desc: that.sharemsg.content,
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
console.log("suss");
logUtil.printLog("分享到朋友圈成功返回的信息为:", res);
that.showMsg("分享成功!");
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
console.log("err");
logUtil.printLog("取消分享到朋友圈返回的信息为:", res);
... ... @@ -562,11 +620,11 @@ export default {
// 分享图标
type: "", // 分享类型,music、video或link,不填默认为link
dataUrl: "", // 如果type是music或video,则要提供数据链接,默认为空
success: function (res) {
success: function(res) {
// 用户确认分享后执行的回调函数
logUtil.printLog("分享给朋友成功返回的信息为:", res);
},
cancel: function (res) {
cancel: function(res) {
// 用户取消分享后执行的回调函数
logUtil.printLog("取消分享给朋友返回的信息为:", res);
}
... ... @@ -581,13 +639,13 @@ export default {
count: 1, // 默认9
sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
success: function(res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
wx.uploadImage({
localId: localIds[0], // 需要上传的图片的本地ID,由chooseImage接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
var serverId = res.serverId; // 返回图片的服务器端ID
that.serverId = res.serverId;
that.upload();
... ... @@ -609,7 +667,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.videourl = res.data.media;
let objdata = {
... ... @@ -624,7 +682,7 @@ export default {
that.websocketsend(objdata);
// alert(that.videourl)
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -692,7 +750,7 @@ export default {
console.log(that.time);
}, 1000);
wx.startRecord({
success: function (res) {
success: function(res) {
// alert(JSON.stringify(res))
consoel.log(res, 99977775655);
// alert('成功调起录音')
... ... @@ -702,7 +760,7 @@ export default {
// }, 1000)
// that.vicoeEnd()
},
cancel: function () {
cancel: function() {
// alert("用户拒绝授权录音");
}
});
... ... @@ -717,7 +775,7 @@ export default {
clearInterval(timer);
wx.stopRecord({
success: function (res) {
success: function(res) {
var localId = res.localId;
that.localId = res.localId;
that.upyuyin();
... ... @@ -776,7 +834,7 @@ export default {
wx.uploadVoice({
localId: that.localId, // 需要上传的音频的本地ID,由stopRecord接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
var serverId = res.serverId; // 返回音频的服务器端ID
that.serverId = res.serverId;
// alert(that.serverId);
... ... @@ -826,7 +884,7 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res);
that.is_self = res.data.lesson.is_self;
// that.user_id = res.data.lesson.user_id;
... ... @@ -848,7 +906,7 @@ export default {
}
}, 1000);
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -909,7 +967,7 @@ export default {
that.group_count = redata.group_count;
if (redata.code == 9) {
that.recordlist.forEach(function (value, index, array) {
that.recordlist.forEach(function(value, index, array) {
if (value.id == redata.id) {
that.recordlist.splice(index, 1);
that.recordlist = that.recordlist;
... ... @@ -936,8 +994,8 @@ export default {
}
},
websocketsend(Data) {
// alert(JSON.stringify(Data));
//数据发送
console.log(99999);
this.websock.send(Data);
},
websocketclose(e) {
... ... @@ -957,13 +1015,13 @@ export default {
that.$axios
.post(url, param)
.then(function (res) {
.then(function(res) {
console.log(res, "直播列表");
if (that.page == 1) {
// 页面滚动到某一个位置
let len = res.data.record.length;
len = len - 1;
res.data.record.forEach(function (value, index, array) {
res.data.record.forEach(function(value, index, array) {
if (index == len) {
value.idkk = "targetboxk";
that.$nextTick(() => {
... ... @@ -982,14 +1040,14 @@ export default {
// 拼接数组倒叙
var arr = [...res.data.record, ...that.recordlist];
that.recordlist = arr;
that.recordlist.forEach(function (value, index, array) {
that.recordlist.forEach(function(value, index, array) {
value.sel = false;
});
that.recordlist = that.recordlist;
that.this_page = res.data.this_page;
that.total_page = res.data.total_page;
})
.catch(function (err) {
.catch(function(err) {
console.log(err);
});
},
... ... @@ -1000,7 +1058,7 @@ export default {
// that.recordlist[index].sel = !that.recordlist[index].sel;
that.recordlist.forEach(function (value, indexk, array) {
that.recordlist.forEach(function(value, indexk, array) {
if (index == indexk) {
that.recordlist[indexk].sel = !that.recordlist[indexk].sel;
} else {
... ... @@ -1019,7 +1077,7 @@ export default {
wx.downloadVoice({
serverId: item.data, // 需要下载的音频的服务器端ID,由uploadVoice接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
localId = res.localId; // 返回音频的本地ID
that.playlocalid = localId;
that.recordlist[index].localId = localId;
... ... @@ -1055,10 +1113,10 @@ export default {
}
// 监听播放停止播放下一个
wx.onVoicePlayEnd({
success: function (res) {
success: function(res) {
var localId = res.localId; // 返回音频的本地ID
that.recordlist.forEach(function (value, index, array) {
that.recordlist.forEach(function(value, index, array) {
if (localId == value.localId) {
value.sel = false;
}
... ... @@ -1074,7 +1132,7 @@ export default {
wx.downloadVoice({
serverId: that.recordlist[i].data, // 需要下载的音频的服务器端ID,由uploadVoice接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
success: function(res) {
let localId = res.localId; // 返回音频的本地ID
that.recordlist[i].localId = localId;
that.recordlist[i].sel = true;
... ... @@ -1118,7 +1176,7 @@ export default {
let that = this;
clearTimeout(timeOutEvent); //清除定时器
timeOutEvent = 0;
timeOutEvent = setTimeout(function () {
timeOutEvent = setTimeout(function() {
Dialog.confirm({
title: "是否删除帖子"
})
... ...