# Conflicts:
#	jiuyi2/pages.json
This commit is contained in:
sx 2025-02-28 13:12:50 +08:00
commit 944f9da0ed
14 changed files with 1244 additions and 654 deletions

View File

@ -96,8 +96,10 @@
//
util.getUserinfo().then(rs => {
if (userinfo.isRealName) {
// im
util.loginTencent(userinfo)
}
})
}
}

View File

@ -416,6 +416,45 @@ const mine = {
method: 'POST',
})
},
/**
* 修改账号
* @param {Object} param
*/
updateAccount(param) {
return util.request({
url: `/user/home/update/account`,
data: param.data,
method: 'POST',
load: true,
})
},
/**
* 修改手机号
* @param {Object} param
*/
updatePhone(param) {
return util.request({
url: `/user/login/updatePhone`,
data: param.data,
method: 'POST',
load: true,
})
},
/**
* 修改登录密码
* @param {Object} param
*/
updatePassword(param) {
return util.request({
url: `/user/login/updatePassword`,
data: param.data,
method: 'POST',
load: true,
})
},
}
export default mine

View File

@ -240,9 +240,9 @@ const shop = {
*/
merchant(param) {
return util.request({
url: `/shopify/merchant`,
url: `/shopify/appMerInfoApi/getMerDetail`,
method: 'GET',
path: param.path,
query: param.query,
load: true,
})
},

View File

@ -224,6 +224,7 @@ function handleAlert(ev) {
//
function getNoReadNum() {
if (userinfo.value.isRealName) {
// sdk
let isReady = uni.$chat.isReady();
if (!isReady) {
@ -237,7 +238,7 @@ function getNoReadNum() {
const unreadCount = uni.$chat.getTotalUnreadMessageCount();
noReadNum.value = +unreadCount > 99 ? '99+' : unreadCount;
// #endif
}
}
</script>

View File

@ -89,23 +89,26 @@ function handleBuy() {
//
function toCustomer() {
api.shop.getCustomerService({ merchantId: props.detail.merId }).then(rs => {
if (rs.code == 200) {
let param = {};
param.type = 'C2C'
param.name = `${props.detail.merName}`
param.msgId = `${rs.data.serviceId}`
param.isCustomer = true
util.toChat(param)
uni.navigateTo({
url: util.setUrl('/pages/news/chat/chat', param)
})
} else {
util.alert(rs.msg)
}
url: util.setUrl('/pages/mine/setting/feedback')
})
// api.shop.getCustomerService({ merchantId: props.detail.merId }).then(rs => {
// if (rs.code == 200) {
// let param = {};
// param.type = 'C2C'
// param.name = `${props.detail.merName}`
// param.msgId = `${rs.data.serviceId}`
// param.isCustomer = true
// util.toChat(param)
// uni.navigateTo({
// url: util.setUrl('/pages/news/chat/chat', param)
// })
// } else {
// util.alert(rs.msg)
// }
// })
}
</script>
@ -116,7 +119,7 @@ function toCustomer() {
<view class="menu df fdr jcsb aic">
<view class="option df fdc aic">
<image class="wh30" src="/static/store.png" mode="aspectFit" />
<text class="text mt10">店铺</text>
<text class="text mt10" @click="link(`/pages/shop/store/index?storeId=${detail.merId}`)">店铺</text>
</view>
<view class="option df fdc aic" @click="handleCollect">

View File

@ -753,8 +753,27 @@
{
"navigationBarTitleText" : "隐私设置"
}
},
{
"path": "pages/mine/setting/updateAccount",
"style": {
"navigationBarTitleText": "修改账号"
}
},
{
"path": "pages/mine/setting/updatePhoneNum",
"style": {
"navigationBarTitleText": "修改手机号"
}
},
{
"path": "pages/mine/setting/loginPassword",
"style": {
"navigationBarTitleText": "登录密码"
}
}
],
"subPackages": [
{
"root": "TUIKit",

View File

@ -58,7 +58,6 @@ function toCustomer() {
util.toChat(param)
uni.navigateTo({
url: util.setUrl('/pages/news/chat/chat', param)
})

View File

@ -0,0 +1,118 @@
<script setup>
/**
* 修改账号
*/
import {
ref,
reactive,
computed,
} from 'vue'
import {
useStore
} from 'vuex'
//
import util from '@/common/js/util.js'
// api
import api from '@/api/index.js'
//
import CryptoJS from 'crypto-js';
//
const showPwd = ref(false)
const showPwds = ref(false)
//
const store = useStore()
//
const form = reactive({
oldPassword: '',
password: ''
})
//
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
//
function handleSubmit() {
const data = {
...form
}
//
if (!data.oldPassword) {
util.alert('请输入旧密码')
return
}
if (!data.password) {
util.alert('请输入新密码')
return
}
data.oldPassword = CryptoJS.MD5(data.oldPassword).toString();
data.password = CryptoJS.MD5(data.password).toString();
api.mine.updatePassword({ data }).then(rs => {
if (rs.code == 200) {
util.alert('修改成功')
util.getUserinfo()
setTimeout(() => {
uni.navigateBack()
}, 500)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="container">
<view class="line df aic">
<view class="key">旧密码</view>
<view class="value">
<input :password="showPwd ? false : true" v-model="form.oldPassword" placeholder="请输入旧密码" />
</view>
<view class="btn sm ml20 plr20">
<uni-icons :type="showPwd ? 'eye' : 'eye-slash'" color="#999" size="40rpx"
@click="showPwd = !showPwd" />
</view>
</view>
<view class="line df aic">
<view class="key">新密码</view>
<view class="value">
<input :password="showPwds ? false : true" v-model="form.password" placeholder="请输入新密码" />
</view>
<view class="btn sm ml20 plr20">
<uni-icons :type="showPwds ? 'eye' : 'eye-slash'" color="#999" size="40rpx"
@click="showPwds = !showPwds" />
</view>
</view>
<view class="btn bar lg black mtb60 mlr60" @click="handleSubmit">提交</view>
</view>
</template>
<style scoped lang="scss">
//
.container {
padding: 50rpx 30rpx;
color: #333333;
font-size: 34rpx;
.line {
padding: 35rpx 10rpx;
}
.key {
width: 200rpx;
}
.value {
flex: 1;
font-size: 28rpx;
}
}
</style>

View File

@ -151,14 +151,20 @@
</view>
</view>
<view class="line rows">
<view class="">修改账号</view>
<view class="f1 tar c999 f28">{{userinfo.account}}</view>
<view class="line rows" @click="link('/pages/mine/setting/updateAccount')">
<view class="key">修改账号</view>
<view class="col f1 ml20 tar c999 f28">
<view class="">{{ userinfo.account }}</view>
</view>
<uni-icons class="ml20" type="right" />
</view>
<view class="line rows">
<view class="">绑定手机号</view>
<view class="f1 tar c999 f28">{{userinfo.phoneNumber}}</view>
<view class="line rows" @click="link('/pages/mine/setting/updatePhoneNum')">
<view class="key">修改手机号</view>
<view class="col f1 ml20 tar c999 f28">
<view class="">{{ userinfo.phoneNumber }}</view>
</view>
<uni-icons class="ml20" type="right" />
</view>
<view class="line rows" @click="link('/pages/mine/realname')">
@ -189,7 +195,7 @@
<uni-icons type="right" />
</view>
<view class="line rows">
<view class="line rows" @click="link('/pages/mine/setting/loginPassword')">
<view class="">登录密码</view>
<uni-icons type="right" />
</view>

View File

@ -0,0 +1,93 @@
<script setup>
/**
* 修改账号
*/
import {
reactive,
computed,
} from 'vue'
import {
useStore
} from 'vuex'
//
import util from '@/common/js/util.js'
// api
import api from '@/api/index.js'
//
const store = useStore()
//
const form = reactive({
id: '',
account: ''
})
//
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
//
function handleSubmit() {
const data = {
...form
}
//
if (!data.account) {
util.alert('请输入账号')
return
}
data.id = userinfo.value.id
api.mine.updateAccount({ data }).then(rs => {
if (rs.code == 200) {
util.alert('修改成功')
util.getUserinfo()
setTimeout(() => {
uni.navigateBack()
}, 500)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="container">
<view class="line df aic">
<view class="key">账号</view>
<view class="value">
<input class="input" type="text" v-model="form.account" placeholder="请输入账号" />
</view>
</view>
<view class="btn bar lg black mtb60 mlr60" @click="handleSubmit">提交</view>
</view>
</template>
<style scoped lang="scss">
//
.container {
padding: 50rpx 30rpx;
color: #333333;
font-size: 34rpx;
.line {
padding: 35rpx 10rpx;
}
.key {
width: 200rpx;
}
.value {
flex: 1;
font-size: 28rpx;
}
}
</style>

View File

@ -0,0 +1,118 @@
<script setup>
/**
* 修改手机号
*/
import {
reactive,
computed,
} from 'vue'
import {
useStore
} from 'vuex'
//
import getCode from '@/components/getCode/getCode.vue'
//
import util from '@/common/js/util.js'
// api
import api from '@/api/index.js'
//
const store = useStore()
//
const form = reactive({
phoneNumber: '',
verifyCode: ''
})
//
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
//
function handleSubmit() {
const data = {
...form
}
//
if (!data.phoneNumber) {
util.alert('请输入手机号')
return
}
if (!data.verifyCode) {
util.alert('请输入验证码')
return
}
api.mine.updatePhone({ data }).then(rs => {
if (rs.code == 200) {
util.alert('修改成功')
util.getUserinfo()
setTimeout(() => {
uni.navigateBack()
}, 500)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="container">
<view class="line df aic">
<view class="key">手机号</view>
<view class="value">
<input class="input" type="text" v-model="form.phoneNumber" placeholder="请输入手机号" />
</view>
</view>
<view class="line df aic">
<view class="key">验证码</view>
<view class="value">
<input type="text" v-model="form.verifyCode" placeholder="请输入验证码" class="f1" />
</view>
<view class="getCode btn sm ml20 plr20">
<getCode :phone="form.phoneNumber" />
</view>
</view>
<view class="btn bar lg black mtb60 mlr60" @click="handleSubmit">提交</view>
</view>
</template>
<style scoped lang="scss">
//
.container {
padding: 50rpx 30rpx;
color: #333333;
font-size: 34rpx;
.line+.line {
border-top: 2rpx solid #ddd;
}
.line {
padding: 35rpx 10rpx;
}
.key {
width: 200rpx;
}
.value {
flex: 1;
font-size: 28rpx;
}
}
//
.getCode {
color: #666;
background-color: #fff;
}
</style>

View File

@ -55,6 +55,7 @@
user.id = userinfo.id + ''
user.birthday = userinfo.birthday
user.avatar = userinfo.avatar
user.email = userinfo.email
//
genderIndex.value = gender.findIndex(item => item.id == userinfo.sex)
}
@ -100,6 +101,11 @@
//
if (gender[genderIndex.value]) user.sex = gender[genderIndex.value].id
if (!IsEmail(user.email)) {
util.alert('邮箱格式不正确!')
return
}
const data = {
...user,
}
@ -127,6 +133,12 @@
})
})
}
//
function IsEmail(str) {
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
return reg.test(str);
}
</script>
<template>
@ -195,6 +207,14 @@
<uni-icons type="right" />
</view>
<view class="line rows ptb20">
<view class="key">邮箱</view>
<view class="value tar f1">
<input type="text" v-model="user.email" placeholder="请输入你的邮箱" />
</view>
<uni-icons type="right" />
</view>
<view class="line ptb20">
<view class="key">个性签名</view>
<view class="value textareaBox inputBox mt20 ptb20 plr20">

View File

@ -111,6 +111,7 @@
}).then(rs => {
if (rs.code == 200) {
util.alert('创建成功')
createGroup(data)
setTimeout(() => {
form.name = ''
@ -127,6 +128,15 @@
})
}
function createGroup(data) {
uni.$chat.createGroup({
type: TencentCloudChat.TYPES.GRP_PUBLIC,
name: data.name,
groupID: data.groupId,
avatar: data.groupFaceUrl
})
}
//
function uploadImg() {
util.upload_image({

View File

@ -1,18 +1,25 @@
<script setup>
//
import {
ref
computed,
reactive,
ref,
defineExpose,
} from 'vue'
import {
onLoad,
onPageScroll
} from '@dcloudio/uni-app';
//
import util from '@/common/js/util.js'
//
import apex from '@/components/header/apex.vue'
//
import productList from '@/components/shop/productList/productList'
import api from '@/api/index.js'
//
const filteredList = ref([{
label: '默认',
@ -39,9 +46,25 @@
const apexBgColor = ref('#ffffff00')
// id
const storeId = ref('')
//
const detail = reactive({})
//
const listPrototype = reactive({
pageSize: 10,
pageNum: 1,
total: 0,
//
merId: '',
data: [],
})
//
const userinfo = computed(() => uni.$store.state.userinfo || {})
onLoad((option) => {
if (option.storeId) storeId.value = option.storeId
getDetail()
listPrototype.merId = storeId.value
getList()
})
onPageScroll((ev) => {
@ -50,11 +73,14 @@
//
function getDetail() {
//
api.shop.merchant({
path: [id.value],
query: {
merId: storeId.value,
userId: userinfo.value.id,
}
}).then(rs => {
if (rs.code == 200) {
Object.assign(detail, {}, rs.data)
return
}
util.alert({
@ -63,6 +89,110 @@
});
})
}
//
function handleCollectStore() {
api.shop.followShop({
data: {
shopId: storeId.value,
status: {
0: 1,
1: 0,
}[detail.isFollow]
}
}).then(rs => {
if (rs.code == 200) {
//
detail.isFollow = {
0: 1,
1: 0,
}[detail.isFollow]
//
detail.followNum = rs.data
getDetail()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function toCustomer() {
uni.navigateTo({
url: util.setUrl('/pages/mine/setting/feedback')
})
// api.shop.getCustomerService({ merchantId: storeId.value }).then(rs => {
// if (rs.code == 200) {
// let param = {};
// param.type = 'C2C'
// param.name = `${detail.name}`
// param.msgId = `${rs.data.serviceId}`
// param.isCustomer = true
// util.toChat(param)
// uni.navigateTo({
// url: util.setUrl('/pages/news/chat/chat', param)
// })
// } else {
// util.alert(rs.msg)
// }
// })
}
//
function getList() {
api.shop.getProduct({
data: {
pageSize: listPrototype.pageSize,
pageNum: listPrototype.pageNum,
//
merId: listPrototype.merId,
},
}).then(rs => {
if (rs.code == 200) {
if (listPrototype.pageNum == 1) listPrototype.data.length = []
listPrototype.data.push(...rs.rows)
listPrototype.total = rs.total
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}).finally(rs => {
uni.stopPullDownRefresh()
})
}
//
function handleItem(item) {
uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/index', {
productId: item.id
})
})
}
//
function refreshList() {
listPrototype.pageNum = 1
listPrototype.total = 0
getList()
}
//
function getMoreList() {
if (listPrototype.total <= listPrototype.data.length) return
listPrototype.pageNum++
getList()
}
defineExpose({
refreshList,
getMoreList,
})
</script>
<template>
@ -71,25 +201,24 @@
<apex :bgColor="apexBgColor" mode="flex">
<template #content>
<view class="search df jcr">
<view class="">
<view class="" v-if="0">
<image class="wh50" src="/static/share2.png" mode="aspectFit" />
</view>
</view>
</template>
</apex>
<!-- -->
<view class="shopHeaderBg"></view>
<!-- 店铺卡片 -->
<view class="store pr rows ptb25 plr25 mt40">
<!-- 店铺头像 -->
<image class="wh120 fs0 br10" src="/static/logo.png" mode="aspectFill" />
<image class="wh120 fs0 br10" :src="detail.rectangleLogo" mode="aspectFill" />
<!-- 店铺信息 名称 评分 关注数量 -->
<view class="info f1 ml20">
<!-- 店铺名称 -->
<view class="c333 f28">
<text>店铺名称</text>
<text>{{ detail.name }}</text>
</view>
<view class="df aic mt10">
@ -101,7 +230,7 @@
</view>
<!-- 关注数量 -->
<view class="c666 f24">
<text>123关注</text>
<text>{{ detail.followNum }}关注</text>
</view>
</view>
</view>
@ -109,13 +238,14 @@
<!-- 按钮区 -->
<view class="btns w150">
<view>
<view class="btn ti warmHollow fmid" @click="followButton">
<uni-icons class="mr10" color="#FF9B27" type="plusempty" size="13" />
<text>关注</text>
<view @click="handleCollectStore" class="btn sm warm fmid fdr plr30">
<uni-icons class="mr10" color="#fff" type="plusempty" size="13" v-if="detail.isFollow != 1" />
<text class="cfff f28" v-else></text>
<text class="cfff f28">关注</text>
</view>
</view>
<view class="mt10">
<view class="mt10" @click="toCustomer">
<view class="btn ti warmHollow fmid">
<image class="kefu wh30" src="/static/customer-service1.png" mode="aspectFit" />
<text>客服</text>
@ -126,14 +256,46 @@
<!-- 商品列表 -->
<view class="product oh ptb30 plr30">
<productList ref="product" />
<view class="list">
<view class="item oh bfff br20" v-for="(item, index) in listPrototype.data" :key="index"
@click="handleItem(item)">
<!-- 需要展示的图 -->
<image class="poster" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
<!-- 标题 -->
<view class="main plr20">
<view class="title mtb10 thd c333 f30">{{ item.name }}</view>
<view class="info mtb10 df aic">
<!-- 价格 -->
<view class="price thd wsn cFF9B27">
<text class="txt f20"></text>
<text class="txt f36">{{ item.price }}</text>
</view>
<!-- 销量 -->
<view class="sales fs0 thd wsn ml10 c999 f26">销量{{ item.sales }}</view>
<view class="f1"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
//
.store {
// margin-top: -50rpx;
//
.list {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20rpx;
//
.item {
.poster {
width: 100%;
height: 340rpx;
border-radius: 20rpx 20rpx 0 0;
}
}
}
</style>