setMealMore.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view>
  3. <u-popup :value="isShow" mode="bottom" :mask-close-able="false" :border-radius="12">
  4. <view class="set_more">
  5. <view class="more clearfix">
  6. <view class="float_left">
  7. <text class="title">组合套餐</text>
  8. <text class="tip">{{total}}组套餐,最多可省¥{{combinedPackage[0].originPrice - combinedPackage[0].price - 0}}</text>
  9. </view>
  10. <text class="ibonfont ibonguanbi close-icon float_right" @click="closeaddcartPop"></text>
  11. </view>
  12. <scroll-view scroll-y="true" style="height: 600rpx;">
  13. <view class="group-ul">
  14. <view class="group-li clearfix" v-for="item,index in combinedPackage" :key="index" @click="goPage('/pageT/goodsGroup/goodsGroupDetail?goodsid=' + goods_id +'&shopid=' + item.shopId+'&index='+index)">
  15. <view class="float_left">
  16. <scroll-view scroll-x="true" class="left-scroll">
  17. <view class="goods-ul">
  18. <view class="goods-li" v-for="item1,index1 in item.goodsData" :key="index1">
  19. <image :src="item1.images[0]" mode="aspectFill"></image>
  20. <view class="goods-name ellipsis">{{item1.title}}</view>
  21. </view>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. <view class="float_left dy-icon">
  26. <text class="ibonfont ibonicon"></text>
  27. </view>
  28. <view class="float_left price-right">
  29. <view class="group-price">
  30. <text>套餐价</text>
  31. <text class="primary-color">¥{{item.price}}</text>
  32. </view>
  33. <view class="save-price primary-color">
  34. 可省¥{{item.originPrice - item.price - 0}}
  35. </view>
  36. <view class="buy-btn primary-bg">
  37. 立即购买
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </scroll-view>
  43. </view>
  44. </u-popup>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. props: {
  50. isShow: {
  51. type: Boolean,
  52. default: false
  53. },
  54. goods_id: {
  55. type: [Number, String],
  56. default: 0,
  57. },
  58. shopId: {
  59. type: [Number, String],
  60. default: 0
  61. },
  62. },
  63. data() {
  64. return {
  65. total: 0,
  66. combinedPackage: []
  67. }
  68. },
  69. watch:{
  70. isShow(val){
  71. if(val){
  72. this.listsApiComBinPackage()
  73. }
  74. }
  75. },
  76. created() {
  77. // this.listsApiComBinPackage()
  78. },
  79. methods: {
  80. // 关闭弹窗
  81. closeaddcartPop() {
  82. this.$emit('close', false);
  83. console.log(this.goodsId, this.shopId)
  84. },
  85. async listsApiComBinPackage() {
  86. const {
  87. data
  88. } = await this.$u.api.listsApiComBinPackage({
  89. page: 1,
  90. pageSize: 10,
  91. shopId: this.shopId,
  92. goodsId: this.goodsId
  93. })
  94. this.combinedPackage = data
  95. this.total = data.length
  96. console.log(data)
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .set_more {
  103. height: 700rpx;
  104. background-color: #f5f9fc;
  105. .more {
  106. height: 80rpx;
  107. line-height: 80rpx;
  108. padding: 0 30rpx;
  109. background-color: #fff;
  110. .title {
  111. font-weight: 560;
  112. }
  113. .tip {
  114. color: #999;
  115. font-size: 24rpx;
  116. margin-left: 10rpx;
  117. }
  118. .close-icon {
  119. color: #999;
  120. font-size: 40upx;
  121. }
  122. }
  123. .group-ul {
  124. padding: 20rpx;
  125. .group-li {
  126. background-color: #FFFFFF;
  127. border-radius: 12rpx;
  128. padding: 20rpx;
  129. margin-bottom: 20rpx;
  130. .float_left {
  131. .left-scroll {
  132. width: 430rpx;
  133. white-space: nowrap;
  134. .goods-li {
  135. display: inline-block;
  136. vertical-align: middle;
  137. image {
  138. display: block;
  139. width: 150rpx;
  140. height: 150rpx;
  141. border-radius: 10rpx;
  142. margin: 0 auto;
  143. }
  144. text-align: center;
  145. .goods-name {
  146. width: 150rpx;
  147. height: 36rpx;
  148. line-height: 36rpx;
  149. margin-top: 10rpx;
  150. font-size: 24rpx;
  151. -webkit-line-clamp: 1;
  152. }
  153. }
  154. .plus-icon {
  155. vertical-align: middle;
  156. display: inline-block;
  157. line-height: 150rpx;
  158. padding: 0 10rpx;
  159. height: 200rpx;
  160. }
  161. }
  162. }
  163. .dy-icon {
  164. padding: 0 10rpx;
  165. line-height: 150rpx;
  166. padding: 0 10rpx;
  167. height: 200rpx;
  168. color: #cecece;
  169. .ibonicon {
  170. font-size: 26rpx;
  171. }
  172. }
  173. .price-right {
  174. color: #666666;
  175. font-size: 24rpx;
  176. text-align: center;
  177. width: 190rpx;
  178. .group-price {
  179. .primary-color {
  180. font-weight: 700;
  181. font-size: 28rpx;
  182. }
  183. }
  184. .save-price {
  185. padding: 10rpx 0;
  186. }
  187. .buy-btn {
  188. line-height: 56rpx;
  189. height: 56rpx;
  190. border-radius: 8rpx;
  191. text-align: center;
  192. color: #FFFFFF;
  193. width: 150rpx;
  194. margin: 10rpx auto 0;
  195. }
  196. }
  197. }
  198. }
  199. }
  200. </style>