index.vue 43 KB

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