| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <template>
- <view class="container">
- <view class="header-info" v-if="organizationInfo">
- <view style="display: flex;align-items: center;">
- <image :src="organizationInfo.organizeIcon" mode="aspectFit" style="background-color: #fff;border-radius: 50%;width: 80upx;height: 80upx;"></image>
- <view style="flex:1;margin-left: 30upx;">
- <view style="font-size: 30upx;color: #fff;">{{organizationInfo.organizeName}}</view>
- <view style="font-size: 20upx;color: #fff;margin-top: 10upx;">营业时间:{{organizationInfo.jobTime}}</view>
- </view>
- <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;">
- 联系团长
- </view>
-
- </view>
- <view style="height: 2upx;background-color: #fff;margin: 20upx 0;"></view>
- <view style="color: #fff;font-size: 24upx;">
- {{organizationInfo.receiver.areaName}}{{organizationInfo.receiver.address}}
- </view>
- </view>
- <view style="display: flex;height: 110upx;align-items: center;">
- <view @tap="requestData('SHIPPED')" :class="[{activity:param=='SHIPPED'},'nav']" >待取货</view>
- <view @tap="requestData('COMPLETED')" :class="[{activity:param=='COMPLETED'},'nav']" >已取货</view>
- </view>
- <view v-if="emptyType==0" style="background-color: #fff;padding-top: 30upx;border-radius: 20upx;overflow: hidden;margin-bottom: 100upx;">
- <view style="margin:0 40upx;font-size: 28upx;font-weight: bold;height: 30upx;">取货码</view>
- <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;">
- <image :src="item.products[0].thumbnail" mode="aspectFit" style="width: 146upx;height: 114upx;margin-right: 20upx;"></image>
- <view>
- <view style="font-size: 48upx;font-weight: bold;">
- {{claimCode(item.sn)}}
- </view>
- <view style="font-size: 24upx;color: #999999;margin-top: 10upx;">{{item.products[0].name}}</view>
- </view>
- </view>
-
- <view
- v-if="param==SHIPPED"
- @tap="onTapBtn"
- style="
- height: 88upx;
- background:linear-gradient(90deg,rgba(218,62,62,1) 0%,rgba(255,121,121,1) 100%);
- text-align: center;
- line-height: 88upx;
- font-size: 28upx;
- color: #fff;">
- 一键取件
- </view>
- </view>
- <DtEmpty :type="emptyType" />
- <DtNoMore v-if="isNoMore" />
- </view>
- </template>
- <script>
- import DtEmpty from '../comps/dt_empty.vue'
- import DtNoMore from '../comps/dt_no_more.vue'
- export default {
- components: {
- DtEmpty,
- DtNoMore
- },
- data() {
- return {
- memberId:null,
- dataList:[],
- param:'SHIPPED',
- organizationInfo:null
- };
- },
-
- methods:{
- makePhone(){
- this.makePhoneCall(this.organizationInfo.phone);
- },
- onLoadPage(options) {
- wx.hideShareMenu();
- this.memberId = this.$auth.getMemberId();
- this.getOrganizationInfo();
- this.requestData(this.param);
- },
- onTapBtn(){
- this.$dialog.confirm({
- content: '确认收货吗?',
- success: async (res) => {
- if (res.confirm) {
- this.receiveOrder()
- }
- }
- })
- },
- async receiveOrder() {
- let orderIds = [];
- this.dataList.map((item)=>{
- orderIds.push(item.sn)
- })
- let resp = await this.$api.userAgentConfirmOrder({
- orderIds: orderIds
- });
- if(resp){
- this.$dialog.success('确认完成',()=>{
- requestData(this.param);
- })
- }
-
- },
- claimCode(sn){
- return sn.substring(sn.length-6)
- },
- async getOrganizationInfo(){
- let resp = await this.$api.getOrganizationInfo({
- memberId: this.memberId
- });
- this.organizationInfo = resp;
- },
- async requestData(param){
- this.isNoMore = false
- this.pageIndex = 0
- this.dataList.length = 0
- this.param = param;
- if(param=='SHIPPED'){
- let resp = await this.$api.userAgentOrder({
- _isShowLoading: true,
- _isPull: this.isPull,
- memberId: this.memberId,
- pageNo: this.pageIndex,
- pageSize: this.pageSize
- });
- let list = this.getDataList(resp)
- this.dataList = this.dataList.concat(list)
- }else{
- let resp = await this.$api.userAgentAlreadyOrder({
- _isShowLoading: true,
- _isPull: this.isPull,
- memberId: this.memberId,
- pageNo: this.pageIndex,
- pageSize: this.pageSize
- });
- let list = this.getDataList(resp)
- this.dataList = this.dataList.concat(list)
- }
-
- },
-
- },
- onReachBottom() {
- this.onReachBottomPage()
- }
- }
- </script>
- <style lang="scss">
- .container{
- padding: 20upx;
- background-color: $dt-bg-color-grey;
- min-height: 100vh;
- .header-info{
- background:linear-gradient(129deg,rgba(218,62,62,1) 0%,rgba(255,121,121,1) 100%);
- box-shadow:0px 0px 10upx rgba(0,0,0,0.02);
- border-radius:20upx;
- padding: 40upx 30upx;
-
- }
- .nav{
- margin-right: 50upx;
- font-size: 28upx;
- font-weight: bold;
- height: 50upx;
- line-height: 50upx;
- border-bottom: 4upx solid transparent;
- }
- .activity{
- border-bottom: 4upx solid #E42F2F;
- }
- }
-
- </style>
|