cbdetail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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 class="top-icon2" src="../../static/img/cb1.png" mode=""></image>
  7. </view>
  8. <view class="title">充幣</view>
  9. <view class="type flex" @click="navTo('/pages/transaction/cblist')">
  10. <view class="type-left">幣種</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">充幣網絡</view>
  18. <view class="main-list">{{ info.czline }}</view>
  19. <view class="main-title" style="margin-top: 20rpx;">充幣地址</view>
  20. <view class="erweima">
  21. <tki-qrcode
  22. :cid="cid"
  23. ref="qrcode"
  24. :val="info.czaddress"
  25. :size="size"
  26. :unit="unit"
  27. :background="background"
  28. :foreground="foreground"
  29. :pdground="pdground"
  30. :iconSize="iconSize"
  31. :lv="lv"
  32. :onval="onval"
  33. :loadMake="loadMake"
  34. :usingComponents="usingComponents"
  35. @result="qrR"
  36. />
  37. </view>
  38. <view class="address">{{ info.czaddress }}</view>
  39. <view class="btn" @click="copy(info.czaddress)">複製地址</view>
  40. </view>
  41. <view class="info">
  42. <view class="info-item red">最小充值金額:{{ info.czminnum }}{{ info.title }},小於最小金額的充值將不會上賬且無法退回</view>
  43. <view class="info-item">請選擇正確的充值通道網絡,否則資產將不可找回</view>
  44. <view class="info-item">最小充值金額:{{ info.czminnum }}{{ info.title }},小於最小金額的充值將不會上賬且無法退回</view>
  45. <view class="info-item">您的充值地址不會經常改變,可以重複充值;如有更改,我們會盡量通過網站公告或郵件通知您</view>
  46. <view class="info-item">請務必確認電腦及瀏覽器安全,防止信息被篡改或洩露</view>
  47. </view>
  48. <view class="sr">
  49. <view class="sr-title">轉賬金額</view>
  50. <view class="sr-input"><input placeholder="請輸入轉賬金額" type="number" v-model="num" /></view>
  51. <view class="sr-title" style="margin-top: 20rpx;">上傳轉賬憑證</view>
  52. <view class="sr-image">
  53. <image :src="image" mode="" class="upload-img" @click.stop="imgsub" v-if="image"></image>
  54. <image src="../../static/img/add.png" class="upload-img" mode="" v-if="!image" @click.stop="imgsub"></image>
  55. </view>
  56. <view class="sr-btn" @click="submit()">提交</view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import { czpage, upload, paycoin } from '@/api/wallet.js';
  62. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  63. import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
  64. export default {
  65. data() {
  66. return {
  67. id: '',
  68. info: '',
  69. cid: 'cid',
  70. size: 100,
  71. unit: '150',
  72. background: '#FFFFFF',
  73. foreground: '#000000',
  74. pdground: '#000000',
  75. icon: '',
  76. iconSize: 40,
  77. lv: 3,
  78. onval: true,
  79. loadMake: true,
  80. usingComponents: true,
  81. num: '',
  82. image: '',
  83. image1: ''
  84. };
  85. },
  86. onLoad(opt) {
  87. this.id = opt.type;
  88. this.loadData();
  89. },
  90. onShow() {},
  91. onReachBottom() {},
  92. onReady() {},
  93. methods: {
  94. loadData() {
  95. czpage({ id: this.id }).then(e => {
  96. this.info = e.data;
  97. });
  98. },
  99. qrR(res) {
  100. console.log(res, '123456');
  101. },
  102. back() {
  103. uni.navigateBack();
  104. },
  105. navTo(url) {
  106. uni.navigateTo({
  107. url
  108. });
  109. },
  110. imgsub() {
  111. console.log(111);
  112. upload({
  113. filename: ''
  114. }).then(data => {
  115. console.log('data', data);
  116. this.image = data[0].src;
  117. this.image1 = data[0].img;
  118. });
  119. },
  120. copy(item) {
  121. let obj = this;
  122. let content = item; //需要复制的内容
  123. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  124. const result = uniCopy(content);
  125. if (result === false) {
  126. uni.showToast({
  127. title: '不支持'
  128. });
  129. } else {
  130. uni.showToast({
  131. title: '複製成功',
  132. icon: 'none'
  133. });
  134. }
  135. },
  136. submit() {
  137. console.log(222);
  138. if (this.num < 0) {
  139. return this.$api.msg('充值金額不能為0');
  140. }
  141. if (!this.image1) {
  142. return this.$api.msg('請上傳轉款憑證');
  143. }
  144. paycoin({ cid: this.id, zznum: this.num, payimg: this.image1, coinname: this.info.title }).then(e => {
  145. this.num = '';
  146. this.image = '';
  147. return this.$api.msg('提交申請成功,請耐心等待審核');
  148. });
  149. }
  150. }
  151. };
  152. </script>
  153. <style lang="scss">
  154. page,
  155. .content {
  156. min-height: 100%;
  157. height: auto;
  158. background: #f5f5f5;
  159. }
  160. .vheigh {
  161. height: var(--status-bar-height);
  162. }
  163. .top {
  164. padding: 20rpx 40rpx;
  165. .top-icon1 {
  166. width: 52rpx;
  167. height: 36rpx;
  168. }
  169. .top-icon2 {
  170. width: 48rpx;
  171. height: 48rpx;
  172. }
  173. }
  174. .title {
  175. padding: 20rpx 20rpx 0;
  176. font-size: 52rpx;
  177. font-weight: 500;
  178. }
  179. .type {
  180. margin: 20rpx auto 0;
  181. width: 690rpx;
  182. background: #ffffff;
  183. border-radius: 20rpx;
  184. padding: 30rpx 20rpx;
  185. .type-left {
  186. font-size: 32rpx;
  187. color: #000;
  188. }
  189. .type-right {
  190. display: flex;
  191. align-items: center;
  192. .type-name {
  193. font-size: 36rpx;
  194. font-weight: bold;
  195. color: #fcd535;
  196. margin-right: 10rpx;
  197. }
  198. .type-icon {
  199. width: 24rpx;
  200. height: 24rpx;
  201. }
  202. }
  203. }
  204. .main {
  205. margin: 20rpx auto 0;
  206. width: 690rpx;
  207. background: #ffffff;
  208. border-radius: 20rpx;
  209. padding: 30rpx 20rpx;
  210. .main-title {
  211. font-size: 32rpx;
  212. color: #000;
  213. }
  214. .main-list {
  215. margin-top: 20rpx;
  216. width: 200rpx;
  217. height: 70rpx;
  218. line-height: 70rpx;
  219. text-align: center;
  220. border: 2px solid #fcd535;
  221. border-radius: 10rpx;
  222. font-size: 28rpx;
  223. color: #fcd535;
  224. }
  225. .erweima {
  226. margin-top: 40rpx;
  227. width: 100%;
  228. display: flex;
  229. justify-content: center;
  230. }
  231. .address {
  232. margin-top: 20rpx;
  233. width: 100%;
  234. text-align: center;
  235. font-size: 24rpx;
  236. color: #000;
  237. }
  238. .btn {
  239. width: 200rpx;
  240. height: 60rpx;
  241. line-height: 60rpx;
  242. text-align: center;
  243. border-radius: 10rpx;
  244. border: 2px solid #fcd535;
  245. font-size: 28rpx;
  246. color: #fcd535;
  247. margin: 20rpx auto 0;
  248. }
  249. }
  250. .info {
  251. margin: 20rpx auto 0;
  252. width: 690rpx;
  253. background: #ffffff;
  254. border-radius: 20rpx;
  255. padding: 30rpx 20rpx;
  256. .info-item {
  257. font-size: 24rpx;
  258. color: #000;
  259. margin-bottom: 20rpx;
  260. }
  261. .red {
  262. color: red;
  263. }
  264. }
  265. .sr {
  266. margin: 20rpx auto 0;
  267. width: 690rpx;
  268. background: #ffffff;
  269. border-radius: 20rpx;
  270. padding: 30rpx 20rpx;
  271. .sr-title {
  272. font-size: 32rpx;
  273. color: #000;
  274. }
  275. .sr-input {
  276. display: flex;
  277. align-items: center;
  278. width: 100%;
  279. height: 80rpx;
  280. line-height: 80rpx;
  281. background: #f5f5f5;
  282. border-radius: 20rpx;
  283. padding: 0rpx 30rpx;
  284. input {
  285. font-size: 28rpx;
  286. padding-left: 30rpx;
  287. background: #f5f5f5;
  288. }
  289. }
  290. .sr-image {
  291. display: flex;
  292. justify-content: center;
  293. margin: 20rpx;
  294. image {
  295. width: 200rpx;
  296. height: 200rpx;
  297. }
  298. }
  299. .sr-btn {
  300. width: 100%;
  301. height: 80rpx;
  302. line-height: 80rpx;
  303. text-align: center;
  304. border-radius: 10rpx;
  305. margin: 20rpx auto 0;
  306. background: linear-gradient(to left, #eeb80d, #ffe35b);
  307. font-size: 28rpx;
  308. color: #000;
  309. }
  310. }
  311. </style>