member-product.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <view class="container clearfix">
  3. <view class="cm-member-top">
  4. <image class="banner" :src="banner" mode=""></image>
  5. </view>
  6. <view class="cm-member-main ">
  7. <view class="cm-member-product clearfix">
  8. <view v-for="(pro,index) in productList"
  9. :key="index"
  10. :id="pro.productId"
  11. class="product-list"
  12. @click="productDetail(pro.productId)"
  13. >
  14. <view class="product-image">
  15. <image :src="pro.image" mode=""></image>
  16. </view>
  17. <view class="product-mains">
  18. <view class="product-name">
  19. {{ pro.name }}
  20. </view>
  21. <view class="product-tags">
  22. <view class="floor-item-act" v-if="pro.actStatus==1">
  23. <view class="floor-tags" v-if="PromotionsFormat(pro.promotions)">
  24. {{pro.promotions.name}}
  25. <text v-if="pro.priceFlag != 1">:¥{{ pro.price | NumFormat }}</text>
  26. </view>
  27. <view class="floor-tags" v-else>{{pro.promotions.name}}</view>
  28. </view>
  29. <view class="floor-item-act" v-if="pro.actStatus==0">
  30. <view class="floor-tags" v-if="pro.actStatus ==0 && pro.ladderPriceFlag==1">阶梯价格</view>
  31. </view>
  32. </view>
  33. <view class="product-price">
  34. <view class="list-none" v-if="pro.priceFlag == 1">¥未公开价格</view>
  35. <view class="list-none" v-else-if="pro.priceFlag == 2">¥价格仅会员可见</view>
  36. <view class="list-none-price" v-else>¥{{ pro.price | NumFormat }}</view>
  37. </view>
  38. <view class="product-svip">
  39. <view class="svip" v-if='pro.proType == 0'>
  40. <view class="tags">SVIP</view>
  41. </view>
  42. <view class="svip" v-if='pro.proType == 1'>
  43. <view class="tags">SVIP</view>
  44. <view class="price">{{ pro.discount }}</view>
  45. </view>
  46. <view class="svip" v-if='pro.proType == 2'>
  47. <view class="tags">SVIP</view>
  48. <view class="price">¥{{ pro.discountPrice | NumFormat }}</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 透明模态层 -->
  56. <modal-layer v-if='isModallayer'></modal-layer>
  57. </view>
  58. </template>
  59. <script>
  60. import { mapState,mapMutations} from 'vuex'
  61. import modalLayer from '@/components/modal-layer'
  62. export default {
  63. components:{
  64. modalLayer
  65. },
  66. data() {
  67. return {
  68. StaticUrl:this.$Static,
  69. isModallayer:false,
  70. banner:'https://img.caimei365.com/group1/M00/00/28/rB-lGGE4XKWADKAdAANR7wZz3OQ936.jpg',
  71. params:{
  72. userId:0,
  73. redemptionCode:'',
  74. source:2,
  75. },
  76. productList:[
  77. {
  78. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  79. name:'ET-SPACE全身热疗系统生物热能太空舱',
  80. unit:'台',
  81. ladderPriceFlag:0,
  82. priceFlag:1,
  83. originalPrice:100,
  84. price:5000000,
  85. actStatus:0,
  86. promotions:null,
  87. isChecked:false,
  88. productIds:1000,
  89. proType:1,
  90. discount:'8.8折'
  91. },
  92. {
  93. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  94. name:'ET-SPACE全身热疗系统全身热疗系统生物热能太空舱',
  95. unit:'台',
  96. ladderPriceFlag:1,
  97. priceFlag:2,
  98. originalPrice:100,
  99. price:500000,
  100. actStatus:1,
  101. promotions:{
  102. type:1,
  103. mode:1,
  104. name:'优惠价'
  105. },
  106. isChecked:false,
  107. productIds:1001,
  108. proType:2,
  109. discountPrice:50000,
  110. },
  111. {
  112. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  113. name:'ET-SPACE全身热疗系统全身热疗系统生物热能太空舱',
  114. unit:'台',
  115. ladderPriceFlag:1,
  116. priceFlag:0,
  117. originalPrice:100,
  118. price:5000000,
  119. actStatus:1,
  120. promotions:{
  121. type:0,
  122. mode:0,
  123. name:'单品满减'
  124. },
  125. isChecked:false,
  126. productIds:1002,
  127. proType:0,
  128. discountPrice:50000,
  129. },
  130. {
  131. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  132. name:'ET-SPACE全身热疗系统全身热疗系统生物热能太空舱',
  133. unit:'台',
  134. ladderPriceFlag:1,
  135. priceFlag:0,
  136. originalPrice:100,
  137. price:50000000,
  138. actStatus:0,
  139. promotions:null,
  140. isChecked:false,
  141. productIds:1003,
  142. proType:0,
  143. discountPrice:50000,
  144. },
  145. {
  146. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  147. name:'ET-SPACE全身热疗系统生物热能太空舱',
  148. unit:'台',
  149. ladderPriceFlag:0,
  150. priceFlag:1,
  151. originalPrice:100,
  152. price:5000000,
  153. actStatus:0,
  154. promotions:null,
  155. isChecked:false,
  156. productIds:1000,
  157. proType:1,
  158. discount:'8.8折'
  159. },
  160. {
  161. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  162. name:'ET-SPACE全身热疗系统全身热疗系统生物热能太空舱',
  163. unit:'台',
  164. ladderPriceFlag:1,
  165. priceFlag:2,
  166. originalPrice:100,
  167. price:500000,
  168. actStatus:1,
  169. promotions:{
  170. type:1,
  171. mode:1,
  172. name:'优惠价'
  173. },
  174. isChecked:false,
  175. productIds:1001,
  176. proType:2,
  177. discountPrice:50000,
  178. },
  179. {
  180. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  181. name:'ET-SPACE全身热疗系统全身热疗系统生物热能太空舱',
  182. unit:'台',
  183. ladderPriceFlag:1,
  184. priceFlag:0,
  185. originalPrice:100,
  186. price:5000000,
  187. actStatus:1,
  188. promotions:{
  189. type:0,
  190. mode:0,
  191. name:'单品满减'
  192. },
  193. isChecked:false,
  194. productIds:1002,
  195. proType:0,
  196. discountPrice:50000,
  197. },
  198. {
  199. image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
  200. name:'ET-SPACE全身热疗系统全身热疗系统生物热能太空舱',
  201. unit:'台',
  202. ladderPriceFlag:1,
  203. priceFlag:0,
  204. originalPrice:100,
  205. price:50000000,
  206. actStatus:0,
  207. promotions:null,
  208. isChecked:false,
  209. productIds:1003,
  210. proType:0,
  211. discountPrice:50000,
  212. }
  213. ]
  214. }
  215. },
  216. onLoad() {
  217. },
  218. filters: {
  219. NumFormat:function(text) {//处理金额
  220. return Number(text).toFixed(2)
  221. }
  222. },
  223. computed: {
  224. ...mapState(['hasLogin','userInfo','identity','isActivity'])
  225. },
  226. methods: {
  227. PromotionsFormat(promo){//促销活动类型数据处理
  228. if(promo!=null){
  229. if(promo.type == 1 && promo.mode == 1){
  230. return true
  231. }else{
  232. return false
  233. }
  234. }
  235. return false
  236. },
  237. productDetail(productId) {
  238. this.isModallayer = true
  239. this.$api.navigateTo(`/pages/goods/product?id=${productId}`)
  240. this.isModallayer = false
  241. },
  242. },
  243. onPullDownRefresh() {
  244. setTimeout(() => {
  245. uni.stopPullDownRefresh()
  246. }, 200)
  247. },
  248. onShow(){
  249. this.$api.getComStorage('userInfo').then((resolve) =>{
  250. this.params.userId = resolve.userId ? resolve.userId : 0
  251. }).catch(error =>{
  252. console.log('暂无用户信息~')
  253. })
  254. }
  255. }
  256. </script>
  257. <style lang="scss">
  258. page{
  259. background-color: #F7F7F7;
  260. }
  261. .container{
  262. width: 100%;
  263. height: auto;
  264. }
  265. .cm-member-top{
  266. width: 100%;
  267. height: 340rpx;
  268. box-sizing: border-box;
  269. padding: 0 24rpx;
  270. margin: 24rpx 0 0 0;
  271. .banner{
  272. width: 100%;
  273. height: 340rpx;
  274. display: block;
  275. border-radius: 16rpx;
  276. }
  277. }
  278. .cm-member-main{
  279. width: 100%;
  280. box-sizing: border-box;
  281. padding: 0 24rpx 24rpx 24rpx;
  282. background-color: #F7F7F7;
  283. .cm-member-product{
  284. width: 100%;
  285. margin-top: 24rpx;
  286. .product-list{
  287. width: 339rpx;
  288. height: 560rpx;
  289. border-radius: 16rpx;
  290. float: left;
  291. margin-right: 24rpx;
  292. margin-bottom: 24rpx;
  293. background-color: #FFFFFF;
  294. &:nth-child(2n){
  295. margin-right: 0;
  296. }
  297. .product-image{
  298. width: 339rpx;
  299. height: 339rpx;
  300. image{
  301. width: 339rpx;
  302. height: 339rpx;
  303. display: block;
  304. border-radius: 16rpx 16rpx 0 0;
  305. }
  306. }
  307. .product-mains{
  308. width: 100%;
  309. height: auto;
  310. box-sizing: border-box;
  311. padding: 0 24rpx;
  312. margin-top: 8rpx;
  313. .product-name{
  314. line-height: 36rpx;
  315. text-overflow: ellipsis;
  316. overflow: hidden;
  317. display: -webkit-box;
  318. -webkit-line-clamp: 2;
  319. line-clamp: 2;
  320. -webkit-box-orient: vertical;
  321. font-size: $font-size-26;
  322. color: #333333;
  323. text-align: justify;
  324. }
  325. .product-tags{
  326. width: 100%;
  327. height: 32rpx;
  328. margin-top: 4rpx;
  329. .floor-item-act{
  330. width: 100%;
  331. height: 32rpx;
  332. text-align: center;
  333. box-sizing: border-box;
  334. float: left;
  335. .floor-tags{
  336. height: 32rpx;
  337. box-sizing: border-box;
  338. border-radius: 8rpx;
  339. background-color: #FFFFFF;
  340. line-height: 28rpx;
  341. color: $color-system;
  342. text-align: center;
  343. display: inline-block;
  344. padding:0 8rpx;
  345. font-size: $font-size-20;
  346. border: 1px solid #E15616;
  347. float: left;
  348. }
  349. }
  350. }
  351. .product-price{
  352. width: 100%;
  353. line-height: 37rpx;
  354. font-size: $font-size-26;
  355. color: #333333;
  356. margin-top: 8rpx;
  357. .list-none-price{
  358. text-decoration: line-through;
  359. color: #999999;
  360. }
  361. }
  362. .product-svip{
  363. width: 100%;
  364. height: 32rpx;
  365. margin-top: 10rpx;
  366. .svip{
  367. padding-left: 44rpx;
  368. height: 32rpx;
  369. position: relative;
  370. .tags{
  371. width: 60rpx;
  372. height: 32rpx;
  373. background-color: #333333;
  374. text-align: center;
  375. line-height: 32rpx;
  376. font-size: $font-size-22;
  377. color: #F0CB72;
  378. position: absolute;
  379. left: 0;
  380. top: 0;
  381. border-radius: 8rpx 16rpx 8rpx 8rpx;
  382. }
  383. .price{
  384. height: 32rpx;
  385. box-sizing: border-box;
  386. border-radius:0 8rpx 8rpx 0;
  387. background-color: #F0CB72;
  388. line-height: 32rpx;
  389. color: #333333;
  390. text-align: center;
  391. padding:0 9rpx 0 25rpx;
  392. font-size: $font-size-26;
  393. float: left;
  394. }
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>