productDetail.vue 40 KB

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