createOrder.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  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. // #endif
  232. // #ifndef APP
  233. payType: 'weixin',
  234. // #endif
  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. },
  348. methods: {
  349. // 是否使用卡券切换
  350. switchChange(res) {
  351. this.certificate_info.checked = res.detail.value;
  352. if (this.payType == 'offline') {
  353. this.payType = 'weixin'
  354. }
  355. // 重新计算价格
  356. this.payMoneyNub();
  357. },
  358. checkedShopTime(item) {
  359. if (item.door_number - item.day_number == 0) {
  360. uni.showModal({
  361. title: '提示',
  362. content: '该时间段预约已满!',
  363. showCancel: false,
  364. });
  365. return
  366. }
  367. this.day = item;
  368. this.$refs.popup.close();
  369. },
  370. // 选中的时间对象
  371. changeCheckedTime(item, ind) {
  372. this.checkedTime = ind;
  373. },
  374. // 打开弹窗
  375. openTime() {
  376. // 打开弹出窗
  377. this.$refs.popup.open();
  378. },
  379. // 初始化送货时间
  380. timeInit() {
  381. // 保存当前时间
  382. const startTime = new Date();
  383. for (let i = 0; i < this.timeList.length; i++) {
  384. const item = this.timeList[i]
  385. // 保存今天时间戳
  386. item.time = new Date(startTime.getTime() + 86400000 * i);
  387. // 获取今日周几
  388. item.day = this.timeName[item.time.getDay()];
  389. if (!item.name) {
  390. // 获取今日日期
  391. item.name = `${item.time.getMonth()+1}月${item.time.getDate()}日`
  392. }
  393. }
  394. console.log(this.timeList, 'this.timeList');
  395. },
  396. // 送货时间修改
  397. changeTime(res) {
  398. console.log(res);
  399. },
  400. // 加载用户基础信息
  401. userinfo() {
  402. getUserInfo({}).then(({
  403. data
  404. }) => {
  405. this.now_money = data.now_money;
  406. });
  407. },
  408. // 计算支付金额
  409. payMoneyNub() {
  410. let updata = {
  411. orderkey: this.orderKey,
  412. useIntegral: 0, //是否积分抵扣
  413. addressId: this.addressData.id //地址编号
  414. }
  415. // 判断是卡券支付
  416. if (this.certificate_info.checked) {
  417. updata.use_certificate_id = this.certificate_info.id
  418. }
  419. computedOrderkey(updata)
  420. .then(({
  421. data
  422. }) => {
  423. this.integralShow = true;
  424. // 获取支付金额
  425. this.payPrice = +data.result.pay_price;
  426. this.integralMoney = data.result.deduction_price;
  427. })
  428. .catch(e => {
  429. console.log(e);
  430. this.integralShow = false;
  431. });
  432. },
  433. // 加载基础数据
  434. loadData() {
  435. let obj = this;
  436. confirm({
  437. cartId: obj.cartId + '',
  438. longitude: uni.getStorageSync('CACHE_LONGITUDE'),
  439. latitude: uni.getStorageSync('CACHE_LATITUDE'),
  440. }).then(({
  441. data
  442. }) => {
  443. obj.certificate_info.id = data.certificate_info.id;
  444. obj.certificate_info.num = data.certificate_info.num;
  445. obj.addressData = data.addressInfo || {};
  446. obj.shopList = data.cartInfo; //商品列表
  447. obj.moneyAll = data.priceGroup; //金额数据
  448. obj.orderKey = data.orderKey; //订单key
  449. obj.shopAddress = data.system_store; //到店自提列表
  450. obj.shopAddress.address = data.system_store.address.join(','); //到店自提列表
  451. // 计算金额
  452. this.payMoneyNub();
  453. });
  454. },
  455. // 提交订单
  456. submit() {
  457. let obj = this;
  458. if (!this.addressData.real_name) {
  459. this.$api.msg('请选择收货地址');
  460. return false;
  461. }
  462. // 判断是否余额不足
  463. if (obj.payType == 'yue' && +obj.now_money < obj.payPrice) {
  464. uni.showModal({
  465. title: '提示',
  466. content: '账户余额不足!',
  467. showCancel: false,
  468. });
  469. return;
  470. }
  471. if (!obj.day.day&&obj.tabCurrentIndex==1) {
  472. uni.showModal({
  473. title: '提示',
  474. content: '请选择送水时间!',
  475. showCancel: false,
  476. });
  477. return
  478. }
  479. uni.showLoading({
  480. title: '支付中',
  481. mask: true
  482. })
  483. // 支付中
  484. obj.payLoding = true;
  485. // 判断是否为未支付订单中跳转进入
  486. obj.firstCreateOrder();
  487. },
  488. // 订单金额支付
  489. orderMoneyPay() {
  490. let obj = this;
  491. orderPay({
  492. uni: obj.orderId,
  493. // #ifdef H5
  494. from: 'weixin', //来源
  495. // #endif
  496. // #ifdef MP-WEIXIN
  497. from: 'routine', //来源
  498. // #endif
  499. // #ifdef APP-PLUS
  500. from: 'app', //来源
  501. // #endif
  502. paytype: obj.payType //支付类型 weixin-微信 yue-余额
  503. })
  504. .then(e => {
  505. // 判断是否微信小程序支付
  506. if (obj.payType == 'weixin') {
  507. // #ifdef H5 || MP
  508. let da = e.data.result.jsConfig;
  509. let data = {
  510. nonceStr: da.nonceStr,
  511. package: da.package,
  512. signType: da.signType,
  513. paySign: da.paySign,
  514. success: function(res) {
  515. obj.paySuccessTo();
  516. },
  517. fail: () => {
  518. uni.navigateTo({
  519. url: '/pages/order/order?state=0'
  520. });
  521. }
  522. };
  523. // #endif
  524. // #ifdef H5
  525. data.timestamp = da.timestamp;
  526. weixinObj.chooseWXPay(data);
  527. // #endif
  528. // #ifdef MP-WEIXIN
  529. data.timeStamp = da.timestamp;
  530. wx.requestPayment(data);
  531. // #endif
  532. // #ifdef APP
  533. console.log(e.data.result.jsConfig, '返回数值');
  534. uni.requestPayment({
  535. provider: 'wxpay',
  536. orderInfo: e.data.result.jsConfig,
  537. success(e) {
  538. obj.paySuccessTo();
  539. },
  540. fail: (e) => {
  541. console.log(e, '支付失败');
  542. uni.navigateTo({
  543. url: '/pages/order/order?state=0'
  544. });
  545. }
  546. })
  547. // #endif
  548. }
  549. // #ifdef APP
  550. if (obj.payType == 'ali') {
  551. uni.requestPayment({
  552. provider: 'alipay',
  553. orderInfo: e.data.result.jsConfig,
  554. success(e) {
  555. obj.paySuccessTo();
  556. },
  557. fail: (e) => {
  558. console.log(e, '支付失败');
  559. uni.navigateTo({
  560. url: '/pages/order/order?state=0'
  561. });
  562. }
  563. })
  564. }
  565. // #endif
  566. uni.hideLoading();
  567. obj.payLoding = false;
  568. })
  569. .catch(e => {
  570. // 支付完成
  571. uni.hideLoading();
  572. obj.payLoding = false;
  573. console.log(e);
  574. });
  575. },
  576. // 支付成功跳转
  577. paySuccessTo() {
  578. uni.hideLoading();
  579. uni.redirectTo({
  580. url: '/pages/user/money/paySuccess?orderid=' + this.orderId,
  581. });
  582. },
  583. // 初次订单创建
  584. firstCreateOrder() {
  585. let obj = this;
  586. console.log(obj.day, 'obj.day');
  587. let data = {
  588. real_name: obj.addressData.real_name, //联系人名称
  589. phone: obj.addressData.phone, //联系人号码
  590. addressId: obj.addressData.id, //支付地址id
  591. useIntegral: 0, //是否积分抵扣1为是0为否
  592. payType: obj.payType, //支付类型 weixin-微信 yue-余额
  593. mark: obj.desc, //备注
  594. // #ifdef H5
  595. from: 'weixin', //来源
  596. // #endif
  597. // #ifdef MP-WEIXIN
  598. from: 'routine', //来源
  599. // #endif
  600. // #ifdef APP-PLUS
  601. from: 'app', //来源
  602. // #endif
  603. shipping_type: obj.tabCurrentIndex, //提货方式 1 快递 2自提
  604. store_id: obj.shopAddress.id || '',
  605. day: obj.day.day,
  606. door_id: obj.day.door_id
  607. };
  608. if (obj.certificate_info.checked) {
  609. data.use_certificate_id = obj.certificate_info.id
  610. }
  611. // 生成订单
  612. createOrderkey(data, obj.orderKey)
  613. .then(({
  614. data,
  615. status,
  616. msg
  617. }) => {
  618. // 判断是否支付失败
  619. if (data.status == 'ORDER_EXIST') {
  620. uni.showModal({
  621. title: '提示',
  622. content: msg,
  623. showCancel: false
  624. });
  625. uni.hideLoading();
  626. obj.payLoding = false;
  627. return;
  628. }
  629. // 保存订单号
  630. obj.orderId = data.result.orderId;
  631. if(obj.certificate_info.checked&&obj.payPrice==0){
  632. if (status == 200 && data.status == 'SUCCESS') {
  633. obj.paySuccessTo();
  634. } else {
  635. obj.$api.msg(msg);
  636. }
  637. return
  638. }
  639. // 判断是否为余额支付
  640. if (obj.payType == 'yue' || obj.payType == 'offline') {
  641. if (status == 200 && data.status == 'SUCCESS') {
  642. obj.paySuccessTo();
  643. } else {
  644. obj.$api.msg(msg);
  645. }
  646. } else {
  647. // 立即支付
  648. obj.orderMoneyPay();
  649. }
  650. })
  651. .catch(e => {
  652. uni.hideLoading();
  653. obj.payLoding = false;
  654. console.log(e);
  655. });
  656. }
  657. }
  658. };
  659. </script>
  660. <style lang="scss">
  661. .content {
  662. padding-bottom: 100rpx;
  663. }
  664. .address-section {
  665. border-radius: 20rpx;
  666. padding: 30rpx;
  667. margin: 0 $page-row-spacing;
  668. background: #fff;
  669. position: relative;
  670. .order-content {
  671. min-height: 100rpx;
  672. display: flex;
  673. align-items: center;
  674. .leftIcon {
  675. width: 36rpx;
  676. margin: 0 30rpx;
  677. }
  678. .addAddress {
  679. text-align: center;
  680. width: 100%;
  681. display: flex;
  682. justify-content: center;
  683. align-items: center;
  684. }
  685. }
  686. .cen {
  687. display: flex;
  688. flex-direction: column;
  689. font-size: 28rpx;
  690. color: $font-color-dark;
  691. width: 0px;
  692. flex-grow: 1;
  693. }
  694. .name {
  695. font-size: 34rpx;
  696. margin-right: 24rpx;
  697. }
  698. .address {
  699. margin-top: 16rpx;
  700. margin-right: 20rpx;
  701. color: $font-color-light;
  702. }
  703. }
  704. .goodsList {
  705. margin: 0 $page-row-spacing;
  706. padding: 30rpx;
  707. background: #fff;
  708. border-radius: 20rpx;
  709. margin-top: 30rpx;
  710. }
  711. .goods-section {
  712. .logo {
  713. display: block;
  714. width: 50rpx;
  715. height: 50rpx;
  716. border-radius: 100px;
  717. }
  718. .name {
  719. font-size: 30rpx;
  720. color: $font-color-base;
  721. margin-left: 24rpx;
  722. }
  723. .g-item {
  724. display: flex;
  725. image {
  726. flex-shrink: 0;
  727. display: block;
  728. width: 170rpx;
  729. height: 170rpx;
  730. border-radius: 4rpx;
  731. }
  732. .right {
  733. flex: 1;
  734. padding-left: 24rpx;
  735. overflow: hidden;
  736. .serverSet {
  737. font-size: 22rpx;
  738. color: $font-color-light;
  739. }
  740. }
  741. .title {
  742. font-size: 30rpx;
  743. color: $font-color-dark;
  744. }
  745. .spec {
  746. font-size: 26rpx;
  747. color: $font-color-light;
  748. }
  749. .price-box {
  750. display: flex;
  751. align-items: center;
  752. font-size: 32rpx;
  753. padding-top: 10rpx;
  754. color: $font-color-light;
  755. .price {
  756. margin-bottom: 4rpx;
  757. }
  758. .number {
  759. font-size: 26rpx;
  760. margin-left: 20rpx;
  761. }
  762. }
  763. .step-box {
  764. position: relative;
  765. }
  766. }
  767. }
  768. .yt-list {
  769. background: #fff;
  770. margin: 0 $page-row-spacing;
  771. margin-top: 30rpx;
  772. border-radius: 20rpx;
  773. }
  774. .yt-list-cell {
  775. display: flex;
  776. align-items: center;
  777. justify-content: space-between;
  778. padding: 10rpx 30rpx 10rpx 40rpx;
  779. line-height: 70rpx;
  780. position: relative;
  781. .checked,
  782. .noChecked {
  783. width: 36rpx;
  784. height: 36rpx;
  785. }
  786. .noChecked {
  787. border: 1px solid $font-color-light;
  788. border-radius: 100rpx;
  789. }
  790. &.cell-hover {
  791. background: #fafafa;
  792. }
  793. &.b-b:after {
  794. left: 30rpx;
  795. }
  796. .cell-icon {
  797. height: 32rpx;
  798. width: 32rpx;
  799. font-size: 22rpx;
  800. color: #fff;
  801. text-align: center;
  802. line-height: 32rpx;
  803. background: #f85e52;
  804. border-radius: 4rpx;
  805. margin-right: 12rpx;
  806. &.hb {
  807. background: #ffaa0e;
  808. }
  809. &.lpk {
  810. background: #3ab54a;
  811. }
  812. }
  813. .cell-more {
  814. align-self: center;
  815. font-size: 24rpx;
  816. color: $font-color-light;
  817. margin-left: 8rpx;
  818. margin-right: -10rpx;
  819. }
  820. .cell-tit {
  821. font-size: 26rpx;
  822. color: $font-color-light;
  823. margin-right: 10rpx;
  824. .orderIcon {
  825. width: 48rpx;
  826. }
  827. }
  828. .cell-tip {
  829. font-size: 26rpx;
  830. color: $font-color-dark;
  831. &.disabled {
  832. color: $font-color-light;
  833. }
  834. &.active {
  835. color: $base-color;
  836. }
  837. &.red {
  838. color: $base-color;
  839. }
  840. }
  841. &.desc-cell {
  842. .cell-tit {
  843. max-width: 90rpx;
  844. }
  845. }
  846. .desc {
  847. text-align: right;
  848. font-size: $font-base;
  849. color: $font-color-light;
  850. .switchCard {
  851. margin-right: -20rpx;
  852. }
  853. }
  854. }
  855. /* 支付列表 */
  856. .pay-list {
  857. padding-left: 40rpx;
  858. margin-top: 16rpx;
  859. background: #fff;
  860. .pay-item {
  861. display: flex;
  862. align-items: center;
  863. padding-right: 20rpx;
  864. line-height: 1;
  865. height: 110rpx;
  866. position: relative;
  867. }
  868. .icon-weixinzhifu {
  869. width: 80rpx;
  870. font-size: 40rpx;
  871. color: #6bcc03;
  872. }
  873. .icon-alipay {
  874. width: 80rpx;
  875. font-size: 40rpx;
  876. color: #06b4fd;
  877. }
  878. .icon-xuanzhong2 {
  879. display: flex;
  880. align-items: center;
  881. justify-content: center;
  882. width: 60rpx;
  883. height: 60rpx;
  884. font-size: 40rpx;
  885. color: $base-color;
  886. }
  887. .tit {
  888. font-size: 32rpx;
  889. color: $font-color-dark;
  890. flex: 1;
  891. }
  892. }
  893. .footer {
  894. position: fixed;
  895. left: 0;
  896. bottom: 0;
  897. z-index: 995;
  898. display: flex;
  899. align-items: center;
  900. width: 100%;
  901. height: 90rpx;
  902. justify-content: space-between;
  903. font-size: 30rpx;
  904. background-color: #fff;
  905. z-index: 998;
  906. color: $font-color-base;
  907. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  908. .price-content {
  909. padding-left: 30rpx;
  910. }
  911. .price-tip {
  912. color: $font-color-base;
  913. margin-left: 8rpx;
  914. }
  915. .price {
  916. font-size: 36rpx;
  917. color: $font-color-base;
  918. }
  919. .submit {
  920. display: flex;
  921. align-items: center;
  922. justify-content: center;
  923. width: 280rpx;
  924. height: 100%;
  925. color: #fff;
  926. font-size: 32rpx;
  927. background: $bg-gradual;
  928. &.submitNo {
  929. background-color: $font-color-disabled;
  930. }
  931. }
  932. }
  933. .tab-address {
  934. margin-bottom: 30rpx;
  935. margin-top: 0;
  936. .left {
  937. font-size: $font-base;
  938. }
  939. .right {
  940. font-size: $font-sm;
  941. color: #FFF;
  942. background: $bg-gradual;
  943. padding: 6rpx;
  944. border-radius: 10rpx;
  945. line-height: 1;
  946. .item {
  947. padding: 16rpx 20rpx;
  948. &.action {
  949. color: $uni-color-primary;
  950. background-color: #FFF;
  951. border-radius: 10rpx;
  952. }
  953. }
  954. }
  955. }
  956. .shop-box {
  957. .shop-top {
  958. width: 100%;
  959. .shop-title {
  960. width: 0px;
  961. flex-grow: 1;
  962. justify-content: flex-start;
  963. .shopImg {
  964. height: 65rpx;
  965. width: 65rpx;
  966. border-radius: 100rpx;
  967. margin-right: 20rpx;
  968. flex-shrink: 0;
  969. }
  970. .shop-name {
  971. font-weight: bold;
  972. font-size: $font-lg;
  973. }
  974. }
  975. .shop-tip {
  976. color: #FFF;
  977. padding: 5rpx 10rpx;
  978. font-size: $font-sm;
  979. background: linear-gradient(-90deg, #DCB876 0%, #EECD92 100%);
  980. border-radius: 5rpx;
  981. }
  982. }
  983. .shop-content {
  984. color: $font-color-light;
  985. font-size: $font-sm;
  986. }
  987. }
  988. .alertTime {
  989. z-index: 1000;
  990. .alert-box {
  991. background-color: #FFF;
  992. border-top-right-radius: 20rpx;
  993. border-top-left-radius: 20rpx;
  994. .right-content {
  995. width: 70%;
  996. .list {
  997. padding: 20rpx 30rpx;
  998. font-size: $font-sm;
  999. border-bottom: 1px solid $border-color-light;
  1000. }
  1001. }
  1002. .left-title {
  1003. width: 30%;
  1004. align-self: flex-start;
  1005. .title {
  1006. padding: 30rpx;
  1007. text-align: center;
  1008. font-weight: bold;
  1009. font-size: $font-sm;
  1010. background-color: rgba(246, 246, 246, 1);
  1011. &.action {
  1012. background-color: #FFF;
  1013. }
  1014. }
  1015. }
  1016. .alert-title {
  1017. text-align: center;
  1018. padding: 30rpx;
  1019. line-height: 1;
  1020. font-weight: bold;
  1021. }
  1022. .tip {
  1023. position: absolute;
  1024. top: 30rpx;
  1025. right: 30rpx;
  1026. color: $font-color-disabled;
  1027. font-weight: bold;
  1028. }
  1029. }
  1030. }
  1031. /deep/ .uni-switch-input {
  1032. &.uni-switch-input-checked {
  1033. border-color: $base-color !important;
  1034. background-color: $base-color !important;
  1035. }
  1036. }
  1037. </style>