sucai.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="container">
  3. <view class="big">
  4. <view class="header flex-start">
  5. <image class="avaimg" :src="userInfo.avatar || '/static/error/missing-face.png'" mode="">
  6. </image>
  7. <view class="nicheng">
  8. <view class="nc">123</view>
  9. <view class="sj">1分钟前</view>
  10. </view>
  11. </view>
  12. <view class="tex">
  13. <textarea v-model="content" auto-focus maxlength="-1" class="wenzhang" placeholder="请输入内容"></textarea>
  14. </view>
  15. <image class="sc" v-for="item in imgArr" :src="item" mode=""></image>
  16. <image @click="choose" class="sc" src="../../static/user/erweima.png" mode=""></image>
  17. <view class="">
  18. <button class="btn" @click="pushList">发布素材</button>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. mapState,
  26. mapMutations
  27. } from 'vuex';
  28. export default {
  29. data() {
  30. return {
  31. content: '', // 文章内容
  32. imgArr: []
  33. }
  34. },
  35. computed: {
  36. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  37. },
  38. methods: {
  39. pushList() {
  40. // 对应的逻辑
  41. uni.showToast({
  42. title: '发布成功',
  43. icon: 'success'
  44. })
  45. },
  46. choose() {
  47. uni.chooseImage({
  48. count: 9,
  49. success: res=> {
  50. this.imgArr = res.tempFilePaths
  51. console.log('11', res);
  52. }
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style>
  59. .big {
  60. width: 700rpx;
  61. background-color: #fff;
  62. margin-top: 25rpx;
  63. margin-left: 25rpx;
  64. }
  65. .header {
  66. padding-top: 20rpx;
  67. padding-left: 20rpx;
  68. .avaimg {
  69. width: 97rpx;
  70. height: 88rpx;
  71. }
  72. .nicheng {
  73. padding-left: 10rpx;
  74. .nc {
  75. font-size: 32rpx;
  76. color: #333333;
  77. }
  78. .sj {
  79. font-size: 24rpx;
  80. color: #999999;
  81. }
  82. }
  83. }
  84. .wenzhang {
  85. font-size: 28rpx;
  86. color: #666666;
  87. padding-top: 20rpx;
  88. padding-left: 20rpx;
  89. }
  90. .sc {
  91. width: 160rpx;
  92. height: 160rpx;
  93. margin: 0 10rpx;
  94. }
  95. .btn {
  96. width: 625rpx;
  97. height: 89rpx;
  98. background: #FF6F0F;
  99. border-radius: 15rpx;
  100. margin-left: 35rpx;
  101. color: #fff;
  102. position: fixed;
  103. bottom: 60rpx;
  104. z-index: 999;
  105. }
  106. </style>