index.vue 41 KB

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