goods_des_old.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781
  1. <template>
  2. <view class="pageBg">
  3. <!-- 商品图片 -->
  4. <!-- productImages -->
  5. <view class="goods_img_box">
  6. <swiper
  7. class="swiper"
  8. interval="5000"
  9. duration="500"
  10. autoplay="true"
  11. circular="true"
  12. :indicator-dots="base.productImages!==undefined&&base.productImages.length>1"
  13. indicator-color="#E5E5E5"
  14. indicator-active-color="#888888"
  15. >
  16. <block v-if="base.productImages!==undefined&&base.productImages.length>0">
  17. <swiper-item v-for="(item, index) in base.productImages" :key="index">
  18. <image class="image" mode="aspectFill" :src="item.large" @tap="roopHeadImage(item.large)"></image>
  19. </swiper-item>
  20. </block>
  21. <block v-else>
  22. <swiper-item><image class="image" mode="aspectFill" :src="base.thumbnail || 'http://139.9.103.171:1888/img/image/goods_def.png'"></image></swiper-item>
  23. </block>
  24. </swiper>
  25. </view>
  26. <!-- 商品信息 -->
  27. <view class="goods_info_box">
  28. <view class="flex bg-red padding-30">
  29. <text class="text-price text-lg">{{ base.price ? base.price : '' }}</text>
  30. <text class="textprice text-sm text-line-through">{{ base.marketPrice ? base.marketPrice : '' }}</text>
  31. </view>
  32. <!-- <view class="goods_price_share">
  33. <view class="price">
  34. <text class="sell_price">¥{{ base.price ? base.price : '' }}</text>
  35. <text class="original_price">¥{{ base.marketPrice ? base.marketPrice : '' }}</text>
  36. </view>
  37. <image class="share_icon_btn" @tap="shareDrawer" src="http://139.9.103.171:1888/img/image/share_icon.png" mode="widthFix"></image>
  38. <button class="share_icon_btn" @tap="shareDrawer"><image class="share_icon" src="http://139.9.103.171:1888/img/image/share_icon.png"></image></button>
  39. </view> -->
  40. <view class="goods_time_title">
  41. <text class="goods_title" selectable="true">{{ base.name ? base.name : '' }}</text>
  42. </view>
  43. <view class="goods_active">
  44. <!-- <view class="active_item">特价抢购</view>
  45. <view class="active_item">1元换购</view>
  46. <view class="active_item">包邮</view> -->
  47. </view>
  48. <view class="goods_des">{{ base.caption ? base.caption : '' }}</view>
  49. <view class="goods_inventory_sales">
  50. <!-- <text>月销量:{{ base.monthSales ? base.monthSales : 0 }}</text> -->
  51. <text v-if="true">库存:{{ defaultAvailableStock }}</text>
  52. </view>
  53. </view>
  54. <!-- 是否包邮 -->
  55. <view
  56. class="get_coupon"
  57. v-if="
  58. (base != null && base.promotion != null && base.promotion.freeShipping != null && base.promotion.freeShipping.isenabled) ||
  59. (moneyOffsList != null && moneyOffsList.length > 0)
  60. "
  61. >
  62. <view class="get_coupon_text">促销活动</view>
  63. <view class="coupon">
  64. <view class="coupon_list">
  65. <view class="coupon_item">包邮</view>
  66. <view class="coupon_list" v-for="(item, index) in moneyOffsList" :key="index">
  67. <!-- 统一处理方式 -->
  68. <view class="coupon_item" v-if="item.promotionNames.length > 0">{{ item.promotionNames }}</view>
  69. <!-- <view class="coupon_item" v-if="item.discounttype == 0">满{{item.minprice}}减{{item.discounvalue}}</view> -->
  70. <!-- 固定价格 -->
  71. <!-- <view class="coupon_item" v-if="item.discounttype == 1">满{{item.minprice}}减{{item.discounvalue}}</view> -->
  72. <!-- 金额减免 -->
  73. <!-- <view class="coupon_item" v-if="item.discounttype == 2">{{item.minprice > 0 ? '满' + item.minprice : ''}} {{item.discounvalue}}折</view> -->
  74. <!-- 百分比减免 -->
  75. <!-- <view class="coupon_item" v-if="item.discounttype == 3">满{{item.minprice}}减{{item.discounvalue}}</view> -->
  76. <!-- 重复金额减免 -->
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 满减 -->
  82. <!-- <view class="get_coupon" v-if="">
  83. <view class="get_coupon_text">满减</view>
  84. <view class="coupon">
  85. <view class="coupon_list" v-for="(item,index) in moneyOffsList" :key="index">
  86. <view class="coupon_item">满{{item.minprice}}减{{item.discounvalue}}</view>
  87. </view>
  88. </view>
  89. </view> -->
  90. <!-- 赠品 -->
  91. <view class="get_coupon" v-if="giftsList != null && giftsList.length > 0">
  92. <view class="get_coupon_text">赠品</view>
  93. <view class="coupon">
  94. <view class="coupon_list" v-for="(item, index) in giftsList" :key="index">
  95. <view class="coupon_item">{{ item.name }}</view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 领取优惠券-->
  100. <view class="get_coupon" v-if="base.promotion&&base.promotion.coupon!==undefined&&couponList.length > 0">
  101. <view class="get_coupon_text">领取优惠券</view>
  102. <view class="coupon" @tap="showCouponBox">
  103. <view class="coupon_list">
  104. <view class="coupon_item">{{ base.promotion.coupon.name }}</view>
  105. </view>
  106. <image src="http://139.9.103.171:1888/img/image/arrow.png"></image>
  107. </view>
  108. </view>
  109. <!-- 保障 -->
  110. <view class="get_coupon" >
  111. <view class="get_coupon_text">保障</view>
  112. <view class="coupon">
  113. <view style="font-size: 20upx;margin-right: 20upx;">
  114. 24小时无理由退换货
  115. </view>
  116. </view>
  117. </view>
  118. <!-- 商品详细信息 -->
  119. <view class="goods_detail_info_box">
  120. <view class="goods_detail_tab">
  121. <view :class="['goods_tab_item', current == 0 ? 'good_tab_item_active' : '']" @tap="tapTabItem(0)">图文详情</view>
  122. <view :class="['goods_tab_item', current == 1 ? 'good_tab_item_active' : '']" @tap="tapTabItem(1)">商品参数</view>
  123. <view :class="['goods_tab_item', current == 2 ? 'good_tab_item_active' : '']" @tap="tapTabItem(2)">
  124. 商品评价
  125. <text v-if="reviewProdCount > 0">({{ reviewProdCount }})</text>
  126. </view>
  127. </view>
  128. <swiper class="tab_content" :current="current" duration="300" @change="switchTab" :style="{ height: swiper_height }">
  129. <swiper-item>
  130. <view id="start0"></view>
  131. <view class="tab1" v-if="info"><rich-text :nodes="info"></rich-text></view>
  132. <view class="no_data_wrap" v-else><DtNoData msg="暂无数据" /></view>
  133. <view id="end0"></view>
  134. </swiper-item>
  135. <swiper-item>
  136. <view id="start1"></view>
  137. <view class="tab2" v-if="introduction.length > 0">
  138. <view class="goods_params_list">
  139. <view class="goods_params_item" v-for="(item, index) in introduction" :key="index">
  140. <view class="goods_params_title">【{{ item.name }}】</view>
  141. <view class="goods_params_des">{{ item.value }}</view>
  142. </view>
  143. </view>
  144. <view class="check_btn" @tap="jumpmanual">查看完整说明书</view>
  145. </view>
  146. <view class="no_data_wrap" v-else><DtNoData msg="暂无数据" /></view>
  147. <view id="<end1></end1>"></view>
  148. </swiper-item>
  149. <swiper-item>
  150. <view id="start2"></view>
  151. <view class="tab3" v-if="reviewDatas.length > 0">
  152. <DtGoodsComment :dataList="reviewDatas" @tapImage="roopImageClick" />
  153. <view class="check_btn" @tap="moreGoodsComment">查看更多的评价</view>
  154. </view>
  155. <view class="no_data_wrap" v-else><DtNoData msg="暂无数据" /></view>
  156. <view id="end2"></view>
  157. </swiper-item>
  158. </swiper>
  159. </view>
  160. <!--推荐商品-->
  161. <view clsss="recommend" style="background:#F2F2F2">
  162. <DtRecommendWrap title="为您推荐" />
  163. <DtRecommendGoodsList :height="150" :dataList="recommendGoodsList" />
  164. </view>
  165. <!-- 工具栏 -->
  166. <view class="tool_height" :style="footSafe"></view>
  167. <view class="goods_sell_out_tip" v-if="!base.isMarketable">该商品正在补货中,先瞧瞧别的吧~</view>
  168. <view class="goods_tool" :style="footSafe">
  169. <view class="left">
  170. <button
  171. class="item item_btn"
  172. open-type="contact"
  173. session-from="weapp"
  174. :send-message-title="base.name"
  175. :send-message-path="'pages/goods_des?id=' + loadOptions.id"
  176. :show-message-card="true"
  177. >
  178. <image src="http://139.9.103.171:1888/img/image/service_concat_icon.png" style="margin-top: -10upx;"></image>
  179. <text>咨询</text>
  180. </button>
  181. <view class="item" @tap="setProductFavorite">
  182. <image src="http://139.9.103.171:1888/img/image/collection_success_icon.png" v-if="isFavorite"></image>
  183. <image src="http://139.9.103.171:1888/img/image/collection_icon.png" v-else></image>
  184. <text>收藏</text>
  185. </view>
  186. <view class="item shop_car" @tap="goToShopCar">
  187. <image src="http://139.9.103.171:1888/img/image/shop_icon.png"></image>
  188. <text>购物车</text>
  189. <view class="tip_count" v-if="shopCartNum > 0">{{ shopCartNum }}</view>
  190. </view>
  191. </view>
  192. <view class="right">
  193. <view class="sell_out" v-if="!base.isMarketable">已售罄</view>
  194. <block v-else>
  195. <view class="item add_shop_car" @tap="joinShopCar">加入购物车</view>
  196. <view class="item buy" @tap="buyNow">{{ base.drugType == 'RX' ? '提交需求' : '立即购买' }}</view>
  197. <!-- <view class="item buy" @tap="buyNow">立即购买</view> -->
  198. </block>
  199. </view>
  200. </view>
  201. <FootGoodsBook
  202. ref="footBook"
  203. :number.sync="number"
  204. :specifications="specifications"
  205. :selectSpecificationValueMaps="selectSpecificationValueMaps"
  206. :base="base"
  207. :selectSkuItemObj="selectSkuItemObj"
  208. @selectsku="selectSku"
  209. @goodsnum="onGoodsNumChange"
  210. @goodsnumblur="blurInputNumber"
  211. @confirm="confirmAddOrBuy"
  212. />
  213. <view v-if="showDistributorCoupon" class="drawer_screen" ></view>
  214. <view v-if="showDistributorCoupon" style="padding: 40upx;width: 400upx;height: 400upx;position: fixed;top: 0;left: 0;right: 0;bottom: 0; margin: auto;background-color: #fc7700;z-index: 10000;border-radius: 20upx;">
  215. <image src="http://139.9.103.171:1888/img/image/close2.png" style="width: 50upx;position: absolute;top: -100upx;right: 0;" mode="widthFix" @tap="showDistributorCoupon=false"></image>
  216. <view style="color: #fff;text-align: center;margin-bottom: 20upx;font-size: 34upx;">恭喜您获得优惠券</view>
  217. <view style="display: flex;position: relative;">
  218. <image src="http://139.9.103.171:1888/img/image/coupon_img_white.png" style="width: 100%;display: block;" mode="widthFix"></image>
  219. <view style="position: absolute;top:0;left:0;right:0;padding: 20upx;display: flex;justify-content: space-between;">
  220. <view>
  221. <view style="font-size: 28upx;line-height: 60upx;">{{distributorCoupon.name}}</view>
  222. <view style="font-size: 20upx;color: gray;line-height: 60upx;">{{distributorCoupon.beginDate}}-{{distributorCoupon.endDate}}</view>
  223. </view>
  224. <view style="margin-right: 20upx;">
  225. <view style="color: red;font-size: 32upx;line-height: 60upx;">¥{{distributorCoupon.amt}}</view>
  226. <view style="font-size: 22upx;color: gray;line-height: 60upx;">{{distributorCoupon.type}}</view>
  227. </view>
  228. </view>
  229. </view>
  230. <button @tap="onRecieve(distributorCoupon)" style="border-radius: 25px;line-height: 80upx;margin-top: 90upx;text-align: center;background-color: #fed116;color: #fc7700;">立即领取</button>
  231. </view>
  232. <!-- 产品优惠券列表 -->
  233. <FootGoodsCoupon ref="footCoupon" :dataList="couponList" @visible="onVisible" @receive="onRecieve" />
  234. <!-- 使用animation属性指定需要执行的动画 -->
  235. <view class="drawer_screen" @tap="closeDrawer" v-if="bg"></view>
  236. <view :animation="animationData" class="drawer_attr_box" v-if="sharediv">
  237. <view class="drawer_content">
  238. <button open-type="share" class="btn">发送给好友</button>
  239. <button @tap="showPoster" class="btn">生成海报</button>
  240. <button @tap="closeDrawer" class="btn detail-cancel-btn">取消</button>
  241. </view>
  242. </view>
  243. <!-- 生成二维码 -->
  244. <tki-qrcode ref="tki_qrcode" :qrval="qrval" @onQrPath="onQrPath"></tki-qrcode>
  245. <!-- 生成海报 -->
  246. <cover-view class="imagePathBox" :hidden="maskHidden == false" v-if="maskHidden">
  247. <cover-view class="shengcheng">
  248. <cover-image src="http://139.9.103.171:1888/img/image/close2.png" class="shareClose" @tap="closePoster"></cover-image>
  249. <cover-image v-if="imagePosterPath" :src="imagePosterPath" class="shengcheng" mode="aspectFill"></cover-image>
  250. </cover-view>
  251. <button class="save" @tap="picdown">保存图片</button>
  252. </cover-view>
  253. <cover-view :hidden="maskHidden == false" class="mask"></cover-view>
  254. <DtPoster ref="dtPoster" id="poster" :config="posterConfig" @success="onPosterSuccess" @fail="onPosterFail" />
  255. <DtLogin ref="dialogLogin" @signIn="onSignIn"/>
  256. </view>
  257. </template>
  258. <script>
  259. import DtGoodsComment from '../comps/dt_goods_comment.vue';
  260. import DtRecommendWrap from '../comps/dt_recommend_wrap.vue';
  261. import DtRecommendGoodsList from '../comps/dt_recommend_goods_list.vue';
  262. import DtNoData from '../comps/dt_no_data.vue';
  263. import DtPoster from '../comps/canvas/poster.vue';
  264. import DtLogin from '../comps/dt_login.vue';
  265. import FootGoodsCoupon from '../comps/foot_goods_coupon.vue';
  266. import FootGoodsBook from '../comps/foot_goods_book.vue';
  267. import tkiQrcode from '../comps/tki_qrcode.vue';
  268. export default {
  269. components: {
  270. DtGoodsComment,
  271. DtNoData,
  272. DtRecommendWrap,
  273. DtRecommendGoodsList,
  274. DtPoster,
  275. DtLogin,
  276. FootGoodsCoupon,
  277. FootGoodsBook,
  278. tkiQrcode
  279. },
  280. data() {
  281. return {
  282. isAutoHeight: true,
  283. selectedTab: 0,
  284. isLogin: false,
  285. imageURL:'http://139.9.103.171:1888/img/image/coupon_img_white.png',
  286. swiper_height: 0,
  287. space: '\xa0\xa0',
  288. isWaitShow: false,
  289. current: 0,
  290. content: '',
  291. showToastBox: false,
  292. bg: false,
  293. sharediv: false,
  294. animationData: '',
  295. posterConfig: {},
  296. imagePosterPath: '',
  297. maskHidden: false,
  298. isclick: false,
  299. reviewProdCount: 0,
  300. productId: 0,
  301. base: {},
  302. reviewDatas: [],
  303. couponList: [],
  304. moneyOffsList: [],
  305. giftsList: [],
  306. goodsDetailInfo: {},
  307. recommendGoodsList: [],
  308. defaultAvailableStock: 0,
  309. isFavorite: false, //是否收藏
  310. number: 1, //购买数量
  311. operationType: 1, //1添加购物车 2立即购买
  312. shopCartNum: 0, //购物车种类数量
  313. skus: [], //选中所有sku的不同情况数组
  314. specifications: [], //所有sku
  315. selectSpecificationValueMaps: {}, //选中sku
  316. selectSkuItemObj: {}, //选中sku对应的情况
  317. waitShow: false,
  318. manual: [],
  319. srcs: [],
  320. imgBox: [],
  321. inviteCode:null, //邀请码id (分销优惠券参数)
  322. showDistributorCoupon:false,
  323. distributorCoupon:null,
  324. qrval:'',
  325. };
  326. },
  327. computed: {
  328. footSafe() {
  329. return 'padding-bottom:' + this.safeAreaBottom + 'px';
  330. },
  331. info() {
  332. let info = this.goodsDetailInfo.info;
  333. if (!info) {
  334. return '';
  335. }
  336. info = info.replace(/style=\"(.*?)\"/gi, '').replace(/<img/g, '<img style="width:100%;"');
  337. return info;
  338. },
  339. introduction() {
  340. let entriesList = [];
  341. if (this.goodsDetailInfo.introduction && this.goodsDetailInfo.introduction.length > 0) {
  342. this.goodsDetailInfo.introduction.forEach(introduction => {
  343. introduction.entries.forEach(item => {
  344. entriesList.push(item);
  345. });
  346. });
  347. }
  348. this.manual = entriesList;
  349. return entriesList.slice(0, 5);
  350. }
  351. },
  352. methods: {
  353. //查看详情
  354. onVisible(ev, idx) {
  355. let couponList = this.couponList.slice(0);
  356. couponList[idx].isShowDetail = !couponList[idx].isShowDetail;
  357. console.log(330, couponList);
  358. this.$set(this, 'couponList', couponList);
  359. },
  360. // 领取优惠券
  361. async onRecieve(item) {
  362. console.log('get Voucher', item);
  363. let memberId = this.$auth.getMemberId();
  364. let resp = await this.$api.couponExchange({
  365. _isShowLoading: true,
  366. memberId: memberId,
  367. couponId: item.id
  368. });
  369. if (resp.result) {
  370. this.showDistributorCoupon = false;
  371. this.$dialog.success('领取成功');
  372. this.getCouponByProductId();
  373. } else {
  374. this.$dialog.error('领取失败');
  375. }
  376. },
  377. /**
  378. * 获取选中的sku对应的对象
  379. * @param {Object} selectSpecificationValueMaps
  380. * @return {Number} -1:组合不存在;1:选择成功;2:库存不足
  381. */
  382. selectSkusItem(selectSpecificationValueMaps) {
  383. let isSelectAll = this.isSelectAllSku(selectSpecificationValueMaps);
  384. if (!isSelectAll) return 1;
  385. let skuItemObjArr = [];
  386. for (let sku of this.skus) {
  387. let num = 0;
  388. for (let spc of sku.specificationValues) {
  389. for (let key in selectSpecificationValueMaps) {
  390. let item = selectSpecificationValueMaps[key];
  391. if (item.id + item.value == spc.id + spc.value) {
  392. num++;
  393. break;
  394. }
  395. }
  396. }
  397. if (num == sku.specificationValues.length) {
  398. if(sku.availableStock <= 0){
  399. return 2;
  400. }
  401. this.selectSkuItemObj = sku;
  402. this.number = sku.wholesaleNumStart;
  403. return 1;
  404. }
  405. }
  406. return -1;
  407. },
  408. selectSku(skuIndex, item) {
  409. if (this.skus != null && this.skus.length > 0) {
  410. let isOk = 0;
  411. for (let sku of this.skus) {
  412. if (sku.specificationValues != null && sku.specificationValues.length > 0) {
  413. for (let s of sku.specificationValues) {
  414. if (s.id + s.value == item.id + item.value) {
  415. let json = JSON.stringify(this.selectSpecificationValueMaps);
  416. let temp = JSON.parse(json);
  417. temp[skuIndex + ''] = { id: item.id, value: item.value };
  418. if(skuIndex == 0 && temp['1'] != null){
  419. this.selectSkuItemObj = {};
  420. this.selectSkuItemObj[skuIndex + ''] = { id: item.id, value: item.value };
  421. this.selectSpecificationValueMaps = {};
  422. this.selectSpecificationValueMaps[skuIndex + ''] = { id: item.id, value: item.value };
  423. this.number = 0;
  424. this.$forceUpdate();
  425. return;
  426. }
  427. isOk = this.selectSkusItem(temp);
  428. if (isOk == 1) {
  429. this.selectSpecificationValueMaps[skuIndex + ''] = { id: item.id, value: item.value };
  430. break;
  431. }else if(isOk == 2) break;
  432. }
  433. }
  434. }
  435. if (isOk > 0) break;
  436. }
  437. if (isOk == -1) uni.showToast({icon: 'none',title: '暂无此商品'});
  438. if (isOk == 2) uni.showToast({icon: 'none',title: '库存不足'});
  439. this.$forceUpdate();
  440. }
  441. },
  442. //是否选完sku的规格
  443. isSelectAllSku(maps) {
  444. if (maps == null) maps = this.selectSpecificationValueMaps;
  445. let length = 0;
  446. for (let key in maps) {
  447. if (maps[key] != null) length++;
  448. }
  449. return length == this.specifications.length;
  450. },
  451. async confirmAddOrBuy() {
  452. if (!this.isSelectAllSku()) {
  453. this.$dialog.toast('请选择所有相关选项!');
  454. return;
  455. }
  456. this.$refs.footBook.hide();
  457. if (this.operationType == 1) {
  458. if (this.shopCartNum >= 100) {
  459. this.$dialog.toast('购物车已满');
  460. return;
  461. }
  462. let dataArr = [];
  463. let data = {};
  464. data.skuId = this.selectSkuItemObj.id;
  465. data.quantity = this.number;
  466. dataArr.push(data);
  467. let res = await this.$api.cartAdds(dataArr);
  468. this.$dialog.toast('添加购物车成功');
  469. this.cartKindCount();
  470. this.$util.refreshPage(['pages/shop_car']);
  471. }
  472. if (this.operationType == 2) {
  473. let data = {};
  474. data.skuId = this.selectSkuItemObj.id;
  475. data.quantity = this.number;
  476. let paramsStr = JSON.stringify(data);
  477. let isCanBuy = await this.$api.checkCartBuy(data);
  478. this.$refs.footBook.hide();
  479. if (isCanBuy) {
  480. let params = {
  481. params: paramsStr,
  482. flag: this.$global.orderFlag.normal
  483. };
  484. uni.navigateTo({
  485. url: '/pagesM/pages/order_confirm?' + this.$util.serialize(params)
  486. });
  487. }
  488. }
  489. this.closeToastBox();
  490. },
  491. //加入购物车
  492. joinShopCar() {
  493. let inviteCode = this.$auth.getInviteCode()
  494. if (!this.$auth.isAuth) {
  495. this.showLogin()
  496. return
  497. }else if(inviteCode!==null){//针对已登录情况
  498. this.showLogin();
  499. return
  500. }
  501. if (this.specifications.length == 0) {
  502. this.$dialog.toast('暂无规格可选');
  503. return;
  504. }
  505. // this.showToastBox = true;
  506. this.$refs.footBook.show();
  507. this.operationType = 1;
  508. },
  509. //立即购买
  510. buyNow() {
  511. let inviteCode = this.$auth.getInviteCode()
  512. if (!this.$auth.isAuth) {
  513. this.showLogin()
  514. return
  515. }else if(inviteCode!==null){//针对已登录情况
  516. this.showLogin();
  517. return
  518. }
  519. if (this.specifications.length == 0) {
  520. this.$dialog.toast('暂无规格可选');
  521. return;
  522. }
  523. // this.showToastBox = true;
  524. this.operationType = 2;
  525. this.$refs.footBook.show();
  526. },
  527. //跳转购物车
  528. goToShopCar() {
  529. console.log("111")
  530. uni.navigateTo({
  531. url:'/pagesM/pages/shop_car'
  532. })
  533. },
  534. //领取优惠券
  535. showCouponBox() {
  536. let inviteCode = this.$auth.getInviteCode()
  537. if (!this.$auth.isAuth) {
  538. this.showLogin()
  539. return
  540. }else if(inviteCode!==null){//针对已登录情况
  541. this.showLogin();
  542. return
  543. }
  544. // this.showCouponToastBox = true;
  545. // console.log(this.$refs)
  546. this.$refs.footCoupon.show();
  547. },
  548. //设置收藏
  549. async setProductFavorite() {
  550. let inviteCode = this.$auth.getInviteCode()
  551. if (!this.$auth.isAuth) {
  552. this.showLogin()
  553. return
  554. }else if(inviteCode!==null){//针对已登录情况
  555. this.showLogin();
  556. return
  557. }
  558. let data = {};
  559. data.productId = this.productId;
  560. data.memberId = this.$auth.getMemberId();
  561. let res = await this.$api.setProductFavorite(data);
  562. this.$util.refreshPage(['pages/mine_collection']);
  563. this.isFavorite = res.result;
  564. this.$dialog.toast(res.result ? '收藏成功' : '取消收藏');
  565. },
  566. switchTab(e) {
  567. this.current = e.detail.current;
  568. this.autoHeight();
  569. },
  570. tapTabItem(current) {
  571. this.current = current;
  572. },
  573. autoHeight() {
  574. if(!this.isAutoHeight) return;
  575. let current = this.current;
  576. let _this = this;
  577. uni.createSelectorQuery()
  578. .select('#end' + current)
  579. .boundingClientRect()
  580. .select('#start' + current)
  581. .boundingClientRect()
  582. .exec(rect => {
  583. let top1 = rect == null || rect[0] == null || rect[0].top == null ? 0 : rect[0].top;
  584. let top2 = rect == null || rect[1] == null || rect[1].top == null ? 0 : rect[1].top;
  585. let _space = Math.abs(top1 - top2);
  586. _space = _space === 0 ? '100%' : _space + 'px';
  587. const h = _this.swiper_height;
  588. if(_this.selectedTab != current){
  589. _this.selectedTab = current;
  590. _this.swiper_height = parseFloat(_space) < 500 ? '500px' : _space;
  591. }else if (parseFloat(_this.swiper_height) <= parseFloat(_space)) _this.swiper_height = _space;
  592. // Log.e(`================${_this.base.name}>>>h = ${h}; top1 = ${top1}; top2 = ${top2}; _space = ${_space}`);
  593. _this.$forceUpdate();
  594. setTimeout(() => {
  595. // _this.isAutoHeight = false;
  596. _this.autoHeight();
  597. }, 500);
  598. // if (h != _space) {
  599. // setTimeout(() => {
  600. // _this.isAutoHeight = parseFloat(h) < 500;
  601. // _this.autoHeight();
  602. // }, 400);
  603. // } else if (parseFloat(h) < 500) {
  604. // if (_this.isAutoHeight) {
  605. // setTimeout(() => {
  606. // _this.isAutoHeight = false;
  607. // _this.autoHeight();
  608. // }, 400);
  609. // }
  610. // }
  611. });
  612. },
  613. onGoodsNumChange(delta) {
  614. if (delta < 0) {
  615. if (this.number == 1) {
  616. return;
  617. }
  618. if (this.number <= this.selectSkuItemObj.wholesaleNumStart) {
  619. this.$dialog.toast('该商品起批量为' + this.selectSkuItemObj.wholesaleNumStart);
  620. return;
  621. }
  622. this.number--;
  623. } else {
  624. if (this.number >= this.selectSkuItemObj.purchaseLimit && this.selectSkuItemObj.purchaseLimit > 0) {
  625. return;
  626. }
  627. if (this.number >= this.selectSkuItemObj.availableStock) {
  628. this.$dialog.toast('该商品库存不足');
  629. return;
  630. }
  631. this.number++;
  632. }
  633. },
  634. lessAction() {
  635. if (this.number == 1) {
  636. return;
  637. }
  638. if (this.number <= this.selectSkuItemObj.wholesaleNumStart) {
  639. this.$dialog.toast('该商品起批量为' + this.selectSkuItemObj.wholesaleNumStart);
  640. return;
  641. }
  642. this.number--;
  643. },
  644. addAction() {
  645. if (this.number >= this.selectSkuItemObj.purchaseLimit && this.selectSkuItemObj.purchaseLimit > 0) {
  646. return;
  647. }
  648. if (this.number >= this.selectSkuItemObj.availableStock) {
  649. this.$dialog.toast('该商品库存不足');
  650. return;
  651. }
  652. this.number++;
  653. },
  654. blurInputNumber(e) {
  655. let number = e.detail.value ? e.detail.value : 1;
  656. if (this.selectSkuItemObj.wholesaleNumStart) {
  657. let wholesaleNumStart = this.selectSkuItemObj.wholesaleNumStart;
  658. let availableStock = this.selectSkuItemObj.availableStock;
  659. if (number < wholesaleNumStart) {
  660. this.number = wholesaleNumStart;
  661. this.$dialog.toast('该商品起批量为' + wholesaleNumStart);
  662. return;
  663. }
  664. if (number > availableStock) {
  665. this.number = wholesaleNumStart;
  666. this.$dialog.toast('该商品库存不足');
  667. return;
  668. }
  669. this.number = number;
  670. } else {
  671. this.number = number;
  672. }
  673. },
  674. closeToastBox() {
  675. this.showToastBox = false;
  676. },
  677. shareDrawer() {
  678. this.animationDrawer("open")
  679. // this.shareFriend();
  680. },
  681. closeDrawer() {
  682. this.isclick = false;
  683. this.animationDrawer('close');
  684. },
  685. shareFriend() {
  686. this.bg = false;
  687. this.sharediv = false;
  688. this.isclick = false;
  689. uni.showShareMenu({
  690. withShareTicket: true
  691. });
  692. },
  693. animationDrawer(currentStatu) {
  694. /* 动画部分 */
  695. // 第1步:创建动画实例
  696. var animation = wx.createAnimation({
  697. duration: 200, //动画时长
  698. timingFunction: 'linear', //线性
  699. delay: 0 //0则不延迟
  700. });
  701. // 第2步:这个动画实例赋给当前的动画实例
  702. this.animation = animation;
  703. // 第3步:执行第一组动画:Y轴偏移240px后(盒子高度是240px),停
  704. animation.translateY(240).step();
  705. // 第4步:导出动画对象赋给数据对象储存
  706. this.animationData = animation.export();
  707. // 第5步:设置定时器到指定时候后,执行第二组动画
  708. setTimeout(
  709. function() {
  710. // 执行第二组动画:Y轴不偏移,停
  711. animation.translateY(0).step();
  712. // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
  713. this.animationData = animation;
  714. //关闭抽屉
  715. if (currentStatu == 'close') {
  716. this.bg = false;
  717. this.sharediv = false;
  718. }
  719. }.bind(this),
  720. 200
  721. );
  722. // 显示抽屉
  723. if (currentStatu == 'open') {
  724. this.bg = true;
  725. this.sharediv = true;
  726. }
  727. },
  728. showPoster() {
  729. this.$u.toast('未开放')
  730. return
  731. if (this.isclick) {
  732. return;
  733. }
  734. this.isclick = true;
  735. // 获取页面path
  736. let pages = getCurrentPages(); //获取加载的页面
  737. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  738. let inviteCode = null;
  739. let resp = this.$auth.getMemberInfo();
  740. if(this.$auth.isPromoter(true)){
  741. inviteCode = this.$auth.getMemberId();
  742. }
  743. let path = `https://wap.lezhuapp.com/wapp/qrcode/`;
  744. let param = encodeURI(`type=share&id=${this.base.id}&storeId=${this.base.store.id}&path=${currentPage.route}&inviteCode=${inviteCode}`)
  745. this.qrval = path + param;
  746. this.$refs.tki_qrcode.ifQrcode()
  747. },
  748. onQrPath(res){
  749. console.log(res)
  750. this.drawPoster(res);
  751. },
  752. drawPoster(res) {
  753. this.$set(this, 'posterConfig', {
  754. width: 750,
  755. height: 1334,
  756. backgroundColor: '#ffffff',
  757. debug: true,
  758. pixelRatio: 2,
  759. preload: true,
  760. images: [
  761. {
  762. x: 35,
  763. y: 60,
  764. width: 680,
  765. height: 850,
  766. url: this.base.thumbnail || 'http://139.9.103.171:1888/img/image/goods_def.png',
  767. zIndex: 2
  768. },
  769. {
  770. x: 510,
  771. y: 1000,
  772. width: 200,
  773. height: 200,
  774. url: res,
  775. zIndex: 2,
  776. type:'qrcode'
  777. }
  778. ],
  779. texts: [
  780. {
  781. x: 35,
  782. y: 1000,
  783. text: this.base.name,
  784. fontSize: 30,
  785. color: '#333333',
  786. lineHeight: 50,
  787. lineNum: 3,
  788. textAlign: 'left',
  789. fontFamily: 'SourceHanSansRegular',
  790. zIndex: 11,
  791. width: 400
  792. },
  793. {
  794. x: 35,
  795. y: 1200,
  796. text: '¥' + this.base.price,
  797. fontSize: 60,
  798. color: '#D32222',
  799. lineHeight: 50,
  800. lineNum: 3,
  801. textAlign: 'left',
  802. fontFamily: 'SourceHanSansRegular',
  803. zIndex: 11,
  804. width: 400
  805. }
  806. ]
  807. });
  808. this.$nextTick(() => {
  809. this.$refs.dtPoster.onCreate();
  810. });
  811. },
  812. closePoster() {
  813. this.maskHidden = false;
  814. this.isclick = false;
  815. this.$refs.tki_qrcode.ifQrcode()
  816. },
  817. onPosterSuccess(path) {
  818. this.imagePosterPath = path;
  819. this.maskHidden = true;
  820. this.isclick = false;
  821. },
  822. onPosterFail(e) {
  823. this.isclick = false;
  824. },
  825. picdown() {
  826. uni.saveImageToPhotosAlbum({
  827. filePath: this.imagePosterPath,
  828. success: res => {
  829. console.log(res);
  830. this.$dialog.success('图片已保存到相册,赶紧晒一下吧');
  831. this.maskHidden = false;
  832. this.sharediv = false;
  833. this.bg = false;
  834. this.isclick = false;
  835. },
  836. fail: res => {
  837. if (res.errMsg == 'saveImageToPhotosAlbum:fail cancel') {
  838. return;
  839. }
  840. if (res.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
  841. this.$dialog.confirm({
  842. content: '需要使用保存图片或视频到系统相册功能,请确认授权打开',
  843. showCancel: false,
  844. success: confirmRes => {}
  845. });
  846. }
  847. }
  848. });
  849. },
  850. // 通过商品id获取优惠券列表
  851. async getCouponByProductId() {
  852. let memberId = this.$auth.getMemberId();
  853. let data = {};
  854. data.productId = this.base.id;
  855. data.memberId = memberId;
  856. let resp = await this.$api.getCouponByProductId(data);
  857. console.log(resp);
  858. this.couponList = resp;
  859. return resp;
  860. },
  861. //通过商品id获取分销优惠券列表
  862. async getDistributorCoupon(){
  863. let memberId = this.$auth.getMemberId();
  864. let data = {};
  865. data.productId = this.productId;
  866. // data.inviteCode = this.inviteCode;
  867. data.memberId = memberId;
  868. let resp = await this.$api.getDistributorCouponByProductId(data);
  869. if(JSON.stringify(resp) == '{}'||resp==''||resp==null||resp==undefined){return;}
  870. this.distributorCoupon = resp;
  871. this.distributorCoupon.beginDate = resp.beginDate.substr(0,10);
  872. this.distributorCoupon.endDate = resp.endDate.substr(0,10);
  873. this.showDistributorCoupon = true;
  874. },
  875. // 获取商品详情推荐商品
  876. async getRecommendProduct() {
  877. let data = {};
  878. data.productId = this.base.id;
  879. data.productCategoryId = this.base.productCategoryId;
  880. let resp = await this.$api.getRecommendProduct(data);
  881. this.recommendGoodsList = resp.store;
  882. return resp;
  883. },
  884. // 获取商品详情
  885. async findProductInfoById() {
  886. let memberId = this.$auth.getMemberId();
  887. let resp = await this.$api.findProductInfoById({
  888. _isShowLoading: true,
  889. productId: this.productId,
  890. memberId: memberId
  891. });
  892. console.log(502, resp);
  893. this.base = resp.base; // 基本信息
  894. let imgBox = [];
  895. for (let i = 0; i < this.base.productImages.length; i++) {
  896. imgBox.push(this.base.productImages[i].large);
  897. }
  898. this.imgBox = imgBox;
  899. this.skus = resp.base.skus.skus; //不同情况
  900. let specifications = resp.base.skus.specifications; //sku规格
  901. if (specifications != null && specifications.length > 0) {
  902. let isOk = false;
  903. for (var i = 0; i < specifications[0].entries.length; i++) {
  904. specifications[0].entries[i].isExit = false;
  905. for (let sku of this.skus) {
  906. if (sku.specificationValues != null && sku.specificationValues.length > 0) {
  907. for (let sv of sku.specificationValues) {
  908. if (specifications[0].entries[i].id == sv.id) {
  909. specifications[0].entries[i].isExit = true;
  910. break;
  911. }
  912. }
  913. }
  914. if (specifications[0].entries[i].isExit == true) break;
  915. }
  916. }
  917. }
  918. this.specifications = specifications;
  919. this.moneyOffsList = resp.base.promotion.moneyOffs;
  920. this.giftsList = resp.base.promotion.gifts;
  921. let defaultSkus = this.skus.filter(item => {
  922. return item.isDefault;
  923. });
  924. this.defaultAvailableStock = defaultSkus[0].availableStock;
  925. if (this.specifications.length == 0) {
  926. this.selectSkuItemObj = Object.assign({}, defaultSkus[0]);
  927. this.number = this.selectSkuItemObj.wholesaleNumStart;
  928. }
  929. this.shopCartNum = this.base.cartNum;
  930. this.number = this.base.wholesaleNumStart;
  931. this.isFavorite = this.base.isFavorite;
  932. this.goodsDetailInfo = resp;
  933. setTimeout(() => {
  934. this.autoHeight();
  935. }, 100);
  936. this.getRecommendProduct()
  937. this.getCouponByProductId()
  938. this.waitShow = true;
  939. return resp;
  940. },
  941. //获取购物车商品种类
  942. async cartKindCount() {
  943. let resp = await this.$api.cartKindCount();
  944. this.shopCartNum = resp.kindCount;
  945. },
  946. //获取评论
  947. async getReviewList() {
  948. let data = {};
  949. data.pageNo = 1;
  950. data.pageSize = 1;
  951. data.productId = this.productId;
  952. data.type = '';
  953. let res = await this.$api.getReviewList(data);
  954. console.log(res);
  955. let srcs = [];
  956. for (let i in res.datas) {
  957. res.datas[i].imageUrls = JSON.parse(res.datas[i].imageUrls);
  958. srcs = srcs.concat(res.datas[i].imageUrls);
  959. }
  960. this.srcs = srcs;
  961. this.reviewDatas = res.datas;
  962. return res;
  963. },
  964. roopHeadImage(img) {
  965. uni.previewImage({
  966. current: img, // 当前显示图片的http链接
  967. urls: this.imgBox // 需要预览的图片http链接列表
  968. });
  969. },
  970. roopImageClick(img) {
  971. uni.previewImage({
  972. current: img, // 当前显示图片的http链接
  973. urls: this.srcs // 需要预览的图片http链接列表
  974. });
  975. },
  976. //查看更多评价
  977. moreGoodsComment() {
  978. uni.navigateTo({
  979. url: '/pagesM/pages/goods_comment_list?productId=' + this.productId
  980. });
  981. },
  982. //查看说明书
  983. jumpmanual() {
  984. uni.navigateTo({
  985. url: '/pagesM/pages/goods_manual'
  986. });
  987. },
  988. showLogin() {
  989. this.$refs.dialogLogin.show();
  990. },
  991. onSignIn(resp) {
  992. this.$util.refreshPage(['pages/home', 'pages/shop_car', 'pages/mine']);
  993. this.onPullDownRefreshPage();
  994. },
  995. // 获取总数
  996. async reviewProductCount() {
  997. let resp = await this.$api.reviewProductCount({
  998. productId: this.productId
  999. });
  1000. this.reviewProdCount = resp;
  1001. return resp;
  1002. },
  1003. onLoadPage(options) {
  1004. wx.hideShareMenu();
  1005. this.productId = options.id ? options.id : 0;
  1006. let inviteCode = options.inviteCode? options.inviteCode:null;
  1007. this.$auth.setInviteCode(inviteCode);
  1008. this.findProductInfoById()
  1009. this.getReviewList()
  1010. this.reviewProductCount()
  1011. }
  1012. },
  1013. onShow() {
  1014. this.isAutoHeight = true;
  1015. this.autoHeight();
  1016. },
  1017. onLoad() {
  1018. wx.showShareMenu({
  1019. withShareTicket: true
  1020. })
  1021. },
  1022. onShareAppMessage(res) {
  1023. // if (res.from === 'button') {
  1024. let pages = getCurrentPages(); //获取加载的页面
  1025. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  1026. let inviteCode = null;
  1027. let resp = this.$auth.getMemberInfo();
  1028. if(this.$auth.isPromoter(true)){
  1029. inviteCode = this.$auth.getMemberId();
  1030. }
  1031. let path = `/pagesM/pages/home?type=share&id=${this.base.id}&storeId=${this.base.store.id}&path=${currentPage.route}&inviteCode=${inviteCode}`;
  1032. console.error('path = ' + path);
  1033. return {
  1034. title: this.base.name,
  1035. path: path,
  1036. success(res) {
  1037. // 转发成功
  1038. console.log('转发成功');
  1039. },
  1040. fail(res) {
  1041. // 转发失败
  1042. console.log('转发失败');
  1043. }
  1044. };
  1045. // }
  1046. },
  1047. onHide() {
  1048. this.isAutoHeight = false;
  1049. },
  1050. onUnload() {
  1051. this.isAutoHeight = false;
  1052. }
  1053. };
  1054. </script>
  1055. <style lang="scss" scoped>
  1056. .goods_img_box {
  1057. height: 750upx;
  1058. background: #fff;
  1059. .swiper {
  1060. height: 100%;
  1061. width: 100%;
  1062. image {
  1063. width: 100%;
  1064. height: 100%;
  1065. }
  1066. }
  1067. }
  1068. .goods_info_box {
  1069. padding-top: 20rpx;
  1070. display: flex;
  1071. flex-direction: column;
  1072. background: #fff;
  1073. .goods_price_share {
  1074. display: flex;
  1075. flex-direction: row;
  1076. justify-content: space-between;
  1077. align-items: center;
  1078. padding: 0 30upx;
  1079. .price {
  1080. flex: 1;
  1081. .sell_price {
  1082. color: #ee1515;
  1083. font-size: 48upx;
  1084. }
  1085. .original_price {
  1086. color: #999999;
  1087. font-size: 26upx;
  1088. text-decoration: line-through;
  1089. margin-left: 20upx;
  1090. }
  1091. }
  1092. .share_icon_btn {
  1093. width: 70upx;
  1094. height: 70upx;
  1095. // padding: 20upx 0;
  1096. // padding-left: 20upx;
  1097. .share_icon {
  1098. width: 70upx;
  1099. height: 70upx;
  1100. }
  1101. }
  1102. }
  1103. .goods_time_title {
  1104. display: flex;
  1105. flex-direction: row;
  1106. position: relative;
  1107. padding: 0 30upx;
  1108. word-wrap: break-all;
  1109. align-items: center;
  1110. .goods_title {
  1111. flex: 1;
  1112. font-size: 34upx;
  1113. color: #1b1414;
  1114. display: flex;
  1115. flex-direction: row;
  1116. align-items: center;
  1117. text-align: justify;
  1118. }
  1119. .goods_time {
  1120. position: absolute;
  1121. left: 30upx;
  1122. top: 6upx;
  1123. background: $dt-color-primary;
  1124. font-size: 18upx;
  1125. color: #fff;
  1126. border-radius: 4upx;
  1127. padding: 5upx 10upx;
  1128. height: 28upx;
  1129. display: flex;
  1130. align-items: center;
  1131. }
  1132. }
  1133. .goods_tip {
  1134. padding: 10upx 30upx;
  1135. font-size: 0.7rem;
  1136. color: #f04d0d;
  1137. }
  1138. .goods_active {
  1139. display: flex;
  1140. flex-direction: row;
  1141. align-items: center;
  1142. flex-wrap: wrap;
  1143. margin-top: 20upx;
  1144. padding: 0 30upx;
  1145. .active_item {
  1146. // border: 1upx solid #ee1515;
  1147. // border-radius: 4upx;
  1148. padding: 5upx 10upx;
  1149. color: #ee1515;
  1150. font-size: 20upx;
  1151. margin-right: 20upx;
  1152. position: relative;
  1153. margin-bottom: 10upx;
  1154. }
  1155. .active_item::after {
  1156. display: flex;
  1157. box-sizing: border-box;
  1158. align-items: center;
  1159. content: '';
  1160. position: absolute;
  1161. top: 0;
  1162. left: 0;
  1163. width: 200%;
  1164. height: 200%;
  1165. transform: scale(0.5);
  1166. transform-origin: 0 0;
  1167. border: 1upx solid #ee1515;
  1168. border-radius: 4upx;
  1169. pointer-events: none;
  1170. }
  1171. }
  1172. .goods_des {
  1173. color: #666;
  1174. font-size: 28upx;
  1175. padding: 10upx 30upx;
  1176. }
  1177. .goods_inventory_sales {
  1178. font-size: 24upx;
  1179. color: #999;
  1180. display: flex;
  1181. flex-direction: row;
  1182. align-items: center;
  1183. padding: 20upx 30upx;
  1184. border-top: 1upx solid #e5e5e5;
  1185. text {
  1186. width: 30%;
  1187. }
  1188. }
  1189. }
  1190. .get_coupon {
  1191. background: #fff;
  1192. padding: 20upx 30upx;
  1193. display: flex;
  1194. flex-direction: row;
  1195. align-items: center;
  1196. justify-content: space-between;
  1197. margin-top: 20upx;
  1198. .get_coupon_text {
  1199. color: #333;
  1200. font-size: 28upx;
  1201. }
  1202. .coupon {
  1203. display: flex;
  1204. flex-direction: row;
  1205. align-items: center;
  1206. .coupon_list {
  1207. display: flex;
  1208. flex-direction: row;
  1209. align-items: center;
  1210. color: #d32222;
  1211. font-size: 20upx;
  1212. .coupon_item {
  1213. position: relative;
  1214. padding: 10upx 20upx;
  1215. margin-right: 20upx;
  1216. }
  1217. .coupon_item::after {
  1218. display: flex;
  1219. box-sizing: border-box;
  1220. align-items: center;
  1221. content: '';
  1222. position: absolute;
  1223. top: 0;
  1224. left: 0;
  1225. width: 200%;
  1226. height: 200%;
  1227. transform: scale(0.5);
  1228. transform-origin: 0 0;
  1229. border: 1upx solid #ee1515;
  1230. border-radius: 4upx;
  1231. pointer-events: none;
  1232. }
  1233. }
  1234. image {
  1235. width: 10upx;
  1236. height: 18upx;
  1237. }
  1238. }
  1239. }
  1240. .goods_detail_info_box {
  1241. margin-top: 20upx;
  1242. background: #fff;
  1243. .goods_detail_tab {
  1244. display: flex;
  1245. flex-direction: row;
  1246. align-items: center;
  1247. justify-content: space-around;
  1248. padding: 0 30upx;
  1249. border-bottom: 1upx solid #e5e5e5;
  1250. .goods_tab_item {
  1251. flex: 1;
  1252. color: #666666;
  1253. font-size: 28upx;
  1254. padding: 20upx 0;
  1255. text-align: center;
  1256. }
  1257. .good_tab_item_active {
  1258. color: $dt-color-primary;
  1259. }
  1260. }
  1261. .tab_content {
  1262. .tab2 {
  1263. .goods_params_list {
  1264. display: flex;
  1265. flex-direction: column;
  1266. padding: 20upx 20upx 0 20upx;
  1267. .goods_params_item {
  1268. display: flex;
  1269. flex-direction: row;
  1270. margin-bottom: 30upx;
  1271. .goods_params_title {
  1272. color: #666666;
  1273. font-size: 28upx;
  1274. }
  1275. .goods_params_des {
  1276. flex: 1;
  1277. font-size: 28upx;
  1278. color: #333333;
  1279. }
  1280. }
  1281. }
  1282. .check_btn {
  1283. width: 600upx;
  1284. height: 60upx;
  1285. margin: 0 auto;
  1286. margin-bottom: 40upx;
  1287. line-height: 60upx;
  1288. text-align: center;
  1289. font-size: 26upx;
  1290. color: #666666;
  1291. border: 1upx solid #ccc;
  1292. }
  1293. }
  1294. .tab3 {
  1295. .check_btn {
  1296. width: 600upx;
  1297. height: 60upx;
  1298. margin: 0 auto;
  1299. margin-bottom: 40upx;
  1300. line-height: 60upx;
  1301. text-align: center;
  1302. font-size: 26upx;
  1303. color: #666666;
  1304. border: 1upx solid #ccc;
  1305. }
  1306. }
  1307. .no_data_wrap {
  1308. max-height: 300upx;
  1309. min-height: 300upx;
  1310. display: flex;
  1311. flex-direction: column;
  1312. align-items: center;
  1313. justify-content: center;
  1314. }
  1315. }
  1316. }
  1317. .tool_height {
  1318. height: 140upx;
  1319. }
  1320. .goods_tool {
  1321. display: flex;
  1322. height: 90upx;
  1323. position: fixed;
  1324. bottom: 0;
  1325. left: 0;
  1326. width: 100%;
  1327. background-color: #fff;
  1328. .left {
  1329. width: fit-content;
  1330. display: flex;
  1331. flex-direction: row;
  1332. align-items: center;
  1333. border-top: 1upx solid #ccc;
  1334. background: #fff;
  1335. box-sizing: border-box;
  1336. height: 100%;
  1337. button {
  1338. line-height: 1;
  1339. }
  1340. .item {
  1341. display: flex;
  1342. flex-direction: column;
  1343. align-items: center;
  1344. width: 110upx;
  1345. border-right: 1upx solid #ccc;
  1346. border-bottom: 1upx solid #ccc;
  1347. border-radius: 0;
  1348. box-sizing: border-box;
  1349. height: 100%;
  1350. justify-content: center;
  1351. image {
  1352. width: 35upx;
  1353. height: 35upx;
  1354. margin-bottom: 5upx;
  1355. }
  1356. text {
  1357. color: #666666;
  1358. font-size: 20upx;
  1359. }
  1360. }
  1361. .item:last-child {
  1362. border-right: none;
  1363. }
  1364. .shop_car {
  1365. position: relative;
  1366. .tip_count {
  1367. position: absolute;
  1368. right: 22upx;
  1369. top: 5rpx;
  1370. width: 24upx;
  1371. height: 24upx;
  1372. border-radius: 50%;
  1373. background-color: #ff3b30;
  1374. color: #fff;
  1375. font-size: 18upx;
  1376. text-align: center;
  1377. line-height: 24upx;
  1378. }
  1379. }
  1380. }
  1381. .right {
  1382. flex: 1;
  1383. display: flex;
  1384. flex-direction: row;
  1385. align-items: center;
  1386. .item {
  1387. width: 50%;
  1388. height: 90upx;
  1389. font-size: 30upx;
  1390. color: #fff;
  1391. display: flex;
  1392. align-items: center;
  1393. justify-content: center;
  1394. }
  1395. .add_shop_car {
  1396. background: orange;
  1397. }
  1398. .buy {
  1399. background: $dt-color-primary;
  1400. }
  1401. .sell_out {
  1402. width: 100%;
  1403. height: 90upx;
  1404. font-size: 30upx;
  1405. color: #fff;
  1406. display: flex;
  1407. align-items: center;
  1408. justify-content: center;
  1409. background: #cccccc;
  1410. }
  1411. }
  1412. }
  1413. .goods_sell_out_tip {
  1414. color: #ffffff;
  1415. font-size: 22upx;
  1416. background: rgba(0, 0, 0, 0.5);
  1417. position: fixed;
  1418. bottom: 90upx;
  1419. left: 0;
  1420. width: 100%;
  1421. text-align: center;
  1422. padding: 5upx 0;
  1423. }
  1424. .toast_box {
  1425. position: fixed;
  1426. height: 100%;
  1427. width: 100%;
  1428. z-index: 101;
  1429. left: 0;
  1430. bottom: 0upx;
  1431. background: rgba(0, 0, 0, 0.5);
  1432. display: flex;
  1433. flex-direction: column;
  1434. justify-content: space-between;
  1435. .toast_content {
  1436. background: white;
  1437. border-top-left-radius: 20upx;
  1438. border-top-right-radius: 20upx;
  1439. position: fixed;
  1440. width: 100%;
  1441. bottom: 0upx;
  1442. .goods_img_price_wrap {
  1443. display: flex;
  1444. flex-direction: row;
  1445. align-items: center;
  1446. padding: 30upx 0;
  1447. border-bottom: 1 solid #e5e5e5;
  1448. .goods_img {
  1449. height: 120upx;
  1450. width: 120upx;
  1451. padding-left: 30upx;
  1452. image {
  1453. width: 120upx;
  1454. height: 120upx;
  1455. }
  1456. }
  1457. .goods_price_box {
  1458. display: flex;
  1459. flex-direction: column;
  1460. justify-content: space-around;
  1461. height: 120upx;
  1462. padding-left: 28upx;
  1463. .price {
  1464. display: flex;
  1465. flex-direction: row;
  1466. align-items: center;
  1467. text {
  1468. padding-left: 10upx;
  1469. padding-top: 7upx;
  1470. font-size: 48upx;
  1471. color: #d32222;
  1472. }
  1473. }
  1474. .sku_params {
  1475. font-size: 24upx;
  1476. color: #999;
  1477. }
  1478. .count_num {
  1479. font-size: 24upx;
  1480. color: #999;
  1481. }
  1482. }
  1483. }
  1484. .goods-sku-list-wrap {
  1485. display: flex;
  1486. flex-direction: column;
  1487. .sku_item {
  1488. padding: 0 30upx;
  1489. .sku_name {
  1490. font-size: 24upx;
  1491. color: #333;
  1492. padding: 20upx 0upx;
  1493. }
  1494. .sku_value_box {
  1495. display: flex;
  1496. flex-wrap: wrap;
  1497. flex-direction: row;
  1498. text {
  1499. font-size: 26upx;
  1500. color: #333;
  1501. padding: 10upx 20upx;
  1502. margin-right: 15upx;
  1503. border: 2upx solid #ebebeb;
  1504. opacity: 0.6;
  1505. border-radius: 5px;
  1506. margin-bottom: 10upx;
  1507. }
  1508. .active {
  1509. background-color: $dt-color-primary;
  1510. border: 2upx solid $dt-color-primary;
  1511. color: #fff;
  1512. opacity: 1;
  1513. }
  1514. .disabled {
  1515. background-color: #e5e5e5;
  1516. color: #ccc;
  1517. opacity: 1;
  1518. }
  1519. }
  1520. }
  1521. }
  1522. .goods_num_select_wrap {
  1523. display: flex;
  1524. flex-direction: row;
  1525. justify-content: space-between;
  1526. align-items: center;
  1527. padding: 20upx 30upx 30upx 30upx;
  1528. .num_text {
  1529. font-size: 24upx;
  1530. color: rgb(51, 51, 51);
  1531. }
  1532. .number_select {
  1533. height: 50upx;
  1534. border-radius: 6upx;
  1535. border: 2upx solid #e5e5e5;
  1536. display: flex;
  1537. flex-direction: row;
  1538. align-items: center;
  1539. justify-content: space-around;
  1540. width: 200upx;
  1541. .number_change_less {
  1542. width: 60upx;
  1543. text-align: center;
  1544. border-right: 2upx solid #e5e5e5;
  1545. height: 100%;
  1546. line-height: 50upx;
  1547. font-size: 36upx;
  1548. }
  1549. .number_change_add {
  1550. width: 60upx;
  1551. text-align: center;
  1552. border-left: 2upx solid #e5e5e5;
  1553. height: 100%;
  1554. line-height: 50upx;
  1555. font-size: 36upx;
  1556. }
  1557. .goods_number {
  1558. width: 60upx;
  1559. padding: 0 10upx;
  1560. text-align: center;
  1561. font-size: 36upx;
  1562. color: #353535;
  1563. }
  1564. }
  1565. }
  1566. .comfirm_btn_box {
  1567. margin: 80upx 40upx;
  1568. button {
  1569. color: #fff;
  1570. border-radius: 6upx;
  1571. text-align: center;
  1572. background: $dt-color-primary;
  1573. }
  1574. }
  1575. .toastDelete {
  1576. position: absolute;
  1577. width: 30upx;
  1578. height: 30upx;
  1579. right: 10upx;
  1580. top: 0upx;
  1581. padding: 20upx;
  1582. }
  1583. }
  1584. .toast_coupon_content {
  1585. min-height: 800upx;
  1586. height: auto;
  1587. background: #f2f2f2;
  1588. position: fixed;
  1589. width: 100%;
  1590. bottom: 0upx;
  1591. border-top-left-radius: 20upx;
  1592. border-top-right-radius: 20upx;
  1593. .title {
  1594. color: #333333;
  1595. text-align: center;
  1596. font-size: 30upx;
  1597. height: 100upx;
  1598. line-height: 100upx;
  1599. background: #fff;
  1600. }
  1601. .coupon_wrap_list {
  1602. display: flex;
  1603. flex-direction: column;
  1604. align-items: center;
  1605. .coupon_height {
  1606. height: 20upx;
  1607. }
  1608. }
  1609. .toastDelete {
  1610. position: absolute;
  1611. width: 30upx;
  1612. height: 30upx;
  1613. right: 10upx;
  1614. top: 15upx;
  1615. padding: 20upx;
  1616. }
  1617. }
  1618. }
  1619. .drawer_screen {
  1620. width: 100%;
  1621. height: 100%;
  1622. position: fixed;
  1623. top: 0;
  1624. left: 0;
  1625. z-index: 1000;
  1626. background: #000;
  1627. opacity: 0.2;
  1628. overflow: hidden;
  1629. }
  1630. .drawer_attr_box {
  1631. width: 100%;
  1632. overflow: hidden;
  1633. position: fixed;
  1634. bottom: 0;
  1635. left: 0;
  1636. z-index: 1001;
  1637. background: rgb(242, 242, 242);
  1638. .drawer_content {
  1639. overflow-y: scroll;
  1640. .btn {
  1641. background: #fff;
  1642. font-size: 30upx;
  1643. color: rgb(51, 51, 51);
  1644. border-bottom: 1px solid #e8e8e8;
  1645. border-radius: 0;
  1646. padding: 14upx 0;
  1647. }
  1648. .btn::after {
  1649. border: none;
  1650. }
  1651. .detail-cancel-btn {
  1652. margin-top: 16upx;
  1653. }
  1654. }
  1655. }
  1656. .imagePathBox {
  1657. width: 100%;
  1658. height: 100%;
  1659. background: rgba(0, 0, 0, 0.7);
  1660. position: fixed;
  1661. top: 0;
  1662. left: 0;
  1663. right: 0;
  1664. bottom: 0;
  1665. z-index: 1200;
  1666. .save {
  1667. display: block;
  1668. width: 80%;
  1669. height: 80upx;
  1670. padding: 0;
  1671. line-height: 80upx;
  1672. text-align: center;
  1673. position: fixed;
  1674. z-index: 1200;
  1675. top: 1000upx;
  1676. left: 10%;
  1677. background: $dt-color-primary;
  1678. color: #fff;
  1679. font-size: 30upx;
  1680. border-radius: 10upx;
  1681. }
  1682. .save::after {
  1683. border: 0 !important;
  1684. }
  1685. }
  1686. .shengcheng {
  1687. width: 600upx;
  1688. height: 900upx;
  1689. position: fixed;
  1690. top: 100upx;
  1691. left: 50%;
  1692. z-index: 1200;
  1693. border-radius: 10upx;
  1694. transform: translate(-50%);
  1695. margin-top: -50upx;
  1696. .shareClose {
  1697. text-align: center;
  1698. position: fixed;
  1699. top: 60upx;
  1700. right: 10upx;
  1701. height: 46upx;
  1702. width: 46upx;
  1703. z-index: 1201;
  1704. }
  1705. }
  1706. </style>