goods.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#666"></navbar>
  4. <view id="page-top">
  5. <view class="product">
  6. <view class="u-bg-fff pb40">
  7. <view class="pic">
  8. <!-- <image src="../../../static/delImg/product2.png" mode="aspectFill"></image> -->
  9. <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1500"
  10. circular="true">
  11. <swiper-item v-if="dataForm.video_url">
  12. <!-- <video enable-progress-gesture="false" :src="dataForm.video_url"></video>
  13. -->
  14. <j-video class="jvideo" :url="dataForm.video_url" width="750rpx" height="620rpx">
  15. </j-video>
  16. </swiper-item>
  17. <swiper-item v-for="(item, index) in imglist" :key="index">
  18. <image :src="item" mode="aspectFill"></image>
  19. </swiper-item>
  20. </swiper>
  21. <view class="p-price">
  22. <view class="pd24 u-flex-center" style="align-items: baseline;">
  23. <view class="u-FFF u-font36">
  24. <rich-text :nodes="$mUtil.priceBigSmallTwo(dataForm.min_sale_price)"></rich-text>
  25. </view>
  26. <text class="discount u-font24 u-ml20 u-del">¥{{ dataForm.max_market_price }}</text>
  27. <!-- <text class="discount u-font24 u-ml15">
  28. {{((dataForm.min_sale_price / dataForm.max_market_price) *10).toFixed(1)}}折
  29. </text> -->
  30. <!-- <text class="discount u-font24 u-ml15" style="flex: 1;text-align: right;">
  31. 贡献值:{{ $mUtil.isToFixedNum(dataForm.consumption_value, 2) }}
  32. </text> -->
  33. </view>
  34. </view>
  35. <view class="u-plr30" style="margin-top: 100rpx;">
  36. <view>
  37. <view class="u-font34 u-bold u-1A1A1A">
  38. <view v-if="dataForm.platform_store" class="tag" style="vertical-align: middle;">
  39. 自营</view>
  40. <text class="u-font34 u-bold u-1A1A1A"
  41. style="vertical-align: middle;">{{dataForm.title}}</text>
  42. </view>
  43. </view>
  44. <view class="u-font24 u-mt15 u-999">
  45. <text>已售
  46. <text class="u-FF0000">{{ dataForm.result_sale_num }}</text>件,仅剩<text
  47. class="u-FF0000">{{
  48. dataForm.residual_inventory
  49. }}</text>件</text>
  50. </view>
  51. <!--优惠-->
  52. <view class="bg-FFF6EE pd20 u-mt20 u-flex-center br-rd10"
  53. v-if="shopDiscounts.is_use == true">
  54. <view class="u-FF0000 br-FF0000 u-font24">首单优惠</view>
  55. <view class="u-ml15 u-font24 u-CA7E57">满{{ shopDiscounts.full }}元减{{
  56. shopDiscounts.reduction
  57. }}元</view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="u-bg-fff u-mt10">
  63. <view class="u-plr30 u-flex-center-sb pt-pb35">
  64. <view class="u-flex-center">
  65. <view @click="goShop">
  66. <image class="u-avatar104" :src="shop.logo"></image>
  67. </view>
  68. <view class="u-ml25">
  69. <view class="u-font28 u-1A1A1A u-bold">{{ shop.shop_name }} </view>
  70. <view class="u-999 u-font24 u-mt5 u-text2" @click="goLocal">
  71. <text class="iconfont" style="color: #FA6138;">&#xe6db;</text>
  72. {{ shop.province_name }}{{ shop.city_name }}{{ shop.area_name
  73. }}{{ shop.address }}
  74. </view>
  75. </view>
  76. </view>
  77. <view class="iconfont" @click="goShop">&#xe6c7;</view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="u-bg-fff u-mt10">
  82. <view class="tab u-flex-center-sa u-font30 u-1A1A1A u-border-one-one"
  83. :style="`top: calc(${statusBarHeight}px + 44px)`">
  84. <view @tap="change(0)" class="pb30" :class="{ active: isChecked == 0 }">商品详情</view>
  85. <view @tap="change(1)" class="pb30" :class="{ active: isChecked == 1 }">
  86. 用户评论({{ commentList.length }})</view>
  87. </view>
  88. <view class="u-mt10">
  89. <!--商品详情-->
  90. <view v-if="isChecked == 0">
  91. <view class="richText ql-editor-box">
  92. <rich-text :nodes="goodsInfo.mobile_detail"></rich-text>
  93. <!-- <jyf-parser :html="$mUtil.formatRichText(goodsInfo.mobile_detail)" ref="article">
  94. </jyf-parser> -->
  95. </view>
  96. </view>
  97. <!--评论-->
  98. <view class="u-plr30" v-else>
  99. <comment :value="commentList"></comment>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <view style="height:150rpx;background-color:white"></view>
  105. <view class="bottom-btn u-bg-fff">
  106. <view class="pt-pb30 u-plr30 u-flex-center-sb">
  107. <view class="leftbox">
  108. <button @click="share" class="u-text-center goods-tools">
  109. <view class="iconfont2 u-font44 u-999">&#xe684;</view>
  110. <view class="u-font28 u-1A1A1A">分享</view>
  111. </button>
  112. <button class="u-text-center goods-tools" @click="collection">
  113. <view v-if="!isCollection">
  114. <view class="iconfont2 u-font40 u-999">&#xe6bf;</view>
  115. <view class="u-font28 u-1A1A1A">收藏</view>
  116. </view>
  117. <view v-else>
  118. <view class="iconfont2 u-font44 u-999 collectionActive">&#xe616;</view>
  119. <view class="u-font28 u-1A1A1A">取消</view>
  120. </view>
  121. </button>
  122. <view class="cart" @click="goTocart">
  123. <view class="u-text-center goods-tools">
  124. <view class="iconfont2 car-icon u-font44 u-999">&#xe600;<text v-if="carNums > 0"
  125. class="nums">{{ carNums }}</text></view>
  126. <view class="u-font28 u-1A1A1A">购物车</view>
  127. </view>
  128. </view>
  129. </view>
  130. <!--普通商品-->
  131. <!-- <view class="u-flex-center" v-if="ispay"> -->
  132. <view class="u-flex-center">
  133. <button class="cart-btn u-00321E u-font30" @click="buy(0, dataForm.id)"
  134. v-if="dataForm.area_feature != 1">
  135. 加入购物车
  136. </button>
  137. <button class="buy-btn u-DCCDA4 u-font30" @click="buy(1, dataForm.id)">
  138. 立即购买
  139. </button>
  140. </view>
  141. </view>
  142. </view>
  143. <!--规格-->
  144. <uniPopup type="bottom" ref="specOpen">
  145. <view class="u-bg-fff spec">
  146. <view class="u-plr30 flex-sb u-border-one-one pb30">
  147. <view class="u-flex-center">
  148. <image class="u-goods200" :src="choseConfig.cover ? choseConfig.cover : cover"></image>
  149. <view class="u-ml20">
  150. <view class="u-999 u-font24 price-zhe">
  151. <view class="u-FF0000 u-font36">
  152. <rich-text
  153. :nodes="$mUtil.priceBigSmall(choseConfig.sale_price ? choseConfig.sale_price : moPrice)">
  154. </rich-text>
  155. </view>
  156. <text
  157. class="u-del u-ml15">¥{{ choseConfig.market_price ? choseConfig.market_price : moDelPrice }}
  158. </text>
  159. <!-- <text class="u-ml10">7.5折</text> -->
  160. </view>
  161. <view class="u-font22 u-999 u-mt5">库存 {{ stock }} 件</view>
  162. <view class="u-1A1A1A u-mt25">{{
  163. choseConfig.sku_set_name ? choseConfig.sku_set_name : "请选择"
  164. }}
  165. </view>
  166. </view>
  167. </view>
  168. <view class="iconfont u-999 closeIcon" @click="specOpenClose">&#xe612;</view>
  169. </view>
  170. <view>
  171. <!-- overHeight -->
  172. <view class="">
  173. <view class="u-mt30" v-for="(item, index) in skuTab" :key="item.head.id">
  174. <view class="u-plr30">{{ item.head.name }}</view>
  175. <view class="u-mt20 u-border-one-one pb30">
  176. <view class="u-plr30 u-flex u-flex-warp">
  177. <view class="spec-item" :class="childrenItem.flag ? 'activeColor' : ''"
  178. @click="chonseSku(index, childrenItem.id)" v-for="childrenItem in item.values"
  179. :key="childrenItem.id">{{ childrenItem.name }}</view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. <view class="u-plr30 u-mt30">
  185. <view class="u-flex-center-sb">
  186. <view>购买数量</view>
  187. <!-- 服务体系礼包、免费商品、公益申领不能一次购买多个 -->
  188. <!-- <view v-if="/^(1|3)$/.test(dataForm.area_feature) || dataForm.free" class="u-flex-center">
  189. <view class="num" style="border: none;">{{ add_num }}</view>
  190. </view> -->
  191. <view class="u-flex-center">
  192. <view class="iconfont minus" @click="resNum">&#xe60b;</view>
  193. <view class="num">{{ add_num }}</view>
  194. <view class="iconfont plus-sign" @click="addNum">&#xe686;</view>
  195. </view>
  196. </view>
  197. <view class="specOpen-btn">
  198. <view v-if="btnType == 0">
  199. <button class="u-btn-two" @click="btnBuy(btnType)">
  200. {{ btnName }}
  201. </button>
  202. </view>
  203. <view v-else>
  204. <button class="u-btn-two" @click="btnBuy(btnType)">
  205. {{ btnName }}
  206. </button>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. </uniPopup>
  213. <!--页面加载动画-->
  214. <ldLoading isFullScreen :active="loading"></ldLoading>
  215. <share ref="shares" :contentHeight="580" v-if="isvisible"></share>
  216. <!-- 服务体系礼包才有的弹窗 -->
  217. <uni-popup class="tip-popup" ref="submitPopup" type="center" :mask-click="false">
  218. <view class="content-box">
  219. <view class="title">请确认所属区域</view>
  220. <scroll-view scroll-y style="max-height: 80vh;box-sizing: border-box;">
  221. <view class="content">
  222. <view v-for="(item,index) in areaLevel" :key="index">
  223. <view class="check-tip"
  224. :class="dataForm && (dataForm.service_package_area != 7 || index<=0)?'required':''">
  225. 请选择{{item.levelName}}</view>
  226. <picker class="pickerList" :range="areaList[index]" range-key="label"
  227. @change="e=>areaChange(e,index)">
  228. <view class="check-input">
  229. <textarea v-if="dataForm && dataForm.service_package_area == 7" disabled auto-height
  230. v-model="checkAreaList[index][item.propName]"
  231. :placeholder="'请选择所属'+item.levelName"
  232. placeholder-style="font-size:24rpx;line-height:40rpx"></textarea>
  233. <textarea v-else disabled auto-height v-model="checkAreaList[0][item.propName]"
  234. :placeholder="'请选择所属'+item.levelName"
  235. placeholder-style="font-size:24rpx;line-height:40rpx"></textarea>
  236. <text class="iconfont2">&#xe65f;</text>
  237. </view>
  238. </picker>
  239. </view>
  240. <button v-if="dataForm && dataForm.service_package_area == 7 && areaLevel.length < 7"
  241. @click="addArea()" class="add-area">继续选择其它省</button>
  242. <view class="tip">
  243. 注意:请认证选择所属区域,选择和自身属地收益相关
  244. </view>
  245. <view class="btn-box">
  246. <button @click="closePopup()">取消</button>
  247. <button @click="submitByService()">继续购买</button>
  248. </view>
  249. </view>
  250. </scroll-view>
  251. </view>
  252. </uni-popup>
  253. </view>
  254. </template>
  255. <script>
  256. import uniPopup from "../../../components/uni-popup/uni-popup.vue";
  257. import comment from "../../../components/ld-comment/ld-comment.vue";
  258. import jyfParser from "../../../components/jyf-parser/jyf-parser";
  259. import share from "./../../public/share";
  260. import jVideo from "../../../components/j-video/j-video.vue"
  261. let app = getApp()
  262. export default {
  263. components: {
  264. uniPopup,
  265. comment,
  266. jyfParser,
  267. share,
  268. jVideo
  269. },
  270. data() {
  271. return {
  272. //手机状态栏高度
  273. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  274. config: {
  275. back: true, //false是tolbar页面 是则不写
  276. title: "商品详情",
  277. color: "#1a1a1a",
  278. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  279. backgroundColor: [1, '#ffffff'],
  280. // backTabPage: "",
  281. // leftSlot:true
  282. },
  283. imglist: [], //详情图片数组
  284. isChecked: 0,
  285. btnName: "",
  286. btnType: "", //0 购物车,1 立即购买
  287. dataForm: {}, //商品详情
  288. shop: {}, //店铺信息
  289. shopDiscounts: {}, //店铺首单优惠
  290. stock: 0,
  291. cover: "",
  292. loading: true,
  293. moDelPrice: "",
  294. moPrice: "",
  295. goodsSkuList: [], //sku组合值
  296. skuTab: [], //sku二位数组
  297. goods_id: null,
  298. limit_buy_num: 0,
  299. choseConfig: {},
  300. hasId: "",
  301. add_num: 1,
  302. goStatus: 0, //0:购物车,1下单
  303. shop_id: 0,
  304. commentList: [],
  305. goodsInfo: {},
  306. dataShopId: "",
  307. isvisible: false,
  308. isCollection: false, //是否收藏
  309. option: null,
  310. imgUrl: this.$mConfig.staticUrl,
  311. ispay: app.globalData.openPay,
  312. fromShare: false, // 是否分享过来的页面
  313. carNums: 0, // 购物车数量
  314. detail: null,
  315. // 省市区、街道、社区
  316. areaList: [
  317. [],
  318. [],
  319. [],
  320. [],
  321. []
  322. ],
  323. areaIndex: [0, 0, 0, 0, 0],
  324. checkAreaList: [{
  325. province_name: '',
  326. province_code: '',
  327. city_name: '',
  328. city_code: '',
  329. area_name: '',
  330. area_code: '',
  331. street_name: '',
  332. street_code: '',
  333. community_name: '',
  334. community_code: ''
  335. }],
  336. areaLevel: [] //省,市,区,街道,社区
  337. }
  338. },
  339. onShow() {
  340. var pages = getCurrentPages();
  341. var prevPage = pages[pages.length - 2];
  342. if (prevPage == undefined) {
  343. // this.config.backTabPage = "/pages/research/homepage/lidaPage";
  344. }
  345. if (uni.getStorageSync("apiToken")) {
  346. this.cartList()
  347. }
  348. },
  349. onLoad(options) {
  350. //店铺推荐(商品)
  351. this.option = options.id
  352. console.log('分类带过来的id' + this.option)
  353. console.log(options)
  354. if (options.id) {
  355. this.getDetailInfo(options.id);
  356. this.goodsDetail(options.id);
  357. this.loadComment(options.id);
  358. }
  359. if (options.shareId) {
  360. this.recordSave(options.shareId, options.id);
  361. }
  362. if (options.share == 1) {
  363. this.fromShare = true
  364. }
  365. this.getAreaList();
  366. },
  367. onShareAppMessage(res) {
  368. if (res.from === "button") {
  369. // 来自页面内分享按钮
  370. console.log(res.target);
  371. }
  372. return {
  373. title: this.shareTitle,
  374. imageUrl: this.shareImg,
  375. path: `/pages/product/goods/goods?id=${this.goodsId}&shopid=${this.shop_id}&share=1`,
  376. };
  377. },
  378. methods: {
  379. iconBtn() {
  380. if (this.fromShare) {
  381. uni.redirectTo({
  382. url: '/pages/index/home'
  383. });
  384. } else {
  385. uni.navigateBack();
  386. }
  387. },
  388. goLocal() {
  389. uni.openLocation({
  390. latitude: Number(this.shop.tx_latitude),
  391. longitude: Number(this.shop.tx_longitude),
  392. name: this.shop.name,
  393. address: this.shop.address,
  394. success: function() {
  395. console.log("success");
  396. },
  397. });
  398. console.log(this.shop)
  399. },
  400. // 购物车数量
  401. cartList() {
  402. let shop = uni.getStorageSync('shop')
  403. let nums = 0
  404. console.log(shop.id)
  405. this.$http.get(`/cart/list/` + shop.id)
  406. .then(res => {
  407. if (res && res.code == 200) {
  408. if (res.list.length > 0) {
  409. res.list.forEach(k => {
  410. k.flag = false
  411. nums += k.user_cart_list.length
  412. })
  413. this.carNums = nums
  414. } else {
  415. this.carNums = 0
  416. }
  417. }
  418. })
  419. },
  420. goShop() {
  421. uni.navigateTo({
  422. // url: "/pages/research/homepage/shopHomepage?shopId=" + this.shop_id,
  423. url: "/pages/convenienceService/shopDetails?shopId=" + this.shop_id
  424. });
  425. },
  426. recordSave(share_user_id, goods_id) {
  427. this.$http
  428. .post("/share/record/save", {
  429. share_user_id: share_user_id,
  430. goods_id: goods_id,
  431. })
  432. .then((res) => {});
  433. },
  434. collection() {
  435. let token = uni.getStorageSync("apiToken");
  436. if (!token) {
  437. uni.navigateTo({
  438. url: "/pages/login/index",
  439. });
  440. } else {
  441. if (this.isCollection) {
  442. this.$http
  443. .delete("/collect/goods/delete/" + this.dataForm.id)
  444. .then((res) => {
  445. if (res && res.code == 200) {
  446. this.isCollection = false;
  447. this.$mUtil.toast("取消收藏成功");
  448. } else {
  449. this.$mUtil.toast(res.msg);
  450. }
  451. });
  452. } else {
  453. this.$http
  454. .put("/collect/goods/save", {
  455. goods_id: this.dataForm.id
  456. })
  457. .then((res) => {
  458. if (res && res.code == 200) {
  459. this.isCollection = true;
  460. this.$mUtil.toast("收藏成功");
  461. } else {
  462. this.$mUtil.toast(res.msg);
  463. }
  464. });
  465. }
  466. }
  467. },
  468. share() {
  469. this.isvisible = false
  470. let token = uni.getStorageSync("apiToken");
  471. if (!token) {
  472. uni.navigateTo({
  473. url: "/pages/login/index",
  474. });
  475. } else {
  476. this.$http.get('/goods/info/' + this.option).then((res) => {
  477. if (res && res.code == 200) {
  478. if (res.data == null) {
  479. this.$mUtil.toast("该商品不存在")
  480. } else {
  481. let user = uni.getStorageSync("personal");
  482. this.dataForm = res.data;
  483. this.isvisible = true;
  484. this.$nextTick(() => {
  485. this.$refs.shares.shareInfo(
  486. "/?pageType=1&type=1&id=" + this.goodsId + "&shareId=" + user
  487. .id,
  488. 'pages/down',
  489. this.dataForm.title,
  490. "",
  491. this.dataForm.cover
  492. );
  493. });
  494. }
  495. }
  496. })
  497. }
  498. },
  499. // 获取主页数据
  500. getIndexList(shopid) {
  501. this.$http.get("/yxt/shop/info/" + shopid).then((res) => {
  502. uni.stopPullDownRefresh();
  503. this.loading = false;
  504. if (res.data && res.code == 200) {
  505. this.shop = res.data;
  506. }
  507. });
  508. },
  509. getByShop(id) {
  510. //店铺优惠查询
  511. this.$http.get("/marketing/firstOrder/getByShop/" + id).then((res) => {
  512. if (res && res.code == 200) {
  513. this.shopDiscounts = res.data;
  514. }
  515. });
  516. },
  517. getDetailInfo(id) {
  518. this.$http.get("/goods/info/" + id).then((res) => {
  519. this.loading = false;
  520. if (res && res.code == 200) {
  521. this.dataForm = res.data;
  522. this.goodsId = res.data.id;
  523. this.imglist = res.data.images;
  524. this.shareImg = res.data.cover;
  525. this.shareTitle = res.data.title;
  526. this.dataShopId = res.data.shop_id;
  527. this.shop_id = res.data.shop_id;
  528. this.getByShop(this.dataShopId);
  529. this.getIndexList(this.dataShopId);
  530. }
  531. });
  532. let token = uni.getStorageSync("apiToken");
  533. if (token) {
  534. this.$http.get("/collect/goods/is-collect/" + id).then((res) => {
  535. if (res && res.code == 200) {
  536. this.isCollection = res.data;
  537. }
  538. });
  539. }
  540. },
  541. goTocart() {
  542. uni.navigateTo({
  543. url: "/pages/index/shop",
  544. });
  545. },
  546. //点击拼团更多
  547. goGb() {
  548. this.$refs.gbOpen.open();
  549. },
  550. //点击关闭
  551. gbClose() {
  552. this.$refs.gbOpen.close();
  553. },
  554. //评论,商品详情切换
  555. change(i) {
  556. this.isChecked = i;
  557. },
  558. //点购物车,立即购买
  559. buy(i, id) {
  560. // 【普通商品】才能加入购物车,【1服务体系礼包,2新人惠选区,3公益申领】不能加入购物车
  561. // if (i == 0 && (!this.dataForm || this.dataForm.area_feature != 1)) {
  562. // uni.showToast({
  563. // icon: 'none',
  564. // title: '该商品不可加入购物车'
  565. // })
  566. // return false;
  567. // }
  568. this.btnType = i;
  569. this.checkSku(id);
  570. if (i == 0) {
  571. this.btnName = "加入购物车";
  572. } else {
  573. this.btnName = "立即购买";
  574. }
  575. },
  576. // 减数量
  577. resNum() {
  578. if (this.add_num > 1) {
  579. this.add_num--;
  580. }
  581. },
  582. //加数量
  583. addNum() {
  584. this.add_num++;
  585. },
  586. chonseSku(index, id) {
  587. this.skuTab[index].values.forEach((res) => {
  588. res.flag = false;
  589. if (res.id == id) {
  590. res.flag = true;
  591. }
  592. });
  593. let choseId = [];
  594. this.skuTab.forEach((res) => {
  595. res.values.forEach((Key) => {
  596. if (Key.flag) {
  597. choseId.push(Key.id);
  598. }
  599. });
  600. });
  601. let totalId = choseId.sort().join("|");
  602. this.hasId = totalId;
  603. this.goodsSkuList.forEach((res) => {
  604. if (res.sku_hash_code == totalId) {
  605. this.choseConfig = res;
  606. this.stock = res.able_stock;
  607. this.able_stock = res.able_stock;
  608. }
  609. });
  610. console.log(this.goodsSkuList)
  611. console.log('goodsSkuList')
  612. },
  613. //查询sku
  614. checkSku(id) {
  615. this.$http.get(`/goods/skus/${this.shop_id}/${id}`).then((res) => {
  616. this.loading = false;
  617. if (res && res.code == 200) {
  618. // this.choseConfig = {};
  619. this.hasId = ''
  620. res.data.goods.sku_table.forEach((keys) => {
  621. keys.values.forEach((val) => {
  622. val.flag = false;
  623. });
  624. });
  625. this.limit_buy_num = res.data.goods.limit_buy_num;
  626. this.goods_id = res.data.goods.id;
  627. this.goodsSkuList = res.data.goods_sku_list;
  628. this.moPrice = res.data.goods.min_sale_price;
  629. this.moDelPrice = res.data.goods.max_sale_price;
  630. this.cover = res.data.goods.cover;
  631. this.stock = res.data.total_stock;
  632. if (res.data.goods_auth) {
  633. if (res.data.goods_auth.added) {
  634. this.$refs.specOpen.open();
  635. } else {
  636. this.$mUtil.toast("该商品已经下架");
  637. }
  638. } else {
  639. this.$mUtil.toast("没有经营权限");
  640. }
  641. //只有没数据才去重新渲染sku的数据
  642. if (this.skuTab.length == 0) {
  643. this.skuTab = res.data.goods.sku_table;
  644. for (let i in this.skuTab) {
  645. //默认选中第一个可选项
  646. this.skuTab[i].values[0].flag = true;
  647. }
  648. //显示选中的sku信息
  649. // this.chonseSku(0, this.skuTab[0].values[0].id);
  650. }
  651. //显示选中的sku信息
  652. this.chonseSku(0, this.skuTab[0].values[0].id);
  653. console.log(this.skuTab)
  654. console.log('skuTab')
  655. // if(res.data.goods.sku_table.length>0){
  656. // this.$refs.specOpen.open()
  657. // }else{
  658. // this.hasId = ''
  659. // this.btnBuy()
  660. // }
  661. }
  662. });
  663. },
  664. //关闭规格弹窗
  665. specOpenClose() {
  666. this.$refs.specOpen.close();
  667. },
  668. //加入购物车
  669. btnBuys() {
  670. // 判断是否选中sku
  671. if (this.skuTab.length > 0 && this.hasId.split('|').length < this.skuTab.length) {
  672. this.$mUtil.toast("请选中分类");
  673. return false;
  674. }
  675. // 判断限购
  676. if (this.add_num > this.limit_buy_num && this.limit_buy_num != 0) {
  677. this.$mUtil.toast("商品限购" + this.limit_buy_num + "件");
  678. return false;
  679. }
  680. //判断库存
  681. if (this.goodsSkuList.length > 0 && this.able_stock < this.add_num) {
  682. this.$mUtil.toast("商品库存只有" + this.able_stock + "件");
  683. this.$http.post(`/singlegoods/understockrecord/save`, {
  684. shop_id: this.shop_id,
  685. goods_id: this.goods_id,
  686. single_goods_id: this.choseConfig.single_goods_id,
  687. sku_set_name: this.choseConfig.sku_set_name,
  688. buy_num: this.add_num
  689. }).then((res) => {
  690. });
  691. return false;
  692. }
  693. if (this.goStatus == 0) {
  694. let data = {
  695. goods_id: this.goods_id,
  696. sku_hash_code: this.hasId,
  697. add_num: this.add_num,
  698. source_shop_id: this.shop_id.toString(),
  699. };
  700. this.$http.post(`/cart/add`, data).then((res) => {
  701. if (res && res.code == 200) {
  702. this.$mUtil.toast("添加成功");
  703. this.$refs.specOpen.close();
  704. this.choseConfig = {};
  705. this.add_num = 1;
  706. this.cartList();
  707. }
  708. });
  709. } else {
  710. this.psotJson();
  711. //如果是“服务体系商品”
  712. // if (this.dataForm.area_feature == 1 && this.dataForm.service_package_area != 1) {
  713. // if (this.dataForm.service_package_area != 7) {
  714. // switch (this.dataForm.service_package_area) {
  715. // case 6:
  716. // this.areaLevel = [{
  717. // levelName: '省',
  718. // propName: 'province_name',
  719. // propValue: 'province_code'
  720. // }];
  721. // break;
  722. // case 5:
  723. // this.areaLevel = [{
  724. // levelName: '省',
  725. // propName: 'province_name',
  726. // propValue: 'province_code'
  727. // }, {
  728. // levelName: '市',
  729. // propName: 'city_name',
  730. // propValue: 'city_code'
  731. // }];
  732. // break;
  733. // case 4:
  734. // this.areaLevel = [{
  735. // levelName: '省',
  736. // propName: 'province_name',
  737. // propValue: 'province_code'
  738. // }, {
  739. // levelName: '市',
  740. // propName: 'city_name',
  741. // propValue: 'city_code'
  742. // }, {
  743. // levelName: '区',
  744. // propName: 'area_name',
  745. // propValue: 'area_code'
  746. // }];
  747. // break;
  748. // case 3:
  749. // this.areaLevel = [{
  750. // levelName: '省',
  751. // propName: 'province_name',
  752. // propValue: 'province_code'
  753. // }, {
  754. // levelName: '市',
  755. // propName: 'city_name',
  756. // propValue: 'city_code'
  757. // }, {
  758. // levelName: '区',
  759. // propName: 'area_name',
  760. // propValue: 'area_code'
  761. // }, {
  762. // levelName: '街道',
  763. // propName: 'street_name',
  764. // propValue: 'street_code'
  765. // }];
  766. // break;
  767. // case 2:
  768. // this.areaLevel = [{
  769. // levelName: '省',
  770. // propName: 'province_name',
  771. // propValue: 'province_code'
  772. // }, {
  773. // levelName: '市',
  774. // propName: 'city_name',
  775. // propValue: 'city_code'
  776. // }, {
  777. // levelName: '区',
  778. // propName: 'area_name',
  779. // propValue: 'area_code'
  780. // }, {
  781. // levelName: '街道',
  782. // propName: 'street_name',
  783. // propValue: 'street_code'
  784. // }, {
  785. // levelName: '社区',
  786. // propName: 'community_name',
  787. // propValue: 'community_code'
  788. // }];
  789. // break;
  790. // }
  791. // this.submitPopup();
  792. // return;
  793. // } else {
  794. // this.areaLevel = this.checkAreaList.map(item => {
  795. // return {
  796. // levelName: '省',
  797. // propName: 'province_name',
  798. // propValue: 'province_code'
  799. // }
  800. // })
  801. // this.submitPopup();
  802. // return;
  803. // }
  804. // }
  805. }
  806. },
  807. //组合数据
  808. psotJson() {
  809. // this.loading = true;
  810. let dataJson = {};
  811. let childArr = [];
  812. let parendArr = [];
  813. // let shop = uni.getStorageSync('shop')
  814. // let shopid = shop.id ? shop.id : ''
  815. childArr.push({
  816. user_cart_id: 0,
  817. activity_goods_id: "0",
  818. goods_id: this.goods_id,
  819. num: this.add_num,
  820. sku_hash_code: this.hasId,
  821. });
  822. parendArr.push({
  823. shop_id: this.dataShopId,
  824. source_shop_id: this.shop_id,
  825. activity_id: 0, //活动id
  826. sponsor_activity_id: 0, //拼团id
  827. user_remark: "",
  828. items: childArr,
  829. });
  830. if (this.dataForm.service_package_area == 7) {
  831. let checkAreaList = this.checkAreaList.filter(item => {
  832. return !!item.province_code
  833. })
  834. this.checkAreaList = checkAreaList;
  835. }
  836. dataJson = {
  837. is_cart: false, //是否来源于购物车
  838. receipt_id: null,
  839. shipment_mode: 0, //0物流,1自提
  840. shop_orders: parendArr,
  841. marketing_type: 0, //0无活动,1秒杀,2拼团
  842. // service_system_goods: this.dataForm.area_feature == 1 ? true : undefined, // 是否是服务体系商品
  843. // service_package_area: this.dataForm.area_feature == 1 ? this.dataForm.service_package_area :
  844. // undefined, // 服务体系商品类型
  845. // select_areas: this.dataForm.area_feature == 1 ? this.checkAreaList : undefined,
  846. free: this.dataForm.free
  847. };
  848. uni.setStorageSync("dataJson", dataJson);
  849. //let originalPrice = this.dataForm.max_market_price // 原价
  850. //let zhe = ((this.dataForm.min_sale_price / this.dataForm.max_market_price) *10).toFixed(1) // 折扣
  851. uni.navigateTo({
  852. url: "../surePay/surePay",
  853. });
  854. // let shop = uni.getStorageSync('shop')
  855. // let shopid=shop.id?shop.id:''
  856. // this.loading = false;
  857. // this.$http.post(`/order/build`, dataJson).then(res => {
  858. // if (res && res.code == 200) {
  859. // uni.setStorageSync('sureData', res.data)
  860. // uni.navigateTo({
  861. // url: '../surePay/surePay'
  862. // })
  863. // }
  864. // })
  865. },
  866. //
  867. btnBuy(i) {
  868. this.goStatus = i;
  869. let token = uni.getStorageSync("apiToken");
  870. //判断是否微信授权登录(没有授权登录进wx-login,授权了但没有注册进login)
  871. if (!token) {
  872. uni.navigateTo({
  873. url: "/pages/login/index",
  874. });
  875. } else {
  876. this.btnBuys();
  877. }
  878. //0 购物车,1 立即购买
  879. },
  880. /**
  881. * 详情
  882. * */
  883. goodsDetail(id) {
  884. this.$http.get(`/goods/content/${id}`).then((res) => {
  885. if (res && res.code == 200) {
  886. this.goodsInfo = res.data;
  887. }
  888. });
  889. },
  890. /*评论*/
  891. loadComment(id) {
  892. this.$http
  893. .get(`/comment/orderGoods/getgoodscomments/${id}`)
  894. .then((res) => {
  895. if (res && res.code == 200) {
  896. this.commentList = res.list;
  897. }
  898. });
  899. },
  900. submitPopup() {
  901. this.$refs.submitPopup.open();
  902. },
  903. closePopup() {
  904. this.$refs.submitPopup.close();
  905. },
  906. //获取省市区、街道、社区
  907. getAreaList(parentCode = 100000, columnIndex = 0) {
  908. this.$http.get(`/cnarea/lbs-children/${parentCode}`, {}).then(res => {
  909. if (res && res.code == 200) {
  910. this.$set(this.areaList, columnIndex, res.list);
  911. }
  912. });
  913. },
  914. //地区选择
  915. areaChange(e, columnIndex) {
  916. let rowIndex = e.detail.value;
  917. let oldColumnIndex = this.areaIndex[columnIndex];
  918. this.areaIndex[columnIndex] = rowIndex;
  919. //非 “大区公司”等级
  920. if (this.dataForm.service_package_area != 7) {
  921. // 查询下级地区
  922. this.getAreaList(this.areaList[columnIndex][rowIndex].value, columnIndex * 1 + 1);
  923. //保存当前选择的数据,用于提交
  924. this.checkAreaList[0][this.areaLevel[columnIndex].propName] = this.areaList[columnIndex][rowIndex]
  925. .label;
  926. this.checkAreaList[0][this.areaLevel[columnIndex].propValue] = this.areaList[columnIndex][rowIndex]
  927. .value;
  928. // 重置选择的下级地区的值
  929. if (oldColumnIndex != rowIndex) {
  930. let props = ['province', 'city', 'area', 'street', 'community'] // 重置选择的下级列表的值
  931. let preName = this.areaLevel[columnIndex].propName.split('_name')[0]; //属性名前缀
  932. let startIndex = props.indexOf(preName);
  933. for (let i = startIndex; i < props.length; i++) {
  934. if (i > startIndex) {
  935. this.checkAreaList[0][props[i] + '_name'] = '';
  936. this.checkAreaList[0][props[i] + '_code'] = '';
  937. }
  938. }
  939. }
  940. } else {
  941. this.$set(this.areaList, columnIndex * 1 + 1, this.areaList[0]);
  942. this.checkAreaList[columnIndex][this.areaLevel[columnIndex].propName] = this.areaList[columnIndex][
  943. rowIndex
  944. ].label;
  945. this.checkAreaList[columnIndex][this.areaLevel[columnIndex].propValue] = this.areaList[columnIndex][
  946. rowIndex
  947. ].value;
  948. }
  949. },
  950. // 校验地区选择
  951. valArea() {
  952. let length = 0;
  953. let error = '';
  954. for (let i in this.areaLevel) {
  955. if (!this.checkAreaList[0][this.areaLevel[i].propValue]) {
  956. error = '请选择' + this.areaLevel[i].levelName;
  957. break;
  958. }
  959. }
  960. return error;
  961. },
  962. //来自“服务体系礼包”的购买
  963. submitByService() {
  964. let error = this.valArea();
  965. if (error) {
  966. uni.showToast({
  967. icon: 'none',
  968. title: error
  969. })
  970. } else {
  971. this.closePopup();
  972. this.psotJson();
  973. }
  974. },
  975. addArea() {
  976. this.checkAreaList.push({
  977. province_name: '',
  978. province_code: '',
  979. city_name: '',
  980. city_code: '',
  981. area_name: '',
  982. area_code: '',
  983. street_name: '',
  984. street_code: '',
  985. community_name: '',
  986. community_code: ''
  987. });
  988. this.areaLevel.push({
  989. levelName: '省',
  990. propName: 'province_name',
  991. propValue: 'province_code'
  992. });
  993. this.$set(this.areaList, this.checkAreaList.length - 1, this.areaList[0]);
  994. }
  995. }
  996. }
  997. </script>
  998. <style lang="scss">
  999. @font-face {
  1000. font-family: 'hxicon';
  1001. /* project id 2009392 */
  1002. src: url(data:font/truetype;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzI8vEjdAAABfAAAAFZjbWFwt08gwQAAAggAAAJKZ2x5ZqU14o0AAARwAAAH3GhlYWQZ4AolAAAA4AAAADZoaGVhB94DjgAAALwAAAAkaG10eDQAAAAAAAHUAAAANGxvY2ELTA28AAAEVAAAABxtYXhwARsA0wAAARgAAAAgbmFtZbuddLgAAAxMAAACVXBvc3RDGZ0IAAAOpAAAAKEAAQAAA4D/gABcBAAAAAAABAAAAQAAAAAAAAAAAAAAAAAAAA0AAQAAAAEAAAgLkC9fDzz1AAsEAAAAAADbYGMVAAAAANtgYxUAAP+8BAADQgAAAAgAAgAAAAAAAAABAAAADQDHAAQAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQQAAZAABQAIAokCzA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UAcgBhAHQAZQBkACAAYgB5ACAAcwB2AGcAMgB0AHQAZgAgAGYAcgBvAG0AIABGAG8AbgB0AGUAbABsAG8AIABwAHIAbwBqAGUAYwB0AC4AaAB0AHQAcAA6AC8ALwBmAG8AbgB0AGUAbABsAG8ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0BAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgAFY2xvc2UJZmF2b3JmaWxsBWZhdm9yDGxvY2F0aW9uZmlsbAhsb2NhdGlvbgZzZWFyY2gGdW5mb2xkCHNldHRpbmdzC2ZvcndhcmRmaWxsB2ZvcndhcmQEYmFjawVyaWdodAAAAAAA) format('truetype');
  1003. }
  1004. @font-face {
  1005. font-family: 'iconfont';
  1006. /* project id 2070236 */
  1007. src: url('//at.alicdn.com/t/font_2070236_id1ac7qapa.eot');
  1008. src: url('//at.alicdn.com/t/font_2070236_id1ac7qapa.eot?#iefix') format('embedded-opentype'),
  1009. url('//at.alicdn.com/t/font_2070236_id1ac7qapa.woff2') format('woff2'),
  1010. url('//at.alicdn.com/t/font_2070236_id1ac7qapa.woff') format('woff'),
  1011. url('//at.alicdn.com/t/font_2070236_id1ac7qapa.ttf') format('truetype'),
  1012. url('//at.alicdn.com/t/font_2070236_id1ac7qapa.svg#iconfont') format('svg');
  1013. }
  1014. .hxicon {
  1015. font-family: hxicon;
  1016. font-size: 20px;
  1017. font-style: normal;
  1018. /* #ifndef APP-PLUS-NVUE */
  1019. -webkit-font-smoothing: antialiased;
  1020. -webkit-text-stroke-width: 0.2px;
  1021. -moz-osx-font-smoothing: grayscale;
  1022. /* #endif */
  1023. }
  1024. .price-zhe {
  1025. display: flex;
  1026. align-items: baseline;
  1027. }
  1028. .slotBox {
  1029. position: fixed;
  1030. .back {
  1031. padding: 0 13rpx;
  1032. }
  1033. }
  1034. .love-color {
  1035. width: 36rpx;
  1036. height: 36rpx;
  1037. }
  1038. .tag {
  1039. display: inline-block;
  1040. padding: 0 10rpx;
  1041. height: 40rpx;
  1042. background: #ff0000;
  1043. border-radius: 10rpx 0px 10rpx 0px;
  1044. line-height: 40rpx;
  1045. text-align: center;
  1046. margin-right: 10rpx;
  1047. color: #fff;
  1048. font-size: 20rpx;
  1049. }
  1050. .collectionActive {
  1051. color: #ff0000;
  1052. // font-size: 45rpx;
  1053. transform: scale(1.2);
  1054. }
  1055. page {
  1056. background-color: #f5f5f5;
  1057. }
  1058. .pd24 {
  1059. padding: 24rpx;
  1060. }
  1061. .pd20 {
  1062. padding: 20rpx;
  1063. }
  1064. .pt20-pb14 {
  1065. padding-top: 20rpx;
  1066. padding-bottom: 14rpx;
  1067. }
  1068. .pt28-pb18 {
  1069. padding-top: 28rpx;
  1070. padding-bottom: 18rpx;
  1071. }
  1072. .pb30 {
  1073. padding-bottom: 30rpx;
  1074. }
  1075. .pb40 {
  1076. padding-bottom: 40rpx;
  1077. }
  1078. .pb50 {
  1079. padding-bottom: 50rpx;
  1080. }
  1081. .pt-pb30 {
  1082. padding-top: 30rpx;
  1083. padding-bottom: 30rpx;
  1084. }
  1085. .pt-pb35 {
  1086. padding-top: 35rpx;
  1087. padding-bottom: 35rpx;
  1088. }
  1089. .ml54 {
  1090. margin-left: 54rpx;
  1091. }
  1092. .ml138 {
  1093. margin-left: 138rpx;
  1094. }
  1095. .br-rd10 {
  1096. border-radius: 10rpx;
  1097. }
  1098. .br-rd20 {
  1099. border-radius: 20rpx;
  1100. }
  1101. .stb-btn {
  1102. padding: 8rpx 18rpx;
  1103. border-radius: 10rpx;
  1104. }
  1105. .br-FF0000 {
  1106. border: 1rpx solid #ff0000;
  1107. border-radius: 24rpx;
  1108. padding: 6rpx 12rpx;
  1109. }
  1110. .bg-FFF6EE {
  1111. background-color: #fff6ee;
  1112. }
  1113. .mt80 {
  1114. margin-top: 80rpx;
  1115. }
  1116. .product {
  1117. // padding-bottom: 150rpx;
  1118. }
  1119. .pic {
  1120. width: 100%;
  1121. position: relative;
  1122. .swiper {
  1123. // height: 620rpx;
  1124. height: 100vw;
  1125. video {
  1126. width: 100%;
  1127. // height: 620rpx;
  1128. height: 100vw;
  1129. }
  1130. image {
  1131. width: 100%;
  1132. // height: 620rpx;
  1133. height: 100vw;
  1134. }
  1135. }
  1136. .p-price {
  1137. z-index: 10;
  1138. width: 100%;
  1139. position: absolute;
  1140. // top: 620rpx;
  1141. top: 100vw;
  1142. background: #FA6138;
  1143. border-radius: 0rpx 0rpx 0px 0px;
  1144. .discount {
  1145. color: #ffffff;
  1146. }
  1147. }
  1148. }
  1149. .richText {
  1150. padding: 30rpx;
  1151. /deep/ img {
  1152. margin-top: 0 !important;
  1153. vertical-align: middle;
  1154. }
  1155. }
  1156. //秒杀,拼团样式
  1157. .p-ab {
  1158. position: absolute;
  1159. top: 448rpx;
  1160. }
  1161. .stb-list {
  1162. padding-bottom: 10rpx;
  1163. }
  1164. .triangle-bottomright {
  1165. width: 0;
  1166. height: 0;
  1167. border-bottom: 108rpx solid #dccda4;
  1168. border-left: 60rpx solid transparent;
  1169. }
  1170. .seckill {
  1171. background-color: #dccda4;
  1172. color: #FA6138;
  1173. padding: 16rpx;
  1174. padding-right: 28rpx;
  1175. border-radius: 5rpx 20rpx 0px 0px;
  1176. }
  1177. .seckill-btn {
  1178. width: 86%;
  1179. }
  1180. .br-284534 {
  1181. border-bottom: 1rpx solid rgba($color: #3775F6, $alpha: 0.3);
  1182. }
  1183. .gb-te {
  1184. padding-top: 20rpx;
  1185. padding-bottom: 15rpx;
  1186. }
  1187. .gb-btn {
  1188. padding: 18rpx 80rpx 8rpx;
  1189. line-height: 30rpx;
  1190. }
  1191. .btn-bg-dccda4 {
  1192. background: #dccda4;
  1193. border-radius: 48rpx 0rpx 0rpx 48rpx;
  1194. }
  1195. .btn-bg-00321E {
  1196. background: #FA6138;
  1197. border-radius: 0px 48px 48px 0px;
  1198. }
  1199. .tab {
  1200. position: sticky;
  1201. top: 0;
  1202. background-color: #fff;
  1203. padding-top: 38rpx;
  1204. z-index: 9;
  1205. .pb30 {
  1206. position: relative;
  1207. &::before {
  1208. content: '';
  1209. position: absolute;
  1210. left: 50%;
  1211. bottom: 0;
  1212. transform: translateX(-50%);
  1213. width: 0;
  1214. height: 2px;
  1215. background: #FA6138;
  1216. transition: all 0.3s;
  1217. }
  1218. &.active {
  1219. font-size: 30rpx;
  1220. color: #FA6138;
  1221. font-weight: 700;
  1222. &::before {
  1223. width: 100%;
  1224. }
  1225. }
  1226. }
  1227. }
  1228. .bottom-btn {
  1229. width: 100%;
  1230. position: fixed;
  1231. bottom: 0;
  1232. z-index: 9;
  1233. border-top: 1rpx solid #e6e6e6;
  1234. .leftbox {
  1235. display: flex;
  1236. align-items: center;
  1237. height: 84rpx;
  1238. .u-text-center {
  1239. margin-right: 20rpx;
  1240. }
  1241. }
  1242. .cart {
  1243. position: relative;
  1244. .car-icon {
  1245. position: relative;
  1246. .nums {
  1247. font-size: 20rpx;
  1248. color: #FFFFFF;
  1249. font-weight: 400;
  1250. padding: 4rpx;
  1251. height: 30rpx;
  1252. min-width: 30rpx;
  1253. line-height: 23rpx;
  1254. background-color: #FF0000;
  1255. border-radius: 15rpx;
  1256. position: absolute;
  1257. right: 5rpx;
  1258. top: -10rpx;
  1259. }
  1260. }
  1261. .number {
  1262. position: absolute;
  1263. top: -10rpx;
  1264. left: 45rpx;
  1265. padding: 4rpx 8rpx;
  1266. background-color: #ff0000;
  1267. border: 4rpx solid #ffffff;
  1268. border-radius: 40rpx;
  1269. }
  1270. }
  1271. .cart-btn {
  1272. width: 200rpx;
  1273. height: 85rpx;
  1274. line-height: 85rpx;
  1275. background: #FF9651;
  1276. color: white;
  1277. border-radius: 40rpx;
  1278. margin-right: 10rpx;
  1279. }
  1280. .buy-btn {
  1281. width: 200rpx;
  1282. height: 85rpx;
  1283. line-height: 85rpx;
  1284. background: #FA6138;
  1285. border-radius: 40rpx;
  1286. margin-left: 10rpx;
  1287. }
  1288. }
  1289. .flex-sb {
  1290. display: flex;
  1291. justify-content: space-between;
  1292. }
  1293. //弹窗
  1294. .spec {
  1295. border-radius: 18rpx 18rpx 0rpx 0rpx;
  1296. padding-top: 30rpx;
  1297. // max-height: 900rpx;
  1298. overflow-y: auto;
  1299. // padding-bottom: constant(safe-area-inset-bottom);
  1300. // padding-bottom: env(safe-area-inset-bottom);
  1301. .spec-item {
  1302. background-color: #f6f6f6;
  1303. border: 1px solid #f6f6f6;
  1304. padding: 12rpx 30rpx;
  1305. font-size: 24rpx;
  1306. color: #1a1a1a;
  1307. border-radius: 4px;
  1308. }
  1309. .activeColor {
  1310. background-color: #e1e6e3;
  1311. border: 1px solid #FA6138;
  1312. color: #FA6138;
  1313. border-radius: 4px;
  1314. }
  1315. .spec-item:not(:last-child) {
  1316. margin-right: 24rpx;
  1317. }
  1318. //减号
  1319. .minus {
  1320. width: 50rpx;
  1321. height: 50rpx;
  1322. line-height: 50rpx;
  1323. text-align: center;
  1324. background: #dedede;
  1325. border-radius: 8rpx 0rpx 0rpx 8rpx;
  1326. }
  1327. .num {
  1328. width: 74rpx;
  1329. height: 46rpx;
  1330. line-height: 46rpx;
  1331. text-align: center;
  1332. border: 1px solid #dedede;
  1333. }
  1334. //加号
  1335. .plus-sign {
  1336. width: 50rpx;
  1337. height: 50rpx;
  1338. line-height: 50rpx;
  1339. text-align: center;
  1340. background: #dedede;
  1341. border-radius: 0rpx 8rpx 8rpx 0rpx;
  1342. }
  1343. .specOpen-btn {
  1344. margin-top: 68rpx;
  1345. padding-bottom: 34rpx;
  1346. button {
  1347. background-color: #FA6138;
  1348. color: #ffffff;
  1349. }
  1350. }
  1351. }
  1352. .jvideo {
  1353. .playIcon {
  1354. width: 100rpx;
  1355. }
  1356. }
  1357. .tip-popup {
  1358. .content-box {
  1359. width: 690rpx;
  1360. .content {
  1361. height: 100%;
  1362. overflow: auto;
  1363. box-sizing: border-box;
  1364. background: white;
  1365. }
  1366. }
  1367. .check-tip {
  1368. font-size: 28rpx;
  1369. font-family: PingFang SC, PingFang SC-Regular;
  1370. font-weight: 400;
  1371. text-align: left;
  1372. color: #1a1a1a;
  1373. margin-bottom: 10rpx;
  1374. padding: 0 30rpx;
  1375. position: relative;
  1376. &.required {
  1377. &:before {
  1378. content: '*';
  1379. font-size: 32rpx;
  1380. font-family: PingFang SC, PingFang SC-Regular;
  1381. font-weight: 400;
  1382. text-align: left;
  1383. color: #ff0000;
  1384. vertical-align: middle;
  1385. margin-right: 2rpx;
  1386. }
  1387. }
  1388. }
  1389. .content {
  1390. .tip {
  1391. width: auto !important;
  1392. padding-left: 30rpx;
  1393. padding-right: 30rpx;
  1394. text-align: center;
  1395. }
  1396. .add-area {
  1397. width: 630rpx;
  1398. background: white;
  1399. color: #FA6138;
  1400. border: 1px dashed #3775F6;
  1401. height: 75rpx;
  1402. line-height: 75rpx;
  1403. font-size: 30rpx;
  1404. margin: 40rpx auto 60rpx auto;
  1405. border-radius: 20rpx;
  1406. }
  1407. }
  1408. }
  1409. .check-input {
  1410. display: flex;
  1411. justify-content: space-between;
  1412. align-items: center;
  1413. text-align: left;
  1414. background: #ffffff;
  1415. border-radius: 10px;
  1416. width: 630rpx;
  1417. min-height: 70rpx;
  1418. border: 1px solid #cccccc;
  1419. margin: 0 30rpx;
  1420. padding: 15rpx 21rpx;
  1421. margin-bottom: 25rpx;
  1422. }
  1423. </style>