小程序配置,

用户信息获取
dev
Tuzki 2 years ago
parent 0493cf8031
commit ac5bea9660
  1. 6
      App.vue
  2. 4
      common/param.js
  3. 2
      manifest.json
  4. 454
      pages/personcenter/personcenter.vue
  5. 61
      pages/suggest/sug_from.vue

@ -6,11 +6,11 @@ const aes = require('./common/aes.js');
onLaunch: function() { onLaunch: function() {
console.log("App Launch") console.log("App Launch")
var that = this; var that = this;
util.userLocation();//android // util.userLocation();//android
//userid //userid
var userStorageSync = aes.aesDecrypt(uni.getStorageSync("userid")) var userStorageSync = aes.aesDecrypt(uni.getStorageSync("userid"))
if(userStorageSync.indexOf("data")){ if(userStorageSync.indexOf("data")&&userStorageSync!=null&&userStorageSync!=""){
var json = JSON.parse(userStorageSync); var json = JSON.parse(userStorageSync);
uni.setStorageSync("userid",aes.aesMinEncrypt(json.data)); uni.setStorageSync("userid",aes.aesMinEncrypt(json.data));
} }

@ -5,7 +5,7 @@ module.exports = {
clng: 114.489380, //当前经度 clng: 114.489380, //当前经度
clat: 38.042040 ,//当前纬度 clat: 38.042040 ,//当前纬度
update_oauthTime: 1000*60*60*12 ,//更新时间 update_oauthTime: 1000*60*60*12 ,//更新时间
appid: "wxaf70a5cd03b06c19", appid: "wx111bbea67d1b06d5",
user_info:null ,//用户信息 user_info:null ,//用户信息
cityName:"雄安", cityName:"雄安",
cityPy:"xiongan", cityPy:"xiongan",
@ -65,4 +65,4 @@ module.exports = {
YXJD:"2930", YXJD:"2930",
hotScenicGuid:"79", hotScenicGuid:"79",
videoFLType:"54"//视频分类 videoFLType:"54"//视频分类
} }

@ -60,7 +60,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxaf70a5cd03b06c19", "appid" : "wx111bbea67d1b06d5",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : true, "minified" : true,

@ -5,10 +5,10 @@
<!-- <image src="" class="dzhi_t_bg" mode="aspectFill"></image> --> <!-- <image src="" class="dzhi_t_bg" mode="aspectFill"></image> -->
<view class="mode_com"> <view class="mode_com">
<view class="dly_flex person_inf"> <view class="dly_flex person_inf">
<view class="pers_box" @tap="oauthUser()"> <view class="pers_box">
<view class="pes_img"> <view class="pes_img">
<!-- 默认头像 --> <!-- 默认头像 -->
<button class="btn_dzhi"> <button class="btn_dzhi" @click="oauthUser()">
<!--授权按钮--> <!--授权按钮-->
<image :src="headimgurl" mode="aspectFill" class="pers_box"></image> <image :src="headimgurl" mode="aspectFill" class="pers_box"></image>
</button> </button>
@ -47,7 +47,7 @@
<text class="ht_text">客服电话</text> <text class="ht_text">客服电话</text>
</view> </view>
<view class="w_33" @tap="jump('logout')" > <view class="w_33" @tap="jump('delete')">
<view class=""><image src="../../static/animg/p_tc.png" class="kou_top3" mode="aspectFill"></image></view> <view class=""><image src="../../static/animg/p_tc.png" class="kou_top3" mode="aspectFill"></image></view>
<text class="ht_text">退出登录</text> <text class="ht_text">退出登录</text>
</view> </view>
@ -89,110 +89,109 @@ export default {
}; };
}, },
onShow() { onShow() {
if (!this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) { if (!this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) {
this.isLogin = true; this.isLogin = true;
that.nickname = aes.aesDecrypt(uni.getStorageSync('nickname')); that.nickname = aes.aesDecrypt(uni.getStorageSync('nickname'));
that.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl')); that.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl'));
} }
if ( // if (
aes.aesDecrypt(uni.getStorageSync('adminId')) != undefined && // aes.aesDecrypt(uni.getStorageSync('adminId')) != undefined &&
aes.aesDecrypt(uni.getStorageSync('adminId')) != null && // aes.aesDecrypt(uni.getStorageSync('adminId')) != null &&
aes.aesDecrypt(uni.getStorageSync('adminId')) != '' // aes.aesDecrypt(uni.getStorageSync('adminId')) != ''
) { // ) {
this.adminId = uni.getStorageSync('adminId'); // this.adminId = uni.getStorageSync('adminId');
this.isAdminLogin = true; // this.isAdminLogin = true;
} // }
}, },
onLoad(options) { onLoad(options) {
if ( // if (
aes.aesDecrypt(uni.getStorageSync('adminId')) != undefined && // aes.aesDecrypt(uni.getStorageSync('adminId')) != undefined &&
aes.aesDecrypt(uni.getStorageSync('adminId')) != null && // aes.aesDecrypt(uni.getStorageSync('adminId')) != null &&
aes.aesDecrypt(uni.getStorageSync('adminId')) != '' // aes.aesDecrypt(uni.getStorageSync('adminId')) != ''
) { // ) {
this.adminId = aes.aesDecrypt(uni.getStorageSync('adminId')); // this.adminId = aes.aesDecrypt(uni.getStorageSync('adminId'));
this.isAdminLogin = true; // this.isAdminLogin = true;
} // }
// options = this.$param.user_info; // // options = this.$param.user_info;
var that = this; // var that = this;
this.getIsShow(); // this.getIsShow();
// #ifdef H5 // // #ifdef H5
if (this.$wechat.isWechat()) { // if (this.$wechat.isWechat()) {
//weixin // //weixin
this.isUpdate = false; // this.isUpdate = false;
} else { // } else {
this.isUpdate = true; // this.isUpdate = true;
} // }
// #endif // // #endif
if (uni.getStorageSync('oauthTime') + this.$param.update_oauthTime < new Date().getTime()) { if (uni.getStorageSync('oauthTime') + this.$param.update_oauthTime < new Date().getTime()) {
// uni.removeStorageSync("user_token"); // uni.removeStorageSync("user_token");
uni.removeStorageSync('nickname'); uni.removeStorageSync('nickname');
uni.removeStorageSync('unionid'); uni.removeStorageSync('unionid');
uni.removeStorageSync('headimgurl'); uni.removeStorageSync('headimgurl');
} }
uni.showLoading({ // uni.showLoading({
mask: true, // mask: true,
title: '授权中', // title: '',
success() { // success() {
setTimeout(function () { // setTimeout(function () {
uni.hideLoading(); // uni.hideLoading();
}, 3000); // }, 3000);
} // }
}); // });
if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) { // if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) {
if (options == null || options.unionid == null || options.unionid == '' || options.unionid == undefined) { // if (options == null || options.unionid == null || options.unionid == '' || options.unionid == undefined) {
if (this.$wechat.isWechat()) { // if (this.$wechat.isWechat()) {
//weixin // //weixin
that.$util.getUser(that, 'person', '', ''); // that.$util.getUser(that, 'person', '', '');
} else { // } else {
switch (uni.getSystemInfoSync().platform) { // switch (uni.getSystemInfoSync().platform) {
case 'android': // case 'android':
// // //
var that = this; // var that = this;
this.$util.bindGpsObj(that); // this.$util.bindGpsObj(that);
Android.gotoDetial('WxUserInfo', ''); // Android.gotoDetial('WxUserInfo', '');
break; // break;
case 'ios': // case 'ios':
//ios // //ios
var that = this; // var that = this;
this.$util.bindGpsObj(that); // this.$util.bindGpsObj(that);
window.location.href = 'https://www.baidu.com?url=wechat'; // window.location.href = 'https://www.baidu.com?url=wechat';
break; // break;
} // }
} // }
} else { // } else {
// clearTimeout(timer); // // clearTimeout(timer);
// // //
uni.setStorageSync('oauthTime', new Date().getTime()); // uni.setStorageSync('oauthTime', new Date().getTime());
uni.setStorageSync('nickname', aes.aesMinEncrypt(options.nickname)); // uni.setStorageSync('nickname', aes.aesMinEncrypt(options.nickname));
uni.setStorageSync('openid', aes.aesMinEncrypt(options.openid)); // uni.setStorageSync('openid', aes.aesMinEncrypt(options.openid));
uni.setStorageSync('unionid', aes.aesMinEncrypt(options.unionid)); // uni.setStorageSync('unionid', aes.aesMinEncrypt(options.unionid));
uni.setStorageSync('headimgurl', aes.aesMinEncrypt(options.headimgurl)); // uni.setStorageSync('headimgurl', aes.aesMinEncrypt(options.headimgurl));
that.nickname = aes.aesDecrypt(uni.getStorageSync('nickname')); // that.nickname = aes.aesDecrypt(uni.getStorageSync('nickname'));
that.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl')); // that.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl'));
that.isLogin = true; // that.isLogin = true;
that.getUserInterest(); // // that.getUserInterest(); //
// this.$util.getUserInfo(that,options.unionid,function(){ // // this.$util.getUserInfo(that,options.unionid,function(){
uni.hideLoading(); // uni.hideLoading();
// }); // // });
} // }
} else { // } else {
// if(uni.getStorageSync("user_token") == undefined || uni.getStorageSync("user_token") == null || uni.getStorageSync("user_token") == ""){ // // if(uni.getStorageSync("user_token") == undefined || uni.getStorageSync("user_token") == null || uni.getStorageSync("user_token") == ""){
// this.$util.getUserInfo(that,uni.getStorageSync("unionid"),function(){ // // this.$util.getUserInfo(that,uni.getStorageSync("unionid"),function(){
// that.isLogin = true; // // that.isLogin = true;
// that.nickname = uni.getStorageSync("nickname"); // // that.nickname = uni.getStorageSync("nickname");
// that.headimgurl = uni.getStorageSync("headimgurl"); // // that.headimgurl = uni.getStorageSync("headimgurl");
// uni.hideLoading(); // // uni.hideLoading();
// }); // // });
// }else{ // // }else{
this.isLogin = true; // this.isLogin = true;
this.nickname = aes.aesDecrypt(uni.getStorageSync('nickname')); // this.nickname = aes.aesDecrypt(uni.getStorageSync('nickname'));
this.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl')); // this.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl'));
that.getUserInterest(); // // that.getUserInterest(); //
that.getAndroidUserKey(); // // that.getAndroidUserKey(); //
uni.hideLoading(); // uni.hideLoading();
// } // // }
} // }
}, },
methods: { methods: {
saveLoginLog: function (unionid) { saveLoginLog: function (unionid) {
@ -215,7 +214,7 @@ export default {
} }
}); });
}, },
/* 是否显示投诉功能 */ /* 是否显示投诉功能 */
getIsShow: function () { getIsShow: function () {
this.$Request.post(this.$config.getYbsjSysParam, {}).then((res) => { this.$Request.post(this.$config.getYbsjSysParam, {}).then((res) => {
var d = res.data; var d = res.data;
@ -224,60 +223,61 @@ export default {
}, },
oauthUser: function () { oauthUser: function () {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
wx.login({ // wx.login({
success:(res) => { // success:(res) => {
console.log(res,'登录获取的code') // console.log(res,'code')
this.code = res.code; // this.code = res.code;
wx.request({ // wx.request({
url:"https://api.weixin.qq.com/sns/jscode2session?appid=wxaf70a5cd03b06c19&secret=7ae3b6e164593cf30acfd3f5b8cbea0c&js_code="+this.code+"&grant_type=authorization_code", // url:"https://api.weixin.qq.com/sns/jscode2session?appid=wx111bbea67d1b06d5&secret=5d5a1ac827c9eab437a90927ebb8a47d&js_code="+this.code+"&grant_type=authorization_code",
success:function(res){ // success:function(res){
console.log(res) // console.log(res)
}, // },
fail: function(err){ // fail: function(err){
console.log(err)//App.json60 // console.log(err)//App.json60
} // }
}) // })
console.log(this.code,res); // console.log(this.code,res);
}, // },
fail: function (error) { // fail: function (error) {
console.log('login failed ' + error); // console.log('login failed ' + error);
} // }
}); // });
wx.getUserProfile({ // wx.getUserProfile({
desc: '用于完善会员资料', // desc: '',
success:(res) => { // success:(res) => {
console.log(this.code,res); // console.log(this.code,res);
}, // },
fail: function (error) { // fail: function (error) {
console.log('login failed ' + error); // console.log('login failed ' + error);
} // }
}) // })
wx.getUserInfo({ // wx.getUserInfo({
provider: 'weixin', // provider: 'weixin',
success:(res) => { // success:(res) => {
console.log(this.code,res); // console.log(this.code,res);
}, // },
fail: function (error) { // fail: function (error) {
console.log('login failed ' + error); // console.log('login failed ' + error);
} // }
}) // })
uni.login({ // uni.login({
"provider": "weixin", // "provider": "weixin",
"onlyAuthorize": true, // // "onlyAuthorize": true, //
success: function(event){ // success: function(event){
console.log(event) // console.log(event)
//code, // //code,
}, // },
fail: function (err) { // fail: function (err) {
// // //
// err.code // // err.code
} // }
}) // })
that.$util.getUser(that, 'person', '', ''); // that.$util.getUser(that, 'person', '', '');
// #endif // #endif
// #ifndef MP-WEIXIN // #ifdef MP-WEIXIN
if (this.isLogin) { let this_ = this;
if (this_.isLogin) {
return; return;
} else { } else {
uni.showLoading({ uni.showLoading({
@ -285,34 +285,54 @@ export default {
title: '授权中', title: '授权中',
success() { success() {
setTimeout(function () { setTimeout(function () {
wx.login({
success: (res) => {
console.log(res, '登录获取的code');
this.code = res.code;
wx.request({
url:
'https://api.weixin.qq.com/sns/jscode2session?appid=wx111bbea67d1b06d5&secret=5d5a1ac827c9eab437a90927ebb8a47d&js_code=' +
this.code +
'&grant_type=authorization_code',
success: function (res) {
console.log(res);
uni.setStorageSync('unionid', aes.aesMinEncrypt(res.data.openid));
},
fail: function (err) {
console.log(err); //App.json60
}
});
console.log(this.code, res);
},
fail: function (error) {
console.log('login failed ' + error);
}
});
wx.getUserInfo({
provider: 'weixin',
success: (res) => {
console.log(this.code, res);
uni.setStorageSync('nickname', aes.aesMinEncrypt(res.userInfo.nickName));
uni.setStorageSync('headimgurl', aes.aesMinEncrypt(res.userInfo.avatarUrl));
uni.setStorageSync('oauthTime', new Date().getTime());
this_.nickName = res.userInfo.nickName;
this_.headimgurl = res.userInfo.avatarUrl;
},
fail: function (error) {
console.log('login failed ' + error);
}
});
// uni.showToast({ // uni.showToast({
// title:","+that.nickname+"", // title:","+that.nickname+"",
// icon:"none", // icon:"none",
// duration: 1500 // duration: 1500
// }) // })
this_.isLogin = true;
this_.$forceUpdate()
uni.hideLoading(); uni.hideLoading();
}, 3000); }, 3000);
} }
}); });
if (this.$wechat.isWechat()) {
//weixin
that.$util.getUser(this, 'person', '', '');
} else {
switch (uni.getSystemInfoSync().platform) {
case 'android':
//
var that = this;
this.$util.bindGpsObj(that);
Android.gotoDetial('WxUserInfo', '');
break;
case 'ios':
//ios
var that = this;
this.$util.bindGpsObj(that);
window.location.href = 'https://www.baidu.com?url=wechat';
break;
}
}
} }
// #endif // #endif
@ -332,39 +352,41 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: '/pages/personcenter/aboutus' url: '/pages/personcenter/aboutus'
}); });
} else if (obj == 'yuyue') { } else if (obj == 'yuyue') {
// if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) { if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) {
// uni.showToast({ uni.showToast({
// title: '', title: '请先授权',
// icon: 'none' icon: 'none'
// }); });
// return; return;
// } }
uni.navigateTo({ uni.navigateTo({
url: '/sunPackIndex/scenic/subscribe/yuyue/yue_list_js' url: '/sunPackIndex/scenic/subscribe/yuyue/yue_list_js'
}); });
} else if (obj == 'tousu') { } else if (obj == 'tousu') {
// if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) { if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) {
// uni.showToast({ uni.showToast({
// title: '', title: '请先授权',
// icon: 'none' icon: 'none'
// }); });
// return; return;
// } }
uni.navigateTo({ uni.navigateTo({
url: '/pages/suggest/sug_list' url: '/pages/suggest/sug_list'
}); });
} else if (obj == 'myReserve') { } else if (obj == 'myReserve') {
/* if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) { if (this.$util.isBlack(aes.aesDecrypt(uni.getStorageSync('unionid')))) {
uni.showToast({ uni.showToast({
title: '请先授权', title: '请先授权',
icon: 'none' icon: 'none'
}); });
return; return;
} */ }
console.log('90909090')
uni.navigateTo({ uni.navigateTo({
url: '/pages/myReserve/myReserve' url: '/pages/myReserve/myResesrve'
}); });
console.log('jjijsdjifi')
} else if (obj == 'admin') { } else if (obj == 'admin') {
uni.navigateTo({ uni.navigateTo({
url: '/pages/personcenter/adminLogin/adminLogin' url: '/pages/personcenter/adminLogin/adminLogin'
@ -391,8 +413,8 @@ export default {
uni.removeStorageSync('oauthTime'); uni.removeStorageSync('oauthTime');
uni.removeStorageSync('openid'); uni.removeStorageSync('openid');
uni.removeStorageSync('unionid'); uni.removeStorageSync('unionid');
this.nickname = "点击头像授权"; this.nickname = '点击头像授权';
this.headimgurl = "../../static/images/adm_img.png"; this.headimgurl = '../../static/images/adm_img.png';
this.isLogin = false; this.isLogin = false;
} }
} else if (obj == 'myComment') { } else if (obj == 'myComment') {
@ -408,39 +430,43 @@ export default {
}); });
} else if (obj == 'delete') { } else if (obj == 'delete') {
var that = this; var that = this;
uni.showModal({ if (that.isLogin == true) {
title: '提示', uni.showModal({
icon: 'none', title: '提示',
content:"该操作将会清空所有用户数据!是否注销账户", icon: 'none',
success: function (res) { content: '该操作将会清空所有用户数据!是否注销账户',
if (res.confirm) { success: function (res) {
that.deleteUserApp(); if (res.confirm) {
this.scenicGZType = 'NO', that.deleteUserApp();
this.lineGZType = 'NO', (this.scenicGZType = 'NO'), (this.lineGZType = 'NO'), (this.foodGZType = 'NO'), (this.methodGZType = 'NO'), uni.removeStorageSync('nickname');
this.foodGZType = 'NO', uni.removeStorageSync('headimgurl');
this.methodGZType = 'NO', uni.removeStorageSync('oauthTime');
uni.removeStorageSync('nickname'); uni.removeStorageSync('openid');
uni.removeStorageSync('headimgurl'); uni.removeStorageSync('unionid');
uni.removeStorageSync('oauthTime'); that.nickname = '点击头像授权';
uni.removeStorageSync('openid'); that.headimgurl = '../../static/images/adm_img.png';
uni.removeStorageSync('unionid'); that.isLogin = false;
this.nickname = "点击头像授权"; } else if (res.cancel) {
this.headimgurl = "../../static/images/adm_img.png"; }
this.isLogin = false;
} else if (res.cancel) {
} }
} });
}); }else{
uni.showToast({
title: '您还未登录!',
icon: 'none'
});
return;
}
} }
}, },
getUserInterest: function () { getUserInterest: function () {
var that = this; var that = this;
var data = { var data = {
userid: aes.aesDecrypt(uni.getStorageSync('unionid')), userid: aes.aesDecrypt(uni.getStorageSync('unionid')),
userkey: this.$param.userkey userkey: this.$param.userkey
//userid: "2" //userid: "2"
}; };
this.$Request.post(this.$config.getUserInterest, data).then(res => { this.$Request.post(this.$config.getUserInterest, data).then((res) => {
var data = res.data; var data = res.data;
that.scenicGZType = data.scenic_isShow; that.scenicGZType = data.scenic_isShow;
that.lineGZType = data.line_isShow; that.lineGZType = data.line_isShow;
@ -466,9 +492,9 @@ export default {
userid: aes.aesDecrypt(uni.getStorageSync('unionid')), userid: aes.aesDecrypt(uni.getStorageSync('unionid')),
userkey: this.$param.userkey userkey: this.$param.userkey
}; };
this.$Request.post(this.$config.deleteUserApp, data).then(res => { this.$Request.post(this.$config.deleteUserApp, data).then((res) => {
uni.showToast({ uni.showToast({
title: "注销成功!", title: '注销成功!',
duration: 2000 duration: 2000
}); });
}); });
@ -500,9 +526,9 @@ export default {
userid: aes.aesDecrypt(uni.getStorageSync('unionid')), userid: aes.aesDecrypt(uni.getStorageSync('unionid')),
pageType: '' pageType: ''
}; };
this.$Request.post(this.$config.imgPushFun, data).then(res => {}); this.$Request.post(this.$config.imgPushFun, data).then((res) => {});
} }
}, }
} }
}; };
</script> </script>

