bd-info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <view class="bd-info">
  3. <view class="dir-left-nowrap bd-price-share">
  4. <view class="box-grow-1" :class="isNegotiable === 1 ? 'cross-center' : ''">
  5. <template v-if="isNegotiable !== 1">
  6. <view v-if="isShowPrice">
  7. <template v-if="levelShow === 1">
  8. <view class="dir-left-nowrap cross-bottom">
  9. <view class="bd-price box-grow-0" :class="theme.color">
  10. <app-price :max="`${priceMemberMax}`" :min="`${priceMemberMin}`" :default-price="`${price}`" :theme="theme.theme"></app-price>
  11. </view>
  12. <view v-if="isShowMember" class="bd-member-mark">
  13. <app-member-mark :theme="theme"></app-member-mark>
  14. </view>
  15. <app-sup-vip v-if="discount" :is_vip_card_user="isVipCardUser" margin="0 0 0 13rpx" :discount="discount"></app-sup-vip>
  16. </view>
  17. <view class="dir-left-nowrap cross-bottom">
  18. <view v-if="isUnderlinePrice == 1" :class="[theme.color, 'box-grow-0', 'bd-member-price']">
  19. <app-price :price="`${price}`" type="text-price-all"></app-price>
  20. </view>
  21. <view v-if="isSales === 1" class="bd-sales">销量{{sales}}{{unit}}</view>
  22. </view>
  23. </template>
  24. <template v-else>
  25. <view class="dir-left-nowrap cross-bottom">
  26. <view :class="[theme.color, 'bd-price']">
  27. <app-price :max="`${priceMax}`" :min="`${priceMin}`" type="text-price-all" :default-price="`${price}`"></app-price>
  28. </view>
  29. <view v-if="isUnderlinePrice == 1" class="bd-origin-price" >
  30. <app-price :price="`${originalPrice}`" type="text-price-all"></app-price>
  31. </view>
  32. <app-sup-vip v-if="discount" :is_vip_card_user="isVipCardUser" margin="0 0 0 13rpx" :discount="discount"></app-sup-vip>
  33. </view>
  34. </template>
  35. </view>
  36. </template>
  37. <template v-else>
  38. <text :class="[theme.color, 'bd-negotiable']">价格面议</text>
  39. </template>
  40. </view>
  41. </view>
  42. <text class="bd-name u-line-2">
  43. {{name}}
  44. <text v-if="isSales === 1" class="bd-sales" >销量{{sales}}{{unit}}</text>
  45. </text>
  46. <text class="bd-subtitle u-line-3" v-if="subtitle">{{subtitle}}</text>
  47. <slot></slot>
  48. <view class="bd-tags">
  49. <div class="bd-tag-group">
  50. <view class="bd-tag">
  51. <image src="../../../static/image/icon/icon-zheng.png"></image>
  52. <text>正品保证</text>
  53. </view>
  54. <view class="bd-tag">
  55. <image src="../../../static/image/icon/icon-tui.png" style="width: 34rpx;"></image>
  56. <text>售后无忧</text>
  57. </view>
  58. </div>
  59. <block v-if="isShowShare" >
  60. <view class="bd-tag bd-tag-share" @click="shareClick" style="margin-right: 0;background-color:#F84469;">
  61. <image src="../../../static/image/icon/icon-share1.png"></image>
  62. <text style="background-color:#F84469;color: #fff;">分享商品</text>
  63. </view>
  64. </block>
  65. <template v-if="!isShowShare && $slots.share">
  66. <view class="bd-share">
  67. <slot name="share"></slot>
  68. </view>
  69. </template>
  70. <template v-if="isShowShare">
  71. <bd-quick-share
  72. v-model="quickShareShow"
  73. @quickShare="quickShare"
  74. :goods-id="goodsId"
  75. :extra-quick-share="extraQuickShare"
  76. :app-share-pic="appSharePic"
  77. :app-share-title="appShareTitle"
  78. ></bd-quick-share>
  79. <app-share-qr-code
  80. v-model="shareShow"
  81. :url="newShareUrl"
  82. :goods="goods"
  83. :poster-config="posterConfig"
  84. :poster-generate="posterGenerate"
  85. :has-poster-nav="hasPosterNav"
  86. ></app-share-qr-code>
  87. </template>
  88. </view>
  89. <app-vip-card v-if="isVip" background="#fff" top="20rpx"></app-vip-card>
  90. <view class="bd-margin" v-if="flashSale">
  91. <bd-flash-sale :flash-sale="flashSale" :theme="theme"></bd-flash-sale>
  92. </view>
  93. <view class="bd-margin" v-if="levelShow === 21 && isNegotiable === 0">
  94. <view class="bd-vip" @click="goToMember">
  95. <img :src="root+'/web/statics/img/app/common/vip.png'" alt="">
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import AppVipCard from '@/components/page-component/app-vip-card/app-vip-card';
  102. import bdFlashSale from '@/components/page-component/goods/bd-flash-sale.vue';
  103. import appPrice from '@/components/page-component/goods/app-price.vue';
  104. import bdJoinMember from '@/components/page-component/goods/bd-join-member.vue';
  105. import appMemberMark from '@/components/page-component/app-member-mark/app-member-mark.vue';
  106. import bdQuickShare from '@/components/page-component/goods/bd-quick-share.vue';
  107. import appShareQrCode from '../../page-component/app-share-qr-code-poster/app-share-qr-code-poster.vue';
  108. import {mapState} from "vuex";
  109. export default {
  110. name: "u-info",
  111. props: {
  112. name: String,
  113. subtitle: String,
  114. isNegotiable: Number,
  115. theme: Object,
  116. flashSale: Object,
  117. levelShow: Number,
  118. price: Number,
  119. originalPrice: Number,
  120. priceMax: Number,
  121. priceMin: Number,
  122. priceMemberMax: Number,
  123. priceMemberMin: Number,
  124. isShowMember: {
  125. type: Boolean,
  126. default() {
  127. return true;
  128. }
  129. },
  130. isShowShare: {
  131. type: Boolean,
  132. default() {
  133. return true;
  134. }
  135. },
  136. discount: Number,
  137. isVipCardUser: {
  138. type: Number,
  139. default() {
  140. return 0;
  141. }
  142. },
  143. sales: {
  144. type: [Number, String]
  145. },
  146. unit: String,
  147. isSales: Number,
  148. posterConfig: String,
  149. posterGenerate: String,
  150. hasPosterNav: {
  151. type: Boolean,
  152. default() {
  153. return false
  154. },
  155. },
  156. goodsId: Number,
  157. shareUrl: String,
  158. extraQuickShare: Object,
  159. appSharePic: String,
  160. appShareTitle: String,
  161. goods: Object,
  162. isVip: Boolean,
  163. isShowPrice: {
  164. type: Boolean,
  165. default() {
  166. return true
  167. },
  168. },
  169. },
  170. data() {
  171. return {
  172. shareShow: false,
  173. quickShareShow: false,
  174. root: this.$siteInfo.root,
  175. }
  176. },
  177. components: {
  178. AppVipCard,
  179. bdFlashSale,
  180. appPrice,
  181. appMemberMark,
  182. bdJoinMember,
  183. bdQuickShare,
  184. appShareQrCode
  185. },
  186. computed: {
  187. ...mapState({
  188. isUnderlinePrice: state => state.mallConfig.mall.setting.is_underline_price,
  189. }),
  190. newShareUrl() {
  191. if (this.shareUrl) {
  192. return this.shareUrl;
  193. } else {
  194. if (this.goodsId) {
  195. return this.$api.poster.goods + '&goods_id=' + this.goodsId;
  196. } else {
  197. return ``;
  198. }
  199. }
  200. },
  201. },
  202. methods: {
  203. quickShare(e) {
  204. this.$emit('quickShare', e);
  205. },
  206. shareClick() {
  207. // 判断登入
  208. if (!this.$user.isLogin()) {
  209. this.$user.getInfo().then(() => {
  210. });
  211. } else {
  212. if (this.extraQuickShare) {
  213. this.quickShareShow = true;
  214. } else {
  215. this.shareShow = true;
  216. }
  217. }
  218. },
  219. goToMember(){
  220. uni.navigateTo({
  221. url:'/pages/member/index/index'
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style>
  228. .bd-info {
  229. width: 100%;
  230. background-color: #ffffff;
  231. padding: 20upx;
  232. margin-top: 16upx;
  233. }
  234. .bd-name {
  235. font-size: 32upx;
  236. color: #353535;
  237. line-height: 42upx;
  238. margin-top: 5upx;
  239. font-weight: 600;
  240. }
  241. .bd-subtitle {
  242. margin-top: 23upx;
  243. font-size: 24upx;
  244. line-height: 34upx;
  245. color: #999999;
  246. }
  247. .bd-price-share {
  248. margin-top: 20upx;
  249. }
  250. .bd-negotiable {
  251. font-size: 48upx;
  252. line-height: 53upx;
  253. }
  254. .bd-share {
  255. margin-top: 15upx;
  256. }
  257. .bd-share .bd-icon {
  258. width: 40upx;
  259. height: 40upx;
  260. }
  261. .bd-share .bd-text {
  262. color: #767676;
  263. font-size: 20upx;
  264. line-height: 30upx;
  265. margin-top: 5upx;
  266. }
  267. .bd-margin {
  268. margin-top: 20upx;
  269. }
  270. .bd-member-mark {
  271. margin-left: 12upx;
  272. }
  273. .bd-price {
  274. font-size: 50upx;
  275. line-height: 1;
  276. font-family: DIN;
  277. color: #F84469;
  278. }
  279. .bd-sales {
  280. color: #999999;
  281. font-size: 24rpx;
  282. float: right;
  283. }
  284. .bd-member-price {
  285. font-size: 32upx;
  286. margin-right: 20upx;
  287. line-height: 1;
  288. }
  289. .bd-origin-price {
  290. text-decoration: line-through;
  291. margin-left: 20upx;
  292. color: #999999;
  293. font-size: 26upx;
  294. }
  295. .bd-tags{
  296. width: 100%;
  297. display: flex;
  298. margin-top: 24rpx;
  299. justify-content: space-between;
  300. }
  301. .bd-tag-group{
  302. flex: 1;
  303. display: flex;
  304. }
  305. .bd-tags .bd-tag{
  306. display: flex;
  307. align-items: center;
  308. margin-right: 10px;
  309. }
  310. .bd-tags .bd-tag image{
  311. width: 32rpx;
  312. height: 32rpx;
  313. }
  314. .bd-tags .bd-tag text{
  315. background: #FED2D5;
  316. color: #E73E67;
  317. padding: 5rpx 10rpx;
  318. border-radius: 10rpx;
  319. font-size: 26rpx;
  320. margin-left: 10rpx;
  321. }
  322. .bd-tag-share{
  323. background: #FED2D5;
  324. color: #E73E67;
  325. border-radius: 10rpx;
  326. padding: 5rpx 10rpx;
  327. }
  328. .bd-tag-share image{
  329. margin-right: -10rpx;
  330. }
  331. .bd-tag-share text{
  332. font-size: 30rpx;
  333. margin-left: 0;
  334. }
  335. .bd-vip{
  336. margin-top: 24rpx;
  337. }
  338. .bd-vip image{
  339. height: 72rpx;
  340. width: 100%;
  341. }
  342. </style>