productDetail.vue 40 KB

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