index_bf.vue 44 KB

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