orderDetail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <template>
  2. <view class="container">
  3. <view class="recharge">
  4. <view class="example-title flex_item">
  5. <view class="titleTip"></view>
  6. <view class="">支付信息</view>
  7. </view>
  8. <view class="infoBox">
  9. <view class="tplAddr" v-if="baseData.bank=='wx'">收款:<text>微信</text></view>
  10. <view class="tplAddr" v-else-if="baseData.bank=='alipay'">收款:<text>支付宝</text></view>
  11. <view class="tplAddr" v-else>银行:<text>{{baseData.bank}}</text></view>
  12. <view class="tplAddr" v-if="baseData.bank_name">支行:<text>{{baseData.bank_name}}</text></view>
  13. <view class="tplAddr" v-if="baseData.bank_code">卡号:<text>{{baseData.bank_code}}</text></view>
  14. <view class="tplAddr" v-if="baseData.account">账号:<text>{{baseData.account}}</text></view>
  15. <view class="tplAddr">姓名:<text>{{baseData.real_name}}</text></view>
  16. <view class="tplAddr">手机号:<text>{{baseData.phone}}</text></view>
  17. <view class="tplAddr">数量:<text>{{baseData.num*1}}{{baseData.money_type}}</text></view>
  18. <view class="tplAddr">单格:<text>¥{{baseData.price*1}}</text></view>
  19. <view class="tplAddr">总价:<text>¥{{allmoney}}</text></view>
  20. </view>
  21. </view>
  22. <view class="login_text" v-if="baseData.qrcode">
  23. <view class="example-title flex_item">
  24. <view class="titleTip"></view>
  25. <view class="">收款码</view>
  26. </view>
  27. <view class="login_input">
  28. <view class="login_name">
  29. <image class="showQrcode" mode="scaleToFill" :src="baseData.qrcode" @click="openshow"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="login_text" v-if="baseData.status!=1">
  34. <view class="example-title flex_item">
  35. <view class="titleTip"></view>
  36. <view class="">打款凭证</view>
  37. </view>
  38. <view class="login_input">
  39. <!-- <view class="login_img"><text>打款凭证</text></view> -->
  40. <view class="login_name" @click="scImg" v-if="!baseData.voucher">
  41. <image :src="img||'/static/image/img19.png'"></image>
  42. </view>
  43. <view class="login_name" v-else>
  44. <image class="showImage" mode="widthFix" :src="baseData.voucher"></image>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- <view class="submission" v-if="baseData.status==3 && tab == 1"><button class="golden" type="golden" hover-class="none"
  49. @click="submission">确认提交</button></view> -->
  50. <view class="submission" v-if="baseData.status==5 && tab == 0"><button class="golden" type="golden" hover-class="none"
  51. @click="comirOrder">确认订单</button></view>
  52. <view class="submission" v-if="baseData.status==1 && tab == 0"><button class="golden" type="golden" hover-class="none"
  53. @click="cancel">取消订单</button></view>
  54. </view>
  55. </template>
  56. <script type="text/javascript">
  57. // import { show_cb,do_cb } from '@/api/recharge.js';
  58. import {
  59. upload
  60. } from '@/api/order.js';
  61. import {
  62. getSell,
  63. setSellVoucher,
  64. cancelLog,
  65. comfirLog
  66. } from '@/api/game.js';
  67. import {
  68. copyText
  69. } from '@/utils/rocessor.js';
  70. export default {
  71. data() {
  72. return {
  73. img: '',
  74. remark: '',
  75. id: '',
  76. baseData: {},
  77. allmoney: 0,
  78. tab:0
  79. };
  80. },
  81. onLoad(opt) {
  82. this.id = opt.id;
  83. this.tab = opt.tab;
  84. this.getData();
  85. },
  86. methods: {
  87. // 预览图片
  88. openshow(){
  89. console.log('预览');
  90. uni.previewImage({
  91. urls:[this.baseData.qrcode],
  92. fail(err){
  93. console.log(err);
  94. }
  95. })
  96. },
  97. //获取数据
  98. getData() {
  99. const that = this;
  100. //确认充值调接口,成功跳转页面
  101. getSell({
  102. id: that.id,
  103. })
  104. .then(function(e) {
  105. that.baseData = e.data.info
  106. that.baseData.num = that.baseData.num * 1;
  107. that.baseData.price = that.baseData.price * 1;
  108. that.allmoney = +(that.baseData.num * that.baseData.price).toFixed(8);
  109. console.log(that.allmoney);
  110. })
  111. .catch(function(e) {
  112. console.log(e);
  113. });
  114. },
  115. //取消挂出
  116. cancel(id){
  117. const that = this;
  118. cancelLog({
  119. id:that.id,
  120. }).then(res => {
  121. if(res.status == 200){
  122. uni.showToast({
  123. title: res.msg,
  124. icon: 'none',
  125. })
  126. setTimeout(()=>{
  127. uni.navigateBack()
  128. },1000)
  129. }else{
  130. uni.showToast({
  131. title: res.msg,
  132. icon: 'none',
  133. })
  134. }
  135. });
  136. },
  137. comirOrder(){
  138. const that = this;
  139. comfirLog({
  140. id:that.id,
  141. }).then(res => {
  142. if(res.status == 200){
  143. uni.showToast({
  144. title: res.msg,
  145. icon: 'none',
  146. })
  147. setTimeout(()=>{
  148. uni.navigateBack()
  149. },1000)
  150. }else{
  151. uni.showToast({
  152. title: res.msg,
  153. icon: 'none',
  154. })
  155. }
  156. });
  157. },
  158. // 下载图片
  159. domImage() {
  160. uni.downloadFile({
  161. url: this.er_code,
  162. success(re) {
  163. console.log(re.tempFilePath, 're');
  164. uni.showToast({
  165. title: '下载成功'
  166. });
  167. }
  168. })
  169. },
  170. // 复制地址
  171. copy() {
  172. copyText(this.dataMoney.address)
  173. },
  174. // 二维码生成
  175. qrR(res) {
  176. this.er_code = res;
  177. },
  178. //确认提交
  179. submission() {
  180. let obj = this;
  181. uni.showLoading({
  182. title: '提交中...',
  183. mask: true
  184. });
  185. //确认充值调接口,成功跳转页面
  186. setSellVoucher({
  187. id: obj.id,
  188. image: obj.img,
  189. })
  190. .then(function(e) {
  191. uni.hideLoading();
  192. uni.showToast({
  193. title: e.msg
  194. });
  195. setTimeout(()=>{
  196. uni.navigateBack()
  197. },1500)
  198. })
  199. .catch(function(e) {
  200. console.log(e, '错误');
  201. uni.hideLoading();
  202. });
  203. },
  204. //上传图片
  205. scImg() {
  206. upload({
  207. file: ''
  208. }).then((e) => {
  209. console.log(e, 55)
  210. this.img = e[0].url;
  211. });
  212. },
  213. }
  214. };
  215. </script>
  216. <style lang="scss">
  217. /* page {
  218. min-height: 100%;
  219. background: linear-gradient(-28deg, rgba(44, 45, 53, 1), rgba(59, 62, 74, 1));
  220. } */
  221. .body_content {
  222. width: 100%;
  223. height: 100%;
  224. }
  225. .login_text {
  226. width: 100%;
  227. color: #fff !important;
  228. font-size: 28rpx !important;
  229. background-color: #1F2A4A;
  230. margin: 25rpx 0rpx;
  231. padding-bottom: 15rpx;
  232. }
  233. .recharge {
  234. text-align: center;
  235. color: #85858e;
  236. font-size: 30rpx;
  237. background-color: #1F2A4A;
  238. }
  239. .example-title {
  240. text-align: left !important;
  241. padding: 25rpx 25rpx;
  242. border-bottom: 2rpx solid #2F364E;
  243. color: #0C5AFA;
  244. .titleTip {
  245. width: 5rpx;
  246. height: 30rpx;
  247. background: linear-gradient(90deg, #0C5AFA, #1356FF);
  248. border-radius: 3rpx;
  249. margin-right: 15rpx;
  250. }
  251. }
  252. .infoBox {
  253. text-align: left;
  254. padding: 28rpx 51rpx;
  255. .tplName {
  256. font-family: PingFang SC;
  257. font-weight: bold;
  258. font-size: 32rpx;
  259. color: #FFFFFF;
  260. line-height: 24rpx;
  261. }
  262. .tplNum {
  263. margin: 30rpx 0rpx;
  264. padding: 15rpx 30rpx;
  265. border-radius: 10rpx;
  266. border: 1px solid #1356FF;
  267. font-family: PingFang SC;
  268. font-size: 26rpx;
  269. color: #1356FF;
  270. display: inline-block;
  271. }
  272. .tplAddr {
  273. color: #e3e3e3;
  274. font-size: 26rpx;
  275. margin-bottom: 10rpx;
  276. text {
  277. padding-left: 15rpx;
  278. font-size: 26rpx;
  279. color: #FFFFFF;
  280. }
  281. }
  282. }
  283. .login_input {
  284. // border-bottom: 1px solid #464755;
  285. padding: 35rpx;
  286. }
  287. .uni-input {
  288. width: 100%;
  289. text-align: left !important;
  290. }
  291. .code {
  292. width: 277rpx;
  293. height: 277rpx;
  294. margin: 25rpx auto;
  295. margin-bottom: 35rpx;
  296. background: #0C5AFA;
  297. }
  298. .code image {
  299. width: 100%;
  300. height: 100%;
  301. }
  302. .btnBox {
  303. justify-content: center;
  304. padding-bottom: 50rpx;
  305. padding-top: 30rpx;
  306. .btn {
  307. margin-right: 50rpx;
  308. font-family: PingFang SC;
  309. font-weight: bold;
  310. font-size: 26rpx;
  311. color: #0C5AFA;
  312. border: 1rpx solid #0C5AFA;
  313. padding: 15rpx 45rpx;
  314. border-radius: 15rpx;
  315. }
  316. }
  317. .submission {
  318. padding: 30rpx 25rpx;
  319. .golden {
  320. background: #0C5AFA;
  321. color: #fff;
  322. }
  323. }
  324. .login_name {
  325. width: 100%;
  326. color: #ffffff;
  327. .showImage {
  328. width: 100%;
  329. border: 1px solid #FFF;
  330. }
  331. }
  332. .login_name image {
  333. width: 100rpx;
  334. height: 100rpx;
  335. }
  336. .tip {
  337. padding: 29rpx 31rpx;
  338. line-height: 55rpx;
  339. font-size: 24rpx;
  340. }
  341. .select_img {
  342. width: 28rpx;
  343. height: 32rpx;
  344. }
  345. .select_img image {
  346. width: 100%;
  347. height: 100%;
  348. }
  349. .scann {
  350. margin-bottom: 35rpx;
  351. margin-top: 15rpx;
  352. }
  353. .scanning {
  354. background-color: #6f6f78;
  355. color: #ffffff;
  356. padding: 10rpx 30rpx;
  357. border-radius: 15rpx;
  358. font-size: 28rpx;
  359. }
  360. .address_code {
  361. padding: 25rpx 0rpx;
  362. color: #ffffff;
  363. }
  364. .input-placeholder {
  365. color: #fff !important;
  366. }
  367. </style>