Commit 10849734 authored by Facius's avatar Facius

feat: 首页登录

parent 2e64e045
Pipeline #2965 canceled with stages
...@@ -374,7 +374,6 @@ export default { ...@@ -374,7 +374,6 @@ export default {
}) })
}, },
handleSelectCell(id) { handleSelectCell(id) {
console.log('-----------', id)
uni.navigateTo({ uni.navigateTo({
url: `/pages/bill/bill-detail/bill-detail?id=${id}`, url: `/pages/bill/bill-detail/bill-detail?id=${id}`,
}) })
...@@ -392,6 +391,7 @@ export default { ...@@ -392,6 +391,7 @@ export default {
} }
}, },
checkVip() { checkVip() {
if (checkToken()) {
if (checkVip()) { if (checkVip()) {
return true return true
} else { } else {
...@@ -407,6 +407,9 @@ export default { ...@@ -407,6 +407,9 @@ export default {
} }
return false return false
} }
} else {
this.toLogin()
}
}, },
formatCount(count) { formatCount(count) {
return (Math.trunc((count || 0) * 100) / 100).toFixed(2) return (Math.trunc((count || 0) * 100) / 100).toFixed(2)
...@@ -415,16 +418,15 @@ export default { ...@@ -415,16 +418,15 @@ export default {
this.$refs.uToast.show({ this.$refs.uToast.show({
duration: 1500, duration: 1500,
title: '请先登录', title: '请先登录',
type: 'error', type: 'warning',
callback: () => { callback: () => {
this.$u.route({ this.$u.route({
url: 'pages/login/index', url: 'pages/login/login',
}) })
}, },
}) })
}, },
handleClickShare() { handleClickShare() {
console.log('-----handleClickShare----')
if (this.userInfo.vip.code == 'NO') { if (this.userInfo.vip.code == 'NO') {
experienceVip() experienceVip()
.then((res) => {}) .then((res) => {})
......
...@@ -48,9 +48,12 @@ ...@@ -48,9 +48,12 @@
v-model="form.actualAmount" v-model="form.actualAmount"
placeholder="请填写实收金额" placeholder="请填写实收金额"
/> />
<view class="same-view" hover-class="u-hover-class" <view
class="same-view"
hover-class="u-hover-class"
@click="$u.throttle(handleClickSame, 500)" @click="$u.throttle(handleClickSame, 500)"
>同上</view> >同上</view
>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="欠款金额" :border-bottom="false"> <u-form-item label="欠款金额" :border-bottom="false">
...@@ -157,7 +160,9 @@ ...@@ -157,7 +160,9 @@
<view class="confirm-view">确定</view> <view class="confirm-view">确定</view>
</u-button> </u-button>
</view> </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 <u-picker
mode="time" mode="time"
v-model="showTimePicker" v-model="showTimePicker"
...@@ -191,7 +196,10 @@ export default { ...@@ -191,7 +196,10 @@ export default {
customerPhone: '', customerPhone: '',
receivableAmount: '', receivableAmount: '',
actualAmount: '0', 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: '', address: '',
latitude: '', latitude: '',
longitude: '', longitude: '',
...@@ -316,15 +324,27 @@ export default { ...@@ -316,15 +324,27 @@ export default {
} }
if (this.billId) { if (this.billId) {
this.repairDetail() this.repairDetail()
} else {
this.getLocation()
} }
}, },
onReady() { onReady() {
this.$refs.uForm.setRules(this.rules) this.$refs.uForm.setRules(this.rules)
}, },
onUnload() {}, onUnload() {},
onShow() { onShow() {},
},
methods: { 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() { repairDetail() {
this.loading = true this.loading = true
repairDetail({ repairDetail({
...@@ -372,9 +392,10 @@ export default { ...@@ -372,9 +392,10 @@ export default {
}, },
chooseLocation() { chooseLocation() {
uni.chooseLocation({ uni.chooseLocation({
latitude: this.form.latitude,
longitude: this.form.longitude,
success: (res) => { success: (res) => {
let { name, address, latitude, longitude } = res let { name, address, latitude, longitude } = res
console.log(res)
this.form.address = address + name this.form.address = address + name
this.form.latitude = latitude this.form.latitude = latitude
this.form.longitude = longitude this.form.longitude = longitude
...@@ -404,7 +425,8 @@ export default { ...@@ -404,7 +425,8 @@ export default {
}, },
editeRepair() { editeRepair() {
this.buttonLoading = true this.buttonLoading = true
editeRepair(this.form).then((res)=> { editeRepair(this.form)
.then((res) => {
if (res.code == 0) { if (res.code == 0) {
if (this.billId) { if (this.billId) {
uni.$emit('maintain-bill-detail') uni.$emit('maintain-bill-detail')
...@@ -415,7 +437,8 @@ export default { ...@@ -415,7 +437,8 @@ export default {
this.toParticulars() this.toParticulars()
this.buttonLoading = false this.buttonLoading = false
} }
}).catch((res)=> { })
.catch((res) => {
this.buttonLoading = false this.buttonLoading = false
}) })
}, },
...@@ -504,14 +527,14 @@ export default { ...@@ -504,14 +527,14 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.same-view { .same-view {
border-left: 2rpx solid #D8D8D8; border-left: 2rpx solid #d8d8d8;
height: 28rpx; height: 28rpx;
line-height: 28rpx; line-height: 28rpx;
flex-shrink: 0; flex-shrink: 0;
width: 68rpx; width: 68rpx;
margin-left: 16rpx; margin-left: 16rpx;
text-align: right; text-align: right;
color: #02A074; color: #02a074;
font-size: 24rpx; 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