index.vue 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907
  1. <template>
  2. <view :style="colorStyle">
  3. <skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
  4. bgcolor="#FFF"></skeleton>
  5. <!-- 头部 -->
  6. <!-- #ifdef APP-PLUS -->
  7. <view class="navbar" :style="{ height: navH + 'rpx', opacity: opacity, paddingTop: sysHeight + 'px;' }">
  8. <!-- #endif -->
  9. <!-- #ifndef APP-PLUS -->
  10. <view class='navbar' :style="{height:navH+'rpx',opacity:opacity}">
  11. <!-- #endif -->
  12. <view class='navbarH' :style='"height:"+navH+"rpx;"'>
  13. <view class='navbarCon acea-row row-center-wrapper'>
  14. <view class="header acea-row row-center-wrapper">
  15. <view class="item" :class="navActive === index ? 'on' : ''" v-for="(item,index) in navList"
  16. :key='index' @tap="tap(item,index)">
  17. {{ item }}
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- #ifdef APP-PLUS -->
  24. <view id="home" class="home-nav acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
  25. :style="{ top:(navH/2)+'rpx' ,marginTop:sysHeight + 'px;'}">
  26. <!-- #endif -->
  27. <!-- #ifndef APP-PLUS -->
  28. <view id="home" class="home-nav acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
  29. :style="{ top: (sysHeight+7.5) +'px'}">
  30. <!-- #endif -->
  31. <view class="iconfont icon-fanhui2" @tap="returns"></view>
  32. <!-- #ifdef MP -->
  33. <view class="line"></view>
  34. <view class="iconfont icon-gengduo5" @click="moreNav"></view>
  35. <!-- #endif -->
  36. </view>
  37. <!-- #ifdef APP-PLUS -->
  38. <view id="home" class="home-nav right acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
  39. :style="{ top:(navH/2)+'rpx' ,marginTop:sysHeight + 'px;'}">
  40. <!-- #endif -->
  41. <!-- #ifdef H5 -->
  42. <view id="home" class="home-nav right acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
  43. :style="{ top: homeTop +'rpx'}">
  44. <!-- #endif -->
  45. <!-- #ifdef APP-PLUS || H5 -->
  46. <view class="iconfont icon-gengduo2" @click="moreNav"></view>
  47. </view>
  48. <!-- #endif -->
  49. <homeList :navH="96" :returnShow="returnShow" :currentPage="currentPage" :sysHeight="sysHeight"></homeList>
  50. <view class='product-con skeleton' :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
  51. <scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
  52. :style="'height:'+height+'px;'" @scroll="scroll">
  53. <view id="past0">
  54. <!-- #ifdef APP-PLUS || MP -->
  55. <view class="" :style="'width:100%;' + 'height:'+sysHeight+'px;'"></view>
  56. <!-- #endif -->
  57. <productConSwiper class="skeleton-rect" :imgUrls='imgUrls'></productConSwiper>
  58. <view class="bg-color">
  59. <view class='nav acea-row row-between-wrapper'>
  60. <view class='money skeleton-rect'>¥<text class='num'>{{storeInfo.price}}</text>
  61. <text
  62. v-if="attribute.productAttr.length && (attribute.productAttr.length?attribute.productAttr[0].attr_values.length:0) > 1">起</text>
  63. <text class='y-money'>¥{{storeInfo.ot_price}}</text>
  64. </view>
  65. <view class='acea-row row-middle skeleton-rect'>
  66. <view class='timeItem' v-if="status == 1">
  67. <view>距秒杀结束仅剩</view>
  68. <countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '"
  69. :minute-text="' : '" :second-text="' '" :datatime="datatime"
  70. style="margin-top: 4rpx;"></countDown>
  71. </view>
  72. <!-- <view class="timeState" wx:if="{{status == 0}}">已结束</view>
  73. <view class="timeState" wx:if="{{status == 2}}">即将开始</view> -->
  74. <!-- <view class='iconfont icon-jiantou'></view> -->
  75. </view>
  76. </view>
  77. </view>
  78. <view class='wrapper'>
  79. <view class='introduce acea-row row-between'>
  80. <view class='infor skeleton-rect'>
  81. <span class='labelN' v-if="storeInfo.brand_name && storeInfo.brand_name.trim()">{{storeInfo.brand_name}}</span>
  82. {{storeInfo.title}}
  83. </view>
  84. <!-- <button class='iconfont icon-fenxiang' open-type='share'></button> -->
  85. <view class='iconfont icon-fenxiang skeleton-rect' @click="listenerActionSheet" v-if="base64Show"></view>
  86. </view>
  87. <view class='label acea-row row-middle skeleton-rect'>
  88. <!-- <view class='stock'>库存:{{storeInfo.stock}}{{storeInfo.unit_name}}</view> -->
  89. <view class='stock'>累计销售:{{storeInfo.total?storeInfo.total:0}}{{storeInfo.unit_name || ''}}
  90. </view>
  91. <view>限量: {{ storeInfo.quota_show ? storeInfo.quota_show : 0 }}{{storeInfo.unit_name || ''}}
  92. </view>
  93. </view>
  94. </view>
  95. <view class='attribute skeleton-rect'>
  96. <view v-if='attribute.productAttr.length' @tap='selecAttr' class="attrInfo">
  97. <view class="acea-row row-between-wrapper">
  98. <view class="attrValue line1">{{attr}}:<text class='atterTxt'>{{attrValue}}</text></view>
  99. <view class='iconfont icon-jiantou'></view>
  100. </view>
  101. <view class="acea-row row-between-wrapper mt7" v-if="skuArr.length > 1">
  102. <view class="flex">
  103. <image :src="item.image" v-for="(item,index) in skuArr.slice(0,4)" :key="index" class="attrImg"></image>
  104. </view>
  105. <view class="switchTxt">共{{skuArr.length}}种规格可选</view>
  106. </view>
  107. </view>
  108. <view class="storeInfo acea-row row-between row-top" v-if="isMention && storeLen && Object.keys(storeList).length>0" @tap="showStoreList">
  109. <view class="acea-row row-top row-between">
  110. 门店:
  111. <storeLis :num='1' :type="'seckill'" :ids="parseInt(storeInfo.id)" :storeList='storeList' @getStoreList="getStoreList"></storeLis>
  112. </view>
  113. <view class="iconfont icon-jiantou"></view>
  114. </view>
  115. </view>
  116. </view>
  117. <view class='userEvaluation skeleton-rect' id="past1" v-if="replyCount">
  118. <view class='title acea-row row-between-wrapper'>
  119. <view>用户评价({{replyCount}})</view>
  120. <navigator class='praise' hover-class='none'
  121. :url="'/pages/goods/goods_comment_list/index?product_id='+storeInfo.product_id">
  122. <text class='font-color'>{{replyChance}}%</text>好评率
  123. <text class='iconfont icon-jiantou'></text>
  124. </navigator>
  125. </view>
  126. <userEvaluation :reply="reply" @changeLogin="changeLogin"></userEvaluation>
  127. </view>
  128. <view class='product-intro' id="past2">
  129. <view class='title'>产品介绍</view>
  130. <view class='conter'>
  131. <!-- #ifndef APP-PLUS -->
  132. <jyf-parser :html="storeInfo.description" ref="article" :tag-style="tagStyle"></jyf-parser>
  133. <!-- #endif -->
  134. <!-- #ifdef APP-PLUS -->
  135. <view v-html="storeInfo.description"></view>
  136. <!-- #endif -->
  137. </view>
  138. </view>
  139. </scroll-view>
  140. <view class='footer acea-row row-between-wrapper'>
  141. <!-- #ifdef MP -->
  142. <!-- <button open-type="contact" hover-class='none' class='item'>
  143. <view class='iconfont icon-kefu'></view>
  144. <view class="p_center">客服</view>
  145. </button> -->
  146. <!-- #endif -->
  147. <!-- #ifndef MP -->
  148. <!-- <navigator hover-class="none" class="item" url="/pages/customer_list/chat">
  149. <view class="iconfont icon-kefu"></view>
  150. <view class="p_center">客服</view>
  151. </navigator> -->
  152. <!-- #endif -->
  153. <navigator hover-class="none" open-type="switchTab" class="item skeleton-rect" url="/pages/index/index">
  154. <view class="iconfont icon-shouye6"></view>
  155. <view class="p_center">首页</view>
  156. </navigator>
  157. <view @tap='setCollect' class='item skeleton-rect'>
  158. <view class='iconfont icon-shoucang1' v-if="storeInfo.userCollect"></view>
  159. <view class='iconfont icon-shoucang' v-else></view>
  160. <view class="p_center">收藏</view>
  161. </view>
  162. <view class="bnt acea-row skeleton-rect"
  163. v-if="status == 1 && attribute.productSelect.quota > 0 && attribute.productSelect.product_stock>0">
  164. <view class="joinCart bnts" @tap="openAlone">单独购买</view>
  165. <view class="buy bnts" @tap="goCat">立即购买</view>
  166. </view>
  167. <view class="bnt acea-row skeleton-rect"
  168. v-if="(status == 1 && attribute.productSelect.quota <= 0) || (status == 3 && attribute.productSelect.quota <= 0) || (status == 1 && attribute.productSelect.product_stock <= 0) || (status == 3 && attribute.productSelect.product_stock <= 0)">
  169. <view class="joinCart bnts" @tap="openAlone">单独购买</view>
  170. <view class="buy bnts bg-color-hui">已售罄</view>
  171. </view>
  172. <view class="bnt acea-row skeleton-rect" v-if="!dataShow && status == 1">
  173. <view class="joinCart bnts" @tap="openAlone">单独购买</view>
  174. <view class="buy bnts bg-color-hui">立即购买</view>
  175. </view>
  176. <view class="bnt acea-row skeleton-rect" v-if="status == 2">
  177. <view class="joinCart bnts" @tap="openAlone">单独购买</view>
  178. <view class="buy bnts bg-color-hui">未开始</view>
  179. </view>
  180. <view class="bnt acea-row skeleton-rect" v-if="status == 0">
  181. <view class="joinCart bnts" @tap="openAlone">单独购买</view>
  182. <view class="buy bnts bg-color-hui">已结束</view>
  183. </view>
  184. </view>
  185. </view>
  186. <product-window ref='productWindow' :attr='attribute' :limitNum='1' :cusPreviewImg='1' :productType="storeInfo.product_type" :productId="storeInfo.id" @myevent="onMyEvent" @ChangeAttr="ChangeAttr" :type="'seckill'"
  187. @ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" @getImg="showImg" @deliveryFun="deliveryFun" @onAddressId="onAddressId" @onstoreId="onstoreId"></product-window>
  188. <!-- 分享按钮 -->
  189. <view class="generate-posters" :class="posters ? 'on' : ''">
  190. <view class="generateCon acea-row row-middle">
  191. <!-- #ifndef MP -->
  192. <button class="item" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
  193. <!-- <button class="item" hover-class='none' v-if="weixinStatus === true" @click="setShareInfoStatus"> -->
  194. <!-- <view class="iconfont icon-weixin3"></view> -->
  195. <view class="pictrue">
  196. <image src="../../../static/images/weixin.png"></image>
  197. </view>
  198. <view class="">分享给好友</view>
  199. </button>
  200. <!-- #endif -->
  201. <!-- #ifdef MP -->
  202. <button class="item" open-type="share" hover-class='none'>
  203. <!-- <view class="iconfont icon-weixin3"></view> -->
  204. <view class="pictrue">
  205. <image src="../../../static/images/weixin.png"></image>
  206. </view>
  207. <view class="">分享给好友</view>
  208. </button>
  209. <!-- #endif -->
  210. <!-- #ifdef APP-PLUS -->
  211. <view class="item" @click="appShare('WXSceneSession')">
  212. <!-- <view class="iconfont icon-weixin3"></view> -->
  213. <view class="pictrue">
  214. <image src="../../../static/images/weixin.png"></image>
  215. </view>
  216. <view class="">分享给好友</view>
  217. </view>
  218. <!-- <view class="item" @click="appShare('WXSenceTimeline')">
  219. <view class="iconfont icon-pengyouquan"></view>
  220. <view class="">微信朋友圈</view>
  221. </view> -->
  222. <!-- #endif -->
  223. <view class="item" @click="getpreviewImage">
  224. <view class="pictrue">
  225. <image src="../../../static/images/changan.png"></image>
  226. </view>
  227. <view class="">预览发图</view>
  228. </view>
  229. <!-- #ifndef H5 -->
  230. <button class="item" hover-class='none' @tap="savePosterPath">
  231. <!-- <view class="iconfont icon-haibao"></view> -->
  232. <view class="pictrue">
  233. <image src="../../../static/images/haibao.png"></image>
  234. </view>
  235. <view class="">保存海报</view>
  236. </button>
  237. <!-- #endif -->
  238. </view>
  239. <view class="generateClose acea-row row-center-wrapper" @click="posterImageClose">取消</view>
  240. </view>
  241. <view class="mask" v-if="posters"></view>
  242. <!-- 海报展示 -->
  243. <view class='poster-pop' v-if="posterImageStatus">
  244. <!-- <image src='/static/images/poster-close.png' class='close' @click="posterImageClose"></image> -->
  245. <image :src='posterImage'></image>
  246. <!-- #ifndef H5 -->
  247. <!-- <view class='save-poster' @click="savePosterPath">保存到手机</view> -->
  248. <!-- #endif -->
  249. <!-- #ifdef H5 -->
  250. <!-- <view class="keep">长按图片可以保存到手机</view> -->
  251. <!-- #endif -->
  252. </view>
  253. <view class='mask1' v-if="posterImageStatus"></view>
  254. <canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
  255. <kefuIcon :ids='storeInfo.product_id' :routineContact='routineContact'></kefuIcon>
  256. <!-- 发送给朋友图片 -->
  257. <view class="share-box" v-if="H5ShareBox">
  258. <image :src="imgHost + '/statics/images/share-info.png'" @click="H5ShareBox = false"></image>
  259. </view>
  260. <!-- #ifdef H5 || APP-PLUS -->
  261. <zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="codeVal" :size="size" :unit="unit" :background="background"
  262. :foreground="foreground" :pdground="pdground" :icon="codeIcon" :iconSize="iconsize" :onval="onval"
  263. :loadMake="loadMake" @result="qrR" />
  264. <!-- #endif -->
  265. <cusPreviewImg ref="cusPreviewImg" :list="skuArr" @changeSwitch="changeSwitch"></cusPreviewImg>
  266. <!-- #ifdef MP -->
  267. <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  268. <!-- #endif -->
  269. </view>
  270. </template>
  271. <script>
  272. const app = getApp();
  273. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  274. import zbCode from '@/components/zb-code/zb-code.vue'
  275. import {
  276. mapGetters
  277. } from "vuex";
  278. import {
  279. getSeckillDetail,
  280. seckillCode,
  281. seckillQRCode
  282. } from '@/api/activity.js';
  283. import {
  284. postCartAdd,
  285. collectAdd,
  286. collectDel
  287. } from '@/api/store.js';
  288. import storeLis from '@/components/storeLis';
  289. import productConSwiper from '@/components/productConSwiper/index.vue'
  290. import productWindow from '@/components/productWindow/index.vue'
  291. import userEvaluation from '@/components/userEvaluation/index.vue'
  292. import kefuIcon from '@/components/kefuIcon';
  293. import cusPreviewImg from '@/components/cusPreviewImg';
  294. import homeList from '@/components/homeList'
  295. import parser from "@/components/jyf-parser/jyf-parser";
  296. import countDown from '@/components/countDown';
  297. import {
  298. imageBase64
  299. } from "@/api/public";
  300. import {
  301. toLogin
  302. } from '@/libs/login.js';
  303. import {
  304. silenceBindingSpread
  305. } from "@/utils";
  306. import {
  307. getUserInfo
  308. } from '@/api/user.js';
  309. import {
  310. TOKENNAME,
  311. HTTP_REQUEST_URL
  312. } from '@/config/app.js';
  313. import {Debounce} from '@/utils/validate.js'
  314. import colors from '@/mixins/color.js';
  315. export default {
  316. computed: mapGetters(['isLogin']),
  317. mixins:[colors],
  318. data() {
  319. return {
  320. showSkeleton: true, //骨架屏显示隐藏
  321. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  322. dataShow: 0,
  323. id: 0,
  324. time: 0,
  325. countDownHour: "00",
  326. countDownMinute: "00",
  327. countDownSecond: "00",
  328. storeInfo: {
  329. brand_name:''
  330. },
  331. imgUrls: [],
  332. parameter: {
  333. 'navbar': '1',
  334. 'return': '1',
  335. 'title': '抢购详情页',
  336. 'color': false
  337. },
  338. attribute: {
  339. cartAttr: false,
  340. productAttr: [],
  341. productSelect: {},
  342. deliveryType:[],
  343. isType:0,
  344. relation_id:0,
  345. store_self_mention:0
  346. },
  347. productValue: [],
  348. isOpen: false,
  349. attr: '请选择',
  350. attrValue: '',
  351. status: 1,
  352. time_id: 0,
  353. isAuto: false,
  354. isShowAuth: false,
  355. iShidden: false,
  356. limitNum: 1, //限制本属性产品的个数;
  357. iSplus: false,
  358. replyCount: 0, //总评论数量
  359. reply: [], //评论列表
  360. replyChance: 0,
  361. navH: "",
  362. navList: ['商品', '评价', '详情'],
  363. opacity: 0,
  364. scrollY: 0,
  365. topArr: [],
  366. toView: '',
  367. height: 0,
  368. heightArr: [],
  369. lock: false,
  370. scrollTop: 0,
  371. tagStyle: {
  372. img: 'width:100%;display:block;',
  373. table: 'width:100%',
  374. video: 'width:100%'
  375. },
  376. datatime: 0,
  377. navActive: 0,
  378. meunHeight: 0,
  379. backH: '',
  380. posters: false,
  381. weixinStatus: false,
  382. posterImageStatus: false,
  383. canvasStatus: false, //海报绘图标签
  384. storeImage: '', //海报产品图
  385. PromotionCode: '', //二维码图片
  386. posterImage: '', //海报路径
  387. posterbackgd: '/static/images/posterbackgd.png',
  388. actionSheetHidden: false,
  389. cart_num: '',
  390. homeTop: 20,
  391. returnShow: true,
  392. H5ShareBox: false, //公众号分享图片
  393. routineContact: 0,
  394. siteName:'', //商城名称
  395. themeColor:'',
  396. fontColor:'',
  397. skuArr:[],
  398. //二维码参数
  399. codeShow: false,
  400. cid: '1',
  401. codeVal: "", // 要生成的二维码值
  402. size: 200, // 二维码大小
  403. unit: 'upx', // 单位
  404. background: '#FFF', // 背景色
  405. foreground: '#000', // 前景色
  406. pdground: '#000', // 角标色
  407. codeIcon: '', // 二维码图标
  408. iconsize: 40, // 二维码图标大小
  409. lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  410. onval: true, // val值变化时自动重新生成二维码
  411. loadMake: true, // 组件加载完成后自动生成二维码
  412. base64Show: 0,
  413. shareQrcode: 0,
  414. followCode:'',
  415. selectSku:{},
  416. currentPage:false,
  417. sysHeight: sysHeight,
  418. isMention: false, //是否存在到店自提
  419. storeLen:1,
  420. imgHost:HTTP_REQUEST_URL,
  421. addressId:'',
  422. store_id :'',
  423. delivery_type:0,
  424. store_name:'',
  425. posterTitle:'',
  426. storeList:{}
  427. }
  428. },
  429. components: {
  430. zbCode,
  431. storeLis,
  432. productConSwiper,
  433. 'productWindow': productWindow,
  434. userEvaluation,
  435. kefuIcon,
  436. cusPreviewImg,
  437. "jyf-parser": parser,
  438. countDown,
  439. homeList
  440. },
  441. computed: mapGetters(['isLogin']),
  442. watch: {
  443. isLogin: {
  444. handler: function(newV, oldV) {
  445. if (newV) {
  446. // this.getSeckillDetail();
  447. }
  448. },
  449. deep: true
  450. }
  451. },
  452. onLoad(options) {
  453. let that = this
  454. let statusBarHeight = ''
  455. var pages = getCurrentPages();
  456. that.returnShow = pages.length === 1 ? false : true;
  457. that.navH = app.globalData.navHeight;
  458. // // #ifndef MP
  459. // that.navH = 96 ;
  460. // // #endif
  461. //设置商品列表高度
  462. uni.getSystemInfo({
  463. success: function(res) {
  464. that.height = res.windowHeight
  465. statusBarHeight = res.statusBarHeight
  466. //res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度;
  467. },
  468. });
  469. this.isLogin && silenceBindingSpread();
  470. // #ifdef MP
  471. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  472. this.meunHeight = menuButtonInfo.height
  473. this.backH = (that.navH / 2) + (this.meunHeight / 2)
  474. //扫码携带参数处理
  475. if (options.scene) {
  476. let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
  477. if (value.id) {
  478. this.id = value.id;
  479. } else {
  480. this.showSkeleton = false;
  481. return this.$util.Tips({
  482. title: '缺少参数无法查看商品'
  483. }, {
  484. tab: 3,
  485. url: 1
  486. });
  487. }
  488. //记录推广人uid
  489. if (value.spid) app.globalData.spid = value.spid;
  490. // if (value.time) this.datatime = value.time
  491. }
  492. // #endif
  493. if (options.id) {
  494. this.id = options.id
  495. // this.status = options.status
  496. this.time_id = options.time_id || 0
  497. //记录推广人uid
  498. if (options.spid) app.globalData.spid = options.spid;
  499. // if (options.time) this.datatime = Number(options.time);
  500. }
  501. this.getSeckillDetail();
  502. if (this.isLogin && options.id) {
  503. // #ifdef MP
  504. that.downloadFilePromotionCode();
  505. // #endif
  506. }
  507. this.$nextTick(() => {
  508. // #ifdef MP
  509. const menuButton = uni.getMenuButtonBoundingClientRect();
  510. const query = uni.createSelectorQuery().in(this);
  511. query
  512. .select('#home')
  513. .boundingClientRect(data => {
  514. this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
  515. })
  516. .exec();
  517. // #endif
  518. })
  519. this.colorData();
  520. let color = [
  521. {themeColor:'#1DB0FC',fontColor:'#FD502F'},
  522. {themeColor:'#42CA4D',fontColor:'#FF7600'},
  523. {themeColor:'#e93323',fontColor:'#e93323'},
  524. {themeColor:'#FF448F',fontColor:'#FF448F'},
  525. {themeColor:'#FE5C2D',fontColor:'#FE5C2D'},
  526. {themeColor:'#E0A558',fontColor:'#DA8C18'}
  527. ];
  528. setTimeout(()=>{
  529. switch (this.colorNum) {
  530. case 1:
  531. this.themeColor = color[0].themeColor;
  532. this.fontColor = color[0].fontColor;
  533. break;
  534. case 2:
  535. this.themeColor = color[1].themeColor;
  536. this.fontColor = color[1].fontColor;
  537. break;
  538. case 3:
  539. this.themeColor = color[2].themeColor;
  540. this.fontColor = color[2].fontColor;
  541. break;
  542. case 4:
  543. this.themeColor = color[3].themeColor;
  544. this.fontColor = color[3].fontColor;
  545. break;
  546. case 5:
  547. this.themeColor = color[4].themeColor;
  548. this.fontColor = color[4].fontColor;
  549. break;
  550. case 6:
  551. this.themeColor = color[5].themeColor;
  552. this.fontColor = color[5].fontColor;
  553. break;
  554. default:
  555. this.themeColor = color[2].themeColor;
  556. this.fontColor = color[2].fontColor;
  557. break
  558. }
  559. },1)
  560. },
  561. onReady(){
  562. this.isNodes++;
  563. // #ifdef H5
  564. this.codeVal = window.location.origin + '/pages/activity/goods_seckill_details/index?id=' + this.id +
  565. '&spid=' + this.$store.state.app.uid
  566. // #endif
  567. // #ifdef APP-PLUS
  568. this.codeVal = HTTP_REQUEST_URL + '/pages/activity/goods_seckill_details/index?id=' + this.id +
  569. '&spid=' + this.$store.state.app.uid
  570. // #endif
  571. },
  572. onShow(){
  573. uni.removeStorageSync('form_type_cart');
  574. },
  575. mounted(){
  576. uni.$on('activeFn', data => {
  577. let id = data.id;
  578. this.store_id = id;
  579. this.$refs.productWindow.getList(id);
  580. })
  581. },
  582. methods: {
  583. seckillQRCode(type) {
  584. seckillQRCode(this.id).then(res => {
  585. this.followCode = res.data.code_base;
  586. this.getImageBase64(type);
  587. });
  588. },
  589. changeLogin(){
  590. this.getIsLogin();
  591. },
  592. onLoadFun: function(data) {
  593. this.downloadFilePromotionCode();
  594. this.isShowAuth = false;
  595. },
  596. getIsLogin(){
  597. // #ifndef MP
  598. toLogin()
  599. // #endif
  600. // #ifdef MP
  601. this.isShowAuth = true;
  602. // #endif
  603. },
  604. // 授权关闭
  605. authColse: function(e) {
  606. this.isShowAuth = e
  607. },
  608. // 获取配送方式
  609. deliveryFun(e){
  610. this.delivery_type = e;
  611. },
  612. // 获取配送地址id
  613. onAddressId(row){
  614. this.addressId=row.id
  615. },
  616. // 获取自提地址id
  617. onstoreId(row) {
  618. this.storeList = row;
  619. this.store_id = row.id;
  620. this.store_name = row.name;
  621. },
  622. getStoreList(len){
  623. this.storeLen = len;
  624. },
  625. showStoreList(){
  626. uni.navigateTo({
  627. url: '/pages/store/store_list/index?productId='+this.id+'&type=1&isCollage=1'
  628. })
  629. },
  630. moreNav(){
  631. this.currentPage = !this.currentPage
  632. },
  633. //点击sku图片打开轮播图
  634. showImg(index){
  635. this.$refs.cusPreviewImg.open(this.selectSku.suk)
  636. },
  637. //滑动轮播图选择商品
  638. changeSwitch(e){
  639. let productSelect = this.skuArr[e];
  640. this.$set(this,'selectSku',productSelect);
  641. var skuList = productSelect.suk.split(',');
  642. skuList.forEach((i,index)=>{
  643. this.$set(this.attribute.productAttr[index],'index',skuList[index]);
  644. })
  645. if (productSelect) {
  646. this.$set(this.attribute.productSelect, "image", productSelect.image);
  647. this.$set(this.attribute.productSelect, "price", productSelect.price);
  648. this.$set(this.attribute.productSelect, "stock", productSelect.stock);
  649. this.$set(this.attribute.productSelect, "unique", productSelect.unique);
  650. this.$set(this.attribute.productSelect, "cart_num", 1);
  651. this.$set(this.attribute.productSelect, "quota", productSelect.quota);
  652. this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
  653. this.$set(this, "attrValue", productSelect.suk);
  654. this.attrTxt = "已选择"
  655. }
  656. },
  657. qrR(res) {
  658. // #ifdef H5
  659. if(!this.$wechat.isWeixin() || this.shareQrcode != '1'){
  660. this.PromotionCode = res;
  661. this.followCode = ''
  662. }
  663. // #endif
  664. // #ifdef APP-PLUS
  665. this.PromotionCode = res;
  666. // #endif
  667. },
  668. // 图片预览;
  669. getpreviewImage: function() {
  670. if(this.posterImage){
  671. let photoList = [];
  672. photoList.push(this.posterImage)
  673. uni.previewImage({
  674. urls: photoList,
  675. current: this.posterImage
  676. });
  677. }else{
  678. his.$util.Tips({
  679. title: '您的海报尚未生成'
  680. });
  681. }
  682. },
  683. // app分享
  684. // #ifdef APP-PLUS
  685. appShare(scene) {
  686. let that = this
  687. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  688. let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
  689. uni.share({
  690. provider: "weixin",
  691. scene: scene,
  692. type: 0,
  693. href: `${HTTP_REQUEST_URL}${curRoute}`,
  694. title: that.storeInfo.title,
  695. summary: that.storeInfo.info,
  696. imageUrl: that.storeInfo.small_image,
  697. success: function(res) {
  698. uni.showToast({
  699. title: '分享成功',
  700. icon: 'success'
  701. })
  702. // that.posters = false;
  703. },
  704. fail: function(err) {
  705. uni.showToast({
  706. title: '分享失败',
  707. icon: 'none',
  708. duration: 2000
  709. })
  710. // that.posters = false;
  711. }
  712. });
  713. },
  714. // #endif
  715. /**
  716. * 购物车手动填写
  717. *
  718. */
  719. iptCartNum: function(e) {
  720. this.$set(this.attribute.productSelect, 'cart_num', e);
  721. this.$set(this, "cart_num", e);
  722. },
  723. // 后退
  724. returns: function() {
  725. // #ifdef H5
  726. return history.back();
  727. // #endif
  728. // #ifndef H5
  729. return uni.navigateBack({
  730. delta: 1,
  731. })
  732. // #endif
  733. },
  734. getSeckillDetail: function() {
  735. let that = this;
  736. getSeckillDetail(that.id, {time_id : that.time_id}).then(res => {
  737. that.$set(that.attribute, 'isType', res.data.storeInfo.type);
  738. that.$set(that.attribute, 'relation_id', res.data.storeInfo.relation_id);
  739. that.$set(that.attribute, 'store_self_mention', res.data.store_self_mention);
  740. this.dataShow = 1;
  741. let title = res.data.storeInfo.title;
  742. this.storeInfo = res.data.storeInfo;
  743. this.datatime = Number(res.data.storeInfo.last_time);
  744. this.status = res.data.storeInfo.status;
  745. this.imgUrls = res.data.storeInfo.images;
  746. that.$set(that, 'posterTitle', res.data.product_poster_title);
  747. if(this.storeInfo.description){
  748. this.storeInfo.description = this.storeInfo.description.replace(/<img/gi,
  749. '<img style="max-width:100%;height:auto;float:left;display:block" ');
  750. this.storeInfo.description = this.storeInfo.description.replace(
  751. /<video/gi,
  752. '<video style="width:100%;height:auto;display:block" '
  753. );
  754. }
  755. this.attribute.productAttr = res.data.productAttr;
  756. if (res.data.storeInfo.delivery_type.indexOf('2') != -1) {
  757. that.$set(that, 'isMention', true);
  758. }
  759. this.productValue = res.data.productValue;
  760. for(let key in res.data.productValue){
  761. let obj = res.data.productValue[key];
  762. that.skuArr.push(obj)
  763. }
  764. that.selectSku = that.skuArr[0];
  765. res.data.storeInfo.delivery_type.sort((x,y)=>x - y);
  766. that.$set(that.attribute, 'deliveryType', res.data.storeInfo.delivery_type);
  767. this.attribute.productSelect.num = res.data.storeInfo.num;
  768. this.attribute.productSelect.once_num = res.data.storeInfo.once_num;
  769. this.replyCount = res.data.replyCount;
  770. this.reply = res.data.reply;
  771. this.replyChance = res.data.replyChance;
  772. this.shareQrcode = res.data.share_qrcode;
  773. that.routineContact = Number(res.data.routine_contact_type);
  774. uni.setNavigationBarTitle({
  775. title: title.substring(0, 7) + '...'
  776. });
  777. that.siteName = res.data.site_name;
  778. var navList = ['商品', '详情'];
  779. if(res.data.replyCount){
  780. navList.splice(1, 0, '评价');
  781. }
  782. that.$set(that, 'navList', navList);
  783. // #ifdef H5
  784. that.storeImage = that.storeInfo.image
  785. if(this.$wechat.isWeixin() && this.shareQrcode=='1'){
  786. // that.followCode = that.storeInfo.code_base
  787. // that.getImageBase64(1);
  788. that.seckillQRCode(1);
  789. }else{
  790. that.getImageBase64();
  791. // that.seckillQRCode();
  792. }
  793. that.setShare();
  794. // #endif
  795. // #ifndef H5
  796. that.downloadFilestoreImage();
  797. // #endif
  798. that.DefaultSelect();
  799. setTimeout(function() {
  800. that.infoScroll();
  801. }, 500);
  802. app.globalData.openPages = '/pages/activity/goods_seckill_details/index?id=' + that.id +
  803. '&time=' + that.time +
  804. '&status=' + that.status + '&spid=' + that.storeInfo.uid;
  805. // wxParse.wxParse('description', 'html', that.data.storeInfo.description || '', that, 0);
  806. // wxh.time(that.data.time, that);
  807. setTimeout(() => {
  808. that.showSkeleton = false
  809. }, 300)
  810. }).catch(err => {
  811. that.$util.Tips({
  812. title: err
  813. }, {
  814. tab: 3
  815. })
  816. });
  817. },
  818. setShare: function() {
  819. this.$wechat.isWeixin() &&
  820. this.$wechat.wechatEvevt([
  821. "updateAppMessageShareData",
  822. "updateTimelineShareData",
  823. "onMenuShareAppMessage",
  824. "onMenuShareTimeline"
  825. ], {
  826. desc: this.storeInfo.info,
  827. title: this.storeInfo.title,
  828. link: location.href,
  829. imgUrl: this.storeInfo.image
  830. }).then(res => {}).catch(err => {});
  831. },
  832. /**
  833. * 默认选中属性
  834. *
  835. */
  836. DefaultSelect: function() {
  837. let self = this
  838. let productAttr = self.attribute.productAttr;
  839. let value = [];
  840. for (var key in this.productValue) {
  841. if (this.productValue[key].quota > 0) {
  842. value = this.attribute.productAttr.length ? key.split(",") : [];
  843. break;
  844. }
  845. }
  846. for (let i = 0; i < productAttr.length; i++) {
  847. this.$set(productAttr[i], "index", value[i]);
  848. }
  849. //sort();排序函数:数字-英文-汉字;
  850. let productSelect = this.productValue[value.join(",")];
  851. if (productSelect && productAttr.length) {
  852. self.$set(
  853. self.attribute.productSelect,
  854. "store_name",
  855. self.storeInfo.title
  856. );
  857. self.$set(self.attribute.productSelect, "image", productSelect.image);
  858. self.$set(self.attribute.productSelect, "price", productSelect.price);
  859. self.$set(self.attribute.productSelect, "stock", productSelect.stock);
  860. self.$set(self.attribute.productSelect, "unique", productSelect.unique);
  861. self.$set(self.attribute.productSelect, "quota", productSelect.quota);
  862. self.$set(self.attribute.productSelect, "quota_show", productSelect.quota_show);
  863. self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
  864. self.$set(self.attribute.productSelect, "cart_num", 1);
  865. self.$set(self, "attrValue", value.join(","));
  866. self.attrValue = value.join(",")
  867. } else if (!productSelect && productAttr.length) {
  868. self.$set(
  869. self.attribute.productSelect,
  870. "store_name",
  871. self.storeInfo.title
  872. );
  873. self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
  874. self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
  875. self.$set(self.attribute.productSelect, "quota", 0);
  876. self.$set(self.attribute.productSelect, "quota_show", 0);
  877. self.$set(self.attribute.productSelect, "product_stock", 0);
  878. self.$set(self.attribute.productSelect, "stock", 0);
  879. self.$set(self.attribute.productSelect, "unique", "");
  880. self.$set(self.attribute.productSelect, "cart_num", 0);
  881. self.$set(self, "attrValue", "");
  882. self.$set(self, "attrTxt", "请选择");
  883. } else if (!productSelect && !productAttr.length) {
  884. self.$set(
  885. self.attribute.productSelect,
  886. "store_name",
  887. self.storeInfo.title
  888. );
  889. self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
  890. self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
  891. self.$set(self.attribute.productSelect, "stock", self.storeInfo.stock);
  892. self.$set(self.attribute.productSelect, "quota", self.storeInfo.quota);
  893. self.$set(self.attribute.productSelect, "product_stock", self.storeInfo.product_stock);
  894. self.$set(
  895. self.attribute.productSelect,
  896. "unique",
  897. self.storeInfo.unique || ""
  898. );
  899. self.$set(self.attribute.productSelect, "cart_num", 1);
  900. self.$set(self.attribute.productSelect, "quota", productSelect.quota);
  901. self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
  902. self.$set(self, "attrValue", "");
  903. self.$set(self, "attrTxt", "请选择");
  904. }
  905. },
  906. selecAttr: function() {
  907. if(!this.isLogin){
  908. //#ifndef MP
  909. toLogin();
  910. //#endif
  911. //#ifdef MP
  912. this.isShowAuth = true;
  913. //#endif
  914. return
  915. }
  916. if((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')){
  917. this.$refs.productWindow.showLocation();
  918. }
  919. this.currentPage = false;
  920. this.attribute.cartAttr = true
  921. },
  922. onMyEvent: function() {
  923. this.$set(this.attribute, 'cartAttr', false);
  924. this.$set(this, 'isOpen', false);
  925. },
  926. /**
  927. * 购物车数量加和数量减
  928. *
  929. */
  930. ChangeCartNum: function(changeValue) {
  931. //changeValue:是否 加|减
  932. //获取当前变动属性
  933. let productSelect = this.productValue[this.attrValue];
  934. if (this.cart_num) {
  935. productSelect.cart_num = this.cart_num;
  936. this.attribute.productSelect.cart_num = this.cart_num;
  937. }
  938. //如果没有属性,赋值给商品默认库存
  939. if (productSelect === undefined && !this.attribute.productAttr.length)
  940. productSelect = this.attribute.productSelect;
  941. //无属性值即库存为0;不存在加减;
  942. if (productSelect === undefined) return;
  943. let stock = productSelect.stock || 0;
  944. let quotaShow = productSelect.quota_show || 0;
  945. let quota = productSelect.quota || 0;
  946. let productStock = productSelect.product_stock || 0;
  947. let num = this.attribute.productSelect;
  948. let nums = this.storeInfo.num || 0;
  949. let onceNum = this.storeInfo.once_num || 0;
  950. //设置默认数据
  951. if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
  952. if (changeValue) {
  953. num.cart_num++;
  954. let arrMin = [];
  955. arrMin.push(nums);
  956. arrMin.push(onceNum);
  957. arrMin.push(quota);
  958. arrMin.push(productStock);
  959. let minN = Math.min.apply(null, arrMin);
  960. if (num.cart_num >= minN) {
  961. this.$set(this.attribute.productSelect, "cart_num", minN ? minN : 1);
  962. this.$set(this, "cart_num", minN ? minN : 1);
  963. }
  964. // if(quotaShow >= productStock){
  965. // if (num.cart_num > productStock) {
  966. // this.$set(this.attribute.productSelect, "cart_num", productStock);
  967. // this.$set(this, "cart_num", productStock);
  968. // }
  969. // }else{
  970. // if (num.cart_num > quotaShow) {
  971. // this.$set(this.attribute.productSelect, "cart_num", quotaShow);
  972. // this.$set(this, "cart_num", quotaShow);
  973. // }
  974. // }
  975. this.$set(this, "cart_num", num.cart_num);
  976. this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
  977. } else {
  978. num.cart_num--;
  979. if (num.cart_num < 1) {
  980. this.$set(this.attribute.productSelect, "cart_num", 1);
  981. this.$set(this, "cart_num", 1);
  982. }
  983. this.$set(this, "cart_num", num.cart_num);
  984. this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
  985. }
  986. },
  987. attrVal(val) {
  988. this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attr_values[val
  989. .indexn];
  990. },
  991. /**
  992. * 属性变动赋值
  993. *
  994. */
  995. ChangeAttr: function(res) {
  996. this.$set(this, 'cart_num', 1);
  997. let productSelect = this.productValue[res];
  998. this.$set(this, "selectSku", productSelect);
  999. if (productSelect) {
  1000. this.$set(this.attribute.productSelect, "image", productSelect.image);
  1001. this.$set(this.attribute.productSelect, "price", productSelect.price);
  1002. this.$set(this.attribute.productSelect, "stock", productSelect.stock);
  1003. this.$set(this.attribute.productSelect, "unique", productSelect.unique);
  1004. this.$set(this.attribute.productSelect, "cart_num", 1);
  1005. this.$set(this.attribute.productSelect, "quota", productSelect.quota);
  1006. this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
  1007. this.$set(this, "attrValue", res);
  1008. this.attrTxt = "已选择"
  1009. } else {
  1010. this.$set(this.attribute.productSelect, "image", this.storeInfo.image);
  1011. this.$set(this.attribute.productSelect, "price", this.storeInfo.price);
  1012. this.$set(this.attribute.productSelect, "stock", 0);
  1013. this.$set(this.attribute.productSelect, "unique", "");
  1014. this.$set(this.attribute.productSelect, "cart_num", 0);
  1015. this.$set(this.attribute.productSelect, "quota", 0);
  1016. this.$set(this.attribute.productSelect, "quota_show", 0);
  1017. this.$set(this, "attrValue", "");
  1018. this.attrTxt = "已选择"
  1019. }
  1020. },
  1021. scroll: function(e) {
  1022. var that = this,
  1023. scrollY = e.detail.scrollTop;
  1024. var opacity = scrollY / 200;
  1025. opacity = opacity > 1 ? 1 : opacity;
  1026. that.opacity = opacity
  1027. that.scrollY = scrollY
  1028. that.currentPage = false;
  1029. if (that.lock) {
  1030. that.lock = false
  1031. return;
  1032. }
  1033. for (var i = 0; i < that.topArr.length; i++) {
  1034. if (scrollY < that.topArr[i] - (app.globalData.navHeight / 2) + that.heightArr[i]) {
  1035. that.navActive = i
  1036. break
  1037. }
  1038. }
  1039. },
  1040. tap: function(item, index) {
  1041. var id = item.id;
  1042. var index = index;
  1043. var that = this;
  1044. if (!this.replyCount && id == "past1") {
  1045. id = "past2"
  1046. }
  1047. this.toView = id;
  1048. this.navActive = index;
  1049. this.lock = true;
  1050. this.scrollTop = index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[index]
  1051. },
  1052. infoScroll: function() {
  1053. var that = this,
  1054. topArr = [],
  1055. heightArr = [];
  1056. for (var i = 0; i < that.navList.length; i++) { //productList
  1057. //获取元素所在位置
  1058. var query = wx.createSelectorQuery().in(this);
  1059. var idView = "#past" + i;
  1060. if(!this.replyCount && i == 1){
  1061. idView = "#past" + 2;
  1062. }
  1063. query.select(idView).boundingClientRect();
  1064. query.exec(function(res) {
  1065. var top = res[0].top;
  1066. var height = res[0].height;
  1067. topArr.push(top);
  1068. heightArr.push(height);
  1069. that.topArr = topArr
  1070. that.heightArr = heightArr
  1071. });
  1072. };
  1073. },
  1074. /**
  1075. * 收藏商品
  1076. */
  1077. setCollect: Debounce(function() {
  1078. var that = this;
  1079. if (this.storeInfo.userCollect) {
  1080. collectDel(this.storeInfo.product_id).then(res => {
  1081. that.storeInfo.userCollect = !that.storeInfo.userCollect
  1082. })
  1083. } else {
  1084. collectAdd(this.storeInfo.product_id).then(res => {
  1085. that.storeInfo.userCollect = !that.storeInfo.userCollect
  1086. })
  1087. }
  1088. }),
  1089. /*
  1090. * 单独购买
  1091. */
  1092. openAlone: Debounce(function() {
  1093. uni.navigateTo({
  1094. url: `/pages/goods_details/index?id=${this.storeInfo.product_id}`
  1095. })
  1096. }),
  1097. /*
  1098. * 下订单
  1099. */
  1100. goCat: function() {
  1101. if(this.isLogin){
  1102. if((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')){
  1103. this.$refs.productWindow.showLocation();
  1104. }
  1105. var that = this;
  1106. that.currentPage = false;
  1107. var productSelect = this.productValue[this.attrValue];
  1108. //打开属性
  1109. if (this.isOpen)
  1110. this.attribute.cartAttr = true
  1111. else
  1112. this.attribute.cartAttr = !this.attribute.cartAttr
  1113. //只有关闭属性弹窗时进行加入购物车
  1114. if (this.attribute.cartAttr === true && this.isOpen == false) return this.isOpen = true
  1115. //如果有属性,没有选择,提示用户选择
  1116. if (this.attribute.productAttr.length && productSelect === undefined && this.isOpen == true) return app
  1117. .$util.Tips({
  1118. title: '请选择属性'
  1119. });
  1120. postCartAdd({
  1121. productId: that.storeInfo.product_id,
  1122. secKillId: that.id,
  1123. bargainId: 0,
  1124. combinationId: 0,
  1125. cartNum: that.cart_num,
  1126. uniqueId: productSelect !== undefined ? productSelect.unique : '',
  1127. 'new': 1,
  1128. store_id:this.store_id,
  1129. addressId:this.addressId,
  1130. delivery_type:this.delivery_type
  1131. }).then(res => {
  1132. this.isOpen = false
  1133. uni.navigateTo({
  1134. url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cartId+'&delivery_type='+that.delivery_type+'&addressId='+that.addressId+'&store_id='+that.store_id+'&store_name='+that.store_name+'&product_id=' + that.storeInfo.id
  1135. });
  1136. }).catch(err => {
  1137. return this.$util.Tips({
  1138. title: err
  1139. });
  1140. });
  1141. }else{
  1142. this.getIsLogin();
  1143. }
  1144. },
  1145. /**
  1146. * 分享打开
  1147. *
  1148. */
  1149. listenerActionSheet: function() {
  1150. this.currentPage = false
  1151. if (this.isLogin === false) {
  1152. this.getIsLogin();
  1153. } else {
  1154. // #ifdef H5
  1155. if (this.$wechat.isWeixin() === true) {
  1156. this.weixinStatus = true;
  1157. }
  1158. // #endif
  1159. this.posters = true;
  1160. this.goPoster();
  1161. }
  1162. },
  1163. // 分享关闭
  1164. listenerActionClose: function() {
  1165. this.posters = false;
  1166. },
  1167. //隐藏海报
  1168. posterImageClose: function() {
  1169. this.posterImageStatus = false;
  1170. this.posters = false;
  1171. },
  1172. //替换安全域名
  1173. setDomain: function(url) {
  1174. url = url ? url.toString() : '';
  1175. //本地调试打开,生产请注销
  1176. if (url.indexOf("https://") > -1) return url;
  1177. else return url.replace('http://', 'https://');
  1178. },
  1179. //获取海报产品图
  1180. downloadFilestoreImage: function() {
  1181. let that = this;
  1182. uni.downloadFile({
  1183. url: that.setDomain(that.storeInfo.image),
  1184. success: function(res) {
  1185. that.storeImage = res.tempFilePath;
  1186. that.base64Show = 1;
  1187. },
  1188. fail: function() {
  1189. return that.$util.Tips({
  1190. title: ''
  1191. });
  1192. that.storeImage = '';
  1193. },
  1194. });
  1195. },
  1196. /**
  1197. * 获取产品分销二维码
  1198. * @param function successFn 下载完成回调
  1199. *
  1200. */
  1201. downloadFilePromotionCode: function(successFn) {
  1202. let that = this;
  1203. seckillCode(that.id, {
  1204. stop_time: that.datatime
  1205. }).then(res => {
  1206. uni.downloadFile({
  1207. url: that.setDomain(res.data.code),
  1208. success: function(res) {
  1209. that.$set(that, 'isDown', false);
  1210. if (typeof successFn == 'function')
  1211. successFn && successFn(res.tempFilePath);
  1212. else
  1213. that.$set(that, 'PromotionCode', res.tempFilePath);
  1214. },
  1215. fail: function() {
  1216. that.$set(that, 'isDown', false);
  1217. that.$set(that, 'PromotionCode', '');
  1218. },
  1219. });
  1220. }).catch(err => {
  1221. that.$set(that, 'isDown', false);
  1222. that.$set(that, 'PromotionCode', '');
  1223. });
  1224. },
  1225. getImageBase64: function(type) {
  1226. let that = this;
  1227. imageBase64(that.storeImage,that.followCode)
  1228. .then(res => {
  1229. that.storeImage = res.data.image;
  1230. if(type){
  1231. that.PromotionCode = res.data.code;
  1232. }
  1233. that.base64Show = 1;
  1234. })
  1235. .catch(() => {});
  1236. },
  1237. // 小程序关闭分享弹窗;
  1238. // goFriend: function() {
  1239. // this.posters = false;
  1240. // },
  1241. /**
  1242. * 生成海报
  1243. */
  1244. goPoster: function() {
  1245. let that = this;
  1246. // that.posters = false;
  1247. that.$set(that, 'canvasStatus', true);
  1248. let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
  1249. // #ifdef MP
  1250. if(that.PromotionCode==''&&!that.isDown){
  1251. return that.$util.Tips({
  1252. title: '小程序二维码需要发布正式版后才能获取到'
  1253. },function(){
  1254. that.posters = false;
  1255. });
  1256. }
  1257. // #endif
  1258. if (that.isDown) return that.$util.Tips({
  1259. title: '正在下载海报,请稍后再试!'
  1260. },function(){
  1261. that.posters = false;
  1262. });
  1263. uni.getImageInfo({
  1264. src: that.PromotionCode,
  1265. fail: function(res) {
  1266. return that.$util.Tips({
  1267. title: '小程序二维码需要发布正式版后才能获取到'
  1268. });
  1269. },
  1270. success() {
  1271. if (arr2[2] == '') {
  1272. //海报二维码不存在则从新下载
  1273. that.downloadFilePromotionCode(function(msgPromotionCode) {
  1274. arr2[2] = msgPromotionCode;
  1275. if (arr2[2] == '')
  1276. return that.$util.Tips({
  1277. title: '海报二维码生成失败!'
  1278. });
  1279. that.$nextTick(()=>{
  1280. that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName, arr2, that.storeInfo.title, that.storeInfo
  1281. .price, that.storeInfo.ot_price,that.posterTitle,
  1282. function(tempFilePath) {
  1283. that.$set(that, 'posterImage', tempFilePath);
  1284. that.$set(that, 'posterImageStatus', true);
  1285. that.$set(that, 'canvasStatus', false);
  1286. that.$set(that, 'actionSheetHidden', !that
  1287. .actionSheetHidden);
  1288. });
  1289. })
  1290. });
  1291. } else {
  1292. //生成推广海报
  1293. that.$nextTick(function(){
  1294. that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName, arr2, that.storeInfo.title, that.storeInfo.price, that
  1295. .storeInfo.ot_price,that.posterTitle,
  1296. function(tempFilePath) {
  1297. that.$set(that, 'posterImage', tempFilePath);
  1298. that.$set(that, 'posterImageStatus', true);
  1299. that.$set(that, 'canvasStatus', false);
  1300. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  1301. });
  1302. })
  1303. }
  1304. },
  1305. });
  1306. },
  1307. /*
  1308. * 保存到手机相册
  1309. */
  1310. // #ifdef MP
  1311. savePosterPath: function() {
  1312. let that = this;
  1313. uni.getSetting({
  1314. success(res) {
  1315. if (!res.authSetting['scope.writePhotosAlbum']) {
  1316. uni.authorize({
  1317. scope: 'scope.writePhotosAlbum',
  1318. success() {
  1319. uni.saveImageToPhotosAlbum({
  1320. filePath: that.posterImage,
  1321. success: function(res) {
  1322. that.posterImageClose();
  1323. that.$util.Tips({
  1324. title: '保存成功',
  1325. icon: 'success'
  1326. });
  1327. },
  1328. fail: function(res) {
  1329. that.$util.Tips({
  1330. title: '保存失败'
  1331. });
  1332. }
  1333. })
  1334. }
  1335. })
  1336. } else {
  1337. uni.saveImageToPhotosAlbum({
  1338. filePath: that.posterImage,
  1339. success: function(res) {
  1340. that.posterImageClose();
  1341. that.$util.Tips({
  1342. title: '保存成功',
  1343. icon: 'success'
  1344. });
  1345. },
  1346. fail: function(res) {
  1347. that.$util.Tips({
  1348. title: '保存失败'
  1349. });
  1350. },
  1351. })
  1352. }
  1353. }
  1354. })
  1355. },
  1356. // #endif
  1357. //#ifdef APP-PLUS
  1358. savePosterPath() {
  1359. let that = this
  1360. uni.saveImageToPhotosAlbum({
  1361. filePath: that.posterImage,
  1362. success: function(res) {
  1363. that.posterImageClose();
  1364. that.$util.Tips({
  1365. title: '保存成功',
  1366. icon: 'success'
  1367. });
  1368. },
  1369. fail: function(res) {
  1370. that.$util.Tips({
  1371. title: '保存失败'
  1372. });
  1373. }
  1374. });
  1375. },
  1376. // #endif
  1377. setShareInfoStatus: function() {
  1378. let data = this.storeInfo;
  1379. let href = location.href;
  1380. if (this.$wechat.isWeixin()) {
  1381. this.posters = true;
  1382. getUserInfo().then(res => {
  1383. href =
  1384. href.indexOf("?") === -1 ?
  1385. href + "?spid=" + res.data.uid :
  1386. href + "&spid=" + res.data.uid;
  1387. let configAppMessage = {
  1388. desc: data.store_info,
  1389. title: data.store_name,
  1390. link: href,
  1391. imgUrl: data.image
  1392. };
  1393. this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
  1394. configAppMessage)
  1395. });
  1396. }
  1397. }
  1398. },
  1399. //#ifdef MP
  1400. onShareAppMessage() {
  1401. return {
  1402. title: this.storeInfo.title,
  1403. path: app.globalData.openPages,
  1404. imageUrl: this.storeInfo.image
  1405. };
  1406. },
  1407. onShareTimeline() {
  1408. let that = this;
  1409. return {
  1410. title: that.storeInfo.title,
  1411. imageUrl: that.storeInfo.image,
  1412. path: app.globalData.openPages,
  1413. };
  1414. },
  1415. //#endif
  1416. }
  1417. </script>
  1418. <style lang="scss">
  1419. /deep/.userEvaluation .evaluateWtapper .evaluateItem {
  1420. margin: 0 !important;
  1421. }
  1422. .mt7 {
  1423. margin-top:7px;
  1424. padding-left:55px;
  1425. }
  1426. .store{
  1427. background-color: #fff;
  1428. margin: 20rpx 20rpx 0 20rpx;
  1429. border-radius: 12rpx;
  1430. .title{
  1431. height: 80rpx;
  1432. width: 100%;
  1433. font-size: 28rpx;
  1434. color: #333;
  1435. padding: 0 20rpx;
  1436. .icon-jinru2{
  1437. color: #7a7a7a;
  1438. font-size: 28rpx;
  1439. }
  1440. }
  1441. }
  1442. .generate-posters {
  1443. width: 100%;
  1444. height: 318rpx;
  1445. background-color: #fff;
  1446. position: fixed;
  1447. left: 0;
  1448. bottom: 0;
  1449. z-index: 300;
  1450. transform: translate3d(0, 100%, 0);
  1451. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  1452. border-top: 1rpx solid #eee;
  1453. .generateCon{
  1454. height: 220rpx;
  1455. }
  1456. .generateClose{
  1457. height: 98rpx;
  1458. font-size: 28rpx;
  1459. color: #333333;
  1460. border-top:1px solid #eee;
  1461. }
  1462. .item{
  1463. .pictrue{
  1464. width: 96rpx;
  1465. height: 96rpx;
  1466. border-radius: 50%;
  1467. margin: 0 auto 6rpx auto;
  1468. image{
  1469. width: 100%;
  1470. height: 100%;
  1471. border-radius: 50%;
  1472. }
  1473. }
  1474. }
  1475. }
  1476. .generate-posters.on {
  1477. transform: translate3d(0, 0, 0);
  1478. }
  1479. .generate-posters .item {
  1480. flex: 1;
  1481. text-align: center;
  1482. font-size: 30rpx;
  1483. }
  1484. .generate-posters .item .iconfont {
  1485. font-size: 80rpx;
  1486. color: #5eae72;
  1487. }
  1488. .generate-posters .item .iconfont.icon-haibao {
  1489. color: #5391f1;
  1490. }
  1491. .navbar .header {
  1492. height: 96rpx;
  1493. /* #ifdef MP */
  1494. font-size: 28rpx;
  1495. /* #endif */
  1496. /* #ifndef MP */
  1497. font-size: 30rpx;
  1498. /* #endif */
  1499. color: #050505;
  1500. background-color: #fff;
  1501. /* #ifdef APP-PLUS */
  1502. width: 100%;
  1503. /* #endif */
  1504. }
  1505. .icon-xiangzuo {
  1506. /* #ifdef H5 */
  1507. top: 30rpx !important;
  1508. /* #endif */
  1509. }
  1510. .navbar .header .item {
  1511. position: relative;
  1512. /* #ifdef MP */
  1513. margin: 0 20rpx;
  1514. /* #endif */
  1515. /* #ifndef MP */
  1516. margin: 0 25rpx;
  1517. /* #endif */
  1518. }
  1519. .navbar .header .item.on:before {
  1520. position: absolute;
  1521. width: 56rpx;
  1522. height: 5rpx;
  1523. background-repeat: no-repeat;
  1524. content: "";
  1525. // background-image: linear-gradient(to right, #ff3366 0%, #ff6533 100%);
  1526. background-color: var(--view-theme);
  1527. bottom: -10rpx;
  1528. left: 50%;
  1529. margin-left: -28rpx;
  1530. }
  1531. .navbar {
  1532. position: fixed;
  1533. background-color: #fff;
  1534. top: 0;
  1535. left: 0;
  1536. z-index: 99;
  1537. width: 100%;
  1538. }
  1539. .navbar .navbarH {
  1540. position: relative;
  1541. }
  1542. .navbar .navbarH .navbarCon {
  1543. position: absolute;
  1544. bottom: 0;
  1545. height: 100rpx;
  1546. width: 100%;
  1547. }
  1548. .icon-xiangzuo {
  1549. /* color: #000;
  1550. position: fixed;
  1551. font-size: 40rpx;
  1552. width: 100rpx;
  1553. height: 56rpx;
  1554. line-height: 54rpx;
  1555. z-index: 1000;
  1556. left: 33rpx; */
  1557. }
  1558. .product-con .nav {
  1559. background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAABkCAMAAADud0VvAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAKHRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnEt6j2gAACYZJREFUeNrtnel2qzoMhSUPzOnpef+HvD1NmonB90eShoTRBoMBaXWltV06wNfdLSEAYaMhdjtEAAQAfHtTAAraX04/KVB0BCLCbffeXyofdk/0Xev3AzGxzSPh7yJAUAiqvLfUfUrBDfqGF/XzkxPM3aEUw3YcsXOi51ov1hFgk7hHO6+O8vK+aYY9OxwVodwvCobGMKPhX0Uz67BF3DFJRBPl3fJ+OZyIYg3egY8r4ybkM/z9pK3hzpOYNVLeJe/FaX8lhPUiZ8ySjPeT+BLrm8PdSwJspbxN3vPDniy7gcArPpWMd7C+MdzD2ANspbxF3tPvA1l2s4w1uwv8aDLeU9dZdW4zuGMU8xvYrZTfZ9+JP30fidshAo+WqjPYyDrWqdNGcOdR9Py/1ibv99nHvrq9P3xfiNlhAs/Z2DKObbretLgJ3GXs9zYxv/L+IL74/keWfXjGWiPwdqx7M+vbwN2PRW/KX+UdFaRfe7LsoxiaQjDr1h2Rtf9ZrB13DEOuYWLe5P309UOgjhVZ7Sn88cjHSh1ma7jzMEA9E1OSd7X/jyz7qAKfCrRl3bGam9blqmvGXQYeNvPcIe/511dGhI6csaa85ODHs+7IWE9rv17cvVDcd5KBvF//+ybLbiNjLQQb2bo/WUe1VdzRD9gvv1omBgDg9B9ZdnsCL0a07v11fcW4M99HNDQxCg5fZNmtCrzEcaw7cqbbWbBC3IUvjU0MFP+oym5b4K9CDLfuPVivMTerw136HE1NDKT/qMo+QWS5N6wPHm8pL2ofrHXhjtJnpiYG4UiNMVMJ/EWa98Ejr2v+2h7ueHcxRoV2dfhHl59OF+mbwPclnzHeXLvvVvv14M49jgBmJgby/XdBDE4ZxVkKXeuOnA+8YHUtuAvJQafl8WU23f+QZZ9P4PtZd8Y4e5VyA/RxFXtOSqy7g0bt1PssXL7PxN484Ykng6233EBe6SBGhQBvKvUuWmqF6o5CQrdVb5B3OO7Jss8W16eDb2tf5xxH0uXFqzsTvE3L2+U9/zmQZZ9Xqzzefpsl5AJfQG1T9y61XzruXCAamhiE9ECFRwcOoY/1oN90veJhXt5vCnfOWSfljeBfDtQr4IjAi1rrjuJZc6z2UW4Od8HQ1MSAOv1Qe687R9Jv0vUu3HVz1aWmqnj7yzfrFsiPR7LsDkWW+6KswCh4w3nT10vmt5KqIkdjEwPZke5751xI73H3VMYfF7U+K+vYoO3a6r5E3G8XJZoV2uF6pPveOXlQAw4IKAS+1l70cO/CHxcIu2klBlCdj9Te62p4wd3DNBv2wbgvzbuj+XUbWJxO1Cvg7IEVXDV0Orao/bq9O/YX8spsdqLCo7us3/y659UpeCvueuZ9Ubj3orwe/OuJCo+Osw4AwAIG3YZ9a7hryru6nKnw6D7rNwf/aJNURrh34L8wM2OSo6rzhSy7q6zzCpEsZPVsYy2zm8C9P/j5hQqPDrNeAyz4HuFuJO+Qnanw6CbrkjUTKkoOvu0DffO+VNz71GfU9UqW3cWDKF/9ehVYDLzmssyGcNeQ9+JKLmYBrDcAK0LWI0/dDu4d8p5fqfDoJOu8J6EPgW937rrmfXFNBL1OMmUpWXZXWe8tyCLCmjNLFWA3gnsz+GlKhUf3WG/OTZsIxdAD6BL3lePeJe8qJRfjNOs6hMqo08vomfcF414HfkEuxkHWud6Z/tKQhfKF07qby6wb92Z5hyKjwqNbwYTkoN2mWx57IbYYd103s/D7zJR7fbOcLLtbrP/mpgPimkUjMrrIq5lq3lROLsZd1geoOwB40WjqvnTcH7CTi3GL9dfcFJQ5oQDAYtFGq8YXXyjuL8gXBbkYt1jnw+S8uhwG2AzrynF/lfeChN0x1ge7l5plHost4/4LOwm7c6yPwndlGIY9cW/74gu9z8y95ZGE3UnWreAO4tfBq+3hXvNrUszIusdG5/t9jGFYi3vH1svHHZBYd4p1bkPOq2ORcH3cy2Oko0UxmHU77qVmjFFAuFPMzLo9vitDmfABWxPujqUkyzFpzGvJTe2pPcYB4b4C1m+wqyWyPiXuAHKHhPvCbQFTd9jVIlgXU/JduUgj9g23JtxdEPYy7Mp51mtz0ylxB+UnaLS1INhm54e/PJMC1QJYn/vnvKSJZ5odUcwYnONT1t2W9xLrk8t5dbks8L23JnWf1cUI9lT0oc8dmpT1+cNI4EndZyRIcCgru7vJKvM8MbucV4dBjL22plR1/hCCNcCuXGQdHMQd2E7qbU24zxNSYjPsyiXWfe6IWa8d3gWecHfZxUgJbbC7gjvz23JTN/DnidTYmnCfvhbj8y7YlXusu4o7QBhh762pMjO1i/HZbfdj68v8rIul9O+crrveFJO6Txnoe9it7HPL+411d+W8OoxC6Lc14T6li/GgJ+xqRtYbc1N3cQe+44S7Wy4mkKo/7Gp21gcjOOlfw5vAE+7zhh8ILdjV/Kw7LefVZZn06HAg3Kew7GHAdGFXk7MuluRe6h7oFAeEuwOWPfJRH3Y1OeuL47syljvWsTXhbjm8yAMj2KfinXu+WKacV8dPgSfc54gw5qawT4I7HzM3dWH5IfCE+/S5Xxwyc9jVFKyLxfNdceeJ37JMZ1VthUhCANVx8rT5rKqagPU17na1vySsuWhAXFoJP/HBXNlt3+iVryQ3rR+y2G9aJtwtBEaJVMawK8uwv+j6KviujL2ENdxmkuAc3bLvYmau7JafzfDuYdaJO7BEEu5ThNzF8HahtcZLbhV27vvSIUKtfi8/xpplSlVHjfAjUKX+Xs0ENcutsh44drA7Op2HLV/SisCTuo97+JKP2i6wfspe2IT9yfpK3UvtA50iJDNjjaiPHW8+QdoFe57aexIJD8p+fcV8vw/57v33JjMzTnifMarui5MaPiFL1TSsbyvyrzB+nSHcx4job9DvjFLdtEqtwc6Dam66qXi/sI/MzHDL/vEpNXu/SoPikllj/ebXN+Re6sZRRGZmvBCff5hur8BzkF1yu6xTHK+JIHUfJ/y/H8ZnlKBIL8UErG9c3QEgDh9Dwn1AxH+j+4416RW4XJR91rfJ9/tQ7O4PdCLcB1h27/YwY6PTp+erJdYlyXnNMA6QcB/A1Z9Phr+7Txf29JzaYn1RhE74vcSOEe6G4X0miM9n1WvCfj7nNlgPBcl5yxhjnyozJhH9CfF1r2rUZYrzaXzLzkOqw3SF2l8SRuqua9l3f+Ttn6KJvKens01dJzlvXWbx/9o+Ua+lzl/DAAAAAElFTkSuQmCC');
  1560. background-repeat: no-repeat;
  1561. background-size: 100% 100%;
  1562. width: 100%;
  1563. height: 100rpx;
  1564. padding: 0 30rpx;
  1565. box-sizing: border-box;
  1566. }
  1567. .product-con .nav /deep/.time .styleAll {
  1568. padding: 0 6rpx;
  1569. font-size: 22rpx;
  1570. color: var(--view-theme);
  1571. background-color: #fff;
  1572. border-radius: 2rpx
  1573. }
  1574. .product-con .nav .money {
  1575. font-size: 28rpx;
  1576. color: #fff;
  1577. }
  1578. .product-con .nav .money .num {
  1579. font-size: 48rpx;
  1580. }
  1581. .product-con .nav .money .y-money {
  1582. font-size: 26rpx;
  1583. margin-left: 10rpx;
  1584. text-decoration: line-through;
  1585. }
  1586. .product-con .nav .timeItem {
  1587. font-size: 20rpx;
  1588. color: #fff;
  1589. text-align: center;
  1590. }
  1591. .product-con .nav .timeItem .timeCon {
  1592. margin-top: 10rpx;
  1593. }
  1594. .product-con .nav .timeItem .timeCon .num {
  1595. padding: 0 7rpx;
  1596. font-size: 22rpx;
  1597. color: #ff3d3d;
  1598. background-color: #fff;
  1599. border-radius: 2rpx;
  1600. }
  1601. .product-con .nav .timeState {
  1602. font-size: 28RPX;
  1603. color: #FFF;
  1604. }
  1605. .product-con .nav .iconfont {
  1606. color: #fff;
  1607. font-size: 30rpx;
  1608. margin-left: 20rpx;
  1609. }
  1610. .product-con .wrapper {
  1611. padding: 32rpx;
  1612. box-sizing: border-box;
  1613. }
  1614. .product-con .wrapper .introduce {
  1615. margin: 0;
  1616. }
  1617. .product-con .wrapper .introduce .infor {
  1618. width: 570rpx;
  1619. }
  1620. .product-con .wrapper .introduce .iconfont {
  1621. font-size: 37rpx;
  1622. color: #515151;
  1623. }
  1624. .product-con .wrapper .label {
  1625. margin: 18rpx 0 0 0;
  1626. font-size: 24rpx;
  1627. color: #82848f;
  1628. display: flex;
  1629. justify-content: space-between;
  1630. }
  1631. .product-con .wrapper .label .stock {
  1632. width: 255rpx;
  1633. margin-right: 28rpx;
  1634. }
  1635. .product-con .footer {
  1636. padding: 0 20rpx 0 30rpx;
  1637. position: fixed;
  1638. bottom: 0;
  1639. width: 100%;
  1640. box-sizing: border-box;
  1641. background-color: #fff;
  1642. z-index: 277;
  1643. border-top: 1px solid #f0f0f0;
  1644. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1645. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1646. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  1647. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  1648. }
  1649. .product-con .footer .item {
  1650. font-size: 18rpx;
  1651. color: #666;
  1652. }
  1653. .product-con .footer .item .iconfont {
  1654. text-align: center;
  1655. font-size: 40rpx;
  1656. }
  1657. .product-con .footer .item .iconfont.icon-shoucang1 {
  1658. color: var(--view-theme);
  1659. }
  1660. .product-con .footer .item .iconfont.icon-gouwuche1 {
  1661. font-size: 40rpx;
  1662. position: relative;
  1663. }
  1664. .product-con .footer .item .iconfont.icon-gouwuche1 .num {
  1665. color: #fff;
  1666. position: absolute;
  1667. font-size: 18rpx;
  1668. padding: 2rpx 8rpx 3rpx;
  1669. border-radius: 200rpx;
  1670. top: -10rpx;
  1671. right: -10rpx;
  1672. }
  1673. .product-con .footer .bnt {
  1674. width: 540rpx;
  1675. height: 76rpx;
  1676. }
  1677. .product-con .footer .bnt .bnts {
  1678. width: 270rpx;
  1679. text-align: center;
  1680. line-height: 76rpx;
  1681. color: #fff;
  1682. font-size: 28rpx;
  1683. }
  1684. .product-con .footer .bnt .joinCart {
  1685. border-radius: 50rpx 0 0 50rpx;
  1686. // background-image: linear-gradient(to right, #fea10f 0%, #fa8013 100%);
  1687. background-color: var(--view-bntColor);
  1688. }
  1689. .product-con .footer .bnt .buy {
  1690. border-radius: 0 50rpx 50rpx 0;
  1691. background-color: var(--view-theme);
  1692. // background-image: linear-gradient(to right, #fa6514 0%, #e93323 100%);
  1693. }
  1694. .product-con .conter {
  1695. display: block;
  1696. padding-bottom: 100rpx;
  1697. }
  1698. .product-con .conter img {
  1699. display: block;
  1700. }
  1701. .setCollectBox {
  1702. font-size: 18rpx;
  1703. color: #666;
  1704. }
  1705. .bg-color-hui {
  1706. background: #bbbbbb !important;
  1707. }
  1708. .canvas {
  1709. width: 750px;
  1710. height: 1300px;
  1711. position: relative;
  1712. bottom: -10000rpx;
  1713. }
  1714. .poster-pop {
  1715. width: 460rpx;
  1716. height: 800rpx;
  1717. position: fixed;
  1718. left: 50%;
  1719. transform: translateX(-50%);
  1720. z-index: 300;
  1721. top:50%;
  1722. margin-top: -559rpx;
  1723. }
  1724. .poster-pop image {
  1725. width: 100%;
  1726. height: 100%;
  1727. display: block;
  1728. border-radius: 18rpx;
  1729. }
  1730. .poster-pop .close {
  1731. width: 46rpx;
  1732. height: 75rpx;
  1733. position: fixed;
  1734. right: 0;
  1735. top: -73rpx;
  1736. display: block;
  1737. }
  1738. .poster-pop .save-poster {
  1739. background-color: #df2d0a;
  1740. font-size: :22rpx;
  1741. color: #fff;
  1742. text-align: center;
  1743. height: 76rpx;
  1744. line-height: 76rpx;
  1745. width: 100%;
  1746. }
  1747. .poster-pop .keep {
  1748. color: #fff;
  1749. text-align: center;
  1750. font-size: 25rpx;
  1751. margin-top: 10rpx;
  1752. }
  1753. /deep/.mask {
  1754. z-index: 99 !important;
  1755. }
  1756. .mask1 {
  1757. position: fixed;
  1758. top: 0;
  1759. left: 0;
  1760. right: 0;
  1761. bottom: 0;
  1762. background-color: #000;
  1763. opacity: .5;
  1764. z-index: 288;
  1765. }
  1766. .home-nav {
  1767. /* #ifdef H5 */
  1768. top: 20rpx !important;
  1769. /* #endif */
  1770. }
  1771. .home-nav {
  1772. color: #333;
  1773. position: fixed;
  1774. /* #ifdef MP */
  1775. width: 150rpx;
  1776. left: 15rpx;
  1777. height: 58rpx;
  1778. /* #endif */
  1779. /* #ifndef MP */
  1780. height: 56rpx;
  1781. width: 56rpx;
  1782. left: 33rpx;
  1783. /* #endif */
  1784. font-size: 33rpx;
  1785. z-index: 99;
  1786. background: rgba(255, 255, 255, 0.3);
  1787. border: 0.5px solid rgba(0,0,0,0.1);
  1788. border-radius: 40rpx;
  1789. &.right{
  1790. right: 33rpx;
  1791. left:unset
  1792. }
  1793. &.on {
  1794. background: unset;
  1795. color: #333;
  1796. }
  1797. &.homeIndex{
  1798. /* #ifdef MP */
  1799. width: 98rpx;
  1800. /* #endif */
  1801. /* #ifndef MP */
  1802. border-color: rgba(255,255,255,0);
  1803. /* #endif */
  1804. }
  1805. }
  1806. .home-nav .iconfont {
  1807. width: 66rpx;
  1808. text-align: center;
  1809. font-size: 30rpx;
  1810. color: #000;
  1811. }
  1812. .home-nav .line {
  1813. width: 1rpx;
  1814. height: 34rpx;
  1815. background: rgba(0, 0, 0, 0.1);
  1816. }
  1817. .home-nav .icon-xiangzuo {
  1818. width: auto;
  1819. font-size: 28rpx;
  1820. }
  1821. .share-box {
  1822. z-index: 1000;
  1823. position: fixed;
  1824. left: 0;
  1825. top: 0;
  1826. width: 100%;
  1827. height: 100%;
  1828. }
  1829. .share-box image {
  1830. width: 100%;
  1831. height: 100%;
  1832. }
  1833. </style>