index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
  4. <view class="C1b1b1b">
  5. <tm-search v-model="soso" color="white" confirm-text="" @click="sosoFun">
  6. <!-- <template #right>
  7. <view class="xiangji">
  8. <image src="/static/img/xiangji.png" mode="widthFix"></image>
  9. </view>
  10. </template> -->
  11. </tm-search>
  12. <view class="dingwei">
  13. <tm-quickCity color="blue" v-model="offshow" :defaultValue.sync="defaultValue" @change="qiehuandizhi">
  14. <image style="vertical-align: middle;" src="/static/img/dingwei.png" mode="widthFix"></image>
  15. <text style="vertical-align: middle;" class="text-size-g">{{chengshi}}</text>
  16. </tm-quickCity>
  17. </view>
  18. </view>
  19. <view class="zhuti mt-50">
  20. <tm-grid :grid="5" :list="list3" :icon-size="140" font-color="white"></tm-grid>
  21. <!-- 今日穿搭 -->
  22. <tm-sheet class="lunbo">
  23. <view class="py-10 text-size-g dianz">
  24. <image src="/static/img/6.png" mode="widthFix"></image>
  25. <text class="text-white">今日穿搭推荐</text>
  26. </view>
  27. <view class="pb-20 text-size-g">
  28. <view class="text-white" style="display: flex;justify-content: space-between;">
  29. <view v-if="list.length !=0"
  30. style="display: flex;align-items: center; justify-content: center;width: 46%;font-size: 16px;font-weight: bold;">
  31. {{list[current].name}}
  32. </view>
  33. <view class="qiehuan">
  34. <tm-translate class="fl a_1" :auto="true" ref="a_1" :duration="80" animation-name="zoomIn">
  35. <image v-if="current==0" class="anniu mr-10" src="/static/img/14.png" mode="widthFix">
  36. </image>
  37. <image v-if="current!=0" @click="xia()" class="anniu mr-10" src="/static/img/12.png"
  38. mode="widthFix"></image>
  39. </tm-translate>
  40. <tm-swiper @click="tiaoclick" @change="jinriFun" class="tu fl" :previmage="false"
  41. :noSwiping="true" :height="220" :width="250" :current="current" :margin="8"
  42. :autoplay="false" :list="list"></tm-swiper>
  43. <tm-translate class="fl a_1" :auto="true" ref="a_5" :duration="80" animation-name="zoomIn">
  44. <image v-if="current<(list.length-1)" @click="shang()" class="anniu fl ml-10"
  45. src="/static/img/13.png" mode="widthFix"></image>
  46. <image v-if="current>(list.length-2)" class="anniu fl ml-10" src="/static/img/11.png"
  47. mode="widthFix"></image>
  48. </tm-translate>
  49. </view>
  50. </view>
  51. </view>
  52. </tm-sheet>
  53. <!-- 明日计划 -->
  54. <tm-sheet class="lunbo1">
  55. <view class="py-10 text-size-g dianz mingri">
  56. <image src="/static/img/17.png" mode="widthFix"></image>
  57. <text class="text-white">明日计划</text>
  58. </view>
  59. <view class="mt-20 text-size-g jihua">
  60. <tm-translate class="a_1" ref="a_6" :auto="true" :duration="80" animation-name="zoomIn">
  61. <image @click="jihuashang()" class="anniu mr-10" src="/static/img/18.png" mode="widthFix">
  62. </image>
  63. </tm-translate>
  64. <view class="bbb">
  65. <tm-swiper @click="tiao" class="aaa" :previmage="false" :noSwiping="true" :current="current1"
  66. :autoplay="false" :list="list1"></tm-swiper>
  67. </view>
  68. <tm-translate class="a_1" ref="a_4" :auto="true" :duration="80" animation-name="zoomIn"
  69. style="right: 0px;">
  70. <image @click="jihuaxia()" class="anniu mr-10" src="/static/img/19.png" mode="widthFix"></image>
  71. </tm-translate>
  72. <view style="clear: both;"></view>
  73. </view>
  74. </tm-sheet>
  75. <!-- 热门穿搭 -->
  76. <tm-sheet class="lunbo1" style="margin-bottom: 70px !important;">
  77. <view class="py-10 text-size-g dianz mingri">
  78. <image src="/static/img/24.png" mode="widthFix"></image>
  79. <text class="text-white">热门穿搭</text>
  80. </view>
  81. <view class="text-size-g jihua remen">
  82. <view style="width: 48%;" class="fl">
  83. <view @click="tiaodapei(item.id)" v-for="(item,index) in listdata" v-if="index%2==0"
  84. class="round-3 shadow-2 overflow pa-10 mt-20"
  85. :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'white']">
  86. <image class="logo" :src="item.image" mode="widthFix"></image>
  87. <view class="pa-10 text-size-s">
  88. <view class="text-overflow-2">
  89. <text>{{item.text}}</text>
  90. </view>
  91. <view class="mt-2 flex-between flex-center">
  92. <view>
  93. <!-- <tm-translate ref="a_2" :duration="80" animation-name="fadeIn"> -->
  94. <!-- <image class="remenzan" :src="dianzan1?'/static/img/29.png':'/static/img/9.png'" mode="widthFix"></image> -->
  95. <!-- </tm-translate> -->
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. <view style="width: 46%;" class="fr">
  102. <view style="width: 100%;" class="fr round-3 shadow-2 overflow pa-10 mt-20"
  103. :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'white']">
  104. <view class="py-10 text-size-m dianz mingri">
  105. <text style="vertical-align: middle;" class="text-white">销量飙升榜</text>
  106. <image style="width: 25px;margin-left: 8px;" src="/static/img/36.png" mode="widthFix">
  107. </image>
  108. </view>
  109. <view class="py-10 text-size-s dianz mingri">
  110. <text class="text-white">亿万新品趋势洞察</text>
  111. </view>
  112. <view class="mt-10" v-for="item in list2" @click="xiangqing()">
  113. <image class="chuandaimg fl" :src="item.img" mode="widthFix"></image>
  114. <view class="chuandazi fr">
  115. <view class="text-size-m text-weight-b text-overflow-2">{{item.title}}</view>
  116. <view class="tm-cartCellListFood-label text-size-s text-grey py-8">{{item.text}}
  117. </view>
  118. <image class="gengduo fr" src="/static/img/40.png" mode="widthFix"></image>
  119. </view>
  120. <view style="clear: both;"></view>
  121. </view>
  122. </view>
  123. <view style="clear: both;"></view>
  124. <view v-for="(item,index) in listdata" v-if="index%2==1"
  125. class="round-3 shadow-2 overflow pa-10 mt-20"
  126. :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'white']">
  127. <image class="logo" :src="item.image" mode="widthFix"></image>
  128. <view class="pa-10 text-size-s">
  129. <view class="text-overflow-2">
  130. <text>{{item.text}}</text>
  131. </view>
  132. <view class="mt-24 flex-between flex-center">
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. <view style="clear: both;" class="more ma-40 pt-40" @click="gengmore()">
  138. <image src="/static/img/30.png" mode="widthFix"></image>
  139. <text class="text-size-s">下拉加载更多~</text>
  140. </view>
  141. </view>
  142. </tm-sheet>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. import {
  148. myRequest
  149. } from '@/api/request.js'
  150. export default {
  151. data() {
  152. return {
  153. offshow:false,
  154. chengshi:"南京",
  155. defaultValue: [],
  156. soso: '',
  157. aab: false,
  158. shoucangsrc: true,
  159. dianzan: true,
  160. dianzan1: true,
  161. list3: [],
  162. top: 60,
  163. sys: null,
  164. list2: [{
  165. img: '/static/img/39.png',
  166. title: '单品推荐',
  167. text: '3.9万人追捧'
  168. }, {
  169. img: '/static/img/37.png',
  170. title: '单品推荐',
  171. text: '3.9万人追捧'
  172. }, {
  173. img: '/static/img/38.png',
  174. title: '单品推荐',
  175. text: '3.9万人追捧'
  176. }],
  177. list: [],
  178. list1: [],
  179. current: 0,
  180. current1: 0,
  181. listdata: []
  182. };
  183. },
  184. onLoad() {
  185. // #ifdef MP
  186. this.top = uni.upx2px(150);
  187. // #endif
  188. },
  189. created() {
  190. var that = this;
  191. setTimeout(function() {
  192. if (uni.getStorageSync("token") == "") {
  193. uni.redirectTo({
  194. url: "/pages/login/index"
  195. })
  196. }
  197. }, 1000)
  198. this.sys = uni.getSystemInfoSync();
  199. this.getService();
  200. this.getremmend();
  201. this.getHot();
  202. this.getPlan();
  203. },
  204. methods: {
  205. qiehuandizhi(e){
  206. if(e[2]!=null){
  207. this.offshow=false;
  208. this.chengshi=e[1];
  209. }
  210. },
  211. xiangqing(){
  212. uni.navigateTo({
  213. url: "/pages/shopdetail/index",
  214. })
  215. },
  216. // 获取用户服务列表
  217. getService() {
  218. let that = this;
  219. myRequest({
  220. url: "/api/Service/serviceList",
  221. method: 'get',
  222. data: that.reqData
  223. }).then(res => {
  224. if (res.data.code == 200) {
  225. res.data.data.forEach(item => {
  226. that.list3.push({
  227. icon: item.img,
  228. text: item.name,
  229. sort: item.sort
  230. })
  231. })
  232. } else {
  233. that.$refs.toast.show({
  234. model: 'error',
  235. label: res.data.msg
  236. })
  237. }
  238. })
  239. },
  240. // 获取穿搭推荐
  241. getremmend() {
  242. let that = this;
  243. myRequest({
  244. url: "/api/Collocation/recommendList",
  245. method: 'get',
  246. data: that.reqData
  247. }).then(res => {
  248. if (res.data.code == 200) {
  249. res.data.data.forEach(item => {
  250. that.list.push({
  251. src: item.image,
  252. name: item.title,
  253. id:item.id
  254. })
  255. })
  256. } else {
  257. that.$refs.toast.show({
  258. model: 'error',
  259. label: res.data.msg
  260. })
  261. }
  262. })
  263. },
  264. // 获取明日计划
  265. getPlan() {
  266. let that = this;
  267. myRequest({
  268. url: "/api/Scene/sceneList",
  269. method: 'get',
  270. data: that.reqData
  271. }).then(res => {
  272. if (res.data.code == 200) {
  273. res.data.data.forEach(item => {
  274. that.list1.push({
  275. src: item.img,
  276. title: item.scene_name
  277. })
  278. })
  279. } else {
  280. that.$refs.toast.show({
  281. model: 'error',
  282. label: res.data.msg
  283. })
  284. }
  285. })
  286. },
  287. // 获取热门穿搭
  288. getHot() {
  289. let that = this;
  290. myRequest({
  291. url: "/api/ShopCollocation/hotList",
  292. method: 'get',
  293. data: that.reqData
  294. }).then(res => {
  295. if (res.data.code == 200) {
  296. res.data.data.data.forEach(item => {
  297. that.listdata.push({
  298. image: item.image,
  299. text: item.title,
  300. id:item.id
  301. })
  302. })
  303. } else {
  304. that.$refs.toast.show({
  305. model: 'error',
  306. label: res.data.msg
  307. })
  308. }
  309. })
  310. },
  311. tiaodapei(id) {
  312. console.log(id)
  313. uni.navigateTo({
  314. url: "/pages/shouyedetail/index?id="+id,
  315. })
  316. },
  317. tiao() {
  318. uni.navigateTo({
  319. url: "/pages/bianji/index",
  320. })
  321. },
  322. tiaoclick(e) {
  323. uni.navigateTo({
  324. url: "/pages/zidingyikan/index?id="+e.data.id+"&type=1",
  325. })
  326. },
  327. jinriFun(e) {
  328. this.current = e;
  329. },
  330. sosoFun() {
  331. uni.navigateTo({
  332. url: "/pages/sousuo/index",
  333. })
  334. },
  335. gengmore() {
  336. },
  337. jihuashang() {
  338. if (this.current1 == 0) {
  339. return
  340. }
  341. this.$refs.a_6.play()
  342. this.current1 = this.current1 - 1;
  343. },
  344. jihuaxia() {
  345. if (this.current1 > (this.list1.length - 5)) {
  346. return
  347. }
  348. this.$refs.a_4.play()
  349. this.current1 = this.current1 + 1;
  350. },
  351. shouc() {
  352. this.shoucangsrc = !this.shoucangsrc;
  353. this.$refs.a_3.play()
  354. },
  355. zan() {
  356. this.dianzan = !this.dianzan;
  357. this.$refs.a_2.play()
  358. },
  359. shang() {
  360. this.$refs.a_5.play()
  361. this.current = this.current + 1;
  362. },
  363. xia() {
  364. this.$refs.a_1.play()
  365. this.current = this.current - 1;
  366. }
  367. },
  368. }
  369. </script>
  370. <style lang="scss">
  371. /deep/ .tm-menubars .body {
  372. background-color: #1b1b1b !important;
  373. }
  374. /deep/ .aaa uni-image {
  375. width: 52px !important;
  376. height: 52px !important;
  377. }
  378. /deep/ .aaa uni-swiper-item {
  379. width: 55px !important;
  380. height: 80px !important;
  381. padding: 0 5px !important;
  382. }
  383. .xiangji image {
  384. width: 30px;
  385. height: 22px;
  386. }
  387. .suosou image {
  388. width: 40px;
  389. }
  390. /deep/ .icon-search {
  391. font-size: 23px !important;
  392. color: #8E8E93 !important;
  393. }
  394. /deep/ .tm-search {
  395. width: 94%;
  396. margin: 0 auto;
  397. background-color: #414141 !important;
  398. border-radius: 10px;
  399. }
  400. /deep/ .tm-search .grey-darken-5 {
  401. background-color: #414141 !important;
  402. }
  403. .dingwei {
  404. width: 92%;
  405. margin: 0 auto;
  406. margin-top: 20px;
  407. padding-bottom: 20px;
  408. }
  409. .dingwei image {
  410. width: 25px;
  411. margin-right: 10px;
  412. }
  413. /deep/ .tm-col {
  414. width: 20% !important;
  415. }
  416. .zhuti {
  417. padding: 10px 10px;
  418. }
  419. /deep/ .lunbo {
  420. margin: 0 !important;
  421. padding: 8px !important;
  422. margin-top: 50px !important;
  423. }
  424. .dianz image {
  425. width: 35px;
  426. vertical-align: middle;
  427. margin-right: 10px;
  428. }
  429. /deep/ .text-size-s span,
  430. /deep/ .text-size-g {
  431. font-size: 15px;
  432. }
  433. .touxiang image {
  434. width: 40px;
  435. margin-right: 10px;
  436. vertical-align: middle;
  437. }
  438. .shoucang image {
  439. width: 45px;
  440. }
  441. .qiehuan {
  442. float: right;
  443. }
  444. .qiehuan .a_1 {
  445. margin-top: 25%;
  446. }
  447. .qiehuan .anniu {
  448. width: 20px;
  449. height: 20px !important;
  450. }
  451. .di {
  452. background: #0D0D0D;
  453. width: 45px;
  454. height: 45px;
  455. text-align: center;
  456. line-height: 50px;
  457. border-radius: 30px;
  458. }
  459. .mingri image {
  460. width: 30px;
  461. margin-right: 12px;
  462. }
  463. .di image {
  464. width: 22px;
  465. margin: 0 !important;
  466. height: 20px !important;
  467. }
  468. .jihua image {
  469. width: 30px;
  470. height: 30px;
  471. }
  472. .jihua {
  473. position: relative;
  474. }
  475. .jihua .a_1 {
  476. position: absolute;
  477. top: 10%;
  478. }
  479. .bbb {
  480. width: 75% !important;
  481. margin: 0 auto !important;
  482. }
  483. /deep/ .bbb uni-swiper {
  484. width: 100% !important;
  485. height: 90px !important;
  486. }
  487. /deep/ .bbb .flex-start {
  488. background: rgba(0, 0, 0, 0) !important;
  489. padding: 0 !important;
  490. width: 100% !important;
  491. text-align: center;
  492. margin-top: 30px;
  493. }
  494. /deep/ .lunbo1 {
  495. margin: 0 !important;
  496. padding: 8px !important;
  497. margin-top: 20px !important;
  498. }
  499. .remenzan {
  500. width: 18px !important;
  501. margin-top: 10px;
  502. }
  503. .remen .logo {
  504. width: 100%;
  505. }
  506. .more {
  507. text-align: center;
  508. }
  509. .more image {
  510. margin-right: 10px;
  511. vertical-align: middle;
  512. }
  513. .chuandaimg {
  514. width: 50% !important;
  515. }
  516. .chuandazi {
  517. width: 48% !important;
  518. }
  519. /deep/ .lunbo1 .fulled {
  520. width: 100% !important;
  521. }
  522. /deep/ .gengduo {
  523. width: 30px !important;
  524. margin-top: 10px !important;
  525. }
  526. </style>