itemdetail.vue 44 KB

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