pageSpecial.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. }
  165. const url = typeMap[pros.linkType]
  166. uni.navigateTo({
  167. url:url
  168. })
  169. }
  170. },
  171. LiveGoPath(){//查看直播
  172. this.$api.navigateTo('/pages/h5/article/path-live')
  173. // uni.navigateToMiniProgram({
  174. // appId: 'wx92d650b253f8f2e3',
  175. // path: '/pages/index/index',
  176. // extraData: {
  177. // 'data1': 'test'
  178. // },
  179. // envVersion: 'develop',
  180. // success(res) {
  181. // // 打开成功
  182. // console.log(res)
  183. // }
  184. // })
  185. },
  186. LiveGoPathPros(live){
  187. // 友盟埋点首页直播模块点击
  188. if(process.env.NODE_ENV != 'development'){
  189. this.$uma.trackEvent('Um_Event_HomeLiveTemplateClick', {
  190. Um_Key_LiveName: `${live.liveTitle}`,
  191. Um_Key_PageName: '首页直播模块',
  192. Um_Key_SourcePage: '商城首页',
  193. })
  194. }
  195. this.$api.navigateTo(`/pages/h5/article/page-image?title=${live.liveTitle}&image=${live.advertisingImage}`)
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="scss">
  201. .container-pages{
  202. width: 100%;
  203. height:508rpx;
  204. padding: 24rpx;
  205. float: left;
  206. background-color: #F7F7F7;
  207. box-sizing: border-box;
  208. background-color: #F7F7F7;
  209. overflow: hidden;
  210. display: flex;
  211. align-items: center;
  212. .tui-goods__list {
  213. display: flex;
  214. align-items: center;
  215. }
  216. .tui-goods__item {
  217. background-color: #fff;
  218. width: 307rpx;
  219. height: 460rpx;
  220. border-radius: 16rpx;
  221. box-sizing: border-box;
  222. margin-right: 16rpx;
  223. padding: 17rpx;
  224. }
  225. .tui-group-name{
  226. width: 100%;
  227. height: 36rpx;
  228. float: left;
  229. margin-bottom: 13rpx;
  230. .tui-group-title{
  231. font-size: 26rpx;
  232. line-height: 36rpx;
  233. float: left;
  234. color: #333333;
  235. }
  236. .icon-xiayibu{
  237. font-size: 26rpx;
  238. line-height: 36rpx;
  239. float: right;
  240. color: #909090;
  241. }
  242. }
  243. .tui-goods__main{
  244. width: 100%;
  245. height: auto;
  246. float: left;
  247. position: relative;
  248. &.one{
  249. margin-bottom: 14rpx;
  250. }
  251. }
  252. .tui-goods__imgbox {
  253. width: 273rpx;
  254. height: 273rpx;
  255. box-sizing: border-box;
  256. border-radius: 8rpx;
  257. }
  258. .tui-goods__img {
  259. max-width: 273rpx;
  260. max-height: 273rpx;
  261. border-radius: 8rpx;
  262. display: block;
  263. }
  264. .tui-goods__name{
  265. width: 100%;
  266. height: 48rpx;
  267. float: left;
  268. line-height: 48rpx;
  269. box-sizing: border-box;
  270. padding-left: 12rpx;
  271. font-size: $font-size-24;
  272. color: #FFFFFF;
  273. background-color: rgba(0,0,0,0.4);
  274. position: absolute;
  275. bottom: 0;
  276. left: 0;
  277. white-space: nowrap;
  278. text-overflow: ellipsis;
  279. overflow: hidden;
  280. border-radius:0 0 8rpx 8rpx;
  281. }
  282. .tui-goods__statu{
  283. padding-left: 45rpx;
  284. padding-right: 10rpx;
  285. height: 35rpx;
  286. position: absolute;
  287. top: 17rpx;
  288. left: 17rpx;
  289. background-color: rgba(0,0,0,0.4);
  290. border-radius: 18rpx;
  291. line-height: 35rpx;
  292. color: #FFFFFF;
  293. text-align: right;
  294. font-size: $font-size-20;
  295. .icon-live{
  296. width: 17rpx;
  297. height: 17rpx;
  298. display: block;
  299. margin: 0 auto;
  300. position: absolute;
  301. left: 15rpx;
  302. top: 9rpx;
  303. }
  304. .iconfont{
  305. width: 35rpx;
  306. height: 35rpx;
  307. line-height: 35rpx;
  308. display: block;
  309. position: absolute;
  310. left: 10rpx;
  311. font-size: $font-size-26;
  312. &.icon-weikaishi{
  313. color: #E56D00;
  314. left:0;
  315. }
  316. &.icon-jieshu{
  317. color: #FFFFFF;
  318. left:0;
  319. font-size: 22rpx;
  320. }
  321. }
  322. }
  323. .tui-goods__text{
  324. width: 100%;
  325. height: 44rpx;
  326. float: left;
  327. line-height: 44rpx;
  328. box-sizing: border-box;
  329. padding-left: 12rpx;
  330. font-size: $font-size-24;
  331. color: #666666;
  332. white-space: nowrap;
  333. text-overflow: ellipsis;
  334. overflow: hidden;
  335. position: relative;
  336. &::before{
  337. content: '';
  338. width: 8rpx;
  339. height: 8rpx;
  340. border-radius: 50%;
  341. background-color: #cccccc;
  342. position: absolute;
  343. left: 0;
  344. top: 18rpx;
  345. }
  346. }
  347. }
  348. </style>