hxj_index_component.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <view style="background-color: #FEFFFE;">
  3. <view class="swiper_cent">
  4. <swiper style="height: 900rpx;" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="1000"
  5. @change="swiperChange">
  6. <swiper-item v-for="(item,index) in homePages[0].data.banners" :key="index" @click="goPage(item.url)">
  7. <image :src="item.picUrl" style="width: 100%;height: 900rpx;" mode=""></image>
  8. </swiper-item>
  9. </swiper>
  10. <view class="swiper_zhishi">
  11. <view :class="swiperKey===i?'view_active':''" v-for="(item1,i) in homePages[0].data.banners.length" :key="i"></view>
  12. </view>
  13. </view>
  14. <u-announcement
  15. v-bind:bgColor="homePages[1].data.background"
  16. v-bind:btn-color="homePages[1].data.btnColor"
  17. v-bind:btn-height="homePages[1].data.btnHeight"
  18. v-bind:btn-radius="`${homePages[1].data.btnRadius}rpx`"
  19. v-bind:btn-text="homePages[1].data.btnText"
  20. v-bind:btn-text-color="homePages[1].data.btnTextColor"
  21. v-bind:btn-width="homePages[1].data.btnWidth"
  22. v-bind:content="homePages[1].data.content"
  23. v-bind:header-url="homePages[1].data.headerUrl"
  24. v-bind:icon="homePages[1].data.icon"
  25. v-bind:name="homePages[1].data.name"
  26. v-bind:textColor="homePages[1].data.textColor"
  27. ></u-announcement>
  28. <view class="link">
  29. <view>
  30. <view class="title">人居 · 荟享家<image class="hxjImg"
  31. src="https://t17.9026.com/web/statics/image/index/HUIXIANGJIA.png" mode=""></image>
  32. </view>
  33. </view>
  34. </view>
  35. <app-scroll-list :list="list"></app-scroll-list>
  36. <view class="link">
  37. <view class="title1">本期家点灵感</view>
  38. <image class="tyx" src="https://t17.9026.com/web/statics/image/index/tyx.png" mode=""></image>
  39. <image class="d6" src="https://t17.9026.com/web/statics/image/index/6d.png" mode=""></image>
  40. <view class="subtitle">臻选整装 · 安全无甲醛 · 7天入住</view>
  41. </view>
  42. <view class="lg_list">
  43. <view class="item" v-for="(item,index) in compositionList" :key="index"
  44. @click="goPage(item.type=='goods'?`/pages/goods/goods?id=${item.id}`:`/pages/case/projectInfo?id=${item.id}`)">
  45. <image class="imgBox" :src="item.cover_img">
  46. </image>
  47. <view class="b_card main-between">
  48. <view class="left">
  49. <view class="title t-omit" style="width: 420rpx;">{{item.name}}</view>
  50. <view class="desc t-omit" style="width: 420rpx;">{{item.tag}}</view>
  51. </view>
  52. <view class="right">
  53. <view class="price"><text class="rmb">¥</text><text>{{item.price}}</text><text
  54. class="dw">元</text></view>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- <view class="more">
  59. <view>VIEW MORE</view>
  60. <view>
  61. <image src="https://t17.9026.com/web/statics/image/index/viewmore.png" mode=""></image>
  62. </view>
  63. </view> -->
  64. </view>
  65. <view class="link ">
  66. <view class="title1 main-left cross-center">优惠券<image class="coupon_1"
  67. src="https://t17.9026.com/web/statics/image/index/coupon_1.png" mode=""></image><text
  68. class="coupon_sub">RECOMMEND</text></view>
  69. </view>
  70. <view class="coupon main-left">
  71. <view class="item main-left" v-for="(item,index) in homePages[6].data.coupon_list" :key="index" @click="receive(index)">
  72. <view class="Wb">
  73. <view>
  74. <view class="title_2">定制优享礼券 <text class="hjx-tc-B19D60 hjx-ts-21 hxj-ml-10">立即领取</text></view>
  75. <view class="desc_2">新用户礼遇</view>
  76. </view>
  77. <view>
  78. <view class="price"><text>¥</text>{{item.sub_price}}</view>
  79. <view class="yxq">有效期至{{item.end_time.split(' ')[0]}}</view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="link mt_20">
  85. <view class="title1">荟享定制<image class="coupon_1"
  86. src="https://t17.9026.com/web/statics/image/index/coupon_1.png" mode="">
  87. </image><text class="coupon_sub">HUIXIANG</text></view>
  88. </view>
  89. <view class="hxdz">
  90. <view class="main-left q">
  91. <view class="l" @click="goPage(homePages[7].data.list[0].link.new_link_url)">
  92. <view class="title_2">明星套装</view>
  93. <view class="desc_2">自然高端好家居</view>
  94. <image :src="homePages[7].data.list[0].pic_url" mode=""></image>
  95. </view>
  96. <view class="main-between-y">
  97. <view class="r1" @click="goPage(homePages[7].data.list[1].link.new_link_url)">
  98. <view class="title_2">优选</view>
  99. <view class="desc_2">优选家居</view>
  100. <image :src="homePages[7].data.list[1].pic_url" mode=""></image>
  101. </view>
  102. <view class="r2" @click="goPage(homePages[7].data.list[2].link.new_link_url)">
  103. <view class="title_2">专属</view>
  104. <view class="desc_2">定制精品</view>
  105. <image :src="homePages[7].data.list[2].pic_url" mode=""></image>
  106. </view>
  107. </view>
  108. </view>
  109. <scroll-view scroll-x="true">
  110. <view class="main-left w">
  111. <view class="item" v-for="(item,index) in homePages[8].data.navs" :key="index">
  112. <image class="borradu_20"
  113. :src="item.icon_url"
  114. mode=""></image>
  115. <view class="title_2">{{item.name}}</view>
  116. <view class="desc_2">独到品味的代表备份</view>
  117. </view>
  118. </view>
  119. </scroll-view>
  120. <!-- <view class="more">
  121. <view class="viewmore1_color">查看更多</view>
  122. <view class="viewmore1_color">VIEW MORE</view>
  123. <view>
  124. <image class="viewmore1" src="https://t17.9026.com/web/statics/image/index/viewmore1.png" mode=""></image>
  125. </view>
  126. </view> -->
  127. </view>
  128. <view class="main-between link mt_20">
  129. <view class="title1">
  130. 限时团购
  131. <image class="coupon_1" src="https://t17.9026.com/web/statics/image/index/coupon_1.png" mode="">
  132. </image>
  133. <text class="coupon_sub">TUANGOU</text>
  134. </view>
  135. <view class="link-more" @click="goPage('/plugins/pt/index/index')">
  136. 查看更多<image src="https://t17.9026.com/web/statics/image/index/arrow-right-gray.png" mode=""></image>
  137. </view>
  138. </view>
  139. <view class="group_list">
  140. <swiper style="height: 606rpx;" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="1000"
  141. previous-margin="25rpx" next-margin="25rpx" :current="ptCurrent" @change="ptChange">
  142. <swiper-item class="" v-for="(item,index) in homePages[9].data.list" :key="index"
  143. @click="goPage(item.page_url)">
  144. <view class="item">
  145. <view class="imgBox" >
  146. <image class="img" :src="item.cover_pic"></image>
  147. </view>
  148. <view class="b_card main-between" >
  149. <view class="main-left cross-center left">
  150. <view class="i">02</view>
  151. <view class="q">:</view>
  152. <view class="i">24</view>
  153. <view class="q">:</view>
  154. <view class="i">45</view>
  155. </view>
  156. <view class="right">
  157. <view class="price"><text class="rmb">¥</text><text>{{item.pintuan_price}}</text><text
  158. class="dw">元</text></view>
  159. </view>
  160. </view>
  161. </view>
  162. </swiper-item>
  163. </swiper>
  164. </view>
  165. <view class="link main-left">
  166. <!-- <view class="title1" style="margin-right: 61rpx;">荟享自营</view>
  167. <view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view>
  168. <view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view>
  169. <view class="title1" style="margin-right: 61rpx;color: #A7A7A7;">精选类别</view> -->
  170. <view class="title1" style="margin-right: 61rpx;" :style="{'color':bottom_goods_index===index?'':'#A7A7A7'}" v-for="(item,index) in homePages[11].data.catList" :key="index" @click="selectCat(index)">{{item.menuName}}</view>
  171. <image class="tyx" src="https://t17.9026.com/web/statics/image/index/tyx.png" mode=""></image>
  172. </view>
  173. <view class="hxzy">
  174. <view class="top">
  175. <image
  176. style="width: 560rpx;height: 270rpx;border-radius: 20rpx 0 0 0;position: absolute;top: 0;right: 0;"
  177. src="https://t17.9026.com/web/statics/image/index/9.png" mode=""></image>
  178. <view class="dbo main-between-y">
  179. <view>
  180. <view class="text">decoration荟享自营</view>
  181. <view class="text">心至所向·渐入家境</view>
  182. </view>
  183. <!-- <view class="category">2930人已收藏</view> -->
  184. </view>
  185. </view>
  186. <view class="dir-left-wrap bottom">
  187. <view class="item" v-for="(item,index) in homePages[11].data.catList[bottom_goods_index].goodsList" :key="index"
  188. @click="goPage(`/pages/goods/goods?id=${item.id}`)">
  189. <view>
  190. <image class="cover" :src="item.cover_pic"
  191. mode=""></image>
  192. </view>
  193. <view class="title_2 t-omit" style="width: 320rpx;">{{item.name}}</view>
  194. <view class="desc_2">{{item.sales}}</view>
  195. <view class="price" style="margin-top: 27rpx;"><text class="rmb">¥</text><text>{{item.price}}</text><text
  196. class="dw">元</text></view>
  197. </view>
  198. </view>
  199. <view class="more1" @click="goPage('/pages/cats/cats')">
  200. <view class="viewmore1_color main-center cross-center">更多荟享<image class=""
  201. src="https://t17.9026.com/web/statics/image/index/viewmore1.png" mode=""></image>
  202. </view>
  203. </view>
  204. </view>
  205. <view class="bottom_logo">
  206. <image src="https://t17.9026.com/web/statics/image/index/bottom_logo.png" mode=""></image>
  207. <view class="text">home shopping mall</view>
  208. </view>
  209. </view>
  210. </template>
  211. <script>
  212. import {mapState} from 'vuex'
  213. import appScrollList from './components/scroll-list.vue'
  214. import uAnnouncement from "@/components/page-component/u-announcement/u-announcement.vue";
  215. export default {
  216. components: {
  217. appScrollList,
  218. uAnnouncement
  219. },
  220. props: {
  221. homePages: {
  222. type: Object,
  223. default () {
  224. return {
  225. navs: [],
  226. };
  227. },
  228. },
  229. page_id:{
  230. type:Number,
  231. default:0
  232. },
  233. dIndex: {
  234. type: Array,
  235. default () {
  236. return [0, 0];
  237. }
  238. },
  239. mIndex: {
  240. type: Array,
  241. default () {
  242. return [0, 0];
  243. }
  244. },
  245. dType:String
  246. },
  247. computed:{
  248. ...mapState({
  249. selectedProperties:state=>state.user.selectedProperties
  250. })
  251. },
  252. watch:{
  253. selectedProperties(){
  254. this.getComposition()
  255. },
  256. },
  257. data() {
  258. return {
  259. ptCurrent:1,//拼图轮播第几个
  260. pageData: '',
  261. swiperKey: 0, //轮播位置
  262. bottom_goods_index:0, //底部商品分类索引
  263. list: [
  264. {
  265. image: 'https://t17.9026.com/web/statics/image/index/temporary/jhk-1634283687206.png',
  266. title: '热销方案',
  267. tag: '热销',
  268. link: '/pages/case/hot_sale_project'
  269. },
  270. {
  271. image: 'https://t17.9026.com/web/statics/image/index/temporary/jhk-1634284372084.png',
  272. title: '主题专区',
  273. tag: '主题',
  274. // link: '/pages/case/themeArea'
  275. link:'/pages/topic/list'
  276. },
  277. {
  278. image: 'https://t17.9026.com/web/statics/image/index/temporary/jhk-1634283667210.png',
  279. title: '定制产品',
  280. tag: '预约',
  281. link: '/pages/case/appointment/appointment-list'
  282. },
  283. {
  284. image: 'https://t17.9026.com/web/statics/image/index/2.png',
  285. title: '明星套装',
  286. tag: '套装',
  287. link: '/pages/case/appointment/appointment-list'
  288. }
  289. ],
  290. // jdlg: [{
  291. // title: '兴城人居ins风套装',
  292. // sub_title: '细节控·轻奢风',
  293. // price: '65622',
  294. // cover_image: '3',
  295. // },
  296. // {
  297. // title: '风创造「最大坪效」85m²MUJI',
  298. // sub_title: '细节控·轻奢风',
  299. // price: '7486',
  300. // cover_image: 'temporary/jhk-1634283447190'
  301. // },
  302. // {
  303. // title: '85m²MUJI风创造「最大坪效」',
  304. // sub_title: '细节控·轻奢风',
  305. // price: '27853',
  306. // cover_image: 'temporary/jhk-1634284367308'
  307. // }
  308. // ],
  309. // qwe: [
  310. // {
  311. // 'title': '兴城人居',
  312. // 'cover_image': 'jhk-1634283667210'
  313. // }, {
  314. // 'title': '世龙广场',
  315. // 'cover_image': 'jhk-1634284372084'
  316. // }, {
  317. // 'title': '新中式',
  318. // 'cover_image': 'jhk-1634283687206'
  319. // },
  320. // ],
  321. compositionList:[],//本期家点灵感
  322. }
  323. },
  324. created() {
  325. this.getComposition()
  326. },
  327. methods: {
  328. selectCat(index){
  329. this.bottom_goods_index=index
  330. },
  331. swiperChange(e) {
  332. console.log(e.detail.current)
  333. this.swiperKey = e.detail.current
  334. },
  335. goPage(url) {
  336. uni.navigateTo({
  337. url: url
  338. })
  339. },
  340. //获取推荐套餐
  341. getComposition(){
  342. this.$request({
  343. url:this.$api.composition.list,
  344. data:{
  345. is_recommend:1,
  346. limit:3
  347. },
  348. method:'post'
  349. }).then(res=>{
  350. if(res.code===0){
  351. this.compositionList=res.data.list
  352. }
  353. })
  354. },
  355. //领取优惠券
  356. receive(index) {
  357. let list = this.homePages[6].data.coupon_list
  358. if (this.sign == 'integral-mall') {
  359. this.$jump({
  360. url: list[index].page_url,
  361. open_type: 'navigate'
  362. });
  363. return;
  364. }
  365. if (list[index].is_receive == 1) {
  366. uni.showToast({
  367. mask: true,
  368. title: '已领取',
  369. icon: 'none'
  370. });
  371. return true;
  372. }
  373. uni.showLoading({
  374. mask: true,
  375. title: '领取中'
  376. });
  377. this.$request({
  378. url: this.$api.coupon.receive,
  379. data: {
  380. coupon_id: list[index].id
  381. }
  382. }).then(e => {
  383. uni.hideLoading();
  384. if (e.code === 0) {
  385. if (e.data.rest == 0) {
  386. this.homePages[6].data.coupon_list[index].is_receive = '1';
  387. }
  388. let tempList = this.homePages[6].data.coupon_list;
  389. this.flushCache(tempList);
  390. this.$store.dispatch('page/actionSetCoupon', {
  391. list: [Object.assign(tempList[index], e.data)],
  392. type: 'receive'
  393. });
  394. } else {
  395. uni.showToast({
  396. title: e.msg,
  397. icon: 'none'
  398. });
  399. }
  400. }).catch(() => {
  401. uni.hideLoading();
  402. });
  403. },
  404. flushCache(coupon_list) {
  405. if (this.page_id == 0) {
  406. let storage = this.$storage.getStorageSync('INDEX_MALL');
  407. let dIndex = this.dIndex;
  408. let mIndex = this.mIndex;
  409. if (this.dType === 'module') {
  410. storage.home_pages.navs[mIndex[0]].template.data[mIndex[1]].data.list[dIndex[0]].data[dIndex[1]]
  411. .data.coupon_list = coupon_list;
  412. } else {
  413. storage.home_pages.navs[dIndex[0]].template.data[dIndex[1]].data.coupon_list = coupon_list;
  414. }
  415. this.$storage.setStorageSync('INDEX_MALL', storage);
  416. }
  417. },
  418. ptChange(e){
  419. this.ptCurrent=e.detail.current
  420. }
  421. }
  422. }
  423. </script>
  424. <style lang="scss" scoped>
  425. @import './index.scss';
  426. .swiper_cent {
  427. position: relative;
  428. .swiper_zhishi {
  429. display: flex;
  430. align-items: center;
  431. width: 100%;
  432. justify-content: center;
  433. position: absolute;
  434. bottom: 39rpx;
  435. view {
  436. width: 81rpx;
  437. height: 4rpx;
  438. background: #c8c8c8;
  439. }
  440. .view_active {
  441. background: #f4f4f4;
  442. }
  443. }
  444. }
  445. .ptcc{
  446. animation:myfirst 0.5s infinite;
  447. animation-iteration-count:1;
  448. animation-fill-mode:forwards;
  449. }
  450. // .ptee{
  451. // animation:myfirst 0.5s infinite;
  452. // animation-iteration-count:1;
  453. // animation-fill-mode:forwards;
  454. // animation-direction:reverse;
  455. // }
  456. @keyframes myfirst
  457. {
  458. from {height: 404rpx;}
  459. to {margin-top: 40rpx;height: 365rpx!important;}
  460. }
  461. </style>