itemdetail.vue 46 KB

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