productDetail.vue 40 KB

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