homeGoodsSet.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. <template>
  2. <div class="homeGoodsSet app-container">
  3. <div class="tab-list">
  4. <div class="tab" :class="[query.regionCode == item.regionCode?'active':'']" v-for="item in tableData2" :key="item.regionCode" @click="handleRegionCode(item.regionCode)">{{item.region}}</div>
  5. </div>
  6. <div class="tab-list">
  7. <div class="tab" :class="[query.productType == ''?'active':'']" @click="handleTab('')">全部</div>
  8. <div class="tab" :class="[query.productType == item.value?'active':'']" v-for="item in tabList" :key="item.value" @click="handleTab(item.value)">{{item.label}}</div>
  9. </div>
  10. <div class="search">
  11. <div>
  12. <el-input
  13. v-model="query.title"
  14. size="small"
  15. placeholder="请输入产品名称"
  16. clearable
  17. class="item-width-200 "
  18. ></el-input>
  19. <el-button
  20. class="ml10"
  21. type="primary"
  22. size="small"
  23. icon="el-icon-search"
  24. @click="handleSearch"
  25. >
  26. 搜索
  27. </el-button>
  28. </div>
  29. <!-- <el-button class="add-btn" type="primary" size="small" @click="handleAdd"
  30. >添加</el-button
  31. > -->
  32. </div>
  33. <div class="search">
  34. <div>
  35. <el-button class="add-btn" type="primary" size="small" :disabled="!pids.length" v-if="btnAuthObj.blacklist" @click="handleBatch(true)"
  36. >批量加入黑名单</el-button
  37. >
  38. </div>
  39. <div>
  40. <el-button class="add-btn" size="small" v-if="btnAuthObj.setProduct" @click="handleSetting"
  41. >产品配置</el-button
  42. >
  43. <el-button class="add-btn" size="small" @click="handleList"
  44. >黑名单</el-button
  45. >
  46. </div>
  47. </div>
  48. <el-table
  49. @selection-change="handleSelectionChange"
  50. :data="tableData"
  51. tooltip-effect="dark"
  52. border
  53. v-loading="loading"
  54. style="width: 100%"
  55. >
  56. <el-table-column
  57. align="center"
  58. type="selection"
  59. width="55">
  60. </el-table-column>
  61. <el-table-column
  62. width="250px"
  63. align="center"
  64. label="产品信息"
  65. prop="产品信息"
  66. show-overflow-tooltip
  67. >
  68. <template slot-scope="scope">
  69. <div class="info">
  70. <el-image
  71. v-if="scope.row.cover&&scope.row.cover.length"
  72. :src="scope.row.cover[0]"
  73. class="small-img"
  74. style="width: 40px; height: 40px;"
  75. fit="cover"
  76. >
  77. </el-image>
  78. <span class="ml10">{{scope.row.title}}</span>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column
  83. align="center"
  84. label="价格"
  85. prop="salePrice"
  86. show-overflow-tooltip
  87. >
  88. </el-table-column>
  89. <el-table-column
  90. align="center"
  91. label="销量"
  92. prop="salesCount"
  93. show-overflow-tooltip
  94. >
  95. </el-table-column>
  96. <el-table-column
  97. align="center"
  98. label="区域"
  99. prop="regionCode"
  100. show-overflow-tooltip
  101. >
  102. </el-table-column>
  103. <el-table-column
  104. align="center"
  105. label="产品类型"
  106. prop="productType"
  107. show-overflow-tooltip
  108. >
  109. <template slot-scope="scope">
  110. {{productType[scope.row.productType]||'暂无分类'}}
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. align="center"
  115. label="排序"
  116. prop="top"
  117. show-overflow-tooltip
  118. >
  119. <template slot-scope="scope">
  120. <span>{{scope.row.top}}</span> <i class="el-icon-edit" @click="handleTop(scope.row)"></i>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="center" label="操作">
  124. <template slot-scope="scope">
  125. <el-button type="text" size="small" v-if="btnAuthObj.blacklist" @click="handleDel(scope.row,true)"
  126. >加入黑名单</el-button
  127. >
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <div class="page-box">
  132. <el-pagination
  133. @size-change="handleSizeChange"
  134. @current-change="handleCurrentChange"
  135. background
  136. :current-page="query.page"
  137. :page-sizes="[10, 20, 30, 40]"
  138. :page-size="query.size"
  139. layout="total, sizes, prev, pager, next, jumper"
  140. :total="total"
  141. >
  142. </el-pagination>
  143. </div>
  144. <el-dialog title="黑名单" width="80%" :visible.sync="dialogFormVisible3">
  145. <div class="search">
  146. <el-button class="add-btn" type="primary" size="small" :disabled="!pids1.length" @click="handleBatch(false)"
  147. >批量移除黑名单</el-button>
  148. </div>
  149. <el-table
  150. :data="tableData1"
  151. tooltip-effect="dark"
  152. border
  153. v-loading="loading"
  154. style="width: 100%"
  155. @selection-change="handleSelectionChange1"
  156. >
  157. <el-table-column
  158. align="center"
  159. type="selection"
  160. width="55">
  161. </el-table-column>
  162. <el-table-column
  163. align="center"
  164. label="产品信息"
  165. prop="产品信息"
  166. show-overflow-tooltip
  167. >
  168. <template slot-scope="scope">
  169. <div class="info">
  170. <el-image
  171. v-if="scope.row.cover&&scope.row.cover.length"
  172. :src="scope.row.cover[0]"
  173. class="small-img"
  174. style="width: 40px; height: 40px;"
  175. fit="cover"
  176. >
  177. </el-image>
  178. <span class="ml10">{{scope.row.title}}</span>
  179. </div>
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. align="center"
  184. label="价格"
  185. prop="salePrice"
  186. show-overflow-tooltip
  187. >
  188. </el-table-column>
  189. <el-table-column
  190. align="center"
  191. label="销量"
  192. prop="salesCount"
  193. show-overflow-tooltip
  194. >
  195. </el-table-column>
  196. <el-table-column
  197. align="center"
  198. label="区域"
  199. prop="regionCode"
  200. show-overflow-tooltip
  201. >
  202. </el-table-column>
  203. <el-table-column
  204. align="center"
  205. label="产品类型"
  206. prop="productType"
  207. show-overflow-tooltip
  208. >
  209. <template slot-scope="scope">
  210. {{productType[scope.row.productType]||'暂无分类'}}
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="center"
  215. label="排序"
  216. prop="top"
  217. show-overflow-tooltip
  218. >
  219. <template slot-scope="scope">
  220. <span>{{scope.row.top}}</span> <i class="el-icon-edit" @click="handleTop(scope.row)"></i>
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="center" label="操作">
  224. <template slot-scope="scope">
  225. <el-button type="text" size="small" v-if="btnAuthObj.blacklist" @click="handleDel(scope.row,false)"
  226. >移除黑名单</el-button
  227. >
  228. </template>
  229. </el-table-column>
  230. </el-table>
  231. <div class="page-box">
  232. <el-pagination
  233. @size-change="handleSizeChange1"
  234. @current-change="handleCurrentChange1"
  235. background
  236. :current-page="query1.page"
  237. :page-sizes="[10, 20, 30, 40]"
  238. :page-size="query1.size"
  239. layout="total, sizes, prev, pager, next, jumper"
  240. :total="total1"
  241. >
  242. </el-pagination>
  243. </div>
  244. </el-dialog>
  245. <el-dialog title="产品配置" width="750px" :visible.sync="dialogFormVisible1">
  246. <el-table
  247. :data="tableData2"
  248. tooltip-effect="dark"
  249. border
  250. v-loading="loading1"
  251. style="width: 100%"
  252. >
  253. <el-table-column
  254. align="center"
  255. label="行政区域"
  256. prop="region"
  257. show-overflow-tooltip
  258. width="150px"
  259. >
  260. </el-table-column>
  261. <el-table-column
  262. align="center"
  263. label="产品类型"
  264. prop="productType"
  265. show-overflow-tooltip
  266. >
  267. <template slot-scope="scope">
  268. {{ formatType(scope.row.types)}}
  269. </template>
  270. </el-table-column>
  271. <el-table-column align="center" label="操作" width="100px">
  272. <template slot-scope="scope">
  273. <el-button type="text" size="small" @click="handleEdit(scope.row)"
  274. > 编辑</el-button
  275. >
  276. <el-button type="text" size="small" @click="handleRemove(scope.row.regionCode)"
  277. >删除</el-button
  278. >
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. <el-button type="text" size="small" @click="handleAdd">+添加</el-button>
  283. </el-dialog>
  284. <el-dialog :title="title" width="550px" :visible.sync="dialogFormVisible4">
  285. <el-form label-width="130px" :model="setQuery1"
  286. ref="setQuery1"
  287. :rules="rules1">
  288. <el-form-item label="区域" prop="regionCode">
  289. <el-select v-model="setQuery1.regionCode" filterable class="item-width-300" placeholder="请选择">
  290. <el-option
  291. v-for="item in cityOptions"
  292. :key="item.value"
  293. :label="item.label"
  294. :value="item.value">
  295. </el-option>
  296. </el-select>
  297. </el-form-item>
  298. <el-form-item label="产品类型" prop="types">
  299. <el-select v-model="setQuery1.types" filterable multiple class="item-width-300" placeholder="请选择">
  300. <el-option
  301. v-for="item in options"
  302. :key="item.value"
  303. :label="item.label"
  304. :value="item.value">
  305. </el-option>
  306. </el-select>
  307. </el-form-item>
  308. </el-form>
  309. <div slot="footer" class="dialog-footer">
  310. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  311. <el-button type="primary" :loading="btnLoading1" @click="save">确 定</el-button>
  312. </div>
  313. </el-dialog>
  314. <el-dialog title="排序" width="550px" :visible.sync="dialogFormVisible2">
  315. <el-form label-width="130px" :model="topFrom"
  316. ref="topFrom"
  317. :rules="rules2">
  318. <el-form-item label="排序" prop="top">
  319. <el-input
  320. v-model.number="topFrom.top"
  321. class="item-width-300"
  322. ></el-input>
  323. </el-form-item>
  324. </el-form>
  325. <div slot="footer" class="dialog-footer">
  326. <el-button @click="dialogFormVisible2 = false">取 消</el-button>
  327. <el-button type="primary" :loading="btnLoading2" @click="save2">确 定</el-button>
  328. </div>
  329. </el-dialog>
  330. </div>
  331. </template>
  332. <script>
  333. import { debounce } from "@/utils/index";
  334. import { homeGoodsList,setHidden,listShowTypes,listAllTypes,setShowTypes,setTop,listHidden,removeType,listSetTypesRegions } from "@/api/goods";
  335. import { getCityList } from "@/api/common";
  336. export default {
  337. name: "marketing",
  338. data() {
  339. return {
  340. regionOptions:[],
  341. cityOptions:[],
  342. date:'',
  343. title:'',
  344. tableData: [],
  345. tableData1: [],
  346. tableData2: [],
  347. loading: false,
  348. loading1: false,
  349. btnLoading: false,
  350. dialogFormVisible: false,
  351. btnLoading1: false,
  352. dialogFormVisible1: false,
  353. btnLoading2: false,
  354. dialogFormVisible2: false,
  355. dialogFormVisible3: false,
  356. dialogFormVisible4: false,
  357. query: {
  358. distance:100000000,
  359. latitude:30.57447,
  360. longitude:103.92377,
  361. regionCode:"",
  362. productType:'',
  363. title:'',
  364. page: 1,
  365. size: 10,
  366. },
  367. query1: {
  368. page: 1,
  369. size: 10,
  370. },
  371. total: 0,
  372. total1: 0,
  373. setQuery1:{
  374. "region": [
  375. "区域"
  376. ],
  377. "regionCode": [
  378. "区域编码"
  379. ],
  380. "types": [
  381. "显示产品类型"
  382. ]
  383. },
  384. options:[],
  385. setQuery:{
  386. "activityContent": "",
  387. "activityId": "",
  388. "activityMoney": 0,
  389. "endTime": "",
  390. "id": 0,
  391. "startTime": ""
  392. },
  393. topFrom:{
  394. pid:"",
  395. top:0,
  396. regionCode:''
  397. },
  398. rules:{
  399. activityId: [{ required: true, message: "请输入活动ID", trigger: "blur" }],
  400. activityMoney: [{ required: true, message: "请输入活动金额", trigger: "blur" }],
  401. startTime: [{ required: true, message: "请选择活动时间", trigger: "change" }],
  402. },
  403. rules1:{
  404. regionCode: [{ required: true, message: "请选择区域", trigger: "change" }],
  405. types: [{ type:'array',required: true, message: "请选择产品类型", trigger: "change" }],
  406. },
  407. rules2:{
  408. top: [{ required: true, message: "请输入排序", trigger: "blur" }],
  409. },
  410. productType:{
  411. 'Web'
  412. :'链接',
  413. 'Recharge'
  414. :'充值类',
  415. 'Scenic'
  416. :'景区',
  417. 'ScenicTicket'
  418. :'景区门票',
  419. 'StudyTour'
  420. :'研学旅游',
  421. 'Hotel'
  422. :'酒店',
  423. 'HotelRoom'
  424. :'酒店房型',
  425. 'Cinema'
  426. :'电影院',
  427. 'MovieTicket'
  428. :'电影票',
  429. 'Restaurant'
  430. :'餐厅',
  431. 'RestaurantFood'
  432. :'餐厅美食',
  433. 'CarMaintain'
  434. :'汽车保养门店',
  435. 'CarMaintainGoods'
  436. :'汽车保养商品',
  437. 'CarMaintainService'
  438. :'汽车保养服务',
  439. 'Shop'
  440. :'店铺',
  441. 'ShopGoods'
  442. :'店铺商品',
  443. 'ShopService'
  444. :'店铺服务',
  445. 'Coupon'
  446. :'优惠券',
  447. 'PetrolStation'
  448. :'加油站',
  449. },
  450. pids:[],//拉黑
  451. pids1:[],// 解除
  452. };
  453. },
  454. watch: {
  455. date(val){
  456. if(val){
  457. this.setQuery.startTime = val[0]
  458. this.setQuery.endTime = val[1]
  459. }else{
  460. this.setQuery.startTime = ''
  461. this.setQuery.endTime = ''
  462. }
  463. },
  464. },
  465. computed: {
  466. tabList() {
  467. let types = []
  468. this.tableData2.map(item => {
  469. if(item.regionCode == this.query.regionCode){
  470. types = item.types
  471. }
  472. })
  473. let list = types.map(item => {
  474. return {
  475. label:item.productTypeDesc,
  476. value:item.productType
  477. }
  478. })
  479. return list
  480. }
  481. },
  482. methods: {
  483. formatType(types){
  484. let str = ''
  485. types.map(item=>{
  486. str += this.productType[item.productType] + '、'
  487. })
  488. return str
  489. },
  490. handleSelectionChange(val){
  491. this.pids = val.map(item => {
  492. return { pid:item.pid,regionCode:item.regionCode}
  493. })
  494. },
  495. handleSelectionChange1(val){
  496. this.pids1 = val.map(item => {
  497. return { pid:item.pid,regionCode:item.regionCode}
  498. })
  499. },
  500. handleList(){
  501. this.dialogFormVisible3 = true
  502. this.query1.page = 1
  503. this.listHidden()
  504. },
  505. handleTab(val){
  506. this.query.productType = val
  507. this.handleSearch()
  508. },
  509. handleRegionCode(val){
  510. this.query.regionCode = val
  511. this.query.productType = ''
  512. this.handleSearch()
  513. },
  514. handleSetting(){
  515. this.dialogFormVisible1 = true
  516. },
  517. handleSearch(){
  518. this.query.page = 1;
  519. this.getList();
  520. },
  521. handleRemove(code){
  522. this.$confirm(`此操作将删除该数据, 是否继续?`, '提示', {
  523. confirmButtonText: '确定',
  524. cancelButtonText: '取消',
  525. type: 'warning'
  526. }).then(() => {
  527. removeType(code).then(res=>{
  528. if(res.state == 'Success'){
  529. this.$notify({
  530. title: '成功',
  531. message: '操作成功',
  532. type: 'success'
  533. });
  534. this.listShowTypes();
  535. this.handleSearch()
  536. }
  537. })
  538. })
  539. },
  540. handleEdit(row){
  541. this.title = '编辑'
  542. this.dialogFormVisible4 = true
  543. this.setQuery1 = {
  544. regionCode:row.regionCode,
  545. types:row.types.map(item=>item.productType)
  546. }
  547. },
  548. handleAdd() {
  549. this.title = '添加'
  550. this.setQuery1 = {
  551. regionCode:'',types:[]
  552. }
  553. this.dialogFormVisible4 = true
  554. },
  555. handleTop(row){
  556. this.topFrom.pid = row.pid
  557. this.dialogFormVisible2 = true
  558. this.topFrom.top = row.top
  559. this.topFrom.regionCode = row.regionCode
  560. },
  561. // 删除
  562. handleDel(item,hidden) {
  563. let str = ''
  564. if(hidden){
  565. str = '拉黑'
  566. }else{
  567. str = '取消拉黑'
  568. }
  569. this.$confirm(`此操作将${str}该数据, 是否继续?`, '提示', {
  570. confirmButtonText: '确定',
  571. cancelButtonText: '取消',
  572. type: 'warning'
  573. }).then(() => {
  574. setHidden({products:[{pid:item.pid,regionCode:item.regionCode}],hidden}).then(res=>{
  575. if(res.state == 'Success'){
  576. this.$notify({
  577. title: '成功',
  578. message: '操作成功',
  579. type: 'success'
  580. });
  581. if(hidden){
  582. this.getList()
  583. }else{
  584. this.listHidden()
  585. }
  586. }
  587. })
  588. })
  589. },
  590. handleBatch(hidden){
  591. let str = ''
  592. let products
  593. if(hidden){
  594. str = '拉黑'
  595. products = this.pids
  596. }else{
  597. str = '取消拉黑'
  598. products = this.pids1
  599. }
  600. this.$confirm(`此操作将批量${str}该数据, 是否继续?`, '提示', {
  601. confirmButtonText: '确定',
  602. cancelButtonText: '取消',
  603. type: 'warning'
  604. }).then(() => {
  605. setHidden({products,hidden}).then(res=>{
  606. if(res.state == 'Success'){
  607. this.dialogFormVisible3 = false
  608. this.pids = []
  609. this.$notify({
  610. title: '成功',
  611. message: '操作成功',
  612. type: 'success'
  613. });
  614. if(hidden){
  615. }else{
  616. // this.listHidden()
  617. }
  618. this.handleSearch()
  619. }
  620. })
  621. })
  622. },
  623. handleSizeChange(val) {
  624. this.query.page = 1;
  625. this.query.size = val;
  626. this.getList();
  627. },
  628. handleCurrentChange(val) {
  629. this.query.page = val;
  630. this.getList();
  631. },
  632. handleSizeChange1(val) {
  633. this.query1.page = 1;
  634. this.query1.size = val;
  635. this.listHidden();
  636. },
  637. handleCurrentChange1(val) {
  638. this.query1.page = val;
  639. this.listHidden();
  640. },
  641. search() {
  642. this.query.page = 1;
  643. this.getList();
  644. },
  645. // 首页列表
  646. getList() {
  647. this.loading = true
  648. let query = JSON.parse(JSON.stringify(this.query))
  649. query.page-=1
  650. homeGoodsList(query).then((res) => {
  651. this.loading = false
  652. if (res.state == "Success") {
  653. this.tableData = res.content.content;
  654. this.total = res.content.totalElements
  655. }
  656. });
  657. },
  658. // 拉黑列表
  659. listHidden(){
  660. let query = JSON.parse(JSON.stringify(this.query1))
  661. query.page-=1
  662. listHidden(query).then(res=>{
  663. if (res.state == "Success") {
  664. this.tableData1 = res.content.content;
  665. this.total1 = res.content.totalElements
  666. }
  667. })
  668. },
  669. // 所有产品类型
  670. listAllTypes(){
  671. listAllTypes().then((res) => {
  672. if (res.state == "Success") {
  673. res.content.map(item=>{
  674. this.options.push({
  675. value:item.productType,
  676. label:item.productTypeDesc
  677. })
  678. })
  679. }
  680. });
  681. },
  682. // 所有设置的区域产品类型
  683. listShowTypes(){
  684. return new Promise((resolve, reject) => {
  685. this.loading1 = true
  686. listShowTypes().then(res=>{
  687. this.loading1 = false
  688. if (res.state == "Success") {
  689. if(res.content.content.length){
  690. this.query.regionCode = res.content.content[0].regionCode
  691. }
  692. this.tableData2 = res.content.content
  693. resolve()
  694. // this.setQuery1.type = res.content.map(item=>item.productType)
  695. }
  696. })
  697. })
  698. },
  699. // 添加编辑区域产品类型
  700. save(){
  701. this.$refs.setQuery1.validate((v) => {
  702. if (v) {
  703. this.btnLoading1 = true
  704. let setQuery1 = JSON.parse(JSON.stringify(this.setQuery1))
  705. setQuery1.types = setQuery1.types.map(item=>{
  706. return {productType:item}
  707. })
  708. setShowTypes(setQuery1).then(res=>{
  709. this.btnLoading1 = false
  710. if(res.state == 'Success'){
  711. this.dialogFormVisible4 = false
  712. this.$notify({
  713. title: '成功',
  714. message: '操作成功',
  715. type: 'success'
  716. });
  717. this.listShowTypes();
  718. this.handleSearch()
  719. }
  720. })
  721. }
  722. });
  723. },
  724. // 设置排序
  725. save2(){
  726. this.$refs.topFrom.validate((v) => {
  727. if (v) {
  728. this.btnLoading2 = true
  729. setTop(this.topFrom).then(res=>{
  730. this.btnLoading2 = false
  731. if(res.state == 'Success'){
  732. this.dialogFormVisible2 = false
  733. this.$notify({
  734. title: '成功',
  735. message: '操作成功',
  736. type: 'success'
  737. });
  738. this.getList();
  739. }
  740. })
  741. }
  742. });
  743. },
  744. getCityList() {
  745. this.loading = true
  746. getCityList({name:'',
  747. page: 0,
  748. size: 999,}).then((res) => {
  749. this.loading = false
  750. if (res.state == "Success") {
  751. this.cityOptions = res.content.content.map(item => {
  752. return {
  753. value: item.code,
  754. label: item.name
  755. }
  756. })
  757. }
  758. });
  759. },
  760. listSetTypesRegions() {
  761. listSetTypesRegions().then((res) => {
  762. if (res.state == "Success") {
  763. this.regionOptions = res.content.map(item => {
  764. return {
  765. value: item.code,
  766. label: item.name
  767. }
  768. })
  769. }
  770. });
  771. }
  772. },
  773. created() {
  774. // this.listSetTypesRegions();
  775. this.getCityList();
  776. this.listAllTypes()
  777. this.listShowTypes().then(() => {
  778. this.getList();
  779. })
  780. },
  781. };
  782. </script>
  783. <style lang="scss" >
  784. .homeGoodsSet {
  785. .tab-list{
  786. display: flex;
  787. align-items: center;
  788. padding-bottom: 20px;
  789. flex-wrap: wrap;
  790. width: 100%;
  791. .tab{
  792. font-size: 14px;
  793. color: #222;
  794. cursor: pointer;
  795. }
  796. .tab+.tab{
  797. margin-left: 10px;
  798. }
  799. .tab.active{
  800. color: #2836fe;
  801. font-weight: bold;
  802. }
  803. }
  804. .info{
  805. display: flex;
  806. align-items: center;
  807. .small-img{
  808. width: 40px;
  809. height: 40px;
  810. }
  811. }
  812. }
  813. </style>