msgView.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <!-- #ifdef H5 -->
  3. <view class="message_view_page">
  4. <!-- 横幅 -->
  5. <view class="gonggao">
  6. <view>防骗手册,为您保驾护航</view>
  7. <text class="iconfont icon-jinru"></text>
  8. </view>
  9. <!-- 商品信息 -->
  10. <view class="goods_info">
  11. <!-- 商品图片 -->
  12. <view class="goods_img"></view>
  13. <!-- 商品描述 -->
  14. <view class="goods_text">
  15. <view class="goods_name">商品的名称展示</view>
  16. <view class="goods_pon">
  17. <view>
  18. <view class="goods_jiag">¥{{180.00}}</view>
  19. <view class="goods_fuwu">卖家包运费</view>
  20. </view>
  21. <view class="go_goods_btn">立即购买</view>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 聊天内容 -->
  26. <view class="message_view">
  27. <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" :enhanced="true"
  28. :bounces="false" :show-scrollbar="false" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
  29. <view style="box-sizing: border-box;padding: 10rpx 0;">
  30. <view v-for="(item,index) in 50" :key="index">
  31. <!-- 右消息 -->
  32. <view class="msg_view">
  33. <!-- 占位 -->
  34. <view class="msg_user_img_kong">
  35. </view>
  36. <view class="msg_view_info msg_view_info_right">
  37. <view class="msg_view_conent">
  38. 12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl
  39. </view>
  40. <view class="msg_view_time">2023-10-11 12:12:12</view>
  41. </view>
  42. <!-- 头像 -->
  43. <view class="msg_user_img">
  44. </view>
  45. </view>
  46. <!-- 左消息 -->
  47. <view class="msg_view">
  48. <!-- 头像 -->
  49. <view class="msg_user_img">
  50. </view>
  51. <view class="msg_view_info msg_view_info_left">
  52. <view class="msg_view_conent">12465479198kuhsadbckaehbl</view>
  53. <view class="msg_view_time">2023-10-11 12:12:12</view>
  54. </view>
  55. <!-- 占位 -->
  56. <view class="msg_user_img_kong">
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. <!-- 输入框 -->
  64. <view>
  65. <view class="text_input_view">
  66. <view class="text_input_lay">
  67. <view class="text_input_tengh">
  68. <input class="uni-input_chat" focus placeholder="请输入" />
  69. </view>
  70. <view class="text_input_mount" @click="gengduo = !gengduo">
  71. +
  72. </view>
  73. </view>
  74. </view>
  75. <view v-if="gengduo" class="gengduo_view">
  76. <view class="gengduo_view_ay">
  77. <view class="gengduo_view_icon"></view>
  78. <view class="gengduo_view_name">相册</view>
  79. </view>
  80. <view class="gengduo_view_ay">
  81. <view class="gengduo_view_icon"></view>
  82. <view class="gengduo_view_name">拍照</view>
  83. </view>
  84. <view class="gengduo_view_ay">
  85. <view class="gengduo_view_icon"></view>
  86. <view class="gengduo_view_name">位置</view>
  87. </view>
  88. <view class="gengduo_view_ay">
  89. <view class="gengduo_view_icon"></view>
  90. <view class="gengduo_view_name">举报</view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <!-- #endif -->
  96. <!-- #ifndef H5 -->
  97. <web-view :src="webViewHref('/pages/message/msgView')"></web-view>
  98. <!-- #endif -->
  99. </template>
  100. <script>
  101. export default {
  102. // #ifdef H5
  103. data() {
  104. return {
  105. scrollTop: 0,
  106. gengduo: false
  107. }
  108. },
  109. methods: {
  110. upper() {
  111. console.log("顶")
  112. },
  113. lower() {
  114. console.log("底")
  115. },
  116. scroll(e) {
  117. this.scrollTop = e.detail.scrollTop
  118. },
  119. },
  120. // #endif
  121. // #ifndef H5
  122. // #endif
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. page {
  127. height: 100%;
  128. overflow: hidden;
  129. }
  130. .message_view_page {
  131. overflow: hidden;
  132. width: 100%;
  133. /* #ifdef H5 */
  134. height: 100%;
  135. /* #endif */
  136. /* #ifndef H5 */
  137. height: 100vh;
  138. /* #endif */
  139. display: flex;
  140. flex-direction: column;
  141. .msg_view {
  142. width: 100%;
  143. height: auto;
  144. box-sizing: border-box;
  145. padding: 10rpx 20rpx;
  146. display: flex;
  147. .msg_view_info {
  148. flex: 1;
  149. min-height: 80rpx;
  150. .msg_view_conent {
  151. display: inline-block;
  152. max-width: 100%;
  153. height: auto;
  154. background: #fff;
  155. border-radius: 10rpx;
  156. box-sizing: border-box;
  157. padding: 18rpx;
  158. word-break: break-all;
  159. }
  160. .msg_view_time {
  161. margin-top: 8rpx;
  162. font-size: 22rpx;
  163. color: #aaa;
  164. }
  165. }
  166. .msg_view_info_left {
  167. display: flex;
  168. flex-direction: column;
  169. align-items: flex-start;
  170. box-sizing: border-box;
  171. padding-left: 30rpx;
  172. }
  173. .msg_view_info_right {
  174. display: flex;
  175. flex-direction: column;
  176. align-items: flex-end;
  177. padding-right: 30rpx;
  178. }
  179. .msg_user_img_kong {
  180. width: 80rpx;
  181. height: 80rpx;
  182. }
  183. .msg_user_img {
  184. background: #fff;
  185. width: 80rpx;
  186. height: 80rpx;
  187. border-radius: 40rpx;
  188. }
  189. }
  190. .gengduo_view {
  191. width: 100%;
  192. height: auto;
  193. box-sizing: border-box;
  194. padding: 8rpx 20rpx 18rpx 20rpx;
  195. background: #fff;
  196. display: flex;
  197. justify-content: space-around;
  198. .gengduo_view_ay {
  199. width: 110rpx;
  200. }
  201. .gengduo_view_icon {
  202. width: 110rpx;
  203. height: 110rpx;
  204. border-radius: 16rpx;
  205. background: #eee;
  206. margin-bottom: 16rpx;
  207. }
  208. .gengduo_view_name {
  209. font-size: 22rpx;
  210. text-align: center;
  211. color: #aaa;
  212. }
  213. }
  214. .text_input_view {
  215. width: 100%;
  216. height: 100rpx;
  217. box-sizing: border-box;
  218. padding: 18rpx 20rpx;
  219. background: #fff;
  220. .text_input_lay {
  221. width: 100%;
  222. height: 100%;
  223. display: flex;
  224. .text_input_tengh {
  225. flex: 1;
  226. height: 100%;
  227. box-sizing: border-box;
  228. padding-right: 18rpx;
  229. .uni-input_chat {
  230. border-radius: 34rpx;
  231. width: 100%;
  232. height: 100%;
  233. box-sizing: border-box;
  234. border: 1rpx solid #eee;
  235. padding: 0 10rpx;
  236. }
  237. }
  238. .text_input_mount {
  239. width: 64rpx;
  240. height: 64rpx;
  241. font-size: 52rpx;
  242. font-weight: bold;
  243. color: #999;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. }
  248. }
  249. }
  250. .goods_info {
  251. width: 100%;
  252. height: auto;
  253. padding: 20rpx;
  254. box-sizing: border-box;
  255. background: #fff;
  256. display: flex;
  257. .goods_img {
  258. width: 100rpx;
  259. height: 100rpx;
  260. }
  261. .goods_text {
  262. flex: 1;
  263. min-height: 100rpx;
  264. height: auto;
  265. box-sizing: border-box;
  266. padding-left: 16rpx;
  267. .goods_name {
  268. width: 100%;
  269. margin-bottom: 10rpx;
  270. font-size: 28rpx;
  271. font-weight: bold;
  272. overflow: hidden;
  273. /*超出部分隐藏*/
  274. white-space: nowrap;
  275. /*禁止换行*/
  276. text-overflow: ellipsis;
  277. /*省略号*/
  278. }
  279. .goods_jiag {
  280. font-size: 26rpx;
  281. color: red;
  282. }
  283. .goods_fuwu {
  284. font-size: 24rpx;
  285. color: #aaa;
  286. }
  287. .goods_pon {
  288. width: 100%;
  289. display: flex;
  290. justify-content: space-between;
  291. align-items: center;
  292. .go_goods_btn {
  293. width: auto;
  294. height: auto;
  295. box-sizing: border-box;
  296. padding: 14rpx 28rpx;
  297. border-radius: 10rpx;
  298. font-size: 24rpx;
  299. font-weight: bold;
  300. color: #fff;
  301. background: rgb(250, 42, 42);
  302. }
  303. }
  304. }
  305. }
  306. .message_view {
  307. width: 100%;
  308. flex: 1;
  309. position: relative;
  310. .message_view_scroll {
  311. position: absolute;
  312. top: 0;
  313. bottom: 0;
  314. left: 0;
  315. right: 0;
  316. }
  317. }
  318. .gonggao {
  319. width: 100%;
  320. height: 80rpx;
  321. background: #fff2d4;
  322. box-sizing: border-box;
  323. padding: 0 20rpx;
  324. display: flex;
  325. align-items: center;
  326. justify-content: space-between;
  327. font-size: 24rpx;
  328. color: rgb(230, 138, 19);
  329. view {
  330. color: rgb(230, 138, 19);
  331. }
  332. }
  333. }
  334. </style>