createOrder.vue 27 KB

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