index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459
  1. <template>
  2. <page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
  3. <view>
  4. <view class="product_image_box">
  5. <image class="product_image" :src="productInfo.thumb"></image>
  6. </view>
  7. <view class="product_info">
  8. <view class="stock_price" v-if="isShowPrice">
  9. <view class="product_price" >
  10. <text>¥{{productInfo.price}} </text>
  11. <text class="product_market">¥{{productInfo.market_price}} </text>
  12. </view>
  13. </view>
  14. <view class="product_name">{{productInfo.name}}</view>
  15. <view class="product_spec">
  16. <view class="spec_name">{{productInfo.spec}}</view>
  17. <view class="product_stock">剩{{productInfo.stock}}个</view>
  18. </view>
  19. </view>
  20. <view class="product_business" v-if="productInfo.business_info.name">
  21. <image class="logopic" :src="productInfo.business_info.logopic" ></image>
  22. <view class="business_info">
  23. <view class="business_name">
  24. {{productInfo.business_info.name}}
  25. </view>
  26. <view class="business_desc">
  27. {{productInfo.business_info.desc}}
  28. </view>
  29. </view>
  30. </view>
  31. <view class="product_description">
  32. <rich-text :nodes="productInfo.description"></rich-text>
  33. </view>
  34. <view class="product_poster" v-if="productInfo.poster" >
  35. <image class="product_image" :src="productInfo.poster" mode="widthFix"></image>
  36. </view>
  37. <view class="order_car">
  38. <navigator url="/pages/car/index" open-type="switchTab" class="to_car" >
  39. <image src="../../static/icon/car.png" class="car_icon" ></image>
  40. </navigator>
  41. <button class="show_order" data-eventsync="true" @click="showSpecPopup(1)" >立即预约</button>
  42. <button class="show_car" data-eventsync="true" @click="showSpecPopup(2)" >加入购物车</button>
  43. </view>
  44. <view class="to_bottom"> --- 到底了 --- </view>
  45. <uni-popup ref="specPopup" :show="true" type="bottom" class="popup" background-color="#FFFFFF" @change="popupChange" >
  46. <view class="order_info">
  47. <view class="custom_addr" v-if="specBtnType==1" @click="showAddrPopup()">
  48. <view class="contact_user">
  49. <text class="contact_none" v-if="!checkedAddr.id">请选择收货地址</text>
  50. <text class="contact_name" >{{checkedAddr.contact_name}}</text>
  51. <text class="contact_phone" >{{checkedAddr.contact_phone}}</text>
  52. <text class="contact_more"> &gt;</text>
  53. </view>
  54. <view class="contact_addr">
  55. {{checkedAddr.contact_province}} {{checkedAddr.contact_city}} {{checkedAddr.contact_area}} {{checkedAddr.contact_addr}}
  56. </view>
  57. </view>
  58. <view class="car_item" >
  59. <view class="box_left">
  60. <image class="car_image" :src="productInfo.thumb" mode=""></image>
  61. </view>
  62. <view class="box_right">
  63. <view class="car_name">{{productInfo.name}}</view>
  64. <view class="stock_price">
  65. <view class="product_price" v-if="isShowPrice">
  66. <text>¥{{productInfo.price}} </text>
  67. <text class="car_market">¥{{productInfo.market_price}}</text>
  68. </view>
  69. <view class="product_quantity_box">
  70. <button class="product_quantity_sub" @click="changeQuantity(-1)" data-eventsync="true">
  71. <image class="sub_icon" src="../../static/icon/sub_icon.png" mode=""></image>
  72. </button>
  73. <input type="number" class="product_quantity" placeholder="数量" v-model="quantity" @blur="changeQuantity(0)" ></input>
  74. <button class="product_quantity_add" @click="changeQuantity(+1)" data-eventsync="true">
  75. <image class="add_icon" src="../../static/icon/add_icon.png" mode=""></image>
  76. </button>
  77. </view>
  78. </view>
  79. <view class="product_stock">剩{{productInfo.stock}}个</view>
  80. </view>
  81. </view>
  82. <view class="select_sku" v-if="productInfo.product_attr.length" >
  83. <scroll-view scroll-y="true" class="scroll_max" >
  84. <view class="product_attr" v-for="(spec,spec_index) in productInfo.product_attr" :key="spec_index">
  85. <scroll-view scroll-y="true" class="scroll_y" >
  86. <view class="spec_name">{{ spec.spec_name }}</view>
  87. <view class="arrt_list">
  88. <view class="arrt_option" :class="option.active?'active':''" v-for="(option,attr_index) in spec.attr_list" :key="attr_index" @click="attrChange(spec_index,attr_index)">
  89. {{option.name}}
  90. </view>
  91. </view>
  92. </scroll-view>
  93. </view>
  94. </scroll-view>
  95. </view>
  96. <!-- 选择优惠券 -->
  97. <view class="to_select_coupon" v-if="specBtnType==1" @click="openCoupon()">
  98. <text>优惠券</text>
  99. <view class="coupon_deduction">{{couponUsed}}</view>
  100. </view>
  101. <view class="order_price" v-if="specBtnType==1" >合计: ¥{{priceTotal}}</view>
  102. <view class="order_btn">
  103. <button class="to_order" @click="createOrder()" v-if="specBtnType==1" data-eventsync="true" >预约</button>
  104. <button class="to_car" @click="createCart()" v-if="specBtnType==2" data-eventsync="true" >加入购物车</button>
  105. </view>
  106. </view>
  107. </uni-popup>
  108. <uni-popup ref="couponPopup" type="bottom" class="popup" background-color="#FFFFFF" >
  109. <view class="popup_title">优惠券</view>
  110. <view class="coupon_list">
  111. <view class="coupon_item" v-for="(item,index) in couponList" @click="checkedCoupon(index)" :key="index">
  112. <view class="box_left">
  113. <view class="rebate" v-if="item.rebate_type == 1" > ¥{{item.rebate}}</view>
  114. <view class="rebate" v-if="item.rebate_type == 2" > 打 {{item.rebate}} 折</view>
  115. <view class="rebate" v-if="item.rebate_type == 3" > 赠 <text v-if="item.rebate_scope.length">
  116. {{item.rebate_scope[0].product_name}}
  117. </text> </view>
  118. <view class="std_pay"> 满{{item.std_pay}}</view>
  119. </view>
  120. <view class="box_right">
  121. <view class="coupon_title">
  122. <view class="coupon_name" v-if="item.rebate_type == 1">满减券</view>
  123. <view class="coupon_name" v-if="item.rebate_type == 2">折扣券</view>
  124. <view class="coupon_name" v-if="item.rebate_type == 3">赠品券</view>
  125. </view>
  126. <view class="product_scope">
  127. <text class="" v-if="item.type_id == 1">限定商品可用</text>
  128. <text class="" v-if="item.type_id == 2">全场可用</text>
  129. <view class="check_label" >
  130. <view class="isstd" v-if="!item.is_std">不可用</view>
  131. <image class="checkbox" v-if="item.is_std" :src="item.checked?'../../static/icon/checked.png':'../../static/icon/checkbox.png'"></image>
  132. </view>
  133. </view>
  134. <view class="coupon_info">
  135. <view class="coupon_exp">{{item.exp_time}} 到期</view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </uni-popup>
  141. <uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF" >
  142. <view class="popup_title">收货地址 <navigator url="/pages/addr/index?notify=addr" class="to_addr_page">管理</navigator> </view>
  143. <view class="addr_list">
  144. <view class="addr_item" v-for="(item,index) in addrList" :key="index" @click="checkedAddrItem(item)">
  145. <view class="radio_label">
  146. <image class="radio_icon" :src="item.id == checkedAddr.id? '../../static/icon/radioed.png' : '../../static/icon/radio.png'" ></image>
  147. </view>
  148. <view class="contact_user">
  149. <text class="contact_name">{{item.contact_name}}</text>
  150. <text class="contact_phone">{{item.contact_phone}}</text>
  151. <text class="contact_default" v-if="item.is_default">默认</text>
  152. </view>
  153. <view class="contact_addr">
  154. {{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
  155. </view>
  156. </view>
  157. </view>
  158. <view class="create_box">
  159. <navigator url="/pages/addr/index?notify=addr&type=create" class="create_addr" >新建收货地址</navigator>
  160. </view>
  161. </uni-popup>
  162. <uni-popup ref="addFollow" type="center" class="center_popup" @change="popupChange">
  163. <view class="add_follow">
  164. <view class="close_area"><button class="close_btn" @click="closeAddFollow()">关闭</button></view>
  165. <view class="info_alter">长按识别二维码添加客服</view>
  166. <view class="qr_code_area">
  167. <image v-if="followQrcode" :src="followQrcode" class="qr_code" mode="" show-menu-by-longpress></image>
  168. </view>
  169. <button class="save_btn" @click="saveImage()">保存图片添加客服</button>
  170. <view class="rule_info">
  171. <view class="">报单规则:</view>
  172. <view class="">1、预约报单需要添加客服人员</view>
  173. <view class="">2、添加完客服人员后返回小程序填写商家资质</view>
  174. <view class="">3、开始预约报单</view>
  175. </view>
  176. </view>
  177. </uni-popup>
  178. </view>
  179. </template>
  180. <script>
  181. export default {
  182. data() {
  183. return {
  184. show:false, // 使用Popup组件时,阻止禁止滚动穿透
  185. productInfo:{
  186. id:0,
  187. name:"",
  188. price:"0.00",
  189. market_price:"0.00",
  190. spec:"",
  191. stock:0,
  192. thumb:"",
  193. poster:"",
  194. description:"",
  195. business_info:{
  196. name:"",
  197. logopic:"",
  198. desc:"",
  199. },
  200. product_attr:[],
  201. product_sku:[],
  202. },
  203. requestParam:{
  204. id:0,
  205. },
  206. // 数量
  207. quantity:1,
  208. // 总价
  209. priceTotal:"0.00",
  210. // 优惠券列表
  211. couponList:[],
  212. // 总价
  213. priceTotal:'0.00',
  214. // 优惠券使用
  215. couponUsed:"去使用 >",
  216. // 扣减金额
  217. rebatePrice:0.00,
  218. // 已经选择的优惠券ID
  219. customCoupon: 0,
  220. // 规格选择按钮类型
  221. specBtnType: 1, // 1预约。2购物车
  222. // 地址列表
  223. addrList:[],
  224. // 已选地址
  225. checkedAddr:{
  226. id:0,
  227. contact_name:"",
  228. contact_phone:"",
  229. contact_province:"",
  230. contact_city:"",
  231. contact_area:"",
  232. contact_addr:"",
  233. is_default:0,
  234. },
  235. // 客服二维码
  236. followQrcode:"",
  237. // 是否登录状态
  238. isShowPrice:false,
  239. // 选择的skuid
  240. sku_id:0,
  241. }
  242. },
  243. onLoad(param) {
  244. // 接受路由参数,产品ID
  245. this.requestParam.id = param.product_id;
  246. var that = this;
  247. // 监听地址变动
  248. uni.$on('addr_list_change',function(data){
  249. // 地址列表
  250. that.addrList = data.list;
  251. });
  252. // #ifdef MP-WEIXIN
  253. //分享按钮
  254. uni.showShareMenu({
  255. withShareTicket: true,
  256. menus: ['shareAppMessage', 'shareTimeline']
  257. })
  258. // #endif
  259. },
  260. onShareAppMessage(obj) {
  261. return {
  262. title: '双十一 药优惠 得积分 兑豪礼',
  263. path: '/pages/index/index'
  264. }
  265. },
  266. onShow() {
  267. // 没有添加客服就不显示
  268. this.isShowPrice = this.$checkAccess.checkShowPrice();
  269. // 如果存在产品ID的话
  270. if( this.requestParam.id > 0) {
  271. // 请求详情
  272. this.$http.request('api/product/get_detail',this.requestParam).then((re)=>{
  273. // 成功渲染数据
  274. if( re.code == 'success' ) {
  275. // 刷新数据
  276. this.productInfo = re.data;
  277. //设置默认sku
  278. this.setDefaultSpec();
  279. }
  280. });
  281. };
  282. },
  283. methods: {
  284. // 地址弹出层
  285. showAddrPopup(){
  286. // 显示下单弹出层
  287. this.$refs.addrPopup.open('bottom');
  288. },
  289. // 规格弹出层
  290. showSpecPopup(type){
  291. // 登录提示
  292. if( !this.$checkAccess.alterLogin()) return ;
  293. // 判断是否弹出
  294. // if( this.$checkAccess.getFollowQrcode() ) return this.openAddFollow();
  295. // 显示类型,1预约,2购物车
  296. this.specBtnType = type;
  297. // 恢复优惠券使用按钮
  298. this.couponUsed = "去使用 >";
  299. // 恢复扣减金额
  300. this.rebatePrice = 0.00;
  301. // 选择优惠券重置
  302. this.customCoupon = 0;
  303. // 计算价格
  304. this.priceHandler();
  305. // 显示下单弹出层
  306. this.$refs.specPopup.open('bottom');
  307. // 结果
  308. this.$http.request('api/custom_coupon/get_checked',this.requestParam).then((re)=>{
  309. if( re.code == 'success' ){
  310. // 赋值
  311. this.couponList = re.data;
  312. // 优惠券是否可用
  313. this.checkCoupon();
  314. }
  315. });
  316. // 地址列表
  317. this.getAddrList();
  318. //只有一组sku时是否下架
  319. if(this.productInfo.product_sku.length === 1){
  320. this.defaultSkuStatus();
  321. }
  322. },
  323. // 优惠券弹出层
  324. openCoupon(){
  325. this.$refs.couponPopup.open('bottom')
  326. },
  327. // 数量调整
  328. changeQuantity(number){
  329. // 如果不是0.表示两侧按钮点击,0表示输入的修改
  330. if( number != 0 ) {
  331. // 计算个数
  332. this.quantity = this.quantity + number;
  333. }
  334. // 如果大于库存设置为库存
  335. if( this.quantity > this.productInfo.stock ) {
  336. this.quantity = this.productInfo.stock;
  337. uni.showToast({
  338. title:"库存不足",
  339. icon:"none"
  340. })
  341. }
  342. // 如果小于1.设置为1
  343. if( this.quantity < 1 ) {
  344. this.quantity = 1;
  345. uni.showToast({title:"数量不可以小于0",icon:"none"})
  346. }
  347. // 计算价格
  348. this.priceHandler();
  349. // 优惠券是否可用
  350. this.checkCoupon();
  351. },
  352. // 创建订单
  353. createOrder(){
  354. // 不可预约
  355. if( !this.$checkAccess.alertCity() ) return;
  356. // 下单数量小于0
  357. if( this.quantity < 1 ) {
  358. uni.showToast({
  359. title:"至少购买1个"
  360. })
  361. return;
  362. }
  363. // 如果大于库存设置为库存
  364. if( this.productInfo.stock < 1 ) {
  365. uni.showToast({
  366. title:"库存不足",
  367. icon:"none"
  368. })
  369. return;
  370. }
  371. // 如果大于库存设置为库存
  372. if( this.productInfo.stock < this.quantity ) {
  373. this.quantity = this.productInfo.stock;
  374. uni.showToast({
  375. title:"库存不足",
  376. icon:"none"
  377. })
  378. return;
  379. }
  380. // 地址未填
  381. if( !this.checkedAddr.id ) {
  382. uni.showToast({
  383. title:"请选择收货地址",
  384. icon:"none"
  385. })
  386. return;
  387. }
  388. //需要下单的产品信息参数传给completion页面
  389. let productInfo = [{name:this.productInfo.name,spec:this.productInfo.spec,price:this.productInfo.price}]
  390. //转成json字符串
  391. productInfo = JSON.stringify(productInfo);
  392. //加密json格式成编码数组
  393. let encodedArray = encodeURIComponent(productInfo);
  394. // 需要下单的产品列表
  395. let productList = [{product_id:this.productInfo.id,buy_num:this.quantity,product_skuid:this.sku_id}];
  396. // 转成json字符串传输
  397. productList = JSON.stringify(productList);
  398. // 请求接口
  399. this.$http.request('api/orders/create',{"product_list":productList,"custom_coupon_id":this.customCoupon,'addr_id':this.checkedAddr.id},'post').then((re)=>{
  400. // 判断结果
  401. if( re.code == 'success' ) {
  402. // 处理结果
  403. this.productInfo.stock = this.productInfo.stock - this.quantity;
  404. // 关闭弹窗
  405. this.$refs.specPopup.close();
  406. // 跳转到报单完成页面
  407. uni.navigateTo({url:`/pages/orders/completion?params=${encodedArray}`});
  408. }else{
  409. uni.showModal({title:re.msg,showCancel:false});
  410. }
  411. });
  412. },
  413. // 加入购物车
  414. createCart(){
  415. // 不可预约
  416. if( !this.$checkAccess.alertCity() ) return;
  417. // 下单数量小于0
  418. if( this.quantity < 1 ) {
  419. uni.showToast({
  420. title:"至少购买1个"
  421. })
  422. return;
  423. }
  424. // 如果库存不足
  425. if( this.productInfo.stock < 1 ) {
  426. uni.showToast({
  427. title:"库存不足",
  428. icon:"none"
  429. })
  430. return;
  431. }
  432. // 如果大于库存设置为库存
  433. if( this.productInfo.stock < this.quantity ) {
  434. this.quantity = this.productInfo.stock;
  435. uni.showToast({
  436. title:"库存不足",
  437. icon:"none"
  438. })
  439. return;
  440. }
  441. // 商品信息
  442. let data = {product_id:this.productInfo.id,buy_num:this.quantity,skuid:this.sku_id};
  443. // 请求接口
  444. this.$http.request('api/shop_cart/add',data,'post').then((re)=>{
  445. // 判断结果
  446. if( re.code == 'success' ) {
  447. // 跳转到订单列表
  448. uni.showToast({
  449. icon:"success",
  450. title:"加入购物车成功"
  451. })
  452. // 关闭结果
  453. this.$refs.specPopup.close();
  454. }else{
  455. // 跳转到订单列表
  456. uni.showToast({
  457. icon:"error",
  458. title:"加入购物车失败"
  459. })
  460. }
  461. });
  462. },
  463. // 检查优惠券是否可用
  464. checkCoupon(){
  465. // 如果存在的话
  466. if( this.couponList.length ){
  467. let hasIsStd = false;
  468. // 循环优惠券
  469. for (let i in this.couponList) {
  470. /* 商品的总价格,决定是否可用 */
  471. let totalPrice = 0.00;
  472. // 如果是商品券
  473. if( this.couponList[i].type_id == 1 ){
  474. // 判断商品是不是在商品范围
  475. let isScope = false;
  476. // 循环商品范围
  477. for (let k in this.couponList[i].product_scope) {
  478. // 如果存在商品范围
  479. if( this.couponList[i].product_scope[k].product_id == this.productInfo.id) isScope = true;
  480. }
  481. // 范围内的做计算
  482. if( isScope ) totalPrice = this.$decimal.add(totalPrice,this.$decimal.mul(this.productInfo.price,this.quantity));
  483. // 店铺券
  484. }else{
  485. // 店铺券
  486. totalPrice = this.$decimal.add(totalPrice,this.$decimal.mul(this.productInfo.price,this.quantity));
  487. }
  488. // 判断价格到不到限额
  489. this.couponList[i].is_std = parseFloat(totalPrice.toFixed()) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay,1).toFixed());
  490. // 如果不可用的话,该项已选择则不选
  491. if( !this.couponList[i].is_std && this.couponList[i].checked ) this.checkedCoupon(i);
  492. }
  493. }
  494. },
  495. // 选择优惠券
  496. checkedCoupon(index){
  497. // 单个设置选中/未选
  498. this.couponList[index].checked = this.couponList[index].checked ? 0 : 1;
  499. // 循环处理
  500. for (let i in this.couponList) {
  501. // 有未选的就不做全选
  502. if( index != i ) this.couponList[i].checked = 0;
  503. }
  504. // 如果未选中,提示可用
  505. if( !this.couponList[index].checked ) this.couponUsed = '去使用 >';
  506. // 已经选择的优惠券ID
  507. this.customCoupon = this.couponList[index].checked ? this.couponList[index].id : 0;
  508. // 计算扣减
  509. this.couponRebate();
  510. // 计算价格
  511. this.priceHandler();
  512. // 关闭弹窗
  513. this.$refs.couponPopup.close();
  514. },
  515. // 计算价格
  516. priceHandler(){
  517. // 总价格
  518. let priceTotal = this.$decimal.mul(this.productInfo.price,this.quantity);
  519. // 扣减数据
  520. priceTotal = priceTotal.sub(this.rebatePrice);
  521. // 小数点保留
  522. this.priceTotal = priceTotal.toFixed(2);
  523. },
  524. // 计算优惠券扣减
  525. couponRebate(){
  526. // 默认扣减0
  527. this.rebatePrice = 0;
  528. // 循环优惠券
  529. for (let i in this.couponList) {
  530. // 判断是否选中
  531. if( this.couponList[i].id != this.customCoupon ){
  532. // 未选择的不管
  533. continue;
  534. }
  535. /* 商品的总价格,决定是否可用 */
  536. var totalPrice = 0.00;
  537. // 如果是商品券
  538. if( this.couponList[i].type_id == 1 ){
  539. // 判断商品是不是在商品范围
  540. var isScope = false;
  541. // 循环商品范围
  542. for (let k in this.couponList[i].product_scope) {
  543. // 如果存在商品范围
  544. if( this.couponList[i].product_scope[k].product_id == this.productInfo.id) isScope = true;
  545. }
  546. // 范围内的做计算
  547. if( isScope ) totalPrice = this.$decimal.mul(this.productInfo.price,this.quantity);
  548. }else{
  549. // 折扣券以及满减券的话,计算价格
  550. totalPrice = this.$decimal.mul(this.productInfo.price,this.quantity);
  551. }
  552. // 如果是可以用的话
  553. if( parseFloat(totalPrice.toFixed()) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay,1).toFixed()) ){
  554. // 扣减金额
  555. let rebatePrice = this.$decimal.mul(1,0);
  556. // 满减
  557. if( this.couponList[i].rebate_type == 1 ){
  558. // 计算扣减数据
  559. rebatePrice = this.$decimal.mul(this.couponList[i].rebate,1);
  560. // 替换文字
  561. this.couponUsed = "¥-" + rebatePrice.toFixed(2);
  562. }
  563. // 折扣
  564. if( this.couponList[i].rebate_type == 2 ){
  565. // 折扣
  566. rebatePrice = this.$decimal.mul(totalPrice,this.couponList[i].rebate);
  567. // 减数
  568. rebatePrice = this.$decimal.sub(totalPrice,rebatePrice.mul(0.1));
  569. // 替换文字
  570. this.couponUsed = "¥-" + rebatePrice.toFixed(2);
  571. }
  572. // 赠品
  573. if( this.couponList[i].rebate_type == 3 ){
  574. // 替换文字
  575. this.couponUsed = "送" + ( this.couponList[i].rebate_scope.length ? this.couponList[i].rebate_scope[0].product_name: "");
  576. }
  577. // 小数点保留
  578. this.rebatePrice = rebatePrice.toFixed(2);
  579. }
  580. }
  581. },
  582. popupChange(e){
  583. // 禁止滚动穿透
  584. this.show = e.show
  585. },
  586. // 选择地址
  587. checkedAddrItem(item){
  588. this.checkedAddr = item;
  589. this.$refs.addrPopup.close();
  590. },
  591. getAddrList(){
  592. // 判断数据
  593. this.$http.request('api/custom_addr/get_list').then((callback)=>{
  594. // 获取成功
  595. if( callback.code == 'success' ){
  596. this.addrList = callback.data;
  597. // 如果有的话
  598. if( this.addrList.length ){
  599. // 获取默认的
  600. for (let i in this.addrList) {
  601. // 如果是默认的
  602. if( this.addrList[i].is_default ) this.checkedAddr = this.addrList[i];
  603. }
  604. // 如果没有默认的话
  605. if( !this.checkedAddr.id ){
  606. this.checkedAddr = this.addrList[this.addrList.length-1];
  607. }
  608. }
  609. }
  610. });
  611. },
  612. // 客服显示
  613. openAddFollow(){
  614. // 返回结果
  615. this.followQrcode = this.$checkAccess.getFollowQrcode();
  616. // 有图才展示
  617. if( this.followQrcode ) this.$refs.addFollow.open('center');
  618. },
  619. closeAddFollow(){
  620. this.$refs.addFollow.close();
  621. },
  622. // 保存图片
  623. saveImage(){
  624. var that = this;
  625. // 下载远程图片后保存到相册
  626. uni.downloadFile({
  627. url: this.followQrcode,
  628. success:function(res) {
  629. if(res.statusCode == 200){
  630. uni.saveImageToPhotosAlbum({
  631. filePath: res.tempFilePath,
  632. success:function(res) {
  633. uni.showToast({title:"保存成功",icon:'none'});
  634. that.$refs.addFollow.close();
  635. },
  636. fail:function(err){
  637. }
  638. });
  639. }
  640. },
  641. })
  642. },
  643. // 设置默认sku
  644. setDefaultSpec(){
  645. // 如果列表存在
  646. if( this.productInfo.product_sku.length ){
  647. //如果列表大于1
  648. if(this.productInfo.product_sku.length > 1){
  649. //循环sku列表
  650. for(var k = 0 ; k < this.productInfo.product_sku.length;k++ ){
  651. //全部规格都已经下架
  652. if(k === this.productInfo.product_sku.length){
  653. uni.showToast({
  654. title:"当前商品已全部下架",
  655. icon:"error"
  656. })
  657. this.productInfo.stock = 0;
  658. return;
  659. }
  660. // 获取第一个没有下架的sku作为默认值
  661. if(this.productInfo.product_sku[k].status === 0){
  662. var attr_ids = this.productInfo.product_sku[k].attr_ids.split(",");
  663. break;
  664. }
  665. }
  666. // 循环规格列表
  667. for ( let i in this.productInfo.product_attr ) {
  668. // 再循环属性
  669. for (let j in this.productInfo.product_attr[i].attr_list) {
  670. // 如果不等于id
  671. if( attr_ids.includes(this.productInfo.product_attr[i].attr_list[j].id + '') ){
  672. // 设置选中
  673. this.productInfo.product_attr[i].attr_list[j].active = 1;
  674. }else{
  675. this.productInfo.product_attr[i].attr_list[j].active = 0;
  676. }
  677. }
  678. }
  679. // 产品价格修改
  680. this.productInfo.price = this.productInfo.product_sku[k].price;
  681. // 产品规格修改
  682. // this.productInfo.spec = this.productInfo.product_sku[k].attr_names;
  683. // 产品库存
  684. this.productInfo.stock = this.productInfo.product_sku[k].stock;
  685. // 产品SKU
  686. this.sku_id = this.productInfo.product_sku[k].id;
  687. // 计算价格
  688. this.priceHandler();
  689. // 优惠券是否可用
  690. this.checkCoupon();
  691. }else{
  692. var attr_ids = this.productInfo.product_sku[0].attr_ids.split(",");
  693. // 循环规格列表
  694. for ( let i in this.productInfo.product_attr ) {
  695. // 再循环属性
  696. for (let j in this.productInfo.product_attr[i].attr_list) {
  697. // 如果不等于id
  698. if( attr_ids.includes(this.productInfo.product_attr[i].attr_list[j].id + '') ){
  699. // 设置选中
  700. this.productInfo.product_attr[i].attr_list[j].active = 1;
  701. }else{
  702. this.productInfo.product_attr[i].attr_list[j].active = 0;
  703. }
  704. }
  705. }
  706. // 产品价格修改
  707. this.productInfo.price = this.productInfo.product_sku[0].price;
  708. // 产品规格修改
  709. this.productInfo.spec = this.productInfo.product_sku[0].attr_names;
  710. // 产品库存
  711. this.productInfo.stock = this.productInfo.product_sku[0].stock;
  712. // 产品SKU
  713. this.sku_id = this.productInfo.product_sku[0].id;
  714. // 计算价格
  715. this.priceHandler();
  716. // 优惠券是否可用
  717. this.checkCoupon();
  718. }
  719. }
  720. },
  721. // 属性变更
  722. attrChange(spec_index,attr_index){
  723. // 判断当前属性是否选择。选择的跳过
  724. if (this.productInfo.product_attr[spec_index].attr_list[attr_index].active) return;
  725. // 先记录当前规格下所有属性原来的active状态
  726. let originalActiveStates = {};
  727. for (let i in this.productInfo.product_attr[spec_index].attr_list) {
  728. originalActiveStates[i] = this.productInfo.product_attr[spec_index].attr_list[i].active;
  729. }
  730. //循环规格下的属性
  731. for ( let i in this.productInfo.product_attr[spec_index].attr_list ) {
  732. // 全部改为未选中
  733. this.productInfo.product_attr[spec_index].attr_list[i].active = 0;
  734. }
  735. //选择选项
  736. this.productInfo.product_attr[spec_index].attr_list[attr_index].active = 1;
  737. //选中的规格
  738. var attr_ids = [];
  739. // 循环规格
  740. for ( let i in this.productInfo.product_attr ) {
  741. // 再循环属性
  742. for (let j in this.productInfo.product_attr[i].attr_list) {
  743. // 如果选中的
  744. if( this.productInfo.product_attr[i].attr_list[j].active ){
  745. attr_ids.push(this.productInfo.product_attr[i].attr_list[j].id);
  746. }
  747. }
  748. }
  749. // 转成字符串
  750. var attrids = attr_ids.join(",");
  751. // 如果当前点击的属性对应的SKU状态为未下架(初始化为0)
  752. let currentSKUStatus = 0;
  753. // 匹配规格
  754. if( this.productInfo.product_sku.length ){
  755. // 是否有对应的SKU
  756. let haveSku = 0;
  757. // 循环sku
  758. for (let i in this.productInfo.product_sku) {
  759. // 如果sku不匹配
  760. if( this.productInfo.product_sku[i].attr_ids != attrids ) continue;
  761. // 设置有SKU
  762. haveSku = 1;
  763. // 获取当前匹配到的SKU的状态
  764. currentSKUStatus = this.productInfo.product_sku[i].status;
  765. // 如果商品已经下架(status等于1),则恢复当前规格下所有属性原来的active状态
  766. if(currentSKUStatus === 1){
  767. uni.showToast({title:"该规格已下架",icon:"none"});
  768. for (let k in originalActiveStates) {
  769. this.productInfo.product_attr[spec_index].attr_list[k].active = originalActiveStates[k];
  770. }
  771. continue;
  772. }
  773. // 如果商品没有库存
  774. if( this.productInfo.product_sku[i].stock <= 0 ){
  775. uni.showToast({title:"该规格库存不足",icon:"none"});
  776. for (let k in originalActiveStates) {
  777. this.productInfo.product_attr[spec_index].attr_list[k].active = originalActiveStates[k];
  778. }
  779. continue;
  780. }
  781. // 产品价格修改
  782. this.productInfo.price = this.productInfo.product_sku[i].price;
  783. // 产品规格修改
  784. this.productInfo.spec = this.productInfo.product_sku[i].attr_names;
  785. // 产品库存
  786. this.productInfo.stock = this.productInfo.product_sku[i].stock;
  787. // 产品SKU
  788. this.sku_id = this.productInfo.product_sku[i].id;
  789. // 计算价格
  790. this.priceHandler();
  791. // 优惠券是否可用
  792. this.checkCoupon();
  793. }
  794. // 如果没有对应的SKU
  795. if( !haveSku ){
  796. uni.showToast({title:"该规格已下架",icon:"none"});
  797. for (let k in originalActiveStates) {
  798. this.productInfo.product_attr[spec_index].attr_list[k].active = originalActiveStates[k];
  799. }
  800. }
  801. }
  802. },
  803. //只有一组sku默认规格是否已下架
  804. defaultSkuStatus(){
  805. if(this.productInfo.product_sku.length){
  806. if(this.productInfo.product_sku[0].status === 1){
  807. uni.showToast({
  808. title:"该规格已下架",
  809. icon:"none",
  810. });
  811. this.productInfo.stock = 0;
  812. var attr_ids = this.productInfo.product_sku[0].attr_ids.split(",");
  813. // 循环规格列表
  814. for ( let i in this.productInfo.product_attr ) {
  815. // 再循环属性
  816. for (let j in this.productInfo.product_attr[i].attr_list) {
  817. // 如果不等于id
  818. if( attr_ids.includes(this.productInfo.product_attr[i].attr_list[j].id + '') ){
  819. // 取消选中
  820. this.productInfo.product_attr[i].attr_list[j].active = 0;
  821. }
  822. }
  823. }
  824. return;
  825. }
  826. }
  827. }
  828. }
  829. }
  830. </script>
  831. <style lang="less">
  832. .product_image_box{
  833. display: block;
  834. overflow: hidden;
  835. background: #FFFFFF;
  836. margin: 10rpx auto;
  837. .product_image{
  838. display: block;
  839. margin: 0 auto;
  840. width: 750rpx;
  841. height: 750rpx;
  842. }
  843. }
  844. .product_info{
  845. display: block;
  846. background: #FFFFFF;
  847. margin: 10rpx 0rpx;
  848. padding: 10px 10px;
  849. .product_name{
  850. max-height: 80rpx;
  851. font-size: 30rpx;
  852. line-height: 40rpx;
  853. overflow: hidden;
  854. padding: 10rpx 0rpx;
  855. }
  856. .product_spec{
  857. color: #999999;
  858. font-size: 24rpx;
  859. line-height: 30rpx;
  860. overflow: hidden;
  861. .spec_name{
  862. float: left;
  863. }
  864. .product_stock{
  865. float: right;
  866. }
  867. }
  868. .stock_price{
  869. font-size: 20rpx;
  870. overflow: hidden;
  871. margin-top: 10rpx;
  872. line-height: 30rpx;
  873. .product_price{
  874. float: left;
  875. color: red;
  876. font-size: 38rpx;
  877. line-height: 60rpx;
  878. .product_market{
  879. font-size: 24rpx;
  880. color: #999999;
  881. line-height: 30rpx;
  882. margin-left: 10rpx;
  883. text-decoration: line-through;
  884. }
  885. }
  886. }
  887. }
  888. // 描述简介
  889. .product_business{
  890. display: block;
  891. overflow: hidden;
  892. padding: 20rpx 20rpx;
  893. margin: 10rpx auto;
  894. background: #FFFFFF;
  895. .logopic{
  896. float: left;
  897. width: 80rpx;
  898. height: 80rpx;
  899. border-radius: 50%;
  900. margin-right: 20rpx;
  901. }
  902. .business_info{
  903. float: left;
  904. width: 600rpx;
  905. overflow: hidden;
  906. .business_name{
  907. font-size: 26rpx;
  908. line-height: 40rpx;
  909. }
  910. .business_desc{
  911. color: #999999;
  912. font-size: 24rpx;
  913. line-height: 40rpx;
  914. }
  915. }
  916. }
  917. .product_description{
  918. width: 700rpx;
  919. display: block;
  920. overflow: hidden;
  921. background: #FFFFFF;
  922. min-height: 600rpx;
  923. font-size: 26rpx;
  924. margin: 0rpx auto;
  925. line-height: 50rpx;
  926. padding: 10rpx 25rpx;
  927. [alt]{ //web_view图片
  928. max-width: 100%; // 避免图片超宽
  929. vertical-align: bottom; // 避免图片之间间隙
  930. }
  931. }
  932. .product_poster{
  933. display: block;
  934. overflow: hidden;
  935. padding: 10rpx 0rpx;
  936. margin: 10rpx auto;
  937. background: #FFFFFF;
  938. .product_image{
  939. width: 750rpx;
  940. display: block;
  941. }
  942. }
  943. .order_car{
  944. left: 0rpx;
  945. width: 750rpx;
  946. height: 140rpx;
  947. display: block;
  948. position: fixed;
  949. padding-top: 20rpx;
  950. background: #FFFFFF;
  951. bottom: var(--window-bottom);
  952. border-top: 2rpx solid #DDDDDD;
  953. .show_order{
  954. float: right;
  955. width: 280rpx;
  956. height: 80rpx;
  957. display: block;
  958. color: #FFFFFF;
  959. font-size: 30rpx;
  960. overflow: hidden;
  961. line-height: 80rpx;
  962. padding: 0rpx 0rpx;
  963. text-align: center;
  964. margin-right: 35rpx;
  965. background-color: #E03519;
  966. border-radius: 0rpx;
  967. border-top-right-radius: 20rpx;
  968. border-bottom-right-radius: 20rpx;
  969. }
  970. .show_car{
  971. float: right;
  972. width: 280rpx;
  973. height: 80rpx;
  974. display: block;
  975. color: #FFFFFF;
  976. font-size: 30rpx;
  977. overflow: hidden;
  978. line-height: 80rpx;
  979. padding: 0rpx 0rpx;
  980. text-align: center;
  981. background-color: #F59A23;
  982. border-radius: 0rpx;
  983. border-top-left-radius: 20rpx;
  984. border-bottom-left-radius: 20rpx;
  985. }
  986. .to_car{
  987. float: left;
  988. width: 100rpx;
  989. height: 60rpx;
  990. display: block;
  991. text-align: center;
  992. margin-left: 35rpx;
  993. padding-top: 10rpx;
  994. .car_icon{
  995. float: left;
  996. width: 60rpx;
  997. height: 60rpx;
  998. display: block;
  999. }
  1000. }
  1001. }
  1002. .popup{
  1003. overflow: hidden;
  1004. .popup_title{
  1005. display: block;
  1006. overflow: hidden;
  1007. margin: 0rpx auto;
  1008. font-size: 36rpx;
  1009. height: 120rpx;
  1010. line-height: 120rpx;
  1011. padding: 0rpx 20rpx;
  1012. border-bottom: 10rpx solid #F8F8F8;
  1013. .to_addr_page{
  1014. float: right;
  1015. color: #F59A23;
  1016. display: block;
  1017. height: 120rpx;
  1018. line-height: 120rpx;
  1019. font-size: 26rpx;
  1020. padding: 0rpx 10rpx;
  1021. }
  1022. }
  1023. .order_info{
  1024. overflow: hidden;
  1025. background: #FFFFFF;
  1026. .custom_addr{
  1027. width: 680rpx;
  1028. display: block;
  1029. font-size: 24rpx;
  1030. overflow: hidden;
  1031. margin: 0rpx auto;
  1032. line-height: 40rpx;
  1033. padding: 20rpx 35rpx;
  1034. background-color: #FFFFFF;
  1035. border-bottom: 2rpx solid #dddddd;
  1036. .contact_user{
  1037. display: block;
  1038. font-size: 24rpx;
  1039. line-height: 50rpx;
  1040. .contact_none{
  1041. font-size: 26rpx;
  1042. font-weight: bold;
  1043. }
  1044. .contact_name{
  1045. font-size: 26rpx;
  1046. font-weight: bold;
  1047. margin-right: 16rpx;
  1048. }
  1049. .contact_more{
  1050. float: right;
  1051. font-size: 40rpx;
  1052. font-weight: bold;
  1053. }
  1054. }
  1055. .contact_addr{
  1056. width: 620rpx;
  1057. display: block;
  1058. font-size: 24rpx;
  1059. line-height: 30rpx;
  1060. padding: 10rpx 5rpx;
  1061. }
  1062. }
  1063. .car_item{
  1064. height: 200rpx;
  1065. display: block;
  1066. background: #FFFFFF;
  1067. margin: 20rpx auto;
  1068. .box_left{
  1069. float: left;
  1070. width: 160rpx;
  1071. height: 200rpx;
  1072. margin-left: 35rpx;
  1073. .car_image{
  1074. width: 160rpx;
  1075. height: 160rpx;
  1076. margin: 20rpx 0rpx;
  1077. border-radius: 5rpx;
  1078. }
  1079. }
  1080. .box_right{
  1081. float: left;
  1082. width: 485rpx;
  1083. margin-left: 35rpx;
  1084. padding-top: 20rpx;
  1085. .car_name{
  1086. max-height: 80rpx;
  1087. font-size: 30rpx;
  1088. line-height: 40rpx;
  1089. overflow: hidden;
  1090. padding: 0rpx 0rpx;
  1091. }
  1092. .car_spec{
  1093. color: #999999;
  1094. font-size: 24rpx;
  1095. line-height: 30rpx;
  1096. padding: 0rpx 0rpx;
  1097. }
  1098. .stock_price{
  1099. width: 485rpx;
  1100. color: #dddddd;
  1101. font-size: 20rpx;
  1102. overflow: hidden;
  1103. margin-top: 10rpx;
  1104. line-height: 30rpx;
  1105. .product_price{
  1106. float: left;
  1107. color: red;
  1108. font-size: 30rpx;
  1109. line-height: 60rpx;
  1110. .car_market{
  1111. font-size: 24rpx;
  1112. color: #999999;
  1113. line-height: 30rpx;
  1114. vertical-align: middle;
  1115. text-decoration: line-through;
  1116. }
  1117. }
  1118. .product_quantity_box{
  1119. float: right;
  1120. color: #333333;
  1121. overflow: hidden;
  1122. font-size: 24rpx;
  1123. margin-top: 10rpx;
  1124. text-align: center;
  1125. .product_quantity_sub{
  1126. float: left;
  1127. border: none;
  1128. height: 36rpx;
  1129. background: none;
  1130. text-align: center;
  1131. line-height: 36rpx;
  1132. padding: 10rpx 10rpx;
  1133. .sub_icon{
  1134. width: 22rpx;
  1135. height: 22rpx;
  1136. display: block;
  1137. }
  1138. }
  1139. .product_quantity_sub::after{
  1140. border: none;
  1141. background: none;
  1142. }
  1143. .product_quantity{
  1144. float: left;
  1145. width: 100rpx;
  1146. height: 36rpx;
  1147. font-size: 24rpx;
  1148. min-height: 36rpx;
  1149. line-height: 36rpx;
  1150. padding: 0rpx 0rpx;
  1151. border-radius: 8rpx;
  1152. border: 2rpx solid #dddddd;
  1153. }
  1154. .product_quantity_add{
  1155. float: left;
  1156. border: none;
  1157. height: 36rpx;
  1158. background: none;
  1159. text-align: center;
  1160. padding: 10rpx 10rpx;
  1161. line-height: 36rpx;
  1162. .add_icon{
  1163. width: 22rpx;
  1164. height: 22rpx;
  1165. display: block;
  1166. }
  1167. }
  1168. .product_quantity_add::after{
  1169. border: none;
  1170. background: none;
  1171. }
  1172. }
  1173. }
  1174. .product_stock{
  1175. font-size: 20rpx;
  1176. line-height: 60rpx;
  1177. }
  1178. }
  1179. }
  1180. .select_sku{
  1181. font-size: 28rpx;
  1182. padding: 20rpx 35rpx;
  1183. margin-bottom: 20rpx;
  1184. .scroll_max{
  1185. height: 440rpx;
  1186. .product_attr{
  1187. display: block;
  1188. overflow: hidden;
  1189. margin-bottom: 20rpx;
  1190. .spec_name{
  1191. display: block;
  1192. height: 40rpx;
  1193. font-size: 28rpx;
  1194. line-height: 40rpx;
  1195. }
  1196. .arrt_list{
  1197. display: block;
  1198. overflow: hidden;
  1199. background-color: #F5F5F5;
  1200. .arrt_option{
  1201. float: left;
  1202. font-size: 28rpx;
  1203. line-height: 40rpx;
  1204. text-align: center;
  1205. border-radius: 6rpx;
  1206. padding: 10rpx 20rpx;
  1207. margin: 10rpx 0rpx;
  1208. margin-right: 20rpx;
  1209. background-color: #EEEEEE;
  1210. }
  1211. .arrt_option.active {
  1212. color: #FFFFFF;
  1213. background-color: #fE6000;
  1214. }
  1215. }
  1216. }
  1217. }
  1218. }
  1219. .to_select_coupon{
  1220. font-size: 28rpx;
  1221. padding: 10rpx 35rpx;
  1222. margin-bottom: 20rpx;
  1223. .coupon_deduction{
  1224. color: red;
  1225. float: right;
  1226. }
  1227. }
  1228. .order_price{
  1229. font-size: 28rpx;
  1230. text-align: right;
  1231. margin: 0rpx 35rpx;
  1232. padding: 10rpx 0rpx;
  1233. border-top: 2rpx solid #DDDDDD;
  1234. .coupon_deduction{
  1235. color: red;
  1236. float: right;
  1237. }
  1238. }
  1239. .order_btn{
  1240. width: 700rpx;
  1241. height: 100rpx;
  1242. display: block;
  1243. margin: 0 auto;
  1244. margin-top: 60rpx;
  1245. line-height: 80rpx;
  1246. text-align: center;
  1247. font-size: 30rpx;
  1248. .to_car{
  1249. color: #FFFFFF;
  1250. float: right;
  1251. width: 700rpx;
  1252. height: 80rpx;
  1253. display: block;
  1254. overflow: hidden;
  1255. font-size: 30rpx;
  1256. line-height: 80rpx;
  1257. padding: 0rpx 0rpx;
  1258. border-radius: 40rpx;
  1259. border: 0rpx solid transparent;
  1260. background-color: #F59A23;
  1261. }
  1262. .to_car::after{
  1263. border: 0rpx solid transparent;
  1264. }
  1265. .to_order{
  1266. color: #FFFFFF;
  1267. float: right;
  1268. width: 700rpx;
  1269. height: 80rpx;
  1270. display: block;
  1271. font-size: 30rpx;
  1272. overflow: hidden;
  1273. line-height: 80rpx;
  1274. padding: 0rpx 0rpx;
  1275. border-radius: 40rpx;
  1276. background-color: #E03519;
  1277. border: 0rpx solid transparent;
  1278. }
  1279. .to_order::after{
  1280. border: 0rpx solid transparent;
  1281. }
  1282. }
  1283. }
  1284. .coupon_list{
  1285. display: block;
  1286. overflow: hidden;
  1287. min-height: 600rpx;
  1288. margin: 10rpx auto;
  1289. background: #FFFFFF;
  1290. padding-bottom: 50rpx;
  1291. .coupon_item{
  1292. height: 200rpx;
  1293. display: block;
  1294. margin: 10rpx auto;
  1295. border-bottom: 2rpx solid #DDDDDD;
  1296. .box_left{
  1297. float: left;
  1298. width: 160rpx;
  1299. height: 160rpx;
  1300. font-size: 20rpx;
  1301. text-align: center;
  1302. margin-left: 35rpx;
  1303. line-height: 60rpx;
  1304. margin-top: 20rpx;
  1305. background: pink;
  1306. .rebate{
  1307. width: 120rpx;
  1308. height: 60rpx;
  1309. margin: 0rpx auto;
  1310. line-height: 60rpx;
  1311. margin-top: 20rpx;
  1312. overflow: hidden;
  1313. white-space: nowrap;
  1314. text-overflow: ellipsis;
  1315. }
  1316. }
  1317. .box_right{
  1318. float: left;
  1319. width: 485rpx;
  1320. margin-left: 35rpx;
  1321. padding-top: 20rpx;
  1322. .coupon_title{
  1323. width: 485rpx;
  1324. max-height: 80rpx;
  1325. font-size: 30rpx;
  1326. overflow: hidden;
  1327. line-height: 40rpx;
  1328. padding: 0rpx 0rpx;
  1329. .coupon_name{
  1330. float: left;
  1331. height: 40rpx;
  1332. width: 380rpx;
  1333. }
  1334. .coupon_status{
  1335. width: 85rpx;
  1336. float: right;
  1337. color: #999999;
  1338. font-size: 24rpx;
  1339. }
  1340. }
  1341. .product_scope{
  1342. width: 485rpx;
  1343. height: 80rpx;
  1344. color: #999999;
  1345. font-size: 24rpx;
  1346. overflow: hidden;
  1347. line-height: 80rpx;
  1348. .check_label{
  1349. float: right;
  1350. display: block;
  1351. overflow: hidden;
  1352. padding: 20rpx 20rpx;
  1353. .isstd{
  1354. line-height: 40rpx;
  1355. }
  1356. .checkbox{
  1357. float: right;
  1358. width: 40rpx;
  1359. height: 40rpx;
  1360. }
  1361. }
  1362. }
  1363. .coupon_info{
  1364. width: 485rpx;
  1365. max-height: 80rpx;
  1366. font-size: 30rpx;
  1367. overflow: hidden;
  1368. line-height: 40rpx;
  1369. padding: 0rpx 0rpx;
  1370. .coupon_exp{
  1371. float: left;
  1372. font-size: 20rpx;
  1373. }
  1374. }
  1375. }
  1376. }
  1377. .coupon_item:last-child{
  1378. border-bottom: none;
  1379. }
  1380. }
  1381. .addr_list{
  1382. width: 730rpx;
  1383. display: block;
  1384. overflow: hidden;
  1385. margin: 0rpx auto;
  1386. min-height: 500rpx;
  1387. .addr_item{
  1388. display: block;
  1389. font-size: 24rpx;
  1390. overflow: hidden;
  1391. line-height: 40rpx;
  1392. padding: 15rpx 10rpx;
  1393. border-radius: 15rpx;
  1394. border-bottom: 2rpx solid #dddddd;
  1395. .radio_label{
  1396. width: 40rpx;
  1397. float: left;
  1398. height: 50rpx;
  1399. padding-top: 30rpx;
  1400. margin-right: 20rpx;
  1401. .radio_icon{
  1402. float: left;
  1403. width: 40rpx;
  1404. height: 40rpx;
  1405. }
  1406. }
  1407. .contact_user{
  1408. float: left;
  1409. width: 640rpx;
  1410. display: block;
  1411. height: 50rpx;
  1412. font-size: 24rpx;
  1413. line-height: 50rpx;
  1414. .contact_name{
  1415. font-size: 26rpx;
  1416. font-weight: bold;
  1417. margin-right: 16rpx;
  1418. }
  1419. .contact_default{
  1420. color: #F59A23;
  1421. font-size: 20rpx;
  1422. margin-left: 16rpx;
  1423. border: 1rpx solid #F59A23;
  1424. }
  1425. }
  1426. .contact_addr{
  1427. float: left;
  1428. width: 640rpx;
  1429. display: block;
  1430. font-size: 24rpx;
  1431. line-height: 30rpx;
  1432. padding: 10rpx 5rpx;
  1433. }
  1434. }
  1435. }
  1436. .create_box{
  1437. height: 140rpx;
  1438. display: block;
  1439. .create_addr{
  1440. width: 700rpx;
  1441. height: 80rpx;
  1442. display: block;
  1443. color: #FFFFFF;
  1444. font-size: 30rpx;
  1445. overflow: hidden;
  1446. line-height: 80rpx;
  1447. padding: 0rpx 0rpx;
  1448. text-align: center;
  1449. margin: 0rpx auto;
  1450. margin-top: 20rpx;
  1451. border-radius: 40rpx;
  1452. background-color: #E03519;
  1453. }
  1454. }
  1455. }
  1456. </style>