index.vue 46 KB

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