Compare commits
17 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
75eed2ba19 | |
|
|
9e7ef1e9f1 | |
|
|
3a27171cda | |
|
|
014b0dd508 | |
|
|
c034b59a7b | |
|
|
0533985189 | |
|
|
43d2d02e8e | |
|
|
b6b0ca3dbd | |
|
|
0d0017eac7 | |
|
|
5c2377b482 | |
|
|
1346f8bf3b | |
|
|
d18d67dd62 | |
|
|
f2bfb2d79b | |
|
|
3c3ee616fd | |
|
|
beca206592 | |
|
|
becfc58eca | |
|
|
d2f29362a0 |
|
|
@ -2,7 +2,7 @@
|
|||
"name": "芋道商城",
|
||||
"appid": "__UNI__460BC4C",
|
||||
"description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
|
||||
"versionName": "2025.12",
|
||||
"versionName": "2026.04",
|
||||
"versionCode": "183",
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"id": "shopro",
|
||||
"name": "shopro",
|
||||
"displayName": "芋道商城",
|
||||
"version": "2025.12",
|
||||
"version": "2026.04",
|
||||
"description": "芋道商城,一套代码,同时发行到iOS、Android、H5、微信小程序多个平台,请使用手机扫码快速体验强大功能",
|
||||
"scripts": {
|
||||
"prettier": "prettier --write \"{pages,sheep}/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
return;
|
||||
}
|
||||
state.pagination.pageNo++;
|
||||
getList();
|
||||
getRankList();
|
||||
}
|
||||
|
||||
// 上拉加载更多
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@
|
|||
<text class="num font-color">{{ item.brokerageUserCount || 0 }} </text>人
|
||||
</view>
|
||||
<view>
|
||||
<text class="num">{{ item.orderCount || 0 }}</text
|
||||
<text class="num">{{ item.brokerageOrderCount || 0 }}</text
|
||||
>单</view
|
||||
>
|
||||
<view>
|
||||
|
|
@ -320,6 +320,7 @@
|
|||
|
||||
function setType(e) {
|
||||
state.pagination.list = [];
|
||||
state.pagination.pageNo = 1;
|
||||
state.level = e + '';
|
||||
getTeamList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
>
|
||||
<uni-easyinput
|
||||
:inputBorder="false"
|
||||
:value="state.accountInfo.bankName"
|
||||
:value="bankNameLabel"
|
||||
placeholder="请选择银行"
|
||||
suffixIcon="right"
|
||||
disabled
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onBeforeMount, reactive } from 'vue';
|
||||
import { onBeforeMount, reactive, computed } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import accountTypeSelect from './components/account-type-select.vue';
|
||||
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
|
|
@ -199,6 +199,14 @@
|
|||
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;
|
||||
|
|
@ -300,7 +308,8 @@
|
|||
function bankChange(e) {
|
||||
const value = e.detail.value;
|
||||
state.bankListSelectedIndex = value;
|
||||
state.accountInfo.bankName = state.bankList[value].label;
|
||||
const item = state.bankList[value];
|
||||
state.accountInfo.bankName = item ? item.value : undefined;
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
:color="color"
|
||||
:tools="tools"
|
||||
:opacityBgUi="opacityBgUi"
|
||||
:backgroundColor="navbarBackgroundColor"
|
||||
@search="(e) => emits('search', e)"
|
||||
:defaultSearch="defaultSearch"
|
||||
/>
|
||||
|
|
@ -80,6 +81,11 @@
|
|||
type: String,
|
||||
default: 'bg-white',
|
||||
},
|
||||
// 顶部导航栏背景颜色(仅在 navbar === 'normal' 时生效)
|
||||
navbarBackgroundColor: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '',
|
||||
|
|
@ -213,16 +219,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>
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@
|
|||
<script setup>
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import { convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
import { convertProductPropertyList, initDefaultSelect, 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,7 +315,8 @@
|
|||
}
|
||||
|
||||
changeDisabled(false);
|
||||
// TODO 芋艿:待讨论的优化点:1)单规格,要不要默认选中;2)默认要不要选中第一个规格
|
||||
// 初始化默认选中规格中的第一个,如果不需要,注释这段代码即可
|
||||
initDefaultSelect(propertyList, onSelectSku);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,12 @@
|
|||
<script setup>
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import { formatStock, convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
import {
|
||||
formatStock,
|
||||
convertProductPropertyList,
|
||||
fen2yuan,
|
||||
initDefaultSelect,
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
|
||||
const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
|
||||
const props = defineProps({
|
||||
|
|
@ -305,7 +310,8 @@
|
|||
}
|
||||
|
||||
changeDisabled(false);
|
||||
// TODO 芋艿:待讨论的优化点:1)单规格,要不要默认选中;2)默认要不要选中第一个规格
|
||||
// 初始化默认选中规格中的第一个,如果不需要,注释这段代码即可
|
||||
initDefaultSelect(propertyList, onSelectSku);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -497,3 +497,18 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@ export default {
|
|||
}
|
||||
|
||||
// 调用后端接口,获得 JSSDK 初始化所需的签名
|
||||
const url = location.origin;
|
||||
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(url);
|
||||
// 微信要求签名 URL 与当前页面去掉 hash 后完全一致;不能直接用 location.origin(会丢子路径与 query)
|
||||
const signUrl = location.href.split('#')[0];
|
||||
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(signUrl);
|
||||
if (code === 0) {
|
||||
jweixin.config({
|
||||
debug: false,
|
||||
|
|
@ -57,7 +58,11 @@ export default {
|
|||
configSuccess = true;
|
||||
jweixin.error((err) => {
|
||||
configSuccess = false;
|
||||
console.error('微信 JSSDK 初始化失败', err);
|
||||
console.error('[wx-jssdk] config error', err, {
|
||||
href: location.href,
|
||||
signUrl,
|
||||
data,
|
||||
});
|
||||
$helper.toast('微信JSSDK:' + err.errMsg);
|
||||
});
|
||||
jweixin.ready(() => {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ import user from './user';
|
|||
import sys from './sys';
|
||||
import { baseUrl, h5Url } from '@/sheep/config';
|
||||
|
||||
const app = defineStore({
|
||||
id: 'app',
|
||||
const app = defineStore('app', {
|
||||
state: () => ({
|
||||
paramsForTabbar: {}, // 为全局tabbar跳转传参用。原因是 tabbar 无法传参,只能通过全局状态传递
|
||||
info: {
|
||||
|
|
@ -74,7 +73,7 @@ const app = defineStore({
|
|||
this.info = {
|
||||
name: '芋道商城',
|
||||
logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
|
||||
version: '2025.12',
|
||||
version: '2026.04',
|
||||
copyright: '全部开源,个人与企业可 100% 免费使用',
|
||||
copytime: 'Copyright© 2018-2025',
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import CartApi from '@/sheep/api/trade/cart';
|
||||
|
||||
const cart = defineStore({
|
||||
id: 'cart',
|
||||
const cart = defineStore('cart', {
|
||||
state: () => ({
|
||||
list: [], // 购物车列表(invalidList + validList)
|
||||
selectedIds: [], // 已选列表
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { defineStore } from 'pinia';
|
||||
|
||||
const modal = defineStore({
|
||||
id: 'modal',
|
||||
const modal = defineStore('modal', {
|
||||
state: () => ({
|
||||
auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
|
||||
share: false, // 分享弹框
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import app from './app';
|
||||
|
||||
const sys = defineStore({
|
||||
id: 'sys',
|
||||
const sys = defineStore('sys', {
|
||||
state: () => ({
|
||||
theme: '', // 主题,
|
||||
mode: 'light', // 明亮模式、暗黑模式(暂未支持)
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ const defaultNumData = {
|
|||
},
|
||||
};
|
||||
|
||||
const user = defineStore({
|
||||
id: 'user',
|
||||
const user = defineStore('user', {
|
||||
state: () => ({
|
||||
userInfo: clone(defaultUserInfo), // 用户信息
|
||||
userWallet: clone(defaultUserWallet), // 用户钱包信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue