会员相关更新、商品列表更新

This commit is contained in:
GaoHao
2024-08-16 18:09:09 +08:00
26 changed files with 1891 additions and 2186 deletions

View File

@@ -8,7 +8,6 @@
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
// #endif
uni.cache.set('NAME', '零点八零');
this.userlogin()
},
onLoad() {
},

View File

@@ -12,23 +12,36 @@
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="navbar_tow flex-between"
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
:style="{'height':HeighT.customBar + ( (HeighT.heightBar - systemInfo.statusBarHeight)*2 )+'px','marginTop': ( HeighT.heightBar - (HeighT.heightBar - systemInfo.statusBarHeight))+'px','padding-right':HeighT.custwidth + 'px'}">
<!-- #endif -->
<!-- 标题搜索框 -->
<view v-if="search&&opacity">
<u--input
class="search"
v-model="searchVal"
placeholder="想吃什么搜一搜"
@confirm="confirmSearch"
prefixIcon="search"
prefixIconStyle="font-size: 22px;color: #909399"
:customStyle="{height:'100%',marginLeft:'20rpx',backgroundColor:'#eee',padding: '0'}"
></u--input>
<view class="flex-between" v-if="opacity&&inputshow">
<view class="navbar_tow_one flex-start" v-if="iconshow" @click="clicknavigateBack">
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
</view>
<view class="navbar_tow_tow " @click="inputFocus" style="position: relative;">
<u--input
placeholder="请输入内容"
class="custom-input"
border="surround"
:focus="focus"
@confirm="confirmSearch"
v-model="searchVal"
:readonly="readonly"
prefixIcon="search"
prefixIconStyle="font-size: 18px;color: #909399"
placeholderStyle="font-size: 14px;color: #999"
fontSize="14px"
:customStyle="{padding: '3rpx 10rpx ',width: '400rpx',borderRadius: '30rpx',backgroundColor: '#eee'}"
>
</u--input>
</view>
</view>
<!-- 正常导航栏 -->
<view class="flex-between" @click="clicknavigateBack" v-else>
<view class="navbar_tow_one flex-start" v-if="iconshow">
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
</view>
<!-- #ifndef MP-WEIXIN -->
<view class="navbar_tow_tow" v-if="opacity || titleshow" :style="{color: namecolor}">
@@ -46,7 +59,10 @@
</view>
</view>
</view>
</view>
</view>
</template>
<script>
@@ -54,7 +70,9 @@
data() {
return {
Topdistance: '',
searchVal: ""
searchVal: "",
systemInfo: '',
// keyword
};
},
props: {
@@ -93,6 +111,18 @@
navigateBacknavtitle: {
type: Boolean,
default: false
},
inputshow:{
type: Boolean,
default: false
},
focus:{
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
}
},
computed: {
@@ -103,11 +133,18 @@
mounted() {
this.$nextTick(() => {
this.GetTop()
wx.getSystemInfo({
success: res => {
this.systemInfo = res;
}
})
});
// 当组件挂载完成后获取距离
},
methods: {
GetTop() {
this.$u.getRect('.navbar').then(res => {
this.Topdistance = res.height //滚动距离
@@ -121,6 +158,14 @@
uni.navigateBack()
}
},
/**
* 搜索点击处理
*/
inputFocus() {
console.log(123)
this.$emit('searchStatus', 'searchClick')
},
confirmSearch () {
this.$emit('searchVal', this.searchVal)
}
@@ -131,7 +176,7 @@
<style scoped lang="scss">
page {
background: #F9F9F9;
background: #F7F7F7;
}
.navbarcontent {
@@ -205,12 +250,22 @@
}
.navbar_tow_tow {
width: 200rpx;
text-align: center;
flex: auto;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
position: relative;
.u--input {
width: 200rpx;
input{
font-size: 28rpx;
}
}
}
}

View File

@@ -4,7 +4,7 @@
"path": "pages/index/index",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "black"
}
},
{
@@ -172,7 +172,14 @@
"path": "pages/order_food/order_food",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "balck"
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/order_food/order_food_search",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "black"
}
},
{

View File

@@ -55,6 +55,7 @@
},
methods: {
scanCodehandle(i) {
console.log(1)
if (i == 0) {
uni.scanCode({
success: (res) => {
@@ -67,31 +68,18 @@
}
})
} else {
if (this.usershopUserinfo.isVip == 0) {
// 跳转到开通页面
uni.navigateTo({
url: '/pages/member/activatedmemberone?shopId=' + uni.cache.get('shopUser')
})
} else {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: uni.cache.get('shopUser'),
})
}
uni.pro.navigateTo('member/memberdetails', {
shopId_id: uni.cache.get('shopUser'),
})
}
},
memberindex(i) {
console.log(2)
if (i == 0) {
if (this.usershopUserinfo.isVip == 0) {
// 跳转到开通页面
uni.navigateTo({
url: '/pages/member/activatedmemberone?shopId=' + uni.cache.get('shopUser')
})
} else {
uni.pro.navigateTo('member/index', {
shopId: uni.cache.get('shopUser'),
type: 'index',
})
}
uni.pro.navigateTo('member/index', {
shopId: uni.cache.get('shopUser'),
type: 'index',
})
} else {
let data = {
shopName: this.usershopUserinfo.shopName,

View File

@@ -1,180 +0,0 @@
<template>
<!-- 账单明细 -->
<view>
<view class="bild">
<view class="bildLeft">
<text>我的余额</text>
<view>{{info.amount}}</view>
</view>
<view class="bildRight">
<text>我的积分</text>
<view>{{info.levelConsume}}</view>
</view>
</view>
<view class="navTop">
<view @click="clickEvent(1)" :class="[active==1?'fonts':'']">
余额明细
<view :class="[active==1?'xian':'']" style="left: 36rpx;"> </view>
</view>
<view @click="clickEvent(2)" :class="[active==2?'fonts':'']">
积分明细
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
</view>
</view>
<view class="listStyle" v-for="(item,i) in list" :key="i">
<!-- <image :src="require('')" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
<view class="listrigth">
<view>{{item.biz_name}}</view>
<view :class="[item.type == '+'?'colorStyle':'']">{{item.type}}{{item.amount}}
</view>
</view>
<view class="listrigth2">
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view>余额:{{item.balance}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
active: 1,
list: [],
form: {
page: 1,
pageSize: 10,
memberId: null
},
info: null
}
},
onLoad(e) {
this.info = e
this.form.memberId = e.memberId
this.getlist()
},
onReachBottom() {
this.getlist()
},
methods: {
// 检测是否包含In
checkIn(str) {
let reg = RegExp(/In/)
return str.match(reg)
},
async getlist() {
if (this.active == 1) {
let res = await this.api.queryMemberAccount(this.form)
if (res.code == 0) {
if (this.form.page == 1) {
this.list = res.data.list
} else {
this.form.page++
this.list.push(res.data.list)
}
}
} else {
this.list = []
}
},
clickEvent(i) {
this.active = i
this.getlist()
}
}
}
</script>
<style scoped lang="less">
.bild {
height: 320rpx;
background-image: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/czmxbg.png');
background-size: 750rpx 320rpx;
display: flex;
justify-content: space-around;
align-items: center;
.bildLeft,
.bildRight {
font-weight: 400;
font-size: 32rpx;
>view,
>text {
text-align: center;
color: #333;
}
>view {
margin-top: 34rpx;
font-weight: bold;
}
}
}
.navTop {
display: flex;
justify-content: space-around;
align-items: center;
color: #333;
margin-top: -60rpx;
padding: 0 120rpx;
.fonts {
font-size: 34rpx;
}
>view {
position: relative;
.xian {
width: 58rpx;
height: 6rpx;
background: #FFAA62;
border-radius: 2rpx 2rpx 2rpx 2rpx;
position: absolute;
bottom: -16rpx;
}
}
}
.listStyle {
padding: 28rpx;
padding-top: 50rpx;
width: 100%;
.listrigth,
.listrigth2 {
display: flex;
justify-content: space-between;
align-items: center;
// padding-left: 32rpx;
}
.listrigth {
.colorStyle {
color: #FF7127;
}
>view {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
}
.listrigth2 {
margin-top: 6rpx;
>view {
font-weight: 500;
font-size: 24rpx;
color: #666666;
}
}
}
</style>

View File

@@ -21,17 +21,22 @@
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
</view>
</view>
<view class="listStyle" v-for="(item,i) in list" :key="i">
<!-- <image :src="require('')" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
<view class="listrigth">
<view>{{item.biz_name}}</view>
<view :class="[item.type == '+'?'colorStyle':'']">{{item.type}}{{item.amount}}
<view class="listStyle " v-for="(item,i) in list" :key="i">
<image class="head_img" :src="item.head_img?item.head_img:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image>
<view class="flex-start">
<view class="listStyle_left">
<view class="listrigth">
<view>{{item.biz_name}}</view>
<view :class="[item.type == '+'?'colorStyle':'']">{{item.type}}{{item.amount}}
</view>
</view>
</view>
<view class="listrigth2">
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view>余额:{{item.balance}}</view>
</view>
</view>
<view class="listrigth2">
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view>余额:{{item.balance}}</view>
</view>
</view>
</view>
@@ -150,7 +155,9 @@
.listrigth,
.listrigth2 {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
// padding-left: 32rpx;
@@ -167,9 +174,17 @@
color: #333333;
}
}
.listStyle_left{
width: 100%;
display: flex;
align-items: center;
}
.head_img{
border-radius: 50%;
margin-right: 32rpx;
}
.listrigth2 {
margin-top: 6rpx;
margin-top: 16rpx;
>view {
font-weight: 500;

View File

@@ -1,169 +0,0 @@
<template>
<view class="towcontentitem">
<view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="userInfo.logo" mode="aspectFill"></image>
<view class="towcontentitemonetext flex-colum-start">
<text class="towcontentitemonetextone">{{userInfo.shopName || '暂无昵称'}}</text>
</view>
</view>
<view class="towcontentitemthere flex-start">
余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text>
</view>
<view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext">VIP{{userInfo.code || '无'}}</text>
</view>
<view class="towcontentitevip">
VIP{{userInfo.isVip||''}}
</view>
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/erweima.png" class="imgStyle" mode=""
@click="clickEvent"></image>
</view>
</template>
<script>
export default {
props: ['userInfo'],
data() {
return {}
},
mounted() {
console.log(this.userInfo, '调试1113')
},
methods: {
clickEvent() {
if (this.userInfo.amount) {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(this.userInfo)
})
}
}
}
}
</script>
<style lang="scss" scoped>
.towcontentitem {
width: 100%;
position: relative;
padding: 32rpx;
border-radius: 12rpx;
background: linear-gradient(126deg, #FFFBF2 0%, #F2D093 100%);
border-radius: 12rpx 12rpx 12rpx 12rpx;
&::after {
position: absolute;
bottom: 0;
right: 68rpx;
content: '';
display: inline-block;
width: 240rpx;
height: 232rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/member.png) no-repeat;
background-size: 100% 100%;
}
.towcontentitemimage {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 12rpx;
z-index: 5;
}
.towcontentitemone {
width: 100%;
position: relative;
z-index: 9;
.towcontentitemoneimage {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.towcontentitemonetext {
height: 76rpx;
margin-left: 16rpx;
.towcontentitemonetextone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 36rpx;
color: #333333;
}
.towcontentitemonetexttow {
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
}
}
.towcontentitemprogressa {
padding: 8rpx 44rpx;
z-index: 10;
position: relative;
margin-top: 54rpx;
}
.towcontentitemtow {
margin-top: 84rpx;
z-index: 10;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
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 {
margin-left: 92rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: Medium;
font-size: 24rpx;
color: #333333;
display: flex;
align-items: center;
.towcontentitemtheretext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
}
}
.imgStyle {
width: 54rpx;
height: 52rpx;
position: absolute;
right: 50rpx;
bottom: 30rpx;
// border: 2px solid #fff;
z-index: 666;
}
</style>

View File

@@ -161,7 +161,7 @@
encryptedData: d.detail.encryptedData,
iv: d.detail.iv,
})
this.phonetitle = res.data
this.telephone = res.data
}
})
}
@@ -205,7 +205,14 @@
birthDay: this.birthDay
})
if ( res.code == 0 ) {
this.$emit('getRegisterMember', false)
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
})
if (res.code == 0) {
uni.cache.set('userInfo', res.data);
}
}
}
@@ -240,6 +247,8 @@
.reg-head-img{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
padding: 0;
position: relative;
}
.reg-head-edit{

View File

@@ -1,332 +0,0 @@
<template>
<view class="content">
<card :userInfo="userInfo"></card>
<view class="therecontent">
<input type="number" v-model="amount" placeholder="自定义金额">
</view>
<view class="fourcontent flex-start">
<view class="fourcontentlnage" v-for="(item,index) in listdata" :key="index">
<view class="flex-colum" :class="index == inputshow?'fourcontentitems':'fourcontentitem'"
@click="clickinput(item,index)">
<text>{{item.minNum}}</text>
<text style="margin-top: 10rpx;">{{item.minNum}}{{item.handselNum}}</text>
</view>
</view>
</view>
<view class="fivecontent" @tap="$u.debounce(userbalancerechangesub, 500)">
立即充值
</view>
</view>
</template>
<script>
import card from './components/card.vue'
export default {
components: {
card
},
data() {
return {
inputshow: 0,
listdata: [],
amount: '',
userInfo: {},
shopId: ''
}
},
onLoad(e) {
this.shopId = e.shopId
if (e.type == 'list') { //从列表进来的
this.paygetShopByMember(e.shopId)
} else {
this.paygetShopByMember(e.shopId)
}
this.paygetActive(e.shopId) //列表
},
methods: {
async paygetShopByMember(w) {
let res = await this.api.paygetShopByMember({
page: 1,
pageSize: 10,
userId: uni.cache.get('userInfo').id,
shopId: this.shopId
})
this.userInfo = res.data.list[0]
},
async paygetActive() {
let res = await this.api.paygetActive({
shopId: this.shopId,
page: 1,
pageSize: 10
})
try {
this.listdata = res.data.list
this.amount = res.data.list[0].minNum
} catch (e) {
//TODO handle the exception
}
},
async userbalancerechangesub() {
if (this.amount == null || this.amount == '') {
uni.showToast({
title: '金额不能为空',
icon: 'none'
});
return false;
}
if (this.amount <= 0) {
uni.showToast({
title: '金额必须大于0',
icon: 'none'
});
return false;
}
let res = await this.api.paymemeberIn({
shopId: this.shopId, // 判断显示哪家的作品,
amount: this.amount // 判断显示哪家的作品,
})
if (res.code == 0) {
uni.showLoading({
title: '加载中',
mask: true
})
// #ifdef MP-WEIXIN
uni.requestPayment({
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
nonceStr: res.data.nonceStr, // 随机字符串
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
success: (res) => {
uni.showToast({
title: "支付成功"
})
uni.hideLoading()
setTimeout(res => {
uni.navigateBack()
}, 500)
},
fail: (res) => {
uni.hideLoading()
}
});
uni.hideLoading()
// #endif
}
},
clickinput(a, b) {
console.log(a, b)
this.inputshow = b
this.amount = a.minNum
},
}
}
</script>
<style lang="scss">
page {
background: #F9F9F9;
}
.content {
padding: 0 28rpx;
.towcontentitem {
width: 100%;
position: relative;
padding: 32rpx;
border-radius: 12rpx;
background: linear-gradient(126deg, #FFFBF2 0%, #F2D093 100%);
border-radius: 12rpx 12rpx 12rpx 12rpx;
&::after {
position: absolute;
bottom: 0;
right: 68rpx;
content: '';
display: inline-block;
width: 240rpx;
height: 232rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/member.png) no-repeat;
background-size: 100% 100%;
}
.towcontentitemimage {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 12rpx;
z-index: 5;
}
.towcontentitemone {
width: 100%;
position: relative;
z-index: 9;
.towcontentitemoneimage {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.towcontentitemonetext {
height: 76rpx;
margin-left: 16rpx;
.towcontentitemonetextone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 36rpx;
color: #333333;
}
.towcontentitemonetexttow {
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
}
}
.towcontentitemprogressa {
padding: 8rpx 44rpx;
z-index: 10;
position: relative;
margin-top: 54rpx;
}
.towcontentitemtow {
margin-top: 84rpx;
z-index: 10;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
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 {
margin-left: 92rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: Medium;
font-size: 24rpx;
color: #333333;
.towcontentitemtheretext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
}
}
.therecontent {
margin-top: 32rpx;
position: relative;
padding: 22rpx 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 8rpx;
input {
padding-left: 30rpx;
text-align: right;
font-size: 28rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #666666;
}
}
.therecontent::after {
position: absolute;
top: 50%;
left: 32rpx;
transform: translateY(-50%);
content: '¥';
display: inline-block;
width: 28rpx;
height: 40rpx;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
.fourcontent {
.fourcontentlnage {
width: 33.33%;
.fourcontentitem {
margin: 24rpx 10rpx;
padding: 16rpx 0;
text-align: center;
background: #FFFFFF;
border-radius: 8rpx;
// border: 1rpx solid #333333;
font-size: 28rpx;
font-family: Roboto-Medium, Roboto;
font-weight: 500;
color: #333333;
}
.fourcontentitems {
margin: 24rpx 10rpx;
padding: 16rpx 0;
text-align: center;
border-radius: 8rpx;
background: #F1CB66;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #F1CB66;
font-size: 28rpx;
font-family: Roboto-Medium, Roboto;
font-weight: 500;
color: #FFFFFF;
}
}
}
.fivecontent {
position: relative;
bottom: 44rpx;
margin-top: 62rpx;
padding: 20rpx 0;
text-align: center;
width: 100%;
font-size: 36rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
border-radius: 8rpx;
background: #F1CB66;
}
}
</style>

View File

@@ -70,11 +70,14 @@
<view class="rechargeBox">
<view class="agreement">
<u-checkbox-group>
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30"></u-checkbox>
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30">
<view style="width: 100rpx;height: 100rpx;"></view>
</u-checkbox>
</u-checkbox-group>
<text>已同意</text>
<text class="agreement_text" @click="Privacy(1)">用户储值协议</text>
<text class="agreement_text" @click="Privacy(3)">用户授权协议</text>
<text class="agreement_text" @click="viewProtocol">用户隐私协议</text>
<!-- <text class="agreement_text" @click="viewProtocol">用户储值协议</text> -->
<!-- <text class="agreement_text" @click="viewProtocol">用户授权协议</text> -->
</view>
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
</view>
@@ -116,9 +119,9 @@
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
this.tokenShow = false;
// 等待登录结果返回
if (!uni.cache.get('token')) {
await this.$onLaunched;
}
// if (!uni.cache.get('token')) {
// await this.$onLaunched;
// }
this.init();
} else{
this.shopId = e.shopId;
@@ -173,25 +176,16 @@
uni.pro.navigateTo(item.url, this.userInfo)
},
async Privacy(e) {
if (e == 1) {
//用户协议
let res = await this.api.agreementgetAgreementOne({
discern: 0
});
uni.pro.navigateTo('my/about/agreement', {
discern: 0,
list: res.data.content
});
} else {
let res3 = await this.api.agreementgetAgreementOne({
discern: 3
});
uni.pro.navigateTo('my/about/agreement', {
discern: 3,
list: res3.data.content
});
}
/**
* 查看协议
*/
viewProtocol (){
wx.openPrivacyContract({
success: () => {}, // 打开成功
fail: () => {}, // 打开失败
complete: () => {}
})
},
/**
@@ -216,18 +210,26 @@
* 拉起地图
*/
openLocation () {
console.log('123');
uni.openLocation({
latitude: Number(this.userInfo.lat), // 目的地的纬度,浮点数,范围为-90~90
longitude: Number(this.userInfo.lng), // 目的地的经度,浮点数,范围为-180~180
latitude: Number(this.usershopUserinfo.lat), // 目的地的纬度,浮点数,范围为-90~90
longitude: Number(this.usershopUserinfo.lng), // 目的地的经度,浮点数,范围为-180~180
scale: 18, // 缩放比例范围5~18
name: this.userInfo.shopName, // 位置名
address: this.userInfo.address, // 地址的详细说明
name: this.usershopUserinfo.shopName, // 位置名
address: this.usershopUserinfo.address, // 地址的详细说明
success() {
console.log('导航启动成功');
},
fail(error) {
console.log('导航启动失败', error);
if ( error.errMsg == "openLocation:fail invalid_coordinate") {
uni.showToast({
title: "门店经纬度无效",
icon: 'none'
});
}
}
});
},
@@ -278,6 +280,13 @@
* 充值
*/
async userbalancerechangesub() {
if (!this.isProtocol) {
uni.showToast({
title: '请勾选协议',
icon: 'none'
});
return false;
}
if (this.amount == null || this.amount == '') {
uni.showToast({
title: '金额不能为空',
@@ -317,9 +326,7 @@
uni.hideLoading()
let pages = getCurrentPages()
if ( pages.length > 1) {
setTimeout(res => {
uni.navigateBack()
}, 500)
this.paygetShopByMember()
} else {
setTimeout(res => {
uni.switchTab({

View File

@@ -40,17 +40,24 @@
size: 10, //页容量
status: 'loadmore',
},
userId: uni.cache.get('userInfo').id
userId: uni.cache.get('userInfo').id,
type: null,
}
},
onLoad(e) {
console.log(e)
if ( e.type ) {
this.type = e.type;
}
},
onShow() {
this.list = []
this.form = {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
},
this.paygetShopByMember()
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
},
this.paygetShopByMember()
},
onReachBottom() {
this.paygetShopByMember()
@@ -86,9 +93,21 @@
}
},
eeInfo(item) {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: item.shopId
})
if ( this.type && this.type == 'user_payCode') {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(item)
})
} else if ( this.type && this.type == 'user_recharge') {
uni.pro.navigateTo('member/index', {
shopId: item.shopId,
type: 'index',
})
} else {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: item.shopId
})
}
},
}
}

