|
|
@@ -0,0 +1,331 @@
|
|
|
+<template>
|
|
|
+ <view class="container">
|
|
|
+ <!-- 顶部导航 -->
|
|
|
+ <view class="Tab_con flex_r flex_ac flex_jb">
|
|
|
+ <view class="tab_list flex_r flex_ac" :class="current == item.status ? 'active' : ''" v-for="(item,index) in TabList" :key="index" @tap="SetCurrent(item.status)">{{item.title}}</view>
|
|
|
+ </view>
|
|
|
+ <!-- 顶部导航-end -->
|
|
|
+
|
|
|
+ <!-- 寄售列表 -->
|
|
|
+ <view class="con">
|
|
|
+ <view class="goods flex_c" v-for="(item,index) in goods" :key="index" @tap="navToSpeedUp(item,index)">
|
|
|
+ <view class="flex_r">
|
|
|
+ <image class="goods_img" :src="item.ojsImg" mode=""></image>
|
|
|
+ <view class="goods_info flex_c flex_jc">
|
|
|
+ <view class="goods_name ellipsis">{{item.ojsName}}</view>
|
|
|
+ <view class="period">寄售数量:{{item.ojsCount}}套</view>
|
|
|
+ </view>
|
|
|
+ <view class="goods_status flex_grow flex_r flex_je" :class="item.ojsType == 1 ? 'g_color' : item.ojsType == 2 ? 'y_color' : 'r_color'">
|
|
|
+ {{item.ojsType == 1 ? '寄售中' : item.ojsType == 2 ? '寄售成功' : '寄售失败'}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="goods_time">{{item.ojsTime}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 寄售列表-end -->
|
|
|
+ <not-goods v-if="haveGoods" textStr="暂无寄售信息"></not-goods>
|
|
|
+
|
|
|
+ <!-- 兑换弹窗 -->
|
|
|
+ <uni-popup type="center" ref="conversion">
|
|
|
+ <view class="const_con">
|
|
|
+ <image class="closePopup" src="/static/f_close.png" mode="" @tap="closePopup"></image>
|
|
|
+ <view class="const_head flex_r flex_ac flex_jc y_color">寄售失败</view>
|
|
|
+ <view class="const_info flex_r flex_ac flex_jc">
|
|
|
+ <view class="frist_list flex_c">
|
|
|
+ <view class="flex_r flex_ac" @tap="setPayWay(0)">
|
|
|
+ <image class="frist_img" :src="pay_way == 0 ? '/static/xuanzhong_icon.png' : '/static/weixuanzhong_icon.png'" mode=""></image>
|
|
|
+ <view class="frist_text">再次寄售</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="frist_list flex_c">
|
|
|
+ <view class="flex_r flex_ac" @tap="setPayWay(1)">
|
|
|
+ <image class="frist_img" :src="pay_way == 1 ? '/static/xuanzhong_icon.png' : '/static/weixuanzhong_icon.png'" mode=""></image>
|
|
|
+ <view class="frist_text">发货邮寄</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 收货地址 -->
|
|
|
+ <view class="address" v-if="pay_way == 1">
|
|
|
+ <block v-if="DefaultAddress != ''">
|
|
|
+ <view class="add_head flex_r flex_ac flex_jb">
|
|
|
+ <view class="user_info flex_r flex_ac">
|
|
|
+ <view class="user_name">{{DefaultAddress.name}}</view>
|
|
|
+ <view class="user_phone">{{DefaultAddress.mobile}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="set_address flex_r flex_ac" @tap="chooseWXaddress">
|
|
|
+ <image class="set_img" src="/static/setAddress.png" mode=""></image>
|
|
|
+ <view class="set_text">修改</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="add_name mar_t20">{{DefaultAddress.province}}{{DefaultAddress.city}}{{DefaultAddress.county}}{{DefaultAddress.address}}</view>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <view class="add_address flex_c flex_ac flex_jc" @tap="chooseWXaddress">
|
|
|
+ <image class="add_icon" src="/static/add.png" mode=""></image>
|
|
|
+ <view class="add_text">添加收货地址</view>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ <!-- 收货地址-end -->
|
|
|
+ <view class="conversion flex_r flex_ac flex_jc" @tap="SetConsign(pay_way)">确认</view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+ <!-- 兑换弹窗-end -->
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+let page = 1;
|
|
|
+let app=getApp();
|
|
|
+var appEv = app.$vm.$options;
|
|
|
+// let reqApi = new ReqApi();
|
|
|
+// import { ReqApi } from "@/utils/reqTools.js";
|
|
|
+import { get, post, u_post } from "@/request/api.js";
|
|
|
+import notGoods from '@/components/not-goods/index.vue'
|
|
|
+import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
+ export default {
|
|
|
+ components:{
|
|
|
+ notGoods,
|
|
|
+ uniPopup
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ current:2,
|
|
|
+ TabList:[
|
|
|
+ {title:'寄售中',status:2},
|
|
|
+ {title:'寄售成功',status:3},
|
|
|
+ {title:'寄售失败',status:4},
|
|
|
+ {title:'全部',status:1}
|
|
|
+ ],
|
|
|
+ goods:[],
|
|
|
+ haveGoods: false, // 是否有商品
|
|
|
+ selectIndex:'',
|
|
|
+ isShow:false ,// 是否显示地址
|
|
|
+ DefaultAddress:'' ,// 地址
|
|
|
+ pay_way:0 // 操作-0:再次寄售;1:收货
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad:function(){
|
|
|
+ this.loadAddress()
|
|
|
+ },
|
|
|
+ onShow:function(options){
|
|
|
+ page = 1;
|
|
|
+ this.goods = []
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ tabsChange:function(index){
|
|
|
+ this.current = index
|
|
|
+ },
|
|
|
+ loadData:function(){
|
|
|
+ let that = this;
|
|
|
+ let data = {
|
|
|
+ status:this.current,
|
|
|
+ page:page
|
|
|
+ }
|
|
|
+ u_post("ShuZiTeaYW/ojs/goodsLists",data).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ let obj = res.ojsList
|
|
|
+ if(obj.length>0){
|
|
|
+ for(var i in obj){
|
|
|
+ that.goods.push(obj[i])
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(page == 1){
|
|
|
+ that.haveGoods = true
|
|
|
+ page = -1
|
|
|
+ }else{
|
|
|
+ page = -1
|
|
|
+ appEv.errTips('暂无更多')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(page == 1){
|
|
|
+ that.haveGoods = true
|
|
|
+ page = -1
|
|
|
+ }else{
|
|
|
+ page = -1
|
|
|
+ appEv.errTips('暂无更多')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ SetCurrent:function(i){
|
|
|
+ this.current = i;
|
|
|
+ this.haveGoods = false;
|
|
|
+ page = 1;
|
|
|
+ this.goods = []
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ // 修改操作方式
|
|
|
+ setPayWay:function(i){
|
|
|
+ this.pay_way = i;
|
|
|
+ },
|
|
|
+ // 跳转加速
|
|
|
+ navToSpeedUp:function(item,index){
|
|
|
+ if(item.ojsType != 3){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages/speed-up/index?id=' + item.ojsId
|
|
|
+ })
|
|
|
+ }else if(item.ojsType == 3){
|
|
|
+ this.selectIndex = index
|
|
|
+ this.$refs.conversion.open()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭立即兑换弹窗
|
|
|
+ closePopup:function(){
|
|
|
+ this.$refs.conversion.close()
|
|
|
+ },
|
|
|
+ // 点击操作失败事件
|
|
|
+ SetConsign:function(i){
|
|
|
+ let that = this;
|
|
|
+ let data = {
|
|
|
+ ojsId:this.goods[this.selectIndex].ojsId,
|
|
|
+ type:i + 1
|
|
|
+ }
|
|
|
+ if(i == 1){
|
|
|
+ if(this.DefaultAddress.id&&this.DefaultAddress.id!=''){
|
|
|
+ data = {
|
|
|
+ ...data,
|
|
|
+ addressId:this.DefaultAddress.id
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ data = {
|
|
|
+ ...data,
|
|
|
+ province:this.DefaultAddress.province,
|
|
|
+ city:this.DefaultAddress.city,
|
|
|
+ county:this.DefaultAddress.county,
|
|
|
+ address:this.DefaultAddress.address,
|
|
|
+ name:this.DefaultAddress.name,
|
|
|
+ mobile:this.DefaultAddress.mobile
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ u_post("ojs/updateOjsType",data).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ appEv.errTips(res.msg)
|
|
|
+ that.$refs.conversion.close()
|
|
|
+ page = 1;
|
|
|
+ that.haveGoods = false;
|
|
|
+ that.goods = []
|
|
|
+ that.loadData()
|
|
|
+ }else{
|
|
|
+ appEv.errTips(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取用户地址
|
|
|
+ loadAddress:function(){
|
|
|
+ let that = this;
|
|
|
+ u_post("ShuZiTeaYW/shop/userDefaultAddress").then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ that.DefaultAddress = res.date
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ chooseWXaddress:function() {
|
|
|
+ var that = this;
|
|
|
+ uni.chooseAddress({
|
|
|
+ success: function (res) {
|
|
|
+ let default_address = {
|
|
|
+ city: res.cityName,
|
|
|
+ county: res.countyName,
|
|
|
+ address: res.detailInfo,
|
|
|
+ zipCode: res.postalCode,
|
|
|
+ province: res.provinceName,
|
|
|
+ mobile: res.telNumber,
|
|
|
+ name: res.userName
|
|
|
+ };
|
|
|
+ that.DefaultAddress = default_address;
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ console.log(res);
|
|
|
+ if (res.errMsg == "chooseAddress:fail auth deny" || res.errMsg == "chooseAddress:fail:auth denied") {
|
|
|
+ that.flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onShareAppMessage: function () {
|
|
|
+ var path = '/pages/consign-list/index?agentId=1';
|
|
|
+ if (app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId) {
|
|
|
+ path = '/pages/consign-list/index?agentId='+ app.globalData.systemUserInfo.userId;
|
|
|
+ }
|
|
|
+
|
|
|
+ var title = `茶,让生活更美好!`;
|
|
|
+ return {
|
|
|
+ title: title,
|
|
|
+ path: path
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 页面上拉触底事件的处理函数
|
|
|
+ */
|
|
|
+ onReachBottom: function () {
|
|
|
+ if (page != -1) {
|
|
|
+ var that = this;
|
|
|
+ setTimeout(function () {
|
|
|
+ ++page;
|
|
|
+ that.loadData();
|
|
|
+ }, 800);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+// 页面配置
|
|
|
+page{background: #F4F4F4;}
|
|
|
+// 页面配置-end
|
|
|
+
|
|
|
+// 顶部列表
|
|
|
+.tab_list{height: 100%;box-sizing: border-box;font-size: 30rpx;color:#808080;}
|
|
|
+.Tab_con{width: 100%;height: 92rpx;background: #fff;padding:0 30rpx;box-sizing: border-box;}
|
|
|
+
|
|
|
+.active{color: #1BBD89;border-bottom: 6rpx solid #1BBD89;}
|
|
|
+// 顶部列表-end
|
|
|
+
|
|
|
+// 寄售列表
|
|
|
+.goods_info{width: 270rpx;overflow: hidden;}
|
|
|
+.period{font-size: 26rpx;color:#5D5C5C;margin-top: 24rpx;}
|
|
|
+.goods_status{font-size: 30rpx;font-family: "SourceHanSansCN-Medium";}
|
|
|
+.goods_time{font-size: 22rpx;color: #808080;line-height: 1;margin-top: 20rpx;}
|
|
|
+.con{width: 100%;overflow: hidden;padding:30rpx 30rpx 0;box-sizing: border-box;}
|
|
|
+.goods_img{width: 218rpx;height: 152rpx;margin-right: 36rpx;border-radius: 8rpx;}
|
|
|
+.goods_name{width: 100%;overflow: hidden;font-size: 32rpx;color: #373636;font-family: "SourceHanSansCN-Medium";}
|
|
|
+.goods{width: 100%;overflow: hidden;padding:24rpx 20rpx;box-sizing: border-box;background: #fff;border-radius: 12rpx;margin-bottom: 30rpx;}
|
|
|
+// 寄售列表-end
|
|
|
+
|
|
|
+// 状态颜色
|
|
|
+.g_color{color: #1BBD89 !important;}
|
|
|
+.y_color{color: #FD9F33 !important;}
|
|
|
+.r_color{color: #EC421A !important;}
|
|
|
+// 状态颜色-end
|
|
|
+
|
|
|
+
|
|
|
+// 兑换弹窗
|
|
|
+.frist_list{width: 50%;overflow: hidden;}
|
|
|
+.frist_text{font-size: 28rpx;color:#302F2F;}
|
|
|
+.frist_img{width: 35rpx;height: 35rpx;margin-right: 32rpx;}
|
|
|
+.frist_info{width: 100%;overflow: hidden;align-items: initial;}
|
|
|
+.closePopup{width: 42rpx;height: 42rpx;position: absolute;right: 0;top: -65rpx;}
|
|
|
+.const_info{width: 100%;overflow: hidden;padding:30rpx 50rpx;box-sizing: border-box;}
|
|
|
+.const_con{width: 689rpx;border-radius: 10rpx;background: #fff;position: relative;padding-bottom: 20rpx;}
|
|
|
+.const_head{width: 100%;height: 97rpx;border-bottom:3rpx solid rgba(0,0,0,.15);font-size: 40rpx;color:#1BBD89;font-family: "SourceHanSansCN-Medium";}
|
|
|
+.conversion{width: 269rpx;height: 68rpx;background: #1BBE8A;font-family: "SourceHanSansCN-Medium";color:#fff;font-size: 32rpx;border-radius: 34rpx;margin: 40rpx auto 0;}
|
|
|
+// 兑换弹窗-end
|
|
|
+
|
|
|
+// 收货地址
|
|
|
+.user_phone{font-size: 26rpx;color:#222;}
|
|
|
+.set_text{font-size: 24rpx;color:#868686;}
|
|
|
+.set_img{width: 24rpx;height: 24rpx;margin-right: 9rpx;}
|
|
|
+.add_address{width: 100%;overflow: hidden;height: 109rpx;}
|
|
|
+.add_icon{width: 60rpx;height: 60rpx;margin-bottom: 12rpx;}
|
|
|
+.user_name{font-size:32rpx;color:#000;margin-right: 46rpx;}
|
|
|
+.add_name{width: 448rpx;overflow: hidden;font-size: 24rpx;color:#868686;}
|
|
|
+.add_text{font-size: 24rpx;color:#868686;font-family: "SourceHanSansCN-Normal";}
|
|
|
+.address{width: 100%;overflow: hidden;padding:28rpx;box-sizing: border-box;background: #fff;border-radius: 12rpx;background: #f4f4f4;}
|
|
|
+// 收货地址-end
|
|
|
+</style>
|