index.vue 56 KB

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