hallorderDetail.vue 13 KB

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