tbdetail.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="content">
  3. <view class="vheight"></view>
  4. <view class="top flex">
  5. <image @click="back()" class="top-icon1" src="../../static/img/cb2.png" mode=""></image>
  6. <image @click="navTo('/pages/user/tbRecord')" class="top-icon2" src="../../static/img/cb1.png" mode=""></image>
  7. </view>
  8. <view class="title">{{ $t('tb.tb') }}</view>
  9. <view class="type flex" @click="navTo('/pages/transaction/tblist')">
  10. <view class="type-left">{{ $t('tb.bz') }}</view>
  11. <view class="type-right">
  12. <view class="type-name">{{ info.title }}</view>
  13. <image class="type-icon" src="../../static/icon/user-back.png" mode=""></image>
  14. </view>
  15. </view>
  16. <view class="main">
  17. <view class="main-title">{{ $t('tb.tbwl') }}</view>
  18. <view class="main-list">{{ info.czline }}</view>
  19. <view class="main-title" style="margin-top: 20rpx;">{{ $t('tb.tbdz') }}</view>
  20. <view class="sr-input"><input :placeholder="$t('tb.qsrtbdz')" type="text" v-model="address" /></view>
  21. <view class="sr-sl flex">
  22. <view class="sr-title">{{ $t('tb.tbsl') }}</view>
  23. <view class="sr-num" v-if="info">{{ $t('tb.ky') }} {{ money }} {{ info.name.toLocaleUpperCase() }}</view>
  24. </view>
  25. <view class="sr-input flex">
  26. <input :placeholder="$t('tb.qsrtbsl')" type="number" v-model="num" />
  27. <view class="main-type-box">
  28. <view class="main-type" v-if="info">{{ info.name.toLocaleUpperCase() }}</view>
  29. <view class="all" @click="qb()">{{ $t('tb.qb') }}</view>
  30. </view>
  31. </view>
  32. <view class="sr-btn" @click="submit()">{{ $t('tb.tj') }}</view>
  33. <view class="sr-tip flex" v-if="num">
  34. <view class="sr-tip-item">{{ $t('tb.sjdz') }}</view>
  35. <view class="sr-tip-item" v-if="info.sxftype == 1">{{ num * 1 * (1 - (info.txsxf * 1) / 100) }}</view>
  36. <view class="sr-tip-item" v-if="info.sxftype == 2">{{ num * 1 - info.txsxf_n * 1 }}</view>
  37. </view>
  38. </view>
  39. <view class="info">
  40. <view class="info-item red">
  41. {{ $t('tb.tbkc') }}{{ info.sxftype == 1 ? info.txsxf + '%' : info.txsxf_n + info.title }}{{ $t('tb.sxfsxt') }}:{{ info.txminnum }}{{ info.title }},{{
  42. $t('tb.wyzxjed')
  43. }}
  44. </view>
  45. <view class="info-item">{{ $t('tb.wbzzjaq') }}</view>
  46. <view class="info-item">{{ $t('cb.qwbqrdn') }}</view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import { txpage, tbhandle } from '@/api/wallet.js';
  52. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  53. import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
  54. export default {
  55. data() {
  56. return {
  57. id: '',
  58. info: '',
  59. address: '',
  60. num: '',
  61. money: ''
  62. };
  63. },
  64. onLoad(opt) {
  65. uni.setNavigationBarTitle({ title: this.$t('tb.tbxq') });
  66. this.id = opt.type;
  67. this.loadData();
  68. },
  69. onShow() {},
  70. onReachBottom() {},
  71. onReady() {},
  72. methods: {
  73. loadData() {
  74. txpage({ id: this.id }).then(({ data }) => {
  75. this.info = data.info;
  76. this.money = data.money;
  77. });
  78. },
  79. qrR(res) {
  80. console.log(res, '123456');
  81. },
  82. back() {
  83. uni.navigateBack();
  84. },
  85. qb() {
  86. this.num = this.money;
  87. },
  88. navTo(url) {
  89. uni.navigateTo({
  90. url
  91. });
  92. },
  93. submit() {
  94. console.log(222);
  95. if (this.num < 0) {
  96. return this.$api.msg(this.$t('tbslbnw'));
  97. }
  98. if (!this.address) {
  99. return this.$api.msg(this.$t('qsrscdz'));
  100. }
  101. tbhandle({ id: this.id, num: this.num, address: this.address }).then(e => {
  102. this.num = '';
  103. this.image = '';
  104. return this.$api.msg(this.$t('cb.tjsqcg'));
  105. });
  106. }
  107. }
  108. };
  109. </script>
  110. <style lang="scss">
  111. page,
  112. .content {
  113. min-height: 100%;
  114. height: auto;
  115. background: #f5f5f5;
  116. }
  117. .vheight {
  118. height: var(--status-bar-height);
  119. }
  120. .top {
  121. padding: 20rpx 40rpx;
  122. .top-icon1 {
  123. width: 52rpx;
  124. height: 36rpx;
  125. }
  126. .top-icon2 {
  127. width: 48rpx;
  128. height: 48rpx;
  129. }
  130. }
  131. .title {
  132. padding: 20rpx 20rpx 0;
  133. font-size: 52rpx;
  134. font-weight: 500;
  135. }
  136. .type {
  137. margin: 20rpx auto 0;
  138. width: 690rpx;
  139. background: #ffffff;
  140. border-radius: 20rpx;
  141. padding: 30rpx 20rpx;
  142. .type-left {
  143. font-size: 32rpx;
  144. color: #000;
  145. }
  146. .type-right {
  147. display: flex;
  148. align-items: center;
  149. .type-name {
  150. font-size: 36rpx;
  151. font-weight: bold;
  152. color: #fcd535;
  153. margin-right: 10rpx;
  154. }
  155. .type-icon {
  156. width: 24rpx;
  157. height: 24rpx;
  158. }
  159. }
  160. }
  161. .main {
  162. margin: 20rpx auto 0;
  163. width: 690rpx;
  164. background: #ffffff;
  165. border-radius: 20rpx;
  166. padding: 30rpx 20rpx;
  167. .main-title {
  168. font-size: 32rpx;
  169. color: #000;
  170. }
  171. .main-list {
  172. margin-top: 20rpx;
  173. width: 200rpx;
  174. height: 70rpx;
  175. line-height: 70rpx;
  176. text-align: center;
  177. border: 2px solid #fcd535;
  178. border-radius: 10rpx;
  179. font-size: 28rpx;
  180. color: #fcd535;
  181. }
  182. .sr-input {
  183. margin-top: 20rpx;
  184. display: flex;
  185. align-items: center;
  186. width: 100%;
  187. height: 80rpx;
  188. line-height: 80rpx;
  189. background: #f5f5f5;
  190. border-radius: 20rpx;
  191. padding: 0rpx 30rpx;
  192. input {
  193. width: 292rpx;
  194. font-size: 28rpx;
  195. padding-left: 30rpx;
  196. background: #f5f5f5;
  197. }
  198. }
  199. .sr-sl {
  200. margin-top: 20rpx;
  201. .sr-num {
  202. color: #707a8a;
  203. font-size: 24rpx;
  204. }
  205. }
  206. .main-type-box {
  207. display: flex;
  208. align-items: center;
  209. .main-type {
  210. font-size: 28rpx;
  211. color: #707a8a;
  212. margin-right: 20rpx;
  213. }
  214. .all {
  215. font-size: 28rpx;
  216. color: #707a8a;
  217. }
  218. }
  219. .sr-btn {
  220. width: 100%;
  221. height: 80rpx;
  222. line-height: 80rpx;
  223. text-align: center;
  224. border-radius: 10rpx;
  225. margin: 20rpx auto 0;
  226. background: linear-gradient(to left, #eeb80d, #ffe35b);
  227. font-size: 28rpx;
  228. color: #000;
  229. }
  230. .sr-tip {
  231. margin-top: 20rpx;
  232. .sr-tip-item {
  233. font-size: 24rpx;
  234. color: #707a8a;
  235. }
  236. }
  237. }
  238. .info {
  239. margin: 20rpx auto 0;
  240. width: 690rpx;
  241. background: #ffffff;
  242. border-radius: 20rpx;
  243. padding: 30rpx 20rpx;
  244. .info-item {
  245. font-size: 24rpx;
  246. color: #000;
  247. margin-bottom: 20rpx;
  248. }
  249. .red {
  250. color: red;
  251. }
  252. }
  253. </style>