|
|
@@ -40,7 +40,7 @@
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
<view v-for="(s, idx) in detailInfo.orderList" :key="idx" class="commodity-item" >
|
|
|
- <view class="item-info" @click="pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})" >
|
|
|
+ <view class="item-info" @click="getDetail(s)" >
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ s.orderSn }} 时间 {{s.addTime.substr(5,11)}}</text>
|
|
|
<text class="item-price">
|
|
|
@@ -103,6 +103,7 @@
|
|
|
import { getDetail,detail,cancel } from "@/api/clear/index";
|
|
|
import productMins from "@/mixins/product";
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
export default {
|
|
|
name: "info",
|
|
|
components: {
|
|
|
@@ -118,11 +119,46 @@ export default {
|
|
|
name: ""
|
|
|
},
|
|
|
detailInfo: {},
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ notLogin:true
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getLoginInfo"])
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ getLoginInfo: {
|
|
|
+ handler(newValue) {
|
|
|
+ if(!this.$util.isEmpty(newValue.admin) && newValue.admin.currentShopId > 0){
|
|
|
+ this.notLogin = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
|
|
|
+ this.notLogin = true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ remindLogin(){
|
|
|
+ let that = this
|
|
|
+ this.$util.confirmModal({content:'您还没有登录,请先登录',okText:'去登录'},() => {
|
|
|
+ that.pageTo({url:'/admin/home/login'})
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDetail(s){
|
|
|
+ if(this.notLogin){
|
|
|
+ this.remindLogin()
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})
|
|
|
+ },
|
|
|
cancelFn(info){
|
|
|
+ if(this.notLogin){
|
|
|
+ this.remindLogin()
|
|
|
+ return false
|
|
|
+ }
|
|
|
let that = this
|
|
|
that.$util.confirmModal({content:'确认取消?'},() => {
|
|
|
cancel({id:info.id}).then(res=>{
|
|
|
@@ -134,6 +170,10 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
toClear(info){
|
|
|
+ if(this.notLogin){
|
|
|
+ this.remindLogin()
|
|
|
+ return false
|
|
|
+ }
|
|
|
let that = this
|
|
|
detail({ id:info.id }).then(res => {
|
|
|
if(res.code == 1) {
|
|
|
@@ -151,9 +191,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
callUp(mobile) {
|
|
|
- uni.makePhoneCall({
|
|
|
- phoneNumber: mobile
|
|
|
- });
|
|
|
+ uni.makePhoneCall({ phoneNumber: mobile })
|
|
|
},
|
|
|
init() {
|
|
|
let id = 0
|