index.vue 43 KB

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