index.vue 44 KB

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