index.vue 43 KB

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