pageSpecial.vue 12 KB

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