1
0

clerk.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <app-layout>
  3. <view v-if="list.length == 0" class="search dir-top-nowrap cross-center">
  4. <view class="input">
  5. <input v-model="keyword" placeholder="请输入买家手机号" type="number">
  6. </view>
  7. <app-button :theme="getTheme" color="#fff" @click="getList" arrangement="row" type="important" round width="702">
  8. <text class="app-text">确认</text>
  9. </app-button>
  10. </view>
  11. <view v-else>
  12. <app-order v-for="(item,index) in list" :key="item.id" v-on:update="update" v-if="item.is_confirm == 0" :is_user="is_user" :theme="getTheme" :item="item"></app-order>
  13. </view>
  14. </app-layout>
  15. </template>
  16. <script>
  17. import {mapGetters, mapState} from 'vuex';
  18. import appOrder from '../components/app-order';
  19. export default {
  20. data() {
  21. return {
  22. middleman: {},
  23. setting: {},
  24. more_list: false,
  25. page: 1,
  26. list: [],
  27. keyword: '',
  28. apply_at: ''
  29. }
  30. },
  31. components: {
  32. "app-order": appOrder
  33. },
  34. computed: {
  35. ...mapGetters('mallConfig', {
  36. getTheme: 'getTheme',
  37. }),
  38. ...mapState({
  39. stock: state => state.mallConfig.__wxapp_img.stock,
  40. bonusImg: state => state.mallConfig.__wxapp_img.bonus,
  41. userInfo: state => state.user.info,
  42. })
  43. },
  44. onLoad: function (options) {
  45. this.getStatus();
  46. },
  47. methods: {
  48. update(e) {
  49. for(let index in this.list) {
  50. if(this.list[index].id == e.id) {
  51. this.list.splice(index,1);
  52. }
  53. }
  54. this.$forceUpdate();
  55. },
  56. getStatus() {
  57. let that = this;
  58. that.$request({
  59. url: that.$api.community.index,
  60. }).then(response=>{
  61. if(response.code == 0) {
  62. this.setting = response.data.setting;
  63. if(response.data.middleman.id > 0) {
  64. this.middleman = response.data.middleman;
  65. this.apply_at = this.middleman.apply_at.substring(0,10)
  66. }else {
  67. uni.showToast({
  68. title: '您还不是团长,现在前往申请页面',
  69. icon: 'none',
  70. duration: 1000
  71. });
  72. setTimeout(function(){
  73. uni.redirectTo({
  74. url: '/plugins/community/apply/apply'
  75. });
  76. },1000)
  77. }
  78. }else {
  79. uni.showToast({
  80. title: response.msg,
  81. icon: 'none',
  82. duration: 1000
  83. });
  84. }
  85. }).catch(response => {
  86. that.$hideLoading();
  87. });
  88. },
  89. getList() {
  90. let that = this;
  91. if(!that.keyword) {
  92. uni.showToast({
  93. title: '请输入买家手机号',
  94. icon: 'none',
  95. duration: 1000
  96. });
  97. return false
  98. }
  99. if(that.loading) {
  100. return false
  101. }
  102. that.loading = true;
  103. that.$request({
  104. url: that.$api.community.middle_list,
  105. data: {
  106. status: 3,
  107. keyword: that.keyword,
  108. page: that.page,
  109. }
  110. }).then(response=>{
  111. that.$hideLoading();
  112. uni.hideLoading();
  113. that.loading = false;
  114. if(response.code == 0) {
  115. if(response.data.list.length == 0) {
  116. uni.showToast({
  117. title: '未找到待提货订单',
  118. icon: 'none',
  119. duration: 1000
  120. });
  121. }
  122. let list = response.data.list;
  123. that.more_list = false;
  124. if (list.length == response.data.pagination.pageSize) {
  125. that.more_list = true;
  126. that.page++;
  127. }
  128. if(that.page == 1) {
  129. that.list = list;
  130. }else {
  131. that.list = that.list.concat(list);
  132. }
  133. that.$forceUpdate();
  134. }else {
  135. uni.showToast({
  136. title: response.msg,
  137. icon: 'none',
  138. duration: 1000
  139. });
  140. }
  141. }).catch(response => {
  142. that.loading = false;
  143. that.$hideLoading();
  144. uni.hideLoading();
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style scoped lang="scss">
  151. .search {
  152. .input {
  153. height: 100rpx;
  154. background-color: #fff;
  155. padding: 0 24rpx;
  156. margin-bottom: 40rpx;
  157. width: 100%;
  158. input {
  159. height: 100rpx;
  160. line-height: 100rpx;
  161. }
  162. }
  163. }
  164. </style>