index.vue 44 KB

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