Compare commits

..

No commits in common. "master" and "v2025.12" have entirely different histories.

20 changed files with 33 additions and 113 deletions

5
.env
View File

@ -1,12 +1,9 @@
# 版本号
SHOPRO_VERSION=v2.4.1
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development -生产环境-release
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development
SHOPRO_BASE_URL=http://api-dashboard.yudao.iocoder.cn
# 后端接口 - 体验环境(通过 process.env.NODE_ENV 非 development -体验环境-trial
SHOPRO_TRIAL_BASE_URL=http://api-dashboard.yudao.iocoder.cn/trial
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development
SHOPRO_DEV_BASE_URL=http://127.0.0.1:48080
### SHOPRO_DEV_BASE_URL=http://10.171.1.188:48080

View File

@ -2,7 +2,7 @@
"name": "芋道商城",
"appid": "__UNI__460BC4C",
"description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName": "2026.04",
"versionName": "2025.12",
"versionCode": "183",
"transformPx": false,
"app-plus": {

View File

@ -2,7 +2,7 @@
"id": "shopro",
"name": "shopro",
"displayName": "芋道商城",
"version": "2026.04",
"version": "2025.12",
"description": "芋道商城一套代码同时发行到iOS、Android、H5、微信小程序多个平台请使用手机扫码快速体验强大功能",
"scripts": {
"prettier": "prettier --write \"{pages,sheep}/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
@ -94,7 +94,6 @@
"luch-request": "^3.0.8",
"pinia": "^2.0.33",
"pinia-plugin-persist-uni": "^1.2.0",
"vue": "^3.5.11",
"weixin-js-sdk": "^1.6.0"
},
"devDependencies": {

View File

@ -105,7 +105,7 @@
return;
}
state.pagination.pageNo++;
getRankList();
getList();
}
//

View File

@ -163,7 +163,7 @@
<text class="num font-color">{{ item.brokerageUserCount || 0 }} </text>
</view>
<view>
<text class="num">{{ item.brokerageOrderCount || 0 }}</text
<text class="num">{{ item.orderCount || 0 }}</text
></view
>
<view>
@ -320,7 +320,6 @@
function setType(e) {
state.pagination.list = [];
state.pagination.pageNo = 1;
state.level = e + '';
getTeamList();
}

View File

