index.vue 5.0 KB

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