index.vue 43 KB

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