Browse Source

对接完成积分商城接口,对接完余额条件筛选,新增商家中心商家登录并对接完成登录逻辑

master
邓平艺 4 years ago
parent
commit
6c935648a6
  1. 2
      common/js/config.js
  2. 15
      components/lf-nav/lf-nav.vue
  3. 1
      components/lf-swipeAction/lf-swipeAction.vue
  4. 2
      components/lf-waterfall-shopdetails/lf-waterfall.vue
  5. 7
      pages.json
  6. 18
      pages/address/add/add.vue
  7. 5
      pages/address/list/list.vue
  8. 183
      pages/business/center/center.vue
  9. 167
      pages/business/login/login.vue
  10. 3
      pages/index/index/index.vue
  11. 203
      pages/point/shoppingMall/shoppingMall.vue
  12. 49
      pages/recharge/balance/balance.vue
  13. 33
      pages/shop/goodsdetail.vue
  14. 4
      pages/user/my/center.vue
  15. 6
      pages/user/my/setting.vue

2
common/js/config.js

@ -16,7 +16,7 @@ export default {
//https://demo-guojiang-ec-api.guojiang.club/
baseUrl: process.env.NODE_ENV === 'development' ?
'http://192.168.3.29/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
'http://192.168.3.165/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
},
PACKAGES: {
activity: false,

15
components/lf-nav/lf-nav.vue

@ -170,7 +170,20 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 12rpx;
// padding: 0 12rpx;
}
.head .head-nav>text{
display: inline-block;
width: 50%;
height: 100%;
line-height: 57rpx;
}
.head .head-nav>text:nth-child(1){
padding-left: 12rpx;
}
.head .head-nav>text:nth-child(2){
text-align: right;
padding-right: 12rpx;
}
.head .head-nav::after{
position: absolute;

1
components/lf-swipeAction/lf-swipeAction.vue

@ -17,6 +17,7 @@
</template>
<script>
// https://ext.dcloud.net.cn/plugin?id=2177
// #ifdef APP-NVUE
const dom = weex.requireModule('dom');
// #endif

2
components/lf-waterfall-shopdetails/lf-waterfall.vue

@ -121,7 +121,7 @@
},
methods: {
onClick(id){
this.$url('/pages/shop/goodsdetail?type=mail&goods_id='+id);
this.$url('/pages/shop/goodsdetail?type=mail&id='+id);
this.$emit('click');
},
goAd(type,url){

7
pages.json

@ -482,6 +482,13 @@
"navigationBarTitleText": "物流详情" ,
"navigationStyle":"custom"
}
},
{
"path": "pages/business/login/login",
"style": {
"navigationBarTitleText": "商家登录" ,
"navigationStyle":"custom"
}
}
],
"globalStyle": {

18
pages/address/add/add.vue

@ -15,15 +15,15 @@
<radio-group class="lf-flex">
<label>
<radio-group @change="radioChange">
<radio :checked="detail.sex == 0" value="0"></radio>
<radio :checked="detail.sex == '男'" value="男"></radio>
</radio-group>
<text class="lf-m-l-15">女士</text>
<text class="lf-m-l-15">先生</text>
</label>
<label>
<radio-group @change="radioChange">
<radio :checked="detail.sex == 1" value="1"></radio>
<radio :checked="detail.sex == '女'" value="女"></radio>
</radio-group>
<text class="lf-m-l-15">先生</text>
<text class="lf-m-l-15">女士</text>
</label>
</radio-group>
</view>
@ -77,7 +77,7 @@
<view class="info-item">
<label for="name">门牌号:</label>
<view class="form-control">
<input type="text" id="name" placeholder="请输入门牌号(选填)" data-type="house_num" :value="house_num" @input="input" />
<input type="text" id="name" placeholder="请输入门牌号(选填)" data-type="house_num" :value="detail.house_num" @input="input" />
</view>
</view>
<view class="info-item">
@ -134,7 +134,7 @@ export default {
area: 430105,
city: 430100,
province: 430000,
sex: '',
sex: '',
house_num: ''
},
order_no: '',
@ -374,6 +374,9 @@ export default {
//
queryAddress(id) {
uni.showLoading({
title: '正在获取中'
})
var token = this.$cookieStorage.get('user_token');
this.$http.get({
api: 'api/address/' + id,
@ -412,7 +415,8 @@ export default {
image: '../../../static/error.png'
});
}
});
uni.hideLoading();
}).catch(err => uni.hideLoading())
},
//

