设置密码 会员

This commit is contained in:
魏啾
2024-05-23 11:21:11 +08:00
parent d0cf4a5cc6
commit 8386120c87
9 changed files with 259 additions and 75 deletions

View File

@@ -13,9 +13,9 @@ export default {
return uni.api.get("/product/orderConfirm", data); return uni.api.get("/product/orderConfirm", data);
}, },
// 会员支付 // 会员支付
accountPay(data) { accountPay(data) {
return uni.api.get("/pay/accountPay", data); return uni.api.get("/pay/accountPay", data);
}, },
// 下单 // 下单
creatGroupOrder(data) { creatGroupOrder(data) {
return uni.api.post("/groupOrderInfo/creatGroupOrder", data); return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
@@ -68,7 +68,7 @@ export default {
return uni.api.post("/pay/modfiyOrderInfo", data); return uni.api.post("/pay/modfiyOrderInfo", data);
}, },
// 获取余额 // 获取余额
shopUserInfo(data) { shopUserInfo(data) {
return uni.api.get("/user/shopUserInfo", data); return uni.api.get("/user/shopUserInfo", data);
}, },
// 优惠加倍 // 优惠加倍
@@ -112,9 +112,6 @@ export default {
orderfindCoupons(data) { //系统优惠券 orderfindCoupons(data) { //系统优惠券
return uni.api.get("/order/findCoupons", data); return uni.api.get("/order/findCoupons", data);
}, },
loginuserInfo(data) { //获取用户信息
return uni.api.get("/login/userInfo", data);
},
tbPlatformDict(data) { //获取菜单 tbPlatformDict(data) { //获取菜单
return uni.api.get("/tbPlatformDict", data); return uni.api.get("/tbPlatformDict", data);
}, },
@@ -128,7 +125,7 @@ export default {
return uni.api.get("/order/findWiningUser", data); return uni.api.get("/order/findWiningUser", data);
}, },
// 获取自己的免单订单 // 获取自己的免单订单
ordermineWinner(data) { ordermineWinner(data) {
return uni.api.get("/order/mineWinner", data); return uni.api.get("/order/mineWinner", data);
}, },
indexlist(data) { //商品列表(今日上新/热榜/咖啡饮品) indexlist(data) { //商品列表(今日上新/热榜/咖啡饮品)
@@ -159,4 +156,10 @@ export default {
paygetActive(data) { // 获取充值活动 paygetActive(data) { // 获取充值活动
return uni.api.get("/pay/getActive", data); return uni.api.get("/pay/getActive", data);
}, },
paygetShopByMember(data) { // 获取会员店铺信息
return uni.api.get("/pay/getShopByMember", data, false);
},
loginmpdifyPwd(data) { // 修改资金密码
return uni.api.get("login/mpdifyPwd", data);
},
} }

View File

