conversion.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <!-- 订单兑换 -->
  2. <template>
  3. <view class="conversion">
  4. <Header :title="title"></Header>
  5. <view class="" style="height: 94upx;"></view>
  6. <view class="order-detail-content">
  7. <view class="order-message">
  8. <view class="title">订单信息</view>
  9. <view class="ordername titlebar"
  10. >产品名称:<text class="txt">{{ orderDetail.goodsName }}</text></view
  11. >
  12. <view class="shopname titlebar"
  13. >店铺名称:<text class="txt">{{ orderDetail.shopName }}</text></view
  14. >
  15. <view class="waternum titlebar"
  16. >流水号:<text class="txt">{{ orderDetail.outOrderNo }}</text></view
  17. >
  18. <view class="ordernum titlebar"
  19. >订单号:<text class="txt">{{ orderDetail.ordersNo }}</text></view
  20. >
  21. <view class="phonenum titlebar"
  22. >手机号:<text class="txt">{{ orderDetail.buyPhone }}</text></view
  23. >
  24. <view class="goindate titlebar"
  25. >入园日期:<text class="txt">{{ orderDetail.orderTime }}</text></view
  26. >
  27. <view class="price titlebar"
  28. >产品价格:<text class="txt">{{
  29. orderDetail.ordersPrice
  30. }}</text></view
  31. >
  32. <view class="buynum titlebar"
  33. >购买数量:<text class="txt">{{
  34. orderDetail.playManList.length
  35. }}</text></view
  36. >
  37. <view class="palytime titlebar"
  38. >游玩时间:<text class="txt">{{ orderDetail.payTime }}</text></view
  39. >
  40. <view class="orderstatus titlebar"
  41. >订单状态:<text class="txt">{{ orderDetail.statusName }}</text>
  42. </view>
  43. <view class="tourist">
  44. <view class="title">游客信息</view>
  45. <view
  46. class="tourist-warp"
  47. v-for="(item, index) in orderDetail.playManList"
  48. :key="index"
  49. >
  50. <view class="name touristbar"
  51. >姓名:<text class="txt">{{ item.name }}</text></view
  52. >
  53. <view class="idcard touristbar"
  54. >身份证:<text class="txt">{{ item.idcard }}</text></view
  55. >
  56. </view>
  57. </view>
  58. </view>
  59. <view class="paymessage">
  60. <view class="title">支付信息</view>
  61. <view class="shoppric"
  62. >产品价格:<text class="money"
  63. >¥{{ orderDetail.ordersPrice }}</text
  64. ></view
  65. >
  66. <view class="realitypirc"
  67. >实付金额:<text class="money"
  68. >¥{{ orderDetail.ordersPrice }}</text
  69. ></view
  70. >
  71. </view>
  72. <view class="btns">
  73. <view class="btn cancel" @tap="cancelChange">取消兑换</view>
  74. <view class="btn convert" @tap="sureconvert">确认兑换</view>
  75. </view>
  76. </view>
  77. <mask
  78. :txt="masktxt"
  79. :iconShow="iconShow"
  80. v-if="isShowMask"
  81. @isSureConver="isSureConver"
  82. ></mask>
  83. <rf-loading v-if="loading"></rf-loading>
  84. </view>
  85. </template>
  86. <script>
  87. import Header from '../components/header.vue';
  88. import mask from '../components/mask';
  89. export default {
  90. components: {
  91. Header,
  92. mask,
  93. },
  94. data() {
  95. return {
  96. title: '订单兑换',
  97. loading: false,
  98. isShowMask: false,
  99. iconShow: false,
  100. masktxt: '是的',
  101. orderDetail: uni.getStorageSync('orderDetail'),
  102. type: false,
  103. };
  104. },
  105. onLoad() {
  106. console.log(this.orderDetail);
  107. },
  108. methods: {
  109. // 取消兑换
  110. cancelChange() {
  111. this.type = false;
  112. this.masktxt = '是否取消兑换?';
  113. this.iconShow = false;
  114. this.isShowMask = true;
  115. },
  116. // 确认兑换
  117. sureconvert() {
  118. this.type = true;
  119. this.iconShow = true;
  120. this.masktxt = '是否兑换?';
  121. this.isShowMask = true;
  122. },
  123. // 监听遮罩层行为
  124. isSureConver(e) {
  125. // 兑换
  126. if (this.type) {
  127. if (e) {
  128. this.$http
  129. .get('/orders/verOrdersByNo/' + this.orderDetail.qrcode)
  130. .then((res) => {
  131. console.log(res);
  132. if (res.code === 200 ) {
  133. this.$mHelper.toast('核销成功!');
  134. }
  135. }).catch(err0r=>{
  136. this.$mHelper.toast(res.msg);
  137. });
  138. } else {
  139. this.$mHelper.toast('已取消核销该订单');
  140. }
  141. } else { // 取消兑换
  142. if (e) {
  143. this.$mHelper.toast('已取消兑换')
  144. } else {
  145. this.isShowMask = false
  146. return
  147. }
  148. }
  149. this.isShowMask = false;
  150. this.$mRouter.back();
  151. },
  152. },
  153. };
  154. </script>
  155. <style lang="scss" scoped>
  156. .conversion {
  157. .order-detail-content {
  158. padding: 24upx 32upx 44upx;
  159. .order-message {
  160. background-color: #ffffff;
  161. padding: 31upx 33upx 35upx;
  162. border-radius: 17upx;
  163. .title {
  164. font-size: 34upx;
  165. color: #111111;
  166. }
  167. .titlebar {
  168. font-size: 28upx;
  169. color: #666666;
  170. letter-spacing: 2upx;
  171. margin-top: 12upx;
  172. .txt {
  173. margin-left: 10upx;
  174. font-size: 28upx;
  175. }
  176. }
  177. .ordername {
  178. margin-top: 15upx;
  179. }
  180. .orderstatus {
  181. height: 98upx;
  182. line-height: 98upx;
  183. border-top: 1px solid #e1e1e1;
  184. border-bottom: 1px solid #e1e1e1;
  185. }
  186. .tourist {
  187. .tourist-warp {
  188. padding-bottom: 20upx;
  189. border-bottom: 1px solid #e1e1e1;
  190. &:last-child {
  191. border-bottom: none;
  192. }
  193. }
  194. .title {
  195. padding: 15upx 0;
  196. font-size: 34upx;
  197. color: #111111;
  198. }
  199. .touristbar {
  200. color: #666666;
  201. }
  202. .txt {
  203. margin-left: 10upx;
  204. font-size: 28upx;
  205. }
  206. }
  207. }
  208. .paymessage {
  209. background-color: #ffffff;
  210. padding: 31upx 33upx 35upx;
  211. border-radius: 17upx;
  212. margin-top: 24upx;
  213. .title {
  214. font-size: 34upx;
  215. color: #111111;
  216. }
  217. .shoppric {
  218. color: #666666;
  219. margin-top: 20upx;
  220. .money {
  221. margin-left: 10upx;
  222. }
  223. }
  224. .realitypirc {
  225. color: #666666;
  226. font-size: 28upx;
  227. margin-top: 20upx;
  228. border-top: 1upx solid #e1e1e1;
  229. padding-top: 20upx;
  230. .money {
  231. margin-left: 10upx;
  232. color: #fa4141;
  233. }
  234. }
  235. }
  236. .btns {
  237. display: flex;
  238. justify-content: center;
  239. align-items: center;
  240. margin-top: 40upx;
  241. .btn {
  242. width: 321upx;
  243. height: 92upx;
  244. box-sizing: border-box;
  245. text-align: center;
  246. line-height: 92upx;
  247. font-size: 38upx;
  248. letter-spacing: 2upx;
  249. color: #7a7c7c;
  250. margin-right: 31upx;
  251. background-color: #fff;
  252. border: 1px solid #e2e2e2;
  253. border-radius: 10upx;
  254. }
  255. .convert {
  256. margin-right: 0;
  257. background-color: #a95cff;
  258. color: #ffffff;
  259. border: none;
  260. }
  261. }
  262. }
  263. }
  264. </style>