Commit e1f52280 authored by 刘文虎's avatar 刘文虎
parents bfbfb8d3 448134c4
Pipeline #2968 canceled with stages
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</view> </view>
</view> </view>
</view> </view>
<NoData v-else-if="!loading" imageWidth="374" text="当前暂无收支明细" /> <NoData v-else imageWidth="374" text="当前暂无收支明细" />
</view> </view>
</template> </template>
...@@ -53,12 +53,12 @@ export default { ...@@ -53,12 +53,12 @@ export default {
}, },
data() { data() {
return { return {
loading: true, // loading: true,
} }
}, },
watch: { watch: {
list() { list() {
this.loading = false // this.loading = false
}, },
}, },
computed: { computed: {
......
...@@ -129,8 +129,6 @@ ...@@ -129,8 +129,6 @@
</template> </template>
<script> <script>
let systemInfo = uni.getSystemInfoSync()
import MidPopup from '@/components/mid-popup/mid-popup.vue' import MidPopup from '@/components/mid-popup/mid-popup.vue'
import BillList from '@/components/bill-list' import BillList from '@/components/bill-list'
import PopNormal from '@/components/pop-normal' import PopNormal from '@/components/pop-normal'
...@@ -162,6 +160,7 @@ export default { ...@@ -162,6 +160,7 @@ export default {
list: [], list: [],
triggered: true, triggered: true,
_freshing: false, _freshing: false,
systemInfo: {},
} }
}, },
computed: { computed: {
...@@ -178,7 +177,7 @@ export default { ...@@ -178,7 +177,7 @@ export default {
} }
}, },
shareImage() { shareImage() {
return this.baseUrl + 'share_index.png' return this.baseUrl + 'huiyuanfenxiangtu-red@3x.png'
}, },
dingweidizhiImage() { dingweidizhiImage() {
return this.baseUrl + 'dingweidizhi@3x.png' return this.baseUrl + 'dingweidizhi@3x.png'
...@@ -222,12 +221,15 @@ export default { ...@@ -222,12 +221,15 @@ export default {
] ]
}, },
paddingTop() { paddingTop() {
var top = systemInfo.safeAreaInsets.top var top =
(this.systemInfo.safeAreaInsets &&
this.systemInfo.safeAreaInsets.top) ||
20
// #ifdef APP-PLUS || H5 // #ifdef APP-PLUS || H5
return 44 + top return 44 + top
// #endif // #endif
// #ifdef MP // #ifdef MP
return (systemInfo.platform == 'ios' ? 44 : 48) + top return (this.systemInfo.platform == 'ios' ? 44 : 48) + top
// #endif // #endif
}, },
params() { params() {
...@@ -254,6 +256,7 @@ export default { ...@@ -254,6 +256,7 @@ export default {
uni.$on('bill-list-reload', (res) => { uni.$on('bill-list-reload', (res) => {
this.initInfo() this.initInfo()
}) })
this.systemInfo = uni.getSystemInfoSync()
}, },
onShow() { onShow() {
console.log('----------------') console.log('----------------')
...@@ -371,7 +374,6 @@ export default { ...@@ -371,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}`,
}) })
...@@ -389,21 +391,25 @@ export default { ...@@ -389,21 +391,25 @@ export default {
} }
}, },
checkVip() { checkVip() {
if (checkToken()) {
if (checkVip()) { if (checkVip()) {
return true return true
} else { } else {
if (userInfo.vip.code == 'TEMPORARY') { if (this.userInfo.vip.code == 'NO') {
this.visible = true
} else {
this.$refs.uToast.show({ this.$refs.uToast.show({
duration: 1500, duration: 1500,
title: '请先开通会员', title: '请先开通会员',
type: 'warning', type: 'warning',
callback: () => {}, callback: () => {},
}) })
} else {
this.visible = true
} }
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)
...@@ -412,21 +418,24 @@ export default { ...@@ -412,21 +418,24 @@ 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() {
if (this.userInfo.vip.code == 'NO') {
experienceVip() experienceVip()
.then((res) => {}) .then((res) => {})
.catch((res) => {}) .catch((res) => {})
}
}, },
// 朋友圈 // 朋友圈
onShareTimeline(res) { onShareTimeline(res) {
this.handleClickShare()
return { return {
title: '扳手记账', title: '扳手记账',
path: `/pages/index/index?shareUserId=${this.userInfo.id}`, path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
...@@ -435,6 +444,7 @@ export default { ...@@ -435,6 +444,7 @@ export default {
}, },
// 好友 // 好友
onShareAppMessage(res) { onShareAppMessage(res) {
this.handleClickShare()
return { return {
title: '扳手记账', title: '扳手记账',
path: `/pages/index/index?shareUserId=${this.userInfo.id}`, path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
...@@ -452,8 +462,6 @@ export default { ...@@ -452,8 +462,6 @@ export default {
flex-direction: column; flex-direction: column;
.content-view { .content-view {
height: 100%;
overflow-x: scroll;
padding: 0rpx 24rpx 140rpx 24rpx; padding: 0rpx 24rpx 140rpx 24rpx;
margin-bottom: -60rpx; margin-bottom: -60rpx;
......
...@@ -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">
...@@ -124,7 +127,7 @@ ...@@ -124,7 +127,7 @@
:custom-style="customAreaStyle" :custom-style="customAreaStyle"
:placeholder-style="placeholderStyle" :placeholder-style="placeholderStyle"
v-model="form.remark" v-model="form.remark"
placeholder="填写维修备注信息" placeholder="举例:修一台格力空调,压缩机800元,工时200元,合计1000元,质保1年。"
/> />
</view> </view>
</view> </view>
...@@ -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
}) })
}, },
...@@ -429,7 +452,7 @@ export default { ...@@ -429,7 +452,7 @@ export default {
}) })
}, },
handleClickSame() { handleClickSame() {
if (this.form.actualAmount) { if (this.form.receivableAmount) {
this.form.actualAmount = this.form.receivableAmount this.form.actualAmount = this.form.receivableAmount
} }
}, },
...@@ -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