verification.vue 8.0 KB

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