businessList.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. }],
  47. [{
  48. label: '竞品分析:',
  49. prop: 'analysis',
  50. slot: 'analysis',
  51. className: 'perce100',
  52. }],
  53. [{
  54. label: '操作:',
  55. prop: 'action',
  56. type: 'action',
  57. className: 'perce100',
  58. }],
  59. ]
  60. }
  61. },
  62. created() {
  63. },
  64. methods: {
  65. add(status) {
  66. this.tableList.push({
  67. name: '',
  68. analysis: ''
  69. })
  70. },
  71. init(list) {
  72. if (list) {
  73. this.tableList = JSON.parse(JSON.stringify(list))
  74. }
  75. },
  76. save() {
  77. uni.$emit('setBusinessOpportunity')
  78. },
  79. del(index) {
  80. this.tableList.splice(index, 1);
  81. },
  82. getValue() {
  83. return this.tableList
  84. },
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .add {
  90. width: 96rpx;
  91. height: 96rpx;
  92. border-radius: 48rpx;
  93. background: #3c9cff;
  94. position: fixed;
  95. bottom: 100rpx;
  96. right: 24rpx;
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. z-index: 99;
  101. }
  102. .footerButton {
  103. width: 100%;
  104. height: 84rpx;
  105. display: flex;
  106. position: fixed;
  107. bottom: 0;
  108. z-index: 10;
  109. /deep/.u-button {
  110. height: 100%;
  111. }
  112. >view {
  113. flex: 1;
  114. }
  115. }
  116. .item {
  117. display: flex;
  118. flex-direction: column;
  119. padding: 16rpx;
  120. >view {
  121. padding-top: 14rpx;
  122. }
  123. .item_title {
  124. font-size: 32rpx;
  125. font-weight: 800;
  126. }
  127. .item_list {
  128. display: flex;
  129. align-items: center;
  130. text {
  131. font-size: 28rpx;
  132. }
  133. .lable {
  134. color: #626060;
  135. }
  136. .value {
  137. color: #333;
  138. margin-left: 12rpx;
  139. flex: 1
  140. }
  141. }
  142. }
  143. /deep/.u-swipe-action-item__right__button__wrapper {
  144. background-color: #f56c6c !important;
  145. }
  146. /deep/.u-input {
  147. padding: 0 !important;
  148. }
  149. /deep/uni-textarea {
  150. padding: 0 !important;
  151. }
  152. </style>