index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="goodsList">
  3. <view class="item acea-row row-between-wrapper" v-for="(item,index) in tempArr" :key='index'
  4. @click="goDetail(item)">
  5. <view class="pictrue">
  6. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
  7. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  8. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
  9. <image :src="item.image" mode=""></image>
  10. </view>
  11. <view class="pictxt">
  12. <view class="text line2">{{item.store_name}}</view>
  13. <view class="bottom acea-row row-between-wrapper">
  14. <view class="money font-color">
  15. <text class="sign">{{$t(`¥`)}}</text>{{item.price}}
  16. <!-- <span class="vip" v-if="item.vip_price">
  17. <image src="../../static/images/vip01.png"></image>
  18. ¥{{item.vip_price}}
  19. </span>
  20. <text class="y_money" v-else>¥{{item.ot_price}}</text> -->
  21. </view>
  22. <view v-if="item.stock>0">
  23. <view class="iconfont icon-gouwuche6 acea-row row-center-wrapper"
  24. v-if="item.activity && (item.activity.type === '1' || item.activity.type === '2' || item.activity.type === '3')">
  25. </view>
  26. <view v-else>
  27. <!-- 多规格 -->
  28. <view class="bnt acea-row row-center-wrapper" @click.stop="goCartDuo(item)"
  29. v-if="item.spec_type">
  30. {{$t(`选规格`)}}
  31. <text class="num" v-if="isLogin && item.cart_num">{{item.cart_num}}</text>
  32. </view>
  33. <!-- 单规格 -->
  34. <view class="iconfont icon-gouwuche6 acea-row row-center-wrapper"
  35. v-if="!item.spec_type && !item.cart_num" @click.stop="goCartDan(item,index)"></view>
  36. <view class="cart acea-row row-middle" v-if="!item.spec_type && item.cart_num">
  37. <view class="pictrue iconfont icon-jianhao acea-row row-center-wrapper"
  38. @click.stop="CartNumDes(index,item)"></view>
  39. <view class="num">{{item.cart_num}}</view>
  40. <view class="pictrue iconfont icon-jiahao acea-row row-center-wrapper"
  41. @click.stop="CartNumAdd(index,item)"></view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="bnt acea-row row-center-wrapper end" v-else>{{$t(`已售罄`)}}</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. name: 'd_goodList',
  54. props: {
  55. dataConfig: {
  56. type: Object,
  57. default: () => {}
  58. },
  59. tempArr: {
  60. type: Array,
  61. default: []
  62. },
  63. isLogin: {
  64. type: Boolean,
  65. default: false
  66. }
  67. },
  68. data() {
  69. return {
  70. addIng: false
  71. };
  72. },
  73. created() {},
  74. mounted() {},
  75. methods: {
  76. goDetail(item) {
  77. this.$emit('detail', item);
  78. },
  79. goCartDuo(item) {
  80. this.$emit('gocartduo', item);
  81. },
  82. goCartDan(item, index) {
  83. this.$emit('gocartdan', item, index);
  84. },
  85. CartNumDes(index, item) {
  86. if (this.addIng) return
  87. this.addIng = true
  88. this.$emit('ChangeCartNumDan', false, index, item);
  89. },
  90. CartNumAdd(index, item) {
  91. if (this.addIng) return
  92. this.addIng = true
  93. this.$emit('ChangeCartNumDan', true, index, item);
  94. }
  95. }
  96. };
  97. </script>
  98. <style lang="scss">
  99. .goodsList {
  100. padding: 0 30rpx;
  101. .item {
  102. width: 100%;
  103. box-sizing: border-box;
  104. margin-bottom: 63rpx;
  105. .pictrue {
  106. width: 140rpx;
  107. height: 140rpx;
  108. border-radius: 10rpx;
  109. position: relative;
  110. border-radius: 22rpx;
  111. image {
  112. width: 100%;
  113. height: 100%;
  114. border-radius: 22rpx;
  115. }
  116. }
  117. .pictxt {
  118. width: 372rpx;
  119. .text {
  120. font-size: 26rpx;
  121. font-family: PingFang SC;
  122. font-weight: 500;
  123. color: #333333;
  124. }
  125. .bottom {
  126. margin-top: 22rpx;
  127. .money {
  128. font-size: 34rpx;
  129. font-weight: 800;
  130. .sign {
  131. font-size: 24rpx;
  132. }
  133. .y_money {
  134. font-size: 20rpx;
  135. color: #999999;
  136. margin-left: 14rpx;
  137. font-weight: normal;
  138. text-decoration: line-through;
  139. }
  140. .vip {
  141. font-size: 22rpx;
  142. color: #333333;
  143. font-weight: normal;
  144. margin-left: 14rpx;
  145. image {
  146. width: 38rpx;
  147. height: 18rpx;
  148. margin-right: 6rpx;
  149. }
  150. }
  151. }
  152. .cart {
  153. height: 46rpx;
  154. .pictrue {
  155. color: var(--view-theme);
  156. font-size: 46rpx;
  157. width: 46rpx;
  158. height: 46rpx;
  159. text-align: center;
  160. line-height: 46rpx;
  161. &.icon-jiahao {
  162. color: var(--view-theme);
  163. }
  164. }
  165. .num {
  166. font-size: 30rpx;
  167. color: #333333;
  168. font-weight: bold;
  169. width: 60rpx;
  170. text-align: center;
  171. }
  172. }
  173. .icon-gouwuche6 {
  174. width: 46rpx;
  175. height: 46rpx;
  176. background-color: var(--view-theme);
  177. border-radius: 50%;
  178. color: #fff;
  179. font-size: 30rpx;
  180. }
  181. .bnt {
  182. padding: 0 20rpx;
  183. height: 45rpx;
  184. background: var(--view-theme);
  185. border-radius: 23rpx;
  186. font-size: 22rpx;
  187. color: #fff;
  188. position: relative;
  189. &.end {
  190. background: #cccccc;
  191. }
  192. .num {
  193. min-width: 14rpx;
  194. background-color: #fff;
  195. color: var(--view-theme);
  196. border-radius: 15px;
  197. position: absolute;
  198. right: -13rpx;
  199. top: -11rpx;
  200. font-size: 16rpx;
  201. padding: 0 10rpx;
  202. border: 1px solid var(--view-theme);
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. </style>