View File

@@ -1,304 +0,0 @@
<template>
<!-- 会员详情 -->
<view class="content">
<card :userInfo="userInfo"></card>
<view class="memberdetailsStyle">
<text>会员详情</text>
<view @click="goUrl('member/billDetails')">
<text>账单明细</text>
<uni-icons type="right" style="color: #333;" size="20"></uni-icons>
</view>
<view @click="goUrlinfo('member/index')">
<text>会员充值</text>
<uni-icons type="right" style="color: #333;" size="20"></uni-icons>
</view>
</view>
</view>
</template>
<script>
import card from './components/card.vue'
export default {
components: {
card
},
data() {
return {
shopId_id: null,
inputshow: 0,
memberlist: {},
listdata: [],
amount: '',
userInfo: {},
}
},
onLoad(e) {
console.log(e)
this.shopId_id = e.shopId_id
},
onShow() {
this.paygetShopByMember(this.shopId_id)
},
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]
},
clickinput(a, b) {
console.log(a, b)
this.inputshow = b
this.amount = a.minNum
},
goUrl(url) {
uni.pro.navigateTo(url, this.userInfo)
},
goUrlinfo(url) {
uni.pro.navigateTo(url, {
shopId: this.shopId_id,
type: 'list'
})
}
}
}
</script>
<style lang="scss">
page {
background: #F9F9F9;
}
.content {
padding: 0 28rpx;
.towcontentitem {
width: 100%;
position: relative;
padding: 32rpx;
border-radius: 12rpx;
background: linear-gradient(126deg, #FFFBF2 0%, #F2D093 100%);
border-radius: 12rpx 12rpx 12rpx 12rpx;
&::after {
position: absolute;
bottom: 0;
right: 68rpx;
content: '';
display: inline-block;
width: 240rpx;
height: 232rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/member.png) no-repeat;
background-size: 100% 100%;
}
.towcontentitemimage {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 12rpx;
z-index: 5;
}
.towcontentitemone {
width: 100%;
position: relative;
z-index: 9;
.towcontentitemoneimage {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.towcontentitemonetext {
height: 76rpx;
margin-left: 16rpx;
.towcontentitemonetextone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 36rpx;
color: #333333;
}
.towcontentitemonetexttow {
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
}
}
.towcontentitemprogressa {
padding: 8rpx 44rpx;
z-index: 10;
position: relative;
margin-top: 54rpx;
}
.towcontentitemtow {
margin-top: 84rpx;
z-index: 10;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
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 {
margin-left: 92rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: Medium;
font-size: 24rpx;
color: #333333;
.towcontentitemtheretext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
}
}
.therecontent {
margin-top: 32rpx;
position: relative;
padding: 22rpx 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 8rpx;
input {
padding-left: 30rpx;
text-align: right;
font-size: 28rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #666666;
}
}
.therecontent::after {
position: absolute;
top: 50%;
left: 32rpx;
transform: translateY(-50%);
content: '¥';
display: inline-block;
width: 28rpx;
height: 40rpx;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
.fourcontent {
.fourcontentlnage {
width: 33.33%;
.fourcontentitem {
margin: 24rpx 10rpx;
padding: 16rpx 0;
text-align: center;
background: #FFFFFF;
border-radius: 8rpx;
border: 1rpx solid #333333;
font-size: 28rpx;
font-family: Roboto-Medium, Roboto;
font-weight: 500;
color: #333333;
}
.fourcontentitems {
margin: 24rpx 10rpx;
padding: 16rpx 0;
text-align: center;
border-radius: 8rpx;
background: #F1CB66;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #F1CB66;
font-size: 28rpx;
font-family: Roboto-Medium, Roboto;
font-weight: 500;
color: #FFFFFF;
}
}
}
.fivecontent {
position: relative;
bottom: 44rpx;
margin-top: 62rpx;
padding: 20rpx 0;
text-align: center;
width: 100%;
font-size: 36rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
border-radius: 8rpx;
background: #F1CB66;
}
// 会员详情
.memberdetailsStyle {
margin-top: 32rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
background-color: #fff;
padding: 32rpx;
height: 252rpx;
display: flex;
justify-content: space-between;
flex-direction: column;
>text {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
>view {
font-weight: 400;
font-size: 28rpx;
color: #333333;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
</style>

View File

@@ -23,13 +23,13 @@
<view class="card_cen_right" v-if="userInfo.isVip != 0">查看特权</view>
</view>
<view class="card_bom" v-if="userInfo.isVip != 0">
<view class="card_bom_item">
<view class="card_bom_item" @click="itemClick(1)">
<text>{{userInfo.amount || '0.00'}}</text><text>储值</text>
</view>
<view class="card_bom_item">
<text>0</text><text>积分</text>
</view>
<view class="card_bom_item">
<view class="card_bom_item" @click="itemClick(3)">
<text>0</text><text>优惠券</text>
</view>
<view class="card_bom_item">
@@ -93,39 +93,53 @@
list: ['鸿运当头',"财运亨通","时来运转","否极泰来","花逢时发"],
index: 0,
text: ""
}
},
usershopUserinfo:{},
}
},
onLoad(e) {
this.shopId_id = e.shopId_id
},
onShow() {
this.paygetShopByMember()
this.init();
},
methods: {
/**
* 获取会员卡信息
* 获取店铺信息
*/
async paygetShopByMember() {
let res = await this.api.paygetShopByMember({
page: 1,
pageSize: 10,
userId: uni.cache.get('userInfo').id,
shopId: this.shopId_id
async init() {
let res = await this.api.shopUserInfo({
"shopId": this.shopId_id,
"userId": uni.cache.get('userInfo').id,
})
this.userInfo = res.data.list[0];
if (res.code == 0) {
this.userInfo = res.data
}
if ( this.userInfo.isVip == 0 ) {
this.memberOpen = true;
return;
}
},
itemClick ( type ) {
if ( type == 1) {
uni.pro.navigateTo('member/index', {
shopId: this.userInfo.shopId,
type: 'index',
})
} else if ( type == 3 ) {
uni.pro.navigateTo('user/coupon')
}
},
/**
* 注册会员卡
* @param {Object} e
*/
getRegisterMember (e) {
this.memberOpen = e;
this.paygetShopByMember()
this.init()
},
clickEvent() {

View File

@@ -7,7 +7,7 @@
</view>
<view class="box_item flex-between" style="position:relative;">
<text class="top_box_one_text"></text>
<input type="number" v-model="form.checkCode" placeholder="请输入验证码" style="padding-right: 140rpx;" />
<input type="number" v-model="form.checkCode" placeholder="请输入验证码" style="padding-right: 140rpx;color: #333" />
<view class="top_box_one_texts">
<view v-if="showText == true" class="yzm" @click="CodeRegister">{{ Recapture }}</view>
<view v-else style="color: #ccc; background-color: #f9f9f9; border-radius:16px; padding: 10rpx;">
@@ -28,7 +28,7 @@
</view>
<view class="flex-colum">
<view class="Box_bottom" @click="userInfosavePayPassword">确定</view>
<view class="Box_bottom" :class="(form.checkCode!=''&&form.password!=''&&form.payPassword!='')?'active':''" @click="userInfosavePayPassword">确定</view>
</view>
</view>
</template>
@@ -52,8 +52,13 @@
Recapture: '获取验证码'
};
},
onLoad() {
onLoad(e) {
// if ( e.shopUserInfo ) {
// this.shopUserInfo = JSON.parse(e.shopUserInfo);
// this.isPwd = this.shopUserInfo.isPwd;
// this.mobile = this.shopUserInfo.telephone.slice(0, 3)+'****'+this.shopUserInfo.telephone.slice(7);
// this.form.mobile = this.shopUserInfo.telephone;
// }
},
methods: {
@@ -62,7 +67,7 @@
// post 手机验证码
phone: this.form.mobile
});
if (res) {
if (res.code == 0) {
uni.showToast({
title: '验证码获取成功',
icon: 'none'
@@ -150,9 +155,10 @@
icon: 'none'
});
}
// 获取用户信息
this.loginwxuserInfo()
setTimeout(() => {
// 获取用户信息
this.loginwxuserInfo()
uni.navigateBack();
}, 1000);
}
@@ -196,7 +202,7 @@
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #999999;
color: #333;
}
@@ -238,7 +244,7 @@
width: 100%;
height: 96rpx;
line-height: 96rpx;
background: #999;
background-color: #999;
border-radius: 48rpx;
font-size: 32rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
@@ -246,6 +252,9 @@
color: #ffffff;
text-align: center;
}
.Box_bottom.active{
background-color: #E3AD7F;
}
}
}
</style>

View File

@@ -419,7 +419,7 @@
.flex-between {
width: 100%;
padding: 24rpx 28rpx;
padding: 48rpx 28rpx;
background: #FFFFFF;
.fixedview_one {

View File

@@ -94,15 +94,18 @@
<view class="method_list_top">
<view class="method_list_top_left">
<image class="icon" :src="item.url" mode="aspectFill"/>
<text class="name"> {{ item.name }} </text>
<view class="method_list_top_cen">
<view class="name"> {{ item.name }} </view>
<view class="method_list_bom" v-if="item.type == 1">
<text class="balance">会员卡余额 {{amountVIP?amountVIP.amount:0}}</text>
<text class="topUpNow" @click="goRecharge">去充值</text>
</view>
</view>
</view>
<u-radio activeColor="#E8AD7B" icon-size="36" size="36" :name="index+1">
</u-radio>
</view>
<view class="method_list_bom" v-if="item.type == 1">
<text class="balance">会员卡余额 {{amountVIP?amountVIP.amount:0}}</text>
<text class="topUpNow" @click="goRecharge">去充值</text>
</view>
</view>
</block>
</u-radio-group>
@@ -361,16 +364,9 @@
goRecharge() {
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
// console.log(this.amountVIP.isVip, '调试1')
if (this.amountVIP.isVip == 0) {
// 跳转到开通页面
uni.navigateTo({
url: '/pages/member/activatedmemberone?shopId=' + uni.cache.get('shopUser')
})
} else {
uni.pro.navigateTo('/pages/member/index', {
shopId: uni.cache.get('shopUser')
})
}
uni.pro.navigateTo('/pages/member/index', {
shopId: uni.cache.get('shopUser')
})
},
/**
@@ -422,18 +418,26 @@
} else {
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
// console.log(isPwd,'是否设置了支付密码')
if (uni.cache.get('userInfo').isPwd == 0) {
uni.pro.navigateTo('/pages/user/repairpassword', {
shopId_id: uni.cache.get('shopUser')
})
if ( this.amountVIP.isVip == 0 ) {//非会员情况
this.goRecharge();
} else {
uni.hideLoading()
// this.payPasswordShow = false;
this.ispws = true
this.$nextTick(() => {
// this.$refs.payPwd.onPayUp();
})
console.log(this.amountVIP)
if (uni.cache.get('userInfo').isPwd == 0) {
uni.navigateTo({
url: '/pages/member/setPassword?shopUserInfo=' + JSON.stringify(this.amountVIP)
})
} else {
uni.hideLoading()
// this.payPasswordShow = false;
this.ispws = true
this.$nextTick(() => {
// this.$refs.payPwd.onPayUp();
})
}
}
}
},
@@ -534,8 +538,8 @@
} else if (res.data == 3) {
this.showToastUppop('未设置支付密码')
setTimeout(() => {
uni.pro.navigateTo('/pages/user/repairpassword', {
shopId_id: uni.cache.get('shopUser')
uni.navigateTo({
url: '/pages/member/setPassword?shopUserInfo=' + JSON.stringify(this.amountVIP)
})
}, 1500)
@@ -906,24 +910,25 @@
.paymentMethod_content{
background-color: $uni-bg-color;
border-radius: 22rpx;
padding:30rpx 0;
padding:30rpx 0 0 0;
box-sizing: border-box;
.paymentMethod_title{
font-weight: 500;
font-size: 32rpx;
color: #333333;
margin-bottom: 30rpx;
// margin-bottom: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.method_list{
padding: 20rpx 30rpx;
padding: 40rpx 30rpx;
box-sizing: border-box;
.method_list_top{
display: flex;
justify-content: space-between;
.method_list_top_left{
display: flex;
align-items: center;
.icon{
width: 54.67rpx!important;
height: 48rpx!important;
@@ -934,13 +939,18 @@
font-weight: 500;
color: #333;
}
.method_list_top_cen{
display: flex;
flex-direction: column;
}
}
}
.method_list_bom{
display: flex;
align-items: center;
.balance{
margin-right: 20rpx;
margin-left: 70rpx;
font-size: 24rpx;
}
.topUpNow{

View File

@@ -9,7 +9,7 @@
</view>
<!-- 顶部面板 -->
<view class="top--panel">
<navseat :opacity='opacity' :search="true" @searchVal="searchVal" :titleshow='true' @navigateBacknav='navigateBacknav'
<navseat :opacity='opacity' :inputshow="true" :readonly="true" @searchStatus="searchStatus" :titleshow='true' @navigateBacknav='navigateBacknav'
:navigateBacknavtitle='true'></navseat>
<!-- 顶部面板可添加所需要放在页面顶部的内容代码比如banner图 -->
<image class="panelimgbackground"
@@ -59,14 +59,15 @@
<view v-if="item.isPauseSale != 0 " class="flex-between" style="margin-top: 32rpx;margin-bottom: 48rpx;">
<view v-if="item.isPauseSale != 0 || item.isSale == 0 " class="flex-between" style="margin-top: 32rpx;margin-bottom: 48rpx;">
<view class="panelfiveitemsex flex-between">
<view class="panelfiveitemsex_oen"><text>¥</text><text>{{item.lowPrice}}</text><text>/</text></view>
</view>
<view class="panelfiveitemNum" >
<view class="sku-wrap flex-center" style="background-color: #CECECE;">
<text class="t">已售罄</text>
<text class="t" v-if="item.isSale == 0" >非可售时间</text>
<text class="t" v-else-if="item.isPauseSale != 0" >已售罄</text>
</view>
</view>
</view>
@@ -106,7 +107,7 @@
</view>
</view>
<view v-if="item.isPauseSale != 0 " style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;background-color: rgba(255,255,255,0.5);"></view>
<view v-if="item.isPauseSale != 0 || item.isSale == 0" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 9,background-color: rgba(255,255,255,0.5);"></view>
</view>
</view>
</scroll-view>
@@ -143,7 +144,7 @@
<image class="goodsImg" src="@/static/1.gif" mode="" v-else :lazy-load="true"></image>
<view v-if="item.name=='热销'" class="topSort" :class="'c'+(index1+1)">TOP{{index1+1}}
</view>
<view class="goods_right">
<view class="goods_right" style="overflow: hidden;">
<!-- <text class="suit" v-if="item1.suit > 1">{{item1.suit}}份起点</text> -->
<view class="name">{{ item1.name }}</view>
<view class="lookBack" v-if="item.name=='热销'">本店回头客第{{index1+1}}</view>
@@ -151,11 +152,12 @@
<view class="monthlySale">月售{{item1.stockNumber}}</view>
<view v-if="item1.isPauseSale != 0 " class="flex-between">
<view v-if="item1.isPauseSale != 0 || item.isSale == 0 " class="flex-between">
<view class="money"><text class="money_num">{{ item1.lowPrice }}</text>/</view>
<view class="flex-end" >
<view class="sku-wrap flex-center" style="background-color: #CECECE;">
<text class="t">已售罄</text>
<text class="t" v-if="item1.isSale == 0" >非可售时间</text>
<text class="t" v-else-if="item1.isPauseSale != 0" >已售罄</text>
</view>
</view>
</view>
@@ -196,7 +198,7 @@
</view>
</view>
<view v-if="item1.isPauseSale != 0 " style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;background-color: rgba(255,255,255,0.5);"></view>
<view v-if="item1.isPauseSale != 0 || item1.isSale == 0 " style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 9background-color: rgba(255,255,255,0.5);"></view>
</view>
</view>
<view class="fill-last" :style="{ 'height':fillHeight + 'px' }"></view>
@@ -444,8 +446,6 @@
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
uni.cache.set('tableCode', this.tableCode)
}
uni.cache.set('types', 'types');
},
onUnload() {
if (this.socketTicket) {
@@ -465,10 +465,9 @@
scrollTop: 0,
duration: 0
});
if (!uni.cache.get('token')) {
await this.$onLaunched;
}
uni.$on('message', this.getMessage)
console.log(uni.cache.get('token'))
console.log(14)
_this.getLocation()
},
methods: {
@@ -494,6 +493,7 @@
userId: uni.cache.get('userInfo').id,
"type": "connect",
})
uni.$on('message', this.getMessage)
},
/**
@@ -563,7 +563,12 @@
// e.currentTarget.src
},
searchVal (e) {
searchStatus (e) {
if ( e == "searchClick" ) {
uni.navigateTo({
url: '/pages/order_food/order_food_search?tableCode=' + uni.cache.get('tableCode')
});
}
console.log(e)
},
@@ -736,7 +741,7 @@
* @param {Object} index1
*/
async clickspecifications(item1, index, index1, type) {
if ( item1.isPauseSale != 0 ) {
if ( item1.isPauseSale != 0 || item1.isSale == 0 ) {
return;
}
this.skuidname = []
@@ -956,6 +961,7 @@
* @param {Object} msg
*/
getMessage(msg) { //wss 回显数据
console.log(msg)
if (msg == 1) { // 网络在连接
this.fixedtrue = true
return false
@@ -1064,7 +1070,6 @@
/* 获取最后一项的高度,设置填充高度。判断和填充时做了 +-20 的操作,是为了滚动时更好的定位 */
let last = res[res.length - 1].height;
if (last - 20 < this.scrollHeight) {
// this.fillHeight = this.scrollHeight - last + 20; //这是吸到顶部的距离
this.fillHeight = 200;
}
});
@@ -1110,10 +1115,7 @@
</script>
<style lang="scss" scoped>
$bg: #fafafa;
$tabLeft: 200upx;
$itemH: 100upx;
$cartH: 90upx;
/* 容器 */
.container {
@@ -1310,8 +1312,7 @@
justify-content: flex-end;
.sku-wrap {
width: 138rpx;
height: 54rpx;
padding: 10rpx 20rpx;
background: #E3AD7F;
border-radius: 32rpx;
position: relative;
@@ -2077,8 +2078,7 @@
}
.sku-wrap {
width: 138rpx;
height: 54rpx;
padding: 10rpx 20rpx;
background: #E3AD7F;
border-radius: 32rpx;
// position: absolute;

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
<view class="code-wrap">
<view class="num-wrap">
<text class="t">账户余额</text>
<text class="num">{{shopInfo.amount || '--'}}</text>
<text class="num">{{shopInfo.amount || '0'}}</text>
</view>
<view class="line-code">
<tki-barcode ref="tkiBarcode" show :opations="tkiOptions"></tki-barcode>

View File

@@ -1,353 +0,0 @@
<template>
<view class="container">
<view class="towcontent">
<view class="towcontentlistxitem flex-start">
<view class="towcontentlistxitembox flex-colum"
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
v-for="(item,index) in listbox" :key="index" @click="towcontentclick(index,item)">
<text>{{item.name}}</text>
<image v-if="towcontentclickindex == index"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
</image>
</view>
</view>
</view>
<view class="containertop">
<view class="containertopbox">
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
<view class="containertopboxitemleft flex-colum"
:class="item.status == 0?'':'containertopboxitemlefts'">
<view class="containertopboxitemleft_one"
:class="item.status == 0?'':'containertopboxitemleft_ones'">
<text style="font-size: 28rpx;"></text>
<text>{{item.couponsAmount || 0}}</text>
</view>
<view class="containertopboxitemleft_tow"
:class="item.status == 0?'':'containertopboxitemleft_tows'">
优惠券()
</view>
</view>
<view class="containertopboxitemright">
<view class="containertopboxitemright_one">
无门槛使用
</view>
<view class="containertopboxitemright_tow">
通用红包券
</view>
<view class="containertopboxitemright_there">
有效期至{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
</view>
<view
:class="item.status == 0?'containertopboxitemright_four':'containertopboxitemright_fours'">
{{item.status == 0 ? '兑换积分':'已过期'}}
</view>
</view>
</view>
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
v-if="is_end" mode="aspectFill"></image>
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
listbox: [{
name: '全部',
type: ''
},
{
name: '未使用',
type: '0'
},
{
name: '已过期',
type: '1'
}
],
towcontentclickindex: 0,
list: [],
is_end:false,
form: {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
statuses: ''
},
};
},
onLoad() {
this.ordermineCouponsthis()
},
onReachBottom() {
this.ordermineCouponsthis()
},
methods: {
init_fn(e) {
this.list = []
this.form = {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
statuses: ''
}
try {
if (e) {
this.form.statuses = e
}
} catch (e) {
//TODO handle the exception
}
this.ordermineCouponsthis()
},
async ordermineCouponsthis() {
try {
let res = await this.api.ordermineCoupons({
userId: uni.cache.get('userInfo').id,
status: this.form.statuses,
page: this.form.page,
size: this.form.size,
orderId:""
})
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
if (this.form.page == 1 && res.data.list == 0) {
this.is_end = true
}
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}
} catch (e) {
//TODO handle the exception
}
},
towcontentclick(index, item) {
this.towcontentclickindex = index
this.form.statuses = item.type
this.init_fn(item.type)
}
}
};
</script>
<style scoped lang="scss">
page {
background: #fff;
}
.container {
.towcontent {
padding: 0 28rpx;
border-top: 16rpx solid #F9F9F9;
.towcontentlistxitem {
width: 100%;
margin-top: 32rpx;
.towcontentlistxitembox {
width: 33%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #333333;
image {
margin-top: 6rpx;
width: 38.83rpx;
height: 8.62rpx;
}
}
.towcontentlistxitemboxopacity {
width: 33%;
font-family: PingFang SC, PingFang SC;
font-weight: bold;
font-size: 32rpx;
color: #333333;
image {
width: 38.83rpx;
height: 8.62rpx;
}
}
}
}
.containertop {
padding: 40rpx 32rpx;
.containertopbox {
.containertopboxitem::after {
position: absolute;
bottom: 14rpx;
left: 14rpx;
content: '';
display: inline-block;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/coupontop.png) no-repeat;
width: 72.83rpx;
height: 77.14rpx;
background-size: cover;
}
.containertopboxitem {
margin-top: 20rpx;
width: 100%;
position: relative;
.containertopboxitemleft {
position: relative;
width: 182rpx;
height: 192rpx;
background: #F1CB66;
border-radius: 18rpx 0rpx 0rpx 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
::after {
content: '';
position: absolute;
top: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
border-radius: 0 0 32rpx 32rpx;
z-index: 999;
}
::before {
content: '';
position: absolute;
bottom: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
line-height: 32rpx;
border-radius: 32rpx 32rpx 0 0;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
z-index: 999;
}
.containertopboxitemleft_one {
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 60rpx;
color: #FFFFFF;
}
}
.containertopboxitemleft_ones {
text {
color: #999999;
}
}
.containertopboxitemleft_tow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.containertopboxitemleft_tows {
color: #999999;
}
}
.containertopboxitemlefts {
background: #F7F7F7;
}
.containertopboxitemright {
position: relative;
padding: 0 32rpx;
flex: auto;
height: 192rpx;
background: #FFFFFF;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
border-radius: 0rpx 18rpx 18rpx 0rpx;
.containertopboxitemright_one {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #666666;
padding: 12rpx 0;
border-bottom: 1rpx dotted #707070;
}
.containertopboxitemright_tow {
margin-top: 14rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.containertopboxitemright_there {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.containertopboxitemright_four {
position: absolute;
right: 32rpx;
top: 50%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #FE665E;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.containertopboxitemright_fours {
position: absolute;
right: 32rpx;
top: 50%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #999999;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #F7F7F7;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
}
}
}
}
}
</style>

View File

@@ -12,6 +12,7 @@
</view>
</view>
</view>
<view class="containertop">
<view class="containertopbox">
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
@@ -32,15 +33,16 @@
无门槛使用
</view>
<view class="containertopboxitemright_tow">
通用红包券
<view>通用红包券</view>
<view
:class="item.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
{{item.status == 0 ? '去使用':'已过期'}}
</view>
</view>
<view class="containertopboxitemright_there">
有效期至{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
</view>
<view
:class="item.status == 0?'containertopboxitemright_four':'containertopboxitemright_fours'">
{{item.status == 0 ? '兑换积分':'已过期'}}
</view>
</view>
</view>
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
@@ -191,6 +193,7 @@
.containertop {
padding: 40rpx 32rpx;
.containertopbox {
margin-top: 8rpx;
.containertopboxitem::after {
position: absolute;
bottom: 14rpx;
@@ -204,7 +207,7 @@
}
.containertopboxitem {
margin-top: 20rpx;
margin-bottom: 32rpx;
width: 100%;
position: relative;
@@ -212,7 +215,7 @@
position: relative;
width: 182rpx;
height: 192rpx;
background: #F1CB66;
background: #E3AD7F;
border-radius: 18rpx 0rpx 0rpx 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
@@ -287,19 +290,21 @@
.containertopboxitemright_one {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-weight: bold;
font-size: 24rpx;
color: #666666;
padding: 12rpx 0;
padding: 16rpx 0 16rpx 0;
border-bottom: 1rpx dotted #707070;
}
.containertopboxitemright_tow {
margin-top: 14rpx;
margin-top: 18rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-weight: bold;
font-size: 32rpx;
color: #333333;
display: flex;
justify-content: space-between;
}
.containertopboxitemright_there {
@@ -308,37 +313,23 @@
font-size: 24rpx;
color: #999999;
}
.containertopboxitemright_four {
position: absolute;
right: 32rpx;
top: 50%;
.containertopboxitemright_btn{
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #FE665E;
padding: 8rpx 22rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.containertopboxitemright_four {
color: #FFFFFF;
background: #333;
}
.containertopboxitemright_fours {
position: absolute;
right: 32rpx;
top: 50%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #999999;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #F7F7F7;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
}
}

View File

@@ -21,12 +21,17 @@
<view class="list_item">
<view class="list_item_left">账号</view>
<view class="list_item_right ">
<button open-type="getPhoneNumber" @getphonenumber="getPhone">
<button v-if="!mobile" open-type="getPhoneNumber" @getphonenumber="getPhone">
<view class="flex-colum-end">
<view class="text">{{phonetitle || '请授权手机号'}}</view>
<view class="place" v-if="phonetitle">绑定的手机号不能修改</view>
<view class="text">请授权手机号</view>
</view>
</button>
<view v-else >
<view class="flex-colum-end">
<view class="text">{{phonetitle }}</view>
<view class="place">绑定的手机号不能修改</view>
</view>
</view>
</view>
</view>
<view class="list_item">
@@ -64,7 +69,7 @@
</view>
</view>
<view class="save" @click="sumbit">保存</view>
<view class="save active" @click="$u.debounce(sumbit, 500)">保存</view>
</view>
</template>
@@ -104,6 +109,7 @@
userHeadImg: "",
nickName: '',
birthDay: "",
mobile: "",
phonetitle: ""
};
},
@@ -120,6 +126,7 @@
}
this.birthDay = this.userInfo.birthDay;
this.phonetitle = this.userInfo.telephone ? (this.userInfo.telephone.substr(0, 3) + "****" + this.userInfo.telephone.substr(7)) : ""
this.mobile = this.userInfo.telephone;
this.date = this.getDate({ format: true})
},
@@ -163,9 +170,6 @@
* @param {Object} d
*/
async getPhone(d) {
if ( this.phonetitle ) {
return;
}
if (d.detail.iv) {
uni.login({
provider: 'weixin',
@@ -176,7 +180,8 @@
encryptedData: d.detail.encryptedData,
iv: d.detail.iv,
})
this.phonetitle = res.data
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
this.mobile = res.data;
}
})
}
@@ -243,7 +248,7 @@
nickName: this.nickName,
sex: this.sex,
birthDay: this.birthDay,
telephone: this.phonetitle == '请授权手机号' ? '' : this.phonetitle
telephone: this.mobile,
})
if (res.code == 0) {
uni.navigateBack()
@@ -305,6 +310,7 @@
margin-right: 16rpx;
}
button{
outline: none;
text{
color: #fff!important;
}
@@ -312,6 +318,9 @@
button::after{
border: none;
}
button:active {
background-color: inherit;
}
}
}
}
@@ -320,7 +329,7 @@
height: 96rpx;
line-height: 96rpx;
text-align: center;
background: #E0E0E0;
background-color: #E0E0E0;
border-radius: 48rpx;
font-weight: 400;
font-size: 32rpx;
@@ -331,6 +340,10 @@
right: 0;
margin: auto;
}
.save.active{
background-color: #E3AD7F;
color: #fff;
}
}

