productDetail.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415
  1. <template>
  2. <view class="pages">
  3. <!-- head -->
  4. <view class="scrollPage-header">
  5. <view :style="{height:statusBarHeight+'px'}"></view>
  6. <view class="header-title">
  7. <view class="header-left" @click="goBack">
  8. <uni-icons type="arrowleft" size="20"></uni-icons>
  9. <text>{{isShare?'首页':'返回'}}</text>
  10. </view>
  11. <view class="header-right"></view>
  12. </view>
  13. </view>
  14. <!-- 内容 -->
  15. <view class="scrollPage-content">
  16. <view class="product-info" v-if="detail">
  17. <view :style="{height:statusBarHeight+'px'}"></view>
  18. <u-swiper mode="number" :border-radius="0" img-mode="aspectFit" :interval="3000" :height="450" :list="imgList" @click="viewImg"></u-swiper>
  19. <view class="product-info-text">
  20. <view class="product-info-text-title">
  21. {{detail.productName}}
  22. <!-- <view class="copyText" @click="copy(detail.productName)">复制</view> -->
  23. <uni-tag style="margin-left: 10px;" size="mini" :circle="true" v-if="detail.status==0 || detail.dealerScopeFlag==0" :text="detail.status==0?'已下架':'已售罄'"></uni-tag>
  24. </view>
  25. <view class="product-info-text-attr">
  26. <view class="product-info-price flex align_center" v-if="!hasLogin">
  27. ¥***
  28. </view>
  29. <view class="flex align_center" v-else>
  30. <view class="product-info-price">
  31. ¥<text>{{detail.priceStr[0]}}</text>.{{detail.priceStr[1]}}
  32. </view>
  33. <view class="flex align_center rebate-tag" v-if="detail.promoType=='BUY_PROD_GIVE_VALID'">
  34. 返<text>{{detail.resultValue}}</text>元
  35. </view>
  36. <view class="flex align_center rebate-tag" v-if="detail.promoType=='BUY_PROD_GIVE_PROD'">
  37. 买{{detail.conditionValue}}赠{{detail.resultValue}}
  38. </view>
  39. <view class="flex align_center tejia-tag" v-if="detail.promoType=='PROMO_PROD'">
  40. 特价<text>¥{{detail.orginPrice}}</text>
  41. </view>
  42. <view class="flex align_center rebate-tag" v-if="detail.shopProductSubsidy&&detail.shopProductSubsidy.subsidyAmount<detail.price&&!detail.shopPromoProduct&&showBalanceAuth">
  43. 可抵扣<text>¥{{detail.shopProductSubsidy.subsidyAmount}}</text>
  44. </view>
  45. </view>
  46. <view class="product-info-nums">
  47. <view class="share">
  48. <button open-type="share"><u-icon :size='24' name="zhuanfa"></u-icon> 分享</button>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <u-divider bg-color="">商品详情</u-divider>
  55. <view class="product-info-guige" v-if="detail&&detail.product">
  56. <view class="row">品牌:<text>{{detail.product.productBrandName||'--'}}</text></view>
  57. <view class="row">原厂编码:<text>{{detail.product.origCode||'--'}} </text> <view class="copyText" v-if="detail.product.origCode" @click="copy(detail.product.origCode)">复制</view></view>
  58. <view class="row">产品编码:<text>{{detail.product.code||'--'}}</text> <view class="copyText" v-if="detail.product.code" @click="copy(detail.product.code)">复制</view></view>
  59. <view class="row">条形码:<text>{{detail.product.qrCode||'--'}}</text> <view class="copyText" v-if="detail.product.qrCode" @click="copy(detail.product.qrCode)">复制</view></view>
  60. <view class="row">商品尺寸:<text>{{detail.product.size||'--'}}</text></view>
  61. <view class="row-ban">计量单位:<text>{{detail.product.unit||'--'}}</text></view>
  62. <view class="row-ban">重量:<text>{{detail.product.weight||'--'}}</text></view>
  63. <view class="row-ban">包装数:<text>{{ (detail.product.packQty) || '--' }}{{ detail.product.packQty ? detail.product.unit : '' }}/{{ detail.product.packQtyUnit||'--' }}</text></view>
  64. </view>
  65. <view class="flex align_center row-info">
  66. <view class="flex"><u-icon :size='24' name="checkbox-mark"></u-icon> <view class="txt">由汽配商发货</view></view>
  67. <view class="flex"><u-icon :size='24' name="checkbox-mark"></u-icon> <view class="txt">退换货及售后请联系汽配商</view></view>
  68. </view>
  69. <view class="product-info-content">
  70. <rich-text v-if="detail && detail.product && detail.product.description" :nodes="detail.product.description"></rich-text>
  71. <view v-else style="font-size: 12px;color: #999;text-align: center;">暂无产品介绍</view>
  72. </view>
  73. </view>
  74. <!-- 底部栏 -->
  75. <view class="scrollPage-footer">
  76. <view class="scrollPage-footer-box">
  77. <view class="footer-left">
  78. <view v-if="isShare" class="footer-left-item" @click="goBack">
  79. <u-icon :size='50' color="#666" name="home"></u-icon>
  80. <text class="footer-left-item-text">首页</text>
  81. </view>
  82. <view class="footer-left-item" @click="toCart">
  83. <u-icon :size='50' color="#666" name="shopping-cart"></u-icon>
  84. <text class="footer-left-item-text">购物车</text>
  85. <text class="badge" v-if="totalNum">{{totalNum>99?'99+':totalNum}}</text>
  86. </view>
  87. </view>
  88. <view class="footer-right">
  89. <view class="footer-right-item" @click="toAddCart">
  90. <text>加入购物车</text>
  91. </view>
  92. <view class="footer-right-item" @click="toBuy">
  93. <text>立即购买</text>
  94. </view>
  95. </view>
  96. </view>
  97. <view :style="{height:safeAreaBottom+'px'}"></view>
  98. </view>
  99. <!-- 购物车动画 -->
  100. <uni-cart-animation ref="cartAnimation" @animationfinish="loading = false"></uni-cart-animation>
  101. <!-- 立即购买和付款 -->
  102. <page-container
  103. :show="showPopu"
  104. :round="true"
  105. :z-index="100"
  106. position="bottom"
  107. customStyle="border-radius:15px 15px 0 0;"
  108. @beforeleave="beforeClosePopu"
  109. @afterleave="closePopu">
  110. <!-- 确认订单 -->
  111. <view class="popu-content" v-if="detail&&!showPay">
  112. <view class="popu-close" @click="cancelBuy">
  113. <uni-icons size="26" type="closeempty"></uni-icons>
  114. </view>
  115. <view class="pupu-box">
  116. <view class="popu-content-img">
  117. <image style="width: 80px; height: 80px;" mode="aspectFit" :src="detail.productMsg||'/static/def_imgs.png'"></image>
  118. </view>
  119. <view class="popu-content-info">
  120. <view class="popu-content-info-title">
  121. <text class="ellipsis-two">{{detail.productName}}</text>
  122. </view>
  123. <view class="popu-content-info-code">
  124. <text class="ellipsis-two">{{detail.product.code}}</text>
  125. </view>
  126. <view class="popu-content-box">
  127. <view class="popu-content-price" v-if="hasLogin">
  128. ¥<text>{{detail.priceStr[0]}}</text>.{{detail.priceStr[1]}}
  129. </view>
  130. <view class="popu-content-price" v-else>¥***</view>
  131. <view class="flex align_center rebate-tag" v-if="hasLogin&&detail.promoType=='BUY_PROD_GIVE_VALID'">
  132. 返<text>{{detail.resultValue}}</text>元
  133. </view>
  134. <view class="flex align_center rebate-tag" v-if="hasLogin&&detail.promoType=='BUY_PROD_GIVE_PROD'">
  135. 买{{detail.conditionValue}}赠{{detail.resultValue}}
  136. </view>
  137. <view class="flex align_center tejia-tag" v-if="hasLogin&&detail.promoType=='PROMO_PROD'">
  138. 特价<text>¥{{detail.orginPrice}}</text>
  139. </view>
  140. <view class="flex align_center rebate-tag"
  141. v-if="hasLogin&&detail.shopProductSubsidy&&detail.shopProductSubsidy.subsidyAmount<detail.price&&!detail.shopPromoProduct&&showBalanceAuth">
  142. 可抵扣<text>¥{{detail.shopProductSubsidy.subsidyAmount}}</text>
  143. </view>
  144. </view>
  145. <view style="margin-top: 10px;" class="popu-content-num flex align_center justify_end">
  146. <text>数量</text>
  147. <view class="flex align_center qty-box">
  148. <view class="qty-btn" @click="changeQty(qty-1)" :class="(qty <= 1)?'qty-disabled':''">-</view>
  149. <view class="qty-num" @click="$refs.showPopu.open()" :style="{width:Number(qty).toString().length*8+10+'px'}">
  150. {{qty}}
  151. </view>
  152. <view class="qty-btn" @click="changeQty(qty+1)" :class="(qty >= 999)?'qty-disabled':''">+</view>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="pupu-box gift-box" v-if="giftNum">
  158. <view class="popu-content-img">
  159. <image style="width: 58px; height: 58px;" mode="aspectFit" :src="detail.productMsg||'/static/def_imgs.png'"></image>
  160. </view>
  161. <view class="popu-content-info">
  162. <view class="popu-content-info-title flex align_center">
  163. <view class="flex align_center rebate-tag">
  164. 赠品
  165. </view>
  166. <view class="ellipsis-two">{{detail.productName}}</view>
  167. </view>
  168. <view class="popu-content-box">
  169. <view class="popu-content-num flex align_center">
  170. <text>X</text> {{giftNum}}
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. <view class="pupu-box-item">
  176. <view class="flex align_center justify_between" v-if="shelfInfo">
  177. <text>配送商:{{shelfInfo.dealerName}}</text>
  178. <view @click="callPhone()"><uni-icons size="18" type="phone" color="dodgerblue"></uni-icons><text style="font-size:12px;">拨打</text></view>
  179. </view>
  180. <view v-if="!isAddCart">
  181. <view class="totalBar-box" v-if="hasBalancePay">
  182. <view class="flex align_center justify_between">
  183. <view>总金额</view>
  184. <view><text class="pf">¥</text>{{totalAmount}}</view>
  185. </view>
  186. <view class="flex align_center justify_between">
  187. <view v-if="storeAccount">抵扣(余额:<text class="pf">¥</text>{{storeAccount.giveBalance}})</view>
  188. <view class="flex align_center" v-if="!disKdk" @click="hasKdk=!hasKdk">
  189. <uni-icons size="18" :type="hasKdk?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons>
  190. <text class="pf">¥</text>{{subsidyAmount}}
  191. </view>
  192. <view class="flex align_center" v-else>
  193. <uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons>
  194. <text class="pf">¥</text>{{subsidyAmount}}
  195. </view>
  196. </view>
  197. <view class="flex align_center justify_end" v-if="detail&&detail.shopProductSubsidy">
  198. <view>合计:</view>
  199. <view style="font-weight: bold;"><text class="pf">¥</text>{{payAmount}}</view>
  200. </view>
  201. </view>
  202. <payOptions v-model="payType" :hasBalancePay="showBalanceAuth" :disableCz="disCzOption" :hasPay="hasPay" @change="payTypeChange" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
  203. </view>
  204. </view>
  205. <view class="popu-content-btn">
  206. <view class="popu-content-btn-item cartbtn" v-if="isAddCart" @click="submitCart($event)">加入购物车</view>
  207. <view class="popu-content-btn-item okbtn" v-if="!isAddCart" @click="toBuy">
  208. {{hasPay?'立即支付':'确定采购'}}
  209. <text class="payAmount">¥{{payAmount}}</text>
  210. </view>
  211. </view>
  212. </view>
  213. <!-- 确认付款 -->
  214. <view class="popu-content" v-if="payInfo&&showPay&&payData">
  215. <view class="popu-close" @click="cancelPay">
  216. <uni-icons size="26" type="closeempty"></uni-icons>
  217. </view>
  218. <view class="pupu-box-pay-item">
  219. <view class="popu-content-amount flex align_center justify_center">
  220. <view>¥{{payInfo.totalDiscountedAmount}}</view>
  221. </view>
  222. <view class="flex align_center justify_between" v-if="payInfo.totalSpecialGiveAmount>0">
  223. <text>总优惠</text>
  224. <view class="popu-content-price">¥{{payInfo.totalSpecialGiveAmount}}</view>
  225. </view>
  226. <view class="flex align_center justify_between" v-if="payInfo.totalTicketGiveAmount>0">
  227. <text>代金券</text>
  228. <view class="popu-content-price">¥{{payInfo.totalTicketGiveAmount}}</view>
  229. </view>
  230. <view style="height: 10px;"></view>
  231. <view class="popu-content-title flex align_center justify_between">
  232. <text>付款方式</text>
  233. <view></view>
  234. </view>
  235. <view class="popu-content-pay flex align_center justify_between">
  236. <view class="flex align_center">
  237. <uni-icons size="20" type="weixin" color="#4CAF50"></uni-icons>
  238. <text style="margin-left: 5px;">微信支付</text>
  239. </view>
  240. <view><uni-icons size="22" type="checkbox-filled" color="#2196f3"></uni-icons></view>
  241. </view>
  242. </view>
  243. <view class="popu-content-btn">
  244. <view class="popu-content-btn-item okbtn" @click="confirmPay">确定付款</view>
  245. </view>
  246. </view>
  247. </page-container>
  248. <!-- 修改数量弹框 -->
  249. <uni-popup ref="showPopu" type="center" style="z-index: 1500;" :maskClick="false">
  250. <view class="popu-nums-content">
  251. <view class="popu-close" @click="$refs.showPopu.close()">
  252. <uni-icons size="26" type="closeempty"></uni-icons>
  253. </view>
  254. <view class="popu-content-title flex align_center justify_center"><text>修改商品数量</text></view>
  255. <view class="popu-content-num flex align_center justify_center">
  256. <uni-number-box v-model="qty" :size="28" :input-width="280" :input-height="70" :min="1" :max="999"></uni-number-box>
  257. </view>
  258. <view class="popu-content-btn">
  259. <view class="popu-content-btn-item okbtn" @click="$refs.showPopu.close()">确定</view>
  260. </view>
  261. </view>
  262. </uni-popup>
  263. </view>
  264. </template>
  265. <script>
  266. import {
  267. mapState,
  268. mapMutations,
  269. } from 'vuex'
  270. import { addCart, getCartCount } from '@/api/cart.js'
  271. import { getShopDetail } from '@/api/shop.js'
  272. import { purchaseSave, purchaseCheck, purchasePay } from '@/api/purchase.js'
  273. import { toAuthStore, toLogin } from "@/utils/index.js"
  274. import payOptions from '../components/payOptions.vue'
  275. export default {
  276. components: {
  277. payOptions
  278. },
  279. data() {
  280. return {
  281. loading: false,
  282. showPopu: false, // 弹框
  283. statusBarHeight: 0, // 状态栏高度
  284. safeAreaBottom: 0, // 底部安全区域高度
  285. imgList: [],
  286. shopProductSn: null,
  287. detail: null,
  288. qty: 1,// 数量
  289. isShare: false ,// 是否从分享打开的
  290. busPos:{
  291. x: 10,
  292. y:uni.getSystemInfoSync().windowHeight - 30
  293. },
  294. submitOk: false, // 是否成功
  295. cacelOk: false, // 是否取消
  296. refashOk: false, // 是否刷新页面
  297. showPay: false, // 是否显示付款信息
  298. isAddCart: false, // 是否加入购物车
  299. payData: null, // 支付参数
  300. payType: 0, // 支付方式,0抵扣、1微信,2线下
  301. hasKdk: false,
  302. }
  303. },
  304. onLoad(option) {
  305. this.isShare = !!option.share
  306. // 计算安全区域
  307. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
  308. this.safeAreaBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
  309. this.shopProductSn = option.sn
  310. // 获取产品详情
  311. this.getDetail()
  312. },
  313. // 分享
  314. onShareAppMessage(e){
  315. return {
  316. title: this.detail ? this.detail.productName : '商品名称',
  317. path: '/pagesB/shopiing/productDetail?sn='+this.shopProductSn+'&share=1',
  318. imageUrl:this.detail ? this.detail.productMsg : '',
  319. type: '1'
  320. }
  321. },
  322. watch: {
  323. disCzOption(v){
  324. this.payType = v ? (this.hasPay ? 1 : 2) : 0
  325. },
  326. disKdk(v){
  327. this.hasKdk = !v
  328. }
  329. },
  330. computed: {
  331. ...mapState(['hasLogin']),
  332. // 登录用户信息
  333. userInfo(){
  334. return this.$store.state.vuex_userInfo
  335. },
  336. // 货架经销商信息
  337. shelfInfo(){
  338. return this.$store.state.vuex_storeShelf
  339. },
  340. //是否开启线上支付,且支付方式不是线下支付
  341. hasPay(){
  342. const shelfInfo = this.shelfInfo
  343. return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'
  344. },
  345. // 最小支付金额
  346. minPayAmount(){
  347. const shelfInfo = this.shelfInfo
  348. return shelfInfo&&shelfInfo.minAmount ? shelfInfo.minAmount : 0
  349. },
  350. // 抵扣余额支付是否可用
  351. showBalanceAuth(){
  352. return this.$store.state.vuex_showBalanceAuth
  353. },
  354. // 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
  355. hasBalancePay(){
  356. // 抵扣金额是否小于售价
  357. const isXPrice = this.detail&&this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount<=this.detail.price
  358. // 是否有促销活动
  359. const hasProm = this.detail&&!this.detail.shopPromoProduct
  360. return this.$store.state.vuex_showBalanceAuth&&hasProm&&isXPrice
  361. },
  362. // 门店账户信息
  363. storeAccount(){
  364. return this.$store.state.vuex_storeAccount
  365. },
  366. // 禁用的支付选项
  367. disCzOption(){
  368. return this.storeAccount && this.payAmount>this.storeAccount.rechargeBalance
  369. },
  370. // 是否禁用抵扣金额
  371. disKdk(){
  372. const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
  373. return !kdk||this.payType==2
  374. },
  375. // 总金额
  376. totalAmount(){
  377. return Number(this.hasLogin&&this.detail&&this.detail.price * this.qty).toFixed(2)
  378. },
  379. // 抵扣金额
  380. subsidyAmount(){
  381. return Number(this.hasBalancePay?(this.detail&&this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount||0) * this.qty:0).toFixed(2)
  382. },
  383. // 经销商电话
  384. dealerPhone(){
  385. const shelfInfo = this.shelfInfo
  386. return shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
  387. },
  388. // 总数
  389. totalNum(){
  390. return this.hasLogin&&this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_cartTotal : 0
  391. },
  392. // 支付合计,结算金额
  393. payAmount(){
  394. return Number(this.totalAmount-(this.hasKdk&&!this.disKdk&&this.detail&&this.detail.shopProductSubsidy?this.subsidyAmount:0)).toFixed(2)
  395. },
  396. // 赠品数量
  397. giftNum(){
  398. return this.detail && this.detail.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(this.qty / this.detail.conditionValue)*this.detail.resultValue : 0
  399. },
  400. // 付款信息
  401. payInfo(){
  402. return this.$store.state.vuex_tempOrderData
  403. }
  404. },
  405. methods: {
  406. // 返回
  407. goBack(){
  408. if(this.isShare){
  409. uni.reLaunch({
  410. url: '/pages/index/index'
  411. })
  412. }else{
  413. uni.navigateBack()
  414. }
  415. },
  416. // 复制
  417. copy(text){
  418. uni.setClipboardData({
  419. data: text,
  420. success: function () {
  421. uni.showToast({
  422. title: '复制成功'
  423. })
  424. }
  425. })
  426. },
  427. viewImg(index){
  428. uni.previewImage({
  429. urls: this.imgList
  430. })
  431. },
  432. // 联系经销商
  433. callPhone() {
  434. if(this.dealerPhone!=''){
  435. uni.makePhoneCall({
  436. phoneNumber: this.dealerPhone
  437. })
  438. }
  439. },
  440. // 产品详情
  441. getDetail(){
  442. uni.showLoading({
  443. title: '加载中'
  444. })
  445. const storeShelf = this.$store.state.vuex_storeShelf
  446. const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1'&&storeShelf ? storeShelf.dealerSn : ''
  447. // 获取产品详情
  448. getShopDetail({
  449. shopProductSn: this.shopProductSn,
  450. dealerSn: dealerSn
  451. }).then(res => {
  452. if(res.status == 200){
  453. this.detail = res.data
  454. if(res.data){
  455. // 产品图片列表
  456. if(res.data.productPicList){
  457. res.data.productPicList.forEach(item => {
  458. this.imgList.push(item.imageUrl||'/static/def_imgs.png')
  459. })
  460. }else{
  461. this.imgList.push(res.data.productMsg||'/static/def_imgs.png')
  462. }
  463. // 产品促销活动
  464. const a = res.data.shopPromoProduct
  465. let bprice = res.data.price
  466. if(a){
  467. res.data.promoType = a.promoType
  468. res.data.resultValue = a.resultValue
  469. res.data.conditionValue = a.conditionValue
  470. res.data.discountType = a.discountType
  471. res.data.promoProductSn = a.promoProductSn
  472. res.data.promoSn = a.promoSn
  473. res.data.orginPrice = res.data.price
  474. // 特价
  475. if(res.data.promoType=='PROMO_PROD'){
  476. bprice =res.data.conditionValue
  477. }
  478. }
  479. res.data.priceStr = Number(bprice).toFixed(2).toString().split('.')
  480. res.data.price = bprice
  481. // 可抵扣金额是否可用,有余额支付权限,且没有促销活动,且有抵扣金额,且抵扣金额小于等于抵扣余额
  482. const kdk = res.data.shopProductSubsidy&&res.data.shopProductSubsidy.subsidyAmount>0&&this.storeAccount&&res.data.shopProductSubsidy.subsidyAmount<=this.storeAccount.giveBalance
  483. this.hasKdk = kdk&&!this.detail.shopPromoProduct&&this.showBalanceAuth
  484. }
  485. }
  486. uni.hideLoading()
  487. })
  488. },
  489. // 修改数量
  490. changeQty(value) {
  491. const max = 999
  492. const v = value > max ? max : (value==''||value==0?1:value)
  493. this.qty = v
  494. },
  495. // 加入购物车
  496. toAddCart(){
  497. // 未登录
  498. if(this.hasLogin){
  499. // 游客未认证
  500. if(this.userInfo.sysUserFlag == '0'){
  501. toAuthStore()
  502. }else{
  503. // 打开确认数量弹框
  504. this.isAddCart = true
  505. this.showPopu = true
  506. }
  507. }else{
  508. toLogin()
  509. }
  510. },
  511. // 确定加入购物车
  512. submitCart(event){
  513. if(this.loading){
  514. return
  515. }
  516. this.loading = true
  517. this.$refs.cartAnimation.touchOnGoods(event,this.busPos);
  518. // 加入购物车
  519. addCart({
  520. qty: this.qty,
  521. price: this.detail.price,
  522. productSn: this.detail.productSn
  523. }).then(res => {
  524. if(res.status == 200){
  525. uni.$emit('refashCart')
  526. this.showPopu = false
  527. }
  528. })
  529. },
  530. // 打开购物车页面
  531. toCart(){
  532. if(this.hasLogin){
  533. // 游客未认证
  534. if(this.userInfo.sysUserFlag == '0'){
  535. toAuthStore()
  536. }else{
  537. uni.navigateTo({
  538. url: '/pagesB/cart/index'
  539. })
  540. }
  541. }else{
  542. toLogin()
  543. }
  544. },
  545. // 立即购买
  546. toBuy(){
  547. if(this.hasLogin){
  548. // 游客未认证
  549. if(this.userInfo.sysUserFlag == '0'){
  550. toAuthStore()
  551. }else{
  552. if(this.detail.status==0 || this.detail.dealerScopeFlag==0){
  553. uni.showModal({
  554. content: '此商品已'+(this.detail.status==0?'下架':'售罄'),
  555. showCancel:false,
  556. confirmText:'知道了'
  557. })
  558. }else{
  559. // 打开数量选择弹框
  560. if(!this.showPopu){
  561. this.showPopu = true
  562. // 结算金额大于充值余额时不可使用充值余额
  563. this.payType = this.storeAccount.rechargeBalance<this.payAmount ? (this.hasPay? '1' : '2'):'0'
  564. // 没有充值余额权限
  565. this.payType = this.showBalanceAuth ? this.payType : (this.hasPay? '1' : '2')
  566. // 有余额支付权限,且没有促销活动,且有抵扣金额,且抵扣金额小于等于抵扣余额
  567. this.hasKdk = this.detail.shopProductSubsidy&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance&&!this.detail.shopPromoProduct&&this.showBalanceAuth
  568. }else{
  569. // 充值余额支付
  570. if(this.payType == 0){
  571. if(this.storeAccount.rechargeBalance<this.payAmount){
  572. setTimeout(()=>{
  573. this.payType = this.hasPay ? '1' : '2'
  574. },100)
  575. uni.showModal({
  576. content: '充值余额不足!',
  577. confirmText:'去充值',
  578. success: (res) => {
  579. if (res.confirm) {
  580. uni.navigateTo({
  581. url: '/pagesB/accountBalance/accountBalance'
  582. })
  583. }
  584. }
  585. })
  586. return;
  587. }
  588. }
  589. // 微信支付
  590. if(this.payType == 1){
  591. if(this.hasPay && this.minPayAmount>this.payAmount){
  592. uni.showModal({
  593. content: '支付金额不能小于'+this.minPayAmount+'元!',
  594. showCancel:false,
  595. confirmText:'知道了'
  596. })
  597. return;
  598. }
  599. }
  600. // 去结算生产订单
  601. this.creatOrder()
  602. }
  603. }
  604. }
  605. }else{
  606. toLogin()
  607. }
  608. },
  609. // 取消立即购买
  610. cancelBuy(){
  611. this.resetPage()
  612. },
  613. // 去结算
  614. creatOrder(){
  615. uni.showLoading({
  616. title: '提交中...',
  617. mask: true
  618. })
  619. const _this = this
  620. this.loading = false
  621. purchaseCheck({
  622. useSubsidyFlag: this.hasKdk&&!this.disKdk? '1' : '0',
  623. payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'PAY_WECHAT_ONLINE' : '',
  624. detailList: [{
  625. productSn:this.detail.productSn,
  626. productCode:this.detail.productCode,
  627. qty: this.qty,
  628. price:this.detail.price,
  629. promoSn: this.detail.promoSn,
  630. promoProductSn: this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.productSubsidySn,
  631. resultValue: this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount
  632. }]}).then(res => {
  633. uni.hideLoading()
  634. if(res.status == 200){
  635. const successList = res.data.successList ? res.data.successList.map(item => {
  636. return {
  637. productSn:item.productSn,
  638. productCode: item.productCode,
  639. qty: item.qty,
  640. price:item.price,
  641. promoSn: item.promoSn,
  642. promoProductSn: item.promoProductSn,
  643. resultValue: item.resultValue
  644. }
  645. }) : []
  646. const removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
  647. const selloutList = res.data.selloutList ? res.data.selloutList.map(item => item.productCode) : []
  648. // 有已下架或已售罄产品提示
  649. if(removeList.length || selloutList.length){
  650. uni.showModal({
  651. title: '提示',
  652. content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
  653. showCancel: successList.length,
  654. confirmText: successList.length?'确定':'知道了',
  655. success(ret) {
  656. if(ret.confirm && successList.length){
  657. _this.submitForm(successList)
  658. }
  659. }
  660. })
  661. }else{
  662. const promoChangeFlag = res.data.promoChangeFlag
  663. const subsidyChangeFlag = res.data.subsidyChangeFlag
  664. // 活动变更
  665. if(promoChangeFlag||subsidyChangeFlag){
  666. uni.showModal({
  667. title: '提示',
  668. content: promoChangeFlag ? '促销活动已变更,请刷新!' : (subsidyChangeFlag?'抵扣规则已变更,请刷新!':''),
  669. confirmText:'确定刷新',
  670. success(ret) {
  671. if(ret.confirm){
  672. _this.showPopu = false
  673. _this.refashOk = true
  674. }
  675. }
  676. })
  677. return
  678. }
  679. // 直接提交
  680. _this.submitForm(successList)
  681. }
  682. }else{
  683. this.loading = false
  684. uni.showToast({
  685. title: res.message,
  686. icon: 'none'
  687. })
  688. }
  689. })
  690. },
  691. // 创建订单
  692. submitForm(detailList){
  693. uni.showLoading({
  694. title: '提交中...',
  695. mask: true
  696. })
  697. this.loading = true
  698. purchaseSave({
  699. detailList: detailList,
  700. useSubsidyFlag: this.hasKdk&&!this.disKdk? '1' : '0',
  701. payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'PAY_WECHAT_ONLINE' : ''
  702. }).then(res => {
  703. if(res.status == 200){
  704. res.data.detailList = []
  705. this.$store.state.vuex_tempOrderData = res.data
  706. // 这里判断是否开通支付或是充值余额付款,如果开通打开确认付款弹框
  707. if(this.hasPay||this.payType==0){
  708. // 计算待付款剩余倒计时
  709. if(this.payType==1){
  710. res.data.timestamp = (new Date(res.data.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
  711. }
  712. purchasePay({
  713. bizSn:res.data.purchaseSn,
  714. bizNo:res.data.purchaseNo,
  715. bizType:'SETTLE_BILL',
  716. payUserOpenId: this.$store.state.vuex_openid || uni.getStorageSync('openid'),
  717. settleType: this.payType == 0 ? 'RECHARGE_BALANCE' : 'PAY_WECHAT_ONLINE'
  718. }).then(ret=>{
  719. if(ret.status == 200){
  720. // 微信支付
  721. if(this.payType == 1){
  722. if(ret.data){
  723. this.showPay = true
  724. this.payData = ret.data?ret.data.payRequestRest:null
  725. }else{
  726. this.payError('支付失败')
  727. }
  728. }else{
  729. // 余额支付
  730. this.payError()
  731. }
  732. }else{
  733. this.payError(ret.message)
  734. }
  735. uni.$emit("refashPayBalance")
  736. uni.hideLoading()
  737. })
  738. }else{
  739. // 未开通支付,创建成功,跳转到订单详情页
  740. this.showPopu = false
  741. this.submitOk = true
  742. uni.hideLoading()
  743. uni.$emit("refashPayBalance")
  744. }
  745. }else{
  746. uni.$emit("refashPayBalance")
  747. uni.hideLoading()
  748. uni.showToast({
  749. title: res.message,
  750. icon: 'none'
  751. })
  752. }
  753. })
  754. },
  755. // 关闭之前
  756. beforeClosePopu(){
  757. console.log(this.showPay,this.submitOk,this.cacelOk)
  758. // 正在支付
  759. if(this.showPay&&!this.submitOk&&!this.cacelOk){
  760. this.showPay = false
  761. this.cancelPay()
  762. }
  763. },
  764. // 支付失败关闭弹框并跳到订单详情页面
  765. payError(msg){
  766. if(msg){
  767. uni.showModal({
  768. title: '提示',
  769. content: msg,
  770. showCancel: false,
  771. confirmText: '确定',
  772. success: (res) => {
  773. if (res.confirm) {
  774. this.showPay = true
  775. this.showPopu = false
  776. this.submitOk = true
  777. }
  778. }
  779. })
  780. }else{
  781. // 充值余额支付成功
  782. this.showPay = true
  783. this.showPopu = false
  784. this.submitOk = true
  785. }
  786. },
  787. // 关闭确定订单弹窗后
  788. closePopu(){
  789. this.showPopu = false
  790. // 刷新页面
  791. if(this.refashOk){
  792. this.qty = 1
  793. this.getDetail()
  794. }else{
  795. // 开通了支付
  796. if(this.hasPay){
  797. // 付款
  798. if(this.showPay){
  799. // 确定取消付款或付款失败
  800. if(this.cacelOk){
  801. this.cacelOk = false
  802. }
  803. // 确定付款成功
  804. if(this.submitOk){
  805. this.submitOk = false
  806. }
  807. // 去订单详情页
  808. this.toOrderDetial()
  809. }else{
  810. // 取消立即购买
  811. this.resetPage()
  812. }
  813. }else{
  814. // 未开通支付
  815. // 去订单详情页
  816. if(this.submitOk){
  817. this.submitOk = false
  818. this.toOrderDetial()
  819. }else{
  820. // 取消采购
  821. this.resetPage()
  822. }
  823. }
  824. }
  825. },
  826. // 修改支付方式
  827. payTypeChange(v){
  828. // 选择线下支付时,可抵扣金额不能使用
  829. if(v==2){
  830. this.hasKdk = false
  831. }
  832. // 充值余额支付,判断是否不足
  833. if(v==0){
  834. if(this.payAmount>this.storeAccount.rechargeBalance){
  835. setTimeout(()=>{
  836. this.payType = this.hasPay ? '1' : '2'
  837. },100)
  838. uni.showToast({
  839. title: '充值余额不足',
  840. icon: 'none'
  841. })
  842. }
  843. }else{
  844. this.payType = v
  845. }
  846. },
  847. // 确认付款
  848. confirmPay(){
  849. const _this = this
  850. // 确认付款
  851. const data = _this.payData
  852. console.log(data)
  853. if(data){
  854. uni.requestPayment({
  855. provider: 'wxpay',
  856. timeStamp: data.timeStamp,
  857. nonceStr: data.nonceStr,
  858. package: data.package,
  859. signType: data.signType,
  860. paySign: data.paySign,
  861. success: (res) =>{
  862. _this.payComplete(1,true)
  863. },
  864. fail: (err)=> {
  865. console.log('fail:',err);
  866. _this.payComplete(err.errMsg.indexOf("cancel")>=0 ? 2 : 0,false)
  867. }
  868. });
  869. }else{
  870. _this.payComplete(0,false)
  871. }
  872. },
  873. payComplete(type,data){
  874. uni.showToast({
  875. mask: true,
  876. title: type==1 ? '支付成功' : (type==2?'支付取消':'支付失败'),
  877. icon: 'none'
  878. })
  879. this.showPopu = false
  880. this.submitOk = true
  881. },
  882. // 确认取消付款弹框
  883. cancelPay(){
  884. const _this = this
  885. uni.showModal({
  886. title: '确定取消支付吗?',
  887. content: '您的订单在30分钟内未支付将被取消,请尽快完成支付。',
  888. confirmText: '继续支付',
  889. cancelText: '取消支付',
  890. success(ret) {
  891. // 确定取消,跳转到订单详情页
  892. if(ret.cancel){
  893. // 支付弹框打开中
  894. if(_this.showPopu){
  895. console.log(0)
  896. _this.showPopu = false
  897. _this.cacelOk = true
  898. }else{
  899. console.log(1)
  900. // 未打开直接跳转
  901. _this.toOrderDetial()
  902. }
  903. }
  904. if(ret.confirm){
  905. console.log(2)
  906. // 继续支付
  907. _this.showPopu = true
  908. _this.showPay = true
  909. _this.cacelOk = false
  910. }
  911. }
  912. })
  913. },
  914. // 重置页面
  915. resetPage(){
  916. this.qty = 1
  917. this.isAddCart = false
  918. this.showPopu = false
  919. this.showPay = false
  920. this.cacelOk = false
  921. this.submitOk = false
  922. setTimeout(()=>{
  923. uni.hideLoading()
  924. },300)
  925. },
  926. // 订单详情页
  927. toOrderDetial(){
  928. this.loading = false
  929. this.resetPage()
  930. // 跳转到订单详情页面
  931. uni.navigateTo({
  932. url: "/pagesB/procureOrder/orderDetail?purchaseSn="+this.$store.state.vuex_tempOrderData.purchaseSn
  933. })
  934. }
  935. }
  936. }
  937. </script>
  938. <style lang="less">
  939. .pages {
  940. height: 100vh;
  941. display: flex;
  942. flex-direction: column;
  943. .scrollPage-header{
  944. z-index: 1;
  945. width: 100%;
  946. position:fixed;
  947. left: 0;
  948. top: 0;
  949. .header-title{
  950. display: flex;
  951. align-items: center;
  952. justify-content: space-between;
  953. padding: 0 10px;
  954. height: 44px;
  955. .header-left{
  956. display: flex;
  957. align-items: center;
  958. text{
  959. font-size: 14px;
  960. color: #333333;
  961. }
  962. background-color: rgba(255,255,255,0.6);
  963. box-shadow: 0px 1px 0px 0px #E6E6E6;
  964. border-radius: 50px;
  965. padding: 3px 6px 3px;
  966. }
  967. .header-right{
  968. width: 50px;
  969. }
  970. }
  971. }
  972. .copyText{
  973. background-color: #efefef;
  974. border-radius: 100rpx;
  975. padding: 0 20rpx;
  976. color: #03A9F4;
  977. font-size: 20rpx;
  978. display: inline-block;
  979. margin-left: 20rpx;
  980. height: 44rpx;
  981. line-height: 44rpx;
  982. }
  983. .scrollPage-content{
  984. flex: 1;
  985. overflow-y: auto;
  986. .product-info{
  987. background:#fff;
  988. margin-bottom: 10px;
  989. .product-info-text{
  990. padding: 10px;
  991. .product-info-text-title{
  992. font-weight: bold;
  993. color: #333333;
  994. line-height: 22px;
  995. margin-bottom: 5px;
  996. }
  997. .product-info-text-attr{
  998. display: flex;
  999. align-items: center;
  1000. justify-content: space-between;
  1001. .product-info-price{
  1002. color: red;
  1003. display: flex;
  1004. align-items: baseline;
  1005. font-size: 12px;
  1006. text{
  1007. font-size: 38rpx;
  1008. }
  1009. }
  1010. .product-info-nums{
  1011. font-size: 12px;
  1012. color: #999999;
  1013. >view{
  1014. display: flex;
  1015. align-items: center;
  1016. }
  1017. .share{
  1018. button{
  1019. width: auto;
  1020. padding: 0;
  1021. border: 0;
  1022. background: none;
  1023. line-height: normal;
  1024. margin: 0;
  1025. display: inline;
  1026. font-size: 12px;
  1027. color: #999;
  1028. &::after{
  1029. border:none;
  1030. }
  1031. ::v-deep .u-icon{
  1032. margin-right: 3px;
  1033. }
  1034. }
  1035. }
  1036. }
  1037. }
  1038. }
  1039. }
  1040. .product-info-guige{
  1041. display: flex;
  1042. flex-wrap: wrap;
  1043. justify-content: space-between;
  1044. background:#fff;
  1045. margin: 10px 0 0;
  1046. padding: 10px;
  1047. line-height: 28px;
  1048. .row{
  1049. width: 100%;
  1050. }
  1051. .row-ban{
  1052. width: 50%;
  1053. }
  1054. >view{
  1055. color: #999;
  1056. text{
  1057. color: #333333;
  1058. }
  1059. }
  1060. }
  1061. .row-info{
  1062. width: 100%;
  1063. background: #fff;
  1064. font-size: 24rpx;
  1065. text-align: center;
  1066. margin: 20rpx 0;
  1067. padding: 15rpx;
  1068. .txt{
  1069. margin-left: 10rpx;
  1070. color: #666;
  1071. font-weight: bold;
  1072. }
  1073. > view{
  1074. padding: 0 10px;
  1075. }
  1076. }
  1077. .product-info-content{
  1078. background:#fff;
  1079. margin-bottom: 10px;
  1080. padding: 10px;
  1081. line-height: 28px;
  1082. }
  1083. }
  1084. .rebate-tag{
  1085. background: #ffe7df;
  1086. color: #E91E63;
  1087. padding: 2px 5px;
  1088. font-size: 10px;
  1089. border-radius: 3px;
  1090. margin-left: 6px;
  1091. }
  1092. .tejia-tag{
  1093. color: #E91E63;
  1094. margin-left: 6px;
  1095. font-size: 12px;
  1096. text{
  1097. font-size: 12px;
  1098. color: #999;
  1099. margin-left: 5px;
  1100. text-decoration: line-through;
  1101. }
  1102. }
  1103. .scrollPage-footer{
  1104. background-color: #FFFFFF;
  1105. width: 100%;
  1106. position: fixed;
  1107. left: 0;
  1108. bottom: 0;
  1109. .scrollPage-footer-box{
  1110. display: flex;
  1111. align-items: center;
  1112. justify-content: space-between;
  1113. height: 45px;
  1114. }
  1115. .footer-left{
  1116. display: flex;
  1117. align-items: center;
  1118. justify-content: space-between;
  1119. width: 35%;
  1120. .footer-left-item{
  1121. display: flex;
  1122. flex-direction: column;
  1123. align-items: center;
  1124. justify-content: center;
  1125. padding: 0 15px;
  1126. position: relative;
  1127. .footer-left-item-text{
  1128. font-size: 12px;
  1129. color: #666666;
  1130. }
  1131. .badge{
  1132. background: #f44336;
  1133. color: #fff;
  1134. position: absolute;
  1135. right: 5px;
  1136. top: -8px;
  1137. font-size: 12px;
  1138. display: flex;
  1139. align-items: center;
  1140. justify-content: center;
  1141. border-radius: 50rpx;
  1142. padding: 0 10rpx;
  1143. }
  1144. }
  1145. }
  1146. .footer-right{
  1147. width: 60%;
  1148. height: 80%;
  1149. display: flex;
  1150. align-items: center;
  1151. border-radius: 50px;
  1152. overflow: hidden;
  1153. margin: 0 5px;
  1154. .footer-right-item{
  1155. height: 100%;
  1156. display: flex;
  1157. flex-direction: column;
  1158. align-items: center;
  1159. justify-content: center;
  1160. width: 50%;
  1161. font-size: 14px;
  1162. color: #FFFFFF;
  1163. }
  1164. .footer-right-item:first-child{
  1165. background-color: #FF9900;
  1166. }
  1167. .footer-right-item:last-child{
  1168. background-color: #FF0000;
  1169. }
  1170. }
  1171. }
  1172. .popu-nums-content{
  1173. background-color: #FFFFFF;
  1174. border-radius: 10px;
  1175. width: 300px;
  1176. display: flex;
  1177. flex-direction: column;
  1178. align-items: center;
  1179. padding: 10px 15px;
  1180. .popu-close{
  1181. padding: 10px;
  1182. position: absolute;
  1183. right: 0;
  1184. top: 0;
  1185. z-index: 1000;
  1186. }
  1187. .popu-content-title{
  1188. padding: 10px;
  1189. font-size: 16px;
  1190. }
  1191. .popu-content-num{
  1192. font-size: 24rpx;
  1193. color: #999999;
  1194. padding: 10px 0;
  1195. > text{
  1196. margin-right: 10px;
  1197. font-size: 10px;
  1198. }
  1199. }
  1200. .popu-content-btn{
  1201. width: 100%;
  1202. display: flex;
  1203. align-items: center;
  1204. justify-content: space-around;
  1205. margin: 20px 0 10px;
  1206. .popu-content-btn-item{
  1207. width: 40%;
  1208. height: 32px;
  1209. font-size: 14px;
  1210. display: flex;
  1211. align-items: center;
  1212. justify-content: center;
  1213. border-radius: 100px;
  1214. }
  1215. .cancelBtn{
  1216. background-color: #f8f8f8;
  1217. color: #666;
  1218. }
  1219. .okbtn{
  1220. background-color: #f70000;
  1221. color: #FFFFFF;
  1222. }
  1223. }
  1224. }
  1225. .popu-content{
  1226. display: flex;
  1227. flex-direction: column;
  1228. align-items: center;
  1229. padding: 10px 15px;
  1230. .popu-close{
  1231. padding: 10px;
  1232. position: absolute;
  1233. right: 0;
  1234. top: 0;
  1235. z-index: 1000;
  1236. }
  1237. .qty-box{
  1238. display: flex;
  1239. .qty-btn{
  1240. display: flex;
  1241. align-items: center;
  1242. justify-content: center;
  1243. width: 22px;
  1244. height: 20px;
  1245. border-radius: 50px;
  1246. font-size: 18px;
  1247. color: #066cff;
  1248. &.qty-disabled{
  1249. color: #999;
  1250. }
  1251. }
  1252. .qty-num{
  1253. width: 24px;
  1254. height: 20px;
  1255. line-height: 20px;
  1256. text-align: center;
  1257. background-color: #efefef;
  1258. margin: 0 3px;
  1259. border-radius: 3px;
  1260. font-size: 12px;
  1261. input{
  1262. width: 100%;
  1263. height: 100%;
  1264. text-align: center;
  1265. color: #333;
  1266. }
  1267. }
  1268. }
  1269. .pupu-box{
  1270. display: flex;
  1271. justify-content: space-between;
  1272. margin-top: 35px;
  1273. width: 100%;
  1274. }
  1275. .popu-content-img{
  1276. border-radius: 6px;
  1277. border: 1px solid #eee;
  1278. overflow: hidden;
  1279. width: 80px;
  1280. height: 80px;
  1281. }
  1282. .popu-content-info{
  1283. padding: 0 0 0 10px;
  1284. flex-grow: 1;
  1285. overflow: hidden;
  1286. width: 50%;
  1287. .popu-content-info-title{
  1288. font-size: 14px;
  1289. }
  1290. .popu-content-info-code{
  1291. font-size: 12px;
  1292. color: #00aaff;
  1293. margin-top: 5px;
  1294. }
  1295. }
  1296. .gift-box{
  1297. padding-left: 8%;
  1298. margin-top: 10px;
  1299. border-top: 1px solid #eee;
  1300. padding-top: 10px;
  1301. .popu-content-img{
  1302. width: 58px;
  1303. height: 58px;
  1304. }
  1305. .popu-content-info-title{
  1306. font-size: 12px;
  1307. color: #666;
  1308. }
  1309. .popu-content-box{
  1310. margin-top: 0;
  1311. }
  1312. .popu-content-num{
  1313. padding:5px 15px;
  1314. >text{
  1315. font-size: 10px;
  1316. }
  1317. }
  1318. .rebate-tag{
  1319. margin: 0 5px 0 0;
  1320. background: #ff0000;
  1321. color: #fff;
  1322. flex-grow: 1;
  1323. display: flex;
  1324. justify-content: center;
  1325. }
  1326. .ellipsis-two{
  1327. width: 80%;
  1328. flex-grow: 1;
  1329. }
  1330. }
  1331. .popu-content-box{
  1332. display: flex;
  1333. align-items: baseline;
  1334. margin-top: 5px;
  1335. .popu-content-price{
  1336. color: red;
  1337. display: flex;
  1338. align-items: baseline;
  1339. font-size: 12px;
  1340. text{
  1341. font-size: 38rpx;
  1342. }
  1343. }
  1344. }
  1345. .pupu-box-item,.pupu-box-pay-item{
  1346. width: 100%;
  1347. padding-top: 20px;
  1348. > view{
  1349. padding: 5px 0;
  1350. }
  1351. .totalBar-box{
  1352. margin-bottom: 20rpx;
  1353. > view{
  1354. padding: 5px 0;
  1355. }
  1356. .pf{
  1357. font-size: 20rpx;
  1358. }
  1359. }
  1360. }
  1361. .pupu-box-pay-item{
  1362. > view{
  1363. padding: 6px 0;
  1364. }
  1365. .popu-content-amount{
  1366. font-size: 28px;
  1367. color: red;
  1368. }
  1369. .popu-content-title{
  1370. font-weight: bold;
  1371. }
  1372. }
  1373. .popu-content-num{
  1374. > text{
  1375. margin-right: 10px;
  1376. }
  1377. }
  1378. .popu-content-btn{
  1379. width: 100%;
  1380. display: flex;
  1381. align-items: center;
  1382. justify-content: space-around;
  1383. margin: 30px 0 20px;
  1384. .popu-content-btn-item{
  1385. width: 30%;
  1386. height: 34px;
  1387. font-size: 14px;
  1388. display: flex;
  1389. align-items: center;
  1390. justify-content: center;
  1391. border-radius: 100px;
  1392. }
  1393. .cancelBtn{
  1394. background-color: #f8f8f8;
  1395. color: #666;
  1396. }
  1397. .okbtn{
  1398. background-color: #f70000;
  1399. color: #FFFFFF;
  1400. width: 65%;
  1401. .payAmount{
  1402. margin-left: 5px;
  1403. }
  1404. }
  1405. .cartbtn{
  1406. background-color: #ffa60c;
  1407. color: #FFFFFF;
  1408. width: 65%;
  1409. }
  1410. }
  1411. }
  1412. }
  1413. </style>