多租户商城-商户端
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.

571 lines
14 KiB

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