pageSpecial.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. this.$api.navigateTo(`/h5/pages/article/path?link=${LINK}`)
  98. },
  99. NewActivityList(){
  100. this.$api.navigateTo('/h5/pages/activity/activity-list')
  101. },
  102. NewActivityListPath(pros){
  103. /**
  104. * 页面跳转类型
  105. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  106. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  107. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  108. **/
  109. if(pros.linkType){
  110. console.log(pros.linkType)
  111. const typeMap = {
  112. 1:`/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
  113. 2:`/pages/goods/instrument-details?id=${pros.linkParam.id}`,
  114. 4:`/h5/pages/activity/activity?title=${pros.title}&link=${pros.appletsLink}`,
  115. 5:`/pages/goods/product?id=${pros.linkParam.id}`,
  116. 7:`/supplier/pages/user/my-shop?shopId=${pros.linkParam.id}`,
  117. 8:`/h5/pages/activity/activity-list`,
  118. 9:`/second/pages/form/introduce`,
  119. 10:`/second/pages/product/product-list`,
  120. 11:`/second/pages/form/form`,
  121. 12:`/search/pages/search/search?keyWord=${pros.linkParam.keyword}`,
  122. 13:`/h5/pages/article/path?link=${pros.link}`,
  123. 14:`/h5/pages/article/path?link=${pros.link}`,
  124. 15:`/h5/pages/article/path?link=${pros.link}`,
  125. 17:`/pages/login/register-select`,
  126. 18:`/h5/pages/article/path?link=${pros.link}`,
  127. 19:`/search/pages/search/search-supplier?keyWord=${pros.linkParam.keyword}`
  128. }
  129. const url = typeMap[pros.linkType];
  130. uni.navigateTo({
  131. url:url
  132. })
  133. }
  134. },
  135. LiveGoPath(){//查看直播
  136. this.$api.navigateTo('/h5/pages/article/path-live')
  137. // uni.navigateToMiniProgram({
  138. // appId: 'wx92d650b253f8f2e3',
  139. // path: '/pages/index/index',
  140. // extraData: {
  141. // 'data1': 'test'
  142. // },
  143. // envVersion: 'develop',
  144. // success(res) {
  145. // // 打开成功
  146. // console.log(res)
  147. // }
  148. // })
  149. },
  150. LiveGoPathPros(live){
  151. this.$api.navigateTo(`/h5/pages/article/page-image?title=${live.liveTitle}&image=${live.advertisingImage}`)
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. .container-pages{
  158. width: 100%;
  159. height:508rpx;
  160. padding: 24rpx;
  161. float: left;
  162. background-color: #F7F7F7;
  163. margin-top: 16rpx;
  164. box-sizing: border-box;
  165. background-color: #F7F7F7;
  166. overflow: hidden;
  167. display: flex;
  168. align-items: center;
  169. .tui-goods__list {
  170. display: flex;
  171. align-items: center;
  172. }
  173. .tui-goods__item {
  174. background-color: #fff;
  175. width: 307rpx;
  176. height: 460rpx;
  177. border-radius: 16rpx;
  178. box-sizing: border-box;
  179. margin-right: 16rpx;
  180. padding: 17rpx;
  181. }
  182. .tui-group-name{
  183. width: 100%;
  184. height: 36rpx;
  185. float: left;
  186. margin-bottom: 13rpx;
  187. .tui-group-title{
  188. font-size: 26rpx;
  189. line-height: 36rpx;
  190. float: left;
  191. color: #333333;
  192. }
  193. .icon-xiayibu{
  194. font-size: 26rpx;
  195. line-height: 36rpx;
  196. float: right;
  197. color: #909090;
  198. }
  199. }
  200. .tui-goods__main{
  201. width: 100%;
  202. height: auto;
  203. float: left;
  204. position: relative;
  205. &.one{
  206. margin-bottom: 14rpx;
  207. }
  208. }
  209. .tui-goods__imgbox {
  210. width: 273rpx;
  211. height: 273rpx;
  212. box-sizing: border-box;
  213. border-radius: 8rpx;
  214. }
  215. .tui-goods__img {
  216. max-width: 273rpx;
  217. max-height: 273rpx;
  218. border-radius: 8rpx;
  219. display: block;
  220. }
  221. .tui-goods__name{
  222. width: 100%;
  223. height: 48rpx;
  224. float: left;
  225. line-height: 48rpx;
  226. box-sizing: border-box;
  227. padding-left: 12rpx;
  228. font-size: $font-size-24;
  229. color: #FFFFFF;
  230. background-color: rgba(0,0,0,0.4);
  231. position: absolute;
  232. bottom: 0;
  233. left: 0;
  234. white-space: nowrap;
  235. text-overflow: ellipsis;
  236. overflow: hidden;
  237. border-radius:0 0 8rpx 8rpx;
  238. }
  239. .tui-goods__statu{
  240. padding-left: 45rpx;
  241. padding-right: 10rpx;
  242. height: 35rpx;
  243. position: absolute;
  244. top: 17rpx;
  245. left: 17rpx;
  246. background-color: rgba(0,0,0,0.4);
  247. border-radius: 18rpx;
  248. line-height: 35rpx;
  249. color: #FFFFFF;
  250. text-align: right;
  251. font-size: $font-size-20;
  252. .icon-live{
  253. width: 17rpx;
  254. height: 17rpx;
  255. display: block;
  256. margin: 0 auto;
  257. position: absolute;
  258. left: 15rpx;
  259. top: 9rpx;
  260. }
  261. .iconfont{
  262. width: 35rpx;
  263. height: 35rpx;
  264. line-height: 35rpx;
  265. display: block;
  266. position: absolute;
  267. left: 10rpx;
  268. font-size: $font-size-26;
  269. &.icon-weikaishi{
  270. color: #E56D00;
  271. left:0;
  272. }
  273. &.icon-jieshu{
  274. color: #FFFFFF;
  275. left:0;
  276. font-size: 22rpx;
  277. }
  278. }
  279. }
  280. .tui-goods__text{
  281. width: 100%;
  282. height: 44rpx;
  283. float: left;
  284. line-height: 44rpx;
  285. box-sizing: border-box;
  286. padding-left: 12rpx;
  287. font-size: $font-size-24;
  288. color: #666666;
  289. white-space: nowrap;
  290. text-overflow: ellipsis;
  291. overflow: hidden;
  292. position: relative;
  293. &::before{
  294. content: '';
  295. width: 8rpx;
  296. height: 8rpx;
  297. border-radius: 50%;
  298. background-color: #cccccc;
  299. position: absolute;
  300. left: 0;
  301. top: 18rpx;
  302. }
  303. }
  304. }
  305. </style>