添加截流,昵称表情处理,投诉刷新

dev
Tuzki 2 years ago
parent 87c8b4f6f7
commit 647d199939
  1. 213
      common/util.js
  2. 51
      pages/personcenter/EditProfile/EditProfile.vue
  3. 208
      pages/personcenter/personcenter.vue
  4. 18
      sunPackIndex/scenic/subscribe/yuyue/yue_form_js.vue
  5. 4
      sunPackIndex/suggest/sug_list.vue

@ -21,21 +21,21 @@ module.exports = {
// }) // })
this.gpsObject = null; this.gpsObject = null;
}, },
getNetworkType:function(successCallbck,failCallback){ getNetworkType: function(successCallbck, failCallback) {
uni.getNetworkType({ uni.getNetworkType({
success: function (res) { success: function(res) {
if (successCallbck) { if (successCallbck) {
successCallbck(res); successCallbck(res);
} }
}, },
fail:function(){ fail: function() {
if (failCallback) { if (failCallback) {
failCallback(res); failCallback(res);
} }
} }
}); });
}, },
hideLoadingByTime:function(){ hideLoadingByTime: function() {
setTimeout(function() { setTimeout(function() {
uni.hideLoading(); uni.hideLoading();
}, 10000); }, 10000);
@ -60,9 +60,9 @@ module.exports = {
param.clng = param.lng; param.clng = param.lng;
if (this.gpsObject) { if (this.gpsObject) {
uni.showToast({ uni.showToast({
title:"为了您的良好体验请打开GPS功能", title: "为了您的良好体验请打开GPS功能",
icon:"none", icon: "none",
duration:2000 duration: 2000
}) })
this.gpsObject.callGpsFail(); this.gpsObject.callGpsFail();
} }
@ -83,16 +83,16 @@ module.exports = {
if (this.gpsObject) { if (this.gpsObject) {
uni.showToast({ uni.showToast({
title:"为了您的良好体验请打开GPS功能", title: "为了您的良好体验请打开GPS功能",
icon:"none", icon: "none",
duration:2000 duration: 2000
}) })
this.gpsObject.callGpsFail(); this.gpsObject.callGpsFail();
} }
} }
}, },
//获取安卓内容 //获取安卓内容
getAndroidData: function(code,mes,type,data){ getAndroidData: function(code, mes, type, data) {
/* mes += "---------"+type+"-------"+code+"------"+data; /* mes += "---------"+type+"-------"+code+"------"+data;
uni.showModal({ uni.showModal({
title:"提示", title:"提示",
@ -102,7 +102,7 @@ module.exports = {
} }
}) */ }) */
if (code == "200") { if (code == "200") {
if(type == "WxUserInfo"){ if (type == "WxUserInfo") {
var wx_data = JSON.parse(data); var wx_data = JSON.parse(data);
// var unionid = "oaxUrw1nI4vDQ1ihKWlrDWIXHea0"; // var unionid = "oaxUrw1nI4vDQ1ihKWlrDWIXHea0";
// uni.setStorageSync("unionid","oaxUrw1nI4vDQ1ihKWlrDWIXHea0"); // uni.setStorageSync("unionid","oaxUrw1nI4vDQ1ihKWlrDWIXHea0");
@ -111,54 +111,54 @@ module.exports = {
// uni.setStorageSync("headimgurl","http://thirdwx.qlogo.cn/mmopen/vi_32/0sUibCSJ47ia4mjIib7Xs2MTVxdMyr7jhq1kj0PDnuHOd5vUbibn7MrGekMqfFjUWXLGPZurvRlKRyZc5awpA1Sa7g/132"); // uni.setStorageSync("headimgurl","http://thirdwx.qlogo.cn/mmopen/vi_32/0sUibCSJ47ia4mjIib7Xs2MTVxdMyr7jhq1kj0PDnuHOd5vUbibn7MrGekMqfFjUWXLGPZurvRlKRyZc5awpA1Sa7g/132");
var unionid = wx_data.unionid; var unionid = wx_data.unionid;
var url = wx_data.headimgurl; var url = wx_data.headimgurl;
url = url.substring(url.indexOf(":")+1); url = url.substring(url.indexOf(":") + 1);
uni.setStorageSync("oauthTime",new Date().getTime()) uni.setStorageSync("oauthTime", new Date().getTime())
uni.setStorageSync("unionid",aes.aesMinEncrypt(unionid)); uni.setStorageSync("unionid", aes.aesMinEncrypt(unionid));
uni.setStorageSync("openid",aes.aesMinEncrypt(wx_data.openid)); uni.setStorageSync("openid", aes.aesMinEncrypt(wx_data.openid));
uni.setStorageSync("nickname",aes.aesMinEncrypt(wx_data.nickname)); uni.setStorageSync("nickname", aes.aesMinEncrypt(wx_data.nickname));
uni.setStorageSync("headimgurl",aes.aesMinEncrypt(url)); uni.setStorageSync("headimgurl", aes.aesMinEncrypt(url));
var that = this.gpsObject; var that = this.gpsObject;
wx_data.headimgurl = url; wx_data.headimgurl = url;
data = JSON.stringify(wx_data); data = JSON.stringify(wx_data);
//Android //Android
// this.getUserInfo(that,unionid,function(){ // this.getUserInfo(that,unionid,function(){
that.$util.saveWxUser(that,data); that.$util.saveWxUser(that, data);
that.callBackMethod(); that.callBackMethod();
// }); // });
}else if(type == "DEVICEID"){ } else if (type == "DEVICEID") {
this.gpsObject.imgPushTest(data); this.gpsObject.imgPushTest(data);
}else if(type == "GetVersionInfo"){ } else if (type == "GetVersionInfo") {
this.gpsObject.version = data; this.gpsObject.version = data;
}else if(type == "QRCODE"){ } else if (type == "QRCODE") {
if(data.indexOf("userid") == 1){ if (data.indexOf("userid") == 1) {
uni.showToast({ uni.showToast({
title:"二维码错误", title: "二维码错误",
mask:true, mask: true,
icon:"none" icon: "none"
}) })
return; return;
} }
var map = JSON.parse(data); var map = JSON.parse(data);
var userid= map.userid; var userid = map.userid;
//扫码结果 //扫码结果
uni.navigateTo({ uni.navigateTo({
url:"/sunPackIndex/scenic/subscribe/qrcode/reserve_detail_2?userid="+userid url: "/sunPackIndex/scenic/subscribe/qrcode/reserve_detail_2?userid=" + userid
}) })
} }
}else if(code == "0" && mes == "未安装微信_小程序跳转"){ } else if (code == "0" && mes == "未安装微信_小程序跳转") {
uni.navigateTo({ uni.navigateTo({
url:"/sunPackIndex/scenic/subscribe/yuyue/yue_list_js" url: "/sunPackIndex/scenic/subscribe/yuyue/yue_list_js"
}) })
}else if(code == "0" && mes == "未安装微信_授权登陆"){ } else if (code == "0" && mes == "未安装微信_授权登陆") {
uni.navigateTo({ uni.navigateTo({
url:"/pages/index/an_login/an_login" url: "/pages/index/an_login/an_login"
}) })
}else{ } else {
if(!mes == '失败'){ if (!mes == '失败') {
uni.showToast({ uni.showToast({
title:mes, title: mes,
icon:"none", icon: "none",
duration:2000 duration: 2000
}) })
} }
} }
@ -224,7 +224,7 @@ module.exports = {
break; break;
case 'ios': case 'ios':
console.log('运行iOS上') console.log('运行iOS上')
window.location.href="https://www.baidu.com"; window.location.href = "https://www.baidu.com";
break; break;
default: default:
@ -232,28 +232,28 @@ module.exports = {
} }
} }
}, },
getUser: function(that,obj,value,guid){ getUser: function(that, obj, value, guid) {
console.log(obj,) console.log(obj, )
var url = that.$config.getOauthWxUser + "?type="+obj+"&value="+value+"&guid="+guid; var url = that.$config.getOauthWxUser + "?type=" + obj + "&value=" + value + "&guid=" + guid;
console.log(url) console.log(url)
window.location.href= url; window.location.href = url;
}, },
getUserInfo: function(that,unionid,successCallMethod){ getUserInfo: function(that, unionid, successCallMethod) {
var method = "LoginUN"; var method = "LoginUN";
var sendData = { var sendData = {
"api_token":that.$md5.hexMD5("API"+method+"lvyou"), "api_token": that.$md5.hexMD5("API" + method + "lvyou"),
"unionid":unionid "unionid": unionid
} }
var data = { var data = {
"data":JSON.stringify(sendData), "data": JSON.stringify(sendData),
"url": that.$config.LoginUN "url": that.$config.LoginUN
} }
that.$Request.post(that.$config.getAittoData,data).then(res => { that.$Request.post(that.$config.getAittoData, data).then(res => {
if(res.code == 0){ if (res.code == 0) {
uni.setStorageSync("user_token",aes.aesMinEncrypt(res.data.user_token)); uni.setStorageSync("user_token", aes.aesMinEncrypt(res.data.user_token));
uni.setStorageSync("user_info",res.data.userInfo); uni.setStorageSync("user_info", res.data.userInfo);
successCallMethod(); successCallMethod();
}else{ } else {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: res.msg title: res.msg
@ -261,26 +261,26 @@ module.exports = {
} }
}) })
}, },
saveWxUser: function(that,obj){ saveWxUser: function(that, obj) {
var data = { var data = {
"data": obj, "data": obj,
userkey:that.$param.userkey userkey: that.$param.userkey
} }
that.$Request.post(that.$config.saveUser,data).then(res => { that.$Request.post(that.$config.saveUser, data).then(res => {
var flag = that.$util.isSuccess(res); var flag = that.$util.isSuccess(res);
if (!flag) { if (!flag) {
return; return;
} }
var userid = res.data; var userid = res.data;
uni.setStorageSync("userid",aes.aesMinEncrypt(userid)); uni.setStorageSync("userid", aes.aesMinEncrypt(userid));
}) })
}, },
pay:function(obj,successCallbck){ pay: function(obj, successCallbck) {
//是否在微信 //是否在微信
if (wechat.isWechat()) { if (wechat.isWechat()) {
wechat.pay(obj,successCallbck); wechat.pay(obj, successCallbck);
} else { } else {
} }
}, },
setLocation: function(lng, lat) { setLocation: function(lng, lat) {
@ -307,9 +307,9 @@ module.exports = {
}, },
getCurrentTime3: function() { getCurrentTime3: function() {
let yyyy = new Date().getFullYear(); let yyyy = new Date().getFullYear();
let mm = new Date().getMonth() + 1 < 10? '0' + (new Date().getMonth()+ 1) : new Date().getMonth()+ 1; let mm = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1;
let dd = new Date().getDate() < 10? '0' + new Date().getDate() : new Date().getDate(); let dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate();
let hh = new Date().getHours() < 10? '0' + new Date().getHours() : new Date().getHours(); let hh = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours();
let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes(); let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes();
let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds(); let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds();
return yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf; return yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf;
@ -328,7 +328,7 @@ module.exports = {
case 'ios': case 'ios':
console.log('运行iOS上'); console.log('运行iOS上');
// successCallbck(""); // successCallbck("");
window.location.href="https://www.baidu.com"; window.location.href = "https://www.baidu.com";
// this.$bridge.callHandler('getLocation', {}, function(response) { // this.$bridge.callHandler('getLocation', {}, function(response) {
// console.log('运行iOS上11'); // console.log('运行iOS上11');
// log('JS got response', response); // log('JS got response', response);
@ -440,22 +440,22 @@ module.exports = {
let dd = new Date().getDate(); let dd = new Date().getDate();
return yyyy + '-' + mm + '-' + dd; return yyyy + '-' + mm + '-' + dd;
}, },
isBlack: function(obj){ isBlack: function(obj) {
return obj == undefined || obj == null || obj == ""; return obj == undefined || obj == null || obj == "";
}, },
isSuccess: function(res){ isSuccess: function(res) {
if(res.status == 200){ if (res.status == 200) {
return true; return true;
}else if(res.status == 400){ } else if (res.status == 400) {
uni.showToast({ uni.showToast({
title:res.msg, title: res.msg,
icon:"none" icon: "none"
}) })
return false; return false;
}else if(res.status == 500){ } else if (res.status == 500) {
uni.showToast({ uni.showToast({
title:res.msg, title: res.msg,
icon:"none" icon: "none"
}) })
return false; return false;
} }
@ -473,20 +473,20 @@ module.exports = {
美食 美食
如果usertype=SCENIC等其他值时usefun为对应数据的主键id 如果usertype=SCENIC等其他值时usefun为对应数据的主键id
*/ */
saveOperatorLog: function(that,usertype,usefun){ saveOperatorLog: function(that, usertype, usefun) {
var data = { var data = {
"unionid":aes.aesDecrypt(uni.getStorageSync("unionid")), "unionid": aes.aesDecrypt(uni.getStorageSync("unionid")),
"userkey":that.$param.userkey, "userkey": that.$param.userkey,
"usertype": usertype, "usertype": usertype,
"usefun":usefun "usefun": usefun
} }
that.$Request.post(that.$config.saveOperatorLog,data).then(res => { that.$Request.post(that.$config.saveOperatorLog, data).then(res => {
if(res.code == 200){ if (res.code == 200) {
console.log("保存日志成功") console.log("保存日志成功")
} }
}) })
}, },
convertDateFromString: function (dateString) { convertDateFromString: function(dateString) {
var ddd = new Date(dateString); var ddd = new Date(dateString);
return ddd; return ddd;
}, },
@ -496,5 +496,50 @@ module.exports = {
return true; return true;
} }
return false; return false;
},
// 表情转码
utf16toEntities(str) {
const patt = /[\ud800-\udbff][\udc00-\udfff]/g; // 检测utf16字符正则
str = str.replace(patt, (char) => {
let H;
let L;
let code;
let s;
if (char.length === 2) {
H = char.charCodeAt(0); // 取出高位
L = char.charCodeAt(1); // 取出低位
code = (H - 0xD800) * 0x400 + 0x10000 + L - 0xDC00; // 转换算法
s = `&#${code};`;
} else {
s = char;
}
return s;
});
return str;
},
// 表情解码
entitiestoUtf16(strObj) {
const patt = /&#\d+;/g;
const arr = strObj.match(patt) || [];
let H;
let L;
let code;
for (let i = 0; i < arr.length; i += 1) {
code = arr[i];
code = code.replace('&#', '').replace(';', '');
// 高位
H = Math.floor((code - 0x10000) / 0x400) + 0xD800;
// 低位
L = ((code - 0x10000) % 0x400) + 0xDC00;
code = `&#${code};`;
const s = String.fromCharCode(H, L);
strObj = strObj.replace(code, s);
}
return strObj;
} }
} }

@ -13,7 +13,7 @@
<view class="demo-uni-col dark">昵称</view> <view class="demo-uni-col dark">昵称</view>
<view class="demo-uni-col light"> <view class="demo-uni-col light">
<input type="nickname" v-model="username" @blur="blurname" class="nickname" placeholder="请输入昵称" /> <input type="nickname" v-model="usernames" @blur="blurname" class="nickname" placeholder="请输入昵称" />
</view> </view>
</uni-row> </uni-row>
@ -26,19 +26,21 @@ export default {
data() { data() {
return { return {
username: '', username: '',
usernames: '',
url: '', url: '',
pic:'', pic: ''
}; };
}, },
onShow() { onShow() {
let this_ = this; let this_ = this;
console.log(uni.getStorageSync('nickname'), uni.getStorageSync('headimgurl')); console.log(uni.getStorageSync('nickname'), uni.getStorageSync('headimgurl'));
this_.username = uni.getStorageSync('nickname'); this_.username = uni.getStorageSync('nickname');
this_.usernames = this_.$util.entitiestoUtf16(this_.username);
this_.url = uni.getStorageSync('headimgurl'); this_.url = uni.getStorageSync('headimgurl');
}, },
methods: { methods: {
onChooseAvatar(e) { onChooseAvatar(e) {
console.log(e) console.log(e);
let this_ = this; let this_ = this;
const avatarUrl = e.detail.avatarUrl; const avatarUrl = e.detail.avatarUrl;
this_.url = avatarUrl; this_.url = avatarUrl;
@ -47,7 +49,7 @@ export default {
filePath: avatarUrl, filePath: avatarUrl,
name: 'file', name: 'file',
success(res) { success(res) {
console.log(res,'山川了') console.log(res, '山川了');
if (res.statusCode != 200) { if (res.statusCode != 200) {
uni.showToast({ uni.showToast({
title: '上传失败', title: '上传失败',
@ -60,11 +62,11 @@ export default {
return; return;
} }
obj = obj.data; obj = obj.data;
this_.pic = obj.path this_.pic = this_.$config.ROOTPATH + obj.path;
console.log(this_.pic,';') console.log(this_.pic, ';');
}, },
fail(res) { fail(res) {
console.log('失败了',res) console.log('失败了', res);
uni.showToast({ uni.showToast({
title: '上传失败', title: '上传失败',
icon: 'none' icon: 'none'
@ -74,33 +76,37 @@ export default {
}, },
blurname(e) { blurname(e) {
let this_ = this; let this_ = this;
this_.username = e.detail.value; this_.username = this_.$util.utf16toEntities(e.detail.value);
this_.usernames = e.detail.value;
console.log(this_.username, this_.usernames);
}, },
saveProfile() { saveProfile() {
let this_ = this; let this_ = this;
if(this_.pic&&this_.pi!=''){ if (this_.pic && this_.pic != '') {
uni.setStorageSync('headimgurl', this_.$config.ROOTPATH+this_.pic); uni.setStorageSync('headimgurl', this_.pic);
} else {
this_.pic = uni.getStorageSync('headimgurl');
} }
uni.setStorageSync('nickname', this_.username); uni.setStorageSync('nickname', this_.username);
uni.setStorageSync('oauthTime', new Date().getTime()); uni.setStorageSync('oauthTime', new Date().getTime());
const obj = { const obj = {
headimgurl:this_.$config.ROOTPATH+this_.pic, headimgurl: this_.pic,
openid:uni.getStorageSync('unionid'), openid: uni.getStorageSync('unionid'),
nickname:this_.username nickname: this_.username
} };
console.log(obj,'请求参数') console.log(obj, '请求参数');
var data = { var data = {
"data": JSON.stringify(obj), data: JSON.stringify(obj),
userkey:this_.$param.userkey userkey: this_.$param.userkey
} };
this_.$Request.post(this_.$config.saveUser,data).then(res => { this_.$Request.post(this_.$config.saveUser, data).then((res) => {
var flag = this_.$util.isSuccess(res); var flag = this_.$util.isSuccess(res);
if (!flag) { if (!flag) {
return; return;
} }
var userid = res.data; var userid = res.data;
console.log(userid,'保存返回') console.log(userid, '保存返回');
}) });
uni.showToast({ uni.showToast({
icon: 'success', icon: 'success',
title: '保存成功!', title: '保存成功!',
@ -141,6 +147,9 @@ export default {
.saveBtn { .saveBtn {
width: 70%; width: 70%;
margin: 30rpx auto; margin: 30rpx auto;
position: fixed;
bottom: 3vh;
left: 15%;
} }
.nickname { .nickname {
text-align: right; text-align: right;

@ -15,13 +15,11 @@
</button> --> </button> -->
</view> </view>
</view> </view>
<view class="pes_inf aml_30" > <view class="pes_inf aml_30">
<!-- 用户昵称 --> <!-- 用户昵称 -->
<view class="t_adm_box"> <view class="t_adm_box">
<!-- <text class="t_nic">{{nickname}}阳光夏~小葵</text> -- 已登录状态 显示用户昵称 --> <!-- <text class="t_nic">{{nickname}}阳光夏~小葵</text> -- 已登录状态 显示用户昵称 -->
<text class="t_nic" >{{ nickname }}</text> <text class="t_nic">{{ nicknames }}</text>
<!--登录后 退出按钮-->
<!-- <text v-if="isLogin" class="pes_img_tc" @tap="jump('logoutWechat')">退出</text> -->
</view> </view>
<!-- <input type="nickname" @blur="saveName" class="weui-input" placeholder="请输入昵称"/> --> <!-- <input type="nickname" @blur="saveName" class="weui-input" placeholder="请输入昵称"/> -->
</view> </view>
@ -66,40 +64,7 @@
</view> </view>
</view> </view>
</view> </view>
<view> <view></view>
<!-- 普通弹窗 -->
<!-- <uni-popup ref="popup" background-color="#fff" >
<view class="w100 fx-box">
<view class="f-32 color-01 fw-700 flex-c-c">
设置头像和昵称
</view>
<view class="m-t-40">
<view class="flex w00">
<view class="flex-al-c w100 f-28">
<view class="w30 tx-tt">设置头像</view>
<view class="w70">
<button open-type="chooseAvatar" @chooseavatar='onChooseAvatar' class="f-24 wh-106 color-01 m-t-10 tx-btn"
>
<image class="wh-106s" :src="url" mode="scaleToFill"></image>
</button>
</view>
</view>
</view>
<view class="flex-c-c flex-column m-t-40 tx-nc">
<view class="flex-al-c w100 f-28">
<view class="w30 ">设置昵称</view>
<input class="w70" type="nickname" @blur="blurname" v-model="username" placeholder="请输入昵称">
</view>
</button>
</view>
</view>
<view class="flex-c-c tx-sz" @click='conserved'>
<view style="background: #0081f5;width: 300rpx;color: #fff;" class="padd-12 bor-r-10 flex-c-c m-t-40">设置</view>
</view>
</view>
</uni-popup> -->
</view>
<!-- 兴趣定制 --> <!-- 兴趣定制 -->
<!-- 工具栏 --> <!-- 工具栏 -->
@ -115,10 +80,11 @@ export default {
that = this; that = this;
return { return {
avatarUrl: '', avatarUrl: '',
url:'', url: '',
username:'', username: '',
headimgurl: '../../static/images/adm_img.png', headimgurl: '',
nickname: '点击授权', nickname: '点击授权',
nicknames: '点击授权',
isUpdate: true, isUpdate: true,
isLogin: false, isLogin: false,
isShowOnlinets: 'NO', isShowOnlinets: 'NO',
@ -142,11 +108,12 @@ export default {
onShow() { onShow() {
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) {
this.isLogin = false; this.isLogin = false;
this.headimgurl = '' this.headimgurl = '';
}else{ } else {
this.nickname = uni.getStorageSync('nickname') this.nickname = uni.getStorageSync('nickname');
this.headimgurl = uni.getStorageSync('headimgurl') this.nicknames = this.$util.entitiestoUtf16(this.nickname);
this.isLogin = true this.headimgurl = uni.getStorageSync('headimgurl');
this.isLogin = true;
} }
}, },
onLoad(options) { onLoad(options) {
@ -158,19 +125,6 @@ export default {
} }
}, },
methods: { methods: {
conserved(e){
console.log(e,'难定')
let this_ = this;
setTimeout(() => {
this_.headimgurl = this_.url;
this_.nickname = this_.username;
uni.setStorageSync('nickname', this_.username);
uni.setStorageSync('headimgurl', this_.url);
uni.setStorageSync('oauthTime', new Date().getTime());
this.$refs.popup.close()
}, 1000)
},
changean(type) { changean(type) {
let this_ = this; let this_ = this;
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) {
@ -181,8 +135,8 @@ export default {
return; return;
} else { } else {
uni.navigateTo({ uni.navigateTo({
url:'/pages/personcenter/EditProfile/EditProfile' url: '/pages/personcenter/EditProfile/EditProfile'
}) });
// this.type = type // this.type = type
// this_.url = this.headimgurl // this_.url = this.headimgurl
// this_.username = this.nickname // this_.username = this.nickname
@ -206,7 +160,7 @@ export default {
blurname(e) { blurname(e) {
let this_ = this; let this_ = this;
console.log(e); console.log(e);
this_.username = e.detail.value this_.username = e.detail.value;
}, },
saveLoginLog: function (unionid) { saveLoginLog: function (unionid) {
var that = this; var that = this;
@ -259,26 +213,28 @@ export default {
const obj = JSON.parse(res.data.msg); const obj = JSON.parse(res.data.msg);
this_.isLogin = true; this_.isLogin = true;
const da = { const da = {
userkey:this_.$param.userkey, userkey: this_.$param.userkey,
openid:obj.openid openid: obj.openid
} };
this_.$Request.post(this_.$config.getUser,da).then((res)=>{ this_.$Request.post(this_.$config.getUser, da).then((res) => {
if(res.data == null){ if (res.data == null) {
uni.setStorageSync('nickname', '微信用户'); uni.setStorageSync('nickname', '微信用户');
uni.setStorageSync('headimgurl', 'https://www.lbgjtoa.com/appImg/icon-person-01.png'); uni.setStorageSync('headimgurl', 'https://www.lbgjtoa.com/appImg/icon-person-01.png');
uni.setStorageSync('oauthTime', new Date().getTime()); uni.setStorageSync('oauthTime', new Date().getTime());
this_.nickname = '微信用户'; this_.nickname = '微信用户';
this_.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png'; this_.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png';
this_.$forceUpdate(); this_.$forceUpdate();
}else{ this_.saveProfile();
} else {
uni.setStorageSync('nickname', res.data.wxNickname); uni.setStorageSync('nickname', res.data.wxNickname);
uni.setStorageSync('headimgurl', res.data.wxHeadimgurl); uni.setStorageSync('headimgurl', res.data.wxHeadimgurl);
uni.setStorageSync('oauthTime', new Date().getTime()); uni.setStorageSync('oauthTime', new Date().getTime());
this_.nickname = res.data.wxNickname; this_.nickname = res.data.wxNickname;
this_.nicknames = this_.$util.entitiestoUtf16(this_.nickname);
this_.headimgurl = res.data.wxHeadimgurl; this_.headimgurl = res.data.wxHeadimgurl;
this_.$forceUpdate(); this_.$forceUpdate();
} }
}) });
uni.setStorageSync('unionid', obj.openid); uni.setStorageSync('unionid', obj.openid);
}, },
fail: function (err) { fail: function (err) {
@ -301,8 +257,8 @@ export default {
// #endif // #endif
}, },
saveProfile:function(){ saveProfile: function () {
let this_ = this let this_ = this;
// wx.getUserInfo({ // wx.getUserInfo({
// provider: 'weixin', // provider: 'weixin',
// success: (res) => { // success: (res) => {
@ -312,28 +268,28 @@ export default {
// this_.nickname = ''; // this_.nickname = '';
// this_.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png'; // this_.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png';
// this_.$forceUpdate(); // this_.$forceUpdate();
const obj = { const obj = {
headimgurl:this_.headimgurl, headimgurl: this_.headimgurl,
openid:uni.getStorageSync('unionid'), openid: uni.getStorageSync('unionid'),
nickname:this_.nickname nickname: this_.nickname
} };
console.log(obj,'请求参数') console.log(obj, '请求参数');
var data = { var data = {
"data": JSON.stringify(obj), data: JSON.stringify(obj),
userkey:this_.$param.userkey userkey: this_.$param.userkey
} };
this_.$Request.post(this_.$config.saveUser,data).then(res => { this_.$Request.post(this_.$config.saveUser, data).then((res) => {
var flag = this_.$util.isSuccess(res); var flag = this_.$util.isSuccess(res);
if (!flag) { if (!flag) {
return; return;
} }
var userid = res.data; var userid = res.data;
console.log(userid,'保存返回') console.log(userid, '保存返回');
}) });
// }, // },
// fail: function (error) { // fail: function (error) {
// console.log('login failed ' + error); // console.log('login failed ' + error);
// } // }
// }); // });
// uni.showToast({ // uni.showToast({
// title:","+that.nickname+"", // title:","+that.nickname+"",
@ -341,16 +297,7 @@ export default {
// duration: 1500 // duration: 1500
// }) // })
}, },
callBackMethod: function () {
// clearTimeout(timer);
this.isLogin = true;
that.nickname = aes.aesDecrypt(uni.getStorageSync('nickname'));
that.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl'));
that.getUserInterest(); //
that.getAndroidUserKey(); //
uni.hideLoading();
that.saveLoginLog(uni.getStorageSync('unionid'));
},
jump: function (obj) { jump: function (obj) {
if (obj == 'aboutus') { if (obj == 'aboutus') {
uni.navigateTo({ uni.navigateTo({
@ -409,17 +356,6 @@ export default {
uni.removeStorageSync('adminId'); uni.removeStorageSync('adminId');
this.adminId = ''; this.adminId = '';
this.isAdminLogin = false; this.isAdminLogin = false;
} else if (obj == 'logoutWechat') {
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) {
uni.removeStorageSync('nickname');
uni.removeStorageSync('headimgurl');
uni.removeStorageSync('oauthTime');
uni.removeStorageSync('openid');
uni.removeStorageSync('unionid');
this.nickname = '点击授权';
this.headimgurl = '../../static/images/adm_img.png';
this.isLogin = false;
}
} else if (obj == 'myComment') { } else if (obj == 'myComment') {
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) {
uni.showToast({ uni.showToast({
@ -447,7 +383,7 @@ export default {
uni.removeStorageSync('oauthTime'); uni.removeStorageSync('oauthTime');
uni.removeStorageSync('openid'); uni.removeStorageSync('openid');
uni.removeStorageSync('unionid'); uni.removeStorageSync('unionid');
that.nickname = '点击授权'; that.nicknames = '点击授权';
that.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png'; that.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png';
that.isLogin = false; that.isLogin = false;
} else if (res.cancel) { } else if (res.cancel) {
@ -534,7 +470,7 @@ export default {
} }
} }
} }
} };
</script> </script>
<style> <style>
@ -547,44 +483,56 @@ export default {
.islogin { .islogin {
padding: 120rpx 50rpx 40rpx; padding: 120rpx 50rpx 40rpx;
} }
.mode_coms{ .mode_coms {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.fx-box{ .fx-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.tx-tt{ .tx-tt {
margin: 0 auto; margin: 0 auto;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.tx-btn{ .tx-btn {
margin: 0 auto; margin: 0 auto;
width: 140rpx; width: 140rpx;
height: 140rpx; height: 140rpx;
} }
.m-t-40{ .m-t-40 {
text-align: center; text-align: center;
margin-top: 20rpx; margin-top: 20rpx;
} }
.tx-btn{ .tx-btn {
margin: 0 auto; margin: 0 auto;
margin-top: 20rpx; margin-top: 20rpx;
padding: 0; padding: 0;
} }
.wh-106s{ .wh-106s {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.t-setting{ .t-setting {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
} }
.set-img{ .set-img {
width: 100%; width: 100%;
height: 100% } height: 100%;
}
.person_inf{
width: 50%;
}
.pes_inf {
width: 99%;
}
.t_nic {
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
</style> </style>

@ -191,8 +191,14 @@
}, },
// //
saveReserve: function() { saveReserve: function() {
let that = this let that = this
if(this.agreementChecked==true){ if(this.agreementChecked==true){
uni.showLoading({
mask:true,
title:'加载中...'
})
let promise = new Promise(function(resolve, reject) { let promise = new Promise(function(resolve, reject) {
that.dynamicLists.map((item, index) => { that.dynamicLists.map((item, index) => {
that.$refs.form[index].validate().then(res => { that.$refs.form[index].validate().then(res => {
@ -205,6 +211,7 @@
resolve('success'); resolve('success');
}, 1000); }, 1000);
}) })
promise.then(value => { promise.then(value => {
let reState = that.dynamicLists.every((item, index) => { let reState = that.dynamicLists.every((item, index) => {
return item.state == '1' return item.state == '1'
@ -212,7 +219,11 @@
console.log("asd",reState) console.log("asd",reState)
if (reState == true) { if (reState == true) {
console.log("asd",reState) console.log("asd",reState)
this.postReserve() this.postReserve()
}else{
uni.hideLoading()
} }
})} })}
}, },
@ -264,6 +275,7 @@
}, },
success: function(result) { success: function(result) {
if (result.data.status == 200) { if (result.data.status == 200) {
uni.hideLoading()
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: '预约成功', content: '预约成功',
@ -285,7 +297,11 @@
//succ.call(self, result.data) //succ.call(self, result.data)
}, },
fail: function(e) { fail: function(e) {
//error.call(self, e) uni.hideLoading()
uni.showToast({
icon:'none',
title:'预约失败'
})
} }
}) })
}, },

@ -213,6 +213,7 @@
return; return;
} }
var data = res.data; var data = res.data;
let arr = []
if(data != null && data.length > 0){ if(data != null && data.length > 0){
for(var i = 0;i < data.length;i++){ for(var i = 0;i < data.length;i++){
var item = { var item = {
@ -225,8 +226,9 @@
"showHideType":"zhed_gao", "showHideType":"zhed_gao",
"upDownType":"down_touj" "upDownType":"down_touj"
} }
that.controlList.push(item); arr.push(item)
} }
that.controlList = arr
}else{ }else{
that.loadType = false; that.loadType = false;
} }

Loading…
Cancel
Save