From c891bc5ff6b03baf28a9eac7f5a14ade4cea3c23 Mon Sep 17 00:00:00 2001 From: Sanakey <714737083@qq.com> Date: 星期一, 24 十月 2022 10:19:19 +0800 Subject: [PATCH] getUserInfo接口更新前 --- pages/user/user.js | 4 app.wxss | 6 pages/updateUserInfo/updateUserInfo.json | 10 + pages/updateUserInfo/updateUserInfo.js | 124 +++++++++++++++ component/authorizeInfo/authorize.js | 3 pages/cart/cart.js | 10 - component/mustAuthorize/authorize.js | 11 - pages/map/map.js | 68 ++++++++ project.private.config.json | 16 + pages/order/order.js | 11 - component/authorizePhone/authorize.js | 27 --- pages/withdraw/withdraw.js | 15 - app.json | 9 component/contact/contact.js | 13 - pages/updateUserInfo/updateUserInfo.wxss | 36 ++++ pages/updateUserInfo/updateUserInfo.wxml | 14 + component/sku-dialog/index.js | 8 pages/user/user.json | 5 pages/index/index.js | 9 - pages/user/user.wxss | 6 pages/user/user.wxml | 5 pages/detail/detail.js | 51 ------ 22 files changed, 309 insertions(+), 152 deletions(-) diff --git a/app.json b/app.json index c07f0bb..746ba9f 100644 --- a/app.json +++ b/app.json @@ -74,7 +74,8 @@ "pages/vouchers/vouchers", "pages/liveRoomCreate/liveRoomCreate", "pages/myLiveRoom/myLiveRoom", - "pages/liveRoomGoods/liveRoomGoods" + "pages/liveRoomGoods/liveRoomGoods", + "pages/updateUserInfo/updateUserInfo" ], "window": { "backgroundTextStyle": "light", @@ -145,12 +146,16 @@ "permission": { "scope.userLocation": { "desc": "浣犵殑浣嶇疆淇℃伅灏嗙敤浜庡皬绋嬪簭瀹氫綅" + }, + "scope.getFuzzyLocation": { + "desc": "浣犵殑浣嶇疆淇℃伅灏嗙敤浜庡皬绋嬪簭妯$硦瀹氫綅" } }, "requiredPrivateInfos":[ "choosePoi", "chooseLocation", - "chooseAddress" + "chooseAddress", + "getFuzzyLocation" ], "plugins": { "live-player-plugin": { diff --git a/app.wxss b/app.wxss index 330ba2b..a44cc8b 100644 --- a/app.wxss +++ b/app.wxss @@ -40,6 +40,12 @@ width: 100%; } +.absolute{ + position: absolute; +} +.relative{ + position: relative; +} .flex_row{ display: flex; flex-direction: row; diff --git a/component/authorizeInfo/authorize.js b/component/authorizeInfo/authorize.js index 0b6e7f4..4d1f414 100644 --- a/component/authorizeInfo/authorize.js +++ b/component/authorizeInfo/authorize.js @@ -88,9 +88,6 @@ } - // utils.authorize(e, this, () => { - // console.log('鎻愪氦鎺堟潈鍚庣殑鍥炶皟鍑芥暟'); - // }) }, } }) diff --git a/component/authorizePhone/authorize.js b/component/authorizePhone/authorize.js index 0aa0ec0..2bebf3a 100644 --- a/component/authorizePhone/authorize.js +++ b/component/authorizePhone/authorize.js @@ -132,31 +132,6 @@ }, - // getUserInfo(e) { - // utils.isAuthorize(this); - - // if (!this.data.isAuthorize) { - // if (!utils.authorize(e, this)) { - // this.triggerEvent('authorize', { - // isAuthorize: false - // }) - // return; - // } else { - // this.triggerEvent('authorize', { - // isAuthorize: true - // }) - // } - - // } else { - // this.triggerEvent('authorize', { - // isAuthorize: true - // }) - // } - - - // // utils.authorize(e, this, () => { - // // console.log('鎻愪氦鎺堟潈鍚庣殑鍥炶皟鍑芥暟'); - // // }) - // }, + } }) \ No newline at end of file diff --git a/component/contact/contact.js b/component/contact/contact.js index 09440da..6246295 100644 --- a/component/contact/contact.js +++ b/component/contact/contact.js @@ -125,18 +125,7 @@ // 鎻愪氦fromid formIdSubmit: function (e) { - // utils.isAuthorize(this); - // if(!this.data.isAuthorize){ - // if (!utils.authorize(e, this)){ - // wx.showToast({ - // title: '璇锋巿鏉冨ご鍍忔樀绉帮紒', - // icon: 'none', - // duration: 2000 - // }) - // return; - // } - // } - // utils.formIdSubmit(e, this); + let aiTemplateId = app.globalData.aiMessageDefaultTemplateId; if(aiTemplateId==""||!aiTemplateId){ diff --git a/component/mustAuthorize/authorize.js b/component/mustAuthorize/authorize.js index 3394d84..8ae87aa 100644 --- a/component/mustAuthorize/authorize.js +++ b/component/mustAuthorize/authorize.js @@ -169,16 +169,7 @@ return; } this.completeAuthorize(); - // this.setData({ - // isShowAvatarDialog:false - // }) - // utils.isAuthorize(this); - // console.log(this.data.isAuthorize,333) - // if(!this.data.isAuthorize){ - // if (!utils.authorize(e, this)){ - // return; - // } - // } + }, completeAuthorize(){ diff --git a/component/sku-dialog/index.js b/component/sku-dialog/index.js index 99d17c0..8fb7429 100644 --- a/component/sku-dialog/index.js +++ b/component/sku-dialog/index.js @@ -353,13 +353,7 @@ }) return }; - // utils.isAuthorize(this); - // console.log(this.data.isAuthorize,333) - // if(!this.data.isAuthorize){ - // if (!utils.authorize(e, this)){ - // return; - // } - // } + //鑾峰彇鏁伴噺锛屼环鏍硷紝鍟嗗搧鍚嶇О锛宨d锛屽皝闈㈠浘 var num = this.data.Quantity.quantity||1; var price = this.data.goodsItem.Price; diff --git a/pages/cart/cart.js b/pages/cart/cart.js index d79b94a..7ad2a54 100644 --- a/pages/cart/cart.js +++ b/pages/cart/cart.js @@ -495,15 +495,7 @@ utils.showTip("璇疯嚦灏戦�夋嫨涓�浠跺晢鍝侊紒", "none"); return; } - // console.log(this.data.isAuthorize) - // utils.isAuthorize(this); - // // console.log(this.isAuthorize) - // if(!this.data.isAuthorize){ - // if (!utils.authorize(e, this)){ - // return; - // } - // } - // wx.showLoading(); + // // 閲嶆柊璁$畻浠锋牸锛屽垽鏂簱瀛� // var shopList = []; // var cartInfo = wx.getStorageSync('cartData'); diff --git a/pages/detail/detail.js b/pages/detail/detail.js index bd45b4b..409dd47 100644 --- a/pages/detail/detail.js +++ b/pages/detail/detail.js @@ -366,41 +366,7 @@ }) console.log('isPullTelephone:', isPullTelephone1); }); - // let getLogin = Request.request({ - // url: '/shopping/confirm.do?m=isLogin' - // }).then((res) => { - // console.log('denglu',res) - // isLogin = res.isLogin - // // res.isLogin ? isLogin = false : isLogin = true - // // console.log('isPullTelephone2', isPullTelephone2) - // }); - // Promise.all([getSetting, getLogin]).then(()=> { - // let isPullTelephone = false; - // if (isPullTelephone1 && !isLogin) { - // isPullTelephone = true; - // // if(!this.data.isAuthorize){ - // // if (!utils.authorize(e, this)){ - // // return; - // // } - // // } - // } - // this.setData({ - // isPullTelephone: isPullTelephone - // }) - // console.log('isPullTelephone:', isPullTelephone); - // }) - // Request.request({ - // url: '/wx/getCardUserInfo.do', - // data: { - // FromUserId: app.globalData.FromUserId - // } - // }).then((res) => { - // console.log(res); - // this.setData({ - // UserId: res.UserId, - // Name: res.Name - // }); - // }); + }, @@ -1122,13 +1088,7 @@ }) return }; - // utils.isAuthorize(this); - // console.log(this.data.isAuthorize,333) - // if(!this.data.isAuthorize){ - // if (!utils.authorize(e, this)){ - // return; - // } - // } + //鑾峰彇鏁伴噺锛屼环鏍硷紝鍟嗗搧鍚嶇О锛宨d锛屽皝闈㈠浘 var num = this.data.Quantity.quantity; var price = this.data.goodsItem.Price; @@ -1214,12 +1174,7 @@ if(!utils.requestError(res)){ return false; } - // utils.isAuthorize(this); - // if(!this.data.isAuthorize){ - // if (!utils.authorize(e, this)){ - // return; - // } - // } + wx.navigateTo({ url: '../order/order?selectedCartIds='+res.data.CartId diff --git a/pages/index/index.js b/pages/index/index.js index 33c786a..8c2148e 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -977,14 +977,7 @@ }, getUserInfo2(e) { console.log("淇℃伅椤电偣鍑�") - // utils.isAuthorize(this); - // if(!this.data.isAuthorize){ - // utils.authorize(e, this) - // // if (!utils.authorize(e, this)){ - // // return; - // // } - - // } + wx.navigateTo({ url: '../information/information?infordoc='+ e.currentTarget.dataset.doccode, }) diff --git a/pages/map/map.js b/pages/map/map.js index 6f261c3..0fd9ed6 100644 --- a/pages/map/map.js +++ b/pages/map/map.js @@ -50,6 +50,74 @@ + wx.getSetting({ + success: res => { + if (res.authSetting['scope.userFuzzyLocation']) { + console.log('鎺堟潈', res); + // wx.getFuzzyLocation({ + // type: 'wgs84', + // success (res) { + // const latitude = res.latitude + // const longitude = res.longitude + // console.log('妯$硦瀹氫綅',latitude,longitude); + // },fail(res){ + // console.log('妯$硦瀹氫綅鎶ラ敊',res); + // } + // }) + } else { + console.log('鏈巿鏉�'); + + // wx.showModal({ + // title: '鎻愮ず', + // content: '璇锋墦寮�鍦板潃鎺堟潈', + // success: res=>{ + // if (res.confirm) { + // wx.openSetting({ + // success(res) { + // console.log(res.authSetting) + // } + // }) + // } + // } + // }) + + wx.authorize({ + scope: 'scope.userFuzzyLocation', + success: (res) => { + console.log('瀹氫綅鎺堟潈', res); + wx.getFuzzyLocation({ + type: 'wgs84', + success (res) { + const latitude = res.latitude + const longitude = res.longitude + console.log('妯$硦瀹氫綅2',latitude,longitude); + this.setData({ + longitude: res.longitude, + latitude: res.latitude + }); + } + }) + } + }); + // wx.openSetting({ + // success(res) { + // console.log(res,'jjjj9999'); + // wx.authorize({ + // scope: 'scope.userLocation', + // success(res) { + // console.log('鍐嶆鎺堟潈', res); + // console.log(12347896); + // + // } + // }); + // } + // }) + + + } + + } + }); // wx.authorize({ diff --git a/pages/order/order.js b/pages/order/order.js index a1e0469..1d6da25 100644 --- a/pages/order/order.js +++ b/pages/order/order.js @@ -807,16 +807,7 @@ }) // this.postOrder(this.data.dataEvent); }, - // async getUserInfo(e){ - // // if (!utils.authorize(e, this)){ - // // e.detail.isAuthorize = false; - // // contactComp.getAuthorize(e); - // // return; - // // } - // await utils.isAuthorize(this); - // await utils.authorize(e, this); - // this.postOrder(this.data.dataEvent); - // }, + placeOrder: function (event) { console.log('鎻愪氦璁㈠崟浜嬩欢',event) diff --git a/pages/updateUserInfo/updateUserInfo.js b/pages/updateUserInfo/updateUserInfo.js new file mode 100644 index 0000000..784027a --- /dev/null +++ b/pages/updateUserInfo/updateUserInfo.js @@ -0,0 +1,124 @@ + +var utils = require("../../utils/util.js"); +var app = getApp(); + +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + + }, + + + // 鎵嬫満鍙疯緭鍏� + inputTel: function(e) { + inpTelNum = e.detail.value; + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad: function(options) { + + }, + + uploadImg() { + wx.chooseImage({ + count: 1, // 榛樿9 + sizeType: ["original", "compressed"], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ["album", "camera"], // 鍙互鎸囧畾鏉ユ簮鏄浉鍐岃繕鏄浉鏈猴紝榛樿浜岃�呴兘鏈� + success: (res) => { + // console.log(res.data) + // this.setData({ + // imageList: res.tempFilePaths, + // tempFiles: res.tempFiles + // }) + let imgList = res.tempFilePaths; + let files = res.tempFiles; + console.log(imgList, files); + // this.setData({ + // [imgType]: imgList[0], + // }); + // return; + wx.uploadFile({ + url: utils.getUrl( + "/wx/miniapp/user/uploadAvatar.do" + ), + // url: app.globalData.reqBase + '/shopping/confirm.do?m=uploadAttachment&doccode='+ doccode +'&rowid='+rowid, + formData: { + file: files[0], + }, + filePath: imgList[0], + name: "data", + success: (res) => { + console.log(res); + // return; + if (!utils.requestError(res)) { + return false; + } + console.log(data); + + }, + fail: function (errmsg) { + console.log("uploadImage fail, errMsg is", errmsg); + utils.requestFail( + errmsg, + "/wx/miniapp/user/uploadAvatar.do" + ); + }, + }); + }, + }); + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady: function() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow: function() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide: function() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload: function() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh: function() { + + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom: function() { + + }, + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + // onShareAppMessage: function() { + + // } +}) \ No newline at end of file diff --git a/pages/updateUserInfo/updateUserInfo.json b/pages/updateUserInfo/updateUserInfo.json new file mode 100644 index 0000000..2a5d11a --- /dev/null +++ b/pages/updateUserInfo/updateUserInfo.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "涓汉淇℃伅", + "usingComponents": { + "van-cell": "/src/vant-weapp/cell/index", + "van-cell-group": "/src/vant-weapp/cell-group/index", + "van-icon": "/src/vant-weapp/icon/index", + "van-field": "/src/vant-weapp/field/index", + "van-image": "/src/vant-weapp/image/index" + } +} \ No newline at end of file diff --git a/pages/updateUserInfo/updateUserInfo.wxml b/pages/updateUserInfo/updateUserInfo.wxml new file mode 100644 index 0000000..bae7cca --- /dev/null +++ b/pages/updateUserInfo/updateUserInfo.wxml @@ -0,0 +1,14 @@ + +<view> +<van-cell center title="澶村儚"> + <view> + <van-image round width="100rpx" height="100rpx" bind:tap="uploadImg" src="https://img.yzcdn.cn/vant/cat.jpeg"/> + </view> +</van-cell> + <van-field + value="{{ username3 }}" + label="鐢ㄦ埛鍚�" + placeholder="璇疯緭鍏ョ敤鎴峰悕" + input-align="right" + /> +</view> \ No newline at end of file diff --git a/pages/updateUserInfo/updateUserInfo.wxss b/pages/updateUserInfo/updateUserInfo.wxss new file mode 100644 index 0000000..19d911f --- /dev/null +++ b/pages/updateUserInfo/updateUserInfo.wxss @@ -0,0 +1,36 @@ +/* pages/login/login.wxss */ +@import "/src/weui.wxss"; + +page { + background-color: #f9f9f9; + font-size: 32rpx; + line-height: 1.6; +} + +view { + font-size: 32rpx; +} + +input { + width: 100%; +} + +.savebtn { + margin: 50rpx 25rpx; +} + +.warning { + color: red; +} + +.go-register { + margin: 20rpx; + text-align: right; +} + +.go-register .text { + color: #229bc9; + font-size: 28rpx; + padding: 10rpx 20rpx; + display:inline-block; +} diff --git a/pages/user/user.js b/pages/user/user.js index c8c061a..973c1a0 100644 --- a/pages/user/user.js +++ b/pages/user/user.js @@ -25,6 +25,9 @@ // }) // return; // } + + + const accountInfo = wx.getAccountInfoSync(); console.log(accountInfo.miniProgram.appId) // 灏忕▼搴� appId console.log(accountInfo.miniProgram.version) // 灏忕▼搴忕増鏈彿 @@ -106,6 +109,7 @@ // ReferralsName:app.globalData.ReferralsName, // Name: app.globalData.FromUserId // }) + }, getSubscribeMessage(){ diff --git a/pages/user/user.json b/pages/user/user.json index 0020802..65a3854 100644 --- a/pages/user/user.json +++ b/pages/user/user.json @@ -1,3 +1,6 @@ { - "navigationBarTitleText": "鎴戠殑" + "navigationBarTitleText": "鎴戠殑", + "usingComponents": { + "van-icon": "/src/vant-weapp/icon/index" + } } \ No newline at end of file diff --git a/pages/user/user.wxml b/pages/user/user.wxml index ed851cb..4080338 100644 --- a/pages/user/user.wxml +++ b/pages/user/user.wxml @@ -6,8 +6,11 @@ <view class="my-header"> <!-- <view class="userinfo"> --> <block> - <view class="my-header-div"> + <view class="my-header-div relative"> <!-- http://rf.onbus.cn/shopping/mobile/img/touxiang.png --> + <navigator class="edit-icon absolute" url="/pages/updateUserInfo/updateUserInfo"> + <van-icon class="" bindtap="editUserInfo" name="records" size="24px"/> + </navigator> <image src="{{userData.HeadImgUrl}}" wx:if="{{userData.HeadImgUrl!==''}}" class="header-img" bindtap="viewAvatar" data-src="{{userData.HeadImgUrl}}" /> <button class="get-userinfo header-img" wx:else open-type="getUserInfo" bind:tap="getUserInfo"><view style="font-size:28rpx;">鐐瑰嚮</view> 鑾峰彇澶村儚</button> </view> diff --git a/pages/user/user.wxss b/pages/user/user.wxss index 1be386a..58c8d18 100644 --- a/pages/user/user.wxss +++ b/pages/user/user.wxss @@ -210,4 +210,10 @@ text-align: center; color: #999; padding: 20rpx 0; +} + +.edit-icon{ + left: 50%; + top: -20rpx; + margin-left: 60rpx; } \ No newline at end of file diff --git a/pages/withdraw/withdraw.js b/pages/withdraw/withdraw.js index bfba9d6..f1f2b79 100644 --- a/pages/withdraw/withdraw.js +++ b/pages/withdraw/withdraw.js @@ -106,13 +106,7 @@ } if (!this.data.isCanTap) return; - // utils.isAuthorize(this); - // console.log(this.data.isAuthorize, 333) - // if (!this.data.isAuthorize) { - // if (!utils.authorize(e, this)) { - // return; - // } - // } + this.setData({ isCanTap: false @@ -209,13 +203,6 @@ return false } - // utils.isAuthorize(this); - // console.log(this.data.isAuthorize, 333) - // if (!this.data.isAuthorize) { - // if (!utils.authorize(e, this)) { - // return; - // } - // } this.setData({ isCanTap: false diff --git a/project.private.config.json b/project.private.config.json index 06ca98f..720c739 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -251,10 +251,24 @@ "pathName": "pages/classify/classify", "query": "", "scene": null + }, + { + "name": "", + "pathName": "pages/location/location", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "鏇存柊鐢ㄦ埛淇℃伅", + "pathName": "pages/updateUserInfo/updateUserInfo", + "query": "", + "launchMode": "default", + "scene": null } ] } }, "description": "椤圭洰绉佹湁閰嶇疆鏂囦欢銆傛鏂囦欢涓殑鍐呭灏嗚鐩� project.config.json 涓殑鐩稿悓瀛楁銆傞」鐩殑鏀瑰姩浼樺厛鍚屾鍒版鏂囦欢涓�傝瑙佹枃妗o細https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "libVersion": "2.25.1" + "libVersion": "2.27.0" } \ No newline at end of file -- Gitblit v1.8.0