pageSpecial.vue 10 KB

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