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