index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. <template>
  2. <div class="container">
  3. <div class="content">
  4. <van-pull-refresh v-model="loading" @refresh="onRefresh" style="height:100%">
  5. <div class="tab-box">
  6. <div class="tab-text"
  7. v-for="(item,i) in tabList" :key="i"
  8. :class="tabActive == i?'active-text':''"
  9. @click="changeTab(i)">{{item}}
  10. </div>
  11. </div>
  12. <div class="information-box">
  13. <div class="information-ul">
  14. <div class="information-title">{{ $t('transaction.CurrentPriceSTT') }}</div>
  15. <div class="rate">{{formatToFixed4(WGTLIST.rate)}}</div>
  16. <div class="cny">≈CNY {{multiplyAndFormat4(WGTLIST.rate,WGTLIST.cny)}}</div>
  17. <div class="balance">{{ $t('transaction.WalletBalanceWGT') }} {{formatToFixed4(WGTLIST.balance)}}</div>
  18. </div>
  19. <div class="information-ul">
  20. <div class="information-title">{{tabActive == 0?$t('transaction.PurchaseQuantitySTT'):tabActive == 1?$t('transaction.OrderQuantityWGT'):$t('transaction.WalletBalanceWGT')}}</div>
  21. <van-field v-model="valueInput" class="rate" :placeholder="`$t('transaction.PleaseEnter')${tabActive == 0?'STT':'WGT'}{{ $t('transaction.Quantity') }}`"/>
  22. <div class="cny">≈ {{sttAmount.toFixed(4)}} {{ tabActive == 0 ? 'WGT' : 'STT' }}</div>
  23. <div class="balance">{{ $t('transaction.WalletBalanceWGT') }} {{formatToFixed4(STTLIST.balance)}}</div>
  24. </div>
  25. </div>
  26. <van-button class="information-btn" type="primary" size="large" @click="changeBtn">{{tabActive == 0?$t('transaction.BuyWGT'):tabActive == 1?$t('transaction.OrderToSellWGT'):$t('transaction.BookNow')}}</van-button>
  27. <!-- 广告 -->
  28. <div class="card-box">
  29. <div class="card-ul">
  30. <div class="card-li" v-for="(item,i) in cardList" :key="i" >{{item}}</div>
  31. </div>
  32. <div class="list-ul">
  33. <div class="list-li" v-for="item in list" :key="item.id">
  34. <div class="list-text">{{formatAddress(item?.seller_address)}}</div>
  35. <div class="list-text">{{ formatToFixed4(item?.money) }}</div>
  36. <div class="list-text">{{ formatToFixed4(item?.amount) }}</div>
  37. <div class="list-text">
  38. <div class="list-btn" @click="purchase(item)">{{ $t('transaction.Buy') }}</div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- -->
  44. <div class="delegation" v-if="tabActive != 0">
  45. <div class="delegation-label">
  46. <div :class="delegationIndex == 1?'active-label':''" @click="delegationIndex = 1">{{ $t('transaction.CurrentCommission') }}</div>
  47. <div :class="delegationIndex == 2?'active-label':''" @click="delegationIndex = 2">{{ $t('transaction.MarketTrading') }}</div>
  48. </div>
  49. <div class="delegation-ul">
  50. <template v-if="delegationIndex == 1">
  51. <div class="delegation-li" v-for="item in entrustMylist">
  52. <div>
  53. <div class="m4"><text class="cell-label green">{{isSubscribe?$t('transaction.Reservation'):''}}{{ $t('transaction.SellOrder') }}</text>{{ formatAddress(item?.seller_trans_hash) }}</div>
  54. <div class="m4 red"><text class="cell-label">{{isSubscribe?$t('transaction.Reservation'):$t('transaction.Entrusted')}}{{ $t('transaction.Value') }}</text>{{formatToFixed4(item?.money)}} STT</div>
  55. <div class="m4 blue"><text class="cell-label">{{isSubscribe?$t('transaction.Reservation'):$t('transaction.Entrusted')}}{{ $t('transaction.Quantity') }}</text>{{ formatToFixed4(item?.amount) }} WGT</div>
  56. <div><text class="cell-label">{{isSubscribe?$t('transaction.Reservation'):$t('transaction.Entrusted')}}{{ $t('transaction.Time') }}</text>{{item.created_at}}</div>
  57. </div>
  58. <div class="green text-ri">
  59. <div class="m8">{{isSubscribe?$t('transaction.Reservation'):$t('transaction.Current')}}{{ $t('transaction.Price') }} {{ isSubscribe ? formatToFixed4(item.price) : formatToFixed4(WGTLIST.rate) }}</div>
  60. <div style="display: flex;justify-content: flex-end;">
  61. <div v-if="isSubscribe"
  62. class="cell-btn"
  63. :class="item.status == 'N'?'box-entrust':'box-cancel'"
  64. @click="collect(item)">{{item.status == 'N'?$t('transaction.UnderCommission'):$t('transaction.Claim')}}
  65. </div>
  66. <div v-else
  67. class="cell-btn red"
  68. style="border: 1px solid #FF0000;" @click="changeCancel(item)">{{ $t('transaction.Revoke') }}
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <template v-if="delegationIndex == 2">
  75. <div class="delegation-li" v-for="item in entrustBuylist">
  76. <div>
  77. <div class="m4"><text class="cell-label">{{ $t('transaction.SalesOrderNumber') }}</text>{{ formatAddress(item?.seller_trans_hash) }}</div>
  78. <div class="m4"><text class="cell-label">{{ $t('transaction.PaymentNumber') }}</text>{{ formatAddress(item?.pay_trans_hash) }}</div>
  79. <div class="m4 red"><text class="cell-label">{{ $t('transaction.TransactionPrice') }}</text>{{ formatToFixed4(item?.pay_price) }} STT</div>
  80. <div><text class="cell-label">{{ $t('transaction.Time') }}</text>{{item.pay_date}}</div>
  81. </div>
  82. <div class="red text-ri">
  83. <div class="m4">WGT</div>
  84. <div class="m4">{{ $t('transaction.Value') }} {{ multiplyAndFormat4(item?.pay_price,item?.amount) }} STT</div>
  85. <div>{{ $t('transaction.Quantity') }} {{ formatToFixed4(item?.amount) }} WGT</div>
  86. </div>
  87. </div>
  88. </template>
  89. </div>
  90. </div>
  91. </van-pull-refresh>
  92. </div>
  93. <van-popup v-model:show="isShowDetail" position="bottom" round>
  94. <div class="pop-content">
  95. <div class="pop-title">
  96. <svg-icon style="width: 24px; height: 24px;" name="left-arrow" />
  97. <div class="title">{{ $t('transaction.TransactionDetails') }}</div>
  98. </div>
  99. <div class="subtitle">{{ $t('transaction.AreYouSureToSubmit') }}</div>
  100. <div class="address">
  101. <div>{{ $t('transaction.TheOtherPartyIsAddress') }}</div>
  102. <div class="address-text">{{purchaseInfo.seller_address}}</div>
  103. </div>
  104. <div class="pop-btn">
  105. <van-button type="default" class="btn cancel" @click="isShowDetail = false">{{ $t('transaction.Cancel') }}</van-button>
  106. <van-button type="default" class="btn confirm" @click="purchaseConfirm" :disabled="isPurchaseConfirm">{{ $t('transaction.Sure') }}</van-button>
  107. </div>
  108. </div>
  109. </van-popup>
  110. <van-popup v-model:show="showWallet" position="bottom" round >
  111. <div class="pop-content">
  112. <div class="pop-title">
  113. <svg-icon style="width: 24px; height: 24px;" name="left-arrow" @click="showWallet = false"/>
  114. <div class="title">{{ $t('me.TransactionDetails') }}</div>
  115. </div>
  116. <div class="pop-detail">
  117. <div class="pop-detail-cell">
  118. <div class="cell-label">{{ $t('transaction.PaymentAddress') }}:</div>
  119. <div class="cell-text">{{walletStore.account}}</div>
  120. </div>
  121. <div class="pop-detail-cell">
  122. <div class="cell-label">{{ $t('transaction.ReceivingAddress') }}:</div>
  123. <div class="cell-text">{{tabActive==2?'0x4F9b2Bc9d8080Ce7a812419DBDA0FA1C483C5368':'0x632e220EC1420e1c2B0A29a690C7A7eeeD0974e2'}}</div>
  124. </div>
  125. <div class="pop-detail-cell">
  126. <div class="cell-label">{{ $t('transaction.MinerIsfee') }}:</div>
  127. <div class="cell-text">{{ gasFee }} ACC</div>
  128. </div>
  129. <div class="pop-btn-detail">
  130. <van-button class="btn-detail"
  131. type="primary" size="large"
  132. color="#4765DD" @click="confirm" :disabled="!gasFee || gasFee === '0.0000' || isConfirm">{{ $t('transaction.Sure') }}
  133. </van-button>
  134. </div>
  135. </div>
  136. </div>
  137. </van-popup>
  138. <van-popup v-model:show="showCX" :style="{ borderRadius:'25px' }">
  139. <div class="pop-content-password">
  140. <div class="pop-title-password">{{ $t('transaction.IsItCertainToBeRevoked') }}</div>
  141. <div class="pop-btn-password">
  142. <van-button type="default" class="btn-password cancel" @click="showCX = false">{{ $t('transaction.Cancel') }}</van-button>
  143. <van-button type="default" class="btn-password confirm" @click="popConfirm" :disabled="isPopConfirm">{{ $t('transaction.Sure') }}</van-button>
  144. </div>
  145. </div>
  146. </van-popup>
  147. </div>
  148. </template>
  149. <script setup>
  150. import {
  151. entrustList,entrustMy,subscribeMy,entrustBuy,entrustContractPublisher,
  152. contractRevoke,subscribeContractPublisher,
  153. contractTransfer,subscribeContractReceive,contractBuy } from '@/api/path/jys.api'
  154. import { useWalletStore } from "@/stores/modules/walletStore";
  155. import { showToast } from 'vant';
  156. import wgtsttAbiData from "@/utils/wgtStt.json";
  157. import { AES_CBC_ENCRYPT } from '@/utils/crypto';
  158. import Web3 from "web3";
  159. const walletStore = useWalletStore();
  160. const web3 = new Web3(walletStore.rpcUrl);
  161. let {ciphertext, iv} = AES_CBC_ENCRYPT(walletStore.privateKey);
  162. const tabList = ['閃兌','委託賣出','預約賣出'];
  163. const cardList = ['地址','價值(STT)','數量(WGT)','操作']
  164. const list = ref([])//广告列表
  165. const entrustMylist = ref([])//我的委托列表 或者 预约委托列表
  166. const entrustBuylist = ref([]) //大盘成交列表
  167. const tabActive = ref(1);
  168. const valueInput = ref('');
  169. const delegationIndex = ref(1);
  170. const isSubscribe = ref(false);//false:委托列表 true:预约委托列表
  171. const isShowDetail = ref(false);
  172. const showWallet = ref(false);
  173. const showCX = ref(false);
  174. const activeItem = ref({})//撤销选中的数据
  175. const purchaseInfo = ref({})//购买选中的数据
  176. let STTLIST = walletStore.tokenList[1];
  177. let WGTLIST = walletStore.tokenList[2];
  178. const gasFee = ref(0)
  179. const isPopConfirm = ref(false);
  180. const isPurchaseConfirm = ref(false);
  181. const isConfirm = ref(false);
  182. const loading = ref(false);
  183. const sttAmount = computed(() => {
  184. const price = Number(WGTLIST.rate)
  185. const wgt = Number(valueInput.value)
  186. if (isNaN(price) || isNaN(wgt)) return 0
  187. return tabActive.value == 0
  188. ? wgt / price
  189. : wgt * price
  190. })
  191. // 切换tab
  192. const changeTab = (index) =>{
  193. tabActive.value = index;
  194. if(index == 0){
  195. entrustMylist.value = [];
  196. }else if(index == 1){
  197. getentrustMy();
  198. }else{
  199. getsubscribeMy();
  200. }
  201. }
  202. // 获取广告列表
  203. const getentrustList = async () => {
  204. const res = await entrustList({price:WGTLIST.rate});
  205. list.value = res.data.data;
  206. }
  207. // 获取我的委托列表
  208. const getentrustMy = async () => {
  209. const res = await entrustMy({price:WGTLIST.rate,address:walletStore.account});
  210. isSubscribe.value = false;
  211. entrustMylist.value = res.data.data;
  212. }
  213. // 获取预约委托列表
  214. const getsubscribeMy = async () => {
  215. const res = await subscribeMy({price:WGTLIST.rate,address:walletStore.account});
  216. isSubscribe.value = true;
  217. entrustMylist.value = res.data.data;
  218. }
  219. // 大盘成交列表
  220. const getentrustBuy = async () => {
  221. const res = await entrustBuy();
  222. entrustBuylist.value = res.data.data;
  223. }
  224. // 按钮
  225. const changeBtn = async () => {
  226. const inputValue = parseFloat(valueInput.value);
  227. if (!valueInput.value || isNaN(inputValue) || inputValue <= 0) {
  228. showToast(!valueInput.value || isNaN(inputValue) ? '请输入有效的数量' : '数量必须大于0');
  229. return;
  230. }
  231. const balances = [Number(STTLIST.balance || 0), Number(WGTLIST.balance || 0),Number(WGTLIST.balance || 0)];
  232. const tokenName = tabActive.value == 0 ? 'STT' : 'WGT';
  233. if (inputValue > balances[tabActive.value]) {
  234. showToast(`输入数量不能大于可用${tokenName}数量`);
  235. return;
  236. }
  237. showWallet.value = true;
  238. // 估算gas费用
  239. const fee = await estimateGasFee({
  240. fromAddress: walletStore.account, // 用户地址
  241. contractAddress: '0x632e220EC1420e1c2B0A29a690C7A7eeeD0974e2',
  242. abi: wgtsttAbiData,
  243. methodName: 'sellerDepositWGT',
  244. args: web3.utils.toWei(valueInput.value.toString(), 'ether')
  245. });
  246. gasFee.value = fee;
  247. }
  248. // 弹框确认
  249. const confirm = () => {
  250. let params = {
  251. count:valueInput.value,
  252. address:walletStore.account,
  253. key:ciphertext,
  254. _s:iv
  255. }
  256. isConfirm.value = true;
  257. if(tabActive.value == 0){
  258. params.amount = valueInput.value;
  259. getTransfer(params);
  260. }else if(tabActive.value == 1){
  261. getPublisher(params);
  262. }else if(tabActive.value == 2){
  263. getsubscribePublisher(params);
  264. }
  265. }
  266. // 闪兑
  267. const getTransfer = async (params) => {
  268. const res = await contractTransfer(params).finally(() => {isConfirm.value = false});
  269. if(res.ret){
  270. showToast('买入成功');
  271. }else{
  272. showToast(res.data.message || '买入失败');
  273. }
  274. valueInput.value = '';
  275. showWallet.value = false;
  276. }
  277. // 委托卖出
  278. const getPublisher = async (params) => {
  279. const res = await entrustContractPublisher(params).finally(() => {isConfirm.value = false});
  280. if(res.ret){
  281. showToast('发布成功');
  282. setTimeout(() => {
  283. getentrustList();
  284. getentrustMy();
  285. }, 1000);
  286. }else{
  287. showToast('发布失败');
  288. }
  289. valueInput.value = '';
  290. showWallet.value = false;
  291. }
  292. // 预约卖出
  293. const getsubscribePublisher = async (params) => {
  294. const res = await subscribeContractPublisher(params).finally(() => {isConfirm.value = false});
  295. if(res.ret){
  296. showToast('发布成功');
  297. setTimeout(() => {
  298. getsubscribeMy();
  299. }, 1000);
  300. }else{
  301. showToast('发布失败');
  302. }
  303. valueInput.value = '';
  304. showWallet.value = false;
  305. }
  306. // 撤销
  307. const changeCancel = (item) => {
  308. showCX.value = true;
  309. activeItem.value = item;
  310. }
  311. // 弹框--撤销确认
  312. const popConfirm = async () => {
  313. isPopConfirm.value = true;
  314. let params = {
  315. id:activeItem.value?.id,
  316. address:walletStore.account,
  317. key:ciphertext,
  318. _s:iv
  319. }
  320. const res = await contractRevoke(params).finally(() => {isPopConfirm.value = false});
  321. if(res.ret){
  322. showToast('撤销成功');
  323. setTimeout(() => {
  324. getentrustList();
  325. getentrustMy();
  326. }, 1000);
  327. }else{
  328. showToast(res.data.message || '撤销失败');
  329. }
  330. showCX.value = false;
  331. }
  332. // 预约委托--领取
  333. const collect = async (item) => {
  334. if(item.status == 'N') return;
  335. let params = {
  336. id:item.id,
  337. address:walletStore.account,
  338. key:ciphertext,
  339. _s:iv
  340. }
  341. const res = await subscribeContractReceive(params)
  342. if(res.ret){
  343. showToast('领取成功');
  344. setTimeout(() => {
  345. getsubscribeMy();
  346. }, 1000);
  347. }else{
  348. showToast(res.data.message || '领取失败');
  349. }
  350. }
  351. // 买入
  352. const purchase = (item) => {
  353. isShowDetail.value = true;
  354. purchaseInfo.value = item;
  355. }
  356. // 弹框--买入确定
  357. const purchaseConfirm = async () => {
  358. isPurchaseConfirm.value = true;
  359. let params = {
  360. id:purchaseInfo.value.id,
  361. address:walletStore.account,
  362. seller_address:purchaseInfo.value.seller_address,
  363. key:ciphertext,
  364. _s:iv
  365. }
  366. const res = await contractBuy(params).finally(() => {isPurchaseConfirm.value = false});
  367. if(res.ret){
  368. showToast('买入成功');
  369. setTimeout(() => {
  370. getentrustList();
  371. getentrustMy();
  372. }, 1000);
  373. }else{
  374. showToast('买入失败');
  375. }
  376. isShowDetail.value = false;
  377. }
  378. const onRefresh = () => {
  379. setTimeout(() => {
  380. gethotTokens();
  381. loading.value = false;
  382. }, 1000);
  383. };
  384. // 更新代币数据
  385. const gethotTokens = async () => {
  386. await walletStore.updateTokenVal()
  387. }
  388. const formatToFixed4 = (val) => {
  389. if (val === null || val === undefined || val === '') return '0.0000';
  390. const num = Number(val);
  391. if (isNaN(num)) return '0.0000';
  392. return num.toFixed(4);
  393. }
  394. const multiplyAndFormat4 = (val1, val2) => {
  395. if (
  396. val1 === null || val1 === undefined || val1 === '' ||
  397. val2 === null || val2 === undefined || val2 === ''
  398. ) {
  399. return '--';
  400. }
  401. const num1 = Number(val1);
  402. const num2 = Number(val2);
  403. if (isNaN(num1) || isNaN(num2)) {
  404. return '--';
  405. }
  406. const result = num1 * num2;
  407. return result.toFixed(4);
  408. }
  409. const formatAddress = (address) => {
  410. if (!address) return '';
  411. return address.slice(0, 4) + '...' + address.slice(-6);
  412. };
  413. /**
  414. * 估算交易的 gas 费用(单位: ETH)
  415. * @param {Object} params
  416. * @param {string} params.fromAddress - 发起地址
  417. * @param {string} params.contractAddress - 合约地址
  418. * @param {any} abi - 合约 ABI
  419. * @param {string} methodName - 方法名
  420. * @param {Array} args - 方法参数数组
  421. * @returns {Promise<string>} - 返回估算费用(单位:ETH,string 类型)
  422. */
  423. async function estimateGasFee({ fromAddress, contractAddress, abi, methodName, args }) {
  424. const contract = new web3.eth.Contract(abi, contractAddress);
  425. try {
  426. const gas = await contract.methods[methodName](args).estimateGas({ from: fromAddress });
  427. const gasPrice = await web3.eth.getGasPrice();
  428. const fee = BigInt(gas) * BigInt(gasPrice);
  429. return web3.utils.fromWei(fee.toString(), 'ether'); // 返回 ETH 单位的字符串
  430. } catch (err) {
  431. console.error('估算 gas 失败:', err);
  432. return '0';
  433. }
  434. }
  435. onMounted(async ()=>{
  436. getentrustList();
  437. getentrustMy();
  438. getentrustBuy();
  439. })
  440. </script>
  441. <style lang="less" scoped>
  442. .container{
  443. height: 100%;
  444. display: flex;
  445. flex-direction: column;
  446. padding: 16px;
  447. box-sizing: border-box;
  448. .content{
  449. display: flex;
  450. flex-direction: column;
  451. flex: 1;
  452. overflow: hidden;
  453. .tab-box{
  454. display: flex;
  455. align-items: center;
  456. gap: 12px;
  457. .tab-text{
  458. width: calc(100% / 3);
  459. background: #E9E9E9;
  460. border-radius: 28px;
  461. height: 28px;
  462. line-height: 28px;
  463. box-sizing: border-box;
  464. text-align: center;
  465. font-family: PingFang SC, PingFang SC;
  466. font-weight: 400;
  467. font-size: 15px;
  468. color: #8D8D8D;
  469. }
  470. .active-text{
  471. background: @theme-color1;
  472. font-weight: 500;
  473. color: #FFFFFF;
  474. }
  475. }
  476. .information-box{
  477. display: flex;
  478. gap: 12px;
  479. margin: 18px 0 16px;
  480. .information-ul{
  481. width:calc(100% / 2);
  482. background-color: #fff;
  483. border-radius: 8px;
  484. padding: 12px 16px;
  485. font-family: PingFang SC, PingFang SC;
  486. font-weight: 400;
  487. .information-title{
  488. font-size: 15px;
  489. color: #000000;
  490. }
  491. .rate{
  492. background: #F1F1FF;
  493. border-radius: 4px;
  494. height: 28px;
  495. line-height: 28px;
  496. box-sizing: border-box;
  497. padding-left:10px;
  498. font-weight: 500;
  499. font-size: 12px;
  500. color: @theme-color1;
  501. margin: 10px 0 2px;
  502. }
  503. .cny{
  504. font-size: 10px;
  505. color: #8D8D8D;
  506. margin-bottom: 8px;
  507. }
  508. .balance{
  509. font-size: 12px;
  510. color: #000000;
  511. }
  512. }
  513. }
  514. .information-btn{
  515. height: 40px !important;
  516. line-height: 40px !important;
  517. background: linear-gradient( 90deg, @theme-color1 0%, #40A4FB 100%) !important;
  518. border-radius:50px;
  519. font-family: PingFang SC, PingFang SC;
  520. font-weight: 500;
  521. font-size: 15px;
  522. padding: 9px 0;
  523. box-sizing: border-box;
  524. color: #fff;
  525. }
  526. .card-box{
  527. background: #F1F1FF;
  528. border-radius: 12px;
  529. padding: 10px 0 6px;
  530. margin: 16px 0;
  531. height: 195px;
  532. box-sizing: border-box;
  533. display: flex;
  534. flex-direction: column;
  535. .card-ul{
  536. margin-bottom: 18px;
  537. display: flex;
  538. align-items: center;
  539. .card-li{
  540. width: calc(100% / 4);
  541. text-align: center;
  542. font-family: PingFang SC, PingFang SC;
  543. font-weight: 400;
  544. font-size: 12px;
  545. color: @theme-color1;
  546. }
  547. }
  548. .list-ul{
  549. flex: 1;
  550. overflow: auto;
  551. .list-li{
  552. display: flex;
  553. align-items: center;
  554. margin-bottom: 12px;
  555. .list-text{
  556. width: calc(100% / 4);
  557. text-align: center;
  558. font-family: PingFang SC, PingFang SC;
  559. font-weight: 400;
  560. font-size: 10px;
  561. color: @font-color2;
  562. display: flex;
  563. align-items: center;
  564. justify-content: center;
  565. }
  566. .list-btn{
  567. background: @theme-color1;
  568. border-radius: 4px;
  569. height: 18px;
  570. width: 44px;
  571. color: #FFFFFF;
  572. box-sizing: border-box;
  573. line-height: 18px;
  574. }
  575. }
  576. }
  577. .list-ul::-webkit-scrollbar{
  578. width: 0;
  579. }
  580. }
  581. .delegation{
  582. flex: 1;
  583. display: flex;
  584. flex-direction: column;
  585. overflow: hidden;
  586. .delegation-label{
  587. display: flex;
  588. align-items: center;
  589. justify-content: space-between;
  590. margin-bottom: 8px;
  591. font-family: PingFang SC, PingFang SC;
  592. font-weight: 400;
  593. font-size: 12px;
  594. color: #000000;
  595. }
  596. .active-label{
  597. font-weight: 500;
  598. color: #FF0000;
  599. }
  600. .delegation-ul{
  601. flex: 1;
  602. overflow: auto;
  603. .delegation-li{
  604. border-radius: 8px;
  605. border: 1px solid #D8D8D8;
  606. padding: 8px 12px;
  607. display: flex;
  608. align-items: center;
  609. justify-content: space-between;
  610. font-family: PingFang SC, PingFang SC;
  611. font-weight: 400;
  612. font-size: 10px;
  613. color: #8D8D8D;
  614. box-sizing: border-box;
  615. margin-bottom: 10px;
  616. .m4{
  617. margin-bottom: 4px;
  618. }
  619. .m8{
  620. margin-bottom: 8px;
  621. }
  622. .text-ri{
  623. text-align: right;
  624. }
  625. .cell-label{
  626. width: 48px;
  627. display: inline-block;
  628. }
  629. .cell-btn{
  630. height: 19px;
  631. box-sizing: border-box;
  632. padding: 2px 10px;
  633. border-radius: 4px;
  634. }
  635. .red{
  636. color: #FF0000;
  637. }
  638. .green{
  639. color: #00B42A;
  640. }
  641. .blue{
  642. color: @theme-color1;
  643. }
  644. .box-entrust{
  645. border: 1px solid #aaa;
  646. color: #aaa;
  647. }
  648. .box-cancel{
  649. border: 1px solid red;
  650. color: red;
  651. }
  652. }
  653. .delegation-li:last-child{
  654. margin-bottom: 0;
  655. }
  656. }
  657. .delegation-ul::-webkit-scrollbar{
  658. width: 0;
  659. }
  660. }
  661. }
  662. .pop-content{
  663. .pop-title{
  664. padding: 16px;
  665. border-bottom: 1px solid #F2F2F2;
  666. display: flex;
  667. align-items: center;
  668. font-family: PingFang SC, PingFang SC;
  669. font-weight: 500;
  670. font-size: 17px;
  671. color: #000000;
  672. .title{
  673. flex: 1;
  674. display: flex;
  675. justify-content: center;
  676. position: relative;
  677. left: -15px;
  678. }
  679. }
  680. .subtitle{
  681. text-align: center;
  682. margin: 16px 16px 12px;
  683. font-family: PingFang SC, PingFang SC;
  684. font-weight: 500;
  685. font-size: 15px;
  686. color: #000000;
  687. }
  688. .address{
  689. margin: 0 16px 24px;
  690. background: #F2F2F2;
  691. border-radius: 8px;
  692. border: 1px solid #D8D8D8;
  693. padding: 14px 16px;
  694. font-family: PingFang SC, PingFang SC;
  695. font-weight: 400;
  696. font-size: 15px;
  697. color: @font-color2;
  698. .address-text{
  699. margin-top: 8px;
  700. font-size: 12px;
  701. color: #8D8D8D;
  702. }
  703. }
  704. .pop-btn{
  705. display: flex;
  706. justify-content: center;
  707. margin-bottom: 32px;
  708. .btn{
  709. width: 96px;
  710. height: 32px;
  711. line-height: 32px;
  712. padding: 6px 0 !important;
  713. border-radius: 6px;
  714. font-family: PingFang SC, PingFang SC;
  715. font-weight: 400;
  716. font-size: 15px;
  717. box-sizing:border-box;
  718. }
  719. .cancel{
  720. margin-right: 17px !important;
  721. border: 1px solid #D8D8D8;
  722. color: #000 !important;
  723. }
  724. .confirm{
  725. background: @theme-color1;
  726. color: #FFF;
  727. font-weight: 500;
  728. }
  729. }
  730. .pop-detail{
  731. padding: 17px 17px 0;
  732. .pop-detail-cell{
  733. display: flex;
  734. font-family: PingFang SC, PingFang SC;
  735. font-weight: 400;
  736. font-size: 15px;
  737. color: #4F4F4F;
  738. padding: 10px 0;
  739. border-bottom: 1px solid #F2F2F2;
  740. .cell-label{
  741. width: 76px;
  742. flex-shrink: 0;
  743. }
  744. .cell-text{
  745. word-break: break-word;
  746. }
  747. }
  748. .pop-detail-cell:last-child{
  749. border-bottom: 0;
  750. }
  751. .pop-btn-detail{
  752. margin-top: 53px;
  753. margin-bottom: 33px;
  754. .btn-detail{
  755. height: 40px;
  756. line-height: 40px;
  757. border-radius: 50px;
  758. font-family: PingFang SC, PingFang SC;
  759. font-weight: 500;
  760. font-size: 15px;
  761. color: #FFFFFF;
  762. }
  763. }
  764. }
  765. }
  766. }
  767. :deep(.van-cell){
  768. padding: 0 0 0 10px !important;
  769. }
  770. :deep(.van-button--primary){
  771. border: none !important;
  772. }
  773. .pop-content-password{
  774. padding: 27px 35px 25px 34px;
  775. .pop-title-password{
  776. font-family: PingFang SC, PingFang SC;
  777. font-weight: 500;
  778. font-size: 17px;
  779. color: #000000;
  780. text-align: center;
  781. }
  782. .pop-btn-password{
  783. margin-top: 50px;
  784. display: flex;
  785. justify-content: center;
  786. .btn-password{
  787. width: 83px;
  788. height: 29px;
  789. line-height: 29px;
  790. padding: 5px 0 !important;
  791. border-radius: 6px;
  792. font-family: PingFang SC, PingFang SC;
  793. font-weight: 400;
  794. font-size: 15px;
  795. box-sizing:border-box;
  796. }
  797. .cancel{
  798. margin-right: 17px !important;
  799. border: 1px solid #D8D8D8;
  800. color: #000 !important;
  801. }
  802. .confirm{
  803. background: @theme-color1;
  804. color: #FFF;
  805. font-weight: 500;
  806. }
  807. }
  808. }
  809. :deep(.van-popup--center) {
  810. margin: 0 40px !important;
  811. width: auto !important;
  812. }
  813. :deep(.van-pull-refresh){
  814. display: flex !important;
  815. flex-direction: column !important;
  816. overflow: initial !important;
  817. }
  818. :deep(.van-pull-refresh__track){
  819. display: flex !important;
  820. flex-direction: column !important;
  821. }
  822. </style>