5
pages/address/list/list.vue

@ -119,6 +119,9 @@ export default {
},
//
radioChange(e){
uni.showLoading({
title: '切换默认地址中'
})
let current = e.target.value;
let id = null;
this.list.forEach((item, index) => {
@ -143,8 +146,10 @@ export default {
is_default: 1
}
}).then(res => {
uni.hideLoading();
this.$msg('操作成功', {icon: 'success'});
}).catch(err => {
uni.hideLoading();
this.$msg('切换默认地址失败');
})
},

183
pages/business/center/center.vue

@ -1,100 +1,102 @@
<template>
<view>
<lf-nav title="我的" :showIcon="true" :spreadOut="false" bgColor="transparent" titleColor="#fff"></lf-nav>
<view class="head">
<view class="bg-left"></view>
<view class="bg-right"></view>
<view class="head-content">
<view class="lf-flex">
<image class="head-img" mode="aspectFill" src="https://picsum.photos/id/237/200/300"></image>
<view class="head-title lf-line-3">雅诗兰黛专卖店</view>
</view>
<view class="lf-flex">
<view class="head-menu" @click="$url('/pages/business/balance/balance')">
<text class="lf-iconfont icon-yue"></text>
<text>余额</text>
<block v-if="$isRight(detail)">
<view class="head">
<view class="bg-left"></view>
<view class="bg-right"></view>
<view class="head-content">
<view class="lf-flex">
<image class="head-img" mode="aspectFill" src="https://picsum.photos/id/237/200/300"></image>
<view class="head-title lf-line-3">雅诗兰黛专卖店</view>
</view>
<view class="head-menu" @click="onScanCode">
<text class="lf-iconfont icon-saoyisao"></text>
<text>扫一扫</text>
<view class="lf-flex">
<view class="head-menu" @click="$url('/pages/business/balance/balance')">
<text class="lf-iconfont icon-yue"></text>
<text>余额</text>
</view>
<view class="head-menu" @click="onScanCode">
<text class="lf-iconfont icon-saoyisao"></text>
<text>扫一扫</text>
</view>
</view>
</view>
</view>
</view>
<view class="notice">
<u-notice-bar mode="vertical" type="none" :list="list"></u-notice-bar>
</view>
<view class="card">
<view class="lf-row-between">
<view class="title">待处理</view>
<view class="lf-color-777" @click="$url('/pages/business/order/list')">
<text class="lf-font-24 lf-m-r-10">订单管理</text>
<text class="lf-iconfont icon-xiangyou lf-font-20"></text>
</view>
<view class="notice">
<u-notice-bar mode="vertical" type="none" :list="list"></u-notice-bar>
</view>
<view class="lf-flex lf-m-t-50">
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待付款</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待发货</view>
<view class="card">
<view class="lf-row-between">
<view class="title">待处理</view>
<view class="lf-color-777" @click="$url('/pages/business/order/list')">
<text class="lf-font-24 lf-m-r-10">订单管理</text>
<text class="lf-iconfont icon-xiangyou lf-font-20"></text>
</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待提货</view>
<view class="lf-flex lf-m-t-50">
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待付款</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待发货</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待提货</view>
</view>
</view>
</view>
</view>
<view class="card">
<view class="lf-row-between">
<view class="title">今日数据</view>
</view>
<view class="lf-flex lf-m-t-50">
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">
<text>0</text>
<text class="lf-font-24">()</text>
</view>
<view>支付金额</view>
<view class="card">
<view class="lf-row-between">
<view class="title">今日数据</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">
<text>0</text>
<text class="lf-font-24">()</text>
<view class="lf-flex lf-m-t-50">
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">
<text>0</text>
<text class="lf-font-24">()</text>
</view>
<view>支付金额</view>
</view>
<view>线上订单</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">
<text>0</text>
<text class="lf-font-24">()</text>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">
<text>0</text>
<text class="lf-font-24">()</text>
</view>
<view>线上订单</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">
<text>0</text>
<text class="lf-font-24">()</text>
</view>
<view>线下订单</view>
</view>
<view>线下订单</view>
</view>
</view>
</view>
<view class="card">
<view class="lf-row-between">
<view class="title">我的商品</view>
</view>
<view class="lf-flex lf-m-t-50">
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>销售中</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待上架</view>
<view class="card">
<view class="lf-row-between">
<view class="title">我的商品</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>已下架</view>
<view class="lf-flex lf-m-t-50">
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>销售中</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>待上架</view>
</view>
<view class="item" :style="{width: 100 / 3 +'%'}">
<view class="num">0</view>
<view>已下架</view>
</view>
</view>
</view>
</view>
</block>
</view>
</template>
@ -102,13 +104,34 @@
export default {
data(){
return {
list: ['我有一只小毛驴,但我从来也不骑', '天苍苍野茫茫']
list: ['我有一只小毛驴,但我从来也不骑', '天苍苍野茫茫'],
token: '',
detail: {}
}
},
onLoad(){
let store_token = this.$cookieStorage.get('store_token');
if(!store_token){
this.$msg('登录状态异常, 即将跳转至登录页').then(() => {
this.$url('/pages/business/login/login', {type: 'redirect'});
})
}else{
this.token = store_token;
this.getStoreCenter();
}
},
methods: {
getStoreCenter(){
this.$http.get({
api: 'api/supplier/index',
header: {
token: this.token
}
}).then(res => {
console.log("getStoreCenter", res);
this.detail = res.data.data;
})
},
//
onScanCode(){
uni.scanCode({

167
pages/business/login/login.vue

@ -0,0 +1,167 @@
<template>
<view>
<lf-nav title="商家登录" :showIcon="true" bgColor="#fff"></lf-nav>
<view class="head">
<view class="head-content">
<image class="logo"></image>
<view class="title">欢迎来到金城优选</view>
</view>
</view>
<view class="content">
<view class="list">
<view class="lf-flex">
<view class="lf-font-28 lf-color-black" style="width: 140rpx;">手机号</view>
<input class="input" placeholder="请输入手机号码" v-model="phone" maxlength="11" />
</view>
<view class="clear" v-if="phone.length" @click="phone = ''">
<text class="lf-iconfont icon-status-error"></text>
</view>
</view>
<view class="list">
<view class="lf-flex">
<view class="lf-font-28 lf-color-black" style="width: 140rpx;">密码</view>
<input class="input" placeholder="请输入密码" v-model="password" />
</view>
<view class="clear" v-if="password.length" @click="password = ''">
<text class="lf-iconfont icon-status-error"></text>
</view>
</view>
</view>
<button class="next-btn" hover-class="lf-opacity" @click="next">登录</button>
</view>
</template>
<script>
export default {
data(){
return {
phone: '',
password: ''
}
},
onLoad(){
},
methods: {
next(){
if(!this.phone) return this.$msg('请输入登录手机号');
if(!this.$check(this.phone, 'mobile')) return this.$msg('请输入正确的手机号');
if(!this.password) return this.$msg('请输入密码');
uni.showLoading({
title: '正在登录'
})
this.$http.post({
api: 'api/supplier/login',
data: {
username: this.phone,
password: this.password
}
}).then(res => {
console.log("login", res);
uni.hideLoading();
if(res.data.code != 200){
this.$msg(res.data.data);
}else{
let token = res.data.data.token;
// let expires_in = res.data.data.expires_in || 315360000; //
// this.$cookieStorage.set('store_token', token, expires_in);
this.$cookieStorage.set('store_token', token);
this.$url('/pages/business/center/center', {type: 'redirect'});
}
}).catch(err => uni.hideLoading())
}
}
}
</script>
<style lang="scss" scoped>
.head{
height: 400rpx;
width: 750rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.head-content{
display: flex;
flex-direction: column;
align-items: center;
.logo{
width: 182rpx;
height: 182rpx;
border-radius: 50%;
background-color: #EEEEEE;
}
.title{
font-size: 32rpx;
color: #222222;
font-weight: bold;
font-family: '楷体';
margin-top: 20rpx;
}
}
}
.content{
padding: 0 32rpx;
}
.next-btn{
width: 550rpx;
height: 100rpx;
background: #15716E;
border-radius: 50rpx;
line-height: 100rpx;
color: #FFFFFF;
margin-top: 100rpx;
}
.list{
height: 120rpx;
width: 100%;
border-bottom: 1rpx solid #e5e5e5;
display: flex;
justify-content: space-between;
align-items: center;
.input{
width: 430rpx;
height: 80rpx;
font-size: 28rpx;
}
.input-code{
width: 340rpx;
}
.clear{
padding: 20rpx;
}
.code{
min-width: 180rpx;
max-width: 220rpx;
height: 64rpx;
padding: 0 4rpx;
font-size: 24rpx;
color: #15716E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 32rpx;
border: 2rpx solid #15716E;
}
.active-bg{
background: #efefef;
}
}
.fixed-desc{
position: fixed;
bottom: 50rpx;
left: calc(50% - 343rpx);
width: 686rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
font-size: 28rpx;
color: #777777;
&>text:nth-child(2){
color: #FF9D9D;
}
}
</style>

3
pages/index/index/index.vue

@ -503,7 +503,8 @@
price: item.associate.max_price,
product_id: item.associate.id,
sale: item.associate.sale_count,
title: item.associate.name
title: item.associate.name,
id: item.associate.id
}
});
return new_list;

203
pages/point/shoppingMall/shoppingMall.vue

@ -8,7 +8,7 @@
<view class="left">
<view>
<text class="lf-iconfont icon-jifen"></text>
<text class="point-num">783</text>
<text class="point-num">{{ point.point }}</text>
<text class="lf-iconfont icon-xiangyou lf-font-24"></text>
</view>
<view class="lf-font-24">当前积分</view>
@ -34,15 +34,17 @@
@change="tabChange">
</u-tabs>
</view>
<view class="page-item">
<view class="page-item" v-for="(tab_item, tab_index) in tab_list"
:key="tab_index" v-if="tab_current == tab_index">
<view class="filter">
<view :class="{'filter-item': true, 'filter-active': index == filter_current}"
v-for="(item, index) in filter_list" :key="index"
@click="filter_current = index">{{ item }}
@click="activeFilter(index)">{{ item.name }}
</view>
</view>
<view class="goods">
<lf-waterfall :list="goods_list" goodsType="point"></lf-waterfall>
<view class="goods" v-if="$isRight(tab_list)">
<lf-waterfall :list="tab_list[tab_current].list"></lf-waterfall>
<lf-nocontent src="/static/images/empty.png" v-if="tab_list[tab_current].list.length <= 0"></lf-nocontent>
</view>
</view>
<u-back-top :scrollTop="pageScrollTop"></u-back-top>
@ -56,87 +58,146 @@
lfWaterfall
},
data(){
let _public = {
page: 1,
isPage: true,
loadingClass: true,
loadingText: '正在加载中'
}
return {
tab_current: 0,
tab_list: [{
name: '全部',
list: [],
..._public
tab_list: [],
filter_list: [{
name: '1~100',
point_start: '1',
point_end: '100'
},{
name: '时尚尖货',
list: [],
..._public
name: '100~1万',
point_start: '100',
point_end: '10000'
},{
name: '美容美妆',
list: [],
..._public
name: '1万~2万',
point_start: '10000',
point_end: '20000'
},{
name: '家具用品',
list: [],
..._public
name: '2万~5万',
point_start: '20000',
point_end: '50000'
},{
name: '儿童玩具',
list: [],
..._public
name: '>5万',
point_start: '50000',
point_end: ''
}],
filter_list: ['1~100','100~1万','1万~2万','2万~5万','>5万'],
filter_current: null,
goods_list: [
{
id: 10,
original_price: "4111.00",
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
price: "2412.00",
product_id: 1008,
sale: 0,
title: "AIMER MEN爱慕先生爱慕先生"
},
{
id: 10,
original_price: "4111.00",
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
price: "2412.00",
product_id: 1008,
sale: 0,
title: "AIMER MEN爱慕先生爱慕先生"
},
{
id: 10,
original_price: "4111.00",
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
price: "2412.00",
product_id: 1008,
sale: 0,
title: "AIMER MEN爱慕先生爱慕先生"
},
{
id: 10,
original_price: "4111.00",
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
price: "2412.00",
product_id: 1008,
sale: 0,
title: "AIMER MEN爱慕先生爱慕先生"
}
]
token: '',
point: {point: 0}
}
},
onLoad(){
this.token = this.$cookieStorage.get('user_token');
this.getTotalPoint();
this.getCategoryList();
},
methods: {
getTotalPoint(){
this.$http.get({
api: 'api/users/point',
header: {
Authorization: this.token
}
}).then(res => {
console.log("getTotalPoint", res)
this.point = res.data.data;
});
},
getCategoryList(){
uni.showLoading({
title: '正在获取分类'
})
this.$http.get({
api: 'api/category/list',
header: {
Authorization: this.token
}
}).then(res => {
let list = res.data.data.map(item => {
return {
c_id: item.id,
name: item.name,
list: [],
page: 1,
isPage: true,
loadingClass: true,
loadingText: '正在加载中'
}
})
this.tab_list = list;
uni.hideLoading();
this.getPointList();
}).catch(err => uni.hideLoading())
},
getPointList(){
uni.showLoading({
title: '正在获取商品'
})
let tabItem = this.tab_list[this.tab_current];
let par = {
is_largess: 1,
page: tabItem.page,
c_id: tabItem.c_id
};
if(this.filter_current != null){
let f_item = this.filter_list[this.filter_current];
par.point_start = f_item.point_start;
par.point_end = f_item.point_end;
}
this.$http.get({
api: 'api/store/list',
data: par,
header: {
Authorization: this.token
}
}).then(res => {
let list = res.data.data.map(item => {
return {
id: item.id,
sale: item.sale_count,
picture: item.img,
title: item.name,
store_nums: item.store_nums
}
})
let pagination = res.data.meta.pagination;
tabItem.isPage = pagination.current_page < pagination.total_pages;
if(tabItem.page == 1){
tabItem.list = list;
}else{
tabItem.list.push(...list);
}
uni.hideLoading();
}).catch(err => uni.hideLoading())
},
activeFilter(index){
if(this.filter_current == index){
this.filter_current = null;
}else{
this.filter_current = index;
}
let tabItem = this.tab_list[this.tab_current];
tabItem.page = 1;
tabItem.isPage = true;
tabItem.loadingClass = true;
tabItem.loadingText = '正在加载中';
this.getPointList();
},
tabChange(event){
this.tab_current = event;
if(this.tab_list[event].list.length <= 0){
this.getPointList();
}
}
},
onReachBottom(){
let tabItem = this.tab_list[this.tab_current];
if(tabItem.isPage){
tabItem.page = tabItem.page+1;
this.getPointList();
}else{
this.$msg('没有更多啦~')
}
}
}

49
pages/recharge/balance/balance.vue

@ -19,22 +19,27 @@
<view class="lf-font-32 lf-color-black lf-font-bold">余额变动明细</view>
<picker mode='date' :value="date" @change="dateChange">
<view style="width: 440rpx; text-align: right;">
<text>{{ date || '2021-09-01' }}</text>
<text>{{ date || getDay }}</text>
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text>
</view>
</picker>
</view>
<view class="item" v-for="(item, index) in 10" :key="index">
<view class="item" v-for="(item, index) in list" :key="index">
<view class="lf-row-between">
<text class="lf-font-36 lf-color-black lf-font-bold" :class="{'lf-color-price': index % 2}">{{ index % 2 ? '-250' : '+80' }}</text>
<text class="lf-font-24 lf-color-555">线上-商城内消费</text>
<view class="lf-font-36 lf-color-black lf-font-bold"
:class="{'lf-color-price': item.value < 0}"
style="width: 70%;">{{ item.value }}
</view>
<view class="lf-font-24 lf-color-555">{{ item.note }}</view>
</view>
<view class="lf-row-between lf-m-t-20">
<text class="lf-font-24 lf-color-555">¥374.38</text>
<text class="lf-font-24 lf-color-777">2021-09-01 18:27:58</text>
<view class="lf-font-24 lf-color-555">¥{{ item.current_balance }}</view>
<view class="lf-font-24 lf-color-777">{{ item.created_at }}</view>
</view>
</view>
<lf-nocontent src="/static/images/empty.png" v-if="list.length <= 0"></lf-nocontent>
</view>
<u-back-top :scrollTop="pageScrollTop"></u-back-top>
</view>
</template>
@ -74,6 +79,11 @@
config: ''
}
},
computed: {
getDay(){
return this.$shared.recordTime(new Date(), '-', 'date');
}
},
onLoad(e){
// TODO listdate
//
@ -98,6 +108,11 @@
methods: {
dateChange(event){
this.date = event.detail.value;
this.page = 0;
this.more = true;
this.show = false;
this.showText = '正在加载下一页数据';
this.queryBalanceList();
},
queryBalanceList() {
@ -106,10 +121,16 @@
// type
// } : {};
// params.page = page;
uni.showLoading({
title: '正在获取中'
})
let token = this.token;
let params = {
page: this.page
};
if(this.date){
params.day = this.date;
}
this.$http.get({
api: 'api/users/balance/list',
header: {
@ -121,25 +142,31 @@
res = res.data;
// this.result(res, status);
var page = res.meta.pagination;
this.list = res.data;
this.page = page.current_page;
this.more = page.current_page < page.total_pages;
this.show = false;
console.log("page", page);
if(page.current_page == 1){
this.list = res.data;
}else{
this.list.push(...res.data);
}
console.log("res.data", this.list);
} else {
wx.showModal({
uni.showModal({
title: '提示',
content: '数据请求失败',
success: res => {}
});
}
wx.hideLoading();
uni.hideLoading();
}).catch(rej => {
wx.showToast({
uni.showToast({
title: "请求失败",
image: '../../../static/error.png'
});
wx.hideLoading();
uni.hideLoading();
});
},
//

33
pages/shop/goodsdetail.vue

@ -204,10 +204,10 @@
<!-- 商品信息及关闭按钮 -->
<view class="popup-head">
<view class="lf-flex">
<image class="goods-img" src="https://picsum.photos/200"></image>
<image class="goods-img" :src="goods_detail.img"></image>
<view class="goods-info">
<view class="price">¥5.8</view>
<view class="goods-name">桃子</view>
<view class="price">¥{{ goods.min_price }}</view>
<view class="goods-name">{{ goods.name }}</view>
</view>
</view>
<view @click="show_popup = false">
@ -282,14 +282,19 @@
spec_current: null, //
click_type: null, // [1][2]
type: 'mail', // mailselfpointseckill
time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 13:10:00').getTime()
time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 13:10:00').getTime(),
goods_stock: {
specs: [],
stores: []
}
}
},
onLoad(options){
this.goods_id = options.goods_id;
console.log("options", options)
this.goods_id = options.id;
this.type = options.type || 'mail';
console.log('商品',this.goods_id)
this.getNewdetail();
this.getGoodsStock();
},
computed: {
isRight() {
@ -333,7 +338,11 @@
shoot(type){
// TODO type
this.click_type = type;
this.show_popup = true;
if(this.goods_stock.specs.length){
this.show_popup = true;
}else{
this.confirm();
}
},
activeSpec(index){
if(this.spec_current == index){
@ -391,7 +400,7 @@
},
getNewdetail(){
this.$http.get({
api: '/api/store/detail/'+this.goods_id,
api: 'api/store/detail/'+ this.goods_id,
header: {
Authorization: this.$cookieStorage.get('user_token')
}
@ -405,6 +414,14 @@
console.log("====", err);
})
},
getGoodsStock(){
this.$http.get({
api: `api/store/detail/${this.goods_id}/stock`
}).then(res => {
console.log("getGoodsStock", res);
this.goods_stock = res.data.data;
})
},
//
makePhoneCall(phoneStr){
uni.makePhoneCall({

4
pages/user/my/center.vue

@ -42,9 +42,9 @@
<view class="lf-flex-column">
<view class="lf-font-bold" style="color: #15716E;">
<text class="lf-font-48">VIP</text>
<text class="lf-font-30 lf-m-l-10">预备会员</text>
<text class="lf-font-30 lf-m-l-10">{{ centerInfo.userLevel.name }}</text>
</view>
<view class="lf-font-28" style="color: #15716E;">卡号: 638329</view>
<view class="lf-font-28" style="color: #15716E;">卡号: 666666</view>
</view>
<view class="card-tag">
会员权益

6
pages/user/my/setting.vue

@ -119,6 +119,9 @@
methods: {
//
getMeInfo(){
uni.showLoading({
title: '正在获取资料'
})
this.$http.get({
api: 'api/me',
header: {
@ -126,7 +129,8 @@
}
}).then(res => {
this.userInfo = res.data.data;
})
uni.hideLoading();
}).catch(err => uni.hideLoading())
},
//
changeImage: function() {

Loading…
Cancel
Save