pageSpecial.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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="shopAdvert.length>0">
  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 shopAdvert" :key="item">
  16. <view class="tui-goods__ross" @click="NavToDetailPage(item)">
  17. <image class="ross-image" :src="item.appImage" mode=""></image>
  18. </view>
  19. </swiper-item>
  20. </swiper>
  21. <view class="swiper__dots-box">
  22. <view
  23. v-for="(item, idx) in shopAdvert"
  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. current: 0 ,// 切换轮播
  145. iconLive: 'https://static.caimei365.com/app/img/icon/icon-live.gif'
  146. }
  147. },
  148. filters: {
  149. statusType: function(value) {
  150. switch (value) {
  151. case 1:
  152. return '未开始'
  153. break
  154. case 2:
  155. return '直播中'
  156. break
  157. case 3:
  158. return '看回放'
  159. break
  160. }
  161. },
  162. NumFormat: function(value) {
  163. //处理金额
  164. return Number(value).toFixed(2)
  165. }
  166. },
  167. created() {
  168. this.initData(this.templateData)
  169. },
  170. computed: {
  171. ...mapState(['shopAdvert'])
  172. },
  173. methods: {
  174. initData(data) {
  175. this.tempData = data
  176. },
  177. swiperChange(e) {//轮播图切换
  178. this.current = e.detail.current
  179. },
  180. NavToDetailPage(item) {
  181. //跳转
  182. this.$api.FlooryNavigateTo(item)
  183. },
  184. NavArticlePath(LINK) {
  185. // 友盟埋点首页文章模块点击
  186. if (process.env.NODE_ENV != 'development') {
  187. this.$uma.trackEvent('Um_Event_HomeArticleTemplateClick', {
  188. Um_Key_ArticleLink: `${LINK}`,
  189. Um_Key_PageName: '首页文章模块',
  190. Um_Key_SourcePage: '商城首页'
  191. })
  192. }
  193. // 采美埋点首页文章模块数据统计
  194. this.cmsSysStatistics(4)
  195. this.$api.navigateTo(`/pages/h5/article/path?link=${LINK}`)
  196. },
  197. NewActivityList() {
  198. this.$api.navigateTo('/pages/h5/activity/activity-list')
  199. },
  200. NewActivityListPath(pros) {
  201. // 友盟埋点首页活动模块点击
  202. if (process.env.NODE_ENV != 'development') {
  203. this.$uma.trackEvent('Um_Event_HomeActivityTemplateClick', {
  204. Um_Key_ActivityName: `${pros.title}`,
  205. Um_Key_PageName: '首页活动模块',
  206. Um_Key_SourcePage: '商城首页'
  207. })
  208. }
  209. // 采美埋点首页活动模块数据统计
  210. this.cmsSysStatistics(3)
  211. /**
  212. * 页面跳转类型
  213. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  214. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  215. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  216. **/
  217. if (pros.linkType) {
  218. console.log(pros.linkType)
  219. const typeMap = {
  220. 1: `/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
  221. 2: `/pages/goods/instrument-details?id=${pros.linkParam.id}`,
  222. 4:`/pages/h5/activity/activity?link=${pros.appletsLink}&linkId=${pros.linkParam.id}`,
  223. 5: `/pages/goods/product?id=${pros.linkParam.id}`,
  224. // 7:`/pages/supplier/user/my-shop?shopId=${pros.linkParam.id}`,
  225. 8: '/pages/h5/activity/activity-list',
  226. 9: '/pages/second/form/introduce',
  227. 10: '/pages/second/product/product-list',
  228. 11: '/pages/second/form/form',
  229. 12: `/pages/search/search?keyWord=${pros.linkParam.keyword}`,
  230. 13: `/pages/h5/article/path?link=${pros.link}`,
  231. 14: `/pages/h5/article/path?link=${pros.link}`,
  232. 15: `/pages/h5/article/path?link=${pros.link}`,
  233. 17: '/pages/login/register-select',
  234. 18: `/pages/h5/article/path?link=${pros.link}`,
  235. 19: `/pages/search/search-supplier?keyWord=${pros.linkParam.keyword}`,
  236. 20: `/pages/goods/good-floor?linkId=${pros.linkParam.id}&title=${pros.name}`,
  237. 21: '/pages/h5/activity/meobohui',
  238. 22: `/pages/goods/good-floor-temp?linkId=${pros.linkParam.id}&title=${pros.name}`,
  239. 23: `/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`, //活动专题页面
  240. 25: '/pages/goods/goods-doc-list', //美业资料
  241. 28: `/pages/h5/article/path?link=${pros.link}`, // 采美认证通
  242. 29: '/pages/user/coupon/coupon-collection' //领券中心
  243. }
  244. const url = typeMap[pros.linkType]
  245. uni.navigateTo({
  246. url: url
  247. })
  248. }
  249. },
  250. LiveGoPath() {
  251. //查看直播
  252. this.$api.navigateTo('/pages/h5/article/path-live')
  253. // uni.navigateToMiniProgram({
  254. // appId: 'wx92d650b253f8f2e3',
  255. // path: '/pages/index/index',
  256. // extraData: {
  257. // 'data1': 'test'
  258. // },
  259. // envVersion: 'develop',
  260. // success(res) {
  261. // // 打开成功
  262. // console.log(res)
  263. // }
  264. // })
  265. },
  266. LiveGoPathPros(live) {
  267. // 友盟埋点首页直播模块点击
  268. if (process.env.NODE_ENV != 'development') {
  269. this.$uma.trackEvent('Um_Event_HomeLiveTemplateClick', {
  270. Um_Key_LiveName: `${live.liveTitle}`,
  271. Um_Key_PageName: '首页直播模块',
  272. Um_Key_SourcePage: '商城首页'
  273. })
  274. }
  275. // 采美埋点首页直播模块数据统计
  276. this.cmsSysStatistics(2)
  277. this.$api.navigateTo(`/pages/h5/article/page-image?title=${live.liveTitle}&image=${live.advertisingImage}`)
  278. }
  279. }
  280. }
  281. </script>
  282. <style lang="scss">
  283. .container-pages {
  284. width: 100%;
  285. height: 508rpx;
  286. padding: 24rpx;
  287. float: left;
  288. background-color: #f7f7f7;
  289. box-sizing: border-box;
  290. background-color: #f7f7f7;
  291. overflow: hidden;
  292. display: flex;
  293. align-items: center;
  294. .tui-goods__list {
  295. display: flex;
  296. align-items: center;
  297. }
  298. .tui-goods__item {
  299. background-color: #fff;
  300. width: 307rpx;
  301. height: 460rpx;
  302. border-radius: 16rpx;
  303. box-sizing: border-box;
  304. margin-right: 16rpx;
  305. padding: 17rpx;
  306. &.ross{
  307. padding: 0;
  308. position: relative;
  309. .swiper__dots-box{
  310. position: absolute;
  311. bottom: 30rpx;
  312. left: 0;
  313. right: 0;
  314. /* #ifndef APP-NVUE */
  315. display: flex;
  316. /* #endif */
  317. flex: 1;
  318. flex-direction: row;
  319. justify-content: center;
  320. align-items: center;
  321. .swiper__dots-item{
  322. width: 8rpx;
  323. height: 8rpx;
  324. border-radius: 100%;
  325. margin-left: 6px;
  326. background-color:rgba(255,255,255,.7);
  327. }
  328. .swiper__dots-long{
  329. width: 35rpx;
  330. height: 8rpx;
  331. border-radius: 4rpx;
  332. background-color: #ffff;
  333. transition: all 0.4s;
  334. }
  335. }
  336. }
  337. .tui-goods__ross{
  338. width: 307rpx;
  339. height: 460rpx;
  340. text-align: center;
  341. line-height: 460rpx;
  342. color: #fff;
  343. font-size: 40rpx;
  344. float: left;
  345. border-radius: 16rpx;
  346. .ross-image{
  347. width: 100%;
  348. height: 100%;
  349. border-radius: 16rpx;
  350. display: block;
  351. }
  352. }
  353. }
  354. .tui-group-name {
  355. width: 100%;
  356. height: 36rpx;
  357. float: left;
  358. margin-bottom: 13rpx;
  359. .tui-group-title {
  360. font-size: 26rpx;
  361. line-height: 36rpx;
  362. float: left;
  363. color: #333333;
  364. }
  365. .icon-xiayibu {
  366. font-size: 26rpx;
  367. line-height: 36rpx;
  368. float: right;
  369. color: #909090;
  370. }
  371. }
  372. .tui-goods__main {
  373. width: 100%;
  374. height: auto;
  375. float: left;
  376. position: relative;
  377. &.one {
  378. margin-bottom: 14rpx;
  379. }
  380. }
  381. .tui-goods__imgbox {
  382. width: 273rpx;
  383. height: 273rpx;
  384. box-sizing: border-box;
  385. border-radius: 8rpx;
  386. }
  387. .tui-goods__img {
  388. max-width: 273rpx;
  389. max-height: 273rpx;
  390. border-radius: 8rpx;
  391. display: block;
  392. }
  393. .tui-goods__name {
  394. width: 100%;
  395. height: 48rpx;
  396. float: left;
  397. line-height: 48rpx;
  398. box-sizing: border-box;
  399. padding-left: 12rpx;
  400. font-size: $font-size-24;
  401. color: #ffffff;
  402. background-color: rgba(0, 0, 0, 0.4);
  403. position: absolute;
  404. bottom: 0;
  405. left: 0;
  406. white-space: nowrap;
  407. text-overflow: ellipsis;
  408. overflow: hidden;
  409. border-radius: 0 0 8rpx 8rpx;
  410. }
  411. .tui-goods__statu {
  412. padding-left: 45rpx;
  413. padding-right: 10rpx;
  414. height: 35rpx;
  415. position: absolute;
  416. top: 17rpx;
  417. left: 17rpx;
  418. background-color: rgba(0, 0, 0, 0.4);
  419. border-radius: 18rpx;
  420. line-height: 35rpx;
  421. color: #ffffff;
  422. text-align: right;
  423. font-size: $font-size-20;
  424. .icon-live {
  425. width: 17rpx;
  426. height: 17rpx;
  427. display: block;
  428. margin: 0 auto;
  429. position: absolute;
  430. left: 15rpx;
  431. top: 9rpx;
  432. }
  433. .iconfont {
  434. width: 35rpx;
  435. height: 35rpx;
  436. line-height: 35rpx;
  437. display: block;
  438. position: absolute;
  439. left: 10rpx;
  440. font-size: $font-size-26;
  441. &.icon-weikaishi {
  442. color: #e56d00;
  443. left: 0;
  444. }
  445. &.icon-jieshu {
  446. color: #ffffff;
  447. left: 0;
  448. font-size: 22rpx;
  449. }
  450. }
  451. }
  452. .tui-goods__text {
  453. width: 100%;
  454. height: 44rpx;
  455. float: left;
  456. line-height: 44rpx;
  457. box-sizing: border-box;
  458. padding-left: 12rpx;
  459. font-size: $font-size-24;
  460. color: #666666;
  461. white-space: nowrap;
  462. text-overflow: ellipsis;
  463. overflow: hidden;
  464. position: relative;
  465. &::before {
  466. content: '';
  467. width: 8rpx;
  468. height: 8rpx;
  469. border-radius: 50%;
  470. background-color: #cccccc;
  471. position: absolute;
  472. left: 0;
  473. top: 18rpx;
  474. }
  475. }
  476. }
  477. </style>