index.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047
  1. <template>
  2. <view :style="viewColor">
  3. <view class="product-con">
  4. <view class="head-wrapper" id="home" :style="{ top: homeTop + 'rpx' }">
  5. <view class="head-menu">
  6. <view class='iconfont icon-fanhui2' @click="returns"></view>
  7. <view class="iconfont icon-gengduo5" @click="showNav"></view>
  8. </view>
  9. </view>
  10. <!-- 导航小图标 -->
  11. <view class="dialog_nav" v-show="currentPage" :style="{ top: navH + 'rpx' }">
  12. <view class="dialog_nav_item" :class="item.after" v-for="(item,index) in selectNavList" :key="index"
  13. @click="linkPage(item.url)">
  14. <text class="iconfont" :class="item.icon"></text>
  15. <text class="pl-20">{{item.name}}</text>
  16. </view>
  17. </view>
  18. <view>
  19. <scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true" :style='"height:"+height+"px;"'
  20. @scroll="scroll">
  21. <view id="past0">
  22. <!-- #ifdef MP || APP-PLUS -->
  23. <view :style="'width:100%;' + 'height:'+sysHeight + 'px'"></view>
  24. <!-- #endif -->
  25. <productConSwiper class="skeleton-rect" :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg" :videoline="storeInfo.video_link"></productConSwiper>
  26. <view v-if="storeInfo.atmosphere_pic" :style="{ backgroundImage: `url(${storeInfo.atmosphere_pic})` }" class="nav acea-row row-between-wrapper">
  27. <view class='money skeleton-rect'>
  28. <text class='num'>{{combinationInfo.price}}</text><text class="y-money">{{storeInfo.price}}</text>
  29. </view>
  30. </view>
  31. <view class='wrapper'>
  32. <view :class="{ atmosphere: storeInfo.atmosphere_pic }" class='share acea-row row-between row-bottom' style="padding: 0;margin: 0;">
  33. <view v-if="storeInfo.atmosphere_pic" class='introduce skeleton-rect'>
  34. <text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)" class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
  35. <text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red">自营</text>
  36. {{storeInfo.store_name}}
  37. </view>
  38. <view v-else class='money skeleton-rect' style="min-width: 10rpx;">
  39. <text class="p-color"><text class='num'>{{combinationInfo.price}}</text></text>
  40. <text class="font-gray orig_price"><text class='num' style="font-size: 28rpx;">{{storeInfo.price}}</text></text>
  41. </view>
  42. <view @click="listenerActionSheet" class="fenxiang_btn btn_one">
  43. <text class="iconfont icon-fenxiang4"></text><br/>分享
  44. </view>
  45. </view>
  46. <view v-if="!storeInfo.atmosphere_pic" class='introduce skeleton-rect'>
  47. <text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)" class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
  48. <text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red">自营</text>
  49. {{storeInfo.store_name}}
  50. </view>
  51. <view class='label acea-row row-between-wrapper'>
  52. <view class="skeleton-rect">类型:{{combinationInfo.buying_count_num ? combinationInfo.buying_count_num : 0}}人团</view>
  53. <view class="skeleton-rect">库存:{{combinationInfo.stock ? combinationInfo.stock : 0}}</view>
  54. <view class="skeleton-rect">已拼:{{combinationInfo.sales ? combinationInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}</view>
  55. </view>
  56. </view>
  57. <view class="combination_wrapper">
  58. <view class='notice acea-row row-middle' v-if="itemNew.length">
  59. <view class='num t-color'>
  60. <text class='iconfont icon-laba'></text>
  61. 已拼{{combinationInfo.sales ? combinationInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}<text
  62. class='line'>|</text>
  63. </view>
  64. <view class='swiper'>
  65. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500" vertical="true"
  66. circular="true">
  67. <block v-for="(item,index) in itemNew" :key='index'>
  68. <swiper-item>
  69. <view class='line1'>{{item.nickname ? item.nickname : ''}}拼团成功</view>
  70. </swiper-item>
  71. </block>
  72. </swiper>
  73. </view>
  74. </view>
  75. <view class='assemble' v-if="pink.length" :style="itemNew.length ? '' : 'margin-top: 20rpx;'">
  76. <view class='item acea-row row-between-wrapper skeleton-rect' v-for='(item,index) in pink' :key='index' v-if="index < AllIndex && pink.length>0">
  77. <view class='pictxt acea-row row-between-wrapper'>
  78. <view class='pictrue'>
  79. <image :src='item.initiator.avatar ? item.initiator.avatar : "/static/images/f.png"'></image>
  80. </view>
  81. <view class='text line1'>{{ item.initiator.nickname ? item.initiator.nickname : ""}}</view>
  82. </view>
  83. <view class='right acea-row row-middle'>
  84. <view>
  85. <view class='lack'>还差<text class='t-color'>{{item.buying_count_num - item.yet_buying_num}}</text>人成团</view>
  86. <view class='time'>
  87. 剩余
  88. <count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="':'"
  89. :minute-text="':'" :second-text="' '" :datatime="item.end_time"></count-down>
  90. </view>
  91. </view>
  92. <navigator hover-class='none' :url="'/pages/activity/combination_status/index?id='+item.group_buying_id" class='spellBnt'>
  93. 去拼单
  94. <text class='iconfont icon-jiantou'></text>
  95. </navigator>
  96. </view>
  97. </view>
  98. <template v-if="pink.length">
  99. <view class='more' @tap='showAll' v-if="pink.length > AllIndex">查看更多<text class='iconfont icon-xiangxia'></text></view>
  100. <view class='more' @tap='hideAll' v-else-if="pink.length === AllIndex && pink.length !== AllIndexDefault">收起<text
  101. class='iconfont icon-xiangshang'></text></view>
  102. </template>
  103. </view>
  104. <view class='playWay skeleton-rect'>
  105. <view class='title acea-row row-between-wrapper'>
  106. <view>拼团玩法</view>
  107. </view>
  108. <view class='way acea-row row-middle'>
  109. <view class='item'>
  110. <text class='num'></text>
  111. <text class="way_text">开团/参团</text>
  112. </view>
  113. <view class='iconfont icon-arrow'></view>
  114. <view class='item'>
  115. <text class='num'></text>
  116. <text class="way_text">邀请好友</text>
  117. </view>
  118. <view class='iconfont icon-arrow'></view>
  119. <view class='item'>
  120. <view>
  121. <text class='num'></text>
  122. <text class="way_text">满员发货</text>
  123. </view>
  124. <view class='tip'>不满自动退款</view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class='attribute acea-row row-between-wrapper skeleton-rect' @click="selecAttr">
  130. <view class='acea-row row-between-wrapper'>
  131. <text class="atterName">{{attrTxt}}</text>
  132. <text class='atterTxt'>{{attrValue}}</text>
  133. </view>
  134. <view class='iconfont icon-jiantou'></view>
  135. </view>
  136. <!--运费-->
  137. <view v-if="shipping || shippingValue" class='attribute acea-row row-between-wrapper' @click="showShip">
  138. <view class="acea-row row-between-wrapper">运费:
  139. <text class='atterTxt'>{{shippingValue}}</text>
  140. </view>
  141. <view class='iconfont icon-jiantou'></view>
  142. </view>
  143. <!--保障-->
  144. <view v-if="guarantee.length" class='attribute acea-row row-between-wrapper' @click="showGuaranee">
  145. <view class="acea-row row-between-wrapper">保障:
  146. <view class="guaranteeAttr">
  147. <text class='atterTxt1' :class="item.guarantee_name ? 'hasAttr' : ''" v-for="(item,index) in guarantee">
  148. {{item.guarantee_name ? item.guarantee_name : ''}}
  149. </text>
  150. </view>
  151. </view>
  152. <view class='iconfont icon-jiantou'></view>
  153. </view>
  154. <!--商品参数-->
  155. <view v-if="specsInfo.params && specsInfo.params.length>0" class="attribute acea-row row-between-wrapper" @click="seeSpecs">
  156. <view class="acea-row row-middle">
  157. 参数:
  158. <view class="list line1">
  159. <text class="item params" v-for="(item,index) in specsInfo.params" :key="index"
  160. v-if="index<2">{{item.name}}</text>
  161. <text>...</text>
  162. </view>
  163. </view>
  164. <view class="iconfont icon-jiantou"></view>
  165. </view>
  166. </view>
  167. <view class='userEvaluation' id="past1" v-if="replyCount && replyCount>0">
  168. <view class='title acea-row row-between-wrapper'>
  169. <view>用户评价({{replyCount}})</view>
  170. <navigator class='praise' hover-class='none' :url='"/pages/users/goods_comment_list/index?product_id="+storeInfo.product_id'>
  171. <text class='t-color'>{{replyChance}}</text>好评率
  172. <text class='iconfont icon-jiantou'></text>
  173. </navigator>
  174. </view>
  175. <block v-if="replyCount">
  176. <userEvaluation :reply="reply"></userEvaluation>
  177. </block>
  178. </view>
  179. <!-- 种草秀 -->
  180. <view class='userPlant' v-if="storeInfo.community && storeInfo.community.length>0">
  181. <view class='title acea-row row-between-wrapper'>
  182. <view>种草秀 </view>
  183. <navigator class='praise' hover-class='none' :url="'/pages/plantGrass/plant_show/index?spu_id='+storeInfo.spu_id">
  184. 查看全部
  185. <text class='iconfont icon-jiantou'></text>
  186. </navigator>
  187. </view>
  188. <view class="imgList acea-row">
  189. <navigator class="pictrue" v-for="(item, index) in storeInfo.community" :key="index" v-if="index<=2"
  190. hover-class='none' :url="'/pages/plantGrass/plant_detail/index?id='+item.community_id">
  191. <image :src="item.image[0]" class="image"></image>
  192. </navigator>
  193. </view>
  194. </view>
  195. <!-- 商铺信息 -->
  196. <view v-if="hide_mer_status == 0 && storeInfo.merchant" class="store-wrapper">
  197. <view class="store-hd skeleton-rect">
  198. <view class="store-info">
  199. <view class="logo">
  200. <image :src="storeInfo.merchant.mer_avatar" mode=""></image>
  201. </view>
  202. <navigator :url="'/pages/store/home/index?id='+storeInfo.mer_id" hover-class="none" class="info">
  203. <view class="name">{{storeInfo.merchant.mer_name}}
  204. <text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)" class="font-bg-red ml8">{{storeInfo.merchant.type_name}}</text>
  205. <text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red ml8">自营</text>
  206. </view>
  207. <view class="txt">
  208. {{storeInfo.merchant.care_count < 10000 ? storeInfo.merchant.care_count : (storeInfo.merchant.care_count/10000).toFixed(2)+'万'}}人关注
  209. </view>
  210. </navigator>
  211. <navigator :url="'/pages/store/home/index?id='+storeInfo.mer_id" class="link" hover-class="none">进店</navigator>
  212. </view>
  213. <view class="score-wrapper">
  214. <view class="item">
  215. 商品描述<text>{{storeInfo.merchant.product_score}}</text>
  216. </view>
  217. <view class="item">
  218. 卖家服务<text>{{storeInfo.merchant.service_score}}</text>
  219. </view>
  220. <view class="item">
  221. 物流服务<text>{{storeInfo.merchant.postage_score}}</text>
  222. </view>
  223. </view>
  224. </view>
  225. <view v-if="storeInfo.merchant.recommend && storeInfo.merchant.recommend.length > 0" class="con-box">
  226. <view class="title">店铺推荐</view>
  227. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
  228. <view class="img-box">
  229. <view class="img-item" v-for="(item,index) in storeInfo.merchant.recommend" :key="index" @click="goProDetail(item)">
  230. <image :src="item.image" mode=""></image>
  231. <view class="txt">
  232. <view class="title line1">{{item.store_name}}</view>
  233. <view class="price">
  234. <text></text>{{item.price}}
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. </scroll-view>
  240. </view>
  241. </view>
  242. <view class='product-intro' id="past3">
  243. <view class='title'>产品介绍</view>
  244. <view class='conter' v-if="description">
  245. <jyf-parser :domain="domain" :html="description.content" ref="article" :tag-style="tagStyle"></jyf-parser>
  246. </view>
  247. <!-- 价格说明 -->
  248. <view v-if="priceRule.content" class="price-info">
  249. <view class="price-title">价格说明</view>
  250. <!-- #ifndef APP-PLUS -->
  251. <jyf-parser :domain='domain' :html="priceRule.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
  252. <!-- #endif -->
  253. <!-- #ifdef APP-PLUS -->
  254. <view class="description" v-html="priceRule.content.replace(/<br\/>/ig, '')"></view>
  255. <!-- #endif -->
  256. </view>
  257. </view>
  258. <view class="content-height"></view>
  259. </scroll-view>
  260. </view>
  261. <view class='footer_count'>
  262. <view class="acea-row row-between-wrapper footer" :class="{'footpl':hide_mer_status==1}">
  263. <navigator v-if="hide_mer_status !=1" :url="'/pages/store/home/index?id='+storeInfo.mer_id" class='item skeleton-rect'>
  264. <view class='iconfont icon-dianpu2'></view>
  265. <view>店铺</view>
  266. </navigator>
  267. <block v-if="storeInfo.merchant">
  268. <view v-if="storeInfo.merchant.services_type== 0" class="item skeleton-rect" @click="goCustomer">
  269. <view class="iconfont icon-kefu"></view>
  270. <view>客服</view>
  271. </view>
  272. <view v-else class="item skeleton-rect" @click="call">
  273. <view class="iconfont icon-kefu"></view>
  274. <view>客服</view>
  275. </view>
  276. </block>
  277. <view @click="setCollect" class='item skeleton-rect'>
  278. <view class='iconfont icon-shoucang1' v-if="storeInfo.isRelation"></view>
  279. <view class='iconfont icon-shoucang' v-else></view>
  280. <view>收藏</view>
  281. </view>
  282. <view class='bnt acea-row'>
  283. <form @submit="joinCart" report-submit='true'>
  284. <button class='joinCart bnts skeleton-rect' @tap="openAlone">单独购买</button>
  285. </form>
  286. <form @submit="goBuy" report-submit='true' v-if="attr.productSelect ">
  287. <button v-if="attr.productSelect.stock == 0" class='buy bnts skeleton-rect' form-type="submit" disabled>已售罄</button>
  288. <button v-else class='buy bnts skeleton-rect' form-type="submit">立即开团</button>
  289. </form>
  290. </view>
  291. </view>
  292. </view>
  293. <block v-if="sharePacket.max&&sharePacket.min">
  294. <shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"
  295. :showAnimate="showAnimate" @boxStatus="boxStatus"></shareRedPackets>
  296. </block>
  297. <!--商品参数-->
  298. <specs :specsInfo="specsInfo" @myevent="mySpecs"></specs>
  299. <!-- 组件 -->
  300. <productWindow :attr="attr" :isShow='1' :iSplus='1' :image="storeInfo.image" @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
  301. @ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'></productWindow>
  302. <!-- 分享按钮 -->
  303. <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
  304. <!-- #ifndef MP -->
  305. <button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
  306. <view class="iconfont icon-weixin3"></view>
  307. <view class="">发送给朋友</view>
  308. </button>
  309. <!-- #endif -->
  310. <!-- #ifdef MP -->
  311. <button class="item" :class="weixinStatus ? 'item3' : ''" open-type="share" hover-class='none' @click="goFriend">
  312. <view class="iconfont icon-weixin3"></view>
  313. <view class="">发送给朋友</view>
  314. </button>
  315. <!-- #endif -->
  316. <button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="downloadFilePromotionCode">
  317. <view class="iconfont icon-haibao"></view>
  318. <view class="">生成海报</view>
  319. </button>
  320. <button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="copyPwd">
  321. <view class="iconfont icon-fuzhikouling1"></view>
  322. <view>生成口令</view>
  323. </button>
  324. </view>
  325. <view class="mask" v-if="posters" @click="listenerActionClose"></view>
  326. <view class="mask_transparent" v-if="currentPage" @touchmove="hideNav" @click="hideNav()"></view>
  327. <!--口令复制结果-->
  328. <copyPassword :isCopy='isCopy' :copyUrl='copyUrl' @close="closeCopy"></copyPassword>
  329. <!-- 海报展示 -->
  330. <view class='poster-pop' v-if="posterImageStatus">
  331. <image src='../../../static/images/poster-close.png' class='close' @click="posterImageClose"></image>
  332. <image :src='posterImage'></image>
  333. <!-- #ifndef H5 -->
  334. <view class='save-poster' @click="savePosterPath">保存到手机</view>
  335. <!-- #endif -->
  336. <!-- #ifdef H5 -->
  337. <view class="keep">长按图片可以保存到手机</view>
  338. <!-- #endif -->
  339. </view>
  340. <view class='mask' v-if="posterImageStatus"></view>
  341. <canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
  342. <!-- 发送给朋友图片 -->
  343. <view class="share-box" v-if="H5ShareBox">
  344. <image :src="`${domain}/static/images/share-info.png`" @click="H5ShareBox = false"></image>
  345. </view>
  346. <guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
  347. <!-- #ifndef H5 -->
  348. <passwordPopup></passwordPopup>
  349. <!-- #endif -->
  350. </view>
  351. </view>
  352. </template>
  353. <script>
  354. // +----------------------------------------------------------------------
  355. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  356. // +----------------------------------------------------------------------
  357. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  358. // +----------------------------------------------------------------------
  359. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  360. // +----------------------------------------------------------------------
  361. // | Author: CRMEB Team <admin@crmeb.com>
  362. // +----------------------------------------------------------------------
  363. var sysHeight = uni.getSystemInfoSync().statusBarHeight;
  364. import {
  365. getProductCode,
  366. collectAdd,
  367. collectDel,
  368. postCartAdd,
  369. copyPasswordApi, priceRuleApi
  370. } from '@/api/store.js';
  371. import { getCombinationDetail } from '@/api/activity.js';
  372. import { getUserInfo, imgToBase } from '@/api/user.js';
  373. import { getCartCounts } from '@/api/order.js';
  374. import { mapGetters } from "vuex";
  375. import { imageBase64 } from "@/api/public";
  376. import productConSwiper from '@/components/productConSwiper';
  377. import productWindow from '@/components/productWindow';
  378. import specs from '@/components/specs/index.vue';
  379. import copyPassword from '@/components/copyPassword';
  380. import userEvaluation from '@/components/userEvaluation';
  381. import shareRedPackets from '@/components/shareRedPackets';
  382. import { HTTP_REQUEST_UR } from '@/config/app';
  383. import home from '@/components/home';
  384. import { silenceBindingSpread, configMap } from "@/utils";
  385. import parser from "@/components/jyf-parser/jyf-parser";
  386. import { HTTP_REQUEST_URL } from '@/config/app';
  387. import { toLogin } from '@/libs/login.js';
  388. // #ifndef H5
  389. import passwordPopup from '@/components/passwordPopup';
  390. // #endif
  391. import shareScence from "@/libs/spread";
  392. let app = getApp();
  393. import history from "@/mixins/history";
  394. import countDown from '@/components/countDown/index.vue';
  395. import guaranteeTemplate from '@/components/freightGuarantee';
  396. export default {
  397. components: {
  398. // #ifndef H5
  399. passwordPopup,
  400. // #endif
  401. productConSwiper,
  402. productWindow,
  403. specs,
  404. userEvaluation,
  405. shareRedPackets,
  406. home,
  407. countDown,
  408. guaranteeTemplate,
  409. copyPassword,
  410. "jyf-parser": parser,
  411. },
  412. mixins: [history],
  413. data() {
  414. let that = this;
  415. return {
  416. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  417. sysHeight: sysHeight, //系统导航条高度
  418. attrTxt: '请选择', //属性页面提示
  419. attrValue: '', //已选属性
  420. animated: false, //购物车动画
  421. id: 0, //商品id
  422. replyCount: 0, //总评论数量
  423. reply: [], //评论列表
  424. storeInfo: {}, //商品详情
  425. combinationInfo: {}, //预售详情
  426. productValue: [], //系统属性
  427. cart_num: 1, //购买数量
  428. isOpen: false, //是否打开属性组件
  429. actionSheetHidden: true,
  430. posterImageStatus: false,
  431. storeImage: '', //海报产品图
  432. PromotionCode: '', //二维码图片
  433. canvasStatus: false, //海报绘图标签
  434. posterImage: '', //海报路径
  435. posterbackgd: '/static/images/posterbackgd.png',
  436. sharePacket: {
  437. isState: true, //默认不显示
  438. }, //分销商详细
  439. circular: false,
  440. autoplay: true,
  441. interval: 3000,
  442. duration: 500,
  443. clientHeight: "",
  444. itemNew: [],
  445. indicatorDots: false,
  446. systemStore: {}, //门店信息
  447. replyChance: 0,
  448. CartCount: 0,
  449. posters: false,
  450. weixinStatus: false,
  451. attr: {
  452. cartAttr: false,
  453. productAttr: [],
  454. productSelect: {}
  455. },
  456. description: '',
  457. priceRule: "",
  458. navActive: 0,
  459. H5ShareBox: false, //公众号分享图片
  460. retunTop: true, //顶部返回
  461. navH: "",
  462. navList: [],
  463. opacity: 0,
  464. scrollY: 0,
  465. topArr: [],
  466. toView: '',
  467. height: 0,
  468. heightArr: [],
  469. lock: false,
  470. scrollTop: 0,
  471. tagStyle: {
  472. img: 'width:100%;display:block;'
  473. },
  474. // 动画状态
  475. showAnimate: true,
  476. domain: HTTP_REQUEST_URL,
  477. minNum: 0,
  478. pink_ok_sum: 0,
  479. pink: [],
  480. AllIndexDefault: 0,
  481. AllIndex: 2,
  482. maxAllIndex: 0,
  483. currSpid: '',
  484. codeImg: "",
  485. justifyLeft: "display: inline;",
  486. videoCoverImg: "",
  487. shipping: "",
  488. guarantee: [],
  489. guaranteeValue: "",
  490. shippingValue: "",
  491. isCopy: false,
  492. copyUrl: '',
  493. services_type: "",
  494. specsInfo: {
  495. show: false,
  496. params: []
  497. },
  498. currentPage: false,
  499. homeTop: 59,
  500. selectNavList: [{
  501. name: '首页',
  502. icon: 'icon-shouye8',
  503. url: '/pages/index/index',
  504. after: 'dialog_after'
  505. },
  506. {
  507. name: '搜索',
  508. icon: 'icon-sousuo6',
  509. url: '/pages/columnGoods/goods_search_con/index',
  510. after: 'dialog_after'
  511. },
  512. {
  513. name: '购物车',
  514. icon: 'icon-gouwuche7',
  515. url: '/pages/order_addcart/order_addcart',
  516. after: 'dialog_after'
  517. },
  518. {
  519. name: '我的收藏',
  520. icon: 'icon-shoucang3',
  521. url: '/pages/users/user_goods_collection/index',
  522. after: 'dialog_after'
  523. },
  524. {
  525. name: '个人中心',
  526. icon: 'icon-gerenzhongxin1',
  527. url: '/pages/user/index'
  528. },
  529. ],
  530. };
  531. },
  532. computed: configMap(['hide_mer_status','share_pic','site_name'],mapGetters(['isLogin','uid','viewColor'])),
  533. onLoad(options) {
  534. let that = this
  535. if (options.spid) {
  536. app.globalData.spid = options.spid;
  537. that.currSpid = options.spid
  538. }
  539. var pages = getCurrentPages();
  540. if (pages.length <= 1) {
  541. that.retunTop = false
  542. }
  543. that.navH = app.globalData.navHeight+10;
  544. // #ifdef APP-PLUS
  545. that.homeTop = (that.sysHeight + 8)*2;
  546. // #endif
  547. // #ifdef H5
  548. that.homeTop = 10;
  549. // #endif
  550. if (options.id) {
  551. this.id = options.id
  552. }
  553. uni.getSystemInfo({
  554. success: function(res) {
  555. that.height = res.windowHeight
  556. },
  557. });
  558. //扫码携带参数处理
  559. // #ifdef MP
  560. if (options.scene) {
  561. let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
  562. if (value.id) options.id = value.id;
  563. //记录推广人uid
  564. if (value.spid) {
  565. app.globalData.spid = value.spid;
  566. that.currSpid = value.spid
  567. }
  568. }
  569. if (!options.id && !options.scene) {
  570. return this.$util.Tips({
  571. title: '缺少参数无法查看商品'
  572. }, {
  573. tab: 3,
  574. url: 1
  575. });
  576. } else {
  577. this.id = options.id
  578. }
  579. //记录推广人uid
  580. if (options.spid) app.globalData.spid = options.spid;
  581. // #endif
  582. shareScence(that.currSpid, that.isLogin)
  583. that.getGoodsDetails();
  584. if (this.isLogin) {
  585. // this.downloadFilePromotionCode();
  586. //#ifdef H5
  587. silenceBindingSpread();
  588. //#endif
  589. this.getHistory()
  590. }
  591. },
  592. onReady() {
  593. this.isNodes++;
  594. this.$nextTick(function() {
  595. // #ifdef MP
  596. const menuButton = uni.getMenuButtonBoundingClientRect();
  597. const query = uni.createSelectorQuery().in(this);
  598. query
  599. .select('#home')
  600. .boundingClientRect(data => {
  601. this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
  602. })
  603. .exec();
  604. // #endif
  605. });
  606. },
  607. onShow() {
  608. },
  609. /**
  610. * 用户点击右上角分享
  611. */
  612. // #ifdef MP
  613. onShareAppMessage: function() {
  614. let that = this;
  615. return {
  616. title: that.storeInfo.store_name || '',
  617. imageUrl: that.storeInfo.image || '',
  618. path: '/pages/activity/combination_details/index?id=' + that.id + '&spid=' + that.uid,
  619. }
  620. },
  621. onShareTimeline: function() {
  622. let that = this;
  623. return {
  624. title: that.storeInfo.store_name || '',
  625. query: {
  626. id: that.id,
  627. spid: that.uid
  628. },
  629. imageUrl: that.storeInfo.image || ''
  630. }
  631. },
  632. // #endif
  633. methods: {
  634. call: function(isService){
  635. let that = this;
  636. if(isService){
  637. uni.showModal({
  638. title: '提示',
  639. content: '暂无在线客服,确定拨打客服电话:'+that.storeInfo.merchant.service_phone+'吗?',
  640. success: function(res) {
  641. if (res.confirm) {
  642. uni.makePhoneCall({
  643. // 手机号
  644. phoneNumber: that.storeInfo.merchant.service_phone,
  645. // 成功回调
  646. success: (res) => {},
  647. // 失败回调
  648. fail: (res) => {}
  649. });
  650. }
  651. }
  652. })
  653. }else{
  654. return that.$util.Tips({
  655. title: '暂无可用客服'
  656. })
  657. }
  658. },
  659. goCustomer(){
  660. let that = this;
  661. if (that.isLogin === false) {
  662. toLogin()
  663. } else {
  664. uni.navigateTo({
  665. url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.storeInfo.product_id}&combinationId=${that.id}`
  666. });
  667. }
  668. },
  669. showAll: function() {
  670. this.AllIndexDefault = this.AllIndex;
  671. this.AllIndex = this.pink.length;
  672. },
  673. hideAll: function() {
  674. this.AllIndex = this.AllIndexDefault;
  675. },
  676. seeSpecs() {
  677. this.specsInfo.show = true;
  678. },
  679. mySpecs() {
  680. this.$set(this.specsInfo, 'show', false);
  681. },
  682. goProDetail(item) {
  683. console.log(item, 'goProDetail')
  684. uni.redirectTo({
  685. url: '/pages/goods_details/index?id=' + item.product_id
  686. })
  687. },
  688. //下拉导航页面跳转
  689. linkPage(url) {
  690. if (['/pages/index/index', '/pages/order_addcart/order_addcart',
  691. '/pages/user/index', '/pages/plant_grass/index'
  692. ].indexOf(url) > -1) {
  693. uni.switchTab({
  694. url
  695. })
  696. } else {
  697. uni.navigateTo({
  698. url
  699. })
  700. }
  701. this.currentPage = false
  702. },
  703. boxStatus(data) {
  704. this.showAnimate = data
  705. },
  706. closeChange: function() {
  707. this.$set(this.sharePacket, 'isState', true);
  708. },
  709. /**查看运费说明*/
  710. showShip: function() {
  711. this.$refs.guartemplate.showShippingTel();
  712. },
  713. /**查看服务保障*/
  714. showGuaranee: function() {
  715. this.$refs.guartemplate.showGuaranteeTel();
  716. },
  717. showNav() {
  718. this.currentPage = !this.currentPage;
  719. },
  720. hideNav() {
  721. this.currentPage = false;
  722. },
  723. /*获取价格说明*/
  724. getPricrRule() {
  725. priceRuleApi(this.storeInfo.cate_id).then(res => {
  726. this.priceRule = res.data
  727. }).catch(err => {});
  728. },
  729. /**
  730. * 购物车手动填写
  731. *
  732. */
  733. iptCartNum: function(e) {
  734. let num = parseInt(e)
  735. let stock = this.combinationInfo.self_count ? parseInt(this.combinationInfo.self_count) : 999999999;
  736. if (num > stock) {
  737. this.$nextTick(res => {
  738. this.$set(this.attr.productSelect, 'cart_num', stock);
  739. })
  740. } else {
  741. if (num <= 0) {
  742. this.$nextTick(res => {
  743. this.$set(this.attr.productSelect, 'cart_num', stock);
  744. })
  745. } else {
  746. this.$nextTick(res => {
  747. this.$set(this.attr.productSelect, 'cart_num', num);
  748. })
  749. }
  750. }
  751. },
  752. // 后退
  753. returns: function() {
  754. uni.navigateBack()
  755. },
  756. // 首页
  757. goHome() {
  758. uni.switchTab({
  759. url: '/pages/index/index'
  760. });
  761. },
  762. tap: function(index) {
  763. var id = "past" + index;
  764. var index = index;
  765. var that = this;
  766. this.$set(this, 'toView', id);
  767. this.$set(this, 'navActive', index);
  768. this.$set(this, 'lock', true);
  769. this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[index]);
  770. },
  771. scroll: function(e) {
  772. var that = this,
  773. scrollY = e.detail.scrollTop;
  774. var opacity = scrollY / 200;
  775. opacity = opacity > 1 ? 1 : opacity;
  776. that.$set(that, 'showAnimate', false);
  777. that.$set(that, 'opacity', opacity);
  778. that.$set(that, 'scrollY', scrollY);
  779. if (that.lock) {
  780. that.$set(that, 'lock', false)
  781. return;
  782. }
  783. for (var i = 0; i < that.topArr.length; i++) {
  784. if (scrollY < that.topArr[i] - (app.globalData.navHeight / 2) + that.heightArr[i]) {
  785. that.$set(that, 'navActive', i)
  786. break
  787. }
  788. }
  789. },
  790. /*
  791. * 获取用户信息
  792. */
  793. getUserInfo: function() {
  794. let that = this;
  795. that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != 0 ? false : true);
  796. getUserInfo().then(res => {
  797. // that.$set(that, 'uid', res.data.uid);
  798. });
  799. },
  800. /**
  801. * 购物车数量加和数量减
  802. *
  803. */
  804. ChangeCartNum: function(changeValue) {
  805. //changeValue:是否 加|减
  806. //获取当前变动属性
  807. let productSelect = this.productValue[this.attrValue];
  808. //如果没有属性,赋值给商品默认库存
  809. if (productSelect === undefined && !this.attr.productAttr.length)
  810. productSelect = this.attr.productSelect;
  811. //无属性值即库存为0;不存在加减;
  812. if (productSelect === undefined) return;
  813. let stock = productSelect.stock || 999999999;
  814. let num = this.attr.productSelect;
  815. if (changeValue) {
  816. num.cart_num++;
  817. if (num.cart_num > stock) {
  818. this.$set(this.attr.productSelect, "cart_num", stock);
  819. this.$set(this, "cart_num", stock);
  820. uni.showToast({
  821. title: `购买数量不能超过库存`,
  822. icon: 'none'
  823. })
  824. }
  825. } else {
  826. num.cart_num--;
  827. if (num.cart_num < 1) {
  828. this.$set(this.attr.productSelect, "cart_num", 1);
  829. this.$set(this, "cart_num", 1);
  830. }
  831. }
  832. },
  833. attrVal(val) {
  834. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val.indexn]);
  835. },
  836. /**
  837. * 属性变动赋值
  838. *
  839. */
  840. ChangeAttr: function(res) {
  841. let productSelect = this.productValue[res];
  842. if (productSelect && productSelect.stock > 0) {
  843. this.$set(this.attr.productSelect, "image", productSelect.image);
  844. this.$set(this.attr.productSelect, "price", productSelect.price);
  845. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  846. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  847. this.$set(this.attr.productSelect, "cart_num", 1);
  848. this.$set(this, "attrValue", res);
  849. this.$set(this, "attrTxt", "已选择");
  850. } else {
  851. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  852. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  853. this.$set(this.attr.productSelect, "stock", 0);
  854. this.$set(this.attr.productSelect, "unique", "");
  855. this.$set(this.attr.productSelect, "cart_num", 0);
  856. this.$set(this, "attrValue", "");
  857. this.$set(this, "attrTxt", "请选择");
  858. }
  859. },
  860. setClientHeight: function() {
  861. let that = this;
  862. let view = uni.createSelectorQuery().in(this).select("#list0");
  863. view.fields({
  864. size: true,
  865. }, data => {
  866. that.$set(that, 'clientHeight', data.height + 20)
  867. }).exec();
  868. },
  869. /**
  870. * 获取产品详情
  871. *
  872. */
  873. getGoodsDetails: function() {
  874. uni.showLoading({
  875. title: '加载中',
  876. mask: true
  877. });
  878. let that = this;
  879. getCombinationDetail(that.id).then(res => {
  880. uni.hideLoading();
  881. let storeInfo = res.data.product;
  882. let combinationInfo = res.data;
  883. if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
  884. this.videoCoverImg = storeInfo.slider_image[0]
  885. storeInfo.slider_image.splice(0, 1)
  886. } else if (storeInfo.video_link && storeInfo.slider_image.length === 1) {
  887. this.videoCoverImg = storeInfo.slider_image[0]
  888. }
  889. that.$set(that, 'combinationInfo', combinationInfo);
  890. that.$set(that, 'storeInfo', storeInfo);
  891. that.$set(that, 'description', storeInfo.content);
  892. that.$set(that, 'reply', res.data.product.topReply ? [res.data.product.topReply] : []);
  893. that.$set(that, 'replyCount', res.data.product.replayData && res.data.product.replayData.count);
  894. that.$set(that, 'replyChance', res.data.product.replayData && res.data.product.replayData.rate);
  895. that.$set(that.attr, 'productAttr', res.data.product.attr);
  896. that.$set(that, 'productValue', res.data.product.sku);
  897. that.$set(that.sharePacket, 'priceName', res.data.product.priceName);
  898. that.$set(that.sharePacket, 'max', res.data.product.max_extension);
  899. that.$set(that.sharePacket, 'min', res.data.product.min_extension);
  900. that.$set(that, 'systemStore', res.data.product.system_store);
  901. that.$set(that, 'PromotionCode', storeInfo.code_base);
  902. that.$set(that, 'pink', res.data.groupBuying);
  903. that.$set(that, 'itemNew', res.data.successUser);
  904. that.$set(that, 'shippingValue', res.data.product.temp ? res.data.product.temp.name : '');
  905. that.$set(that, 'guaranteeValue', res.data.product.guarantee ? res.data.product.guarantee.template_name : '');
  906. that.$set(that, 'guarantee', res.data.product.guaranteeTemplate ? res.data.product.guaranteeTemplate : []);
  907. that.$set(that, 'shipping', res.data.product.temp ? res.data.product.temp.info : '');
  908. that.$set(that.specsInfo, 'params', res.data.product.params);
  909. uni.setNavigationBarTitle({
  910. title: storeInfo.store_name.substring(0, 7) + "..."
  911. })
  912. that.$set(that, 'storeImage', that.storeInfo.image);
  913. // #ifdef H5
  914. if (that.isLogin) {
  915. that.getCartCount();
  916. that.ShareInfo();
  917. // that.downloadFilePromotionCode();
  918. };
  919. // #endif
  920. // #ifdef APP-PLUS || MP
  921. that.getCartCount();
  922. // #endif
  923. setTimeout(function() {
  924. that.infoScroll();
  925. }, 500);
  926. that.DefaultSelect();
  927. that.getPricrRule(that.storeInfo.cate_id);
  928. // 找到最小定金金额
  929. let objs = Object.keys(res.data.product.sku);
  930. let m = objs.map(key => res.data.product.sku[key]);
  931. this.minNum = Math.min.apply(Math, m.map(function(o) {
  932. return o.down_price
  933. }))
  934. }).catch(res => {
  935. uni.hideLoading();
  936. return that.$util.Tips({
  937. title: res
  938. }, {
  939. tab: 3,
  940. url: 1
  941. });
  942. })
  943. },
  944. infoScroll: function() {
  945. var that = this,
  946. topArr = [],
  947. heightArr = [];
  948. for (var i = 0; i < that.navList.length; i++) { //productList
  949. //获取元素所在位置
  950. var query = uni.createSelectorQuery().in(this);
  951. var idView = "#past" + i;
  952. query.select(idView).boundingClientRect();
  953. query.exec(function(res) {
  954. var top = res[0].top;
  955. var height = res[0].height;
  956. topArr.push(top);
  957. heightArr.push(height);
  958. that.$set(that, 'topArr', topArr);
  959. that.$set(that, 'heightArr', heightArr);
  960. });
  961. };
  962. },
  963. /**
  964. * 拨打电话
  965. */
  966. makePhone: function() {
  967. uni.makePhoneCall({
  968. phoneNumber: this.systemStore.phone
  969. })
  970. },
  971. /**
  972. * 默认选中属性
  973. *
  974. */
  975. DefaultSelect: function() {
  976. let productAttr = this.attr.productAttr;
  977. let value = [];
  978. let arr = []
  979. let unSortArr = []
  980. for (var key in this.productValue) {
  981. if (this.productValue[key].stock > 0) {
  982. value = this.attr.productAttr.length ? key.split(",") : [];
  983. break;
  984. }
  985. }
  986. for (let i = 0; i < productAttr.length; i++) {
  987. this.$set(productAttr[i], "index", value[i]);
  988. }
  989. //sort();排序函数:数字-英文-汉字;
  990. let productSelect = this.productValue[value.join(",")];
  991. if (productSelect && productAttr.length) {
  992. this.$set(
  993. this.attr.productSelect,
  994. "store_name",
  995. this.storeInfo.store_name
  996. );
  997. this.$set(this.attr.productSelect, "image", productSelect.image);
  998. this.$set(this.attr.productSelect, "price", productSelect.price);
  999. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  1000. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  1001. this.$set(this, "attrValue", value.join(","));
  1002. this.$set(this, "attrTxt", "已选择");
  1003. if (productSelect.stock == 0) {
  1004. this.$set(this.attr.productSelect, "cart_num", 0);
  1005. } else {
  1006. this.$set(this.attr.productSelect, "cart_num", 1);
  1007. }
  1008. } else if (!productSelect && productAttr.length) {
  1009. this.$set(
  1010. this.attr.productSelect,
  1011. "store_name",
  1012. this.storeInfo.store_name
  1013. );
  1014. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  1015. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  1016. this.$set(this.attr.productSelect, "stock", 0);
  1017. this.$set(this.attr.productSelect, "unique", "");
  1018. this.$set(this.attr.productSelect, "cart_num", 0);
  1019. this.$set(this, "attrValue", "");
  1020. this.$set(this, "attrTxt", "请选择");
  1021. } else if (!productSelect && !productAttr.length) {
  1022. this.$set(
  1023. this.attr.productSelect,
  1024. "store_name",
  1025. this.storeInfo.store_name
  1026. );
  1027. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  1028. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  1029. this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
  1030. this.$set(
  1031. this.attr.productSelect,
  1032. "unique",
  1033. this.storeInfo.unique || ""
  1034. );
  1035. this.$set(this.attr.productSelect, "cart_num", 1);
  1036. this.$set(this, "attrValue", "");
  1037. this.$set(this, "attrTxt", "请选择");
  1038. } else if (productSelect && !productAttr.length) {
  1039. this.$set(
  1040. this.attr.productSelect,
  1041. "store_name",
  1042. this.storeInfo.store_name
  1043. );
  1044. this.$set(this.attr.productSelect, "image", productSelect.image);
  1045. this.$set(this.attr.productSelect, "price", productSelect.price);
  1046. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  1047. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  1048. this.$set(this, "attrValue", value.join(","));
  1049. this.$set(this, "attrTxt", "已选择");
  1050. if (productSelect.stock == 0) {
  1051. this.$set(this.attr.productSelect, "cart_num", 0);
  1052. } else {
  1053. this.$set(this.attr.productSelect, "cart_num", 1);
  1054. }
  1055. }
  1056. },
  1057. /*
  1058. * 单独购买
  1059. */
  1060. openAlone: function() {
  1061. uni.navigateTo({
  1062. url: `/pages/goods_details/index?id=${this.storeInfo.old_product_id}`
  1063. })
  1064. },
  1065. /**
  1066. *
  1067. *
  1068. * 收藏商品
  1069. */
  1070. setCollect: function() {
  1071. if (this.isLogin === false) {
  1072. toLogin()
  1073. } else {
  1074. let that = this;
  1075. if (this.storeInfo.isRelation) {
  1076. collectDel({
  1077. type: 4,
  1078. type_id: this.combinationInfo.product_group_id
  1079. }).then(res => {
  1080. that.$util.Tips({
  1081. title: '已取消收藏'
  1082. });
  1083. that.$set(that.storeInfo, 'isRelation', !that.storeInfo.isRelation);
  1084. })
  1085. } else {
  1086. collectAdd({
  1087. type_id: this.combinationInfo.product_group_id,
  1088. type: 4
  1089. }).then(res => {
  1090. that.$util.Tips({
  1091. title: '收藏成功'
  1092. });
  1093. that.$set(that.storeInfo, 'isRelation', !that.storeInfo.isRelation);
  1094. })
  1095. }
  1096. }
  1097. },
  1098. /**
  1099. * 打开属性插件
  1100. */
  1101. selecAttr: function() {
  1102. this.$set(this.attr, 'cartAttr', true);
  1103. this.$set(this, 'isOpen', true);
  1104. },
  1105. onMyEvent: function() {
  1106. this.$set(this.attr, 'cartAttr', false);
  1107. this.$set(this, 'isOpen', false);
  1108. },
  1109. /**
  1110. * 打开属性加入购物车
  1111. *
  1112. */
  1113. joinCart: function(e) {
  1114. //是否登录
  1115. if (this.isLogin === false) {
  1116. toLogin()
  1117. } else {
  1118. this.goCat();
  1119. }
  1120. },
  1121. /*
  1122. * 加入购物车
  1123. */
  1124. goCat: function(news) {
  1125. let that = this,
  1126. productSelect = that.productValue[this.attrValue];
  1127. //打开属性
  1128. if (that.attrValue) {
  1129. //默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
  1130. that.attr.cartAttr = !that.isOpen ? true : false;
  1131. } else {
  1132. if (that.isOpen) that.attr.cartAttr = true;
  1133. else that.attr.cartAttr = !that.attr.cartAttr;
  1134. }
  1135. //只有关闭属性弹窗时进行加入购物车
  1136. if (that.attr.cartAttr === true && that.isOpen === false)
  1137. return (that.isOpen = true);
  1138. //如果有属性,没有选择,提示用户选择
  1139. if (
  1140. that.attr.productAttr.length &&
  1141. that.isOpen === true &&
  1142. productSelect.stock == 0
  1143. )
  1144. return that.$util.Tips({
  1145. title: "产品库存不足,请选择其它"
  1146. });
  1147. let q = {
  1148. is_new: 1,
  1149. product_id: that.id,
  1150. cart_num: that.attr.productSelect.cart_num,
  1151. product_attr_unique: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : "",
  1152. product_type: 4,
  1153. spread_id: this.currSpid
  1154. };
  1155. postCartAdd(q)
  1156. .then(function(res) {
  1157. that.isOpen = false;
  1158. that.attr.cartAttr = false;
  1159. if (news) {
  1160. uni.navigateTo({
  1161. url: '/pages/users/order_confirm/index?cartId=' + res.data.cart_id
  1162. });
  1163. } else {
  1164. that.$util.Tips({
  1165. title: "添加购物车成功",
  1166. success: () => {
  1167. that.getCartCount(true);
  1168. }
  1169. });
  1170. }
  1171. })
  1172. .catch(res => {
  1173. that.isOpen = false;
  1174. return that.$util.Tips({
  1175. title: res
  1176. });
  1177. });
  1178. },
  1179. /**
  1180. * 获取购物车数量
  1181. * @param boolean 是否展示购物车动画和重置属性
  1182. */
  1183. getCartCount: function(isAnima) {
  1184. let that = this;
  1185. const isLogin = that.isLogin;
  1186. if (isLogin) {
  1187. getCartCounts().then(res => {
  1188. that.CartCount = res.data[0].count;
  1189. //加入购物车后重置属性
  1190. if (isAnima) {
  1191. that.animated = true;
  1192. setTimeout(function() {
  1193. that.animated = false;
  1194. }, 500);
  1195. }
  1196. });
  1197. }
  1198. },
  1199. /**
  1200. * 立即购买
  1201. */
  1202. goBuy: function(e) {
  1203. if (this.isLogin === false) {
  1204. toLogin()
  1205. } else {
  1206. this.goCat(true);
  1207. }
  1208. },
  1209. /**
  1210. * 分享打开
  1211. *
  1212. */
  1213. listenerActionSheet: function() {
  1214. // #ifdef H5
  1215. if (this.$wechat.isWeixin() === true) {
  1216. this.weixinStatus = true;
  1217. }
  1218. // #endif
  1219. this.posters = true;
  1220. },
  1221. // 分享关闭
  1222. listenerActionClose: function() {
  1223. this.posters = false;
  1224. },
  1225. //隐藏海报
  1226. posterImageClose: function() {
  1227. this.posterImageStatus = false
  1228. },
  1229. //替换安全域名
  1230. setDomain: function(url) {
  1231. url = url ? url.toString() : '';
  1232. //本地调试打开,生产请注销
  1233. if (url.indexOf("https://") > -1) return url;
  1234. else return url.replace('http://', 'https://');
  1235. },
  1236. /**
  1237. * 获取产品分销二维码
  1238. * @param function successFn 下载完成回调
  1239. *
  1240. */
  1241. downloadFilePromotionCode: function(successFn) {
  1242. let that = this;
  1243. let type;
  1244. // #ifndef MP
  1245. type = 'wechat'
  1246. // #endif
  1247. // #ifdef MP
  1248. type = 'routine'
  1249. // #endif
  1250. getProductCode(that.id, {
  1251. type: type,
  1252. product_type: 4
  1253. }).then(async res => {
  1254. that.codeImg = res.data.url;
  1255. that.goPoster();
  1256. }).catch(err => {
  1257. that.$util.Tips({
  1258. title: err
  1259. });
  1260. that.posters = false;
  1261. that.$set(that, 'PromotionCode', '');
  1262. });
  1263. },
  1264. // 小程序关闭分享弹窗;
  1265. goFriend: function() {
  1266. this.posters = false;
  1267. },
  1268. /**
  1269. * 生成海报
  1270. */
  1271. async goPoster() {
  1272. if (this.posterImage) {
  1273. this.posterImageStatus = true
  1274. this.posters = false
  1275. return
  1276. }
  1277. let that = this;
  1278. let arr2
  1279. that.posters = false;
  1280. that.$set(that, 'canvasStatus', true);
  1281. uni.showLoading({
  1282. title: '海报生成中',
  1283. mask: true
  1284. });
  1285. // #ifdef MP || APP-PLUS
  1286. arr2 = [that.posterbackgd, await this.fileStoreImage(this.storeImage), await this.fileStoreImage(
  1287. this.codeImg), await that.fileStoreImage(that.share_pic)];
  1288. // #endif
  1289. // #ifdef H5
  1290. arr2 = [that.posterbackgd, await this.imgToBase(that.storeImage), await this.imgToBase(this.codeImg), await that.imgToBase(that.share_pic)];
  1291. // #endif
  1292. //生成推广海报
  1293. that.$util.goodsPosterCanvas(arr2, that.storeInfo.store_name, that.storeInfo.price, that.site_name, that.storeInfo.ot_price, function(tempFilePath) {
  1294. that.$set(that, 'posterImage', tempFilePath);
  1295. that.$set(that, 'posterImageStatus', true);
  1296. that.$set(that, 'canvasStatus', false);
  1297. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  1298. }, (err) => {
  1299. that.$set(that, 'canvasStatus', false);
  1300. });
  1301. },
  1302. /*
  1303. * 保存到手机相册
  1304. */
  1305. savePosterPath: function() {
  1306. let that = this;
  1307. // #ifdef MP
  1308. uni.getSetting({
  1309. success(res) {
  1310. if (!res.authSetting['scope.writePhotosAlbum']) {
  1311. uni.authorize({
  1312. scope: 'scope.writePhotosAlbum',
  1313. success() {
  1314. uni.saveImageToPhotosAlbum({
  1315. filePath: that.posterImage,
  1316. success: function(res) {
  1317. that.posterImageClose();
  1318. that.$util.Tips({
  1319. title: '保存成功',
  1320. icon: 'success'
  1321. });
  1322. },
  1323. fail: function(res) {
  1324. that.$util.Tips({
  1325. title: '保存失败'
  1326. });
  1327. }
  1328. })
  1329. }
  1330. })
  1331. } else {
  1332. uni.saveImageToPhotosAlbum({
  1333. filePath: that.posterImage,
  1334. success: function(res) {
  1335. that.posterImageClose();
  1336. that.$util.Tips({
  1337. title: '保存成功',
  1338. icon: 'success'
  1339. });
  1340. },
  1341. fail: function(res) {
  1342. that.$util.Tips({
  1343. title: '保存失败'
  1344. });
  1345. },
  1346. })
  1347. }
  1348. }
  1349. })
  1350. // #endif
  1351. // #ifdef APP-PLUS
  1352. uni.saveImageToPhotosAlbum({
  1353. filePath: that.posterImage,
  1354. success: function(res) {
  1355. that.posterImageClose();
  1356. that.$util.Tips({
  1357. title: '保存成功',
  1358. icon: 'success'
  1359. });
  1360. },
  1361. fail: function(res) {
  1362. that.$util.Tips({
  1363. title: '保存失败'
  1364. });
  1365. },
  1366. })
  1367. // #endif
  1368. },
  1369. //#ifdef H5
  1370. ShareInfo() {
  1371. let data = this.storeInfo;
  1372. let href = location.href;
  1373. if (this.$wechat.isWeixin()) {
  1374. getUserInfo().then(res => {
  1375. href =
  1376. href.indexOf("?") === -1 ?
  1377. href + "?spid=" + res.data.uid :
  1378. href + "&spid=" + res.data.uid;
  1379. let configAppMessage = {
  1380. desc: data.store_info,
  1381. title: data.store_name,
  1382. link: href,
  1383. imgUrl: data.image
  1384. };
  1385. this.$wechat.wechatEvevt([
  1386. "updateAppMessageShareData",
  1387. "updateTimelineShareData",
  1388. "onMenuShareAppMessage",
  1389. "onMenuShareTimeline"
  1390. ], configAppMessage).then(res => {
  1391. console.log(res, '=============================>>WXAPI');
  1392. }).catch(err => {
  1393. console.log(err);
  1394. })
  1395. });
  1396. }
  1397. },
  1398. //#endif
  1399. async imgToBase(url) {
  1400. let res = await imgToBase({
  1401. image: url
  1402. })
  1403. return res.data.image
  1404. },
  1405. //图片转符合安全域名路径
  1406. fileStoreImage(url) {
  1407. if(url){
  1408. // #ifdef MP
  1409. let ishttps = url.split('//')[0] == 'https:'
  1410. if (!ishttps) {
  1411. url = 'https://'+url.split('//')[1]
  1412. }
  1413. // #endif
  1414. return new Promise((resolve, reject) => {
  1415. let that = this;
  1416. uni.downloadFile({
  1417. url: url,
  1418. success: function(res) {
  1419. resolve(res.tempFilePath);
  1420. },
  1421. fail: function(error) {
  1422. return that.$util.Tips({
  1423. title: '请检查图片地址是否在合法域名内'
  1424. });
  1425. }
  1426. });
  1427. })
  1428. }
  1429. },
  1430. //复制口令
  1431. copyPwd(){
  1432. let that = this;
  1433. copyPasswordApi({
  1434. id: that.id,
  1435. product_type: 4
  1436. }).then(async res => {
  1437. that.copyUrl = res.data.str;
  1438. that.posters = false
  1439. that.isCopy = true;
  1440. })
  1441. },
  1442. closeCopy(){
  1443. this.isCopy = false
  1444. },
  1445. },
  1446. }
  1447. </script>
  1448. <style scoped lang="scss">
  1449. .font-bg-red{
  1450. position: relative;
  1451. top: -3rpx;
  1452. background-color: var(--view-theme);
  1453. // border: 1px solid var(--view-theme);
  1454. }
  1455. .p-color {
  1456. color: var(--view-priceColor);
  1457. }
  1458. .t-color {
  1459. color: var(--view-theme);
  1460. }
  1461. .product-con .nav {
  1462. background-repeat: no-repeat;
  1463. background-size: 100% 100%;
  1464. width: 100%;
  1465. height: 100rpx;
  1466. padding: 0 30rpx;
  1467. box-sizing: border-box;
  1468. }
  1469. .product-con .nav .money {
  1470. font-size: 28rpx;
  1471. color: #fff;
  1472. .num {
  1473. font-size: 48rpx;
  1474. }
  1475. }
  1476. page {
  1477. background-color: #f5f5f5;
  1478. }
  1479. .orig_price {
  1480. text-decoration: line-through;
  1481. font-weight: normal;
  1482. margin-left: 10rpx;
  1483. }
  1484. .font-gray {
  1485. color: #82848F;
  1486. }
  1487. .product-con .notice {
  1488. width: 100%;
  1489. height: 62rpx;
  1490. background-color: var(--view-minorColor);
  1491. padding: 0 30rpx;
  1492. box-sizing: border-box;
  1493. }
  1494. .product-con .notice .num {
  1495. font-size: 24rpx;
  1496. }
  1497. .product-con .notice .num .iconfont {
  1498. font-size: 30rpx;
  1499. vertical-align: -3rpx;
  1500. margin-right: 20rpx;
  1501. }
  1502. .product-con .notice .num .line {
  1503. color: #282828;
  1504. margin-left: 15rpx;
  1505. }
  1506. .product-con .notice .swiper {
  1507. height: 100%;
  1508. width: 360rpx;
  1509. line-height: 62rpx;
  1510. overflow: hidden;
  1511. margin-left: 14rpx;
  1512. }
  1513. .product-con .notice .swiper swiper {
  1514. height: 100%;
  1515. width: 100%;
  1516. overflow: hidden;
  1517. font-size: 24rpx;
  1518. color: #282828;
  1519. }
  1520. .product-con .assemble {
  1521. background-color: #fff;
  1522. }
  1523. .product-con .assemble .item {
  1524. padding-right: 30rpx;
  1525. margin-left: 30rpx;
  1526. height: 132rpx;
  1527. }
  1528. .product-con .assemble .item .pictxt {
  1529. width: 295rpx;
  1530. }
  1531. .product-con .assemble .item .pictxt .text {
  1532. width: 194rpx;
  1533. }
  1534. .product-con .assemble .item .pictxt .pictrue {
  1535. width: 80rpx;
  1536. height: 80rpx;
  1537. }
  1538. .product-con .assemble .item .pictxt .pictrue image {
  1539. width: 100%;
  1540. height: 100%;
  1541. border-radius: 50%;
  1542. }
  1543. .product-con .assemble .item .right .lack {
  1544. font-size: 24rpx;
  1545. color: #333333;
  1546. }
  1547. .product-con .assemble .item .right .time {
  1548. position: relative;
  1549. left: -10rpx;
  1550. font-size: 22rpx;
  1551. color: #82848f;
  1552. margin-top: 5rpx;
  1553. display: inline;
  1554. }
  1555. .product-con .assemble .item .right .spellBnt {
  1556. font-size: 24rpx;
  1557. color: #fff;
  1558. width: 140rpx;
  1559. height: 50rpx;
  1560. border-radius: 50rpx;
  1561. background-image: linear-gradient(to right, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
  1562. text-align: center;
  1563. line-height: 50rpx;
  1564. margin-left: 30rpx;
  1565. }
  1566. .product-con .assemble .item .right .spellBnt .iconfont {
  1567. font-size: 25rpx;
  1568. margin-left: 5rpx;
  1569. }
  1570. .product-con .assemble .more {
  1571. font-size: 24rpx;
  1572. color: #282828;
  1573. text-align: center;
  1574. height: 90rpx;
  1575. line-height: 90rpx;
  1576. }
  1577. .product-con .assemble .more .iconfont {
  1578. margin-left: 13rpx;
  1579. font-size: 25rpx;
  1580. }
  1581. .product-con .nav .time {
  1582. font-size: 20rpx;
  1583. color: #fff;
  1584. text-align: center;
  1585. }
  1586. .product-con .nav .iconfont {
  1587. color: #fff;
  1588. font-size: 30rpx;
  1589. margin-left: 20rpx;
  1590. }
  1591. .product-con .wrapper {
  1592. padding: 32rpx 32rpx 26rpx;
  1593. width: 100%;
  1594. box-sizing: border-box;
  1595. }
  1596. .product-con .attribute .atterTxt1{
  1597. color: #282828;
  1598. &.hasAttr{
  1599. &:after{
  1600. content: "";
  1601. display: inline-block;
  1602. position: relative;
  1603. top: -6rpx;
  1604. margin: 0 6rpx;
  1605. width: 5rpx;
  1606. height: 5rpx;
  1607. background-color: #282828;
  1608. border-radius: 100%;
  1609. }
  1610. &:last-child{
  1611. &:after{
  1612. display: none;
  1613. }
  1614. }
  1615. }
  1616. }
  1617. .product-con .guaranteeAttr{
  1618. display: inline-block;
  1619. width: 560rpx;
  1620. overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
  1621. }
  1622. .product-con .price_text {
  1623. display: inline-block;
  1624. width: 90rpx;
  1625. height: 30rpx;
  1626. background: url(~pages/activity/static/images/presell_text.png);
  1627. background-size: 100%;
  1628. color: #FD6523;
  1629. font-size: 22rpx;
  1630. line-height: 30rpx;
  1631. text-align: center;
  1632. margin-left: 27rpx;
  1633. position: relative;
  1634. top: -8rpx;
  1635. }
  1636. .product-con .wrapper .introduce {
  1637. margin: 0;
  1638. padding-right: 40rpx;
  1639. position: relative;
  1640. margin: 20rpx 0 0;
  1641. .icon-fenxiang {
  1642. position: absolute;
  1643. top: 0;
  1644. right: 0;
  1645. }
  1646. }
  1647. .product-con .wrapper .introduce .infor {
  1648. width: 570rpx;
  1649. }
  1650. .product-con .wrapper .introduce .iconfont {
  1651. font-size: 37rpx;
  1652. color: #515151;
  1653. }
  1654. .product-con .wrapper .label {
  1655. margin: 18rpx 0 0 0;
  1656. font-size: 24rpx;
  1657. color: #82848f;
  1658. }
  1659. .product-con .wrapper .label .stock {
  1660. width: 255rpx;
  1661. margin-right: 28rpx;
  1662. }
  1663. .product-con .playWay {
  1664. background-color: #fff;
  1665. padding: 0 30rpx;
  1666. margin-top: 20rpx;
  1667. font-size: 28rpx;
  1668. color: #282828;
  1669. }
  1670. .product-con .playWay .title {
  1671. height: 86rpx;
  1672. border-bottom: 1px solid #eee;
  1673. }
  1674. .product-con .playWay .title .iconfont {
  1675. margin-left: 13rpx;
  1676. font-size: 28rpx;
  1677. color: #717171;
  1678. }
  1679. .product-con .playWay .way {
  1680. min-height: 110rpx;
  1681. font-size: 26rpx;
  1682. color: #282828;
  1683. }
  1684. .product-con .playWay .way .iconfont {
  1685. color: #cdcdcd;
  1686. font-size: 40rpx;
  1687. margin: 0 35rpx;
  1688. }
  1689. .product-con .playWay .way .item .num {
  1690. font-size: 34rpx;
  1691. margin-right: 6rpx;
  1692. width: 17px;
  1693. height: 28px;
  1694. display: inline-block;
  1695. vertical-align: middle;
  1696. }
  1697. .product-con .playWay .way .item .tip {
  1698. font-size: 22rpx;
  1699. color: #a5a5a5;
  1700. margin-top: -4rpx;
  1701. }
  1702. .product-con .playWay .way .way_text {
  1703. position: relative;
  1704. top: 4rpx;
  1705. }
  1706. .head-bar {
  1707. background: #fff;
  1708. }
  1709. .generate-posters {
  1710. width: 100%;
  1711. height: 170rpx;
  1712. background-color: #fff;
  1713. position: fixed;
  1714. left: 0;
  1715. bottom: 0;
  1716. z-index: 388;
  1717. transform: translate3d(0, 100%, 0);
  1718. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  1719. border-top: 1px solid #eee;
  1720. }
  1721. .generate-posters.on {
  1722. transform: translate3d(0, 0, 0);
  1723. }
  1724. .generate-posters .item {
  1725. /* #ifdef H5 */
  1726. flex: 50%;
  1727. /* #endif */
  1728. /* #ifndef H5 */
  1729. flex: 33.33%;
  1730. /* #endif */
  1731. text-align: center;
  1732. font-size: 30rpx;
  1733. &.item3{
  1734. flex: 33.33%
  1735. }
  1736. }
  1737. .generate-posters .item .iconfont {
  1738. font-size: 80rpx;
  1739. color: #5eae72;
  1740. }
  1741. .generate-posters .item .iconfont.icon-haibao {
  1742. color: #5391f1;
  1743. }
  1744. .generate-posters .item .iconfont.icon-fuzhikouling1 {
  1745. color: #FBB324;
  1746. }
  1747. .product-con .mask {
  1748. z-index: 88;
  1749. }
  1750. .product-con .footer {
  1751. padding: 0 20rpx 0 40rpx;
  1752. position: fixed;
  1753. left: 0;
  1754. bottom: 0;
  1755. width: 100%;
  1756. box-sizing: border-box;
  1757. height: 100rpx;
  1758. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1759. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1760. background-color: #fff;
  1761. z-index: 277;
  1762. border-top: 1px solid #f0f0f0;
  1763. &.footpl{
  1764. padding-left: 70rpx;
  1765. }
  1766. }
  1767. .product-con .footer .item {
  1768. font-size: 18rpx;
  1769. color: #666;
  1770. text-align: center;
  1771. }
  1772. .product-con .footer .item .iconfont {
  1773. text-align: center;
  1774. font-size: 40rpx;
  1775. }
  1776. .product-con .footer .item .iconfont.icon-shoucang1 {
  1777. color: var(--view-priceColor);
  1778. }
  1779. .product-con .footer .item .iconfont.icon-gouwuche1 {
  1780. font-size: 40rpx;
  1781. position: relative;
  1782. }
  1783. .product-con .footer .item .iconfont.icon-gouwuche1 .num {
  1784. color: #fff;
  1785. position: absolute;
  1786. font-size: 18rpx;
  1787. padding: 2rpx 8rpx 3rpx;
  1788. border-radius: 200rpx;
  1789. top: -10rpx;
  1790. right: -10rpx;
  1791. }
  1792. .product-con .footer .bnt {
  1793. width: 444rpx;
  1794. height: 76rpx;
  1795. }
  1796. .product-con .footer .bnt .bnts {
  1797. width: 222rpx;
  1798. text-align: center;
  1799. line-height: 76rpx;
  1800. color: #fff;
  1801. font-size: 28rpx;
  1802. }
  1803. .product-con .footer .bnt .joinCart {
  1804. border-radius: 50rpx 0 0 50rpx;
  1805. background-image: linear-gradient(to right, var(--view-bntColor11) 0%, var(--view-bntColor12) 100%);
  1806. }
  1807. .product-con .footer .bnt .buy {
  1808. border-radius: 0 50rpx 50rpx 0;
  1809. background-image: linear-gradient(to right, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
  1810. }
  1811. .product-con .footer .bnt .joinCart[disabled] {
  1812. background: #bbb;
  1813. }
  1814. .product-con .footer .bnt .buy[disabled] {
  1815. background: #bbb;
  1816. }
  1817. button {
  1818. padding: 0;
  1819. margin: 0;
  1820. line-height: normal;
  1821. background-color: #fff;
  1822. }
  1823. button::after {
  1824. border: 0;
  1825. }
  1826. action-sheet-item {
  1827. padding: 0;
  1828. height: 240rpx;
  1829. align-items: center;
  1830. display: flex;
  1831. }
  1832. .contact {
  1833. font-size: 16px;
  1834. width: 50%;
  1835. background-color: #fff;
  1836. padding: 8rpx 0;
  1837. border-radius: 0;
  1838. margin: 0;
  1839. line-height: 2;
  1840. }
  1841. .contact::after {
  1842. border: none;
  1843. }
  1844. .canvas {
  1845. z-index: 300;
  1846. width: 750px;
  1847. height: 1190px;
  1848. }
  1849. .poster-pop {
  1850. width: 600rpx;
  1851. height: 897rpx;
  1852. position: fixed;
  1853. left: 50%;
  1854. transform: translateX(-50%);
  1855. z-index: 399;
  1856. top: 50%;
  1857. margin-top: -500rpx;
  1858. }
  1859. .poster-pop image {
  1860. width: 100%;
  1861. height: 100%;
  1862. display: block;
  1863. }
  1864. .poster-pop .close {
  1865. width: 46rpx;
  1866. height: 75rpx;
  1867. position: fixed;
  1868. right: 0;
  1869. top: -73rpx;
  1870. display: block;
  1871. }
  1872. .poster-pop .save-poster {
  1873. background-color: #df2d0a;
  1874. font-size: :22rpx;
  1875. color: #fff;
  1876. text-align: center;
  1877. height: 76rpx;
  1878. line-height: 76rpx;
  1879. width: 100%;
  1880. }
  1881. .poster-pop .keep {
  1882. color: #fff;
  1883. text-align: center;
  1884. font-size: 25rpx;
  1885. margin-top: 10rpx;
  1886. }
  1887. .mask {
  1888. position: fixed;
  1889. top: 0;
  1890. left: 0;
  1891. right: 0;
  1892. bottom: 0;
  1893. background-color: rgba(0, 0, 0, 0.6);
  1894. z-index: 300;
  1895. }
  1896. .share-box {
  1897. z-index: 1000;
  1898. position: fixed;
  1899. left: 0;
  1900. top: 0;
  1901. width: 100%;
  1902. height: 100%;
  1903. image {
  1904. width: 100%;
  1905. height: 100%;
  1906. }
  1907. }
  1908. .store-wrapper {
  1909. margin-top: 20rpx;
  1910. background-color: #fff;
  1911. .store-hd {
  1912. padding: 30rpx;
  1913. border-bottom: 1px solid #F5F5F5;
  1914. .store-info {
  1915. position: relative;
  1916. display: flex;
  1917. .logo {
  1918. width: 86rpx;
  1919. height: 86rpx;
  1920. image {
  1921. width: 86rpx;
  1922. height: 86rpx;
  1923. border-radius: 6rpx;
  1924. }
  1925. }
  1926. .info {
  1927. display: flex;
  1928. flex-direction: column;
  1929. justify-content: center;
  1930. margin-left: 20rpx;
  1931. .name {
  1932. font-size: 28rpx;
  1933. color: #282828;
  1934. font-weight: bold;
  1935. }
  1936. .txt {
  1937. margin-top: 8rpx;
  1938. color: #666666;
  1939. font-size: 22rpx;
  1940. }
  1941. }
  1942. .link {
  1943. position: absolute;
  1944. right: 0;
  1945. top: 50%;
  1946. transform: translateY(-50%);
  1947. display: flex;
  1948. align-items: center;
  1949. justify-content: center;
  1950. width: 114rpx;
  1951. height: 50rpx;
  1952. line-height: 50rpx;
  1953. background-image: linear-gradient(-90deg, var(--view-bntColor21) 0%, var(--view-bntColor21) 100%);
  1954. border-radius: 25rpx;
  1955. color: #fff;
  1956. }
  1957. }
  1958. .score-wrapper {
  1959. display: flex;
  1960. justify-content: space-between;
  1961. margin-top: 30rpx;
  1962. .item {
  1963. color: #948D8C;
  1964. font-size: 26rpx;
  1965. text {
  1966. margin-left: 10rpx;
  1967. color: var(--view-priceColor);
  1968. }
  1969. }
  1970. }
  1971. }
  1972. .con-box {
  1973. padding: 20rpx 0 20rpx 30rpx;
  1974. .title {
  1975. font-size: 28rpx;
  1976. color: #282828;
  1977. margin-bottom: 20rpx;
  1978. }
  1979. .img-box {
  1980. display: flex;
  1981. .img-item {
  1982. width: 206rpx;
  1983. margin-right: 15rpx;
  1984. image,uni-image {
  1985. width: 206rpx;
  1986. height: 206rpx;
  1987. border-radius: 16rpx;
  1988. }
  1989. .txt {
  1990. .title {
  1991. font-size: 28rpx;
  1992. color: #282828;
  1993. }
  1994. .price {
  1995. color: var(--view-priceColor);
  1996. font-size: 28rpx;
  1997. text {
  1998. font-size: 20rpx;
  1999. }
  2000. }
  2001. }
  2002. }
  2003. }
  2004. }
  2005. }
  2006. .head-wrapper {
  2007. z-index: 999;
  2008. display: flex;
  2009. align-items: center;
  2010. position: fixed;
  2011. left: 30rpx;
  2012. top: 0;
  2013. }
  2014. .head-menu {
  2015. display: flex;
  2016. align-items: center;
  2017. height: 58rpx;
  2018. width: 158rpx;
  2019. background: rgba(255,255,255,0.302);
  2020. border: 2rpx solid rgba(0,0,0,0.0588);
  2021. border-radius: 29rpx;
  2022. .iconfont {
  2023. flex: 1;
  2024. text-align: center;
  2025. color: #000000;
  2026. box-sizing: border-box;
  2027. &.icon-fanhui2 {
  2028. border-right: 1px solid rgba(0,0,0,0.2);;
  2029. }
  2030. }
  2031. }
  2032. .atmosphere {
  2033. &.share {
  2034. align-items: flex-start;
  2035. padding: 20rpx 0 0 !important;
  2036. .introduce {
  2037. flex: 1;
  2038. margin-top: 0;
  2039. }
  2040. }
  2041. }
  2042. </style>