shopList.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. },
  25. data() {
  26. return {
  27. title: 'product-list',
  28. renderImage: false,
  29. pictureUrl: this.pictureUrl
  30. };
  31. },
  32. methods: {
  33. goshop(e) {
  34. console.log(e)
  35. let id = e.goods_commonid;
  36. let store_id = e.store_id;
  37. uni.navigateTo({
  38. url:`/pages/index/shop?id=${id}&store_id=${store_id}`
  39. })
  40. }
  41. },
  42. onLoad() {
  43. },
  44. onPullDownRefresh() {
  45. },
  46. onReachBottom() {
  47. }
  48. };
  49. </script>
  50. <style>
  51. .textover {
  52. overflow: hidden;
  53. text-overflow:ellipsis;
  54. white-space: nowrap;
  55. }
  56. .tags {
  57. display:inline-block!important;
  58. border: 1px solid #D9332E;
  59. color: #D9332E;
  60. text-align: center;
  61. line-height: 50upx;
  62. width:auto;
  63. padding: 0 10upx;
  64. margin-top: 10upx;
  65. }
  66. </style>