更新代码

This commit is contained in:
zhangmanman
2021-09-23 10:18:51 +08:00
parent f7fc27944d
commit ec3c9428b3
29 changed files with 26009 additions and 21844 deletions

View File

@@ -115,7 +115,6 @@
},
created() {
managesAttestation(this.$Route.query.id).then(res=>{
console.log(res)
this.info = res
})
},

View File

@@ -5,6 +5,7 @@
</template>
<script>
import { orderJournal } from '@/apis/interfaces/store'
export default {
data() {
return {

View File

@@ -147,7 +147,7 @@
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
<image class='code-img' :src="shareCode" mode="widthFix" />
</view>
</block>
<!-- 弹窗 -->
<u-toast ref="uToast" />
@@ -329,6 +329,7 @@
&.vip{
background-image: linear-gradient(to right, #f8e5c0, #d6a46a);
color: #8d4928;
text-transform: uppercase;
}
}
}

View File

@@ -2,19 +2,28 @@
<view class="content">
<view class="codeContent">
<image class="codeContent-back" src="../../static/icons/store_codeBack.png" mode="widthFix"></image>
<view class="company">
<image class="company-logo" src="../../static/dev/good_cover_00.jpg" mode="aspectFill"></image>
<view class="company-cont">
<view class="company-name">如朗科技</view>
<view class="company-name">邀请你加入易货平台</view>
<image class="codeContent-cont" src="../../static/icons/store_contBack.png" mode="widthFix"></image>
<view class="textContent">
<view class="company">
<image class="company-logo" :src="companyInfo.cover" mode="aspectFill"></image>
<view class="company-cont">
<view class="nowrap company-name">{{companyInfo.name}}</view>
<view class="company-tips">易货平台</view>
</view>
</view>
<view class="code">
<image class="code-img" :src="companyInfo.code" mode="aspectFit"></image>
<!-- <view class="code-text">简单扫一扫即可进入平台</view> -->
</view>
<!-- @click="shareCanvas" -->
<view class="codeBnt">
扫码推广
</view>
</view>
<image class="codeContent-code" src="../../static/dev/good_cover_03.jpg" mode="aspectFit"></image>
</view>
<view class="codeBnt">
<image class="codeBnt-img" src="../../static/icons/store_down.png" mode="aspectFill"></image>
保存图片
</view>
<canvas class="codeImg" canvas-id="qrcodeCard"></canvas>
</view>
</template>
@@ -23,62 +32,218 @@
export default {
data() {
return {
codeImg: ''
companyInfo : ''
}
},
created() {
// companiesCode().then(res=>{
// this.codeImg = res
// })
companiesCode().then(res=>{
this.companyInfo = res
})
},
methods: {
// 绘制图片
shareCanvas(e){
uni.showLoading({
title: '加载中',
})
// 下载头像
let avatarImg = new Promise(success=>{
uni.getImageInfo({
src : this.companyInfo.cover,
success : res => {
success(res.path)
}
})
})
// 下载二维码
let codeImg = new Promise(success => {
uni.getImageInfo({
src : this.companyInfo.code,
success : res => {
success(res.path)
}
})
})
Promise.all([avatarImg, codeImg]).then(res => {
// 绘制海报
const ctx = uni.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景图片
ctx.drawImage('../../static/icons/store_downBack', 0, 0, 375, 603)
// 绘制头像
ctx.drawImage(res[0], 0, 0, 60, 60)
// 绘制二维码
ctx.drawImage(res[1], 140, 250, 110, 110)
// 文字
ctx.setFontSize(16)
ctx.fillText(this.companyInfo.name, 194, 180 , 270)
ctx.setFontSize(16)
ctx.fillText('邀请你加入易货平台', 194, 180 , 270)
ctx.save();
ctx.beginPath(); //开始绘制
ctx.arc(50 / 2 + 170, 50 / 2 + 110, 50 / 2, 0, Math.PI * 2, false);
ctx.clip();
// 保存图片
ctx.draw(true, () => {
uni.hideLoading()
uni.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: res => {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success : res=>{
if (res.errMsg == "saveImageToPhotosAlbum:ok"){
uni.showToast({
title: '分享海报已保存至相册',
icon : 'none'
})
}else{
uni.hideLoading()
}
},
fail : err=>{
if (err.errMsg == "saveImageToPhotosAlbum:fail auth deny"){
uni.showModal({
title : '提示',
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
confirmColor: '#d82526',
confirmText : '去设置',
success : res=>{
if (res.confirm){
uni.openSetting()
}
}
})
}
}
})
}
})
})
}).catch(err=>{
uni.showToast({
title: '海报下载,请检查网络',
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #e1293f;
background-color: #e93340;
height: 100vh;
width: 100vw;
padding: 80rpx;
box-sizing: border-box;
}
.codeContent {
position: relative;
width: 100%;
height: 100vh;
.codeContent-back {
width: 100%;
height: 100%;
z-index: 1;
position: absolute;
box-shadow: 0 0 20rpx rgba(115,0,4,.3);
}
.codeContent-cont {
left: 5%;
width: 90%;
top: 100px;
z-index: 2;
position: absolute;
}
.codeContent-tips {
position: absolute;
top: 0;
right: 20rpx;
width: 200rpx;
z-index: 2;
}
.textContent {
position: absolute;
padding: 20rpx 20rpx 0 40rpx;
box-sizing: border-box;
width: 70%;
z-index: 3;
left: 15%;
right: 15%;
top: 140px;
}
.company {
position: absolute;
width: 100%;
.company-logo {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.company-cont {
position: absolute;
width: 100%;
height: 230rpx;
left: 0;
top: 0;
padding: 20rpx 20rpx 30rpx 210rpx;
font-size: $title-size;
.company-name {
font-weight: 600;
margin: 10rpx 0;
}
.company-tips {
font-size: 26rpx;
color: #787878;
}
}
}
.code {
text-align: center;
width: 100%;
box-sizing: border-box;
margin-bottom: $margin;
.code-img {
width: 90%;
}
.code-text {
color: #787878;
margin-top: $margin - 10;
font-size: $title-size;
}
}
}
.codeBnt {
background-color: #FFFFFF;
background-color: #e1293f;
text-align: center;
border-radius: 10rpx;
line-height: 90rpx;
font-weight: 600;
font-size: $title-size;
color: #e1293f;
margin-top: 160rpx;
color: #FFFFFF;
box-shadow: 4rpx 0 10rpx rgba(155,0,19,.5);
position: relative;
.codeBnt-img {
position: absolute;
top: 0;
width: 60rpx;
height: 60rpx;
left: 24%;
}
}
/* canvas */
.codeImg {
position: absolute;
left: -1000%;
height: 603px;
width: 375px;
background: white;
}
</style>

View File

@@ -68,7 +68,6 @@
methods:{
// tabs筛选
onTbas(type){
console.log(type)
getDate(type).then(res => {
this.tabsIndex = type
this.dateValue = res

141
pages/store/deliver.vue Normal file
View File

@@ -0,0 +1,141 @@
<template>
<view>
<!-- 订单分类 -->
<scroll-view class="nav" scroll-x="true" scroll-with-animation="true">
<view :class="['nav-item', selectNavId === item.state ? 'nav-item-selected':'']" v-for="(item,index) in navList" :key="index" @click="selectNav(item.state)">
{{item.name}}
</view>
</scroll-view>
<!-- 订单列表 -->
<store-order v-if="returnInfo.length > 0" :list="returnInfo" listType="deliver" />
<view v-else class="pack-center">
<image src="../../static/icons/order-null.png"></image>
<view>您还没有相关订单</view>
</view>
</view>
</template>
<script>
import { storeDeliver } from '@/apis/interfaces/store'
import storeOrder from '@/components/store-order/store-order'
export default {
comments:{
storeOrder
},
data() {
return {
returnInfo : '' ,// 列表
navList : [{
name : '待发货',
state : '1'
},{
name : '已发货',
state : '2'
},{
name : '待提货',
state : '3'
},{
name : '已提货',
state : '4'
}
],
selectNavId : '1'
}
},
created() {
},
onShow() {
// 获取退货单列表
this.returnData();
},
methods: {
// 退货单列表
returnData(){
storeDeliver(this.selectNavId).then(res=>{
console.log(res)
this.returnInfo = res.data
})
},
// 选择订单
selectNav(id) {
if (this.selectNavId !== id) {
this.selectNavId = id
this.returnData()
}
},
// 我要发货
goSend(orderNo) {
console.log(orderNo)
return
uni.showModal({
title: '是否签收此订单?',
success: res => {
if(res.confirm) {
storeSign(orderNo).then(() => {
uni.showToast({
icon: 'none',
title: '签收成功'
})
setTimeout(()=>{
this.returnData()
},3000)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
// 订单nav
.nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
white-space: nowrap;
font-size: $title-size*0.95;
padding: 0 30rpx;
background-color: #fff;
color: #666;
position: sticky;
top: 0rpx;
z-index: 1;
.nav-item {
width: 25%;
text-align: center;
display: inline-block;
border-bottom: solid 4rpx #fff;
padding: 30rpx 0;
}
.nav-item-selected {
color: $main-color;
}
}
// 暂无订单
.pack-center {
text-align: center;
font-size: $title-size-sm;
color: $text-gray;
padding-top: 50%;
image {
width: $uni-img-size-lg * 2;
height:$uni-img-size-lg * 2;
border-radius: $uni-border-radius-circle;
margin-bottom: $margin;
}
}
</style>

166
pages/store/deliverForm.vue Normal file
View File

@@ -0,0 +1,166 @@
<template>
<view>
<form @submit="sendSubmit">
<view class="nickname">
<view class="examineTitle">
选择发货方式
</view>
<view class="toExamine" v-if="send.sendWay[send.sendIndex]">
<picker mode="selector" :value="send.sendIndex" range-key="name" :range="send.sendWay" @change="wayChange">
<view>{{send.sendWay[send.sendIndex].name}}</view>
</picker>
<image class="toExamine-row" src="../../static/icons/goods_row.png" mode="aspectFill"></image>
</view>
</view>
<view class="nickname" v-if="send.sendIndex == 0">
<view class="examineTitle">
选择物流公司
</view>
<view class="toExamine" v-if="state.array[state.index]">
<picker mode="selector" :value="state.index" range-key="name" :range="state.array" @change="sexChange">
<view>{{state.array[state.index].name}}</view>
</picker>
<image class="toExamine-row" src="../../static/icons/goods_row.png" mode="aspectFill"></image>
</view>
</view>
<view class="nickname" v-if="send.sendIndex == 0">
<view class="examineTitle">
填写物流单号
</view>
<input class="remarks" @blur="bindExpressNo" auto-height placeholder="" />
</view>
<!-- 选择其他方式显示 -->
<view class="nickname" v-if="send.sendIndex == 1">
<view class="examineTitle">
送货人姓名
</view>
<input class="remarks" name="courier_name" auto-height placeholder="" />
</view>
<view class="nickname" v-if="send.sendIndex == 1">
<view class="examineTitle">
送货人联系方式
</view>
<input class="remarks" name="courier_mobile" auto-height placeholder="" />
</view>
<button class="submit" form-type="submit" type="default">提交</button>
</form>
</view>
</template>
<script>
import { deliverFront, deliverForm } from '@/apis/interfaces/store'
export default {
data() {
return {
send : {
sendWay : [{
id : 'post',
name : '邮寄'
},{
id : 'other',
name : '其他'
}],
sendIndex : 0,
},
state : {
// 快递筛选
array : [],
// 快递筛选默认下标
index : 0,
},
expressNo : '',
courierName : '',
courierMobile : ''
}
},
created() {
deliverFront(this.$Route.query.id).then(res=>{
this.state.array = res
})
},
methods: {
// 选择发货方式
wayChange(e) {
this.send.sendIndex = e.detail.value
this.expressNo = ''
this.courierName = ''
this.courierMobile = ''
},
// 筛选
sexChange(e) {
this.state.index = e.detail.value
},
// 物流单号
bindExpressNo(val) {
this.expressNo = val.detail.value
},
// 送货人姓名
bindCourierName(val) {
this.courierName = val.detail.value
},
// 送货人联系方式
bindCourierMobile(val) {
this.courierMobile = val.detail.value
},
// 提交表单
sendSubmit() {
deliverForm(this.$Route.query.id,{
type : this.send.sendWay[this.send.sendIndex].id || '',
express_id : this.state.array[this.state.index].id || '',
express_no : this.expressNo || '',
courier_name : this.courierName || '',
courier_mobile : this.courierMobile || ''
}).then(res=>{
uni.showToast({
icon: 'none',
title: '发送成功'
})
this.$Router.back()
})
}
}
}
</script>
<style lang="scss" scoped>
.nickname {
background-color: #FFFFFF;
padding: $padding;
margin-bottom: $margin;
display: flex;
position: relative;
font-size: $title-size-lg;
.examineTitle {
width: 210rpx;
}
.remarks {
width: calc(100% - 210rpx);
font-size: $title-size-lg;
color: $text-color;
}
.toExamine {
position: absolute;
top: $padding;
right: $padding;
display: flex;
.toExamine-row {
width: 32rpx;
height: 32rpx;
margin-top: 6rpx;
filter: grayscale(100%);
}
}
}
.submit {
background: #e93340;
color: white;
border-color: #e93340;
margin: $margin*4 $margin 0;
}
</style>

114
pages/store/examine.vue Normal file
View File

@@ -0,0 +1,114 @@
<template>
<view>
<form @submit="sendSubmit">
<view class="nickname">
<view class="examineTitle">
退换单操作
</view>
<view class="toExamine">
<picker mode="selector" :value="state.index" range-key="name" :range="state.array" @change="sexChange">
<view>{{state.array[state.index].name}}</view>
</picker>
<image class="toExamine-row" src="../../static/icons/goods_row.png" mode="aspectFill"></image>
</view>
</view>
<view class="nickname">
<view class="examineTitle">
退换单备注
</view>
<textarea class="remarks" @blur="bindTextAreaBlur" auto-height placeholder="请填写备注" />
</view>
<button class="submit" form-type="submit" type="default">提交</button>
</form>
</view>
</template>
<script>
import { storeAudit } from '@/apis/interfaces/store'
export default {
data() {
return {
state : {
// 退货单-筛选
array : [{
id : 'agree',
name: '审核通过'
},{
id : 'refuse',
name: '审核驳回'
}],
// 退货单筛选默认下标
index : 0,
},
remarks : ''
}
},
created() {
},
methods: {
bindTextAreaBlur(val) {
this.remarks = val.detail.value
},
// 筛选
sexChange(e) {
this.state.index = e.detail.value
},
sendSubmit(){
let newState = this.state.array[this.state.index].id,
newRemark = this.remarks
storeAudit(this.$Route.query.id, {
state : newState,
remark: newRemark
}).then(res=>{
uni.showToast({
icon: 'none',
title: '审核成功'
})
this.$Router.back()
})
}
}
}
</script>
<style lang="scss" scoped>
.nickname {
background-color: #FFFFFF;
padding: $padding;
margin-bottom: $margin;
display: flex;
position: relative;
font-size: $title-size-lg;
.examineTitle {
width: 210rpx;
}
.remarks {
width: calc(100% - 210rpx);
font-size: $title-size-lg;
color: $text-color;
}
.toExamine {
position: absolute;
top: $padding;
right: $padding;
display: flex;
.toExamine-row {
width: 32rpx;
height: 32rpx;
margin-top: 6rpx;
filter: grayscale(100%);
}
}
}
.submit {
background: #e93340;
color: white;
border-color: #e93340;
margin: $margin*4 $margin 0;
}
</style>

View File

@@ -82,14 +82,6 @@
},
onShow(){
this.getIndex()
// 获取员工管理列表
if(this.$store.state.token != ''){
if(!this.employee) {
employeesTool().then(res=>{
this.toolList = res.permission
})
}
}
},
methods: {
// 首页数据
@@ -111,14 +103,23 @@
faith : res.integrity
}
this.workbench = {
identity: res.identity_time,
grade : res.identity_sign,
top : res.top,
middle : res.middle,
order : res.order
}
this.employee = res.is_employee
this.loding = false
// 若为员工身份-则调取员工管理信息
if(res.is_employee) {
employeesTool().then(res=>{
this.toolList = res.permission
})
}
}).catch(err =>{
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'
@@ -128,7 +129,6 @@
// 查询企业认证状态
getAppliesQuery(){
appliesQuery().then(res=>{
console.log(res)
this.appliesState = res
this.loding = false
}).catch(err => {
@@ -215,7 +215,7 @@
.statusBar-box{
min-height: 90rpx;
position: relative;
padding: $padding ($padding + 200) $padding ($padding + 88);
padding: $padding $padding $padding ($padding + 88);
color: white;
.logo{
position: absolute;
@@ -228,12 +228,13 @@
box-shadow: 0 4rpx 15rpx rgba(109,1,0,.8);
}
.company{
margin-left: 30rpx;
width: calc(100% - 94rpx);
padding-left: 30rpx;
box-sizing: border-box;
.name{
line-height: 40rpx;
@extend .nowrap;
font-size: $title-size;
display: flex;
.name-img {
width: 30rpx;
height: 30rpx;

83
pages/store/journal.vue Normal file
View File

@@ -0,0 +1,83 @@
<template>
<view>
<view class="logsBack">
<view class="logsList" v-for="(item ,index) in logArr" :key="index">
<view class="logsLabel">
<view class="logsLabel-name">操作来源</view>
<view class="logsTips" :class="[item.isMy ? 'active' : '']">{{ item.isMy ? '个人' : '商家' }}</view>
</view>
<view class="logsLabel" v-if="item.title">
<view class="logsLabel-name">申请原因</view>
<view class="logsLabel-text">{{ item.title }}</view>
</view>
<view class="logsLabel" v-if="item.state_text">
<view class="logsLabel-name">申请状态</view>
<view class="logsLabel-text">{{ item.state_text }}</view>
</view>
<view class="logsLabel" v-if="item.remark">
<view class="logsLabel-name">补充描述</view>
<view class="logsLabel-text">{{ item.remark }}</view>
</view>
<view class="logsLabel">
<view class="logsLabel-name">退款时间</view>
<view class="logsLabel-text">{{ item.created_at }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { orderJournal } from '@/apis/interfaces/store'
export default {
data() {
return {
logArr : '', //订单数组列表
}
},
created() {
orderJournal(this.$Route.query.id).then(res=>{
this.logArr = res
})
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.logsBack {
background: #f7f7f7;
padding: $padding;
box-sizing: border-box;
font-size: $title-size-sm;
.logsList {
background: #fff;
padding: $padding;
box-sizing: border-box;
border-radius: 10rpx;
margin-bottom: $margin;
position: relative;
}
.logsTips {
color: #e1293f;
&.active {
color: #e1293f;
}
}
.logsLabel {
padding: $padding 0;
overflow: hidden;
display: flex;
.logsLabel-name {
margin-right: $margin;
width: 140rpx;
}
.logsLabel-text {
color: $text-gray;
width: calc(100% - 140rpx - #{$margin});
}
}
}
</style>

161
pages/store/logistic.vue Normal file
View File

@@ -0,0 +1,161 @@
<template>
<view>
<!-- 物流状态 start -->
<view class="state" v-if="logistic.length > 0">
<view class="take">
<view class="take-tips">
</view>
<view class="take-text">
收货地址发接口返回绝对是放假客户端上看见发货数据库大黄蜂教科书的浩丰科技
</view>
</view>
<view class="list">
<!-- v-for="(item, index) in logistic" :key="index" -->
<view class="list-label">
<view class="list-name">
<text>发货中</text> 2020-15-12
</view>
<view class="list-time">
华东师范邯郸市科技发货圣诞节客服
</view>
</view>
</view>
</view>
<view class="pack-center" v-else>
<image src="../../static/icons/store_logistic.png" mode="aspectFill"></image>
<view>{{message}} </view>
</view>
</view>
</template>
<script>
import { deliverLogistic } from '@/apis/interfaces/store'
export default {
data() {
return {
message : '',
logistic: ''
}
},
created() {
deliverLogistic(this.$Route.query.id).then(res=>{
console.log(res)
}).catch(err => {
this.message = err.message
})
},
methods: {
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f6f6f6;
}
// 物流状态
.state {
background-color: $uni-bg-color;
margin-top: $margin;
padding: $padding;
font-size: $title-size-m;
color: $text-gray;
.take {
display: flex;
padding-bottom: $padding;
position: relative;
&::before {
position: absolute;
content: '';
left: $uni-img-size-sm / 3 + 2;
top: $margin;
background-color: $uni-text-color-grey;
width: 2rpx;
height: 100%;
}
.take-tips {
background-color: #e53d4c;
width: $uni-img-size-sm;
height: $uni-img-size-sm;
border-radius: $uni-border-radius-circle;
font-size: $title-size-sm;
transform: scale(.9);
text-align: center;
color: $uni-text-color-inverse;
margin-top: 10rpx;
margin-left: -4rpx;
}
.take-text {
margin-left: $margin;
line-height: 40rpx;
margin-top: $margin - 10;
width: calc(100% - #{$uni-img-size-sm} + #{$margin});
}
}
.list {
font-size: $title-size-sm;
.list-label {
padding-left: $padding * 3;
padding-bottom: $padding;
padding-top: $padding - 10;
position: relative;
&::after {
position: absolute;
content: '';
left: $uni-img-size-sm / 3 - 4;
top: $margin;
background-color: $uni-text-color-grey;
width: $uni-img-size-sm / 3;
height: $uni-img-size-sm / 3;
border-radius: $uni-border-radius-circle;
z-index: 9;
}
&::before {
position: absolute;
content: '';
left: $uni-img-size-sm / 3 + 2;
top: $margin;
background-color: $uni-text-color-grey;
width: 2rpx;
height: 100%;
}
&:first-child {
color: #e53d4c;
}
&:last-child::before {
background-color: $uni-bg-color;
}
&:first-child::after {
background-color: #e53d4c;
}
.list-name {
margin-bottom: $margin - 10;
text {
font-weight: 600;
padding-right: $padding;
}
}
.list-time {
font-size: $uni-font-size-sm;
line-height: 34rpx;
}
}
}
}
// 暂无订单
.pack-center {
text-align: center;
font-size: $title-size-sm;
color: $text-gray;
padding-top: 50%;
image {
width: $uni-img-size-lg * 2;
height:$uni-img-size-lg * 2;
margin: 0 auto $margin;
}
}
</style>

View File

@@ -0,0 +1,38 @@
<template>
<view>
<!-- 订单详情 -->
<store-order-details :info="info" :listType="newType" />
</view>
</template>
<script>
import { deliverDetails, orderDetails } from '@/apis/interfaces/store'
import storeOrderDet from '@/components/store-order-details/store-order-details'
export default {
comments:{
storeOrderDet
},
data() {
return {
info : '',
newType : ''
}
},
created() {
this.newType = this.$Route.query.type
if(this.$Route.query.type == 'deliver') {
deliverDetails(this.$Route.query.id).then(res=>{
this.info = res
})
return
}
orderDetails(this.$Route.query.id).then(res=>{
this.info = res
})
},
methods: {}
}
</script>
<style lang="scss" scoped></style>

171
pages/store/return.vue Normal file
View File

@@ -0,0 +1,171 @@
<template>
<view>
<!-- 订单分类 -->
<scroll-view class="nav" scroll-x="true" scroll-with-animation="true">
<view :class="['nav-item', selectNavId === item.id ? 'nav-item-selected':'']" v-for="(item,index) in navList" :key="index" @click="selectNav(item.id)">
{{item.name}}
</view>
</scroll-view>
<!-- 订单列表 -->
<store-order v-if="returnInfo.length > 0" :list="returnInfo" />
<view v-else class="pack-center">
<image src="../../static/icons/order-null.png"></image>
<view>您还没有相关订单</view>
</view>
</view>
</template>
<script>
import { storeReturn, storeSign, storeToken } from '@/apis/interfaces/store'
import storeOrder from '@/components/store-order/store-order'
export default {
comments:{
storeOrder
},
data() {
return {
returnInfo : '' ,// 列表
navList : [{
name : '待审核',
id : 'apply'
},{
name : '待返货',
id : 'deliver'
},{
name : '待签收',
id : 'delivered'
},{
name : '已签收',
id : 'signed'
},
{
name : '待确认退货',
id : 'process'
},
{
name : '完成退货',
id : 'completed'
}
],
selectNavId : 'apply'
}
},
created() {
},
onShow() {
// 获取退货单列表
this.returnData();
},
methods: {
// 退货单列表
returnData(){
storeReturn(this.selectNavId).then(res=>{
this.returnInfo = res.data
})
},
// 选择订单
selectNav(id) {
if (this.selectNavId !== id) {
this.selectNavId = id
this.returnData()
}
},
// 签收订单
goSign(orderNo,index) {
uni.showModal({
title: '是否签收此订单?',
success: res => {
if(res.confirm) {
storeSign(orderNo).then(() => {
uni.showToast({
icon: 'none',
title: '签收成功'
})
setTimeout(()=>{
this.returnData()
},3000)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
})
},
// 确认退货
goReToken(orderNo,index) {
uni.showModal({
title: '是否确认退货此订单?',
success: res => {
if(res.confirm) {
storeToken(orderNo).then(() => {
uni.showToast({
icon: 'none',
title: '退货成功'
})
setTimeout(()=>{
this.returnData()
},3000)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
// 订单nav
.nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
white-space: nowrap;
font-size: $title-size*0.95;
padding: 0 30rpx;
background-color: #fff;
color: #666;
position: sticky;
top: 0rpx;
z-index: 1;
.nav-item {
display: inline-block;
border-bottom: solid 4rpx #fff;
padding: 30rpx 10rpx;
margin-right: 10rpx;
}
.nav-item-selected {
border-bottom: solid 4rpx $main-color;
color: $main-color;
}
}
// 暂无订单
.pack-center {
text-align: center;
font-size: $title-size-sm;
color: $text-gray;
padding-top: 50%;
image {
width: $uni-img-size-lg * 2;
height:$uni-img-size-lg * 2;
border-radius: $uni-border-radius-circle;
margin-bottom: $margin;
}
}
</style>