cyl/develop
zsk 12 months ago
commit 80bc1a07fe

@ -38,6 +38,42 @@ Component({
this.setData({ this.setData({
showModal: false showModal: false
}) })
},
saveImage: function (e) {
console.log('saveImage', e.currentTarget.dataset.src);
const imageUrl = e.currentTarget.dataset.src;
// 给出确认弹窗
wx.downloadFile({
url: imageUrl,
success: res => {
if (res.statusCode === 200) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
wx.showToast({
title: '保存成功',
icon: 'success'
});
},
fail: err => {
console.error('保存失败', err);
wx.showToast({
title: '保存失败',
icon: 'none'
});
}
});
} }
},
fail: err => {
console.error('下载失败', err);
wx.showToast({
title: '下载失败',
icon: 'none'
});
}
});
},
} }
}) })

@ -16,7 +16,13 @@
</view> </view>
<view class hover-class="none" hover-stop-propagation="false">加载中...</view> <view class hover-class="none" hover-stop-propagation="false">加载中...</view>
</view> </view>
<!-- #if MP -->
<image src="{{serviceInfo.qrCode}}" bindload="imageLoad" show-menu-by-longpress="{{true}}" style="width: 184px;height: 184px;"></image> <image src="{{serviceInfo.qrCode}}" bindload="imageLoad" show-menu-by-longpress="{{true}}" style="width: 184px;height: 184px;"></image>
<!-- #elif IOS -->
<image src="{{serviceInfo.qrCode}}" data-src="{{serviceInfo.qrCode}}" bindload="imageLoad" bindlongpress="saveImage" show-menu-by-longpress="{{false}}" style="width: 184px;height: 184px;"></image>
<!-- #elif ANDROID -->
<image src="{{serviceInfo.qrCode}}" data-src="{{serviceInfo.qrCode}}" bindload="imageLoad" bindlongpress="saveImage" show-menu-by-longpress="{{false}}" style="width: 184px;height: 184px;"></image>
<!-- #endif -->
<!-- <view class="f14 c9">人才经纪人</view> --> <!-- <view class="f14 c9">人才经纪人</view> -->
<!-- <view class="mt20 f22 c3">{{pmdUserInfo.tel}}</view> --> <!-- <view class="mt20 f22 c3">{{pmdUserInfo.tel}}</view> -->
<view class="f14 c3 mt6">长按识别二维码</view> <view class="f14 c3 mt6">长按识别二维码</view>

