index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="fetchPacketIndex">
  3. <navigation-bar-view ref="nav" :maxTimer="60"></navigation-bar-view>
  4. <!-- <view class="label-box">请选择您的取出方式</view> -->
  5. <view class="content">
  6. <view class="scan-code-box">
  7. <image class="scan-code-bg" :src="require('../../static/images/icon-scan-code-bg.png')" mode="aspectFit"></image>
  8. <image class="scan-code" :src="codeUrl" mode="aspectFit"></image>
  9. </view>
  10. <view class="message">点开微信”扫一扫“</view>
  11. <view class="message">Scan QR Code via WeChat</view>
  12. <!-- <view class="item">
  13. <view class="label" style="margin-bottom: 2vw;">微信扫码</view>
  14. <view class="img">
  15. <image :src="codeUrl" mode="aspectFit"></image>
  16. </view>
  17. <view class="message">微信/支付宝扫码</view>
  18. </view>
  19. <view class="item">
  20. <view class="label">手机号验证</view>
  21. <view class="cell">
  22. <input class="input-box" placeholder="请输入存放手机号码后四位" type="number" @input="changePhone" />
  23. </view>
  24. <view class="cell">
  25. <input class="input-box" placeholder="请输入取货码" type="number" @input="changeCode" />
  26. <view class="code-btn" @click="getCode">确认</view>
  27. </view>
  28. </view> -->
  29. </view>
  30. <view class="take-out-the-process">
  31. <image class="icon" :src="require('../../static/images/icon-take-out.png')" mode="aspectFit"></image>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import navigationBarView from '../../components/navigationBarView.vue';
  37. export default {
  38. components: {
  39. navigationBarView
  40. },
  41. data() {
  42. return {
  43. countDownStr: '获取验证码',
  44. body: {
  45. phone: '',
  46. rentSn: ''
  47. },
  48. codeUrl: ''
  49. }
  50. },
  51. onLoad() {
  52. this.getData();
  53. },
  54. onHide() {
  55. const $this = this;
  56. $this.$nextTick(function() {
  57. $this.$refs.nav.clearTimer();
  58. })
  59. },
  60. methods: {
  61. getData() {
  62. let sn = uni.getStorageSync('sn');
  63. this.codeUrl = `../../static/TakeStore/take_${sn}.png`
  64. console.log(this.codeUrl)
  65. this.$api.deviceInfo({
  66. deviceSn: sn
  67. }).then(res => {
  68. this.codeUrl = res.data.takeUrl
  69. })
  70. },
  71. changePhone(e) {
  72. this.body.phone = e.detail.value;
  73. },
  74. changeCode(e) {
  75. this.body.rentSn = e.detail.value;
  76. },
  77. getCode() {
  78. if (!this.body.phone) {
  79. uni.showToast({
  80. title: '请输入手机号后四位',
  81. icon: 'none'
  82. })
  83. return
  84. }
  85. if (!this.body.rentSn) {
  86. uni.showToast({
  87. title: '请输入取货码',
  88. icon: 'none'
  89. })
  90. return
  91. }
  92. // 977114
  93. let sn = uni.getStorageSync('sn');
  94. this.$api.offorderOfflineInfo({
  95. mobile: this.body.phone,
  96. rentSn: this.body.rentSn,
  97. deviceSn: sn
  98. }).then(res => {
  99. uni.redirectTo({
  100. url: '/pages/order/details?mobile=' + this.body.phone + '&rentSn=' + this.body.rentSn
  101. })
  102. })
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. .fetchPacketIndex {
  109. min-height: 100vh;
  110. background-color: #F8F8F8;
  111. .label-box {
  112. padding: 15.2vw 5vw 5.2vw;
  113. color: #222222;
  114. font-size: 4.2vw;
  115. }
  116. .content {
  117. display: flex;
  118. align-items: center;
  119. justify-content: space-between;
  120. flex-direction: column;
  121. // background-color: red;
  122. margin-top: 29.2vw;
  123. // padding: 0 5vw;
  124. .scan-code-box {
  125. position: relative;
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. width: 39.7vw;
  130. height: 39.6vw;
  131. margin-bottom: 8.3vw;
  132. .scan-code-bg {
  133. position: absolute;
  134. top: 0;
  135. left: 0;
  136. width: 39.7vw;
  137. height: 39.6vw;
  138. }
  139. .scan-code {
  140. position: relative;
  141. width: 29.2vw;
  142. height: 29.2vw;
  143. }
  144. }
  145. .message {
  146. text-align: center;
  147. font-size: 4.2vw;
  148. line-height: 5.8vw;
  149. color: #253B56;
  150. }
  151. // .item {
  152. // display: flex;
  153. // align-items: center;
  154. // flex-direction: column;
  155. // width: 42.5vw;
  156. // height: 60.4vw;
  157. // border-radius: 1.7vw;
  158. // background-color: #FFFFFF;
  159. // .label {
  160. // margin: 11.3vw 0 5vw;
  161. // color: #222222;
  162. // font-size: 4.2vw;
  163. // line-height: 4.2vw;
  164. // }
  165. // .message {
  166. // color: #666;
  167. // font-size: 3.2vw;
  168. // line-height: 3.2vw;
  169. // }
  170. // .img {
  171. // width: 30vw;
  172. // height: 30vw;
  173. // image {
  174. // width: 100%;
  175. // height: 100%;
  176. // }
  177. // }
  178. // .cell {
  179. // display: flex;
  180. // align-items: center;
  181. // width: 35.2vw;
  182. // margin-bottom: 11rpx;
  183. // .input-box {
  184. // flex: 1;
  185. // height: 7.5vw;
  186. // line-height: 7.5vw;
  187. // border: 0.2vw solid #DCDCDC;
  188. // border-radius: .8vw;
  189. // padding: 0 1vw;
  190. // background-color: #F4F4F4;
  191. // font-size: 2.5vw;
  192. // }
  193. // .code-btn {
  194. // display: flex;
  195. // align-items: center;
  196. // justify-content: center;
  197. // width: 15vw;
  198. // height: 7.5vw;
  199. // border-radius: .8vw;
  200. // background-color: #FDD002;
  201. // margin-left: 1.9vw;
  202. // font-size: 2.5vw;
  203. // }
  204. // }
  205. // }
  206. }
  207. .take-out-the-process {
  208. position: fixed;
  209. bottom: 0;
  210. left: 0;
  211. right: 0;
  212. .icon {
  213. width: 100vw;
  214. height: 43.75vw;
  215. vertical-align: top;
  216. }
  217. }
  218. }
  219. </style>