index.vue 43 KB

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