orderVerification.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view class="ordersVerification">
  3. <view style="height: 24rpx;width: 100%;background:#F9F9F9 ;"></view>
  4. <!-- 表单 -->
  5. <view class="form">
  6. <uni-forms ref="baseForm" :modelValue="FormData">
  7. <uni-forms-item label="收货人" labelWidth="150rpx">
  8. <uni-easyinput v-model="FormData.name" placeholder="请输入收货人" />
  9. </uni-forms-item>
  10. <uni-forms-item label="联系方式" labelWidth="150rpx">
  11. <uni-easyinput v-model="FormData.contact" placeholder="请输入联系方式" />
  12. </uni-forms-item>
  13. <uni-forms-item label="兑换时间" labelWidth="150rpx">
  14. <uni-easyinput v-model="FormData.date" placeholder="请输入兑换时间" />
  15. </uni-forms-item>
  16. </uni-forms>
  17. </view>
  18. <!-- 商品信息 -->
  19. <view class="card" >
  20. <view class="toptitle">
  21. <view>洲际天堂大饭店</view>
  22. <view v-if="items.status == 3">未核销</view>
  23. <view v-if="items.status == 4">已核销</view>
  24. </view>
  25. <view class="shopCard">
  26. <image :src="items.img_urls"></image>
  27. <view style="margin-left: 24rpx;">
  28. <text class="name">{{items.product_name}}</text>
  29. <text class="tag" v-if="items.source_type == 3">礼盒装 2000积分</text>
  30. </view>
  31. </view>
  32. <view class="points" v-if="items.source_type == 3">
  33. <text class="totalName">共计:</text>
  34. <text class="totalContent">2000积分</text>
  35. </view>
  36. <view class="btn" >
  37. <text>核销</text>
  38. </view>
  39. </view>
  40. <!-- 核销订单按钮 -->
  41. <view class="bottombtn">
  42. <view class="btnitem" @click="verificationOrder">
  43. <text>核销订单</text>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default{
  50. data(){
  51. return{
  52. //订单号
  53. order_no:'',
  54. //订单详情
  55. items:'',
  56. //订单id
  57. order_id:'',
  58. // 表单数据
  59. FormData:{
  60. name:'',
  61. contact:'',
  62. date:'',
  63. },
  64. }
  65. },
  66. onLoad(o) {
  67. if(o.order_id){
  68. this.order_id = o.order_id
  69. this.orderDetail()
  70. }
  71. },
  72. methods:{
  73. //订单详情
  74. orderDetail(){
  75. this.$api.orders.getOrderDetail({
  76. order_id:this.order_id
  77. }).then(res=>{
  78. this.items = res.data
  79. this.FormData.name = res.data.receiver
  80. this.FormData.contact = res.data.phone
  81. this.FormData.date = res.data.created_at
  82. this.order_no = res.data.order_no
  83. })
  84. },
  85. // 核销订单
  86. verificationOrder(){
  87. let _this = this
  88. uni.showModal({
  89. title: '提示',
  90. content: '是否核销订单',
  91. cancelColor:'#333333',
  92. confirmColor:'#FF6200',
  93. success: function (res) {
  94. if (res.confirm) {
  95. _this.$api.orders.confirmOrder({
  96. order_no:_this.order_no
  97. }).then(res=>{
  98. if(res.code == 0){
  99. uni.showToast({
  100. icon:'none',
  101. title:'核销成功'
  102. })
  103. _this.orderDetail()
  104. }else{
  105. uni.showToast({
  106. icon:'none',
  107. title:res.msg
  108. })
  109. }
  110. })
  111. } else if (res.cancel) {
  112. console.log('用户点击取消');
  113. }
  114. }
  115. });
  116. },
  117. // // 选择兑换时间
  118. // bindDateChange: function(e) {
  119. // this.FormData.date=e.detail.value
  120. // },
  121. // 获取时间
  122. // getDate(type) {
  123. // const date = new Date();
  124. // let year = date.getFullYear();
  125. // let month = date.getMonth() + 1;
  126. // let day = date.getDate();
  127. // if (type === 'start') {
  128. // year = year - 60;
  129. // } else if (type === 'end') {
  130. // year = year + 2;
  131. // }
  132. // month = month > 9 ? month : '0' + month;
  133. // day = day > 9 ? day : '0' + day;
  134. // return `${year}-${month}-${day}`;
  135. // }
  136. },
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. $pageColor:#F9F9F9;
  141. $bgColor:#FFFFFF;
  142. // flex布局居中对齐
  143. @mixin flexlayout {
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. .ordersVerification {
  149. height: 100%;
  150. background: $pageColor;
  151. }
  152. ::v-deep .uni-forms-item.is-direction-left{
  153. border-bottom: 2rpx solid #F0F0F0;
  154. }
  155. ::v-deep .uni-forms-item.is-direction-left:last-child{
  156. border-bottom: 0rpx solid #F0F0F0;
  157. }
  158. ::v-deep .is-input-border {
  159. border: none;
  160. }
  161. .form {
  162. width: 750rpx;
  163. height: 328rpx;
  164. background: $bgColor;
  165. border-radius: 16rpx;
  166. padding:10rpx 30rpx;
  167. box-sizing: border-box;
  168. }
  169. .card{
  170. margin-top: 24rpx;
  171. // width: 750rpx;
  172. // height: 426rpx;
  173. background: $bgColor;
  174. border-radius: 16rpx;
  175. padding:32rpx 28rpx 24rpx 28rpx;
  176. box-sizing: border-box;
  177. .toptitle{
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. font-size: 28rpx;
  182. font-family: PingFang-SC-Bold, PingFang-SC;
  183. font-weight: bold;
  184. color: #080F18;
  185. }
  186. .shopCard{
  187. margin-top: 28rpx;
  188. width: 694rpx;
  189. height: 164rpx;
  190. background: #F4F5F6;
  191. border-radius: 10rpx;
  192. display: flex;
  193. align-items: center;
  194. image{
  195. width: 132rpx;
  196. height: 132rpx;
  197. margin-left: 16rpx;
  198. display: inline-block;
  199. }
  200. .name{
  201. font-size: 28rpx;
  202. font-family: PingFangSC-Medium, PingFang SC;
  203. font-weight: 500;
  204. color: #080F18;
  205. display: block;
  206. }
  207. .tag{
  208. font-size: 24rpx;
  209. font-family: PingFang-SC-Medium, PingFang-SC;
  210. font-weight: 500;
  211. color: #666666;
  212. }
  213. }
  214. .points{
  215. display: flex;
  216. justify-content: flex-end;
  217. align-items: center;
  218. margin-top: 30rpx;
  219. .totalName{
  220. font-size: 22rpx;
  221. font-family: PingFang-SC-Medium, PingFang-SC;
  222. font-weight: 500;
  223. color: #080F18;
  224. margin-right: 10rpx;
  225. }
  226. .totalContent{
  227. font-size: 30rpx;
  228. font-family: PingFang-SC-Heavy, PingFang-SC;
  229. font-weight: 800;
  230. color: #080F18;
  231. }
  232. }
  233. .btn{
  234. width: 170rpx;
  235. height: 60rpx;
  236. background: #FFFFFF;
  237. border-radius: 30rpx;
  238. border: 2rpx solid #D0D0D0;
  239. margin-left: 524rpx;
  240. margin-top: 15rpx;
  241. @include flexlayout()
  242. text{
  243. font-size: 26rpx;
  244. font-family: PingFang-SC-Medium, PingFang-SC;
  245. font-weight: 500;
  246. color: #080F18;
  247. }
  248. }
  249. }
  250. .bottombtn{
  251. width: 690rpx;
  252. height: 92rpx;
  253. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  254. border-radius: 12rpx;
  255. margin-left: 30rpx;
  256. position: fixed;
  257. bottom: 72rpx;
  258. @include flexlayout()
  259. .btnitem{
  260. @include flexlayout()
  261. text{
  262. font-size: 30rpx;
  263. font-family: PingFang-SC-Bold, PingFang-SC;
  264. font-weight: bold;
  265. color: $bgColor;
  266. }
  267. }
  268. }
  269. .date{
  270. width: 545rpx;
  271. height: 74rpx;
  272. background: #FFFFFF;
  273. display: flex;
  274. align-items:center;
  275. padding-left: 20rpx;
  276. box-sizing: border-box;
  277. position: relative;
  278. }
  279. </style>