| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <view>
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="详情"></uni-nav-bar>
- <u-swiper :list="list" height="428"></u-swiper>
- <view class="quiz">
- <view class="quiz_username">
- <image src="../../static/image/expertDiagnosis/6940a11a251770f1b0d8b7b10ebdf9b.png" mode="" v-if="Number(quizdata.heat)==1"></image>
- <span>{{quizdata.title}}</span>
- </view>
- <view class="quiz_usertime">
- <view style="display: flex;align-items: center;">
- <image src="../../static/image/fourMoodBase/touxiang.png" mode=""></image>
- <span>{{quizdata.username}}</span>
- </view>
- <view>
- <span>{{quizdata.adtime|timeFormat()}}</span>
- </view>
- </view>
- <view class="quiz_usercontert" v-html="quizdata.content"></view>
- </view>
- <view class="comment">
- <p class="comment_title">评论</p>
- <view class="comment_unit" v-for="(item,index) in commentdata" :key="index">
- <view class="comment_unit_user">
- <view class="username">
- <image :src="item.image" mode=""></image>
- <span style="font-size: 26rpx;color:#C1C1C1;">{{item.username}}</span>
- <p v-if="Number(item.user_type) == 1">专家</p>
- </view>
- <view>
- <span style="font-size: 26rpx;color:#C1C1C1;">{{item.uptime|timeFormat()}}</span>
- </view>
- </view>
- <view class="comment_unit_con">
- <p v-html="item.content"></p>
- </view>
- </view>
- </view>
- <view class="issue_box">
- <view class="issue">
- <input type="text" v-model="issuedata"/>
- <p @click="issue">发布</p>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [{}],
- quizdata: {},
- commentdata: [],
- issuedata:'',
- defaultimg: '/images/expertDiagnosis/img01.png',
- }
- },
- methods: {//
- async getParticulars(data) {
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=pest.pests.pests_answers_list',
- data: {
- lower: data.lower
- }
- })
- this.commentdata = res.data
- console.log(this.commentdata)
- },
- async getDiscuss(data) {
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=pest.pests.pests_new_idea',
- data: {
- lower: data.lower,
- content:data.content
- }
- })
- console.log(res)
- },
- clickLeft() {
- uni.navigateTo({
- url: "exchangeShare"
- })
- },
- issue(){//发布评论
- let obj = {}
- obj.lower = this.quizdata.lower
- obj.content=this.issuedata
- if(this.issuedata!=''){
- this.getDiscuss(obj)
- }
- uni.navigateTo({
- url:"particulars?items="+JSON.stringify(this.quizdata)
- })
- }
- },
- onLoad(option) {
- this.quizdata = JSON.parse(option.items)
- console.log(this.quizdata.img_urls)
- if(this.quizdata.img_urls =='' || this.quizdata.img_urls ==null){
- this.list[0].image = 'http://static.yfpyx.com/projectimg'+this.defaultimg
- }else{
- this.list[0].image = this.quizdata.img_urls
- }
- let data = {}
- data.lower = this.quizdata.lower
- this.getParticulars(data)
- }
- }
- </script>
- <style lang="scss">
- .u-swiper-wrap {
- width: 95%;
- margin: 20rpx auto;
- }
- .quiz {
- width: 95%;
- margin: 20rpx auto;
- border-bottom: 4rpx dashed #E8E8E8;
- .quiz_username {
- width: 100%;
- image {
- width: 40rpx;
- height: 40rpx;
- vertical-align: middle;
- margin-right: 20rpx;
- }
- span{
- font-weight: 700;
- font-size: 32rpx;
- }
- }
- .quiz_usertime {
- width: 100%;
- margin-top: 15rpx;
- display: flex;
- justify-content: space-between;
- image {
- width: 50rpx;
- height: 50rpx;
- margin-right: 20rpx;
- }
- span {
- font-size: 12rpx;
- color: #C1C1C1;
- }
- }
- .quiz_usercontert {
- padding: 20rpx;
- margin-bottom: 20rpx;
- }
- }
- .comment {
- width: 95%;
- margin: 20rpx auto 0;
- .comment_title {
- font-weight: 700;
- font-size: 32rpx;
- }
- .comment_unit {
- .comment_unit_user {
- display: flex;
- justify-content: space-between;
- margin-top: 20rpx;
- .username {
- display: flex;
- align-items: center;
- image {
- width: 50rpx;
- height: 50rpx;
- margin-right: 20rpx;
- border-radius: 50%;
- }
- p{
- width: 60rpx;
- height: 30rpx;
- color: white;
- background-color: #5CA348;
- font-size: 24rpx;
- text-align: center;
- line-height: 30rpx;
- padding: 0 10rpx;
- margin-left: 20rpx;
- border-radius: 8rpx;
- }
- }
- }
- .comment_unit_con {
- padding-left: 60rpx;
- /deep/p {
- margin-top: 20rpx;
- img {
- margin-top: 20rpx;
- display: block;
- width: 180rpx !important;
- height: 180rpx !important;
- }
- }
- }
- }
- }
- .issue_box{
- width: 100%;
- position: fixed;
- bottom: 0;
- background-color: #FFFFFF;
- }
- .issue{
- width: 95%;
- margin: 0 auto;
- display: flex;
- padding-bottom: 20rpx;
- input{
- width: 90%;
- background-color: #F3F3F3;
- height: 60rpx;
- text-indent: 1em;
- }
- p{
- width: 10%;
- text-align: right;
- line-height: 60rpx;
- color: #7a7a7a;
- }
- }
- </style>
|