@ -5,8 +5,8 @@
<view class="sug_form_line"> <view class="sug_form_line">
<view class="sug_dly_flex"> <view class="sug_dly_flex">
<view class="sug_sgu">事故发生地<text class="chel_t_s">(必填)</text></view> <view class="sug_sgu">事故发生地<text class="chel_t_s">(必填)</text></view>
<view @tap="getLocation()" class="sug_r"> <view class="sug_r">
<view class="sug_dwei">当前位置<text>></text></view> <view @click="getLocation()" class="sug_dwei">当前位置</view>
</view> </view>
</view> </view>
<view> <view>
@ -43,7 +43,7 @@
<view class="sug_form_line"> <view class="sug_form_line">
<view class="sug_dly_flex" > <view class="sug_dly_flex" >
<view class="sug_sgu">上传证据</view> <view class="sug_sgu">上传证据</view>
</view> </view>
<view class="sug_dly_flex sug_lst_img sug_fm_img"> <view class="sug_dly_flex sug_lst_img sug_fm_img">
<view class="w_33" v-for="(item,index) in pics" :key="index"> <view class="w_33" v-for="(item,index) in pics" :key="index">
@ -85,7 +85,7 @@
</view> --> </view> -->
</view> </view>
</view> </view>
</view> </view>
<view class="mode_com "> <view class="mode_com ">
<view class="sug_form_line"> <view class="sug_form_line">
@ -95,11 +95,11 @@
<input type="text" name="lineuser" @input="inputVerify" :value="lineuser" placeholder="请输入姓名" class="ipt_sug" /> <input type="text" name="lineuser" @input="inputVerify" :value="lineuser" placeholder="请输入姓名" class="ipt_sug" />
<!-- <view class="btn_del_sug"><image src="../../static/images/del_2.png" mode="aspectFill" class="kou_top3"></image></view> --> <!-- <view class="btn_del_sug"><image src="../../static/images/del_2.png" mode="aspectFill" class="kou_top3"></image></view> -->
</view> </view>
</view> </view>
</view> </view>
<view class="sug_form_line"> <view class="sug_form_line">
<view class="sug_dly_flex sub_lxir"> <view class="sug_dly_flex sub_lxir">
<text style="color: #ff0000;">*</text><view class="sug_sgu">联系方式</view> <text style="color: #ff0000;">*</text><view class="sug_sgu">联系方式</view>
@ -107,11 +107,11 @@
<input type="number" name="linemobile" placeholder="请输入手机号码" class="ipt_sug" /> <input type="number" name="linemobile" placeholder="请输入手机号码" class="ipt_sug" />
<!-- <view class="btn_baoh_sug"><image src="../../static/images/icn_baoh.png" mode="aspectFill" class="kou_top3"></image><text>保护中</text></view> --> <!-- <view class="btn_baoh_sug"><image src="../../static/images/icn_baoh.png" mode="aspectFill" class="kou_top3"></image><text>保护中</text></view> -->
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="blk_2"></view> <view class="blk_2"></view>
<view class="sug_fied"> <view class="sug_fied">
@ -141,7 +141,7 @@
var value = e.detail.value var value = e.detail.value
if(value == ""){ if(value == ""){
return; return;
} }
if(!value.match("^[a-zA-Z0-9_\u4e00-\u9fa5]+$")){ if(!value.match("^[a-zA-Z0-9_\u4e00-\u9fa5]+$")){
uni.showToast({ uni.showToast({
icon:"none", icon:"none",
@ -185,7 +185,7 @@
return; return;
} }
} }
if(e.detail.value.creason.length == 0){ if(e.detail.value.creason.length == 0){
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
@ -201,7 +201,7 @@
return; return;
} }
} }
if(e.detail.value.lineuser.length==0){ if(e.detail.value.lineuser.length==0){
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
@ -259,7 +259,7 @@
} }
}); });
}, },
beforeUpload: function(){ beforeUpload: function(){
var that = this; var that = this;
var url = this.$config.getMessageInfoFormFilter; var url = this.$config.getMessageInfoFormFilter;
@ -333,7 +333,7 @@
var that = this; var that = this;
var pics = that.pics; var pics = that.pics;
if(pics.length < 9){ if(pics.length < 9){
uni.chooseImage({ uni.chooseImage({
count: 9, // 9 count: 9, // 9
sizeType: ['original','compressed'], // original compressed sizeType: ['original','compressed'], // original compressed
@ -392,30 +392,17 @@
title: "定位中", title: "定位中",
mask: true mask: true
}) })
this.$util.bindGpsObj(that); uni.getLocation({
this.$util.getLocation( type: 'gcj02',
function(res) { altitude:true,
if (that.$wechat.isWechat()) { success: function (res) {
that.latitude = res.latitude; console.log('当前位置的经度:' + res.longitude);
that.longitude = res.longitude; console.log('当前位置的纬度:' + res.latitude);
} that.address = res.longitude+','+res.latitude;
var data = {
lat: that.latitude,
lng: that.longitude,
poi:"0",
key:"Z2IBZ-6BRKG-Z52QT-IU3J2-6P3QO-WIBII"
}
that.$Request.post(that.$config.getAddressByLatLng,data).then(res => {
if(res.status == 0){
that.address = res.result.address;
}
});
uni.hideLoading(); uni.hideLoading();
}, },
function() {
console.log('location error---'); });
}
);
}, },
callGpsSuccess: function(lat, lng){ callGpsSuccess: function(lat, lng){
var that = this; var that = this;

Loading…
Cancel
Save