index.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448
  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. })
  636. .catch((err) => {
  637. // 失败回调
  638. Toast({ title: err }); // 提示错误
  639. });
  640. }
  641. // 切换配送方式(快递/自提)
  642. const addressType = (e) => {
  643. let index = e; // 0-快递,1-自提
  644. shippingType.value = parseInt(index); // 更新配送方式
  645. // 若为普通商城类型,重新计算价格
  646. if (orderInfoVo.value.mallType === 0) {
  647. computedPrice();
  648. }
  649. // if (index == 1) getList();
  650. };
  651. // 配送方式选择器变化事件(预留,用于下拉选择器)
  652. const bindPickerChange = (e) => {
  653. let value = e.detail.value; // 选择的索引
  654. shippingType.value = value; // 更新配送方式
  655. computedPrice(); // 重新计算价格
  656. };
  657. // 关闭优惠券弹窗
  658. const closeCouponPopup = () => {
  659. showCouponPopup.value = false; // 隐藏优惠券弹窗
  660. };
  661. // 改变备注框状态(优惠券选择后调用)
  662. const changeTextareaStatus = () => {
  663. // 重置所有优惠券的选中状态
  664. for (let i = 0, len = coupon.value.list.length; i < len; i++) {
  665. coupon.value.list[i].use_title = "";
  666. coupon.value.list[i].is_use = 0;
  667. }
  668. textareaStatus.value = true; // 显示备注框
  669. status.value = 0; // 重置状态
  670. coupon.value.list = coupon.value.list; // 触发响应式更新
  671. };
  672. // 选择优惠券后的处理事件
  673. const ChangCoupons = (e) => {
  674. // this.usableCoupon = e
  675. // this.coupon.coupon = false
  676. let index = e,
  677. list = coupon.value.list,
  678. couponTitleValue = "请选择",
  679. couponIdValue = 0;
  680. console.log("list", list);
  681. for (let i = 0, len = list.length; i < len; i++) {
  682. if (i != index) {
  683. list[i].use_title = "";
  684. list[i].isUse = 0;
  685. }
  686. }
  687. // 切换当前优惠券的选中状态
  688. if (list[index].isUse) {
  689. // 若已选中,则取消选择
  690. list[index].use_title = "";
  691. list[index].isUse = 0;
  692. } else {
  693. // 若未选中,则选中
  694. list[index].use_title = "不使用"; // 显示"不使用"按钮
  695. list[index].isUse = 1; // 标记为选中
  696. couponTitleValue = list[index].name; // 更新标题为优惠券名称
  697. couponIdValue = list[index].id; // 更新选中的优惠券ID
  698. }
  699. // 更新优惠券相关状态
  700. couponTitle.value = couponTitleValue;
  701. couponId.value = couponIdValue;
  702. coupon.value.coupon = false;
  703. // coupon.value.list = list;
  704. computedPrice();
  705. };
  706. // 首次进入页面时展示默认地址
  707. const OnDefaultAddress = (e) => {
  708. addressInfo.value = e; // 保存默认地址详情
  709. address.value.addressId = e.id; // 更新选中地址ID
  710. };
  711. // 选择地址后触发的事件
  712. const OnChangeAddress = (e) => {
  713. console.log("OnChangeAddress", e);
  714. addressInfo.value = e;
  715. address.value.addressId = e.id;
  716. textareaStatus.value = true;
  717. //orderInfoVo.value.addressId = e;
  718. address.value.address = false;
  719. //this.getaddressInfo();
  720. if (orderInfoVo.value.mallType === 0) {
  721. computedPrice();
  722. }
  723. };
  724. // 备注输入事件(实时保存输入内容)
  725. const bindHideKeyboard = (e) => {
  726. mark.value = e.detail.value; // 保存输入的备注信息
  727. };
  728. // 获取当前订单可用的优惠券列表
  729. const getCouponList = () => {
  730. // 调用获取优惠券API,传入预订单号
  731. getCouponsOrderPrice(preOrderNo.value).then((res) => {
  732. coupon.value.list = res.data; // 保存优惠券列表
  733. openType.value = 1; // 设置打开方式为"使用"
  734. });
  735. };
  736. // 获取默认地址或指定地址详情
  737. const getaddressInfo = () => {
  738. if (addressId.value) {
  739. // 若有指定地址ID,获取该地址详情
  740. getAddressDetail(addressId.value).then((res) => {
  741. if (res.data) {
  742. // 若地址存在
  743. res.data.isDefault = parseInt(res.data.isDefault); // 转换默认地址标识为数字
  744. addressInfo.value = res.data || {}; // 保存地址详情
  745. addressId.value = res.data.id || 0; // 更新地址ID
  746. address.value.addressId = res.data.id || 0; // 更新选中地址ID
  747. }
  748. });
  749. } else {
  750. // 若没有指定地址ID,获取默认地址
  751. getAddressDefault().then((res) => {
  752. // 注意:原代码中未导入getAddressDefault,可能是遗漏
  753. if (res.data) {
  754. // 若默认地址存在
  755. res.data.isDefault = parseInt(res.data.isDefault);
  756. addressInfo.value = res.data || {};
  757. addressId.value = res.data.id || 0;
  758. address.value.addressId = res.data.id || 0;
  759. }
  760. });
  761. }
  762. };
  763. // 选择支付方式
  764. const payItem = (e) => {
  765. let activeValue = e;
  766. active.value = activeValue;
  767. animated.value = true;
  768. payType.value = payments.value[activeValue].value;
  769. userSelectPayTypeItem.value = payments.value[activeValue];
  770. computedPrice();
  771. setTimeout(() => {
  772. car();
  773. }, 500);
  774. };
  775. // 打开优惠券弹窗
  776. const couponTap = () => {
  777. // coupon.value.coupon = true;
  778. showCouponPopup.value = true;
  779. if (!coupon.value.list.length) getCouponList();
  780. // getCouponList();
  781. };
  782. // 关闭支付方式选择动画
  783. const car = () => {
  784. animated.value = false; // 关闭动画
  785. };
  786. // 打开地址选择弹窗
  787. const onAddress = () => {
  788. textareaStatus.value = false; // 隐藏备注框
  789. address.value.address = true; // 显示地址弹窗
  790. // 设置地址页面跳转链接(携带预订单号)
  791. pagesUrl.value =
  792. "/pages/users/user_address_list/index?preOrderNo=" + preOrderNo.value;
  793. };
  794. // 联系人输入事件(保存联系人)
  795. const realName = (e) => {
  796. contacts.value = e.detail.value;
  797. };
  798. // 联系人电话输入事件(保存电话)
  799. const phone = (e) => {
  800. contactsTel.value = e.detail.value;
  801. };
  802. // 创建订单并发起支付
  803. const payment = (data) => {
  804. // 调用创建订单API
  805. orderCreate(data)
  806. .then((res) => {
  807. // 订单创建成功
  808. // 调用支付流程,传入订单号和成功提示
  809. getOrderPay(res.data.orderNo, "支付成功");
  810. })
  811. .catch((err) => {
  812. // 订单创建失败
  813. console.error("payment error", err); // 打印错误
  814. uni.hideLoading(); // 隐藏加载中
  815. Toast({ title: err }); // 提示错误
  816. });
  817. };
  818. // 处理支付流程(根据支付类型发起支付并处理结果)
  819. const getOrderPay = async (orderNo, message) => {
  820. // 支付结果页地址(携带订单号)
  821. const goPages = "/pages/order_pay_status/index?order_id=" + orderNo;
  822. try {
  823. // 调用微信支付配置API(获取支付参数)
  824. const res = await wechatOrderPay({
  825. mallType: orderInfoVo.value.mallType,
  826. orderNo: orderNo,
  827. // payChannel: payChannel.value,
  828. payChannel: userSelectPayTypeItem.value.payChannel,
  829. payType: payType.value,
  830. scene: appStore.productTypeComputed === "normal" ? 0 : 1177, // 下单时小程序的场景值
  831. });
  832. console.log("res-------------", res.data);
  833. let jsConfig = res.data.prepayWithRequestPaymentResponse;
  834. switch (res.data.payType) {
  835. case "alipay":
  836. // 发起支付宝支付
  837. const result = await submitPayment({
  838. type: res.data.payType, // 支付类型
  839. orderInfo: res.data.alipayRequest, // 支付宝支付参数
  840. });
  841. console.log("result", result); // 打印支付结果
  842. // 失败提示信息(默认"支付失败")
  843. let failMsg = result?.message || paymentConfig.PAYMENT_STATUS.FAIL;
  844. // 根据支付结果处理
  845. if (result.status === paymentConfig.PAYMENT_STATUS.SUCCESS) {
  846. // 支付成功:查询后端支付状态
  847. const params = {
  848. orderNo: orderNo,
  849. payType: "alipay",
  850. };
  851. console.log("进入成功判断", params);
  852. const res = await alipayPaymentResult(params); // 调用查询接口
  853. console.log("alipayPaymentResult", res);
  854. // 提示成功并跳转到结果页
  855. return Toast(
  856. { title: paymentConfig.PAYMENT_STATUS.SUCCESS, icon: "success" },
  857. { tab: 4, url: goPages }
  858. );
  859. } else if (result.status === paymentConfig.PAYMENT_STATUS.FAIL) {
  860. // 支付失败:提示并跳转
  861. return Toast(
  862. { title: paymentConfig.PAYMENT_STATUS.FAIL },
  863. { tab: 5, url: `${goPages}&msg=${failMsg}` }
  864. );
  865. } else if (result.status === paymentConfig.PAYMENT_STATUS.CANCEL) {
  866. // 支付取消:提示并跳转
  867. return Toast(
  868. { title: paymentConfig.PAYMENT_STATUS.CANCEL },
  869. {
  870. tab: 5,
  871. url: `${goPages}&msg=${paymentConfig.PAYMENT_STATUS.CANCEL}`,
  872. }
  873. );
  874. }
  875. break;
  876. case "yue":
  877. // 余额支付:直接提示成功并跳转
  878. console.log("余额支付");
  879. return Toast(
  880. { title: message },
  881. { tab: 5, url: goPages + "&status=1" }
  882. );
  883. break;
  884. case "weixinApp":
  885. const wxPayResult = await submitPayment({
  886. type: res.data.payType,
  887. orderInfo: res.data.prepayWithRequestPaymentResponse,
  888. });
  889. let wxPayFailMsg =
  890. wxPayResult?.message || paymentConfig.PAYMENT_STATUS.FAIL;
  891. if (wxPayResult.status === paymentConfig.PAYMENT_STATUS.SUCCESS) {
  892. // 查询后端支付状态接口
  893. let params = {
  894. orderNo: orderNo,
  895. payType: "weixinApp",
  896. };
  897. let res = await alipayPaymentResult(params);
  898. return Toast(
  899. { title: paymentConfig.PAYMENT_STATUS.SUCCESS, icon: "success" },
  900. { tab: 4, url: goPages }
  901. );
  902. } else if (wxPayResult.status === paymentConfig.PAYMENT_STATUS.FAIL) {
  903. return Toast(
  904. { title: paymentConfig.PAYMENT_STATUS.FAIL },
  905. { tab: 5, url: `${goPages}&msg=${wxPayFailMsg}` }
  906. );
  907. } else if (wxPayResult.status === paymentConfig.PAYMENT_STATUS.CANCEL) {
  908. return Toast(
  909. { title: paymentConfig.PAYMENT_STATUS.CANCEL },
  910. {
  911. tab: 5,
  912. url: `${goPages}&msg=${paymentConfig.PAYMENT_STATUS.CANCEL}`,
  913. }
  914. );
  915. }
  916. break;
  917. }
  918. uni.hideLoading(); // 隐藏加载中
  919. } catch (error) {
  920. // 支付过程出错
  921. console.error("getOrderPay error", error, typeof error);
  922. let msg = "";
  923. // 处理错误信息
  924. if (typeof error === "string") {
  925. msg = error;
  926. } else if (typeof error === "object" && error.message) {
  927. msg = error.message;
  928. } else {
  929. msg = "支付失败,请稍后再试";
  930. }
  931. uni.hideLoading(); // 隐藏加载中
  932. // 跳转到结果页并携带错误信息
  933. uni.navigateTo({
  934. url: `/pages/order_pay_status/index?order_id=${orderNo}&msg=${msg}`,
  935. });
  936. return Toast({ title: msg }); // 提示错误
  937. }
  938. };
  939. function modalConfirm() {
  940. showModal.value = false;
  941. const webviewPageUrl = `/pages/webview/index?path=/pages/users/vault/rechargeRmb`;
  942. uni.navigateTo({
  943. url: webviewPageUrl,
  944. fail: (err) => {
  945. console.error("跳转到webview页面失败:", err);
  946. uni.showToast({
  947. title: "跳转失败,请重试",
  948. icon: "none",
  949. duration: 1500,
  950. });
  951. },
  952. });
  953. // uni.navigateTo({
  954. // url: "/pages/users/vault/recharge",
  955. // });
  956. }
  957. const SubOrder = async (e) => {
  958. console.log("SubOrder", payType.value);
  959. // if (payType.value == "alipay") {
  960. // return Toast({ title: "暂不支持支付宝支付,请使用余额支付" });
  961. // }
  962. let data = {}; // 订单提交数据
  963. // 验证:必须选择支付方式
  964. if (!payType.value) return Toast({ title: "请选择支付方式" });
  965. // 验证:快递配送时必须选择地址
  966. if (!address.value.addressId && !shippingType.value) {
  967. return Toast({ title: "请选择收货地址" });
  968. }
  969. try {
  970. const channels = await getAvailableChannels();
  971. if (payType.value === "alipay" && !channels.includes("alipay")) {
  972. return Toast({ title: "设备不支持支付宝支付" });
  973. } else if (payType.value === "weixin" && !channels.includes("wxpay")) {
  974. return Toast({ title: "设备不支持微信支付" });
  975. }
  976. } catch (error) {
  977. console.error("获取支付渠道失败", error);
  978. return Toast({ title: "获取支付渠道失败" });
  979. }
  980. // 构造订单提交数据
  981. data = {
  982. mallType: orderInfoVo.value.mallType,
  983. realName: contacts.value,
  984. phone: contactsTel.value,
  985. addressId: address.value.addressId,
  986. couponId: couponId.value,
  987. payType: payType.value,
  988. useIntegral: useIntegral.value,
  989. preOrderNo: preOrderNo.value,
  990. mark: mark.value,
  991. // storeId: system_store.value.id || 0,
  992. shippingType: util.$h.Add(shippingType.value, 1),
  993. // payChannel: payChannel.value || "weixinh5",
  994. payChannel: userSelectPayTypeItem.value.payChannel,
  995. };
  996. console.log(" data.payType", data.payType);
  997. // 验证:贝币支付时余额是否充足
  998. if (
  999. orderInfoVo.value.mallType === 1 &&
  1000. Number(orderInfoVo.value.proTotalFee) > orderInfoVo.value.userIntegral
  1001. ) {
  1002. return Toast({ title: "贝币余额不足!" });
  1003. }
  1004. // 验证:余额支付时余额是否充足
  1005. else if (
  1006. data.payType == "yue" &&
  1007. parseFloat(appStore.$userInfo.nowMoney) <
  1008. parseFloat(orderInfoVo.value.payFee)
  1009. ) {
  1010. // 余额不足
  1011. showModal.value = true;
  1012. return;
  1013. }
  1014. uni.showModal({
  1015. title: "提示",
  1016. content: "确认支付吗",
  1017. success: res=>{
  1018. console.log(res);
  1019. if(res.confirm){
  1020. uni.showLoading({
  1021. title: "订单支付中",
  1022. });
  1023. // 发起支付
  1024. payment(data);
  1025. }else{
  1026. return
  1027. }
  1028. },
  1029. })
  1030. };
  1031. </script>
  1032. <style lang="scss" scoped>
  1033. .order-submission {
  1034. .line {
  1035. width: 100%;
  1036. height: 3rpx;
  1037. image {
  1038. width: 100%;
  1039. height: 100%;
  1040. display: block;
  1041. }
  1042. }
  1043. .allAddress {
  1044. width: 100%;
  1045. // background-image: linear-gradient(to bottom, #f0cb88 0%, transparent 100%);
  1046. background: $uni-bg-primary;
  1047. padding: 100rpx 30rpx 0 30rpx;
  1048. .nav {
  1049. width: 690rpx;
  1050. margin: 0 auto;
  1051. .item {
  1052. width: 334rpx;
  1053. &.on {
  1054. position: relative;
  1055. width: 230rpx;
  1056. &::before {
  1057. position: absolute;
  1058. bottom: 0;
  1059. content: "快递配送";
  1060. font-size: 28rpx;
  1061. display: block;
  1062. height: 0;
  1063. width: 336rpx;
  1064. border-width: 0 20rpx 80rpx 0;
  1065. border-style: none solid solid;
  1066. border-color: transparent transparent #fff;
  1067. z-index: 2;
  1068. border-radius: 14rpx 36rpx 0 0;
  1069. text-align: center;
  1070. line-height: 80rpx;
  1071. }
  1072. }
  1073. &:nth-of-type(2).on::before {
  1074. content: "到店自提";
  1075. border-width: 0 0 80rpx 20rpx;
  1076. border-radius: 36rpx 14rpx 0 0;
  1077. }
  1078. &.on2 {
  1079. position: relative;
  1080. &::before {
  1081. position: absolute;
  1082. bottom: 0;
  1083. content: "到店自提";
  1084. font-size: 28rpx;
  1085. display: block;
  1086. height: 0;
  1087. width: 401rpx;
  1088. border-width: 0 0 60rpx 60rpx;
  1089. border-style: none solid solid;
  1090. border-color: transparent transparent #f7c1bd;
  1091. border-radius: 36rpx 14rpx 0 0;
  1092. text-align: center;
  1093. line-height: 60rpx;
  1094. }
  1095. }
  1096. &:nth-of-type(1).on2::before {
  1097. content: "快递配送";
  1098. border-width: 0 60rpx 60rpx 0;
  1099. border-radius: 14rpx 36rpx 0 0;
  1100. }
  1101. }
  1102. }
  1103. .address {
  1104. width: 690rpx;
  1105. max-height: 180rpx;
  1106. margin: 0 auto;
  1107. padding: 28rpx;
  1108. background-color: #fff;
  1109. box-sizing: border-box;
  1110. .addressCon {
  1111. width: 596rpx;
  1112. font-size: 26rpx;
  1113. color: #666;
  1114. .name {
  1115. font-size: 30rpx;
  1116. color: #282828;
  1117. font-weight: bold;
  1118. margin-bottom: 10rpx;
  1119. .phone {
  1120. margin-left: 50rpx;
  1121. }
  1122. }
  1123. .default {
  1124. margin-right: 12rpx;
  1125. }
  1126. .setaddress {
  1127. color: #333;
  1128. font-size: 28rpx;
  1129. }
  1130. }
  1131. .iconfont {
  1132. font-size: 35rpx;
  1133. color: #707070;
  1134. }
  1135. }
  1136. .line {
  1137. width: 100%;
  1138. margin: 0 auto;
  1139. }
  1140. }
  1141. .wrapper {
  1142. background-color: #fff;
  1143. margin-top: 15rpx;
  1144. .item {
  1145. padding: 27rpx 24rpx;
  1146. font-size: 30rpx;
  1147. color: #333333;
  1148. border-bottom: 1px solid #f5f5f5;
  1149. .zf-box {
  1150. display: flex;
  1151. justify-content: space-between;
  1152. align-items: center;
  1153. }
  1154. .swicth-box {
  1155. display: flex;
  1156. justify-content: space-between;
  1157. align-items: center;
  1158. border: 2rpx solid #eee;
  1159. height: 86rpx;
  1160. font-size: 28rpx;
  1161. padding: 0 0 0 12%;
  1162. box-sizing: border-box;
  1163. margin: 20rpx 0;
  1164. border-radius: 14rpx;
  1165. .lable-box {
  1166. display: flex;
  1167. align-items: center;
  1168. .iconfont {
  1169. width: 44rpx;
  1170. height: 44rpx;
  1171. border-radius: 50%;
  1172. text-align: center;
  1173. line-height: 44rpx;
  1174. background-color: #fe960f;
  1175. color: #fff;
  1176. font-size: 30rpx;
  1177. margin-right: 15rpx;
  1178. &.icon-touzijintiao1 {
  1179. background-color: #f0cb88;
  1180. }
  1181. }
  1182. .lable-icon {
  1183. display: flex;
  1184. flex-direction: column;
  1185. justify-content: center;
  1186. }
  1187. .value {
  1188. font-size: 20rpx;
  1189. color: #fe960f;
  1190. }
  1191. }
  1192. }
  1193. .discount {
  1194. font-size: 30rpx;
  1195. color: #333;
  1196. .iconfont {
  1197. color: #515151;
  1198. font-size: 30rpx;
  1199. margin-left: 15rpx;
  1200. }
  1201. .num {
  1202. font-size: 32rpx;
  1203. margin-right: 20rpx;
  1204. }
  1205. .placeholder {
  1206. color: #ccc;
  1207. }
  1208. }
  1209. .shipping {
  1210. font-size: 30rpx;
  1211. color: #999;
  1212. position: relative;
  1213. padding-right: 58rpx;
  1214. .iconfont {
  1215. font-size: 35rpx;
  1216. color: #707070;
  1217. position: absolute;
  1218. right: 0;
  1219. top: 50%;
  1220. transform: translateY(-50%);
  1221. margin-left: 30rpx;
  1222. }
  1223. }
  1224. textarea {
  1225. background-color: #f9f9f9;
  1226. width: auto !important;
  1227. height: 140rpx;
  1228. border-radius: 14rpx;
  1229. margin-top: 30rpx;
  1230. padding: 15rpx;
  1231. box-sizing: border-box;
  1232. font-weight: 400;
  1233. }
  1234. .placeholder {
  1235. color: #ccc;
  1236. }
  1237. .list {
  1238. margin-top: 35rpx;
  1239. .payItem {
  1240. border: 1px solid #eee;
  1241. border-radius: 14rpx;
  1242. height: 86rpx;
  1243. width: 100%;
  1244. box-sizing: border-box;
  1245. margin-top: 20rpx;
  1246. font-size: 28rpx;
  1247. color: #282828;
  1248. &.on {
  1249. border-color: #fc5445;
  1250. color: $theme-color;
  1251. }
  1252. .name {
  1253. flex: 1;
  1254. // width: 50%;
  1255. text-align: center;
  1256. border-right: 1px solid #eee;
  1257. justify-content: flex-start;
  1258. padding: 0 0 0 12%;
  1259. .iconfont {
  1260. width: 44rpx;
  1261. height: 44rpx;
  1262. border-radius: 50%;
  1263. text-align: center;
  1264. line-height: 44rpx;
  1265. background-color: #fe960f;
  1266. color: #fff;
  1267. font-size: 30rpx;
  1268. margin-right: 15rpx;
  1269. &.icon-wechat {
  1270. background-color: #41b035;
  1271. }
  1272. &.icon-zhifubao {
  1273. background-color: #06b4fd;
  1274. }
  1275. }
  1276. }
  1277. .tip {
  1278. width: 49%;
  1279. text-align: center;
  1280. font-size: 26rpx;
  1281. color: #aaa;
  1282. }
  1283. }
  1284. }
  1285. }
  1286. }
  1287. .moneyList {
  1288. margin-top: 15rpx;
  1289. background-color: #fff;
  1290. padding: 30rpx;
  1291. .item {
  1292. font-size: 28rpx;
  1293. color: #282828;
  1294. & ~ .item {
  1295. margin-top: 20rpx;
  1296. }
  1297. .money {
  1298. color: #666666;
  1299. }
  1300. }
  1301. }
  1302. .footer {
  1303. width: 100%;
  1304. height: 100rpx;
  1305. background-color: #fff;
  1306. padding: 0 30rpx;
  1307. font-size: 28rpx;
  1308. color: #333;
  1309. box-sizing: border-box;
  1310. position: fixed;
  1311. bottom: 0;
  1312. left: 0;
  1313. .settlement {
  1314. font-size: 30rpx;
  1315. color: #fff;
  1316. width: 240rpx;
  1317. height: 70rpx;
  1318. background-color: $theme-color;
  1319. border-radius: 50rpx;
  1320. text-align: center;
  1321. line-height: 70rpx;
  1322. z-index: 100;
  1323. }
  1324. .transparent {
  1325. opacity: 0;
  1326. }
  1327. }
  1328. }
  1329. .line2 {
  1330. width: 504rpx;
  1331. }
  1332. .textR {
  1333. text-align: right;
  1334. }
  1335. </style>