|
|
@@ -14,7 +14,7 @@
|
|
|
<view class="fill_name">
|
|
|
<text class="nickname">昵称</text>
|
|
|
<input type="text" class="inputText" v-model="dataList.form.nickname" placeholder="请填写昵称" placeholder-style="font-size: 28upx; color: #999;">
|
|
|
- <button class="generate_btn">点击生成</button>
|
|
|
+ <button class="generate_btn" open-type="getUserInfo" @getuserinfo="getWxAvatar">点击生成</button>
|
|
|
</view>
|
|
|
<view class="fill_name">
|
|
|
<text class="nickname">手机号</text>
|
|
|
@@ -41,7 +41,7 @@
|
|
|
<script>
|
|
|
import { pxApplyAdd, pxApplyWxPay } from '@/api/px-class/index'
|
|
|
import weixinPay from '@/utils/pay/wxPay'
|
|
|
-import { getWxPhone } from "@/api/mini";
|
|
|
+import { getWxPhone, getWxInfo } from "@/api/mini";
|
|
|
export default{
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -114,7 +114,27 @@ export default{
|
|
|
} else {
|
|
|
this.$msg("获取信息失败!");
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 获取微信信息
|
|
|
+ getWxAvatar() {
|
|
|
+ uni.getUserInfo({
|
|
|
+ provider: "weixin",
|
|
|
+ success: res => {
|
|
|
+ getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(
|
|
|
+ subRes => {
|
|
|
+ // this.form.adminId = subRes.data.id;
|
|
|
+ this.dataList.form.nickname = subRes.data.nickName;
|
|
|
+ uni.showToast({
|
|
|
+ icon: "success"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ // this.loading = false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|