hxj-bd-info.vue 6.0 KB

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