bd-info.vue 12 KB

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