|
|
@@ -21,7 +21,7 @@
|
|
|
<button v-if="applyStatus === 'approved'" class="btn-center" @click="goToCenter">
|
|
|
进入服务商中心
|
|
|
</button>
|
|
|
- <button class="btn-back" @click="uni.navigateBack">返回首页</button>
|
|
|
+ <button class="btn-back" @click="goBack">返回首页</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -157,6 +157,16 @@ export default {
|
|
|
this.checkExistingApply()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 模板里不能直接调用 uni.*(渲染时实例上没有 uni,会报
|
|
|
+ // "Property or method uni is not defined"),统一收进方法
|
|
|
+ goBack() {
|
|
|
+ var pages = getCurrentPages()
|
|
|
+ if (pages && pages.length > 1) {
|
|
|
+ uni.navigateBack()
|
|
|
+ } else {
|
|
|
+ uni.switchTab({ url: '/pages/index/index' })
|
|
|
+ }
|
|
|
+ },
|
|
|
async checkExistingApply() {
|
|
|
try {
|
|
|
const res = await getMyServiceRoleApply()
|