View File

@@ -1,227 +0,0 @@
<template>
<view class="content">
<view v-if="isPwd == 0">
<view class="contenttext flex-center">
{{form.password.length == 6?'请再次确认支付密码':"请设置新密码,用于支付验证"}}
</view>
<view class="contentbox flex-between">
<view class="contentboxitem flex-colum">
{{consumeFee.slice(0,1)}}
</view>
<view class="contentboxitem flex-colum">
{{consumeFee.slice(1,2)}}
</view>
<view class="contentboxitem flex-colum">
{{consumeFee.slice(2,3)}}
</view>
<view class="contentboxitem flex-colum">
{{consumeFee.slice(3,4)}}
</view>
<view class="contentboxitem flex-colum">
{{consumeFee.slice(4,5)}}
</view>
<view class="contentboxitem flex-colum">
{{consumeFee.slice(5,6)}}
</view>
</view>
</view>
<view class="" v-else>
</view>
<cwx-keyboard ref="keyboard" v-if="isPwd == 0" @confirmEvent="confirmEvent"
:money.sync="consumeFee"></cwx-keyboard>
</view>
</template>
<script>
import cwxKeyboard from '@/components/cwx-keyboard/cwx-keyboard';
export default {
components: {
cwxKeyboard
},
data() {
return {
isPwd: uni.cache.get('userInfo').isPwd,
form: {
mobile: uni.cache.get('userInfo').telephone,
password: '', //密码
payPassword: '', //二次密码
checkCode: ''
},
passwords: false,
payPasswords: false,
// 注册定时器 初始值
second: 60,
showText: true,
Recapture: '发送验证码',
consumeFee: '', //第一遍
consumeFees: '', //第二遍
money: '',
showoverlay: true
};
},
onLoad() {
if (uni.cache.get('userInfo').isPwd != 0) {
uni.setNavigationBarTitle({
title: '忘记支付密码', // 标题文本,必须是字符串
});
}
},
watch: {
consumeFee(newVal, oldVal) {
if (this.form.password.length == 6) {
this.form.payPassword = newVal
if (this.form.payPassword.length == 6) {
this.userInfosavePayPassword()
}
} else {
this.form.password = newVal
if (this.form.password.length == 6) {
this.$refs.keyboard._handleClearKey() //清空
}
}
}
},
methods: {
confirmEvent(e) {
console.log(e)
},
async CodeRegister() {
const res = await this.api.phoneValidateCode({
// post 手机验证码
phone: this.form.mobile
});
if (res) {
uni.showToast({
title: '验证码获取成功',
icon: 'none'
});
// 定时器
this.showText = false;
this.Recapture = '重新获取';
var interval = setInterval(() => {
let times = --this.second;
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
}, 1000);
setTimeout(() => {
clearInterval(interval);
this.second = 60;
this.showText = true;
}, 60000);
}
},
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
})
if (res.code == 0) {
uni.cache.set('userInfo', res.data);
}
},
async userInfosavePayPassword() {
if (this.form.mobile.length != 11 && this.isPwd == 0) {
uni.showToast({
title: '手机号必须是11位',
icon: 'none'
});
return false;
}
if (this.form.password == null || this.form.password == '') {
uni.showToast({
title: '请输入密码',
icon: 'none'
});
return false;
}
if (this.form.payPassword == null || this.form.payPassword == '') {
uni.showToast({
title: '请输入确认密码',
icon: 'none'
});
return false;
}
if (this.form.password.length != 6 || this.form.payPassword.length != 6) {
uni.showToast({
title: '密码必须是6位',
icon: 'none'
});
return false;
}
if (this.form.payPassword != this.form.password) {
this.$refs.keyboard._handleClearKey() //清空
this.form.payPassword = ''
this.form.password = ''
uni.showToast({
title: '密码和确认密码不一致',
icon: 'none'
});
return false;
}
if (this.form.checkCode == null || this.form.checkCode == '') {
uni.showToast({
title: '请输入验证码',
icon: 'none'
});
return false;
}
let res = await this.api.loginresetPwd({
pwd: this.form.password,
code: this.form.checkCode
})
if (res.code == 0) {
if (uni.cache.get('userInfo').isPwd != 0) {
uni.showToast({
title: '修改成功',
icon: 'none'
});
} else {
uni.showToast({
title: '设置成功',
icon: 'none'
});
}
// 获取用户信息
this.loginwxuserInfo()
setTimeout(() => {
uni.navigateBack();
}, 1000);
} else {
this.$refs.keyboard._handleClearKey() //清空
this.form.payPassword = ''
this.form.password = ''
}
}
}
};
</script>
<style lang="scss">
.content {
height: 100%;
background: #FFFFFF;
.contenttext {
padding: 48rpx 0;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 40rpx;
color: #333333;
}
.contentbox {
margin-top: 48rpx;
padding: 0 56rpx;
.contentboxitem {
width: 88rpx;
height: 88rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #999999;
}
}
}
</style>

