index.vue 46 KB

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