订单相关修改提测
This commit is contained in:
@@ -17,36 +17,53 @@
|
||||
<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'">
|
||||
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': item.status != 0,}" v-if="item.type == 2">
|
||||
<view class="containertopboxitemleft_one"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_ones'">
|
||||
<text style="font-size: 28rpx;">¥</text>
|
||||
<text>{{item.couponsAmount || 0}}</text>
|
||||
<block v-if="item.type == 2">
|
||||
<text>{{item.num || 0}}</text>
|
||||
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
||||
</block>
|
||||
<block v-else >
|
||||
<text style="font-size: 28rpx;margin-right: 6rpx;">¥</text>
|
||||
<text>{{item.couponsAmount || 0}}</text>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
<view class="containertopboxitemleft_tow"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_tows'">
|
||||
优惠券(元)
|
||||
:class="{
|
||||
'containertopboxitemleft_tows': item.status != 0,
|
||||
'containertopboxitemleft_nameVip': item.type == 2,
|
||||
}">
|
||||
{{ item.type == 2 ? item.detail : '优惠券(元)'}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="containertopboxitemright">
|
||||
<view class="containertopboxitemright_one">
|
||||
无门槛使用
|
||||
<view class="flex-start">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png" mode="aspectFill">
|
||||
<text class="title">{{ item.shopName }}</text>
|
||||
</view>
|
||||
<text>无门槛使用</text>
|
||||
</view>
|
||||
<view class="containertopboxitemright_tow">
|
||||
<view>通用红包券</view>
|
||||
<view> {{ item.type == 2 ? '会员商品券' : '通用红包券'}}</view>
|
||||
<view
|
||||
@click="navigatorGo(item)"
|
||||
:class="item.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
||||
{{item.status == 0 ? '去使用':'已过期'}}
|
||||
{{item.status == 0 ? '去使用':'已使用'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="containertopboxitemright_there">
|
||||
<!-- <view class="containertopboxitemright_there">
|
||||
有效期至:{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
|
||||
</view>
|
||||
</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>
|
||||
|
||||
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||
v-if="list.length <= 0" mode="aspectFill"></image>
|
||||
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
||||
</view>
|
||||
</view>
|
||||
@@ -66,82 +83,59 @@
|
||||
type: '0'
|
||||
},
|
||||
{
|
||||
name: '已过期',
|
||||
name: '已使用',
|
||||
type: '1'
|
||||
}
|
||||
],
|
||||
towcontentclickindex: 0,
|
||||
list: [],
|
||||
is_end:false,
|
||||
form: {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
statuses: ''
|
||||
},
|
||||
status: "",
|
||||
|
||||
};
|
||||
},
|
||||
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
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换类型
|
||||
* @param {Object} index
|
||||
* @param {Object} item
|
||||
*/
|
||||
towcontentclick(index, item) {
|
||||
this.towcontentclickindex = index;
|
||||
this.status = item.type;
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取优惠券数据
|
||||
*/
|
||||
async ordermineCouponsthis() {
|
||||
try {
|
||||
let res = await this.api.ordermineCoupons({
|
||||
let res = await this.api.getUserConpons({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
status: this.form.statuses,
|
||||
page: this.form.page,
|
||||
size: this.form.size,
|
||||
orderId:""
|
||||
shopId: uni.cache.get('shopId'),
|
||||
status: this.status
|
||||
})
|
||||
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)
|
||||
if (res.code == 0) {
|
||||
this.list = res.data;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
towcontentclick(index, item) {
|
||||
this.towcontentclickindex = index
|
||||
this.form.statuses = item.type
|
||||
this.init_fn(item.type)
|
||||
}
|
||||
|
||||
/**
|
||||
* 去使用优惠券
|
||||
*/
|
||||
navigatorGo ( item ) {
|
||||
if ( item.type == 2 ) {
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -210,44 +204,33 @@
|
||||
margin-bottom: 32rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
border-radius: 18rpx;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
.containertopboxitemleft {
|
||||
position: relative;
|
||||
width: 182rpx;
|
||||
height: 192rpx;
|
||||
background: #E3AD7F;
|
||||
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;
|
||||
|
||||
}
|
||||
// ::before {
|
||||
// content: '';
|
||||
// position: absolute;
|
||||
// bottom: 0rpx;
|
||||
// left: 166rpx;
|
||||
// background: #fff;
|
||||
// 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;
|
||||
@@ -269,12 +252,44 @@
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.containertopboxitemleft_nameVip{
|
||||
color: #967152;
|
||||
}
|
||||
|
||||
.containertopboxitemleft_tows {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.containertopboxitemleft::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -20rpx;
|
||||
left: 166rpx;
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0rpx -13rpx 7rpx -6rpx rgba(0, 0, 0, 0.1);
|
||||
z-index: 999;
|
||||
}
|
||||
.containertopboxitemleft::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
left: 166rpx;
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0rpx 25rpx 15rpx -4rpx rgba(0, 0, 0, 0.1);
|
||||
z-index: 999;
|
||||
|
||||
}
|
||||
.containertopboxitemleft_vip{
|
||||
background-color: #E1D4B2;
|
||||
}
|
||||
.containertopboxitemlefts {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
@@ -285,26 +300,39 @@
|
||||
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: bold;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
padding: 16rpx 0 16rpx 0;
|
||||
border-bottom: 1rpx dotted #707070;
|
||||
padding: 16rpx 0 20rpx 0;
|
||||
border-bottom: 1rpx dashed #707070;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.icon{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
margin-right: 14rpx;
|
||||
}
|
||||
text{
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.title{
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitemright_tow {
|
||||
margin-top: 18rpx;
|
||||
margin-top: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.containertopboxitemright_there {
|
||||
@@ -318,13 +346,13 @@
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.containertopboxitemright_four {
|
||||
color: #FFFFFF;
|
||||
background: #333;
|
||||
background: #967152;
|
||||
}
|
||||
|
||||
.containertopboxitemright_fours {
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='opacity' :title='titlename' :titleshow='true'></navseat>
|
||||
<view class="onecontent">
|
||||
<view :style="[{'padding-top':HeighT.customBar +44+'px'}]"></view>
|
||||
<view class="onecontentbox">
|
||||
<!-- <button open-type="chooseAvatar" @chooseavatar="uploadImg">
|
||||
<image class="onecontentboximage" :src="userHeadImg" mode=""></image>
|
||||
</button> -->
|
||||
<!-- <image class="onecontentboximage" :src="userHeadImg" mode="" @click="uploadImg"></image> -->
|
||||
<button type="default" class="btn" open-type="chooseAvatar" @chooseavatar="uploadImg">
|
||||
<view class="" :style="'background-image:url('+userHeadImg+');'"
|
||||
style="width: 180rxp;height: 180rpx; background-position: center;"></view>
|
||||
</button>
|
||||
|
||||
|
||||
<view class="onecontentboxitem flex-between">
|
||||
<view class="onecontentboxitemtext">
|
||||
昵称
|
||||
</view>
|
||||
<input class="onecontentboxiteminput" v-model="nickName" type="nickname" @blur="bindblur"
|
||||
placeholder="请输入昵称" @input="bindinput" />
|
||||
|
||||
</view>
|
||||
<view class="onecontentboxitem flex-between" style="border-top: 1rpx dotted #333333;">
|
||||
<view class="onecontentboxitemtext">
|
||||
手机号
|
||||
</view>
|
||||
<button class="onecontentboxiteminput buttonstyle"
|
||||
style="background-color: #fff;border: none;!important" open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhone">{{phonetitle}} </button>
|
||||
<!-- <input class="onecontentboxiteminput" disabled v-model="phonetitle" type="text"
|
||||
placeholder="请输入手机号"> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontentboxitemnamber" @click="sumbit">
|
||||
保存
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
titlename: '完善信息',
|
||||
opacity: false,
|
||||
form: {
|
||||
address: '', //地址
|
||||
type: '', //品类
|
||||
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
|
||||
other: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
},
|
||||
userInfo: uni.cache.get('userInfo'),
|
||||
userHeadImg: "",
|
||||
nickName: '',
|
||||
phonetitle: ""
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.userInfo = uni.cache.get('userInfo')
|
||||
this.nickName = this.userInfo.nickName
|
||||
this.userHeadImg = this.userInfo.headImg
|
||||
this.phonetitle = this.userInfo.telephone ? this.userInfo.telephone : '请授权手机号'
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacitys = false
|
||||
} else {
|
||||
this.opacitys = true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getPhone(d) {
|
||||
if (d.detail.iv) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
iv: d.detail.iv,
|
||||
})
|
||||
this.phonetitle = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
bindblur(e) {
|
||||
console.log(e, 11)
|
||||
this.nickName = e.detail.value; // 获取微信昵称
|
||||
},
|
||||
bindinput(e) {
|
||||
console.log(e, 22)
|
||||
this.nickName = e.detail.value; // 获取微信昵称
|
||||
},
|
||||
// uploadImg() {
|
||||
// let _this = this
|
||||
// uni.chooseImage({
|
||||
// crop: {
|
||||
// width: 200,
|
||||
// height: 200
|
||||
// },
|
||||
// success: (chooseImageRes) => {
|
||||
// const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
// uni.uploadFile({
|
||||
// url: uni.conf.baseUrl + '/common/upload',
|
||||
// filePath: tempFilePaths[0],
|
||||
// header: {
|
||||
// environment: 'app',
|
||||
// type: 'android',
|
||||
// version: '1.7.3',
|
||||
// },
|
||||
// name: "file",
|
||||
// formData: {
|
||||
// file: chooseImageRes.tempFiles[0],
|
||||
// },
|
||||
// success: (uploadFileRes) => {
|
||||
// let {
|
||||
// data
|
||||
// } = JSON.parse(uploadFileRes.data)
|
||||
// this.userHeadImg = data
|
||||
// },
|
||||
// });
|
||||
// },
|
||||
// })
|
||||
// },
|
||||
uploadImg(e) {
|
||||
const {
|
||||
avatarUrl
|
||||
} = e.detail
|
||||
console.log(e)
|
||||
console.log(e.detail)
|
||||
// this.userHeadImg = avatarUrl
|
||||
uni.uploadFile({
|
||||
url: 'https://wxcashiertest.sxczgkj.cn/cashierService/common/upload',
|
||||
// url: uni.conf.baseUrl + '/common/upload',
|
||||
|
||||
filePath: avatarUrl,
|
||||
header: {
|
||||
environment: 'app',
|
||||
type: 'android',
|
||||
version: '1.7.3',
|
||||
},
|
||||
name: "file",
|
||||
formData: {
|
||||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let {
|
||||
data
|
||||
} = JSON.parse(uploadFileRes.data)
|
||||
this.userHeadImg = data
|
||||
},
|
||||
});
|
||||
},
|
||||
async sumbit() {
|
||||
let res = await this.api.upUserInfo({
|
||||
headImg: this.userHeadImg,
|
||||
nickName: this.nickName,
|
||||
telephone: this.phonetitle == '请授权手机号' ? '' : this.phonetitle
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
height: 446rpx;
|
||||
background: linear-gradient(180deg, #FFD158 0%, #F9F9F9 100%);
|
||||
|
||||
.onecontentbox {
|
||||
position: relative;
|
||||
margin-top: 116rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
padding: 75rpx 32rpx 0rpx 32rpx;
|
||||
|
||||
.onecontentboximage {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: -60rpx;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.onecontentboxitem {
|
||||
padding: 24rpx 0;
|
||||
|
||||
.onecontentboxitemtext {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontentboxiteminput {
|
||||
text-align: right;
|
||||
flex: auto;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.buttonstyle {
|
||||
.buttonstyle:after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentboxitemnamber {
|
||||
margin-top: 84rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 20rpx 0;
|
||||
background: #FFD158;
|
||||
border-radius: 46rpx 46rpx 46rpx 46rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 100%;
|
||||
padding: 0;
|
||||
|
||||
>view {
|
||||
border-radius: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.buttonstyle:after {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
@@ -6,7 +6,12 @@
|
||||
<view class="list_item">
|
||||
<view class="list_item_left">头像</view>
|
||||
<view class="list_item_right flex-center">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="list_item_right_head" type="default" open-type="chooseAvatar" @chooseavatar="uploadImg">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button class="list_item_right_head" type="default" open-type="chooseAvatar" onChooseAvatar="uploadImg">
|
||||
<!-- #endif -->
|
||||
<image class="list_item_right_head" :src="userHeadImg" mode="aspectFill"></image>
|
||||
</button>
|
||||
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
||||
@@ -38,7 +43,7 @@
|
||||
<view class="list_item_left">性别</view>
|
||||
<view class="list_item_right flex-center">
|
||||
<view class="place r" @click="sexShow = true">{{sexText}}</view>
|
||||
<u-picker @cancel="sexShow = false" :show="sexShow" :columns="sexList" keyName="label" @confirm="confirmSex"></u-picker>
|
||||
<u-picker @cancel="sexShow = false" itemHeight="66" :show="sexShow" :columns="sexList" keyName="label" @confirm="confirmSex"></u-picker>
|
||||
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
@@ -51,7 +56,7 @@
|
||||
<!-- <picker :show="calendarShow" mode="date"></picker> -->
|
||||
<u-datetime-picker
|
||||
mode="date"
|
||||
itemHeight="66"
|
||||
itemHeight="90"
|
||||
visibleItemCount="5"
|
||||
@cancel="calendarShow = false"
|
||||
:show="calendarShow"
|
||||
@@ -171,10 +176,30 @@
|
||||
* 获取手机号
|
||||
* @param {Object} d
|
||||
*/
|
||||
async getPhone(d) {
|
||||
getPhone(d) {
|
||||
console.log(d)
|
||||
if (d.detail.iv) {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
// 微信小程序环境
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
iv: d.detail.iv,
|
||||
})
|
||||
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||
this.mobile = res.data;
|
||||
}
|
||||
});
|
||||
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序环境
|
||||
my.getAuthCode({
|
||||
scopes: 'auth_user',
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
@@ -185,7 +210,10 @@
|
||||
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||
this.mobile = res.data;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// #endif
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -217,6 +245,7 @@
|
||||
* @param {Object} e
|
||||
*/
|
||||
uploadImg(e) {
|
||||
console.log(e)
|
||||
const { avatarUrl } = e.detail
|
||||
// this.userHeadImg = avatarUrl
|
||||
uni.uploadFile({
|
||||
@@ -233,11 +262,15 @@
|
||||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
console.log(uploadFileRes)
|
||||
let {
|
||||
data
|
||||
} = JSON.parse(uploadFileRes.data)
|
||||
this.userHeadImg = data
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -270,6 +303,10 @@
|
||||
background: #fff;
|
||||
}
|
||||
.container{
|
||||
|
||||
::v-deep .u-input input{
|
||||
background-color: transparent;
|
||||
}
|
||||
.info_list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
<script>
|
||||
import _ from 'lodash';
|
||||
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
||||
import webSocketUtils from '@/common/js/websocket.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
<script>
|
||||
import _ from 'lodash';
|
||||
import navbar from '@/uni_modules/uview-ui/libs/config/props/navbar';
|
||||
import webSocketUtils from '@/common/js/websocket.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
this.loginwxuserInfo()
|
||||
if (uni.cache.get('shopUser') ) {
|
||||
if (uni.cache.get('shopId') ) {
|
||||
this.getShopInfo();
|
||||
this.getShopExtend();
|
||||
} else{
|
||||
@@ -107,7 +107,7 @@
|
||||
*/
|
||||
async getShopExtend () {
|
||||
let res = await this.api.getShopExtend({
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
autokey: "my_bg" //index_bg my_bg member_bg shopInfo_bg
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
@@ -120,11 +120,13 @@
|
||||
*/
|
||||
async loginwxuserInfo() {
|
||||
let res = await this.api.loginwxuserInfo({
|
||||
// userId: 109
|
||||
userId: uni.cache.get('userInfo').id
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('userInfo', res.data);
|
||||
this.userInfo = uni.cache.get('userInfo')
|
||||
this.userInfo = res.data;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -157,7 +159,7 @@
|
||||
*/
|
||||
async getShopInfo() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
@@ -173,10 +175,10 @@
|
||||
* 查看二维码
|
||||
*/
|
||||
clickEvent() {
|
||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
if ( this.shopInfo.isVip == 0 ) {
|
||||
uni.pro.navigateTo('member/memberdetails', {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
shopId_id: uni.cache.get('shopId')
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
@@ -194,8 +196,8 @@
|
||||
|
||||
clickTo(item, index) {
|
||||
let shopId = null;
|
||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
||||
shopId = uni.cache.get('shopUser');
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
shopId = uni.cache.get('shopId');
|
||||
} else{
|
||||
|
||||
}
|
||||
@@ -209,9 +211,9 @@
|
||||
uni.pro.navigateTo('member/list')
|
||||
break
|
||||
case 'recharge':
|
||||
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
uni.pro.navigateTo('member/index', {
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index',
|
||||
})
|
||||
} else{
|
||||
|
||||
Reference in New Issue
Block a user