|
@@ -1,22 +1,25 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view>
|
|
<view>
|
|
|
<view class="status_bar"></view>
|
|
<view class="status_bar"></view>
|
|
|
- <view style="position: relative;top: 40px;">
|
|
|
|
|
- <view style="position: fixed;z-index: 100;top: 40px;">
|
|
|
|
|
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="详情"></uni-nav-bar>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- <u-swiper :list="list" height="428" @click="examine(list)"></u-swiper> -->
|
|
|
|
|
|
|
+ <view style="position: fixed;top: 40px;background-color: #fff;z-index: 99;">
|
|
|
|
|
+ <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="详情"></uni-nav-bar>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view style="position: relative;top: 90px;">
|
|
|
<view class="partitlteimg">
|
|
<view class="partitlteimg">
|
|
|
- <image :src="list" mode="" class="img" @click="examine(list)"></image>
|
|
|
|
|
|
|
+ <!-- <image :src="list" mode="" class="" @click="examine(list)"></image> -->
|
|
|
|
|
+ <u-swiper :list="list" height='428' @click="examine(list)"></u-swiper>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="quiz">
|
|
<view class="quiz">
|
|
|
<view class="quiz_username">
|
|
<view class="quiz_username">
|
|
|
- <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/expertDiagnosis/6940a11a251770f1b0d8b7b10ebdf9b.png'" mode="" v-if="Number(quizdata.heat)==1"></image>
|
|
|
|
|
|
|
+ <image
|
|
|
|
|
+ :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/expertDiagnosis/6940a11a251770f1b0d8b7b10ebdf9b.png'"
|
|
|
|
|
+ mode="" v-if="Number(quizdata.heat)==1"></image>
|
|
|
<span>{{quizdata.title}}</span>
|
|
<span>{{quizdata.title}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="quiz_usertime">
|
|
<view class="quiz_usertime">
|
|
|
<view style="display: flex;align-items: center;">
|
|
<view style="display: flex;align-items: center;">
|
|
|
- <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/fourMoodBase/touxiang.png'" mode=""></image>
|
|
|
|
|
|
|
+ <image :src="quizdata.image?quizdata.image:'http://www.hnyfwlw.com:8006/bigdata_app/image/fourMoodBase/touxiang.png'"
|
|
|
|
|
+ mode=""></image>
|
|
|
<span>{{quizdata.username}}</span>
|
|
<span>{{quizdata.username}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view>
|
|
<view>
|
|
@@ -48,8 +51,8 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="issue_box" :style="{position: 'fixed',bottom: height+'px'}">
|
|
<view class="issue_box" :style="{position: 'fixed',bottom: height+'px'}">
|
|
|
<view class="issue">
|
|
<view class="issue">
|
|
|
- <input type="text" v-model="issuedata" @focus="focus" :auto-blur="true" :adjust-position='false' @blur="blur"
|
|
|
|
|
- @confirm="confirm" />
|
|
|
|
|
|
|
+ <input type="text" v-model="issuedata" @focus="focus" :auto-blur="true" :adjust-position='false'
|
|
|
|
|
+ @blur="blur" @confirm="confirm" />
|
|
|
<p @click="issue">发布</p>
|
|
<p @click="issue">发布</p>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -60,7 +63,7 @@
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- list: [{}],
|
|
|
|
|
|
|
+ list: [],
|
|
|
quizdata: {},
|
|
quizdata: {},
|
|
|
commentdata: [],
|
|
commentdata: [],
|
|
|
issuedata: '',
|
|
issuedata: '',
|
|
@@ -70,7 +73,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: { //
|
|
methods: { //
|
|
|
- async getParticulars(datas) {//获取评论列表
|
|
|
|
|
|
|
+ async getParticulars(datas) { //获取评论列表
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=pest.pests.pests_answers_list',
|
|
url: '/api/api_gateway?method=pest.pests.pests_answers_list',
|
|
|
data: {
|
|
data: {
|
|
@@ -82,7 +85,7 @@
|
|
|
this.commentdata = this.commentdata.concat(res.data)
|
|
this.commentdata = this.commentdata.concat(res.data)
|
|
|
console.log(res.data)
|
|
console.log(res.data)
|
|
|
},
|
|
},
|
|
|
- async getDiscuss(data) {//发布评论
|
|
|
|
|
|
|
+ async getDiscuss(data) { //发布评论
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=pest.pests.pests_new_idea',
|
|
url: '/api/api_gateway?method=pest.pests.pests_new_idea',
|
|
|
data: {
|
|
data: {
|
|
@@ -90,7 +93,7 @@
|
|
|
content: data.content,
|
|
content: data.content,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- if(res.code==200){
|
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
this.commentdata = []
|
|
this.commentdata = []
|
|
|
this.page = 1
|
|
this.page = 1
|
|
|
this.getParticulars(this.quizdata.lower)
|
|
this.getParticulars(this.quizdata.lower)
|
|
@@ -124,27 +127,65 @@
|
|
|
this.page++
|
|
this.page++
|
|
|
this.getParticulars(this.quizdata.lower)
|
|
this.getParticulars(this.quizdata.lower)
|
|
|
},
|
|
},
|
|
|
- examine(list){
|
|
|
|
|
|
|
+ examine(list) {
|
|
|
console.log(list)
|
|
console.log(list)
|
|
|
- var imgarr =[]
|
|
|
|
|
- // for(var i=0;i<list.length;i++){
|
|
|
|
|
- imgarr.unshift(list)
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ var imgarr = []
|
|
|
|
|
+ for(var i=0;i<list.length;i++){
|
|
|
|
|
+ imgarr.unshift(list[0].image)
|
|
|
|
|
+ }
|
|
|
console.log(imgarr)
|
|
console.log(imgarr)
|
|
|
uni.previewImage({
|
|
uni.previewImage({
|
|
|
urls: imgarr
|
|
urls: imgarr
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ async getInvitation(id) { //获取点击的帖子详细内容
|
|
|
|
|
+ const res = await this.$myRequest({
|
|
|
|
|
+ url: '/api/api_gateway?method=pest.pests.pests_answers_list',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ d_id: id,
|
|
|
|
|
+ page: this.page,
|
|
|
|
|
+ page_size: 10
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ this.quizdata = res.data[0]
|
|
|
|
|
+ console.log(this.quizdata)
|
|
|
|
|
+ var index2 = this.quizdata.content.indexOf('http')
|
|
|
|
|
+ this.recursion(index2)
|
|
|
|
|
+ if(!(index2+1)){
|
|
|
|
|
+ var obj = {
|
|
|
|
|
+ image: this.quizdata.img_urls
|
|
|
|
|
+ }
|
|
|
|
|
+ this.list.push(obj)
|
|
|
|
|
+ }
|
|
|
|
|
+ // if (this.quizdata.image == '' || this.quizdata.image == null) {
|
|
|
|
|
+ // this.list = 'http://www.hnyfwlw.com:8006/projectimg' + this.defaultimg
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.list = this.quizdata.image
|
|
|
|
|
+ // }
|
|
|
|
|
+ this.quizdata.content=this.quizdata.content.replace(/src/g,"none")
|
|
|
|
|
+ this.quizdata.content=this.quizdata.content.replace(/width/g,"none")
|
|
|
|
|
+ this.quizdata.content=this.quizdata.content.replace(/height/g,"none")
|
|
|
|
|
+ this.getParticulars(this.quizdata.lower)
|
|
|
|
|
+ },
|
|
|
|
|
+ recursion(index) {//提取图片链接 递归方法
|
|
|
|
|
+ if (index + 1) {
|
|
|
|
|
+ var src = this.quizdata.content.slice(index, this.quizdata.content.indexOf('"', index))
|
|
|
|
|
+ var length = src.length
|
|
|
|
|
+ var obj = {
|
|
|
|
|
+ image: src
|
|
|
|
|
+ }
|
|
|
|
|
+ this.list.push(obj)
|
|
|
|
|
+ console.log(src)
|
|
|
|
|
+ var index3 = this.quizdata.content.indexOf('http', index + length)
|
|
|
|
|
+ console.log(index3)
|
|
|
|
|
+ this.recursion(index3)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
- this.quizdata = JSON.parse(option.items)
|
|
|
|
|
- console.log(this.quizdata.lower)
|
|
|
|
|
- if (this.quizdata.img_urls == '' || this.quizdata.img_urls == null) {
|
|
|
|
|
- this.list = 'http://www.hnyfwlw.com:8006/projectimg' + this.defaultimg
|
|
|
|
|
- } else {
|
|
|
|
|
- this.list = this.quizdata.img_urls
|
|
|
|
|
- }
|
|
|
|
|
- this.getParticulars(this.quizdata.lower)
|
|
|
|
|
|
|
+ console.log(option.items)
|
|
|
|
|
+ this.getInvitation(option.items)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -153,20 +194,26 @@
|
|
|
// width: 95%;
|
|
// width: 95%;
|
|
|
// margin: 20rpx auto;
|
|
// margin: 20rpx auto;
|
|
|
// }
|
|
// }
|
|
|
- .partitlteimg{
|
|
|
|
|
|
|
+ .partitlteimg {
|
|
|
width: 95%;
|
|
width: 95%;
|
|
|
- margin: 80rpx auto 20rpx;
|
|
|
|
|
|
|
+ margin: 0 auto 20rpx;
|
|
|
height: 428rpx;
|
|
height: 428rpx;
|
|
|
- .img{
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 428rpx;
|
|
|
|
|
|
|
+ image {
|
|
|
|
|
+ max-width: 100%;
|
|
|
|
|
+ max-height: 100%;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.quiz {
|
|
.quiz {
|
|
|
width: 95%;
|
|
width: 95%;
|
|
|
margin: 20rpx auto;
|
|
margin: 20rpx auto;
|
|
|
border-bottom: 4rpx dashed #E8E8E8;
|
|
border-bottom: 4rpx dashed #E8E8E8;
|
|
|
-
|
|
|
|
|
|
|
+ .quiz_title{
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
.quiz_username {
|
|
.quiz_username {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
|
|
|
@@ -193,6 +240,7 @@
|
|
|
width: 50rpx;
|
|
width: 50rpx;
|
|
|
height: 50rpx;
|
|
height: 50rpx;
|
|
|
margin-right: 20rpx;
|
|
margin-right: 20rpx;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
span {
|
|
span {
|
|
@@ -205,6 +253,30 @@
|
|
|
.quiz_usercontert {
|
|
.quiz_usercontert {
|
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ rich-text{
|
|
|
|
|
+ // display: none;
|
|
|
|
|
+ color: red;
|
|
|
|
|
+ image{
|
|
|
|
|
+ width: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ img{
|
|
|
|
|
+ width: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ /deep/p{
|
|
|
|
|
+ color: red;
|
|
|
|
|
+ }
|
|
|
|
|
+ /deep/image{
|
|
|
|
|
+ width: 0 !important;
|
|
|
|
|
+ height: 0 !important;
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ /deep/img{
|
|
|
|
|
+ width: 0 !important;
|
|
|
|
|
+ height: 0 !important;
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -218,8 +290,8 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.scroll-view_H {
|
|
.scroll-view_H {
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
height: 600rpx;
|
|
height: 600rpx;
|
|
|
|
|
+ padding-bottom: 100rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.comment_unit {
|
|
.comment_unit {
|