多租户商城-商户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

505 lines
13 KiB

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