View File

@@ -1,384 +0,0 @@
<template>
<view class="container">
<!-- <view class="user-info-wrap" @click="clickinformation">
<view style="width: 108rpx; height: 108rpx;border-radius: 50%;">
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.headImg"
:src="userInfo.headImg" mode="aspectFill">
</image>
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-else src="@/static/avatar.png"
mode="aspectFill">
</image>
</view>
<view class="info flex-colum-start">
<text class="phone">{{userInfo.nickName || '无'}}</text>
</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" @click="clickinformation">
<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;" @click="clickphone()"
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 class="userinfoone" v-if="teblist.length!=0">
<view class="userinfoonebox">
<view class="userinfooneboxitem flex-between" @click="clickinfo(item,index)"
v-for="(item,index) in teblist" :key="index">
<view class="userinfooneboxitemleft flex-start">
<image :src="item.shareImg" mode="aspectFill"></image>
<text>{{item.name}}</text>
</view>
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
</view>
</view>
</view>
<listitem :list='list' v-if="list.length!=0"></listitem>
</view>
</template>
<script>
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
import listitem from "@/components/listitem.vue";
import navseat from '@/components/navseat.vue'
export default {
components: {
listitem,
navseat
},
data() {
return {
titlename: '个人中心',
opacity: false,
userInfo: {},
teblist: [],
list: [],
Topdistance: '',
};
},
onLoad() {},
computed: {
HeighT() { //手机类型的尺寸
return this.$store.getters.is_BarHeight
},
},
mounted() {
setTimeout(() => {
this.$nextTick(() => {
this.GetTop()
});
}, 1000)
// 当组件挂载完成后获取距离
},
onPageScroll(e) {
if (e.scrollTop <= 44) { //搜索导航栏
this.opacity = false
} else {
this.opacity = true
}
},
onShow() {
if (uni.cache.get('token')) {
this.init_fn()
this.loginwxuserInfo()
this.tbPlatformDict()
}
},
methods: {
clickphone() {
uni.makePhoneCall({
phoneNumber: uni.cache.get('userInfo').custPhone
});
},
clickinformation() {
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() {
uni.showModal({
title: '注意',
content: '确定要退出登录吗?',
success: async (res) => {
if (res.confirm) {
try {
await this.api.loginOut();
} catch (e) {
//TODO handle the exception
}
uni.cache.clear();
uni.reLaunch({
url: '/pages/login/login'
});
}
}
});
},
loginClick() {
uni.cache.clear();
uni.reLaunch({
url: '/pages/login/login'
});
},
// 精选推荐
// 下面初始数据
init_fn() {
this.list = []
this.form = {
address: uni.cache.get('getLocationstorage').address, //地址
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat,
type: '', //品类
orderBy: 5, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐
other: '', //附近1KM 1选中 0不选中
page: 1, //页数
size: 10, //页容量
dateType: '',
status: 'loadmore'
}
this.onLoadlist()
},
async onLoadlist() {
try {
let res = await this.api.indexlist(this.form)
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}
} catch (e) {}
},
clickinfo(item, index) {
switch (item.jumpType) {
case 'scan': //特殊处理点击
switch (item.value) {
case 'loginOut':
this.boxClick()
break;
}
break;
case 'scan_applet':
uni.navigateToMiniProgram(JSON.parse(item.value))
break
case 'relative': //内部页面
uni.pro.navigateTo(item.absUrl)
break;
case 'absolute': //外链url
uni.navigateTo({
url: `/pages/webview/webview?url=${item.menuUrl}`
});
break;
}
},
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
})
if (res.code == 0) {
uni.cache.set('userInfo', res.data);
this.userInfo = uni.cache.get('userInfo')
}
},
async tbPlatformDict() {
let res = await this.api.tbPlatformDict({
type: 'ownMenu'
})
// console.log(res)
if (res.code == 0) {
this.teblist = res.data
}
},
// / 更换头像
onChooseAvatar(e) {
uni.showLoading({
title: '上传中',
mask: true
})
console.log(e.detail.avatarUrl)
let file = e.detail.avatarUrl;
uploadImage(file, 'avatar',
result => {
//将上传后的图片以对象官方要求的格式的形式存入uni-file-picker的value值imageValueimageValue值的结构为数组包对象用于图片回显
// let objAge = {
// 'url': result,
// 'extname': 'png',
// 'name': 'imgss.png'
// };
// this.userlist.avatar.push(objAge)
this.userInfo.avatar = result
console.log(this.userInfo.avatar)
uni.hideLoading()
}, result => {
uni.hideLoading()
})
},
orderHandle(type) {
this.useStorage.set('orderType', type);
uni.switchTab({
url: '/pages/order/order'
});
}
}
};
</script>
<style scoped lang="scss">
.user-info-wrap {
position: relative;
padding: 48rpx 32rpx 88rpx 32rpx;
display: flex;
align-items: center;
width: 750rpx;
background: #FFD158;
border-radius: 0rpx 0rpx 40rpx 0rpx;
.info {
flex: 1;
padding-left: $paddingSize;
display: flex;
flex-direction: column;
.name {
input {
text-align: left;
font-size: 32upx;
}
}
.phone {
padding-top: 8upx;
}
}
}
.user-info-wrap::after {
position: absolute;
content: '';
bottom: 40rpx;
right: 0;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
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 {
position: relative;
padding: 48rpx 28rpx;
width: 100%;
// top: -40rpx;
background: #F6F6F6;
// border-radius: 40rpx 0 0rpx 0rpx;
.userinfoonebox {
padding: 32rpx 20rpx 32rpx 52rpx;
border-radius: 22rpx;
background: #FFFFFF;
width: 100%;
.userinfooneboxitem {
width: 100%;
margin-top: 32rpx;
.userinfooneboxitemleft {
image {
width: 41.33rpx;
height: 36.9rpx;
}
text {
margin-left: 32rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
}
}
.userinfooneboxitem:nth-child(1) {
margin-top: 0;
}
}
}
</style>

View File

@@ -8,8 +8,8 @@
<image class="my_info_left_head" :src="userInfo.headImg" mode="aspectFill"></image>
<view class="name">{{userInfo.nickName || '无'}}</view>
</view>
<image class="my_info_right_qr" v-if="userInfo" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_qRcode.png'" mode="aspectFill"></image>
<view class="my_info_right" v-else>
<image class="my_info_right_qr" @click="clickEvent" v-if="shopInfo.isVip!=0" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_qRcode.png'" mode="aspectFill"></image>
<view class="my_info_right" @click="clickEvent" v-else>
<text>免费入会</text>
</view>
</view>
@@ -57,18 +57,19 @@
teblist: [],
myAssetsList: [
{ name: "储值", type: "recharge", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/storedValue.png"},
{ name: "积分", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"},
// { name: "积分", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"},
{ name: "优惠券", type: "my_coupon", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/coupon.png"},
{ name: "权益卡", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/equityCard.png"}
// { name: "权益卡", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/equityCard.png"}
],
myFunList: [
{ name: "我的优惠券", type: "my_coupon", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png"},
{ name: "我的订单", type: "my_order", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_order.png"},
{ name: "收货地址", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_address.png"},
// { name: "收货地址", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_address.png"},
{ name: "个人资料", type: "my_info", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/personal.png"},
{ name: "我的会员卡", type: "my_member", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_member.png"},
{ name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
// { name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
],
shopInfo: {},
};
},
onLoad() {},
@@ -82,13 +83,23 @@
},
onShow() {
if (uni.cache.get('token')) {
this.init_fn()
this.loginwxuserInfo()
this.tbPlatformDict()
this.init_fn()
this.loginwxuserInfo()
if (uni.cache.get('shopUser') ) {
this.getShopInfo();
} else{
}
},
methods: {
// 下面初始数据
init_fn() {
},
/**
* 获取用户信息
*/
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
@@ -98,6 +109,8 @@
this.userInfo = uni.cache.get('userInfo')
}
},
async tbPlatformDict() {
let res = await this.api.tbPlatformDict({
type: 'ownMenu'
@@ -107,10 +120,7 @@
this.teblist = res.data
}
},
// 下面初始数据
init_fn() {
},
clickphone() {
uni.makePhoneCall({
phoneNumber: uni.cache.get('userInfo').custPhone
@@ -123,8 +133,54 @@
url: '/pages/login/login'
});
},
/**
* 获取店铺信息
*/
async getShopInfo() {
let res = await this.api.shopUserInfo({
"shopId": uni.cache.get('shopUser'),
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
this.shopInfo = res.data
}
if ( res.data.isVip == 0 ) {
this.memberOpen = true;
return;
}
},
/**
* 查看二维码
*/
clickEvent() {
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
if ( this.shopInfo.isVip == 0 ) {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: uni.cache.get('shopUser')
})
} else {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(this.shopInfo)
})
}
} else{
uni.pro.navigateTo('member/list', {
type: 'user_payCode'
})
}
},
clickTo(item, index) {
let shopId = null;
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
shopId = uni.cache.get('shopUser');
} else{
}
switch (item.type) {
case 'my_order':
uni.switchTab({
@@ -132,14 +188,20 @@
});
break
case 'my_member':
if (uni.cache.get('token')) {
uni.pro.navigateTo('member/list')
} else {
this.loginClick()
}
uni.pro.navigateTo('member/list')
break
case 'recharge':
uni.pro.navigateTo('member/index')
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
uni.pro.navigateTo('member/index', {
shopId: uni.cache.get('shopUser'),
type: 'index',
})
} else{
uni.pro.navigateTo('member/list', {
type: 'user_recharge'
})
}
break
case 'my_coupon': //内部页面
uni.pro.navigateTo('user/coupon')
@@ -238,7 +300,7 @@
}
.my_assets_list{
display: flex;
justify-content: space-between;
justify-content: space-around;
padding: 0 38rpx;
.my_list_item{
display: flex;