app-goods-marketing.vue 7.6 KB

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