代码提交

main
gzy 4 months ago
parent 237cde5ae0
commit 8fed9a410f

@ -1,5 +1,5 @@
{
"name": "芋道商城",
"name": "郑大商城",
"appid": "__UNI__460BC4C",
"description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName": "2.1.0",

@ -1,32 +1,15 @@
<!-- 用户信息 -->
<template>
<s-layout title="用户信息" class="set-userinfo-wrap">
<uni-forms
:model="state.model"
:rules="state.rules"
labelPosition="left"
border
class="form-box"
>
<uni-forms :model="state.model" :rules="state.rules" labelPosition="left" border class="form-box">
<!-- 头像 -->
<view class="ss-flex ss-row-center ss-col-center ss-p-t-60 ss-p-b-0 bg-white">
<view class="header-box-content">
<su-image
class="content-img"
isPreview
:current="0"
:src="state.model?.avatar"
:height="160"
:width="160"
:radius="80"
mode="scaleToFill"
/>
<su-image class="content-img" isPreview :current="0" :src="state.model?.avatar" :height="160" :width="160"
:radius="80" mode="scaleToFill" />
<view class="avatar-action">
<!-- #ifdef MP -->
<button
class="ss-reset-button avatar-action-btn"
open-type="chooseAvatar"
@chooseavatar="onChooseAvatar">
<button class="ss-reset-button avatar-action-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
修改
</button>
<!-- #endif -->
@ -40,25 +23,16 @@
<view class="bg-white ss-p-x-30">
<!-- 昵称 + 性别 -->
<uni-forms-item name="nickname" label="昵称">
<uni-easyinput
v-model="state.model.nickname"
type="nickname"
placeholder="设置昵称"
:inputBorder="false"
:placeholderStyle="placeholderStyle"
/>
<uni-easyinput v-model="state.model.nickname" type="nickname" placeholder="设置昵称" :inputBorder="false"
:placeholderStyle="placeholderStyle" />
</uni-forms-item>
<uni-forms-item name="sex" label="性别">
<view class="ss-flex ss-col-center ss-h-100">
<radio-group @change="onChangeGender" class="ss-flex ss-col-center">
<label class="radio" v-for="item in sexRadioMap" :key="item.value">
<view class="ss-flex ss-col-center ss-m-r-32">
<radio
:value="item.value"
color="var(--ui-BG-Main)"
style="transform: scale(0.8)"
:checked="parseInt(item.value) === state.model?.sex"
/>
<radio :value="item.value" color="var(--ui-BG-Main)" style="transform: scale(0.8)"
:checked="parseInt(item.value) === state.model?.sex" />
<view class="gender-name">{{ item.name }}</view>
</view>
</label>
@ -67,15 +41,8 @@
</uni-forms-item>
<uni-forms-item name="mobile" label="手机号" @tap="onChangeMobile">
<uni-easyinput
v-model="userInfo.mobile"
placeholder="请绑定手机号"
:inputBorder="false"
disabled
:styles="{ disableColor: '#fff' }"
:placeholderStyle="placeholderStyle"
:clearable="false"
>
<uni-easyinput v-model="userInfo.mobile" placeholder="请绑定手机号" :inputBorder="false" disabled
:styles="{ disableColor: '#fff' }" :placeholderStyle="placeholderStyle" :clearable="false">
<template v-slot:right>
<view class="ss-flex ss-col-center">
<su-radio v-if="userInfo.verification?.mobile" :modelValue="true" />
@ -87,23 +54,19 @@
</uni-easyinput>
</uni-forms-item>
<uni-forms-item name="level" label="会员等级">
<uni-easyinput v-model="state.laevelname" :inputBorder="false" disabled :styles="{ disableColor: '#fff' }"
:placeholderStyle="placeholderStyle" :clearable="false">
</uni-easyinput>
</uni-forms-item>
<uni-forms-item name="password" label="登录密码" @tap="onSetPassword">
<uni-easyinput
v-model="userInfo.password"
placeholder="点击修改登录密码"
:inputBorder="false"
:styles="{ disableColor: '#fff' }"
disabled
placeholderStyle="color:#BBBBBB;font-size:28rpx;line-height:normal"
:clearable="false"
>
<uni-easyinput v-model="userInfo.password" placeholder="点击修改登录密码" :inputBorder="false"
:styles="{ disableColor: '#fff' }" disabled
placeholderStyle="color:#BBBBBB;font-size:28rpx;line-height:normal" :clearable="false">
<template v-slot:right>
<view class="ss-flex ss-col-center">
<su-radio
class="ss-flex"
v-if="userInfo.verification?.password"
:modelValue="true"
/>
<su-radio class="ss-flex" v-if="userInfo.verification?.password" :modelValue="true" />
<button v-else class="ss-reset-button ss-flex ss-col-center ss-row-center">
<text class="_icon-forward" style="color: #bbbbbb; font-size: 26rpx" />
</button>
@ -115,14 +78,8 @@
<view class="bg-white ss-m-t-14">
<uni-list>
<uni-list-item
clickable
@tap="sheep.$router.go('/pages/user/address/list')"
title="地址管理"
showArrow
:border="false"
class="list-border"
/>
<uni-list-item clickable @tap="sheep.$router.go('/pages/user/address/list')" title="地址管理" showArrow
:border="false" class="list-border" />
</uni-list>
</view>
</uni-forms>
@ -132,40 +89,24 @@
<view class="title-box ss-p-l-30">第三方账号绑定</view>
<view class="account-list ss-flex ss-row-between">
<view v-if="'WechatOfficialAccount' === sheep.$platform.name" class="ss-flex ss-col-center">
<image
class="list-img"
:src="sheep.$url.static('/static/img/shop/platform/WechatOfficialAccount.png')"
/>
<image class="list-img" :src="sheep.$url.static('/static/img/shop/platform/WechatOfficialAccount.png')" />
<text class="list-name">微信公众号</text>
</view>
<view v-if="'WechatMiniProgram' === sheep.$platform.name" class="ss-flex ss-col-center">
<image
class="list-img"
:src="sheep.$url.static('/static/img/shop/platform/WechatMiniProgram.png')"
/>
<image class="list-img" :src="sheep.$url.static('/static/img/shop/platform/WechatMiniProgram.png')" />
<text class="list-name">微信小程序</text>
</view>
<view v-if="'App' === sheep.$platform.name" class="ss-flex ss-col-center">
<image
class="list-img"
:src="sheep.$url.static('/static/img/shop/platform/wechat.png')"
/>
<image class="list-img" :src="sheep.$url.static('/static/img/shop/platform/wechat.png')" />
<text class="list-name">微信开放平台</text>
</view>
<view class="ss-flex ss-col-center">
<view class="info ss-flex ss-col-center" v-if="state.thirdInfo">
<image
class="avatar ss-m-r-20"
:src="sheep.$url.cdn(state.thirdInfo.avatar)"
/>
<image class="avatar ss-m-r-20" :src="sheep.$url.cdn(state.thirdInfo.avatar)" />
<text class="name">{{ state.thirdInfo.nickname }}</text>
</view>
<view class="bind-box ss-m-l-20">
<button
v-if="state.thirdInfo.openid"
class="ss-reset-button relieve-btn"
@tap="unBindThirdOauth"
>
<button v-if="state.thirdInfo.openid" class="ss-reset-button relieve-btn" @tap="unBindThirdOauth">
解绑
</button>
<button v-else class="ss-reset-button bind-btn" @tap="bindThirdOauth"></button>
@ -189,11 +130,12 @@
import { showAuthModal } from '@/sheep/hooks/useModal';
import FileApi from '@/sheep/api/infra/file';
import UserApi from '@/sheep/api/member/user';
// const laevelname = ''
const state = reactive({
model: {}, //
rules: {},
thirdInfo: {}, //
laevelname:'不是会员'
});
const placeholderStyle = 'color:#BBBBBB;font-size:28rpx;line-height:normal';
@ -293,6 +235,10 @@
const getUserInfo = async () => {
//
const userInfo = await sheep.$store('user').getInfo();
if (userInfo.level!==null){
state.laevelname = userInfo.level.name
console.log(state.laevelname,'78789');
}
state.model = clone(userInfo);
//

@ -1,7 +1,7 @@
<template>
<!-- 规格弹窗 -->
<su-popup :show="show" round="10" @close="emits('close')">
<!-- SKU 信息 -->
<!-- SKU 信息 -->
<view class="ss-modal-box bg-white ss-flex-col">
<view class="modal-header ss-flex ss-col-center">
<view class="header-left ss-m-r-30">
@ -22,7 +22,7 @@
</view>
</view>
<!-- 属性选择 -->
<!-- 属性选择 -->
<view class="modal-content ss-flex-1">
<scroll-view scroll-y="true" class="modal-content-scroll" @touchmove.stop>
<view class="sku-item ss-m-b-20" v-for="property in propertyList" :key="property.id">
@ -42,13 +42,14 @@
</view>
<view class="buy-num-box ss-flex ss-col-center ss-row-between ss-m-b-40">
<view class="label-text">购买数量</view>
<su-number-box :min="1" :max="state.selectedSku.stock" :step="1"
v-model="state.selectedSku.goods_num" @change="onNumberChange($event)" />
<!-- :max="state.selectedSku.stock" -->
<su-number-box :min="1" :max="1" :step="1" v-model="state.selectedSku.goods_num"
@change="onNumberChange($event)" />
</view>
</scroll-view>
</view>
<!-- 操作区 -->
<!-- 操作区 -->
<view class="modal-footer border-top">
<view class="buy-box ss-flex ss-col-center ss-flex ss-col-center ss-row-center">
<button class="ss-reset-button add-btn ui-Shadow-Main" @tap="onAddCart"></button>

Loading…
Cancel
Save