app-goods-marketing.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="app-goods-marketing">
  3. <view class="marketing">
  4. <view class="block dir-left-nowrap cross-center" v-if="integral && integral.title">
  5. <view class="box-grow-0">活动</view>
  6. <view class="give box-grow-0 main-center cross-center" :class="theme + '-border ' + theme + '-color'">
  7. 送积分
  8. </view>
  9. <view class="content box-grow-1">{{integral.title}}</view>
  10. </view>
  11. <view class="block dir-left-nowrap cross-center" v-if="card && card.list.length > 0" @click="change('cardShow')">
  12. <!-- <view class="box-grow-0">促销</view> -->
  13. <view class="give box-grow-0 main-center cross-center" :class="theme + '-border ' + theme + '-color'">
  14. 入场券
  15. </view>
  16. <!-- <view class="content box-grow-1">{{card.title}}</view> -->
  17. <view class="content box-grow-1">附带核销卡券</view>
  18. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  19. </view>
  20. </view>
  21. <view class="marketing">
  22. <view class="block dir-left-nowrap cross-center" v-if="express">
  23. <view class="box-grow-0">快递</view>
  24. <view class="content box-grow-1">{{express}}</view>
  25. </view>
  26. <view class="block dir-left-nowrap cross-center" v-if="shipping">
  27. <view class="box-grow-0">包邮</view>
  28. <view class="content box-grow-1">{{shipping}}</view>
  29. </view>
  30. <view class="block dir-left-nowrap cross-center" v-if="limit">
  31. <view class="box-grow-0">限购</view>
  32. <view class="content box-grow-1">{{limit}}</view>
  33. </view>
  34. <view class="block dir-left-nowrap cross-center" v-if="pickup" @click="change('pickupShow')">
  35. <view class="box-grow-0">起送</view>
  36. <view class="content box-grow-1">{{pickup}}</view>
  37. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  38. </view>
  39. </view>
  40. <view class="marketing">
  41. </view>
  42. <view class="card-modal">
  43. <app-model v-model="cardShow" type="1" :height="840">
  44. <view slot="title" class="title">赠卡券</view>
  45. <view slot="content" class="content">
  46. <view class="card dir-left-nowrap cross-center" v-for="(item, index) in card.list" :key="index">
  47. <image :src="item.pic_url"></image>
  48. <view class="box-grow-1 dir-top-nowrap">
  49. <text class="name">{{item.name}}</text>
  50. <text class="number">赠送{{item.number}}张</text>
  51. </view>
  52. </view>
  53. </view>
  54. </app-model>
  55. </view>
  56. <view class="pickup-modal">
  57. <app-model v-model="pickupShow" type="2">
  58. <view slot="title" class="title">起送</view>
  59. <view slot="content" class="content">
  60. <view>{{pickup}}</view>
  61. </view>
  62. </app-model>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import { mapState } from 'vuex';
  68. import appModel from '../../../components/basic-component/app-model/app-model.vue';
  69. export default {
  70. name: "app-goods-marketing",
  71. components: {
  72. 'app-model': appModel,
  73. },
  74. props: {
  75. limit: {
  76. type: String,
  77. default() {
  78. return '';
  79. }
  80. },
  81. pickup: {
  82. type: String,
  83. default() {
  84. return '';
  85. }
  86. },
  87. shipping: {
  88. type: String,
  89. default() {
  90. return '';
  91. }
  92. },
  93. card: {
  94. type: Object,
  95. default() {
  96. return {};
  97. }
  98. },
  99. integral: {
  100. type: Object,
  101. default() {
  102. return {};
  103. }
  104. },
  105. express: {
  106. type: String,
  107. default() {
  108. return '';
  109. }
  110. },
  111. },
  112. computed: {
  113. ...mapState({
  114. theme: state => state.mallConfig.theme,
  115. }),
  116. },
  117. data() {
  118. return {
  119. cardShow: false,
  120. pickupShow: false
  121. };
  122. },
  123. methods: {
  124. change(item) {
  125. this[item] = true;
  126. }
  127. }
  128. }
  129. </script>
  130. <style scoped lang="scss">
  131. .marketing {
  132. margin-bottom: #{20rpx};
  133. & .block:first-child {
  134. padding-top: #{32rpx};
  135. padding-bottom: #{28rpx};
  136. }
  137. & .block:last-child {
  138. padding-bottom: #{32rpx};
  139. }
  140. &:empty {
  141. margin: 0;
  142. }
  143. .block {
  144. background-color: #ffffff;
  145. font-size: $uni-font-size-general-one;
  146. color: $uni-general-color-two;
  147. padding: 0 #{24rpx} #{28rpx} #{24rpx};
  148. & view:first-child {
  149. margin-right: #{30rpx};
  150. }
  151. .give {
  152. padding: #{2rpx} #{4rpx};
  153. border: #{1rpx} solid;
  154. border-radius: #{4rpx};
  155. font-size: $uni-font-size-weak-two;
  156. margin-right: #{12rpx};
  157. }
  158. .content {
  159. color: $uni-important-color-black;
  160. display: inline-block;
  161. white-space: nowrap;
  162. width: 100%;
  163. overflow: hidden;
  164. text-overflow: ellipsis;
  165. }
  166. image {
  167. width: #{12rpx};
  168. height: #{22rpx};
  169. display: block;
  170. margin-left: #{24rpx};
  171. }
  172. }
  173. }
  174. .card-modal {
  175. .title {
  176. font-size: $uni-font-size-general-one;
  177. padding: #{40rpx} 0;
  178. text-align: center;
  179. }
  180. .content {
  181. width: 100%;
  182. padding: 0 #{24rpx} #{40rpx} #{24rpx};
  183. max-height: #{800rpx};
  184. overflow-y: auto;
  185. .card {
  186. width: 100%;
  187. height: #{160rpx};
  188. background-image: url('../../../static/image/icon/goods-card.png');
  189. background-position: center;
  190. background-repeat: no-repeat;
  191. background-size: contain;
  192. padding: 0 #{32rpx} 0 #{36rpx};
  193. margin-bottom: #{20rpx};
  194. image {
  195. width: #{88rpx};
  196. height: #{88rpx};
  197. display: block;
  198. margin-right: #{68rpx};
  199. border-radius: #{88rpx};
  200. }
  201. .name {
  202. width: 478#{rpx};
  203. text-overflow: ellipsis;
  204. white-space: nowrap;
  205. overflow: hidden;
  206. font-size: 28#{rpx};
  207. color: #353535;
  208. }
  209. .number {
  210. font-size:24#{rpx};
  211. color: #999999;
  212. margin-top:10#{rpx};
  213. }
  214. }
  215. }
  216. }
  217. .pickup-modal {
  218. .title {
  219. font-size: $uni-font-size-general-one;
  220. padding: #{40rpx} 0;
  221. text-align: center;
  222. }
  223. .content {
  224. padding: 0 #{40rpx} #{48rpx};
  225. font-size: $uni-font-size-general-one;
  226. }
  227. }
  228. </style>