@@ -16,22 +16,32 @@
<!-- #endif --> <!-- #endif -->
<!-- 标题搜索框 --> <!-- 标题搜索框 -->
<view class="flex-between" @click="clicknavigateBack"> <view class="flex-between" @click="clicknavigateBack">
<view class="navbar_tow_one flex-start"> <view class="navbar_tow_one flex-start" v-if="iconshow">
<u-icon name="arrow-left" color="#000" size="40"></u-icon> <u-icon name="arrow-left" color="#000" size="40"></u-icon>
</view> </view>
<!-- #ifndef MP-WEIXIN -->
<view class="navbar_tow_tow" v-if="opacity || titleshow"> <view class="navbar_tow_tow" v-if="opacity || titleshow">
{{title}} <!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="navbar_tow_tow" v-if="opacity || titleshow"
:style="{'padding-left':HeighT.custwidth-14 + 'px'}">
<!-- #endif -->
{{title}}
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return {}; return {
Topdistance: ''
};
}, },
props: { props: {
title: { title: {
@@ -46,14 +56,31 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
iconshow: {
type: Boolean,
default: true
}
}, },
computed: { computed: {
HeighT() { //手机类型的尺寸 HeighT() { //手机类型的尺寸
return this.$store.getters.is_BarHeight return this.$store.getters.is_BarHeight
}, },
}, },
mounted() {
this.$nextTick(() => {
this.GetTop()
});
// 当组件挂载完成后获取距离
},
methods: { methods: {
clicknavigateBack(){ GetTop() {
this.$u.getRect('.navbar').then(res => {
this.Topdistance = res.height //滚动距离
this.$emit('Topdistance', res.height)
})
},
clicknavigateBack() {
uni.navigateBack() uni.navigateBack()
} }
} }
@@ -135,6 +162,8 @@
} }
.navbar_tow_tow { .navbar_tow_tow {
text-align: center;
flex: auto; flex: auto;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;

View File

@@ -121,7 +121,8 @@
"style": { "style": {
"navigationBarTitleText": "个人中心", "navigationBarTitleText": "个人中心",
"navigationBarBackgroundColor": "#FFD158", "navigationBarBackgroundColor": "#FFD158",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white",
"navigationStyle": "custom"
} }
}, { }, {
"path": "pages/user/repairpassword", "path": "pages/user/repairpassword",

View File

@@ -2,17 +2,20 @@
<view class="content"> <view class="content">
<view class="towcontentitem"> <view class="towcontentitem">
<view class="towcontentitemone flex-start"> <view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="userInfo.headImg" mode="aspectFill"></image> <image class="towcontentitemoneimage" :src="userInfo.logo" mode="aspectFill"></image>
<view class="towcontentitemonetext flex-colum-start"> <view class="towcontentitemonetext flex-colum-start">
<text class="towcontentitemonetextone">{{userInfo.nickName || '暂无昵称'}}</text> <text class="towcontentitemonetextone">{{userInfo.chainName || '暂无昵称'}}</text>
</view> </view>
</view> </view>
<view class="towcontentitemthere flex-start"> <view class="towcontentitemthere flex-start">
余额<text class="towcontentitemtheretext">{{memberlist.vip_number || '0.00'}}</text> 余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text>
</view> </view>
<view class="towcontentitemtow flex-between"> <view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext">{{memberlist.vip_number || '无'}}</text> <text class="towcontentitemtowetext">vip{{userInfo.code || '无'}}</text>
</view>
<view class="towcontentitevip">
vip{{userInfo.is_vip}}
</view> </view>
</view> </view>
<view class="therecontent"> <view class="therecontent">
@@ -46,11 +49,24 @@
} }
}, },
onLoad(e) { onLoad(e) {
// this.shopUser = uni.cache.get('shopUser') console.log(e)
this.userInfo = uni.cache.get('userInfo') if (e.type == 'list') {//从列表进来的
this.paygetActive() this.paygetShopByMember(e.shopId_id)
}else{
this.paygetShopByMember(e.shopId_id)
}
this.paygetActive() //列表
}, },
methods: { methods: {
async paygetShopByMember(w) {
let res = await this.api.paygetShopByMember({
page: 1,
pageSize: 10,
userId: uni.cache.get('userInfo').id,
shopId: w
})
this.userInfo = res.data.list[0]
},
async paygetActive() { async paygetActive() {
let res = await this.api.paygetActive({ let res = await this.api.paygetActive({
shopId: uni.cache.get('shopUser'), shopId: uni.cache.get('shopUser'),
@@ -201,13 +217,29 @@
} }
.towcontentitemtow { .towcontentitemtow {
margin-top: 84rpx;
z-index: 10; z-index: 10;
font-size: 24rpx; font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #422A07; color: #422A07;
} }
.towcontentitevip{
position: absolute;
right: 0;
top: 0;
width: 92rpx;
height: 40rpx;
font-size: 20rpx;
background: #F4C380;
border-radius: 0rpx 12rpx 0rpx 12rpx;
text-align: center;
line-height: 40rpx;
color: #fff;
font-family:Source Han Sans CN-Medium;
font-weight: Medium;
}
.towcontentitemthere { .towcontentitemthere {
margin-left: 92rpx; margin-left: 92rpx;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
@@ -292,6 +324,8 @@
} }
.fivecontent { .fivecontent {
position: relative;
bottom: 44rpx;
margin-top: 62rpx; margin-top: 62rpx;
padding: 20rpx 0; padding: 20rpx 0;
text-align: center; text-align: center;

View File

@@ -9,20 +9,20 @@
<image class="towcontentitemimage" <image class="towcontentitemimage"
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image> src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image>
<view class="towcontentitemone flex-start"> <view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="item.store_avatar" mode="aspectFill"></image> <image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
<text class="towcontentitemonetext" style="color: #333333;">{{item.store_title}}</text> <text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
</view> </view>
<view class="towcontentitemtow flex-between"> <view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext" style="color:#333333;">{{item.vip_number}}</text> <text class="towcontentitemtowetext" style="color:#333333;">{{item.is_vip}}</text>
<text>{{item.end_time}}</text> <text>{{item.shopName}}</text>
</view> </view>
</view> </view>
</view> </view>
<view v-if="list.length==0 && is_end == true" class="flex-colum"> <view v-if="list.length== 0 && is_end == true" class="flex-colum" >
<image :src="bgnothave" mode="aspectFill"> <image :src="bgnothave" mode="aspectFill">
</image> </image>
</view> </view>
<u-loadmore :status="form.status" /> <u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
</view> </view>
</template> </template>
@@ -30,53 +30,57 @@
export default { export default {
data() { data() {
return { return {
bgnothave:uni.getStorageSync('bgnothave'), bgnothave: uni.getStorageSync('bgnothave'),
list: [], list: [],
is_end: false, is_end: false,
nickname: uni.cache.get('loginuser').userinfo.nickname, nickname: uni.cache.get('userInfo').nickName,
form: { form: {
page: 1, page: 1, //页数
size: 10, //页容量
status: 'loadmore', status: 'loadmore',
}, },
} }
}, },
onShow() { onShow() {
this.userusercarlist() this.paygetShopByMember()
}, },
onReachBottom() { onReachBottom() {
this.userusercarlist() this.paygetShopByMember()
},
computed: {
}, },
computed: {},
methods: { methods: {
async userusercarlist() { async paygetShopByMember() {
let res = await this.api.userusercarlist({ let res = await this.api.paygetShopByMember({
page: this.form.page, page: this.form.page,
store_id:uni.cache.get('store_id') pageSize: this.form.size,
userId: uni.cache.get('userInfo').id,
shopId:''
}) })
if (res.length == 0) {
this.is_end = true if (res.data.pages < this.form.page) {
this.form.status = 'nomore' this.form.status = 'nomore'
if (this.form.page == 1 && res.data.list == 0) {
this.is_end = true
}
return false; return false;
} else { } else {
this.form.status = 'loading'; this.form.status = 'loading';
this.form.page = ++this.form.page; this.form.page = ++this.form.page;
setTimeout(() => { setTimeout(() => {
this.list = [...this.list, ...res]; this.list = [...this.list, ...res.data.list];
if (res.length == 10) { this.form.status = 'loading';
this.form.status = 'loading'; if (res.data.pageNum == res.data.pages) {
} else {
this.is_end = true;
this.form.status = 'nomore'; this.form.status = 'nomore';
} else {
this.form.status = 'loading';
} }
}, 500) }, 500)
} }
}, },
eeInfo(e) { eeInfo(item) {
uni.pro.navigateTo('my/member/memberinfo',{ uni.pro.navigateTo('member/index',{
id: e.vip_id, shopId_id:item.shopId,
lang:1 type:'list'
}) })
}, },
} }
@@ -137,6 +141,7 @@
.towcontentitemone { .towcontentitemone {
position: relative; position: relative;
z-index: 10; z-index: 10;
.towcontentitemoneimage { .towcontentitemoneimage {
width: 76rpx; width: 76rpx;
height: 76rpx; height: 76rpx;
@@ -162,7 +167,7 @@
width: 100%; width: 100%;
left: 0; left: 0;
bottom: 18rpx; bottom: 18rpx;
padding:0 32rpx; padding: 0 32rpx;
// margin-top: 52rpx; // margin-top: 52rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-family: Source Han Sans CN-Regular, Source Han Sans CN;

View File

@@ -370,6 +370,7 @@ this.getAount()
uni.showToast({ uni.showToast({
title: "支付成功" title: "支付成功"
}) })
uni.cache.set('shopUser','')//删除shopUser
this.paymodfiyOrderInfo() this.paymodfiyOrderInfo()
setTimeout(res => { setTimeout(res => {
uni.redirectTo({ uni.redirectTo({

View File

@@ -45,7 +45,7 @@
</view> </view>
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" <image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
v-if="is_end" mode="aspectFill"></image> v-if="is_end" mode="aspectFill"></image>
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' /> <u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
</view> </view>
</view> </view>
</view> </view>

View File

@@ -1,8 +1,8 @@
<template> <template>
<view class="Box"> <view class="Box">
<view class="box_one">安全密码用于商户推广提现/订单退款确保资金安全</view> <view class="box_one" v-if="isPwd == 0">安全密码用于商户推广提现/订单退款确保资金安全</view>
<view class="box_box"> <view class="box_box">
<view class="box_item flex-between"> <view class="box_item flex-between" v-if="isPwd == 0">
<text class="top_box_one_text">手机号码</text> <text class="top_box_one_text">手机号码</text>
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" /> <input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
</view> </view>
@@ -36,6 +36,7 @@
export default { export default {
data() { data() {
return { return {
isPwd: uni.cache.get('userInfo').isPwd,
form: { form: {
mobile: uni.cache.get('userInfo').telephone, mobile: uni.cache.get('userInfo').telephone,
password: '', password: '',
@@ -50,8 +51,14 @@
Recapture: '发送验证码' Recapture: '发送验证码'
}; };
}, },
onLoad() {}, onLoad() {
if (uni.cache.get('userInfo').isPwd != 0) {
uni.setNavigationBarTitle({
title: '忘记支付密码', // 标题文本,必须是字符串
});
}
},
methods: { methods: {
async CodeRegister() { async CodeRegister() {
const res = await this.api.phoneValidateCode({ const res = await this.api.phoneValidateCode({
@@ -78,8 +85,8 @@
} }
}, },
async userInfosavePayPassword() { async userInfosavePayPassword() {
console.log(this.form.payPassword, this.form.password)
if (this.form.mobile.length != 11) { if (this.form.mobile.length != 11 && this.isPwd == 0) {
uni.showToast({ uni.showToast({
title: '手机号必须是11位', title: '手机号必须是11位',
icon: 'none' icon: 'none'
@@ -123,14 +130,21 @@
} }
let res = await this.api.loginresetPwd({ let res = await this.api.loginresetPwd({
pwd: this.form.password, pwd: this.form.password,
shopId: uni.cache.get('shopUser'),
code: this.form.checkCode code: this.form.checkCode
}) })
if (res == 1) {
uni.showToast({ if (res.code == 0) {
title: '修改成功', if (uni.cache.get('userInfo').isPwd != 0) {
icon: 'none' uni.showToast({
}); title: '修改成功',
icon: 'none'
});
} else {
uni.showToast({
title: '设置成功',
icon: 'none'
});
}
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack();
}, 1000); }, 1000);

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<view class="user-info-wrap" @click="clickinformation"> <!-- <view class="user-info-wrap" @click="clickinformation">
<view style="width: 108rpx; height: 108rpx;border-radius: 50%;"> <view style="width: 108rpx; height: 108rpx;border-radius: 50%;">
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.headImg" <image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.headImg"
:src="userInfo.headImg" mode="aspectFill"> :src="userInfo.headImg" mode="aspectFill">
@@ -12,8 +12,35 @@
<view class="info flex-colum-start"> <view class="info flex-colum-start">
<text class="phone">{{userInfo.nickName || '无'}}</text> <text class="phone">{{userInfo.nickName || '无'}}</text>
</view> </view>
</view> -->
<navseat :opacity='opacity' class="navseat" title='个人中心' :iconshow="false" :titleshow='true'></navseat>
<view class="boxtop">
<!-- #ifndef MP-WEIXIN -->
<view :style="{'height':Topdistance+'px'}"></view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px'}"></view>
<!-- #endif -->
<view class="boxtop_top flex-between">
<view class="boxtop_topleft">
<view class="flex-start" v-if="userInfo.nickName">
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.headImg"
:src="userInfo.headImg" mode="aspectFill">
</image>
<text>{{userInfo.nickName || '无'}}</text>
</view>
<view class="flex-start" v-else @click="loginClick">
<text>去登录</text>
</view>
</view>
<image style="width: 44rpx; height: 42.26rpx;"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/kf.png" mode="aspectFill">
</view>
<image @click="memberlist" class="boxtop_botton" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/member.png"
mode="aspectFit"></image>
</view> </view>
<view class="userinfoone"> <view class="userinfoone" v-if="teblist.length!=0">
<view class="userinfoonebox"> <view class="userinfoonebox">
<view class="userinfooneboxitem flex-between" @click="clickinfo(item,index)" <view class="userinfooneboxitem flex-between" @click="clickinfo(item,index)"
v-for="(item,index) in teblist" :key="index"> v-for="(item,index) in teblist" :key="index">
@@ -25,31 +52,48 @@
</view> </view>
</view> </view>
</view> </view>
<listitem :list='list'></listitem> <listitem :list='list' v-if="list.length!=0"></listitem>
</view> </view>
</template> </template>
<script> <script>
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js"; import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
import listitem from "@/components/listitem.vue"; import listitem from "@/components/listitem.vue";
import navseat from '@/components/navseat.vue'
export default { export default {
components: { components: {
listitem listitem,
navseat
}, },
data() { data() {
return { return {
shopUser: {}, titlename: '个人中心',
opacity: false,
userInfo: {}, userInfo: {},
shopInfo: {},
teblist: [], teblist: [],
list: [] list: [],
Topdistance: ''
}; };
}, },
onLoad() { onLoad() {
this.init_fn() },
computed: {
HeighT() { //手机类型的尺寸
return this.$store.getters.is_BarHeight
},
},
mounted() {
setTimeout(() => {
this.$nextTick(() => {
this.GetTop()
});
}, 1000)
// 当组件挂载完成后获取距离
}, },
onShow() { onShow() {
if (uni.cache.get('token')) { if (uni.cache.get('token')) {
this.init_fn()
this.loginwxuserInfo() this.loginwxuserInfo()
this.tbPlatformDict() this.tbPlatformDict()
} }
@@ -58,6 +102,20 @@
clickinformation() { clickinformation() {
uni.pro.navigateTo('user/information') uni.pro.navigateTo('user/information')
}, },
//获取元素距离顶部的距离
GetTop() {
this.$u.getRect('.content').then(res => {
console.log(1111, res)
this.Topdistance = res.height //滚动距离
})
},
memberlist(){
if (uni.cache.get('token')) {
uni.pro.navigateTo('member/list')
}else{
this.loginClick()
}
},
//退出登录 //退出登录
boxClick() { boxClick() {
uni.showModal({ uni.showModal({
@@ -78,6 +136,12 @@
} }
}); });
}, },
loginClick() {
uni.cache.clear();
uni.reLaunch({
url: '/pages/login/login'
});
},
// 精选推荐 // 精选推荐
// 下面初始数据 // 下面初始数据
init_fn() { init_fn() {
@@ -128,7 +192,7 @@
} }
break; break;
case 'scan_applet': case 'scan_applet':
uni.navigateToMiniProgram(JSON.parse(item.value)) uni.navigateToMiniProgram(JSON.parse(item.value))
break break
case 'relative': //内部页面 case 'relative': //内部页面
uni.pro.navigateTo(item.absUrl) uni.pro.navigateTo(item.absUrl)
@@ -153,7 +217,7 @@
let res = await this.api.tbPlatformDict({ let res = await this.api.tbPlatformDict({
type: 'ownMenu' type: 'ownMenu'
}) })
console.log(res) // console.log(res)
if (res.code == 0) { if (res.code == 0) {
this.teblist = res.data this.teblist = res.data
} }
@@ -233,13 +297,46 @@
background-image: radial-gradient(40rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx); background-image: radial-gradient(40rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
} }
.boxtop {
width: 100%;
height: 542rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/user.png) no-repeat;
background-size: 100% 100%;
position: relative;
.boxtop_top {
padding: 0 32rpx;
margin-top: 52rpx;
.boxtop_topleft {
.flex-start {
text {
margin-left: 18rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 36rpx;
color: #333333;
}
}
}
}
.boxtop_botton {
position: absolute;
left: 50%;
bottom: 0;
transform: translatex(-50%);
width: 654rpx;
height: 160rpx;
}
}
.userinfoone { .userinfoone {
position: relative; position: relative;
padding: 48rpx 28rpx; padding: 48rpx 28rpx;
width: 100%; width: 100%;
top: -40rpx; // top: -40rpx;
background: #F6F6F6; background: #F6F6F6;
border-radius: 40rpx 0 0rpx 0rpx; // border-radius: 40rpx 0 0rpx 0rpx;
.userinfoonebox { .userinfoonebox {
padding: 32rpx 20rpx 32rpx 52rpx; padding: 32rpx 20rpx 32rpx 52rpx;