pageSpecial.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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(`/pages/h5/article/path?link=${LINK}`)
  106. },
  107. NewActivityList(){
  108. this.$api.navigateTo('/pages/h5/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:`/pages/h5/activity/activity?title=${pros.title}&link=${pros.appletsLink}`,
  131. 5:`/pages/goods/product?id=${pros.linkParam.id}`,
  132. // 7:`/pages/supplier/user/my-shop?shopId=${pros.linkParam.id}`,
  133. 8:`/pages/h5/activity/activity-list`,
  134. 9:`/pages/second/form/introduce`,
  135. 10:`/pages/second/product/product-list`,
  136. 11:`/pages/second/form/form`,
  137. 12:`/pages/search/search?keyWord=${pros.linkParam.keyword}`,
  138. 13:`/pages/h5/article/path?link=${pros.link}`,
  139. 14:`/pages/h5/article/path?link=${pros.link}`,
  140. 15:`/pages/h5/article/path?link=${pros.link}`,
  141. 17:`/pages/login/register-select`,
  142. 18:`/pages/h5/article/path?link=${pros.link}`,
  143. 19:`/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('/pages/h5/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(`/pages/h5/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. box-sizing: border-box;
  188. background-color: #F7F7F7;
  189. overflow: hidden;
  190. display: flex;
  191. align-items: center;
  192. .tui-goods__list {
  193. display: flex;
  194. align-items: center;
  195. }
  196. .tui-goods__item {
  197. background-color: #fff;
  198. width: 307rpx;
  199. height: 460rpx;
  200. border-radius: 16rpx;
  201. box-sizing: border-box;
  202. margin-right: 16rpx;
  203. padding: 17rpx;
  204. }
  205. .tui-group-name{
  206. width: 100%;
  207. height: 36rpx;
  208. float: left;
  209. margin-bottom: 13rpx;
  210. .tui-group-title{
  211. font-size: 26rpx;
  212. line-height: 36rpx;
  213. float: left;
  214. color: #333333;
  215. }
  216. .icon-xiayibu{
  217. font-size: 26rpx;
  218. line-height: 36rpx;
  219. float: right;
  220. color: #909090;
  221. }
  222. }
  223. .tui-goods__main{
  224. width: 100%;
  225. height: auto;
  226. float: left;
  227. position: relative;
  228. &.one{
  229. margin-bottom: 14rpx;
  230. }
  231. }
  232. .tui-goods__imgbox {
  233. width: 273rpx;
  234. height: 273rpx;
  235. box-sizing: border-box;
  236. border-radius: 8rpx;
  237. }
  238. .tui-goods__img {
  239. max-width: 273rpx;
  240. max-height: 273rpx;
  241. border-radius: 8rpx;
  242. display: block;
  243. }
  244. .tui-goods__name{
  245. width: 100%;
  246. height: 48rpx;
  247. float: left;
  248. line-height: 48rpx;
  249. box-sizing: border-box;
  250. padding-left: 12rpx;
  251. font-size: $font-size-24;
  252. color: #FFFFFF;
  253. background-color: rgba(0,0,0,0.4);
  254. position: absolute;
  255. bottom: 0;
  256. left: 0;
  257. white-space: nowrap;
  258. text-overflow: ellipsis;
  259. overflow: hidden;
  260. border-radius:0 0 8rpx 8rpx;
  261. }
  262. .tui-goods__statu{
  263. padding-left: 45rpx;
  264. padding-right: 10rpx;
  265. height: 35rpx;
  266. position: absolute;
  267. top: 17rpx;
  268. left: 17rpx;
  269. background-color: rgba(0,0,0,0.4);
  270. border-radius: 18rpx;
  271. line-height: 35rpx;
  272. color: #FFFFFF;
  273. text-align: right;
  274. font-size: $font-size-20;
  275. .icon-live{
  276. width: 17rpx;
  277. height: 17rpx;
  278. display: block;
  279. margin: 0 auto;
  280. position: absolute;
  281. left: 15rpx;
  282. top: 9rpx;
  283. }
  284. .iconfont{
  285. width: 35rpx;
  286. height: 35rpx;
  287. line-height: 35rpx;
  288. display: block;
  289. position: absolute;
  290. left: 10rpx;
  291. font-size: $font-size-26;
  292. &.icon-weikaishi{
  293. color: #E56D00;
  294. left:0;
  295. }
  296. &.icon-jieshu{
  297. color: #FFFFFF;
  298. left:0;
  299. font-size: 22rpx;
  300. }
  301. }
  302. }
  303. .tui-goods__text{
  304. width: 100%;
  305. height: 44rpx;
  306. float: left;
  307. line-height: 44rpx;
  308. box-sizing: border-box;
  309. padding-left: 12rpx;
  310. font-size: $font-size-24;
  311. color: #666666;
  312. white-space: nowrap;
  313. text-overflow: ellipsis;
  314. overflow: hidden;
  315. position: relative;
  316. &::before{
  317. content: '';
  318. width: 8rpx;
  319. height: 8rpx;
  320. border-radius: 50%;
  321. background-color: #cccccc;
  322. position: absolute;
  323. left: 0;
  324. top: 18rpx;
  325. }
  326. }
  327. }
  328. </style>