index.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402
  1. <template>
  2. <view>
  3. <view class="order-submission">
  4. <view
  5. class="allAddress"
  6. :style="store_self_mention ? '' : 'padding-top:10rpx;'"
  7. >
  8. <view class="nav acea-row">
  9. <view
  10. class="item font-color"
  11. :class="shippingType == 0 ? 'on' : 'on2'"
  12. @tap="addressType(0)"
  13. v-if="store_self_mention"
  14. ></view>
  15. <!-- <view class="item font-color" :class="shippingType == 1 ? 'on' : 'on2'" @tap="addressType(1)"
  16. v-if="store_self_mention"></view> -->
  17. </view>
  18. <view
  19. class="address acea-row row-between-wrapper"
  20. @tap="onAddress"
  21. v-if="shippingType == 0"
  22. :style="
  23. store_self_mention
  24. ? ''
  25. : 'border-top-left-radius: 14rpx;border-top-right-radius: 14rpx;'
  26. "
  27. >
  28. <view class="addressCon" v-if="addressInfo.realName">
  29. <view class="name"
  30. >{{ addressInfo.realName }}
  31. <text class="phone">{{ addressInfo.phone }}</text>
  32. </view>
  33. <view class="acea-row">
  34. <text class="default font-color" v-if="addressInfo.isDefault"
  35. >[默认]</text
  36. >
  37. <text class="line2"
  38. >{{ addressInfo.province }}{{ addressInfo.city
  39. }}{{ addressInfo.district }}{{ addressInfo.detail }}</text
  40. >
  41. </view>
  42. </view>
  43. <view class="addressCon" v-else>
  44. <view class="setaddress">设置收货地址</view>
  45. </view>
  46. <view class="iconfont icon-jiantou"></view>
  47. </view>
  48. <view
  49. class="address acea-row row-between-wrapper"
  50. v-else
  51. @tap="showStoreList"
  52. >
  53. <block v-if="storeList.length > 0">
  54. <view class="addressCon">
  55. <view class="name"
  56. >{{ system_store.name }}
  57. <text class="phone">{{ system_store.phone }}</text>
  58. </view>
  59. <view class="line1">
  60. {{ system_store.address
  61. }}{{ ", " + system_store.detailedAddress }}
  62. </view>
  63. </view>
  64. <view class="iconfont icon-jiantou"></view>
  65. </block>
  66. <block v-else>
  67. <view>暂无门店信息</view>
  68. </block>
  69. </view>
  70. <view class="line">
  71. <image src="/static/images/line.jpg"></image>
  72. </view>
  73. </view>
  74. <view class="pad30">
  75. <orderGoods
  76. :mallType="orderInfoVo.mallType"
  77. :cartInfo="cartInfo"
  78. :orderProNum="orderProNum"
  79. ></orderGoods>
  80. <view class="wrapper borRadius14">
  81. <view
  82. class="item acea-row row-between-wrapper"
  83. @tap="couponTap"
  84. v-if="orderInfoVo.mallType === 0"
  85. >
  86. <view>优惠券</view>
  87. <view class="discount"
  88. >{{ couponTitle }}
  89. <text class="iconfont icon-jiantou"></text>
  90. </view>
  91. </view>
  92. <view class="item acea-row row-between-wrapper">
  93. <view>快递费用</view>
  94. <block v-if="orderInfoVo.mallType === 0">
  95. <view
  96. class="discount"
  97. v-if="
  98. parseFloat(orderInfoVo.freightFee) > 0 &&
  99. orderInfoVo.mallType === 0
  100. "
  101. >
  102. +¥{{ orderInfoVo.freightFee }}
  103. </view>
  104. <view class="discount" v-else>免运费</view>
  105. </block>
  106. <view class="discount" v-else>邮费到付</view>
  107. </view>
  108. <view class="item" v-if="textareaStatus">
  109. <view>备注信息</view>
  110. <textarea
  111. v-if="coupon.coupon === false"
  112. placeholder-class="placeholder"
  113. @input="bindHideKeyboard"
  114. value=""
  115. name="mark"
  116. placeholder="请添加备注(150字以内)"
  117. ></textarea>
  118. </view>
  119. </view>
  120. <!-- 是否使用余料支付 -->
  121. <view class="wrapper borRadius14">
  122. <view class="item">
  123. <view class="zf-box" v-if="orderInfoVo.mallType == 0">
  124. <view>余料支付方式</view>
  125. </view>
  126. <view class="swicth-box" v-if="orderInfoVo.mallType == 0">
  127. <view class="lable-box">
  128. <view class="iconfont icon-touzijintiao1"></view>
  129. <view class="lable-icon">
  130. <view class="lable">余料支付</view>
  131. <view class="value"> 可用余料:{{ auBalance }}</view>
  132. </view>
  133. </view>
  134. <!-- <switch
  135. color="#FFCC33"
  136. style="transform: scale(0.7)"
  137. @change="useGoldPay"
  138. ></switch> -->
  139. </view>
  140. <view class="zf-box">
  141. <view>工费支付方式</view>
  142. </view>
  143. <view class="list">
  144. <view
  145. v-for="(item, index) in avaliablePayments"
  146. class="payItem acea-row row-middle"
  147. :class="active == index ? 'on' : ''"
  148. @tap="payItem(index)"
  149. :key="index"
  150. >
  151. <view class="name acea-row row-center-wrapper">
  152. <view
  153. class="iconfont animated"
  154. :class="
  155. item.icon +
  156. ' ' +
  157. (animated == true && active == index ? 'bounceIn' : '')
  158. "
  159. >
  160. </view>
  161. {{ item.name }}
  162. </view>
  163. <view class="tip">{{ item.title }}</view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. <view class="moneyList borRadius14">
  169. <view class="item acea-row row-between-wrapper">
  170. <view>商品总价:</view>
  171. <view v-if="orderInfoVo.mallType === 0" class="money">
  172. ¥{{ orderInfoVo.payFee || 0 }}
  173. </view>
  174. <view v-else class="money">
  175. 贝币: {{ Number(orderInfoVo.proTotalFee) || 0 }}
  176. </view>
  177. </view>
  178. <view
  179. class="item acea-row row-between-wrapper"
  180. v-if="orderInfoVo.couponFee > 0"
  181. >
  182. <view>优惠券抵扣:</view>
  183. <view class="money">-¥{{ orderInfoVo.couponFee }}</view>
  184. </view>
  185. <!-- <view
  186. class="item acea-row row-between-wrapper"
  187. v-if="orderInfoVo.deductionPrice > 0"
  188. >
  189. <view>积分抵扣:</view>
  190. <view class="money">-¥{{ orderInfoVo.deductionPrice }}</view>
  191. </view> -->
  192. <view
  193. class="item acea-row row-between-wrapper"
  194. v-if="orderInfoVo.mallType === 0"
  195. >
  196. <view>工费:</view>
  197. <view class="money">+¥{{ orderInfoVo.totalLaborCost }}</view>
  198. </view>
  199. <view
  200. class="item acea-row row-between-wrapper"
  201. v-if="
  202. orderInfoVo.mallType === 0 && orderInfoVo?.totalAdditionalAmount
  203. "
  204. >
  205. <view>附加费:</view>
  206. <view class="money"
  207. >+¥{{ orderInfoVo.totalAdditionalAmount }}</view
  208. >
  209. </view>
  210. <view
  211. class="item acea-row row-between-wrapper"
  212. v-if="orderInfoVo.freightFee > 0"
  213. >
  214. <view>运费:</view>
  215. <view class="money">+¥{{ orderInfoVo.freightFee }}</view>
  216. </view>
  217. <view
  218. v-if="
  219. orderInfoVo.mallType === 0 &&
  220. Number(orderInfoVo.vipLevelDis) !== 0
  221. "
  222. class="item acea-row row-between-wrapper"
  223. >
  224. <view>会员折扣:</view>
  225. <view class="money">-¥{{ orderInfoVo.vipLevelDis }}</view>
  226. </view>
  227. </view>
  228. <view style="height: 120rpx"></view>
  229. </view>
  230. <view class="footer acea-row row-between-wrapper">
  231. <view>
  232. 合计:
  233. <text class="font-color" v-if="orderInfoVo.mallType === 0">
  234. ¥{{ orderInfoVo.payFee || 0 }}
  235. </text>
  236. <text class="font-color" v-else>
  237. {{ Number(orderInfoVo.proTotalFee) || 0 }}
  238. </text>
  239. </view>
  240. <view class="settlement" style="z-index: 100" @tap="SubOrder">
  241. 立即结算
  242. </view>
  243. </view>
  244. </view>
  245. <couponListWindow
  246. :coupon="coupon"
  247. @close="closeCouponPopup"
  248. :showPopup="showCouponPopup"
  249. :openType="openType"
  250. @ChangCoupons="ChangCoupons"
  251. :orderShow="orderShow"
  252. ></couponListWindow>
  253. <addressWindow
  254. ref="addressWindowRef"
  255. @changeTextareaStatus="changeTextareaStatus"
  256. :address="address"
  257. :pagesUrl="pagesUrl"
  258. @OnDefaultAddress="OnDefaultAddress"
  259. @OnChangeAddress="OnChangeAddress"
  260. @changeClose="changeClose"
  261. />
  262. <!-- 余额不足modal -->
  263. <up-modal
  264. :showCancelButton="true"
  265. :show="showModal"
  266. title="余额不足"
  267. confirmText="去充值"
  268. @cancel="showModal = false"
  269. @confirm="modalConfirm"
  270. ></up-modal>
  271. </view>
  272. </template>
  273. <script setup>
  274. // 导入UniApp页面加载生命周期函数
  275. import { onLoad } from "@dcloudio/uni-app";
  276. // 导入Vue3响应式API(ref创建响应式变量、computed计算属性等)
  277. import { ref, computed, watch, onMounted, nextTick } from "vue";
  278. // 导入应用状态管理(全局状态,如登录状态、用户信息等)
  279. import { useAppStore } from "@/stores/app.js";
  280. // 导入提示框工具(封装的toast提示函数)
  281. import { useToast } from "@/hooks/useToast.js";
  282. // 导入支付相关工具(封装的支付逻辑,如提交支付、验证支付渠道等)
  283. import { usePayment } from "@/hooks/usePayment.js";
  284. // 导入订单相关API接口(优惠券、创建订单、计算价格等接口)
  285. import {
  286. getCouponsOrderPrice, // 获取可用优惠券接口
  287. orderCreate, // 创建订单接口
  288. postOrderComputed, // 计算订单价格接口
  289. wechatOrderPay, // 微信支付接口
  290. wechatQueryPayResult, // 微信支付结果查询接口
  291. loadPreOrderApi, // 加载预订单接口
  292. alipayPaymentResult, // 支付宝支付结果查询接口
  293. } from "@/api/order.js";
  294. // 导入用户地址详情API接口
  295. import { getAddressDetail } from "@/api/user.js";
  296. // 导入门店列表API接口
  297. import { storeListApi } from "@/api/store.js";
  298. // 导入工具类(封装的通用工具函数)
  299. import util from "@/utils/util";
  300. // 导入优惠券弹窗组件
  301. import couponListWindow from "@/components/couponListWindow";
  302. // 导入地址选择组件
  303. import addressWindow from "@/components/addressWindow";
  304. // 导入订单商品列表组件
  305. import orderGoods from "@/components/orderGoods";
  306. // 导入登录工具(未登录时跳转登录页)
  307. import { toLogin } from "@/libs/login.js";
  308. import useRealGoldPrice from "@/hooks/useRealGoldPrice";
  309. const { realGoldprice, fetchGoldPrice } = useRealGoldPrice("RTJ_Au");
  310. // 初始化应用状态管理实例(用于获取全局状态)
  311. const appStore = useAppStore();
  312. // 初始化提示框工具(获取toast方法)
  313. const { Toast } = useToast();
  314. // 初始化支付工具(获取支付相关方法)
  315. const { submitPayment, paymentConfig, getAvailableChannels } = usePayment();
  316. // 响应式变量:订单页面标识(用于优惠券组件,控制不显示tab切换)
  317. const orderShow = ref("orderShow");
  318. // 响应式变量:控制备注输入框是否显示
  319. const textareaStatus = ref(true);
  320. // 响应式变量:支付方式列表(包含支付宝、微信、余额等支付方式配置)
  321. const payments = ref([
  322. {
  323. name: "支付宝支付", // 支付方式名称
  324. icon: "icon-zhifubao", // 图标类名
  325. value: "alipay", // 支付标识值
  326. title: "支付宝快捷支付", // 支付说明
  327. payType: "alipay", // 支付类型
  328. payStatus: 1, // 支付状态(1-可用,0-不可用)
  329. payChannel: "appAliPay",
  330. },
  331. {
  332. name: "微信支付",
  333. icon: "icon-wechat",
  334. value: "weixin",
  335. title: "微信快捷支付",
  336. payType: "weixin",
  337. payStatus: 1,
  338. payChannel: "weixinApp",
  339. },
  340. {
  341. name: "余额支付",
  342. icon: "icon-balance",
  343. value: "yue",
  344. title: "可用余额:",
  345. payType: "yue",
  346. payStatus: 1,
  347. payChannel: "weixinh5",
  348. },
  349. {
  350. name: "贝币支付",
  351. icon: "icon-balance",
  352. value: "yue",
  353. title: "可用贝币:",
  354. payType: "yue",
  355. payStatus: 0,
  356. payChannel: "weixinh5",
  357. },
  358. ]);
  359. // 计算属性:过滤出可用的支付方式(只保留payStatus为1的项)
  360. const avaliablePayments = computed(() => {
  361. return payments.value.filter((item) => item.payStatus === 1);
  362. });
  363. // 响应式变量:当前选中的支付方式(默认余额支付)
  364. const payType = ref("alipay");
  365. // 响应式变量:优惠券打开方式(1表示"使用"场景)
  366. const openType = ref(1);
  367. // 响应式变量:当前选中的支付方式索引(用于UI高亮)
  368. const active = ref(0);
  369. // 响应式变量:优惠券相关配置(控制弹窗显示、列表数据等)
  370. const coupon = ref({
  371. coupon: false, // 是否显示优惠券弹窗
  372. list: [], // 优惠券列表数据
  373. statusTile: "立即使用", // 按钮文字
  374. });
  375. // 响应式变量:地址相关配置(控制弹窗显示、选中地址ID等)
  376. const address = ref({
  377. address: false,
  378. addressId: 0,
  379. }); // 地址组件
  380. const addressInfo = ref({}); // 地址信息
  381. const addressId = ref(0); // 地址id
  382. const couponId = ref(0); // 优惠券id
  383. const userInfo = ref({}); // 用户信息
  384. const mark = ref(""); // 备注信息
  385. const couponTitle = ref("请选择"); // 优惠券
  386. const useIntegral = ref(false); // 是否使用积分
  387. const status = ref(0);
  388. // 响应式变量:是否有地址(用于判断是否需要提示用户添加地址)
  389. const is_address = ref(false);
  390. // 响应式变量:支付页面刷新标识(修复支付页面隐藏后刷新问题)
  391. const toPay = ref(false);
  392. // 响应式变量:配送方式(0-快递配送,1-到店自提)
  393. const shippingType = ref(0);
  394. // 响应式变量:选中的门店信息(自提时使用)
  395. const system_store = ref({});
  396. const contacts = ref("");
  397. // 响应式变量:联系人电话(自提时可能需要)
  398. const contactsTel = ref("");
  399. const storeList = ref([]);
  400. // 响应式变量:是否支持门店自提(1-支持,0-不支持)
  401. const store_self_mention = ref(0);
  402. // 响应式变量:购物车商品信息(订单中的商品列表)
  403. const cartInfo = ref([]);
  404. const animated = ref(false);
  405. // 响应式变量:订单总价
  406. const totalPrice = ref(0);
  407. const pagesUrl = ref("");
  408. // const usableCoupon = ref({});
  409. const payChannel = ref("");
  410. // 响应式变量:订单信息详情(包含商品总价、运费、折扣等)
  411. const orderInfoVo = ref({});
  412. // 响应式变量:地址列表数据(用于地址选择组件)
  413. const addressList = ref([]);
  414. // 响应式变量:订单商品总数
  415. const orderProNum = ref(0);
  416. const preOrderNo = ref(""); // 预下单订单号
  417. const addressWindowRef = ref(null); // 地址组件引用
  418. const showCouponPopup = ref(false); // 显示优惠券弹窗
  419. const showModal = ref(false);
  420. const userSelectPayTypeItem = ref(payments.value[0]);
  421. // 监听 isLogin
  422. watch(
  423. () => appStore.isLogin, // 监听的数据源:全局登录状态
  424. (newV) => {
  425. // newV是登录状态的新值(true/false)
  426. if (newV) {
  427. // 若已登录
  428. getloadPreOrder(); // 加载预订单信息
  429. this.getaddressInfo(); // 获取地址信息(this指向当前组件实例)
  430. }
  431. },
  432. { deep: true } // 深度监听(确保复杂数据类型变化也能触发)
  433. );
  434. // 商品总价
  435. // 页面加载时触发的生命周期函数
  436. onLoad((options) => {
  437. // options是页面跳转时传递的参数
  438. console.log(appStore.userInfo); // 打印用户信息(调试用)
  439. // #ifdef APP
  440. // 支付宝沙箱模式(测试环境用,正式环境注释)
  441. // var EnvUtils = plus.android.importClass("com.alipay.sdk.app.EnvUtils");
  442. // EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX);
  443. // #endif
  444. // #ifdef H5
  445. payChannel.value = "weixinh5"; // H5环境支付渠道为微信H5支付
  446. // #endif
  447. // #ifdef APP
  448. payChannel.value = "appAliPay"; // APP环境支付渠道为支付宝APP支付
  449. // #endif
  450. // 从参数中获取预订单号(若没有则默认为0)
  451. preOrderNo.value = options.preOrderNo || 0;
  452. // 从参数中获取地址ID(若没有则默认为0)
  453. addressId.value = options.addressId || 0;
  454. // 从参数中获取是否有地址的标识
  455. is_address.value = options.is_address ? true : false;
  456. // 若已登录,则加载预订单信息;否则跳转到登录页
  457. if (appStore.isLogin) {
  458. getloadPreOrder(); // 加载预订单
  459. } else {
  460. toLogin(); // 跳登录
  461. }
  462. });
  463. // 组件挂载后触发的生命周期函数(DOM渲染完成后)
  464. onMounted(() => {
  465. textareaStatus.value = true; // 默认显示备注输入框
  466. // 若已登录且非支付页面,则获取地址信息(注释掉的逻辑,预留)
  467. if (appStore.isLogin && !toPay.value) {
  468. //this.getaddressInfo();
  469. }
  470. // 监听全局事件"handClick"(用于接收门店选择结果)
  471. uni.$on("handClick", (res) => {
  472. if (res) {
  473. // 若有结果
  474. system_store.value = res.address; // 更新选中的门店信息
  475. }
  476. // 清除监听(避免重复触发)
  477. uni.$off("handClick");
  478. });
  479. });
  480. // 是否选择余料支付
  481. const useGoldPay = (e) => {
  482. computedPrice();
  483. };
  484. // 黄金余料
  485. const auBalance = ref(0);
  486. // 加载预订单信息(核心函数:初始化订单数据)
  487. const getloadPreOrder = () => {
  488. console.log("preOrderNo.value", preOrderNo.value);
  489. // 调用加载预订单API,传入预订单号
  490. loadPreOrderApi(preOrderNo.value)
  491. .then((res) => {
  492. console.log("getOrderDetail=========>", res.data);
  493. auBalance.value = res.data.auBalance;
  494. // 接口成功回调
  495. let orderInfoVoData = res.data.orderInfoVo; // 订单基本信息
  496. orderInfoVo.value = orderInfoVoData; // 保存订单信息
  497. cartInfo.value = orderInfoVoData.orderDetailList; // 保存商品列表
  498. orderProNum.value = orderInfoVoData.orderProNum; // 保存商品总数
  499. // 设置地址ID(优先用参数传入的,没有则用订单默认的)
  500. address.value.addressId = addressId.value
  501. ? addressId.value
  502. : orderInfoVoData.addressId;
  503. // 判断是否支持门店自提(根据接口返回和全局状态)
  504. store_self_mention.value =
  505. res.data.storeSelfMention == "true" && // 接口返回支持自提
  506. appStore.productTypeComputed === "normal" // 全局状态为普通商品
  507. ? true
  508. : false;
  509. // 根据商城类型设置是否使用积分(mallType=1时默认使用)
  510. useIntegral.value = orderInfoVo.value.mallType === 1;
  511. // 根据商城类型设置默认支付方式(mallType=1时用贝币支付)
  512. payType.value = orderInfoVo.value.mallType === 1 ? "yue" : "alipay";
  513. // 动态更新支付方式状态(根据接口返回的配置)
  514. payments.value.forEach((item) => {
  515. if (item.name === "余额支付") {
  516. // 余额支付:显示可用余额,状态由接口返回的yuePayStatus决定
  517. item.title = "可用余额: " + orderInfoVoData.userBalance;
  518. item.payStatus = parseInt(res.data.yuePayStatus) === 1 ? 1 : 2;
  519. } else if (item.payType === "weixin") {
  520. // 微信支付:状态由接口返回的payWeixinOpen决定
  521. item.payStatus = parseInt(res.data.payWeixinOpen) === 1 ? 1 : 0;
  522. }
  523. // 贝币支付:仅在mallType=1时可用
  524. if (orderInfoVo.value.mallType === 1) {
  525. item.title = "可用贝币: " + orderInfoVoData.userIntegral;
  526. item.payStatus = item.name === "贝币支付" ? 1 : 0;
  527. } else {
  528. item.payStatus = item.name === "贝币支付" ? 0 : 1;
  529. }
  530. });
  531. if (addressId.value) {
  532. computedPrice();
  533. }
  534. // 调用子页面方法授权后执行获取地址列表
  535. nextTick(() => {
  536. addressWindowRef.value.fetchAddressList();
  537. });
  538. })
  539. .catch((err) => {
  540. // 接口失败回调
  541. console.error(err); // 打印错误
  542. uni.navigateTo({ url: "/pages/order_list/index" }); // 跳转到订单列表
  543. Toast({ title: err }); // 提示错误信息
  544. });
  545. };
  546. // 授权回调事件(用户授权后触发,预留)
  547. const onLoadFun = () => {
  548. //this.getaddressInfo(); // 获取地址信息(注释掉的逻辑)
  549. // 调用子组件方法获取地址列表(注释掉的逻辑)
  550. // this.$scope.selectComponent('#address-window').getAddressList();
  551. };
  552. // 获取门店列表数据(自提时使用)
  553. const getList = () => {
  554. // 从本地存储获取用户经纬度(用于附近门店查询)
  555. let longitude = uni.getStorageSync("user_longitude");
  556. let latitude = uni.getStorageSync("user_latitude");
  557. // 构造请求参数
  558. let data = {
  559. latitude: latitude, // 纬度
  560. longitude: longitude, // 经度
  561. page: 1, // 页码
  562. limit: 10, // 每页条数
  563. };
  564. // 调用门店列表API
  565. storeListApi(data)
  566. .then((res) => {
  567. // 成功回调
  568. let list = res.data.list || []; // 门店列表
  569. storeList.value = list; // 保存门店列表
  570. system_store.value = list[0]; // 默认选中第一个门店
  571. })
  572. .catch((err) => {
  573. // 失败回调
  574. Toast({ title: err }); // 提示错误
  575. });
  576. };
  577. // 关闭地址弹窗
  578. const changeClose = () => {
  579. address.value.address = false; // 隐藏地址弹窗
  580. };
  581. // 跳转门店列表页面(自提时选择门店)
  582. const showStoreList = () => {
  583. // 若有门店列表数据,则跳转到门店详情页
  584. if (storeList.value.length > 0) {
  585. uni.navigateTo({
  586. url: "/pages/users/goods_details_store/index",
  587. });
  588. }
  589. };
  590. // 计算订单价格
  591. function computedPrice() {
  592. let shippingTypeValue = shippingType.value;
  593. postOrderComputed({
  594. mallType: orderInfoVo.value.mallType, // 商城类型
  595. addressId: address.value.addressId, // 地址ID
  596. useIntegral: useIntegral.value ? true : false, // 是否用积分
  597. couponId: couponId.value, // 优惠券ID
  598. shippingType: parseInt(shippingTypeValue) + 1, // 配送方式(后端要求+1)
  599. preOrderNo: preOrderNo.value, // 预订单号
  600. goldNum: appStore.userInfo.goldBalance, // 余料数量
  601. })
  602. .then((res) => {
  603. // 成功回调
  604. let data = res.data; // 计算后的价格数据
  605. // 更新订单费用信息
  606. orderInfoVo.value.couponFee = data.couponFee; // 优惠券抵扣
  607. orderInfoVo.value.userIntegral = data.surplusIntegral; // 剩余积分
  608. orderInfoVo.value.deductionPrice = data.deductionPrice; // 积分抵扣金额
  609. orderInfoVo.value.freightFee = data.freightFee; // 运费
  610. orderInfoVo.value.payFee = data.payFee; // 实付金额
  611. orderInfoVo.value.proTotalFee = data.proTotalFee; // 商品总价
  612. orderInfoVo.value.useIntegral = data.useIntegral; // 是否使用积分
  613. orderInfoVo.value.usedIntegral = data.usedIntegral; // 已用积分
  614. orderInfoVo.value.surplusIntegral = data.surplusIntegral; // 剩余积分
  615. })
  616. .catch((err) => {
  617. // 失败回调
  618. Toast({ title: err }); // 提示错误
  619. });
  620. }
  621. // 切换配送方式(快递/自提)
  622. const addressType = (e) => {
  623. let index = e; // 0-快递,1-自提
  624. shippingType.value = parseInt(index); // 更新配送方式
  625. // 若为普通商城类型,重新计算价格
  626. if (orderInfoVo.value.mallType === 0) {
  627. computedPrice();
  628. }
  629. // if (index == 1) getList();
  630. };
  631. // 配送方式选择器变化事件(预留,用于下拉选择器)
  632. const bindPickerChange = (e) => {
  633. let value = e.detail.value; // 选择的索引
  634. shippingType.value = value; // 更新配送方式
  635. computedPrice(); // 重新计算价格
  636. };
  637. // 关闭优惠券弹窗
  638. const closeCouponPopup = () => {
  639. showCouponPopup.value = false; // 隐藏优惠券弹窗
  640. };
  641. // 改变备注框状态(优惠券选择后调用)
  642. const changeTextareaStatus = () => {
  643. // 重置所有优惠券的选中状态
  644. for (let i = 0, len = coupon.value.list.length; i < len; i++) {
  645. coupon.value.list[i].use_title = "";
  646. coupon.value.list[i].is_use = 0;
  647. }
  648. textareaStatus.value = true; // 显示备注框
  649. status.value = 0; // 重置状态
  650. coupon.value.list = coupon.value.list; // 触发响应式更新
  651. };
  652. // 选择优惠券后的处理事件
  653. const ChangCoupons = (e) => {
  654. // this.usableCoupon = e
  655. // this.coupon.coupon = false
  656. let index = e,
  657. list = coupon.value.list,
  658. couponTitleValue = "请选择",
  659. couponIdValue = 0;
  660. console.log("list", list);
  661. for (let i = 0, len = list.length; i < len; i++) {
  662. if (i != index) {
  663. list[i].use_title = "";
  664. list[i].isUse = 0;
  665. }
  666. }
  667. // 切换当前优惠券的选中状态
  668. if (list[index].isUse) {
  669. // 若已选中,则取消选择
  670. list[index].use_title = "";
  671. list[index].isUse = 0;
  672. } else {
  673. // 若未选中,则选中
  674. list[index].use_title = "不使用"; // 显示"不使用"按钮
  675. list[index].isUse = 1; // 标记为选中
  676. couponTitleValue = list[index].name; // 更新标题为优惠券名称
  677. couponIdValue = list[index].id; // 更新选中的优惠券ID
  678. }
  679. // 更新优惠券相关状态
  680. couponTitle.value = couponTitleValue;
  681. couponId.value = couponIdValue;
  682. coupon.value.coupon = false;
  683. // coupon.value.list = list;
  684. computedPrice();
  685. };
  686. // 首次进入页面时展示默认地址
  687. const OnDefaultAddress = (e) => {
  688. addressInfo.value = e; // 保存默认地址详情
  689. address.value.addressId = e.id; // 更新选中地址ID
  690. };
  691. // 选择地址后触发的事件
  692. const OnChangeAddress = (e) => {
  693. console.log("OnChangeAddress", e);
  694. addressInfo.value = e;
  695. address.value.addressId = e.id;
  696. textareaStatus.value = true;
  697. //orderInfoVo.value.addressId = e;
  698. address.value.address = false;
  699. //this.getaddressInfo();
  700. if (orderInfoVo.value.mallType === 0) {
  701. computedPrice();
  702. }
  703. };
  704. // 备注输入事件(实时保存输入内容)
  705. const bindHideKeyboard = (e) => {
  706. mark.value = e.detail.value; // 保存输入的备注信息
  707. };
  708. // 获取当前订单可用的优惠券列表
  709. const getCouponList = () => {
  710. // 调用获取优惠券API,传入预订单号
  711. getCouponsOrderPrice(preOrderNo.value).then((res) => {
  712. coupon.value.list = res.data; // 保存优惠券列表
  713. openType.value = 1; // 设置打开方式为"使用"
  714. });
  715. };
  716. // 获取默认地址或指定地址详情
  717. const getaddressInfo = () => {
  718. if (addressId.value) {
  719. // 若有指定地址ID,获取该地址详情
  720. getAddressDetail(addressId.value).then((res) => {
  721. if (res.data) {
  722. // 若地址存在
  723. res.data.isDefault = parseInt(res.data.isDefault); // 转换默认地址标识为数字
  724. addressInfo.value = res.data || {}; // 保存地址详情
  725. addressId.value = res.data.id || 0; // 更新地址ID
  726. address.value.addressId = res.data.id || 0; // 更新选中地址ID
  727. }
  728. });
  729. } else {
  730. // 若没有指定地址ID,获取默认地址
  731. getAddressDefault().then((res) => {
  732. // 注意:原代码中未导入getAddressDefault,可能是遗漏
  733. if (res.data) {
  734. // 若默认地址存在
  735. res.data.isDefault = parseInt(res.data.isDefault);
  736. addressInfo.value = res.data || {};
  737. addressId.value = res.data.id || 0;
  738. address.value.addressId = res.data.id || 0;
  739. }
  740. });
  741. }
  742. };
  743. // 选择支付方式
  744. const payItem = (e) => {
  745. let activeValue = e;
  746. active.value = activeValue;
  747. animated.value = true;
  748. payType.value = payments.value[activeValue].value;
  749. userSelectPayTypeItem.value = payments.value[activeValue];
  750. computedPrice();
  751. setTimeout(() => {
  752. car();
  753. }, 500);
  754. };
  755. // 打开优惠券弹窗
  756. const couponTap = () => {
  757. // coupon.value.coupon = true;
  758. showCouponPopup.value = true;
  759. if (!coupon.value.list.length) getCouponList();
  760. // getCouponList();
  761. };
  762. // 关闭支付方式选择动画
  763. const car = () => {
  764. animated.value = false; // 关闭动画
  765. };
  766. // 打开地址选择弹窗
  767. const onAddress = () => {
  768. textareaStatus.value = false; // 隐藏备注框
  769. address.value.address = true; // 显示地址弹窗
  770. // 设置地址页面跳转链接(携带预订单号)
  771. pagesUrl.value =
  772. "/pages/users/user_address_list/index?preOrderNo=" + preOrderNo.value;
  773. };
  774. // 联系人输入事件(保存联系人)
  775. const realName = (e) => {
  776. contacts.value = e.detail.value;
  777. };
  778. // 联系人电话输入事件(保存电话)
  779. const phone = (e) => {
  780. contactsTel.value = e.detail.value;
  781. };
  782. // 创建订单并发起支付
  783. const payment = (data) => {
  784. // 调用创建订单API
  785. orderCreate(data)
  786. .then((res) => {
  787. // 订单创建成功
  788. // 调用支付流程,传入订单号和成功提示
  789. getOrderPay(res.data.orderNo, "支付成功");
  790. })
  791. .catch((err) => {
  792. // 订单创建失败
  793. console.error("payment error", err); // 打印错误
  794. uni.hideLoading(); // 隐藏加载中
  795. Toast({ title: err }); // 提示错误
  796. });
  797. };
  798. // 处理支付流程(根据支付类型发起支付并处理结果)
  799. const getOrderPay = async (orderNo, message) => {
  800. // 支付结果页地址(携带订单号)
  801. const goPages = "/pages/order_pay_status/index?order_id=" + orderNo;
  802. try {
  803. // 调用微信支付配置API(获取支付参数)
  804. const res = await wechatOrderPay({
  805. mallType: orderInfoVo.value.mallType,
  806. orderNo: orderNo,
  807. // payChannel: payChannel.value,
  808. payChannel: userSelectPayTypeItem.value.payChannel,
  809. payType: payType.value,
  810. scene: appStore.productTypeComputed === "normal" ? 0 : 1177, // 下单时小程序的场景值
  811. });
  812. console.log("res-------------", res.data);
  813. let jsConfig = res.data.prepayWithRequestPaymentResponse;
  814. switch (res.data.payType) {
  815. case "alipay":
  816. // 发起支付宝支付
  817. const result = await submitPayment({
  818. type: res.data.payType, // 支付类型
  819. orderInfo: res.data.alipayRequest, // 支付宝支付参数
  820. });
  821. console.log("result", result); // 打印支付结果
  822. // 失败提示信息(默认"支付失败")
  823. let failMsg = result?.message || paymentConfig.PAYMENT_STATUS.FAIL;
  824. // 根据支付结果处理
  825. if (result.status === paymentConfig.PAYMENT_STATUS.SUCCESS) {
  826. // 支付成功:查询后端支付状态
  827. const params = {
  828. orderNo: orderNo,
  829. payType: "alipay",
  830. };
  831. console.log("进入成功判断", params);
  832. const res = await alipayPaymentResult(params); // 调用查询接口
  833. console.log("alipayPaymentResult", res);
  834. // 提示成功并跳转到结果页
  835. return Toast(
  836. { title: paymentConfig.PAYMENT_STATUS.SUCCESS, icon: "success" },
  837. { tab: 4, url: goPages }
  838. );
  839. } else if (result.status === paymentConfig.PAYMENT_STATUS.FAIL) {
  840. // 支付失败:提示并跳转
  841. return Toast(
  842. { title: paymentConfig.PAYMENT_STATUS.FAIL },
  843. { tab: 5, url: `${goPages}&msg=${failMsg}` }
  844. );
  845. } else if (result.status === paymentConfig.PAYMENT_STATUS.CANCEL) {
  846. // 支付取消:提示并跳转
  847. return Toast(
  848. { title: paymentConfig.PAYMENT_STATUS.CANCEL },
  849. {
  850. tab: 5,
  851. url: `${goPages}&msg=${paymentConfig.PAYMENT_STATUS.CANCEL}`,
  852. }
  853. );
  854. }
  855. break;
  856. case "yue":
  857. // 余额支付:直接提示成功并跳转
  858. console.log("余额支付");
  859. return Toast(
  860. { title: message },
  861. { tab: 5, url: goPages + "&status=1" }
  862. );
  863. break;
  864. case "weixinApp":
  865. const wxPayResult = await submitPayment({
  866. type: res.data.payType,
  867. orderInfo: res.data.prepayWithRequestPaymentResponse,
  868. });
  869. let wxPayFailMsg =
  870. wxPayResult?.message || paymentConfig.PAYMENT_STATUS.FAIL;
  871. if (wxPayResult.status === paymentConfig.PAYMENT_STATUS.SUCCESS) {
  872. // 查询后端支付状态接口
  873. let params = {
  874. orderNo: orderNo,
  875. payType: "weixinApp",
  876. };
  877. let res = await alipayPaymentResult(params);
  878. return Toast(
  879. { title: paymentConfig.PAYMENT_STATUS.SUCCESS, icon: "success" },
  880. { tab: 4, url: goPages }
  881. );
  882. } else if (wxPayResult.status === paymentConfig.PAYMENT_STATUS.FAIL) {
  883. return Toast(
  884. { title: paymentConfig.PAYMENT_STATUS.FAIL },
  885. { tab: 5, url: `${goPages}&msg=${wxPayFailMsg}` }
  886. );
  887. } else if (wxPayResult.status === paymentConfig.PAYMENT_STATUS.CANCEL) {
  888. return Toast(
  889. { title: paymentConfig.PAYMENT_STATUS.CANCEL },
  890. {
  891. tab: 5,
  892. url: `${goPages}&msg=${paymentConfig.PAYMENT_STATUS.CANCEL}`,
  893. }
  894. );
  895. }
  896. break;
  897. }
  898. uni.hideLoading(); // 隐藏加载中
  899. } catch (error) {
  900. // 支付过程出错
  901. console.error("getOrderPay error", error, typeof error);
  902. let msg = "";
  903. // 处理错误信息
  904. if (typeof error === "string") {
  905. msg = error;
  906. } else if (typeof error === "object" && error.message) {
  907. msg = error.message;
  908. } else {
  909. msg = "支付失败,请稍后再试";
  910. }
  911. uni.hideLoading(); // 隐藏加载中
  912. // 跳转到结果页并携带错误信息
  913. uni.navigateTo({
  914. url: `/pages/order_pay_status/index?order_id=${orderNo}&msg=${msg}`,
  915. });
  916. return Toast({ title: msg }); // 提示错误
  917. }
  918. };
  919. function modalConfirm() {
  920. showModal.value = false;
  921. uni.navigateTo({
  922. url: "/pages/users/vault/recharge",
  923. });
  924. }
  925. const SubOrder = async (e) => {
  926. console.log("SubOrder", payType.value);
  927. // if (payType.value == "alipay") {
  928. // return Toast({ title: "暂不支持支付宝支付,请使用余额支付" });
  929. // }
  930. let data = {}; // 订单提交数据
  931. // 验证:必须选择支付方式
  932. if (!payType.value) return Toast({ title: "请选择支付方式" });
  933. // 验证:快递配送时必须选择地址
  934. if (!address.value.addressId && !shippingType.value) {
  935. return Toast({ title: "请选择收货地址" });
  936. }
  937. try {
  938. const channels = await getAvailableChannels();
  939. if (payType.value === "alipay" && !channels.includes("alipay")) {
  940. return Toast({ title: "设备不支持支付宝支付" });
  941. } else if (payType.value === "weixin" && !channels.includes("wxpay")) {
  942. return Toast({ title: "设备不支持微信支付" });
  943. }
  944. } catch (error) {
  945. console.error("获取支付渠道失败", error);
  946. return Toast({ title: "获取支付渠道失败" });
  947. }
  948. // 构造订单提交数据
  949. data = {
  950. mallType: orderInfoVo.value.mallType,
  951. realName: contacts.value,
  952. phone: contactsTel.value,
  953. addressId: address.value.addressId,
  954. couponId: couponId.value,
  955. payType: payType.value,
  956. useIntegral: useIntegral.value,
  957. preOrderNo: preOrderNo.value,
  958. mark: mark.value,
  959. // storeId: system_store.value.id || 0,
  960. shippingType: util.$h.Add(shippingType.value, 1),
  961. // payChannel: payChannel.value || "weixinh5",
  962. payChannel: userSelectPayTypeItem.value.payChannel,
  963. };
  964. console.log(" data.payType", data.payType);
  965. // 验证:贝币支付时余额是否充足
  966. if (
  967. orderInfoVo.value.mallType === 1 &&
  968. Number(orderInfoVo.value.proTotalFee) > orderInfoVo.value.userIntegral
  969. ) {
  970. return Toast({ title: "贝币余额不足!" });
  971. }
  972. // 验证:余额支付时余额是否充足
  973. else if (
  974. data.payType == "yue" &&
  975. parseFloat(appStore.$userInfo.nowMoney) <
  976. parseFloat(orderInfoVo.value.payFee)
  977. ) {
  978. // 余额不足
  979. showModal.value = true;
  980. return;
  981. }
  982. uni.showLoading({
  983. title: "订单支付中",
  984. });
  985. // 发起支付
  986. payment(data);
  987. };
  988. </script>
  989. <style lang="scss" scoped>
  990. .order-submission {
  991. .line {
  992. width: 100%;
  993. height: 3rpx;
  994. image {
  995. width: 100%;
  996. height: 100%;
  997. display: block;
  998. }
  999. }
  1000. .allAddress {
  1001. width: 100%;
  1002. // background-image: linear-gradient(to bottom, #f0cb88 0%, transparent 100%);
  1003. background: $uni-bg-primary;
  1004. padding: 100rpx 30rpx 0 30rpx;
  1005. .nav {
  1006. width: 690rpx;
  1007. margin: 0 auto;
  1008. .item {
  1009. width: 334rpx;
  1010. &.on {
  1011. position: relative;
  1012. width: 230rpx;
  1013. &::before {
  1014. position: absolute;
  1015. bottom: 0;
  1016. content: "快递配送";
  1017. font-size: 28rpx;
  1018. display: block;
  1019. height: 0;
  1020. width: 336rpx;
  1021. border-width: 0 20rpx 80rpx 0;
  1022. border-style: none solid solid;
  1023. border-color: transparent transparent #fff;
  1024. z-index: 2;
  1025. border-radius: 14rpx 36rpx 0 0;
  1026. text-align: center;
  1027. line-height: 80rpx;
  1028. }
  1029. }
  1030. &:nth-of-type(2).on::before {
  1031. content: "到店自提";
  1032. border-width: 0 0 80rpx 20rpx;
  1033. border-radius: 36rpx 14rpx 0 0;
  1034. }
  1035. &.on2 {
  1036. position: relative;
  1037. &::before {
  1038. position: absolute;
  1039. bottom: 0;
  1040. content: "到店自提";
  1041. font-size: 28rpx;
  1042. display: block;
  1043. height: 0;
  1044. width: 401rpx;
  1045. border-width: 0 0 60rpx 60rpx;
  1046. border-style: none solid solid;
  1047. border-color: transparent transparent #f7c1bd;
  1048. border-radius: 36rpx 14rpx 0 0;
  1049. text-align: center;
  1050. line-height: 60rpx;
  1051. }
  1052. }
  1053. &:nth-of-type(1).on2::before {
  1054. content: "快递配送";
  1055. border-width: 0 60rpx 60rpx 0;
  1056. border-radius: 14rpx 36rpx 0 0;
  1057. }
  1058. }
  1059. }
  1060. .address {
  1061. width: 690rpx;
  1062. max-height: 180rpx;
  1063. margin: 0 auto;
  1064. padding: 28rpx;
  1065. background-color: #fff;
  1066. box-sizing: border-box;
  1067. .addressCon {
  1068. width: 596rpx;
  1069. font-size: 26rpx;
  1070. color: #666;
  1071. .name {
  1072. font-size: 30rpx;
  1073. color: #282828;
  1074. font-weight: bold;
  1075. margin-bottom: 10rpx;
  1076. .phone {
  1077. margin-left: 50rpx;
  1078. }
  1079. }
  1080. .default {
  1081. margin-right: 12rpx;
  1082. }
  1083. .setaddress {
  1084. color: #333;
  1085. font-size: 28rpx;
  1086. }
  1087. }
  1088. .iconfont {
  1089. font-size: 35rpx;
  1090. color: #707070;
  1091. }
  1092. }
  1093. .line {
  1094. width: 100%;
  1095. margin: 0 auto;
  1096. }
  1097. }
  1098. .wrapper {
  1099. background-color: #fff;
  1100. margin-top: 15rpx;
  1101. .item {
  1102. padding: 27rpx 24rpx;
  1103. font-size: 30rpx;
  1104. color: #333333;
  1105. border-bottom: 1px solid #f5f5f5;
  1106. .zf-box {
  1107. display: flex;
  1108. justify-content: space-between;
  1109. align-items: center;
  1110. }
  1111. .swicth-box {
  1112. display: flex;
  1113. justify-content: space-between;
  1114. align-items: center;
  1115. border: 2rpx solid #eee;
  1116. height: 86rpx;
  1117. font-size: 28rpx;
  1118. padding: 0 0 0 12%;
  1119. box-sizing: border-box;
  1120. margin: 20rpx 0;
  1121. border-radius: 14rpx;
  1122. .lable-box {
  1123. display: flex;
  1124. align-items: center;
  1125. .iconfont {
  1126. width: 44rpx;
  1127. height: 44rpx;
  1128. border-radius: 50%;
  1129. text-align: center;
  1130. line-height: 44rpx;
  1131. background-color: #fe960f;
  1132. color: #fff;
  1133. font-size: 30rpx;
  1134. margin-right: 15rpx;
  1135. &.icon-touzijintiao1 {
  1136. background-color: #f0cb88;
  1137. }
  1138. }
  1139. .lable-icon {
  1140. display: flex;
  1141. flex-direction: column;
  1142. justify-content: center;
  1143. }
  1144. .value {
  1145. font-size: 20rpx;
  1146. color: #fe960f;
  1147. }
  1148. }
  1149. }
  1150. .discount {
  1151. font-size: 30rpx;
  1152. color: #333;
  1153. .iconfont {
  1154. color: #515151;
  1155. font-size: 30rpx;
  1156. margin-left: 15rpx;
  1157. }
  1158. .num {
  1159. font-size: 32rpx;
  1160. margin-right: 20rpx;
  1161. }
  1162. .placeholder {
  1163. color: #ccc;
  1164. }
  1165. }
  1166. .shipping {
  1167. font-size: 30rpx;
  1168. color: #999;
  1169. position: relative;
  1170. padding-right: 58rpx;
  1171. .iconfont {
  1172. font-size: 35rpx;
  1173. color: #707070;
  1174. position: absolute;
  1175. right: 0;
  1176. top: 50%;
  1177. transform: translateY(-50%);
  1178. margin-left: 30rpx;
  1179. }
  1180. }
  1181. textarea {
  1182. background-color: #f9f9f9;
  1183. width: auto !important;
  1184. height: 140rpx;
  1185. border-radius: 14rpx;
  1186. margin-top: 30rpx;
  1187. padding: 15rpx;
  1188. box-sizing: border-box;
  1189. font-weight: 400;
  1190. }
  1191. .placeholder {
  1192. color: #ccc;
  1193. }
  1194. .list {
  1195. margin-top: 35rpx;
  1196. .payItem {
  1197. border: 1px solid #eee;
  1198. border-radius: 14rpx;
  1199. height: 86rpx;
  1200. width: 100%;
  1201. box-sizing: border-box;
  1202. margin-top: 20rpx;
  1203. font-size: 28rpx;
  1204. color: #282828;
  1205. &.on {
  1206. border-color: #fc5445;
  1207. color: $theme-color;
  1208. }
  1209. .name {
  1210. flex: 1;
  1211. // width: 50%;
  1212. text-align: center;
  1213. border-right: 1px solid #eee;
  1214. justify-content: flex-start;
  1215. padding: 0 0 0 12%;
  1216. .iconfont {
  1217. width: 44rpx;
  1218. height: 44rpx;
  1219. border-radius: 50%;
  1220. text-align: center;
  1221. line-height: 44rpx;
  1222. background-color: #fe960f;
  1223. color: #fff;
  1224. font-size: 30rpx;
  1225. margin-right: 15rpx;
  1226. &.icon-wechat {
  1227. background-color: #41b035;
  1228. }
  1229. &.icon-zhifubao {
  1230. background-color: #06b4fd;
  1231. }
  1232. }
  1233. }
  1234. .tip {
  1235. width: 49%;
  1236. text-align: center;
  1237. font-size: 26rpx;
  1238. color: #aaa;
  1239. }
  1240. }
  1241. }
  1242. }
  1243. }
  1244. .moneyList {
  1245. margin-top: 15rpx;
  1246. background-color: #fff;
  1247. padding: 30rpx;
  1248. .item {
  1249. font-size: 28rpx;
  1250. color: #282828;
  1251. & ~ .item {
  1252. margin-top: 20rpx;
  1253. }
  1254. .money {
  1255. color: #666666;
  1256. }
  1257. }
  1258. }
  1259. .footer {
  1260. width: 100%;
  1261. height: 100rpx;
  1262. background-color: #fff;
  1263. padding: 0 30rpx;
  1264. font-size: 28rpx;
  1265. color: #333;
  1266. box-sizing: border-box;
  1267. position: fixed;
  1268. bottom: 0;
  1269. left: 0;
  1270. .settlement {
  1271. font-size: 30rpx;
  1272. color: #fff;
  1273. width: 240rpx;
  1274. height: 70rpx;
  1275. background-color: $theme-color;
  1276. border-radius: 50rpx;
  1277. text-align: center;
  1278. line-height: 70rpx;
  1279. z-index: 100;
  1280. }
  1281. .transparent {
  1282. opacity: 0;
  1283. }
  1284. }
  1285. }
  1286. .line2 {
  1287. width: 504rpx;
  1288. }
  1289. .textR {
  1290. text-align: right;
  1291. }
  1292. </style>