1
0

app-goods-marketing.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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="sign !== 'gift' ? theme + '-m-border ' + theme + '-m-text ' + theme : 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="balance && balance.title">
  12. <view class="box-grow-0">促销</view>
  13. <view class="give box-grow-0 main-center cross-center" :class="sign !== 'gift' ? theme + '-m-border ' + theme + '-m-text ' + theme : theme + '-color'">
  14. 赠余额
  15. </view>
  16. <view class="content box-grow-1">{{balance.title}}</view>
  17. </view>
  18. <view class="block dir-left-nowrap cross-center" v-if="card && card.list.length > 0" @click="change('cardShow')">
  19. <view class="box-grow-0">{{!(balance && balance.title) ? '促销' : ''}}</view>
  20. <view class="give box-grow-0 main-center cross-center" :class="sign !== 'gift' ? theme + '-m-border ' + theme + '-m-text ' + theme : theme + '-color'">
  21. 赠卡券
  22. </view>
  23. <view class="content box-grow-1">{{card.title}}</view>
  24. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  25. </view>
  26. <view class="block dir-left-nowrap cross-center" v-if="coupon && coupon.list.length > 0" @click="change('couponShow')">
  27. <view class="box-grow-0">{{!(balance && balance.title && card && card.list.length > 0) ? '促销' : ''}}</view>
  28. <view class="give box-grow-0 main-center cross-center" :class="sign !== 'gift' ? theme + '-m-border ' + theme + '-m-text ' + theme : theme + '-color'">
  29. 赠优惠券
  30. </view>
  31. <view class="content box-grow-1">{{coupon.title}}</view>
  32. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  33. </view>
  34. </view>
  35. <view class="marketing marketing-top">
  36. <view class="block dir-left-nowrap cross-center" v-if="express">
  37. <view class="box-grow-0">快递</view>
  38. <view class="content box-grow-1">{{express}}</view>
  39. </view>
  40. <view class="block dir-left-nowrap cross-center" v-if="shipping" @click="change('shippingShow')">
  41. <view class="box-grow-0">包邮</view>
  42. <view class="content box-grow-1">{{shipping}}</view>
  43. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  44. </view>
  45. <view class="block dir-left-nowrap cross-center" v-if="limit" @click="change('limitShow')">
  46. <view class="box-grow-0">限购</view>
  47. <view class="content box-grow-1">{{limit}}</view>
  48. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  49. </view>
  50. <view class="block dir-left-nowrap cross-center" v-if="pickup" @click="change('pickupShow')">
  51. <view class="box-grow-0">起送</view>
  52. <view class="content box-grow-1">{{pickup}}</view>
  53. <image class="box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  54. </view>
  55. </view>
  56. <view class="card-modal">
  57. <app-model v-model="cardShow" type="1" :height="840">
  58. <view slot="title" class="title">赠卡券</view>
  59. <view slot="content" class="content">
  60. <view class="card dir-left-nowrap cross-center" v-for="(item, index) in card.list" :key="index">
  61. <image :src="item.pic_url"></image>
  62. <view class="box-grow-1 dir-top-nowrap">
  63. <text class="name">{{item.name}}</text>
  64. <text class="number">赠送{{item.number}}张</text>
  65. </view>
  66. </view>
  67. </view>
  68. </app-model>
  69. </view>
  70. <view class="coupon-modal">
  71. <app-model v-model="couponShow" type="1" :height="840">
  72. <view slot="title" class="title">赠优惠券</view>
  73. <view slot="content" class="content">
  74. <view class="coupon dir-left-nowrap cross-center" v-for="(item, index) in coupon.list" :key="index">
  75. <view class="dis" v-if="item.type === 1">
  76. <text>{{item.discount}}</text>
  77. <text>折</text>
  78. </view>
  79. <view class="price" v-else-if="item.type === 2">
  80. <text>¥</text>
  81. <text>{{item.sub_price}}</text>
  82. </view>
  83. <view class="box-grow-1 dir-top-nowrap">
  84. <text class="name">{{item.name}}</text>
  85. <text class="limit">满{{item.min_price}}可用</text>
  86. <text class="number">赠送{{item.number}}张</text>
  87. </view>
  88. </view>
  89. </view>
  90. </app-model>
  91. </view>
  92. <view class="pickup-modal">
  93. <app-model v-model="pickupShow" type="2">
  94. <view slot="title" class="title">起送</view>
  95. <view slot="content" class="content">
  96. <scroll-view scroll-y class="scroll">{{pickup}}</scroll-view>
  97. </view>
  98. </app-model>
  99. <app-model v-model="limitShow" type="2">
  100. <view slot="title" class="title">限购</view>
  101. <view slot="content" class="content-area">
  102. <scroll-view scroll-y class="scroll">{{limit}}</scroll-view>
  103. </view>
  104. </app-model>
  105. <app-model v-model="shippingShow" type="2">
  106. <view slot="title" class="title">包邮</view>
  107. <view slot="content" class="content">
  108. <scroll-view scroll-y class="scroll">{{shipping}}</scroll-view>
  109. </view>
  110. </app-model>
  111. </view>
  112. </view>
  113. </template>
  114. <script>
  115. import appModel from '../../../components/basic-component/app-model/app-model.vue';
  116. export default {
  117. name: "app-goods-marketing",
  118. components: {
  119. 'app-model': appModel
  120. },
  121. props: {
  122. limit: {
  123. type: String,
  124. default() {
  125. return '';
  126. }
  127. },
  128. pickup: {
  129. type: String,
  130. default() {
  131. return '';
  132. }
  133. },
  134. shipping: {
  135. type: String,
  136. default() {
  137. return '';
  138. }
  139. },
  140. card: {
  141. type: Object,
  142. default() {
  143. return {};
  144. }
  145. },
  146. integral: {
  147. type: Object,
  148. default() {
  149. return {};
  150. }
  151. },
  152. balance:{
  153. type: Object,
  154. default() {
  155. return {};
  156. }
  157. },
  158. coupon:{
  159. type: Object,
  160. default() {
  161. return {};
  162. }
  163. },
  164. express: {
  165. type: String,
  166. default() {
  167. return '';
  168. }
  169. },
  170. theme: String,
  171. sign: String
  172. },
  173. data() {
  174. return {
  175. shippingShow: false,
  176. limitShow: false,
  177. cardShow: false,
  178. pickupShow: false,
  179. couponShow: false
  180. };
  181. },
  182. methods: {
  183. change(key) {
  184. this[key] = true;
  185. }
  186. }
  187. }
  188. </script>
  189. <style scoped lang="scss">
  190. .marketing-top {
  191. margin-top: #{20rpx};
  192. }
  193. .marketing {
  194. & .block:first-child {
  195. padding-top: #{32rpx};
  196. padding-bottom: #{28rpx};
  197. }
  198. & .block:last-child {
  199. padding-bottom: #{32rpx};
  200. }
  201. &:empty {
  202. margin: 0;
  203. }
  204. .block {
  205. background-color: #ffffff;
  206. font-size: $uni-font-size-general-one;
  207. color: $uni-general-color-two;
  208. padding: 0 #{24rpx} #{28rpx} #{24rpx};
  209. & view:first-child {
  210. margin-right: #{30rpx};
  211. width: 60upx;
  212. }
  213. .give {
  214. padding: #{2rpx} #{4rpx};
  215. border: #{1rpx} solid;
  216. border-radius: #{4rpx};
  217. font-size: $uni-font-size-weak-two;
  218. margin-right: #{12rpx};
  219. }
  220. .content {
  221. color: $uni-important-color-black;
  222. display: inline-block;
  223. white-space: nowrap;
  224. width: 100%;
  225. overflow: hidden;
  226. text-overflow: ellipsis;
  227. }
  228. image {
  229. width: #{12rpx};
  230. height: #{22rpx};
  231. display: block;
  232. margin-left: #{24rpx};
  233. }
  234. }
  235. }
  236. .card-modal {
  237. .title {
  238. font-size: $uni-font-size-general-one;
  239. padding: #{40rpx} 0;
  240. text-align: center;
  241. }
  242. .content {
  243. width: 100%;
  244. padding: 0 #{24rpx} #{40rpx} #{24rpx};
  245. max-height: #{800rpx};
  246. overflow-y: auto;
  247. .card {
  248. width: 100%;
  249. height: #{160rpx};
  250. background-image: url('../../../static/image/icon/goods-card.png');
  251. background-position: center;
  252. background-repeat: no-repeat;
  253. background-size: contain;
  254. padding: 0 #{32rpx} 0 #{36rpx};
  255. margin-bottom: #{20rpx};
  256. image {
  257. width: #{88rpx};
  258. height: #{88rpx};
  259. display: block;
  260. margin-right: #{68rpx};
  261. border-radius: #{88rpx};
  262. }
  263. .name {
  264. width: 478#{rpx};
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. overflow: hidden;
  268. font-size: 28#{rpx};
  269. color: #353535;
  270. }
  271. .number {
  272. font-size:24#{rpx};
  273. color: #999999;
  274. margin-top:10#{rpx};
  275. }
  276. }
  277. }
  278. }
  279. .pickup-modal {
  280. .title {
  281. font-size: $uni-font-size-general-one;
  282. padding: #{40rpx} 0;
  283. text-align: center;
  284. }
  285. .content {
  286. padding: 0 #{40rpx} #{48rpx};
  287. font-size: $uni-font-size-general-one;
  288. }
  289. .scroll {
  290. max-height: #{450rpx};
  291. word-wrap:break-word;
  292. }
  293. ::-webkit-scrollbar {
  294. width: 0;
  295. height: 0;
  296. color: transparent;
  297. }
  298. .content-area {
  299. font-size: $uni-font-size-general-one;
  300. }
  301. }
  302. .coupon-modal {
  303. .title {
  304. font-size: $uni-font-size-general-one;
  305. padding: #{40rpx} 0;
  306. text-align: center;
  307. }
  308. .content {
  309. width: 100%;
  310. padding: 0 #{24rpx} #{40rpx} #{24rpx};
  311. max-height: #{800rpx};
  312. overflow-y: auto;
  313. z-index: 1000;
  314. .coupon {
  315. width: 100%;
  316. height: #{160rpx};
  317. background-image: url('../../../static/image/icon/goods-card.png');
  318. background-position: center;
  319. background-repeat: no-repeat;
  320. background-size: contain;
  321. margin-bottom: #{20rpx};
  322. .dis {
  323. >text:first-child {
  324. font-weight: bold;
  325. font-size: 36upx;
  326. }
  327. >text:last-child {
  328. font-size: 22upx;
  329. font-weight: bold;
  330. }
  331. }
  332. .price {
  333. >text:first-child {
  334. font-size: 18upx;
  335. font-weight: bold;
  336. }
  337. >text:last-child {
  338. font-size: 36upx;
  339. font-weight: bold;
  340. }
  341. }
  342. view:first-child {
  343. width: 160upx;
  344. text-align: center;
  345. }
  346. view:last-child {
  347. padding-left: 32upx;
  348. }
  349. image {
  350. width: #{88rpx};
  351. height: #{88rpx};
  352. display: block;
  353. margin-right: #{68rpx};
  354. border-radius: #{88rpx};
  355. }
  356. .name {
  357. width: 478#{rpx};
  358. text-overflow: ellipsis;
  359. white-space: nowrap;
  360. overflow: hidden;
  361. font-size: 28#{rpx};
  362. color: #353535;
  363. }
  364. .limit {
  365. font-size: 19upx;
  366. color: #353535;
  367. }
  368. .number {
  369. font-size:24#{rpx};
  370. color: #999999;
  371. margin-top:10#{rpx};
  372. }
  373. }
  374. }
  375. }
  376. </style>