_ids.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <div class="mobile-fix-content mobile-centerfix-content mobile-dopay">
  3. <p class="md-remain-time">
  4. 请您在 <span class="red-text">{{baseUtils.filterDate(remainTime, 'day')}}天{{baseUtils.filterDate(remainTime, 'hour')}}时{{baseUtils.filterDate(remainTime, 'minute')}}分</span> 内完成支付,否则订单会被自动取消!
  5. </p>
  6. <div class="content-line md-pay">
  7. <h1>收款账户</h1>
  8. <div class="info-line clearfix">
  9. <div class="fl">平台代收&nbsp;<i class="inline-block">i</i></div>
  10. <div class="fr"><span class="inline-block text-ellipse">{{accountData.branchname}}</span></div>
  11. </div>
  12. <div class="info-line clearfix">
  13. <div class="fl">{{accountData.bankname}}</div>
  14. <div class="fr"><span class="inline-block text-ellipse">{{accountData.number}}</span></div>
  15. </div>
  16. <div class="info-line clearfix">
  17. <div class="fl">上传付款凭证:</div>
  18. <div class="fr">
  19. <div class="img inline-block">
  20. <upload @uploadAction="onUpload" :noReview="true"></upload>
  21. </div>
  22. <div class="inline-block text">仅支持jpg、gif、pdf格式的文件,大小不超过3M</div>
  23. </div>
  24. </div>
  25. <div class="remind clearfix">
  26. <span class="fl">注意:</span>
  27. <p class="fr">1、移动端仅支持线下转账,如需网银转账,可在pc端进行操作。<br/>2、优软商城及销售商不会以订单异常、系统升级为由要求您点击任何网址链接进行退款操作。</p>
  28. </div>
  29. </div>
  30. <div class="content-line md-pay md-info">
  31. <div class="info-line clearfix">
  32. <div class="fl">付款方式:</div>
  33. <div class="fr"><span class="inline-block text-ellipse red-text">线下付款</span></div>
  34. </div>
  35. <div class="info-line clearfix">
  36. <div class="fl">需支付:</div>
  37. <div class="fr">
  38. <span class="inline-block text-ellipse">
  39. <span class="red-text"><span>{{orderData[0].currency | currencyFilter}}</span>{{totalPrice}}</span>
  40. (包含以下订单号)
  41. </span>
  42. </div>
  43. </div>
  44. <ul class="order-list" :class="{'more-list': showMore}">
  45. <li class="clearfix" v-for="(item, index) in orderData">
  46. <div class="fl"><i>{{index + 1}}</i></div>
  47. <div class="fr">{{item.orderid}}</div>
  48. </li>
  49. </ul>
  50. <div class="more" v-if="orderData.length > 3" @click="showMore = !showMore">{{showMore ? '收起' : '查看更多'}}
  51. <i class="iconfont icon-arrow-down" v-if="!showMore"></i>
  52. <i class="iconfont icon-arrow-up" v-else></i>
  53. </div>
  54. </div>
  55. <div class="operate-line">
  56. <nuxt-link to="/mobile/order?type=buyer" class="operate inline-block">前往订单中心</nuxt-link>
  57. <a class="operate inline-block active" @click="submit">提交</a>
  58. </div>
  59. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  60. </div>
  61. </template>
  62. <script>
  63. import { RemindBox } from '~components/mobile/common'
  64. import Upload from '~components/common/upload/upload.vue'
  65. export default {
  66. layout: 'mobile',
  67. middleware: 'authenticated',
  68. data () {
  69. return {
  70. remindText: '',
  71. timeoutCount: '',
  72. showMore: false,
  73. imgUrl: null
  74. }
  75. },
  76. components: {
  77. RemindBox,
  78. Upload
  79. },
  80. fetch ({ store, params }) {
  81. return Promise.all([
  82. store.dispatch('userCenter/loadOrderData', {ids: params.ids}),
  83. store.dispatch('userCenter/loadAccount', {status: 104, type: 'mall'})
  84. ])
  85. },
  86. computed: {
  87. orderData () {
  88. return this.$store.state.userCenter.list.order.data
  89. },
  90. remainTime () {
  91. return this.orderData[0].availabletime - Date.now()
  92. },
  93. accountData () {
  94. return this.$store.state.userCenter.list.account.data[0] || {}
  95. },
  96. totalPrice () {
  97. let price = 0
  98. this.orderData.forEach(item => {
  99. price += item.ensurePrice
  100. })
  101. return price
  102. }
  103. },
  104. methods: {
  105. setRemindText: function (str) {
  106. this.remindText = str
  107. this.timeoutCount++
  108. },
  109. onUpload (obj) {
  110. this.imgUrl = obj.url
  111. },
  112. submit () {
  113. console.log(this.imgUrl)
  114. if (this.imgUrl) {
  115. let arr = []
  116. this.orderData.forEach(item => {
  117. arr.push(item.orderid)
  118. })
  119. this.$http.post(`/trade/transfer?order=${arr.join('-')}`, {
  120. imgUrl: this.imgUrl,
  121. total: this.totalPrice,
  122. type: 'PAIDTOPLATFORM'
  123. }).then(res => {
  124. if (res.data === 'success') {
  125. this.$router.push('/mobile/order?type=buyer')
  126. } else {
  127. this.setRemindText(res.data || '付款失败')
  128. }
  129. }, err => {
  130. this.setRemindText(err.response.data || '付款失败')
  131. })
  132. } else {
  133. this.setRemindText('请上传付款凭证')
  134. }
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. $red-text: #f43938;
  141. .mobile-dopay {
  142. .red-text {
  143. color: $red-text;
  144. }
  145. .md-remain-time {
  146. font-size: .28rem;
  147. color: #666;
  148. padding: .14rem 0 .1rem;
  149. text-align: center;
  150. }
  151. .content-line {
  152. background: #fff;
  153. margin-bottom: .19rem;
  154. }
  155. .md-pay {
  156. padding-bottom: .45rem;
  157. h1 {
  158. height: .8rem;
  159. line-height: .8rem;
  160. text-align: center;
  161. font-size: .35rem;
  162. border-bottom: 1px solid #e4e4e4;
  163. }
  164. .info-line {
  165. padding: 0 .45rem;
  166. margin-top: .28rem;
  167. font-size: .28rem;
  168. color: #666;
  169. .fl {
  170. i {
  171. width: .36rem;
  172. height: .36rem;
  173. color: #fff;
  174. font-weight: bold;
  175. font-size: .28rem;
  176. text-align: center;
  177. line-height: .36rem;
  178. background: $red-text;
  179. border-radius: 100%;
  180. font-style: normal;
  181. }
  182. }
  183. .fr {
  184. span {
  185. width: 4.5rem;
  186. text-align: right;
  187. }
  188. .img {
  189. width: 1.09rem;
  190. height: 1.09rem;
  191. border: 2px dashed #9c9c9c;
  192. .preview {
  193. position: relative;
  194. input {
  195. width: 1.09rem;
  196. height: 1.09rem;
  197. opacity: 0;
  198. position: absolute;
  199. top: -.3rem;
  200. }
  201. }
  202. }
  203. .text {
  204. color: #999;
  205. font-size: .24rem;
  206. max-width: 3rem;
  207. margin-left: .26rem;
  208. }
  209. }
  210. }
  211. .remind {
  212. color: #999;
  213. font-size: .24rem;
  214. padding: 0 .45rem;
  215. margin-top: .44rem;
  216. .fr {
  217. line-height: .36rem;
  218. max-width: 5.8rem;
  219. }
  220. }
  221. }
  222. .md-info {
  223. padding: .33rem 0 0 0;
  224. .info-line {
  225. margin-top: .14rem;
  226. &:first-child {
  227. margin-top: 0;
  228. }
  229. .fl {
  230. width: 1.57rem;
  231. text-align: right;
  232. }
  233. .fr {
  234. > span {
  235. width: 4.7rem;
  236. text-align: left;
  237. word-break: break-all;
  238. white-space: initial;
  239. .red-text {
  240. span {
  241. font-size: .24rem;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. .order-list {
  248. max-height: 1.56rem;
  249. overflow: hidden;
  250. margin-top: .31rem;
  251. &.more-list {
  252. max-height: unset;
  253. }
  254. li {
  255. margin-bottom: .19rem;
  256. .fl {
  257. text-align: right;
  258. width: 35%;
  259. i {
  260. font-size: .24rem;
  261. color: #fff;
  262. font-style: normal;
  263. background: #3f84f6;
  264. padding: .03rem .06rem;
  265. border-radius: .04rem;
  266. }
  267. }
  268. .fr {
  269. padding-left: .07rem;
  270. text-align: left;
  271. width: 65%;
  272. font-size: .24rem;
  273. color: #666;
  274. padding-top: .04rem;
  275. }
  276. }
  277. }
  278. .more {
  279. height: .67rem;
  280. line-height: .67rem;
  281. border-top: 1px solid #e4e4e4;
  282. font-size: .28rem;
  283. text-align: center;
  284. i {
  285. font-size: .24rem;
  286. margin-left: .1rem;
  287. }
  288. }
  289. }
  290. .operate-line {
  291. margin-bottom: .63rem;
  292. margin-top: .51rem;
  293. text-align: center;
  294. .operate {
  295. width: 5.96rem;
  296. height: .77rem;
  297. line-height: .77rem;
  298. font-size: .32rem;
  299. color: #666;
  300. text-align: center;
  301. background: #fff;
  302. border: 2px solid #b5b5b6;
  303. border-radius: .08rem;
  304. &.active {
  305. color: #fff;
  306. background: #3f84f6;
  307. border-color: #3f84f6;
  308. margin-top: .28rem;
  309. }
  310. }
  311. }
  312. }
  313. </style>