WriteOff.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="content">
  3. <view class="qr-box position-relative">
  4. <view class="title-box">
  5. <view class="title">
  6. 服务确认二维码
  7. </view>
  8. <view class="tip-text">
  9. 请扫码核销
  10. </view>
  11. </view>
  12. <view class="qr-content flex-center">
  13. <uqrcode :loading='loading' :auto='false' :start='false' sizeUnit='rpx' ref="qrcode" canvas-id="qrcode"
  14. :value="item.verify_code" size="500"></uqrcode>
  15. </view>
  16. <view class="text-code">
  17. {{item.verify_code}}
  18. </view>
  19. <view class="tip-icon top-left"></view>
  20. <view class="tip-icon bottom-left"></view>
  21. <view class="tip-icon top-right"></view>
  22. <view class="tip-icon bottom-right"></view>
  23. </view>
  24. <view class="flex bottomBox">
  25. <view class="buttomBottom" @click="shopLi">
  26. 联系商家
  27. </view>
  28. <view class="buttomBottom bgYellow" @click="shopNext">前往商家</view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. orderDetail
  35. } from '@/api/order.js';
  36. export default {
  37. data() {
  38. return {
  39. orderId: '',
  40. item: {
  41. verify_code: ''
  42. },
  43. loading: true
  44. };
  45. },
  46. onLoad(option) {
  47. this.orderId = option.id;
  48. this.loadOrder();
  49. },
  50. methods: {
  51. // 载入订单详细
  52. loadOrder() {
  53. let obj = this;
  54. orderDetail({}, obj.orderId).then(e => {
  55. obj.item = e.data;
  56. obj.$refs.qrcode.make({
  57. success: () => {
  58. obj.loading = false;
  59. console.log('生成成功');
  60. },
  61. fail: err => {
  62. console.log(err)
  63. }
  64. });
  65. });
  66. },
  67. // 联系商家
  68. shopLi() {
  69. uni.makePhoneCall({
  70. phoneNumber: this.item.system_store.phone //仅为示例
  71. });
  72. },
  73. // 前往商家
  74. shopNext() {
  75. // 打开地图导航
  76. uni.openLocation({
  77. latitude: +this.item.system_store.latitude,
  78. longitude: +this.item.system_store.longitude,
  79. fail(e) {
  80. console.log(e);
  81. }
  82. })
  83. },
  84. }
  85. };
  86. </script>
  87. <style lang="scss">
  88. page {
  89. background-color: $base-color;
  90. }
  91. .qr-box {
  92. color: $font-color-dark;
  93. background-color: #FFF;
  94. text-align: center;
  95. margin: 0 30rpx;
  96. .title-box {
  97. padding-top: 50rpx;
  98. padding-bottom: 30rpx;
  99. background-color: #F5F5F5;
  100. .title {
  101. font-weight: bold;
  102. font-size: 44rpx;
  103. }
  104. .tip-text {
  105. font-size: $font-sm;
  106. color: $font-color-light;
  107. }
  108. }
  109. .qr-content {
  110. padding-top: 110rpx;
  111. }
  112. .tip-icon {
  113. position: absolute;
  114. background-color: $base-color;
  115. border-radius: 99rpx;
  116. width: 100rpx;
  117. height: 100rpx;
  118. }
  119. .top-left,
  120. .bottom-left {
  121. left: -40rpx;
  122. }
  123. .top-right,
  124. .bottom-right {
  125. right: -40rpx;
  126. }
  127. .bottom-left,
  128. .bottom-right {
  129. bottom: -40rpx;
  130. }
  131. .top-left,
  132. .top-right {
  133. top: -40rpx;
  134. }
  135. .text-code {
  136. font-size: 44rpx;
  137. font-weight: bold;
  138. padding-top: 60rpx;
  139. padding-bottom: 110rpx;
  140. }
  141. }
  142. .content {
  143. padding-top: 90rpx;
  144. }
  145. .bottomBox {
  146. justify-content: space-around;
  147. position: fixed;
  148. bottom: 0;
  149. left: 0;
  150. right: 0;
  151. border-top: 1px solid $border-color-light;
  152. .buttomBottom {
  153. width: 50%;
  154. text-align: center;
  155. padding: 30rpx 80rpx;
  156. line-height: 1;
  157. color: $base-color;
  158. font-size: $font-base;
  159. background-color: #FFF;
  160. &.bgYellow {
  161. color: #FFFFFF;
  162. background: $bg-gradual;
  163. }
  164. }
  165. }
  166. </style>