index.vue 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897
  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. toLogin()
  598. },
  599. // 授权关闭
  600. // authColse: function(e) {
  601. // this.isShowAuth = e
  602. // },
  603. // 获取配送方式
  604. deliveryFun(e){
  605. this.delivery_type = e;
  606. },
  607. // 获取配送地址id
  608. onAddressId(row){
  609. this.addressId=row.id
  610. },
  611. // 获取自提地址id
  612. onstoreId(row) {
  613. this.storeList = row;
  614. this.store_id = row.id;
  615. this.store_name = row.name;
  616. },
  617. getStoreList(len){
  618. this.storeLen = len;
  619. },
  620. showStoreList(){
  621. uni.navigateTo({
  622. url: '/pages/store/store_list/index?productId='+this.id+'&type=1&isCollage=1'
  623. })
  624. },
  625. moreNav(){
  626. this.currentPage = !this.currentPage
  627. },
  628. //点击sku图片打开轮播图
  629. showImg(index){
  630. this.$refs.cusPreviewImg.open(this.selectSku.suk)
  631. },
  632. //滑动轮播图选择商品
  633. changeSwitch(e){
  634. let productSelect = this.skuArr[e];
  635. this.$set(this,'selectSku',productSelect);
  636. var skuList = productSelect.suk.split(',');
  637. skuList.forEach((i,index)=>{
  638. this.$set(this.attribute.productAttr[index],'index',skuList[index]);
  639. })
  640. if (productSelect) {
  641. this.$set(this.attribute.productSelect, "image", productSelect.image);
  642. this.$set(this.attribute.productSelect, "price", productSelect.price);
  643. this.$set(this.attribute.productSelect, "stock", productSelect.stock);
  644. this.$set(this.attribute.productSelect, "unique", productSelect.unique);
  645. this.$set(this.attribute.productSelect, "cart_num", 1);
  646. this.$set(this.attribute.productSelect, "quota", productSelect.quota);
  647. this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
  648. this.$set(this, "attrValue", productSelect.suk);
  649. this.attrTxt = "已选择"
  650. }
  651. },
  652. qrR(res) {
  653. // #ifdef H5
  654. if(!this.$wechat.isWeixin() || this.shareQrcode != '1'){
  655. this.PromotionCode = res;
  656. this.followCode = ''
  657. }
  658. // #endif
  659. // #ifdef APP-PLUS
  660. this.PromotionCode = res;
  661. // #endif
  662. },
  663. // 图片预览;
  664. getpreviewImage: function() {
  665. if(this.posterImage){
  666. let photoList = [];
  667. photoList.push(this.posterImage)
  668. uni.previewImage({
  669. urls: photoList,
  670. current: this.posterImage
  671. });
  672. }else{
  673. his.$util.Tips({
  674. title: '您的海报尚未生成'
  675. });
  676. }
  677. },
  678. // app分享
  679. // #ifdef APP-PLUS
  680. appShare(scene) {
  681. let that = this
  682. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  683. let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
  684. uni.share({
  685. provider: "weixin",
  686. scene: scene,
  687. type: 0,
  688. href: `${HTTP_REQUEST_URL}${curRoute}`,
  689. title: that.storeInfo.title,
  690. summary: that.storeInfo.info,
  691. imageUrl: that.storeInfo.small_image,
  692. success: function(res) {
  693. uni.showToast({
  694. title: '分享成功',
  695. icon: 'success'
  696. })
  697. // that.posters = false;
  698. },
  699. fail: function(err) {
  700. uni.showToast({
  701. title: '分享失败',
  702. icon: 'none',
  703. duration: 2000
  704. })
  705. // that.posters = false;
  706. }
  707. });
  708. },
  709. // #endif
  710. /**
  711. * 购物车手动填写
  712. *
  713. */
  714. iptCartNum: function(e) {
  715. this.$set(this.attribute.productSelect, 'cart_num', e);
  716. this.$set(this, "cart_num", e);
  717. },
  718. // 后退
  719. returns: function() {
  720. // #ifdef H5
  721. return history.back();
  722. // #endif
  723. // #ifndef H5
  724. return uni.navigateBack({
  725. delta: 1,
  726. })
  727. // #endif
  728. },
  729. getSeckillDetail: function() {
  730. let that = this;
  731. getSeckillDetail(that.id, {time_id : that.time_id}).then(res => {
  732. that.$set(that.attribute, 'isType', res.data.storeInfo.type);
  733. that.$set(that.attribute, 'relation_id', res.data.storeInfo.relation_id);
  734. that.$set(that.attribute, 'store_self_mention', res.data.store_self_mention);
  735. this.dataShow = 1;
  736. let title = res.data.storeInfo.title;
  737. this.storeInfo = res.data.storeInfo;
  738. this.datatime = Number(res.data.storeInfo.last_time);
  739. this.status = res.data.storeInfo.status;
  740. this.imgUrls = res.data.storeInfo.images;
  741. that.$set(that, 'posterTitle', res.data.product_poster_title);
  742. if(this.storeInfo.description){
  743. this.storeInfo.description = this.storeInfo.description.replace(/<img/gi,
  744. '<img style="max-width:100%;height:auto;float:left;display:block" ');
  745. this.storeInfo.description = this.storeInfo.description.replace(
  746. /<video/gi,
  747. '<video style="width:100%;height:auto;display:block" '
  748. );
  749. }
  750. this.attribute.productAttr = res.data.productAttr;
  751. if (res.data.storeInfo.delivery_type.indexOf('2') != -1) {
  752. that.$set(that, 'isMention', true);
  753. }
  754. this.productValue = res.data.productValue;
  755. for(let key in res.data.productValue){
  756. let obj = res.data.productValue[key];
  757. that.skuArr.push(obj)
  758. }
  759. that.selectSku = that.skuArr[0];
  760. res.data.storeInfo.delivery_type.sort((x,y)=>x - y);
  761. that.$set(that.attribute, 'deliveryType', res.data.storeInfo.delivery_type);
  762. this.attribute.productSelect.num = res.data.storeInfo.num;
  763. this.attribute.productSelect.once_num = res.data.storeInfo.once_num;
  764. this.replyCount = res.data.replyCount;
  765. this.reply = res.data.reply;
  766. this.replyChance = res.data.replyChance;
  767. this.shareQrcode = res.data.share_qrcode;
  768. that.routineContact = Number(res.data.routine_contact_type);
  769. uni.setNavigationBarTitle({
  770. title: title.substring(0, 7) + '...'
  771. });
  772. that.siteName = res.data.site_name;
  773. var navList = ['商品', '详情'];
  774. if(res.data.replyCount){
  775. navList.splice(1, 0, '评价');
  776. }
  777. that.$set(that, 'navList', navList);
  778. // #ifdef H5
  779. that.storeImage = that.storeInfo.image
  780. if(this.$wechat.isWeixin() && this.shareQrcode=='1'){
  781. // that.followCode = that.storeInfo.code_base
  782. // that.getImageBase64(1);
  783. that.seckillQRCode(1);
  784. }else{
  785. that.getImageBase64();
  786. // that.seckillQRCode();
  787. }
  788. that.setShare();
  789. // #endif
  790. // #ifndef H5
  791. that.downloadFilestoreImage();
  792. // #endif
  793. that.DefaultSelect();
  794. setTimeout(function() {
  795. that.infoScroll();
  796. }, 500);
  797. app.globalData.openPages = '/pages/activity/goods_seckill_details/index?id=' + that.id +
  798. '&time=' + that.time +
  799. '&status=' + that.status + '&spid=' + that.storeInfo.uid;
  800. // wxParse.wxParse('description', 'html', that.data.storeInfo.description || '', that, 0);
  801. // wxh.time(that.data.time, that);
  802. setTimeout(() => {
  803. that.showSkeleton = false
  804. }, 300)
  805. }).catch(err => {
  806. that.$util.Tips({
  807. title: err
  808. }, {
  809. tab: 3
  810. })
  811. });
  812. },
  813. setShare: function() {
  814. this.$wechat.isWeixin() &&
  815. this.$wechat.wechatEvevt([
  816. "updateAppMessageShareData",
  817. "updateTimelineShareData",
  818. "onMenuShareAppMessage",
  819. "onMenuShareTimeline"
  820. ], {
  821. desc: this.storeInfo.info,
  822. title: this.storeInfo.title,
  823. link: location.href,
  824. imgUrl: this.storeInfo.image
  825. }).then(res => {}).catch(err => {});
  826. },
  827. /**
  828. * 默认选中属性
  829. *
  830. */
  831. DefaultSelect: function() {
  832. let self = this
  833. let productAttr = self.attribute.productAttr;
  834. let value = [];
  835. for (var key in this.productValue) {
  836. if (this.productValue[key].quota > 0) {
  837. value = this.attribute.productAttr.length ? key.split(",") : [];
  838. break;
  839. }
  840. }
  841. for (let i = 0; i < productAttr.length; i++) {
  842. this.$set(productAttr[i], "index", value[i]);
  843. }
  844. //sort();排序函数:数字-英文-汉字;
  845. let productSelect = this.productValue[value.join(",")];
  846. if (productSelect && productAttr.length) {
  847. self.$set(
  848. self.attribute.productSelect,
  849. "store_name",
  850. self.storeInfo.title
  851. );
  852. self.$set(self.attribute.productSelect, "image", productSelect.image);
  853. self.$set(self.attribute.productSelect, "price", productSelect.price);
  854. self.$set(self.attribute.productSelect, "stock", productSelect.stock);
  855. self.$set(self.attribute.productSelect, "unique", productSelect.unique);
  856. self.$set(self.attribute.productSelect, "quota", productSelect.quota);
  857. self.$set(self.attribute.productSelect, "quota_show", productSelect.quota_show);
  858. self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
  859. self.$set(self.attribute.productSelect, "cart_num", 1);
  860. self.$set(self, "attrValue", value.join(","));
  861. self.attrValue = value.join(",")
  862. } else if (!productSelect && productAttr.length) {
  863. self.$set(
  864. self.attribute.productSelect,
  865. "store_name",
  866. self.storeInfo.title
  867. );
  868. self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
  869. self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
  870. self.$set(self.attribute.productSelect, "quota", 0);
  871. self.$set(self.attribute.productSelect, "quota_show", 0);
  872. self.$set(self.attribute.productSelect, "product_stock", 0);
  873. self.$set(self.attribute.productSelect, "stock", 0);
  874. self.$set(self.attribute.productSelect, "unique", "");
  875. self.$set(self.attribute.productSelect, "cart_num", 0);
  876. self.$set(self, "attrValue", "");
  877. self.$set(self, "attrTxt", "请选择");
  878. } else if (!productSelect && !productAttr.length) {
  879. self.$set(
  880. self.attribute.productSelect,
  881. "store_name",
  882. self.storeInfo.title
  883. );
  884. self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
  885. self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
  886. self.$set(self.attribute.productSelect, "stock", self.storeInfo.stock);
  887. self.$set(self.attribute.productSelect, "quota", self.storeInfo.quota);
  888. self.$set(self.attribute.productSelect, "product_stock", self.storeInfo.product_stock);
  889. self.$set(
  890. self.attribute.productSelect,
  891. "unique",
  892. self.storeInfo.unique || ""
  893. );
  894. self.$set(self.attribute.productSelect, "cart_num", 1);
  895. self.$set(self.attribute.productSelect, "quota", productSelect.quota);
  896. self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
  897. self.$set(self, "attrValue", "");
  898. self.$set(self, "attrTxt", "请选择");
  899. }
  900. },
  901. selecAttr: function() {
  902. if(!this.isLogin){
  903. toLogin();
  904. return
  905. }
  906. if((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')){
  907. this.$refs.productWindow.showLocation();
  908. }
  909. this.currentPage = false;
  910. this.attribute.cartAttr = true
  911. },
  912. onMyEvent: function() {
  913. this.$set(this.attribute, 'cartAttr', false);
  914. this.$set(this, 'isOpen', false);
  915. },
  916. /**
  917. * 购物车数量加和数量减
  918. *
  919. */
  920. ChangeCartNum: function(changeValue) {
  921. //changeValue:是否 加|减
  922. //获取当前变动属性
  923. let productSelect = this.productValue[this.attrValue];
  924. if (this.cart_num) {
  925. productSelect.cart_num = this.cart_num;
  926. this.attribute.productSelect.cart_num = this.cart_num;
  927. }
  928. //如果没有属性,赋值给商品默认库存
  929. if (productSelect === undefined && !this.attribute.productAttr.length)
  930. productSelect = this.attribute.productSelect;
  931. //无属性值即库存为0;不存在加减;
  932. if (productSelect === undefined) return;
  933. let stock = productSelect.stock || 0;
  934. let quotaShow = productSelect.quota_show || 0;
  935. let quota = productSelect.quota || 0;
  936. let productStock = productSelect.product_stock || 0;
  937. let num = this.attribute.productSelect;
  938. let nums = this.storeInfo.num || 0;
  939. let onceNum = this.storeInfo.once_num || 0;
  940. //设置默认数据
  941. if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
  942. if (changeValue) {
  943. num.cart_num++;
  944. let arrMin = [];
  945. arrMin.push(nums);
  946. arrMin.push(onceNum);
  947. arrMin.push(quota);
  948. arrMin.push(productStock);
  949. let minN = Math.min.apply(null, arrMin);
  950. if (num.cart_num >= minN) {
  951. this.$set(this.attribute.productSelect, "cart_num", minN ? minN : 1);
  952. this.$set(this, "cart_num", minN ? minN : 1);
  953. }
  954. // if(quotaShow >= productStock){
  955. // if (num.cart_num > productStock) {
  956. // this.$set(this.attribute.productSelect, "cart_num", productStock);
  957. // this.$set(this, "cart_num", productStock);
  958. // }
  959. // }else{
  960. // if (num.cart_num > quotaShow) {
  961. // this.$set(this.attribute.productSelect, "cart_num", quotaShow);
  962. // this.$set(this, "cart_num", quotaShow);
  963. // }
  964. // }
  965. this.$set(this, "cart_num", num.cart_num);
  966. this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
  967. } else {
  968. num.cart_num--;
  969. if (num.cart_num < 1) {
  970. this.$set(this.attribute.productSelect, "cart_num", 1);
  971. this.$set(this, "cart_num", 1);
  972. }
  973. this.$set(this, "cart_num", num.cart_num);
  974. this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
  975. }
  976. },
  977. attrVal(val) {
  978. this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attr_values[val
  979. .indexn];
  980. },
  981. /**
  982. * 属性变动赋值
  983. *
  984. */
  985. ChangeAttr: function(res) {
  986. this.$set(this, 'cart_num', 1);
  987. let productSelect = this.productValue[res];
  988. this.$set(this, "selectSku", productSelect);
  989. if (productSelect) {
  990. this.$set(this.attribute.productSelect, "image", productSelect.image);
  991. this.$set(this.attribute.productSelect, "price", productSelect.price);
  992. this.$set(this.attribute.productSelect, "stock", productSelect.stock);
  993. this.$set(this.attribute.productSelect, "unique", productSelect.unique);
  994. this.$set(this.attribute.productSelect, "cart_num", 1);
  995. this.$set(this.attribute.productSelect, "quota", productSelect.quota);
  996. this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
  997. this.$set(this, "attrValue", res);
  998. this.attrTxt = "已选择"
  999. } else {
  1000. this.$set(this.attribute.productSelect, "image", this.storeInfo.image);
  1001. this.$set(this.attribute.productSelect, "price", this.storeInfo.price);
  1002. this.$set(this.attribute.productSelect, "stock", 0);
  1003. this.$set(this.attribute.productSelect, "unique", "");
  1004. this.$set(this.attribute.productSelect, "cart_num", 0);
  1005. this.$set(this.attribute.productSelect, "quota", 0);
  1006. this.$set(this.attribute.productSelect, "quota_show", 0);
  1007. this.$set(this, "attrValue", "");
  1008. this.attrTxt = "已选择"
  1009. }
  1010. },
  1011. scroll: function(e) {
  1012. var that = this,
  1013. scrollY = e.detail.scrollTop;
  1014. var opacity = scrollY / 200;
  1015. opacity = opacity > 1 ? 1 : opacity;
  1016. that.opacity = opacity
  1017. that.scrollY = scrollY
  1018. that.currentPage = false;
  1019. if (that.lock) {
  1020. that.lock = false
  1021. return;
  1022. }
  1023. for (var i = 0; i < that.topArr.length; i++) {
  1024. if (scrollY < that.topArr[i] - (app.globalData.navHeight / 2) + that.heightArr[i]) {
  1025. that.navActive = i
  1026. break
  1027. }
  1028. }
  1029. },
  1030. tap: function(item, index) {
  1031. var id = item.id;
  1032. var index = index;
  1033. var that = this;
  1034. if (!this.replyCount && id == "past1") {
  1035. id = "past2"
  1036. }
  1037. this.toView = id;
  1038. this.navActive = index;
  1039. this.lock = true;
  1040. this.scrollTop = index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[index]
  1041. },
  1042. infoScroll: function() {
  1043. var that = this,
  1044. topArr = [],
  1045. heightArr = [];
  1046. for (var i = 0; i < that.navList.length; i++) { //productList
  1047. //获取元素所在位置
  1048. var query = wx.createSelectorQuery().in(this);
  1049. var idView = "#past" + i;
  1050. if(!this.replyCount && i == 1){
  1051. idView = "#past" + 2;
  1052. }
  1053. query.select(idView).boundingClientRect();
  1054. query.exec(function(res) {
  1055. var top = res[0].top;
  1056. var height = res[0].height;
  1057. topArr.push(top);
  1058. heightArr.push(height);
  1059. that.topArr = topArr
  1060. that.heightArr = heightArr
  1061. });
  1062. };
  1063. },
  1064. /**
  1065. * 收藏商品
  1066. */
  1067. setCollect: Debounce(function() {
  1068. var that = this;
  1069. if (this.storeInfo.userCollect) {
  1070. collectDel(this.storeInfo.product_id).then(res => {
  1071. that.storeInfo.userCollect = !that.storeInfo.userCollect
  1072. })
  1073. } else {
  1074. collectAdd(this.storeInfo.product_id).then(res => {
  1075. that.storeInfo.userCollect = !that.storeInfo.userCollect
  1076. })
  1077. }
  1078. }),
  1079. /*
  1080. * 单独购买
  1081. */
  1082. openAlone: Debounce(function() {
  1083. uni.navigateTo({
  1084. url: `/pages/goods_details/index?id=${this.storeInfo.product_id}`
  1085. })
  1086. }),
  1087. /*
  1088. * 下订单
  1089. */
  1090. goCat: function() {
  1091. if(this.isLogin){
  1092. if((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')){
  1093. this.$refs.productWindow.showLocation();
  1094. }
  1095. var that = this;
  1096. that.currentPage = false;
  1097. var productSelect = this.productValue[this.attrValue];
  1098. //打开属性
  1099. if (this.isOpen)
  1100. this.attribute.cartAttr = true
  1101. else
  1102. this.attribute.cartAttr = !this.attribute.cartAttr
  1103. //只有关闭属性弹窗时进行加入购物车
  1104. if (this.attribute.cartAttr === true && this.isOpen == false) return this.isOpen = true
  1105. //如果有属性,没有选择,提示用户选择
  1106. if (this.attribute.productAttr.length && productSelect === undefined && this.isOpen == true) return app
  1107. .$util.Tips({
  1108. title: '请选择属性'
  1109. });
  1110. postCartAdd({
  1111. productId: that.storeInfo.product_id,
  1112. secKillId: that.id,
  1113. bargainId: 0,
  1114. combinationId: 0,
  1115. cartNum: that.cart_num,
  1116. uniqueId: productSelect !== undefined ? productSelect.unique : '',
  1117. 'new': 1,
  1118. store_id:this.store_id,
  1119. addressId:this.addressId,
  1120. delivery_type:this.delivery_type
  1121. }).then(res => {
  1122. this.isOpen = false
  1123. uni.navigateTo({
  1124. 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
  1125. });
  1126. }).catch(err => {
  1127. return this.$util.Tips({
  1128. title: err
  1129. });
  1130. });
  1131. }else{
  1132. this.getIsLogin();
  1133. }
  1134. },
  1135. /**
  1136. * 分享打开
  1137. *
  1138. */
  1139. listenerActionSheet: function() {
  1140. this.currentPage = false
  1141. if (this.isLogin === false) {
  1142. this.getIsLogin();
  1143. } else {
  1144. // #ifdef H5
  1145. if (this.$wechat.isWeixin() === true) {
  1146. this.weixinStatus = true;
  1147. }
  1148. // #endif
  1149. this.posters = true;
  1150. this.goPoster();
  1151. }
  1152. },
  1153. // 分享关闭
  1154. listenerActionClose: function() {
  1155. this.posters = false;
  1156. },
  1157. //隐藏海报
  1158. posterImageClose: function() {
  1159. this.posterImageStatus = false;
  1160. this.posters = false;
  1161. },
  1162. //替换安全域名
  1163. setDomain: function(url) {
  1164. url = url ? url.toString() : '';
  1165. //本地调试打开,生产请注销
  1166. if (url.indexOf("https://") > -1) return url;
  1167. else return url.replace('http://', 'https://');
  1168. },
  1169. //获取海报产品图
  1170. downloadFilestoreImage: function() {
  1171. let that = this;
  1172. uni.downloadFile({
  1173. url: that.setDomain(that.storeInfo.image),
  1174. success: function(res) {
  1175. that.storeImage = res.tempFilePath;
  1176. that.base64Show = 1;
  1177. },
  1178. fail: function() {
  1179. return that.$util.Tips({
  1180. title: ''
  1181. });
  1182. that.storeImage = '';
  1183. },
  1184. });
  1185. },
  1186. /**
  1187. * 获取产品分销二维码
  1188. * @param function successFn 下载完成回调
  1189. *
  1190. */
  1191. downloadFilePromotionCode: function(successFn) {
  1192. let that = this;
  1193. seckillCode(that.id, {
  1194. stop_time: that.datatime
  1195. }).then(res => {
  1196. uni.downloadFile({
  1197. url: that.setDomain(res.data.code),
  1198. success: function(res) {
  1199. that.$set(that, 'isDown', false);
  1200. if (typeof successFn == 'function')
  1201. successFn && successFn(res.tempFilePath);
  1202. else
  1203. that.$set(that, 'PromotionCode', res.tempFilePath);
  1204. },
  1205. fail: function() {
  1206. that.$set(that, 'isDown', false);
  1207. that.$set(that, 'PromotionCode', '');
  1208. },
  1209. });
  1210. }).catch(err => {
  1211. that.$set(that, 'isDown', false);
  1212. that.$set(that, 'PromotionCode', '');
  1213. });
  1214. },
  1215. getImageBase64: function(type) {
  1216. let that = this;
  1217. imageBase64(that.storeImage,that.followCode)
  1218. .then(res => {
  1219. that.storeImage = res.data.image;
  1220. if(type){
  1221. that.PromotionCode = res.data.code;
  1222. }
  1223. that.base64Show = 1;
  1224. })
  1225. .catch(() => {});
  1226. },
  1227. // 小程序关闭分享弹窗;
  1228. // goFriend: function() {
  1229. // this.posters = false;
  1230. // },
  1231. /**
  1232. * 生成海报
  1233. */
  1234. goPoster: function() {
  1235. let that = this;
  1236. // that.posters = false;
  1237. that.$set(that, 'canvasStatus', true);
  1238. let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
  1239. // #ifdef MP
  1240. if(that.PromotionCode==''&&!that.isDown){
  1241. return that.$util.Tips({
  1242. title: '小程序二维码需要发布正式版后才能获取到'
  1243. },function(){
  1244. that.posters = false;
  1245. });
  1246. }
  1247. // #endif
  1248. if (that.isDown) return that.$util.Tips({
  1249. title: '正在下载海报,请稍后再试!'
  1250. },function(){
  1251. that.posters = false;
  1252. });
  1253. uni.getImageInfo({
  1254. src: that.PromotionCode,
  1255. fail: function(res) {
  1256. return that.$util.Tips({
  1257. title: '小程序二维码需要发布正式版后才能获取到'
  1258. });
  1259. },
  1260. success() {
  1261. if (arr2[2] == '') {
  1262. //海报二维码不存在则从新下载
  1263. that.downloadFilePromotionCode(function(msgPromotionCode) {
  1264. arr2[2] = msgPromotionCode;
  1265. if (arr2[2] == '')
  1266. return that.$util.Tips({
  1267. title: '海报二维码生成失败!'
  1268. });
  1269. that.$nextTick(()=>{
  1270. that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName, arr2, that.storeInfo.title, that.storeInfo
  1271. .price, that.storeInfo.ot_price,that.posterTitle,
  1272. function(tempFilePath) {
  1273. that.$set(that, 'posterImage', tempFilePath);
  1274. that.$set(that, 'posterImageStatus', true);
  1275. that.$set(that, 'canvasStatus', false);
  1276. that.$set(that, 'actionSheetHidden', !that
  1277. .actionSheetHidden);
  1278. });
  1279. })
  1280. });
  1281. } else {
  1282. //生成推广海报
  1283. that.$nextTick(function(){
  1284. that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName, arr2, that.storeInfo.title, that.storeInfo.price, that
  1285. .storeInfo.ot_price,that.posterTitle,
  1286. function(tempFilePath) {
  1287. that.$set(that, 'posterImage', tempFilePath);
  1288. that.$set(that, 'posterImageStatus', true);
  1289. that.$set(that, 'canvasStatus', false);
  1290. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  1291. });
  1292. })
  1293. }
  1294. },
  1295. });
  1296. },
  1297. /*
  1298. * 保存到手机相册
  1299. */
  1300. // #ifdef MP
  1301. savePosterPath: function() {
  1302. let that = this;
  1303. uni.getSetting({
  1304. success(res) {
  1305. if (!res.authSetting['scope.writePhotosAlbum']) {
  1306. uni.authorize({
  1307. scope: 'scope.writePhotosAlbum',
  1308. success() {
  1309. uni.saveImageToPhotosAlbum({
  1310. filePath: that.posterImage,
  1311. success: function(res) {
  1312. that.posterImageClose();
  1313. that.$util.Tips({
  1314. title: '保存成功',
  1315. icon: 'success'
  1316. });
  1317. },
  1318. fail: function(res) {
  1319. that.$util.Tips({
  1320. title: '保存失败'
  1321. });
  1322. }
  1323. })
  1324. }
  1325. })
  1326. } else {
  1327. uni.saveImageToPhotosAlbum({
  1328. filePath: that.posterImage,
  1329. success: function(res) {
  1330. that.posterImageClose();
  1331. that.$util.Tips({
  1332. title: '保存成功',
  1333. icon: 'success'
  1334. });
  1335. },
  1336. fail: function(res) {
  1337. that.$util.Tips({
  1338. title: '保存失败'
  1339. });
  1340. },
  1341. })
  1342. }
  1343. }
  1344. })
  1345. },
  1346. // #endif
  1347. //#ifdef APP-PLUS
  1348. savePosterPath() {
  1349. let that = this
  1350. uni.saveImageToPhotosAlbum({
  1351. filePath: that.posterImage,
  1352. success: function(res) {
  1353. that.posterImageClose();
  1354. that.$util.Tips({
  1355. title: '保存成功',
  1356. icon: 'success'
  1357. });
  1358. },
  1359. fail: function(res) {
  1360. that.$util.Tips({
  1361. title: '保存失败'
  1362. });
  1363. }
  1364. });
  1365. },
  1366. // #endif
  1367. setShareInfoStatus: function() {
  1368. let data = this.storeInfo;
  1369. let href = location.href;
  1370. if (this.$wechat.isWeixin()) {
  1371. this.posters = true;
  1372. getUserInfo().then(res => {
  1373. href =
  1374. href.indexOf("?") === -1 ?
  1375. href + "?spid=" + res.data.uid :
  1376. href + "&spid=" + res.data.uid;
  1377. let configAppMessage = {
  1378. desc: data.store_info,
  1379. title: data.store_name,
  1380. link: href,
  1381. imgUrl: data.image
  1382. };
  1383. this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
  1384. configAppMessage)
  1385. });
  1386. }
  1387. }
  1388. },
  1389. //#ifdef MP
  1390. onShareAppMessage() {
  1391. return {
  1392. title: this.storeInfo.title,
  1393. path: app.globalData.openPages,
  1394. imageUrl: this.storeInfo.image
  1395. };
  1396. },
  1397. onShareTimeline() {
  1398. let that = this;
  1399. return {
  1400. title: that.storeInfo.title,
  1401. imageUrl: that.storeInfo.image,
  1402. path: app.globalData.openPages,
  1403. };
  1404. },
  1405. //#endif
  1406. }
  1407. </script>
  1408. <style lang="scss">
  1409. /deep/.userEvaluation .evaluateWtapper .evaluateItem {
  1410. margin: 0 !important;
  1411. }
  1412. .mt7 {
  1413. margin-top:7px;
  1414. padding-left:55px;
  1415. }
  1416. .store{
  1417. background-color: #fff;
  1418. margin: 20rpx 20rpx 0 20rpx;
  1419. border-radius: 12rpx;
  1420. .title{
  1421. height: 80rpx;
  1422. width: 100%;
  1423. font-size: 28rpx;
  1424. color: #333;
  1425. padding: 0 20rpx;
  1426. .icon-jinru2{
  1427. color: #7a7a7a;
  1428. font-size: 28rpx;
  1429. }
  1430. }
  1431. }
  1432. .generate-posters {
  1433. width: 100%;
  1434. height: 318rpx;
  1435. background-color: #fff;
  1436. position: fixed;
  1437. left: 0;
  1438. bottom: 0;
  1439. z-index: 300;
  1440. transform: translate3d(0, 100%, 0);
  1441. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  1442. border-top: 1rpx solid #eee;
  1443. .generateCon{
  1444. height: 220rpx;
  1445. }
  1446. .generateClose{
  1447. height: 98rpx;
  1448. font-size: 28rpx;
  1449. color: #333333;
  1450. border-top:1px solid #eee;
  1451. }
  1452. .item{
  1453. .pictrue{
  1454. width: 96rpx;
  1455. height: 96rpx;
  1456. border-radius: 50%;
  1457. margin: 0 auto 6rpx auto;
  1458. image{
  1459. width: 100%;
  1460. height: 100%;
  1461. border-radius: 50%;
  1462. }
  1463. }
  1464. }
  1465. }
  1466. .generate-posters.on {
  1467. transform: translate3d(0, 0, 0);
  1468. }
  1469. .generate-posters .item {
  1470. flex: 1;
  1471. text-align: center;
  1472. font-size: 30rpx;
  1473. }
  1474. .generate-posters .item .iconfont {
  1475. font-size: 80rpx;
  1476. color: #5eae72;
  1477. }
  1478. .generate-posters .item .iconfont.icon-haibao {
  1479. color: #5391f1;
  1480. }
  1481. .navbar .header {
  1482. height: 96rpx;
  1483. /* #ifdef MP */
  1484. font-size: 28rpx;
  1485. /* #endif */
  1486. /* #ifndef MP */
  1487. font-size: 30rpx;
  1488. /* #endif */
  1489. color: #050505;
  1490. background-color: #fff;
  1491. /* #ifdef APP-PLUS */
  1492. width: 100%;
  1493. /* #endif */
  1494. }
  1495. .icon-xiangzuo {
  1496. /* #ifdef H5 */
  1497. top: 30rpx !important;
  1498. /* #endif */
  1499. }
  1500. .navbar .header .item {
  1501. position: relative;
  1502. /* #ifdef MP */
  1503. margin: 0 20rpx;
  1504. /* #endif */
  1505. /* #ifndef MP */
  1506. margin: 0 25rpx;
  1507. /* #endif */
  1508. }
  1509. .navbar .header .item.on:before {
  1510. position: absolute;
  1511. width: 56rpx;
  1512. height: 5rpx;
  1513. background-repeat: no-repeat;
  1514. content: "";
  1515. // background-image: linear-gradient(to right, #ff3366 0%, #ff6533 100%);
  1516. background-color: var(--view-theme);
  1517. bottom: -10rpx;
  1518. left: 50%;
  1519. margin-left: -28rpx;
  1520. }
  1521. .navbar {
  1522. position: fixed;
  1523. background-color: #fff;
  1524. top: 0;
  1525. left: 0;
  1526. z-index: 99;
  1527. width: 100%;
  1528. }
  1529. .navbar .navbarH {
  1530. position: relative;
  1531. }
  1532. .navbar .navbarH .navbarCon {
  1533. position: absolute;
  1534. bottom: 0;
  1535. height: 100rpx;
  1536. width: 100%;
  1537. }
  1538. .icon-xiangzuo {
  1539. /* color: #000;
  1540. position: fixed;
  1541. font-size: 40rpx;
  1542. width: 100rpx;
  1543. height: 56rpx;
  1544. line-height: 54rpx;
  1545. z-index: 1000;
  1546. left: 33rpx; */
  1547. }
  1548. .product-con .nav {
  1549. 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');
  1550. background-repeat: no-repeat;
  1551. background-size: 100% 100%;
  1552. width: 100%;
  1553. height: 100rpx;
  1554. padding: 0 30rpx;
  1555. box-sizing: border-box;
  1556. }
  1557. .product-con .nav /deep/.time .styleAll {
  1558. padding: 0 6rpx;
  1559. font-size: 22rpx;
  1560. color: var(--view-theme);
  1561. background-color: #fff;
  1562. border-radius: 2rpx
  1563. }
  1564. .product-con .nav .money {
  1565. font-size: 28rpx;
  1566. color: #fff;
  1567. }
  1568. .product-con .nav .money .num {
  1569. font-size: 48rpx;
  1570. }
  1571. .product-con .nav .money .y-money {
  1572. font-size: 26rpx;
  1573. margin-left: 10rpx;
  1574. text-decoration: line-through;
  1575. }
  1576. .product-con .nav .timeItem {
  1577. font-size: 20rpx;
  1578. color: #fff;
  1579. text-align: center;
  1580. }
  1581. .product-con .nav .timeItem .timeCon {
  1582. margin-top: 10rpx;
  1583. }
  1584. .product-con .nav .timeItem .timeCon .num {
  1585. padding: 0 7rpx;
  1586. font-size: 22rpx;
  1587. color: #ff3d3d;
  1588. background-color: #fff;
  1589. border-radius: 2rpx;
  1590. }
  1591. .product-con .nav .timeState {
  1592. font-size: 28RPX;
  1593. color: #FFF;
  1594. }
  1595. .product-con .nav .iconfont {
  1596. color: #fff;
  1597. font-size: 30rpx;
  1598. margin-left: 20rpx;
  1599. }
  1600. .product-con .wrapper {
  1601. padding: 32rpx;
  1602. box-sizing: border-box;
  1603. }
  1604. .product-con .wrapper .introduce {
  1605. margin: 0;
  1606. }
  1607. .product-con .wrapper .introduce .infor {
  1608. width: 570rpx;
  1609. }
  1610. .product-con .wrapper .introduce .iconfont {
  1611. font-size: 37rpx;
  1612. color: #515151;
  1613. }
  1614. .product-con .wrapper .label {
  1615. margin: 18rpx 0 0 0;
  1616. font-size: 24rpx;
  1617. color: #82848f;
  1618. display: flex;
  1619. justify-content: space-between;
  1620. }
  1621. .product-con .wrapper .label .stock {
  1622. width: 255rpx;
  1623. margin-right: 28rpx;
  1624. }
  1625. .product-con .footer {
  1626. padding: 0 20rpx 0 30rpx;
  1627. position: fixed;
  1628. bottom: 0;
  1629. width: 100%;
  1630. box-sizing: border-box;
  1631. background-color: #fff;
  1632. z-index: 277;
  1633. border-top: 1px solid #f0f0f0;
  1634. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1635. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1636. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  1637. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  1638. }
  1639. .product-con .footer .item {
  1640. font-size: 18rpx;
  1641. color: #666;
  1642. }
  1643. .product-con .footer .item .iconfont {
  1644. text-align: center;
  1645. font-size: 40rpx;
  1646. }
  1647. .product-con .footer .item .iconfont.icon-shoucang1 {
  1648. color: var(--view-theme);
  1649. }
  1650. .product-con .footer .item .iconfont.icon-gouwuche1 {
  1651. font-size: 40rpx;
  1652. position: relative;
  1653. }
  1654. .product-con .footer .item .iconfont.icon-gouwuche1 .num {
  1655. color: #fff;
  1656. position: absolute;
  1657. font-size: 18rpx;
  1658. padding: 2rpx 8rpx 3rpx;
  1659. border-radius: 200rpx;
  1660. top: -10rpx;
  1661. right: -10rpx;
  1662. }
  1663. .product-con .footer .bnt {
  1664. width: 540rpx;
  1665. height: 76rpx;
  1666. }
  1667. .product-con .footer .bnt .bnts {
  1668. width: 270rpx;
  1669. text-align: center;
  1670. line-height: 76rpx;
  1671. color: #fff;
  1672. font-size: 28rpx;
  1673. }
  1674. .product-con .footer .bnt .joinCart {
  1675. border-radius: 50rpx 0 0 50rpx;
  1676. // background-image: linear-gradient(to right, #fea10f 0%, #fa8013 100%);
  1677. background-color: var(--view-bntColor);
  1678. }
  1679. .product-con .footer .bnt .buy {
  1680. border-radius: 0 50rpx 50rpx 0;
  1681. background-color: var(--view-theme);
  1682. // background-image: linear-gradient(to right, #fa6514 0%, #e93323 100%);
  1683. }
  1684. .product-con .conter {
  1685. display: block;
  1686. padding-bottom: 100rpx;
  1687. }
  1688. .product-con .conter img {
  1689. display: block;
  1690. }
  1691. .setCollectBox {
  1692. font-size: 18rpx;
  1693. color: #666;
  1694. }
  1695. .bg-color-hui {
  1696. background: #bbbbbb !important;
  1697. }
  1698. .canvas {
  1699. width: 750px;
  1700. height: 1300px;
  1701. position: relative;
  1702. bottom: -10000rpx;
  1703. }
  1704. .poster-pop {
  1705. width: 460rpx;
  1706. height: 800rpx;
  1707. position: fixed;
  1708. left: 50%;
  1709. transform: translateX(-50%);
  1710. z-index: 300;
  1711. top:50%;
  1712. margin-top: -559rpx;
  1713. }
  1714. .poster-pop image {
  1715. width: 100%;
  1716. height: 100%;
  1717. display: block;
  1718. border-radius: 18rpx;
  1719. }
  1720. .poster-pop .close {
  1721. width: 46rpx;
  1722. height: 75rpx;
  1723. position: fixed;
  1724. right: 0;
  1725. top: -73rpx;
  1726. display: block;
  1727. }
  1728. .poster-pop .save-poster {
  1729. background-color: #df2d0a;
  1730. font-size: :22rpx;
  1731. color: #fff;
  1732. text-align: center;
  1733. height: 76rpx;
  1734. line-height: 76rpx;
  1735. width: 100%;
  1736. }
  1737. .poster-pop .keep {
  1738. color: #fff;
  1739. text-align: center;
  1740. font-size: 25rpx;
  1741. margin-top: 10rpx;
  1742. }
  1743. /deep/.mask {
  1744. z-index: 99 !important;
  1745. }
  1746. .mask1 {
  1747. position: fixed;
  1748. top: 0;
  1749. left: 0;
  1750. right: 0;
  1751. bottom: 0;
  1752. background-color: #000;
  1753. opacity: .5;
  1754. z-index: 288;
  1755. }
  1756. .home-nav {
  1757. /* #ifdef H5 */
  1758. top: 20rpx !important;
  1759. /* #endif */
  1760. }
  1761. .home-nav {
  1762. color: #333;
  1763. position: fixed;
  1764. /* #ifdef MP */
  1765. width: 150rpx;
  1766. left: 15rpx;
  1767. height: 58rpx;
  1768. /* #endif */
  1769. /* #ifndef MP */
  1770. height: 56rpx;
  1771. width: 56rpx;
  1772. left: 33rpx;
  1773. /* #endif */
  1774. font-size: 33rpx;
  1775. z-index: 99;
  1776. background: rgba(255, 255, 255, 0.3);
  1777. border: 0.5px solid rgba(0,0,0,0.1);
  1778. border-radius: 40rpx;
  1779. &.right{
  1780. right: 33rpx;
  1781. left:unset
  1782. }
  1783. &.on {
  1784. background: unset;
  1785. color: #333;
  1786. }
  1787. &.homeIndex{
  1788. /* #ifdef MP */
  1789. width: 98rpx;
  1790. /* #endif */
  1791. /* #ifndef MP */
  1792. border-color: rgba(255,255,255,0);
  1793. /* #endif */
  1794. }
  1795. }
  1796. .home-nav .iconfont {
  1797. width: 66rpx;
  1798. text-align: center;
  1799. font-size: 30rpx;
  1800. color: #000;
  1801. }
  1802. .home-nav .line {
  1803. width: 1rpx;
  1804. height: 34rpx;
  1805. background: rgba(0, 0, 0, 0.1);
  1806. }
  1807. .home-nav .icon-xiangzuo {
  1808. width: auto;
  1809. font-size: 28rpx;
  1810. }
  1811. .share-box {
  1812. z-index: 1000;
  1813. position: fixed;
  1814. left: 0;
  1815. top: 0;
  1816. width: 100%;
  1817. height: 100%;
  1818. }
  1819. .share-box image {
  1820. width: 100%;
  1821. height: 100%;
  1822. }
  1823. </style>