productDetail.vue 39 KB

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