index.vue 43 KB

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