_ids.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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" @click="showRemind = true">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" @remindAction="setRemindText" :noReview="false"></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. <div class="mobile-modal" v-if="showRemind">
  60. <div class="consignment-modal">
  61. <div class="cm-content">货款将由优软商城在银行开立的第三方账户暂为保管,待您确定收货后,商城再和卖家结算。</div>
  62. <div class="cm-foot" @click="showRemind = false">我知道了</div>
  63. </div>
  64. </div>
  65. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  66. </div>
  67. </template>
  68. <script>
  69. import { RemindBox } from '~components/mobile/common'
  70. import Upload from '~components/common/upload/upload.vue'
  71. export default {
  72. layout: 'mobile',
  73. middleware: 'authenticated',
  74. data () {
  75. return {
  76. remindText: '',
  77. timeoutCount: '',
  78. showMore: false,
  79. imgUrl: null,
  80. showRemind: false
  81. }
  82. },
  83. components: {
  84. RemindBox,
  85. Upload
  86. },
  87. fetch ({ store, params }) {
  88. return Promise.all([
  89. store.dispatch('userCenter/loadOrderData', {ids: params.ids}),
  90. store.dispatch('userCenter/loadAccount', {status: 104, type: 'mall'})
  91. ])
  92. },
  93. computed: {
  94. orderData () {
  95. return this.$store.state.userCenter.list.order.data
  96. },
  97. remainTime () {
  98. return this.orderData[0].availabletime - Date.now()
  99. },
  100. accountData () {
  101. return this.$store.state.userCenter.list.account.data[0] || {}
  102. },
  103. totalPrice () {
  104. let price = 0
  105. this.orderData.forEach(item => {
  106. price += item.ensurePrice
  107. })
  108. return price
  109. }
  110. },
  111. methods: {
  112. setRemindText: function (str) {
  113. this.remindText = str
  114. this.timeoutCount++
  115. },
  116. onUpload (obj) {
  117. this.imgUrl = obj.url
  118. },
  119. submit () {
  120. console.log(this.imgUrl)
  121. if (this.imgUrl) {
  122. let arr = []
  123. this.orderData.forEach(item => {
  124. arr.push(item.orderid)
  125. })
  126. this.$http.post(`/trade/transfer?order=${arr.join('-')}`, {
  127. imgUrl: this.imgUrl,
  128. total: this.totalPrice,
  129. type: 'PAIDTOPLATFORM'
  130. }).then(res => {
  131. if (res.data === 'success') {
  132. this.$router.push('/mobile/order?type=buyer')
  133. } else {
  134. this.setRemindText(res.data || '付款失败')
  135. }
  136. }, err => {
  137. this.setRemindText(err.response.data || '付款失败')
  138. })
  139. } else {
  140. this.setRemindText('请上传付款凭证')
  141. }
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss">
  147. $red-text: #f43938;
  148. .mobile-dopay {
  149. .red-text {
  150. color: $red-text;
  151. }
  152. .md-remain-time {
  153. font-size: .28rem;
  154. color: #666;
  155. padding: .14rem 0 .1rem;
  156. text-align: center;
  157. }
  158. .content-line {
  159. background: #fff;
  160. margin-bottom: .19rem;
  161. }
  162. .md-pay {
  163. padding-bottom: .45rem;
  164. h1 {
  165. height: .8rem;
  166. line-height: .8rem;
  167. text-align: center;
  168. font-size: .35rem;
  169. border-bottom: 1px solid #e4e4e4;
  170. }
  171. .info-line {
  172. padding: 0 .45rem;
  173. margin-top: .28rem;
  174. font-size: .28rem;
  175. color: #666;
  176. .fl {
  177. i {
  178. width: .36rem;
  179. height: .36rem;
  180. color: #fff;
  181. font-weight: bold;
  182. font-size: .28rem;
  183. text-align: center;
  184. line-height: .36rem;
  185. background: $red-text;
  186. border-radius: 100%;
  187. font-style: normal;
  188. }
  189. }
  190. .fr {
  191. > span {
  192. width: 4.5rem;
  193. text-align: right;
  194. }
  195. .img {
  196. width: 1.09rem;
  197. height: 1.09rem;
  198. border: 2px dashed #9c9c9c;
  199. position: relative;
  200. .preview {
  201. position: relative;
  202. input {
  203. width: 1.09rem;
  204. height: 1.09rem;
  205. opacity: 0;
  206. position: absolute;
  207. top: -.3rem;
  208. }
  209. }
  210. .hover-show {
  211. position: absolute;
  212. top: 0;
  213. background: rgba(0,0,0,.4);
  214. bottom: 0;
  215. width: 100%;
  216. a {
  217. display: none;
  218. }
  219. .delete {
  220. display: block;
  221. width: 100%;
  222. text-align: center;
  223. height: 100%;
  224. line-height: 1rem;
  225. font-size: .4rem;
  226. color: #fff;
  227. i {
  228. float: right;
  229. margin: .1rem;
  230. }
  231. }
  232. }
  233. }
  234. .text {
  235. color: #999;
  236. font-size: .24rem;
  237. max-width: 3rem;
  238. margin-left: .26rem;
  239. }
  240. }
  241. }
  242. .remind {
  243. color: #999;
  244. font-size: .24rem;
  245. padding: 0 .45rem;
  246. margin-top: .44rem;
  247. .fr {
  248. line-height: .36rem;
  249. max-width: 5.8rem;
  250. }
  251. }
  252. }
  253. .md-info {
  254. padding: .33rem 0 0 0;
  255. .info-line {
  256. margin-top: .14rem;
  257. &:first-child {
  258. margin-top: 0;
  259. }
  260. .fl {
  261. width: 1.57rem;
  262. text-align: right;
  263. }
  264. .fr {
  265. > span {
  266. width: 4.7rem;
  267. text-align: left;
  268. word-break: break-all;
  269. white-space: initial;
  270. .red-text {
  271. span {
  272. font-size: .24rem;
  273. }
  274. }
  275. }
  276. }
  277. }
  278. .order-list {
  279. max-height: 1.56rem;
  280. overflow: hidden;
  281. margin-top: .31rem;
  282. &.more-list {
  283. max-height: unset;
  284. }
  285. li {
  286. margin-bottom: .19rem;
  287. .fl {
  288. text-align: right;
  289. width: 35%;
  290. i {
  291. font-size: .24rem;
  292. color: #fff;
  293. font-style: normal;
  294. background: #3f84f6;
  295. padding: .03rem .06rem;
  296. border-radius: .04rem;
  297. }
  298. }
  299. .fr {
  300. padding-left: .07rem;
  301. text-align: left;
  302. width: 65%;
  303. font-size: .24rem;
  304. color: #666;
  305. padding-top: .04rem;
  306. }
  307. }
  308. }
  309. .more {
  310. height: .67rem;
  311. line-height: .67rem;
  312. border-top: 1px solid #e4e4e4;
  313. font-size: .28rem;
  314. text-align: center;
  315. i {
  316. font-size: .24rem;
  317. margin-left: .1rem;
  318. }
  319. }
  320. }
  321. .operate-line {
  322. margin-bottom: .63rem;
  323. margin-top: .51rem;
  324. text-align: center;
  325. .operate {
  326. width: 5.96rem;
  327. height: .77rem;
  328. line-height: .77rem;
  329. font-size: .32rem;
  330. color: #666;
  331. text-align: center;
  332. background: #fff;
  333. border: 2px solid #b5b5b6;
  334. border-radius: .08rem;
  335. &.active {
  336. color: #fff;
  337. background: #3f84f6;
  338. border-color: #3f84f6;
  339. margin-top: .28rem;
  340. }
  341. }
  342. }
  343. .consignment-modal {
  344. position: absolute;
  345. top: 50%;
  346. left: 50%;
  347. width: 6.3rem;
  348. margin-left: -3.15rem;
  349. margin-top: -1.36rem;
  350. background: #fff;
  351. border-radius: .15rem;
  352. font-size: .32rem;
  353. .cm-content {
  354. padding: .39rem .42rem .25rem;
  355. border-bottom: 1px solid #f4f4f4;
  356. }
  357. .cm-foot {
  358. padding: .27rem 0;
  359. color: #3f84f6;
  360. text-align: center;
  361. }
  362. }
  363. }
  364. </style>