index.vue 42 KB

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