Miao 3 months ago
parent
commit
2e9d5d9b03
  1. 7
      App.vue
  2. 6
      components/AdvisorPage/index.vue
  3. 10
      pages/Index/index.vue
  4. 11
      pages/Login/index.vue
  5. 1
      pages/Service/index.vue
  6. 3
      uni_modules/m-view/index.js
  7. 33
      uni_modules/m-view/lib/cloud-lib.js

7
App.vue

@ -1,9 +1,13 @@
<script>
import api from "@/utils/functions";
import cloud from "@/uni_modules/m-view/lib/cloud-lib";
export default {
onLaunch: function() {
console.log('App Launch')
// #ifdef H5
cloud.build();
// #endif
},
onShow: function() {
@ -11,8 +15,9 @@
onHide: function() {
console.log('App Hide')
},
mounted() {
},
created() {
if(!uni.getStorageSync('sysInfo')){

6
components/AdvisorPage/index.vue

@ -400,17 +400,20 @@ export default {
},
uploadAvatar(e) {
console.log(e)
alert(e)
api.uploadOssFile(e.detail.avatarUrl).then(res => {
this.model.userInfo.avatar = res.show_path
avatarUpload({
url: res.show_path
}).then(res => {
alert(res)
if (res.code === 200) {
uni.$u.toast('修改成功')
} else {
uni.$u.toast(res.msg)
}
}).catch(err => {
alert(err)
uni.$u.toast('服务器开小差了')
})
})
@ -598,7 +601,10 @@ export default {
sourceType: ['album'], //
success: function (res) {
console.log('res',res)
alert(res)
that.uploadAvatar({detail: {avatarUrl: res.tempFilePaths}});
},fail(e){
alert(e);
}
});
},

10
pages/Index/index.vue

@ -164,6 +164,16 @@ export default {
//#ifdef MP-WEIXIN
this.$refs.home.marginTop = that.marginTop = uni.$u.getPx(44);
// #endif
uni.setNavigationBarTitle({
title:'这是个标题'
})
alert(JSON.stringify(uni.setNavigationBarTitle))
// eshimin.setTitle({
// title:'es',
// onResponse:function (res) {
// alert(res)
// }
// });
},
onReachBottom() {
if (this.footCheck === 'shop') {

11
pages/Login/index.vue

@ -68,6 +68,7 @@
<u-text text="快捷登录" color="#fff" size="32" align="center" custom-style="display:inline;"></u-text>
</u-button>
<u-button
style="margin-top:40rpx;"
type="success"
size="normal"
shape="circle"
@ -271,6 +272,16 @@ export default {
complete: () => {},
})
// #endif
let token = {"token":"4OYeyJhbGcifi5OiJoYXZhbDI1Niw0IiwidHlwIjoiSldUIn0dBv.WDxeyJ1c2VyhceX2lkIjo2MSwiaWF0IjoxNzI4OTExMTA0LCJleHAiOjE3Mjg5MTExNjQsImlzcyI6IlNEX0NMIiwianRpIjoianRpNjcwZDE3MDAyZmI3MDc3In0gMX.BeDMzc2NTMx8yWNDlkOWJlM2Q2YjFkMmUwNDhmM2Y3ZjZlNjAyMDU4ZDUwY2UxNDFiZTUyNTRiY2NhZTdlNTIwODVjYwm2c","token_exp":1728911164}
uni.setStorageSync('token',token)
userDetail().then((res) => {
// uni.setStorageSync('token',res.data.token);
uni.setStorageSync('user',res.data);
this.$store.commit('userInfo', res.data);
uni.navigateBack({
delta:1,
})
});
},
}
</script>

1
pages/Service/index.vue

@ -84,7 +84,6 @@
<view id="map" class="map" v-if="tabCheck === 'room'">
<MzMap ref="mzMap" :coordinates="roomCoordinate" @markerTap="markerTap" @tap="mapTap" ></MzMap>
</view>
</view>
<view id="popMap" class="popMap row " v-if="popMapShow">
<view class="pop-container row">

3
uni_modules/m-view/index.js

@ -7,9 +7,6 @@ const $m = {
...tools,
service
}
// #ifdef H5
cloud.build();
// #endif
// $m挂载到uni对象上
uni.$m = $m

33
uni_modules/m-view/lib/cloud-lib.js

@ -26,12 +26,28 @@ export default {
if('fail' in params)params.fail(e);
}
}
uni.getLocation = (params) => {
// uni.getLocation = (params) => {
// try {
// console.log('getLocation', params)
// if('compile' in params)params.compile();
// eshimin.getLocation({
// onResponse:function (res) {
// if('success' in params)params.success(res);
// }
// });
// }catch (e){
// console.log(e)
// if('fail' in params)params.fail(e);
// }
// }
uni.makePhoneCall = (params) => {
try {
console.log('getLocation', params)
console.log('makePhoneCall', params)
if('compile' in params)params.compile();
eshimin.getLocation({
phoneNum:params.phoneNumber,
onResponse:function (res) {
alert(res)
if('success' in params)params.success(res);
}
});
@ -40,21 +56,24 @@ export default {
if('fail' in params)params.fail(e);
}
}
uni.makePhoneCall = (params) => {
uni.setNavigationBarTitle = (params) => {
try {
console.log('makePhoneCall', params)
console.log('setTitle', params)
if('compile' in params)params.compile();
eshimin.getLocation({
phoneNum:params.phoneNumber,
eshimin.setTitle({
title:params.title,
onResponse:function (res) {
alert(res)
if('success' in params)params.success(res);
}
});
alert(12)
}catch (e){
console.log(e)
alert(e);
if('fail' in params)params.fail(e);
}
}
};
},
};

Loading…
Cancel
Save