productDetail.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  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&&this.showBalanceAuth
  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. this.refashOk = false
  487. uni.hideLoading()
  488. })
  489. },
  490. // 修改数量
  491. changeQty(value) {
  492. const max = 999
  493. const v = value > max ? max : (value==''||value==0?1:value)
  494. this.qty = v
  495. },
  496. // 加入购物车
  497. toAddCart(){
  498. // 未登录
  499. if(this.hasLogin){
  500. // 游客未认证
  501. if(this.userInfo.sysUserFlag == '0'){
  502. toAuthStore()
  503. }else{
  504. // 打开确认数量弹框
  505. this.isAddCart = true
  506. this.showPopu = true
  507. }
  508. }else{
  509. toLogin()
  510. }
  511. },
  512. // 确定加入购物车
  513. submitCart(event){
  514. if(this.loading){
  515. return
  516. }
  517. this.loading = true
  518. this.$refs.cartAnimation.touchOnGoods(event,this.busPos);
  519. // 加入购物车
  520. addCart({
  521. qty: this.qty,
  522. price: this.detail.price,
  523. productSn: this.detail.productSn
  524. }).then(res => {
  525. if(res.status == 200){
  526. uni.$emit('refashCart')
  527. this.showPopu = false
  528. }
  529. })
  530. },
  531. // 打开购物车页面
  532. toCart(){
  533. if(this.hasLogin){
  534. // 游客未认证
  535. if(this.userInfo.sysUserFlag == '0'){
  536. toAuthStore()
  537. }else{
  538. uni.navigateTo({
  539. url: '/pagesB/cart/index'
  540. })
  541. }
  542. }else{
  543. toLogin()
  544. }
  545. },
  546. // 立即购买
  547. toBuy(){
  548. if(this.hasLogin){
  549. // 游客未认证
  550. if(this.userInfo.sysUserFlag == '0'){
  551. toAuthStore()
  552. }else{
  553. if(this.detail.status==0 || this.detail.dealerScopeFlag==0){
  554. uni.showModal({
  555. content: '此商品已'+(this.detail.status==0?'下架':'售罄'),
  556. showCancel:false,
  557. confirmText:'知道了'
  558. })
  559. }else{
  560. // 打开数量选择弹框
  561. if(!this.showPopu){
  562. this.showPopu = true
  563. // 结算金额大于充值余额时不可使用充值余额
  564. this.payType = this.storeAccount.rechargeBalance<this.payAmount ? (this.hasPay? '1' : '2'):'0'
  565. // 没有充值余额权限
  566. this.payType = this.showBalanceAuth ? this.payType : (this.hasPay? '1' : '2')
  567. // 有余额支付权限,且没有促销活动,且有抵扣金额,且抵扣金额小于等于抵扣余额
  568. this.hasKdk = this.detail.shopProductSubsidy&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance&&!this.detail.shopPromoProduct&&this.showBalanceAuth
  569. }else{
  570. // 充值余额支付
  571. if(this.payType == 0){
  572. if(this.storeAccount.rechargeBalance<this.payAmount){
  573. setTimeout(()=>{
  574. this.payType = this.hasPay ? '1' : '2'
  575. },100)
  576. uni.showModal({
  577. content: '充值余额不足!',
  578. confirmText:'去充值',
  579. success: (res) => {
  580. if (res.confirm) {
  581. uni.navigateTo({
  582. url: '/pagesB/accountBalance/accountBalance'
  583. })
  584. }
  585. }
  586. })
  587. return;
  588. }
  589. }
  590. // 微信支付
  591. if(this.payType == 1){
  592. if(this.hasPay && this.minPayAmount>this.payAmount){
  593. uni.showModal({
  594. content: '支付金额不能小于'+this.minPayAmount+'元!',
  595. showCancel:false,
  596. confirmText:'知道了'
  597. })
  598. return;
  599. }
  600. }
  601. // 去结算生产订单
  602. this.creatOrder()
  603. }
  604. }
  605. }
  606. }else{
  607. toLogin()
  608. }
  609. },
  610. // 取消立即购买
  611. cancelBuy(){
  612. this.resetPage()
  613. },
  614. // 去结算
  615. creatOrder(){
  616. uni.showLoading({
  617. title: '提交中...',
  618. mask: true
  619. })
  620. const _this = this
  621. this.loading = false
  622. purchaseCheck({
  623. useSubsidyFlag: this.hasKdk&&!this.disKdk? '1' : '0',
  624. payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'PAY_WECHAT_ONLINE' : '',
  625. detailList: [{
  626. productSn:this.detail.productSn,
  627. productCode:this.detail.productCode,
  628. qty: this.qty,
  629. price:this.detail.price,
  630. promoSn: this.detail.promoSn,
  631. promoProductSn: this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.productSubsidySn,
  632. resultValue: this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount
  633. }]}).then(res => {
  634. uni.hideLoading()
  635. if(res.status == 200){
  636. const successList = res.data.successList ? res.data.successList.map(item => {
  637. return {
  638. productSn:item.productSn,
  639. productCode: item.productCode,
  640. qty: item.qty,
  641. price:item.price,
  642. promoSn: item.promoSn,
  643. promoProductSn: item.promoProductSn,
  644. resultValue: item.resultValue
  645. }
  646. }) : []
  647. const removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
  648. const selloutList = res.data.selloutList ? res.data.selloutList.map(item => item.productCode) : []
  649. // 有已下架或已售罄产品提示
  650. if(removeList.length || selloutList.length){
  651. uni.showModal({
  652. title: '提示',
  653. content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
  654. showCancel: successList.length,
  655. confirmText: successList.length?'确定':'知道了',
  656. success(ret) {
  657. if(ret.confirm && successList.length){
  658. _this.submitForm(successList)
  659. }
  660. }
  661. })
  662. }else{
  663. const promoChangeFlag = res.data.promoChangeFlag
  664. const subsidyChangeFlag = res.data.subsidyChangeFlag
  665. // 活动变更
  666. if(promoChangeFlag||subsidyChangeFlag){
  667. uni.showModal({
  668. title: '提示',
  669. content: promoChangeFlag ? '促销活动已变更,请刷新!' : (subsidyChangeFlag?'抵扣规则已变更,请刷新!':''),
  670. confirmText:'确定刷新',
  671. success(ret) {
  672. if(ret.confirm){
  673. _this.showPopu = false
  674. _this.refashOk = true
  675. }
  676. }
  677. })
  678. return
  679. }
  680. // 直接提交
  681. _this.submitForm(successList)
  682. }
  683. }else{
  684. this.loading = false
  685. uni.showToast({
  686. title: res.message,
  687. icon: 'none'
  688. })
  689. }
  690. })
  691. },
  692. // 创建订单
  693. submitForm(detailList){
  694. uni.showLoading({
  695. title: '提交中...',
  696. mask: true
  697. })
  698. this.loading = true
  699. purchaseSave({
  700. detailList: detailList,
  701. useSubsidyFlag: this.hasKdk&&!this.disKdk? '1' : '0',
  702. payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'PAY_WECHAT_ONLINE' : ''
  703. }).then(res => {
  704. if(res.status == 200){
  705. res.data.detailList = []
  706. this.$store.state.vuex_tempOrderData = res.data
  707. // 这里判断是否开通支付或是充值余额付款,如果开通打开确认付款弹框
  708. if(this.hasPay||this.payType==0){
  709. // 计算待付款剩余倒计时
  710. if(this.payType==1){
  711. res.data.timestamp = (new Date(res.data.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
  712. }
  713. purchasePay({
  714. bizSn:res.data.purchaseSn,
  715. bizNo:res.data.purchaseNo,
  716. bizType:'SETTLE_BILL',
  717. payUserOpenId: this.$store.state.vuex_openid || uni.getStorageSync('openid'),
  718. settleType: this.payType == 0 ? 'RECHARGE_BALANCE' : 'PAY_WECHAT_ONLINE'
  719. }).then(ret=>{
  720. if(ret.status == 200){
  721. // 微信支付
  722. if(this.payType == 1){
  723. if(ret.data){
  724. this.showPay = true
  725. this.payData = ret.data?ret.data.payRequestRest:null
  726. }else{
  727. this.payError('支付失败')
  728. }
  729. }else{
  730. console.log(this.payType,'------111-----')
  731. // 余额支付
  732. this.payError()
  733. }
  734. }else{
  735. this.payError(ret.message)
  736. }
  737. uni.$emit("refashPayBalance")
  738. uni.hideLoading()
  739. })
  740. }else{
  741. // 未开通支付,创建成功,跳转到订单详情页
  742. this.showPopu = false
  743. this.submitOk = true
  744. uni.hideLoading()
  745. uni.$emit("refashPayBalance")
  746. }
  747. }else{
  748. uni.$emit("refashPayBalance")
  749. uni.hideLoading()
  750. uni.showToast({
  751. title: res.message,
  752. icon: 'none'
  753. })
  754. }
  755. })
  756. },
  757. // 关闭之前
  758. beforeClosePopu(){
  759. console.log(this.showPay,this.submitOk,this.cacelOk)
  760. // 正在支付
  761. if(this.showPay&&!this.submitOk&&!this.cacelOk){
  762. this.showPay = false
  763. this.cancelPay()
  764. }
  765. },
  766. // 支付失败关闭弹框并跳到订单详情页面
  767. payError(msg){
  768. if(msg){
  769. uni.showModal({
  770. title: '提示',
  771. content: msg,
  772. showCancel: false,
  773. confirmText: '确定',
  774. success: (res) => {
  775. if (res.confirm) {
  776. this.showPay = true
  777. this.showPopu = false
  778. this.submitOk = true
  779. }
  780. }
  781. })
  782. }else{
  783. // 充值余额支付成功
  784. this.showPay = true
  785. this.showPopu = false
  786. this.submitOk = true
  787. }
  788. },
  789. // 关闭确定订单弹窗后
  790. closePopu(){
  791. this.showPopu = false
  792. // 刷新页面
  793. if(this.refashOk){
  794. this.qty = 1
  795. this.getDetail()
  796. }else{
  797. // 开通了支付
  798. if(this.hasPay){
  799. // 付款
  800. if(this.showPay){
  801. // 确定取消付款或付款失败
  802. if(this.cacelOk){
  803. this.cacelOk = false
  804. }
  805. // 确定付款成功
  806. if(this.submitOk){
  807. this.submitOk = false
  808. }
  809. // 去订单详情页
  810. this.toOrderDetial()
  811. }else{
  812. // 取消立即购买
  813. this.resetPage()
  814. }
  815. }else{
  816. // 未开通支付
  817. // 去订单详情页
  818. if(this.submitOk){
  819. this.submitOk = false
  820. this.toOrderDetial()
  821. }else{
  822. // 取消采购
  823. this.resetPage()
  824. }
  825. }
  826. }
  827. },
  828. // 修改支付方式
  829. payTypeChange(v){
  830. // 选择线下支付时,可抵扣金额不能使用
  831. if(v==2){
  832. this.hasKdk = false
  833. }
  834. // 充值余额支付,判断是否不足
  835. if(v==0){
  836. if(this.payAmount>this.storeAccount.rechargeBalance){
  837. setTimeout(()=>{
  838. this.payType = this.hasPay ? '1' : '2'
  839. },100)
  840. uni.showToast({
  841. title: '充值余额不足',
  842. icon: 'none'
  843. })
  844. }
  845. }else{
  846. this.payType = v
  847. }
  848. },
  849. // 确认付款
  850. confirmPay(){
  851. const _this = this
  852. // 确认付款
  853. const data = _this.payData
  854. console.log(data)
  855. if(data){
  856. uni.requestPayment({
  857. provider: 'wxpay',
  858. timeStamp: data.timeStamp,
  859. nonceStr: data.nonceStr,
  860. package: data.package,
  861. signType: data.signType,
  862. paySign: data.paySign,
  863. success: (res) =>{
  864. _this.payComplete(1,true)
  865. },
  866. fail: (err)=> {
  867. console.log('fail:',err);
  868. _this.payComplete(err.errMsg.indexOf("cancel")>=0 ? 2 : 0,false)
  869. }
  870. });
  871. }else{
  872. _this.payComplete(0,false)
  873. }
  874. },
  875. payComplete(type,data){
  876. uni.showToast({
  877. mask: true,
  878. title: type==1 ? '支付成功' : (type==2?'支付取消':'支付失败'),
  879. icon: 'none'
  880. })
  881. this.showPopu = false
  882. this.submitOk = true
  883. },
  884. // 确认取消付款弹框
  885. cancelPay(){
  886. const _this = this
  887. uni.showModal({
  888. title: '确定取消支付吗?',
  889. content: '您的订单在30分钟内未支付将被取消,请尽快完成支付。',
  890. confirmText: '继续支付',
  891. cancelText: '取消支付',
  892. success(ret) {
  893. // 确定取消,跳转到订单详情页
  894. if(ret.cancel){
  895. // 支付弹框打开中
  896. if(_this.showPopu){
  897. console.log(0)
  898. _this.showPopu = false
  899. _this.cacelOk = true
  900. }else{
  901. console.log(1)
  902. // 未打开直接跳转
  903. _this.toOrderDetial()
  904. }
  905. }
  906. if(ret.confirm){
  907. console.log(2)
  908. // 继续支付
  909. _this.showPopu = true
  910. _this.showPay = true
  911. _this.cacelOk = false
  912. }
  913. }
  914. })
  915. },
  916. // 重置页面
  917. resetPage(){
  918. this.qty = 1
  919. this.isAddCart = false
  920. this.showPopu = false
  921. this.showPay = false
  922. this.cacelOk = false
  923. this.submitOk = false
  924. setTimeout(()=>{
  925. uni.hideLoading()
  926. },300)
  927. },
  928. // 订单详情页
  929. toOrderDetial(){
  930. this.loading = false
  931. this.resetPage()
  932. // 跳转到订单详情页面
  933. uni.navigateTo({
  934. url: "/pagesB/procureOrder/orderDetail?purchaseSn="+this.$store.state.vuex_tempOrderData.purchaseSn
  935. })
  936. }
  937. }
  938. }
  939. </script>
  940. <style lang="less">
  941. .pages {
  942. height: 100vh;
  943. display: flex;
  944. flex-direction: column;
  945. .scrollPage-header{
  946. z-index: 1;
  947. width: 100%;
  948. position:fixed;
  949. left: 0;
  950. top: 0;
  951. .header-title{
  952. display: flex;
  953. align-items: center;
  954. justify-content: space-between;
  955. padding: 0 10px;
  956. height: 44px;
  957. .header-left{
  958. display: flex;
  959. align-items: center;
  960. text{
  961. font-size: 14px;
  962. color: #333333;
  963. }
  964. background-color: rgba(255,255,255,0.6);
  965. box-shadow: 0px 1px 0px 0px #E6E6E6;
  966. border-radius: 50px;
  967. padding: 3px 6px 3px;
  968. }
  969. .header-right{
  970. width: 50px;
  971. }
  972. }
  973. }
  974. .copyText{
  975. background-color: #efefef;
  976. border-radius: 100rpx;
  977. padding: 0 20rpx;
  978. color: #03A9F4;
  979. font-size: 20rpx;
  980. display: inline-block;
  981. margin-left: 20rpx;
  982. height: 44rpx;
  983. line-height: 44rpx;
  984. }
  985. .scrollPage-content{
  986. flex: 1;
  987. overflow-y: auto;
  988. .product-info{
  989. background:#fff;
  990. margin-bottom: 10px;
  991. .product-info-text{
  992. padding: 10px;
  993. .product-info-text-title{
  994. font-weight: bold;
  995. color: #333333;
  996. line-height: 22px;
  997. margin-bottom: 5px;
  998. }
  999. .product-info-text-attr{
  1000. display: flex;
  1001. align-items: center;
  1002. justify-content: space-between;
  1003. .product-info-price{
  1004. color: red;
  1005. display: flex;
  1006. align-items: baseline;
  1007. font-size: 12px;
  1008. text{
  1009. font-size: 38rpx;
  1010. }
  1011. }
  1012. .product-info-nums{
  1013. font-size: 12px;
  1014. color: #999999;
  1015. >view{
  1016. display: flex;
  1017. align-items: center;
  1018. }
  1019. .share{
  1020. button{
  1021. width: auto;
  1022. padding: 0;
  1023. border: 0;
  1024. background: none;
  1025. line-height: normal;
  1026. margin: 0;
  1027. display: inline;
  1028. font-size: 12px;
  1029. color: #999;
  1030. &::after{
  1031. border:none;
  1032. }
  1033. ::v-deep .u-icon{
  1034. margin-right: 3px;
  1035. }
  1036. }
  1037. }
  1038. }
  1039. }
  1040. }
  1041. }
  1042. .product-info-guige{
  1043. display: flex;
  1044. flex-wrap: wrap;
  1045. justify-content: space-between;
  1046. background:#fff;
  1047. margin: 10px 0 0;
  1048. padding: 10px;
  1049. line-height: 28px;
  1050. .row{
  1051. width: 100%;
  1052. }
  1053. .row-ban{
  1054. width: 50%;
  1055. }
  1056. >view{
  1057. color: #999;
  1058. text{
  1059. color: #333333;
  1060. }
  1061. }
  1062. }
  1063. .row-info{
  1064. width: 100%;
  1065. background: #fff;
  1066. font-size: 24rpx;
  1067. text-align: center;
  1068. margin: 20rpx 0;
  1069. padding: 15rpx;
  1070. .txt{
  1071. margin-left: 10rpx;
  1072. color: #666;
  1073. font-weight: bold;
  1074. }
  1075. > view{
  1076. padding: 0 10px;
  1077. }
  1078. }
  1079. .product-info-content{
  1080. background:#fff;
  1081. margin-bottom: 10px;
  1082. padding: 10px;
  1083. line-height: 28px;
  1084. }
  1085. }
  1086. .rebate-tag{
  1087. background: #ffe7df;
  1088. color: #E91E63;
  1089. padding: 2px 5px;
  1090. font-size: 10px;
  1091. border-radius: 3px;
  1092. margin-left: 6px;
  1093. }
  1094. .tejia-tag{
  1095. color: #E91E63;
  1096. margin-left: 6px;
  1097. font-size: 12px;
  1098. text{
  1099. font-size: 12px;
  1100. color: #999;
  1101. margin-left: 5px;
  1102. text-decoration: line-through;
  1103. }
  1104. }
  1105. .scrollPage-footer{
  1106. background-color: #FFFFFF;
  1107. width: 100%;
  1108. position: fixed;
  1109. left: 0;
  1110. bottom: 0;
  1111. .scrollPage-footer-box{
  1112. display: flex;
  1113. align-items: center;
  1114. justify-content: space-between;
  1115. height: 45px;
  1116. }
  1117. .footer-left{
  1118. display: flex;
  1119. align-items: center;
  1120. justify-content: space-between;
  1121. width: 35%;
  1122. .footer-left-item{
  1123. display: flex;
  1124. flex-direction: column;
  1125. align-items: center;
  1126. justify-content: center;
  1127. padding: 0 15px;
  1128. position: relative;
  1129. .footer-left-item-text{
  1130. font-size: 12px;
  1131. color: #666666;
  1132. }
  1133. .badge{
  1134. background: #f44336;
  1135. color: #fff;
  1136. position: absolute;
  1137. right: 5px;
  1138. top: -8px;
  1139. font-size: 12px;
  1140. display: flex;
  1141. align-items: center;
  1142. justify-content: center;
  1143. border-radius: 50rpx;
  1144. padding: 0 10rpx;
  1145. }
  1146. }
  1147. }
  1148. .footer-right{
  1149. width: 60%;
  1150. height: 80%;
  1151. display: flex;
  1152. align-items: center;
  1153. border-radius: 50px;
  1154. overflow: hidden;
  1155. margin: 0 5px;
  1156. .footer-right-item{
  1157. height: 100%;
  1158. display: flex;
  1159. flex-direction: column;
  1160. align-items: center;
  1161. justify-content: center;
  1162. width: 50%;
  1163. font-size: 14px;
  1164. color: #FFFFFF;
  1165. }
  1166. .footer-right-item:first-child{
  1167. background-color: #FF9900;
  1168. }
  1169. .footer-right-item:last-child{
  1170. background-color: #FF0000;
  1171. }
  1172. }
  1173. }
  1174. .popu-nums-content{
  1175. background-color: #FFFFFF;
  1176. border-radius: 10px;
  1177. width: 300px;
  1178. display: flex;
  1179. flex-direction: column;
  1180. align-items: center;
  1181. padding: 10px 15px;
  1182. .popu-close{
  1183. padding: 10px;
  1184. position: absolute;
  1185. right: 0;
  1186. top: 0;
  1187. z-index: 1000;
  1188. }
  1189. .popu-content-title{
  1190. padding: 10px;
  1191. font-size: 16px;
  1192. }
  1193. .popu-content-num{
  1194. font-size: 24rpx;
  1195. color: #999999;
  1196. padding: 10px 0;
  1197. > text{
  1198. margin-right: 10px;
  1199. font-size: 10px;
  1200. }
  1201. }
  1202. .popu-content-btn{
  1203. width: 100%;
  1204. display: flex;
  1205. align-items: center;
  1206. justify-content: space-around;
  1207. margin: 20px 0 10px;
  1208. .popu-content-btn-item{
  1209. width: 40%;
  1210. height: 32px;
  1211. font-size: 14px;
  1212. display: flex;
  1213. align-items: center;
  1214. justify-content: center;
  1215. border-radius: 100px;
  1216. }
  1217. .cancelBtn{
  1218. background-color: #f8f8f8;
  1219. color: #666;
  1220. }
  1221. .okbtn{
  1222. background-color: #f70000;
  1223. color: #FFFFFF;
  1224. }
  1225. }
  1226. }
  1227. .popu-content{
  1228. display: flex;
  1229. flex-direction: column;
  1230. align-items: center;
  1231. padding: 10px 15px;
  1232. .popu-close{
  1233. padding: 10px;
  1234. position: absolute;
  1235. right: 0;
  1236. top: 0;
  1237. z-index: 1000;
  1238. }
  1239. .qty-box{
  1240. display: flex;
  1241. .qty-btn{
  1242. display: flex;
  1243. align-items: center;
  1244. justify-content: center;
  1245. width: 22px;
  1246. height: 20px;
  1247. border-radius: 50px;
  1248. font-size: 18px;
  1249. color: #066cff;
  1250. &.qty-disabled{
  1251. color: #999;
  1252. }
  1253. }
  1254. .qty-num{
  1255. width: 24px;
  1256. height: 20px;
  1257. line-height: 20px;
  1258. text-align: center;
  1259. background-color: #efefef;
  1260. margin: 0 3px;
  1261. border-radius: 3px;
  1262. font-size: 12px;
  1263. input{
  1264. width: 100%;
  1265. height: 100%;
  1266. text-align: center;
  1267. color: #333;
  1268. }
  1269. }
  1270. }
  1271. .pupu-box{
  1272. display: flex;
  1273. justify-content: space-between;
  1274. margin-top: 35px;
  1275. width: 100%;
  1276. }
  1277. .popu-content-img{
  1278. border-radius: 6px;
  1279. border: 1px solid #eee;
  1280. overflow: hidden;
  1281. width: 80px;
  1282. height: 80px;
  1283. }
  1284. .popu-content-info{
  1285. padding: 0 0 0 10px;
  1286. flex-grow: 1;
  1287. overflow: hidden;
  1288. width: 50%;
  1289. .popu-content-info-title{
  1290. font-size: 14px;
  1291. }
  1292. .popu-content-info-code{
  1293. font-size: 12px;
  1294. color: #00aaff;
  1295. margin-top: 5px;
  1296. }
  1297. }
  1298. .gift-box{
  1299. padding-left: 8%;
  1300. margin-top: 10px;
  1301. border-top: 1px solid #eee;
  1302. padding-top: 10px;
  1303. .popu-content-img{
  1304. width: 58px;
  1305. height: 58px;
  1306. }
  1307. .popu-content-info-title{
  1308. font-size: 12px;
  1309. color: #666;
  1310. }
  1311. .popu-content-box{
  1312. margin-top: 0;
  1313. }
  1314. .popu-content-num{
  1315. padding:5px 15px;
  1316. >text{
  1317. font-size: 10px;
  1318. }
  1319. }
  1320. .rebate-tag{
  1321. margin: 0 5px 0 0;
  1322. background: #ff0000;
  1323. color: #fff;
  1324. flex-grow: 1;
  1325. display: flex;
  1326. justify-content: center;
  1327. }
  1328. .ellipsis-two{
  1329. width: 80%;
  1330. flex-grow: 1;
  1331. }
  1332. }
  1333. .popu-content-box{
  1334. display: flex;
  1335. align-items: baseline;
  1336. margin-top: 5px;
  1337. .popu-content-price{
  1338. color: red;
  1339. display: flex;
  1340. align-items: baseline;
  1341. font-size: 12px;
  1342. text{
  1343. font-size: 38rpx;
  1344. }
  1345. }
  1346. }
  1347. .pupu-box-item,.pupu-box-pay-item{
  1348. width: 100%;
  1349. padding-top: 20px;
  1350. > view{
  1351. padding: 5px 0;
  1352. }
  1353. .totalBar-box{
  1354. margin-bottom: 20rpx;
  1355. > view{
  1356. padding: 5px 0;
  1357. }
  1358. .pf{
  1359. font-size: 20rpx;
  1360. }
  1361. }
  1362. }
  1363. .pupu-box-pay-item{
  1364. > view{
  1365. padding: 6px 0;
  1366. }
  1367. .popu-content-amount{
  1368. font-size: 28px;
  1369. color: red;
  1370. }
  1371. .popu-content-title{
  1372. font-weight: bold;
  1373. }
  1374. }
  1375. .popu-content-num{
  1376. > text{
  1377. margin-right: 10px;
  1378. }
  1379. }
  1380. .popu-content-btn{
  1381. width: 100%;
  1382. display: flex;
  1383. align-items: center;
  1384. justify-content: space-around;
  1385. margin: 30px 0 20px;
  1386. .popu-content-btn-item{
  1387. width: 30%;
  1388. height: 34px;
  1389. font-size: 14px;
  1390. display: flex;
  1391. align-items: center;
  1392. justify-content: center;
  1393. border-radius: 100px;
  1394. }
  1395. .cancelBtn{
  1396. background-color: #f8f8f8;
  1397. color: #666;
  1398. }
  1399. .okbtn{
  1400. background-color: #f70000;
  1401. color: #FFFFFF;
  1402. width: 65%;
  1403. .payAmount{
  1404. margin-left: 5px;
  1405. }
  1406. }
  1407. .cartbtn{
  1408. background-color: #ffa60c;
  1409. color: #FFFFFF;
  1410. width: 65%;
  1411. }
  1412. }
  1413. }
  1414. }
  1415. </style>