hxj-bd-info.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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;">{{house_layout}} {{measure}}</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="main-center cross-center lq" @click="receive">领券<image src="../../../static/image/index/arrow-right-facet-white.png" mode=""></image></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. house_layout:String,
  62. measure:String,
  63. isShowShare: {
  64. type: Boolean,
  65. default () {
  66. return true;
  67. }
  68. },
  69. posterConfig: String,
  70. posterGenerate: String,
  71. hasPosterNav: {
  72. type: Boolean,
  73. default () {
  74. return false
  75. },
  76. },
  77. shareUrl: String,
  78. appShareTitle: String,
  79. appSharePic: String,
  80. extraQuickShare: Object,
  81. hasUnderlinePrice: {
  82. type: [Boolean, String],
  83. default: true
  84. }
  85. },
  86. data() {
  87. return {
  88. shareShow: false,
  89. quickShareShow: false
  90. }
  91. },
  92. components: {
  93. bdQuickShare,
  94. appShareQrCode,
  95. },
  96. computed: {
  97. isUnderlinePrice() {
  98. return Number(this.is_underline_price) && this.hasUnderlinePrice
  99. },
  100. ...mapState({
  101. is_underline_price: state => state.mallConfig.mall.setting.is_underline_price
  102. }),
  103. newShareUrl() {
  104. if (this.shareUrl) {
  105. return this.shareUrl;
  106. } else {
  107. if (this.goodsId) {
  108. return this.$api.poster.goods + '&goods_id=' + this.goodsId;
  109. } else {
  110. return ``;
  111. }
  112. }
  113. }
  114. },
  115. methods: {
  116. receive(){
  117. this.$emit('receive')
  118. },
  119. testShare(s) {
  120. this.$emit('share', s);
  121. },
  122. quickShare(e) {
  123. this.$emit('quickShare', e);
  124. },
  125. shareClick() {
  126. // 判断登入
  127. if (!this.$user.isLogin()) {
  128. this.$user.getInfo().then(() => {});
  129. } else {
  130. if (this.extraQuickShare) {
  131. this.quickShareShow = true;
  132. } else {
  133. this.shareShow = true;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .hxj-goods-name {
  142. width: 750rpx;
  143. height: auto;
  144. background: #F6F6F6;
  145. padding: 43rpx 30rpx 28rpx 46rpx;
  146. .hxj-name {
  147. width: 360rpx;
  148. font-size: 28rpx;
  149. font-weight: 500;
  150. color: #121212;
  151. line-height: 56rpx;
  152. margin-right: 14rpx;
  153. }
  154. .hxj-tags {
  155. width: 56rpx;
  156. height: 30rpx;
  157. background: #040404;
  158. font-size: 20rpx;
  159. font-weight: 400;
  160. color: #FFFFFF;
  161. margin-right: 13rpx;
  162. text-align: center;
  163. }
  164. .hxj-ynum {
  165. width: auto;
  166. height: 30rpx;
  167. border: 1rpx solid #AE8445;
  168. border-radius: 4rpx;
  169. font-size: 22rpx;
  170. font-weight: 500;
  171. color: #AE8445;
  172. opacity: 0.6;
  173. padding: 0 6rpx;
  174. line-height: 30rpx;
  175. text-align: center;
  176. }
  177. .hxj-price {
  178. font-size: 46rpx;
  179. font-weight: bold;
  180. color: #A6814F;
  181. .rmb {
  182. font-size: 18rpx;
  183. font-weight: 500;
  184. color: #A6814F;
  185. margin-right: 9rpx;
  186. }
  187. .dw {
  188. font-size: 20rpx;
  189. font-weight: 500;
  190. color: #A6814F;
  191. margin-left: 13rpx;
  192. }
  193. }
  194. .lq {
  195. width: 92rpx;
  196. height: 38rpx;
  197. background: #FF0000;
  198. border-radius: 19rpx;
  199. font-size: 20rpx;
  200. font-weight: 500;
  201. color: #FFFFFF;
  202. line-height: 38rpx;
  203. margin-top: 10rpx;
  204. image{
  205. width: 22rpx;
  206. height: 22rpx;
  207. margin-left: 7rpx;
  208. }
  209. }
  210. .se {
  211. image {
  212. width: 25rpx;
  213. height: 25rpx;
  214. margin-right: 6rpx;
  215. }
  216. font-size: 24rpx;
  217. font-weight: 500;
  218. color: #AE8445;
  219. }
  220. }
  221. .bd-share {
  222. margin-top: 15upx;
  223. margin-right: -20upx;
  224. }
  225. .bd-share .bd-share-box {
  226. height: 48upx;
  227. border-radius: 40upx 0 0 40upx;
  228. padding: 0 14upx;
  229. width: 103upx;
  230. }
  231. .bd-share .bd-icon {
  232. width: 22upx;
  233. height: 22upx;
  234. }
  235. .bd-share .bd-text {
  236. color: #ffffff;
  237. font-size: 22upx;
  238. line-height: 30upx;
  239. margin-left: 10upx;
  240. }
  241. .process {
  242. background-color: rgb(221, 183, 102);
  243. background-size: 100% 100%;
  244. width: 20.66rem;
  245. height: 2.78rem;
  246. }
  247. </style>