瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

391 lines
7.7 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="postDetail">
  3. <navbar leftClick @leftClick="$utils.navigateBack" title="详情" />
  4. <view class="works" @click="$emit('click')">
  5. <view class="box" :style="{'--sexcolor' : sex[detail.sex].color}">
  6. <view class="headPortraitimg">
  7. <image :src="detail.userImage" mode="aspectFill"></image>
  8. </view>
  9. <view class="YaoduUniversalWall">
  10. <view class="heide">
  11. <view class="username text-ellipsis">
  12. {{ detail.userName }}
  13. </view>
  14. <view class="inde" v-if="detail.sex">
  15. <!-- 性别 -->
  16. {{ detail.sex }}
  17. </view>
  18. <view class="inde" v-if="detail.yearDate">
  19. <!-- 年份 -->
  20. {{ detail.yearDate }}
  21. </view>
  22. <view class="inde" v-if="detail.address">
  23. <!-- 地址 -->
  24. {{ detail.address }}
  25. </view>
  26. <view class="authentication" v-if="detail.isContent">
  27. <!-- 个人认证 -->
  28. {{ detail.isContent }}
  29. </view>
  30. </view>
  31. <view class="Times">
  32. <view class="TimeMonth">
  33. <!-- 10-08 -->
  34. {{ detail.createTime }}发布
  35. </view>
  36. <!-- <view class="Month">
  37. 12:34
  38. </view> -->
  39. </view>
  40. </view>
  41. </view>
  42. <view class="dynamics" v-html="$utils.stringFormatHtml(detail.title)">
  43. </view>
  44. <view class="Artworkimages">
  45. <view class="wrokimg" @click.stop="previewImage(detail.image, i)" :key="i"
  46. v-for="(img, i) in detail.image">
  47. <image :src="img" mode="aspectFill"></image>
  48. </view>
  49. </view>
  50. <view class="bottom">
  51. <view class="browse">
  52. {{ detail.isBrowse }}浏览
  53. </view>
  54. <view class="browse">
  55. {{ detail.isComment }}条评论
  56. </view>
  57. <view class="Leavingamessage">
  58. <uv-icon size="40rpx" name="chat"></uv-icon>
  59. </view>
  60. <view class="Leavingamessage" v-if="del" @click.stop="$emit('del')">
  61. <uv-icon size="40rpx" name="trash"></uv-icon>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="comment-list">
  66. <view class="comment"
  67. v-for="(item, index) in list">
  68. <view class="box">
  69. <view class="headPortraitimg">
  70. <image :src="item.userHead" mode="aspectFill"></image>
  71. </view>
  72. <view class="YaoduUniversalWall">
  73. <view class="heide">
  74. <view class="username text-ellipsis">
  75. {{ item.userName }}
  76. </view>
  77. </view>
  78. <view class="Times">
  79. <view class="TimeMonth">
  80. {{ item.createTime }}发布
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="dynamics" v-html="$utils.stringFormatHtml(item.userValue)">
  86. </view>
  87. </view>
  88. </view>
  89. <view class="submit-box">
  90. <view class="top">
  91. <uv-icon
  92. color="#00cf05"
  93. size="50rpx"
  94. name="weixin-fill"></uv-icon>
  95. <input type="text"
  96. :placeholder="'评论给' + detail.userName"
  97. v-model="form.userValue"/>
  98. <view class="submit"
  99. @click="submit">
  100. 发布
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import mixinsSex from '@/mixins/sex.js'
  108. import mixinsList from '@/mixins/list.js'
  109. export default {
  110. mixins: [mixinsSex, mixinsList],
  111. components: {},
  112. data() {
  113. return {
  114. detail: {},
  115. form : {},
  116. mixinsListApi : 'getCommentPage',
  117. }
  118. },
  119. onLoad(options) {
  120. // this.$route.query的参数
  121. console.log(options)
  122. this.id = options.id
  123. this.queryParams.orderId = options.id
  124. this.queryParams.type = 0
  125. },
  126. onPullDownRefresh() {
  127. this.getDetail()
  128. },
  129. onShow() {
  130. this.getDetail()
  131. },
  132. onShareAppMessage(res) {
  133. // return {
  134. // title: this.item.title,
  135. // desc: this.item.content && this.item.content.slice(0, 30),
  136. // path: '/pages/publish/postDetail?id=' + this.id
  137. // }
  138. },
  139. methods: {
  140. getDetail() {
  141. this.$api('getPostDetail', {
  142. id: this.id
  143. }, res => {
  144. uni.stopPullDownRefresh()
  145. if (res.code == 200) {
  146. res.result.image =
  147. res.result.image ?
  148. res.result.image.split(',') : [],
  149. this.detail = res.result
  150. }
  151. })
  152. },
  153. submit(){
  154. if (this.$utils.verificationAll(this.form, {
  155. userValue: '说点什么吧',
  156. })) {
  157. return
  158. }
  159. // this.form.image = this.fileList.map((item) => item.url).join(",")
  160. this.form.orderId = this.id
  161. this.$api('addComment', this.form, res => {
  162. this.form.userValue = ''
  163. if(res.code == 200){
  164. uni.showToast({
  165. title: '发布成功!',
  166. icon: 'none'
  167. })
  168. this.getData()
  169. }
  170. })
  171. },
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .postDetail {
  177. padding-bottom: env(safe-area-inset-bottom);
  178. .works {
  179. background-color: #fff;
  180. padding: 40rpx;
  181. border-radius: 20rpx;
  182. .box {
  183. display: flex;
  184. align-items: center;
  185. .headPortraitimg {
  186. width: 100rpx;
  187. height: 100rpx;
  188. border-radius: 15rpx;
  189. overflow: hidden;
  190. image {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. }
  195. .YaoduUniversalWall {
  196. padding: 0rpx 10rpx;
  197. .username {
  198. max-width: 200rpx;
  199. }
  200. .heide {
  201. display: flex;
  202. justify-content: center;
  203. align-items: center;
  204. }
  205. .inde {
  206. display: flex;
  207. justify-content: center;
  208. align-items: center;
  209. padding: 0rpx 10rpx;
  210. margin: 0rpx 5rpx;
  211. font-size: 20rpx;
  212. height: 30rpx;
  213. color: white;
  214. // background-color: rgb(124, 136, 242);
  215. background-color: var(--sexcolor);
  216. border-radius: 7rpx;
  217. flex-shrink: 0;
  218. }
  219. .authentication {
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. padding: 0rpx 10rpx;
  224. margin: 0rpx 5rpx;
  225. font-size: 20rpx;
  226. height: 34rpx;
  227. padding: 0rpx 10rpx;
  228. color: white;
  229. background-color: #ffd036;
  230. border-radius: 7rpx;
  231. flex-shrink: 0;
  232. }
  233. .Times {
  234. display: flex;
  235. padding: 5rpx 0rpx;
  236. font-size: 20rpx;
  237. margin-top: 10rpx;
  238. .Month {
  239. margin: 0rpx 15rpx;
  240. }
  241. }
  242. }
  243. }
  244. .personalInformation {
  245. display: flex;
  246. .inde {
  247. font-size: 25rpx;
  248. padding: 0rpx 8rpx;
  249. }
  250. .authentication {
  251. font-size: 25rpx;
  252. }
  253. }
  254. .dynamics {
  255. margin-top: 20rpx;
  256. font-size: 28rpx;
  257. // font-weight: bold;
  258. // line-height: 35rpx;
  259. letter-spacing: 3rpx;
  260. }
  261. .Artworkimages {
  262. display: flex;
  263. flex-wrap: wrap;
  264. .wrokimg {
  265. margin: 10rpx;
  266. image {
  267. height: 190rpx;
  268. width: 190rpx;
  269. border-radius: 20rpx;
  270. }
  271. }
  272. }
  273. .bottom {
  274. display: flex;
  275. margin-top: 20rpx;
  276. font-size: 24rpx;
  277. .browse {
  278. margin: 0rpx 30rpx;
  279. color: rgb(132, 132, 132);
  280. }
  281. .Leavingamessage {
  282. height: 20rpx;
  283. width: 20rpx;
  284. margin-left: auto;
  285. }
  286. }
  287. }
  288. .comment-list {
  289. margin-top: 20rpx;
  290. padding-bottom: 150rpx;
  291. .comment {
  292. background-color: #fff;
  293. padding: 30rpx 40rpx;
  294. margin-top: 10rpx;
  295. .box {
  296. display: flex;
  297. align-items: center;
  298. .headPortraitimg {
  299. width: 80rpx;
  300. height: 80rpx;
  301. border-radius: 15rpx;
  302. overflow: hidden;
  303. image {
  304. width: 100%;
  305. height: 100%;
  306. }
  307. }
  308. .YaoduUniversalWall {
  309. padding: 0rpx 10rpx;
  310. font-size: 26rpx;
  311. line-height: 40rpx;
  312. .Times{
  313. font-size: 22rpx;
  314. }
  315. }
  316. }
  317. .dynamics {
  318. margin-top: 20rpx;
  319. margin-left: 100rpx;
  320. font-size: 28rpx;
  321. letter-spacing: 3rpx;
  322. }
  323. }
  324. }
  325. .submit-box{
  326. position: fixed;
  327. bottom: 0;
  328. left: 0;
  329. background-color: #fff;
  330. width: 100%;
  331. box-shadow: 0 0 6rpx 6rpx #00000011;
  332. padding-bottom: env(safe-area-inset-bottom);
  333. .top{
  334. align-items: center;
  335. display: flex;
  336. justify-content: center;
  337. input{
  338. background-color: #f3f3f3;
  339. width: 460rpx;
  340. height: 40rpx;
  341. border-radius: 40rpx;
  342. margin: 20rpx;
  343. padding: 20rpx 30rpx;
  344. font-size: 28rpx;
  345. }
  346. .submit{
  347. }
  348. }
  349. }
  350. }
  351. </style>