pageSpecial.vue 11 KB

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