priceTool.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <div class="brandListTool">
  3. <h3 class="toolTit">定价捆绑</h3>
  4. <!-- <div class="toolBox" v-if="terminal !== 4">-->
  5. <!-- <div class="itemBox">-->
  6. <!-- <label>标题</label>-->
  7. <!-- <el-input v-model="activeComponent.componentContent.title" placeholder="请输入内容"></el-input>-->
  8. <!-- </div>-->
  9. <!-- </div>-->
  10. <div class="porListBox">
  11. <div class="addProduct">
  12. <div v-if="!activeComponent.componentContent.activityName" class="addProBtn addImgBtn" @click="selectActivity"><span class="iconfont">&#xe685;</span>选择活动</div>
  13. <div v-else class="categoryName">
  14. <span>{{activeComponent.componentContent.activityName}}</span>
  15. <div class="operation">
  16. <span class="iconfont" @click="replaceActivity">&#xe66c;</span>
  17. <span class="iconfont" @click="deleteActivity">&#xe633;</span>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <div v-if="terminal == 4">
  23. <div class="styleSelectLine">
  24. <div class="blockTit">
  25. <span>排列样式</span>
  26. <span>{{activeComponent.componentContent.arrangeType}}</span>
  27. </div>
  28. <div class="selectCompose">
  29. <div class="composeList">
  30. <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>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="toolBox" v-if="activeComponent.componentContent.arrangeType === '多行多列'">
  35. <div class="productTit">
  36. <span>展示排数</span>
  37. <span>{{activeComponent.componentContent.productRowNum}}</span>
  38. </div>
  39. <div class="itemBox">
  40. <div class="block">
  41. <el-slider :max="9" :min="1" v-model="activeComponent.componentContent.productRowNum"></el-slider>
  42. </div>
  43. </div>
  44. <div class="productTit">
  45. <span>每排商品数</span>
  46. <span>{{activeComponent.componentContent.productNum}}</span>
  47. </div>
  48. <div class="itemBox">
  49. <div class="block">
  50. <el-slider :max="5" :min="2" v-model="activeComponent.componentContent.productNum"></el-slider>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="itemChoice">
  56. <div class="Tit">查看更多</div>
  57. <div class="Info" v-text="activeComponent.componentContent.showMore ? '显示' : '隐藏'"></div>
  58. <div class="modifyBox">
  59. <el-checkbox v-model="activeComponent.componentContent.showMore"></el-checkbox>
  60. </div>
  61. </div>
  62. <div class="moreBox" v-show="activeComponent.componentContent.showMore">
  63. <div class="link">
  64. <tool-select-link :linkObj.sync='activeComponent.componentContent.linkObj' styleType="1"></tool-select-link>
  65. </div>
  66. </div>
  67. <el-dialog title="选择活动" :visible.sync="showSkillActivity" width="900px">
  68. <el-table :data='skillActivity' style="width: 100%" @row-click="rowClick" highlight-current-row>
  69. <el-table-column label width="35">
  70. <template slot-scope="scope">
  71. <el-radio :label="scope.row.priceId" v-model="radioId"/>
  72. </template>
  73. </el-table-column>
  74. <el-table-column
  75. prop="composeName"
  76. label="标题">
  77. </el-table-column>
  78. <el-table-column
  79. :formatter="getDate"
  80. width="400"
  81. label="活动时间">
  82. </el-table-column>
  83. <el-table-column
  84. prop="state"
  85. label="状态">
  86. <template slot-scope="scope">
  87. 进行中
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <span slot="footer" class="dialog-footer">
  92. <el-button @click="cancelSkill">取 消</el-button>
  93. <el-button type="primary" @click="confirmActivity">确 定</el-button>
  94. </span>
  95. </el-dialog>
  96. </div>
  97. </template>
  98. <script>
  99. import Cookies from 'js-cookie'
  100. import Draggable from 'vuedraggable'
  101. import api from '@@/components/canvasShow/config/api'
  102. import {toolMixin} from '@@/config/mixin'
  103. import {sendReqMixin} from '@@/components/canvasShow/config/mixin'
  104. import { mapGetters, mapMutations } from 'vuex'
  105. import ToolSelect from '../toolModule/tool-select'
  106. import ToolSingleImg from '../toolModule/tool-single-img'
  107. import ToolSelectLink from '../toolModule/tool-select-link'
  108. export default {
  109. mixins: [toolMixin, sendReqMixin],
  110. name: 'groupTool',
  111. components: {
  112. ToolSelectLink,
  113. ToolSingleImg,
  114. ToolSelect,
  115. Draggable
  116. },
  117. data () {
  118. return {
  119. radioId: '',
  120. skillActivity: [],
  121. selectSkill: {},
  122. showSkillActivity: false,
  123. title: '', // 标题内容
  124. textInfo: '', // 文本
  125. imgTextData: [
  126. {
  127. title: '',
  128. isShow: true,
  129. imgData: '',
  130. describe: '',
  131. url: ''
  132. }
  133. ],
  134. alignList: [
  135. {
  136. id: 1,
  137. label: '居左',
  138. value: 'left'
  139. },
  140. {
  141. id: 2,
  142. label: '居中',
  143. value: 'center'
  144. }
  145. ],
  146. categoryList: [],
  147. textAlign: 'left',
  148. imgCurrent: null,
  149. dialogVisible: false,
  150. dialogCategory: false,
  151. currentCategory: null,
  152. // categoryName: '', // 类别名称
  153. productList: [], // 产品列表
  154. productNum: 2, // 商品展示数量
  155. labelCurrent: null,
  156. arrangeList: [
  157. // {
  158. // id: 1,
  159. // type: 'L1',
  160. // name: '一行一个',
  161. // Icon: '&#xe603'
  162. // },
  163. {
  164. id: 2,
  165. type: 'L2',
  166. name: '多行多列',
  167. Icon: '&#xe625'
  168. },
  169. {
  170. id: 3,
  171. type: 'L3',
  172. name: '横向滑动',
  173. Icon: '&#xe624;'
  174. }
  175. ]
  176. }
  177. },
  178. computed: {
  179. ...mapGetters([
  180. 'terminal'
  181. ])
  182. },
  183. methods: {
  184. ...mapMutations({
  185. setPriceNum: 'SET_PRICENUM'
  186. }),
  187. // 时间变换
  188. getDate(row) {
  189. return `${row.startTime}至${row.endTime}`
  190. },
  191. // 点击选择活动
  192. selectActivity() {
  193. this.getActivity()
  194. this.showSkillActivity = true
  195. this.radioId = this.activeComponent.componentContent.shopGroupWorkId
  196. },
  197. // 获取活动数据
  198. getActivity() {
  199. const _ = this
  200. const params = {
  201. method: 'GET',
  202. url: `${api.getPrices}?shopId=${Cookies.get('shopID')}`,
  203. }
  204. this.sendReq(params, (res) => {
  205. _.skillActivity = res.data
  206. })
  207. },
  208. // 行点击
  209. rowClick(row) {
  210. this.selectSkill = row;
  211. this.radioId=row.shopGroupWorkId;
  212. },
  213. // 确认活动选择
  214. confirmActivity() {
  215. this.activeComponent.componentContent.priceId = this.selectSkill.priceId
  216. this.activeComponent.componentContent.activityName = this.selectSkill.composeName
  217. this.showSkillActivity = false
  218. this.setPriceNum()
  219. },
  220. // 取消活动选择
  221. cancelSkill() {
  222. this.showSkillActivity = false;
  223. this.radioId = ''
  224. },
  225. // 替换活动
  226. replaceActivity () {
  227. this.showSkillActivity = true
  228. this.getActivity()
  229. },
  230. // 删除已选活动
  231. deleteActivity () {
  232. this.activeComponent.componentContent.activityName = ''
  233. this.activeComponent.componentContent.priceId = ''
  234. this.$forceUpdate()
  235. this.setPriceNum()
  236. },
  237. // 布局选择
  238. selectArrange (item) {
  239. this.activeComponent.componentContent.arrangeType = item.name
  240. }
  241. }
  242. }
  243. </script>
  244. <style lang="scss" scoped>
  245. .config-content {
  246. .item {
  247. padding: 12px 0;
  248. border-bottom: 1px #ddd solid;
  249. &:nth-child(1) {
  250. border-top: 1px #ddd solid;
  251. }
  252. }
  253. .label-text {
  254. color: #666;
  255. span {
  256. color: hsl(357, 97%, 49%);
  257. font-size: 20px;
  258. vertical-align: middle;
  259. display: inline-block;
  260. margin-right: 5px;
  261. }
  262. }
  263. .add {
  264. margin-top: 10px;
  265. width: 50px;
  266. height: 50px;
  267. text-align: center;
  268. line-height: 50px;
  269. border:1px #ddd solid;
  270. box-shadow: 0 0 10px #ddd;
  271. .el-icon-plus {
  272. color: blue !important;
  273. }
  274. &:hover {
  275. cursor: pointer;
  276. }
  277. }
  278. }
  279. .brandListTool {
  280. padding: 20px 20px 0px 20px;
  281. h3 {
  282. font-size: 18px;
  283. font-weight: 500;
  284. height: 35px;
  285. line-height: 35px;
  286. color: #333333;
  287. margin-bottom: 20px;
  288. }
  289. .toolBox {
  290. padding-bottom: 10px;
  291. .itemBox {
  292. label {
  293. font-size: 14px;
  294. color: #666666;
  295. height: 40px;
  296. line-height: 40px;
  297. }
  298. margin-bottom: 15px;
  299. }
  300. .textTit {
  301. height: 35px;
  302. line-height: 35px;
  303. font-size: 14px;
  304. color: #333333;
  305. display: flex;
  306. justify-content: space-between;
  307. span {
  308. font-weight: normal;
  309. font-size: 14px;
  310. color: #666666;
  311. }
  312. }
  313. .productTit {
  314. margin-top: 20px;
  315. color: #666666;
  316. height: 35px;
  317. display: flex;
  318. align-items: center;
  319. justify-content: space-between;
  320. span {
  321. font-size: 14px;
  322. color: #666666;
  323. }
  324. }
  325. }
  326. .itemChoice {
  327. font-size: 14px;
  328. display: flex;
  329. margin: 20px 0;
  330. align-items: center;
  331. .Tit {
  332. color: #888888;
  333. margin-right: 10px;
  334. width: 70px;
  335. }
  336. .Info {
  337. color: #222222;
  338. }
  339. .modifyBox {
  340. text-align: right;
  341. margin-left: auto;
  342. span {
  343. height: 26px;
  344. line-height: 26px;
  345. float: left;
  346. display: block;
  347. text-align: center;
  348. cursor: pointer;
  349. width: 30px;
  350. border: 1px solid #E8EAEC;
  351. }
  352. .textActive {
  353. border: 1px solid $mainColor;
  354. color: $mainColor;
  355. }
  356. .colorBox {
  357. display: flex;
  358. align-items: center;
  359. justify-content: flex-end;
  360. span {
  361. margin-right: 10px;
  362. cursor: pointer;
  363. border: none;
  364. color: $mainColor;
  365. }
  366. }
  367. }
  368. .fontSize {
  369. span:nth-child(1) {
  370. font-size: 16px;
  371. }
  372. span:nth-child(2) {
  373. font-size: 14px;
  374. }
  375. span:nth-child(3) {
  376. font-size: 12px;
  377. }
  378. }
  379. }
  380. .moreBox{
  381. border: 1px solid #E8EAEC;
  382. border-radius: 4px;
  383. padding:20px 10px;
  384. .radio{
  385. margin-bottom: 20px;
  386. }
  387. .el-radio{
  388. margin-right: 10px;
  389. }
  390. .link{
  391. display: flex;
  392. justify-content: space-between;
  393. align-items: center;
  394. }
  395. }
  396. .addImgBtn {
  397. border-radius: 4px;
  398. background: $mainColor;
  399. text-align: center;
  400. height: 36px;
  401. color: #ffffff;
  402. font-size: 14px;
  403. display: flex;
  404. align-items: center;
  405. justify-content: center;
  406. cursor: pointer;
  407. span {
  408. font-size: 20px;
  409. margin-right: 5px;
  410. }
  411. }
  412. .labelLisTit{
  413. display: flex;
  414. justify-content: space-between;
  415. margin-bottom: 10px;
  416. }
  417. .labelListWarp{
  418. padding-bottom: 20px;
  419. .imgListBox {
  420. margin-top: 20px;
  421. .item {
  422. border: 1px solid #E8EAEC;
  423. border-radius: 4px;
  424. margin-bottom: 10px;
  425. }
  426. .listItemBox {
  427. .addImgTit {
  428. padding: 10px;
  429. display: flex;
  430. justify-content: space-between;
  431. align-items: center;
  432. background: #F6F7F9;
  433. cursor: pointer;
  434. .titLeft {
  435. display: flex;
  436. align-items: center;
  437. span {
  438. color: #7D7E80;
  439. }
  440. span:nth-child(1) {
  441. font-size: 28px;
  442. }
  443. span:nth-child(2) {
  444. font-size: 25px;
  445. margin: 0 6px;
  446. }
  447. span:nth-child(3) {
  448. font-size: 14px;
  449. }
  450. }
  451. .titRight {
  452. display: flex;
  453. align-items: center;
  454. span:nth-child(1) {
  455. width: 40px;
  456. text-align: center;
  457. display: block;
  458. height: 30px;
  459. line-height: 30px;
  460. }
  461. }
  462. }
  463. .addLabelBox{
  464. padding:0 10px 10px;
  465. .itemBox{
  466. margin-bottom: 20px;
  467. label{
  468. font-size: 14px;
  469. color: #666666;
  470. height: 40px;
  471. line-height: 40px;
  472. }
  473. }
  474. ::v-deep .module-box{
  475. margin-bottom: 10px;
  476. }
  477. }
  478. .deleteItem {
  479. padding: 10px;
  480. display: flex;
  481. align-items: center;
  482. justify-content: center;
  483. background: #F6F7F9;
  484. cursor: pointer;
  485. color: $mainColor;
  486. font-size: 14px;
  487. span {
  488. font-size: 16px;
  489. margin-right: 5px;
  490. }
  491. }
  492. }
  493. }
  494. }
  495. }
  496. .styleSelectLine{
  497. margin-top: 30px;
  498. .blockTit{
  499. span{
  500. margin-right: 16px;
  501. &:last-child{
  502. color: $mainColor;
  503. }
  504. }
  505. }
  506. .composeList{
  507. display: flex;
  508. flex-wrap: wrap;
  509. padding-top: 20px;
  510. .item{
  511. width: 50px;
  512. height: 30px;
  513. display: flex;
  514. align-items: center;
  515. justify-content: center;
  516. border: 1px solid #E8EAEC;
  517. color: #999999;
  518. font-size: 18px;
  519. text-align: center;
  520. cursor: pointer;
  521. &:hover,&.active{
  522. color: #FF7800;
  523. border: 1px solid #FF7800;
  524. }
  525. }
  526. }
  527. }
  528. .porListBox {
  529. margin-top: 10px;
  530. padding: 10px;
  531. background: #F0F3F4;
  532. .addProduct {
  533. .categoryName {
  534. height: 35px;
  535. display: flex;
  536. align-items: center;
  537. background: #e9e9e9;
  538. border-radius: 4px;
  539. padding: 0 10px;
  540. justify-content: space-between;
  541. span {
  542. color: #333333;
  543. }
  544. span {
  545. color: #333333;
  546. }
  547. .operation {
  548. display: flex;
  549. span {
  550. width: 35px;
  551. display: block;
  552. height: 35px;
  553. line-height: 35px;
  554. text-align: center;
  555. cursor: pointer;
  556. }
  557. }
  558. }
  559. .addProBtn {}
  560. }
  561. }
  562. </style>