projectInfo.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. <template>
  2. <app-layout>
  3. <view v-if="!Object.keys(compositionList).length" class="u-goods-detail"></view>
  4. <template v-else>
  5. <app-nav-bar v-if="true" :fixed="true" :background-color="''" :xStyle="1" :hasMallSetting="2"
  6. :hasHeight="false"></app-nav-bar>
  7. <!--商品轮播图-->
  8. <app-goods-banner :pic-list="compositionList.banner_imgs" :range-key="'banner_imgs'"
  9. :goods_id="compositionList.id" :isCart="false"></app-goods-banner>
  10. <!-- 套装内商品 -->
  11. <view style="background-color: #fff;">
  12. <view class="link " style="margin-top: 20rpx;">
  13. <view class="title1 main-left cross-center">
  14. 套装内商品
  15. <image class="coupon_1" src="https://t17.9026.com/web/statics/image/index/coupon_1.png" mode="">
  16. </image>
  17. <text class="coupon_sub">IN SET GOODS</text>
  18. </view>
  19. </view>
  20. <hxj-scroll-list :itemWidth="'168rpx'" :itemHeight="'168rpx'" :list="list"></hxj-scroll-list>
  21. <hxj-bd-info :theme="getTheme" :name="compositionList.name"
  22. :discount_amount="compositionList.discount_amount" :original-price="compositionList.actual_price"
  23. :sales="Number(compositionList.sale_num)+Number(compositionList.virtual_sale_num)"
  24. :tag="compositionList.tag" :measure="compositionList.measure" :estate_name="compositionList.estate.name"
  25. :house_layout="compositionList.exampleHouse.name" :goods-id="compositionList.id"
  26. :coupons="goods_coupon_center" :extra-quick-share="extra_quick_share"
  27. :app-share-pic="app_share_pic ? app_share_pic : goods.pic_url[0].pic_url"
  28. :app-share-title="compositionList.name"
  29. :poster-config="poster_config + `&composition_id=` + compositionList.id"
  30. :poster-generate="poster_generate + `&composition_id=` + compositionList.id" :has-poster-nav="true"
  31. :goods="goods" @share="hShareAppMessage" @quickShare="quickShare" @receive="receive">
  32. </hxj-bd-info>
  33. <view class="hxj-goods-list" :style="{ height: isOpen ? 'auto' : '302rpx' }">
  34. <view class="main-between" style="width: 560rpx;">
  35. <view class="title">套装内商品</view>
  36. <view class="title">数量</view>
  37. </view>
  38. <view v-for="(item, index) in list" :key="index">
  39. <view style="width: 525rpx;height: 1px;background: #EFEFEF;opacity: 0.63;margin-left: 62rpx;"></view>
  40. <view class="main-between item">
  41. <view class="main-between" style="width: 560rpx;">
  42. <view class="name t-omit">{{item.name}}</view>
  43. <view class="num">x{{item.goods_num}}</view>
  44. </view>
  45. <view class="zk cropss-center" v-if="index === 1 &&list.length>2 && isOpen === false"
  46. @click="isOpen = true">
  47. 展开
  48. <image src="https://t17.9026.com/web/statics/image/user-center/arrow-bottom.png" mode="">
  49. </image>
  50. </view>
  51. <view class="zk cropss-center" v-if="index===list.length-1 && isOpen === true"
  52. @click="isOpen = false">
  53. 收起
  54. <image src="https://t17.9026.com/web/statics/image/user-center/arrow-top.png" mode="">
  55. </image>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <!--商品优惠券-->
  62. <bd-coupon @change="setCoupon" @on-show-change="val => {isCouponShow = val}" :isCustomEntry="true"
  63. :myShow="isCouponShow" :theme="getTheme" :coupons="goods_coupon_center"></bd-coupon>
  64. <!-- <bd-comments :goods-id="goodsId"></bd-comments> -->
  65. <!--商品详情-->
  66. <bd-detail :detail="compositionList.details"></bd-detail>
  67. <!--相关推荐-->
  68. <!-- <app-goods-recommend :sureCart="true" :theme="getTheme" :goods-list="recommend_list"></app-goods-recommend> -->
  69. <!--空格区域-->
  70. <view class="safe-area-inset-bottom u-bottom">
  71. <view class="u-bottom-height" :class="uBottomHeight"></view>
  72. </view>
  73. <!--底部按钮-->
  74. <view v-if="is_open == 1" class="safe-area-inset-bottom u-bottom-fixed">
  75. <view v-if="full_reduce && exchangeStatus == null">
  76. <app-goods-full-reduce :theme="getTheme" :full_reduce="full_reduce"
  77. :sign="goodsType === 'goods' ? '' : 1"></app-goods-full-reduce>
  78. </view>
  79. <view v-if="exchangeStatus == null && sell_time > 0">
  80. <app-sell-tip :time="sell_time" @changeTime="changeTime"></app-sell-tip>
  81. </view>
  82. <view class="bd-bottom u-bottom-height-0 cross-center dir-left-nowrap">
  83. <template v-if="exchangeStatus == null">
  84. <!-- <view class="bd-back dir-top-nowrap main-center cross-center box-grow-0" @click="back">
  85. <image class="bd-icon"
  86. src="https://shop.9026.com/web/statics/image/mall/static/icon/index.png"></image>
  87. <text class="bd-text">首页</text>
  88. </view> -->
  89. <template v-if="is_negotiable !== 1">
  90. <!-- 客服组件 -->
  91. <bd-service :name="name" :url="sendPath"></bd-service>
  92. </template>
  93. <view class="bd-back dir-top-nowrap main-center cross-center box-grow-0" @click="setCollect">
  94. <image class="bd-icon" :src="
  95. compositionList.is_collect
  96. ? 'https://t17.9026.com/web/statics/image/index/icon-favorite-active.png'
  97. : 'https://t17.9026.com/web/statics/image/index/icon-favorite.png'
  98. "></image>
  99. <text class="bd-text">收藏</text>
  100. </view>
  101. <template v-if="is_negotiable !== 1">
  102. <view class="box-grow-1 bd-btn bd-btn-color " :class="[disableBtn]"
  103. v-if="goods_num === 0 || is_finish_sell">
  104. {{ is_finish_sell ? '商品已下架' : '已售罄' }}
  105. </view>
  106. <view class="box-grow-1 dir-right-nowrap" v-else>
  107. <!-- <view v-if="goods.type === 'goods'" @click="clickAttr(0)" :style="{
  108. background: !goods || goods.buy_goods_auth ? getTheme.background_s_gradient_btn : '#999999',
  109. color: !goods || goods.buy_goods_auth ? getTheme.secondary_text : '#ffffff'
  110. }" :class="['bd-btn', leftTip]">
  111. 加入购物车
  112. </view> -->
  113. <view :class="['box-grow-1']" v-if="!(isTip == 0 && sell_time > 0)">
  114. <app-jump-button form>
  115. <view @click="clickAttr(1)" :style="{
  116. background: getTheme.background_gradient_btn ? getTheme.background_gradient_btn : '#999999',
  117. color: getTheme.main_text ? getTheme.main_text : ''
  118. }" :class="['bd-btn', 'bd-btn-color', 'box-grow-1']">
  119. {{ rightRemindText }}
  120. </view>
  121. </app-jump-button>
  122. </view>
  123. </view>
  124. </template>
  125. <view class="box-grow-1 dir-left-nowrap bd-btn-tel" v-else>
  126. <block v-for="(item, index) in good_negotiable" :key="index">
  127. <view class="tel" v-if="item === 'contact_tel'"
  128. @click="makePhoneCall(mall.setting.contact_tel)" :style="{
  129. background: good_negotiable.length === 1 ? getTheme.background_gradient_btn : getTheme.background_s_gradient_btn,
  130. color: good_negotiable.length === 2 ? getTheme.color : ''
  131. }" :class="[
  132. good_negotiable.length === 1 ? 'all-radius all-width text ' : '',
  133. good_negotiable.length === 3 ? 'bd-three-one text ' : '',
  134. good_negotiable.length === 2 ? 'bd-btn-half' : ''
  135. ]">
  136. 联系电话
  137. </view>
  138. <!-- #ifndef MP-TOUTIAO || MP-ALIPAY || H5 -->
  139. <button v-else-if="item === 'contact'" open-type="contact" show-message-card
  140. :send-message-title="name" :send-message-path="sendPath" :style="contactBtnStyle"
  141. class="contact" :class="contactBtn">
  142. 客服
  143. </button>
  144. <!-- #endif -->
  145. <view class="service" v-else-if="item === 'contact_web'"
  146. @click="router('/pages/web/web?url=' + encodeURIComponent(mall.setting.web_service_url))"
  147. :style="{
  148. background: good_negotiable.length !== 3 ? getTheme.background_gradient_btn : '',
  149. color: good_negotiable.length === 1 ? getTheme.secondary_text : ''
  150. }" :class="
  151. good_negotiable.length === 3
  152. ? 'default-bakground bd-three-one '
  153. : good_negotiable.length === 2
  154. ? 'bd-btn-half text '
  155. : ' all-radius all-width '
  156. ">
  157. 客服
  158. </view>
  159. </block>
  160. </view>
  161. </template>
  162. <template v-else>
  163. <view v-if="exchangeStatus == 0" @click="toExchange" class="box-grow-1 bd-exchange"
  164. :style="{ background: getTheme.background_gradient_o }">立即领取</view>
  165. <view class="box-grow-1 bd-exchange bd-over" v-else-if="exchangeStatus == 1">已领取</view>
  166. </template>
  167. </view>
  168. </view>
  169. </template>
  170. <app-close v-if="showClose" :modal="false" @update="getMall"></app-close>
  171. </app-layout>
  172. </template>
  173. <script>
  174. import {
  175. mapGetters,
  176. mapState
  177. } from 'vuex';
  178. import appGoodsBanner from '../../components/page-component/goods/app-goods-banner.vue';
  179. import appGoodsRecommend from '../../components/page-component/app-goods-recommend/app-goods-recommend.vue';
  180. import appQuickNavigation from '../../components/page-component/app-quick-navigation/app-quick-navigation.vue';
  181. import appComposition from '../../components/basic-component/app-composition/app-composition.vue';
  182. // import uniSwiperDot from '../../components/basic-component/uni-swiper-dot/uni-swiper-dot';
  183. import uAttr from '../../components/page-component/goods/u-attr.vue';
  184. import appGoodsFullReduce from '../../components/page-component/goods/app-goods-full-reduce.vue';
  185. import bdInfo from '@/components/page-component/goods/bd-info';
  186. import bdCoupon from '@/components/page-component/goods/bd-coupon.vue';
  187. // import bdXbc from '@/components/page-component/goods/bd-xbc.vue';
  188. // import bdKb from '@/components/page-component/goods/bd-kb.vue';
  189. // import bdHc from '@/components/page-component/goods/bd-hc.vue';
  190. import bdDetail from '@/components/page-component/goods/bd-detail.vue';
  191. import bdComments from '@/components/page-component/goods/bd-comments.vue';
  192. import appClose from '@/components/basic-component/app-close/app-close.vue';
  193. import bdService from '@/components/page-component/goods/bd-service.vue';
  194. import bdFlashSale from '@/components/page-component/goods/bd-flash-sale.vue';
  195. import appSellTip from '@/components/page-component/goods/app-sell-tip.vue';
  196. import goodsMixin from '@/core/goods-mixin.js';
  197. import appNavBar from '@/components/page-component/index/app-nav-bar.vue';
  198. import hxjScrollList from './components/scroll-list.vue';
  199. import hxjBdInfo from './components/hxj-bd-info.vue';
  200. export default {
  201. name: 'goods',
  202. mixins: [goodsMixin],
  203. components: {
  204. appGoodsBanner,
  205. 'app-goods-recommend': appGoodsRecommend,
  206. 'app-quick-navigation': appQuickNavigation,
  207. 'app-composition': appComposition,
  208. appClose,
  209. // uniSwiperDot,
  210. appGoodsFullReduce,
  211. uAttr,
  212. bdInfo,
  213. bdCoupon,
  214. // bdXbc,
  215. // bdKb,
  216. // bdHc,
  217. bdDetail,
  218. bdComments,
  219. bdService,
  220. bdFlashSale,
  221. appSellTip,
  222. appNavBar,
  223. hxjScrollList,
  224. hxjBdInfo
  225. },
  226. data() {
  227. return {
  228. id: '', //套餐id
  229. isCouponShow: false,
  230. list: [],
  231. isOpen: false, //hxj套装内商品是否展开
  232. compositionList: {}, //套餐详情
  233. showClose: false,
  234. is_open: 0,
  235. goods: null,
  236. selectAttr: null,
  237. recommend_list: null,
  238. is_vip: false,
  239. is_vip_card_user: 0,
  240. current: 0,
  241. discount: null,
  242. attrShow: false,
  243. shareData: null,
  244. contact_tel: '',
  245. contact: '',
  246. contact_web: '',
  247. sendPath: '',
  248. poster_config: this.$api.goods.poster,
  249. poster_generate: this.$api.poster.goods_new,
  250. // // 限时抢购
  251. // flash_sale: null,
  252. // checked: null,
  253. // // 商品服务
  254. // services: null,
  255. // // 商品详情
  256. // detail: null,
  257. // // 商品ID
  258. // goodsId: null,
  259. // // 套餐组合
  260. // composition: null,
  261. // autoplay: true,
  262. // full_reduce: null,
  263. // goods_marketing_award: null,
  264. // express: null,
  265. // goods_marketing: null,
  266. // exchangeStatus: null,
  267. // exchange: null,
  268. // price: null,
  269. // level_show: null,
  270. // sales: null,
  271. // unit: null,
  272. // is_sales: null,
  273. // extra_quick_share: null,
  274. // price_max: null,
  275. // price_min: null,
  276. // price_member_max: null,
  277. // price_member_min: null,
  278. // original_price: null,
  279. // subtitle: null,
  280. // is_negotiable: null,
  281. // name: null,
  282. // app_share_pic: null,
  283. // app_share_title: null,
  284. // goodsType: null,
  285. // favorite: null,
  286. goods_coupon_center: null,
  287. // guarantee_title: null,
  288. // guarantee_pic: null,
  289. // param_content: null,
  290. // param_name: null,
  291. // attr_groups: null,
  292. // goods_num: null,
  293. // good_stock: null,
  294. // min_number: null,
  295. // limit_buy: null,
  296. // disable: 'disable',
  297. // sell_time: 0,
  298. // template_message_list: [],
  299. // is_finish_sell: false
  300. };
  301. },
  302. computed: {
  303. ...mapState({
  304. mall: state => state.mallConfig.mall,
  305. gConfig: state => state.gConfig,
  306. isTip: state => state.mallConfig.mall.setting.is_remind_sell_time
  307. }),
  308. ...mapGetters('mallConfig', {
  309. getTheme: 'getTheme'
  310. }),
  311. good_negotiable: function() {
  312. let good_negotiable = this.mall.setting.good_negotiable;
  313. this.contact_tel = '';
  314. this.contact = '';
  315. this.contact_web = '';
  316. let arr = [];
  317. for (let i = 0; i < good_negotiable.length; i++) {
  318. if (good_negotiable[i] === 'contact_tel') {
  319. this.contact_tel = 'contact_tel';
  320. }
  321. // #ifndef MP-TOUTIAO || MP-ALIPAY || H5
  322. if (good_negotiable[i] === 'contact') {
  323. this.contact = 'contact';
  324. }
  325. // #endif
  326. if (good_negotiable[i] === 'contact_web') {
  327. this.contact_web = 'contact_web';
  328. }
  329. }
  330. if (this.contact_tel) {
  331. arr.push(this.contact_tel);
  332. }
  333. if (this.contact) {
  334. arr.push(this.contact);
  335. }
  336. if (this.contact_web) {
  337. arr.push(this.contact_web);
  338. }
  339. return arr;
  340. },
  341. contactBtnStyle: function() {
  342. const len = this.good_negotiable.length;
  343. const theme = this.getTheme.key;
  344. if (len === 3 && (theme === 'a' || theme === 'b' || theme === 'f')) {
  345. return `background:${this.getTheme.background_gradient_btn}`;
  346. } else if (len === 3 && !(theme === 'a' || theme === 'b' || theme === 'f')) {
  347. return `background:${this.getTheme.background_gradient_btn};color:${this.getTheme.background_s}`;
  348. }
  349. if (len === 2 && (theme === 'a' || theme === 'b' || theme === 'f') && !this.contact_tel) {
  350. return `background:${this.getTheme.background_s_gradient_btn};`;
  351. } else if (len === 2 && (theme === 'a' || theme === 'b' || theme === 'f') && this.contact_tel) {
  352. return `background:${this.getTheme.background}`;
  353. } else if (len === 2 && !(theme === 'a' || theme === 'b' || theme === 'f') && !this.contact_tel) {
  354. return `background:${this.getTheme.background_s_gradient_btn};color:${this.getTheme.background_s}`;
  355. } else if (len === 2 && !(theme === 'a' || theme === 'b' || theme === 'f') && this.contact_tel) {
  356. return `background:${this.getTheme.background_gradient_btn};color:${this.getTheme.background_s}`;
  357. } else {
  358. return `background:${this.getTheme.background_gradient_btn}`;
  359. }
  360. },
  361. uBottomHeight() {
  362. if (this.full_reduce && this.sell_time > 0) {
  363. return 'u-bottom-height-2';
  364. } else if (this.full_reduce || this.sell_time > 0) {
  365. return 'u-bottom-height-1';
  366. } else {
  367. return 'u-bottom-height-0';
  368. }
  369. },
  370. leftTip() {
  371. let leftTip = '';
  372. if (!(this.isTip == 0 && this.sell_time > 0)) {
  373. leftTip = 'bd-btn-left bd-btn-half';
  374. } else {
  375. leftTip = 'box-grow-1';
  376. }
  377. return this.goods && this.goods.type === 'goods' ? leftTip : '';
  378. },
  379. disableBtn() {
  380. return this.is_finish_sell ? 'btn-finish-sell' : 'bd-oversell-btn';
  381. },
  382. contactBtn: function() {
  383. const len = this.good_negotiable.length;
  384. const theme = this.getTheme.key;
  385. if (len === 3 && (theme === 'a' || theme === 'b' || theme === 'f')) {
  386. return `text bd-three-one bd-no-radius `;
  387. } else if (len === 3 && !(theme === 'a' || theme === 'b' || theme === 'f')) {
  388. return `bd-three-one bd-no-radius `;
  389. }
  390. if (len === 2 && (theme === 'a' || theme === 'b' || theme === 'f') && !this.contact_tel) {
  391. return `text bd-btn-half bd-content-radius-0`;
  392. } else if (len === 2 && (theme === 'a' || theme === 'b' || theme === 'f') && this.contact_tel) {
  393. return `bd-btn-half bd-content-radius-1`;
  394. } else if (len === 2 && !(theme === 'a' || theme === 'b' || theme === 'f') && !this.contact_tel) {
  395. return `bd-btn-half bd-content-radius-0`;
  396. } else if (len === 2 && !(theme === 'a' || theme === 'b' || theme === 'f') && this.contact_tel) {
  397. return `bd-btn-half bd-content-radius-1`;
  398. } else {
  399. return `text all-width all-radius `;
  400. }
  401. }
  402. },
  403. onLoad(options) {
  404. this.$commonLoad.onload(options);
  405. // #ifdef MP-WEIXIN
  406. wx.showShareMenu({
  407. menus: ['shareAppMessage', 'shareTimeline']
  408. });
  409. // #endif
  410. if (this.isLogin) {
  411. this.$store.dispatch('user/info');
  412. }
  413. this.id = options.id;
  414. // #ifndef MP-ALIPAY
  415. this.loadData(this.id, options);
  416. // #endif
  417. this.sendPath = '/pages/goods/goods?id=' + options.id;
  418. console.log(this.sendPath);
  419. if (options && options.exchange) {
  420. this.exchangeStatus = options.exchange;
  421. this.exchange = options;
  422. }
  423. },
  424. onShow() {
  425. this.autoplay = true;
  426. this.showClose = false;
  427. setTimeout(() => {
  428. this.showClose = true;
  429. // #ifdef MP-ALIPAY
  430. this.loadData(this.id, this.exchange);
  431. // #endif
  432. });
  433. },
  434. onHidden() {
  435. this.autoplay = false;
  436. },
  437. // #ifdef MP-WEIXIN
  438. onShareTimeline() {
  439. // 分享朋友圈beta
  440. return this.$shareTimeline({
  441. title: this.compositionList.name,
  442. imageUrl: this.goods.pic_url[0].pic_url,
  443. query: {
  444. id: this.id
  445. }
  446. });
  447. },
  448. // #endif
  449. methods: {
  450. receive() {
  451. this.isCouponShow = true
  452. },
  453. onCouponShow(val) {
  454. console.log(val);
  455. },
  456. hShareAppMessage(s = false) {
  457. return this.$shareAppMessage({
  458. title: this.compositionList.name,
  459. // imageUrl: this.app_share_pic ? this.app_share_pic : this.goods.pic_url[0].pic_url,
  460. path: '/pages/case/projectInfo',
  461. desc: this.subtitle,
  462. params: {
  463. id: this.goodsId
  464. }
  465. },
  466. s
  467. );
  468. },
  469. getMall(e) {
  470. this.is_open = e.is_open;
  471. },
  472. toExchange() {
  473. let mch_list = [{
  474. mch_id: 0,
  475. goods_list: [{
  476. id: this.exchange.id,
  477. attr: this.exchange.attr,
  478. num: this.exchange.goods_num,
  479. cat_id: 0,
  480. goods_attr_id: this.exchange.attr_id
  481. }],
  482. code: this.exchange.code,
  483. token: this.exchange.token
  484. }];
  485. let url = `/pages/order-submit/order-submit?mch_list=${JSON.stringify(mch_list)}`;
  486. url +=
  487. `&preview_url=${encodeURIComponent(this.$api.exchange.exchange_preview)}&submit_url=${encodeURIComponent(this.$api.exchange.exchange_submit)}&plugin=exchange`;
  488. uni.navigateTo({
  489. url: url
  490. });
  491. },
  492. // 规格选择
  493. check({
  494. item
  495. }) {
  496. this.checked = item;
  497. },
  498. change(e) {
  499. if (e.detail.source === 'touch') {
  500. this.current = e.detail.current;
  501. }
  502. if (e.detail.source === 'autoplay') {
  503. this.current = e.detail.current;
  504. }
  505. },
  506. quickShare(info) {
  507. this.shareData = info;
  508. //#ifdef H5
  509. this.$shareAppMessage(this.shareData, true);
  510. // #endif
  511. },
  512. toComposition(item) {
  513. let id = item.id > 0 ? item.id : this.composition.list[0].id;
  514. uni.navigateTo({
  515. url: this.composition.url + '?goods_id=' + this.goodsId + '&composition_id=' + id
  516. });
  517. },
  518. loadData(id, options) {
  519. this.$showLoading();
  520. this.$request({
  521. url: this.$api.composition.info,
  522. data: {
  523. composition_id: id
  524. },
  525. method: 'post'
  526. }).then(res => {
  527. if (res.code === 0) {
  528. this.compositionList = res.data
  529. for (let i = 0; i < this.compositionList.compositionGoods.length; i++) {
  530. let image = this.compositionList.compositionGoods[i].goods.cover_pic
  531. let id = this.compositionList.compositionGoods[i].goods.id
  532. let name = this.compositionList.compositionGoods[i].goods.name
  533. let goods_num = this.compositionList.compositionGoods[i].goods_num
  534. this.list.push({
  535. image,
  536. link: `/pages/goods/goods?id=${id}`,
  537. name,
  538. goods_num
  539. })
  540. }
  541. }
  542. this.$hideLoading();
  543. })
  544. this.$request({
  545. url: this.$api.coupon.list,
  546. data: {
  547. composition_id: id,
  548. limit: 100,
  549. },
  550. method: 'get'
  551. }).then(res => {
  552. if (res.code === 0) {
  553. this.goods_coupon_center = res.data.list
  554. }
  555. })
  556. // return new Promise((resolve, reject) => {
  557. // this.$showLoading();
  558. // this.$request({
  559. // url: this.$api.goods.detail,
  560. // data: {
  561. // id: 18,
  562. // plugin: options && options.exchange ? 'exchange' : 'mall'
  563. // }
  564. // })
  565. // .then(response => {
  566. // this.$hideLoading();
  567. // if (response.code === 0) {
  568. // let {
  569. // services,
  570. // detail,
  571. // name,
  572. // vip_card_appoint,
  573. // plugin_extra,
  574. // id,
  575. // goods_activity,
  576. // goods_marketing_award,
  577. // goods_marketing,
  578. // express,
  579. // price,
  580. // sales,
  581. // level_show,
  582. // is_sales,
  583. // unit,
  584. // extra_quick_share,
  585. // price_max,
  586. // price_min,
  587. // price_member_max,
  588. // price_member_min,
  589. // original_price,
  590. // subtitle,
  591. // is_negotiable,
  592. // app_share_title,
  593. // app_share_pic,
  594. // type,
  595. // favorite,
  596. // goods_coupon_center,
  597. // guarantee_title,
  598. // guarantee_pic,
  599. // param_content,
  600. // param_name,
  601. // attr_groups,
  602. // goods_num,
  603. // good_stock,
  604. // min_number,
  605. // limit_buy,
  606. // sell_time,
  607. // template_message_list,
  608. // is_finish_sell
  609. // } = response.data.goods;
  610. // this.app_share_pic = app_share_pic;
  611. // this.app_share_title = app_share_title;
  612. // this.goods = response.data.goods;
  613. // this.services = services;
  614. // this.detail = detail;
  615. // this.goodsId = id;
  616. // this.flash_sale = plugin_extra.flash_sale;
  617. // this.composition = plugin_extra.composition;
  618. // this.goods_marketing_award = goods_marketing_award;
  619. // this.goods_marketing = goods_marketing;
  620. // this.express = express;
  621. // this.price = price;
  622. // this.level_show = level_show;
  623. // this.sales = sales;
  624. // this.unit = unit;
  625. // this.is_sales = is_sales;
  626. // this.price_max = price_max;
  627. // this.price_min = price_min;
  628. // this.price_member_max = price_member_max;
  629. // this.price_member_min = price_member_min;
  630. // this.original_price = original_price;
  631. // this.subtitle = subtitle;
  632. // this.is_negotiable = is_negotiable;
  633. // this.extra_quick_share = extra_quick_share;
  634. // this.goodsType = type;
  635. // this.favorite = favorite;
  636. // this.goods_coupon_center = goods_coupon_center;
  637. // this.guarantee_title = guarantee_title;
  638. // this.param_content = param_content;
  639. // this.guarantee_pic = guarantee_pic;
  640. // this.attr_groups = attr_groups;
  641. // this.param_name = param_name;
  642. // this.goods_num = goods_num;
  643. // this.good_stock = good_stock;
  644. // this.min_number = min_number;
  645. // this.limit_buy = limit_buy;
  646. // this.sell_time = sell_time;
  647. // this.template_message_list = template_message_list;
  648. // this.is_finish_sell = is_finish_sell;
  649. // if (goods_activity) {
  650. // this.full_reduce = goods_activity.full_reduce;
  651. // }
  652. // if (vip_card_appoint.discount || vip_card_appoint.discount === '0.00') {
  653. // this.is_vip = true;
  654. // this.discount = vip_card_appoint.discount;
  655. // }
  656. // this.is_vip_card_user = vip_card_appoint.is_vip_card_user;
  657. // this.loadRecommend();
  658. // // #ifdef H5
  659. // this.hShareAppMessage();
  660. // // #endif
  661. // resolve();
  662. // } else {
  663. // uni.showToast({
  664. // title: response.msg,
  665. // icon: 'none'
  666. // });
  667. // reject();
  668. // }
  669. // })
  670. // .catch(() => {
  671. // reject();
  672. // this.$hideLoading();
  673. // });
  674. // });
  675. },
  676. onAttr(data) {
  677. this.selectAttr = data;
  678. },
  679. loadRecommend() {
  680. this.$request({
  681. url: this.$api.goods.new_recommend,
  682. data: {
  683. goods_id: this.goodsId,
  684. type: 'goods'
  685. }
  686. }).then(response => {
  687. if (response.code === 0) {
  688. this.recommend_list = response.data.list;
  689. }
  690. });
  691. },
  692. back() {
  693. uni.reLaunch({
  694. url: '/pages/index/index'
  695. });
  696. },
  697. setCollect() {
  698. this.$request({
  699. url: this.$api.composition.collect,
  700. data: {
  701. composition_id: this.id
  702. },
  703. method: 'post'
  704. }).then(response => {
  705. if (response.code === 0) {
  706. this.compositionList.is_collect == 0 ? this.compositionList.is_collect = 1 : this
  707. .compositionList.is_collect = 0
  708. } else {
  709. uni.showModal({
  710. title: '提示',
  711. content: response.msg,
  712. showCancel: false
  713. });
  714. }
  715. });
  716. },
  717. clickAttr(data) {
  718. // if (data === 1 && this.sell_time > 0) {
  719. // this.rightTip();
  720. // return;
  721. // }
  722. // if (!this.goods.buy_goods_auth) {
  723. // this.$tips.showToast({
  724. // title: '您暂无权限购买该商品',
  725. // icon: 'none'
  726. // });
  727. // return;
  728. // }
  729. // if (this.goods.type === 'ecard' && data === 0) {
  730. // this.$tips.showToast({
  731. // title: '虚拟商品不允许加入购物车',
  732. // icon: 'none'
  733. // });
  734. // return;
  735. // }
  736. uni.navigateTo({
  737. url: `/plugins/composition/detail/detail?composition_id=${this.id}`
  738. });
  739. // this.attrShow = true;
  740. },
  741. setCoupon(index) {
  742. this.$set(this.goods_coupon_center[index], 'is_receive', 1);
  743. },
  744. router(url) {
  745. uni.navigateTo({
  746. url: url
  747. });
  748. },
  749. makePhoneCall(number) {
  750. uni.makePhoneCall({
  751. phoneNumber: number
  752. });
  753. },
  754. changeTime(time) {
  755. this.sell_time = time;
  756. this.goods.sell_time = time;
  757. }
  758. },
  759. // #ifdef MP
  760. onShareAppMessage(object) {
  761. if (object.from === 'button' && this.shareData) {
  762. return this.$shareAppMessage(this.shareData);
  763. }
  764. return this.hShareAppMessage();
  765. }
  766. // #endif
  767. };
  768. </script>
  769. <style scoped lang="scss">
  770. @import '../index/index.scss';
  771. .hxj-goods-list {
  772. width: 100%;
  773. height: 302rpx;
  774. overflow: hidden;
  775. padding: 50rpx 43rpx 50rpx 51rpx;
  776. background-color: #fff;
  777. .title {
  778. font-size: 24rpx;
  779. font-weight: 500;
  780. color: #121212;
  781. line-height: 56px;
  782. }
  783. .item {
  784. height: 69rpx;
  785. .name {
  786. width: 300rpx;
  787. font-size: 24rpx;
  788. font-weight: 300;
  789. color: #121212;
  790. line-height: 56rpx;
  791. }
  792. .num {
  793. width: 80rpx;
  794. font-size: 24rpx;
  795. font-weight: 300;
  796. color: #121212;
  797. line-height: 56rpx;
  798. text-align: right;
  799. }
  800. .zk {
  801. font-size: 24rpx;
  802. font-weight: bold;
  803. color: #a18353;
  804. line-height: 56rpx;
  805. image {
  806. width: 19rpx;
  807. height: 12rpx;
  808. margin-left: 8rpx;
  809. }
  810. }
  811. }
  812. }
  813. .goods-composition {
  814. width: 702upx;
  815. margin: 20upx 20upx 0 20upx;
  816. padding: 20rpx;
  817. background-color: #fff;
  818. border-radius: 15upx;
  819. .goods-composition-title {
  820. font-size: 28rpx;
  821. color: #353535;
  822. margin-bottom: 20rpx;
  823. }
  824. .goods-composition-swiper {
  825. height: 194rpx;
  826. }
  827. .goods-composition-more {
  828. margin: 20rpx auto 4rpx auto;
  829. width: 226rpx;
  830. padding: 0 24rpx;
  831. height: 56rpx;
  832. line-height: 54rpx;
  833. border-radius: 28rpx;
  834. border: 2rpx solid #bbbbbb;
  835. font-size: 24rpx;
  836. color: #999999;
  837. image {
  838. width: #{12rpx};
  839. height: #{22rpx};
  840. }
  841. }
  842. }
  843. .goods-name {
  844. padding: 24upx 24upx 0 24upx;
  845. background-color: #ffffff;
  846. color: #353535;
  847. font-size: 32upx;
  848. line-height: 42upx;
  849. }
  850. .goods-subtitle {
  851. padding: #{24rpx 24rpx 0 24rpx};
  852. font-size: 24rpx;
  853. background-color: #ffffff;
  854. color: #999999;
  855. }
  856. .price {
  857. padding-top: #{24rpx};
  858. background-color: #ffffff;
  859. }
  860. .vip-card {
  861. padding-bottom: #{20rpx};
  862. background-color: #fff;
  863. }
  864. .attr {
  865. background-color: #f7f7f7;
  866. }
  867. .bottom {
  868. width: 100%;
  869. height: #{110rpx};
  870. }
  871. .bd-bottom {
  872. width: 750upx;
  873. height: 110upx;
  874. padding: 20upx 24upx;
  875. }
  876. .bd-back {
  877. width: 66upx;
  878. height: 100%;
  879. margin-right: 20upx;
  880. }
  881. .bd-icon {
  882. width: 30upx;
  883. height: 30upx;
  884. margin-bottom: 8upx;
  885. }
  886. .bd-text {
  887. font-size: 20upx;
  888. color: #888888;
  889. line-height: 1;
  890. }
  891. .bd-btn {
  892. text-align: center;
  893. line-height: 70upx;
  894. font-size: 28upx;
  895. // border-radius: 35upx;
  896. }
  897. .bd-btn-left {
  898. border-top-right-radius: 0;
  899. border-bottom-right-radius: 0;
  900. }
  901. .bd-btn-right {
  902. border-top-left-radius: 0;
  903. border-bottom-left-radius: 0;
  904. }
  905. .bd-btn-half {
  906. width: 50%;
  907. }
  908. .bd-btn-color {
  909. color: #ffffff;
  910. }
  911. .bd-oversell-btn {
  912. background-color: #cdcdcd;
  913. }
  914. .bd-content-radius-0 {
  915. border-radius: 35upx 0 0 35upx;
  916. }
  917. .bd-content-radius-1 {
  918. border-radius: 0 35upx 35upx 0;
  919. }
  920. .bd-btn-tel {
  921. font-size: 26upx;
  922. >view {
  923. line-height: 70upx;
  924. text-align: center;
  925. }
  926. .tel {
  927. border-top-left-radius: 35upx;
  928. border-bottom-left-radius: 35upx;
  929. }
  930. .contact {
  931. padding: 0;
  932. font-size: 26upx;
  933. height: 70upx;
  934. line-height: 70upx;
  935. margin: 0;
  936. border: none;
  937. }
  938. .service {
  939. border-top-right-radius: 35upx;
  940. border-bottom-right-radius: 35upx;
  941. }
  942. .all-radius {
  943. border-radius: 35upx;
  944. }
  945. .all-width {
  946. width: 100%;
  947. }
  948. .bd-three-one {
  949. width: calc(100% / 3);
  950. }
  951. .bd-no-radius {
  952. border-radius: 0;
  953. }
  954. }
  955. .bd-exchange {
  956. line-height: 70upx;
  957. font-size: #{28rpx};
  958. text-align: center;
  959. color: #fff;
  960. border-radius: 35upx;
  961. &.bd-over {
  962. background: #e9e9e9;
  963. color: #999999;
  964. }
  965. }
  966. .text {
  967. color: #ffffff;
  968. }
  969. .default-bakground {
  970. background-color: #446dfd;
  971. color: #ffffff;
  972. }
  973. .u-bottom-fixed {
  974. position: fixed;
  975. bottom: 0;
  976. left: 0;
  977. width: 100%;
  978. z-index: 1500;
  979. background-color: #ffffff;
  980. box-shadow: 0 -1rpx 20rpx -15rpx #353535;
  981. }
  982. .u-bottom-height-0 {
  983. height: 110upx;
  984. }
  985. .u-bottom-height-1 {
  986. height: 190upx;
  987. }
  988. .u-bottom-height-2 {
  989. height: 270upx;
  990. }
  991. .goods-margin {
  992. margin-top: 20upx;
  993. }
  994. .bd-goods {
  995. margin: 24 upx 24 upx 24 upx 24 upx;
  996. }
  997. .ecard-text {
  998. color: #999999;
  999. }
  1000. .bd-content {
  1001. padding: 0;
  1002. display: block;
  1003. background-color: #ffffff;
  1004. }
  1005. .bd-content-view {
  1006. width: 100%;
  1007. height: 100%;
  1008. }
  1009. .btn-finish-sell {
  1010. background: linear-gradient(to right, rgba(153, 153, 153, 1), rgba(153, 153, 153, 0.7));
  1011. }
  1012. </style>