index.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416
  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. uni.navigateTo({
  935. url: "/pages/users/vault/recharge",
  936. });
  937. }
  938. const SubOrder = async (e) => {
  939. console.log("SubOrder", payType.value);
  940. // if (payType.value == "alipay") {
  941. // return Toast({ title: "暂不支持支付宝支付,请使用余额支付" });
  942. // }
  943. let data = {}; // 订单提交数据
  944. // 验证:必须选择支付方式
  945. if (!payType.value) return Toast({ title: "请选择支付方式" });
  946. // 验证:快递配送时必须选择地址
  947. if (!address.value.addressId && !shippingType.value) {
  948. return Toast({ title: "请选择收货地址" });
  949. }
  950. try {
  951. const channels = await getAvailableChannels();
  952. if (payType.value === "alipay" && !channels.includes("alipay")) {
  953. return Toast({ title: "设备不支持支付宝支付" });
  954. } else if (payType.value === "weixin" && !channels.includes("wxpay")) {
  955. return Toast({ title: "设备不支持微信支付" });
  956. }
  957. } catch (error) {
  958. console.error("获取支付渠道失败", error);
  959. return Toast({ title: "获取支付渠道失败" });
  960. }
  961. // 构造订单提交数据
  962. data = {
  963. mallType: orderInfoVo.value.mallType,
  964. realName: contacts.value,
  965. phone: contactsTel.value,
  966. addressId: address.value.addressId,
  967. couponId: couponId.value,
  968. payType: payType.value,
  969. useIntegral: useIntegral.value,
  970. preOrderNo: preOrderNo.value,
  971. mark: mark.value,
  972. // storeId: system_store.value.id || 0,
  973. shippingType: util.$h.Add(shippingType.value, 1),
  974. // payChannel: payChannel.value || "weixinh5",
  975. payChannel: userSelectPayTypeItem.value.payChannel,
  976. };
  977. console.log(" data.payType", data.payType);
  978. // 验证:贝币支付时余额是否充足
  979. if (
  980. orderInfoVo.value.mallType === 1 &&
  981. Number(orderInfoVo.value.proTotalFee) > orderInfoVo.value.userIntegral
  982. ) {
  983. return Toast({ title: "贝币余额不足!" });
  984. }
  985. // 验证:余额支付时余额是否充足
  986. else if (
  987. data.payType == "yue" &&
  988. parseFloat(appStore.$userInfo.nowMoney) <
  989. parseFloat(orderInfoVo.value.payFee)
  990. ) {
  991. // 余额不足
  992. showModal.value = true;
  993. return;
  994. }
  995. uni.showLoading({
  996. title: "订单支付中",
  997. });
  998. // 发起支付
  999. payment(data);
  1000. };
  1001. </script>
  1002. <style lang="scss" scoped>
  1003. .order-submission {
  1004. .line {
  1005. width: 100%;
  1006. height: 3rpx;
  1007. image {
  1008. width: 100%;
  1009. height: 100%;
  1010. display: block;
  1011. }
  1012. }
  1013. .allAddress {
  1014. width: 100%;
  1015. // background-image: linear-gradient(to bottom, #f0cb88 0%, transparent 100%);
  1016. background: $uni-bg-primary;
  1017. padding: 100rpx 30rpx 0 30rpx;
  1018. .nav {
  1019. width: 690rpx;
  1020. margin: 0 auto;
  1021. .item {
  1022. width: 334rpx;
  1023. &.on {
  1024. position: relative;
  1025. width: 230rpx;
  1026. &::before {
  1027. position: absolute;
  1028. bottom: 0;
  1029. content: "快递配送";
  1030. font-size: 28rpx;
  1031. display: block;
  1032. height: 0;
  1033. width: 336rpx;
  1034. border-width: 0 20rpx 80rpx 0;
  1035. border-style: none solid solid;
  1036. border-color: transparent transparent #fff;
  1037. z-index: 2;
  1038. border-radius: 14rpx 36rpx 0 0;
  1039. text-align: center;
  1040. line-height: 80rpx;
  1041. }
  1042. }
  1043. &:nth-of-type(2).on::before {
  1044. content: "到店自提";
  1045. border-width: 0 0 80rpx 20rpx;
  1046. border-radius: 36rpx 14rpx 0 0;
  1047. }
  1048. &.on2 {
  1049. position: relative;
  1050. &::before {
  1051. position: absolute;
  1052. bottom: 0;
  1053. content: "到店自提";
  1054. font-size: 28rpx;
  1055. display: block;
  1056. height: 0;
  1057. width: 401rpx;
  1058. border-width: 0 0 60rpx 60rpx;
  1059. border-style: none solid solid;
  1060. border-color: transparent transparent #f7c1bd;
  1061. border-radius: 36rpx 14rpx 0 0;
  1062. text-align: center;
  1063. line-height: 60rpx;
  1064. }
  1065. }
  1066. &:nth-of-type(1).on2::before {
  1067. content: "快递配送";
  1068. border-width: 0 60rpx 60rpx 0;
  1069. border-radius: 14rpx 36rpx 0 0;
  1070. }
  1071. }
  1072. }
  1073. .address {
  1074. width: 690rpx;
  1075. max-height: 180rpx;
  1076. margin: 0 auto;
  1077. padding: 28rpx;
  1078. background-color: #fff;
  1079. box-sizing: border-box;
  1080. .addressCon {
  1081. width: 596rpx;
  1082. font-size: 26rpx;
  1083. color: #666;
  1084. .name {
  1085. font-size: 30rpx;
  1086. color: #282828;
  1087. font-weight: bold;
  1088. margin-bottom: 10rpx;
  1089. .phone {
  1090. margin-left: 50rpx;
  1091. }
  1092. }
  1093. .default {
  1094. margin-right: 12rpx;
  1095. }
  1096. .setaddress {
  1097. color: #333;
  1098. font-size: 28rpx;
  1099. }
  1100. }
  1101. .iconfont {
  1102. font-size: 35rpx;
  1103. color: #707070;
  1104. }
  1105. }
  1106. .line {
  1107. width: 100%;
  1108. margin: 0 auto;
  1109. }
  1110. }
  1111. .wrapper {
  1112. background-color: #fff;
  1113. margin-top: 15rpx;
  1114. .item {
  1115. padding: 27rpx 24rpx;
  1116. font-size: 30rpx;
  1117. color: #333333;
  1118. border-bottom: 1px solid #f5f5f5;
  1119. .zf-box {
  1120. display: flex;
  1121. justify-content: space-between;
  1122. align-items: center;
  1123. }
  1124. .swicth-box {
  1125. display: flex;
  1126. justify-content: space-between;
  1127. align-items: center;
  1128. border: 2rpx solid #eee;
  1129. height: 86rpx;
  1130. font-size: 28rpx;
  1131. padding: 0 0 0 12%;
  1132. box-sizing: border-box;
  1133. margin: 20rpx 0;
  1134. border-radius: 14rpx;
  1135. .lable-box {
  1136. display: flex;
  1137. align-items: center;
  1138. .iconfont {
  1139. width: 44rpx;
  1140. height: 44rpx;
  1141. border-radius: 50%;
  1142. text-align: center;
  1143. line-height: 44rpx;
  1144. background-color: #fe960f;
  1145. color: #fff;
  1146. font-size: 30rpx;
  1147. margin-right: 15rpx;
  1148. &.icon-touzijintiao1 {
  1149. background-color: #f0cb88;
  1150. }
  1151. }
  1152. .lable-icon {
  1153. display: flex;
  1154. flex-direction: column;
  1155. justify-content: center;
  1156. }
  1157. .value {
  1158. font-size: 20rpx;
  1159. color: #fe960f;
  1160. }
  1161. }
  1162. }
  1163. .discount {
  1164. font-size: 30rpx;
  1165. color: #333;
  1166. .iconfont {
  1167. color: #515151;
  1168. font-size: 30rpx;
  1169. margin-left: 15rpx;
  1170. }
  1171. .num {
  1172. font-size: 32rpx;
  1173. margin-right: 20rpx;
  1174. }
  1175. .placeholder {
  1176. color: #ccc;
  1177. }
  1178. }
  1179. .shipping {
  1180. font-size: 30rpx;
  1181. color: #999;
  1182. position: relative;
  1183. padding-right: 58rpx;
  1184. .iconfont {
  1185. font-size: 35rpx;
  1186. color: #707070;
  1187. position: absolute;
  1188. right: 0;
  1189. top: 50%;
  1190. transform: translateY(-50%);
  1191. margin-left: 30rpx;
  1192. }
  1193. }
  1194. textarea {
  1195. background-color: #f9f9f9;
  1196. width: auto !important;
  1197. height: 140rpx;
  1198. border-radius: 14rpx;
  1199. margin-top: 30rpx;
  1200. padding: 15rpx;
  1201. box-sizing: border-box;
  1202. font-weight: 400;
  1203. }
  1204. .placeholder {
  1205. color: #ccc;
  1206. }
  1207. .list {
  1208. margin-top: 35rpx;
  1209. .payItem {
  1210. border: 1px solid #eee;
  1211. border-radius: 14rpx;
  1212. height: 86rpx;
  1213. width: 100%;
  1214. box-sizing: border-box;
  1215. margin-top: 20rpx;
  1216. font-size: 28rpx;
  1217. color: #282828;
  1218. &.on {
  1219. border-color: #fc5445;
  1220. color: $theme-color;
  1221. }
  1222. .name {
  1223. flex: 1;
  1224. // width: 50%;
  1225. text-align: center;
  1226. border-right: 1px solid #eee;
  1227. justify-content: flex-start;
  1228. padding: 0 0 0 12%;
  1229. .iconfont {
  1230. width: 44rpx;
  1231. height: 44rpx;
  1232. border-radius: 50%;
  1233. text-align: center;
  1234. line-height: 44rpx;
  1235. background-color: #fe960f;
  1236. color: #fff;
  1237. font-size: 30rpx;
  1238. margin-right: 15rpx;
  1239. &.icon-wechat {
  1240. background-color: #41b035;
  1241. }
  1242. &.icon-zhifubao {
  1243. background-color: #06b4fd;
  1244. }
  1245. }
  1246. }
  1247. .tip {
  1248. width: 49%;
  1249. text-align: center;
  1250. font-size: 26rpx;
  1251. color: #aaa;
  1252. }
  1253. }
  1254. }
  1255. }
  1256. }
  1257. .moneyList {
  1258. margin-top: 15rpx;
  1259. background-color: #fff;
  1260. padding: 30rpx;
  1261. .item {
  1262. font-size: 28rpx;
  1263. color: #282828;
  1264. & ~ .item {
  1265. margin-top: 20rpx;
  1266. }
  1267. .money {
  1268. color: #666666;
  1269. }
  1270. }
  1271. }
  1272. .footer {
  1273. width: 100%;
  1274. height: 100rpx;
  1275. background-color: #fff;
  1276. padding: 0 30rpx;
  1277. font-size: 28rpx;
  1278. color: #333;
  1279. box-sizing: border-box;
  1280. position: fixed;
  1281. bottom: 0;
  1282. left: 0;
  1283. .settlement {
  1284. font-size: 30rpx;
  1285. color: #fff;
  1286. width: 240rpx;
  1287. height: 70rpx;
  1288. background-color: $theme-color;
  1289. border-radius: 50rpx;
  1290. text-align: center;
  1291. line-height: 70rpx;
  1292. z-index: 100;
  1293. }
  1294. .transparent {
  1295. opacity: 0;
  1296. }
  1297. }
  1298. }
  1299. .line2 {
  1300. width: 504rpx;
  1301. }
  1302. .textR {
  1303. text-align: right;
  1304. }
  1305. </style>