@ -115,7 +115,7 @@
>
<uni-easyinput
:inputBorder="false"
:value="bankNameLabel"
:value="state.accountInfo.bankName"
placeholder="请选择银行"
suffixIcon="right"
disabled
@ -164,7 +164,7 @@
</template>
<script setup>
import { onBeforeMount, reactive, computed } from 'vue';
import { onBeforeMount, reactive } from 'vue';
import sheep from '@/sheep';
import accountTypeSelect from './components/account-type-select.vue';
import { fen2yuan } from '@/sheep/hooks/useGoods';
@ -199,14 +199,6 @@
bankListSelectedIndex: '', // bankList index
});
const bankNameLabel = computed(() => {
if (!state.accountInfo.bankName || !state.bankList || state.bankList.length === 0) {
return '';
}
const item = state.bankList.find((it) => it.value === state.accountInfo.bankName);
return item ? item.label : '';
});
//
const onAccountSelect = (e) => {
state.accountSelect = e;
@ -308,8 +300,7 @@
function bankChange(e) {
const value = e.detail.value;
state.bankListSelectedIndex = value;
const item = state.bankList[value];
state.accountInfo.bankName = item ? item.value : undefined;
state.accountInfo.bankName = state.bankList[value].label;
}
onBeforeMount(() => {

View File

@ -12,7 +12,6 @@
:color="color"
:tools="tools"
:opacityBgUi="opacityBgUi"
:backgroundColor="navbarBackgroundColor"
@search="(e) => emits('search', e)"
:defaultSearch="defaultSearch"
/>
@ -81,11 +80,6 @@
type: String,
default: 'bg-white',
},
// navbar === 'normal'
navbarBackgroundColor: {
type: String,
default: '',
},
color: {
type: String,
default: '',
@ -219,16 +213,16 @@
// #endif
// 使 onMounted 使 onShow
onMounted(() => {
onMounted(()=>{
// #ifdef MP-ALIPAY
uni.setNavigationBarTitle({
title: '',
title: "",
});
// #endif
if (!isEmpty(shareInfo.value)) {
sheep.$platform.share.updateShareInfo(shareInfo.value);
}
});
})
</script>
<style lang="scss" scoped>

View File

@ -109,7 +109,7 @@
<script setup>
import { computed, reactive, watch } from 'vue';
import sheep from '@/sheep';
import { convertProductPropertyList, initDefaultSelect, fen2yuan } from '@/sheep/hooks/useGoods';
import { convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods';
const headerBg = sheep.$url.css('/static/img/shop/goods/groupon-btn-long.png');
const emits = defineEmits(['change', 'addCart', 'buy', 'close', 'ladder']);
@ -315,8 +315,7 @@
}
changeDisabled(false);
//
initDefaultSelect(propertyList, onSelectSku);
// TODO 12
</script>
<style lang="scss" scoped>

View File

@ -95,12 +95,7 @@
<script setup>
import { computed, reactive, watch } from 'vue';
import sheep from '@/sheep';
import {
formatStock,
convertProductPropertyList,
fen2yuan,
initDefaultSelect,
} from '@/sheep/hooks/useGoods';
import { formatStock, convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods';
const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
const props = defineProps({
@ -310,8 +305,7 @@
}
changeDisabled(false);
//
initDefaultSelect(propertyList, onSelectSku);
// TODO 12
</script>
<style lang="scss" scoped>

View File

@ -1,5 +1,4 @@
import packageInfo from '@/package.json';
import { getWxEnvVersion } from '@/sheep/helper/env';
const { version } = packageInfo;
@ -8,21 +7,7 @@ export let baseUrl;
if (process.env.NODE_ENV === 'development') {
baseUrl = import.meta.env.SHOPRO_DEV_BASE_URL;
} else {
// 非本地 dev 模式开发环境,判断是体验版还是正式版
const wxEnvVersion = getWxEnvVersion();
if (wxEnvVersion === 'trial') {
// 体验版使用体验版服务器地址
baseUrl = import.meta.env.SHOPRO_TRIAL_BASE_URL || import.meta.env.SHOPRO_BASE_URL;
console.log('当前运行环境:体验版');
} else if (wxEnvVersion === 'release') {
// 正式版使用生产服务器地址
baseUrl = import.meta.env.SHOPRO_BASE_URL;
console.log('当前运行环境:正式版');
} else {
// 其他平台或获取失败,使用默认地址
baseUrl = import.meta.env.SHOPRO_BASE_URL;
}
baseUrl = import.meta.env.SHOPRO_BASE_URL;
}
if (typeof baseUrl === 'undefined') {
console.error('请检查.env配置文件是否存在');

View File

@ -1,21 +0,0 @@
/**
* 微信小程序运行环境develop / trial / release
* 其它平台默认 release整个 App 生命周期内不会变缓存一次
*/
let cachedEnvVersion;
export function getWxEnvVersion() {
if (cachedEnvVersion) return cachedEnvVersion;
// #ifdef MP-WEIXIN
try {
cachedEnvVersion = wx.getAccountInfoSync().miniProgram.envVersion;
} catch (e) {
console.log('获取微信小程序环境失败', e);
cachedEnvVersion = 'release';
}
// #endif
// #ifndef MP-WEIXIN
cachedEnvVersion = 'release';
// #endif
return cachedEnvVersion;
}

View File

@ -497,18 +497,3 @@ export function getRewardActivityRuleItemDescriptions(activity) {
});
return result;
}
/** 单规格,要默认选中 */
export function initDefaultSelect(propertyList, onSelectSku) {
if (propertyList.length === 0) {
return;
}
// 遍历每一个属性
for (const property of propertyList) {
const firstValue = (property.values || [])[0];
// 不是禁用直接选中
if (firstValue && !firstValue.disabled) {
onSelectSku(property.id, firstValue.id);
}
}
}

View File

@ -30,9 +30,8 @@ export default {
}
// 调用后端接口,获得 JSSDK 初始化所需的签名
// 微信要求签名 URL 与当前页面去掉 hash 后完全一致;不能直接用 location.origin会丢子路径与 query
const signUrl = location.href.split('#')[0];
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(signUrl);
const url = location.origin;
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(url);
if (code === 0) {
jweixin.config({
debug: false,
@ -58,11 +57,7 @@ export default {
configSuccess = true;
jweixin.error((err) => {
configSuccess = false;
console.error('[wx-jssdk] config error', err, {
href: location.href,
signUrl,
data,
});
console.error('微信 JSSDK 初始化失败', err);
$helper.toast('微信JSSDK:' + err.errMsg);
});
jweixin.ready(() => {

View File

@ -107,7 +107,7 @@ const buildSpmLink = (query, linkAddress = '') => {
};
// 解析Spm
const decryptSpm = async (spm) => {
const decryptSpm = (spm) => {
const user = $store('user');
let shareParamsArray = spm.split('.');
let shareParams = {
@ -168,7 +168,7 @@ const decryptSpm = async (spm) => {
uni.setStorageSync('shareId', shareParams.shareId);
// 已登录 绑定推广员
if (!!user.isLogin) {
await bindBrokerageUser(shareParams.shareId);
bindBrokerageUser(shareParams.shareId);
}
}

View File

@ -230,14 +230,12 @@ const refreshToken = async (config) => {
// 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了
if (!isRefreshToken) {
isRefreshToken = true;
// 1. 如果获取不到刷新令牌,则只能执行登出操作
const refreshToken = getRefreshToken();
if (!refreshToken) {
return handleAuthorized();
}
// 只有真正发起刷新时才标记刷新中,避免无刷新令牌时状态一直卡住,后续 401 不再弹登录框
// https://github.com/yudaocode/yudao-mall-uniapp/issues/38
isRefreshToken = true;
// 2. 进行刷新访问令牌
try {
const refreshTokenResult = await AuthUtil.refreshToken(refreshToken);

View File

@ -8,7 +8,8 @@ import user from './user';
import sys from './sys';
import { baseUrl, h5Url } from '@/sheep/config';
const app = defineStore('app', {
const app = defineStore({
id: 'app',
state: () => ({
paramsForTabbar: {}, // 为全局tabbar跳转传参用。原因是 tabbar 无法传参,只能通过全局状态传递
info: {
@ -73,7 +74,7 @@ const app = defineStore('app', {
this.info = {
name: '芋道商城',
logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
version: '2026.04',
version: '2025.12',
copyright: '全部开源,个人与企业可 100% 免费使用',
copytime: 'Copyright© 2018-2025',

View File

@ -1,7 +1,8 @@
import { defineStore } from 'pinia';
import CartApi from '@/sheep/api/trade/cart';
const cart = defineStore('cart', {
const cart = defineStore({
id: 'cart',
state: () => ({
list: [], // 购物车列表invalidList + validList
selectedIds: [], // 已选列表

View File

@ -1,6 +1,7 @@
import { defineStore } from 'pinia';
const modal = defineStore('modal', {
const modal = defineStore({
id: 'modal',
state: () => ({
auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
share: false, // 分享弹框

View File

@ -1,7 +1,8 @@
import { defineStore } from 'pinia';
import app from './app';
const sys = defineStore('sys', {
const sys = defineStore({
id: 'sys',
state: () => ({
theme: '', // 主题,
mode: 'light', // 明亮模式、暗黑模式(暂未支持)

View File

@ -36,7 +36,8 @@ const defaultNumData = {
},
};
const user = defineStore('user', {
const user = defineStore({
id: 'user',
state: () => ({
userInfo: clone(defaultUserInfo), // 用户信息
userWallet: clone(defaultUserWallet), // 用户钱包信息