| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <template>
- <view class="mainBox">
- <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
- <myCard :item="item" :btnList="btnList" :index="index+1" :columns="columns" @del="del(index)">
- <u--input placeholder="请输入" slot="name" v-model="item.name">
- </u--input>
- <u--textarea v-model="item.analysis" slot="analysis" placeholder="请输入内容" autoHeight></u--textarea>
- </myCard>
- </view>
- <view class="add" @click="add">
- <u-icon name="plus" color="#fff"></u-icon>
- </view>
- <view style="height: 84rpx;" v-if="isDrawer"></view>
- <view class="footerButton" v-if="isDrawer">
- <u-button type="primary" @click="save" text="保存"></u-button>
- </view>
- </view>
- </template>
- <script>
- import myCard from '../../components/myCard.vue'
- export default {
- components: {
- myCard
- },
- props: {
- isDrawer: {
- default: false
- }
- },
- data() {
- return {
- tableList: [],
- btnList: [{
- name: '删除',
- apiName: 'del',
- btnType: 'error ',
- type: '2',
- pageUrl: '',
- }],
- columns: [
- [{
- label: '竞争对手名称:',
- prop: 'name',
- slot: 'name',
- className: 'perce100',
- style:{
- marginBottom:'14rpx'
- }
- }],
- [{
- label: '竞品分析:',
- prop: 'analysis',
- slot: 'analysis',
- className: 'perce100',
- style:{
- marginBottom:'14rpx'
- }
- }],
- [{
- label: '操作:',
- prop: 'action',
- type: 'action',
- className: 'perce100',
- }],
- ]
- }
- },
- created() {
- },
- methods: {
- add(status) {
- this.tableList.push({
- name: '',
- analysis: ''
- })
- },
- init(list) {
- if (list) {
- this.tableList = JSON.parse(JSON.stringify(list))
- }
- },
- save() {
- uni.$emit('setBusinessOpportunity')
- },
- del(index) {
- this.tableList.splice(index, 1);
- },
- getValue() {
- return this.tableList
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .add {
- width: 96rpx;
- height: 96rpx;
- border-radius: 48rpx;
- background: #3c9cff;
- position: fixed;
- bottom: 100rpx;
- right: 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 99;
- }
- .footerButton {
- width: 100%;
- height: 84rpx;
- display: flex;
- position: fixed;
- bottom: 0;
- z-index: 10;
- /deep/.u-button {
- height: 100%;
- }
- >view {
- flex: 1;
- }
- }
- .item {
- display: flex;
- flex-direction: column;
- padding: 16rpx;
- >view {
- padding-top: 14rpx;
- }
- .item_title {
- font-size: 32rpx;
- font-weight: 800;
- }
- .item_list {
- display: flex;
- align-items: center;
- text {
- font-size: 28rpx;
- }
- .lable {
- color: #626060;
- }
- .value {
- color: #333;
- margin-left: 12rpx;
- flex: 1
- }
- }
- }
- /deep/.u-swipe-action-item__right__button__wrapper {
- background-color: #f56c6c !important;
- }
- /deep/.u-input {
- padding: 0 !important;
- }
- /deep/uni-textarea {
- padding: 0 !important;
- }
- </style>
|