pageSpecial.vue 11 KB

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