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 { ...@@ -100,7 +100,10 @@ export default {
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.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{ swiper{
height: unset; height: unset;
} }
......
...@@ -11,11 +11,23 @@ ...@@ -11,11 +11,23 @@
{ {
"path": "pages/goods/comment-list" "path": "pages/goods/comment-list"
}, },
{
"path": "pages/user-center/user-center"
},
{ {
"path": "pages/index/index" "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" "path": "pages/cart/cart"
...@@ -23,6 +35,9 @@ ...@@ -23,6 +35,9 @@
{ {
"path": "pages/cats/cats" "path": "pages/cats/cats"
}, },
{
"path": "pages/address/AddAddress"
},
{ {
"path": "pages/webbox/webbox" "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> <template>
<div class="cartStyle" v-if="!isloading"> <div class='cartStyle' v-if="!isloading">
<view <view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;padding: 0 15rpx;">
style=" <Text class='grid-text'>商品库存有限,请尽快下单</Text>
display: flex; <Text @click='edit' v-if='editType==false' class='grid-text_r'>编辑</Text>
flex-direction: row; <Text @click='edit' v-if='editType==true' class='grid-text_r'>完成</Text>
align-items: center; </view>
justify-content: space-between; <view style="width: 100%;height: 30rpx;background: #F7F7F7;margin: 20rpx 0;"></view>
padding: 0 15rpx; <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">
<Text class="grid-text">商品库存有限,请尽快下单</Text> <u-checkbox-group @change='SelectAll'>
<Text @click="edit" v-if="editType == false" class="grid-text_r" <u-checkbox v-model="allchecked" shape="circle" active-color="red">赞羊严选</u-checkbox>
>编辑</Text </u-checkbox-group>
> </view>
<Text @click="edit" v-if="editType == true" class="grid-text_r" <view class="cartList"
>完成</Text :style="{'margin-bottom':listbottom}"
> v-if="list.length>0"
</view> >
<view <view class="cartList_item"
style="width: 100%; height: 30rpx; background: #f7f7f7; margin: 20rpx 0;" v-for="(item, index) in list" :key="index"
></view> :name="item.name">
<view <u-checkbox-group @change='clickcheckbox(item.checked,item.goods.price,index)'>
v-if="list.length == 0" <u-checkbox v-model="item.checked" shape="circle" active-color="red"></u-checkbox>
style=" </u-checkbox-group>
width: 100%; <image
height: 400rpx; :src="item.attrs.pic_url ? item.attrs.pic_url:item.goods.cover_pic"
display: flex; mode="aspectFit"
flex-direction: column; style="width: 150rpx; height: 150rpx;margin-left: 30rpx;"
justify-content: center; />
align-items: center; <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 <view v-for="(attr, inde2x) in item.attrs.attr" :key="index2" >
style=" <Text style='color: #A0A09D;font-size: 24rpx;margin-right: 5rpx;'>{{attr.attr_group_name}}:{{attr.attr_name}}</Text>
width: 180rpx; </view>
height: 180rpx; </view>
border-radius: 50%; <view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
background: #dfdfe9; <Text style='color: #E35943;font-size:30rpx ;'><Text style='40rpx'>{{item.goods.price}}</Text></Text>
display: flex; <view class="item_input">
align-items: center; <view class="item_input_l"
justify-content: center; :style="{
" color: item.num == 1 ? '#E2E2E2' : '#9B9B9B',
> }"
<image @click="reduce(index,item.goods.price)">-</view>
src="../../static/images/icon/Shopping.png" <input type="number" class="item_input_c" :value="item.num" >
style="width: 60rpx; height: 60rpx;" <view class="item_input_r" style="color: #9B9B9B;" @click="plus(index,item.goods.price)">+</view>
></image> </view>
</view> </view>
<Text style="margin-top: 20rpx; color: #939393;">购物车还是空的哦</Text> </view>
</view>
<view </view>
style="padding: 25rpx; border-bottom: 1rpx solid #e4e4e4;" </view>
v-if="list.length > 0"
> <view class="box_bottom"
<u-checkbox-group @change="SelectAll"> :style="{'margin-bottom':bottommargin}"
<u-checkbox v-model="allchecked" shape="circle" active-color="red"
>赞羊严选</u-checkbox >
> <div style='margin-left: 30rpx;'>
</u-checkbox-group> <u-checkbox-group @change='SelectAll'>
</view> <u-checkbox v-model="allchecked" shape="circle" active-color="red">全选</u-checkbox>
<view </u-checkbox-group>
class="cartList" <Text style='color: #ff4544;font-size:30rpx ;' v-if='editType==false'>{{TotalPrice}}</Text>
:style="{ 'margin-bottom': listbottom }" </div>
v-if="list.length > 0" <div class='bottom_btn'
> :style="{'background':TotalPrice>0 ? '#ff4544':'#989898'}"
<view v-if='editType==false'
class="cartList_item" @click='settlement'
v-for="(item, index) in list" >
:key="index" <Text style='font-size: 28rpx;color: white;' >去结算</Text>
:name="item.name" </div>
> <u-button v-if='editType==true&& cart_id_list.length ==0' shape="circle" size="medium" class='Deletestyle'>删除</u-button>
<u-checkbox-group <u-button v-if='editType==true&& cart_id_list.length >0' shape="circle" size="medium" class='Deletestyle' @click='Delete' type="error">删除</u-button>
@change="clickcheckbox(item.checked, item.goods.price, index)"
>
<u-checkbox </view>
v-model="item.checked"
shape="circle" <tabbars></tabbars>
active-color="red" </div>
></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>
</template> </template>
<script> <script>
import tabbars from "@/components/tabbar/index"; import tabbars from "@/components/tabbar/index";
export default { export default {
data() { data(){
return { return{
isloading: true, isloading: true,
pageTitle: "购物车", pageTitle: "购物车",
navHeight: 0, navHeight: 0,
contentHeight: 0, contentHeight:0,
cstyle: {}, cstyle:{},
allchecked: false, allchecked:false,
TotalPrice: 0, //总价格 TotalPrice:0,//总价格
bottommargin: 0, bottommargin:0,
listbottom: 0, listbottom:0,
editType: false, editType:false,
list: [], list:[],
cart_id_list: [], cart_id_list:[],
};
}, }
created() {}, },
components: { created(){
tabbars,
}, },
onLoad() { components:{
this.navHeight = this.$navHeight - 2; tabbars,
this.cstyle = uni.getStorageSync("basedata") },
? uni.getStorageSync("basedata").cat_style onLoad() {
: []; this.navHeight = this.$navHeight - 2;
this.cstyle = uni.getStorageSync("basedata")
if (this.cstyle.cat_style == "4") { ? uni.getStorageSync("basedata").cat_style
// this.searchStyle.p = { : [];
// position: "fixed",
// top: this.navHeight, if (this.cstyle.cat_style == "4") {
// width: "100%", // this.searchStyle.p = {
// left: "0", // 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"; mounted() {
this.listbottom = c - 2 + 50 + "px"; let currentPages = getCurrentPages();
this.contentHeight = this.$utils.calcContentHeight(c); let c = this.$uiConfig.is_bang ? 80 : 52;
let u = "/" + currentPages[currentPages.length - 1].route; this.bottommargin = (c-2)+'px';
let pages = wx.getStorageSync("basedata") this.listbottom = (c-2+50)+'px';
? wx.getStorageSync("basedata").bar_title this.contentHeight = this.$utils.calcContentHeight(c);
: []; let u = "/" + currentPages[currentPages.length - 1].route;
pages.forEach((x) => { let pages = wx.getStorageSync("basedata")
if (x.value == u) { ? wx.getStorageSync("basedata").bar_title
this.pageTitle = x.new_name ? x.new_name : x.name; : [];
} pages.forEach((x) => {
}); if (x.value == u) {
this.init(); this.pageTitle = x.new_name ? x.new_name : x.name;
}, }
methods: { });
goHome() { this.init();
uni.redirectTo({ url: "/pages/index/main" }); },
}, methods:{
init() { goHome() {
uni.showNavigationBarLoading(); uni.redirectTo({ url: "/pages/index/main" });
},
this.request( init() {
{ uni.showNavigationBarLoading();
url: "",
header: { this.request(
"X-Access-Token": "Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ", {
"X-App-Platform": "wxapp", url: "",
"X-App-Version": "4.2.47", header:{
"X-Form-Id-List": JSON.stringify([]), 'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
"X-Requested-With": "XMLHttpRequest", 'X-App-Platform': 'wxapp',
"X-User-Id": 21269, 'X-App-Version':'4.2.47',
}, 'X-Form-Id-List': JSON.stringify([]),
data: { 'X-Requested-With': 'XMLHttpRequest',
r: "api/cart/list", 'X-User-Id': 21269
},
},
(res) => { },
uni.hideNavigationBarLoading(); data: {
this.isloading = false; r: "api/cart/list",
if (res.data.list.length > 0) { },
let goods_list = res.data.list[0].goods_list;
goods_list.forEach((x) => { },
x.checked = false;
}); (res) => {
this.list = goods_list; uni.hideNavigationBarLoading()
console.log(this.list); this.isloading = false;
} else { if(res.data.list.length>0){
this.list = []; 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) { }else {
if (checked == true) { this.list.forEach((x)=>{
this.TotalPrice += price * this.list[index].num; x.checked=false;
let all = true; this.TotalPrice =0;
this.list.forEach((x) => { if(this.editType==true){
if (x.checked == false) { this.cart_id_list=[]
all = false; }
} })
}); }
if (all == true) {
this.allchecked = true;
} },
if (this.editType == true) {
let obj = { reduce(index,price){//减
mch_id: 0, if(this.list[index].num>1){
id: this.list[index].id, this.list[index].num = this.list[index].num -1;
}; if(this.list[index].checked==true){
this.cart_id_list.push(obj); this.TotalPrice -= price*1
} }
} else {
this.TotalPrice -= price * this.list[index].num; }
this.allchecked = false; },
if (this.editType == true) { plus(index,price){//加
this.cart_id_list.forEach((x) => { this.list[index].num = this.list[index].num +1;
if (x.id == this.list[index].id) { if(this.list[index].checked==true){
this.cart_id_list.splice(x, 1); this.TotalPrice += price*1
} }
});
} },
} edit(){
}, this.editType=!this.editType;
SelectAll() { this.allchecked =false;
if (this.allchecked == true) { this.TotalPrice= 0
this.TotalPrice = 0; this.list.forEach((x)=>{
this.cart_id_list = []; x.checked=false
this.list.forEach((x) => { })
x.checked = true;
this.TotalPrice += x.goods.price * x.num; },
if (this.editType == true) { Delete(){
this.cart_id_list.push({
mch_id: 0,
id: x.id, uni.showNavigationBarLoading();
}); this.request(
} {
}); url: "",
} else { method:"POST",
this.list.forEach((x) => { header:{
x.checked = false; 'content-type': 'application/x-www-form-urlencoded',
this.TotalPrice = 0; 'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ',
if (this.editType == true) { 'X-App-Platform': 'wxapp',
this.cart_id_list = []; '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) { },
//减 data: {
if (this.list[index].num > 1) { r: "api/cart/delete",
this.list[index].num = this.list[index].num - 1; cart_id_list:JSON.stringify(this.cart_id_list) ,
if (this.list[index].checked == true) { },
this.TotalPrice -= price * 1;
} },
}
}, (res) => {
plus(index, price) { this.init()
//加 this.TotalPrice= 0
this.list[index].num = this.list[index].num + 1; this.editType=false;
if (this.list[index].checked == true) { this.allchecked =false;
this.TotalPrice += price * 1; uni.hideNavigationBarLoading()
} }
}, );
edit() { },
this.editType = !this.editType; settlement(){
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() {},
},
};
</script> </script>
<style> <style>
.cartStyle { .cartStyle{
height: 100%; height: 100%;
position: relative; position: relative;
} }
.cartStyle .grid-text { .cartStyle .grid-text {
font-size: 24rpx; font-size: 24rpx;
margin-top: 4rpx; margin-top: 4rpx;
color: #939393; color: #939393;
} }
.cartStyle .grid-text_r { .cartStyle .grid-text_r{
margin-top: 4rpx; margin-top: 4rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.cartStyle .cartList { .cartStyle .cartList{
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
overflow-y: hidden; overflow-y: hidden;
} }
.cartStyle .cartList .cartList_item { .cartStyle .cartList .cartList_item{
width: 100%; width: 100%;
padding: 40rpx 30rpx; padding:40rpx 30rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
border-bottom: 1rpx solid #e4e4e4; border-bottom: 1rpx solid #E4E4E4;
} }
.cartList .cartList_item .item_input { .cartList .cartList_item .item_input{
width: 200rpx; width: 200rpx;
height: 60rpx; height: 60rpx;
background: #f7f7f7; background: #F7F7F7;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.cartList .item_input .item_input_l, .cartList .item_input .item_input_l,.item_input_r{
.item_input_r { width: 50rpx;
width: 50rpx; height: 60rpx;
height: 60rpx; font-size: 28rpx;
font-size: 28rpx; display: flex;
display: flex; align-items: center;
align-items: center; justify-content: center;
justify-content: center;
} }
.cartStyle .item_input .item_input_c { .cartStyle .item_input .item_input_c{
text-align: center; text-align: center;
width: 50rpx; width: 50rpx;
height: 60rpx; height: 60rpx;
} }
.cartStyle .box_bottom { .cartStyle .box_bottom{
width: 100%; width: 100%;
height: 50px; height: 50px;
position: fixed; position: fixed;
background: #fff; background: #FFF;
left: 0; left: 0;
bottom: 0; bottom: 0;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-top: 1rpx solid #e4e4e4; border-top: 1rpx solid #E4E4E4;
z-index: 999; z-index: 999;
} }
.cartStyle .bottom_btn { .cartStyle .bottom_btn{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 250rpx; width: 250rpx;
height: 50px; height: 50px;
} }
.cartStyle .Deletestyle { .cartStyle .Deletestyle{
margin-right: 40rpx; margin-right: 40rpx;
} }
</style> </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> <template>
<view class="ordersubmit"> <view class="ordersubmit" v-if="ds.mch_list">
<view class="add-box"> <view class="add-box" @click="chosenAddress(ds.address.id)">
<view class="add-info"> <view class="add-info">
<view class="address">{{ <view class="address">{{
address.province + address.city + address.district address.province + address.city + address.district
...@@ -206,6 +206,11 @@ export default { ...@@ -206,6 +206,11 @@ export default {
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
}, },
methods: { methods: {
chosenAddress(id){
uni.navigateTo({
url: '/pages/address/address_chosen?form=ordersubmit&id='+id
});
},
changeUseInt(e) { changeUseInt(e) {
this.userInt=e.value this.userInt=e.value
if(this.userInt){ if(this.userInt){
...@@ -410,7 +415,7 @@ export default { ...@@ -410,7 +415,7 @@ export default {
align-items: center; align-items: center;
} }
.ordersubmit .goodbox .goodinfo .price .left { .ordersubmit .goodbox .goodinfo .price .left {
font-size: 18px; font-size: 20px;
font-family: "oswald"; font-family: "oswald";
width: 1px; width: 1px;
flex: 1; flex: 1;
...@@ -472,7 +477,7 @@ export default { ...@@ -472,7 +477,7 @@ export default {
margin-right: 5px; margin-right: 5px;
} }
.ordersubmit .filed .right .price { .ordersubmit .filed .right .price {
font-size: 14px; font-size: 16px;
flex: 1; flex: 1;
text-align: right; text-align: right;
font-family: "oswald"; font-family: "oswald";
......
<template> <template>
<view class="userStyle" v-if="!isloading"> <view class="userStyle" v-if="!isloading">
<view class="userBox"></view> <view class="userBox" :style="{'margin-bottom':bottommargin}">
<image :src='meueData.user_center.style_bg_pic_url' class="imgbg"> <view :style="{'background-image':'url('+meueData.user_center.top_pic_url+')',backgroundSize: '100% 330rpx'}" class="imgbg" >
<!-- <image :src='user_info.avatar' class="headimg"></image> --> <view style="display: flex;flex-direction: row;align-items: center;width: 100%;" v-if='meueData.user_center.top_style==1'>
<!-- <view style="width: 140rpx;height: 140rpx;background: #007AFF;"></view> --> <u-avatar :src="user_info.avatar" size='140' style='margin-left: 50rpx;'></u-avatar>
</image> <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> <tabbars></tabbars>
</view> </view>
</template> </template>
<script> <script>
import tabbars from "@/components/tabbar/index"; import tabbars from "@/components/tabbar/index";
import auth from "../../components/auth/index.vue";
export default{ export default{
data(){ data(){
return{ return{
...@@ -24,13 +107,24 @@ ...@@ -24,13 +107,24 @@
user_info:{},//个人信息 user_info:{},//个人信息
bottommargin:0, bottommargin:0,
listbottom:0, listbottom:0,
showAuth:false,
u: {},
} }
}, },
components:{ components:{
tabbars tabbars,
auth
}, },
onLoad() { onLoad() {
this.navHeight = this.$navHeight - 2; 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") this.cstyle = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").cat_style ? uni.getStorageSync("basedata").cat_style
: []; : [];
...@@ -45,13 +139,13 @@ ...@@ -45,13 +139,13 @@
this.bottommargin = (c-2)+'px'; this.bottommargin = (c-2)+'px';
this.listbottom = (c-2+50)+'px'; this.listbottom = (c-2+50)+'px';
this.contentHeight = this.$utils.calcContentHeight(c); this.contentHeight = this.$utils.calcContentHeight(c);
let u = "/" + currentPages[currentPages.length - 1].route; let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title ? wx.getStorageSync("basedata").bar_title
: []; : [];
console.log(wx.getStorageSync("basedata")) console.log(wx.getStorageSync("basedata"))
console.log(u)
pages.forEach((x) => { pages.forEach((x) => {
if (x.value == u) { if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name; this.pageTitle = x.new_name ? x.new_name : x.name;
...@@ -71,7 +165,7 @@ ...@@ -71,7 +165,7 @@
{ {
url: "", url: "",
header:{ header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ', 'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr',
'X-App-Platform': 'wxapp', 'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47', 'X-App-Version':'4.2.47',
'X-Form-Id-List': JSON.stringify([]), 'X-Form-Id-List': JSON.stringify([]),
...@@ -88,7 +182,6 @@ ...@@ -88,7 +182,6 @@
(res) => { (res) => {
uni.hideNavigationBarLoading() uni.hideNavigationBarLoading()
this.isloading = false; this.isloading = false;
console.log(res)
} }
); );
}, },
...@@ -98,20 +191,19 @@ ...@@ -98,20 +191,19 @@
{ {
url: "", url: "",
header:{ header:{
'X-Access-Token': 'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ', 'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr',
'X-App-Platform': 'wxapp', 'X-App-Platform': 'wxapp',
'X-App-Version':'4.2.47', 'X-App-Version': '4.2.47',
'X-Form-Id-List': JSON.stringify([]), 'X-Form-Id-List': [{"value":"7567542b600b46ac9d1945822f697123","type":0,"remains":1,"expires_at":"2020-05-25 11:25:17"}],
'X-Requested-With': 'XMLHttpRequest', 'X-Requested-With': 'XMLHttpRequest',
'X-User-Id': 21269 'X-User-Id': 19992,
}, },
data: { data: {
r: "api/user/config", r: "api/user/config",
}, },
},
},
(res) => { (res) => {
uni.hideNavigationBarLoading() uni.hideNavigationBarLoading()
this.isloading = false; this.isloading = false;
...@@ -120,6 +212,21 @@ ...@@ -120,6 +212,21 @@
this.user_info = res.data.user_info; 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 @@ ...@@ -127,19 +234,23 @@
</script> </script>
<style> <style>
.body{
background: #f3f4f6;
}
.userStyle .userBox{ .userStyle .userBox{
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
background: #f3f4f6;;
} }
.userStyle .imgbg{ .userStyle .imgbg{
width: 100%; width: 100%;
height: 330rpx; height: 330rpx;
position: relative;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center;
} }
.userStyle .headimg{ .userStyle .headimg{
width: 140rpx; width: 140rpx;
...@@ -147,4 +258,126 @@ ...@@ -147,4 +258,126 @@
border-radius: 50%; border-radius: 50%;
margin-left: 60rpx; 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> </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