index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <div id="">
  3. <el-main v-loading="loading" style="padding:0px 14px;">
  4. <h2>
  5. <span style="font-size:16px;">订单详情</span>
  6. <el-button type="text" @click="orderSee">查看</el-button>
  7. </h2>
  8. <ul class="ul_">
  9. <li>
  10. 商品类型:<span>{{
  11. orderInfo.goodsType == 1
  12. ? "课程"
  13. : orderInfo.goodsType == 2
  14. ? "题库"
  15. : ""
  16. }}</span>
  17. </li>
  18. <li>
  19. 教育类型:<span>{{ orderInfo.educationName }}</span
  20. >项目类型:<span
  21. >{{ orderInfo.projectName }}-{{ orderInfo.businessName }}</span
  22. >
  23. 订购人数:<span>{{ orderInfo.userNum || 0 }}位</span>
  24. <!-- 订购数量:<span
  25. >{{ orderInfo.goodsNum || 0 }}个</span
  26. > -->
  27. </li>
  28. <li>
  29. 订购金额:<span style="color:red;"
  30. >¥{{ orderInfo.orderPrice | formatPrice }}</span
  31. >
  32. </li>
  33. </ul>
  34. </el-main>
  35. <el-divider></el-divider>
  36. <el-main style="padding:0px 14px;">
  37. <h2 style="margin-bottom:14px;">
  38. <span style="font-size:16px;">支付方式</span
  39. ><span style="font-size:14px;color:#7f7f7f;font-weight:400;"
  40. >(订单在<el-statistic
  41. v-if="orderInfo.overTime"
  42. @finish="orderHilarity"
  43. format="DD天HH小时mm分ss秒"
  44. :value="orderInfo.overTime * 1000"
  45. time-indices
  46. >
  47. </el-statistic
  48. >后将自动关闭,请尽快完成支付)</span
  49. >
  50. </h2>
  51. <div class="pay_box">
  52. <div class="li li_l">
  53. <img
  54. v-if="!imgData.urlBase64"
  55. src="@/assets/qrcode.png"
  56. alt=""
  57. @click="updateImg"
  58. />
  59. <img v-else :src="imgData.urlBase64" alt="" />
  60. <div class="p_r">
  61. <div style="color:#333;font-weight:bold;font-size:16px;">
  62. 在线支付<el-tag
  63. type="warning"
  64. effect="dark"
  65. size="mini"
  66. style="margin-left:6px;"
  67. >
  68. 推荐
  69. </el-tag>
  70. </div>
  71. <div class="wx_a">
  72. <img src="@/assets/wxpay.png" alt="" />
  73. </div>
  74. <div>
  75. <span style="font-size:16px;">应付金额:</span
  76. ><span style="color:red;font-size:20px;font-weight:bold;">
  77. <span style="font-size:14px;">¥</span
  78. >{{ orderInfo.payPrice | formatPrice }}</span
  79. >
  80. </div>
  81. <div style="font-size:16px;">
  82. 支付码有效时间<el-statistic
  83. v-if="imgData.overTime"
  84. @finish="hilarity"
  85. format="mm分ss秒"
  86. :value="imgData.overTime * 1000"
  87. time-indices
  88. >
  89. </el-statistic>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="fgx"></div>
  94. <div class="li li_2">
  95. <div class="li_2_s">
  96. <div class="top_zz">
  97. <img src="@/assets/dgzz.png" alt="" />
  98. <div class="zz_r">
  99. <h2>对公转账</h2>
  100. <p>
  101. 请在订单关闭前,完成对公转账并且提交公司信
  102. 息及付款回执。(到账后 1 个工作日内开通)
  103. </p>
  104. </div>
  105. </div>
  106. <el-button @click="publictransferFunc">选择对公转账</el-button>
  107. </div>
  108. </div>
  109. </div>
  110. </el-main>
  111. <public-transfer ref="publicTransfer" @backFunc="backFuncTransfer" />
  112. <order-detail ref="orderDetail" />
  113. </div>
  114. </template>
  115. <script>
  116. import orderDetail from "../../orderDetail.vue";
  117. import publicTransfer from "./publicTransfer.vue";
  118. export default {
  119. components: { publicTransfer,orderDetail },
  120. data() {
  121. return {
  122. orderInfo: {},
  123. imgData: {},
  124. loading: false,
  125. handleOrderSn: "",
  126. updateWxImg: null
  127. };
  128. },
  129. mounted() {},
  130. methods: {
  131. orderSee() {
  132. this.$refs.orderDetail.openBoxs(this.handleOrderSn);
  133. },
  134. //订单过期
  135. orderHilarity() {
  136. //1过期2已支付
  137. this.$emit("backFunc", 1);
  138. },
  139. //更新wx二维码
  140. updateImg() {
  141. this.getWxPayData();
  142. },
  143. //wx过期
  144. hilarity() {
  145. this.imgData.urlBase64 = "";
  146. },
  147. backFuncTransfer() {
  148. this.getOrderData();
  149. },
  150. publictransferFunc() {
  151. this.$refs.publicTransfer.openBoxs(this.handleOrderSn);
  152. },
  153. comeFunc(data) {
  154. this.handleOrderSn = data;
  155. this.getOrderData();
  156. },
  157. getOrderData(status) {
  158. this.loading = status ? false : true;
  159. this.$request
  160. .orderhandledetail({ handleOrderSn: this.handleOrderSn })
  161. .then(res => {
  162. this.orderInfo = res.data;
  163. if (res.data.payStatus == 0) {
  164. if (status) return;
  165. this.getWxPayData();
  166. this.updateWxImg = setInterval(() => {
  167. this.getOrderData(true);
  168. }, 1500);
  169. } else {
  170. clearInterval(this.updateWxImg);
  171. this.$emit("backFunc", 3, res.data.payStatus);
  172. this.$refs.publicTransfer.visible = false;
  173. }
  174. })
  175. .finally(() => {
  176. this.loading = false;
  177. });
  178. },
  179. getWxPayData() {
  180. this.$request
  181. .orderhandleresumePay({
  182. payType: 1,
  183. handleOrderSn: this.handleOrderSn
  184. })
  185. .then(res => {
  186. this.imgData = res.data || {};
  187. })
  188. .catch(() => {
  189. this.imgData = {};
  190. });
  191. }
  192. }
  193. };
  194. </script>
  195. <style lang="scss" scoped>
  196. .ul_ {
  197. background-color: #f9fafb;
  198. padding: 20px;
  199. li {
  200. margin-bottom: 20px;
  201. &:last-child {
  202. margin-bottom: 0px;
  203. }
  204. span {
  205. color: #000;
  206. margin-right: 20px;
  207. }
  208. }
  209. }
  210. .pay_box {
  211. display: flex;
  212. .li {
  213. flex: 1;
  214. display: flex;
  215. &:first-child {
  216. display: flex;
  217. & > img {
  218. width: 145px;
  219. height: 145px;
  220. padding: 4px;
  221. border: 1px solid #eee;
  222. border-radius: 8px;
  223. margin-right: 20px;
  224. }
  225. & > .p_r {
  226. flex: 1;
  227. display: flex;
  228. flex-direction: column;
  229. justify-content: space-between;
  230. }
  231. }
  232. }
  233. .li_2 {
  234. justify-content: center;
  235. }
  236. .li_2_s {
  237. width: 366px;
  238. & > .top_zz {
  239. display: flex;
  240. margin-bottom: 30px;
  241. & > img {
  242. margin-right: 10px;
  243. width: 52px;
  244. height: 52px;
  245. background-color: #eee;
  246. }
  247. & > .zz_r {
  248. flex: 1;
  249. & > h2 {
  250. font-size: 16px;
  251. color: #333;
  252. margin-bottom: 4px;
  253. }
  254. & > p {
  255. line-height: 24px;
  256. }
  257. }
  258. }
  259. & > .el-button {
  260. width: 100%;
  261. }
  262. }
  263. .fgx {
  264. margin: 0px 20px;
  265. width: 1px;
  266. background-color: #eee;
  267. }
  268. }
  269. .wx_a {
  270. & > img {
  271. width: 113.4px;
  272. height: 36px;
  273. }
  274. }
  275. /deep/ .el-statistic {
  276. width: auto;
  277. display: inline-block;
  278. .con {
  279. & > .number {
  280. font-size: 14px;
  281. color: #007aff;
  282. }
  283. }
  284. }
  285. </style>