myadvicedetial.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="myAdviceDetial">
  3. <!-- 页面头部 -->
  4. <u-navbar
  5. :is-back="true"
  6. back-icon-color="#2af"
  7. :border-bottom="true"
  8. back-text="返回"
  9. :back-text-style="{color:'#2af'}"
  10. :title="title"
  11. >
  12. <view slot="right" class="edit" @click="editMyAdvice">编辑</view>
  13. </u-navbar>
  14. <!-- 列表 -->
  15. <scroll-view class="tabs" :scroll-y="true">
  16. <view class="item" v-for="(item,index) in tabs" :key="index">
  17. <view class="ask">
  18. <view class="userimg"><image class="img" :src="item.src" mode="widthFix"></image></view>
  19. <view class="userinfo">
  20. <view class="label">{{item.label}}</view>
  21. <view class="date">{{item.date}}</view>
  22. </view>
  23. </view>
  24. <view class="userques">咨询内容:{{item.ques}}</view>
  25. <view class="ans">
  26. <view style="font-size:24upx">平台回复:</view>
  27. <!-- <view class="answer" :style="{'-webkit-line-clamp':100}">{{item.ans}}</view> -->
  28. <view class="answer" :class="{linemore:item.id==lineIndex}">{{item.ans}}</view>
  29. <view class="openmsg" @click="showMore(item)"><text v-if="item.id==lineIndex">收起</text><text v-if="item.id!=lineIndex">展开</text></view>
  30. </view>
  31. </view>
  32. </scroll-view>
  33. <view class="opt">
  34. <view class="clearList" @click="clearList">一键清空</view>
  35. <view class="removeListItem">删除</view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue'
  41. export default {
  42. name:'MyAdviceDetial',
  43. components:{
  44. UNavbar,
  45. },
  46. data(){
  47. return {
  48. title:'',
  49. keyword:'',
  50. lineIndex:-1,
  51. flagName:'展开',
  52. tabs:[
  53. {
  54. id:0,
  55. src:'../../../static/E2.png',
  56. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  57. label:'长江三峡集团',
  58. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  59. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  60. date:'2019-12-30 14:20'
  61. },{
  62. id:1,
  63. src:'../../../static/E2.png',
  64. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  65. label:'长江三峡集团',
  66. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  67. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  68. date:'2019-12-30 14:20'
  69. },{
  70. id:2,
  71. src:'../../../static/E2.png',
  72. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  73. label:'长江三峡集团',
  74. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  75. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  76. date:'2019-12-30 14:20'
  77. },{
  78. id:3,
  79. src:'../../../static/E2.png',
  80. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  81. label:'长江三峡集团',
  82. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  83. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  84. date:'2019-12-30 14:20'
  85. },{
  86. id:4,
  87. src:'../../../static/E2.png',
  88. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  89. label:'长江三峡集团',
  90. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  91. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  92. date:'2019-12-30 14:20'
  93. },{
  94. id:5,
  95. src:'../../../static/E2.png',
  96. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  97. label:'长江三峡集团',
  98. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  99. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  100. date:'2019-12-30 14:20'
  101. },{
  102. id:6,
  103. src:'../../../static/E2.png',
  104. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  105. label:'长江三峡集团',
  106. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  107. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  108. date:'2019-12-30 14:20'
  109. },{
  110. id:7,
  111. src:'../../../static/E2.png',
  112. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  113. label:'长江三峡集团',
  114. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  115. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  116. date:'2019-12-30 14:20'
  117. },{
  118. id:8,
  119. src:'../../../static/E2.png',
  120. ques:'您好!对贵公司的某**个项目感兴趣,想进一步沟通合作',
  121. label:'长江三峡集团',
  122. ans:`您好!谢谢你的咨询,已安排人员和贵公司联系您好!谢谢你的咨询,您好!谢谢你的咨询,已安排人员和贵公司联系!谢谢你的咨询,
  123. 您好!谢谢你的咨询,已安排人员和贵公司联系`,
  124. date:'2019-12-30 14:20'
  125. }
  126. ],
  127. }
  128. },
  129. onLoad(e){
  130. uni.showLoading({
  131. title: this.$i18n.locale == 'zh'? '加载中...': 'Loading...'
  132. });
  133. this.title= this.$i18n.locale == 'zh'? '我的咨询': 'My Application'
  134. setTimeout(()=>{uni.hideLoading();},100)
  135. },
  136. methods:{
  137. //展开或者收起回复
  138. showMore(item){
  139. if(this.lineIndex!=item.id) {
  140. this.lineIndex=item.id;
  141. }else{
  142. this.lineIndex=-1;
  143. }
  144. },
  145. //清空列表
  146. clearList(){
  147. this.tabs=[];
  148. },
  149. //编辑我的咨询
  150. editMyAdvice(){
  151. uni.navigateTo({
  152. url:'/pages/service/others/myadvicedit'
  153. })
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang="scss" scoped>
  159. .myAdviceDetial{
  160. background:#fefefe;
  161. .edit{
  162. margin-right:30upx;
  163. color:#2af;
  164. }
  165. .tabs{
  166. width:100%;
  167. height:84.3%;
  168. background:#fefefe;
  169. position:absolute;
  170. .item{
  171. width:100%;
  172. padding:3%;
  173. margin:20upx 0;
  174. border-bottom:4upx solid #eee;
  175. .ask{
  176. display:flex;
  177. align-items:center;
  178. .userimg{
  179. width:100upx;
  180. height:100upx;
  181. position:relative;
  182. border-radius:100%;
  183. background:#eee;
  184. margin-right:10upx;
  185. .img{
  186. width:80%;
  187. margin:10%;
  188. }
  189. }
  190. .userinfo{
  191. font-size:24upx;
  192. color:#666;
  193. }
  194. }
  195. .userques{
  196. font-size:24upx;
  197. margin-top:16upx;
  198. }
  199. .ans{
  200. background:#e8e8e8;
  201. padding:10upx;
  202. margin-top:20upx;
  203. position:relative;
  204. border-radius:10upx;
  205. color:#666;
  206. font-size:24upx;
  207. .answer{
  208. overflow:hidden;
  209. text-overflow:ellipsis;
  210. display:-webkit-box;
  211. font-size:24upx;
  212. -webkit-box-orient:vertical;
  213. -webkit-line-clamp:2;
  214. &.linemore{
  215. -webkit-line-clamp:10000;
  216. }
  217. }
  218. &:after{
  219. content:'';
  220. position:absolute;
  221. top:-60upx;
  222. left:10%;
  223. width:0;
  224. height:0;
  225. border-top:30upx solid transparent;
  226. border-bottom:30upx solid #e8e8e8;
  227. border-left:30upx solid transparent;
  228. border-right:30upx solid transparent;
  229. }
  230. .openmsg{
  231. text-align:right;
  232. margin-right:10upx;
  233. margin-top:10upx;
  234. color:#333;
  235. font-size:24upx;
  236. }
  237. }
  238. }
  239. }
  240. .opt{
  241. width:100%;
  242. padding:0 10%;
  243. position:fixed;
  244. left:0;
  245. right:0;
  246. bottom:0;
  247. height:140upx;
  248. margin:0 auto;
  249. background:#fefefe;
  250. display:flex;
  251. align-items:center;
  252. justify-content:space-between;
  253. .clearList,.removeListItem{
  254. margin-top:52upx;
  255. width:50%;
  256. line-height:70upx;
  257. border:1px solid #eee;
  258. padding:0 40upx;
  259. border-radius:0 0 80upx 80upx;
  260. text-align:center;
  261. }
  262. }
  263. }
  264. </style>