@ -76,6 +76,22 @@ Page({
}); });
}, },
}); });
},
chooseAnImage() {
const that = this;
wx.chooseMedia({
sizeType: ["original"], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
success(res) {
// 返回选定照片的本地文件路径列表tempFilePath可以作为img标签的src属性显示图片
console.log(res);
that.setData({
files: that.data.files.concat(res.tempFilePaths),
temporaryImg: res.tempFiles[0].tempFilePath,
isSure: true,
});
},
});
}, },
changeUserImgsrc: function () { changeUserImgsrc: function () {
var that = this; var that = this;

@ -14,8 +14,10 @@
<!-- bindtap='chooseImage' <!-- bindtap='chooseImage'
<button wx:else open-type="chooseAvatar" style='' bindchooseavatar='choiceAvatar' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button> <button wx:else open-type="chooseAvatar" style='' bindchooseavatar='choiceAvatar' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button>
--> -->
<!-- #if MP || ANDROID --> <!-- #if MP -->
<button wx:else open-type="chooseAvatar" bindchooseavatar='choiceAvatar' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button> <button wx:else open-type="chooseAvatar" bindchooseavatar='choiceAvatar' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button>
<!-- #elif ANDROID -->
<button wx:else open-type="chooseAvatar" bindtap='chooseAnImage' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button>
<!-- #elif IOS --> <!-- #elif IOS -->
<button wx:else bindtap='chooseImage' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button> <button wx:else bindtap='chooseImage' class="change weui-btn_primary fw500 mt32" aria-role="button">更换头像</button>
<!-- #endif --> <!-- #endif -->

@ -64,9 +64,9 @@
</button> </button>
<!-- #elif ANDROID --> <!-- #elif ANDROID -->
<button type class="loginBtn wxBtn ysd-base-bgcolor" style="display:flex;justify-content:center;align-items:center;" hover-class="loginBtnHov" bindtap="appLogin"> <!-- <button type class="loginBtn wxBtn ysd-base-bgcolor" style="display:flex;justify-content:center;align-items:center;" hover-class="loginBtnHov" bindtap="appLogin">
<i class="iconfont icon-shouji1 mr8"></i>手机号快捷登录 <i class="iconfont icon-shouji1 mr8"></i>手机号快捷登录
</button> </button> -->
<!-- #endif --> <!-- #endif -->
</view> </view>
</form> </form>

@ -78,7 +78,7 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
setTimeout(() => { setTimeout(() => {
console.log(app.globalData.loginUserInfo); console.log('mine:',app.globalData.loginUserInfo);
this.setData({ this.setData({
isLogin: app.globalData.isLogin, isLogin: app.globalData.isLogin,
hasUserInfo: app.globalData.hasUserInfo, hasUserInfo: app.globalData.hasUserInfo,

@ -20,7 +20,7 @@
</block> </block>
<view class="usernamebox"> <view class="usernamebox">
<view class="username"> <view class="username">
<view class="theusername">{{userInfo.user.nickName || '伯才用户' }}</view> <view class="theusername">{{userInfo.user.userName || '伯才用户' }}</view>
<i class="iconfont icon-nv3 f12" style="color:#fb8585;line-height:20px" wx:if="{{userInfo.user.sex == 2}}"></i> <i class="iconfont icon-nv3 f12" style="color:#fb8585;line-height:20px" wx:if="{{userInfo.user.sex == 2}}"></i>
<i class="iconfont icon-nan3 f12" style="color:#10aeff;line-height:20px" wx:if="{{userInfo.user.sex == 1}}"></i> <i class="iconfont icon-nan3 f12" style="color:#10aeff;line-height:20px" wx:if="{{userInfo.user.sex == 1}}"></i>
</view> </view>

@ -602,8 +602,8 @@ Page({
console.log('options.agencyInfo', options.agencyInfo); console.log('options.agencyInfo', options.agencyInfo);
if (app.isNotEmptyCheck(options.agencyInfo)) { if (app.isNotEmptyCheck(options.agencyInfo)) {
that.setData({ that.setData({
agentName: JSON.parse(options.agencyInfo).aliasName, // agentName: JSON.parse(options.agencyInfo).aliasName,
agentId: JSON.parse(options.agencyInfo).id, // agentId: JSON.parse(options.agencyInfo).id,
}); });
} }
if (app.isNotEmptyCheck(options.imgUrl)) { if (app.isNotEmptyCheck(options.imgUrl)) {
@ -1055,7 +1055,7 @@ Page({
new Promise(function (resolve, reject) { new Promise(function (resolve, reject) {
var paramData = {}; var paramData = {};
console.log(' wx.getStorageSync("townsManInfoJob")', wx.getStorageSync("townsManInfoJob")); console.log(' wx.getStorageSync("townsManInfoJob")', wx.getStorageSync("townsManInfoJob"));
console.log(' paramData', paramData); console.log(' paramData', that.data);
delete paramData.config_str delete paramData.config_str
delete paramData.face_rect delete paramData.face_rect
delete paramData.request_id delete paramData.request_id
@ -1081,7 +1081,7 @@ Page({
paramData["address"] = e.detail.value.address; paramData["address"] = e.detail.value.address;
paramData["desp"] = e.detail.value.desp; paramData["desp"] = e.detail.value.desp;
paramData["policyIdx"] = that.data.policyIdx paramData["policyIdx"] = that.data.policyIdx
console.log('paramData',paramData);
// if(app.isNotEmptyCheck(userInfo.imgs)){ // if(app.isNotEmptyCheck(userInfo.imgs)){
// paramData["imgs"] = userInfo.imgs.toString(); // paramData["imgs"] = userInfo.imgs.toString();
// } // }

@ -29,18 +29,19 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
let that = this;
if (wx.getStorageSync("configInfo")) { if (wx.getStorageSync("configInfo")) {
this.setData({ this.setData({
configInfo: { ...wx.getStorageSync("configInfo"), biao: false }, configInfo: { ...wx.getStorageSync("configInfo"), biao: false },
}); });
console.log('configInfo', this.data.configInfo); console.log('configInfo', this.data.configInfo);
} }
setTimeout(() => { that.copyUpdateToken(()=>{
console.log('app.globalData.loginUserInfo',app.globalData.loginUserInfo); console.log('app.globalData.loginUserInfo',app.globalData.loginUserInfo);
this.setData({ that.setData({
userInfo: app.globalData.loginUserInfo, userInfo: app.globalData.loginUserInfo,
}); });
}, 100); })
}, },
showToggle () { showToggle () {
@ -108,6 +109,22 @@ Page({
}) })
}, },
copyUpdateToken(callback=()=>{}){
let that = this;
customRequest('/appLoginByToken', { header: 'headers', method: 'GET', data: {} }).then((res) => {
console.log(res);
app.globalData.agencyStatus = res.data.data.agencyStatus;
app.globalData.loginUserInfo = res.data.data;
wx.setStorageSync("loginUser", res.data.data);
wx.setStorageSync("LOGINUSER_ID", res.data.data.user.agencyId);
this.setData({
drawerShow: false
})
// that.onLoad()
// that.onShow()
callback();
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

@ -22,7 +22,7 @@
<view class="userName"> <view class="userName">
<view class="fw500">用户名</view> <view class="fw500">用户名</view>
<view> <view>
<view>{{userInfo.nickName}}</view> <view>{{userInfo.userName}}</view>
<view class="iconfont icon-gengduo11"></view> <view class="iconfont icon-gengduo11"></view>
</view> </view>
</view> </view>
@ -32,9 +32,9 @@
<view class="gender"> <view class="gender">
<view class="fw500">性别</view> <view class="fw500">性别</view>
<view> <view>
<view wx:if="{{userInfo.sex==1}}">男</view> <view wx:if="{{userInfo.user.sex==1}}">男</view>
<view wx:if="{{userInfo.sex==2}}">女</view> <view wx:if="{{userInfo.user.sex==2}}">女</view>
<view wx:if="{{userInfo.sex==0}}">未知</view> <view wx:if="{{userInfo.user.sex==0}}">未知</view>
<view class="iconfont icon-gengduo11"></view> <view class="iconfont icon-gengduo11"></view>
</view> </view>
</view> </view>
@ -60,7 +60,7 @@
</view> </view>
</navigator>--> </navigator>-->
<view class hover-class="none" hover-stop-propagation="false"> <view class hover-class="none" hover-stop-propagation="false">
<navigator class="bgf br8" url="/pages/realName1/index" hover-class="hcb" open-type="navigate" wx:if="{{userInfo.idauth == 0}}"> <navigator class="bgf br8" url="/pages/realName1/index" hover-class="hcb" open-type="navigate" wx:if="{{userInfo.user.idauth == 0}}">
<view class="realname mt_10 br_8"> <view class="realname mt_10 br_8">
<view class="fw500">实名认证</view> <view class="fw500">实名认证</view>
<view> <view>
@ -69,14 +69,14 @@
</view> </view>
</view> </view>
</navigator> </navigator>
<navigator class="bgf br8" url="/pages/trueName/index?realName={{userInfo.realName}}" open-type="navigate" wx:else> <navigator class="bgf br8" url="/pages/trueName/index?realName={{userInfo.user.realName}}" open-type="navigate" wx:else>
<view class="realname mt_10 br_8 bgf" hover-class="hcb"> <view class="realname mt_10 br_8 bgf" hover-class="hcb">
<view class="fw500"> <view class="fw500">
实名认证 实名认证
<view class="iconfont icon-yirenzheng ysd-base-color fw400 f18 ml4" style="line-height:1"></view> <view class="iconfont icon-yirenzheng ysd-base-color fw400 f18 ml4" style="line-height:1"></view>
</view> </view>
<view> <view>
<view class="display-flex c9" style="align-items:center">{{userInfo.realName}}</view> <view class="display-flex c9" style="align-items:center">{{userInfo.user.realName}}</view>
<view class="iconfont icon-gengduo11 c9"></view> <view class="iconfont icon-gengduo11 c9"></view>
</view> </view>
</view> </view>

@ -7,7 +7,7 @@ Page({
*/ */
data: { data: {
userId: "", userId: "",
nickName: "", userName: "",
btnLoading: false, btnLoading: false,
}, },
@ -21,7 +21,7 @@ Page({
var that = this; var that = this;
if (app.isEmptyCheck(e.detail.value.nickName)) { if (app.isEmptyCheck(e.detail.value.userName)) {
wx.showToast({ wx.showToast({
icon: "none", icon: "none",
title: "请输入姓名", title: "请输入姓名",
@ -34,10 +34,12 @@ Page({
var formData = e.detail.value; var formData = e.detail.value;
// formData["userId"] = that.data.userId; // formData["userId"] = that.data.userId;
console.log(formData);
customRequest("/user/updateNickName", { header: 'headers', method: 'POST', data:formData }).then((res) => { customRequest("/user/updateNickName", { header: 'headers', method: 'POST', data:{
nickName:formData.userName
} }).then((res) => {
if (res.data.status == 200) { if (res.data.status == 200) {
app.globalData.user.nickName = formData.nickName; app.globalData.user.userName = formData.userName;
wx.navigateBack({ wx.navigateBack({
delta: 1, delta: 1,
@ -93,7 +95,7 @@ Page({
onShow: function () { onShow: function () {
this.setData({ this.setData({
userId: app.globalData.user.id, userId: app.globalData.user.id,
nickName: app.globalData.user.nickName, userName: app.globalData.user.userName,
}); });
}, },

@ -4,7 +4,7 @@
<view class="weui-cell"> <view class="weui-cell">
<view class="weui-cell__hd"><label class="weui-label fw500">用户名</label></view> <view class="weui-cell__hd"><label class="weui-label fw500">用户名</label></view>
<view class="weui-cell__bd"> <view class="weui-cell__bd">
<input name="nickName" type='nickname' value="{{nickName}}" class="weui-input tr" placeholder="请输入用户名" placeholder-class="weui-input__placeholder" /> <input name="userName" type='userName' value="{{userName}}" class="weui-input tr" placeholder="请输入用户名" placeholder-class="weui-input__placeholder" />
</view> </view>
</view> </view>
</view> </view>

@ -2,6 +2,7 @@
"miniVersion": "v2", "miniVersion": "v2",
"name": "伯才供应链", "name": "伯才供应链",
"version": "1.2.0", "version": "1.2.0",
"i18nFilePath": "i18n", "i18nFilePath": "i18n",
"mini-android": { "mini-android": {
"sdkVersion": "1.6.2", "sdkVersion": "1.6.2",
@ -107,5 +108,9 @@
"customImage": "/Users/zhangshaokang/Desktop/伯才供应链app上架相关图片/安卓启动页及图标/画板备份 12.png" "customImage": "/Users/zhangshaokang/Desktop/伯才供应链app上架相关图片/安卓启动页及图标/画板备份 12.png"
} }
}, },
<<<<<<< HEAD
"versionCode": 120 "versionCode": 120
=======
"versionCode": 125
>>>>>>> f9e7a56bed4415c8dc3372ab13fd25ed5ac6d5ee
} }

Loading…
Cancel
Save