createOrder.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116
  1. <template>
  2. <view class="content padding-t-30">
  3. <view class="flex tab-address goodsList">
  4. <view class="left">
  5. 收货方式
  6. </view>
  7. <view class="flex right">
  8. <view class=" item" :class="{action:tabCurrentIndex==1}" @click="tabCurrentIndex=1">
  9. 配送
  10. </view>
  11. <view class=" item" :class="{action:tabCurrentIndex==2}" @click="tabCurrentIndex=2">
  12. 自提
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 地址 -->
  17. <navigator v-if="tabCurrentIndex == 1" url="/pages/set/address?source=1" class="address-section margin-b-30">
  18. <view class="order-content " v-if="addressData.real_name">
  19. <view class="cen">
  20. <view class="top">
  21. <text class="name">{{ addressData.real_name }}</text>
  22. <text class="mobile">{{ addressData.phone }}</text>
  23. </view>
  24. <text
  25. class="address flex">{{ addressData.province + addressData.city + addressData.district }}{{ addressData.detail }}</text>
  26. </view>
  27. <text class="iconfont iconenter"></text>
  28. </view>
  29. <view class="order-content" v-if="!addressData.real_name">
  30. <view class="addAddress">
  31. <text></text>
  32. <text>添加收货地址</text>
  33. </view>
  34. </view>
  35. </navigator>
  36. <navigator url="/pages/order/shopList?type=1" class="address-section">
  37. <view class="shop-box" v-if="shopAddress.name">
  38. <view class="shop-top flex">
  39. <view class="flex shop-title">
  40. <image class="shopImg" :src="shopAddress.image" mode="scaleToFill"></image>
  41. <view class="shop-name clamp2">{{ shopAddress.name }}</view>
  42. </view>
  43. <view class="shop-tip">
  44. 门店
  45. </view>
  46. </view>
  47. <view class="shop-content margin-t-10">
  48. <view class="shop-address">
  49. 电话:{{ shopAddress.phone }}
  50. </view>
  51. <text class="shop-address">
  52. 地区:{{shopAddress.address+shopAddress.detailed_address}}
  53. </text>
  54. </view>
  55. </view>
  56. <view class="order-content" v-if="!shopAddress.name">
  57. <view class="addAddress">
  58. <text></text>
  59. <text>添加收货地址</text>
  60. </view>
  61. </view>
  62. </navigator>
  63. <view class="goodsList">
  64. <view class="goods-section" v-for="(ls, ind) in shopList" :key="ind">
  65. <!-- 商品列表 -->
  66. <view class="g-item">
  67. <image :src="ls.productInfo.image"></image>
  68. <view class="right">
  69. <text class="title clamp">{{ ls.productInfo.store_name }}</text>
  70. <text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text>
  71. <view class="price-box">
  72. <text
  73. class="price">¥{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
  74. <text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
  75. </view>
  76. <view class="serverSet" v-if="ls.day>0">
  77. (<text>服务费:{{ls.day_deducted}}</text>
  78. <text class="margin-l-10">服务天数:{{ls.day}}天</text>)
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <!-- 金额明细 -->
  85. <view class="yt-list">
  86. <view class="yt-list-cell b-b" v-if="certificate_info.num>0">
  87. <text class="cell-tit clamp">使用卡券({{certificate_info.num}})</text>
  88. <view class="desc">
  89. <switch class="switchCard" :checked='certificate_info.checked' style="transform:scale(0.7)"
  90. @change="switchChange" />
  91. </view>
  92. </view>
  93. <template v-if="tabCurrentIndex == 1">
  94. <view class="yt-list-cell b-b">
  95. <text class="cell-tit clamp">送货日期</text>
  96. <view @click="openTime" class="desc">
  97. <text v-if="day.day">
  98. {{timeList[checkedTime].name+day.time}}
  99. </text>
  100. <text v-else>
  101. 请选择送货日期
  102. </text>
  103. </view>
  104. </view>
  105. </template>
  106. <template v-if="tabCurrentIndex == 2">
  107. <view class="yt-list-cell b-b">
  108. <text class="cell-tit clamp">姓名</text>
  109. <input class="desc" type="text" v-model="addressData.real_name" placeholder="请填写姓名"
  110. placeholder-class="placeholder" />
  111. </view>
  112. <view class="yt-list-cell b-b">
  113. <text class="cell-tit clamp">手机号</text>
  114. <input class="desc" type="text" v-model="addressData.phone" placeholder="请填写手机号"
  115. placeholder-class="placeholder" />
  116. </view>
  117. </template>
  118. <view class="yt-list-cell b-b">
  119. <text class="cell-tit clamp">运费</text>
  120. <text class="cell-tip disabled">{{ Postage }}</text>
  121. </view>
  122. <view class="yt-list-cell b-b">
  123. <text class="cell-tit clamp">备注</text>
  124. <input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />
  125. </view>
  126. </view>
  127. <view class="yt-list">
  128. <view class="yt-list-cell b-b" @click="payType='weixin'">
  129. <view class="cell-tit flex">
  130. <image class="orderIcon" src="../../static/icon/orderWx.png" mode="widthFix"></image>
  131. <text class="margin-l-10">微信支付</text>
  132. </view>
  133. <image class="checked" v-if="payType=='weixin'" src="../../static/icon/addressIconXz.png"
  134. mode="widthFix"></image>
  135. <view v-else class="noChecked"></view>
  136. </view>
  137. <!-- #ifdef APP-PLUS -->
  138. <view class="yt-list-cell b-b" @click="payType='ali'">
  139. <view class="cell-tit flex">
  140. <image class="orderIcon" src="../../static/icon/orderAli.png" mode="widthFix"></image>
  141. <text class="margin-l-10">支付宝</text>
  142. </view>
  143. <image class="checked" v-if="payType=='ali'" src="../../static/icon/addressIconXz.png" mode="widthFix">
  144. </image>
  145. <view v-else class="noChecked"></view>
  146. </view>
  147. <!-- #endif -->
  148. <view class="yt-list-cell b-b" @click="payType='yue'">
  149. <view class="cell-tit flex">
  150. <image class="orderIcon" src="../../static/icon/ye.png" mode="widthFix"></image>
  151. <text class="margin-l-10">余额({{now_money}})</text>
  152. </view>
  153. <image class="checked" v-if="payType=='yue'" src="../../static/icon/addressIconXz.png" mode="widthFix">
  154. </image>
  155. <view v-else class="noChecked"></view>
  156. </view>
  157. <view class="yt-list-cell b-b" v-if="!certificate_info.checked" @click="payType='offline'">
  158. <view class="cell-tit flex">
  159. <image class="orderIcon" src="../../static/icon/yh.png" mode="widthFix"></image>
  160. <text class="margin-l-10">线下支付</text>
  161. </view>
  162. <image class="checked" v-if="payType=='offline'" src="../../static/icon/addressIconXz.png"
  163. mode="widthFix">
  164. </image>
  165. <view v-else class="noChecked"></view>
  166. </view>
  167. </view>
  168. <!-- 底部 -->
  169. <view class="footer">
  170. <view class="price-content">
  171. <text>实付款</text>
  172. <text class="price-tip">¥</text>
  173. <text class="price">{{ payPrice }}</text>
  174. </view>
  175. <text class="submit" :class="{submitNo:payLoding}" @click="payLoding?'':submit()">提交订单</text>
  176. </view>
  177. <uni-popup class="alertTime" ref="popup" type="bottom">
  178. <view class="alert-box position-relative">
  179. <view class="alert-title ">
  180. 选择预计送达时间
  181. </view>
  182. <view class="tip iconfont iconclose" @click="$refs.popup.close()"></view>
  183. <view class="flex">
  184. <view class="left-title">
  185. <view class="title" :class="{action:checkedTime==ind}" v-for="(item,ind) in timeList"
  186. @click="changeCheckedTime(item,ind)">
  187. {{item.name+'('+item.day+')'}}
  188. </view>
  189. </view>
  190. <view class="right-content">
  191. <view class="list flex" v-for="(item,ind) in timeList[checkedTime].list"
  192. @click="checkedShopTime(item)">
  193. <view class="time">
  194. {{item.time}}
  195. </view>
  196. <view class="checked">
  197. 剩余:{{item.door_number-item.day_number}}
  198. </view>
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. </uni-popup>
  204. </view>
  205. </template>
  206. <script>
  207. import {
  208. mapState
  209. } from 'vuex';
  210. import {
  211. confirm,
  212. computedOrderkey,
  213. createOrderkey,
  214. orderPay
  215. } from '@/api/order.js';
  216. import {
  217. getUserInfo
  218. } from '@/api/user.js';
  219. import {
  220. storeday
  221. } from '@/api/water.js';
  222. // #ifdef H5
  223. import weixinObj from "@/plugin/jweixin-module/index.js";
  224. // #endif
  225. export default {
  226. data() {
  227. return {
  228. tabCurrentIndex: 1, //1为自提2为配送
  229. // #ifdef APP
  230. payType: 'ali',
  231. // #ifndef
  232. // #ifndef APP
  233. payType: 'weixin',
  234. // #ifndef
  235. desc: '', //备注
  236. // 收货地址
  237. addressData: {},
  238. // 店铺地址
  239. shopAddress: {
  240. name: '',
  241. mobile: '',
  242. addressName: '',
  243. address: '',
  244. area: '',
  245. default: false,
  246. id: ''
  247. },
  248. // 商品列表
  249. shopList: [],
  250. // 购物车id
  251. cartId: '',
  252. //购物金额详情
  253. moneyAll: {
  254. storeFreePostage: 0, //邮费优惠
  255. storePostage: 0, //邮费
  256. totalPrice: 0, //总支付金额
  257. vipPrice: 0 //vip优惠价
  258. },
  259. payPrice: 0, //总支付金额
  260. orderKey: '', //订单id
  261. payLoding: false, //判断是否支付中
  262. orderId: '', //订单id
  263. now_money: 0, //余额
  264. onShopId: -1, //默认-1为不存在商家id
  265. // 下单日期
  266. day: {
  267. day: '',
  268. id: '',
  269. time: ''
  270. },
  271. // 当前选中的日期对象
  272. checkedTime: 0,
  273. // 保存每周日子
  274. timeName: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  275. // 保存日期列表
  276. timeList: [{
  277. name: '今天',
  278. day: '',
  279. time: '',
  280. list: []
  281. }, {
  282. name: '明天',
  283. day: '',
  284. time: '',
  285. list: []
  286. }, {
  287. name: '',
  288. day: '',
  289. time: '',
  290. list: []
  291. }, {
  292. name: '',
  293. day: '',
  294. time: '',
  295. list: []
  296. }],
  297. // 可使用的水票
  298. certificate_info: {
  299. id: '',
  300. num: 0,
  301. checked: false
  302. }
  303. };
  304. },
  305. watch: {
  306. shopAddress(newValue, oldValue) {
  307. console.log(newValue, 'newValue');
  308. for (let i = 0; i < this.timeList.length; i++) {
  309. const item = this.timeList[i];
  310. const day = `${item.time.getFullYear()}-${item.time.getMonth()+1}-${item.time.getDate()}`
  311. storeday({
  312. store_id: newValue.id,
  313. day
  314. }).then(({
  315. data
  316. }) => {
  317. item.list = data;
  318. });
  319. }
  320. }
  321. },
  322. onLoad(option) {
  323. // 保存当前商品在购物车中的id
  324. this.cartId = option.id;
  325. // 判断是否要读取商家id
  326. if (option.shopId) {
  327. this.onShopId = option.shopId;
  328. }
  329. this.loadData();
  330. this.userinfo();
  331. // 初始化送货时间
  332. this.timeInit();
  333. },
  334. computed: {
  335. // 计算是否免运费
  336. Postage() {
  337. let money = +this.moneyAll.storePostage;
  338. if (money == 0) {
  339. return '免运费';
  340. } else {
  341. return '¥' + money;
  342. }
  343. },
  344. payAllMoney() {
  345. return +this.moneyAll.totalPrice + +this.moneyAll.vipPrice;
  346. },
  347. ...mapState('shop', ['shopDetail'])
  348. },
  349. methods: {
  350. // 是否使用卡券切换
  351. switchChange(res) {
  352. this.certificate_info.checked = res.detail.value;
  353. if (this.payType == 'offline') {
  354. this.payType = 'weixin'
  355. }
  356. // 重新计算价格
  357. this.payMoneyNub();
  358. },
  359. checkedShopTime(item) {
  360. if (item.door_number - item.day_number == 0) {
  361. uni.showModal({
  362. title: '提示',
  363. content: '该时间段预约已满!',
  364. showCancel: false,
  365. });
  366. return
  367. }
  368. this.day = item;
  369. this.$refs.popup.close();
  370. },
  371. // 选中的时间对象
  372. changeCheckedTime(item, ind) {
  373. this.checkedTime = ind;
  374. },
  375. // 打开弹窗
  376. openTime() {
  377. // 打开弹出窗
  378. this.$refs.popup.open();
  379. },
  380. // 初始化送货时间
  381. timeInit() {
  382. // 保存当前时间
  383. const startTime = new Date();
  384. for (let i = 0; i < this.timeList.length; i++) {
  385. const item = this.timeList[i]
  386. // 保存今天时间戳
  387. item.time = new Date(startTime.getTime() + 86400000 * i);
  388. // 获取今日周几
  389. item.day = this.timeName[item.time.getDay()];
  390. if (!item.name) {
  391. // 获取今日日期
  392. item.name = `${item.time.getMonth()+1}月${item.time.getDate()}日`
  393. }
  394. }
  395. console.log(this.timeList, 'this.timeList');
  396. },
  397. // 送货时间修改
  398. changeTime(res) {
  399. console.log(res);
  400. },
  401. // 加载用户基础信息
  402. userinfo() {
  403. getUserInfo({}).then(({
  404. data
  405. }) => {
  406. this.now_money = data.now_money;
  407. });
  408. },
  409. // 计算支付金额
  410. payMoneyNub() {
  411. let updata = {
  412. orderkey: this.orderKey,
  413. useIntegral: 0, //是否积分抵扣
  414. addressId: this.addressData.id //地址编号
  415. }
  416. // 判断是卡券支付
  417. if (this.certificate_info.checked) {
  418. updata.use_certificate_id = this.certificate_info.id
  419. }
  420. computedOrderkey(updata)
  421. .then(({
  422. data
  423. }) => {
  424. this.integralShow = true;
  425. // 获取支付金额
  426. this.payPrice = +data.result.pay_price;
  427. this.integralMoney = data.result.deduction_price;
  428. })
  429. .catch(e => {
  430. console.log(e);
  431. this.integralShow = false;
  432. });
  433. },
  434. // 加载基础数据
  435. loadData() {
  436. let obj = this;
  437. confirm({
  438. cartId: obj.cartId + '',
  439. longitude: uni.getStorageSync('CACHE_LONGITUDE'),
  440. latitude: uni.getStorageSync('CACHE_LATITUDE'),
  441. }).then(({
  442. data
  443. }) => {
  444. obj.certificate_info.id = data.certificate_info.id;
  445. obj.certificate_info.num = data.certificate_info.num;
  446. obj.addressData = data.addressInfo || {};
  447. obj.shopList = data.cartInfo; //商品列表
  448. obj.moneyAll = data.priceGroup; //金额数据
  449. obj.orderKey = data.orderKey; //订单key
  450. obj.shopAddress = data.system_store; //到店自提列表
  451. obj.shopAddress.address = data.system_store.address.join(','); //到店自提列表
  452. // 计算金额
  453. this.payMoneyNub();
  454. });
  455. },
  456. // 提交订单
  457. submit() {
  458. let obj = this;
  459. if (!this.addressData.real_name) {
  460. this.$api.msg('请选择收货地址');
  461. return false;
  462. }
  463. // 判断是否余额不足
  464. if (obj.payType == 'yue' && +obj.now_money < obj.payPrice) {
  465. uni.showModal({
  466. title: '提示',
  467. content: '账户余额不足!',
  468. showCancel: false,
  469. });
  470. return;
  471. }
  472. if (!obj.day.day&&obj.tabCurrentIndex==1) {
  473. uni.showModal({
  474. title: '提示',
  475. content: '请选择送水时间!',
  476. showCancel: false,
  477. });
  478. return
  479. }
  480. uni.showLoading({
  481. title: '支付中',
  482. mask: true
  483. })
  484. // 支付中
  485. obj.payLoding = true;
  486. // 判断是否为未支付订单中跳转进入
  487. obj.firstCreateOrder();
  488. },
  489. // 订单金额支付
  490. orderMoneyPay() {
  491. let obj = this;
  492. orderPay({
  493. uni: obj.orderId,
  494. // #ifdef H5
  495. from: 'weixin', //来源
  496. // #endif
  497. // #ifdef MP-WEIXIN
  498. from: 'routine', //来源
  499. // #endif
  500. // #ifdef APP-PLUS
  501. from: 'app', //来源
  502. // #endif
  503. paytype: obj.payType //支付类型 weixin-微信 yue-余额
  504. })
  505. .then(e => {
  506. // 判断是否微信小程序支付
  507. if (obj.payType == 'weixin') {
  508. // #ifdef H5 || MP
  509. let da = e.data.result.jsConfig;
  510. let data = {
  511. nonceStr: da.nonceStr,
  512. package: da.package,
  513. signType: da.signType,
  514. paySign: da.paySign,
  515. success: function(res) {
  516. obj.paySuccessTo();
  517. },
  518. fail: () => {
  519. uni.navigateTo({
  520. url: '/pages/order/order?state=0'
  521. });
  522. }
  523. };
  524. // #endif
  525. // #ifdef H5
  526. data.timestamp = da.timestamp;
  527. weixinObj.chooseWXPay(data);
  528. // #endif
  529. // #ifdef MP-WEIXIN
  530. data.timeStamp = da.timestamp;
  531. wx.requestPayment(data);
  532. // #endif
  533. // #ifdef APP
  534. console.log(e.data.result.jsConfig, '返回数值');
  535. uni.requestPayment({
  536. provider: 'wxpay',
  537. orderInfo: e.data.result.jsConfig,
  538. success(e) {
  539. obj.paySuccessTo();
  540. },
  541. fail: (e) => {
  542. console.log(e, '支付失败');
  543. uni.navigateTo({
  544. url: '/pages/order/order?state=0'
  545. });
  546. }
  547. })
  548. // #endif
  549. }
  550. // #ifdef APP
  551. if (obj.payType == 'ali') {
  552. uni.requestPayment({
  553. provider: 'alipay',
  554. orderInfo: e.data.result.jsConfig,
  555. success(e) {
  556. obj.paySuccessTo();
  557. },
  558. fail: (e) => {
  559. console.log(e, '支付失败');
  560. uni.navigateTo({
  561. url: '/pages/order/order?state=0'
  562. });
  563. }
  564. })
  565. }
  566. // #endif
  567. uni.hideLoading();
  568. obj.payLoding = false;
  569. })
  570. .catch(e => {
  571. // 支付完成
  572. uni.hideLoading();
  573. obj.payLoding = false;
  574. console.log(e);
  575. });
  576. },
  577. // 支付成功跳转
  578. paySuccessTo() {
  579. uni.hideLoading();
  580. uni.redirectTo({
  581. url: '/pages/user/money/paySuccess?orderid=' + this.orderId,
  582. });
  583. },
  584. // 初次订单创建
  585. firstCreateOrder() {
  586. let obj = this;
  587. console.log(obj.day, 'obj.day');
  588. let data = {
  589. real_name: obj.addressData.real_name, //联系人名称
  590. phone: obj.addressData.phone, //联系人号码
  591. addressId: obj.addressData.id, //支付地址id
  592. useIntegral: 0, //是否积分抵扣1为是0为否
  593. payType: obj.payType, //支付类型 weixin-微信 yue-余额
  594. mark: obj.desc, //备注
  595. // #ifdef H5
  596. from: 'weixin', //来源
  597. // #endif
  598. // #ifdef MP-WEIXIN
  599. from: 'routine', //来源
  600. // #endif
  601. // #ifdef APP-PLUS
  602. from: 'app', //来源
  603. // #endif
  604. shipping_type: obj.tabCurrentIndex, //提货方式 1 快递 2自提
  605. store_id: obj.shopAddress.id || '',
  606. day: obj.day.day,
  607. door_id: obj.day.door_id
  608. };
  609. if (obj.certificate_info.checked) {
  610. data.use_certificate_id = obj.certificate_info.id
  611. }
  612. // 生成订单
  613. createOrderkey(data, obj.orderKey)
  614. .then(({
  615. data,
  616. status,
  617. msg
  618. }) => {
  619. // 判断是否支付失败
  620. if (data.status == 'ORDER_EXIST') {
  621. uni.showModal({
  622. title: '提示',
  623. content: msg,
  624. showCancel: false
  625. });
  626. uni.hideLoading();
  627. obj.payLoding = false;
  628. return;
  629. }
  630. // 保存订单号
  631. obj.orderId = data.result.orderId;
  632. // 判断是否为余额支付
  633. if (obj.payType == 'yue' || obj.payType == 'offline') {
  634. console.log('余额支付', status == 200 && data.status == 'SUCCESS');
  635. if (status == 200 && data.status == 'SUCCESS') {
  636. obj.paySuccessTo();
  637. } else {
  638. obj.$api.msg(msg);
  639. }
  640. } else {
  641. // 立即支付
  642. obj.orderMoneyPay();
  643. }
  644. })
  645. .catch(e => {
  646. uni.hideLoading();
  647. obj.payLoding = false;
  648. console.log(e);
  649. });
  650. }
  651. }
  652. };
  653. </script>
  654. <style lang="scss">
  655. .content {
  656. padding-bottom: 100rpx;
  657. }
  658. .address-section {
  659. border-radius: 20rpx;
  660. padding: 30rpx;
  661. margin: 0 $page-row-spacing;
  662. background: #fff;
  663. position: relative;
  664. .order-content {
  665. min-height: 100rpx;
  666. display: flex;
  667. align-items: center;
  668. .leftIcon {
  669. width: 36rpx;
  670. margin: 0 30rpx;
  671. }
  672. .addAddress {
  673. text-align: center;
  674. width: 100%;
  675. display: flex;
  676. justify-content: center;
  677. align-items: center;
  678. }
  679. }
  680. .cen {
  681. display: flex;
  682. flex-direction: column;
  683. font-size: 28rpx;
  684. color: $font-color-dark;
  685. width: 0px;
  686. flex-grow: 1;
  687. }
  688. .name {
  689. font-size: 34rpx;
  690. margin-right: 24rpx;
  691. }
  692. .address {
  693. margin-top: 16rpx;
  694. margin-right: 20rpx;
  695. color: $font-color-light;
  696. }
  697. }
  698. .goodsList {
  699. margin: 0 $page-row-spacing;
  700. padding: 30rpx;
  701. background: #fff;
  702. border-radius: 20rpx;
  703. margin-top: 30rpx;
  704. }
  705. .goods-section {
  706. .logo {
  707. display: block;
  708. width: 50rpx;
  709. height: 50rpx;
  710. border-radius: 100px;
  711. }
  712. .name {
  713. font-size: 30rpx;
  714. color: $font-color-base;
  715. margin-left: 24rpx;
  716. }
  717. .g-item {
  718. display: flex;
  719. image {
  720. flex-shrink: 0;
  721. display: block;
  722. width: 170rpx;
  723. height: 170rpx;
  724. border-radius: 4rpx;
  725. }
  726. .right {
  727. flex: 1;
  728. padding-left: 24rpx;
  729. overflow: hidden;
  730. .serverSet {
  731. font-size: 22rpx;
  732. color: $font-color-light;
  733. }
  734. }
  735. .title {
  736. font-size: 30rpx;
  737. color: $font-color-dark;
  738. }
  739. .spec {
  740. font-size: 26rpx;
  741. color: $font-color-light;
  742. }
  743. .price-box {
  744. display: flex;
  745. align-items: center;
  746. font-size: 32rpx;
  747. padding-top: 10rpx;
  748. color: $font-color-light;
  749. .price {
  750. margin-bottom: 4rpx;
  751. }
  752. .number {
  753. font-size: 26rpx;
  754. margin-left: 20rpx;
  755. }
  756. }
  757. .step-box {
  758. position: relative;
  759. }
  760. }
  761. }
  762. .yt-list {
  763. background: #fff;
  764. margin: 0 $page-row-spacing;
  765. margin-top: 30rpx;
  766. border-radius: 20rpx;
  767. }
  768. .yt-list-cell {
  769. display: flex;
  770. align-items: center;
  771. justify-content: space-between;
  772. padding: 10rpx 30rpx 10rpx 40rpx;
  773. line-height: 70rpx;
  774. position: relative;
  775. .checked,
  776. .noChecked {
  777. width: 36rpx;
  778. height: 36rpx;
  779. }
  780. .noChecked {
  781. border: 1px solid $font-color-light;
  782. border-radius: 100rpx;
  783. }
  784. &.cell-hover {
  785. background: #fafafa;
  786. }
  787. &.b-b:after {
  788. left: 30rpx;
  789. }
  790. .cell-icon {
  791. height: 32rpx;
  792. width: 32rpx;
  793. font-size: 22rpx;
  794. color: #fff;
  795. text-align: center;
  796. line-height: 32rpx;
  797. background: #f85e52;
  798. border-radius: 4rpx;
  799. margin-right: 12rpx;
  800. &.hb {
  801. background: #ffaa0e;
  802. }
  803. &.lpk {
  804. background: #3ab54a;
  805. }
  806. }
  807. .cell-more {
  808. align-self: center;
  809. font-size: 24rpx;
  810. color: $font-color-light;
  811. margin-left: 8rpx;
  812. margin-right: -10rpx;
  813. }
  814. .cell-tit {
  815. font-size: 26rpx;
  816. color: $font-color-light;
  817. margin-right: 10rpx;
  818. .orderIcon {
  819. width: 48rpx;
  820. }
  821. }
  822. .cell-tip {
  823. font-size: 26rpx;
  824. color: $font-color-dark;
  825. &.disabled {
  826. color: $font-color-light;
  827. }
  828. &.active {
  829. color: $base-color;
  830. }
  831. &.red {
  832. color: $base-color;
  833. }
  834. }
  835. &.desc-cell {
  836. .cell-tit {
  837. max-width: 90rpx;
  838. }
  839. }
  840. .desc {
  841. text-align: right;
  842. font-size: $font-base;
  843. color: $font-color-light;
  844. .switchCard {
  845. margin-right: -20rpx;
  846. }
  847. }
  848. }
  849. /* 支付列表 */
  850. .pay-list {
  851. padding-left: 40rpx;
  852. margin-top: 16rpx;
  853. background: #fff;
  854. .pay-item {
  855. display: flex;
  856. align-items: center;
  857. padding-right: 20rpx;
  858. line-height: 1;
  859. height: 110rpx;
  860. position: relative;
  861. }
  862. .icon-weixinzhifu {
  863. width: 80rpx;
  864. font-size: 40rpx;
  865. color: #6bcc03;
  866. }
  867. .icon-alipay {
  868. width: 80rpx;
  869. font-size: 40rpx;
  870. color: #06b4fd;
  871. }
  872. .icon-xuanzhong2 {
  873. display: flex;
  874. align-items: center;
  875. justify-content: center;
  876. width: 60rpx;
  877. height: 60rpx;
  878. font-size: 40rpx;
  879. color: $base-color;
  880. }
  881. .tit {
  882. font-size: 32rpx;
  883. color: $font-color-dark;
  884. flex: 1;
  885. }
  886. }
  887. .footer {
  888. position: fixed;
  889. left: 0;
  890. bottom: 0;
  891. z-index: 995;
  892. display: flex;
  893. align-items: center;
  894. width: 100%;
  895. height: 90rpx;
  896. justify-content: space-between;
  897. font-size: 30rpx;
  898. background-color: #fff;
  899. z-index: 998;
  900. color: $font-color-base;
  901. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  902. .price-content {
  903. padding-left: 30rpx;
  904. }
  905. .price-tip {
  906. color: $font-color-base;
  907. margin-left: 8rpx;
  908. }
  909. .price {
  910. font-size: 36rpx;
  911. color: $font-color-base;
  912. }
  913. .submit {
  914. display: flex;
  915. align-items: center;
  916. justify-content: center;
  917. width: 280rpx;
  918. height: 100%;
  919. color: #fff;
  920. font-size: 32rpx;
  921. background: $bg-gradual;
  922. &.submitNo {
  923. background-color: $font-color-disabled;
  924. }
  925. }
  926. }
  927. .tab-address {
  928. margin-bottom: 30rpx;
  929. margin-top: 0;
  930. .left {
  931. font-size: $font-base;
  932. }
  933. .right {
  934. font-size: $font-sm;
  935. color: #FFF;
  936. background: $bg-gradual;
  937. padding: 6rpx;
  938. border-radius: 10rpx;
  939. line-height: 1;
  940. .item {
  941. padding: 16rpx 20rpx;
  942. &.action {
  943. color: $uni-color-primary;
  944. background-color: #FFF;
  945. border-radius: 10rpx;
  946. }
  947. }
  948. }
  949. }
  950. .shop-box {
  951. .shop-top {
  952. width: 100%;
  953. .shop-title {
  954. width: 0px;
  955. flex-grow: 1;
  956. justify-content: flex-start;
  957. .shopImg {
  958. height: 65rpx;
  959. width: 65rpx;
  960. border-radius: 100rpx;
  961. margin-right: 20rpx;
  962. flex-shrink: 0;
  963. }
  964. .shop-name {
  965. font-weight: bold;
  966. font-size: $font-lg;
  967. }
  968. }
  969. .shop-tip {
  970. color: #FFF;
  971. padding: 5rpx 10rpx;
  972. font-size: $font-sm;
  973. background: linear-gradient(-90deg, #DCB876 0%, #EECD92 100%);
  974. border-radius: 5rpx;
  975. }
  976. }
  977. .shop-content {
  978. color: $font-color-light;
  979. font-size: $font-sm;
  980. }
  981. }
  982. .alertTime {
  983. z-index: 1000;
  984. .alert-box {
  985. background-color: #FFF;
  986. border-top-right-radius: 20rpx;
  987. border-top-left-radius: 20rpx;
  988. min-height: 70vh;
  989. .right-content {
  990. width: 70%;
  991. .list {
  992. padding: 20rpx 30rpx;
  993. font-size: $font-sm;
  994. border-bottom: 1px solid $border-color-light;
  995. }
  996. }
  997. .left-title {
  998. width: 30%;
  999. align-self: flex-start;
  1000. .title {
  1001. padding: 30rpx;
  1002. text-align: center;
  1003. font-weight: bold;
  1004. font-size: $font-sm;
  1005. background-color: rgba(246, 246, 246, 1);
  1006. &.action {
  1007. background-color: #FFF;
  1008. }
  1009. }
  1010. }
  1011. .alert-title {
  1012. text-align: center;
  1013. padding: 30rpx;
  1014. line-height: 1;
  1015. font-weight: bold;
  1016. }
  1017. .tip {
  1018. position: absolute;
  1019. top: 30rpx;
  1020. right: 30rpx;
  1021. color: $font-color-disabled;
  1022. font-weight: bold;
  1023. }
  1024. }
  1025. }
  1026. /deep/ .uni-switch-input {
  1027. &.uni-switch-input-checked {
  1028. border-color: $base-color !important;
  1029. background-color: $base-color !important;
  1030. }
  1031. }
  1032. </style>