pageSpecial.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template name="pagesProduct">
  2. <view>
  3. <view class="container-pages clearfix">
  4. <scroll-view scroll-x>
  5. <view class="tui-goods__list">
  6. <view class="tui-goods__item ross" v-if="advertisement">
  7. <swiper class="tui-goods__ross"
  8. circular
  9. @change="swiperChange"
  10. :indicator-dots="false"
  11. :autoplay="true"
  12. :interval="5000"
  13. :duration="500"
  14. >
  15. <swiper-item v-for="(item, index) in advertisement" :key="item">
  16. <view class="tui-goods__ross" @click="this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=1378')">
  17. <image class="ross-image" :src="item" mode=""></image>
  18. </view>
  19. </swiper-item>
  20. </swiper>
  21. <view class="swiper__dots-box">
  22. <view
  23. v-for="(item, idx) in advertisement"
  24. :key="idx"
  25. :class="[idx === current ? 'swiper__dots-long' : 'none']"
  26. :data-index="current"
  27. class="swiper__dots-item"
  28. ></view>
  29. </view>
  30. </view>
  31. <view class="tui-goods__item" v-if="tempData.liveList != ''">
  32. <view class="tui-group-name" @click="LiveGoPath">
  33. <view class="tui-group-title"><text>采美LIVE</text></view>
  34. <view class="iconfont icon-xiayibu"></view>
  35. </view>
  36. <view
  37. class="tui-goods__main"
  38. :class="flIndex == 0 ? 'one' : ''"
  39. v-for="(live, flIndex) in tempData.liveList"
  40. :key="flIndex"
  41. @click="LiveGoPathPros(live)"
  42. >
  43. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  44. <image :src="live.homePageImage" mode="" class="tui-goods__img"></image>
  45. <view class="tui-goods__name">{{ live.liveTitle }}</view>
  46. <view class="tui-goods__statu">
  47. <text class="iconfont icon-weikaishi" v-if="live.liveStatus == 1"></text>
  48. <image
  49. :src="iconLive"
  50. mode="widthFix"
  51. class="icon-live"
  52. v-if="live.liveStatus == 2"
  53. ></image>
  54. <text class="iconfont icon-jieshu" v-if="live.liveStatus == 3"></text>
  55. <text>{{ live.liveStatus | statusType }}</text>
  56. </view>
  57. </view>
  58. <view class="tui-goods__text" v-if="flIndex > 0">{{ live.liveTitle }}</view>
  59. </view>
  60. </view>
  61. <view class="tui-goods__item" v-if="tempData.cmImageList != ''">
  62. <view class="tui-group-name" @click="NewActivityList">
  63. <view class="tui-group-title"><text>最新活动</text></view>
  64. <view class="iconfont icon-xiayibu"></view>
  65. </view>
  66. <view
  67. class="tui-goods__main"
  68. :class="flIndex == 0 ? 'one' : ''"
  69. v-for="(cmImage, flIndex) in tempData.cmImageList"
  70. :key="flIndex"
  71. @click="NewActivityListPath(cmImage)"
  72. >
  73. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  74. <image :src="cmImage.homePageImage" mode="" class="tui-goods__img"></image>
  75. <view class="tui-goods__name">{{ cmImage.title }}</view>
  76. </view>
  77. <view class="tui-goods__text" v-if="flIndex > 0">{{ cmImage.title }}</view>
  78. </view>
  79. </view>
  80. <view class="tui-goods__item" v-if="tempData.infoList != ''">
  81. <view
  82. class="tui-group-name"
  83. @click="NavArticlePath('https://www.caimei365.com/info/center-3-1.html')"
  84. >
  85. <view class="tui-group-title"><text>热门文章</text></view>
  86. <view class="iconfont icon-xiayibu"></view>
  87. </view>
  88. <view
  89. class="tui-goods__main"
  90. :class="flIndex == 0 ? 'one' : ''"
  91. v-for="(info, flIndex) in tempData.infoList"
  92. :key="flIndex"
  93. @click="NavArticlePath(info.link)"
  94. >
  95. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  96. <image :src="info.homePageImage" mode="" class="tui-goods__img"></image>
  97. <view class="tui-goods__name">{{ info.title }}</view>
  98. </view>
  99. <view class="tui-goods__text" v-if="flIndex > 0">{{ info.title }}</view>
  100. </view>
  101. </view>
  102. <!-- 采美百科 -->
  103. <view class="tui-goods__item" v-if="tempData.baikeList.length > 0">
  104. <view
  105. class="tui-group-name"
  106. @click="NavArticlePath('https://www.caimei365.com/encyclopedia/product.html')"
  107. >
  108. <view class="tui-group-title"><text>热门百科</text></view>
  109. <view class="iconfont icon-xiayibu"></view>
  110. </view>
  111. <view
  112. class="tui-goods__main"
  113. :class="flIndex == 0 ? 'one' : ''"
  114. v-for="(item, flIndex) in tempData.baikeList"
  115. :key="flIndex"
  116. @click="NavArticlePath(item.link)"
  117. >
  118. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  119. <image :src="item.image" mode="" class="tui-goods__img"></image>
  120. <view class="tui-goods__name">{{ item.name }}</view>
  121. </view>
  122. <view class="tui-goods__text" v-if="flIndex > 0">{{ item.name }}</view>
  123. </view>
  124. </view>
  125. </view>
  126. </scroll-view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import { mapState, mapMutations } from 'vuex'
  132. import cmsMixins from '@/mixins/cmsMixins.js'
  133. export default {
  134. mixins: [cmsMixins],
  135. name: 'pagesProduct',
  136. props: {
  137. templateData: {
  138. type: Object
  139. }
  140. },
  141. data() {
  142. return {
  143. tempData: {},
  144. advertisement:[
  145. 'https://www.caimei365.com/img/ross/ross-image@1x.jpg',
  146. 'https://img.caimei365.com/group1/M00/00/A4/rB-lF2TxdE-AAOcgAAGPzubpUIU968.jpg',
  147. 'https://img.caimei365.com/group1/M00/04/92/rB-lGGT32GiAbNIMAANwZbKVhEE875.jpg'
  148. ],
  149. current: 0 ,// 切换轮播
  150. iconLive: 'https://static.caimei365.com/app/img/icon/icon-live.gif'
  151. }
  152. },
  153. filters: {
  154. statusType: function(value) {
  155. switch (value) {
  156. case 1:
  157. return '未开始'
  158. break
  159. case 2:
  160. return '直播中'
  161. break
  162. case 3:
  163. return '看回放'
  164. break
  165. }
  166. },
  167. NumFormat: function(value) {
  168. //处理金额
  169. return Number(value).toFixed(2)
  170. }
  171. },
  172. created() {
  173. this.initData(this.templateData)
  174. },
  175. computed: {
  176. ...mapState(['isRossShow'])
  177. },
  178. methods: {
  179. initData(data) {
  180. this.tempData = data
  181. },
  182. swiperChange(e) {//轮播图切换
  183. this.current = e.detail.current
  184. },
  185. NavArticlePath(LINK) {
  186. // 友盟埋点首页文章模块点击
  187. if (process.env.NODE_ENV != 'development') {
  188. this.$uma.trackEvent('Um_Event_HomeArticleTemplateClick', {
  189. Um_Key_ArticleLink: `${LINK}`,
  190. Um_Key_PageName: '首页文章模块',
  191. Um_Key_SourcePage: '商城首页'
  192. })
  193. }
  194. // 采美埋点首页文章模块数据统计
  195. this.cmsSysStatistics(4)
  196. this.$api.navigateTo(`/pages/h5/article/path?link=${LINK}`)
  197. },
  198. NewActivityList() {
  199. this.$api.navigateTo('/pages/h5/activity/activity-list')
  200. },
  201. NewActivityListPath(pros) {
  202. // 友盟埋点首页活动模块点击
  203. if (process.env.NODE_ENV != 'development') {
  204. this.$uma.trackEvent('Um_Event_HomeActivityTemplateClick', {
  205. Um_Key_ActivityName: `${pros.title}`,
  206. Um_Key_PageName: '首页活动模块',
  207. Um_Key_SourcePage: '商城首页'
  208. })
  209. }
  210. // 采美埋点首页活动模块数据统计
  211. this.cmsSysStatistics(3)
  212. /**
  213. * 页面跳转类型
  214. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  215. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  216. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  217. **/
  218. if (pros.linkType) {
  219. console.log(pros.linkType)
  220. const typeMap = {
  221. 1: `/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
  222. 2: `/pages/goods/instrument-details?id=${pros.linkParam.id}`,
  223. 4:`/pages/h5/activity/activity?link=${pros.appletsLink}&linkId=${pros.linkParam.id}`,
  224. 5: `/pages/goods/product?id=${pros.linkParam.id}`,
  225. // 7:`/pages/supplier/user/my-shop?shopId=${pros.linkParam.id}`,
  226. 8: '/pages/h5/activity/activity-list',
  227. 9: '/pages/second/form/introduce',
  228. 10: '/pages/second/product/product-list',
  229. 11: '/pages/second/form/form',
  230. 12: `/pages/search/search?keyWord=${pros.linkParam.keyword}`,
  231. 13: `/pages/h5/article/path?link=${pros.link}`,
  232. 14: `/pages/h5/article/path?link=${pros.link}`,
  233. 15: `/pages/h5/article/path?link=${pros.link}`,
  234. 17: '/pages/login/register-select',
  235. 18: `/pages/h5/article/path?link=${pros.link}`,
  236. 19: `/pages/search/search-supplier?keyWord=${pros.linkParam.keyword}`,
  237. 20: `/pages/goods/good-floor?linkId=${pros.linkParam.id}&title=${pros.name}`,
  238. 21: '/pages/h5/activity/meobohui',
  239. 22: `/pages/goods/good-floor-temp?linkId=${pros.linkParam.id}&title=${pros.name}`,
  240. 23: `/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`, //活动专题页面
  241. 25: '/pages/goods/goods-doc-list', //美业资料
  242. 28: `/pages/h5/article/path?link=${pros.link}`, // 采美认证通
  243. 29: '/pages/user/coupon/coupon-collection' //领券中心
  244. }
  245. const url = typeMap[pros.linkType]
  246. uni.navigateTo({
  247. url: url
  248. })
  249. }
  250. },
  251. LiveGoPath() {
  252. //查看直播
  253. this.$api.navigateTo('/pages/h5/article/path-live')
  254. // uni.navigateToMiniProgram({
  255. // appId: 'wx92d650b253f8f2e3',
  256. // path: '/pages/index/index',
  257. // extraData: {
  258. // 'data1': 'test'
  259. // },
  260. // envVersion: 'develop',
  261. // success(res) {
  262. // // 打开成功
  263. // console.log(res)
  264. // }
  265. // })
  266. },
  267. LiveGoPathPros(live) {
  268. // 友盟埋点首页直播模块点击
  269. if (process.env.NODE_ENV != 'development') {
  270. this.$uma.trackEvent('Um_Event_HomeLiveTemplateClick', {
  271. Um_Key_LiveName: `${live.liveTitle}`,
  272. Um_Key_PageName: '首页直播模块',
  273. Um_Key_SourcePage: '商城首页'
  274. })
  275. }
  276. // 采美埋点首页直播模块数据统计
  277. this.cmsSysStatistics(2)
  278. this.$api.navigateTo(`/pages/h5/article/page-image?title=${live.liveTitle}&image=${live.advertisingImage}`)
  279. }
  280. }
  281. }
  282. </script>
  283. <style lang="scss">
  284. .container-pages {
  285. width: 100%;
  286. height: 508rpx;
  287. padding: 24rpx;
  288. float: left;
  289. background-color: #f7f7f7;
  290. box-sizing: border-box;
  291. background-color: #f7f7f7;
  292. overflow: hidden;
  293. display: flex;
  294. align-items: center;
  295. .tui-goods__list {
  296. display: flex;
  297. align-items: center;
  298. }
  299. .tui-goods__item {
  300. background-color: #fff;
  301. width: 307rpx;
  302. height: 460rpx;
  303. border-radius: 16rpx;
  304. box-sizing: border-box;
  305. margin-right: 16rpx;
  306. padding: 17rpx;
  307. &.ross{
  308. padding: 0;
  309. position: relative;
  310. .swiper__dots-box{
  311. position: absolute;
  312. bottom: 30rpx;
  313. left: 0;
  314. right: 0;
  315. /* #ifndef APP-NVUE */
  316. display: flex;
  317. /* #endif */
  318. flex: 1;
  319. flex-direction: row;
  320. justify-content: center;
  321. align-items: center;
  322. .swiper__dots-item{
  323. width: 8rpx;
  324. height: 8rpx;
  325. border-radius: 100%;
  326. margin-left: 6px;
  327. background-color:rgba(255,255,255,.7);
  328. }
  329. .swiper__dots-long{
  330. width: 35rpx;
  331. height: 8rpx;
  332. border-radius: 4rpx;
  333. background-color: #ffff;
  334. transition: all 0.4s;
  335. }
  336. }
  337. }
  338. .tui-goods__ross{
  339. width: 307rpx;
  340. height: 460rpx;
  341. text-align: center;
  342. line-height: 460rpx;
  343. color: #fff;
  344. font-size: 40rpx;
  345. float: left;
  346. border-radius: 16rpx;
  347. .ross-image{
  348. width: 100%;
  349. height: 100%;
  350. border-radius: 16rpx;
  351. display: block;
  352. }
  353. }
  354. }
  355. .tui-group-name {
  356. width: 100%;
  357. height: 36rpx;
  358. float: left;
  359. margin-bottom: 13rpx;
  360. .tui-group-title {
  361. font-size: 26rpx;
  362. line-height: 36rpx;
  363. float: left;
  364. color: #333333;
  365. }
  366. .icon-xiayibu {
  367. font-size: 26rpx;
  368. line-height: 36rpx;
  369. float: right;
  370. color: #909090;
  371. }
  372. }
  373. .tui-goods__main {
  374. width: 100%;
  375. height: auto;
  376. float: left;
  377. position: relative;
  378. &.one {
  379. margin-bottom: 14rpx;
  380. }
  381. }
  382. .tui-goods__imgbox {
  383. width: 273rpx;
  384. height: 273rpx;
  385. box-sizing: border-box;
  386. border-radius: 8rpx;
  387. }
  388. .tui-goods__img {
  389. max-width: 273rpx;
  390. max-height: 273rpx;
  391. border-radius: 8rpx;
  392. display: block;
  393. }
  394. .tui-goods__name {
  395. width: 100%;
  396. height: 48rpx;
  397. float: left;
  398. line-height: 48rpx;
  399. box-sizing: border-box;
  400. padding-left: 12rpx;
  401. font-size: $font-size-24;
  402. color: #ffffff;
  403. background-color: rgba(0, 0, 0, 0.4);
  404. position: absolute;
  405. bottom: 0;
  406. left: 0;
  407. white-space: nowrap;
  408. text-overflow: ellipsis;
  409. overflow: hidden;
  410. border-radius: 0 0 8rpx 8rpx;
  411. }
  412. .tui-goods__statu {
  413. padding-left: 45rpx;
  414. padding-right: 10rpx;
  415. height: 35rpx;
  416. position: absolute;
  417. top: 17rpx;
  418. left: 17rpx;
  419. background-color: rgba(0, 0, 0, 0.4);
  420. border-radius: 18rpx;
  421. line-height: 35rpx;
  422. color: #ffffff;
  423. text-align: right;
  424. font-size: $font-size-20;
  425. .icon-live {
  426. width: 17rpx;
  427. height: 17rpx;
  428. display: block;
  429. margin: 0 auto;
  430. position: absolute;
  431. left: 15rpx;
  432. top: 9rpx;
  433. }
  434. .iconfont {
  435. width: 35rpx;
  436. height: 35rpx;
  437. line-height: 35rpx;
  438. display: block;
  439. position: absolute;
  440. left: 10rpx;
  441. font-size: $font-size-26;
  442. &.icon-weikaishi {
  443. color: #e56d00;
  444. left: 0;
  445. }
  446. &.icon-jieshu {
  447. color: #ffffff;
  448. left: 0;
  449. font-size: 22rpx;
  450. }
  451. }
  452. }
  453. .tui-goods__text {
  454. width: 100%;
  455. height: 44rpx;
  456. float: left;
  457. line-height: 44rpx;
  458. box-sizing: border-box;
  459. padding-left: 12rpx;
  460. font-size: $font-size-24;
  461. color: #666666;
  462. white-space: nowrap;
  463. text-overflow: ellipsis;
  464. overflow: hidden;
  465. position: relative;
  466. &::before {
  467. content: '';
  468. width: 8rpx;
  469. height: 8rpx;
  470. border-radius: 50%;
  471. background-color: #cccccc;
  472. position: absolute;
  473. left: 0;
  474. top: 18rpx;
  475. }
  476. }
  477. }
  478. </style>