verification.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view class="verification">
  3. <view class="nav">
  4. <!-- 搜索栏 -->
  5. <view class="navbox">
  6. <view class="search">
  7. <u-input placeholder="搜索" border='none' v-model="search" @input="searchText">
  8. <template slot="suffix" style='margin-right:40rpx;'>
  9. <u-image :showLoading="true" :showError='true' src="/static/icon/search.png" width="40rpx"
  10. height="32rpx"></u-image>
  11. </template>
  12. </u-input>
  13. </view>
  14. <view>
  15. <image src="/static/icon/scan.png" style="width: 48rpx ;height: 48rpx;" @click="scanCode"></image>
  16. </view>
  17. </view>
  18. <!-- 分段器 -->
  19. <view class="segmented">
  20. <view class="tab_nav">
  21. <view class="navTitle" v-for="(item,index) in items" :key="index">
  22. <view :class="{'active':isActive == index}" @click="checked(index)">
  23. {{item}}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view>
  30. <view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.order_no)" >
  31. <view class="toptitle">
  32. <view>{{item.hotel.name}}</view>
  33. <view v-if="item.status == 3">未核销</view>
  34. <view v-if="item.status == 4">已核销</view>
  35. </view>
  36. <view class="shopCard">
  37. <image :src="item.img_urls"></image>
  38. <view style="margin-left: 24rpx;">
  39. <text class="name">{{item.product_name}}</text>
  40. <text class="tag" v-if="item.source_type == 3" >礼盒装 2000积分</text>
  41. </view>
  42. </view>
  43. <view class="points" v-if="item.source_type == 3" >
  44. <text class="totalName">共计:</text>
  45. <text class="totalContent">2000积分</text>
  46. </view>
  47. <view class="btn" @click.stop="goOrderVF(item.id)" v-if="item.status == 3">
  48. <text>核销</text>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 已经到底啦 -->
  53. <view class="home-bottom">
  54. <uni-load-more :status="status" color="#CCCCCC" :content-text="contentText"/>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import util from './../../../utils/util.js'
  60. export default{
  61. data(){
  62. return{
  63. hotelName:'',
  64. // 搜索
  65. search:'',
  66. // 分段器标题
  67. items: ['未核销', '已核销', '我的'],
  68. isActive: 0,
  69. // 组件uni-load-more
  70. status: 'noMore',
  71. contentText: {
  72. contentdown: '查看更多',
  73. contentrefresh: '加载中',
  74. contentnomore: '—— 已经到底啦 ——'
  75. },
  76. // 订单列表
  77. orderList:[],
  78. }
  79. },
  80. onLoad() {
  81. this.getMyOrder(1)
  82. },
  83. methods:{
  84. // 跳转订单详情
  85. goOrderDetail(order_no) {
  86. uni.navigateTo({
  87. url: '/pages/my/myorders/orderDetail?order_no=' + order_no
  88. })
  89. },
  90. // 获取订单列表
  91. getMyOrder(type){
  92. this.$api.orders.getOrderList({
  93. page:1,
  94. confirm_status:type||'',
  95. keyword:this.search
  96. }).then(res=>{
  97. console.log(res,type,"订单列表")
  98. if(res.code==0){
  99. this.orderList=res.data.data
  100. }
  101. })
  102. },
  103. //菜单index切换
  104. checked(index) {
  105. console.log(index)
  106. this.isActive = index
  107. this.getMyOrder(index+1)
  108. },
  109. // 搜索防抖
  110. searchText:util.debounce(function(){
  111. this.goSearch()
  112. },1000),
  113. // 搜索
  114. goSearch(){
  115. this.$api.orders.getOrderList({
  116. confirm_status:this.isActive+1,
  117. page:1,
  118. keyword:this.search
  119. }).then(res=>{
  120. console.log(res,"搜索活动项目列表")
  121. if(res.code==0){
  122. this.orderList=res.data.data
  123. }
  124. })
  125. },
  126. // 跳转核销订单
  127. goOrderVF(id){
  128. uni.navigateTo({
  129. url:'/pages/my/verification/orderVerification?order_no='+id
  130. })
  131. },
  132. // 扫码
  133. scanCode(){
  134. uni.scanCode({
  135. success: function (res) {
  136. console.log(res);
  137. console.log('条码类型:' + res.scanType);
  138. console.log('条码内容:' + res.result);
  139. }
  140. });
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. $pageColor:#F9F9F9;
  147. $bgColor:#FFFFFF;
  148. // flex布局居中对齐
  149. @mixin flexlayout {
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. }
  154. .verification {
  155. height: 100%;
  156. background: $pageColor;
  157. }
  158. // ::v-deep .segmented-control__item{
  159. // justify-content: center !important;
  160. // margin: 0 30rpx;
  161. // }
  162. .nav {
  163. height: 216rpx;
  164. width: 750rpx;
  165. background: $bgColor;
  166. box-shadow: 0px 4rpx 8rpx 0px rgba(0,0,0,0.04);
  167. border-radius: 0px 0px 16rpx 16rpx;
  168. .navbox {
  169. display: flex;
  170. align-items: center;
  171. justify-content: space-between;
  172. padding: 0 30rpx;
  173. box-sizing: border-box;
  174. margin-bottom: 15rpx;
  175. // 搜索
  176. .search {
  177. height: 124rpx;
  178. width: 614rpx;
  179. background-color: $bgColor;
  180. @include flexlayout;
  181. ::v-deep .u-input {
  182. width: 690rpx !important;
  183. height: 68rpx !important;
  184. background: #F1F1F1;
  185. border-radius: 74rpx;
  186. }
  187. ::v-deep .u-input__content__field-wrapper {
  188. padding-left: 36rpx;
  189. }
  190. ::v-deep .u-input__content__field-wrapper__field{
  191. color:#999999 !important;
  192. font-size: 28rpx !important;
  193. }
  194. }
  195. }
  196. .segmented {
  197. width: 750rpx;
  198. box-sizing: border-box;
  199. //菜单切换
  200. .tab_nav {
  201. width: 750rpx;
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: center;
  205. padding:0 30rpx;
  206. font-family: PingFang-SC-Heavy, PingFang-SC;
  207. }
  208. .tab_nav .navTitle {
  209. @include flexlayout()
  210. width: 128rpx;
  211. flex: none;
  212. height: 28rpx;
  213. font-size: 32rpx;
  214. color: #666;
  215. position: relative;
  216. }
  217. .active {
  218. color: #D9A94D;
  219. font-weight: bold;
  220. box-sizing: border-box;
  221. &::after {
  222. display: inline-block;
  223. content: '';
  224. width: 48rpx;
  225. height: 12rpx;
  226. background: linear-gradient(90deg, #F3D69F 0%, #D9A94D 100%);
  227. border-radius: 6px;
  228. position: absolute;
  229. bottom: -28rpx;
  230. left: 42rpx;
  231. }
  232. }
  233. }
  234. }
  235. .card{
  236. margin-top: 24rpx;
  237. // width: 750rpx;
  238. // height: 426rpx;
  239. background: $bgColor;
  240. border-radius: 16rpx;
  241. padding:32rpx 28rpx 24rpx 28rpx;
  242. box-sizing: border-box;
  243. .toptitle{
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. font-size: 28rpx;
  248. font-family: PingFang-SC-Bold, PingFang-SC;
  249. font-weight: bold;
  250. color: #080F18;
  251. }
  252. .shopCard{
  253. margin-top: 28rpx;
  254. width: 694rpx;
  255. height: 164rpx;
  256. background: #F4F5F6;
  257. border-radius: 10rpx;
  258. display: flex;
  259. align-items: center;
  260. image{
  261. width: 132rpx;
  262. height: 132rpx;
  263. margin-left: 16rpx;
  264. display: inline-block;
  265. border-radius: 12rpx;
  266. }
  267. .name{
  268. font-size: 28rpx;
  269. font-family: PingFangSC-Medium, PingFang SC;
  270. font-weight: 500;
  271. color: #080F18;
  272. display: block;
  273. }
  274. .tag{
  275. font-size: 24rpx;
  276. font-family: PingFang-SC-Medium, PingFang-SC;
  277. font-weight: 500;
  278. color: #666666;
  279. }
  280. }
  281. .points{
  282. display: flex;
  283. justify-content: flex-end;
  284. align-items: center;
  285. margin-top: 30rpx;
  286. .totalName{
  287. font-size: 22rpx;
  288. font-family: PingFang-SC-Medium, PingFang-SC;
  289. font-weight: 500;
  290. color: #080F18;
  291. margin-right: 10rpx;
  292. }
  293. .totalContent{
  294. font-size: 30rpx;
  295. font-family: PingFang-SC-Heavy, PingFang-SC;
  296. font-weight: 800;
  297. color: #080F18;
  298. }
  299. }
  300. .btn{
  301. width: 170rpx;
  302. height: 60rpx;
  303. background: #FFFFFF;
  304. border-radius: 30rpx;
  305. border: 2rpx solid #D0D0D0;
  306. margin-left: 524rpx;
  307. margin-top: 15rpx;
  308. @include flexlayout()
  309. text{
  310. font-size: 26rpx;
  311. font-family: PingFang-SC-Medium, PingFang-SC;
  312. font-weight: 500;
  313. color: #080F18;
  314. }
  315. }
  316. }
  317. .home-bottom {
  318. padding-top: 80rpx;
  319. background-color: #f9f9f9;
  320. }
  321. </style>