index.vue 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319
  1. <template>
  2. <view :style="colorStyle">
  3. <skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
  4. bgcolor="#FFF"></skeleton>
  5. <view class="product-con skeleton" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
  6. <view>
  7. <view class="w-full fixed-lt z-99" :style="[navBarStyle]">
  8. <view class="w-full px-20 h-80 flex-between-center">
  9. <!-- #ifdef MP -->
  10. <view class="fixed flex-center opac" :style="[menuButtonStyle]">
  11. <!-- #endif -->
  12. <!-- #ifndef MP -->
  13. <view class="menu_box flex-center opac">
  14. <!-- #endif -->
  15. <image src="@/static/img/back_icon.png" class="w-32 h-32" @tap="backTap"></image>
  16. <text class="menu_line"></text>
  17. <image src="@/static/img/menu_icon.png" class="w-32 h-32" @tap="moreNav"></image>
  18. </view>
  19. <!-- #ifdef MP -->
  20. <view class="fixed rd-50-p111- flex-center opac"
  21. :style="[shareButtonStyle]"
  22. @tap="listenerActionSheet"
  23. v-show="diyProduct.openShare">
  24. <!-- #endif -->
  25. <!-- #ifndef MP -->
  26. <view class="w-60 h-60 rd-50-p111- flex-center opac" @tap="listenerActionSheet" v-show="diyProduct.openShare">
  27. <!-- #endif -->
  28. <image src="@/static/img/share_icon.png" class="w-32 h-32"></image>
  29. </view>
  30. </view>
  31. </view>
  32. <homeList
  33. :navH="46 + sysHeight"
  34. :currentPage="currentPage"
  35. :sysHeight="sysHeight"
  36. :openNavList="diyProduct.navList"></homeList>
  37. <view>
  38. <!-- 商品轮播图 -->
  39. <productConSwiper
  40. :autoHeight="diyProduct.pictureConfig"
  41. :showDot="diyProduct.swiperDot"
  42. :imgUrls="productSwiper"
  43. :videoline="productVideoLink"
  44. @videoPause="videoPause"
  45. class="skeleton-rect"></productConSwiper>
  46. <!-- 氛围图 -->
  47. <view class="atmosphere-card rd-t-40rpx relative w-full h-152 flex justify-between"
  48. :style="{backgroundImage:cardBg}" v-if="activityBg">
  49. <view class="flex items-baseline text--w111-fff pt-32 pl-40">
  50. <baseMoney :money="computedPrice.deduction.pay_price"
  51. symbolSize="32"
  52. integerSize="48"
  53. decimalSize="32"
  54. color="#ffffff"
  55. weight></baseMoney>
  56. <view class="fs-26 text--w111-fff pl-12"> 售价{{ attr.productSelect.price }} </view>
  57. <view class="fs-26 text--w111-fff pl-12" v-if="showVipPrice">会员价¥{{storeInfo.vip_price}}</view>
  58. </view>
  59. </view>
  60. <!-- 商品介绍卡片 -->
  61. <view class="info_card rd-40rpx relative">
  62. <view class="px-32">
  63. <view class="w-full pt-36">
  64. <!-- 骨架屏展示 -->
  65. <view v-if="showSkeleton">
  66. <view class="w-full h-46 skeleton-rect mt-20" ></view>
  67. <view class="mt-24 flex">
  68. <view class="w-200 h-46 skeleton-rect"></view>
  69. <view class="w-100 h-46 skeleton-rect ml-24"></view>
  70. </view>
  71. <view class="mt-24 flex-between-center">
  72. <view class="w-200 h-46 skeleton-rect"></view>
  73. <view class="w-200 h-46 skeleton-rect"></view>
  74. <view class="w-200 h-46 skeleton-rect"></view>
  75. </view>
  76. <view class="mt-24 flex-between-center">
  77. <view class="w-96 h-46 skeleton-rect"></view>
  78. <view class="flex-1 h-46 skeleton-rect ml-22"></view>
  79. </view>
  80. <view class="mt-24 flex-between-center">
  81. <view class="w-96 h-46 skeleton-rect"></view>
  82. <view class="flex-1 h-46 skeleton-rect ml-22"></view>
  83. </view>
  84. <view class="mt-24 flex-between-center">
  85. <view class="w-96 h-46 skeleton-rect"></view>
  86. <view class="flex-1 h-46 skeleton-rect ml-22"></view>
  87. </view>
  88. <view class="mt-24 flex">
  89. <view class="w-400 h-200 skeleton-rect"></view>
  90. <view class="w-400 h-200 skeleton-rect ml-24"></view>
  91. </view>
  92. </view>
  93. <!-- sku小图 -->
  94. <view class="flex mb-32" v-if="storeInfo.spec_type">
  95. <view class="flex-1 flex-center">
  96. <view :class="isSwiper ? 'active_pic' : 'scroll_pic'" @tap="selectSwiper">
  97. <image :src="storeInfo.image"></image>
  98. </view>
  99. <view class="w-76 h-80 flex-col flex-center fs-22 text--w111-333 lh-30rpx">
  100. <text>{{skuArr.length}}款</text>
  101. <text>可选</text>
  102. </view>
  103. </view>
  104. <scroll-view scroll-x="true" scroll-with-animation
  105. class="white-nowrap vertical-middle w-530" show-scrollbar="false">
  106. <view class="flex w-full">
  107. <view class="inline-block mr-16"
  108. :class="item.suk == attrValue && !isSwiper ? 'active_pic' : 'scroll_pic'"
  109. v-for="(item, index) in skuArr" :key="index"
  110. @tap="changeAttrPic(item,index)">
  111. <image :src="item.small_image"></image>
  112. </view>
  113. </view>
  114. </scroll-view>
  115. </view>
  116. <!-- 价格 -->
  117. <view class="flex-y-center" v-if="!activityBg">
  118. <view class="flex items-baseline">
  119. <view class="flex items-baseline" v-if="computedPrice.deduction.pay_price < computedPrice.deduction.sum_price">
  120. <baseMoney
  121. :money="computedPrice.deduction.pay_price"
  122. symbolSize="32"
  123. integerSize="48"
  124. preFix="到手价"
  125. preFixSize="22"
  126. textColor="var(--view-theme)"
  127. decimalSize="32" weight></baseMoney>
  128. <view class="fs-22 text--w111-3d3d3d pl-12"> 售价{{ attr.productSelect.price }} </view>
  129. </view>
  130. <baseMoney
  131. v-else
  132. :money="attr.productSelect.price"
  133. symbolSize="32"
  134. integerSize="48"
  135. preFixSize="22"
  136. textColor="var(--view-theme)"
  137. decimalSize="32" weight></baseMoney>
  138. <view class="svip-badge acea-row row-middle" v-if="showVipPrice">
  139. <view class="h-26 svip_rd fs-18 bg--w111-484643 text--w111-FDDAA4 px-8 acea-row row-middle">SVIP</view>
  140. <view class="px-8 Regular fw-600 acea-row row-middle">¥{{storeInfo.vip_price}}</view>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 活动标签 -->
  145. <view class="flex-between-center mt-24" v-if="computedPrice.deduction.pay_price < computedPrice.deduction.sum_price">
  146. <scroll-view
  147. scroll-x="true"
  148. show-scrollbar="false"
  149. class="white-nowrap vertical-middle w-600">
  150. <view class="inline-block h-44 rd-8rpx text-center lh-44rpx fs-22 text-primary-con px-8 bg-primary-light mr-16"
  151. v-for="(item,index) in discountInfo.discount" :key="index + 'i'">{{item.title}}</view>
  152. <view
  153. class="inline-block h-44 rd-8rpx text-center lh-44rpx fs-22 text-primary-con px-8 bg-primary-light mr-16"
  154. v-for="(item,index) in coupon.list" :key="index + 'k'"
  155. >满{{ item.use_min_price }}元可用</view>
  156. <view
  157. class="inline-block h-44 rd-8rpx text-center lh-44rpx fs-22 text-primary-con px-8 bg-primary-light mr-16"
  158. v-if="computedPrice.deduction.vip_price > 0"
  159. >会员优惠</view>
  160. </scroll-view>
  161. <view class="fs-22 text-primary-con" @tap="openPerferentDrawer">查看 <text
  162. class="iconfont icon-ic_rightarrow fs-24"></text> </view>
  163. </view>
  164. <!-- 商品名称 -->
  165. <view class="mt-20 fs-30 text--w111-333 fw-500">{{ storeInfo.store_name }}</view>
  166. <!-- 库存销量 -->
  167. <view class="flex-between-center mt-24 text--w111-999 fs-22 lh-30rpx">
  168. <text v-show="diyProduct.isOpen.includes(0)">原价:¥{{ storeInfo.ot_price }}</text>
  169. <text v-show="diyProduct.isOpen.includes(2)">库存:{{ storeInfo.stock }}{{ storeInfo.unit_name }}</text>
  170. <text v-show="diyProduct.isOpen.includes(1)">销量:{{ storeInfo.fsales || 0 }}{{ storeInfo.unit_name || ''}}</text>
  171. </view>
  172. <!-- 商品标签 -->
  173. <view class="flex items-end flex-wrap mt-24 w-full"
  174. v-if="storeInfo.store_label && storeInfo.store_label.length">
  175. <BaseTag
  176. :text="label.label_name"
  177. :color="label.color"
  178. :background="label.bg_color"
  179. :borderColor="label.border_color"
  180. :circle="label.border_color ? true : false"
  181. :imgSrc="label.icon"
  182. size="middle"
  183. v-for="(label, idx) in storeInfo.store_label" :key="idx"></BaseTag>
  184. </view>
  185. </view>
  186. </view>
  187. <view class="px-20">
  188. <!-- SVIP card -->
  189. <view class="h-80 rd-16rpx bg--w111-FFF0D1 flex-between-center mt-24 px-20"
  190. v-if="showVip">
  191. <view class="flex-y-center">
  192. <image src="@/static/img/vip_leval.png" class="w-36 h-36"></image>
  193. <view class="pl-8">
  194. <text class="fs-24 text--w111-7E4B06">开通 SVIP会员 预计省</text>
  195. <text class="text-primary-con fs-28 lh-40rpx px-4">{{diff}}</text>
  196. <text class="fs-24 text--w111-7E4B06">元</text>
  197. </view>
  198. </view>
  199. <view class="fs-24 text--w111-7E4B06" @tap="goPage(1,'/pages/annex/vip_paid/index')">
  200. <text>立即开通</text>
  201. <text class="iconfont icon-ic_rightarrow fs-24"></text>
  202. </view>
  203. </view>
  204. <!-- 排行榜 card -->
  205. <view class="h-80 rd-16rpx bg--w111-fff flex-between-center mt-24 px-20"
  206. @tap="goPage(1,'/pages/columnGoods/rank/index?type=' + storeInfo.rank_type)"
  207. v-if="storeInfo.rank > 0 && diyProduct.showRank">
  208. <view class="flex-y-center">
  209. <image :src="imgHost + '/statics/images/product/cup_icon.png'" class="w-32 h-32"></image>
  210. <image :src="imgHost + '/statics/images/product/rank_icon.png'" class="w-76 h-24 mx-8"></image>
  211. <text class="fs-26 text--w111-333">{{storeInfo.rank_type | rankType}}·第{{storeInfo.rank}}名</text>
  212. </view>
  213. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  214. </view>
  215. </view>
  216. </view>
  217. <view class="px-20">
  218. <!-- 活动 SKU选择 服务保障 -->
  219. <view class="rd-24rpx bg--w111-fff mt-20">
  220. <view class="flex-y-center h-100 rd-t-24rpx pl-20"
  221. v-if="activity.length && diyProduct.showService.includes(0)">
  222. <text class="fs-26 text--w111-888">活动</text>
  223. <view class="flex-y-center ml-32">
  224. <block v-for="(item, index) in activity" :key="index">
  225. <view
  226. class="inline-block px-16 h-48 lh-48rpx rd-24px bg-primary-light text-primary-con mr-16"
  227. v-if="item.type === '3'" @tap="goActivity(item)">
  228. <text class="iconfont icon-ic_user fs-28"></text>
  229. <text class="fs-24 pl-4">二人拼团</text>
  230. <text class="iconfont icon-ic_rightarrow fs-24"></text>
  231. </view>
  232. <view
  233. class="inline-block px-16 h-48 lh-48rpx rd-24px bg-primary-light text-primary-con mr-16"
  234. v-if="item.type === '1'" @tap="goActivity(item)">
  235. <text class="iconfont icon-ic_clock fs-28"></text>
  236. <text class="fs-24 pl-4">限时秒杀</text>
  237. <text class="iconfont icon-ic_rightarrow fs-24"></text>
  238. </view>
  239. <view
  240. class="inline-block px-16 h-48 lh-48rpx rd-24px bg-primary-light text-primary-con mr-16"
  241. v-if="item.type === '2'" @tap="goActivity(item)">
  242. <text class="iconfont icon-ic_sale fs-28"></text>
  243. <text class="fs-24 pl-4">参与砍价</text>
  244. <text class="iconfont icon-ic_rightarrow fs-24"></text>
  245. </view>
  246. </block>
  247. </view>
  248. </view>
  249. <view class="flex-between-center h-100 px-20" @tap="selecAttr"
  250. v-if="attr.productAttr.length && diyProduct.showService.includes(1)">
  251. <view class="flex-y-center">
  252. <text class="fs-26 text--w111-888">选择</text>
  253. <view class="ml-32 text--w111-333 fs-26 w-560 line1">{{ attrValue }}</view>
  254. </view>
  255. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  256. </view>
  257. <view class="flex-between-center h-100 px-20"
  258. v-if="storeInfo.ensure && storeInfo.ensure.length && diyProduct.showService.includes(2)"
  259. @tap="()=>{showServiceDrawer = true}">
  260. <view class="flex-y-center">
  261. <text class="fs-26 text--w111-888">服务</text>
  262. <view class="ml-32 text--w111-333 fs-26 w-524 line1">{{ensureInfo.ensureTitle}}</view>
  263. </view>
  264. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  265. </view>
  266. <view class="flex-between-center h-100 px-20"
  267. v-if="storeInfo.specs && storeInfo.specs.length && diyProduct.showService.includes(3)"
  268. @tap="seeSpecs">
  269. <view class="flex-y-center">
  270. <text class="fs-26 text--w111-888">参数</text>
  271. <view class="ml-32 text--w111-333 fs-26 w-524 line1">{{specsInfo.specsTitle}}</view>
  272. </view>
  273. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  274. </view>
  275. <view class="acea-row row-between h-146 pl-20 pr-20 pt-30" v-if="isMention && Object.keys(storeList).length && diyProduct.showService.includes(4)" @tap="showStoreList">
  276. <view class="acea-row">
  277. <text class="fs-26 text--w111-888">门店</text>
  278. <view class="ml-32 text--w111-333 fs-26 w-524 line1">
  279. <view class="fs-26"><text class="iconfont icon-ic_mall fs-30 mr-12"></text>{{storeList.name}}</view>
  280. <view class="fs-22 text--w111-666 mt-18 line1">{{ storeList.address }}{{ ", " + storeList.detailed_address }}</view>
  281. </view>
  282. </view>
  283. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  284. </view>
  285. </view>
  286. <!-- 评价卡片 -->
  287. <view class="rd-24rpx bg--w111-fff mt-20 py-32"
  288. v-if="replyCount && diyProduct.showReply"
  289. @tap="goPage(1,'/pages/goods/goods_comment_list/index?product_id=' + id)">
  290. <view class="px-20 flex-between-center">
  291. <view>
  292. <text class="text--w111-333 fs-30 fw-500">评价</text>
  293. <text class="fs-24 text--w111-666 pl-8">({{replyCount}})</text>
  294. </view>
  295. <view class="flex-y-center">
  296. <text class="fs-28 text-primary-con">{{replyChance}}%</text>
  297. <text class="fs-24 text--w111-999 pr-12">好评率</text>
  298. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  299. </view>
  300. </view>
  301. <!-- 滑动内容 -->
  302. <block v-if="replyCount">
  303. <userEvaluation :reply="reply" @changeLogin="changeLogin" :fromTo="1"></userEvaluation>
  304. </block>
  305. </view>
  306. <!-- 搭配购 -->
  307. <view class="rd-24rpx bg--w111-fff mt-20 py-30" v-if="discountsData.length && diyProduct.showMatch"
  308. @tap="goPage(1,'/pages/goods/match_pay/index?id=' + id)">
  309. <view class="px-20 flex-between-center">
  310. <view>
  311. <text class="text--w111-333 fs-30 fw-500">搭配购</text>
  312. <text class="fs-24 text--w111-666 pl-8">({{discountsData.length}})</text>
  313. </view>
  314. <text class="iconfont icon-ic_rightarrow fs-24 text--w111-666"></text>
  315. </view>
  316. <scroll-view scroll-x="true" class="white-nowrap vertical-middle w-690 mt-24 pl-20"
  317. show-scrollbar="false">
  318. <view class="inline-block mr-20" v-for="item in discountsData" :key="item.id">
  319. <view class="flex">
  320. <image class="w-164 h-164 rd-16rpx" :src="item.image" mode="aspectFill"></image>
  321. <view class="flex-1 pl-24">
  322. <view class="w-278 text--w111-333 fs-26 break_word line1">{{item.title}}</view>
  323. <view class="w-278 mt-20 text-center lh-30rpx break_word fs-22 text--w111-999 line2">
  324. <text v-for="(items,index) in item.products" :key="index">{{items.store_name}} +</text>
  325. </view>
  326. <view class="flex-y-center fs-20 mt-20" v-if="item.max_discounts_price > 0">
  327. <text class="iconfont icon-a-ic_Money111 font-num fs-28"></text>
  328. <text class="text--w111-999 px-4">最多可省</text>
  329. <text class="font-color fs-24 fw-600">¥{{item.max_discounts_price}}</text>
  330. </view>
  331. </view>
  332. </view>
  333. </view>
  334. </scroll-view>
  335. </view>
  336. <!-- 优品推荐 -->
  337. <view class="rd-24rpx bg--w111-fff mt-20 py-32" v-if="good_list.length && diyProduct.showRecommend">
  338. <view class="pl-20 fs-30 fw-500 text--w111-333">优品推荐</view>
  339. <view class="grid-column-3 grid-gap-x-38rpx grid-gap-y-26rpx px-20 mt-28" v-if="good_list.length <= 6">
  340. <view v-for="(item, index) in good_list" :key="index"
  341. @tap="goPage(1,'/pages/goods_details/index?id=' + item.id)">
  342. <image class="w-198 h-198 rd-20rpx" :src="item.image" mode="aspectFill"></image>
  343. <view class="w-full line1 fs-26 lh-26rpx pt-16">{{ item.store_name }}</view>
  344. <view class="text-primary-con pt-14 fs-28 lh-28rpx fw-600">¥{{ item.price }}</view>
  345. </view>
  346. </view>
  347. <scroll-view scroll-x="true" class="w-690 mt-24 pl-20" show-scrollbar="false" v-else>
  348. <view class="white-nowrap vertical-middle">
  349. <view class="inline-block recommend_pro" v-for="(item,index) in good_list" :key="index"
  350. v-if="(index%2)==0" @tap="goPage(1,'/pages/goods_details/index?id=' + item.id)">
  351. <image class="w-198 h-198 rd-20rpx" :src="item.image">
  352. </image>
  353. <view class="w-198 line1 fs-26 lh-26rpx pt-16 text--w111-333">{{item.store_name}}</view>
  354. <view class="text-primary-con pt-14 fs-28 lh-28rpx fw-600">¥{{item.price}}</view>
  355. </view>
  356. </view>
  357. <view class="white-nowrap vertical-middle mt-24">
  358. <view class="inline-block recommend_pro" v-for="(item,index) in good_list" :key="index"
  359. v-if="(index%2)!=0" @tap="goPage(1,'/pages/goods_details/index?id=' + item.id)">
  360. <image class="w-198 h-198 rd-20rpx" :src="item.image">
  361. </image>
  362. <view class="w-198 line1 fs-26 lh-26rpx pt-16 text--w111-333">{{item.store_name}}</view>
  363. <view class="text-primary-con pt-14 fs-28 lh-28rpx fw-600">¥{{item.price}}</view>
  364. </view>
  365. </view>
  366. </scroll-view>
  367. </view>
  368. <!-- 底部操作按钮 -->
  369. <view class="page_footer bg--w111-fff-s111-80 w-full z-99 fixed-lb pb-safe">
  370. <view class="w-full h-104 pl-32 pr-20 flex">
  371. <view class="flex">
  372. <view class="flex-col flex-center mr-38" @tap="goPage(2,'/pages/index/index')"
  373. v-if="diyProduct.menuList.includes(3)">
  374. <text class="iconfont icon-ic_mall fs-40"></text>
  375. <text class="fs-18">首页</text>
  376. </view>
  377. <view class="flex-col flex-center mr-38" @tap="listenerActionSheet"
  378. v-if="diyProduct.menuList.includes(4)">
  379. <text class="iconfont icon-ic_transmit1 fs-40"></text>
  380. <text class="fs-18">分享</text>
  381. </view>
  382. <!-- #ifdef MP -->
  383. <button class="flex-col flex-center mr-38 bg-transparent" hover-class='none' open-type='contact'
  384. v-if="diyProduct.menuList.includes(0) && routineContact">
  385. <text class="iconfont icon-ic_customerservice fs-40"></text>
  386. <text class="fs-18">客服</text>
  387. </button>
  388. <button class="flex-col flex-center mr-38 bg-transparent" hover-class='none'
  389. v-else-if="diyProduct.menuList.includes(0) && !routineContact" @tap="goGoodCall">
  390. <text class="iconfont icon-ic_customerservice fs-40"></text>
  391. <text class="fs-18">客服</text>
  392. </button>
  393. <!-- #endif -->
  394. <!-- #ifdef H5 || APP-PLUS -->
  395. <view class="flex-col flex-center mr-38" v-if="diyProduct.menuList.includes(0)"
  396. @tap="goGoodCall">
  397. <text class="iconfont icon-ic_customerservice fs-40"></text>
  398. <text class="fs-18">客服</text>
  399. </view>
  400. <!-- #endif -->
  401. <view class="flex-col flex-center mr-38" @tap="setCollect" v-if="diyProduct.menuList.includes(1)">
  402. <text class="iconfont fs-40" :class="storeInfo.userCollect ? 'icon-ic_star1' : 'icon-ic_star'"></text>
  403. <text class="fs-18">收藏</text>
  404. </view>
  405. <view class="flex-col flex-center mr-38 animated relative"
  406. :class="animated == true ? 'bounceIn' : ''"
  407. @tap="goPage(2,'/pages/order_addcart/order_addcart')"
  408. v-if="diyProduct.menuList.includes(2)">
  409. <text class="iconfont icon-ic_ShoppingCart fs-40"></text>
  410. <text class="num-badge bg-color" v-if="parseFloat(CartCount) > 0">{{ CartCount || 0 }}</text>
  411. <text class="fs-18">购物车</text>
  412. </view>
  413. </view>
  414. <view class="flex-1 grid-column-2 self-center grid-gap-16rpx"
  415. v-if="attr.productSelect.stock <= 0 && storeInfo.cart_button && diyProduct.showCart">
  416. <!-- 无库存允许加入购物车并且可视化开启了购物车 -->
  417. <view class="w-full h-72 flex-center join_cart rd-36px text--w111-fff fs-26" @tap="joinCart">加入购物车</view>
  418. <!-- 平台没有可以从门店购买 -->
  419. <view v-if="is_store_buy || delivery_type == 2 || delivery_type == 3" @tap="goBuy" class="w-full h-72 flex-center bg-color rd-36px text--w111-fff fs-26">门店购买</view>
  420. <view v-else class="w-full h-72 flex-center bg-hui rd-36px text--w111-fff fs-26">已售罄</view>
  421. </view>
  422. <view class="flex-1 flex-y-center"
  423. v-else-if="attr.productSelect.stock <= 0 && storeInfo.cart_button && !diyProduct.showCart">
  424. <!-- 无库存允许加入购物车并且可视化关闭了购物车 -->
  425. <!-- 平台没有可以从门店购买 -->
  426. <view v-if="is_store_buy || delivery_type == 2 || delivery_type == 3" @tap="goBuy" class="w-full h-72 flex-center bg-color rd-36px text--w111-fff fs-26">门店购买</view>
  427. <view v-else class="w-full h-72 flex-center bg-hui rd-36px text--w111-fff fs-26">已售罄</view>
  428. </view>
  429. <view class="flex-1 grid-column-2 self-center grid-gap-16rpx"
  430. v-else-if="attr.productSelect.stock >0 && storeInfo.cart_button && diyProduct.showCart">
  431. <!-- 有库存允许加入购物车并且可视化开启了购物车 -->
  432. <view class="w-full h-72 flex-center join_cart rd-36px text--w111-fff fs-26" @tap="joinCart">加入购物车</view>
  433. <view class="w-full h-72 flex-center bg-color rd-36px text--w111-fff fs-26"
  434. @tap="goBuy">{{is_store_buy || delivery_type == 2 || delivery_type == 3?'门店购买':'立即购买'}}</view>
  435. </view>
  436. <view class="flex-1 flex-y-center" v-else>
  437. <!-- 有库存不允许加入购物车并且可视化关闭了购物车 -->
  438. <view class="w-full h-72 flex-center bg-color rd-36px text--w111-fff fs-26"
  439. @tap="goBuy">{{is_store_buy || delivery_type == 2 || delivery_type == 3?'门店购买':'立即购买'}}</view>
  440. </view>
  441. </view>
  442. </view>
  443. <view class="rd-24rpx bg--w111-fff mt-20" id="past3">
  444. <view class="fs-30 fw-500 lh-40rpx flex-center py-32">商品详情</view>
  445. <view class="conter">
  446. <!-- #ifndef APP-PLUS -->
  447. <jyf-parser :html="description" ref="article" :tag-style="tagStyle"></jyf-parser>
  448. <!-- #endif -->
  449. <!-- #ifdef APP-PLUS -->
  450. <view v-html="description"></view>
  451. <!-- #endif -->
  452. </view>
  453. </view>
  454. <view class="pb-safe h-148"></view>
  455. <!-- 服务抽屉 -->
  456. <service-modal :visible="showServiceDrawer" :ensureInfo="ensureInfo" @closeDrawer="()=>{showServiceDrawer = false}"></service-modal>
  457. <!-- 优惠弹窗 -->
  458. <preferential-modal
  459. :visible="showPerferentDrawer"
  460. :discountInfo="discountInfo"
  461. :coupon="coupon"
  462. :computedPrice="computedPrice"
  463. @ChangCouponsUseState="ChangCouponsUseState"
  464. @closeDrawer="()=>{showPerferentDrawer = false}"
  465. @ruleToggle="ruleToggle"></preferential-modal>
  466. <!-- sku弹窗 -->
  467. <productWindow
  468. ref='productWindow'
  469. :attr="attr"
  470. :isShow="1"
  471. :iSplus="1"
  472. :type="0"
  473. isExtends
  474. :storeInfo="storeInfo"
  475. :productId="storeInfo.id"
  476. :isStoreBuy="is_store_buy"
  477. :is_vip="is_vip"
  478. :storeId='storeId'
  479. @myevent="onMyEvent"
  480. @ChangeAttr="ChangeAttr"
  481. @ChangeCartNum="ChangeCartNum"
  482. @attrVal="attrVal"
  483. @iptCartNum="iptCartNum"
  484. @getImg="showImg"
  485. @deliveryFun="deliveryFun"
  486. @onAddressId="onAddressId"
  487. @onstoreId="onstoreId"
  488. @onConfirm="onConfirm" id="product-window"></productWindow>
  489. <specs :specsInfo="specsInfo" @myevent="mySpecs"></specs>
  490. <cusPreviewImg ref="cusPreviewImg" :list="skuArr" @changeSwitch="changeSwitch"></cusPreviewImg>
  491. <!-- #ifdef H5 || APP-PLUS -->
  492. <zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="codeVal" :size="size" :unit="unit"
  493. :background="background" :foreground="foreground" :pdground="pdground" :icon="codeIcon"
  494. :iconSize="iconsize" :onval="onval" :loadMake="loadMake" @result="qrR" />
  495. <!-- #endif -->
  496. <!-- 分享按钮 -->
  497. <view class="generate-posters pb-safe" :class="posters ? 'on' : ''">
  498. <view class="generateCon acea-row row-middle">
  499. <!-- #ifdef H5 -->
  500. <button class="item" hover-class="none" v-if="weixinStatus === true"
  501. @tap="H5ShareBox = true">
  502. <view class="pictrue">
  503. <image src="../../static/images/weixin.png"></image>
  504. </view>
  505. <view class="">分享给好友</view>
  506. </button>
  507. <!-- #endif -->
  508. <!-- #ifdef MP -->
  509. <button class="item" open-type="share" hover-class="none">
  510. <view class="pictrue">
  511. <image src="../../static/images/weixin.png"></image>
  512. </view>
  513. <view class="">分享给好友</view>
  514. </button>
  515. <!-- #endif -->
  516. <!-- #ifdef APP-PLUS -->
  517. <view class="item" @tap="appShare('WXSceneSession')">
  518. <view class="pictrue">
  519. <image src="../../static/images/weixin.png"></image>
  520. </view>
  521. <view class="">分享给好友</view>
  522. </view>
  523. <view class="item" @tap="appShare('WXSenceTimeline')">
  524. <view class="pictrue">
  525. <image src="./static/weixinCircle.png"></image>
  526. </view>
  527. <view class="">分享朋友圈</view>
  528. </view>
  529. <!-- #endif -->
  530. <view class="item" @tap="getpreviewImage">
  531. <view class="pictrue">
  532. <image src="../../static/images/changan.png"></image>
  533. </view>
  534. <view class="">预览发图</view>
  535. </view>
  536. <!-- #ifndef H5 -->
  537. <button class="item" hover-class="none" @tap="savePosterPath">
  538. <view class="pictrue">
  539. <image src="../../static/images/haibao.png"></image>
  540. </view>
  541. <view class="">保存海报</view>
  542. </button>
  543. <!-- #endif -->
  544. </view>
  545. <view class="generateClose flex-center" @tap="posterImageClose">取消</view>
  546. </view>
  547. <div class="fixed-center" v-if="posters && !posterImageStatus">
  548. <image class="poster-loading" :src="imgHost + '/statics/images/poster_loading.png'" mode="widthFix" ></image>
  549. </div>
  550. <!-- 海报展示 -->
  551. <view class="poster-mask" v-if="posterImageStatus || posters"></view>
  552. <view class="poster-pop" v-if="posterImageStatus">
  553. <image :src="posterImage"></image>
  554. </view>
  555. <canvas class="canvas" canvas-id="myCanvas" v-if="canvasStatus"></canvas>
  556. <!-- 发送给朋友图片 -->
  557. <view class="share-box" v-if="H5ShareBox">
  558. <image :src="imgHost + '/statics/images/share-info.png'" @tap="H5ShareBox = false">
  559. </image>
  560. </view>
  561. </view>
  562. </view>
  563. </view>
  564. </view>
  565. </view>
  566. </template>
  567. <script>
  568. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  569. import zbCode from '@/components/zb-code/zb-code.vue'
  570. import {
  571. getProductDetail,
  572. getProductCtivity,
  573. getProductRecommend,
  574. getProductCode,
  575. collectAdd,
  576. collectDel,
  577. postCartAdd,
  578. getProductStoreDetail
  579. } from '@/api/store.js';
  580. import {
  581. getUserInfo,
  582. userShare
  583. } from '@/api/user.js';
  584. import { getCoupons } from '@/api/api.js';
  585. import { getCartCounts } from '@/api/order.js';
  586. import { toLogin } from '@/libs/login.js';
  587. import { mapGetters } from 'vuex';
  588. import { imageBase64 } from '@/api/public';
  589. import countDown from '@/components/countDown';
  590. import productConSwiper from '@/components/productConSwiper';
  591. import productWindow from '@/components/productWindow';
  592. import specs from '@/components/specs/index.vue';
  593. import userEvaluation from '@/components/userEvaluation';
  594. import shareRedPackets from './components/shareRedPackets/index.vue';
  595. import kefuIcon from '@/components/kefuIcon';
  596. import cusPreviewImg from '@/components/cusPreviewImg';
  597. import homeList from '@/components/homeList'
  598. import serviceModal from './components/serviceModal/index.vue';
  599. import preferentialModal from './components/preferentialModal/index.vue';
  600. import { silenceBindingSpread } from '@/utils';
  601. import {
  602. TOKENNAME,
  603. HTTP_REQUEST_URL
  604. } from '@/config/app.js';
  605. import {
  606. Debounce
  607. } from '@/utils/validate.js'
  608. let app = getApp();
  609. import colors from "@/mixins/color";
  610. export default {
  611. components: {
  612. zbCode,
  613. productConSwiper,
  614. productWindow,
  615. userEvaluation,
  616. shareRedPackets,
  617. kefuIcon,
  618. cusPreviewImg,
  619. specs,
  620. countDown,
  621. homeList,
  622. serviceModal,
  623. preferentialModal
  624. },
  625. directives: {
  626. trigger: {
  627. inserted(el, binging) {
  628. el.click();
  629. }
  630. }
  631. },
  632. mixins: [colors],
  633. data() {
  634. let that = this;
  635. return {
  636. showSkeleton: true, //骨架屏显示隐藏
  637. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  638. //属性是否打开
  639. coupon: {
  640. type: -1,
  641. list: [],
  642. count: []
  643. },
  644. attrTxt: '请选择', //属性页面提示
  645. attrValue: '', //已选属性
  646. animated: false, //购物车动画
  647. id: 0, //商品id
  648. replyCount: 0, //总评论数量
  649. reply: [], //评论列表
  650. storeInfo: {
  651. brand_name: ''
  652. }, //商品详情
  653. productValue: [], //系统属性
  654. cart_num: 1, //购买数量
  655. isOpen: false, //是否打开属性组件
  656. actionSheetHidden: true,
  657. posterImageStatus: false,
  658. storeImage: '', //海报产品图
  659. PromotionCode: '', //二维码图片
  660. canvasStatus: false, //海报绘图标签
  661. posterImage: '', //海报路径
  662. posterbackgd: '/static/images/posterbackgd.png',
  663. sharePacket: {
  664. isState: true //默认不显示
  665. }, //分销商详细
  666. uid: 0, //用户uid
  667. circular: false,
  668. autoplay: false,
  669. interval: 3000,
  670. duration: 500,
  671. good_list: [],
  672. replyChance: 0,
  673. CartCount: 0,
  674. isDown: true,
  675. posters: false,
  676. weixinStatus: false,
  677. ensureInfo: {
  678. show: false,
  679. ensure: [],
  680. ensureTitle: ''
  681. },
  682. specsInfo: {
  683. show: false,
  684. specs: [],
  685. specsTitle:''
  686. },
  687. discountInfo: {
  688. show: false,
  689. discount: []
  690. },
  691. attr: {
  692. cartAttr: false,
  693. productAttr: [],
  694. productSelect: {},
  695. deliveryType: [],
  696. isType: 0,
  697. relation_id: 0
  698. },
  699. limitInfo: {
  700. discount_price: 0,
  701. price: 0,
  702. discount: 1,
  703. datatime: 0
  704. },
  705. promotions_type: 0,
  706. description: '',
  707. H5ShareBox: false, //公众号分享图片
  708. activity: [],
  709. lock: false,
  710. scrollTop: 0,
  711. tagStyle: {
  712. img: 'width:100%;display:block;',
  713. table: 'width:100%',
  714. video: 'width:100%'
  715. },
  716. returnShow: true, //判断顶部返回是否出现
  717. diff: '',
  718. is_money_level: 1,
  719. is_vip: 0, //是否是会员
  720. routineContact: 0,
  721. discountsData: [], //套餐数据
  722. siteName: '', //商城名称
  723. themeColor: '',
  724. fontColor: '',
  725. isMention: false, //是否存在到店自提
  726. showAnimate: true,
  727. skuArr: [],
  728. //二维码参数
  729. codeShow: false,
  730. cid: '1',
  731. codeVal: "", // 要生成的二维码值
  732. size: 200, // 二维码大小
  733. unit: 'upx', // 单位
  734. background: '#FFF', // 背景色
  735. foreground: '#000', // 前景色
  736. pdground: '#000', // 角标色
  737. codeIcon: '', // 二维码图标
  738. iconsize: 40, // 二维码图标大小
  739. lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  740. onval: true, // val值变化时自动重新生成二维码
  741. loadMake: true, // 组件加载完成后自动生成二维码
  742. base64Show: 0,
  743. shareQrcode: 0,
  744. followCode: '',
  745. selectSku: {},
  746. currentPage: false,
  747. sysHeight: sysHeight,
  748. isShow: 0,
  749. imgHost: HTTP_REQUEST_URL,
  750. fromType: 0, //判断是否回退分类二和三刷新
  751. cartNum: 0,
  752. addressId: '',
  753. store_id: '',
  754. store_name: '',
  755. delivery_type: 0,
  756. is_store_buy:1, //判断平台是否有库存(0:平台有库存;1:平台没有库存)
  757. storeList:{},
  758. activityBg: '',
  759. posterTitle: '',
  760. showServiceDrawer:false,
  761. showPerferentDrawer:false,
  762. pageScrollStatus:false,
  763. cartType:'',
  764. computedPrice:{
  765. deduction:{
  766. pay_price:0,
  767. sum_price:0,
  768. vip_price:0
  769. }
  770. },
  771. isSwiper: true, //默认展示轮播图
  772. productSwiper: [], //轮播图复制空间
  773. productVideoLink:'', //轮播图视频链接复制空间
  774. userInfo: {},
  775. storeId:0 //跳转门店列表切换时获取门店id
  776. };
  777. },
  778. filters:{
  779. rankType(val){
  780. let obj = {
  781. 1:'销量排行榜',
  782. 2:'好评排行榜',
  783. 3:'收藏排行榜'
  784. };
  785. return obj[val]
  786. }
  787. },
  788. computed:{
  789. ...mapGetters(['isLogin','diyProduct']),
  790. showVip(){
  791. return !this.is_money_level && this.storeInfo.vip_price && this.storeInfo.is_vip && this.diyProduct.showSvip
  792. },
  793. cardBg(){
  794. return `url(${this.activityBg})`
  795. },
  796. showVipPrice(){
  797. if(this.storeInfo.vip_price > 0 && this.storeInfo.is_vip == 1 && this.storeInfo.price_type == 'member'){
  798. return true
  799. }
  800. },
  801. computedPayPrice(){
  802. return this.computedPrice.deduction.pay_price
  803. },
  804. navBarStyle(){
  805. return {
  806. background: this.pageScrollStatus ? '#fff' : 'transparent',
  807. paddingTop: (this.sysHeight) * 2 + 'rpx'
  808. }
  809. },
  810. // #ifdef MP
  811. shareButtonStyle(){
  812. let res = wx.getMenuButtonBoundingClientRect();
  813. return {
  814. width: res.height + 'px',
  815. height: res.height + 'px',
  816. top: res.top + 'px',
  817. left: (res.left - 38) + 'px'
  818. }
  819. },
  820. menuButtonStyle(){
  821. let res = wx.getMenuButtonBoundingClientRect();
  822. return {
  823. width: res.width + 'px',
  824. height: res.height + 'px',
  825. top: res.top + 'px',
  826. left: '11px',
  827. borderRadius: res.height + 'px',
  828. }
  829. }
  830. // #endif
  831. },
  832. watch: {
  833. isLogin: {
  834. handler: function(newV, oldV) {
  835. if (newV == true) {
  836. this.getCartCount();
  837. }
  838. },
  839. deep: true
  840. },
  841. },
  842. onLoad(options) {
  843. let that = this;
  844. var pages = getCurrentPages();
  845. that.returnShow = pages.length === 1 ? false : true;
  846. that.id = options.id;
  847. that.isShow = options.isShow;
  848. that.promotions_type = options.promotions_type || 0;
  849. that.fromType = options.fromType;
  850. //扫码携带参数处理
  851. // #ifdef MP
  852. if (options.scene) {
  853. let value = that.$util.getUrlParams(decodeURIComponent(options.scene));
  854. if (value.id) options.id = value.id;
  855. //记录推广人uid
  856. if (value.spid) app.globalData.spid = value.spid;
  857. }
  858. if (!options.id) {
  859. this.showSkeleton = false;
  860. return that.$util.Tips({
  861. title: '缺少参数无法查看商品'
  862. }, {
  863. tab: 3,
  864. url: 1
  865. });
  866. } else {
  867. that.id = options.id;
  868. }
  869. if (that.isLogin && options.id) {
  870. that.downloadFilePromotionCode();
  871. }
  872. // #endif
  873. //记录推广人uid
  874. if (options.spid) app.globalData.spid = options.spid;
  875. that.getGoodsDetails();
  876. // #ifdef H5
  877. that.isLogin && silenceBindingSpread();
  878. // #endif
  879. this.colorData();
  880. },
  881. onReady: function() {
  882. this.isNodes++;
  883. // #ifdef H5
  884. this.codeVal = window.location.origin + '/pages/goods_details/index?id=' + this.id +
  885. '&spid=' + this.$store.state.app.uid
  886. // #endif
  887. // #ifdef APP-PLUS
  888. this.codeVal = HTTP_REQUEST_URL + '/pages/goods_details/index?id=' + this.id +
  889. '&spid=' + this.$store.state.app.uid
  890. // #endif
  891. },
  892. onShow() {
  893. uni.removeStorageSync('form_type_cart');
  894. },
  895. mounted(){
  896. uni.$on('activeFn', data => {
  897. if(data){
  898. this.storeList = data;
  899. this.storeId = data.id;
  900. }
  901. // let id = data.id;
  902. // this.store_id = id;
  903. // this.$refs.productWindow.getList(id);
  904. })
  905. },
  906. /**
  907. * 用户点击右上角分享
  908. */
  909. // #ifdef MP
  910. onShareAppMessage: function() {
  911. let that = this;
  912. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  913. userShare();
  914. return {
  915. title: that.storeInfo.store_name || '',
  916. imageUrl: that.storeInfo.image || '',
  917. path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
  918. };
  919. },
  920. onShareTimeline() {
  921. let that = this;
  922. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  923. userShare();
  924. return {
  925. title: that.storeInfo.store_name || '',
  926. imageUrl: that.storeInfo.image || '',
  927. path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
  928. };
  929. },
  930. // #endif
  931. methods: {
  932. // 获取配送方式
  933. deliveryFun(e) {
  934. this.delivery_type = e;
  935. },
  936. // 获取配送地址id
  937. onAddressId(row) {
  938. this.addressId = row.id
  939. },
  940. // 门店详情
  941. getStoreDetail(id,pid){
  942. getProductStoreDetail(pid?pid:this.id,{store_id:id}).then(res=>{
  943. let storeInfo = res.data.storeInfo;
  944. this.$set(this, 'storeInfo', storeInfo);
  945. this.$set(this, 'productValue', res.data.productValue);
  946. this.DefaultSelect();
  947. }).catch(err=>{
  948. return this.$util.Tips({
  949. title: err
  950. });
  951. })
  952. },
  953. // 获取自提地址id
  954. onstoreId(row,flag) {
  955. this.storeList = row;
  956. if(flag == 2 || flag == 3){
  957. this.store_id = row.id;
  958. this.store_name = row.name;
  959. this.getStoreDetail(row.id);
  960. }else{
  961. this.getStoreDetail(0,this.storeInfo.pid);
  962. }
  963. },
  964. /*
  965. * 跳转门店列表
  966. */
  967. showStoreList: function() {
  968. let id = this.storeInfo.pid?this.storeInfo.pid:this.storeInfo.id
  969. uni.navigateTo({
  970. url:'/pages/store/list/index?type=1&isCollage=1&storeId='+this.storeList.id+'&product_id='+id
  971. })
  972. },
  973. changeLogin() {
  974. toLogin()
  975. },
  976. seeEnsure() {
  977. this.ensureInfo.show = true;
  978. },
  979. seeSpecs() {
  980. this.specsInfo.show = true;
  981. },
  982. seeDiscount() {
  983. this.discountInfo.show = true;
  984. },
  985. moreNav() {
  986. this.currentPage = !this.currentPage
  987. },
  988. //点击sku图片打开轮播图
  989. showImg(index) {
  990. this.$refs.cusPreviewImg.open(this.selectSku.suk)
  991. },
  992. //滑动轮播图选择商品
  993. changeSwitch(e) {
  994. let productSelect = this.skuArr[e];
  995. this.$set(this, 'selectSku', productSelect);
  996. var skuList = productSelect.suk.split(',');
  997. skuList.forEach((i, index) => {
  998. this.$set(this.attr.productAttr[index], 'index', skuList[index]);
  999. })
  1000. if (productSelect) {
  1001. this.$set(this.attr.productSelect, 'image', productSelect.image);
  1002. this.$set(this.attr.productSelect, 'price', productSelect.price);
  1003. this.$set(this.attr.productSelect, 'stock', productSelect.stock);
  1004. this.$set(this.attr.productSelect, 'unique', productSelect.unique);
  1005. this.$set(this.attr.productSelect, 'cart_num', 1);
  1006. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  1007. this.$set(this, 'attrValue', productSelect.suk);
  1008. this.$set(this, 'attrTxt', '已选择');
  1009. }
  1010. },
  1011. qrR(res) {
  1012. // #ifdef H5
  1013. if (!this.$wechat.isWeixin() || this.shareQrcode != '1') {
  1014. this.PromotionCode = res;
  1015. this.followCode = ''
  1016. }
  1017. // #endif
  1018. // #ifdef APP-PLUS
  1019. this.PromotionCode = res;
  1020. // #endif
  1021. },
  1022. boxStatus(data) {
  1023. this.showAnimate = data
  1024. },
  1025. followWX() {
  1026. getProductCode(this.id).then(res => {
  1027. this.followCode = res.data.code
  1028. this.getImageBase64(1);
  1029. }).catch(err => {
  1030. this.$util.Tips({
  1031. title: err
  1032. });
  1033. })
  1034. },
  1035. // 图片预览;
  1036. getpreviewImage: function() {
  1037. if (this.posterImage) {
  1038. let photoList = [];
  1039. photoList.push(this.posterImage)
  1040. uni.previewImage({
  1041. urls: photoList,
  1042. current: this.posterImage
  1043. });
  1044. } else {
  1045. this.$util.Tips({
  1046. title: '您的海报尚未生成'
  1047. });
  1048. }
  1049. },
  1050. videoPause() {
  1051. },
  1052. // app分享
  1053. // #ifdef APP-PLUS
  1054. appShare(scene) {
  1055. let that = this
  1056. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  1057. let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
  1058. uni.share({
  1059. provider: "weixin",
  1060. scene: scene,
  1061. type: 0,
  1062. href: `${HTTP_REQUEST_URL}${curRoute}&spid=${that.uid}`,
  1063. title: that.storeInfo.store_name,
  1064. summary: that.storeInfo.store_info,
  1065. imageUrl: that.storeInfo.small_image,
  1066. success: function(res) {
  1067. // uni.showToast({
  1068. // title: '分享成功',
  1069. // icon: 'success'
  1070. // })
  1071. // that.posters = false;
  1072. },
  1073. fail: function(err) {
  1074. uni.showToast({
  1075. title: '分享失败',
  1076. icon: 'none',
  1077. duration: 2000
  1078. })
  1079. // that.posters = false;
  1080. }
  1081. });
  1082. },
  1083. // #endif
  1084. closeChange: function() {
  1085. this.$set(this.sharePacket, 'isState', true);
  1086. },
  1087. goActivity: function(e) {
  1088. let item = e;
  1089. if (item.type == 1) {
  1090. uni.navigateTo({
  1091. url: `/pages/activity/goods_details/index?id=${item.id}&type=1&time=${item.time}&status=1`
  1092. });
  1093. } else if (item.type == 2) {
  1094. uni.navigateTo({
  1095. url: `/pages/activity/goods_bargain_details/index?id=${item.id}&spid=${this.uid}`
  1096. });
  1097. } else {
  1098. uni.navigateTo({
  1099. url: `/pages/activity/goods_details/index?id=${item.id}&type=3`
  1100. });
  1101. }
  1102. },
  1103. /**
  1104. * 购物车手动填写
  1105. *
  1106. */
  1107. iptCartNum: function(e) {
  1108. this.$set(this.attr.productSelect, 'cart_num', e);
  1109. },
  1110. backTap() {
  1111. let pages = getCurrentPages(); // 获取当前打开过的页面路由数,
  1112. if (pages.length > 1) {
  1113. uni.navigateBack()
  1114. } else {
  1115. uni.switchTab({
  1116. url: '/pages/index/index'
  1117. });
  1118. }
  1119. },
  1120. /*
  1121. *去商品详情页
  1122. */
  1123. goDetail(item) {
  1124. if (item.activity.length == 0) {
  1125. uni.redirectTo({
  1126. url: '/pages/goods_details/index?id=' + item.id
  1127. });
  1128. return;
  1129. }
  1130. // 砍价
  1131. if (item.activity && item.activity.type == 2) {
  1132. uni.redirectTo({
  1133. url: `/pages/activity/goods_bargain_details/index?id=${item.activity.id}&spid=${this.uid}`
  1134. });
  1135. return;
  1136. }
  1137. // 拼团
  1138. if (item.activity && item.activity.type == 3) {
  1139. uni.redirectTo({
  1140. url: `/pages/activity/goods_details/index?id=${item.activity.id}&type=3`
  1141. });
  1142. return;
  1143. }
  1144. // 秒杀
  1145. if (item.activity && item.activity.type == 1) {
  1146. uni.redirectTo({
  1147. url: `/pages/activity/goods_details/index?id=${item.activity.id}&type=1&time=${item.activity.time}&status=1`
  1148. });
  1149. return;
  1150. }
  1151. },
  1152. /*
  1153. * 获取用户信息
  1154. */
  1155. getUserInfo: function() {
  1156. let that = this;
  1157. getUserInfo().then(res => {
  1158. that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != 0 ? false : true);
  1159. that.$set(that, 'uid', res.data.uid);
  1160. that.$set(that, 'is_money_level', res.data.is_money_level);
  1161. that.userInfo = res.data;
  1162. });
  1163. },
  1164. /**
  1165. * 购物车数量加和数量减
  1166. *
  1167. */
  1168. ChangeCartNum: function(changeValue) {
  1169. //changeValue:是否 加|减
  1170. //获取当前变动属性
  1171. let productSelect = this.productValue[this.attrValue];
  1172. //如果没有属性,赋值给商品默认库存
  1173. if (productSelect === undefined && !this.attr.productAttr.length) productSelect = this.attr
  1174. .productSelect;
  1175. //无属性值即库存为0;不存在加减;
  1176. if (productSelect === undefined) return;
  1177. let stock = productSelect.stock || 0;
  1178. let num = this.attr.productSelect;
  1179. if (changeValue) {
  1180. num.cart_num++;
  1181. if (num.cart_num > stock) {
  1182. this.$set(this.attr.productSelect, 'cart_num', stock ? stock : 1);
  1183. this.$set(this, 'cart_num', stock ? stock : 1);
  1184. }
  1185. } else {
  1186. num.cart_num--;
  1187. if (num.cart_num < 1) {
  1188. this.$set(this.attr.productSelect, 'cart_num', 1);
  1189. this.$set(this, 'cart_num', 1);
  1190. }
  1191. }
  1192. },
  1193. selectSwiper(){
  1194. this.isSwiper = true;
  1195. this.$set(this,'productSwiper', this.storeInfo.slider_image);
  1196. this.$set(this,'productVideoLink',this.storeInfo.video_link);
  1197. },
  1198. changeAttrPic(item,index){
  1199. this.isSwiper = false;
  1200. this.ChangeAttr(item.suk);
  1201. this.changeSwitch(index);
  1202. this.$set(this,'productVideoLink','');
  1203. this.$set(this,'productSwiper', [item.image]);
  1204. },
  1205. attrVal(val) {
  1206. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val
  1207. .indexn]);
  1208. },
  1209. /**
  1210. * 属性变动赋值
  1211. *
  1212. */
  1213. ChangeAttr: function(res) {
  1214. let productSelect = this.productValue[res];
  1215. this.$set(this, "selectSku", productSelect);
  1216. if (productSelect && productSelect.stock >= 0) {
  1217. this.$set(this.attr.productSelect, 'delivery_price', productSelect.delivery_price);
  1218. this.$set(this.computedPrice.deduction, 'pay_price', productSelect.delivery_price);
  1219. this.$set(this.attr.productSelect, 'image', productSelect.image);
  1220. this.$set(this.attr.productSelect, 'price', productSelect.price);
  1221. this.$set(this.attr.productSelect, 'stock', productSelect.stock);
  1222. this.$set(this.attr.productSelect, 'unique', productSelect.unique);
  1223. this.$set(this.attr.productSelect, 'cart_num', 1);
  1224. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  1225. this.$set(this, 'attrValue', res);
  1226. this.$set(this, 'attrTxt', '已选择');
  1227. } else {
  1228. this.$set(this.attr.productSelect, 'delivery_price', this.storeInfo.price);
  1229. this.$set(this.attr.productSelect, 'image', this.storeInfo.image);
  1230. this.$set(this.attr.productSelect, 'price', this.storeInfo.price);
  1231. this.$set(this.attr.productSelect, 'stock', 0);
  1232. this.$set(this.attr.productSelect, 'unique', '');
  1233. this.$set(this.attr.productSelect, 'cart_num', 0);
  1234. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  1235. this.$set(this, 'attrValue', '');
  1236. this.$set(this, 'attrTxt', '请选择');
  1237. }
  1238. },
  1239. // 推荐商品
  1240. getGoodsList() {
  1241. let that = this;
  1242. getProductRecommend(that.id).then(res => {
  1243. that.good_list = res.data || [];
  1244. }).catch(err => {
  1245. return this.$util.Tips({
  1246. title: err
  1247. });
  1248. })
  1249. },
  1250. // 获取产品活动详情
  1251. getGoodsCtivity() {
  1252. let that = this;
  1253. getProductCtivity(that.id, {
  1254. promotions_type: this.promotions_type
  1255. }).then(res => {
  1256. that.$set(that, 'activityBg', res.data.activity_background.image || '');
  1257. that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
  1258. that.$set(that, 'discountsData', res.data.discounts_products ? res.data.discounts_products :
  1259. []); //套餐数据
  1260. let promotions = res.data.promotions[0];
  1261. that.$set(that, 'promotions_type', res.data.promotions.length ? promotions.promotions_type :0);
  1262. if (res.data.promotions.length && promotions.promotions_type == 1) {
  1263. let discount = that.$util.$h.Div(promotions.discount, 100);
  1264. let discountPrice = that.$util.$h.Mul(discount, this.storeInfo.price);
  1265. that.$set(that.limitInfo, 'price', this.storeInfo.price || 0);
  1266. that.$set(that.limitInfo, 'datatime', promotions.stop_time || 0);
  1267. that.$set(that.limitInfo, 'discount', discount);
  1268. that.$set(that.limitInfo, 'discount_price', discountPrice);
  1269. }
  1270. that.$set(that.discountInfo, 'discount', res.data.promotions);
  1271. res.data.coupons.map(item=>{
  1272. this.$set(item,'ruleshow',false);
  1273. })
  1274. that.$set(that.coupon,'list',res.data.coupons);
  1275. that.$set(that,'computedPrice',res.data.computed);
  1276. }).catch(err => {
  1277. return this.$util.Tips({
  1278. title: err
  1279. });
  1280. })
  1281. },
  1282. /**
  1283. * 获取产品详情
  1284. *
  1285. */
  1286. getGoodsDetails: function() {
  1287. let that = this;
  1288. getProductDetail(that.id, {promotions_type: this.promotions_type})
  1289. .then(res => {
  1290. let storeInfo = res.data.storeInfo;
  1291. if(storeInfo.type == 1){
  1292. if(storeInfo.delivery_type.indexOf('1') !=-1){//在门店首页确保选择门店配送或是自提
  1293. storeInfo.delivery_type.sort((x, y) => x - y);
  1294. storeInfo.delivery_type.push(storeInfo.delivery_type.shift());
  1295. }
  1296. }else{
  1297. storeInfo.delivery_type.sort((x, y) => x - y);
  1298. }
  1299. that.$set(that.attr, 'deliveryType', storeInfo.delivery_type);
  1300. if (res.data.storeInfo.delivery_type.indexOf('2') != -1) {
  1301. that.$set(that, 'isMention', true);
  1302. }
  1303. that.$set(that, 'is_store_buy', res.data.is_store_buy || 0);
  1304. that.$set(that, 'storeInfo', storeInfo);
  1305. that.$set(that.attr, 'isType', res.data.storeInfo.type);
  1306. that.$set(that.attr, 'relation_id', res.data.storeInfo.relation_id);
  1307. that.$set(that,'productSwiper', storeInfo.slider_image);
  1308. that.$set(that,'productVideoLink', storeInfo.video_link);
  1309. that.$set(that.ensureInfo, 'ensure', storeInfo.ensure);
  1310. let ensureTitle = [],specsTitle = [];
  1311. storeInfo.ensure.forEach(res => {
  1312. ensureTitle.push(res.name)
  1313. })
  1314. storeInfo.specs.forEach(res => {
  1315. specsTitle.push(res.name)
  1316. })
  1317. that.$set(that.ensureInfo, 'ensureTitle', ensureTitle.join(' · '));
  1318. that.$set(that.specsInfo, 'specsTitle', specsTitle.join(' · '));
  1319. that.$set(that.specsInfo, 'specs', storeInfo.specs);
  1320. that.$set(that, 'description', storeInfo.description);
  1321. if (this.description) {
  1322. this.description = this.description.replace(/<img/gi,'<img style="max-width:100%;height:auto;float:left;display:block" ');
  1323. this.description = this.description.replace(/<video/gi,'<video style="width:100%;height:auto;display:block" ');
  1324. }
  1325. that.$set(that.attr, 'productAttr', res.data.productAttr);
  1326. that.$set(that, 'productValue', res.data.productValue);
  1327. for (let key in res.data.productValue) {
  1328. let obj = res.data.productValue[key];
  1329. that.skuArr.push(obj)
  1330. }
  1331. if (!that.skuArr.length) {
  1332. that.skuArr = [{
  1333. image: this.storeInfo.image,
  1334. suk: this.storeInfo.store_name,
  1335. price: this.storeInfo.price
  1336. }];
  1337. }
  1338. this.$set(this, "selectSku", that.skuArr[0]);
  1339. that.$set(that, 'is_vip', res.data.storeInfo.is_vip);
  1340. that.siteName = res.data.site_name;
  1341. that.posterTitle = res.data.product_poster_title;
  1342. that.$set(that, 'reply', res.data.reply);
  1343. that.$set(that, 'replyCount', res.data.replyCount);
  1344. that.$set(that, 'replyChance', res.data.replyChance);
  1345. that.$set(that.sharePacket, 'priceName', res.data.priceName);
  1346. that.$set(that, 'shareQrcode', res.data.share_qrcode);
  1347. that.$set(that, 'routineContact', Number(res.data.routine_contact_type));
  1348. uni.setNavigationBarTitle({
  1349. title: storeInfo.store_name.substring(0, 13) + '...'
  1350. });
  1351. that.$set(that, 'diff', that.$util.$h.Sub(storeInfo.price, storeInfo.vip_price));
  1352. that.getGoodsList();
  1353. that.getGoodsCtivity();
  1354. // #ifdef H5
  1355. that.$set(that, 'storeImage', that.storeInfo.image);
  1356. that.ShareInfo();
  1357. if (this.$wechat.isWeixin() && this.shareQrcode == '1') {
  1358. that.followWX();
  1359. } else {
  1360. that.getImageBase64();
  1361. }
  1362. // #endif
  1363. if (that.isLogin) {
  1364. that.getUserInfo();
  1365. }
  1366. // #ifndef H5
  1367. that.downloadFilestoreImage();
  1368. // #endif
  1369. that.DefaultSelect();
  1370. that.getCartCount();
  1371. that.preloadImage();
  1372. setTimeout(() => {
  1373. this.showSkeleton = false
  1374. }, 200)
  1375. }).catch(err => {
  1376. //状态异常返回上级页面
  1377. return that.$util.Tips({
  1378. title: err.toString()
  1379. }, {
  1380. tab: 3,
  1381. url: 1
  1382. });
  1383. setTimeout(() => {
  1384. this.showSkeleton = false
  1385. }, 500)
  1386. });
  1387. },
  1388. preloadImage: function () {
  1389. // 预加载海报生成动图
  1390. let that = this;
  1391. uni.downloadFile({
  1392. url: that.imgHost + '/statics/images/poster_loading.png',
  1393. success: function (res) {
  1394. // 图片下载成功,可以暂存图片路径或进行其他操作
  1395. console.log('Image preloaded:', res.tempFilePath);
  1396. },
  1397. });
  1398. },
  1399. /**
  1400. * 默认选中属性
  1401. *
  1402. */
  1403. DefaultSelect: function() {
  1404. let productAttr = this.attr.productAttr;
  1405. let valueobj = [];
  1406. let value = [];
  1407. for (var key in this.productValue) {
  1408. if (this.productValue[key].stock > 0) {
  1409. valueobj = this.attr.productAttr.length ? key.split(',') : [];
  1410. break;
  1411. }
  1412. }
  1413. // 处理已售罄时默认选中第一个
  1414. if (!valueobj.length && this.attr.productAttr.length) {
  1415. value = Object.keys(this.productValue)[0].split(',');
  1416. } else {
  1417. value = valueobj;
  1418. }
  1419. for (let i = 0; i < productAttr.length; i++) {
  1420. this.$set(productAttr[i], 'index', value[i]);
  1421. }
  1422. //sort();排序函数:数字-英文-汉字;
  1423. let productSelect = this.productValue[value.join(',')];
  1424. this.$set(this.attr.productSelect, 'store_name', this.storeInfo.store_name);
  1425. if (productSelect && productAttr.length) {
  1426. this.$set(this.attr.productSelect, 'delivery_price', productSelect.delivery_price);
  1427. this.$set(this.attr.productSelect, 'image', productSelect.image);
  1428. this.$set(this.attr.productSelect, 'price', productSelect.price);
  1429. this.$set(this.attr.productSelect, 'stock', productSelect.stock);
  1430. this.$set(this.attr.productSelect, 'unique', productSelect.unique);
  1431. this.$set(this.attr.productSelect, 'cart_num', 1);
  1432. this.$set(this, 'attrValue', value.join(','));
  1433. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  1434. this.$set(this, 'attrTxt', '已选择');
  1435. } else if (!productSelect && productAttr.length) {
  1436. this.$set(this.attr.productSelect, 'delivery_price', this.storeInfo.price);
  1437. this.$set(this.attr.productSelect, 'image', this.storeInfo.image);
  1438. this.$set(this.attr.productSelect, 'price', this.storeInfo.price);
  1439. this.$set(this.attr.productSelect, 'stock', 0);
  1440. this.$set(this.attr.productSelect, 'unique', '');
  1441. this.$set(this.attr.productSelect, 'cart_num', 0);
  1442. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  1443. this.$set(this, 'attrValue', '');
  1444. this.$set(this, 'attrTxt', '请选择');
  1445. } else if (!productSelect && !productAttr.length) {
  1446. setTimeout(()=>{
  1447. this.$set(this.attr.productSelect, 'delivery_price', this.computedPayPrice);
  1448. },1000)
  1449. this.$set(this.attr.productSelect, 'image', this.storeInfo.image);
  1450. this.$set(this.attr.productSelect, 'price', this.storeInfo.price);
  1451. this.$set(this.attr.productSelect, 'stock', this.storeInfo.stock);
  1452. this.$set(this.attr.productSelect, 'unique', this.storeInfo.unique || '');
  1453. this.$set(this.attr.productSelect, 'cart_num', 1);
  1454. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  1455. this.$set(this, 'attrValue', '');
  1456. this.$set(this, 'attrTxt', '请选择');
  1457. }
  1458. },
  1459. openPerferentDrawer(){
  1460. this.showPerferentDrawer = true;
  1461. },
  1462. /**
  1463. *
  1464. *
  1465. * 收藏商品
  1466. */
  1467. setCollect: Debounce(function() {
  1468. if (this.isLogin === false) {
  1469. toLogin();
  1470. } else {
  1471. let that = this;
  1472. if (this.storeInfo.userCollect) {
  1473. collectDel(this.storeInfo.id).then(res => {
  1474. that.$set(that.storeInfo, 'userCollect', !that.storeInfo.userCollect);
  1475. return that.$util.Tips({
  1476. title: res.msg
  1477. });
  1478. });
  1479. } else {
  1480. collectAdd(this.storeInfo.id).then(res => {
  1481. that.$set(that.storeInfo, 'userCollect', !that.storeInfo.userCollect);
  1482. return that.$util.Tips({
  1483. title: res.msg
  1484. });
  1485. });
  1486. }
  1487. }
  1488. }),
  1489. /**
  1490. * 打开属性插件
  1491. */
  1492. selecAttr: Debounce(function() {
  1493. if(!this.isLogin){
  1494. toLogin();
  1495. return
  1496. }
  1497. if((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')){
  1498. this.$refs.productWindow.showLocation();
  1499. }
  1500. this.currentPage = false;
  1501. this.$set(this.attr, 'cartAttr', true);
  1502. this.$set(this, 'isOpen', true);
  1503. }),
  1504. onMyEvent: function() {
  1505. this.$set(this.attr, 'cartAttr', false);
  1506. this.$set(this, 'isOpen', false);
  1507. },
  1508. myEnsure() {
  1509. this.$set(this.ensureInfo, 'show', false);
  1510. },
  1511. mySpecs() {
  1512. this.$set(this.specsInfo, 'show', false);
  1513. },
  1514. myDiscount() {
  1515. this.$set(this.discountInfo, 'show', false);
  1516. },
  1517. onConfirm(){
  1518. this.$set(this.attr, 'cartAttr', false);
  1519. this.isOpen = true;
  1520. if(this.cartType == 'cart'){
  1521. this.goCat(undefined,'cart');
  1522. }else{
  1523. this.goCat(true,'buy');
  1524. }
  1525. },
  1526. /**
  1527. * 打开属性加入购物车
  1528. *
  1529. */
  1530. joinCart: function(e) {
  1531. this.currentPage = false;
  1532. //是否登录
  1533. if (!this.isLogin) {
  1534. toLogin();
  1535. } else {
  1536. this.goCat(undefined,'cart');
  1537. }
  1538. },
  1539. /*
  1540. * 加入购物车
  1541. */
  1542. goCat: function(news,cartType) {
  1543. if((this.storeInfo.delivery_type[0] == 2 || this.storeInfo.delivery_type[0] == 3) && !uni.getStorageSync('refuseLocation')){
  1544. this.$refs.productWindow.showLocation();
  1545. }
  1546. let that = this,productSelect = that.productValue[this.attrValue];
  1547. this.cartType = cartType;
  1548. //打开属性
  1549. if (that.attrValue) {
  1550. //默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
  1551. that.attr.cartAttr = !that.isOpen ? true : false;
  1552. } else {
  1553. if (that.isOpen) that.attr.cartAttr = true;
  1554. else that.attr.cartAttr = !that.attr.cartAttr;
  1555. }
  1556. //只有关闭属性弹窗时进行加入购物车
  1557. if (that.attr.cartAttr === true && that.isOpen === false) return (that.isOpen = true);
  1558. //如果有属性,没有选择,提示用户选择
  1559. if (that.attr.productAttr.length && productSelect === undefined && that.isOpen === true)
  1560. return that.$util.Tips({
  1561. title: '产品库存不足,请选择其它属性'
  1562. });
  1563. if (that.attr.productSelect.cart_num <= 0) {
  1564. that.attr.productSelect.cart_num = 1
  1565. that.isOpen = false
  1566. return that.$util.Tips({
  1567. title: '请先选择属性'
  1568. });
  1569. }
  1570. let q = {
  1571. cartNum: that.attr.productSelect.cart_num,
  1572. new: news === undefined ? 0 : 1,
  1573. uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
  1574. store_id: this.store_id,
  1575. addressId: this.addressId,
  1576. delivery_type: this.delivery_type,
  1577. };
  1578. if(that.is_store_buy || this.delivery_type == 2 || this.delivery_type == 3){
  1579. q.productId = that.storeInfo.id; //重新调用门店详情后的赋值id
  1580. } else {
  1581. q.productId = that.id;
  1582. }
  1583. let delivery_type = that.delivery_type
  1584. postCartAdd(q)
  1585. .then(function(res) {
  1586. that.isOpen = false;
  1587. that.attr.cartAttr = false;
  1588. if (news) {
  1589. uni.navigateTo({
  1590. url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cartId +
  1591. '&delivery_type=' + delivery_type + '&addressId=' + that.addressId +
  1592. '&store_id=' + that.store_id + '&store_name=' + that.store_name +
  1593. '&product_id=' + that.storeInfo.id + '&is_store=' + (that.store_id ? 1 : 0)
  1594. });
  1595. } else {
  1596. that.$util.Tips({
  1597. title: '添加购物车成功',
  1598. success: () => {
  1599. that.cartNum = res.data.cartNum;
  1600. that.getCartCount(true);
  1601. }
  1602. });
  1603. }
  1604. })
  1605. .catch(err => {
  1606. that.isOpen = false;
  1607. return that.$util.Tips({
  1608. title: err
  1609. });
  1610. });
  1611. },
  1612. /**
  1613. * 获取购物车数量
  1614. * @param boolean 是否展示购物车动画和重置属性
  1615. */
  1616. getCartCount: function(isAnima) {
  1617. let that = this;
  1618. const isLogin = that.isLogin;
  1619. let id = uni.getStorageSync('user_store_id') || 0;
  1620. if (isLogin) {
  1621. getCartCounts(0,id).then(res => {
  1622. that.CartCount = res.data.count;
  1623. this.$store.commit('indexData/setCartNum', that.CartCount + '')
  1624. //加入购物车后重置属性
  1625. if (isAnima) {
  1626. that.animated = true;
  1627. setTimeout(function() {
  1628. that.animated = false;
  1629. }, 500);
  1630. }
  1631. });
  1632. }
  1633. },
  1634. /**
  1635. * 立即购买
  1636. */
  1637. goBuy: function(e) {
  1638. this.currentPage = false;
  1639. if (!this.isLogin) {
  1640. toLogin();
  1641. } else {
  1642. this.goCat(true,'buy');
  1643. }
  1644. },
  1645. listenerActionSheet: function() {
  1646. this.currentPage = false
  1647. // #ifdef H5
  1648. if (this.$wechat.isWeixin() === true) {
  1649. this.weixinStatus = true;
  1650. }
  1651. // #endif
  1652. this.posters = true;
  1653. this.goPoster();
  1654. },
  1655. // 分享关闭
  1656. listenerActionClose: function() {
  1657. this.posters = false;
  1658. },
  1659. //隐藏海报
  1660. posterImageClose: function() {
  1661. this.posterImageStatus = false;
  1662. this.posters = false;
  1663. },
  1664. //替换安全域名
  1665. setDomain: function(url) {
  1666. url = url ? url.toString() : '';
  1667. //本地调试打开,生产请注销
  1668. if (url.indexOf('https://') > -1) return url;
  1669. else return url.replace('http://', 'https://');
  1670. },
  1671. //获取海报产品图
  1672. downloadFilestoreImage: function() {
  1673. let that = this;
  1674. uni.downloadFile({
  1675. url: that.setDomain(that.storeInfo.image),
  1676. success: function(res) {
  1677. that.storeImage = res.tempFilePath;
  1678. that.base64Show = 1;
  1679. },
  1680. fail: function() {
  1681. return that.$util.Tips({
  1682. title: ''
  1683. });
  1684. that.storeImage = '';
  1685. }
  1686. });
  1687. },
  1688. /**
  1689. * 获取产品分销二维码
  1690. * @param function successFn 下载完成回调
  1691. *
  1692. */
  1693. downloadFilePromotionCode: function(successFn) {
  1694. let that = this;
  1695. getProductCode(that.id).then(res => {
  1696. uni.downloadFile({
  1697. url: that.setDomain(res.data.code),
  1698. success: function(res) {
  1699. that.$set(that, 'isDown', false);
  1700. if (typeof successFn == 'function') successFn && successFn(res
  1701. .tempFilePath);
  1702. else that.$set(that, 'PromotionCode', res.tempFilePath);
  1703. },
  1704. fail: function() {
  1705. that.$set(that, 'isDown', false);
  1706. that.$set(that, 'PromotionCode', '');
  1707. }
  1708. });
  1709. })
  1710. .catch(err => {
  1711. that.$set(that, 'isDown', false);
  1712. that.$set(that, 'PromotionCode', '');
  1713. });
  1714. },
  1715. getImageBase64: function(type) {
  1716. let that = this;
  1717. imageBase64(that.storeImage, that.followCode)
  1718. .then(res => {
  1719. that.storeImage = res.data.image;
  1720. if (type) {
  1721. that.PromotionCode = res.data.code;
  1722. }
  1723. that.base64Show = 1;
  1724. })
  1725. .catch(() => {});
  1726. },
  1727. // 小程序关闭分享弹窗;
  1728. // goFriend: function() {
  1729. // this.posters = false;
  1730. // },
  1731. /**
  1732. * 生成海报
  1733. */
  1734. goPoster: function() {
  1735. let that = this;
  1736. that.$set(that, 'canvasStatus', true);
  1737. let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
  1738. // #ifdef MP
  1739. if (that.PromotionCode == '' && !that.isDown) {
  1740. return that.$util.Tips({
  1741. title: '小程序二维码需要发布正式版后才能获取到'
  1742. }, function() {
  1743. that.posters = false;
  1744. });
  1745. }
  1746. if (that.isDown)
  1747. return that.$util.Tips({
  1748. title: '正在下载海报,请稍后再试!'
  1749. }, function() {
  1750. that.posters = false;
  1751. });
  1752. // #endif
  1753. uni.getImageInfo({
  1754. src: that.PromotionCode,
  1755. fail: function(res) {
  1756. // #ifdef H5 || APP-PLUS
  1757. return that.$util.Tips({
  1758. title: res.errMsg
  1759. });
  1760. // #endif
  1761. // #ifdef MP
  1762. return that.$util.Tips({
  1763. title: '小程序二维码需要发布正式版后才能获取到'
  1764. });
  1765. // #endif
  1766. },
  1767. success() {
  1768. if (arr2[2] == '') {
  1769. //海报二维码不存在则从新下载
  1770. that.downloadFilePromotionCode(function(msgPromotionCode) {
  1771. arr2[2] = msgPromotionCode;
  1772. if (arr2[2] == '')
  1773. return that.$util.Tips({
  1774. title: '海报二维码生成失败!'
  1775. });
  1776. that.$nextTick(function() {
  1777. setTimeout(()=>{
  1778. that.$util.PosterCanvas(that.fontColor, that.themeColor,that.siteName,
  1779. arr2, that.storeInfo.store_name, that.storeInfo
  1780. .price, that.storeInfo.ot_price, that.posterTitle,
  1781. function(tempFilePath) {
  1782. that.$set(that, 'posterImage', tempFilePath);
  1783. that.$set(that, 'posterImageStatus', true);
  1784. that.$set(that, 'canvasStatus', false);
  1785. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  1786. });
  1787. },1000)
  1788. })
  1789. });
  1790. } else {
  1791. //生成推广海报
  1792. that.$nextTick(function() {
  1793. setTimeout(()=>{
  1794. that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName,
  1795. arr2, that.storeInfo.store_name, that.storeInfo.price, that.storeInfo.ot_price, that.posterTitle,
  1796. function(tempFilePath) {
  1797. that.$set(that, 'posterImage', tempFilePath);
  1798. that.$set(that, 'posterImageStatus', true);
  1799. that.$set(that, 'canvasStatus', false);
  1800. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  1801. });
  1802. },1000)
  1803. })
  1804. }
  1805. }
  1806. });
  1807. },
  1808. /*
  1809. * 保存到手机相册
  1810. */
  1811. // #ifdef MP
  1812. copyCommand: function() {
  1813. if (wx.navigateToMiniProgram) {
  1814. wx.navigateToMiniProgram({
  1815. appId: 'wxb036cafe2994d7d0',
  1816. path: '/publish/ugc-publish/ugc-publish',
  1817. extraData: {
  1818. productInfo: {
  1819. title: this.storeInfo.store_name,
  1820. path: '/pages/goods_details/index?id=' + this.storeInfo.id,
  1821. thumbUrl: this.storeInfo.image
  1822. }
  1823. }
  1824. });
  1825. }
  1826. },
  1827. savePosterPath: function() {
  1828. let that = this;
  1829. uni.getSetting({
  1830. success(res) {
  1831. if (!res.authSetting['scope.writePhotosAlbum']) {
  1832. uni.authorize({
  1833. scope: 'scope.writePhotosAlbum',
  1834. success() {
  1835. uni.saveImageToPhotosAlbum({
  1836. filePath: that.posterImage,
  1837. success: function(res) {
  1838. that.posterImageClose();
  1839. that.$util.Tips({
  1840. title: '保存成功',
  1841. icon: 'success'
  1842. });
  1843. },
  1844. fail: function(res) {
  1845. that.$util.Tips({
  1846. title: '保存失败'
  1847. });
  1848. }
  1849. });
  1850. }
  1851. });
  1852. } else {
  1853. uni.saveImageToPhotosAlbum({
  1854. filePath: that.posterImage,
  1855. success: function(res) {
  1856. that.posterImageClose();
  1857. that.$util.Tips({
  1858. title: '保存成功',
  1859. icon: 'success'
  1860. });
  1861. },
  1862. fail: function(res) {
  1863. that.$util.Tips({
  1864. title: '保存失败'
  1865. });
  1866. }
  1867. });
  1868. }
  1869. }
  1870. });
  1871. },
  1872. // #endif
  1873. //#ifdef APP-PLUS
  1874. savePosterPath() {
  1875. let that = this
  1876. uni.showModal({
  1877. title: '申请相册权限',
  1878. content: '是否允许APP访问相册用于保存分享图片',
  1879. success: res => {
  1880. if(res.confirm){
  1881. uni.saveImageToPhotosAlbum({
  1882. filePath: that.posterImage,
  1883. success: function(res) {
  1884. that.posterImageClose();
  1885. that.$util.Tips({
  1886. title: '保存成功',
  1887. icon: 'success'
  1888. });
  1889. },
  1890. fail: function(res) {
  1891. that.$util.Tips({
  1892. title: '保存失败'
  1893. });
  1894. }
  1895. });
  1896. }
  1897. },
  1898. fail: () => {},
  1899. complete: () => {}
  1900. });
  1901. },
  1902. // #endif
  1903. //#ifdef H5
  1904. ShareInfo() {
  1905. let data = this.storeInfo;
  1906. let href = location.href;
  1907. if (this.$wechat.isWeixin()) {
  1908. getUserInfo().then(res => {
  1909. href = href.indexOf('?') === -1 ? href + '?spid=' + res.data.uid : href + '&spid=' + res.data.uid;
  1910. let configAppMessage = {
  1911. desc: data.store_info,
  1912. title: data.store_name,
  1913. link: href,
  1914. imgUrl: data.image
  1915. };
  1916. this.$wechat
  1917. .wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData',
  1918. 'onMenuShareAppMessage',
  1919. 'onMenuShareTimeline'
  1920. ], configAppMessage)
  1921. .then(res => {})
  1922. .catch(err => {});
  1923. });
  1924. }
  1925. },
  1926. //#endif
  1927. goDiscounts() {
  1928. uni.navigateTo({
  1929. url: '/pages/goods_details/discountsGoodsList?id=' + this.id
  1930. })
  1931. },
  1932. goPage(type, url){
  1933. if(type == 1){
  1934. uni.navigateTo({
  1935. url
  1936. })
  1937. }else if(type == 2){
  1938. uni.switchTab({
  1939. url
  1940. })
  1941. }else if(type == 3){
  1942. uni.navigateBack();
  1943. }
  1944. },
  1945. ChangCouponsUseState(index) {
  1946. console.log(index,'111');
  1947. let that = this;
  1948. that.coupon.list[index].is_use = true;
  1949. that.$set(that.coupon, 'list', that.coupon.list);
  1950. that.$set(that.coupon, 'coupon', false);
  1951. },
  1952. /**
  1953. * 领取完毕移除当前页面领取过的优惠券展示
  1954. */
  1955. ChangCoupons: function(e) {
  1956. },
  1957. ruleToggle(index){
  1958. this.coupon.list[index].ruleshow = !this.coupon.list[index].ruleshow;
  1959. },
  1960. goGoodCall() {
  1961. let userInfo = {}
  1962. if(typeof this.userInfo === 'string'){
  1963. userInfo = JSON.parse(this.userInfo)
  1964. }else{
  1965. userInfo = this.userInfo
  1966. }
  1967. let url = `/pages/extension/customer_list/chat?productId=${this.id}`
  1968. let obj = {
  1969. store_name: this.storeInfo.store_name,
  1970. path: `/pages/goods_details/index?id=${this.storeInfo.id}`,
  1971. image:this.storeInfo.image
  1972. }
  1973. this.$util.getCustomer(userInfo,url,obj,1)
  1974. },
  1975. colorData(){
  1976. let color = [{
  1977. themeColor: '#1DB0FC',
  1978. fontColor: '#FD502F'
  1979. },
  1980. {
  1981. themeColor: '#42CA4D',
  1982. fontColor: '#FF7600'
  1983. },
  1984. {
  1985. themeColor: '#e93323',
  1986. fontColor: '#e93323'
  1987. },
  1988. {
  1989. themeColor: '#FF448F',
  1990. fontColor: '#FF448F'
  1991. },
  1992. {
  1993. themeColor: '#FE5C2D',
  1994. fontColor: '#FE5C2D'
  1995. },
  1996. {
  1997. themeColor: '#E0A558',
  1998. fontColor: '#DA8C18',
  1999. }
  2000. ];
  2001. setTimeout(() => {
  2002. switch (this.colorNum) {
  2003. case 1:
  2004. this.themeColor = color[0].themeColor;
  2005. this.fontColor = color[0].fontColor;
  2006. break;
  2007. case 2:
  2008. this.themeColor = color[1].themeColor;
  2009. this.fontColor = color[1].fontColor;
  2010. break;
  2011. case 3:
  2012. this.themeColor = color[2].themeColor;
  2013. this.fontColor = color[2].fontColor;
  2014. break;
  2015. case 4:
  2016. this.themeColor = color[3].themeColor;
  2017. this.fontColor = color[3].fontColor;
  2018. break;
  2019. case 5:
  2020. this.themeColor = color[4].themeColor;
  2021. this.fontColor = color[4].fontColor;
  2022. break;
  2023. case 6:
  2024. this.themeColor = color[5].themeColor;
  2025. this.fontColor = color[5].fontColor;
  2026. break;
  2027. default:
  2028. this.themeColor = color[2].themeColor;
  2029. this.fontColor = color[2].fontColor;
  2030. break
  2031. }
  2032. }, 1)
  2033. },
  2034. },
  2035. onPageScroll(object) {
  2036. this.$set(this,'currentPage',false);
  2037. if (object.scrollTop > 340) {
  2038. this.pageScrollStatus = true;
  2039. } else if (object.scrollTop < 340) {
  2040. this.pageScrollStatus = false;
  2041. }
  2042. // 触发图片懒加载
  2043. uni.$emit('scroll');
  2044. },
  2045. };
  2046. </script>
  2047. <style lang="scss">
  2048. /deep/uni-video {
  2049. width: 100% !important;
  2050. }
  2051. /deep/video {
  2052. width: 100% !important;
  2053. }
  2054. .z-99{
  2055. z-index: 99;
  2056. }
  2057. .menu_box{
  2058. width: 154rpx;
  2059. height: 58rpx;
  2060. border-radius: 29rpx;
  2061. z-index: 999;
  2062. }
  2063. .menu_line{
  2064. width: 1px;
  2065. height: 30rpx;
  2066. background: #B3B3B3;
  2067. }
  2068. .opac{
  2069. background-color: rgba(255,255,255,0.6);
  2070. border: 1rpx solid rgba(0,0,0,0.1);
  2071. justify-content: space-evenly;
  2072. }
  2073. .info_card {
  2074. background: linear-gradient(180deg, #ffffff 0%, #ffffff 54%, rgba(255, 255, 255, 0) 100%);
  2075. margin-top: -34rpx;
  2076. }
  2077. .atmosphere-card{
  2078. margin-top: -34rpx;
  2079. background-size: cover;
  2080. background-repeat: no-repeat;
  2081. }
  2082. .bg--w111-484643{
  2083. background: linear-gradient(90deg, #484643 0%, #1F1B17 100%);
  2084. }
  2085. .text--w111-FDDAA4{
  2086. color: #FDDAA4;
  2087. }
  2088. .svip-badge{
  2089. display: flex;
  2090. align-items: center;
  2091. height: 26rpx;
  2092. border-radius: 14rpx;
  2093. background-color: #F7E9CD;
  2094. font-size: 22rpx;
  2095. margin-left: 8rpx;
  2096. position: relative;
  2097. bottom: 4rpx;
  2098. }
  2099. .svip_rd{
  2100. border-radius: 14rpx 0 8rpx 14rpx;
  2101. }
  2102. .break_word {
  2103. overflow-wrap: break-word;
  2104. white-space: normal;
  2105. }
  2106. .white-nowrap {
  2107. white-space: nowrap;
  2108. }
  2109. .w-530{
  2110. width: 530rpx;
  2111. }
  2112. .w-524{
  2113. width: 524rpx;
  2114. }
  2115. .w-76{
  2116. width: 76rpx;
  2117. }
  2118. .active_pic {
  2119. display: flex;
  2120. justify-content: center;
  2121. align-items: center;
  2122. background-color: #fff;
  2123. border-radius: 16rpx;
  2124. border: 1px solid #333;
  2125. padding: 4rpx;
  2126. image {
  2127. width: 68rpx;
  2128. height: 68rpx;
  2129. border-radius: 12rpx;
  2130. }
  2131. }
  2132. .scroll_pic {
  2133. height:80rpx;
  2134. image {
  2135. width: 80rpx;
  2136. height: 80rpx;
  2137. border-radius: 16rpx;
  2138. }
  2139. }
  2140. .icon-ic_star1{
  2141. color: var(--view-theme);
  2142. }
  2143. .join_cart{
  2144. background-color: var(--view-bntColor);
  2145. }
  2146. .text-primary-con{
  2147. color: var(--view-theme);
  2148. }
  2149. .bg-primary-light{
  2150. background: var(--view-minorColorT);
  2151. }
  2152. .recommend_pro ~ .recommend_pro{
  2153. margin-left: 38rpx;
  2154. }
  2155. .page_footer{
  2156. backdrop-filter: blur(10px);
  2157. border-top: 1px solid #f5f5f5;
  2158. }
  2159. .num-badge{
  2160. color: #fff;
  2161. position: absolute;
  2162. font-size: 18rpx;
  2163. padding: 2rpx 10rpx 3rpx;
  2164. border-radius: 200rpx;
  2165. top: 0;
  2166. right: -10rpx;
  2167. }
  2168. .bg-transparent{
  2169. background: transparent;
  2170. }
  2171. .generate-posters {
  2172. width: 100%;
  2173. background-color: #fff;
  2174. position: fixed;
  2175. left: 0;
  2176. bottom: 0;
  2177. z-index: 388;
  2178. transform: translate3d(0, 100%, 0);
  2179. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  2180. border-top: 1rpx solid #eee;
  2181. border-radius: 40rpx 40rpx 0 0;
  2182. .generateCon {
  2183. height: 220rpx;
  2184. }
  2185. .generateClose {
  2186. width: 654rpx;
  2187. height: 72rpx;
  2188. background: #F5F5F5;
  2189. border-radius: 36rpx;
  2190. font-size: 26rpx;
  2191. font-weight: 500;
  2192. margin: 0 auto 40rpx;
  2193. }
  2194. .item {
  2195. .pictrue {
  2196. width: 86rpx;
  2197. height: 86rpx;
  2198. border-radius: 50%;
  2199. margin: 0 auto 12rpx auto;
  2200. image {
  2201. width: 100%;
  2202. height: 100%;
  2203. border-radius: 50%;
  2204. }
  2205. }
  2206. }
  2207. }
  2208. .generate-posters.on {
  2209. transform: translate3d(0, 0, 0);
  2210. }
  2211. .generate-posters .item {
  2212. flex: 1;
  2213. text-align: center;
  2214. font-size: 24rpx;
  2215. }
  2216. .canvas {
  2217. z-index: 300;
  2218. width: 750px;
  2219. height: 1300px;
  2220. position: relative;
  2221. bottom: -10000rpx;
  2222. }
  2223. .poster-mask{
  2224. position: fixed;
  2225. top: 0;
  2226. left: 0;
  2227. right: 0;
  2228. bottom: 0;
  2229. background-color: rgba(0,0,0,0.8);
  2230. z-index: 30;
  2231. backdrop-filter: blur(5px);
  2232. }
  2233. .poster-loading{
  2234. position: relative;
  2235. width: 100%;
  2236. z-index: 31;
  2237. }
  2238. .fixed-center{
  2239. position: fixed;
  2240. top: 0;
  2241. left: 0;
  2242. right: 0;
  2243. bottom: 0;
  2244. z-index: 40;
  2245. }
  2246. .poster-pop {
  2247. width: 460rpx;
  2248. height: 800rpx;
  2249. position: fixed;
  2250. left: 50%;
  2251. transform: translateX(-50%);
  2252. z-index: 399;
  2253. top: 50%;
  2254. margin-top: -559rpx;
  2255. }
  2256. .poster-pop image {
  2257. width: 100%;
  2258. height: 100%;
  2259. display: block;
  2260. border-radius: 18rpx;
  2261. }
  2262. .poster-pop .close {
  2263. width: 46rpx;
  2264. height: 75rpx;
  2265. position: fixed;
  2266. right: 0;
  2267. top: -73rpx;
  2268. display: block;
  2269. }
  2270. .poster-pop .save-poster {
  2271. background-color: #df2d0a;
  2272. font-size: :22rpx;
  2273. color: #fff;
  2274. text-align: center;
  2275. height: 76rpx;
  2276. line-height: 76rpx;
  2277. width: 100%;
  2278. }
  2279. .poster-pop .keep {
  2280. color: #fff;
  2281. text-align: center;
  2282. font-size: 25rpx;
  2283. margin-top: 10rpx;
  2284. }
  2285. .conter {
  2286. display: block;
  2287. overflow: auto;
  2288. }
  2289. .conter img {
  2290. display: block;
  2291. }
  2292. </style>