product.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618
  1. <template>
  2. <view class="container" v-if="showCard">
  3. <!-- 轮播图 -->
  4. <view class="carousel">
  5. <swiper indicator-dots :circular="true" duration="400">
  6. <swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
  7. <view class="image-wrapper"><image :src="item" class="loaded" mode="scaleToFill"></image></view>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. <!-- 介绍部分 -->
  12. <view class="level_row" v-if="level_name != ''">
  13. <text class="level_name">{{ level_name }}折后</text>
  14. <text>¥</text>
  15. <text class="level_price">{{ level_price }}</text>
  16. </view>
  17. <view class="introduce-section">
  18. <view class="introduce-price flex1">
  19. <view class="price">
  20. <view class="price-left">
  21. <view class="left-1">¥</view>
  22. <view class="left-2">{{ actionPrice }}</view>
  23. </view>
  24. <view class="price-right" v-if="originPrice != '' && option.types != 'libao'">¥{{ originPrice }}</view>
  25. <view class="price-right" v-if="originPrice != '' && option.types == 'libao'">¥{{ ot_price }}</view>
  26. </view>
  27. <!-- #ifndef APP-PLUS -->
  28. <!-- <button class="top_img" open-type="share"><image class="share-img" src="../../static/label/share.png"></image></button> -->
  29. <!--<view class="share" @click="open"><image src="../../static/label/share.png"></image></view>
  30. <view class="mask" v-show="show"><image @click="onTap" src="../../static/img/shareimg.png"></image></view> -->
  31. <!-- #endif -->
  32. <!-- #ifdef APP-PLUS -->
  33. <!-- <view class="share" @click="shareEvent"><image src="../../static/label/share.png"></image></view> -->
  34. <!-- #endif -->
  35. </view>
  36. <view class="title">{{ goodsObjact.store_name }}</view>
  37. <view class="bot-row flex1">
  38. <view>快递:¥ {{ goodsObjact.postage }}</view>
  39. <view>剩余:{{ goodsObjact.stock }}件</view>
  40. <view>销量:{{ goodsObjact.fsales }}</view>
  41. </view>
  42. </view>
  43. <view class="shareDate" @click="share"><image src="https://xipin.liuniu946.com/img/share.png"></image></view>
  44. <!-- #ifdef APP-PLUS -->
  45. <!-- <view class="share-section" @click="shareEvent">
  46. <view class="share-icon">
  47. <text class="iconfont iconfavorfill"></text>
  48. </view>
  49. <text class="tit">该商品分享可领49减10红包</text>
  50. <text class="iconfont iconprompt"></text>
  51. <view class="share-btn">
  52. 立即分享
  53. <text class="iconfont iconenter"></text>
  54. </view>
  55. </view> -->
  56. <!-- #endif -->
  57. <!-- 优惠 -->
  58. <view class="discount flex-start">
  59. <view class="discount-1 ">包邮</view>
  60. <view class="discount-2 flex-start">{{ temp.name }},不满足条件,邮费6元</view>
  61. </view>
  62. <!-- 规格 -->
  63. <view class="discount flex1" @click="toggleSpec()">
  64. <view class="flex-start">
  65. <view class="discount-1">选择</view>
  66. <view class="discount-2">请选择数量</view>
  67. </view>
  68. <text class="iconfont iconenter"></text>
  69. </view>
  70. <!-- 评价 -->
  71. <view class="eva-section" v-if="list.replyCount > 0" @click="navTo('/pages/product/reply?id=' + goodsid)">
  72. <view class="e-header">
  73. <text class="tit">评价</text>
  74. <text>({{ list.replyCount }})</text>
  75. <text class="tip">好评率 {{ list.replyChance }}%</text>
  76. <text class="iconfont iconenter"></text>
  77. </view>
  78. <view class="eva-box">
  79. <image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
  80. <view class="right">
  81. <text class="name">{{ reply.nickname }}</text>
  82. <text class="con">{{ reply.comment }}</text>
  83. <view class="con_box">
  84. <view class="con_image" v-for="item in reply.pics"><image :src="item"></image></view>
  85. </view>
  86. <view class="bot">
  87. <text class="attr"></text>
  88. <text class="time">{{ reply.add_time }}</text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- <view class="eva-section" @click="navTo('/pages/product/reply?id=' + goodsid)">
  94. <view class="e-header">
  95. <text class="tit">买家秀</text>
  96. <text>({{ list.replyCount }})</text>
  97. <text class="tip">查看全部</text>
  98. <text class="iconfont iconenter"></text>
  99. </view>
  100. <view class="eva-box">
  101. <image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
  102. </view>
  103. </view> -->
  104. <!-- 规格-模态层弹窗 -->
  105. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec()">
  106. <!-- 遮罩层 -->
  107. <view class="mask"></view>
  108. <view class="layer attr-content" @click.stop="stopPrevent">
  109. <view class="a-t">
  110. <image :src="actionImage"></image>
  111. <view class="right">
  112. <text class="name">{{ goodsObjact.store_name }}</text>
  113. <text class="price">
  114. ¥
  115. <text class="price-1">{{ actionPrice }}</text>
  116. </text>
  117. <text class="stock">库存:{{ goodsNumberMax }}件</text>
  118. <view class="selected" v-if="specList != ''">
  119. 已选:
  120. <text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
  121. </view>
  122. </view>
  123. <view class="content-1" @click="toggleSpec()"><image src="../../static/label/delete.png"></image></view>
  124. </view>
  125. <view v-for="(item, index) in specList" :key="index" class="attr-list flex-column">
  126. <text>{{ item.attr_name }}</text>
  127. <view class="item-list">
  128. <text
  129. v-for="(childItem, childIndex) in item.attr_value"
  130. :key="childIndex"
  131. class="tit"
  132. :class="{ selected: childItem.check }"
  133. @click="selectSpec(childItem, item, index)"
  134. >
  135. {{ childItem.attr }}
  136. </text>
  137. </view>
  138. </view>
  139. <view class="attr-list flex1">
  140. <view>购买数量</view>
  141. <view class="">
  142. <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
  143. </view>
  144. </view>
  145. <view class="buttom-two-box flex1">
  146. <view class="box-1 flex-center" @click="buy(2)"><view>加入购物车</view></view>
  147. <view class="box-2 flex-center" @click="buy(1)"><view>立即购买</view></view>
  148. </view>
  149. <!-- <button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
  150. <button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button> -->
  151. </view>
  152. </view>
  153. <!-- 商品详情图 -->
  154. <view class="detail-desc">
  155. <view class="desc-title flex-center">
  156. <view class="one"></view>
  157. 商品详情
  158. <view class="two"></view>
  159. </view>
  160. <!-- <view class="d-header"><text>图文详情</text></view> -->
  161. <jyf-parser :html="description" ref="article"></jyf-parser>
  162. <!-- 底部高度撑开 -->
  163. <view :class="{ contentBottomHeight: goodsType == 1 || goodsType == 2, goodsBottom: goodsType == 0 }"></view>
  164. </view>
  165. <!-- 按钮 -->
  166. <view class="botton-row flex-start">
  167. <view class="botton-1 flex-center">
  168. <view class="botton-frame" @click="toFavorite(goodsObjact)">
  169. <view class="img-box" v-if="goodsObjact.userCollect == false"><image src="../../static/label/img02.png"></image></view>
  170. <view class="img-box" v-if="goodsObjact.userCollect == true"><image src="../../static/label/img08.png"></image></view>
  171. <view class="word" :class="{ active: goodsObjact.userCollect }">收藏</view>
  172. </view>
  173. <!-- #ifdef MP -->
  174. <button class="botton-frame kefu" open-type="contact">
  175. <view class="img-box" style="height: 45rpx;"><image style="height: 45rpx;" src="../../static/label/kefu.png"></image></view>
  176. <view class="word">客服</view>
  177. </button>
  178. <!-- #endif -->
  179. </view>
  180. <view class="botton-2 flex-center" @click="toggleSpec(2)"><view>加入购物车</view></view>
  181. <view class="botton-2 flex-center" @click="toggleSpec(1)"><view>立即购买</view></view>
  182. </view>
  183. <!-- 分享 -->
  184. <view v-if="shareShow" class="Shraremask" @click="cancel">
  185. <view class="mask-content">
  186. <scroll-view class="view-content" scroll-y>
  187. <view class="share-header">分享到</view>
  188. <view class="share-list">
  189. <view class="share-item">
  190. <!-- #ifdef MP -->
  191. <!-- 微信 -->
  192. <button class="wechat-box" open-type="share">
  193. <image class="itemImage" src="https://xipin.liuniu946.com/img/img001.png" mode=""></image>
  194. <text class="itemText">微信</text>
  195. </button>
  196. <!-- 朋友圈 -->
  197. <view class="wechat-box" @click="navTos()">
  198. <image class="itemImage" src="https://xipin.liuniu946.com/img/img002.png" mode=""></image>
  199. <text class="itemText">朋友圈</text>
  200. </view>
  201. <!-- #endif -->
  202. <!-- #ifdef APP-PLUS -->
  203. <view class="wechat-box" @click="copy()">
  204. <image class="itemImage" src="https://xipin.liuniu946.com/img/img001.png" mode=""></image>
  205. <text class="itemText">微信</text>
  206. </view>
  207. <!-- 朋友圈 -->
  208. <!-- <view class="wechat-box" @click="navTos()">
  209. <image class="itemImage" src="https://xipin.liuniu946.com/img/img002.png" mode=""></image>
  210. <text class="itemText">朋友圈</text>
  211. </view> -->
  212. <!-- #endif -->
  213. </view>
  214. </view>
  215. </scroll-view>
  216. <view class="bottomButtom b-t" @click="cancel">取消</view>
  217. </view>
  218. </view>
  219. <!-- 分享弹出窗 -->
  220. <!-- <view class="pop-mask" v-if="backShare" @click="closeBack"><image class="share-img" :src="shareImage" mode="aspectFit" @longpress="saveImg()"></image></view> -->
  221. <!-- 分享,把参数传过去 -->
  222. <!-- #ifdef APP-PLUS -->
  223. <!-- <popupshare ref="parPop" :opt="showShare" :option="option" :type="shareType"></popupshare> -->
  224. <!-- #endif -->
  225. </view>
  226. </template>
  227. <script>
  228. import { mapState } from 'vuex';
  229. import { uniFav } from '@/components/uni-fav/uni-fav.vue';
  230. import { goodsDetail, cartAdd, collectAdd, collectDel, productDetail,userSpread } from '@/api/product.js';
  231. import { getCombinationPoster } from '@/api/details.js';
  232. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  233. import { userinfo } from '@/api/user.js';
  234. import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
  235. import jyfParser from '@/components/jyf-parser/jyf-parser';
  236. import uniRate from '@/components/uni-rate/uni-rate.vue';
  237. import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
  238. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  239. import popupshare from '@/components/uni-popup/uni-popup-share.vue';
  240. import uniNumberBox from '@/components/uni-number-box.vue';
  241. // #ifdef H5
  242. import { weixindata } from '@/utils/wxAuthorized';
  243. // #endif
  244. export default {
  245. components: {
  246. uniRate,
  247. uniCountdown,
  248. uniNumberBox,
  249. jyfParser,
  250. uniFav,
  251. uniNoticeBar,
  252. popupshare
  253. },
  254. // #ifdef MP
  255. onShareAppMessage: function(res) {
  256. if (res.from === 'button') {
  257. // 来自页面内分享按钮
  258. let pages = getCurrentPages();
  259. // 获取当前页面
  260. let page = pages[pages.length - 1];
  261. let path = '/' + page.route + '?';
  262. // 保存传值
  263. for (let i in page.options) {
  264. path += i + '=' + page.options[i] + '&';
  265. }
  266. // 保存邀请人
  267. path += 'spread=' + this.userInfo.uid;
  268. let data = {
  269. path: path,
  270. imageUrl: this.goodsObjact.image,
  271. title: this.goodsObjact.title
  272. };
  273. return data;
  274. }
  275. },
  276. // #endif
  277. data() {
  278. return {
  279. shareShow:false,//分享弹窗是否显示
  280. level_name: '',
  281. level_price: '',
  282. showShare: '',
  283. parPop: '',
  284. showCard: false, //数据加载完成在渲染界面
  285. replyCount: 0,
  286. showModal: true, //拼单遮罩层
  287. more: true, //查看更多按钮
  288. autoplay: true,
  289. vertical: true,
  290. interval: 3000,
  291. duration: 500,
  292. buys_show: true,
  293. buys_shows: false,
  294. circular: true,
  295. type: 2,
  296. specClass: 'none', //显示隐藏弹窗
  297. actionImage: '', //商品图片
  298. goodsid: '', //商品id
  299. actionPrice: '', //商品价格
  300. // specClass: 'none', //显示隐藏弹窗
  301. shareList: [], //分享列表
  302. goodsObjact: {}, //保存商品数据
  303. goodsNumberMax: 0, //商品库存
  304. //图片循环
  305. imgList: [], //商品轮播图
  306. specList: [],
  307. people: '', //拼团人数
  308. goodsNumber: 1, //购买数量(开团数量为1,整团数量为1*参团人数)
  309. carnumber: '', //整团购买商品数量
  310. reply: {}, //评论数据
  311. list: '', //详情数据
  312. temp: '', //邮费详情
  313. goodsType: 0, //商品类型1秒杀商品0为普通商品2为拼团商品3为新人礼包
  314. pinkTlist: '', //拼团数据
  315. count: 0, //点击查看更多
  316. showlist: [],
  317. showmore: true,
  318. pinkTlistnum: '',
  319. spread: '',
  320. chooseGoodsNumber: 1, //选择商品的数量
  321. specSelected: [], //选中的分类
  322. goodsStore: 0, //选中库存
  323. uniqueId: '',
  324. productValue: [],
  325. isCollect: '', //是否被收藏
  326. maskshow: false, //弹窗
  327. posturl: '',
  328. userCollect: false,
  329. favoriteList: [],
  330. option: '', //保存传值
  331. opt: '', //保存小程序传值
  332. show: true,
  333. originPrice: '',
  334. ot_price: '', //礼包的原价
  335. description: '' //商品描述
  336. };
  337. },
  338. onLoad(option) {
  339. this.option = option;
  340. console.log(this.option, 'this.option');
  341. if (option.scene) {
  342. if (typeof option.scene == 'string') {
  343. let scene = ('{' + option.scene + '}')
  344. .replace('qr%26', '')
  345. .replace(/%3D/g, ':')
  346. .replace(/%26/g, ',')
  347. .replace('pid', '"pid"')
  348. .replace('type', '"type"')
  349. .replace('id', '"id"');
  350. let opt = JSON.parse(scene);
  351. this.opt = opt;
  352. // 保存拼团订单id
  353. this.goodsid = opt.id;
  354. console.log(opt.id, 'opt.id');
  355. if (opt.pid) {
  356. // 存储邀请人
  357. this.spread = opt.pid;
  358. uni.setStorageSync('spread', opt.pid);
  359. if(this.userInfo.spread_uid == 0){
  360. userSpread({
  361. puid: uni.getStorageSync('spread')
  362. }).then(res => {
  363. uni.showToast({
  364. title:'邀请人添加成功1'
  365. })
  366. })
  367. }
  368. }
  369. if (opt.type) {
  370. this.goodsType = opt.type;
  371. }
  372. }
  373. } else {
  374. //保存商品id
  375. this.goodsid = option.id;
  376. console.log(option.id, 'option.id');
  377. //判断有无人邀请
  378. if (typeof(option.spread) !="undefined") {
  379. // 存储邀请人
  380. this.spread = option.spread;
  381. uni.setStorageSync('spread', option.spread);
  382. if(this.userInfo.spread_uid == 0){
  383. userSpread({
  384. puid: uni.getStorageSync('spread')
  385. }).then(res => {
  386. uni.showToast({
  387. title:'邀请人添加成功2'
  388. })
  389. })
  390. }
  391. }
  392. //判断是否是普通商品
  393. if (option.type) {
  394. console.log(option.type);
  395. this.goodsType = option.type;
  396. }
  397. }
  398. this.goodsDetail();
  399. // 保存当前页面
  400. saveUrl();
  401. if (!this.hasLogin) {
  402. uni.showModal({
  403. title: '登录',
  404. content: '您未登录,是否马上登陆?',
  405. success: e => {
  406. if (e.confirm) {
  407. interceptor();
  408. }
  409. },
  410. fail: e => {
  411. console.log(e);
  412. }
  413. });
  414. return;
  415. }
  416. },
  417. computed: {
  418. ...mapState(['userInfo', 'baseURL', 'hasLogin']),
  419. shareType: function(value) {
  420. return this.goodsType > 0 ? (this.goodsType == 2 ? 1 : '') : 0;
  421. }
  422. },
  423. methods: {
  424. // 获取普通商品信息
  425. goodsDetail() {
  426. let obj = this;
  427. productDetail({}, obj.goodsid).then(({ data }) => {
  428. console.log(data, 112);
  429. if (data.reply) {
  430. obj.reply = data.reply;
  431. }
  432. obj.list = data;
  433. obj.temp = data.temp;
  434. // 取整
  435. obj.list.replyChance = parseInt(data.replyChance);
  436. let goods = data.storeInfo;
  437. obj.productValue = data.productValue;
  438. console.log(obj.productValue, 120);
  439. obj.goodsObjact = goods; //商品信息
  440. obj.imgList = goods.slider_image; //保存轮播图
  441. obj.specList = data.productAttr; //保存产品属性
  442. if (obj.goodsObjact.description != null) {
  443. obj.description = obj.goodsObjact.description.replace(/<img/g, "<img style='max-width:100% !important;height:auto !important;'");
  444. } //小程序商品详情图超出屏幕问题
  445. console.log(obj.description, 'obj.description');
  446. obj.specSelected = []; //初始化默认选择对象
  447. for (let i = 0; i < obj.specList.length; i++) {
  448. // 设置默认数据
  449. let attrValue = obj.specList[i].attr_value[0];
  450. attrValue.check = true;
  451. obj.specSelected.push(attrValue.attr);
  452. }
  453. //保存默认选中的对象字符串名称
  454. let str = obj.specSelected.join(',');
  455. // 设置默认值
  456. obj.actionPrice = obj.productValue[str].price;
  457. let a = obj.productValue[str].level_price;
  458. obj.level = JSON.parse(a);
  459. console.log(obj.level, 'level');
  460. obj.goodsNumberMax = obj.productValue[str].stock;
  461. obj.originPrice = obj.productValue[str].originPrice;
  462. obj.ot_price = obj.productValue[str].ot_price;
  463. obj.actionImage = obj.productValue[str].image;
  464. obj.uniqueId = obj.productValue[str].unique;
  465. if (obj.goodsType == 2) {
  466. obj.goodsStore = obj.productValue[str].quota;
  467. } else {
  468. obj.goodsStore = obj.goodsObjact.stock;
  469. }
  470. obj.showCard = true;
  471. this.userinfo();
  472. // #ifdef H5
  473. obj.shareDate();
  474. // #endif
  475. });
  476. },
  477. copy() {
  478. let that = this;
  479. let url = 'https://mmz.liuniu946.com@pages/product/product?id=' + that.goodsid+'@0' + '@' + that.userInfo.uid
  480. console.log(url,'url')
  481. uniCopy({
  482. content: url,
  483. success: res => {
  484. console.log(res,'res')
  485. // uni.showToast({
  486. // title: res,
  487. // icon: 'none'
  488. // });
  489. },
  490. error: e => {
  491. uni.showToast({
  492. title: e,
  493. icon: 'none',
  494. duration: 3000
  495. });
  496. }
  497. });
  498. },
  499. userinfo() {
  500. let a;
  501. let obj = this;
  502. userinfo({}).then(({ data }) => {
  503. console.log(data, 666);
  504. if(data.level_info == null)
  505. {
  506. a = 1;
  507. }else{
  508. a = data.level_info.level_id;
  509. a = a + 1;
  510. }
  511. console.log(a, '9999999');
  512. if (a == 1) {
  513. obj.level_name = '会员';
  514. obj.level_price = obj.level.price_1;
  515. } else if (a == 2) {
  516. obj.level_name = '合伙人';
  517. obj.level_price = obj.level.price_2;
  518. } else {
  519. obj.show = false;
  520. }
  521. });
  522. },
  523. //分享
  524. share() {
  525. console.log('share')
  526. this.shareShow = true;
  527. },
  528. cancel(){
  529. this.shareShow = false;
  530. },
  531. shareData() {
  532. console.log(11);
  533. this.showShare = true;
  534. },
  535. numberChange(e) {
  536. //购买数量
  537. this.chooseGoodsNumber = e.number;
  538. // console.log(e.number)
  539. // console.log(this.chooseGoodsNumber,'chooseGoodsNumber')
  540. },
  541. // #ifdef APP-PLUS
  542. shareEvent() {
  543. this.$nextTick(() => {
  544. this.$refs['parPop'].open();
  545. this.$refs['parPop'].loadData();
  546. });
  547. },
  548. // #endif
  549. // 处理数组结构
  550. dataUpReturn(data) {
  551. //保存处理完毕数据
  552. let arr = [];
  553. // 保存临时数据
  554. let arr1 = [];
  555. // 设置每个小数组可以存放的数量
  556. let num = 2;
  557. if (data.length > 1) {
  558. for (let i = 0; i < data.length; i++) {
  559. // 保存数据到临时数组
  560. arr1.push(data[i]);
  561. if ((i + 1) % num === 0) {
  562. console.log(arr1, 2);
  563. // 添加数据到返回数组,用map方法解决物理指针问题导致的数据对象改变问题
  564. arr.push(
  565. arr1.map(e => {
  566. return e;
  567. })
  568. );
  569. // 清空临时数组重新开始计算
  570. arr1 = [];
  571. }
  572. }
  573. }
  574. // 判断是否为奇数
  575. if (data.length % num === 1) {
  576. arr.push([data[data.length - 1]]);
  577. }
  578. return arr;
  579. },
  580. //拼团列表数据分页
  581. setPinkList() {
  582. let obj = this;
  583. let showlist = new Array();
  584. for (let i = 0; i < obj.pinkTlist.length; i++) {
  585. if (i >= obj.count) {
  586. break;
  587. }
  588. showlist[i] = obj.pinkTlist[i];
  589. }
  590. obj.showlist = showlist;
  591. },
  592. //查看更多
  593. // clickMore() {
  594. // let obj = this;
  595. // obj.count += 2;
  596. // obj.setPinkList();
  597. // if (obj.count >= obj.pinkTlist.length) {
  598. // obj.showmore = false; //当次数大于拼团数据,查看更多隐藏
  599. // } else {
  600. // obj.showmore = true; //当次数大于拼团数据,查看更多隐藏
  601. // }
  602. // },
  603. clickMore() {
  604. this.showlist = this.pinkTlist;
  605. console.log(this.showlist, 22);
  606. this.more = false;
  607. },
  608. //规格弹窗开关
  609. toggleSpec(str) {
  610. if (this.specClass === 'show') {
  611. this.specClass = 'hide';
  612. setTimeout(() => {
  613. this.specClass = 'none';
  614. }, 250);
  615. } else if (this.specClass === 'none') {
  616. this.specClass = 'show';
  617. }
  618. // 判断是否为数字
  619. if (typeof str == 'number') {
  620. // 保存当前购买类型
  621. this.type = str;
  622. }
  623. console.log(this.type, 113);
  624. }, //选择规格
  625. selectSpec(item, arr, ind) {
  626. arr.attr_value.forEach(function(e) {
  627. e.check = false;
  628. });
  629. item.check = true;
  630. let obj = this;
  631. obj.specSelected[ind] = item.attr;
  632. let str = obj.specSelected.join(',');
  633. console.log(obj.productValue[str], 116);
  634. if (obj.productValue[str]) {
  635. obj.buys_show = true;
  636. obj.buys_shows = false;
  637. obj.actionPrice = obj.productValue[str].price;
  638. obj.goodsNumberMax = obj.productValue[str].stock;
  639. obj.actionImage = obj.productValue[str].image;
  640. obj.uniqueId = obj.productValue[str].unique;
  641. if (obj.goodsType == 2) {
  642. obj.goodsStore = obj.productValue[str].quota;
  643. } else {
  644. obj.goodsStore = obj.productValue[str].product_stock;
  645. }
  646. } else {
  647. (obj.buys_show = false), (obj.buys_shows = true);
  648. }
  649. obj.specSelected[ind] = item.attr;
  650. // console.log(obj.specList)
  651. // console.log(str)
  652. // if (obj.specList[str]) {
  653. // let data = obj.specList[str];
  654. // console.log(data)
  655. // obj.actionPrice = data.price;
  656. // if (obj.goodsType == 2) {
  657. // obj.goodsStore = obj.productValue[item.attr].quota;
  658. // } else {
  659. // obj.goodsStore = obj.goodsObjact.stock;
  660. // }
  661. // obj.goodsNumberMax = data.stock;
  662. // obj.actionImage = data.image;
  663. // obj.uniqueId = data.unique;
  664. // }
  665. },
  666. //显示弹窗
  667. open() {
  668. this.show = true;
  669. },
  670. //随意点击隐藏弹窗
  671. onTap() {
  672. if (!this.open) return;
  673. this.close();
  674. },
  675. close() {
  676. this.show = false;
  677. },
  678. //收藏
  679. toFavorite(item) {
  680. let obj = this;
  681. console.log(item.userCollect, 6666);
  682. item.userCollect = !item.userCollect;
  683. // 判断是否已经收藏
  684. if (!item.userCollect) {
  685. collectDel({
  686. id: item.id
  687. }).then(function(e) {
  688. obj.$api.msg('成功取消收藏!');
  689. });
  690. } else {
  691. collectAdd({
  692. id: item.id
  693. }).then(function(e) {
  694. obj.$api.msg('成功加入收藏!');
  695. });
  696. }
  697. },
  698. // #ifdef H5
  699. shareDate() {
  700. let obj = this;
  701. let url = window.location.href.replace(/[\?,&]{0,1}from=singlemessage/g, '') + '&spread=' + this.userInfo.uid;
  702. let bool = uni.getStorageSync('weichatBrowser') || '';
  703. // 判断是否微信浏览器
  704. if (bool) {
  705. let data;
  706. if (obj.goodsType == 0) {
  707. data = {
  708. link: url, // 分享链接
  709. imgUrl: obj.goodsObjact.image, // 分享图标
  710. desc: obj.goodsObjact.store_info,
  711. title: obj.goodsObjact.store_name,
  712. success: function() {}
  713. };
  714. }
  715. if (obj.goodsType == 2) {
  716. data = {
  717. link: url, // 分享链接
  718. imgUrl: obj.goodsObjact.image, // 分享图标
  719. title: obj.goodsObjact.title,
  720. desc: obj.goodsObjact.info,
  721. success: function() {}
  722. };
  723. }
  724. weixindata(data);
  725. }
  726. },
  727. // #endif
  728. /**
  729. * 统一跳转接口,拦截未登录路由
  730. * navigator标签现在默认没有转场动画,所以用view
  731. */
  732. navTo(url) {
  733. uni.navigateTo({
  734. url
  735. });
  736. },
  737. navTos(){
  738. console.log(this.goodsid,'this.goodsid')
  739. uni.navigateTo({
  740. url:'/pages/product/index?goodsid='+ this.goodsid
  741. });
  742. },
  743. // 立即购买
  744. buy(item) {
  745. let obj = this;
  746. // uni.showModal({
  747. // title: 'this.hasLogin',
  748. // content: obj.hasLogin
  749. // });
  750. //obj.toggleSpec();
  751. // this.specClass='show',
  752. // console.log(obj.list.productValue.默认.unique)
  753. // console.log(obj.chooseGoodsNumber,'chooseGoodsNumber')
  754. //return
  755. // 创建传值对象
  756. console.log(obj.list.productValue);
  757. console.log(obj.list);
  758. let data = {
  759. // cartNum: obj.goodsNumber, //商品数量
  760. cartNum: obj.chooseGoodsNumber, //商品数量
  761. uniqueId: obj.uniqueId, //商品标签
  762. new: 1 //商品是否新增加到购物车1为不加入0为加入
  763. //mer_id: obj.shopId
  764. };
  765. //console.log(obj.type,116);
  766. // 判断是否为加入购物车
  767. if (item == 2) {
  768. data.new = 0;
  769. }
  770. //console.log(data.new,115)
  771. // 判断是否为普通商品
  772. if (obj.goodsType == 0) {
  773. data.productId = obj.goodsid; //商品编号
  774. }
  775. // 判断是否为拼团商品
  776. if (obj.goodsType == 2) {
  777. data.combinationId = obj.goodsid; //拼团编号
  778. data.productId = obj.goodsObjact.product_id; //商品编号
  779. if (item == 1) {
  780. data.cartNum = obj.people;
  781. } else {
  782. data.cartNum = 1;
  783. }
  784. // if (obj.userInfo.level == 0) {
  785. // if (this.userInfo.level == 0) {
  786. // uni.showToast({
  787. // title: '新人消费满380元成为团长才能开团!',
  788. // type: 'top',
  789. // duration: 1500,
  790. // icon: 'none'
  791. // });
  792. // setTimeout(function() {
  793. // uni.navigateTo({
  794. // url: '/pages/user/vipup'
  795. // });
  796. // }, 1000);
  797. // return;
  798. // }
  799. // }
  800. }
  801. this.specClass = 'none';
  802. console.log(data, 115);
  803. cartAdd(data)
  804. .then(function(e) {
  805. let da = e.data;
  806. console.log(e);
  807. //obj.toggleSpec();
  808. if (item == 1) {
  809. // 跳转到支付页
  810. uni.navigateTo({
  811. url: '/pages/order/createOrder?id=' + da.cartId + '&type=' + '1'
  812. });
  813. }
  814. if (item == 2) {
  815. obj.$api.msg('成功加入购物车');
  816. //obj.toggleSpec();
  817. }
  818. })
  819. .catch(e => {
  820. console.log(e);
  821. });
  822. },
  823. // 阻止触发上级事件
  824. stopPrevent() {}
  825. }
  826. };
  827. </script>
  828. <style lang="scss">
  829. page {
  830. background: $page-color-base;
  831. padding-bottom: 160rpx;
  832. line-height: 1;
  833. }
  834. .conter {
  835. width: 100%;
  836. }
  837. .shareDate {
  838. position: fixed;
  839. right: 0;
  840. bottom: 50%;
  841. z-index: 95;
  842. width: 140rpx;
  843. height: 140rpx;
  844. // color: #ffffff;
  845. // border-radius: 100%;
  846. // width: 120rpx;
  847. // height: 120rpx;
  848. // line-height: 120rpx;
  849. // background-color: $background-color;
  850. // text-align: center;
  851. // font-size: 30rpx;
  852. image {
  853. width: 140rpx;
  854. height: 140rpx;
  855. }
  856. }
  857. .Shraremask {
  858. position: fixed;
  859. left: 0;
  860. top: 0;
  861. right: 0;
  862. bottom: 0;
  863. display: flex;
  864. justify-content: center;
  865. align-items: flex-end;
  866. z-index: 998;
  867. transition: 0.3s;
  868. background-color: rgba(51, 51, 51, 0.6);
  869. .bottomButtom {
  870. position: absolute;
  871. left: 0;
  872. bottom: 0;
  873. display: flex;
  874. justify-content: center;
  875. align-items: center;
  876. width: 100%;
  877. height: 90rpx;
  878. background: #fff;
  879. z-index: 9;
  880. font-size: $font-base + 2rpx;
  881. color: $font-color-dark;
  882. }
  883. }
  884. .mask-content {
  885. width: 100%;
  886. height: 380rpx;
  887. transition: 0.3s;
  888. background: #fff;
  889. &.has-bottom {
  890. padding-bottom: 90rpx;
  891. }
  892. .view-content {
  893. height: 100%;
  894. }
  895. }
  896. .share-header {
  897. height: 110rpx;
  898. font-size: $font-base + 2rpx;
  899. color: font-color-dark;
  900. display: flex;
  901. align-items: center;
  902. justify-content: center;
  903. padding-top: 10rpx;
  904. &:before,
  905. &:after {
  906. content: '';
  907. width: 240rpx;
  908. heighg: 0;
  909. border-top: 1px solid $border-color-base;
  910. transform: scaleY(0.5);
  911. margin-right: 30rpx;
  912. }
  913. &:after {
  914. margin-left: 30rpx;
  915. margin-right: 0;
  916. }
  917. }
  918. .share-list {
  919. display: flex;
  920. width: 80%;
  921. margin: 0rpx auto;
  922. }
  923. .share-item {
  924. min-width: 33.33%;
  925. display: flex;
  926. justify-content: center;
  927. align-items: center;
  928. height: 180rpx;
  929. width: 100%;
  930. .wechat-box {
  931. width: 50%;
  932. height: 100%;
  933. background: #ffffff;
  934. border: 0;
  935. display: flex;
  936. align-items: center;
  937. flex-direction: column;
  938. &::after {
  939. border: 0;
  940. }
  941. .itemImage {
  942. width: 80rpx;
  943. height: 80rpx;
  944. margin-bottom: 16rpx;
  945. }
  946. .itemText {
  947. font-size: $font-base;
  948. color: $font-color-base;
  949. line-height: 2;
  950. }
  951. }
  952. }
  953. .level_row {
  954. width: 750rpx;
  955. height: 55rpx;
  956. background: #fc4141;
  957. font-size: 28rpx;
  958. line-height: 55rpx;
  959. color: #ffffff;
  960. padding-left: 20rpx;
  961. .level_name {
  962. font-size: 30rpx;
  963. }
  964. .level_price {
  965. font-size: 34rpx;
  966. }
  967. }
  968. .top_img {
  969. // width: 60rpx;
  970. // height: 60rpx;
  971. background-color: rgba(1, 11, 1, 0);
  972. position: absolute;
  973. right: 20rpx;
  974. .share-img {
  975. width: 30rpx;
  976. height: 35rpx;
  977. margin-left: -13px;
  978. }
  979. &::after {
  980. width: 100%;
  981. height: 100%;
  982. border: none;
  983. }
  984. }
  985. /* 分享 */
  986. .share-section {
  987. display: flex;
  988. align-items: center;
  989. color: $font-color-base;
  990. background: linear-gradient(left, #fdf5f6, #fbebf6);
  991. padding: 12rpx 30rpx;
  992. .share-icon {
  993. display: flex;
  994. align-items: center;
  995. width: 70rpx;
  996. height: 30rpx;
  997. line-height: 1;
  998. border: 1px solid $uni-color-primary;
  999. border-radius: 4rpx;
  1000. position: relative;
  1001. overflow: hidden;
  1002. font-size: 22rpx;
  1003. color: $uni-color-primary;
  1004. &:after {
  1005. content: '';
  1006. width: 50rpx;
  1007. height: 50rpx;
  1008. border-radius: 50%;
  1009. left: -20rpx;
  1010. top: -12rpx;
  1011. position: absolute;
  1012. background: $uni-color-primary;
  1013. }
  1014. }
  1015. .iconfavorfill {
  1016. position: relative;
  1017. z-index: 1;
  1018. font-size: 24rpx;
  1019. margin-left: 2rpx;
  1020. margin-right: 10rpx;
  1021. color: #fff;
  1022. line-height: 1;
  1023. }
  1024. .tit {
  1025. font-size: $font-base;
  1026. margin-left: 10rpx;
  1027. }
  1028. .iconprompt {
  1029. padding: 10rpx;
  1030. font-size: 30rpx;
  1031. line-height: 1;
  1032. }
  1033. .share-btn {
  1034. flex: 1;
  1035. text-align: right;
  1036. font-size: $font-sm;
  1037. color: $uni-color-primary;
  1038. }
  1039. .iconenter {
  1040. font-size: $font-sm;
  1041. margin-left: 4rpx;
  1042. color: $uni-color-primary;
  1043. }
  1044. }
  1045. // 处理图片间白色间距问题
  1046. /deep/ .pHeight {
  1047. line-height: 0;
  1048. }
  1049. /deep/ div,
  1050. /deep/ table {
  1051. max-width: 100% !important;
  1052. }
  1053. // 处理图片间白色间距问题
  1054. .pHeight {
  1055. line-height: 0;
  1056. }
  1057. .iconenter {
  1058. font-size: $font-base + 2rpx;
  1059. color: #888;
  1060. }
  1061. .pinklist_list {
  1062. margin-bottom: 25rpx;
  1063. }
  1064. /* 轮播图 */
  1065. .carousel {
  1066. height: 722rpx;
  1067. position: relative;
  1068. swiper {
  1069. height: 100%;
  1070. }
  1071. .image-wrapper {
  1072. width: 100%;
  1073. height: 100%;
  1074. }
  1075. .swiper-item {
  1076. display: flex;
  1077. justify-content: center;
  1078. align-content: center;
  1079. height: 750rpx;
  1080. overflow: hidden;
  1081. image {
  1082. width: 100%;
  1083. height: 100%;
  1084. }
  1085. }
  1086. }
  1087. /* 标题简介 */
  1088. .introduce-section {
  1089. background: #fff;
  1090. padding: 15rpx 25rpx 30rpx 25rpx;
  1091. .introduce-price {
  1092. width: 100%;
  1093. overflow: hidden;
  1094. .price {
  1095. display: flex;
  1096. align-items: center;
  1097. justify-content: flex-start;
  1098. .price-left {
  1099. display: flex;
  1100. align-items: flex-end;
  1101. color: #fc4141;
  1102. margin-right: 20rpx;
  1103. .left-1 {
  1104. margin-right: 5rpx;
  1105. font-size: 28rpx;
  1106. }
  1107. .left-2 {
  1108. font-size: 48rpx;
  1109. }
  1110. }
  1111. .price-right {
  1112. font-size: 28rpx;
  1113. text-decoration: line-through;
  1114. color: #333333;
  1115. opacity: 0.61;
  1116. }
  1117. }
  1118. .share {
  1119. image {
  1120. width: 30rpx;
  1121. height: 35rpx;
  1122. }
  1123. }
  1124. }
  1125. .title {
  1126. margin-top: 30rpx;
  1127. font-size: 32rpx;
  1128. color: #1d2023;
  1129. line-height: 40rpx;
  1130. font-weight: 600;
  1131. }
  1132. .bot-row {
  1133. margin-top: 20rpx;
  1134. overflow: hidden;
  1135. font-size: 24rpx;
  1136. font-weight: 500;
  1137. color: #999999;
  1138. }
  1139. }
  1140. /* 优惠/规格 */
  1141. .discount {
  1142. margin-top: 20rpx;
  1143. padding: 0 25rpx;
  1144. height: 90rpx;
  1145. line-height: 90rpx;
  1146. background-color: #ffffff;
  1147. }
  1148. .discount-1 {
  1149. font-size: 26rpx;
  1150. font-weight: 500;
  1151. color: #666666;
  1152. margin-right: 35rpx;
  1153. }
  1154. .discount-2 {
  1155. display: flex;
  1156. align-items: center;
  1157. justify-content: flex-start;
  1158. font-size: 26rpx;
  1159. font-weight: 500;
  1160. color: #333333;
  1161. .red {
  1162. color: #fd7344;
  1163. }
  1164. }
  1165. .mask {
  1166. z-index: 999;
  1167. width: 100%;
  1168. height: 100%;
  1169. position: fixed;
  1170. top: 0;
  1171. left: 0;
  1172. text-align: center;
  1173. background-color: rgba(0, 0, 0, 0.5);
  1174. image {
  1175. width: 100%;
  1176. height: 100%;
  1177. opacity: 0.8;
  1178. }
  1179. }
  1180. /* 弹出层 */
  1181. .popup {
  1182. position: fixed;
  1183. left: 0;
  1184. top: 0;
  1185. right: 0;
  1186. bottom: 0;
  1187. z-index: 99;
  1188. &.show {
  1189. display: block;
  1190. .mask {
  1191. animation: showPopup 0.2s linear both;
  1192. }
  1193. .layer {
  1194. animation: showLayer 0.2s linear both;
  1195. }
  1196. }
  1197. &.hide {
  1198. .mask {
  1199. animation: hidePopup 0.2s linear both;
  1200. }
  1201. .layer {
  1202. animation: hideLayer 0.2s linear both;
  1203. }
  1204. }
  1205. &.none {
  1206. display: none;
  1207. }
  1208. .mask {
  1209. position: fixed;
  1210. top: 0;
  1211. width: 100%;
  1212. height: 100%;
  1213. z-index: 1;
  1214. background-color: rgba(0, 0, 0, 0.4);
  1215. }
  1216. .price {
  1217. display: flex;
  1218. align-items: flex-end;
  1219. justify-content: flex-start;
  1220. }
  1221. .layer {
  1222. position: fixed;
  1223. z-index: 99;
  1224. bottom: 0;
  1225. width: 100%;
  1226. border-radius: 10rpx 10rpx 0 0;
  1227. background-color: #fff;
  1228. overflow: hidden;
  1229. .btn {
  1230. height: 66rpx;
  1231. line-height: 66rpx;
  1232. border-radius: 100rpx;
  1233. background: $uni-color-primary;
  1234. font-size: $font-base + 2rpx;
  1235. color: #fff;
  1236. margin: 30rpx auto 20rpx;
  1237. }
  1238. }
  1239. @keyframes showPopup {
  1240. 0% {
  1241. opacity: 0;
  1242. }
  1243. 100% {
  1244. opacity: 1;
  1245. }
  1246. }
  1247. @keyframes hidePopup {
  1248. 0% {
  1249. opacity: 1;
  1250. }
  1251. 100% {
  1252. opacity: 0;
  1253. }
  1254. }
  1255. @keyframes showLayer {
  1256. 0% {
  1257. transform: translateY(120%);
  1258. }
  1259. 100% {
  1260. transform: translateY(0%);
  1261. }
  1262. }
  1263. @keyframes hideLayer {
  1264. 0% {
  1265. transform: translateY(0);
  1266. }
  1267. 100% {
  1268. transform: translateY(120%);
  1269. }
  1270. }
  1271. }
  1272. /* 评价 */
  1273. .eva-section {
  1274. display: flex;
  1275. flex-direction: column;
  1276. padding: 20rpx 30rpx;
  1277. background: #fff;
  1278. margin-top: 16rpx;
  1279. .e-header {
  1280. display: flex;
  1281. align-items: center;
  1282. height: 70rpx;
  1283. font-size: $font-sm + 2rpx;
  1284. color: $font-color-light;
  1285. .tit {
  1286. font-size: $font-base + 2rpx;
  1287. color: $font-color-dark;
  1288. margin-right: 4rpx;
  1289. }
  1290. .tip {
  1291. flex: 1;
  1292. text-align: right;
  1293. }
  1294. .iconenter {
  1295. margin-left: 10rpx;
  1296. }
  1297. }
  1298. }
  1299. .eva-box {
  1300. display: flex;
  1301. padding: 20rpx 0;
  1302. .portrait {
  1303. flex-shrink: 0;
  1304. width: 80rpx;
  1305. height: 80rpx;
  1306. border-radius: 100px;
  1307. }
  1308. .right {
  1309. flex: 1;
  1310. display: flex;
  1311. flex-direction: column;
  1312. font-size: $font-base;
  1313. color: $font-color-base;
  1314. padding-left: 26rpx;
  1315. .con {
  1316. font-size: $font-base;
  1317. color: $font-color-dark;
  1318. padding: 20rpx 0;
  1319. }
  1320. .bot {
  1321. display: flex;
  1322. justify-content: space-between;
  1323. font-size: $font-sm;
  1324. color: $font-color-light;
  1325. }
  1326. }
  1327. }
  1328. .con_image {
  1329. width: 130rpx;
  1330. height: 130rpx;
  1331. display: inline-block;
  1332. padding: 15rpx;
  1333. image {
  1334. width: 100%;
  1335. height: 100%;
  1336. }
  1337. }
  1338. /* 规格选择弹窗 */
  1339. .attr-content {
  1340. padding-top: 25rpx;
  1341. .a-t {
  1342. display: flex;
  1343. padding: 0 30rpx;
  1344. image {
  1345. flex: 1;
  1346. width: 170rpx;
  1347. height: 170rpx;
  1348. flex-shrink: 0;
  1349. border-radius: 8rpx;
  1350. }
  1351. .content-1 {
  1352. width: 35rpx;
  1353. height: 35rpx;
  1354. image {
  1355. width: 35rpx;
  1356. height: 35rpx;
  1357. }
  1358. }
  1359. .right {
  1360. display: flex;
  1361. flex-direction: column;
  1362. padding-left: 24rpx;
  1363. font-size: $font-sm + 2rpx;
  1364. color: $font-color-base;
  1365. width: 70%;
  1366. .price {
  1367. font-size: $font-lg - 2rpx;
  1368. color: $base-color;
  1369. margin: 10rpx 0rpx;
  1370. .price-1 {
  1371. display: inline-block;
  1372. font-size: $font-lg + 28rpx;
  1373. color: $base-color;
  1374. }
  1375. }
  1376. .selected {
  1377. margin-top: 20rpx;
  1378. }
  1379. .name {
  1380. font-size: 32rpx;
  1381. color: $font-color-dark;
  1382. overflow: hidden;
  1383. text-overflow: ellipsis;
  1384. white-space: nowrap;
  1385. display: block;
  1386. }
  1387. .selected-text {
  1388. margin-right: 10rpx;
  1389. }
  1390. }
  1391. }
  1392. .attr-list {
  1393. font-size: $font-base + 2rpx;
  1394. color: #333333;
  1395. padding: 30rpx;
  1396. }
  1397. .flex-column {
  1398. display: flex;
  1399. flex-direction: column;
  1400. }
  1401. .buttom-two-box {
  1402. .box-1 {
  1403. height: 100rpx;
  1404. flex: 1;
  1405. background: #ffb238;
  1406. font-size: 32rpx;
  1407. color: #ffffff;
  1408. }
  1409. .box-2 {
  1410. height: 100rpx;
  1411. flex: 1;
  1412. background: #fc4141;
  1413. font-size: 32rpx;
  1414. color: #ffffff;
  1415. }
  1416. }
  1417. .item-list {
  1418. padding: 20rpx 0 0;
  1419. display: flex;
  1420. flex-wrap: wrap;
  1421. text {
  1422. display: flex;
  1423. align-items: center;
  1424. justify-content: center;
  1425. background: #eee;
  1426. margin-right: 20rpx;
  1427. margin-bottom: 20rpx;
  1428. border-radius: 10rpx;
  1429. min-width: 60rpx;
  1430. height: 60rpx;
  1431. padding: 0 20rpx;
  1432. font-size: $font-base;
  1433. color: #666666;
  1434. }
  1435. .selected {
  1436. background: #fbebee;
  1437. color: #fa2740;
  1438. border: 1px solid #fa2740;
  1439. }
  1440. }
  1441. }
  1442. /* 详情 */
  1443. .detail-desc {
  1444. background: #fff;
  1445. /deep/ img {
  1446. max-width: 100% !important;
  1447. display: inline !important;
  1448. }
  1449. /deep/ div {
  1450. max-width: 100% !important;
  1451. }
  1452. .desc-title {
  1453. font-size: 28rpx;
  1454. font-weight: 500;
  1455. color: #1d2023;
  1456. padding: 25rpx 0;
  1457. .one {
  1458. width: 77rpx;
  1459. height: 1px;
  1460. background: linear-gradient(to right, rgba(204, 204, 204, 0), rgba(204, 204, 204, 1));
  1461. margin-right: 10rpx;
  1462. }
  1463. .two {
  1464. margin-left: 10rpx;
  1465. width: 77rpx;
  1466. height: 1px;
  1467. background: linear-gradient(to left, rgba(204, 204, 204, 0), rgba(204, 204, 204, 1));
  1468. }
  1469. }
  1470. .d-header {
  1471. display: flex;
  1472. justify-content: center;
  1473. align-items: center;
  1474. height: 80rpx;
  1475. font-size: $font-base + 2rpx;
  1476. color: $font-color-dark;
  1477. position: relative;
  1478. text {
  1479. padding: 0 20rpx;
  1480. background: #fff;
  1481. position: relative;
  1482. z-index: 0;
  1483. }
  1484. &:after {
  1485. position: absolute;
  1486. left: 50%;
  1487. top: 50%;
  1488. transform: translateX(-50%);
  1489. width: 300rpx;
  1490. height: 0;
  1491. content: '';
  1492. border-bottom: 1px solid #ccc;
  1493. }
  1494. }
  1495. }
  1496. /* 按钮 */
  1497. .botton-row {
  1498. width: 100%;
  1499. position: fixed;
  1500. bottom: 0;
  1501. left: 0;
  1502. font-size: 32rpx;
  1503. color: #ffffff;
  1504. .botton-1 {
  1505. width: 200rpx;
  1506. height: 100rpx;
  1507. background-color: #ffffff;
  1508. .botton-frame {
  1509. width: 100rpx;
  1510. display: flex;
  1511. align-items: center;
  1512. flex-direction: column;
  1513. justify-content: center;
  1514. .img-box {
  1515. width: 45rpx;
  1516. height: 40rpx;
  1517. image {
  1518. width: 100%;
  1519. height: 100%;
  1520. }
  1521. }
  1522. }
  1523. .kefu {
  1524. background: 0;
  1525. line-height: 0;
  1526. padding: 0;
  1527. height: 68rpx;
  1528. margin-top: -6rpx;
  1529. &::after {
  1530. border: 0;
  1531. }
  1532. .word {
  1533. margin-top: 5rpx;
  1534. line-height: 1;
  1535. }
  1536. }
  1537. .word {
  1538. margin-top: 6rpx;
  1539. font-size: 20rpx;
  1540. font-weight: 400;
  1541. color: #666666;
  1542. &.active {
  1543. color: $uni-color-primary;
  1544. }
  1545. }
  1546. }
  1547. .botton-2 {
  1548. color: #ffffff;
  1549. flex: 1;
  1550. height: 100rpx;
  1551. background-color: #ffb238;
  1552. }
  1553. .botton-2:last-child {
  1554. background-color: #fc4141;
  1555. }
  1556. }
  1557. </style>