shopList.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. goodId: {
  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 id = e.goods_commonid;
  39. let goodIds = e.store_id; // 商品单个酒店id
  40. let stoe_ids = this.goodId;
  41. uni.navigateTo({
  42. url:`/pages/index/shop?id=${id}&store_id=${stoe_ids}&goodId=${goodIds}`
  43. })
  44. }
  45. },
  46. onLoad() {
  47. },
  48. onPullDownRefresh() {
  49. },
  50. onReachBottom() {
  51. }
  52. };
  53. </script>
  54. <style>
  55. .textover {
  56. text-overflow:ellipsis; /* ellipsis:显示省略符号来代表被修剪的文本 string:使用给定的字符串来代表被修剪的文本*/ white-space: nowrap; /* nowrap:规定段落中的文本不进行换行 */ overflow: hidden; /*超出 */
  57. display: inline-block; /*display:box的时候省略好不出现*/
  58. }
  59. .tags {
  60. display:inline-block!important;
  61. border: 1px solid #D9332E;
  62. color: #D9332E;
  63. text-align: center;
  64. line-height: 45upx;
  65. width:auto;
  66. padding: 0 10upx;
  67. margin-top: 10upx;
  68. border-radius: 6upx;
  69. font-size: 22upx;
  70. }
  71. </style>