Commit 10849734 authored by Facius's avatar Facius

feat: 首页登录

parent 2e64e045
Pipeline #2965 canceled with stages
......@@ -374,7 +374,6 @@ export default {
})
},
handleSelectCell(id) {
console.log('-----------', id)
uni.navigateTo({
url: `/pages/bill/bill-detail/bill-detail?id=${id}`,
})
......@@ -392,20 +391,24 @@ export default {
}
},
checkVip() {
if (checkVip()) {
return true
} else {
if (this.userInfo.vip.code == 'NO') {
this.visible = true
if (checkToken()) {
if (checkVip()) {
return true
} else {
this.$refs.uToast.show({
duration: 1500,
title: '请先开通会员',
type: 'warning',
callback: () => {},
})
if (this.userInfo.vip.code == 'NO') {
this.visible = true
} else {
this.$refs.uToast.show({
duration: 1500,
title: '请先开通会员',
type: 'warning',
callback: () => {},
})
}
return false
}
return false
} else {
this.toLogin()
}
},
formatCount(count) {
......@@ -415,16 +418,15 @@ export default {
this.$refs.uToast.show({
duration: 1500,
title: '请先登录',
type: 'error',
type: 'warning',
callback: () => {
this.$u.route({
url: 'pages/login/index',
url: 'pages/login/login',
})
},
})
},
handleClickShare() {
console.log('-----handleClickShare----')
if (this.userInfo.vip.code == 'NO') {
experienceVip()
.then((res) => {})
......
......@@ -40,17 +40,20 @@
</u-form-item>
<u-form-item label="实收金额">
<view class="display-view">
<u-input
type="digit"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="form.actualAmount"
placeholder="请填写实收金额"
/>
<view class="same-view" hover-class="u-hover-class"
@click="$u.throttle(handleClickSame, 500)"
>同上</view>
<u-input
type="digit"
:clearable="false"
:custom-style="customStyle"
:placeholder-style="placeholderStyle"
v-model="form.actualAmount"
placeholder="请填写实收金额"
/>
<view
class="same-view"
hover-class="u-hover-class"
@click="$u.throttle(handleClickSame, 500)"
>同上</view
>
</view>
</u-form-item>
<u-form-item label="欠款金额" :border-bottom="false">
......@@ -157,7 +160,9 @@
<view class="confirm-view">确定</view>
</u-button>
</view>
<view class="loading-view" v-if="loading" ><u-loading mode="flower"></u-loading></view>
<view class="loading-view" v-if="loading"
><u-loading mode="flower"></u-loading
></view>
<u-picker
mode="time"
v-model="showTimePicker"
......@@ -191,7 +196,10 @@ export default {
customerPhone: '',
receivableAmount: '',
actualAmount: '0',
repairTime: this.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM:ss'),
repairTime: this.$u.timeFormat(
new Date().getTime(),
'yyyy-mm-dd hh:MM:ss'
),
address: '',
latitude: '',
longitude: '',
......@@ -315,16 +323,28 @@ export default {
this.billId = options.billId
}
if (this.billId) {
this.repairDetail()
this.repairDetail()
} else {
this.getLocation()
}
},
onReady() {
this.$refs.uForm.setRules(this.rules)
},
onUnload() {},
onShow() {
},
onShow() {},
methods: {
getLocation() {
uni.getLocation({
type: 'gcj02',
success: (res) => {
let { name, address, latitude, longitude } = res
this.form.address = address + name
this.form.latitude = latitude
this.form.longitude = longitude
},
})
},
repairDetail() {
this.loading = true
repairDetail({
......@@ -372,9 +392,10 @@ export default {
},
chooseLocation() {
uni.chooseLocation({
latitude: this.form.latitude,
longitude: this.form.longitude,
success: (res) => {
let { name, address, latitude, longitude } = res
console.log(res)
this.form.address = address + name
this.form.latitude = latitude
this.form.longitude = longitude
......@@ -404,20 +425,22 @@ export default {
},
editeRepair() {
this.buttonLoading = true
editeRepair(this.form).then((res)=> {
if (res.code == 0) {
if (this.billId) {
uni.$emit('maintain-bill-detail')
} else {
uni.$emit('maintain-bill-list')
editeRepair(this.form)
.then((res) => {
if (res.code == 0) {
if (this.billId) {
uni.$emit('maintain-bill-detail')
} else {
uni.$emit('maintain-bill-list')
}
this.billId = res.data
this.toParticulars()
this.buttonLoading = false
}
this.billId = res.data
this.toParticulars()
})
.catch((res) => {
this.buttonLoading = false
}
}).catch((res)=> {
this.buttonLoading = false
})
})
},
toParticulars() {
this.$u.route({
......@@ -504,14 +527,14 @@ export default {
justify-content: space-between;
align-items: center;
.same-view {
border-left: 2rpx solid #D8D8D8;
border-left: 2rpx solid #d8d8d8;
height: 28rpx;
line-height: 28rpx;
flex-shrink: 0;
width: 68rpx;
margin-left: 16rpx;
text-align: right;
color: #02A074;
color: #02a074;
font-size: 24rpx;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment