index.vue 42 KB

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