add_appraise.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view>
  3. <!--标题栏-->
  4. <bar-title bgColor="bg-white" isBack>
  5. <block slot="content">追加评价</block>
  6. </bar-title>
  7. <!--信息-->
  8. <view class="bg-white zaiui-content-view">
  9. <view class="cu-form-group">
  10. <textarea placeholder="评价内容"/>
  11. </view>
  12. <view class="zaiui-img-view">
  13. <view class="img-grid-view">
  14. <view class="grid col-5">
  15. <block v-for="(item,index) in imgList" :key="index">
  16. <view class="bg-img" @tap="ViewImage" :data-url="imgList[index]">
  17. <image class="image" :src="imgList[index]" mode="aspectFill"></image>
  18. <view class="cu-tag sm bg-red" @tap.stop="DelImg" :data-index="index">
  19. <text class='cuIcon-close'></text>
  20. </view>
  21. </view>
  22. </block>
  23. <view class="add-view" @tap="ChooseImage">
  24. <text class='cuIcon-add'></text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="text-sm text-gray text-right">500</view>
  29. </view>
  30. </view>
  31. <!--按钮-->
  32. <view class="bg-white zaiui-btn-view zaiui-foot-padding-bottom">
  33. <view class="flex flex-direction">
  34. <button class="cu-btn bg-red">提交评价</button>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import barTitle from '@/components/zaiui-common/basics/bar-title';
  41. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  42. export default {
  43. components: {
  44. barTitle
  45. },
  46. data() {
  47. return {
  48. bg_img: '/static/images/home/goods/1.png', imgList: [],
  49. }
  50. },
  51. onLoad() {
  52. },
  53. onReady() {
  54. _tool.setBarColor(true);
  55. uni.pageScrollTo({
  56. scrollTop: 0,
  57. duration: 0
  58. });
  59. },
  60. methods: {
  61. ChooseImage() {
  62. uni.chooseImage({
  63. count: 4,
  64. sizeType: ['original', 'compressed'],
  65. sourceType: ['album'],
  66. success: (res) => {
  67. if (this.imgList.length != 0) {
  68. this.imgList = this.imgList.concat(res.tempFilePaths)
  69. } else {
  70. this.imgList = res.tempFilePaths
  71. }
  72. }
  73. });
  74. },
  75. ViewImage(e) {
  76. uni.previewImage({
  77. urls: this.imgList,
  78. current: e.currentTarget.dataset.url
  79. });
  80. },
  81. DelImg(e) {
  82. uni.showModal({
  83. title: '召唤师',
  84. content: '确定要删除这段回忆吗?',
  85. cancelText: '再看看',
  86. confirmText: '再见',
  87. success: res => {
  88. if (res.confirm) {
  89. this.imgList.splice(e.currentTarget.dataset.index, 1)
  90. }
  91. }
  92. })
  93. },
  94. }
  95. }
  96. </script>
  97. <style lang="scss">
  98. /* #ifdef APP-PLUS */
  99. @import "../../static/colorui/main.css";
  100. @import "../../static/colorui/icon.css";
  101. @import "../../static/zaiui/style/app.scss";
  102. /* #endif */
  103. .zaiui-img-view {
  104. position: relative;
  105. padding: 0 29.09upx;
  106. .img-grid-view {
  107. position: relative;
  108. padding-right: 72.72upx;
  109. padding-bottom: 18.18upx;
  110. .grid.col-5 {
  111. .bg-img {
  112. position: relative;
  113. border-radius: 3.63upx;
  114. margin-bottom: 27.27upx;
  115. margin-right: 27.27upx;
  116. height: 72.72upx;
  117. width: 72.72upx;
  118. .image {
  119. border-radius: 3.63upx;
  120. height: 72.72upx;
  121. width: 72.72upx;
  122. }
  123. .cu-tag {
  124. position: absolute;
  125. border-radius: 3.63upx;
  126. padding: 0 1.81upx;
  127. height: auto;
  128. right: 0;
  129. top: 0;
  130. text {
  131. position: relative;
  132. top: 1.81upx;
  133. }
  134. }
  135. }
  136. .add-view {
  137. border: 2upx solid #efeeee;
  138. margin-bottom: 27.27upx;
  139. border-radius: 3.63upx;
  140. line-height: 72.72upx;
  141. text-align: center;
  142. height: 72.72upx;
  143. width: 72.72upx;
  144. text {
  145. position: relative;
  146. font-size: 54.54upx;
  147. color: #e4e3e3;
  148. }
  149. }
  150. }
  151. }
  152. .text-right {
  153. position: absolute;
  154. right: 29.09upx;
  155. bottom: 36.36upx;
  156. }
  157. }
  158. .zaiui-btn-view {
  159. position: fixed;
  160. width: 100%;
  161. bottom: 0;
  162. .flex {
  163. padding: 18.18upx;
  164. }
  165. }
  166. </style>