hxj-bd-info.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="bd-info">
  3. <view class="main-between hxj-goods-name">
  4. <view class="main-between-y">
  5. <view class="main-left cross-center">
  6. <view class="hxj-name t-omit">{{name}}</view>
  7. <view class="hxj-tags">套装</view>
  8. <view class="hxj-ynum">已售{{sales}}+</view>
  9. </view>
  10. <view class="main-left cross-center hjx-tc-999 hjx-ts-22">
  11. <view style="margin-right: 31rpx;">A1 200m²</view>
  12. <view class="hjx-text-decoration-line-through">{{originalPrice}}元</view>
  13. </view>
  14. <view class="hjx-tc-AE8445 hjx-ts-22 hjx-tw-500" style="margin:26rpx 0 22rpx ;">券后价</view>
  15. <view class="hxj-price"><text class="rmb">¥</text>{{price}}<text class="dw">元</text></view>
  16. </view>
  17. <view class="main-between-y">
  18. <view class="lq" @click="receive">领券</view>
  19. <view class="cross-center se" v-if="isShowShare" @click="shareClick">
  20. <image src="https://t17.9026.com/web/statics/image/index/share_y.png" mode=""></image>分享
  21. </view>
  22. </view>
  23. </view>
  24. <template v-if="!isShowShare && $slots.share">
  25. <view class="bd-share">
  26. <slot name="share"></slot>
  27. </view>
  28. </template>
  29. <template v-if="isShowShare">
  30. <bd-quick-share v-model="quickShareShow" @quickShare="quickShare" :goods-id="goodsId"
  31. :is-video-number="goods.is_video_number" :extra-quick-share="extraQuickShare"
  32. :app-share-pic="appSharePic" :app-share-title="appShareTitle"></bd-quick-share>
  33. <app-share-qr-code @share="testShare" v-model="shareShow" :url="newShareUrl" :goods="goods"
  34. :poster-config="posterConfig" :poster-generate="posterGenerate" :has-poster-nav="hasPosterNav"
  35. :app-share-pic="appSharePic" :app-share-title="appShareTitle"></app-share-qr-code>
  36. </template>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. mapState
  42. } from "vuex";
  43. import bdQuickShare from '@/components/page-component/goods/bd-quick-share.vue';
  44. import appShareQrCode from '@/components/page-component/app-share-qr-code-poster/app-share-qr-code-poster.vue';
  45. export default {
  46. name: "u-info",
  47. props: {
  48. name: String,
  49. theme: Object,
  50. price: {
  51. type: [Number, String]
  52. },
  53. originalPrice: {
  54. type: [Number, String]
  55. },
  56. sales: {
  57. type: [Number, String]
  58. },
  59. goodsId: Number,
  60. goods: Object,
  61. isShowShare: {
  62. type: Boolean,
  63. default () {
  64. return true;
  65. }
  66. },
  67. posterConfig: String,
  68. posterGenerate: String,
  69. hasPosterNav: {
  70. type: Boolean,
  71. default () {
  72. return false
  73. },
  74. },
  75. shareUrl: String,
  76. appShareTitle: String,
  77. appSharePic: String,
  78. extraQuickShare: Object,
  79. hasUnderlinePrice: {
  80. type: [Boolean, String],
  81. default: true
  82. }
  83. },
  84. data() {
  85. return {
  86. shareShow: false,
  87. quickShareShow: false
  88. }
  89. },
  90. components: {
  91. bdQuickShare,
  92. appShareQrCode,
  93. },
  94. computed: {
  95. isUnderlinePrice() {
  96. return Number(this.is_underline_price) && this.hasUnderlinePrice
  97. },
  98. ...mapState({
  99. is_underline_price: state => state.mallConfig.mall.setting.is_underline_price
  100. }),
  101. newShareUrl() {
  102. if (this.shareUrl) {
  103. return this.shareUrl;
  104. } else {
  105. if (this.goodsId) {
  106. return this.$api.poster.goods + '&goods_id=' + this.goodsId;
  107. } else {
  108. return ``;
  109. }
  110. }
  111. }
  112. },
  113. methods: {
  114. receive(){
  115. this.$emit('receive')
  116. },
  117. testShare(s) {
  118. this.$emit('share', s);
  119. },
  120. quickShare(e) {
  121. this.$emit('quickShare', e);
  122. },
  123. shareClick() {
  124. // 判断登入
  125. if (!this.$user.isLogin()) {
  126. this.$user.getInfo().then(() => {});
  127. } else {
  128. if (this.extraQuickShare) {
  129. this.quickShareShow = true;
  130. } else {
  131. this.shareShow = true;
  132. }
  133. }
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .hxj-goods-name {
  140. width: 750rpx;
  141. height: auto;
  142. background: #F6F6F6;
  143. padding: 43rpx 30rpx 28rpx 46rpx;
  144. .hxj-name {
  145. width: 360rpx;
  146. font-size: 28rpx;
  147. font-weight: 500;
  148. color: #121212;
  149. line-height: 56rpx;
  150. margin-right: 14rpx;
  151. }
  152. .hxj-tags {
  153. width: 56rpx;
  154. height: 30rpx;
  155. background: #040404;
  156. font-size: 20rpx;
  157. font-weight: 400;
  158. color: #FFFFFF;
  159. margin-right: 13rpx;
  160. text-align: center;
  161. }
  162. .hxj-ynum {
  163. width: auto;
  164. height: 30rpx;
  165. border: 1rpx solid #AE8445;
  166. border-radius: 4rpx;
  167. font-size: 22rpx;
  168. font-weight: 500;
  169. color: #AE8445;
  170. opacity: 0.6;
  171. padding: 0 6rpx;
  172. line-height: 30rpx;
  173. text-align: center;
  174. }
  175. .hxj-price {
  176. font-size: 46rpx;
  177. font-weight: bold;
  178. color: #A6814F;
  179. .rmb {
  180. font-size: 18rpx;
  181. font-weight: 500;
  182. color: #A6814F;
  183. margin-right: 9rpx;
  184. }
  185. .dw {
  186. font-size: 20rpx;
  187. font-weight: 500;
  188. color: #A6814F;
  189. margin-left: 13rpx;
  190. }
  191. }
  192. .lq {
  193. width: 92rpx;
  194. height: 38rpx;
  195. background: #FF0000;
  196. border-radius: 19rpx;
  197. font-size: 20rpx;
  198. font-weight: 500;
  199. color: #FFFFFF;
  200. text-align: center;
  201. line-height: 38rpx;
  202. margin-top: 10rpx;
  203. }
  204. .se {
  205. image {
  206. width: 25rpx;
  207. height: 25rpx;
  208. margin-right: 6rpx;
  209. }
  210. font-size: 24rpx;
  211. font-weight: 500;
  212. color: #AE8445;
  213. }
  214. }
  215. .bd-share {
  216. margin-top: 15upx;
  217. margin-right: -20upx;
  218. }
  219. .bd-share .bd-share-box {
  220. height: 48upx;
  221. border-radius: 40upx 0 0 40upx;
  222. padding: 0 14upx;
  223. width: 103upx;
  224. }
  225. .bd-share .bd-icon {
  226. width: 22upx;
  227. height: 22upx;
  228. }
  229. .bd-share .bd-text {
  230. color: #ffffff;
  231. font-size: 22upx;
  232. line-height: 30upx;
  233. margin-left: 10upx;
  234. }
  235. .process {
  236. background-color: rgb(221, 183, 102);
  237. background-size: 100% 100%;
  238. width: 20.66rem;
  239. height: 2.78rem;
  240. }
  241. </style>