Baozhengjin.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="$t('zhanghu.baozhegnjin')" tinColor="#006AFF" jiantou="0" titledetl=''></customNav>
  4. <view class="contentColumn topView">
  5. <text class="topbzjText" style="margin-left: 3%;">{{$t('zhanghu.baozhegnjin')}}</text>
  6. <view class="contentInRowL" style="margin-left: 3%;align-items: center;margin-top: 10rpx;">
  7. <image style="width: 30rpx;height: 30rpx;" src="/static/imags/shijianH.png" mode="scaleToFill"></image>
  8. <view>
  9. <text class="titleText">{{$t('tixian.shuishikt')}}</text>
  10. </view>
  11. <image style="width: 30rpx;height: 30rpx;padding-left: 20rpx;" src="/static/imags/baozhjH.png" mode="scaleToFill"></image>
  12. <view>
  13. <text class="titleText">{{$t('tixian.zijinanquan')}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="contentColumnC baozhjView">
  18. <text class="baozhjshu">{{baozhjin}}</text>
  19. <text class="jiaonaBt" @click="popgjm">{{$t('tixian.jiaonabzj')}}</text>
  20. <!-- <text v-if="baozhjin>0" class="tuibaoBt">{{$t('tixian.tuibaozj')}}</text> -->
  21. </view>
  22. <view class="contentColumn" style="width: 94%;margin-left: 3%;">
  23. <text class="noteText">{{$t('tixian.baozhengjgz')}}</text>
  24. <view class="guizItemV">
  25. <view class="contentInRowL" style="align-items: center;">
  26. <image style="width: 40rpx;height: 40rpx;" src="/static/imags/dunpai.png" mode="scaleToFill"></image>
  27. <view class="">
  28. <text class="noteTitleText">{{$t('tixian.baozhengjyt')}}</text>
  29. </view>
  30. </view>
  31. <text class="noteDetaelText">{{$t('tixian.baozhengjsm')}}</text>
  32. </view>
  33. </view>
  34. <!-- 输入框示例 -->
  35. <uni-popup ref="inputDialog" type="dialog">
  36. <uni-popup-dialog ref="inputClose" mode="input" inputType="number" :title="$t('zhanghu.baozhegnjin')"
  37. :placeholder="$t('tixian.qingshubzjje')" :cancelText="$t('index.quxiao')" :confirmText="$t('index.queren')" @confirm="dialogInputConfirm"></uni-popup-dialog>
  38. </uni-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. addMargin,
  44. md5pay,
  45. getmymargin,
  46. getUsbalance,
  47. userRecharge
  48. } from '@/pages/api/basic.js';
  49. export default {
  50. data() {
  51. return {
  52. baozhjin:0,
  53. bzjObject:'',
  54. showpop:false,
  55. baozhjlist:[0,1],
  56. Sindex:0,
  57. chongzhije:0
  58. }
  59. },
  60. onShow() {
  61. this.getmymargin();
  62. this.getUsbalance();
  63. },
  64. methods: {
  65. popSelect(index){
  66. this.Sindex=index;
  67. },
  68. popgjm(){
  69. var that = this;
  70. var userInfo = uni.getStorageSync('userInfo')
  71. if(userInfo.auditStatus!=1){
  72. uni.showToast({
  73. title:that.$t('user.zhanghaowsh') ,
  74. icon: 'none',
  75. duration: 3500
  76. })
  77. return;
  78. }
  79. this.$refs.inputDialog.open('center');
  80. //this.showpop=true;//选择保证金额
  81. },
  82. dialogInputConfirm(val) {
  83. this.userRecharge(val);
  84. // uni.navigateTo({
  85. // url:'/pages/tixian/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(this.bzjObject.payUrl))+'&ddid='+this.bzjObject.ddId
  86. // })
  87. },
  88. async userRecharge(val){
  89. var language = uni.getStorageSync('language');
  90. var lg;
  91. if(language=='yuenan'){
  92. lg='vi';
  93. }
  94. else{
  95. lg='en';
  96. }
  97. //console.log('getUserMsg')
  98. await this.$http.get(`${userRecharge}`, {
  99. amount:val,
  100. language:lg
  101. },true)
  102. .then(async r => {
  103. console.log(r);
  104. if(r.data.code==200){
  105. uni.navigateTo({
  106. url:'/pages/tixian/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(r.data.data))+'&ddid=**'
  107. })
  108. }
  109. })
  110. .catch(err => {
  111. console.log(err)
  112. })
  113. },
  114. async getUsbalance(){
  115. //console.log('getUserMsg')
  116. await this.$http.get(`${getUsbalance}`, {
  117. type:'',
  118. page:1,
  119. size:10,
  120. },true)
  121. .then(async r => {
  122. this.baozhjin=r.data.data.sum;
  123. })
  124. .catch(err => {
  125. console.log(err)
  126. })
  127. },
  128. async getmymargin(){
  129. //console.log('getUserMsg')
  130. await this.$http.get(`${getmymargin}`, {
  131. },true)
  132. .then(async r => {
  133. console.log(r);
  134. for(var i=0;i<r.data.data.length;i++){
  135. var obj= r.data.data[i];
  136. if(obj.ddId.substring(0, 2)=='QS'){
  137. this.bzjObject=obj;
  138. break;
  139. }
  140. }
  141. })
  142. .catch(err => {
  143. console.log(err)
  144. })
  145. },
  146. async getmd5pay(){
  147. //console.log('getUserMsg')
  148. await this.$http.get(`${md5pay}`, {
  149. orderid:'123456789',
  150. amount:1
  151. },true)
  152. .then(async r => {
  153. console.log(r);
  154. if(r.data.data.code=="-1"){
  155. uni.showToast({
  156. title: r.data.data.msg,
  157. icon: 'none',
  158. duration: 3500
  159. })
  160. uni.navigateTo({
  161. url:'/pages/tixian/Zhifuyemian?url=12'
  162. })
  163. return;
  164. }
  165. uni.navigateTo({
  166. url:'/pages/tixian/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(r.data.data.PayURL))+'&ddid=QS'
  167. })
  168. })
  169. .catch(err => {
  170. console.log(err)
  171. })
  172. },
  173. },
  174. }
  175. </script>
  176. <style lang="scss">
  177. @import '@/common/common.scss';
  178. @font-face {
  179. font-family: zrht;
  180. src: url('/uni_modules/font/zrht.otf');
  181. }
  182. page{
  183. background-color: whitesmoke;
  184. }
  185. .topView{
  186. height: 460rpx;
  187. width: 100%;
  188. background-image: url('/static/defimags/baozhengjin.png');
  189. background-size: 100% 100%;//背景图片能够显示全
  190. }
  191. .topbzjText{
  192. margin-top: 140rpx;
  193. font-size: 46rpx;
  194. // font-family: zrht;
  195. color: black;
  196. font-weight: bold;
  197. }
  198. .titleText{
  199. margin-top: 20rpx;
  200. font-size: 30rpx;
  201. color: #1A1A1A;
  202. font-weight: bold;
  203. }
  204. .baozhjView{
  205. margin-top: -110rpx;
  206. width: 94%;
  207. margin-left: 3%;
  208. background-color: white;
  209. box-shadow: 0px 0rpx 10rpx 0rpx lightgrey;
  210. border-radius: 8rpx;
  211. }
  212. .baozhjshu{
  213. margin-top: 50rpx;
  214. font-size: 76rpx;
  215. color: #1A1A1A;
  216. font-weight: bold;
  217. }
  218. .jiaonaBt{
  219. margin-top: 40rpx;
  220. font-size: 30rpx;
  221. color:white;
  222. background-color: #006AFF;
  223. border-radius: 10rpx;
  224. width: 80%;
  225. line-height: 68rpx;
  226. text-align: center;
  227. margin-bottom: 40rpx;
  228. }
  229. .tuibaoBt{
  230. margin-top: 40rpx;
  231. font-size: 30rpx;
  232. color:darkgray;
  233. background-color: lightgray;
  234. border-radius: 10rpx;
  235. width: 80%;
  236. line-height: 68rpx;
  237. text-align: center;
  238. margin-bottom: 40rpx;
  239. }
  240. .noteText{
  241. margin-top: 20rpx;
  242. font-size: 36rpx;
  243. font-weight: bold;
  244. margin-bottom: 20rpx;
  245. }
  246. .guizItemV{
  247. padding-top: 20rpx;
  248. padding-bottom: 20rpx;
  249. border: solid lavender;
  250. border-width: 0px 0px 1rpx 0px;
  251. }
  252. .noteTitleText{
  253. font-size: 32rpx;
  254. font-weight: bold;
  255. margin-bottom: 20rpx;
  256. }
  257. .noteDetaelText{
  258. font-size: 28rpx;
  259. color: #1A1A1A;
  260. }
  261. .popitemV{
  262. margin: 20rpx;
  263. padding: 20rpx;
  264. box-shadow: 0px 0rpx 10rpx 0rpx lightgrey;
  265. color: darkgray;
  266. }
  267. .popitemVB{
  268. margin: 20rpx;
  269. padding: 20rpx;
  270. box-shadow: 0px 0rpx 10rpx 0rpx #006AFF;
  271. }
  272. .noteDTText{
  273. font-size: 32rpx;
  274. font-weight: bold;
  275. color: #1A1A1A;
  276. }
  277. .noteDText{
  278. font-size: 28rpx;
  279. color: darkgreen;
  280. }
  281. </style>