index.vue 40 KB

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