shopList.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="page">
  3. <view class="uni-product-list">
  4. <view class="uni-product" 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">¥{{product.goods_marketprice}}</text>
  11. <text class="uni-product-price-favour">¥{{product.goods_costprice}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. productList: {
  21. type: Array
  22. }
  23. },
  24. data() {
  25. return {
  26. title: 'product-list',
  27. renderImage: false,
  28. pictureUrl: this.pictureUrl
  29. };
  30. },
  31. methods: {
  32. goshop(e) {
  33. console.log(e)
  34. let id = e.goods_commonid;
  35. let store_id = e.store_id;
  36. uni.navigateTo({
  37. url:`/pages/index/shop?id=${id}&store_id=${store_id}`
  38. })
  39. }
  40. },
  41. onLoad() {
  42. },
  43. onPullDownRefresh() {
  44. },
  45. onReachBottom() {
  46. }
  47. };
  48. </script>
  49. <style>
  50. .textover {
  51. overflow: hidden;
  52. text-overflow:ellipsis;
  53. white-space: nowrap;
  54. }
  55. </style>