createOrder.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160
  1. <template>
  2. <view>
  3. <!-- <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex === item.state }" @click="tabClick(item.state)">{{ item.text }}</view>
  6. </view> -->
  7. <view class="store-wrap">
  8. </view>
  9. <view class="store">
  10. <view class="name flex">
  11. <image src="/static/icon/store.png" mode=""></image>{{storeInfo.name}}
  12. </view>
  13. <view class="info">
  14. 地址:{{storeInfo.address}}
  15. </view>
  16. <view class="info">
  17. 电话:{{storeInfo.phone}}
  18. </view>
  19. </view>
  20. <!-- 地址 -->
  21. <!-- <navigator v-if="tabCurrentIndex == 0" class="address-section" url="/pages/set/address?source=1">
  22. <view class="order-content" v-if="addressData.real_name">
  23. <text class="iconfont iconlocation"></text>
  24. <view class="cen">
  25. <view class="top">
  26. <text class="name">{{ addressData.real_name }}</text>
  27. <text class="mobile">{{ addressData.phone }}</text>
  28. </view>
  29. <text class="address">{{ addressData.province + addressData.city + addressData.district }}
  30. {{ addressData.detail }}</text>
  31. </view>
  32. <text class="iconfont iconenter"></text>
  33. </view>
  34. <view class="order-content" v-if="!addressData.real_name">
  35. <view class="addAddress">
  36. <text class="iconfont iconaddition"></text>
  37. <text>添加收货地址</text>
  38. </view>
  39. </view>
  40. <image class="a-bg" :src="addressImg"></image>
  41. </navigator> -->
  42. <!-- <view class="address-section">
  43. <view id="list-box">
  44. <view class="chose">
  45. <view class="title">选择门店</view>
  46. <view class="chose-name" @click.stop="selectPoint" >
  47. 选择门店
  48. </view>
  49. </view>
  50. <view class="stores-wrapper" v-if="checkedPoint && checkedPoint.name" @click.stop="selectPoint">
  51. <view class="store">
  52. <view class="store-logo">
  53. <image :src="checkedPoint.image" mode=""></image>
  54. <text class="store-name clamp">{{ checkedPoint.name }}</text>
  55. </view>
  56. <template v-if="checkedPoint.detailed_address != '测试'">
  57. <view class="store-addr store-base">
  58. 地址:
  59. <text>{{ checkedPoint.detailed_address }}</text>
  60. </view>
  61. <view class="store-addr store-base">
  62. 电话:
  63. <text>{{ checkedPoint.phone }}</text>
  64. </view>
  65. </template>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="personal" v-if="tabCurrentIndex == 1">
  70. <view class="info">
  71. <view class="name">提货人</view>
  72. <input type="text" class="box-right" v-model="real_name" style="color: #000000"
  73. placeholder="请填写提货人" />
  74. </view>
  75. <view class="info">
  76. <view class="name">手机号</view>
  77. <input type="text" class="box-right" v-model="phone" style="color: #000000" size="8"
  78. maxlength="11" placeholder="请填写提货人手机号" />
  79. </view>
  80. </view>
  81. <image class="a-bg" :src="addressImg"></image>
  82. </view> -->
  83. <view class="personal" >
  84. <view class="info">
  85. <view class="name">提货人</view>
  86. <input type="text" class="box-right" v-model="real_name" style="color: #000000"
  87. placeholder="请填写提货人" />
  88. </view>
  89. <view class="info">
  90. <view class="name">手机号</view>
  91. <input type="text" class="box-right" v-model="phone" style="color: #000000" size="8"
  92. maxlength="11" placeholder="请填写提货人手机号" />
  93. </view>
  94. </view>
  95. <view class="goods-wrap">
  96. <view class="goods-section" v-for="(ls, ind) in shopList" :key="ind">
  97. <view class="g-item">
  98. <image :src="ls.product.image"></image>
  99. <view class="right">
  100. <text class="title clamp">{{ ls.product.store_name }}</text>
  101. <text class="spec">{{ ls.specs.name}}</text>
  102. <view class="price-box">
  103. <text
  104. class="price">¥{{ ls.specs.price }}</text>
  105. <text class="number">{{ 'x ' + +ls.cart_num }}</text>
  106. <!-- <view><text class="price">¥{{lss.price}}</text></view> -->
  107. <!-- <view class="number">
  108. <uni-number-box class="step" :value="lss.number" :index="indx" @eventChange="numberChange"></uni-number-box>
  109. </view> -->
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- 优惠明细 -->
  116. <!-- <view class="yt-list">
  117. <view class="yt-list-cell b-b" @click="couponListshow ? toggleMask('show') : ''">
  118. <view class="cell-icon">券</view>
  119. <text class="cell-tit clamp">优惠券</text>
  120. <text class="cell-tip active" v-if="couponListshow && !couponChecked.coupon_price">选择优惠券</text>
  121. <text class="cell-tip red" v-if="couponChecked.coupon_price">-¥{{ couponChecked.coupon_price }}</text>
  122. <text class="cell-tip disabled" v-if="!couponListshow && !couponChecked.coupon_price">没有优惠券</text>
  123. <text class="cell-more wanjia wanjia-gengduo-d"></text>
  124. </view>
  125. <view class="yt-list-cell b-b" v-if="moneyAll.storeFreePostage > 0">
  126. <view class="cell-icon hb">减</view>
  127. <text class="cell-tit clamp">商家促销</text>
  128. <text class="cell-tip disabled">满{{ moneyAll.storeFreePostage }}包邮</text>
  129. </view>
  130. </view> -->
  131. <!-- 金额明细 -->
  132. <view class="yt-list">
  133. <!-- <view class="yt-list-cell b-b">
  134. <text class="cell-tit clamp">优惠金额</text>
  135. <text class="cell-tip red">-¥35</text>
  136. </view> -->
  137. <!-- <view class="yt-list-cell b-b" v-if="is_integral > 0">
  138. <text class="cell-tit clamp">积分抵扣{{ '(当前积分:' + integralAll + ')' }}</text>
  139. <view class="cell-tip"><radio @click="checkedPoints = !checkedPoints" color="#007c92" :checked="checkedPoints" /></view>
  140. </view> -->
  141. <!-- <view class="yt-list-cell b-b" v-if="tabCurrentIndex == 0">
  142. <text class="cell-tit clamp">运费</text>
  143. </view>
  144. <view class="yt-list-cell b-b">
  145. <text class="cell-tit clamp">备注</text>
  146. <input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />
  147. </view> -->
  148. </view>
  149. <view class="yt-list">
  150. <view class="yt-list-cell b-b">
  151. <text class="cell-tit clamp">折扣</text>
  152. <text class="cell-tip">¥{{ zkPrice }}</text>
  153. </view>
  154. <view class="yt-list-cell b-b">
  155. <text class="cell-tit clamp">商品总价</text>
  156. <text class="cell-tip">¥{{ totalPrice }}</text>
  157. </view>
  158. </view>
  159. <!-- 底部 -->
  160. <view class="footer" v-if="showbtn">
  161. <view class="price-content">
  162. <text>实付款</text>
  163. <text class="price-tip">¥</text>
  164. <text class="price">{{ payPrice }}</text>
  165. </view>
  166. <text class="submit" :class="{ submitNo: !payType }" @click="payType ? submit() : ''">提交订单</text>
  167. </view>
  168. <!-- 优惠券面板 -->
  169. <view class="mask" :class="maskState === 0 ? 'none' : maskState === 1 ? 'show' : ''" @click="toggleMask">
  170. <view class="mask-content">
  171. <!-- 优惠券页面,仿mt -->
  172. <view class="coupon-item" @click="checkedCp(item)" v-for="(item, index) in couponList" :key="index">
  173. <view class="con">
  174. <view class="left">
  175. <text class="title">{{ item.coupon_title }}</text>
  176. <text class="time">领取时间{{ item.add_time }}</text>
  177. </view>
  178. <view class="right">
  179. <text class="price">{{ item.coupon_price }}</text>
  180. <text>满{{ item.use_min_price }}可用</text>
  181. </view>
  182. <view class="circle l"></view>
  183. <view class="circle r"></view>
  184. </view>
  185. <text class="tips">有效期至{{ item.end_time }}</text>
  186. </view>
  187. </view>
  188. </view>
  189. <uni-popup ref="popupstore" type="bottom" @change="popchange">
  190. <view class="store-list">
  191. <scroll-view scroll-y="true" style="max-height: 500rpx;">
  192. <view class="store" v-for="store in store_list" @click="chooseStore(store)">
  193. <view class="store-logo">
  194. <image :src="store.image" mode=""></image>
  195. <text class="store-name clamp">{{ store.name }}</text>
  196. </view>
  197. <template v-if="store.detailed_address != '测试'">
  198. <view class="store-addr store-base">
  199. 地址:
  200. <text>{{ store.detailed_address }}</text>
  201. </view>
  202. <view class="store-addr store-base">
  203. 电话:
  204. <text>{{ store.phone }}</text>
  205. </view>
  206. </template>
  207. </view>
  208. </scroll-view>
  209. </view>
  210. </uni-popup>
  211. </view>
  212. </template>
  213. <script>
  214. import {
  215. confirm,
  216. computedOrderkey,
  217. couponsOrder,
  218. storeList
  219. } from '@/api/order.js';
  220. import {
  221. getUserInfo
  222. } from '@/api/user.js';
  223. import {
  224. cartAdd, cartCompute
  225. } from '@/api/product.js';
  226. import {
  227. mapState,
  228. mapMutations
  229. } from 'vuex';
  230. export default {
  231. data() {
  232. return {
  233. zkPrice: 0,
  234. storeInfo: {},
  235. totalPrice: 0,
  236. real_name: '',
  237. phone:'',
  238. is_integral: 0,
  239. showbtn: true,
  240. store_list: [],
  241. checkedPoint: {},
  242. addressImg: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAAAFCAYAAAAaAWmiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Rjk3RjkzMjM2NzMxMTFFOUI4RkU4OEZGMDcxQzgzOEYiIHhtc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x5NsW37vWQaS1WXzPHvjihzYS/lgshbeJ75WySHm7wNXXk8SbK/xutOX4ntHtYRxE0eJn6uARaGf6ie++7GPNxVkf/78AAwCn1+RYqusbZQAAAABJRU5ErkJggg==',
  243. // 当前选中的支付方式
  244. tabCurrentIndex: 1,
  245. navList: [
  246. {
  247. state: 1,
  248. text: '到店自提'
  249. },{
  250. state: 0,
  251. text: '快递配送'
  252. },
  253. ],
  254. maskState: 0, //优惠券面板显示状态
  255. desc: '', //备注
  256. payType: 1, //1微信 2支付宝
  257. // 优惠券列表
  258. couponList: [],
  259. couponListshow: false, //是有可以显示优惠券列表
  260. couponChecked: {}, //选中的优惠券
  261. // 收货地址
  262. addressData: {},
  263. // 店铺地址
  264. shopAddress: {
  265. name: '',
  266. mobile: '',
  267. addressName: '',
  268. address: '',
  269. area: '',
  270. default: false
  271. },
  272. // 商品列表
  273. shopList: [],
  274. // 购物车id
  275. cartId: '',
  276. //购物金额详情
  277. moneyAll: {
  278. storeFreePostage: 0, //邮费优惠
  279. storePostage: 0, //邮费
  280. totalPrice: 0, //总支付金额
  281. vipPrice: 0 //vip优惠价
  282. },
  283. payPrice: 0, //总支付金额
  284. orderKey: '', //订单id
  285. checkedPoints: false, //判断是否积分抵扣
  286. integralAll: 0, //可使用的积分
  287. integralMoney: 0, //积分抵扣金额
  288. integralShow: false, //是否显示积分抵扣金额
  289. payType: true, //是否可支付
  290. pinkid: '' ,//保存拼团商品id
  291. store_id: 0
  292. };
  293. },
  294. onLoad(option) {
  295. this.storeInfo = uni.getStorageSync('storeInfo') || {}
  296. // 判断是否为拼团商品
  297. this.cartId = option.id;
  298. this.loadData();
  299. this.userinfo();
  300. this.real_name = uni.getStorageSync('real_name') || ''
  301. this.phone = uni.getStorageSync('phone') || ''
  302. },
  303. watch: {
  304. checkedPoints(newValue, oldValue) {
  305. this.integralShow = false;
  306. this.payMoneyNub();
  307. },
  308. tabCurrentIndex(newValue, oldValue) {
  309. this.payMoneyNub();
  310. }
  311. },
  312. computed: {
  313. Postage() {
  314. let money = +this.moneyAll.storePostage;
  315. if (money == 0) {
  316. return '免运费';
  317. } else {
  318. return '¥' + money;
  319. }
  320. },
  321. // payAllMoney() {
  322. // return +this.moneyAll.totalPrice + +this.moneyAll.vipPrice;
  323. // },
  324. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin','store'])
  325. },
  326. methods: {
  327. storeList() {
  328. storeList().then(res => {
  329. console.log(res)
  330. this.store_list = res.data.list
  331. this.checkedPoint = this.store_list[0]
  332. })
  333. },
  334. // 添加商品到购物车
  335. cartAdd(opt) {
  336. let obj = this;
  337. cartAdd({
  338. cartNum: 1, //商品数量
  339. new: 1, //商品是否新增加到购物车1为不加入0为加入
  340. mer_id: +opt.merid, //商店id
  341. combinationId: +opt.gid, //拼团商品id
  342. productId: +opt.pid //普通商品id
  343. })
  344. .then(function(e) {
  345. let da = e.data;
  346. // 獲取购物车号
  347. obj.cartId = da.cartId;
  348. // 加载数据
  349. obj.loadData();
  350. })
  351. .catch(e => {
  352. console.log(e);
  353. });
  354. },
  355. // 加载用户基础信息
  356. userinfo() {
  357. getUserInfo({}).then(({
  358. data
  359. }) => {
  360. this.integralAll = data.integral;
  361. });
  362. },
  363. // 计算支付金额
  364. payMoneyNub() {
  365. computedOrderkey({
  366. orderkey: this.orderKey,
  367. useIntegral: this.checkedPoints ? 1 : 0, //是否积分抵扣
  368. couponId: this.couponChecked.id, //优惠券编号
  369. addressId: this.addressData.id, //地址编号
  370. shipping_type: this.tabCurrentIndex + 1
  371. })
  372. .then(({
  373. data
  374. }) => {
  375. console.log(data, '111');
  376. this.payType = true;
  377. this.integralShow = true;
  378. // 获取支付金额
  379. this.payPrice = +data.result.pay_price;
  380. this.integralMoney = data.result.deduction_price;
  381. })
  382. .catch(e => {
  383. console.log(e);
  384. this.integralShow = false;
  385. this.payType = false;
  386. });
  387. },
  388. // 是否使用积分
  389. checkedIntegral() {
  390. this.checkedPoints = !this.checkedPoints;
  391. },
  392. // 选中优惠券
  393. checkedCp(item) {
  394. this.couponChecked = item;
  395. this.payMoneyNub();
  396. },
  397. // 加载优惠券列表
  398. couponsOrder(money) {
  399. couponsOrder({}, money).then(e => {
  400. if (e.data.length > 0) {
  401. this.couponListshow = true;
  402. }
  403. this.couponList = e.data;
  404. });
  405. },
  406. //顶部tab点击
  407. tabClick(index) {
  408. this.tabCurrentIndex = index;
  409. },
  410. //显示优惠券面板
  411. toggleMask(type) {
  412. let timer = type === 'show' ? 10 : 300;
  413. let state = type === 'show' ? 1 : 0;
  414. this.maskState = 2;
  415. setTimeout(() => {
  416. this.maskState = state;
  417. }, timer);
  418. },
  419. loadData() {
  420. let obj = this;
  421. confirm({
  422. cartId: obj.cartId,
  423. store_id: obj.storeInfo.id
  424. }).then(({
  425. data
  426. }) => {
  427. // obj.addressData = data.addressInfo || {};
  428. obj.shopList = data.group_price.valid; //商品列表
  429. this.totalPrice = data.group_price.total_price
  430. this.zkPrice = (data.group_price.total_price*1 - data.group_price.pay_price*1).toFixed(2)
  431. this.payPrice = data.group_price.pay_price
  432. // obj.moneyAll = data.priceGroup; //金额数据
  433. obj.orderKey = data.key; //订单key
  434. // // 计算金额
  435. // this.payMoneyNub();
  436. // 加载优惠券
  437. // obj.couponsOrder(data.priceGroup.totalPrice);
  438. });
  439. },
  440. // 购买数量变化
  441. numberChange(data) {
  442. this.number = data.number;
  443. },
  444. // 修改支付方式
  445. changePayType(type) {
  446. this.payType = type;
  447. },
  448. // 提交订单
  449. submit() {
  450. if(!this.real_name) {
  451. this.$api.msg('请填写提货人');
  452. return false;
  453. }
  454. if(!this.phone) {
  455. this.$msg('请填写提货人手机号');
  456. return false;
  457. }
  458. if (!/(^1[2|3|4|5|6|7|8|9][0-9]{9}$)/.test(this.phone)) {
  459. this.$msg('请输入正确的手机号码');
  460. return;
  461. }
  462. uni.setStorageSync('phone',this.phone)
  463. uni.setStorageSync('real_name',this.real_name)
  464. let url = '/pages/money/pay?key=' + this.orderKey
  465. uni.navigateTo({
  466. url
  467. });
  468. },
  469. selectPoint() {
  470. // this.$refs.popupstore.open()
  471. uni.navigateTo({
  472. url: '/pages/zero/order'
  473. })
  474. },
  475. popchange(e) {
  476. this.showbtn = !e.show
  477. },
  478. chooseStore(item) {
  479. this.checkedPoint = item
  480. this.$refs.popupstore.close()
  481. }
  482. }
  483. };
  484. </script>
  485. <style lang="scss" scoped>
  486. page {
  487. background: $page-color-base;
  488. padding-bottom: 100rpx;
  489. }
  490. .navbar {
  491. display: flex;
  492. height: 80rpx;
  493. padding: 0 5px;
  494. background: #fff;
  495. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
  496. position: relative;
  497. z-index: 10;
  498. .nav-item {
  499. flex: 1;
  500. display: flex;
  501. justify-content: center;
  502. align-items: center;
  503. height: 100%;
  504. font-size: $font-lg + 4rpx;
  505. color: $font-color-dark;
  506. position: relative;
  507. &.current {
  508. color: $base-color;
  509. &:after {
  510. content: '';
  511. position: absolute;
  512. left: 50%;
  513. bottom: 0;
  514. transform: translateX(-50%);
  515. width: 140rpx;
  516. height: 0;
  517. border-bottom: 2px solid $base-color;
  518. }
  519. }
  520. }
  521. }
  522. .address-section {
  523. padding: 30rpx 0;
  524. background: #fff;
  525. position: relative;
  526. border-top: 1px solid $border-color-light;
  527. .order-content {
  528. min-height: 100rpx;
  529. display: flex;
  530. align-items: center;
  531. .addAddress {
  532. text-align: center;
  533. width: 100%;
  534. display: flex;
  535. justify-content: center;
  536. align-items: center;
  537. .iconaddition {
  538. font-size: 55rpx;
  539. line-height: 1;
  540. border-radius: 100rpx;
  541. margin-right: 20rpx;
  542. }
  543. }
  544. }
  545. .iconlocation {
  546. flex-shrink: 0;
  547. display: flex;
  548. align-items: center;
  549. justify-content: center;
  550. width: 90rpx;
  551. color: #888;
  552. font-size: 44rpx;
  553. }
  554. .cen {
  555. display: flex;
  556. flex-direction: column;
  557. flex: 1;
  558. font-size: 28rpx;
  559. color: $font-color-dark;
  560. }
  561. .name {
  562. font-size: 34rpx;
  563. margin-right: 24rpx;
  564. }
  565. .address {
  566. margin-top: 16rpx;
  567. margin-right: 20rpx;
  568. color: $font-color-light;
  569. }
  570. .icon-you {
  571. font-size: 32rpx;
  572. color: $font-color-light;
  573. margin-right: 30rpx;
  574. }
  575. .a-bg {
  576. position: absolute;
  577. left: 0;
  578. bottom: 0;
  579. display: block;
  580. width: 100%;
  581. height: 5rpx;
  582. }
  583. }
  584. .goods-wrap {
  585. width: 690rpx;
  586. background: #FFFFFF;
  587. border-radius: 20rpx;
  588. margin: 20rpx auto;
  589. padding: 20rpx;
  590. }
  591. .goods-section {
  592. background: #fff;
  593. padding-bottom: 1px;
  594. .g-header {
  595. display: flex;
  596. align-items: center;
  597. height: 84rpx;
  598. padding: 0 30rpx;
  599. position: relative;
  600. }
  601. .logo {
  602. display: block;
  603. width: 50rpx;
  604. height: 50rpx;
  605. border-radius: 100px;
  606. }
  607. .name {
  608. font-size: 30rpx;
  609. color: $font-color-base;
  610. margin-left: 24rpx;
  611. }
  612. .g-item {
  613. display: flex;
  614. margin: 20rpx 30rpx;
  615. image {
  616. flex-shrink: 0;
  617. display: block;
  618. width: 140rpx;
  619. height: 140rpx;
  620. border-radius: 4rpx;
  621. }
  622. .right {
  623. flex: 1;
  624. padding-left: 24rpx;
  625. overflow: hidden;
  626. }
  627. .title {
  628. font-size: 30rpx;
  629. color: $font-color-dark;
  630. }
  631. .spec {
  632. font-size: 26rpx;
  633. color: $font-color-light;
  634. }
  635. .price-box {
  636. display: flex;
  637. align-items: center;
  638. font-size: 32rpx;
  639. color: $font-color-dark;
  640. padding-top: 10rpx;
  641. .price {
  642. margin-bottom: 4rpx;
  643. color: $color-red;
  644. }
  645. .number {
  646. font-size: 26rpx;
  647. color: $font-color-base;
  648. margin-left: 20rpx;
  649. }
  650. }
  651. .step-box {
  652. position: relative;
  653. }
  654. }
  655. }
  656. .yt-list {
  657. background: #fff;
  658. width: 690rpx;
  659. margin: 20rpx auto;
  660. border-radius: 20rpx;
  661. }
  662. .yt-list-cell {
  663. display: flex;
  664. align-items: center;
  665. padding: 10rpx 30rpx 10rpx 40rpx;
  666. line-height: 70rpx;
  667. position: relative;
  668. &.cell-hover {
  669. background: #fafafa;
  670. }
  671. &.b-b:after {
  672. left: 30rpx;
  673. }
  674. .cell-icon {
  675. height: 32rpx;
  676. width: 32rpx;
  677. font-size: 22rpx;
  678. color: #fff;
  679. text-align: center;
  680. line-height: 32rpx;
  681. background: #f85e52;
  682. border-radius: 4rpx;
  683. margin-right: 12rpx;
  684. &.hb {
  685. background: #ffaa0e;
  686. }
  687. &.lpk {
  688. background: #3ab54a;
  689. }
  690. }
  691. .cell-more {
  692. align-self: center;
  693. font-size: 24rpx;
  694. color: $font-color-light;
  695. margin-left: 8rpx;
  696. margin-right: -10rpx;
  697. }
  698. .cell-tit {
  699. flex: 1;
  700. font-size: 26rpx;
  701. color: $font-color-light;
  702. margin-right: 10rpx;
  703. }
  704. .cell-tip {
  705. font-size: 26rpx;
  706. color: $font-color-dark;
  707. &.disabled {
  708. color: $font-color-light;
  709. }
  710. &.active {
  711. color: $base-color;
  712. }
  713. &.red {
  714. color: $base-color;
  715. }
  716. }
  717. &.desc-cell {
  718. .cell-tit {
  719. max-width: 90rpx;
  720. }
  721. }
  722. .desc {
  723. flex: 1;
  724. text-align: right;
  725. font-size: $font-base;
  726. color: $font-color-dark;
  727. }
  728. }
  729. /* 支付列表 */
  730. .pay-list {
  731. padding-left: 40rpx;
  732. margin-top: 16rpx;
  733. background: #fff;
  734. .pay-item {
  735. display: flex;
  736. align-items: center;
  737. padding-right: 20rpx;
  738. line-height: 1;
  739. height: 110rpx;
  740. position: relative;
  741. }
  742. .icon-weixinzhifu {
  743. width: 80rpx;
  744. font-size: 40rpx;
  745. color: #6bcc03;
  746. }
  747. .icon-alipay {
  748. width: 80rpx;
  749. font-size: 40rpx;
  750. color: #06b4fd;
  751. }
  752. .icon-xuanzhong2 {
  753. display: flex;
  754. align-items: center;
  755. justify-content: center;
  756. width: 60rpx;
  757. height: 60rpx;
  758. font-size: 40rpx;
  759. color: $base-color;
  760. }
  761. .tit {
  762. font-size: 32rpx;
  763. color: $font-color-dark;
  764. flex: 1;
  765. }
  766. }
  767. .footer {
  768. position: fixed;
  769. left: 0;
  770. bottom: 0;
  771. z-index: 995;
  772. display: flex;
  773. align-items: center;
  774. width: 100%;
  775. height: 90rpx;
  776. justify-content: space-between;
  777. font-size: 30rpx;
  778. background-color: #fff;
  779. z-index: 998;
  780. color: $font-color-base;
  781. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  782. .price-content {
  783. padding-left: 30rpx;
  784. }
  785. .price-tip {
  786. color: $base-color;
  787. margin-left: 8rpx;
  788. }
  789. .price {
  790. font-size: 36rpx;
  791. color: $base-color;
  792. }
  793. .submit {
  794. display: flex;
  795. align-items: center;
  796. justify-content: center;
  797. width: 280rpx;
  798. height: 100%;
  799. color: #fff;
  800. font-size: 32rpx;
  801. background-color: $base-color;
  802. &.submitNo {
  803. background-color: $font-color-disabled;
  804. }
  805. }
  806. }
  807. /* 优惠券面板 */
  808. .mask {
  809. display: flex;
  810. align-items: flex-end;
  811. position: fixed;
  812. left: 0;
  813. top: var(--window-top);
  814. bottom: 0;
  815. width: 100%;
  816. background: rgba(0, 0, 0, 0);
  817. z-index: 9995;
  818. transition: 0.3s;
  819. .mask-content {
  820. width: 100%;
  821. max-height: 70vh;
  822. background: #f3f3f3;
  823. transform: translateY(100%);
  824. transition: 0.3s;
  825. overflow-y: scroll;
  826. }
  827. &.none {
  828. display: none;
  829. }
  830. &.show {
  831. background: rgba(0, 0, 0, 0.4);
  832. .mask-content {
  833. transform: translateY(0);
  834. }
  835. }
  836. }
  837. /* 优惠券列表 */
  838. .coupon-item {
  839. display: flex;
  840. flex-direction: column;
  841. margin: 20rpx 24rpx;
  842. background: #fff;
  843. .con {
  844. display: flex;
  845. align-items: center;
  846. position: relative;
  847. height: 120rpx;
  848. padding: 0 30rpx;
  849. &:after {
  850. position: absolute;
  851. left: 0;
  852. bottom: 0;
  853. content: '';
  854. width: 100%;
  855. height: 0;
  856. border-bottom: 1px dashed #f3f3f3;
  857. transform: scaleY(50%);
  858. }
  859. }
  860. .left {
  861. display: flex;
  862. flex-direction: column;
  863. justify-content: center;
  864. flex: 1;
  865. overflow: hidden;
  866. height: 100rpx;
  867. }
  868. .title {
  869. font-size: 32rpx;
  870. color: $font-color-dark;
  871. margin-bottom: 10rpx;
  872. }
  873. .time {
  874. font-size: 24rpx;
  875. color: $font-color-light;
  876. }
  877. .right {
  878. display: flex;
  879. flex-direction: column;
  880. justify-content: center;
  881. align-items: center;
  882. font-size: 26rpx;
  883. color: $font-color-base;
  884. height: 100rpx;
  885. }
  886. .price {
  887. font-size: 44rpx;
  888. color: $base-color;
  889. &:before {
  890. content: '¥';
  891. font-size: 34rpx;
  892. }
  893. }
  894. .tips {
  895. font-size: 24rpx;
  896. color: $font-color-light;
  897. line-height: 60rpx;
  898. padding-left: 30rpx;
  899. }
  900. .circle {
  901. position: absolute;
  902. left: -6rpx;
  903. bottom: -10rpx;
  904. z-index: 10;
  905. width: 20rpx;
  906. height: 20rpx;
  907. background: #f3f3f3;
  908. border-radius: 100px;
  909. &.r {
  910. left: auto;
  911. right: -6rpx;
  912. }
  913. }
  914. }
  915. .personal {
  916. width: 690rpx;
  917. display: flex;
  918. flex-direction: column;
  919. background-color: #ffffff;
  920. margin:20rpx auto;
  921. border-radius: 20rpx;
  922. .box-right {
  923. width: 100%;
  924. font-size: 30rpx;
  925. text-align: right;
  926. padding-right: 25rpx;
  927. }
  928. .info {
  929. padding: 20rpx 25rpx;
  930. display: flex;
  931. align-items: center;
  932. font-size: 30rpx;
  933. justify-content: space-between;
  934. .name {
  935. width: 120rpx;
  936. flex-shrink: 0;
  937. }
  938. input {
  939. margin-left: 12rpx;
  940. width: 100%;
  941. // background-color: pink;
  942. display: block;
  943. color: #999999;
  944. }
  945. }
  946. }
  947. .stores-wrapper {
  948. padding-top: 20rpx;
  949. height: 100%;
  950. }
  951. .store {
  952. width: 710rpx;
  953. // height: 231rpx;
  954. background: #ffffff;
  955. box-shadow: 0px 0px 20rpx 0rpx rgba(50, 50, 52, 0.06);
  956. border-radius: 10rpx;
  957. // margin-bottom: 15rpx;
  958. margin: 0 auto 15rpx;
  959. position: relative;
  960. padding: 25rpx 0 20rpx 20rpx;
  961. .store-logo {
  962. height: 65rpx;
  963. font-size: 32rpx;
  964. font-weight: bold;
  965. color: #333333;
  966. line-height: 65rpx;
  967. // margin-bottom: 20rpx;
  968. position: relative;
  969. image {
  970. width: 65rpx;
  971. height: 65rpx;
  972. border-radius: 50%;
  973. }
  974. .store-name {
  975. max-width: 500rpx;
  976. display: inline-block;
  977. padding-left: 12rpx;
  978. position: absolute;
  979. top: 0;
  980. }
  981. }
  982. .store-base {
  983. height: 37rpx;
  984. line-height: 37rpx;
  985. font-size: 24rpx;
  986. font-weight: bold;
  987. color: #333333;
  988. text {
  989. font-weight: normal;
  990. }
  991. }
  992. .store-lv {
  993. display: inline-block;
  994. // width: 60rpx;
  995. padding: 0 10rpx;
  996. height: 40rpx;
  997. background: linear-gradient(-90deg, #dcb876 0%, #eecd92 100%);
  998. border-radius: 5rpx;
  999. text-align: center;
  1000. line-height: 40rpx;
  1001. color: #fff;
  1002. font-size: 23rpx;
  1003. position: absolute;
  1004. right: 20rpx;
  1005. top: 38rpx;
  1006. }
  1007. .store-can {
  1008. width: 113rpx;
  1009. height: 44rpx;
  1010. border: 2px solid #901b21;
  1011. border-radius: 5rpx;
  1012. font-size: 23rpx;
  1013. text-align: center;
  1014. line-height: 44rpx;
  1015. font-weight: 500;
  1016. color: #901b21;
  1017. position: absolute;
  1018. right: 20rpx;
  1019. bottom: 25rpx;
  1020. }
  1021. }
  1022. .store-list {
  1023. width: 750rpx;
  1024. max-height: 500rpx;
  1025. background-color: #fff;
  1026. z-index: 999;
  1027. padding-top: 20rpx;
  1028. }
  1029. .store-wrap {
  1030. background-color: #ff692c;
  1031. height: 160rpx;
  1032. }
  1033. .store {
  1034. width: 690rpx;
  1035. background: #FFFFFF;
  1036. border-radius: 23rpx;
  1037. margin:-70rpx auto 20rpx;
  1038. background-color: #fff;
  1039. font-size: 22rpx;
  1040. color: #666666;
  1041. .name {
  1042. font-weight: bold;
  1043. font-size: 32rpx;
  1044. color: #333333;
  1045. justify-content: flex-start;
  1046. padding: 20rpx 0;
  1047. image {
  1048. width: 48rpx;
  1049. height: 48rpx;
  1050. margin-right: 10rpx;
  1051. }
  1052. }
  1053. .info {
  1054. padding: 10rpx 0;
  1055. }
  1056. }
  1057. </style>