Browse Source

feat: update default avatar URL and idcardstatus default value

蛋吧eggbar
徐飞洋 1 month ago
parent
commit
1d43dc6445
  1. 2
      pages/buyer/index.js
  2. 2
      pages/evaluate2/one.js
  3. 4
      pages/goods-detail/goods-detail.js
  4. 6
      pages/index/index.js
  5. 4
      pages/profile/authentication/index.js
  6. 2
      pages/profile/index.js
  7. 2
      server-example/fix_settlement_fields.sql

2
pages/buyer/index.js

@ -1878,7 +1878,7 @@ Page({
const userInfo = { const userInfo = {
// 优先使用最新获取的微信头像和昵称,如果没有获取到则使用本地存储的 // 优先使用最新获取的微信头像和昵称,如果没有获取到则使用本地存储的
name: (userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : existingUserInfo.name) || '微信用户', name: (userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : existingUserInfo.name) || '微信用户',
avatarUrl: (userProfile ? userProfile.userInfo.avatarUrl : existingUserInfo.avatarUrl) || 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: (userProfile ? userProfile.userInfo.avatarUrl : existingUserInfo.avatarUrl) || 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
gender: (userProfile ? userProfile.userInfo.gender : existingUserInfo.gender) || 0, gender: (userProfile ? userProfile.userInfo.gender : existingUserInfo.gender) || 0,
country: (userProfile ? userProfile.userInfo.country : existingUserInfo.country) || '', country: (userProfile ? userProfile.userInfo.country : existingUserInfo.country) || '',
province: (userProfile ? userProfile.userInfo.province : existingUserInfo.province) || '', province: (userProfile ? userProfile.userInfo.province : existingUserInfo.province) || '',

2
pages/evaluate2/one.js

@ -703,7 +703,7 @@ Page({
const tempUserInfo = { const tempUserInfo = {
name: userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : '微信用户', name: userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : '微信用户',
// 获取微信头像失败时使用微信默认头像 // 获取微信头像失败时使用微信默认头像
avatarUrl: userProfile ? userProfile.userInfo.avatarUrl : 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: userProfile ? userProfile.userInfo.avatarUrl : 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
gender: userProfile ? userProfile.userInfo.gender : 0, gender: userProfile ? userProfile.userInfo.gender : 0,
country: userProfile ? userProfile.userInfo.country : '', country: userProfile ? userProfile.userInfo.country : '',
province: userProfile ? userProfile.userInfo.province : '', province: userProfile ? userProfile.userInfo.province : '',

4
pages/goods-detail/goods-detail.js

@ -2882,7 +2882,7 @@ Page({
const tempUserInfo = { const tempUserInfo = {
name: userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : '微信用户', name: userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : '微信用户',
// 获取微信头像失败时使用微信默认头像 // 获取微信头像失败时使用微信默认头像
avatarUrl: userProfile ? userProfile.userInfo.avatarUrl : 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: userProfile ? userProfile.userInfo.avatarUrl : 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
gender: userProfile ? userProfile.userInfo.gender : 0, gender: userProfile ? userProfile.userInfo.gender : 0,
country: userProfile ? userProfile.userInfo.country : '', country: userProfile ? userProfile.userInfo.country : '',
province: userProfile ? userProfile.userInfo.province : '', province: userProfile ? userProfile.userInfo.province : '',
@ -3071,7 +3071,7 @@ Page({
}); });
// 检查用户身份证认证状态 // 检查用户身份证认证状态
let idcardstatus = 0; let idcardstatus = '';
const users = wx.getStorageSync('users') || {}; const users = wx.getStorageSync('users') || {};
const userInfo = wx.getStorageSync('userInfo') || {}; const userInfo = wx.getStorageSync('userInfo') || {};

6
pages/index/index.js

@ -51,7 +51,7 @@ Page({
isLoggedIn: false, isLoggedIn: false,
currentUserType: null, currentUserType: null,
showUserInfoForm: false, showUserInfoForm: false,
avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
name: '', name: '',
showAuthModal: false, showAuthModal: false,
showOneKeyLoginModal: false, showOneKeyLoginModal: false,
@ -3231,7 +3231,7 @@ Page({
const tempUserInfo = { const tempUserInfo = {
name: userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : '微信用户', name: userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : '微信用户',
// 获取微信头像失败时使用微信默认头像,而不是本地头像 // 获取微信头像失败时使用微信默认头像,而不是本地头像
avatarUrl: userProfile ? userProfile.userInfo.avatarUrl : 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: userProfile ? userProfile.userInfo.avatarUrl : 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
gender: userProfile ? userProfile.userInfo.gender : 0, gender: userProfile ? userProfile.userInfo.gender : 0,
country: userProfile ? userProfile.userInfo.country : '', country: userProfile ? userProfile.userInfo.country : '',
province: userProfile ? userProfile.userInfo.province : '', province: userProfile ? userProfile.userInfo.province : '',
@ -4100,7 +4100,7 @@ Page({
const userInfo = { const userInfo = {
// 优先使用最新获取的微信头像和昵称,如果没有获取到则使用本地存储的 // 优先使用最新获取的微信头像和昵称,如果没有获取到则使用本地存储的
name: (userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : existingUserInfo.name) || '微信用户', name: (userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : existingUserInfo.name) || '微信用户',
avatarUrl: (userProfile ? userProfile.userInfo.avatarUrl : existingUserInfo.avatarUrl) || 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: (userProfile ? userProfile.userInfo.avatarUrl : existingUserInfo.avatarUrl) || 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
gender: (userProfile ? userProfile.userInfo.gender : existingUserInfo.gender) || 0, gender: (userProfile ? userProfile.userInfo.gender : existingUserInfo.gender) || 0,
country: (userProfile ? userProfile.userInfo.country : existingUserInfo.country) || '', country: (userProfile ? userProfile.userInfo.country : existingUserInfo.country) || '',
province: (userProfile ? userProfile.userInfo.province : existingUserInfo.province) || '', province: (userProfile ? userProfile.userInfo.province : existingUserInfo.province) || '',

4
pages/profile/authentication/index.js

@ -165,7 +165,7 @@ Page({
const currentStatus = this.data.idcardstatus; const currentStatus = this.data.idcardstatus;
// 如果当前状态是已通过,显示确认对话框 // 如果当前状态是已通过,显示确认对话框
if (currentStatus === ) { if (currentStatus === '1') {
wx.showModal({ wx.showModal({
title: '确认重新提交', title: '确认重新提交',
content: '您的认证信息已审核通过,确定要重新提交审核吗?', content: '您的认证信息已审核通过,确定要重新提交审核吗?',
@ -361,7 +361,7 @@ Page({
address: userData.address || '', address: userData.address || '',
validStart: userData.validStart || userData.valid_start || '', validStart: userData.validStart || userData.valid_start || '',
validEnd: userData.validEnd || userData.valid_end || '', validEnd: userData.validEnd || userData.valid_end || '',
idcardstatus: userData.idcardstatus || 0, idcardstatus: userData.idcardstatus || '',
reason: userData.reason || userData.reasonforfailure || '' reason: userData.reason || userData.reasonforfailure || ''
}; };

2
pages/profile/index.js

@ -712,7 +712,7 @@ Page({
const userInfo = { const userInfo = {
// 优先使用最新获取的微信头像和昵称,如果没有获取到则使用本地存储的 // 优先使用最新获取的微信头像和昵称,如果没有获取到则使用本地存储的
name: (userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : existingUserInfo.name) || '微信用户', name: (userProfile ? (userProfile.userInfo.name || userProfile.userInfo.nickName) : existingUserInfo.name) || '微信用户',
avatarUrl: (userProfile ? userProfile.userInfo.avatarUrl : existingUserInfo.avatarUrl) || 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', avatarUrl: (userProfile ? userProfile.userInfo.avatarUrl : existingUserInfo.avatarUrl) || 'https://my-supplier-photos.oss-cn-chengdu.aliyuncs.com/products/%E6%B5%B7%E8%93%9D%E7%81%B0/image/7a2a8a17a83ba4d3d4270828531e2041.jpeg',
gender: (userProfile ? userProfile.userInfo.gender : existingUserInfo.gender) || 0, gender: (userProfile ? userProfile.userInfo.gender : existingUserInfo.gender) || 0,
country: (userProfile ? userProfile.userInfo.country : existingUserInfo.country) || '', country: (userProfile ? userProfile.userInfo.country : existingUserInfo.country) || '',
province: (userProfile ? userProfile.userInfo.province : existingUserInfo.province) || '', province: (userProfile ? userProfile.userInfo.province : existingUserInfo.province) || '',

2
server-example/fix_settlement_fields.sql

@ -95,7 +95,7 @@ IF NOT EXISTS (
AND TABLE_NAME = 'users' AND TABLE_NAME = 'users'
AND COLUMN_NAME = 'idcardstatus' AND COLUMN_NAME = 'idcardstatus'
) THEN ) THEN
ALTER TABLE users ADD COLUMN idcardstatus INT DEFAULT 0 COMMENT '身份证认证状态(0:待审核,1:审核通过,2:审核失败)' AFTER reasonforfailure; ALTER TABLE users ADD COLUMN idcardstatus INT NULL COMMENT '身份证认证状态(0:待审核,1:审核通过,2:审核失败)' AFTER reasonforfailure;
END IF; END IF;
-- 检查 audit_time 字段(审核时间) -- 检查 audit_time 字段(审核时间)

Loading…
Cancel
Save