claim_goods.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="container">
  3. <view class="header-info" v-if="organizationInfo">
  4. <view style="display: flex;align-items: center;">
  5. <image :src="organizationInfo.organizeIcon" mode="aspectFit" style="background-color: #fff;border-radius: 50%;width: 80upx;height: 80upx;"></image>
  6. <view style="flex:1;margin-left: 30upx;">
  7. <view style="font-size: 30upx;color: #fff;">{{organizationInfo.organizeName}}</view>
  8. <view style="font-size: 20upx;color: #fff;margin-top: 10upx;">营业时间:{{organizationInfo.jobTime}}</view>
  9. </view>
  10. <view @tap="makePhone" style="width: 152upx;height:56upx;border-radius: 25px;text-align: center;font-size: 24upx;color: #E42F2F;line-height: 56upx;background-color: #fff;">
  11. 联系团长
  12. </view>
  13. </view>
  14. <view style="height: 2upx;background-color: #fff;margin: 20upx 0;"></view>
  15. <view style="color: #fff;font-size: 24upx;">
  16. {{organizationInfo.receiver.areaName}}{{organizationInfo.receiver.address}}
  17. </view>
  18. </view>
  19. <view style="display: flex;height: 110upx;align-items: center;">
  20. <view @tap="requestData('SHIPPED')" :class="[{activity:param=='SHIPPED'},'nav']" >待取货</view>
  21. <view @tap="requestData('COMPLETED')" :class="[{activity:param=='COMPLETED'},'nav']" >已取货</view>
  22. </view>
  23. <view v-if="emptyType==0" style="background-color: #fff;padding-top: 30upx;border-radius: 20upx;overflow: hidden;margin-bottom: 100upx;">
  24. <view style="margin:0 40upx;font-size: 28upx;font-weight: bold;height: 30upx;">取货码</view>
  25. <view v-for="(item,index) in dataList" :key="index" style="display: flex;padding: 30upx 0;margin:0 40upx;border-bottom: 2upx solid #F6F6F6;align-items: center;">
  26. <image :src="item.products[0].thumbnail" mode="aspectFit" style="width: 146upx;height: 114upx;margin-right: 20upx;"></image>
  27. <view>
  28. <view style="font-size: 48upx;font-weight: bold;">
  29. {{claimCode(item.sn)}}
  30. </view>
  31. <view style="font-size: 24upx;color: #999999;margin-top: 10upx;">{{item.products[0].name}}</view>
  32. </view>
  33. </view>
  34. <view
  35. v-if="param==SHIPPED"
  36. @tap="onTapBtn"
  37. style="
  38. height: 88upx;
  39. background:linear-gradient(90deg,rgba(218,62,62,1) 0%,rgba(255,121,121,1) 100%);
  40. text-align: center;
  41. line-height: 88upx;
  42. font-size: 28upx;
  43. color: #fff;">
  44. 一键取件
  45. </view>
  46. </view>
  47. <DtEmpty :type="emptyType" />
  48. <DtNoMore v-if="isNoMore" />
  49. </view>
  50. </template>
  51. <script>
  52. import DtEmpty from '../comps/dt_empty.vue'
  53. import DtNoMore from '../comps/dt_no_more.vue'
  54. export default {
  55. components: {
  56. DtEmpty,
  57. DtNoMore
  58. },
  59. data() {
  60. return {
  61. memberId:null,
  62. dataList:[],
  63. param:'SHIPPED',
  64. organizationInfo:null
  65. };
  66. },
  67. methods:{
  68. makePhone(){
  69. this.makePhoneCall(this.organizationInfo.phone);
  70. },
  71. onLoadPage(options) {
  72. wx.hideShareMenu();
  73. this.memberId = this.$auth.getMemberId();
  74. this.getOrganizationInfo();
  75. this.requestData(this.param);
  76. },
  77. onTapBtn(){
  78. this.$dialog.confirm({
  79. content: '确认收货吗?',
  80. success: async (res) => {
  81. if (res.confirm) {
  82. this.receiveOrder()
  83. }
  84. }
  85. })
  86. },
  87. async receiveOrder() {
  88. let orderIds = [];
  89. this.dataList.map((item)=>{
  90. orderIds.push(item.sn)
  91. })
  92. let resp = await this.$api.userAgentConfirmOrder({
  93. orderIds: orderIds
  94. });
  95. if(resp){
  96. this.$dialog.success('确认完成',()=>{
  97. requestData(this.param);
  98. })
  99. }
  100. },
  101. claimCode(sn){
  102. return sn.substring(sn.length-6)
  103. },
  104. async getOrganizationInfo(){
  105. let resp = await this.$api.getOrganizationInfo({
  106. memberId: this.memberId
  107. });
  108. this.organizationInfo = resp;
  109. },
  110. async requestData(param){
  111. this.isNoMore = false
  112. this.pageIndex = 0
  113. this.dataList.length = 0
  114. this.param = param;
  115. if(param=='SHIPPED'){
  116. let resp = await this.$api.userAgentOrder({
  117. _isShowLoading: true,
  118. _isPull: this.isPull,
  119. memberId: this.memberId,
  120. pageNo: this.pageIndex,
  121. pageSize: this.pageSize
  122. });
  123. let list = this.getDataList(resp)
  124. this.dataList = this.dataList.concat(list)
  125. }else{
  126. let resp = await this.$api.userAgentAlreadyOrder({
  127. _isShowLoading: true,
  128. _isPull: this.isPull,
  129. memberId: this.memberId,
  130. pageNo: this.pageIndex,
  131. pageSize: this.pageSize
  132. });
  133. let list = this.getDataList(resp)
  134. this.dataList = this.dataList.concat(list)
  135. }
  136. },
  137. },
  138. onReachBottom() {
  139. this.onReachBottomPage()
  140. }
  141. }
  142. </script>
  143. <style lang="scss">
  144. .container{
  145. padding: 20upx;
  146. background-color: $dt-bg-color-grey;
  147. min-height: 100vh;
  148. .header-info{
  149. background:linear-gradient(129deg,rgba(218,62,62,1) 0%,rgba(255,121,121,1) 100%);
  150. box-shadow:0px 0px 10upx rgba(0,0,0,0.02);
  151. border-radius:20upx;
  152. padding: 40upx 30upx;
  153. }
  154. .nav{
  155. margin-right: 50upx;
  156. font-size: 28upx;
  157. font-weight: bold;
  158. height: 50upx;
  159. line-height: 50upx;
  160. border-bottom: 4upx solid transparent;
  161. }
  162. .activity{
  163. border-bottom: 4upx solid #E42F2F;
  164. }
  165. }
  166. </style>