pageSpecial.vue 9.5 KB

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