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>
This diff is collapsed.
<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";
......
This diff is collapsed.
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