first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
<template lang="pug">
.account
.account_welcome(v-if="isShowAction")
.swiper
img(src="img/login_2.png")
.buttons
.login_butt(@click="changePage('login')") 登 录
.reg_butt(@click="changePage('reg')") 注 册
.account_action(v-else)
.header
.login.wrap(v-if="currentStatus == 'login'")
.portrait
img(src="https://upload.jianshu.io/users/upload_avatars/9988193/fc26c109-1ae6-4327-a298-2def343e9cd8.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240")
van-cell-group(class="input" :border="false")
van-field( clearable
left-icon='manager-o'
v-model="UserLogin.name"
placeholder='请输入用户名')
van-field(class="pass"
:type="ShowType"
v-model="UserLogin.pwd"
clearable
:right-icon="ShowIcon"
@click-right-icon="ShowPwd"
left-icon='edit'
placeholder='请输入密码')
.reg.wrap(v-else)
.portrait
img(src="https://upload.jianshu.io/users/upload_avatars/9988193/fc26c109-1ae6-4327-a298-2def343e9cd8.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240")
van-cell-group(class="input" :border="false")
van-field( clearable
left-icon='manager-o'
v-model="UserReg.name"
placeholder='请输入用户名')
van-field( clearable
left-icon='phone-o'
v-model="UserReg.phone"
placeholder='请输入手机号')
van-field(class="pass"
:type="ShowType"
v-model="UserReg.pwd"
clearable
:right-icon="ShowIcon"
@click-right-icon="ShowPwd"
left-icon='edit'
placeholder='请输入密码')
.SubmitLogin(@click=" currentStatus == 'login' ? Login() : Reg() ") {{ currentStatus == "login" ? '登 录': '注 册' }}
.Tips(@click="changePage( currentStatus == 'login' ? 'reg' : 'login' )")
| {{ currentStatus == "login" ? '注 册': '登 录' }}
</template>
<script>
// import SwiperComponents from '@com/Swiper.vue'
export default {
name: 'User',
data() {
return {
UserLogin: {
name: '',
pwd: ''
},
UserReg: {
name: '',
pwd: '',
phone: ''
},
isShowAction: true,
currentStatus: 'login',
ShowIcon: 'closed-eye',
ShowType: 'password',
}
},
async created() {
},
methods: {
ShowPwd() {
if (this.ShowIcon == "closed-eye") {
this.ShowIcon = "eye-o"
this.ShowType = "text"
} else {
this.ShowIcon = "closed-eye"
this.ShowType = "password"
}
},
async Login() {
let res = await this.$http.UserService.Login(this.UserLogin);
this.$dialog.alert({
message: '登录成功',
}).then(() => {
localStorage.setItem("token", res.token);
if (this.$route.query.hasOwnProperty("from")) {
this.$router.replace(this.$route.query.from)
} else {
this.$router.replace("/home")
}
});
},
async Reg() {
await this.$http.UserService.Reg(this.UserReg);
this.$dialog.alert({
message: '注册成功',
}).then(() => {
this.currentStatus = "login"
});
},
/**
* 切换登录和注册页面
* @param action
*/
changePage(action) {
// 切换搭配登录注册页面
this.isShowAction = false;
this.currentStatus = action;
}
},
components: {
}
}
</script>
<style lang="less" scoped>
@import "~@less/page/Account.less";
.swiper{
img{
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,148 @@
<template lang="pug">
.Car
van-nav-bar(fixed='', left-arrow='', title='购物车' @click-left="$router.back()")
template(#right='')
span(@click='changeAction') {{ ShowDelete ? "管理" : "完成" }}
// <span @click="changeAction">完成</span>
.content
van-checkbox-group(ref='checkboxGroup', v-model='checkCarItem')
.carItem(v-for='(v, i) in CarList', :key='i')
van-checkbox(:name='v.car_id')
van-card(:desc="v.wares_info.substring(0, 20) + '..'", :price='v.wares_oldprice', :thumb='v.wares_masterimg[0]', :title='v.wares_title')
template(#footer='')
van-stepper(v-model='v.car_num', @minus='UpdateCarNums(v.car_id, v.car_num - 1)', @plus='UpdateCarNums(v.car_id, v.car_num + 1)')
van-goods-action
van-checkbox(v-model='checkCarItem.length == CarList.length ? true : false', @click='SelectAllCarItem')
| 全选
van-goods-action-button(:text="ShowDelete ? `结算(${Money})` : '删除'", type='danger', @click='ShowDelete ? SubmitCar() : DeleteCarItem()')
</template>
<script>
import { mapMutations } from "vuex";
export default {
name: "car",
data() {
return {
checkCarItem: [],
ShowDelete: true,
CarList: [],
};
},
async created() {
this.GetCarList();
},
methods: {
...mapMutations(["Set_OrderList"]),
async GetCarList() {
this.CarList = await this.$http.IndexService.getCarList({});
console.log(this.CarList);
},
async UpdateCarNums(carid, nums) {
let res = await this.$http.IndexService.updateCarNum({
carid: carid,
quantity: nums,
});
},
async SubmitCar() {
let data = [],
orderData = [];
this.CarList.forEach((v) => {
if (this.checkCarItem.includes(v.car_id)) {
orderData.push(v);
data.push({
waresid: v.wares_id,
goodsnum: v.car_num,
goodsprice: v.wares_oldprice,
});
}
});
let res = await this.$http.IndexService.submitCar(
JSON.stringify({
carList: data,
})
);
this.$toast("订单增加成功");
//this.Set_OrderList(orderData)
setTimeout(() => {
this.$router.push("/Pay");
}, 2000);
},
// 全选
SelectAllCarItem() {
if (this.checkCarItem.length == 0) {
this.$refs.checkboxGroup.toggleAll(true);
} else {
this.$refs.checkboxGroup.toggleAll();
}
console.log(this.checkCarItem);
},
// 删除购物车商品
async DeleteCarItem() {
console.log(this.checkCarItem);
let res = await this.$http.IndexService.deleteCar({
carid: this.checkCarItem,
});
this.GetCarList();
},
changeAction() {
this.ShowDelete = !this.ShowDelete;
},
},
computed: {
Money() {
if (this.checkCarItem.length != 0) {
console.log("this.checkCarItem: ", this.checkCarItem);
let price = 0;
this.CarList.forEach((v) => {
if (this.checkCarItem.includes(v.car_id)) {
price += v.car_num * v.wares_oldprice;
}
});
return price;
} else {
return 0;
}
},
},
components: {},
};
</script>
<style lang="less" scoped>
.content {
padding-top: 46px;
padding-bottom: 110px !important;
}
.van-card {
background: #fff !important;
}
.van-goods-action {
bottom: 49.37px !important;
padding-left: 10px;
box-sizing: border-box;
}
.van-goods-action-button {
width: 30%;
position: absolute;
right: 0;
}
.carItem {
display: flex;
align-items: center;
padding-left: 15px;
box-sizing: border-box;
}
.van-card {
flex: 1;
padding-left: 0 !important;
}
//@import "~@less/page/Home.less";
</style>

View File

@@ -0,0 +1,40 @@
<template lang="pug">
.Collection
van-nav-bar(left-arrow='', title='收藏', @click-left='$router.back()')
ShopItem(:list="List")
</template>
<script>
import ShopItem from "@com/ShopItem.vue";
export default {
name: 'Collection',
data () {
return {
List: []
}
},
async created () {
this.GetLike();
},
methods: {
async GetLike() {
this.List = await this.$http.IndexService.likeList({});
console.log(this.List)
}
},
components: {
ShopItem
}
}
</script>
<style lang="less" scoped>
.van-nav-bar{
position: fixed;
width: 100%;
top: 0;
}
.ShopItem{
padding-top: 46px;
}
</style>

View File

@@ -0,0 +1,85 @@
<template lang="pug">
.home
Header
.content
Swipers(:swiper-list="piclist")
van-grid(:border='false', :column-num='type.length')
van-grid-item(@click="Enterlist(v.id)" v-for="(v,i) in type" :key="i")
van-image(:src="v.url")
span {{v.title}}
Contentlist(:list='Itemlist')
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
import Header from '@com/Header.vue'
import Swipers from '@com/Swiper.vue'
import Contentlist from '@com/Contentlist.vue'
export default {
data() {
return {
piclist:[],
type:[
{url:"img/type_1.png",title:"限时白嫖",id:1},
{url:"img/type_2.png",title:"新品推荐",id:2},
{url:"img/type_3.png",title:"低价高配",id:3},
{url:"img/type_4.png",title:"超值特卖",id:4}
],
Itemlist:[]
};
},
async created() {
this.GetIndex()
},
methods: {
Enterlist(id) {
this.$router.push({
path: '/list',
query: {
id: id
}
})
},
async GetIndex() {
let res = await this.$http.IndexService.index({});
this.Itemlist = res
console.log(res);
res.forEach((v,i)=>{
if (i <= 2) {
this.piclist.push({
img: v.wares_masterimg[1],
id: v.wares_id
})
}
});
}
},
components: {
Header,
Swipers,
Contentlist
}
}
</script>
<style lang="less" scoped>
@import "~@less/page/Home.less";
.content{
padding-top: 50px;
.Swiper{
.van-swipe{
height: 200px !important;
}
}
}
.van-grid-item{
.van-image{
width: 32px !important;
}
span{
margin-top: 3px;
color: #646566;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,29 @@
<template lang="pug">
.Index
router-view
van-tabbar(route)
van-tabbar-item(icon='home-o' replace to="/home") 首页
van-tabbar-item(icon='orders-o' replace to="/type") 分类
van-tabbar-item(icon='shopping-cart-o' replace to="/car") 购物车
van-tabbar-item(icon='friends-o' replace to="/me") 我的
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
export default {
name: 'Index',
data() {
return {
}
},
async created() {
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
//@import "~@less/page/Home.less";
</style>

View File

@@ -0,0 +1,248 @@
<template lang="pug">
.info(v-if="ConfigData.length != 0")
.title
.title_shadow(@click="$router.back()")
van-icon(name="arrow-left", size="20", color="#fff")
.title_shadow(@click="$router.push('/car')")
van-icon(name="shopping-cart-o", size="20", color="#fff")
Swiper(:swiperList="infolist.wares_masterimg")
.InfoContent
h2 {{ infolist.wares_title }}
p {{ infolist.wares_info }}
.price ¥ {{ ConfigData[active].config_price }}
.norms(@click="OpenConfig")
p.status 已选
p.conf {{ ConfigData[active].config_info }}...
p.right
span x1
van-icon(name="arrow")
.info_img
img(
v-for="i in infolist.wares_infoimg",
:src="i",
@click="IsShowPreview = true"
)
van-popup(v-model="isShowConfig",:style="{ height: '40%' }",close-icon="close",closeable,position="bottom",round)
van-card(:desc="ConfigData[active].config_info",:thumb="infolist.wares_masterimg[1].img",:title="ConfigData[active].config_price")
.version 版本
.list
.item(
v-for="(item, index) in ConfigData",
:key="index",
:class="active == index ? 'chioose' : ''",
@click="active = index"
)
| {{ item.config_text }}
van-image-preview(
v-model="IsShowPreview",
:images="infolist.wares_infoimg",
@change="PreviewChange"
)
template(v-slot:index="") {{ CurrentPreviewIndex }}/{{ infolist.wares_infoimg.length }}
van-goods-action
van-goods-action-icon(icon="star-o", text="收藏", @click="LikeShop")
van-goods-action-icon(
icon="cart-o",
text="购物车",
@click="$router.push('/car')"
)
van-goods-action-button(text="加入购物车", type="warning", @click="addCar")
van-goods-action-button(text="立即购买", type="danger", @click="NowBuy()")
</template>
<script>
import Swiper from "../components/Swiper";
export default {
name: "info",
data() {
return {
infolist: {},
isShowConfig: false,
active: 0,
CurrentPreviewIndex: 1,
IsShowPreview: false,
ConfigData: [],
};
},
async created() {
await this.Infocontent();
this.StructureData();
},
methods: {
async Infocontent() {
this.infolist = await this.$http.InfoService.info({
id: this.$route.query.id,
});
let NewSwiper = [];
this.infolist.wares_masterimg.forEach((v) => {
NewSwiper.push({
img: v,
id: 1,
});
});
this.infolist.wares_masterimg = NewSwiper;
console.log(this.infolist);
},
PreviewChange(i) {
this.CurrentPreviewIndex = i + 1;
},
StructureData() {
this.infolist.wares_conf.forEach((v, i) => {
let text = v.match(/ (\S*)GB/)[1] + "GB";
let min = parseInt(text.split("+")[1]);
this.ConfigData.push({
config_text: text,
config_info: v,
});
});
this.ConfigData[0].config_price = this.infolist.wares_nowprice;
this.ConfigData[1].config_price = this.infolist.wares_oldprice;
},
OpenConfig() {
this.isShowConfig = true;
},
async LikeShop() {
await this.$http.IndexService.like({
shopid: this.$route.query.id,
});
this.$toast("收藏成功");
},
async addCar() {
let res = await this.$http.IndexService.addCar({
waresid: this.$route.query.id,
});
this.$toast("添加成功");
},
async NowBuy() {
var data = [];
data.push({
waresid: this.infolist.wares_id,
goodsnum: 1,
goodsprice: this.infolist.wares_oldprice,
});
let res = await this.$http.IndexService.submitCar(
JSON.stringify({
carList: data,
})
);
this.$toast("订单增加成功");
setTimeout(() => {
this.$router.push("/Pay");
}, 2000);
},
},
components: {
Swiper,
},
};
</script>
<style lang="less" scoped>
.title {
padding: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
height: 60px;
position: fixed;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
z-index: 9;
}
.title_shadow {
border-radius: 100%;
width: 40px;
height: 40px;
background: #00000059;
display: flex;
align-items: center;
justify-content: center;
}
.version {
font-size: 16px;
color: #666;
margin: 10px;
}
.list {
margin: 10px;
display: flex;
.item {
padding: 8px 7px;
border: 1px solid #cac8c6;
margin-right: 10px;
}
}
.van-card__content {
padding-top: 20px !important;
}
.van-card__title {
color: #ff6700;
font-size: 20px !important;
margin-bottom: 10px;
}
.chioose {
border: 1px solid #ff6700 !important;
color: #ff6700 !important;
}
.van-card__desc {
font-size: 15px;
}
.InfoContent {
padding: 16px;
h2 {
font-size: 0.56rem;
color: #3c3c3c;
margin-bottom: 0.26667rem;
}
p {
color: rgba(0, 0, 0, 0.54);
font-size: 0.33333rem;
line-height: 0.5rem;
}
.price {
margin-top: 0.26667rem;
color: #ff6700;
font-size: 0.53333rem;
}
}
.norms {
padding: 0.13333rem 0.4rem;
border-bottom: 0.13333rem solid #f7f7f7;
border-top: 0.13333rem solid #f7f7f7;
display: flex;
justify-content: space-between;
height: 1.06667rem;
align-items: center;
font-size: 0.34667rem;
}
.info_img {
padding-bottom: 55px;
img {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,109 @@
<template lang="pug">
.me
.header
img.setting(alt='', src='/img/me_settin_2.png', @click='seating')
.user
img.user_head(alt='', src='/img/user_head.png')
p 赵先生
van-grid.type(:border='false', :column-num='5', clickable='')
router-link(v-for='(item, index) in orderList', :key='index', :to="{ name: 'Status', query: { active: index } }")
van-grid-item(:text='item.title')
img(slot='icon', :src='item.img')
.setting
van-cell(:center='true', :clickable='true', icon='location-o', title='收货地址',is-link to="/Shippingaddress")
img(slot='icon', alt='', src='/img/me_address.png')
van-cell(:center='true', :clickable='true', icon='location-o', title='我的收藏', is-link='', to='/Collection')
img(slot='icon', alt='', src='/img/me_like.png')
van-cell(:center='true', :clickable='true', icon='location-o', is-link='', title='我的设置', to='/setting')
img(slot='icon', alt='', src='/img/me_settin_2.png')
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
export default {
name: "me",
data() {
return {
orderList: [
{ title: "全部订单", img: "/img/me_1.png" },
{ title: "待付款", img: "/img/me_2.png" },
{ title: "待发货", img: "/img/me_3.png" },
{ title: "待收货", img: "/img/me_4.png" },
{ title: "退款/售后", img: "/img/me_5.png" },
],
};
},
async created() {},
methods: {
seating(){
this.$router.push({
path: '/Setting',
})
}
},
components: {},
};
</script>
<style lang="less" scoped>
.header {
width: 100%;
height: 200px;
background: url("/img/me_back.png") no-repeat;
background-position: center center;
background-size: cover;
position: relative;
}
.header .setting {
position: absolute;
right: 15px;
top: 20px;
width: 25px;
height: 25px;
z-index: 9;
}
.header .user {
display: flex;
align-items: center;
position: absolute;
bottom: 40px;
left: 20px;
}
.header .user img {
width: 55px;
height: 55px;
}
.header .user p {
margin-left: 10px;
font-size: 18px;
}
.type {
justify-content: space-around;
}
.type img {
width: 35px;
}
.setting {
margin-top: 15px;
}
.setting .van-cell {
padding-top: 15px;
padding-bottom: 15px;
}
.setting img {
width: 18px;
height: 20px;
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,234 @@
<template lang="pug">
.Pay
.wxpay-page(v-if='HiddedWxPage')
.wxpay-page-dialog
.dialog-title
van-icon(name='cross', size='15', @click='HiddedWxPage = false')
span 请输入支付密码
.dialog-price
p.price-title 付款给创想网络科技
p.price-info
span.info-1 ¥
span.info-2 {{ TotalMoney / 100 }}.00
.dialog-chooise
p 支付方式
.chooise-right
img(alt='', src='img/wxPay/ye.png')
span 零钱
van-icon(name='arrow', size='15')
van-password-input(:focused='showKeyboard', :value='PayPassword', @focus='showKeyboard = true')
.wxpay-page-password
van-number-keyboard(:show='showKeyboard', @blur='showKeyboard = false', @delete='onDelete', @input='onInput')
.order-list(v-else)
// 代付款订单列表
van-card(v-for='(item,index) in Get_OrderList', :key='index', :desc='item.wares_info', :num='item.goods_num', :price='item.goods_price', :thumb='item.wares_masterimg[0]', :title='item.wares_title')
van-cell-group
van-cell(title='配送方式', value='顺丰配送货(免运费)')
van-cell(title='发票类型', value='电子发票')
van-cell(title='优惠券', value='无')
van-cell-group(title='支付方式')
van-cell(title='微信支付')
template(slot='icon')
img(alt='微信支付', src='img/pay_wx.png')
template(slot='right-icon')
van-radio(checked='')
van-cell(title='支付宝支付')
template(slot='icon')
img(alt='支付宝支付', src='img/pay_zfb2.png')
template(slot='right-icon')
van-radio(disabled='')
van-cell(title='花呗分期')
template(slot='icon')
img(alt='花呗分期', src='img/pay_antinstalment.png')
template(slot='right-icon')
van-radio(disabled='')
van-cell(title='银联支付')
template(slot='icon')
img(alt='银联支付', src='img/pay_yl1.png')
template(slot='right-icon')
van-radio(disabled='')
van-submit-bar(:price='TotalMoney', button-text='支付', @submit='PayStatus()')
</template>
<script>
export default {
name: 'Pay',
data () {
return {
showKeyboard: true,
PayPassword: '',
HiddedWxPage: false,
Get_OrderList: []
}
},
async created () {
// console.log(this.Get_OrderList);
this.GetAllOrder()
},
methods: {
async GetAllOrder () {
this.Get_OrderList = await this.$http.IndexService.allOrder({
status: 0
});
},
PayStatus () {
this.HiddedWxPage = true
},
async onInput (v) {
this.PayPassword = (this.PayPassword + v).slice(0, 6);
if (this.PayPassword.length == 6) {
let aa = [];
this.Get_OrderList.forEach(v => {
aa.push(v.goods_id)
})
this.HiddedWxPage = false
let res = await this.$http.IndexService.buyOrder({
goodsid: JSON.stringify(aa)
})
this.$dialog.alert({
title: '提示',
message: '支付成功'
}).then(() => {
this.$router.push("/status")
});
}
},
onDelete () {
this.PayPassword = this.PayPassword.slice(0, this.PayPassword.length - 1);
}
},
components: {},
computed: {
TotalMoney () {
let price = 0;
this.Get_OrderList.forEach((v) => {
price += parseInt(v.goods_totalprice)
});
return price * 100
}
// ...mapGetters([
// 'Get_OrderList'
// ])
}
}
</script>
<style lang="less" scoped>
.order-list {
margin-top: 20px;
}
.van-cell {
align-items: center;
img {
width: 20px;
margin-right: 10px;
}
}
.wxpay-page-dialog {
width: 330px;
position: absolute;
background: #f8f8f8;
left: 50%;
margin-left: -165px;
top: 10%;
padding: 0 10px;
padding-bottom: 20px;
box-sizing: border-box;
}
.wxpay-page-dialog .dialog-title {
display: flex;
align-items: center;
height: 50px;
position: relative;
}
.wxpay-page-dialog .dialog-title .van-icon {
position: absolute;
left: 10px;
color: #aca6a8;
}
.wxpay-page-dialog .dialog-title span {
font-size: 14px;
color: #000;
margin: 0 auto;
}
.wxpay-page-dialog .dialog-price {
margin-top: 10px;
text-align: center;
border-bottom: 1px solid #ececec;
padding-bottom: 15px;
}
.wxpay-page-dialog .dialog-price .price-title {
font-size: 16px;
margin-bottom: 15px;
color: #000;
}
.wxpay-page-dialog .dialog-price .price-info {
font-weight: bolder;
}
.wxpay-page-dialog .dialog-price .price-info .info-1 {
vertical-align: middle;
font-size: 17px;
}
.wxpay-page-dialog .dialog-chooise {
display: flex;
justify-content: space-between;
height: 45px;
align-items: center;
padding: 0 4px;
}
.wxpay-page-dialog .dialog-chooise p {
font-size: 14px;
color: #686169;
}
.wxpay-page-dialog .dialog-chooise .chooise-right {
display: flex;
align-items: center;
}
.wxpay-page-dialog .dialog-chooise .chooise-right img {
width: 20px;
}
.wxpay-page-dialog .dialog-chooise .chooise-right span {
font-size: 13px;
margin-left: 8px;
margin-right: 8px;
}
.wxpay-page-dialog .van-password-input {
margin: 5px 0 0 0;
}
.wxpay-page {
position: fixed;
width: 100%;
background: rgba(0, 0, 0, 0.702);
z-index: 9999;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.delete {
width: 40px;
margin-top: 15px;
}
</style>

View File

@@ -0,0 +1,57 @@
<template lang="pug">
.Search
van-search(v-model='SearchKey', fixed='', placeholder='请输入搜索关键词', show-action='', @search='onSearch')
template(#action='')
div(@click='onSearch') 搜索
.content(v-if='SearchList.length != 0')
ShopItem(:list='SearchList')
.content.search(v-else='')
| 请搜索
</template>
<script>
import ShopItem from "@com/ShopItem";
export default {
name: 'Search',
data () {
return {
SearchKey: '',
SearchList: []
}
},
created () {
},
methods: {
async GetSearchList () {
let res = await this.$http.IndexService.search({
keyword: this.SearchKey
});
this.SearchList = res
},
onSearch () {
this.GetSearchList()
}
},
components: {
ShopItem
}
}
</script>
<style lang="less" scoped>
.van-search {
position: fixed;
width: 100%;
z-index: 9;
top: 0;
left: 0;
}
.search {
text-align: center;
padding-top: 190px;
color: #6666;
}
</style>

View File

@@ -0,0 +1,124 @@
<template>
<div class="Setting">
<div class="logo-wrap">
<img alt="logo" class="logo" src="/img/logo_s.png">
<p>基友汇<span>v2.1.1</span></p>
</div>
<div class="list">
<van-cell :center="true"
:clickable="true"
icon="phone-o"
is-link
title="联系我们"
@click="ContactUs()">
</van-cell>
<van-cell :center="true"
:clickable="true"
icon="friends-o"
is-link
title="关于我们"
@click="AboutUs()">
</van-cell>
<van-cell :center="true"
:clickable="true"
icon="upgrade"
is-link
title="检测升级"
@click="CheckUpdate()">
</van-cell>
</div>
<van-button block
class="logout"
color="#f8d14b"
type="primary" @click="UserLogOut">
退 出 登 录
</van-button>
</div>
</template>
<script>
export default {
name: 'Setting',
data () {
return {}
},
async created () {
},
methods: {
UserLogOut () {
this.$dialog.alert({
title: '退出登录',
message: '确定退出登录吗?'
}).then(() => {
localStorage.clear();
this.$router.push("/home")
})
},
ContactUs () {
this.$dialog.alert({
title: '联系我们',
message: '平台客服电话:0551-7397727'
})
},
AboutUs () {
this.$dialog.alert({
title: '关于我们',
message: '一款专业的手机交易平台,让您买到更加安心放心的高质量手机!'
})
},
CheckUpdate () {
this.$toast("当前已是最新版");
}
},
components: {}
}
</script>
<style lang="less" scoped>
.Setting {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 70px;
box-sizing: border-box;
.list {
width: 100%;
margin-top: 40px;
}
.logo-wrap {
text-align: center;
p {
margin-top: 11px;
font-size: 14px;
letter-spacing: 5px;
span {
letter-spacing: 0;
font-size: 9px;
color: #a3a1a1;
}
}
.logo {
width: 80px;
height: 80px;
}
}
.logout {
width: 91%;
margin-top: 40px;
}
}
.van-cell {
padding: 15px;
}
</style>

View File

@@ -0,0 +1,71 @@
<!-- -->
<template lang="pug">
.Shippingaddress
van-address-list(v-model='chosenAddressId', :list='list', :disabled-list='disabledList', disabled-text='以下地址超出配送范围', default-tag-text='默认',)
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {
chosenAddressId: '1',
list: [
{
id: '1',
name: '张三',
tel: '13000000000',
address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
isDefault: true,
},
{
id: '2',
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号',
},
],
disabledList: [
{
id: '3',
name: '王五',
tel: '1320000000',
address: '浙江省杭州市滨江区江南大道 15 号',
},
],
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
async Getaddress() {
let res = await this.$http.IndexService.getUserAddress({});
console.log(res);
}
},
//生命周期 - 创建完成(可以访问当前this实例)
async created() {
this.Getaddress()
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='less' scoped>
//@import url(); 引入公共css类
</style>

View File

@@ -0,0 +1,59 @@
<template lang="pug">
.OrderStatus
van-tabs(v-model='active', animated='', @change='ChangeStatus')
van-tab(v-for='(v,i) in OrderList', :key='i', :title='v.title')
div(v-if='v.content.length != 0')
van-card(v-for='(t,x) in v.content', :desc='t.wares_info', :num='t.goods_num', :price='t.goods_price', :thumb='t.wares_masterimg[0]', :title='t.wares_title', @click='enterInfo(t.wares_id)')
.nodata(v-else='')
| 没有订单
</template>
<script>
export default {
name: 'Status',
data () {
return {
active: 0,
OrderList: [
{ title: '所有订单', id: -1, content: [] },
{ title: '待付款', id: 0, content: [] },
{ title: '待发货', id: 1, content: [] },
{ title: '待收货', id: 2, content: [] },
{ title: '退款/售后', id: 3, content: [] }
]
}
},
async created () {
if (this.$route.query.hasOwnProperty("active")) {
this.active = this.$route.query.active;
}
this.allOrder()
},
methods: {
enterInfo (id) {
this.$router.push({ path: '/info', query: { id: id } })
},
ChangeStatus (i) {
this.active = i;
if (this.OrderList[this.active].content.length == 0) {
this.allOrder()
}
},
async allOrder () {
let res = await this.$http.IndexService.allOrder({
status: this.OrderList[this.active].id
});
this.OrderList[this.active].content = [ ...res ]
}
},
components: {}
}
</script>
<style lang="less" scoped>
.nodata {
text-align: center;
margin-top: 10%;
color: #a39b9b;
}
</style>

View File

@@ -0,0 +1,104 @@
<template lang="pug">
.type
van-nav-bar(title='分类')
template(#right='')
van-icon(name='search', size='18',@click="enterseach")
.typeconten
van-tree-select(height='100vh', :items='items', :main-active-index.sync='active' @click-nav="Change")
template(#content)
van-row(gutter='10px')
van-col(v-for="(v,i) in items[active].content" @click="enterInfo(v.wares_id)")
van-image(:src='v.wares_masterimg')
p {{v.wares_title}}
</template>
<script>
export default {
name: 'type',
data() {
return {
active: 0,
items: [
{ text: '小米',content:[]},
{ text: '魅族',content:[]},
{ text: '华为',content:[]},
{ text: 'iPhone',content:[]},
{ text: '三星',content:[]},
{ text: '锤子',content:[]},
{ text: '诺基亚',content:[]},
],
}
},
async created() {
this.GetTypeList()
},
methods: {
enterseach(){
this.$router.push({
path: '/Search',
});
},
async GetTypeList() {
let res = await this.$http.Typeservice.list({
typename: this.items[this.active].text
});
console.log(res);
this.items[this.active].content= res;
},
Change(index) {
this.active = index;
if (this.items[this.active].content.length == 0) {
this.GetTypeList()
}
},
enterInfo(id){
this.$router.push({
path: '/info',
query: {
id: id
}
});
},
},
components: {}
}
</script>
<style lang="less" scoped>
.van-nav-bar{
position: fixed;
width: 100%;
top: 0;
left: 0;
}
.van-tree-select{
padding-top: 46px !important;
padding-bottom: 50px !important;
box-sizing: border-box;
}
.van-tree-select__nav{
flex: 0.5 !important;
}
.van-tree-select__content{
padding-left: 10px;
box-sizing: border-box;
padding-right: 10px;
}
.van-row{
display: flex;
flex-wrap: wrap;
}
.van-col{
padding: 0 !important;
width: 48%;
margin-right: 10px;
margin-bottom: 10px;
p{
text-align: center;
}
}
.van-col:nth-child(2n){
margin-right: 0px;
}
</style>

View File

@@ -0,0 +1,40 @@
<!-- -->
<template>
<div class>
<img src="@img/logo.png" alt="">
</div>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {},
//生命周期 - 创建完成(可以访问当前this实例)
created() {},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
</style>

View File

@@ -0,0 +1,67 @@
<template lang="pug">
.list
van-nav-bar(:title='title',left-arrow='',@click-left="$router.back()")
Contentlist(:list='Itemlists')
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import Contentlist from '@com/Contentlist.vue'
export default {
//import引入的组件需要注入到对象中才能使用
components: {
Contentlist
},
data() {
//这里存放数据
return {
Itemlists:[],
title: ''
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
async Infocontent() {
this.Itemlists = await this.$http.activityService.activity({
id:this.$route.query.id
});
console.log(this.Itemlists)
}
},
//生命周期 - 创建完成(可以访问当前this实例)
async created() {
switch (this.$route.query.id) {
case "1":
this.title = '限时白嫖';
break;
case "2":
this.title = '新品推荐';
break;
case "3":
this.title = '低价高配';
break;
case "4":
this.title = '超值特卖';
break;
}
this.Infocontent()
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='less' scoped>
@import "~@less/page/List.less";
</style>