app-price-title-share.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="app-price-title-share">
  3. <view class="app-name">{{name}}</view>
  4. <view v-if="subtitle" class="app-subtitle">
  5. <view class="t-omit-three">{{subtitle}}</view>
  6. </view>
  7. <view class="app-content dir-left-nowrap main-between">
  8. <view class="app-price">
  9. <view v-if="level_show === 1" class="dir-left-nowrap main-left cross-bottom" :class="theme">
  10. <text class="app-member-price" :class="[theme, theme + '-m-text']">{{priceMember}}</text>
  11. <text class="app-member-icon" :class="[theme, theme + '-m-text', theme + '-m-border']">会员价</text>
  12. <app-sup-vip :is_vip_card_user="is_vip_card_user" margin="0 0 10rpx 13rpx" v-if="discount" :discount="discount"></app-sup-vip>
  13. </view>
  14. <view class="cross-bottom dir-left-nowrap" v-else>
  15. <text class="app-unmember-price" :class="[theme, theme + '-m-text']">{{price}}</text>
  16. <app-sup-vip :is_vip_card_user="is_vip_card_user" margin="0 0 10rpx 13rpx" v-if="discount" :discount="discount"></app-sup-vip>
  17. </view>
  18. <view class="app-original-price">
  19. <text v-if="level_show != 1" class="app-p">¥{{original_price}}</text>
  20. <text v-else class="app-miaosha" :class="[theme, theme + '-m-text']">¥{{price}}</text>
  21. <text v-if="isSales == 1">销量 {{miaosha_buy_count}}{{unit}}</text>
  22. </view>
  23. </view>
  24. <view class="app-share">
  25. <app-form-id @click="shareShow = true">
  26. <image class="app-icon" src="../../../static/image/icon/icon-share.png"></image>
  27. <text class="app-text">分享</text>
  28. </app-form-id>
  29. </view>
  30. </view>
  31. <view>
  32. <app-share-qr-code v-model="shareShow"
  33. :url="url"
  34. :poster-config="posterConfig"
  35. :poster-generate="posterGenerate"
  36. :has-poster-nav="hasPosterNav"
  37. ></app-share-qr-code>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import appShareQrCode from '../../../components/page-component/app-share-qr-code-poster/app-share-qr-code-poster.vue';
  43. import { mapState } from "vuex";
  44. export default {
  45. name: 'app-price-title-share',
  46. data() {
  47. return {
  48. shareShow: false,
  49. }
  50. },
  51. props: {
  52. posterConfig: String,
  53. posterGenerate: String,
  54. hasPosterNav: {
  55. type: Boolean,
  56. default() {
  57. return false
  58. },
  59. },
  60. is_vip_card_user: {
  61. type: Number,
  62. default() {
  63. return 0;
  64. }
  65. },
  66. discount: {
  67. type: String,
  68. default() {
  69. return null;
  70. }
  71. },
  72. name: {
  73. type: String,
  74. },
  75. // 副标题
  76. subtitle: {
  77. type: String,
  78. },
  79. original_price:{
  80. type: String,
  81. },
  82. price_max: {
  83. type: Number
  84. },
  85. price_min:{
  86. type: Number
  87. },
  88. price_member_max:{
  89. type: Number
  90. },
  91. price_member_min: {
  92. type: Number
  93. },
  94. level_show: {
  95. type: Number
  96. },
  97. url: {
  98. type: String,
  99. },
  100. miaosha_buy_count: {
  101. type: Number,
  102. },
  103. unit: {
  104. type: String,
  105. },
  106. theme: {
  107. type: String,
  108. }
  109. },
  110. computed: {
  111. priceMember: function() {
  112. if (this.price_member_min === this.price_member_max) {
  113. return this.price_member_min;
  114. } else if (this.price_member_min !== this.price_member_max && this.price_member_max !== 0) {
  115. return `${this.price_member_min}~${this.price_member_max}`
  116. } else if (this.price_member_max=== 0) {
  117. return '免费';
  118. }
  119. },
  120. price: function() {
  121. if (this.price_min === this.price_max) {
  122. return this.price_min;
  123. } else if (this.price_min !== this.price_max && this.price_max !== 0) {
  124. return `${this.price_min}~${this.price_max}`
  125. } else if (this.price_max === 0) {
  126. return '免费';
  127. }
  128. },
  129. ...mapState({
  130. isUnderlinePrice: state => state.mallConfig.mall.setting.is_underline_price,
  131. isSales: state => state.mallConfig.mall.setting.is_sales,
  132. }),
  133. },
  134. components: {
  135. 'app-share-qr-code': appShareQrCode
  136. }
  137. }
  138. </script>
  139. <style scoped lang="scss">
  140. .app-price-title-share {
  141. width: #{750rpx};
  142. background-color: white;
  143. padding: #{24rpx} #{24rpx} #{5rpx} #{24rpx};
  144. .app-name {
  145. width: #{702rpx};
  146. max-height: #{70rpx};
  147. line-height: #{35rpx};
  148. font-size: #{30rpx};
  149. color: #353535;
  150. word-break: break-all;
  151. text-overflow: ellipsis;
  152. display: -webkit-box;
  153. -webkit-box-orient: vertical;
  154. -webkit-line-clamp: 2;
  155. overflow: hidden;
  156. }
  157. .app-subtitle {
  158. margin-top: #{18rpx};
  159. font-size: 24rpx;
  160. background-color: #ffffff;
  161. color: #999999;
  162. }
  163. .app-content {
  164. width: #{702rpx};
  165. .app-price {
  166. padding-top: #{20rpx};
  167. .app-member-price:before {
  168. content: '¥';
  169. font-size: #{32rpx};
  170. }
  171. .app-unmember-price:before {
  172. content: '¥';
  173. font-size: #{23rpx};
  174. }
  175. .app-unmember-price {
  176. font-size: #{40rpx};
  177. }
  178. .origin-price {
  179. color: #ff5c5c !important;
  180. }
  181. .app-member-price {
  182. font-size: #{56rpx};
  183. margin-right: #{13rpx};
  184. font-family: DIN;
  185. }
  186. .app-original-price {
  187. font-size: #{28rpx};
  188. color: #999;
  189. .app-miaosha {
  190. font-size: #{30rpx};
  191. font-family: DIN;
  192. margin-right: #{20rpx};
  193. }
  194. .app-p {
  195. text-decoration: line-through;
  196. margin-right: #{17rpx};
  197. font-size: #{24rpx};
  198. }
  199. }
  200. }
  201. .app-share {
  202. width: #{40rpx};
  203. height: #{136rpx};
  204. position: relative;
  205. .app-icon {
  206. width: #{40rpx};
  207. height: #{40rpx};
  208. }
  209. .app-text {
  210. color: #666666;
  211. font-size: #{20rpx};
  212. position: absolute;
  213. top: #{50rpx};
  214. left: 0;
  215. }
  216. }
  217. }
  218. }
  219. .app-member-icon {
  220. display: inline-block;
  221. width: #{67rpx};
  222. height: #{28rpx};
  223. line-height: #{24rpx};
  224. text-align: center;
  225. border: #{1upx} solid;
  226. border-radius: #{5rpx};
  227. font-size: #{18rpx};
  228. margin-bottom: #{10rpx};
  229. }
  230. </style>