index.vue 44 KB

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