作者 lihongjuan

1

... ... @@ -121,6 +121,10 @@
width: 100%;
height: 100%;
}
.spec {
color: #3D454C;
font-size: 28rpx;
}
/* 省份选择 */
.proselect{
... ...
... ... @@ -6,7 +6,7 @@
<view class="addimg">
<image src="../../static/weizhi.png" mode=""></image>
</view>
<view class="addname">天津</view>
<view class="addname">{{provincename}}</view>
</view>
<view class="navmiddle flexone" @click="search">
<view class="middleleft">
... ... @@ -202,7 +202,8 @@
order: '',
page: 1,
shoplist: [],
carttotal:''
carttotal:'',
provincename:''
}
},
onLoad() {
... ... @@ -214,6 +215,54 @@
},
methods: {
getlocation() {
let that=this;
uni.getLocation({
type: 'wgs84',
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
uni.setStorageSync("longitude",res.longitude);
uni.setStorageSync("latitude",res.longitude)
var point = new plus.maps.Point(res.longitude, res.latitude);
plus.maps.Map.reverseGeocode(
point, {},
function(event) {
console.log(event)
var address = event.address; // 转换后的地理位置
var point = event.coord; // 转换后的坐标信息
var coordType = event.coordType; // 转换后的坐标系类型
console.log(address, 'address');
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
console.log(address.match(reg));
var addressname=address.match(reg);
console.log(addressname);
if(uni.getStorageSync("provincename")==''){
that.provincename=addressname[0];
uni.setStorageSync("provincename",that.provincename)
}else{
that.provincename=uni.getStorageSync("provincename")
}
console.log(that.provincename)
// that.getprovinceid()
// _this.addressList = address.match(reg).toString().split(",");
// _this.address = _this.addressList[1];
// console.log(_this.addressList[0]);
// console.log(_this.addressList[1]);
// console.log(_this.addressList[2]);
},
function(e) {}
);
}
});
},
// 获取购物车气泡
getcartnum(){
let that = this;
... ... @@ -334,6 +383,9 @@
})
}
},
},
onShow(){
this.getlocation()
}
}
... ...
... ... @@ -3,82 +3,81 @@
<view class="texttitle">
{{present_data.question_name}}({{present_data.type==1?'单选':'多选'}})
</view>
<view class="textlist">
<view class='textitem flex' :class="item.answer==1&&item.chose==true?'selright':item.answer==2&&item.chose==true?'selwrong flextwo':''" v-for="(item,index) in present_data.option" :key="index" @click="present_data.canchose==present_data.correct_number?selchose(index):''">
<view class="textlist" v-if="issure">
<view class='textitem flex' :class="item.chose==true?'selright':''" v-for="(item,index) in present_data.option" :key="index" @click="selchose(index)">
<view class="flex">
<view class="textitemleft" >
<image src="../../static/meisel.png" mode=""></image>
<image src="../../static/selright.png" mode="" v-if="item.chose==true"></image>
<image src="../../static/meisel.png" mode="" v-else></image>
</view>
<view class="textitemright">
{{item.sel}}、{{item.option_name}}
</view>
</view>
<view class="wrongimg" v-if="item.answer==2&&item.chose==true">
<!-- <view class="wrongimg" v-if="item.answer==2&&item.chose==true">
<image src="../../static/wrong.png" mode=""></image>
</view>
</view> -->
</view>
<!-- <view class='textitem flex selright'>
<view class="textitemleft">
<image src="../../static/selright.png" mode=""></image>
</view>
<view class="textitemright">
A、6
</view>
</view>
<view class='textitem flextwo selwrong'>
</view>
<view class="textlist" v-else>
<view class='textitem flex' :class="item.answer==1&&item.chose==true?'selright':item.answer==2&&item.chose==true?'selwrong flextwo':''" v-for="(item,index) in present_data.option" :key="index" >
<view class="flex">
<view class="textitemleft">
<image src="../../static/slewrong.png" mode=""></image>
<view class="textitemleft" >
<image src="../../static/selright.png" mode="" v-if="item.answer==1&&item.chose==true"></image>
<image src="../../static/wrong.png" mode="" v-else-if="item.answer==2&&item.chose==true"></image>
<image src="../../static/meisel.png" mode="" v-else></image>
</view>
<view class="textitemright">
A、6
{{item.sel}}、{{item.option_name}}
</view>
</view>
<view class="wrongimg">
<view class="wrongimg" v-if="item.answer==2&&item.chose==true">
<image src="../../static/wrong.png" mode=""></image>
</view>
</view>
<view class='textitem flexone'>
<view class="textitemleft">
<image src="../../static/meisel.png" mode=""></image>
</view>
<view class="textitemright">
A、6
</view>
</view> -->
</view>
<view class="huiyuanbot boxsizing">
<!-- v-if="next_data!=''&&last_data==''" -->
<!-- <view class="behuiyuanbtn" v-if="issure" @click="next_data==''?sureti:sure">确认{{next_data==''?'1':'2'}}</view> -->
<view v-if="issure">
<view class="behuiyuanbtn" @click="sureti">确认</view>
<!-- <view class="behuiyuanbtn" @click="sure" v-else>确认</view> -->
</view>
<view v-else>
<view class="behuiyuanbtn" @click="nextquestion" v-if="next_data!=''">下一题</view>
<view class="behuiyuanbtn" @click="sure" v-else>完成</view>
</view>
<!-- <view v-else>
<view class="behuiyuanbtn" @click="nextquestion" v-if="next_data!=''">下一题</view>
</view> -->
<view class="behuiyuanbtn" v-if="next_data!=''&&last_data==''" @click="nextquestion">下一题</view>
<view class="flextwo" v-else-if="last_data!=''">
<!-- <view class="flextwo" v-else-if="last_data!=''&&next_data!==''">
<view class="behuiyuanbtn btnitem" @click="prequestion">上一题</view>
<view class="behuiyuanbtn btnitem" @click="nextquestion">下一题</view>
</view>
<view class="behuiyuanbtn" v-else @click="sure">确认</view>
</view> -->
<!-- v-else -->
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
questionnaire_id: '',
present_data: [],
last_data: [],
next_data: [],
present_data: '',
last_data: '',
next_data: '',
question_id:'',
score:0,
selitem:0,
//是否在上一题返回的下一题
islast:0,
present_datakarr:[],
issure:true
}
},
onLoad(options) {
... ... @@ -90,18 +89,16 @@
methods: {
getqusetion() {
let that = this;
var url = 'question/get_question';
var params = {
questionnaire_id: that.questionnaire_id,
question_id:that.question_id
}
console.log(params)
app.post(url, params, "post").then((res) => {
console.log(res);
that.present_data = res.data.data.present_data;
that.present_data.canchose=that.present_data.correct_number;
that.present_data.canchose=0;
that.present_data.option.forEach(function(value, index, array) {
value.chose=false;
switch (index) {
... ... @@ -116,74 +113,137 @@
break;
case 3:
value.sel = 'D';
break;
break;
}
})
that.present_data = that.present_data;
that.last_data = res.data.data.last_data;
that.next_data = res.data.data.next_data;
// 查看题目答案是否正确
let newpresent_datakarr=uni.getStorageSync("present_datakarr");
console.log(newpresent_datakarr)
newpresent_datakarr.forEach(function(value,index,array){
// console.log(348934,value)
// console.log('1111',that.present_data)
if(value.id==that.present_data.id){
that.present_data=value;
// console.log(that.present_data)
}
})
}).catch((err) => {
console.log(err)
})
},
// 选择题目
selchose(index){
let that=this;
that.selitem++;
that.present_data.canchose++;
console.log('选中的题数',that.present_data.canchose)
that.present_data.option.forEach(function(value,indexk,array){
if(index==indexk){
value.chose=true;
// value.canchose++;
that.$forceUpdate()
if(that.present_data.correct_number==1){
if(index==indexk){
value.chose=true;
// value.canchose++;
that.$forceUpdate();
}else{
value.chose=false;
that.$forceUpdate();
}
}else{
if(index==indexk){
value.chose=true;
that.$forceUpdate();
}
}
})
that.present_data=that.present_data;
that.score=that.score+that.present_data.score;
if(that.present_data.correct_number==1){
that.present_data.option.forEach(function(value,index,array){
if(value.chose==true&&value.answer==1){
that.score=that.score+that.present_data.score;
}
})
}else{
let arr=[]
that.present_data.option.forEach(function(value,index,array){
if(value.chose==true&&value.answer==1){
arr.push(1)
}
if(arr.length==that.present_data.correct_number){
that.score=that.score+that.present_data.score;
}
})
}
console.log(that.present_data)
console.log('考试得分',that.score)
uni.setStorageSync("present_datak",that.present_data);
uni.setStorageSync("last_datak",that.last_data);
uni.setStorageSync("next_datak",that.next_data);
this.present_datakarr.push(this.present_data);
// console.log(this.present_datakarr)
uni.setStorageSync("present_datakarr",this.present_datakarr);
console.log('xiaadsk',that.next_data)
},
//下一题
nextquestion(){
let that=this;
// this.question_id=this.present_data.id;
this.question_id=2;
this.question_id=this.next_data.id;
console.log('判断是否答题',that.selitem);
// 判断是否答题
if(that.selitem==0){
uni.showToast({
title:"请答题",
icon:"none"
})
}else{
uni.setStorageSync("present_data",that.present_data);
uni.setStorageSync("last_data",that.last_data);
uni.setStorageSync("next_data",that.next_data);
that.selitem==0;
if(that.islast==1){
that.islast=0
this.present_data=uni.getStorageSync("present_datak");
this.last_data=uni.getStorageSync("last_datak");
this.next_data=uni.getStorageSync("next_datak");
}else{
this.getqusetion();
}
that.selitem=0;
that.getqusetion();
that.issure=true
// uni.setStorageSync("present_data",that.present_data);
// uni.setStorageSync("last_data",that.last_data);
// uni.setStorageSync("next_data",that.next_data);
// // 判断是否是在上一题过来的
// if(that.islast==1){
// that.islast=0
// this.present_data=uni.getStorageSync("present_datak");
// that.present_data.canchose=that.present_data.correct_number;
// console.log('dangqian',this.present_data.canchose)
// this.last_data=uni.getStorageSync("last_datak");
// this.next_data=uni.getStorageSync("next_datak");
// }else{
// that.selitem=0;
// this.getqusetion();
// }
}
},
// 上一题
prequestion(){
this.present_data=uni.getStorageSync("present_data");
this.last_data=uni.getStorageSync("last_data");
this.next_data=uni.getStorageSync("next_data");
// this.present_data=uni.getStorageSync("present_data");
// this.last_data=uni.getStorageSync("last_data");
// this.next_data=uni.getStorageSync("next_data");
this.islast=1
this.question_id=this.last_data.id;
this.islast=1;
this.getqusetion();
},
sureti(){
console.log(343348989)
this.issure=false
this.question_id=this.present_data.id;
this.getqusetion()
},
sure(){
let that = this;
var url = 'question/submit_answer';
... ... @@ -211,6 +271,9 @@
}
},
onShow(){
uni.setStorageSync("present_datakarr","")
}
}
... ...
... ... @@ -222,6 +222,8 @@
});
},
// 根据城市名字获取id
getprovinceid(){
let that = this;
... ...
... ... @@ -13,14 +13,14 @@
北京
<image src="../../static/huixia.png" />
</view> -->
<view class="proselect flexthree" @click="selprovince">
<text class="proname">{{provincename}}</text>
<image class="down-ico" src="../../static/huixia.png" />
</view>
<!-- picker @change="bindproChange" :value="index" :range="provincelist" range-key="name">
</picker> -->
<picker @change="bindproChange" :value="index" :range="provincelist" range-key="name">
<!-- <view class="uni-input">{{array[index]}}</view> -->
<view class="proselect flexthree">
<text class="proname">{{provincename}}</text>
<image class="down-ico" src="../../static/huixia.png" />
</view>
</picker>
</view>
<!-- nav -->
<view class="nav-menus">
... ... @@ -72,8 +72,8 @@
<!-- 点赞, 人数 -->
<view class="thumbs-number" @click.stop="praisedian(item,index)">
<view class="thumbs">
<image src="../../static/tienozan.png" v-if="item.is_praise==2"></image>
<image src="../../static/tiezan.png" v-else></image>
<image src="../../static/tienozan.png" v-if="item.is_praise==2"></image>
<image src="../../static/tiezan.png" v-else></image>
{{item.praise}}
</view>
<view class="number">
... ... @@ -100,7 +100,7 @@
showbanben: false,
kindtype: '',
provincelist: [],
province_id: '',
province_id:'',
provincename: '',
index: 0,
keyword: '',
... ... @@ -109,8 +109,7 @@
},
onLoad(options) {
this.kindtype = options.id;
this.getprovincelist();
uni.setStorageSync("provincename", "")
this.getprovincelist()
},
methods: {
kindchange(e) {
... ... @@ -119,70 +118,6 @@
this.luntanlist = [];
this.getluntanlist()
},
selprovince() {
uni.navigateTo({
url: '/pages/nearshop/allprovince'
})
},
getlocation() {
let that = this;
uni.getLocation({
type: 'wgs84',
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
var point = new plus.maps.Point(res.longitude, res.latitude);
plus.maps.Map.reverseGeocode(
point, {},
function(event) {
console.log(event)
var address = event.address; // 转换后的地理位置
var point = event.coord; // 转换后的坐标信息
var coordType = event.coordType; // 转换后的坐标系类型
console.log(address, 'address');
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
console.log(address.match(reg));
var addressname = address.match(reg);
console.log(addressname);
if (uni.getStorageSync("provincename") == '') {
that.provincename = addressname[0];
uni.setStorageSync("provincename", that.provincename)
} else {
that.provincename = uni.getStorageSync("provincename")
}
console.log(that.provincename)
// that.getprovinceid()
// _this.addressList = address.match(reg).toString().split(",");
// _this.address = _this.addressList[1];
// console.log(_this.addressList[0]);
// console.log(_this.addressList[1]);
// console.log(_this.addressList[2]);
},
function(e) {}
);
}
});
},
// 根据城市名字获取id
getprovinceid() {
let that = this;
var url = 'question/get_area';
var params = {
province_name: that.provincename
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err)
})
},
// 输入完成
finish() {
... ... @@ -195,7 +130,6 @@
enterword(e) {
this.keyword = e.detail.value
},
// 获取省份列表
getprovincelist() {
let that = this;
... ... @@ -211,7 +145,6 @@
that.province_id = res.data.data[0].id;
// 获取论坛列表
this.getluntanlist()
}).catch((err) => {
})
... ... @@ -223,7 +156,7 @@
this.page = 1;
this.luntanlist = [];
// 获取论坛列表
this.getluntanlist();
this.getluntanlist();
},
// 获取论坛列表
... ... @@ -249,49 +182,46 @@
})
},
praisedian(item, index) {
praisedian(item,index){
let that = this;
if (that.luntanlist[index].is_praise == 2) {
if(that.luntanlist[index].is_praise==2){
uni.showToast({
title: '点赞成功',
icon: 'none'
title:'点赞成功',
icon:'none'
})
that.luntanlist[index].is_praise = 1;
that.luntanlist[index].praise = that.luntanlist[index].praise + 1
} else {
that.luntanlist[index].is_praise=1;
that.luntanlist[index].praise=that.luntanlist[index].praise+1
}else{
uni.showToast({
title: '取消点赞成功',
icon: 'none'
title:'取消点赞成功',
icon:'none'
})
that.luntanlist[index].is_praise = 2;
that.luntanlist[index].praise = that.luntanlist[index].praise - 1
that.luntanlist[index].is_praise=2;
that.luntanlist[index].praise=that.luntanlist[index].praise-1
}
that.luntanlist = that.luntanlist;
that.luntanlist=that.luntanlist;
var url = 'forum/praise';
var params = {
forum_id: item.id
forum_id:item.id
}
console.log('参数', params)
console.log('参数',params)
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err)
})
},
luntandetail(item) {
uni.navigateTo({
url: '/pages/luntan/luntandetail?id=' + item.id
url:'/pages/luntan/luntandetail?id='+item.id
})
}
},
onShow() {
this.getlocation()
}
}
... ...
... ... @@ -3,19 +3,23 @@
<view class="header">
<view class="userinfo">
<view class="avator" @click="personziliao">
<image src="../../static/userpic.png" mode="widthFix" />
<image :src="avatar==''?'../../static/headtou.png':avatar" />
<!-- <image src="../../static/userpic.png" mode="widthFix" /> -->
</view>
<view class="infoBox">
<view class="identity">
<view class="name">我是用户昵称</view>
<text class="vip flexone">
<image src="../../static/huiyuan.png" mode="widthFix" />
<text class="vipname">VIP5</text>
<view class="name" v-if="nickname==''">暂无昵称</view>
<view class="name" v-else>{{nickname}}</view>
<text class="vip flexone" v-if="userinfo.is_card==1||userinfo.is_vip==1||userinfo.is_company_vip==1">
<image src="../../static/huiyuan.png" mode="widthFix" v-if="is_card==1"/>
<text class="vipname" v-if="userinfo.is_vip==1">{{userinfo.level.name1}}</text>
<text class="vipname" v-if="userinfo.is_company_vip==1">{{userinfo.level.name2}}</text>
</text>
</view>
<!-- <view class="userType">身份认证 >></view> -->
<view class="userActive">
<image src="../../static/active.png" mode="widthFix" />已认证
<view class="userType" v-if="userinfo.is_card==2">身份认证 >></view>
<view class="userActive" v-else>
<image src="../../static/active.png" mode="widthFix" />
已认证
</view>
</view>
<view class="setup" @click="set">
... ... @@ -23,23 +27,23 @@
</view>
</view>
<view class="orderBox">
<view class="orderItem" @click="fahuo">
<view class="orderItem" @click="fahuo" :data-id="1">
<image src="../../static/order_a.png" mode="widthFix"></image>
<view>待付款</view>
</view>
<view class="orderItem">
<view class="orderItem" @click="fahuo" :data-id="2">
<image src="../../static/order_b.png" mode="widthFix"></image>
<view>待发货</view>
</view>
<view class="orderItem">
<view class="orderItem" @click="fahuo" :data-id="3">
<image src="../../static/order_c.png" mode="widthFix"></image>
<view>配送中</view>
<view>待收货</view>
</view>
<view class="orderItem">
<view class="orderItem" @click="fahuo" :data-id="4">
<image src="../../static/order_d.png" mode="widthFix"></image>
<view>待评价</view>
</view>
<view class="orderItem">
<view class="orderItem" @click="fahuo" :data-id="0">
<image src="../../static/order_e.png" mode="widthFix"></image>
<view>全部订单</view>
</view>
... ... @@ -137,18 +141,23 @@
export default {
data() {
return {
footersel: 4
footersel: 4,
userinfo:'',
nickname:'',
avatar:'',
label:'',
}
},
onLoad() {
//获取个人信息
this.getuserinfo()
},
methods: {
// 设置
set() {
uni.navigateTo({
url: '/pages/usercenter/setUp'
url:'/pages/usercenter/setUp?avatar='+this.avatar+'&nickname='+this.nickname
})
},
// 获取用户信息
... ... @@ -162,7 +171,9 @@
app.post(url, params).then((res) => {
console.log(res);
that.userinfo = res.data.data;
that.label = res.data.data.label
that.label = res.data.data.label;
that.nickname=res.data.data.nickname;
that.avatar=res.data.data.avatar;
}).catch((err) => {
... ... @@ -204,9 +215,13 @@
},
// 代发货
fahuo() {
fahuo(e) {
let id=e.currentTarget.dataset.id;
// if(id==0){
// id==''
// }
uni.navigateTo({
url: '/pages/usercenter/myOrder'
url: '/pages/usercenter/myOrder?id='+id
})
},
// 底部导航跳转
... ... @@ -234,10 +249,10 @@
}
},
},
onShow() {
//获取个人信息
this.getuserinfo()
}
}
</script>
... ... @@ -265,11 +280,14 @@
.avator {
width: 128rpx;
height: 128rpx;
font-size: 0;
border-radius: 50%;
border-radius: 64rpx;
}
.avator image {
width: 100%;
border-radius: 50%;
}
.infoBox {
... ...
<template>
<view class="page">
<view class="navbox">
<view class="navItem navactive">
<view class="navItem" :class="selindx==0?'navactive':''" @click="changeopt" :data-id="0">
全部订单
</view>
<view class="navItem">
<view class="navItem" :class="selindx==1?'navactive':''" @click="changeopt" :data-id="1">
待付款
</view>
<view class="navItem">
<view class="navItem" :class="selindx==2?'navactive':''" @click="changeopt" :data-id="2">
待发货
</view>
<view class="navItem">
<view class="navItem" :class="selindx==3?'navactive':''" @click="changeopt" :data-id="3">
待收货
</view>
<view class="navItem">
<view class="navItem" :class="selindx==4?'navactive':''" @click="changeopt" :data-id="4">
待评价
</view>
</view>
<view class="list">
<view class="item">
<view class="item" v-for="(item,index) in orderlist" :key="index">
<view class="titlebox">
<view class="leftT">
<image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂
<image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>
<text v-if="item.type==1">面坊商品</text>
<text v-if="item.type==2">积分商品</text>
<text v-if="item.type==3">{{item.store.name}}</text>
</view>
<view class="rightT">待付款</view>
<view class="rightT" v-if="item.status==1">待付款</view>
<view class="rightT" v-if="item.status==2">待发货</view>
<view class="rightT" v-if="item.status==3">待收货</view>
<view class="rightT" v-if="item.status==4">待评价</view>
<view class="rightT" v-if="item.status==6">已完成</view>
<view class="rightT" v-if="item.status==-1">已取消</view>
</view>
<view class="infobox">
<view class="infobox" v-for="(item,index) in item.order_info" :key="index">
<image src="../../static/cai.png" mode="widthFix" class="shop"></image>
<view class="info">
<view class="word">商品名称名称名称商品名称名称名称商品名称名称名称名称</view>
<view class="price">¥288</view>
<view class="word">{{item.goods_name}}</view>
<view v-if="item.spec.length!=0">
<view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
</view>
<view class="price">¥{{item.price}}</view>
</view>
</view>
<view class="btnbox">
... ... @@ -37,7 +50,7 @@
<view class="btn bactive">立即支付</view>
</view>
</view>
<view class="item">
<!-- <view class="item">
<view class="titlebox">
<view class="leftT">
<image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂
... ... @@ -88,8 +101,8 @@
<view class="btn bactive">立即评论</view>
</view>
</view>
<view class="item">
<view class="titlebox">
<view class="item"> -->
<!-- <view class="titlebox">
<view class="leftT">
<image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂
</view>
... ... @@ -102,33 +115,75 @@
<view class="price">¥288</view>
</view>
</view>
</view>
</view> -->
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
selindx: '',
page: 1,
orderlist: []
}
},
onLoad(options) {
this.selindx = options.id;
console.log(this.selindx);
this.getorder()
},
methods: {
comment(){
comment() {
uni.navigateTo({
url:'/pages/usercenter/shopEvaluate'
url: '/pages/usercenter/shopEvaluate'
})
}
},
//切换选项
changeopt(e) {
this.selindx = e.currentTarget.dataset.id;
this.page=1;
this.orderlist=[];
this.getorder()
},
// 获取订单列表
getorder() {
let that = this;
var url = 'order/get_order_list';
var params = {
status: that.selindx,
page: that.page,
pageNum: 10
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
that.orderlist = that.orderlist.concat(res.data.data);
console.log(that.orderlist)
}).catch((err) => {
console.log(err)
})
},
},
onReachBottom() {
let newpage = this.page;
newpage++;
this.page = newpage;
this.getorder()
}
}
</script>
<style>
page{
page {
background: #F7F7F7;
}
.navbox{
.navbox {
height: 88rpx;
background: #fff;
display: flex;
... ... @@ -137,19 +192,22 @@
padding: 0 32rpx;
box-sizing: border-box;
}
.navItem{
font-size:32rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(35,35,35,1);
.navItem {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(35, 35, 35, 1);
padding: 20rpx 0;
border-bottom: 1px solid transparent;
}
.navactive{
}
.navactive {
color: #FF9417;
border-color: #FF9417;
}
.item{
}
.item {
width: 100%;
background: #fff;
padding: 0 32rpx;
... ... @@ -157,82 +215,100 @@
margin-top: 16rpx;
overflow: hidden;
}
.titlebox{
.titlebox {
height: 84rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #EEEEEE;
}
.leftT{
.leftT {
display: flex;
align-items: center;
font-size:28rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(61,68,76,1);
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(61, 68, 76, 1);
}
.icon{
.icon {
width: 32rpx;
margin-right: 12rpx;
}
.rightT{
font-size:28rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(189,196,206,1);
.rightT {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(189, 196, 206, 1);
}
.infobox{
.infobox {
height: 204rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.shop{
.shop {
width: 140rpx;
}
.info{
.info {
width: 530rpx;
padding: 32rpx 0;
border-bottom: 1px solid #EEEEEE;
box-sizing: border-box;
}
.word{
font-size:30rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(61,69,76,1);
margin-top: 8px;
}
.price{
font-size:32rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(255,91,78,1);
.word {
width:520rpx;
height:76rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(61, 69, 76, 1);
/* margin-top: 8px; */
}
.price {
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(255, 91, 78, 1);
margin-top: 20rpx;
}
.btnbox{
.btnbox {
height: 100rpx;
box-sizing: border-box;
display: flex;
justify-content: flex-end;
align-items: center;
}
.btn{
width:160rpx;
height:64rpx;
border-radius:8px;
border:1px solid rgba(189,196,206,1);
font-size:24rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(91,94,100,1);
.btn {
width: 160rpx;
height: 64rpx;
border-radius: 8px;
border: 1px solid rgba(189, 196, 206, 1);
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(91, 94, 100, 1);
display: flex;
align-items: center;
justify-content: center;
margin-top: 10rpx;
}
.bactive{
.bactive {
color: #FF9417;
border-color: #FF9417;
}
... ...
... ... @@ -3,29 +3,115 @@
<view class="box">
<view class="item">
<view class="left">用户头像</view>
<view class="right">
<image src="../../static/userpic.png" mode="widthFix" class="avator" />
<view class="right " @click="chooseImage">
<image :src="avatar==''?'../../static/headtou.png':avatar" class="avator" />
<image src="../../static/right.png" mode="widthFix" class="jiantou" />
</view>
</view>
<view class="item">
<view class="left">用户昵称</view>
<view class="right">昵称昵称昵称
<view class="right entername">
<input type="text" placeholder="请输入用户昵称" @input="enternickname" :value="nickname" placeholder-class="enterword">
</view>
</view>
</view>
<view class="btn">确认</view>
<view class="btn" @click="surechange">确认</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
nickname:'',
avatar:''
}
},
onLoad(options) {
this.nickname=options.nickname;
console.log(this.nickname)
this.avatar=options.avatar;
},
methods: {
// 输入用户昵称
enternickname(e){
this.nickname=e.detail.value
},
// 上传头像
chooseImage() {
let that = this;
uni.chooseImage({
count: 9,
sizeType: ['original', 'compressed'],
success: function (res) {
console.log(res)
console.log(res.tempFilePaths);
console.log(res.tempFilePaths[0])
app.upload('image', res.tempFilePaths[0], "post").then((res) => {
console.log('上传文件', res);
let url = app.globalData.imgurl+res.url;
that.avatar=url
console.log(that.avatar)
}).catch((err) => {
console.log(err)
})
},
fail: function (res) { }
})
},
//确认修改
surechange(){
let that = this;
if(that.avatar==''){
uni.showToast({
title:'请上传头像',
icon:'none'
})
return false
}
if(that.nickname==''){
uni.showToast({
title:'请输入昵称',
icon:'none'
})
return false
}
var url = 'member/update_user';
var params = {
avatar: that.avatar,
nickname:that.nickname,
longitude:uni.getStorageSync("longitude"),
latitude:uni.getStorageSync("latitude")
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title:"提交成功",
icon:'none'
})
setTimeout(function(){
uni.navigateBack({
checked:true
})
},1500)
}).catch((err) => {
console.log(err)
})
}
}
}
... ... @@ -36,7 +122,7 @@
background: #F7F7F7;
}
.box {
padding: 0 32rpx;
box-sizing: border-box;
... ... @@ -76,6 +162,9 @@
.right .avator {
width: 84rpx;
height:84rpx;
font-size: 0;
border-radius: 50%;
}
.right .jiantou {
... ... @@ -103,4 +192,27 @@
page{
overflow-y: hidden;
}
.entername{
width:490rpx;
}
.entername input{
width:100%;
color:#3D454C;
font-size: 28rpx;
text-align: right;
}
.enterword{
color:#3D454C;
font-size: 28rpx;
}
.headimg{
width:120rpx;
height:120rpx;
font-size: 0;
border-radius: 50%;
}
.headimg image{
border-radius: 50%;
}
</style>
... ...
... ... @@ -6,31 +6,42 @@
¥
<input type="text" class="fill" />
</view>
<view class="huiyuanbot">
<view class="behuiyuanbtn" @click="sureti">确认</view>
</view>
</view>
<view class="cover">
<view class="cover" v-if="showwrap">
<view class="coverBox">
<view class="top">
<view class="close"><image src="../../static/colose.png" mode="widthFix" /></view>
<view class="close" @click="hidewrap">
<image src="../../static/colose.png" mode="widthFix" />
</view>
支付
</view>
<view class="monetall">
<!-- <view class="monetall">
<view class="moneyNum">¥2560.00</view>
<view class="moneyTitle">订单总额</view>
</view>
</view> -->
<view class="payBox">
<view class="payItem">
<view class="left">
<image src="../../static/paya.png" mode="widthFix" />
支付宝
</view>
<view class="right"><image src="../../static/nocheck.png" mode="widthFix" class="check" /></view>
<view class="right">
<image src="../../static/nocheck.png" mode="widthFix" class="check" />
</view>
</view>
<view class="payItem">
<view class="left">
<image src="../../static/payb.png" mode="widthFix" />
微信
</view>
<view class="right"><image src="../../static/check.png" mode="widthFix" class="check" /></view>
<view class="right">
<image src="../../static/check.png" mode="widthFix" class="check" />
</view>
</view>
</view>
<view class="submit">确认支付(¥2560.00)</view>
... ... @@ -40,139 +51,189 @@
</template>
<script>
export default {
data() {
return {};
},
methods: {}
};
export default {
data() {
return {
showwrap: false,
};
},
methods: {
sureti(){
this.showwrap=true
},
// 隐藏弹出
hidewrap(){
this.showwrap=false
}
}
};
</script>
<style>
page {
background: #f7f7f7;
height: 100%;
}
.box {
margin-top: 20rpx;
padding: 20rpx 32rpx 16rpx;
box-sizing: border-box;
border-bottom: 1px solid #eaeaea;
}
.title {
font-size: 32rpx;
font-family: PingFangHK-Regular, PingFangHK;
font-weight: 400;
color: rgba(8, 18, 31, 1);
margin: 40rpx 0;
}
.money {
display: flex;
align-items: center;
font-size: 72rpx;
font-family: PingFangHK-Regular, PingFangHK;
font-weight: 400;
color: rgba(8, 18, 31, 1);
}
.fill {
margin-left: 20rpx;
}
.cover {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.2);
}
.coverBox {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 766rpx;
background: rgba(255, 255, 255, 1);
border-radius: 24rpx 24rpx 0px 0px;
}
.top {
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(6, 18, 31, 1);
border-bottom: 1px solid #eeeeee;
}
.close {
width: 48rpx;
position: absolute;
left: 32rpx;
top: 24rpx;
}
.close image {
width: 100%;
}
.monetall {
margin-top: 70rpx;
}
.moneyNum {
font-size: 68rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(194, 148, 69, 1);
text-align: center;
}
.moneyTitle {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 68, 76, 1);
text-align: center;
}
.payBox {
margin-bottom: 80rpx;
padding: 0 32rpx;
box-sizing: border-box;
}
.payItem {
margin-top: 64rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.left {
display: flex;
align-items: center;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(6, 18, 31, 1);
}
.left image {
width: 48rpx;
margin-right: 32rpx;
}
.right {
width: 48rpx;
}
.check {
width: 100%;
}
.submit {
width: 686rpx;
height: 88rpx;
background: #c29445;
border-radius: 10rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(254, 254, 254, 1);
line-height: 88rpx;
text-align: center;
margin: 0 auto;
}
page {
background: #f7f7f7;
height: 100%;
}
.behuiyuanbtn {
width: 686rpx;
height: 88rpx;
background: #C29445;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 88rpx;
border-radius: 10rpx;
}
.huiyuanbot {
position: fixed;
background: #fff;
bottom: 0;
left: 0;
width: 750rpx;
height: 116rpx;
padding: 14rpx 32rpx;
}
.box {
margin-top: 20rpx;
padding: 20rpx 32rpx 16rpx;
box-sizing: border-box;
border-bottom: 1px solid #eaeaea;
}
.title {
font-size: 32rpx;
font-family: PingFangHK-Regular, PingFangHK;
font-weight: 400;
color: rgba(8, 18, 31, 1);
margin: 40rpx 0;
}
.money {
display: flex;
align-items: center;
font-size: 72rpx;
font-family: PingFangHK-Regular, PingFangHK;
font-weight: 400;
color: rgba(8, 18, 31, 1);
}
.fill {
margin-left: 20rpx;
}
.cover {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.2);
}
.coverBox {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 566rpx;
background: rgba(255, 255, 255, 1);
border-radius: 24rpx 24rpx 0px 0px;
}
.top {
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(6, 18, 31, 1);
border-bottom: 1px solid #eeeeee;
}
.close {
width: 48rpx;
position: absolute;
left: 32rpx;
top: 24rpx;
}
.close image {
width: 100%;
}
.monetall {
margin-top: 70rpx;
}
.moneyNum {
font-size: 68rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(194, 148, 69, 1);
text-align: center;
}
.moneyTitle {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 68, 76, 1);
text-align: center;
}
.payBox {
margin-bottom: 80rpx;
padding: 0 32rpx;
box-sizing: border-box;
}
.payItem {
margin-top: 64rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.left {
display: flex;
align-items: center;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(6, 18, 31, 1);
}
.left image {
width: 48rpx;
margin-right: 32rpx;
}
.right {
width: 48rpx;
}
.check {
width: 100%;
}
.submit {
width: 686rpx;
height: 88rpx;
background: #c29445;
border-radius: 10rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(254, 254, 254, 1);
line-height: 88rpx;
text-align: center;
margin: 0 auto;
}
</style>
... ...
<template>
<view class="page">
<view class="infobox">
<image src="../../static/userpic.png" mode="widthFix" class="avator"></image>
<view class="word">我是用户昵称</view>
<image :src="avatar==''?'../../static/headtou.png':avatar" mode="widthFix" class="avator"></image>
<view class="word">{{nickname==''?'暂无昵称':nickname}}</view>
</view>
<view class="list">
<view class="item">
<view class="left">
<image src="../../static/icond.png" mode="widthFix" class="icon"></image>我的邀请码
</view>
<view class="right">
15621564879<image src="../../static/icona.png" mode="widthFix" class="rcion"></image>
<view class="right salecode">
15621564879
<image src="../../static/icona.png" mode="widthFix" class="rcion"></image>
</view>
</view>
<view class="item" @click="yeji">
... ... @@ -34,23 +35,50 @@
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
nickname:'',
avatar:''
}
},
onLoad() {
},
methods: {
yeji() {
uni.navigateTo({
url: "/pages/usercenter/myAchievement"
})
},
kehu(){
kehu() {
uni.navigateTo({
url:"/pages/usercenter/myCustomer"
url: "/pages/usercenter/myCustomer"
})
},
// 获取用户信息
getuserinfo() {
let that = this;
var url = 'member/index';
var params = {
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
that.nickname = res.data.data.nickname;
that.avatar = res.data.data.avatar;
}).catch((err) => {
})
},
},
onShow() {
this.getuserinfo()
}
}
</script>
... ... @@ -71,6 +99,8 @@
.avator {
width: 128rpx;
height:128rpx;
border-radius: 50%;
margin-right: 28rpx;
}
... ... @@ -124,4 +154,7 @@
width: 32rpx;
margin-left: 12rpx;
}
.salecode{
font-size: 28rpx;
}
</style>
... ...
... ... @@ -52,16 +52,21 @@
export default {
data() {
return {
avatar:'',
nickname:''
}
},
onLoad(options) {
this.avatar=options.avatar;
this.nickname=options.nickname;
},
methods: {
// 个人资料
person(e) {
let id=e.currentTarget.dataset.id;
if(id==1){
uni.navigateTo({
url: '/pages/usercenter/personalData'
url: '/pages/usercenter/personalData?avatar='+this.avatar+'&nickname='+this.nickname
})
}else if(id==2){
uni.navigateTo({
... ...
... ... @@ -2,7 +2,7 @@
<view class="page">
<view class="item">
<view class="title">账户余额</view>
<view class="money">¥998.57</view>
<view class="money">¥{{userinfo.money}}</view>
<view class="moneyBox">
<view class="mitem" @click="chonghzi">
<image src="../../static/money_a.png" mode="widthFix" class="itemImg" />
... ... @@ -21,15 +21,15 @@
</view>
<view class="item">
<view class="title">赊吧剩余额度</view>
<view class="money">¥698.57</view>
<view class="money">¥{{userinfo.borrow_money}}</view>
<view class="moneyBox">
<view class="zitem">
<view class="name">总额度</view>
<view class="word">¥8800.00</view>
<view class="word">¥{{userinfo.borrow_money_limit}}</view>
</view>
<view class="zitem">
<view class="name">全部待还</view>
<view class="word">¥1100.00</view>
<view class="word">¥{{remainshengyu}}</view>
</view>
</view>
<view class="tipsword" @click="sheba">赊吧订单</view>
... ... @@ -38,13 +38,39 @@
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
userinfo:'',
remainshengyu:''
}
},
onLoad() {
this.getuserinfo()
},
methods: {
// 获取用户信息
getuserinfo() {
let that = this;
var url = 'member/index';
var params = {
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
that.userinfo = res.data.data;
that.label = res.data.data.label;
that.nickname=res.data.data.nickname;
that.avatar=res.data.data.avatar;
that.remainshengyu=that.userinfo.borrow_money_limit*100/100-that.userinfo.borrow_money*100/100
}).catch((err) => {
})
},
// 赊吧
sheba() {
uni.navigateTo({
... ... @@ -140,7 +166,9 @@
display: flex;
flex-wrap: wrap;
justify-content: center;
;
align-items: center;
flex-direction: column;
}
... ...