vipTool.vue 11 KB

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