quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
<!--
        作者:luoyiming
        时间:2020-06-20
        描述:diy组件-参数设置-下线门店
    -->
  <div>
    <div class="common-form">
      <span>{{ curItem.name }}</span>
    </div>
    <el-form size="small" :model="curItem" label-width="100px">
      <!-- 商品来源 -->
      <el-form-item label="商品来源:">
        <el-radio-group v-model="curItem.params.source">
          <el-radio :label="'auto'">自动获取</el-radio>
          <el-radio :label="'choice'">手动选择</el-radio>
        </el-radio-group>
      </el-form-item>
      <!--手动选择-->
      <template v-if="curItem.params.source == 'choice'">
        <el-form-item label="门店列表:">
          <div class="choice-shop-list">
            <div :key="index" v-for="(shop, index) in curItem.data" class="item">
              <div class="delete-box"><i class="el-icon-error" @click="$parent.onEditorDeleleData(index, selectedIndex)"></i></div>
              <img v-img-url="shop.image" alt="" />
            </div>
            <div class="item plus-btn" @click.stop="$parent.onSelectProduct(curItem)">
              <i class="el-icon-plus"></i>
              <p>选择门店</p>
            </div>
          </div>
        </el-form-item>
      </template>
      <!-- 自动获取 -->
      <template v-show="curItem.params.source == 'auto'">
        <!-- 展示数量 -->
        <el-form-item label="展示数量:"><el-input style="width: auto;" v-model="curItem.params.auto.showNum" class="w-auto"></el-input></el-form-item>
      </template>
      <!-- 背景颜色 -->
      <el-form-item label="背景颜色:">
          <div class="d-s-c">
              <el-color-picker v-model="curItem.style.background"></el-color-picker>
              <el-button type="button" style="margin-left: 10px;"
                  @click.stop="$parent.onEditorResetColor(curItem.style, 'background', '#ffffff')">重置
              </el-button>
          </div>
      </el-form-item>
    </el-form>
  </div>
</template>
 
<script>
export default {
  data() {
    return {};
  },
  props: ['curItem', 'selectedIndex', 'opts'],
  methods: {}
};
</script>
 
<style>
.choice-shop-list {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.choice-shop-list .item {
  position: relative;
  width: 80px;
  height: 80px;
  margin-right: 10px;
  border: 1px solid #dddddd;
}
.choice-shop-list .item .delete-box {
  position: absolute;
  width: 20px;
  height: 20px;
  top: -10px;
  right: -10px;
  font-size: 20px;
  cursor: pointer;
  color: #999999;
}
.choice-shop-list .item .delete-box:hover {
  color: rgb(255, 51, 0);
}
.choice-shop-list .item.plus-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.choice-shop-list .item.plus-btn > i {
  font-size: 30px;
  color: #cccccc;
}
.choice-shop-list img {
  width: 100%;
  height: 100%;
}
</style>