商城类、订单类uniapp模板,多角色
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
1.8 KiB

7 months ago
  1. <template>
  2. <view style="">
  3. <view v-for="item in commodityList" :key="item.title" class="address-item">
  4. <view class="itme1" @click="selectSp(item)">
  5. <view class="left">
  6. <img src="../../../static/image/center/1.png" alt="" style="width: 100%;height: 100%;">
  7. </view>
  8. <view class="center">
  9. <view>{{ item.title }}</view>
  10. <view>{{ item.smallTitle }}</view>
  11. </view>
  12. <view class="right">×{{item.total}}</view>
  13. </view>
  14. <uv-line></uv-line>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. commodityList: {
  22. default: [],
  23. type: Array,
  24. }
  25. },
  26. data() {
  27. return {
  28. selectAddress: 0,
  29. }
  30. },
  31. methods: {
  32. // 打开商品选择
  33. openCommodity() {
  34. this.$emit('openSpPopup')
  35. },
  36. // 选择了商品
  37. selectSp(e) {
  38. console.log(this.commodityList,"this.csss")
  39. console.log(e, '选择了商品')
  40. this.$emit('selectSp', e)
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped lang="scss">
  46. .itme1 {
  47. display: flex;
  48. height: 150rpx;
  49. width: 100vw;
  50. background-color: #ffffff;
  51. .left {
  52. padding: 40rpx;
  53. width: 20%;
  54. border-radius: 10rpx;
  55. background-color: #ffffff;
  56. }
  57. .center {
  58. display: flex;
  59. flex-direction: column;
  60. justify-content: center;
  61. gap: 20rpx;
  62. width: 70%;
  63. padding: 0rpx 0 0 20rpx;
  64. background-color: #ffffff;
  65. // 给第一个 view 设置样式
  66. > view:first-of-type {
  67. font-size: 36rpx;
  68. color: #333;
  69. }
  70. // 给第二个 view 设置样式
  71. > view:nth-of-type(2) {
  72. font-size: 28rpx;
  73. color: #666666;
  74. }
  75. }
  76. .right {
  77. display: flex;
  78. justify-content: center;
  79. align-items: center;
  80. width: 10%;
  81. color: #666666;
  82. background-color: #ffffff;
  83. }
  84. }
  85. </style>