verification.vue 7.5 KB

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