index.vue 61 KB

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