Commit 448bff0f authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp

# Conflicts:
#	pages.json
#	pages/cart/cart.vue
parents 08cc844b 8068963f
......@@ -100,7 +100,10 @@ export default {
<style lang="scss">
@import "uview-ui/index.scss";
@font-face {
font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
}
swiper{
height: unset;
}
......
......@@ -11,11 +11,23 @@
{
"path": "pages/goods/comment-list"
},
{
"path": "pages/user-center/user-center"
},
{
"path": "pages/index/index"
},
{
"path": "pages/user-center/user-center"
"path": "pages/foot/index/index"
},
{
"path": "pages/favorite/favorite"
},
{
"path": "pages/address/address"
},
{
"path": "pages/address/address_chosen"
},
{
"path": "pages/cart/cart"
......@@ -23,6 +35,9 @@
{
"path": "pages/cats/cats"
},
{
"path": "pages/address/AddAddress"
},
{
"path": "pages/webbox/webbox"
},
......
<template>
<view class="AddaddressStyle" :style="{'height':contentHeight}">
<view class="top">
<input class="uni-input" placeholder="自动获得焦点" style="width: 70%;"/>
<view style="display: flex;align-items: center;justify-content: center;border: 1px solid #F4AAA6;width:160rpx ;height: 60rpx;">
<Text style='color: #EA5A22;'>自动识别</Text>
</view>
</view>
<view class="addcenter">
<u-field
v-model="mobile"
label="收货人"
>
</u-field>
<view style="width: 100%;height: 1px;background: #e4e7ed;"/>
<u-field
v-model="mobile"
label="联系电话"
>
</u-field>
<view style="width: 100%;height: 1px;background: #e4e7ed;"/>
<view class="addcenter_item">
<Text>所在地区</Text>
<view style="display: flex;flex-direction: row;align-items: center;">
<Text :style="{'color':msg.address!=''? '#303133':'#9D9C9B'}">{{msg.address!=''? msg.address :'请选择'}}</Text>
<u-icon name="arrow" color="#B2B2B2" size="30" ></u-icon>
</view>
</view>
<view style="width: 100%;height: 1px;background: #e4e7ed;"/>
<view class="addcenter_item">
<Text>定位地址</Text>
<view style="display: flex;flex-direction: row;align-items: center;">
<Text style='#303133'>{{msg.address}}</Text>
<u-icon name="arrow" color="#B2B2B2" size="30" ></u-icon>
</view>
</view>
<view style="width: 100%;height: 1px;background: #e4e7ed;"/>
<u-field
v-model="mobile"
label="详细地址"
>
</u-field>
</view>
<view class="btn" @click="preserve">
<Text>保存地址</Text>
</view>
</view>
</template>
<script>
export default {
data(){
return{
contentHeight:0,
msg:{
address:''
}
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
},
methods:{
preserve(){
}
}
}
</script>
<style>
.AddaddressStyle{
background: #f3f4f6;
}
.AddaddressStyle .top{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 20rpx;
background: #fff;
}
.AddaddressStyle .addcenter{
margin-top: 40rpx;
background: #FFFFFF;
}
.AddaddressStyle .addcenter_item{
width: 100%;
padding: 20rpx 28rpx;
color: #303133;
font-size: 28rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.AddaddressStyle .btn{
width:94% ;
height: 80rpx;
background:#EA554D;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
margin-left: 3%;
margin-top: 46rpx;
border-radius: 40rpx;
}
</style>
<template>
<view class="addressStyle" v-if="!isloading" :style="{'height':contentHeight}">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
:style="{ height: '100%' }"
>
<view v-for="(item, index) in list" :key="index" class="addresbox">
<view class="addresclo">
<Text>收件人:{{item.name}}</Text>
<Text>{{item.mobile}}</Text>
</view>
<Text>收货地址:{{item.address}}</Text>
<view style="width: 100%;height: 2rpx;background: #EEEEEE;margin-top: 15rpx;"></view>
<view class="addresclo">
<u-checkbox-group @change="isdefault(item)">
<u-checkbox v-model="item.is_default==1?true:false" shape="circle" active-color="red">
<Text
:style="{'color':item.is_default==1?'#F43F3B':'#c8c9cc' }"
>{{item.is_default==1?'已设为默认':'设为默认'}}</Text>
</u-checkbox>
</u-checkbox-group>
<view style="display: flex;flex-direction: row;align-items: center;">
<view
style="display: flex;flex-direction: row;align-items: center;"
@click="btn_edit()"
>
<u-icon name="edit" color="#c8c9cc" size="40"></u-icon>
<Text style="color:#c8c9cc;">编辑</Text>
</view>
<view
style="display: flex;flex-direction: row;align-items: center;margin: 0 30rpx"
@click="btn_delete(item)"
>
<u-icon name="delete" color="#c8c9cc" size="40"></u-icon>
<Text style="color:#c8c9cc;">删除</Text>
</view>
</view>
</view>
</view>
<view class="bottom_btn">
<view class="bottom_btn_item" style="background: #EA554D;" @click="ManualAdd">
<u-icon name="add-o" color="#fff" size="30"></u-icon>
<Text style="color:#fff;margin-left: 10rpx;">手动添加</Text>
</view>
<view class="bottom_btn_item" style="background: #5CBF39;" @click="automatic">
<u-icon name="location" color="#fff" size="30"></u-icon>
<Text style="color:#fff;margin-left: 10rpx">自动获取</Text>
</view>
</view>
</scroll-view>
<!-- 删除的弹框 -->
<u-modal
v-model="showModal"
content="确实删除收货地址"
:show-cancel-button="true"
:show-title="false"
@confirm="confirm"
></u-modal>
<u-toast ref="uToast" />
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> -->
</view>
</template>
<script>
import auth from "../../components/auth/index.vue";
export default {
data() {
return {
loading: true,
list: [],
showAuth: false,
u: {},
contentHeight: 0,
showModal: false,
deleteID: 0
};
},
components: {
auth
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
},
onLoad() {
console.log(wx.getStorageSync("basedata"));
this.u = wx.getStorageSync("userinfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}
},
methods: {
init() {
this.loading = false;
uni.showNavigationBarLoading();
this.request(
{
url: "",
header: {
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ",
"X-App-Platform": "wxapp",
"X-App-Version": "4.2.47",
"X-Form-Id-List": JSON.stringify([]),
"X-Requested-With": "XMLHttpRequest",
"X-User-Id": 21269
},
data: {
r: "api/user/address"
}
},
res => {
uni.hideNavigationBarLoading();
this.isloading = false;
this.list = res.data.list;
}
);
},
reloadUserinfo() {
this.u = uni.getStorageSync("userinfo");
this.showAuth = false;
},
isdefault(item) {
//默认地址
uni.showNavigationBarLoading();
this.request(
{
url: "",
method: "POST",
header: {
"content-type": "application/x-www-form-urlencoded",
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ",
"X-App-Platform": "wxapp",
"X-App-Version": "4.2.47",
"X-Form-Id-List": JSON.stringify([
{
value: "873015dc76a242cc8c7ae1c25cdbdf4c",
type: 0,
remains: 1,
expires_at: "2020-05-25 19:03:25"
}
]),
"X-Requested-With": "XMLHttpRequest",
"X-User-Id": 21269
},
data: {
r: "api/user/address-default",
id: item.id,
is_default: item.is_default == 1 ? 0 : 1
}
},
res => {
this.init();
uni.hideNavigationBarLoading();
}
);
},
btn_edit() {},
btn_delete(item) {
this.deleteID = item.id;
this.showModal = true;
},
confirm() {
uni.showNavigationBarLoading();
this.request(
{
url: "",
method: "POST",
header: {
"content-type": "application/x-www-form-urlencoded",
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ",
"X-App-Platform": "wxapp",
"X-App-Version": "4.2.47",
"X-Form-Id-List": JSON.stringify([
{
value: "873015dc76a242cc8c7ae1c25cdbdf4c",
type: 0,
remains: 1,
expires_at: "2020-05-25 19:03:25"
}
]),
"X-Requested-With": "XMLHttpRequest",
"X-User-Id": 21269
},
data: {
r: "api/user/address-destroy",
id: this.deleteID
}
},
res => {
this.init();
uni.hideNavigationBarLoading();
}
);
},
automatic() {
this.$refs.uToast.show({
title: "暂无开发此功能"
});
},
ManualAdd() {
//手动添加
uni.navigateTo({
url: "/pages/address/AddAddress"
});
}
},
mounted() {
this.init();
}
};
</script>
<style>
.addressStyle {
background: #f3f4f6;
}
.addressStyle .addresbox {
width: 94%;
margin-left: 3%;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
padding: 0 20rpx;
margin-top: 30rpx;
}
.addressStyle .addresclo {
display: flex;
flex-direction: row;
width: 100%;
padding: 20rpx 0;
align-items: center;
justify-content: space-between;
}
.addressStyle .bottom_btn {
width: 94%;
height: 90rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-left: 3%;
margin-top: 30rpx;
}
.addressStyle .bottom_btn .bottom_btn_item {
width: 48%;
height: 80rpx;
border-radius: 40rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
</style>
<template>
<view class="addresschosen">
<view>
<view class="item" v-if="defaultId!=0">
<view class="default">
<u-icon name="checked" size="44" :color="mc"></u-icon>
</view>
<view class="address" @click="chosenHandler">
<view class="base">
<text class="name">{{currentAddress.name}}</text>
<text class="phone">{{currentAddress.mobile}}</text>
</view>
<view class="details">
{{currentAddress.address}}
</view>
</view>
<view class="edit">
<u-icon name="edit" size="44" color="#444"></u-icon>
</view>
</view>
<view class="item" v-for="(x, i) in list" :key="i">
<view class="address">
<view class="base">
<text class="name">{{x.name}}</text>
<text class="phone">{{x.mobile}}</text>
</view>
<view class="details">{{x.address}}</view>
</view>
<view class="edit">
<u-icon name="edit" size="44" color="#444"></u-icon>
</view>
</view>
</view>
<view class="btton-box">
<u-button
size="80"
:ripple="true"
shape="circle"
:custom-style="{
backgroundColor: mc,
height: '80rpx',
color: '#FFF',
fontSize: '14px',
margin:'0 50px'
}"
>新增收货地址</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
source: "",
defaultId: 0,
currentAddress: {},
list: [],
mc:""
};
},
onLoad(option) {
if (option.form) {
(this.source = option.form), (this.defaultId = option.id);
}
this.mc = this.$uiConfig.mainColor;
uni.showNavigationBarLoading();
this.init();
},
methods: {
init() {
this.loading = false;
this.request(
{
url: "",
header: {
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ",
"X-App-Platform": "wxapp",
"X-App-Version": "4.2.47",
"X-Form-Id-List": JSON.stringify([]),
"X-Requested-With": "XMLHttpRequest",
"X-User-Id": 21269,
},
data: {
r: "api/user/address",
},
},
(res) => {
uni.hideNavigationBarLoading();
this.isloading = false;
this.list = res.data.list;
let index = -1;
this.list.forEach((x, i) => {
x.mobile = x.mobile.substr(0, 3) + "****" + x.mobile.substr(7);
if (x.id == this.defaultId) {
this.currentAddress = x;
index = i;
}
});
if (index != -1) {
this.list.splice(i, 1);
}
}
);
},
},
};
</script>
<style>
.addresschosen {
padding: 0;
display: flex;
flex-direction: column;
padding-bottom: 50px;
}
.addresschosen .item {
display: flex;
padding: 15px 5px;
border-bottom: 1px solid #f5f5f5;
align-items: center;
}
.addresschosen .item:last-child {
border: none;
}
.addresschosen .item .default {
padding: 0 10px 0 5px;
}
.addresschosen .item .edit {
margin-left: 30px;
margin-right: 5px;
}
.addresschosen .item .address {
width: 1px;
flex: 1;
}
.addresschosen .item .address .base {
font-size: 20px;
margin-bottom: 5px;
}
.addresschosen .item .address .base .name {
width: 120px;
color: #333;
font-weight: 600;
font-size: 16px;
display: inline-block;
}
.addresschosen .item .address .base .phone {
color: #111;
font-family: "oswald";
}
.addresschosen .item .address .details {
font-size: 13px;
color: #888;
}
.addresschosen .btton-box {
height: 50px;
display: flex;
padding: 5px 10px;
border-top: 1px solid #f5f5f5;
position: fixed;
bottom: 0;
left: 0;
right: 0;
align-items: center;
background: #fff;
}
</style>
<template>
<div class="cartStyle" v-if="!isloading">
<view
style="
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15rpx;
"
>
<Text class="grid-text">商品库存有限,请尽快下单</Text>
<Text @click="edit" v-if="editType == false" class="grid-text_r"
>编辑</Text
>
<Text @click="edit" v-if="editType == true" class="grid-text_r"
>完成</Text
>
</view>
<view
style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;"
></view>
<view
v-if="list.length == 0"
style="
width: 100%;
height: 400rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
>
<view
style="
width: 180rpx;
height: 180rpx;
border-radius: 50%;
background: #dfdfe9;
display: flex;
align-items: center;
justify-content: center;
"
>
<image
src="../../static/images/icon/Shopping.png"
style="width: 60rpx; height: 60rpx;"
></image>
</view>
<Text style="margin-top: 20rpx; color: #939393;">购物车还是空的哦</Text>
</view>
<view
style="padding: 25rpx; border-bottom: 1rpx solid #e4e4e4;"
v-if="list.length > 0"
>
<u-checkbox-group @change="SelectAll">
<u-checkbox v-model="allchecked" shape="circle" active-color="red"
>赞羊严选</u-checkbox
>
</u-checkbox-group>
</view>
<view
class="cartList"
:style="{ 'margin-bottom': listbottom }"
v-if="list.length > 0"
>
<view
class="cartList_item"
v-for="(item, index) in list"
:key="index"
:name="item.name"
>
<u-checkbox-group
@change="clickcheckbox(item.checked, item.goods.price, index)"
>
<u-checkbox
v-model="item.checked"
shape="circle"
active-color="red"
></u-checkbox>
</u-checkbox-group>
<image
:src="item.attrs.pic_url ? item.attrs.pic_url : item.goods.cover_pic"
mode="aspectFit"
style="width: 150rpx; height: 150rpx; margin-left: 30rpx;"
/>
<view
style="
display: flex;
flex-direction: column;
justify-content: space-between;
width: 460rpx;
height: 150rpx;
margin-left: 20rpx;
"
>
<Text
style="
font-size: 28rpx;
width: 460rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>{{ item.goods.name }}</Text
>
<view
style="
width: 460rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>
<view v-for="(attr, inde2x) in item.attrs.attr" :key="inde2x">
<Text
style="color: #a0a09d; font-size: 24rpx; margin-right: 5rpx;"
>{{ attr.attr_group_name }}:{{ attr.attr_name }}</Text
>
</view>
</view>
<view
style="
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
"
>
<Text style="color: #e35943; font-size: 30rpx;"
><Text style="40rpx">{{ item.goods.price }}</Text></Text
>
<view class="item_input">
<view
class="item_input_l"
:style="{
color: item.num == 1 ? '#E2E2E2' : '#9B9B9B',
}"
@click="reduce(index, item.goods.price)"
>-</view
>
<input type="number" class="item_input_c" :value="item.num" />
<view
class="item_input_r"
style="color: #9b9b9b;"
@click="plus(index, item.goods.price)"
>+</view
>
</view>
</view>
</view>
</view>
</view>
<view class="box_bottom" :style="{ 'margin-bottom': bottommargin }">
<div style="margin-left: 30rpx;">
<u-checkbox-group @change="SelectAll">
<u-checkbox v-model="allchecked" shape="circle" active-color="red"
>全选</u-checkbox
>
</u-checkbox-group>
<Text style="color: #ff4544; font-size: 30rpx;" v-if="editType == false"
>{{ TotalPrice }}</Text
>
</div>
<div
class="bottom_btn"
:style="{ background: TotalPrice > 0 ? '#ff4544' : '#989898' }"
v-if="editType == false"
@click="settlement"
>
<Text style="font-size: 28rpx; color: white;">去结算</Text>
</div>
<u-button
v-if="editType == true && cart_id_list.length == 0"
shape="circle"
size="medium"
class="Deletestyle"
>删除</u-button
>
<u-button
v-if="editType == true && cart_id_list.length > 0"
shape="circle"
size="medium"
class="Deletestyle"
@click="Delete"
type="error"
>删除</u-button
>
</view>
<tabbars></tabbars>
</div>
<div class='cartStyle' v-if="!isloading">
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;padding: 0 15rpx;">
<Text class='grid-text'>商品库存有限,请尽快下单</Text>
<Text @click='edit' v-if='editType==false' class='grid-text_r'>编辑</Text>
<Text @click='edit' v-if='editType==true' class='grid-text_r'>完成</Text>
</view>
<view style="width: 100%;height: 30rpx;background: #F7F7F7;margin: 20rpx 0;"></view>
<u-empty v-if="list.length==0" text="购物车还是空的哦" mode="car"></u-empty>
<view style="padding: 25rpx;border-bottom: 1rpx solid #E4E4E4;" v-if="list.length>0">
<u-checkbox-group @change='SelectAll'>
<u-checkbox v-model="allchecked" shape="circle" active-color="red">赞羊严选</u-checkbox>
</u-checkbox-group>
</view>
<view class="cartList"
:style="{'margin-bottom':listbottom}"
v-if="list.length>0"
>
<view class="cartList_item"
v-for="(item, index) in list" :key="index"
:name="item.name">
<u-checkbox-group @change='clickcheckbox(item.checked,item.goods.price,index)'>
<u-checkbox v-model="item.checked" shape="circle" active-color="red"></u-checkbox>
</u-checkbox-group>
<image
:src="item.attrs.pic_url ? item.attrs.pic_url:item.goods.cover_pic"
mode="aspectFit"
style="width: 150rpx; height: 150rpx;margin-left: 30rpx;"
/>
<view style="display: flex;flex-direction: column;justify-content: space-between;width: 460rpx;height: 150rpx;margin-left: 20rpx;">
<Text style='font-size: 28rpx;width: 460rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;'>{{item.goods.name}}</Text>
<view style='width: 460rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;'>
<view v-for="(attr, inde2x) in item.attrs.attr" :key="index2" >
<Text style='color: #A0A09D;font-size: 24rpx;margin-right: 5rpx;'>{{attr.attr_group_name}}:{{attr.attr_name}}</Text>
</view>
</view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<Text style='color: #E35943;font-size:30rpx ;'><Text style='40rpx'>{{item.goods.price}}</Text></Text>
<view class="item_input">
<view class="item_input_l"
:style="{
color: item.num == 1 ? '#E2E2E2' : '#9B9B9B',
}"
@click="reduce(index,item.goods.price)">-</view>
<input type="number" class="item_input_c" :value="item.num" >
<view class="item_input_r" style="color: #9B9B9B;" @click="plus(index,item.goods.price)">+</view>
</view>
</view>
</view>
</view>
</view>
<view class="box_bottom"
:style="{'margin-bottom':bottommargin}"
>
<div style='margin-left: 30rpx;'>
<u-checkbox-group @change='SelectAll'>
<u-checkbox v-model="allchecked" shape="circle" active-color="red">全选</u-checkbox>
</u-checkbox-group>
<Text style='color: #ff4544;font-size:30rpx ;' v-if='editType==false'>{{TotalPrice}}</Text>
</div>
<div class='bottom_btn'
:style="{'background':TotalPrice>0 ? '#ff4544':'#989898'}"
v-if='editType==false'
@click='settlement'
>
<Text style='font-size: 28rpx;color: white;' >去结算</Text>
</div>
<u-button v-if='editType==true&& cart_id_list.length ==0' shape="circle" size="medium" class='Deletestyle'>删除</u-button>
<u-button v-if='editType==true&& cart_id_list.length >0' shape="circle" size="medium" class='Deletestyle' @click='Delete' type="error">删除</u-button>
</view>
<tabbars></tabbars>
</div>
</template>
<script>
import tabbars from "@/components/tabbar/index";
export default {
data() {
return {
isloading: true,
pageTitle: "购物车",
navHeight: 0,
contentHeight: 0,
cstyle: {},
allchecked: false,
TotalPrice: 0, //总价格
bottommargin: 0,
listbottom: 0,
editType: false,
list: [],
cart_id_list: [],
};
},
created() {},
components: {
tabbars,
},
onLoad() {
this.navHeight = this.$navHeight - 2;
this.cstyle = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").cat_style
: [];
if (this.cstyle.cat_style == "4") {
// this.searchStyle.p = {
// position: "fixed",
// top: this.navHeight,
// width: "100%",
// left: "0",
// };
}
},
mounted() {
let currentPages = getCurrentPages();
let c = this.$uiConfig.is_bang ? 80 : 52;
this.bottommargin = c - 2 + "px";
this.listbottom = c - 2 + 50 + "px";
this.contentHeight = this.$utils.calcContentHeight(c);
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
this.init();
},
methods: {
goHome() {
uni.redirectTo({ url: "/pages/index/main" });
},
init() {
uni.showNavigationBarLoading();
this.request(
{
url: "",
header: {
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ",
"X-App-Platform": "wxapp",
"X-App-Version": "4.2.47",
"X-Form-Id-List": JSON.stringify([]),
"X-Requested-With": "XMLHttpRequest",
"X-User-Id": 21269,
},
data: {
r: "api/cart/list",
},
},
import tabbars from "@/components/tabbar/index";
export default {
data(){
return{
isloading: true,
pageTitle: "购物车",
navHeight: 0,
contentHeight:0,
cstyle:{},
allchecked:false,
TotalPrice:0,//总价格
bottommargin:0,
listbottom:0,
editType:false,
list:[],
cart_id_list:[],
}
},
created(){
},
components:{
tabbars,
},
onLoad() {
this.navHeight = this.$navHeight - 2;
this.cstyle = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").cat_style
: [];
if (this.cstyle.cat_style == "4") {
// this.searchStyle.p = {
// position: "fixed",
// top: this.navHeight,
// width: "100%",
// left: "0",
// };
}
},
mounted() {
let currentPages = getCurrentPages();
let c = this.$uiConfig.is_bang ? 80 : 52;
this.bottommargin = (c-2)+'px';
this.listbottom = (c-2+50)+'px';
this.contentHeight = this.$utils.calcContentHeight(c);
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
this.init();
},
methods:{
goHome() {
uni.redirectTo({ url: "/pages/index/main" });
},
init() {
uni.showNavigationBarLoading();
this.request(
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269
(res) => {
uni.hideNavigationBarLoading();
this.isloading = false;
if (res.data.list.length > 0) {
let goods_list = res.data.list[0].goods_list;
goods_list.forEach((x) => {
x.checked = false;
});
this.list = goods_list;
console.log(this.list);
} else {
this.list = [];
}
}
);
},
},
data: {
r: "api/cart/list",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
if(res.data.list.length>0){
let goods_list = res.data.list[0].goods_list;
goods_list.forEach((x) => {
x.checked = false
});
this.list =goods_list;
console.log(this.list)
}else{
this.list=[]
}
}
);
},
clickcheckbox(checked,price,index){
if(checked==true){
this.TotalPrice += price*this.list[index].num;
let all = true;
this.list.forEach((x)=>{
if(x.checked==false){
all=false
}
})
if(all==true){
this.allchecked = true
}
if(this.editType==true){
let obj = {
'mch_id':0,
'id':this.list[index].id
}
this.cart_id_list.push(obj)
}
}else{
this.TotalPrice -= price*this.list[index].num
this.allchecked = false;
if(this.editType==true){
this.cart_id_list.forEach((x)=>{
if(x.id==this.list[index].id){
this.cart_id_list.splice(x,1)
}
})
}
}
},
SelectAll(){
if(this.allchecked==true){
this.TotalPrice= 0;
this.cart_id_list=[];
this.list.forEach((x)=>{
x.checked=true;
this.TotalPrice += x.goods.price*x.num;
if(this.editType==true){
this.cart_id_list.push({
'mch_id':0,
'id':x.id
})
}
})
clickcheckbox(checked, price, index) {
if (checked == true) {
this.TotalPrice += price * this.list[index].num;
let all = true;
this.list.forEach((x) => {
if (x.checked == false) {
all = false;
}
});
if (all == true) {
this.allchecked = true;
}
if (this.editType == true) {
let obj = {
mch_id: 0,
id: this.list[index].id,
};
this.cart_id_list.push(obj);
}
} else {
this.TotalPrice -= price * this.list[index].num;
this.allchecked = false;
if (this.editType == true) {
this.cart_id_list.forEach((x) => {
if (x.id == this.list[index].id) {
this.cart_id_list.splice(x, 1);
}
});
}
}
},
SelectAll() {
if (this.allchecked == true) {
this.TotalPrice = 0;
this.cart_id_list = [];
this.list.forEach((x) => {
x.checked = true;
this.TotalPrice += x.goods.price * x.num;
if (this.editType == true) {
this.cart_id_list.push({
mch_id: 0,
id: x.id,
});
}
});
} else {
this.list.forEach((x) => {
x.checked = false;
this.TotalPrice = 0;
if (this.editType == true) {
this.cart_id_list = [];
}
});
}
},
}else {
this.list.forEach((x)=>{
x.checked=false;
this.TotalPrice =0;
if(this.editType==true){
this.cart_id_list=[]
}
})
}
},
reduce(index,price){//减
if(this.list[index].num>1){
this.list[index].num = this.list[index].num -1;
if(this.list[index].checked==true){
this.TotalPrice -= price*1
}
}
},
plus(index,price){//加
this.list[index].num = this.list[index].num +1;
if(this.list[index].checked==true){
this.TotalPrice += price*1
}
},
edit(){
this.editType=!this.editType;
this.allchecked =false;
this.TotalPrice= 0
this.list.forEach((x)=>{
x.checked=false
})
},
Delete(){
uni.showNavigationBarLoading();
this.request(
{
url: "",
method:"POST",
header:{
'content-type': 'application/x-www-form-urlencoded',
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List':JSON.stringify([{"value":"873015dc76a242cc8c7ae1c25cdbdf4c","type":0,"remains":1,"expires_at":"2020-05-25 19:03:25"}]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269,
reduce(index, price) {
//减
if (this.list[index].num > 1) {
this.list[index].num = this.list[index].num - 1;
if (this.list[index].checked == true) {
this.TotalPrice -= price * 1;
}
}
},
plus(index, price) {
//加
this.list[index].num = this.list[index].num + 1;
if (this.list[index].checked == true) {
this.TotalPrice += price * 1;
}
},
edit() {
this.editType = !this.editType;
this.allchecked = false;
this.TotalPrice = 0;
this.list.forEach((x) => {
x.checked = false;
});
},
Delete() {
uni.showNavigationBarLoading();
this.request(
{
url: "",
method: "POST",
header: {
"content-type": "application/x-www-form-urlencoded",
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ",
"X-App-Platform": "wxapp",
"X-App-Version": "4.2.47",
"X-Form-Id-List": JSON.stringify([
{
value: "873015dc76a242cc8c7ae1c25cdbdf4c",
type: 0,
remains: 1,
expires_at: "2020-05-25 19:03:25",
},
]),
"X-Requested-With": "XMLHttpRequest",
"X-User-Id": 21269,
},
data: {
r: "api/cart/delete",
cart_id_list: JSON.stringify(this.cart_id_list),
},
},
(res) => {
this.init();
this.TotalPrice = 0;
this.editType = false;
this.allchecked = false;
uni.hideNavigationBarLoading();
}
);
},
settlement() {},
},
};
},
data: {
r: "api/cart/delete",
cart_id_list:JSON.stringify(this.cart_id_list) ,
},
},
(res) => {
this.init()
this.TotalPrice= 0
this.editType=false;
this.allchecked =false;
uni.hideNavigationBarLoading()
}
);
},
settlement(){
}
}
}
</script>
<style>
.cartStyle {
height: 100%;
position: relative;
}
.cartStyle .grid-text {
.cartStyle{
height: 100%;
position: relative;
}
.cartStyle .grid-text {
font-size: 24rpx;
margin-top: 4rpx;
color: #939393;
}
.cartStyle .grid-text_r {
margin-top: 4rpx;
margin-right: 10rpx;
.cartStyle .grid-text_r{
margin-top: 4rpx;
margin-right: 10rpx;
}
.cartStyle .cartList {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
overflow-y: hidden;
.cartStyle .cartList{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
overflow-y: hidden;
}
.cartStyle .cartList .cartList_item {
width: 100%;
padding: 40rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1rpx solid #e4e4e4;
.cartStyle .cartList .cartList_item{
width: 100%;
padding:40rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1rpx solid #E4E4E4;
}
.cartList .cartList_item .item_input {
width: 200rpx;
height: 60rpx;
background: #f7f7f7;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.cartList .cartList_item .item_input{
width: 200rpx;
height: 60rpx;
background: #F7F7F7;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.cartList .item_input .item_input_l,
.item_input_r {
width: 50rpx;
height: 60rpx;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
.cartList .item_input .item_input_l,.item_input_r{
width: 50rpx;
height: 60rpx;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.cartStyle .item_input .item_input_c {
text-align: center;
width: 50rpx;
height: 60rpx;
.cartStyle .item_input .item_input_c{
text-align: center;
width: 50rpx;
height: 60rpx;
}
.cartStyle .box_bottom {
width: 100%;
height: 50px;
position: fixed;
background: #fff;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid #e4e4e4;
z-index: 999;
.cartStyle .box_bottom{
width: 100%;
height: 50px;
position: fixed;
background: #FFF;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid #E4E4E4;
z-index: 999;
}
.cartStyle .bottom_btn {
display: flex;
align-items: center;
justify-content: center;
width: 250rpx;
height: 50px;
.cartStyle .bottom_btn{
display: flex;
align-items: center;
justify-content: center;
width: 250rpx;
height: 50px;
}
.cartStyle .Deletestyle {
margin-right: 40rpx;
.cartStyle .Deletestyle{
margin-right: 40rpx;
}
</style>
<template>
<view class="favoriteStyle" :style="{'height':contentHeight}" v-if="!isloading">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" active-color='#fa3534'></u-tabs>
<template>
<view v-show="current==0" style="
height: calc(100vh - 50px);
width: calc(100vw - 20px);
margin-left: 10px;
overflow: hidden;
padding-top: 10px;
">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
style="height: 100%; padding-bottom: 0px;"
>
<view class="u-good-list" >
<u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in goodslist" :key="ci">
<view class="good" @click="clickHandler(cx.goods.page_url)">
<view class="good-img">
<image
mode="aspectFit"
:src="cx.goods.cover_pic"
style="width: 100%; height: 100%;"
/>
</view>
<view class="good-name">{{ cx.goods.name }}</view>
<view class="good-info">
<view class="price" :style="{ color: mainColor }">{{
cx.goods.price_content
}}</view>
<view class="sell">{{ cx.goods.sales }}</view>
<view class="cart">
<u-icon name="cart-o" size="40" :color="mainColor" />
</view>
</view>
</view>
</u-col>
</u-row>
</view>
</scroll-view>
<u-empty v-if="current==0&& goodslist.length==0" text="没有任何收藏商品哦~" mode="favor"></u-empty>
</view>
<view v-show="current==1" style="
height: calc(100vh - 50px);
width: calc(100vw - 20px);
margin-left: 10px;
overflow: hidden;
padding-top: 10px;
">
<u-empty v-if="current==1&& topiclist.length==0" text="没有任何收藏主题哦~" mode="favor"></u-empty>
</view>
</template>
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> -->
</view>
</template>
<script>
import auth from "../../components/auth/index.vue";
export default {
data() {
return {
loading: true,
contentHeight:0,
showAuth:false,
list:[
{name: '商品'},
{name: '专题'},
],
goodslist:[],
topiclist:[],
current:0
}
},
components:{
auth,
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.init()
},
onLoad(){
this.u = wx.getStorageSync("userinfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}
},
methods: {
change(index) {
this.current = index;
if(index==1){
// this.gettopic()
}else{
this.init()
}
},
init(){
this.loading = false;
uni.showNavigationBarLoading();
this.request(
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269
},
data: {
r: "api/user/my-favorite-goods",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
this.goodslist = res.data.list
}
);
},
gettopic(){ //专题数据
this.loading = false;
uni.showNavigationBarLoading();
this.request(
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269
},
data: {
r: "api/user/my-favorite-topic",
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
this.topiclist = res.data.list
}
);
},
reloadUserinfo() {
this.u = uni.getStorageSync("userinfo");
this.showAuth=false
},
clickHandler(url) {
uni.navigateTo({
url: url,
});
},
}
}
</script>
<style>
.favoriteStyle{
background: #f3f4f6;
}
.favoriteStyle .u-good-list .good {
background: #fff;
border-radius: 10px;
overflow: hidden;
margin-bottom: 10px;
}
.favoriteStyle .u-good-list .good .good-img {
width: calc(50vw - 15px);
height: calc(50vw - 15px);
display: block;
}
.favoriteStyle .u-good-list .good .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 3px;
font-size: 13px;
margin: 7px 10px;
}
.favoriteStyle .u-good-list .good .good-info {
display: flex;
margin: 7px 10px;
margin-top: 0;
align-items: flex-end;
padding-bottom: 5px;
}
.favoriteStyle .u-good-list .good .good-info .price {
font-size: 14px;
color: #ff4544;
flex: 1;
}
.favoriteStyle .u-good-list .good .good-info .sell {
font-size: 11px;
color: gray;
flex: 1;
}
.favoriteStyle .u-good-list .good .good-info .cart {
width: 40rpx;
text-align: right;
}
</style>
<template>
<view class="footStyle" :style="{'height':contentHeight}">
<view class="footTop">
<view class="footTop_c">
<view class="footTop_item" style="background: #EA554D;">
<Text style='color: #fff;'>浏览记录</Text>
</view>
<view class="footTop_item" @click="billsummary">
<Text style='color: #EA554D;'>账单总结</Text>
</view>
</view>
<view class="footTop_content">
</view>
</view>
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> -->
<view class="loading" v-show="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style='color: #fff;margin-top: 10rpx;'>加载中...</Text>
</view>
</view>
</template>
<script>
import auth from "../../../components/auth/index.vue";
export default {
data() {
return {
isloading:true,
loading:false,
showAuth:false,
contentHeight:0,
list:[
{name: '浏览记录'},
{name: '账单总结'},
]
}
},
components:{
auth
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
console.log(this.contentHeight)
},
onLoad(){
console.log(wx.getStorageSync("basedata"))
this.u = wx.getStorageSync("userinfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}
},
methods: {
reloadUserinfo() {
this.u = uni.getStorageSync("userinfo");
this.showAuth=false
},
billsummary(){
console.log('跳转菜单总结')
}
}
}
</script>
<style>
.footStyle{
background: #f3f4f6;
}
.footStyle .footTop{
width: 100%;
padding: 20rpx 10%;
background: #fff;
}
.footStyle .footTop_c{
width: 100%;
height: 70rpx;
display: flex;
flex-direction: row;
align-items: center;
border-radius: 35rpx;
border: 1px solid #EA554D;
}
.footStyle .footTop_item{
width: 100%;
height: 70rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 35rpx;
}
.loading{
width: 200rpx;
height: 200rpx;
background: #000000;
opacity: 0.7;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
left: 50%;
top:30%;
margin-left: -100rpx;
z-index: 999;
}
.footStyle .footTop_content{
width: 100%;
}
</style>
<template>
<view class="ordersubmit">
<view class="add-box">
<view class="ordersubmit" v-if="ds.mch_list">
<view class="add-box" @click="chosenAddress(ds.address.id)">
<view class="add-info">
<view class="address">{{
address.province + address.city + address.district
......@@ -206,6 +206,11 @@ export default {
this.secondary = this.$uiConfig.secondary;
},
methods: {
chosenAddress(id){
uni.navigateTo({
url: '/pages/address/address_chosen?form=ordersubmit&id='+id
});
},
changeUseInt(e) {
this.userInt=e.value
if(this.userInt){
......@@ -410,7 +415,7 @@ export default {
align-items: center;
}
.ordersubmit .goodbox .goodinfo .price .left {
font-size: 18px;
font-size: 20px;
font-family: "oswald";
width: 1px;
flex: 1;
......@@ -472,7 +477,7 @@ export default {
margin-right: 5px;
}
.ordersubmit .filed .right .price {
font-size: 14px;
font-size: 16px;
flex: 1;
text-align: right;
font-family: "oswald";
......
<template>
<view class="userStyle" v-if="!isloading">
<view class="userBox"></view>
<image :src='meueData.user_center.style_bg_pic_url' class="imgbg">
<!-- <image :src='user_info.avatar' class="headimg"></image> -->
<!-- <view style="width: 140rpx;height: 140rpx;background: #007AFF;"></view> -->
</image>
<view class="userBox" :style="{'margin-bottom':bottommargin}">
<view :style="{'background-image':'url('+meueData.user_center.top_pic_url+')',backgroundSize: '100% 330rpx'}" class="imgbg" >
<view style="display: flex;flex-direction: row;align-items: center;width: 100%;" v-if='meueData.user_center.top_style==1'>
<u-avatar :src="user_info.avatar" size='140' style='margin-left: 50rpx;'></u-avatar>
<Text style="color: #FFF;margin-left: 20rpx;font-size: 36rpx;" @click='login(user_info)'>{{user_info.nickname?user_info.nickname:'立即登录'}}</Text>
</view>
<view style="display: flex;flex-direction: column;align-items: center;" v-if='meueData.user_center.top_style==2'>
<u-avatar :src="user_info.avatar" size='140' ></u-avatar>
<Text style="color: #FFF;margin-left: 20rpx;font-size: 36rpx;" @click='login(user_info)'>{{user_info.nickname?user_info.nickname:'立即登录'}}</Text>
</view>
<view class="ReceiptAdder" @click="goUrl('/pages/address/address')">
<u-icon name="location" color="#fff" size="40" ></u-icon>
<Text style='color: #fff;font-size: 32;margin-left: 20rpx;'>收货地址</Text>
</view>
</view>
<view class="footprint" v-if='meueData.user_center.is_foot_bar_status==1'>
<view class="footprint_item" @click="goUrl('/pages/favorite/favorite')">
<text>{{user_info.favorite}}</text>
<view class="footprint_item_bottom">
<image :src='meueData.user_center.foot_bar[0].icon_url' style="width: 40rpx;height: 40rpx;"></image>
<Text style='margin-left: 10rpx;'>{{meueData.user_center.foot_bar[0].name}}</Text>
</view>
</view>
<view style="width: 1rpx;height: 60rpx;background: #000000;"></view>
<view class="footprint_item" @click="goUrl('/pages/foot/index/index')">
<text>{{user_info.footprint}}</text>
<view class="footprint_item_bottom">
<image :src='meueData.user_center.foot_bar[1].icon_url' style="width: 40rpx;height: 40rpx;"></image>
<Text style='margin-left: 10rpx;'>{{meueData.user_center.foot_bar[1].name}}</Text>
</view>
</view>
</view>
<view class="account_bar" v-if="meueData.user_center.is_account_status==1">
<view class="account_bar_item">
<Text style="color: #F4BD61;">{{user_info.integral}}</Text>
<view class="footprint_item_bottom">
<image :src='meueData.user_center.account_bar.integral.icon' style="width: 26rpx;height: 26rpx;"></image>
<Text style='margin-left: 10rpx;'>{{meueData.user_center.account_bar.integral.text}}</Text>
</view>
</view>
<view style="width: 1rpx;height: 60rpx;background: #EEEEEE;"></view>
<view class="account_bar_item">
<Text style="color: #F4BD61;">{{user_info.coupon}}</Text>
<view class="footprint_item_bottom">
<image :src='meueData.user_center.account_bar.coupon.icon' style="width: 26rpx;height: 26rpx;"></image>
<Text style='margin-left: 10rpx;'>{{meueData.user_center.account_bar.coupon.text}}</Text>
</view>
</view>
<view style="width: 1rpx;height: 60rpx;background: #EEEEEE;"></view>
<view class="account_bar_item">
<Text style="color: #F4BD61;">{{user_info.card}}</Text>
<view class="footprint_item_bottom">
<image :src='meueData.user_center.account_bar.card.icon' style="width: 26rpx;height: 26rpx;"></image>
<Text style='margin-left: 10rpx;'>{{meueData.user_center.account_bar.card.text}}</Text>
</view>
</view>
</view>
<view class="order_bar" v-if='meueData.user_center.is_order_bar_status==1'>
<u-section title="我的订单" sub-title="查看更多" style='width: 100%;padding: ;'></u-section>
<view class="order_bar_list">
<view class="order_bar_item" v-for="(item, index) in meueData.user_center.order_bar" :key="index"
:name="item.name" @click="goUrl(item.link_url)">
<image :src='item.icon_url' style="width: 66rpx;height: 60rpx;"></image>
<Text style='margin-top: 10rpx;'>{{item.name}}</Text>
</view>
</view>
</view>
<view :class="meueData.user_center.menu_style==1?'menus2':'menus'" v-if='meueData.user_center.is_menu_status==1'>
<view :class="meueData.user_center.menu_style==1?'menus_item2':'menus_item'" v-for="(item, index) in meueData.user_center.menus" :key="index"
:name="item.name" @click="goUrl(item.link_url)">
<image :src='item.icon_url' style="width: 48rpx;height: 48rpx;"></image>
<Text :style="{'margin-top':meueData.user_center.menu_style == 1 ? '0rpx':'10rpx','margin-left':meueData.user_center.menu_style == 1 ? '10rpx':'0rpx'}">
{{item.name}}
</Text>
</view>
</view>
<view class="copyright">
<image :src='meueData.copyright.pic_url' style="width: 95px;height: 28px;"></image>
<Text style='margin-top: 10rpx;'>{{meueData.copyright.description}}</Text>
</view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth>
<tabbars></tabbars>
</view>
</template>
<script>
import tabbars from "@/components/tabbar/index";
import auth from "../../components/auth/index.vue";
export default{
data(){
return{
......@@ -24,13 +107,24 @@
user_info:{},//个人信息
bottommargin:0,
listbottom:0,
showAuth:false,
u: {},
}
},
components:{
tabbars
tabbars,
auth
},
onLoad() {
this.navHeight = this.$navHeight - 2;
this.u = wx.getStorageSync("userinfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}
this.cstyle = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").cat_style
: [];
......@@ -45,13 +139,13 @@
this.bottommargin = (c-2)+'px';
this.listbottom = (c-2+50)+'px';
this.contentHeight = this.$utils.calcContentHeight(c);
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
console.log(wx.getStorageSync("basedata"))
console.log(u)
console.log(wx.getStorageSync("basedata"))
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
......@@ -71,7 +165,7 @@
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
......@@ -88,7 +182,6 @@
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
console.log(res)
}
);
},
......@@ -98,20 +191,19 @@
{
url: "",
header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]),
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269
'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr',
'X-App-Platform': 'wxapp',
'X-App-Version': '4.2.47',
'X-Form-Id-List': [{"value":"7567542b600b46ac9d1945822f697123","type":0,"remains":1,"expires_at":"2020-05-25 11:25:17"}],
'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 19992,
},
data: {
r: "api/user/config",
},
},
},
},
(res) => {
uni.hideNavigationBarLoading()
this.isloading = false;
......@@ -120,6 +212,21 @@
this.user_info = res.data.user_info;
}
);
},
goUrl(url){
console.log(url )
uni.navigateTo({
url: url
})
},
reloadUserinfo() {
this.u = uni.getStorageSync("userinfo");
this.showAuth=false
},
login(name){
if(!name){
this.showAuth = true;
}
}
}
......@@ -127,19 +234,23 @@
</script>
<style>
.body{
background: #f3f4f6;
}
.userStyle .userBox{
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
background: #f3f4f6;;
}
.userStyle .imgbg{
width: 100%;
height: 330rpx;
position: relative;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.userStyle .headimg{
width: 140rpx;
......@@ -147,4 +258,126 @@
border-radius: 50%;
margin-left: 60rpx;
}
.userStyle .footprint{
width: 80%;
height:140rpx ;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
}
.userStyle .footprint_item{
width: 200rpx;
height: 100rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.userStyle .footprint_item_bottom{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.userStyle .account_bar{
width: 94%;
height: 110rpx;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
padding: 0 20rpx;
}
.userStyle .account_bar_item{
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.userStyle .order_bar{
width: 94%;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
padding: 30rpx;
margin-top: 30rpx;
}
.userStyle .order_bar .order_bar_list{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.userStyle .order_bar_item{
display: flex;
flex-direction: column;
align-items: center;
margin-top: 20rpx;
}
.userStyle .menus{
width: 94%;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
margin-top: 30rpx;
}
.userStyle .menus2{
width: 94%;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: column;
margin-top: 20rpx;
}
.userStyle .menus .menus_item{
width: 25%;
height: 110rpx;
margin: 20rpx 0 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.userStyle .menus2 .menus_item2{
width: 100%;
height: 80rpx;
display: flex;
flex-direction: row;
align-items: center;
margin-left: 30rpx;
}
.userStyle .copyright{
padding: 70rpx 0;
display: flex;
flex-direction: column;
align-items: center;
}
.userStyle .ReceiptAdder{
position: absolute;
right: 0;
top:125rpx;
width: 230rpx;
height:80rpx ;
background: #EA554D;
border-top-left-radius: 40rpx;
border-bottom-left-radius: 40rpx;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 20rpx;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment