itemdetail.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <u-navbar :is-back="false" title-color="#000000" :title-bold="true" title-size="36" :title="goods_detail.title">
  4. <view class="back-icon ibonfont ibonfanhui" @click="back"></view>
  5. </u-navbar>
  6. <!-- <block v-if="goods_detail.id"> -->
  7. <block>
  8. <!-- 底部菜单 -->
  9. <view class="footer">
  10. <view class="icons">
  11. <view class="box" @click="goPage('/pages/index/index', 'switchTab')">
  12. <view class="icon ibonfont ibonhome"></view>
  13. <view class="text">首页</view>
  14. </view>
  15. <!-- <view class="box" @click="goPage('/pages/cart/cart', 'switchTab')">
  16. <u-badge v-if="cartNum > 0" type="error" :offset="[-18, -24]" :count="cartNum"></u-badge>
  17. <view class="icon ibonfont iboncart"></view>
  18. <view class="text">购物车</view>
  19. </view> -->
  20. <!-- #ifdef MP-WEIXIN -->
  21. <!-- <view class="box" @click="shareGoods">
  22. <view class="icon ibonfont ibonfenxiang2"></view>
  23. <view class="text">分享</view>
  24. </view> -->
  25. <!-- #endif -->
  26. </view>
  27. <!-- <block v-if="goods_detail.isDistribution === 4 && goods_detail.inventorTotal <= 0">
  28. <view v-if="!(goods_detail.inventorTotal - 0) || goods_detail.inventorTotal - 0 <= 0" class="btn">
  29. <view class="buy primary-bg" style="background-color: #666666 !important;">补货中</view>
  30. </view>
  31. </block> -->
  32. <view class="btn">
  33. <view class="buy primary-fu-bg" @click="openaddcartPop('btn')">立即购买</view>
  34. <!-- <view class="buy primary-bg" @click="openaddcartPop('btn')">加入购物车</view> -->
  35. </view>
  36. </view>
  37. <!-- 商品主图轮播 -->
  38. <view class="swiper-box">
  39. <swiper circular="true" autoplay="true" @change="swiperChange">
  40. <swiper-item v-for="(item, index) in imgList" :key="index">
  41. <image :src="item" mode="aspectFit" @click="previewImage(index)"></image>
  42. </swiper-item>
  43. </swiper>
  44. <!-- <view class="indicator">{{ currentSwiper + 1 }}/{{ imgList.length }}</view> -->
  45. </view>
  46. <!-- 标题 价格 -->
  47. <view class="goods-info">
  48. <!-- 商品信息 -->
  49. <view class="price-view primary-bg clearfix">
  50. <view class="price-out">
  51. <view style="display: inline-block;">
  52. <text class="rmb-ic">¥</text>
  53. <view style="display: inline-block;">
  54. {{goods_detail.price}}
  55. </view>
  56. </view>
  57. <view class="market-price">¥{{ goods_detail.ot_price }}</view>
  58. </view>
  59. <!-- <view class="right-view">
  60. <view class="goods-num">
  61. <view class="num-li">
  62. 已售{{ goods_detail.sold }}</view>
  63. </view>
  64. </view> -->
  65. </view>
  66. <view class="goods-info-main">
  67. <view class="clearfix top-title">
  68. <view class="title float_left ellipsis">
  69. {{ goods_detail.name || '' }}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!--规则选择 -->
  75. <view class="info-box" style="margin-top: 0;" v-if="goods_detail.unitData">
  76. <view class="row" v-if="goods_detail.unitData && goods_detail.unitData.length > 1">
  77. <view class="text">换算</view>
  78. <view class="content">
  79. <block v-for="(item, index) in goods_detail.unitData" :key="index">
  80. <view v-if="item.isMaster === 4" class="conversion">
  81. <text
  82. v-if="goods_detail.isEq === 5">1{{ item.unitName }}≈{{ item.conversion }}{{ goods_detail.unitName }}</text>
  83. <text
  84. v-else>1{{ item.unitName }}={{ item.conversion }}{{ goods_detail.unitName }}</text>
  85. </view>
  86. </block>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 详情 -->
  91. <view class="description">
  92. <view class="title">———— 商品详情 ————</view>
  93. <view class="content">
  94. <u-parse :html="goods_detail.result"></u-parse>
  95. </view>
  96. </view>
  97. </block>
  98. <u-popup mode="bottom" v-model="sharePop" >
  99. <view class="share-tit">分享</view>
  100. <view class="share-ul">
  101. <!-- #ifdef MP -->
  102. <view class="share-li">
  103. <button class="share-btn" open-type="share">
  104. <view class="icon-view">
  105. <u-icon name="weixin-fill" top="12" color="#ffffff" size="60"></u-icon>
  106. </view>
  107. <view class="share-btn-label">分享给好友</view>
  108. </button>
  109. </view>
  110. <!-- #endif -->
  111. <!-- <view class="share-li" @click="generatePoster">
  112. <button class="share-btn">
  113. <view class="icon-view">
  114. <u-icon name="photo-fill" top="12" color="#ffffff" size="60"></u-icon>
  115. </view>
  116. <view class="share-btn-label">生成分享海报</view>
  117. </button>
  118. </view> -->
  119. </view>
  120. <view class="share-cancel" @click="cancelPop">取消分享</view>
  121. </u-popup>
  122. <!-- 海报 -->
  123. <u-popup class="no-pop-bg" v-model="canvasPop" mode="center" :border-radius="12" :mask-close-able="false">
  124. <view v-if="imgList.length && QrSrc && is_poster">
  125. <wm-poster :Width="600" :imgSrc="imgList[0]" :QrSrc="QrSrc" :Title="goods_detail.title"
  126. :PriceTxt="!showGoodsPrice ? '¥' + goods_detail.salePrice : ''"
  127. :OriginalTxt="!showGoodsPrice ? '¥' + goods_detail.marketPrice : ''" @saveImage="saveImage"
  128. @cancelImg="cancelImg"></wm-poster>
  129. </view>
  130. </u-popup>
  131. <!-- 加载动画 -->
  132. <!-- 加入购物车弹窗 -->
  133. <!-- <AddCardModel :isList="false" :selAddress="now_sel_address" @buyNumchange="buyNumchange" @skuChange="skuChange"
  134. @close="is_add_show = false" @change="closeaddcartPop" :skuId="skuId" :isShow="is_add_show"
  135. :goodsId="goods_id" />
  136. <setMealMore :goods_id="goods_id" :shopId="goods_detail.shopId" :isShow="is_setMeal_show"
  137. @close="is_setMeal_show = false" /> -->
  138. <u-popup v-model="payPop" mode="bottom" :border-radius="12">
  139. <view class="pay-pop-view">
  140. <view class="pay-sel-title clearfix">
  141. <text class="float_left">付款方式</text>
  142. <text class="float_right ibonfont ibonguanbi" @click="closePayPop"></text>
  143. </view>
  144. <view class="pay-ul">
  145. <view class="pay-li" @click="choosPayType(1)">
  146. <!-- <view class="pay-li" > -->
  147. <text class="ibonfont ibonhuodaofukuan"></text>
  148. <view class="pay-name clearfix"
  149. :class="[goods_detail.price*1 > userInfo.memberBalance ? 'balance-pay-name' : '']">
  150. <view class="float_left">
  151. <text>余额</text>
  152. <text class="balace-num">(余额:¥{{ userInfo.memberBalance }})</text>
  153. </view>
  154. <text class="float_right ibonfont ibonxuanze1" v-if="pay_type == 1"></text>
  155. <text class="float_right ibonfont ibonxuanze1" style="color: #CCCCCC;" v-else></text>
  156. </view>
  157. </view>
  158. <view class="pay-li" @click="choosPayType(2)" v-if="goods_detail.price*1 > 0">
  159. <text class="ibonfont ibonweixinzhifu"></text>
  160. <view class="pay-name clearfix ">
  161. <view class="float_left">
  162. <text>微信</text>
  163. </view>
  164. <text class="float_right ibonfont ibonxuanze1" v-if="pay_type == 2"></text>
  165. <text class="float_right ibonfont ibonxuanze1" style="color: #CCCCCC;" v-else></text>
  166. </view>
  167. </view>
  168. </view>
  169. <view class="pay-btn primary-btn" @click="submit">
  170. <text>确定</text>
  171. </view>
  172. </view>
  173. </u-popup>
  174. </view>
  175. </template>
  176. <script>
  177. import wmPoster from '../components/wm-poster/wm-poster.vue';
  178. import webUrl from '../../config.js';
  179. import AddCardModel from '@/components/AddCardModel';
  180. import setMealMore from '@/components/setMealMore';
  181. export default {
  182. components: {
  183. wmPoster,
  184. AddCardModel,
  185. setMealMore
  186. },
  187. computed: {
  188. cartNum() {
  189. return this.$store.state.cartNum;
  190. },
  191. showGoodsPrice() {
  192. if (this.$store.state.baseSet.goodsPrice === 5 && this.$common.isLogin()) {
  193. return '';
  194. } else if (!this.$common.isLogin() && this.$store.state.baseSet.goodsPrice === 4) {
  195. return '请登录';
  196. } else if (this.$store.state.userStatus.enableStatus === 4 && this.$store.state.baseSet.goodsPrice === 4) {
  197. return '已禁用';
  198. } else if (this.$store.state.userStatus.status !== 2 && this.$store.state.baseSet.goodsPrice === 4) {
  199. if (this.$store.state.userStatus.status === 0) {
  200. return '待审核';
  201. } else if (this.$store.state.userStatus.status === 1) {
  202. return '审核中';
  203. } else if (this.$store.state.userStatus.status === 3) {
  204. return '已驳回';
  205. }
  206. } else {
  207. return '';
  208. }
  209. },
  210. isLogin() {
  211. return this.$store.state.hasLogin;
  212. },
  213. // 辅助单位价格
  214. unitsalePrice() {
  215. if (this.goods_detail.isEq === 5) {
  216. if (this.eq_sku_kg.enabledLadder !== 1) {
  217. return this.eq_sku_kg.salePrice;
  218. } else {
  219. const unitnum = this.buy_num * Number(this.now_sku_data.conversion);
  220. const priceData = this.eq_sku_kg.ladderPrice.find(item => {
  221. return unitnum > item.from && unitnum <= item.to;
  222. });
  223. return priceData ? priceData.price : 0;
  224. }
  225. } else {
  226. return this.eq_sku_kg.salePrice;
  227. }
  228. }
  229. },
  230. data() {
  231. return {
  232. userInfo: {},
  233. pay_type: 1,
  234. payPop: false,
  235. eq_sku_kg: {}, // 抄码商品kg
  236. eq_sku_jian: {}, // 抄码商品辅助单位
  237. //轮播图下标
  238. currentSwiper: 0,
  239. service_pop: false,
  240. sharePop: false, // 分享弹窗
  241. canvasPop: false, // 海报弹窗
  242. now_sel_address: {},
  243. is_not_express: true, // 当前选择区域是否能够配送
  244. address_data: {}, // 客户地址数据
  245. not_dispatch_areas: {}, // 该商品不能配送区域
  246. is_add_show: false,
  247. is_poster: false,
  248. buy_num: 1,
  249. discountList: [],
  250. activity: [],
  251. maskState: false,
  252. indicatorDots: true, //是否显示面板指示点
  253. autoplay: true, //是否自动切换
  254. interval: 2000,
  255. duration: 500,
  256. goods_detail: {},
  257. goods_id: '',
  258. unit_list: [],
  259. uni_index: 0,
  260. specClass: 'none',
  261. specSelected: [],
  262. specList: [],
  263. isCollect: false,
  264. imgList: [],
  265. phaseTime: {
  266. second: 0,
  267. day: 0
  268. },
  269. coupon_price: '', //领券活动价格
  270. skuId: '', //商品的规格
  271. source: 5,
  272. QrSrc: '',
  273. base_set_info: {},
  274. spec_id_group: [],
  275. now_sku_data: {},
  276. startDeliveryPrice: 0,
  277. isSalesNum: 4, // 起送价
  278. pageName: '', // 启动页标示
  279. is_setMeal_show: false, //组合套餐弹窗
  280. combinedPackage: [],
  281. total: 0,
  282. shopId: '',
  283. isyhk: 0,//是否是优惠卡
  284. };
  285. },
  286. onShow() {
  287. if (this.now_sel_address.provinceCode) {
  288. this.address_data = this.now_sel_address;
  289. if (this.not_dispatch_areas.areas) {
  290. if (this.address_data.districtCode) {
  291. this.is_not_express = this.not_dispatch_areas.areas.indexOf(parseInt(this.address_data
  292. .districtCode)) === -1;
  293. } else if (this.address_data.cityCode) {
  294. this.is_not_express = this.not_dispatch_areas.citys.indexOf(parseInt(this.address_data
  295. .cityCode)) === -1;
  296. } else {
  297. this.is_not_express = this.not_dispatch_areas.provinces.indexOf(parseInt(this.address_data
  298. .provinceCode)) === -1;
  299. }
  300. }
  301. }
  302. },
  303. onShareAppMessage() {
  304. return {
  305. title: this.goods_detail.name,
  306. path: `/pagesT/unit/itemdetail?id=${this.goods_id}&businessmanId=${this.$store.state.userStatus.id || ''}&isyhk=${this.isyhk}`,
  307. imageUrl: this.imgList[0],
  308. success: res => {
  309. console.log(res);
  310. }
  311. };
  312. },
  313. // #ifdef MP-WEIXIN
  314. // 分享到朋友圈
  315. onShareTimeline(obj) {
  316. console.log('分享到朋友圈::', obj);
  317. },
  318. // 收藏小程序
  319. onAddToFavorites() {},
  320. // #endif
  321. watch: {
  322. async '$store.state.locationObj'(val) {
  323. if (JSON.stringify(val) === '{}') {
  324. this.getAuthorizeInfo();
  325. return;
  326. }
  327. await this.getGoodsDetail();
  328. await this.getQrSrc();
  329. },
  330. isLogin() {
  331. this.getGoodsDetail();
  332. }
  333. },
  334. async onLoad(options) {
  335. if (options.pageName) {
  336. this.pageName = options.pageName;
  337. }
  338. // 起送价
  339. this.startDeliveryPrice = this.$store.state.baseSet.startDeliveryPrice || 0;
  340. // #ifdef MP-WEIXIN
  341. // 小程序的原生菜单中显示分享按钮
  342. uni.showShareMenu({
  343. withShareTicket: false,
  344. menus: ['shareAppMessage', 'shareTimeline']
  345. });
  346. // 获取小程序分销商参数
  347. if (options.businessmanId) {
  348. this.$store.commit('commit_businessmanId', options.businessmanId);
  349. this.relationshipBusinessman(options.businessmanId);
  350. }
  351. // #endif
  352. // 接收传值
  353. if (options.id) {
  354. this.goods_id = options.id;
  355. } else {
  356. // 扫码进入
  357. const scene = decodeURIComponent(options.scene);
  358. this.goods_id = scene;
  359. }
  360. if(options.isyhk) {
  361. this.isyhk = options.isyhk
  362. }
  363. if (options.skuId) {
  364. this.skuId = parseInt(options.skuId);
  365. }
  366. // this.goods_id = 78;
  367. this.spec_id_group[0] = this.goods_id;
  368. this.base_set_info = this.$store.state.baseSet;
  369. if (JSON.stringify(this.$store.state.locationObj) === '{}') {
  370. this.getAuthorizeInfo();
  371. return;
  372. }
  373. this.getGoodsDetail();
  374. if (this.isLogin) {
  375. this.address_data = this.$store.state.nowAddress;
  376. if (this.address_data.provinceCode) {
  377. if (this.not_dispatch_areas.areas) {
  378. if (this.address_data.districtCode) {
  379. this.is_not_express = this.not_dispatch_areas.areas.indexOf(parseInt(this.address_data
  380. .districtCode)) === -1;
  381. } else if (this.address_data.cityCode) {
  382. this.is_not_express = this.not_dispatch_areas.citys.indexOf(parseInt(this.address_data
  383. .cityCode)) === -1;
  384. } else {
  385. this.is_not_express = this.not_dispatch_areas.provinces.indexOf(parseInt(this.address_data
  386. .provinceCode)) === -1;
  387. }
  388. }
  389. } else {
  390. await this.getAllShippingAddress();
  391. }
  392. }
  393. await this.getQrSrc();
  394. },
  395. methods: {
  396. choosPayType(val) {
  397. this.pay_type = val
  398. },
  399. showNum(val) {
  400. console.log(Number(val),'Number(val)');
  401. return Number(val)
  402. },
  403. closePayPop() {
  404. this.payPop = false
  405. },
  406. openService() {
  407. this.service_pop = true;
  408. },
  409. // 商品服务弹窗
  410. cancelService() {
  411. this.service_pop = false;
  412. },
  413. // 获取地址列表
  414. getAllShippingAddress() {
  415. this.$u.api
  416. .getAllShippingAddress({
  417. page: 1,
  418. pageSize: 10
  419. })
  420. .then(({
  421. data
  422. }) => {
  423. if (data.length) {
  424. const address = data.find(item => item.defaultStatus === 5) || data[0];
  425. this.address_data = {
  426. provinceCode: address.provinceCode,
  427. cityCode: address.cityCode,
  428. districtCode: address.districtCode,
  429. provinceName: address.area.provinceName,
  430. cityName: address.area.cityName,
  431. districtName: address.area.districtName
  432. };
  433. this.$store.commit('commit_nowAddress', this.address_data);
  434. if (this.not_dispatch_areas.areas) {
  435. if (this.address_data.districtCode) {
  436. this.is_not_express = this.not_dispatch_areas.areas.indexOf(parseInt(this
  437. .address_data.districtCode)) === -1;
  438. } else if (this.address_data.cityCode) {
  439. this.is_not_express = this.not_dispatch_areas.citys.indexOf(parseInt(this
  440. .address_data.cityCode)) === -1;
  441. } else {
  442. this.is_not_express = this.not_dispatch_areas.provinces.indexOf(parseInt(this
  443. .address_data.provinceCode)) === -1;
  444. }
  445. }
  446. }
  447. });
  448. },
  449. // 修改购买金额
  450. buyNumchange(val) {
  451. this.buy_num = val;
  452. },
  453. // 切换商品规格属性
  454. skuChange(val) {
  455. this.now_sku_data = val;
  456. if (this.now_sku_data.activity && this.now_sku_data.activity.activityId) {
  457. let nowData = parseInt(new Date().getTime() / 1000);
  458. if (this.now_sku_data.activity.endTime && this.now_sku_data.activity.endTime - nowData > 0) {
  459. let totalSecond = this.now_sku_data.activity.endTime - nowData;
  460. this.phaseTime = {
  461. second: totalSecond % 86400,
  462. day: totalSecond <= 0 ? 0 : parseInt(totalSecond / 86400)
  463. };
  464. }
  465. }
  466. },
  467. // 收藏商品
  468. collectGoods() {
  469. if (!this.isLogin) {
  470. this.$api.msg('请登录');
  471. return;
  472. }
  473. if (this.goods_detail.isCollect) {
  474. this.goods_detail.isCollect = false;
  475. } else {
  476. this.goods_detail.isCollect = true;
  477. }
  478. this.$u.api.collectGoods(this.goods_id).then(res => {
  479. if (!this.goods_detail.isCollect) {
  480. this.$api.msg('已取消收藏');
  481. } else {
  482. this.$api.msg('已收藏');
  483. }
  484. });
  485. },
  486. getQrSrc() {
  487. // #ifdef MP-TOUTIAO
  488. let pathT = 'pagesT/product/product?id=' + this.goods_id;
  489. pathT = encodeURIComponent(pathT);
  490. this.$u.api
  491. .byteCreateQRCode({
  492. path: pathT,
  493. params: this.goods_id,
  494. appname: 'toutiao'
  495. })
  496. .then(data => {
  497. this.QrSrc = data.data.indexOf('https') > -1 ? data.data : webUrl.QRC_SRC + data.data;
  498. });
  499. // #endif
  500. // #ifdef MP-WEIXIN || H5
  501. let pathS = 'pagesT/product/product';
  502. this.$u.api
  503. .createwxaqrcode({
  504. path: pathS,
  505. params: this.goods_id
  506. })
  507. .then(data => {
  508. this.QrSrc = data.data.indexOf('https') > -1 ? data.data : webUrl.QRC_SRC + data.data;
  509. console.log(this.QrSrc);
  510. });
  511. // #endif
  512. },
  513. handelImg(url) {
  514. if (url.indexOf('?imageView2/2/w/750/h/750') > -1) {
  515. return url.replace('?imageView2/2/w/750/h/750', '');
  516. } else if (url.indexOf('?imageView2/2/w/750') > -1) {
  517. return url.replace('?imageView2/2/w/750', '');
  518. } else {
  519. return url;
  520. }
  521. },
  522. generatePoster() {
  523. // this.is_poster = true;
  524. // this.canvasPop = true;
  525. // this.sharePop = false;
  526. const pramas = {
  527. id: this.goods_detail.id,
  528. priceShop: '¥' + this.goods_detail.maxMarketPrice,
  529. headImgs: this.goods_detail.images.map(item => this.handelImg(item)),
  530. goodsImg: this.handelImg(this.goods_detail.images[0]),
  531. goodsName: this.goods_detail.title,
  532. goodsPrice: '¥' + this.goods_detail.minSalePrice,
  533. mainLogo: '',
  534. recommendCodeGoods: this.QrSrc,
  535. share: {
  536. shareContent: this.$store.state.baseSet.shop || '',
  537. shareImg: this.handelImg(this.goods_detail.images[0]),
  538. shareTitle: this.goods_detail.title,
  539. shareUrl: this.handelImg(this.goods_detail.images[0])
  540. }
  541. };
  542. uni.setStorageSync('posterData', pramas)
  543. uni.navigateTo({
  544. url: '/pagesT/product/goodsPoster'
  545. });
  546. },
  547. saveImage() {
  548. this.canvasPop = false;
  549. },
  550. cancelImg() {
  551. this.is_poster = false;
  552. this.canvasPop = false;
  553. },
  554. shareGoods() {
  555. this.sharePop = true;
  556. },
  557. //App分享为微信小程序(App中分享一个内容到微信好友,对方微信中呈现的是一个小程序卡片)
  558. shareFriend() {
  559. const path = '/pagesT/unit/itemdetail?id=' + this.goods_id;
  560. uni.share({
  561. provider: 'weixin',
  562. scene: 'WXSceneSession',
  563. type: 5,
  564. imageUrl: this.imgList[0],
  565. title: this.goods_detail.title,
  566. miniProgram: {
  567. id: 'gh_16db94f79967', //微信小程序原始ID
  568. path: path,
  569. type: 0,
  570. webUrl: ''
  571. },
  572. success: ret => {
  573. console.log(JSON.stringify(ret));
  574. }
  575. });
  576. },
  577. // 分享弹窗关闭
  578. cancelPop() {
  579. this.sharePop = false;
  580. },
  581. // 如果是阶梯价
  582. ladderPriceChange() {
  583. return this.now_sku_data.ladderPrice.find(ladder => (this.buy_num || 1) >= ladder.from && (this.buy_num ||
  584. 1) <= ladder.to).price;
  585. },
  586. // 请求商品品详情
  587. async getGoodsDetail() {
  588. let that = this
  589. if(that.isyhk == 1) {
  590. that.$u.api.getYhkDetail({
  591. id: that.goods_id
  592. }).then(({
  593. data
  594. }) => {
  595. console.log(data, 'itemdetail+++')
  596. // 轮播图
  597. that.goods_detail = data;
  598. that.goods_detail.result = data.introduce
  599. let arr = []
  600. arr[0] = data.image
  601. that.imgList = arr;
  602. console.log(that.imgList,'that.imgList')
  603. })
  604. }else {
  605. that.$u.api.getItemDetail({
  606. id: that.goods_id
  607. }).then(({
  608. data
  609. }) => {
  610. console.log(data, 'itemdetail+++')
  611. // 轮播图
  612. that.goods_detail = data;
  613. that.imgList = data.slider_image;
  614. })
  615. }
  616. // this.$u.api
  617. // .getGoodsDetail(this.goods_id)
  618. // .then(({
  619. // data
  620. // }) => {
  621. // uni.setNavigationBarTitle({
  622. // title: data.title
  623. // });
  624. // this.imgList = data.images;
  625. // data.specGroup = data.specGroup.map(item => {
  626. // return {
  627. // ...item,
  628. // params: item.params.map(itemP => {
  629. // return {
  630. // ...itemP,
  631. // isdisabled: true
  632. // };
  633. // })
  634. // };
  635. // });
  636. // this.goods_detail = data;
  637. // // 抄码商品获取 KG 数据
  638. // if (data.isEq === 5) {
  639. // this.eq_sku_kg = data.specMultiple.find(item => item.isMaster === 5);
  640. // this.eq_sku_jian = data.specMultiple.find(item => item.isMaster === 4);
  641. // }
  642. // this.not_dispatch_areas = data.express.ruleData.not_dispatch_areas;
  643. // if (this.skuId) {
  644. // // 如果已有选中的skuId 根据ID匹配对应规格数据
  645. // const specMultiple = data.specMultiple.find(item => item.id === parseInt(this.skuId));
  646. // if (specMultiple.isSale !== 4) {
  647. // this.now_sku_data = specMultiple;
  648. // }
  649. // } else if (data.specMultiple.length === 1 && data.specMultiple[0].isSale !== 4) {
  650. // this.now_sku_data = data.specMultiple[0];
  651. // } else {
  652. // // 如果当前商品是非抄码商品 默认选中默认规格
  653. // if (data.isEq === 4) {
  654. // const specMultiple = data.specMultiple.find(item => item.isDefault === 5);
  655. // if (specMultiple && specMultiple.isSale !== 4) {
  656. // this.now_sku_data = specMultiple;
  657. // }
  658. // } else {
  659. // // 抄码商品默认选中一个
  660. // const specMultiple = data.specMultiple.find(item => item.isMaster === 4);
  661. // if (specMultiple && specMultiple.isSale !== 4) {
  662. // this.now_sku_data = specMultiple;
  663. // }
  664. // }
  665. // }
  666. // if (this.now_sku_data.activity && this.now_sku_data.activity.activityId) {
  667. // let nowData = parseInt(new Date().getTime() / 1000);
  668. // if (this.now_sku_data.activity.endTime && this.now_sku_data.activity.endTime -
  669. // nowData > 0) {
  670. // let totalSecond = this.now_sku_data.activity.endTime - nowData;
  671. // this.phaseTime = {
  672. // second: totalSecond % 86400,
  673. // day: totalSecond <= 0 ? 0 : parseInt(totalSecond / 86400)
  674. // };
  675. // }
  676. // }
  677. // // 获取该商品的组合套餐
  678. // if (this.isLogin) {
  679. // this.listsApiComBinPackage();
  680. // }
  681. // })
  682. // .catch(err => {
  683. // setTimeout(() => {
  684. // uni.navigateBack();
  685. // }, 1500);
  686. // });
  687. },
  688. //分享
  689. share() {
  690. this.$refs.share.toggleMask();
  691. },
  692. openaddcartPop(type) {
  693. // if (!this.is_not_express) return;
  694. // this.is_add_show = true;
  695. // this.$u.api.calculation({
  696. // })
  697. console.log(this.isyhk,'this.isyhk');
  698. if(this.isyhk == 1) {
  699. this.$u.api.getCustomerInfo().then(({ data }) => {
  700. console.log(data,'userInfo');
  701. this.userInfo = data;
  702. this.$store.commit('commit_userStatus', data);
  703. this.payPop = true
  704. });
  705. }else {
  706. this.goPage('/pagesT/order/createOrderT?id=' + this.goods_detail.id)
  707. }
  708. },
  709. // 支付
  710. submit() {
  711. let that = this
  712. // 判断余额是否足够
  713. if(that.pay_type == 1 && (that.goods_detail.price*1 > that.userInfo.memberBalance*1)) {
  714. return this.$u.toast('抱歉,您的可用余额不足');
  715. }
  716. that.$u.api.buyYhk({
  717. "id": that.goods_detail.id,
  718. "pay_type": that.pay_type, //1余额2微信3支付宝
  719. "source": that.pay_type == 2 ? 3: '',
  720. }).then(({
  721. data
  722. }) => {
  723. // 余额支付
  724. if(that.pay_type == 1) {
  725. console.log(data)
  726. if(data == '支付成功' || data.data == '支付成功') {
  727. that.payPop = false
  728. setTimeout(() => {
  729. uni.navigateTo({
  730. url:'/pagesT/money/paySuccess?price=' + that.goods_detail.price + '&isyhq=1'
  731. })
  732. // this.otheMsgTip('/pagesT/money/paySuccess?price=' + this
  733. // .goods_detail.price + '&isyhq=1');
  734. }, 200);
  735. }
  736. }
  737. // 微信支付
  738. if(that.pay_type == 2) {
  739. // data.data
  740. let payInfo = data.data
  741. // #ifdef MP-WEIXIN
  742. uni.requestPayment({
  743. provider: 'wxpay',
  744. timeStamp: payInfo.timeStamp, //当前时间
  745. nonceStr: payInfo.nonceStr, //随机字符串,长度在32一下
  746. package: payInfo.package, //统一单接口返回的prepay_id
  747. signType: payInfo.signType, //签名算法,目前支持MD5
  748. paySign: payInfo.paySign, //签名
  749. success: res => {
  750. // 订单审核,取消订单提醒
  751. that.payPop = false
  752. console.log('微信支付成功');
  753. setTimeout(() => {
  754. uni.navigateTo({
  755. url:'/pagesT/money/paySuccess?price=' + that.goods_detail.price + '&isyhq=1'
  756. })
  757. // this.otheMsgTip('/pagesT/money/paySuccess?price=' + this
  758. // .goods_detail.price + '&isyhq=1');
  759. }, 200);
  760. },
  761. fail: async err => {
  762. that.payPop = false
  763. that.$u.toast('支付失败');
  764. console.log('支付失败');
  765. // await setTimeout(() => {
  766. // // uni.redirectTo({
  767. // // url: '/pagesT/order/orderT?state=0'
  768. // // });
  769. // }, 100);
  770. }
  771. });
  772. // #endif
  773. }
  774. })
  775. },
  776. // 关闭加入购物车弹窗
  777. closeaddcartPop(obj) {
  778. if (!obj.show) {
  779. this.is_add_show = false;
  780. }
  781. },
  782. previewImage(index) {
  783. let urls = JSON.parse(JSON.stringify(this.imgList));
  784. if (index > 0) {
  785. urls.unshift(urls[index]);
  786. }
  787. uni.previewImage({
  788. urls: urls,
  789. longPressActions: {
  790. itemList: ['发送给朋友', '保存图片', '收藏'],
  791. success: data => {
  792. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  793. },
  794. fail: err => {
  795. console.log(err.errMsg);
  796. }
  797. }
  798. });
  799. },
  800. //轮播图指示器
  801. swiperChange(event) {
  802. this.currentSwiper = event.detail.current;
  803. },
  804. back() {
  805. if (this.pageName) {
  806. this.goPage('/pages/index/index', 'switchTab');
  807. } else {
  808. uni.navigateBack();
  809. }
  810. },
  811. // 获取该商品的组合套餐
  812. listsApiComBinPackage() {
  813. if (!this.goods_detail.shopId) return;
  814. this.$u.api
  815. .listsApiComBinPackage({
  816. page: 1,
  817. pageSize: 10,
  818. shopId: this.goods_detail.shopId,
  819. goodsId: this.goods_id
  820. })
  821. .then(({
  822. data
  823. }) => {
  824. this.shopId = this.goods_detail.shopId;
  825. this.combinedPackage = data;
  826. this.total = data.length;
  827. });
  828. },
  829. // #ifdef MP
  830. // 添加分销上下级关系 source: 1:首次点击链接 2:首次下单 3:首次付款'
  831. async relationshipBusinessman(businessmanId) {
  832. console.log('上级ID', businessmanId);
  833. if (!this.$store.state.hasLogin) {
  834. // 没有登录不请求接口
  835. return;
  836. }
  837. await this.$u.api.relationshipBusinessman({
  838. businessmanId: businessmanId,
  839. source: 1
  840. });
  841. console.log('上下:', data.data);
  842. }
  843. // #endif
  844. }
  845. };
  846. </script>
  847. <style lang="scss">
  848. @keyframes showPopup {
  849. 0% {
  850. opacity: 0;
  851. }
  852. 100% {
  853. opacity: 1;
  854. }
  855. }
  856. @keyframes hidePopup {
  857. 0% {
  858. opacity: 1;
  859. }
  860. 100% {
  861. opacity: 0;
  862. }
  863. }
  864. @keyframes showLayer {
  865. 0% {
  866. transform: translateY(0);
  867. }
  868. 100% {
  869. transform: translateY(-100%);
  870. }
  871. }
  872. @keyframes hideLayer {
  873. 0% {
  874. transform: translateY(-100%);
  875. }
  876. 100% {
  877. transform: translateY(0);
  878. }
  879. }
  880. .icon {
  881. font-size: 26upx;
  882. }
  883. .back-icon {
  884. font-size: 36rpx;
  885. padding-left: 24rpx;
  886. color: #2a2a2a;
  887. }
  888. .swiper-box {
  889. background-color: #ffffff;
  890. position: relative;
  891. width: 100%;
  892. height: 100vw;
  893. swiper {
  894. width: 100%;
  895. height: 100vw;
  896. swiper-item {
  897. image {
  898. width: 100%;
  899. height: 100vw;
  900. background-color: #f5f5f5;
  901. }
  902. }
  903. }
  904. .indicator {
  905. display: flex;
  906. justify-content: center;
  907. align-items: center;
  908. padding: 0 25upx;
  909. height: 40upx;
  910. border-radius: 4upx;
  911. font-size: 22upx;
  912. position: absolute;
  913. bottom: 50upx;
  914. right: 30upx;
  915. color: #fff;
  916. background-color: rgba(0, 0, 0, 0.2);
  917. }
  918. }
  919. .goods-info {
  920. overflow: hidden;
  921. transform: translateY(-36rpx);
  922. .seckill-view {
  923. padding: 0 20upx;
  924. height: 80upx;
  925. line-height: 80upx;
  926. background: linear-gradient(to right, #ff3859, #ff2d2e);
  927. color: #ffffff;
  928. .ibonxianshimiaosha {
  929. font-size: 36rpx;
  930. }
  931. }
  932. .price-view {
  933. padding: 0 30rpx;
  934. height: 152rpx;
  935. background-color: #fa6400;
  936. color: #ffffff;
  937. border-radius: 48rpx 48rpx 0 0;
  938. position: relative;
  939. .price-out {
  940. position: absolute;
  941. top: 50%;
  942. transform: translateY(calc(-50% - 16rpx));
  943. font-size: 48rpx;
  944. font-family: DIN-Medium;
  945. .rmb-ic {
  946. font-size: 24rpx;
  947. }
  948. .market-price {
  949. text-decoration: line-through;
  950. font-size: 24upx;
  951. color: #ffffff;
  952. opacity: 0.6;
  953. font-weight: 400;
  954. }
  955. .vip-price {
  956. display: inline-block;
  957. margin-left: 20rpx;
  958. line-height: 32rpx;
  959. height: 32rpx;
  960. border-radius: 4rpx;
  961. overflow: hidden;
  962. font-family: DINPro-Regular;
  963. .price-text {
  964. float: left;
  965. min-width: 80rpx;
  966. text-align: center;
  967. vertical-align: middle;
  968. font-size: 20rpx;
  969. color: #ffdfa2;
  970. background: linear-gradient(270deg, #1e5657 0%, #0d2b2c 100%);
  971. padding: 0 8rpx;
  972. }
  973. .price-bs {
  974. text-align: center;
  975. float: left;
  976. vertical-align: middle;
  977. width: 32rpx;
  978. background-color: #ffdfa2;
  979. font-size: 20rpx;
  980. color: #2c7564;
  981. }
  982. }
  983. }
  984. .right-view {
  985. position: absolute;
  986. right: 30rpx;
  987. top: calc(50% - 16rpx);
  988. transform: translateY(-50%);
  989. font-size: 24rpx;
  990. .goods-num {
  991. text-align: right;
  992. .num-li {
  993. display: inline-block;
  994. font-weight: 400;
  995. margin-left: 20rpx;
  996. }
  997. }
  998. }
  999. }
  1000. .active-view {
  1001. padding: 0;
  1002. overflow: hidden;
  1003. // 限时秒杀样式
  1004. .active-left {
  1005. padding-left: 30rpx;
  1006. width: 270rpx;
  1007. line-height: normal;
  1008. padding-top: 20rpx;
  1009. .goods-num {
  1010. height: 28rpx;
  1011. line-height: 28rpx;
  1012. display: flex;
  1013. .num-li {
  1014. font-weight: 400;
  1015. margin-right: 20rpx;
  1016. font-size: 20rpx;
  1017. }
  1018. }
  1019. .market-price {
  1020. text-decoration: line-through;
  1021. font-size: 24upx;
  1022. color: #ffffff;
  1023. opacity: 0.6;
  1024. font-weight: 400;
  1025. }
  1026. }
  1027. .active-right {
  1028. padding-right: 30rpx;
  1029. width: 480rpx;
  1030. background-color: #e02020;
  1031. height: 150rpx;
  1032. padding-left: 28rpx;
  1033. padding-top: 20rpx;
  1034. .ac-r-left {
  1035. .active-ic {
  1036. height: 32rpx;
  1037. line-height: 32rpx;
  1038. font-size: 32rpx;
  1039. font-weight: bold;
  1040. .ibonshijian {
  1041. font-size: 32rpx;
  1042. font-weight: normal;
  1043. margin-right: 6rpx;
  1044. }
  1045. }
  1046. .active-desc {
  1047. height: 32rpx;
  1048. line-height: 32rpx;
  1049. font-size: 24rpx;
  1050. margin-top: 15rpx;
  1051. }
  1052. }
  1053. .ac-r-right {
  1054. text-align: center;
  1055. .time-title {
  1056. font-size: 24rpx;
  1057. margin-bottom: 8rpx;
  1058. }
  1059. .count-down {
  1060. font-family: DIN-Medium;
  1061. .day-num {
  1062. height: 40rpx;
  1063. padding: 0 4rpx;
  1064. display: inline-block;
  1065. background-color: #000000;
  1066. color: #ffffff;
  1067. border-radius: 6rpx;
  1068. text-align: center;
  1069. line-height: 40rpx;
  1070. font-size: 28rpx;
  1071. }
  1072. .day-text {
  1073. display: inline-block;
  1074. line-height: 40rpx;
  1075. color: #ffffff;
  1076. font-size: 24rpx;
  1077. margin: 0 8rpx;
  1078. }
  1079. }
  1080. }
  1081. }
  1082. }
  1083. .goods-info-main {
  1084. transform: translateY(-32rpx);
  1085. padding: 30rpx;
  1086. background: #ffffff;
  1087. border-radius: 32rpx 32rpx 8rpx 8rpx;
  1088. .lap-info {
  1089. display: flex;
  1090. font-size: 24upx;
  1091. .lap-li {
  1092. text-align: center;
  1093. flex: 3;
  1094. padding: 0 20upx;
  1095. .laprice-text {
  1096. font-size: 28upx;
  1097. font-weight: 600;
  1098. color: #ff4d01;
  1099. }
  1100. .laprice-goods-num {
  1101. color: #333333;
  1102. }
  1103. }
  1104. }
  1105. .top-title {
  1106. .title {
  1107. width: 594rpx;
  1108. font-size: 32rpx;
  1109. letter-spacing: 1px;
  1110. color: #2a2a2a;
  1111. font-weight: 500;
  1112. .goods-brand {
  1113. letter-spacing: 0;
  1114. font-weight: 400;
  1115. padding: 0 16upx;
  1116. height: 40rpx;
  1117. line-height: 40rpx;
  1118. border-radius: 40rpx;
  1119. font-size: 24rpx;
  1120. font-weight: 500;
  1121. display: inline-block;
  1122. color: #ffffff;
  1123. margin-right: 16rpx;
  1124. }
  1125. }
  1126. .collection-btn {
  1127. text-align: center;
  1128. font-size: 20rpx;
  1129. .ibonfont {
  1130. font-size: 40rpx;
  1131. }
  1132. }
  1133. }
  1134. .describe {
  1135. font-size: 28rpx;
  1136. color: #9a9a9a;
  1137. padding-top: 20rpx;
  1138. font-weight: 500;
  1139. color: #e02020;
  1140. }
  1141. .active-box {
  1142. margin-top: 40rpx;
  1143. .row {
  1144. width: 100%;
  1145. display: flex;
  1146. align-items: center;
  1147. position: relative;
  1148. .text {
  1149. font-size: 28upx;
  1150. color: #9a9a9a;
  1151. margin-right: 40upx;
  1152. }
  1153. .content {
  1154. .ac-li {
  1155. margin-bottom: 10upx;
  1156. .ac-label {
  1157. background-color: #fa6400;
  1158. padding: 0 16upx;
  1159. height: 40rpx;
  1160. line-height: 40rpx;
  1161. border-radius: 40rpx;
  1162. font-size: 20rpx;
  1163. font-weight: 500;
  1164. display: inline-block;
  1165. color: #ffffff;
  1166. margin-right: 16rpx;
  1167. }
  1168. .ac-activityTitle {
  1169. display: inline-block;
  1170. font-size: 24upx;
  1171. }
  1172. .ac-value {
  1173. font-size: 24upx;
  1174. padding-top: 10rpx;
  1175. .ac-p {
  1176. color: $price-color;
  1177. }
  1178. }
  1179. }
  1180. }
  1181. }
  1182. }
  1183. }
  1184. }
  1185. .info-box {
  1186. padding: 16rpx 30upx;
  1187. background-color: #fff;
  1188. border-radius: 12upx;
  1189. transform: translateY(-48rpx);
  1190. margin-top: 16rpx;
  1191. .row {
  1192. width: 100%;
  1193. display: flex;
  1194. align-items: center;
  1195. position: relative;
  1196. line-height: 80rpx;
  1197. .text {
  1198. font-size: 28upx;
  1199. color: #9a9a9a;
  1200. margin-right: 40upx;
  1201. }
  1202. .content {
  1203. .conversion {
  1204. display: inline-block;
  1205. margin-right: 10rpx;
  1206. }
  1207. .no-sel {
  1208. color: #9a9a9a;
  1209. }
  1210. .service-li {
  1211. display: inline-block;
  1212. font-size: 22rpx;
  1213. color: #6c6c6c;
  1214. margin-left: 20rpx;
  1215. -webkit-line-clamp: 1;
  1216. .service-icon {
  1217. font-size: 28rpx;
  1218. margin-right: 12rpx;
  1219. }
  1220. .icon {
  1221. width: 28rpx;
  1222. height: 28rpx;
  1223. border-radius: 4rpx;
  1224. margin-right: 12rpx;
  1225. }
  1226. }
  1227. }
  1228. .arrow {
  1229. position: absolute;
  1230. right: 0;
  1231. .icon {
  1232. color: #afafaf;
  1233. }
  1234. }
  1235. }
  1236. }
  1237. .group-ul {
  1238. .group-li {
  1239. background-color: #ffffff;
  1240. border-radius: 12rpx;
  1241. margin-bottom: 20rpx;
  1242. .float_left {
  1243. .left-scroll {
  1244. width: 430rpx;
  1245. white-space: nowrap;
  1246. .goods-li {
  1247. display: inline-block;
  1248. vertical-align: middle;
  1249. margin-right: 5px;
  1250. image {
  1251. display: block;
  1252. width: 150rpx;
  1253. height: 150rpx;
  1254. border-radius: 10rpx;
  1255. margin: 0 auto;
  1256. }
  1257. text-align: center;
  1258. .goods-name {
  1259. width: 150rpx;
  1260. height: 36rpx;
  1261. line-height: 36rpx;
  1262. margin-top: 10rpx;
  1263. font-size: 24rpx;
  1264. -webkit-line-clamp: 1;
  1265. }
  1266. }
  1267. .plus-icon {
  1268. vertical-align: middle;
  1269. display: inline-block;
  1270. line-height: 150rpx;
  1271. padding: 0 10rpx;
  1272. height: 200rpx;
  1273. }
  1274. }
  1275. }
  1276. .dy-icon {
  1277. padding: 0 10rpx;
  1278. line-height: 150rpx;
  1279. padding: 0 10rpx;
  1280. height: 200rpx;
  1281. color: #cecece;
  1282. .ibonicon {
  1283. font-size: 26rpx;
  1284. }
  1285. }
  1286. .price-right {
  1287. color: #666666;
  1288. font-size: 24rpx;
  1289. text-align: center;
  1290. width: 190rpx;
  1291. .group-price {
  1292. font-family: DIN-Medium;
  1293. .primary-color {
  1294. font-weight: 700;
  1295. font-size: 28rpx;
  1296. }
  1297. }
  1298. .save-price {
  1299. font-family: DIN-Medium;
  1300. padding: 10rpx 0;
  1301. }
  1302. .buy-btn {
  1303. line-height: 56rpx;
  1304. height: 56rpx;
  1305. border-radius: 8rpx;
  1306. text-align: center;
  1307. color: #ffffff;
  1308. width: 150rpx;
  1309. margin: 10rpx auto 0;
  1310. }
  1311. }
  1312. }
  1313. }
  1314. .setMeal_more {
  1315. color: #999;
  1316. text-align: center;
  1317. font-size: 24rpx;
  1318. }
  1319. .description {
  1320. padding-bottom: 100upx;
  1321. .title {
  1322. width: 100%;
  1323. height: 80upx;
  1324. display: flex;
  1325. justify-content: center;
  1326. align-items: center;
  1327. font-size: 26upx;
  1328. color: #999;
  1329. }
  1330. }
  1331. .footer {
  1332. position: fixed;
  1333. bottom: 0upx;
  1334. width: 100%;
  1335. padding: 12upx 30rpx;
  1336. background-color: #ffffff;
  1337. z-index: 2;
  1338. display: flex;
  1339. justify-content: space-between;
  1340. align-items: center;
  1341. box-shadow: 0px -3rpx 32rpx 0px rgba(156, 170, 175, 0.16);
  1342. .icons {
  1343. height: 74upx;
  1344. .box {
  1345. height: 64upx;
  1346. margin-left: 32rpx;
  1347. display: inline-block;
  1348. text-align: center;
  1349. position: relative;
  1350. .icon {
  1351. font-size: 36upx;
  1352. color: #000000;
  1353. }
  1354. .text {
  1355. display: flex;
  1356. justify-content: center;
  1357. width: 100%;
  1358. font-size: 20upx;
  1359. color: #3c3c3c;
  1360. padding-top: 5rpx;
  1361. }
  1362. &:first-child {
  1363. margin-left: 10rpx;
  1364. padding-right: 24rpx;
  1365. position: relative;
  1366. &::after {
  1367. position: absolute;
  1368. top: 10rpx;
  1369. right: 0;
  1370. content: ' ';
  1371. display: inline-block;
  1372. width: 1px;
  1373. height: 48rpx;
  1374. background: #d8d8d8;
  1375. border-radius: 2rpx;
  1376. }
  1377. }
  1378. }
  1379. }
  1380. .btn {
  1381. overflow: hidden;
  1382. .buy {
  1383. border-radius: 8upx;
  1384. height: 74upx;
  1385. // width: 385rpx;
  1386. width: 580rpx;
  1387. color: #ffffff;
  1388. display: inline-block;
  1389. line-height: 74upx;
  1390. text-align: center;
  1391. font-size: 28upx;
  1392. &:first-child {
  1393. margin-right: 10rpx;
  1394. }
  1395. }
  1396. }
  1397. }
  1398. .popup {
  1399. position: fixed;
  1400. top: 0;
  1401. width: 100%;
  1402. height: 100%;
  1403. z-index: 20;
  1404. display: none;
  1405. .mask {
  1406. position: fixed;
  1407. top: 0;
  1408. width: 100%;
  1409. height: 100%;
  1410. z-index: 21;
  1411. background-color: rgba(0, 0, 0, 0.6);
  1412. }
  1413. .layer {
  1414. position: fixed;
  1415. z-index: 22;
  1416. bottom: -70%;
  1417. width: 100%;
  1418. padding: 0 4%;
  1419. height: 70%;
  1420. border-radius: 20upx 20upx 0 0;
  1421. background-color: #fff;
  1422. display: flex;
  1423. flex-wrap: wrap;
  1424. align-content: space-between;
  1425. .content {
  1426. width: 100%;
  1427. padding: 20upx 0;
  1428. }
  1429. .btn {
  1430. width: 100%;
  1431. height: 100upx;
  1432. .button {
  1433. width: 100%;
  1434. height: 80upx;
  1435. border-radius: 40upx;
  1436. color: #fff;
  1437. display: flex;
  1438. align-items: center;
  1439. justify-content: center;
  1440. background-color: #f47952;
  1441. font-size: 28upx;
  1442. }
  1443. }
  1444. }
  1445. &.show {
  1446. display: block;
  1447. .mask {
  1448. animation: showPopup 0.2s linear both;
  1449. }
  1450. .layer {
  1451. animation: showLayer 0.2s linear both;
  1452. }
  1453. }
  1454. &.hide {
  1455. display: block;
  1456. .mask {
  1457. animation: hidePopup 0.2s linear both;
  1458. }
  1459. .layer {
  1460. animation: hideLayer 0.2s linear both;
  1461. }
  1462. }
  1463. &.none {
  1464. display: none;
  1465. }
  1466. &.service {
  1467. .row {
  1468. margin: 30upx 0;
  1469. .title {
  1470. font-size: 30upx;
  1471. margin: 10upx 0;
  1472. }
  1473. .description {
  1474. font-size: 28upx;
  1475. color: #999;
  1476. }
  1477. }
  1478. }
  1479. &.spec {
  1480. .title {
  1481. font-size: 30upx;
  1482. margin: 30upx 0;
  1483. }
  1484. .sp {
  1485. display: flex;
  1486. view {
  1487. font-size: 28upx;
  1488. padding: 5upx 20upx;
  1489. border-radius: 8upx;
  1490. margin: 0 30upx 20upx 0;
  1491. background-color: #f6f6f6;
  1492. &.on {
  1493. padding: 3upx 18upx;
  1494. border: solid 1upx #f47925;
  1495. }
  1496. }
  1497. }
  1498. .length {
  1499. margin-top: 30upx;
  1500. border-top: solid 1upx #aaa;
  1501. display: flex;
  1502. justify-content: space-between;
  1503. align-items: center;
  1504. padding-top: 20upx;
  1505. .text {
  1506. font-size: 30upx;
  1507. }
  1508. .number {
  1509. display: flex;
  1510. justify-content: center;
  1511. align-items: center;
  1512. .input {
  1513. width: 80upx;
  1514. height: 60upx;
  1515. margin: 0 10upx;
  1516. background-color: #f3f3f3;
  1517. display: flex;
  1518. justify-content: center;
  1519. align-items: center;
  1520. text-align: center;
  1521. input {
  1522. width: 80upx;
  1523. height: 60upx;
  1524. display: flex;
  1525. justify-content: center;
  1526. align-items: center;
  1527. text-align: center;
  1528. font-size: 26upx;
  1529. }
  1530. }
  1531. .sub,
  1532. .add {
  1533. width: 60upx;
  1534. height: 60upx;
  1535. background-color: #f3f3f3;
  1536. border-radius: 5upx;
  1537. .icon {
  1538. font-size: 30upx;
  1539. width: 60upx;
  1540. height: 60upx;
  1541. display: flex;
  1542. justify-content: center;
  1543. align-items: center;
  1544. }
  1545. }
  1546. }
  1547. }
  1548. }
  1549. }
  1550. .share {
  1551. display: none;
  1552. &.show {
  1553. display: block;
  1554. .mask {
  1555. animation: showPopup 0.15s linear both;
  1556. }
  1557. .layer {
  1558. animation: showLayer 0.15s linear both;
  1559. }
  1560. }
  1561. &.hide {
  1562. display: block;
  1563. .mask {
  1564. animation: hidePopup 0.15s linear both;
  1565. }
  1566. .layer {
  1567. animation: hideLayer 0.15s linear both;
  1568. }
  1569. }
  1570. &.none {
  1571. display: none;
  1572. }
  1573. .mask {
  1574. background-color: rgba(0, 0, 0, 0.5);
  1575. position: fixed;
  1576. width: 100%;
  1577. height: 100%;
  1578. top: 0;
  1579. z-index: 11;
  1580. }
  1581. .layer {
  1582. width: 92%;
  1583. position: fixed;
  1584. z-index: 12;
  1585. padding: 0 4%;
  1586. top: 100%;
  1587. background-color: rgba(255, 255, 255, 0.9);
  1588. .list {
  1589. width: 100%;
  1590. display: flex;
  1591. padding: 10upx 0 30upx 0;
  1592. .box {
  1593. width: 25%;
  1594. display: flex;
  1595. justify-content: center;
  1596. flex-wrap: wrap;
  1597. image {
  1598. width: 13.8vw;
  1599. height: 13.8vw;
  1600. }
  1601. .title {
  1602. margin-top: 10upx;
  1603. display: flex;
  1604. justify-content: center;
  1605. width: 100%;
  1606. font-size: 26upx;
  1607. }
  1608. }
  1609. }
  1610. .btn {
  1611. width: 100%;
  1612. height: 100upx;
  1613. display: flex;
  1614. justify-content: center;
  1615. align-items: center;
  1616. font-size: 28upx;
  1617. border-top: solid 1upx #666666;
  1618. }
  1619. .h1 {
  1620. width: 100%;
  1621. height: 80upx;
  1622. display: flex;
  1623. justify-content: center;
  1624. align-items: center;
  1625. font-size: 34upx;
  1626. }
  1627. }
  1628. }
  1629. .coupon-box {
  1630. .row {
  1631. .content {
  1632. .coupon-li {
  1633. display: inline-block;
  1634. width: 120upx;
  1635. background-color: $price-color;
  1636. color: #ffffff;
  1637. line-height: 30upx;
  1638. font-size: 18upx;
  1639. text-align: center;
  1640. }
  1641. }
  1642. }
  1643. }
  1644. .share-tit {
  1645. line-height: 80upx;
  1646. text-align: center;
  1647. font-size: 32upx;
  1648. }
  1649. .share-cancel {
  1650. line-height: 80upx;
  1651. text-align: center;
  1652. font-size: 28upx;
  1653. border-top: 1px solid #f4f4f4;
  1654. }
  1655. .share-ul {
  1656. display: flex;
  1657. padding: 50upx 0;
  1658. .share-li {
  1659. flex: 3;
  1660. .share-btn {
  1661. background-color: #ffffff;
  1662. font-size: 26upx;
  1663. &::after {
  1664. border: 0 none;
  1665. }
  1666. .icon-view {
  1667. display: inline-block;
  1668. width: 100upx;
  1669. height: 100upx;
  1670. border-radius: 100%;
  1671. background-color: #18b566;
  1672. line-height: 100upx;
  1673. text-align: center;
  1674. margin-bottom: 10upx;
  1675. }
  1676. }
  1677. }
  1678. }
  1679. .poster-view {
  1680. // width: 600upx;
  1681. // margin: 0 auto;
  1682. }
  1683. .service-box {
  1684. .content {
  1685. width: 560rpx;
  1686. -webkit-line-clamp: 1;
  1687. .service-li {
  1688. display: inline-block;
  1689. color: #666666;
  1690. font-size: 24rpx;
  1691. margin-right: 30rpx;
  1692. .icon {
  1693. width: 50rpx;
  1694. height: 50rpx;
  1695. border-radius: 4rpx;
  1696. }
  1697. .ibonfont {
  1698. margin-right: 10rpx;
  1699. font-size: 24rpx;
  1700. color: $uni-color-primary;
  1701. }
  1702. }
  1703. }
  1704. }
  1705. .service-pop {
  1706. .title {
  1707. line-height: 100rpx;
  1708. height: 100rpx;
  1709. font-size: 32rpx;
  1710. text-align: center;
  1711. color: #222;
  1712. }
  1713. .service-ul {
  1714. padding: 0 30rpx;
  1715. max-height: 430rpx;
  1716. overflow-y: auto;
  1717. width: 100%;
  1718. .service-li {
  1719. font-size: 28rpx;
  1720. padding: 24rpx 0;
  1721. .icon {
  1722. width: 32rpx;
  1723. height: 32rpx;
  1724. border-radius: 4rpx;
  1725. margin-right: 20rpx;
  1726. }
  1727. .ibonfont {
  1728. font-size: 32rpx;
  1729. color: $uni-color-primary;
  1730. margin-right: 20rpx;
  1731. }
  1732. .desc {
  1733. padding-left: 54rpx;
  1734. padding-top: 10rpx;
  1735. font-size: 24rpx;
  1736. color: #999999;
  1737. }
  1738. }
  1739. }
  1740. .confirm-btn {
  1741. height: 80rpx;
  1742. line-height: 80rpx;
  1743. text-align: center;
  1744. color: #ffffff;
  1745. background-color: $uni-color-primary;
  1746. margin-top: 30rpx;
  1747. }
  1748. }
  1749. .pay-pop-view {
  1750. background-color: #ffffff;
  1751. border-top-left-radius: 12upx;
  1752. border-top-right-radius: 12upx;
  1753. font-size: 28upx;
  1754. .pay-sel-title {
  1755. padding: 0 30upx;
  1756. line-height: 88upx;
  1757. font-weight: bold;
  1758. font-size: 32upx;
  1759. .ibonfont {
  1760. color: #999;
  1761. font-weight: 400;
  1762. }
  1763. }
  1764. .pay-btn {
  1765. height: 90upx;
  1766. line-height: 90upx;
  1767. color: #000;
  1768. font-size: 32upx;
  1769. text-align: center;
  1770. background-color: #108ee9;
  1771. }
  1772. .pay-ul {
  1773. .pay-li {
  1774. line-height: 100upx;
  1775. .ibonfont {
  1776. padding-left: 30upx;
  1777. font-size: 46upx;
  1778. vertical-align: middle;
  1779. margin-right: 24upx;
  1780. }
  1781. .ibonweixinzhifu {
  1782. color: #04be02;
  1783. }
  1784. .ibonumidd17 {
  1785. color: #108ee9;
  1786. }
  1787. .ibonhuodaofukuan {
  1788. color: #f2b844;
  1789. }
  1790. .pay-name {
  1791. width: 650upx;
  1792. display: inline-block;
  1793. padding-right: 30upx;
  1794. vertical-align: middle;
  1795. border-bottom: 1px solid #f5f5f5;
  1796. .ibonxuanze1,
  1797. .ibonweixuanze {
  1798. margin-right: 0;
  1799. padding-left: 0;
  1800. font-size: 38upx;
  1801. }
  1802. .balace-num {
  1803. font-size: 24rpx;
  1804. color: #6c6c6c;
  1805. }
  1806. }
  1807. .balance-pay-name {
  1808. position: relative;
  1809. padding-bottom: 20rpx;
  1810. .balance-tip {
  1811. position: absolute;
  1812. font-size: 22rpx;
  1813. line-height: 36rpx;
  1814. bottom: 10rpx;
  1815. left: 0;
  1816. }
  1817. }
  1818. }
  1819. }
  1820. }
  1821. </style>