newProductTool.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <div class="brandListTool">
  3. <h3 class="toolTit">每日上新</h3>
  4. <div class="toolBox">
  5. <!-- <div class="itemBox" v-if="terminal !== 4">-->
  6. <!-- <label>标题</label>-->
  7. <!-- <el-input v-model="activeComponent.componentContent.title" placeholder="请输入内容"></el-input>-->
  8. <!-- </div>-->
  9. <div class="tool-select-product">
  10. <!-- <div class="title">-->
  11. <!-- <span>商品来源</span>-->
  12. <!-- </div>-->
  13. <div class="porListBox">
  14. <product-source-multiple :productData.sync='activeComponent.componentContent.productData' :type="activeComponent.type"></product-source-multiple>
  15. </div>
  16. </div>
  17. <div v-if="terminal == 4">
  18. <div class="styleSelectLine">
  19. <div class="blockTit">
  20. <span>排列样式</span>
  21. <span>{{activeComponent.componentContent.arrangeType}}</span>
  22. </div>
  23. <div class="selectCompose">
  24. <div class="composeList">
  25. <span class="item iconfont" :class="{active: activeComponent.componentContent.arrangeType === item.name}" @click="selectArrange(item)" v-for="(item) of arrangeList" :key="item.id" v-html="item.Icon"></span>
  26. </div>
  27. </div>
  28. </div>
  29. <div v-if="activeComponent.componentContent.arrangeType === '多行多列'">
  30. <div class="productTit">
  31. <span>展示排数</span>
  32. <span>{{activeComponent.componentContent.productRowNum}}</span>
  33. </div>
  34. <div class="itemBox">
  35. <div class="block">
  36. <el-slider :max="9" :min="1" v-model="activeComponent.componentContent.productRowNum"></el-slider>
  37. </div>
  38. </div>
  39. <div class="productTit">
  40. <span>每排商品数</span>
  41. <span>{{activeComponent.componentContent.productNum}}</span>
  42. </div>
  43. <div class="itemBox">
  44. <div class="block">
  45. <el-slider :max="5" :min="2" v-model="activeComponent.componentContent.productNum"></el-slider>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="itemChoice">
  51. <div class="Tit">查看更多</div>
  52. <div class="Info" v-text="activeComponent.componentContent.showMore ? '显示' : '隐藏'"></div>
  53. <div class="modifyBox">
  54. <el-checkbox v-model="activeComponent.componentContent.showMore"></el-checkbox>
  55. </div>
  56. </div>
  57. <!-- <div class="moreBox" v-show="activeComponent.componentContent.showMore">-->
  58. <!-- <div class="link">-->
  59. <!-- <tool-select-link :linkObj.sync='activeComponent.componentContent.linkObj' styleType="1"></tool-select-link>-->
  60. <!-- </div>-->
  61. <!-- </div>-->
  62. </div>
  63. <el-dialog
  64. title="提示"
  65. :visible.sync="dialogVisible"
  66. width="30%"
  67. :before-close="deleteItem">
  68. <span>点击确定删除此项</span>
  69. <span slot="footer" class="dialog-footer">
  70. <el-button @click="dialogVisible = false">取 消</el-button>
  71. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  72. </span>
  73. </el-dialog>
  74. </div>
  75. </template>
  76. <script>
  77. import Draggable from 'vuedraggable'
  78. import {toolMixin} from '@@/config/mixin'
  79. import { mapGetters } from 'vuex'
  80. import ToolSelect from '../toolModule/tool-select'
  81. import ToolSingleImg from '../toolModule/tool-single-img'
  82. import ToolSelectLink from '../toolModule/tool-select-link'
  83. import ToolProductSource from '../toolModule/tool-product-source'
  84. import ProductSourceMultiple from '@@/components/toolBar/toolModule/product-source-multiple'
  85. export default {
  86. mixins: [toolMixin],
  87. name: 'productListTool',
  88. components: {
  89. ProductSourceMultiple,
  90. ToolProductSource,
  91. ToolSelectLink,
  92. ToolSingleImg,
  93. ToolSelect,
  94. Draggable
  95. },
  96. data () {
  97. return {
  98. title: '', // 标题内容
  99. textInfo: '', // 文本
  100. imgTextData: [
  101. {
  102. title: '',
  103. isShow: true,
  104. imgData: '',
  105. describe: '',
  106. url: ''
  107. }
  108. ],
  109. alignList: [
  110. {
  111. id: 1,
  112. label: '居左',
  113. value: 'left'
  114. },
  115. {
  116. id: 2,
  117. label: '居中',
  118. value: 'center'
  119. }
  120. ],
  121. textAlign: 'left',
  122. imgCurrent: null,
  123. dialogVisible: false,
  124. currentCategory: null,
  125. // categoryName: '', // 类别名称
  126. productList: [], // 产品列表
  127. productNum: 2, // 商品展示数量
  128. labelCurrent: null,
  129. arrangeList: [
  130. // {
  131. // id: 1,
  132. // type: 'L1',
  133. // name: '一行一个',
  134. // Icon: '&#xe603'
  135. // },
  136. {
  137. id: 2,
  138. type: 'L2',
  139. name: '多行多列',
  140. Icon: '&#xe625'
  141. },
  142. {
  143. id: 3,
  144. type: 'L3',
  145. name: '横向滑动',
  146. Icon: '&#xe624;'
  147. }
  148. ]
  149. }
  150. },
  151. computed: {
  152. ...mapGetters([
  153. 'terminal'
  154. ])
  155. },
  156. methods: {
  157. openAddImg (item, index) {
  158. if (this.imgCurrent === index) {
  159. this.imgCurrent = null
  160. return false
  161. }
  162. this.imgCurrent = index
  163. },
  164. // 添加图文
  165. addImgText () {
  166. this.activeComponent.componentContent.imgTextData.push({
  167. title: '',
  168. isShow: true,
  169. imgData: '',
  170. url: ''
  171. })
  172. },
  173. // 删除内容
  174. deleteItem (item, index) {
  175. this.$confirm('确定删除此项?')
  176. .then(_ => {
  177. this.activeComponent.componentContent.imgTextData.splice(index, 1)
  178. })
  179. .catch(_ => {})
  180. },
  181. handleAvatarSuccess (res, file) {
  182. this.imageUrl = URL.createObjectURL(file.raw)
  183. },
  184. // 标签手风琴
  185. openAddLabel (item, index) {
  186. if (this.labelCurrent === index) {
  187. this.labelCurrent = null
  188. return false
  189. }
  190. this.labelCurrent = index
  191. },
  192. // 添加标签
  193. addLabel () {
  194. this.activeComponent.componentContent.labelList.push({
  195. name: '',
  196. url: ''
  197. })
  198. },
  199. // 删除标签
  200. deleteLabelItem (item, index) {
  201. this.$confirm('确定删除此项?')
  202. .then(_ => {
  203. this.activeComponent.componentContent.labelList.splice(index, 1)
  204. })
  205. .catch(_ => {})
  206. },
  207. // 布局选择
  208. selectArrange (item) {
  209. this.activeComponent.componentContent.arrangeType = item.name
  210. }
  211. }
  212. }
  213. </script>
  214. <style lang="scss" scoped>
  215. .brandListTool {
  216. padding: 20px 20px 0px 20px;
  217. h3 {
  218. font-size: 18px;
  219. font-weight: 500;
  220. height: 35px;
  221. line-height: 35px;
  222. color: #333333;
  223. margin-bottom: 20px;
  224. }
  225. .toolBox {
  226. .tool-select-product{
  227. .title{
  228. margin-bottom: 10px;
  229. }
  230. }
  231. padding-bottom: 10px;
  232. .itemChoice {
  233. font-size: 14px;
  234. display: flex;
  235. margin: 20px 0;
  236. align-items: center;
  237. .Tit {
  238. color: #888888;
  239. margin-right: 10px;
  240. width: 70px;
  241. }
  242. .Info {
  243. color: #222222;
  244. }
  245. .modifyBox {
  246. text-align: right;
  247. margin-left: auto;
  248. span {
  249. height: 26px;
  250. line-height: 26px;
  251. float: left;
  252. display: block;
  253. text-align: center;
  254. cursor: pointer;
  255. width: 30px;
  256. border: 1px solid #E8EAEC;
  257. }
  258. .textActive {
  259. border: 1px solid $mainColor;
  260. color: $mainColor;
  261. }
  262. .colorBox {
  263. display: flex;
  264. align-items: center;
  265. justify-content: flex-end;
  266. span {
  267. margin-right: 10px;
  268. cursor: pointer;
  269. border: none;
  270. color: $mainColor;
  271. }
  272. }
  273. }
  274. .fontSize {
  275. span:nth-child(1) {
  276. font-size: 16px;
  277. }
  278. span:nth-child(2) {
  279. font-size: 14px;
  280. }
  281. span:nth-child(3) {
  282. font-size: 12px;
  283. }
  284. }
  285. }
  286. .moreBox{
  287. border: 1px solid #E8EAEC;
  288. border-radius: 4px;
  289. padding:20px 10px;
  290. .radio{
  291. margin-bottom: 20px;
  292. }
  293. .el-radio{
  294. margin-right: 10px;
  295. }
  296. .link{
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. }
  301. }
  302. .itemBox {
  303. label {
  304. font-size: 14px;
  305. color: #666666;
  306. height: 40px;
  307. line-height: 40px;
  308. }
  309. margin-bottom: 15px;
  310. }
  311. .textTit {
  312. height: 35px;
  313. line-height: 35px;
  314. font-size: 14px;
  315. color: #333333;
  316. display: flex;
  317. justify-content: space-between;
  318. span {
  319. font-weight: normal;
  320. font-size: 14px;
  321. color: #666666;
  322. }
  323. }
  324. .productTit {
  325. margin-top: 20px;
  326. color: #666666;
  327. height: 35px;
  328. display: flex;
  329. align-items: center;
  330. justify-content: space-between;
  331. span {
  332. font-size: 14px;
  333. color: #666666;
  334. }
  335. }
  336. }
  337. // ::v-deep .el-select {
  338. // width: 100%;
  339. //}
  340. .addImgBtn {
  341. border-radius: 4px;
  342. background: $mainColor;
  343. text-align: center;
  344. height: 36px;
  345. color: #ffffff;
  346. font-size: 14px;
  347. display: flex;
  348. align-items: center;
  349. justify-content: center;
  350. cursor: pointer;
  351. span {
  352. font-size: 20px;
  353. margin-right: 5px;
  354. }
  355. }
  356. .labelLisTit{
  357. display: flex;
  358. justify-content: space-between;
  359. margin-bottom: 10px;
  360. }
  361. .labelListWarp{
  362. padding-bottom: 20px;
  363. .imgListBox {
  364. margin-top: 20px;
  365. .item {
  366. border: 1px solid #E8EAEC;
  367. border-radius: 4px;
  368. margin-bottom: 10px;
  369. }
  370. .listItemBox {
  371. .addImgTit {
  372. padding: 10px;
  373. display: flex;
  374. justify-content: space-between;
  375. align-items: center;
  376. background: #F6F7F9;
  377. cursor: pointer;
  378. .titLeft {
  379. display: flex;
  380. align-items: center;
  381. span {
  382. color: #7D7E80;
  383. }
  384. span:nth-child(1) {
  385. font-size: 28px;
  386. }
  387. span:nth-child(2) {
  388. font-size: 25px;
  389. margin: 0 6px;
  390. }
  391. span:nth-child(3) {
  392. font-size: 14px;
  393. }
  394. }
  395. .titRight {
  396. display: flex;
  397. align-items: center;
  398. span:nth-child(1) {
  399. width: 40px;
  400. text-align: center;
  401. display: block;
  402. height: 30px;
  403. line-height: 30px;
  404. }
  405. }
  406. }
  407. .addLabelBox{
  408. padding:0 10px 10px;
  409. .itemBox{
  410. margin-bottom: 20px;
  411. label{
  412. font-size: 14px;
  413. color: #666666;
  414. height: 40px;
  415. line-height: 40px;
  416. }
  417. }
  418. ::v-deep .module-box{
  419. margin-bottom: 10px;
  420. }
  421. }
  422. .deleteItem {
  423. padding: 10px;
  424. display: flex;
  425. align-items: center;
  426. justify-content: center;
  427. background: #F6F7F9;
  428. cursor: pointer;
  429. color: $mainColor;
  430. font-size: 14px;
  431. span {
  432. font-size: 16px;
  433. margin-right: 5px;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. }
  440. .styleSelectLine{
  441. margin-top: 30px;
  442. .blockTit{
  443. span{
  444. margin-right: 16px;
  445. &:last-child{
  446. color: $mainColor;
  447. }
  448. }
  449. }
  450. .composeList{
  451. display: flex;
  452. flex-wrap: wrap;
  453. padding-top: 20px;
  454. .item{
  455. width: 50px;
  456. height: 30px;
  457. display: flex;
  458. align-items: center;
  459. justify-content: center;
  460. border: 1px solid #E8EAEC;
  461. color: #999999;
  462. font-size: 18px;
  463. text-align: center;
  464. cursor: pointer;
  465. &:hover,&.active{
  466. color: #FF7800;
  467. border: 1px solid #FF7800;
  468. }
  469. }
  470. }
  471. }
  472. </style>