index.vue 40 KB

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