index.vue 40 KB

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