businessList.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="mainBox">
  3. <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  4. <myCard :item="item" :btnList="btnList" :index="index+1" :columns="columns" @del="del(index)">
  5. <u--input placeholder="请输入" slot="name" v-model="item.name">
  6. </u--input>
  7. <u--textarea v-model="item.analysis" slot="analysis" placeholder="请输入内容" autoHeight></u--textarea>
  8. </myCard>
  9. </view>
  10. <view class="add" @click="add">
  11. <u-icon name="plus" color="#fff"></u-icon>
  12. </view>
  13. <view style="height: 84rpx;" v-if="isDrawer"></view>
  14. <view class="footerButton" v-if="isDrawer">
  15. <u-button type="primary" @click="save" text="保存"></u-button>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import myCard from '../../components/myCard.vue'
  21. export default {
  22. components: {
  23. myCard
  24. },
  25. props: {
  26. isDrawer: {
  27. default: false
  28. }
  29. },
  30. data() {
  31. return {
  32. tableList: [],
  33. btnList: [{
  34. name: '删除',
  35. apiName: 'del',
  36. btnType: 'error ',
  37. type: '2',
  38. pageUrl: '',
  39. }],
  40. columns: [
  41. [{
  42. label: '竞争对手名称:',
  43. prop: 'name',
  44. slot: 'name',
  45. className: 'perce100',
  46. style:{
  47. marginBottom:'14rpx'
  48. }
  49. }],
  50. [{
  51. label: '竞品分析:',
  52. prop: 'analysis',
  53. slot: 'analysis',
  54. className: 'perce100',
  55. style:{
  56. marginBottom:'14rpx'
  57. }
  58. }],
  59. [{
  60. label: '操作:',
  61. prop: 'action',
  62. type: 'action',
  63. className: 'perce100',
  64. }],
  65. ]
  66. }
  67. },
  68. created() {
  69. },
  70. methods: {
  71. add(status) {
  72. this.tableList.push({
  73. name: '',
  74. analysis: ''
  75. })
  76. },
  77. init(list) {
  78. if (list) {
  79. this.tableList = JSON.parse(JSON.stringify(list))
  80. }
  81. },
  82. save() {
  83. uni.$emit('setBusinessOpportunity')
  84. },
  85. del(index) {
  86. this.tableList.splice(index, 1);
  87. },
  88. getValue() {
  89. return this.tableList
  90. },
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .add {
  96. width: 96rpx;
  97. height: 96rpx;
  98. border-radius: 48rpx;
  99. background: #3c9cff;
  100. position: fixed;
  101. bottom: 100rpx;
  102. right: 24rpx;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. z-index: 99;
  107. }
  108. .footerButton {
  109. width: 100%;
  110. height: 84rpx;
  111. display: flex;
  112. position: fixed;
  113. bottom: 0;
  114. z-index: 10;
  115. /deep/.u-button {
  116. height: 100%;
  117. }
  118. >view {
  119. flex: 1;
  120. }
  121. }
  122. .item {
  123. display: flex;
  124. flex-direction: column;
  125. padding: 16rpx;
  126. >view {
  127. padding-top: 14rpx;
  128. }
  129. .item_title {
  130. font-size: 32rpx;
  131. font-weight: 800;
  132. }
  133. .item_list {
  134. display: flex;
  135. align-items: center;
  136. text {
  137. font-size: 28rpx;
  138. }
  139. .lable {
  140. color: #626060;
  141. }
  142. .value {
  143. color: #333;
  144. margin-left: 12rpx;
  145. flex: 1
  146. }
  147. }
  148. }
  149. /deep/.u-swipe-action-item__right__button__wrapper {
  150. background-color: #f56c6c !important;
  151. }
  152. /deep/.u-input {
  153. padding: 0 !important;
  154. }
  155. /deep/uni-textarea {
  156. padding: 0 !important;
  157. }
  158. </style>