Tixian.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="$t('tixian.tixian')" tinColor="white" jiantou="1" titledetl=''></customNav>
  4. <view v-if="meiyouyhk" class="contentColumnC">
  5. <image class="weishimingImage" src="/static/images/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/images/yinhangkt.png" mode=""></image>
  15. <text class="tianjiaBT">{{txyhk}}</text>
  16. </view>
  17. <image style="width: 36rpx;height: 36rpx;" src="/static/images/fanhui@3x.png" mode="scaleToFill"></image>
  18. </view>
  19. <view class="contentInRowS ItemContent" >
  20. <view class="contentInRowL" style="align-items: center;">
  21. <text class="huobidanwei">$</text>
  22. <input class="jiedanText" type="number" :placeholder="$t('tixian.kezhuancdk')+ketixianJE" :value="tixianje" @input="tixianJEinput">
  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')+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 api from "@/pages/api/api.js"
  43. export default {
  44. data() {
  45. return {
  46. meiyouyhk:false,
  47. ketixianJE:0.00,
  48. tixianje:'',
  49. weishezhijymm:false,
  50. popmode:1,
  51. selectIndex:0,
  52. carList:'',
  53. txyhk:'',
  54. yongjinbl:0.1,
  55. yongjin:0,
  56. daozhangjine:0
  57. }
  58. },
  59. onShow() {
  60. this.selectIndex=uni.getStorageSync("defyanhangK");
  61. this.getbankcard();
  62. this.getUsbalance();
  63. },
  64. methods: {
  65. gotoyhkmanager(){
  66. uni.navigateTo({
  67. url:'/pages/tixian/YHkamanager'
  68. })
  69. },
  70. tixianJEinput(event){
  71. this.tixianje = event.target.value;
  72. this.yongjin = this.yongjinbl*this.tixianje;
  73. this.daozhangjine = this.tixianje-this.yongjin;
  74. },
  75. quanbu(){
  76. this.tixianje=this.ketixianJE;
  77. this.yongjin = this.yongjinbl*this.tixianje;
  78. this.daozhangjine = this.tixianje-this.yongjin;
  79. },
  80. qiehuanyhk(){
  81. uni.navigateTo({
  82. url:'/pages/tixian/Wodeyanhangka?state=1'
  83. })
  84. },
  85. querentixian(){
  86. if(this.weishezhijymm){
  87. uni.navigateTo({
  88. url:'/pages/tixian/Jioayimima'
  89. })
  90. return
  91. }
  92. this.$refs.alertDialog.open('center');
  93. },
  94. dialogConfirm() {
  95. console.log('点击确认!!!')
  96. uni.showToast({
  97. title: '服務異常,請聯繫客服處理',
  98. icon: 'none',
  99. duration: 2500
  100. })
  101. },
  102. dialogClose() {
  103. console.log('点击关闭')
  104. },
  105. getbankcard(){
  106. //console.log('getUserMsg')
  107. api('getbankcard',{
  108. },
  109. r=>{
  110. if(r.data.data.length>0){
  111. this.meiyouyhk=false;
  112. this.carList= r.data.data;
  113. var car = this.carList[this.selectIndex];
  114. this.txyhk=car.bankName+car.number.substr(-4,4); //or
  115. }
  116. else{
  117. this.meiyouyhk=true;
  118. }
  119. },failc=>{
  120. //console.log('getadvertis----',failc)
  121. });
  122. },
  123. getUsbalance(){
  124. this.ketixianJE=0;
  125. api('getUsbalance',{
  126. type:'',
  127. page:1,
  128. size:10,
  129. },
  130. r=>{
  131. console.log(r)
  132. if(r.data.data){
  133. this.ketixianJE=r.data.data.sum;
  134. }
  135. },failc=>{
  136. //console.log('getadvertis----',failc)
  137. });
  138. },
  139. },
  140. }
  141. </script>
  142. <style lang="scss">
  143. page{
  144. background-color: whitesmoke;
  145. }
  146. .weishimingImage{
  147. width: 30%;
  148. margin-top: 40rpx;
  149. }
  150. .jiedanText{
  151. width: 88%;
  152. font-size: 26rpx;
  153. color: darkgray;
  154. text-align:center;
  155. }
  156. .tianjiaBT{
  157. font-size: 28rpx;
  158. font-weight: bold;
  159. color: #1A1A1A;
  160. }
  161. .huobidanwei{
  162. padding-right: 16rpx;
  163. font-size: 46rpx;
  164. font-weight: bold;
  165. color: #1A1A1A;
  166. }
  167. .contenV{
  168. margin-top: 30rpx;
  169. width: 94%;
  170. margin-left: 3%;
  171. border-radius: 10rpx;
  172. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  173. background-color: white;
  174. }
  175. .ItemContent{
  176. align-items: center;
  177. padding: 24rpx;
  178. border: solid darkgray;
  179. border-width: 0px 0px 2rpx 0px;
  180. }
  181. .quanbuText{
  182. font-size: 32rpx;
  183. color: #386EF5;
  184. }
  185. .tixianBt{
  186. font-size: 30rpx;
  187. width: 80%;
  188. height: 68rpx;
  189. line-height: 68rpx;
  190. color: white;
  191. border-radius: 10rpx;
  192. text-align: center;
  193. margin-top: 20rpx;
  194. margin-bottom: 20rpx;
  195. background-color: #386EF5;
  196. }
  197. .tixianBtH{
  198. font-size: 30rpx;
  199. width: 80%;
  200. height: 68rpx;
  201. line-height: 68rpx;
  202. color: darkgray;
  203. border-radius: 10rpx;
  204. text-align: center;
  205. margin-top: 20rpx;
  206. margin-bottom: 20rpx;
  207. background-color:lightgray;
  208. }
  209. </style>