index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="distributionShop">
  3. <!-- header -->
  4. <cu-custom isBack bgColor="bg-gradual-blue"><view slot="content">分销中心</view></cu-custom>
  5. <!-- section -->
  6. <image @click="handler" style="width: 100vw;" :src="params.show_image_url" mode="widthFix"></image>
  7. <view @click="handler" class="bg-white padding">
  8. <view class="flex align-center ">
  9. <view style="flex: auto;">
  10. <view class="text-xl text-bold">{{ params.name }}</view>
  11. <view class="text-price text-red"><cu-price :value="params.price" size="64" /></view>
  12. </view>
  13. </view>
  14. <view class="flex justify-between align-end margin-top-sm">
  15. <view class="bg-orange light padding-lr-xs">
  16. <text class="cuIcon-vip lg">会员价</text>
  17. <text class="text-price margin-left-xs">{{ params.vip_price }}</text>
  18. </view>
  19. <view class="">{{ params.point_price }}积分</view>
  20. <view class="text-grey">已售{{ params.sale_count }}件</view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import api from './api.js';
  27. export default {
  28. data() {
  29. return {
  30. params: {}
  31. };
  32. },
  33. async onShow() {
  34. var result = await api.detail();
  35. if (result.code !== 0) return false;
  36. this.params = result.data[0];
  37. },
  38. methods: {
  39. handler(){
  40. uni.navigateTo({
  41. url:`/pages/detail/index?id=${this.params.id}`
  42. })
  43. }
  44. }
  45. };
  46. </script>
  47. <style lang="scss" scoped>
  48. .distributionShop {
  49. .section {
  50. .item {
  51. width: calc(50vw - 60upx);
  52. box-sizing: border-box;
  53. margin: 15upx 30upx;
  54. image {
  55. width: calc(50vw - 60upx);
  56. height: calc(50vw - 60upx);
  57. }
  58. }
  59. .item:nth-child(2n + 1) {
  60. margin-left: 15upx;
  61. }
  62. .item:nth-child(2n + 1) {
  63. margin-right: 15upx;
  64. }
  65. }
  66. }
  67. </style>