hallorderDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <view class="content">
  3. <view class="order-item">
  4. <view class="goods-box-single">
  5. <image class="goods-img" :src="item.image" mode="aspectFill"></image>
  6. <view class="right position-relative">
  7. <view class="flex">
  8. <text class="title">{{ item.name }}</text>
  9. <view class="title-right">
  10. <view class="price">{{ item.price }}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="row b-b flex">
  17. <text class="tit">订单总价</text>
  18. <view class="input">¥{{ item.price }}</view>
  19. </view>
  20. <view class="orderDetialBox">
  21. <view class="f-header m-t">
  22. <view class="f-left-icon"></view>
  23. <view class="tit-box"><text class="tit">订单信息</text></view>
  24. </view>
  25. <view class="item flex">
  26. <view class="title-left flex">
  27. <text class="title">订单编号:</text>
  28. <view class="text">{{ item.order_id }}</view>
  29. </view>
  30. <view class="buttom-right" @click="copyOrderId(item.order_id)">复制单号</view>
  31. </view>
  32. <view class="item flex">
  33. <view class="title-left flex">
  34. <text class="title">下单时间:</text>
  35. <view class="text">{{ item.create_time }}</view>
  36. </view>
  37. </view>
  38. <view class="item flex">
  39. <view class="title-left flex">
  40. <text class="title">完成时间:</text>
  41. <view class="text">{{ item.update_time }}</view>
  42. </view>
  43. </view>
  44. <view class="item flex">
  45. <view class="title-left flex">
  46. <text class="title">卖家昵称:</text>
  47. <view class="text">{{ item.c_nickname }}</view>
  48. </view>
  49. </view>
  50. <view class="item flex">
  51. <view class="title-left flex">
  52. <text class="title">卖家电话:</text>
  53. <view class="text">{{ item.phone }}</view>
  54. </view>
  55. </view>
  56. <view class="main">
  57. <view class="main-tip">卖家收款方式</view>
  58. <view class="main-title flex">
  59. <view class="main-item">
  60. <view class="mt-item" @click="change('0')" :class="{ current: tabCurrentIndex === 0 }" v-if="zfb != ''">
  61. <image class="mt-image" :src="tabCurrentIndex == 0 ? '../../static/img/aliD.png' : '../../static/img/ali.png'" mode=""></image>
  62. <view class="mt-font" :class="{ current: tabCurrentIndex === 0 }">支付宝</view>
  63. </view>
  64. </view>
  65. <view class="main-item">
  66. <view class="mt-item" @click="change('1')" :class="{ current: tabCurrentIndex === 1 }" v-if="bank != ''">
  67. <image class="mt-image1" :src="tabCurrentIndex == 1 ? '../../static/img/bankD.png' : '../../static/img/bank.png'" mode=""></image>
  68. <view class="mt-font" :class="{ current: tabCurrentIndex === 1 }">银行卡</view>
  69. </view>
  70. </view>
  71. <view class="main-item">
  72. <view class="mt-item" @click="change('2')" :class="{ current: tabCurrentIndex === 2 }" v-if="wx != ''">
  73. <image class="mt-image2" :src="tabCurrentIndex == 2 ? '../../static/img/yueD.png' : '../../static/img/yue.png'" mode=""></image>
  74. <view class="mt-font" :class="{ current: tabCurrentIndex === 2 }">微信</view>
  75. </view>
  76. </view>
  77. </view>
  78. <swiper
  79. class="swiper-box"
  80. :duration="500"
  81. @change="changeTab"
  82. :style="{ height: tabCurrentIndex == 2 ? '450rpx' : tabCurrentIndex == 1 ? '340rpx' : '280rpx' }"
  83. :current="tabCurrentIndex"
  84. disable-touch
  85. >
  86. <swiper-item class="tab-content" v-if="zfb != ''">
  87. <scroll-view scroll-y="true" style="height: 100%;">
  88. <view class="tc-item flex">
  89. <view class="tcitem-name">账号</view>
  90. <view class="ali-name">{{ zfb.payment }}</view>
  91. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(zfb.payment)"></image>
  92. </view>
  93. <view class="tc-item flex">
  94. <view class="tcitem-name">姓名</view>
  95. <view class="ali-name">{{ zfb.name }}</view>
  96. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(zfb.name)"></image>
  97. </view>
  98. </scroll-view>
  99. </swiper-item>
  100. <swiper-item class="tab-content" v-else></swiper-item>
  101. <swiper-item class="tab-content" v-if="bank != ''">
  102. <scroll-view scroll-y="true" style="height: 100%;">
  103. <view class="tc-item flex">
  104. <view class="tcitem-name">姓名</view>
  105. <view class="ali-name">{{ bank.name }}</view>
  106. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.name)"></image>
  107. </view>
  108. <view class="tc-item flex">
  109. <view class="tcitem-name">银行</view>
  110. <view class="ali-name">{{ bank.bank }}</view>
  111. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.bank)"></image>
  112. </view>
  113. <view class="tc-item flex">
  114. <view class="tcitem-name">支行</view>
  115. <view class="ali-name">{{ bank.bank_name }}</view>
  116. <image @click="copy(bank.bank_name)" class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
  117. </view>
  118. <view class="tc-item flex">
  119. <view class="tcitem-name">账号</view>
  120. <view class="ali-name">{{ bank.payment }}</view>
  121. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.payment)"></image>
  122. </view>
  123. </scroll-view>
  124. </swiper-item>
  125. <swiper-item class="tab-content" v-else></swiper-item>
  126. <swiper-item class="tab-content" v-if="wx != ''">
  127. <scroll-view scroll-y="true" style="height: 100%;">
  128. <view class="tc-item flex">
  129. <view class="tcitem-name">账号</view>
  130. <view class="ali-name">{{ wx.payment }}</view>
  131. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(wx.payment)"></image>
  132. </view>
  133. <view class="tc-item flex">
  134. <view class="tcitem-name">姓名</view>
  135. <view class="ali-name">{{ wx.name }}</view>
  136. <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(wx.name)"></image>
  137. </view>
  138. <view class="tc-item">
  139. <view class="upload-title" style="color: #9d9d9d;">微信二维码</view>
  140. <view class="upload-main" @click="lookimg(wx.image)"><image class="upload-image" :src="wx.image" mode="aspectFit"></image></view>
  141. </view>
  142. </scroll-view>
  143. </swiper-item>
  144. <swiper-item class="tab-content" v-else></swiper-item>
  145. </swiper>
  146. </view>
  147. <view class="zf flex">
  148. <view class="title-left"><text class="title">支付凭证(点击右边图片查看大图):</text></view>
  149. <image class="zfpz" @click="lookimg(item.upload_image)" :src="item.upload_image" mode=""></image>
  150. </view>
  151. </view>
  152. <view class="btHeight"></view>
  153. </view>
  154. </template>
  155. <script>
  156. import { user_auction_order } from '@/api/order.js';
  157. import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
  158. export default {
  159. data() {
  160. return {
  161. id: '',
  162. item: '',
  163. tabCurrentIndex: 0,
  164. info: '',
  165. bank: '',
  166. wx: '',
  167. zfb: ''
  168. };
  169. },
  170. onLoad(opt) {
  171. this.id = opt.id;
  172. this.loadData();
  173. },
  174. methods: {
  175. loadData() {
  176. uni.showLoading({
  177. title: '加载中'
  178. });
  179. user_auction_order({ order_id: this.id }).then(({ data }) => {
  180. console.log(data);
  181. this.item = data;
  182. this.bank = data.bank;
  183. this.wx = data.wx;
  184. this.zfb = data.zfb;
  185. uni.hideLoading();
  186. });
  187. },
  188. // 查看大图
  189. lookimg(src) {
  190. console.log(src);
  191. let arr = [src];
  192. uni.previewImage({
  193. current: src,
  194. urls: arr
  195. });
  196. },
  197. copy(value) {
  198. let obj = this;
  199. let content = value; //需要复制的内容
  200. console.log('复制的内容:', content);
  201. // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  202. const result = uniCopy(content);
  203. if (result === false) {
  204. uni.showToast({
  205. title: '不支持'
  206. });
  207. } else {
  208. uni.showToast({
  209. title: '复制成功',
  210. icon: 'none'
  211. });
  212. }
  213. },
  214. //swiper 切换
  215. changeTab(e) {
  216. this.tabCurrentIndex = e.target.current;
  217. },
  218. change(num) {
  219. this.tabCurrentIndex = num * 1;
  220. },
  221. // 复制订单编号
  222. copyOrderId(text) {
  223. // #ifndef H5
  224. uni.setClipboardData({
  225. data: text,
  226. success: e => {
  227. uni.showToast({
  228. title: '复制成功',
  229. duration: 1500
  230. });
  231. }
  232. });
  233. // #endif
  234. // #ifdef H5
  235. // 获取需要复制的文字
  236. const copyStr = text;
  237. // 创建input标签存放需要复制的文字
  238. const oInput = document.createElement('input');
  239. // 把文字放进input中,供复制
  240. oInput.value = copyStr;
  241. // 添加文
  242. document.body.appendChild(oInput);
  243. // 选中创建的input
  244. oInput.select();
  245. // 执行复制方法, 该方法返回bool类型的结果,告诉我们是否复制成功
  246. const copyResult = document.execCommand('copy');
  247. // 操作中完成后 从Dom中删除创建的input
  248. document.body.removeChild(oInput);
  249. // 根据返回的复制结果 给用户不同的提示
  250. if (copyResult) {
  251. uni.showToast({
  252. title: '已复制到粘贴板',
  253. duration: 2000
  254. });
  255. } else {
  256. this.$api.msg('复制失败');
  257. }
  258. // #endif
  259. }
  260. }
  261. };
  262. </script>
  263. <style lang="scss">
  264. page {
  265. background: $page-color-base;
  266. }
  267. // 订单详细
  268. .orderDetialBox {
  269. margin-top: 20rpx;
  270. padding: 0 30rpx;
  271. background-color: #ffffff;
  272. font-size: $font-base;
  273. color: $font-color-base;
  274. .item {
  275. height: 80rpx;
  276. .text {
  277. padding-left: 10rpx;
  278. }
  279. .buttom-right {
  280. width: 180rpx;
  281. border-radius: 99rpx;
  282. padding: 10rpx;
  283. text-align: center;
  284. border: 1px solid $border-color-light;
  285. }
  286. }
  287. .zf {
  288. .zfpz {
  289. width: 160rpx;
  290. height: 160rpx;
  291. }
  292. }
  293. }
  294. .row {
  295. display: flex;
  296. align-items: center;
  297. position: relative;
  298. padding: 0 30rpx;
  299. height: 80rpx;
  300. background: #fff;
  301. .order-status {
  302. font-size: $font-lg;
  303. color: $color-red;
  304. font-weight: 500;
  305. }
  306. .refund {
  307. font-size: 30rpx;
  308. color: $font-color-dark;
  309. }
  310. .noRefund {
  311. font-size: 30rpx;
  312. color: $font-color-light;
  313. }
  314. .tit {
  315. flex-shrink: 0;
  316. width: 120rpx;
  317. font-size: 30rpx;
  318. color: $font-color-dark;
  319. }
  320. .input {
  321. text-align: right;
  322. flex: 1;
  323. font-size: 30rpx;
  324. color: $font-color-dark;
  325. &.payColor {
  326. color: $color-red;
  327. }
  328. }
  329. .iconlocation {
  330. font-size: 36rpx;
  331. color: $font-color-light;
  332. }
  333. }
  334. .add-btn {
  335. display: flex;
  336. align-items: center;
  337. justify-content: center;
  338. width: 690rpx;
  339. height: 80rpx;
  340. margin: 60rpx auto;
  341. font-size: $font-lg;
  342. color: #fff;
  343. background-color: $base-color;
  344. border-radius: 10rpx;
  345. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  346. }
  347. /* 多条商品 */
  348. .order-item {
  349. display: flex;
  350. flex-direction: column;
  351. padding-left: 30rpx;
  352. background: #fff;
  353. margin-top: 20rpx;
  354. /* 单条商品 */
  355. .goods-box-single {
  356. display: flex;
  357. padding: 20rpx 0;
  358. .goods-img {
  359. display: block;
  360. width: 120rpx;
  361. height: 120rpx;
  362. }
  363. .right {
  364. flex: 1;
  365. display: flex;
  366. flex-direction: column;
  367. padding: 0 30rpx 0 24rpx;
  368. overflow: hidden;
  369. height: 100%;
  370. .title {
  371. align-self: flex-start;
  372. font-size: $font-base + 2rpx;
  373. color: $font-color-dark;
  374. }
  375. .title-right {
  376. flex-shrink: 0;
  377. text-align: right;
  378. align-self: flex-start;
  379. }
  380. .attr-box {
  381. font-size: $font-sm + 2rpx;
  382. color: $font-color-light;
  383. }
  384. .evaluate {
  385. color: #ffffff;
  386. font-size: 24rpx;
  387. display: inline-block;
  388. text-align: right;
  389. text {
  390. background: #fa2740;
  391. padding: 5rpx 15rpx;
  392. }
  393. }
  394. .yesevaluate {
  395. color: #333333;
  396. font-size: 24rpx;
  397. display: inline-block;
  398. text-align: right;
  399. text {
  400. border: 2rpx solid #333333;
  401. padding: 5rpx 15rpx;
  402. }
  403. }
  404. .price {
  405. font-size: $font-base + 2rpx;
  406. color: $font-color-dark;
  407. &:before {
  408. content: '¥';
  409. font-size: $font-sm;
  410. margin: 0 2rpx 0 8rpx;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. // 标题头
  417. .f-header {
  418. display: flex;
  419. align-items: center;
  420. height: 80rpx;
  421. .tit-box {
  422. @extend %font-title-box;
  423. }
  424. .tit {
  425. @extend %font-title;
  426. }
  427. .f-left-icon {
  428. @extend %f-left-icon;
  429. }
  430. }
  431. // 共有底部高度
  432. $btHeight: 100rpx;
  433. .btHeight {
  434. height: $btHeight;
  435. }
  436. // 拼团按钮
  437. .group-nav {
  438. position: fixed;
  439. bottom: 0;
  440. left: 0;
  441. height: $btHeight;
  442. width: 100%;
  443. justify-content: flex-end;
  444. padding-right: 30rpx;
  445. .bottom {
  446. }
  447. }
  448. .main {
  449. margin-top: 20rpx;
  450. padding: 30rpx 0 40rpx;
  451. background: #ffffff;
  452. .main-tip {
  453. padding: 0 30rpx;
  454. font-size: 30rpx;
  455. font-family: PingFang SC;
  456. font-weight: 500;
  457. color: #999999;
  458. }
  459. .main-title {
  460. margin-top: 34rpx;
  461. justify-content: flex-start;
  462. .current {
  463. background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
  464. color: #ffffff !important;
  465. }
  466. .main-item {
  467. width: 33%;
  468. }
  469. .mt-item {
  470. margin: 0 auto;
  471. width: 160rpx;
  472. height: 60rpx;
  473. background: #f8f8f8;
  474. border-radius: 10rpx;
  475. display: flex;
  476. justify-content: center;
  477. align-items: center;
  478. .mt-image {
  479. width: 32rpx;
  480. height: 32rpx;
  481. }
  482. .mt-image1 {
  483. width: 38rpx;
  484. height: 32rpx;
  485. }
  486. .mt-image2 {
  487. width: 36rpx;
  488. height: 32rpx;
  489. }
  490. .mt-font {
  491. margin-left: 10rpx;
  492. font-size: 30rpx;
  493. font-family: PingFang SC;
  494. font-weight: bold;
  495. color: #333333;
  496. }
  497. }
  498. }
  499. .swiper-box {
  500. width: 100%;
  501. padding: 14rpx 30rpx 0;
  502. .tc-item {
  503. padding: 50rpx 2rpx 0;
  504. line-height: 1;
  505. .tcitem-name {
  506. width: 118rpx;
  507. font-size: 30rpx;
  508. font-family: PingFang SC;
  509. font-weight: 500;
  510. color: #999999;
  511. }
  512. .ali-name {
  513. width: 380rpx;
  514. font-size: 30rpx;
  515. font-family: PingFang SC;
  516. font-weight: 500;
  517. color: #333333;
  518. }
  519. .tcitem-image {
  520. width: 26rpx;
  521. height: 28rpx;
  522. }
  523. }
  524. }
  525. }
  526. </style>