Tixian.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="$t('tixian.tixian')" tinColor="#006AFF" jiantou="0" titledetl=''></customNav>
  4. <view v-if="meiyouyhk" class="contentColumnC">
  5. <image class="weishimingImage" src="/static/imags/zhanwuyhk.png" mode="widthFix"></image>
  6. <text class="jiedanText">{{$t('tixian.bdyhk')}}</text>
  7. <view class="contentInRowC" @click="gotoyhkmanager" style="width:80%;height: 76rpx;border-radius: 10rpx;border: 2rpx solid darkgray;margin-bottom: 20rpx;margin-top: 100rpx;">
  8. <label class="tianjiaBT">{{$t('tixian.tianjayhk')}}</label>
  9. </view>
  10. </view>
  11. <view v-if="!meiyouyhk" class="contentColumn contenV">
  12. <view class="contentInRowS ItemContent" @click="qiehuanyhk">
  13. <view class="contentInRowL" style="align-items: center;">
  14. <image style="width: 60rpx;height: 60rpx;" src="/static/imags/yinhangkt.png" mode=""></image>
  15. <text class="tianjiaBT">{{txyhk}}</text>
  16. </view>
  17. <image style="width: 36rpx;height: 36rpx;" src="/static/imags/youjian@3x.png" mode="scaleToFill"></image>
  18. </view>
  19. <view class="contentInRowS ItemContent" >
  20. <view class="contentInRowL" style="align-items: center;background-color: aquamarine;width: 80%;">
  21. <input class="jiedanText" type="number" :placeholder="$t('tixian.kezhuancdk')+': '+$formPr(ketixianJE)" :value="tixianje" @input="tixianJEinput">
  22. <text class="huobidanwei">{{$t('api.huobidanwei')}}</text>
  23. </view>
  24. <text class="quanbuText" @click="quanbu">{{$t('tixian.quanbu')}}</text>
  25. </view>
  26. <view class="contentColumn" style="padding: 24rpx;">
  27. <text class="jiedanText">{{$t('tixian.kezhuancdk')+': '+$formPr(ketixianJE)}}</text>
  28. <view class="contentColumnC">
  29. <text :class="[tixianje>0?'tixianBt':'tixianBtH']" @click="querentixian">{{$t('tixian.querentixian')}}</text>
  30. <text class="jiedanText">{{$t('tixian.txdzts')}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 提示窗示例 -->
  35. <uni-popup ref="alertDialog" type="dialog">
  36. <uni-popup-dialog type="NOMLE" :cancelText="$t('index.quxiao')" :confirmText="$t('index.queren')" :title="$t('tixian.querentixian')" @confirm="dialogConfirm"
  37. @close="dialogClose"></uni-popup-dialog>
  38. </uni-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. getbankcard,
  44. getUsbalance
  45. } from '@/pages/api/basic.js';
  46. export default {
  47. data() {
  48. return {
  49. meiyouyhk:false,
  50. ketixianJE:0.00,
  51. tixianje:'',
  52. weishezhijymm:false,
  53. popmode:1,
  54. selectIndex:0,
  55. carList:'',
  56. txyhk:'',
  57. yongjinbl:0.1,
  58. yongjin:0,
  59. daozhangjine:0
  60. }
  61. },
  62. onShow() {
  63. this.selectIndex=uni.getStorageSync("defyanhangK");
  64. this.getbankcard();
  65. this.getUsbalance();
  66. },
  67. methods: {
  68. gotoyhkmanager(){
  69. uni.navigateTo({
  70. url:'/pages/tixian/YHkamanager'
  71. })
  72. },
  73. tixianJEinput(event){
  74. this.tixianje = event.target.value;
  75. this.yongjin = this.yongjinbl*this.tixianje;
  76. this.daozhangjine = this.tixianje-this.yongjin;
  77. },
  78. quanbu(){
  79. this.tixianje=this.ketixianJE;
  80. this.yongjin = this.yongjinbl*this.tixianje;
  81. this.daozhangjine = this.tixianje-this.yongjin;
  82. },
  83. qiehuanyhk(){
  84. uni.navigateTo({
  85. url:'/pages/tixian/Wodeyanhangka?state=1'
  86. })
  87. },
  88. querentixian(){
  89. if(this.weishezhijymm){
  90. uni.navigateTo({
  91. url:'/pages/tixian/Jioayimima'
  92. })
  93. return
  94. }
  95. this.$refs.alertDialog.open('center');
  96. },
  97. dialogConfirm() {
  98. console.log('点击确认!!!')
  99. uni.showToast({
  100. title: '功能待完善',
  101. icon: 'none',
  102. duration: 2500
  103. })
  104. },
  105. dialogClose() {
  106. console.log('点击关闭')
  107. },
  108. async getbankcard(){
  109. //console.log('getUserMsg')
  110. await this.$http.get(`${getbankcard}`, {
  111. },true)
  112. .then(async r => {
  113. if(r.data.data.length>0){
  114. this.meiyouyhk=false;
  115. this.carList= r.data.data;
  116. var car = this.carList[this.selectIndex];
  117. this.txyhk=car.bankName+car.number.substr(-4,4); //or
  118. }
  119. else{
  120. this.meiyouyhk=true;
  121. }
  122. })
  123. .catch(err => {
  124. console.log(err)
  125. })
  126. },
  127. async getUsbalance(){
  128. //console.log('getUserMsg')
  129. await this.$http.get(`${getUsbalance}`, {
  130. type:'',
  131. sort:false,
  132. page:1,
  133. size:10,
  134. },true)
  135. .then(async r => {
  136. console.log(r);
  137. this.ketixianJE=r.data.data.sum;
  138. })
  139. .catch(err => {
  140. console.log(err)
  141. })
  142. },
  143. },
  144. }
  145. </script>
  146. <style lang="scss">
  147. @import '@/common/common.scss';
  148. page{
  149. background-color: whitesmoke;
  150. }
  151. .weishimingImage{
  152. width: 30%;
  153. margin-top: 40rpx;
  154. }
  155. .jiedanText{
  156. width: 88%;
  157. font-size: 26rpx;
  158. color: darkgray;
  159. text-align: center;
  160. }
  161. .tianjiaBT{
  162. font-size: 28rpx;
  163. font-weight: bold;
  164. color: #1A1A1A;
  165. }
  166. .huobidanwei{
  167. padding-right: 6rpx;
  168. font-size: 46rpx;
  169. font-weight: bold;
  170. color: #1A1A1A;
  171. }
  172. .contenV{
  173. margin-top: 30rpx;
  174. width: 94%;
  175. margin-left: 3%;
  176. border-radius: 10rpx;
  177. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  178. background-color: white;
  179. }
  180. .ItemContent{
  181. align-items: center;
  182. padding: 24rpx;
  183. border: solid darkgray;
  184. border-width: 0px 0px 2rpx 0px;
  185. }
  186. .quanbuText{
  187. font-size: 32rpx;
  188. color: #006AFF;
  189. }
  190. .tixianBt{
  191. font-size: 30rpx;
  192. width: 80%;
  193. height: 68rpx;
  194. line-height: 68rpx;
  195. color: white;
  196. border-radius: 10rpx;
  197. text-align: center;
  198. margin-top: 20rpx;
  199. margin-bottom: 20rpx;
  200. background-color: #006AFF;
  201. }
  202. .tixianBtH{
  203. font-size: 30rpx;
  204. width: 80%;
  205. height: 68rpx;
  206. line-height: 68rpx;
  207. color: darkgray;
  208. border-radius: 10rpx;
  209. text-align: center;
  210. margin-top: 20rpx;
  211. margin-bottom: 20rpx;
  212. background-color:lightgray;
  213. }
  214. </style>