shopList.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="page">
  3. <view class="uni-product-list">
  4. <view style="padding: 20upx;" v-for="(product,index) in productList" :key="index" @click="goshop(product)">
  5. <view class="image-view">
  6. <image class="uni-product-image" :src="pictureUrl+'/uploads/home/store/goods/' + product.goods_image.substr(0, product.goods_image.indexOf('\_')) + '/' + product.goods_image "></image>
  7. </view>
  8. <view class="uni-product-title textover">{{product.goods_name}}</view>
  9. <view class="uni-product-price">
  10. <text class="uni-product-price-original" style="color:#D9332E!important;font-weight: bold;">¥{{product.goods_price}}</text>
  11. <text class="uni-product-price-favour">¥{{product.goods_marketprice}}</text>
  12. </view>
  13. <view class="tags" v-if="product.goods_advword!=''">{{product.goods_advword}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. productList: {
  22. type: Array
  23. },
  24. // 酒店总id
  25. store_id: {
  26. type: Number
  27. }
  28. },
  29. data() {
  30. return {
  31. title: 'product-list',
  32. renderImage: false,
  33. pictureUrl: this.pictureUrl
  34. };
  35. },
  36. methods: {
  37. goshop(e) {
  38. let goods_commonid = e.goods_commonid; //商品公共ID
  39. let user_store_id = this.store_id; //酒店ID
  40. uni.navigateTo({
  41. url:`/pages/index/shop?id=${goods_commonid}&store_id=${user_store_id}`
  42. })
  43. }
  44. },
  45. onLoad() {
  46. },
  47. onPullDownRefresh() {
  48. },
  49. onReachBottom() {
  50. }
  51. };
  52. </script>
  53. <style>
  54. .textover {
  55. overflow : hidden;
  56. text-overflow: ellipsis;
  57. display: -webkit-box;
  58. -webkit-line-clamp: 2;
  59. -webkit-box-orient: vertical;
  60. }
  61. .tags {
  62. display:inline-block!important;
  63. border: 1px solid #D9332E;
  64. color: #D9332E;
  65. text-align: center;
  66. line-height: 45upx;
  67. width:auto;
  68. padding: 0 10upx;
  69. margin-top: 10upx;
  70. border-radius: 6upx;
  71. font-size: 22upx;
  72. }
  73. </style>