Browse Source

优化多项

master
邓平艺 4 years ago
parent
commit
8ab3d4d7e3
  1. 2
      components/lf-adModal/lf-adModal.vue
  2. 4
      components/lf-shopGoodsCard/lf-shopGoodsCard.vue
  3. 2
      pages/aboutpay/confirmcash.vue
  4. 11
      pages/business/login/login.vue
  5. 4
      pages/business/order/list.vue
  6. 7
      pages/business/payment/wait.vue
  7. 5
      pages/index/category/category.vue
  8. 32
      pages/order/index/onlineorder.vue
  9. 18
      pages/order/newdetail/newdetail.vue
  10. 65
      pages/shop/goodsdetail.vue
  11. 72
      pages/store/cart/cart.vue

2
components/lf-adModal/lf-adModal.vue

@ -58,6 +58,7 @@
left: 0; left: 0;
top: 0; top: 0;
z-index: 99; z-index: 99;
background-color: rgba(0,0,0,0.5);
.box{ .box{
width: 600rpx; width: 600rpx;
height: max-content; height: max-content;
@ -67,6 +68,7 @@
.img{ .img{
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 5rpx;
} }
} }
.close{ .close{

4
components/lf-shopGoodsCard/lf-shopGoodsCard.vue

@ -14,12 +14,12 @@
<view>{{ item.associate.sell_price }}</view> <view>{{ item.associate.sell_price }}</view>
</view> </view>
</view> </view>
<view class="goods-item" @click="$url('/pages/shop/specialList')">
<!-- <view class="goods-item" @click="$url('/pages/shop/specialList')">
<view class="more-box"> <view class="more-box">
<text>查看更多</text> <text>查看更多</text>
<text class="lf-iconfont icon--2 lf-text-vertical"></text> <text class="lf-iconfont icon--2 lf-text-vertical"></text>
</view> </view>
</view>
</view> -->
</view> </view>
</scroll-view> </scroll-view>
</view> </view>

2
pages/aboutpay/confirmcash.vue

@ -20,7 +20,7 @@
</view> </view>
</template> </template>
</countdown-timer> --> </countdown-timer> -->
<countdown-time minute="5" second="0" :showDay="false" :showHour="false">
<countdown-time minute="2" second="0" :showDay="false" :showHour="false" color="#FF9D9D" splitorColor="#FF9D9D">
</countdown-time> </countdown-time>
</view> </view>

11
pages/business/login/login.vue

@ -3,7 +3,8 @@
<lf-nav title="商家登录" :showIcon="true" bgColor="#fff"></lf-nav> <lf-nav title="商家登录" :showIcon="true" bgColor="#fff"></lf-nav>
<view class="head"> <view class="head">
<view class="head-content"> <view class="head-content">
<image class="logo"></image>
<image class="logo" :src="avatar" v-if="avatar"></image>
<image class="logo" src="../../../static/images/login.png" v-else></image>
<view class="title">欢迎来到金诚优选</view> <view class="title">欢迎来到金诚优选</view>
</view> </view>
</view> </view>
@ -36,11 +37,15 @@
data(){ data(){
return { return {
phone: '', phone: '',
password: ''
password: '',
avatar: ''
} }
}, },
onLoad(){ onLoad(){
let userInfo = this.$cookieStorage.get('user_info');
if(this.$isRight(userInfo)){
this.avatar = userInfo.avatar;
}
}, },
methods: { methods: {
next(){ next(){

4
pages/business/order/list.vue

@ -20,8 +20,8 @@
<view class="info"> <view class="info">
<view class="lf-font-26 lf-color-333 lf-line-2">{{ item.items[0].item_name }}</view> <view class="lf-font-26 lf-color-333 lf-line-2">{{ item.items[0].item_name }}</view>
<view class="lf-row-between" style="line-height: 1;"> <view class="lf-row-between" style="line-height: 1;">
<text class="lf-font-24 lf-color-777">{{ item.payment.amount }}{{ item.items[0].item_meta.specs_text }}</text>
<text class="lf-font-32 lf-font-bold" style="color: #F63434;">¥{{ item.payment.amount_yuan }}</text>
<text class="lf-font-24 lf-color-777">{{ item.count }}{{ item.items[0].item_meta.specs_text }}</text>
<text class="lf-font-32 lf-font-bold" style="color: #F63434;">¥{{ item.payment.amount_yuan || item.total }}</text>
</view> </view>
</view> </view>
</view> </view>

7
pages/business/payment/wait.vue

@ -3,11 +3,18 @@
<lf-nav title="等待用户支付" :showIcon="true" bgColor="#fff"></lf-nav> <lf-nav title="等待用户支付" :showIcon="true" bgColor="#fff"></lf-nav>
<view style="height: 50rpx;"></view> <view style="height: 50rpx;"></view>
<lf-nocontent src="/static/images/empty.png" text="等待用户支付…"></lf-nocontent> <lf-nocontent src="/static/images/empty.png" text="等待用户支付…"></lf-nocontent>
<view class="lf-row-center" style="margin-top: -100rpx;">
<countdown-time minute="2" second="0" :showDay="false" :showHour="false" color="#FF9D9D" splitorColor="#FF9D9D"></countdown-time>
</view>
</view> </view>
</template> </template>
<script> <script>
import countdownTime from '@/components/uni-countdown/uni-countdown.vue';
export default { export default {
components: {
countdownTime
},
data(){ data(){
return { return {
user_id: 0, user_id: 0,

5
pages/index/category/category.vue

@ -21,7 +21,7 @@
<scroll-view @scroll="rightScroll" class="right_view" scroll-y :style="{ height: autoHeight }" :scroll-into-view="'left_' + right_selectIndex" scroll-with-animation> <scroll-view @scroll="rightScroll" class="right_view" scroll-y :style="{ height: autoHeight }" :scroll-into-view="'left_' + right_selectIndex" scroll-with-animation>
<block v-for="(item, index) in dataArr" :key="index"> <block v-for="(item, index) in dataArr" :key="index">
<view :ref="'left_' + index" class="right_item " :id="'left_' + index"> <view :ref="'left_' + index" class="right_item " :id="'left_' + index">
<text class="right_item_title ">{{ item.name }}</text>
<text class="right_item_title" :style="{color: left_selectIndex == index ? '#15716E' : '#555555'}">{{ item.name }}</text>
<view class="right_item_view"> <view class="right_item_view">
<view class="item" v-for="(c_item, c_index) in item.sub_category" :key="c_index" @click="rightTap(c_item)"> <view class="item" v-for="(c_item, c_index) in item.sub_category" :key="c_index" @click="rightTap(c_item)">
<image :src="c_item.image" :style="{ width: '100%', height: subItemW + 'px', background: '#999999' }"></image> <image :src="c_item.image" :style="{ width: '100%', height: subItemW + 'px', background: '#999999' }"></image>
@ -386,7 +386,8 @@
line-height: 49px; line-height: 49px;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #15716E;
color: #555555;
// color: #15716E;
} }
.right_item_view { .right_item_view {
display: grid; display: grid;

32
pages/order/index/onlineorder.vue

@ -12,7 +12,7 @@
<view class="lf-p-30 lf-flex lf-w-100 lf-bg-white lf-m-b-30"> <view class="lf-p-30 lf-flex lf-w-100 lf-bg-white lf-m-b-30">
<!-- <u-icon name="search" class="search-icon"></u-icon> <!-- <u-icon name="search" class="search-icon"></u-icon>
<input class="rom-search" type="text" placeholder="请输入商品名称" /> --> <input class="rom-search" type="text" placeholder="请输入商品名称" /> -->
<u-search placeholder="请输入商品名称" bg-color="#F4F8F8" :show-action="false" style="width: 100%;"></u-search>
<u-search placeholder="请输入商品名称" bg-color="#F4F8F8" :show-action="false" style="width: 100%;" @search="onSearch"></u-search>
</view> </view>
<swiper :style="{height: autoHeight, width: '750rpx'}" :current="current" @change="swiperChange"> <swiper :style="{height: autoHeight, width: '750rpx'}" :current="current" @change="swiperChange">
<swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex"> <swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex">
@ -149,6 +149,7 @@
isPage: true isPage: true
} }
], ],
restore_obj: [],
list: [], list: [],
current: 0, current: 0,
windowHeight: 0, windowHeight: 0,
@ -157,7 +158,8 @@
scrollH: '', scrollH: '',
nav_height: '', nav_height: '',
isRefresher: false, isRefresher: false,
page: 1
page: 1,
criteria: '' //
} }
}, },
computed: { computed: {
@ -171,6 +173,7 @@
onLoad(options){ onLoad(options){
let info = uni.getSystemInfoSync(); let info = uni.getSystemInfoSync();
this.scrollH = info.screenHeight; this.scrollH = info.screenHeight;
this.restore_obj = JSON.parse(JSON.stringify(this.tab_list));
if(typeof options.current != 'undefined'){ if(typeof options.current != 'undefined'){
this.current = Number(options.current) || 0; this.current = Number(options.current) || 0;
this.getData() this.getData()
@ -179,6 +182,13 @@
} }
}, },
methods: { methods: {
//
onSearch(value){
console.log("value", value)
this.criteria = value;
this.tab_list = JSON.parse(JSON.stringify(this.restore_obj));
this.getData();
},
goDetails(type,id) { goDetails(type,id) {
if(type==0) { if(type==0) {
this.$url('/pages/order/newdetail/newdetail?pick_type=0&order_id='+id) this.$url('/pages/order/newdetail/newdetail?pick_type=0&order_id='+id)
@ -246,15 +256,21 @@
getData(options ={}) { getData(options ={}) {
let tab_item = this.tab_list[this.current]; let tab_item = this.tab_list[this.current];
console.log('=====adada===',tab_item) console.log('=====adada===',tab_item)
let par = {
status: tab_item.type,
page: tab_item.page,
type: 0,
channel: ''
}
if(this.criteria){
par.criteria = this.criteria;
}
this.$http this.$http
.get({ .get({
api: 'api/order/list', api: 'api/order/list',
data:{
status: tab_item.type,
page: tab_item.page,
type: 0,
channel: ''
},
data: par,
header: { header: {
Authorization: this.$cookieStorage.get('user_token') Authorization: this.$cookieStorage.get('user_token')
}, },

18
pages/order/newdetail/newdetail.vue

@ -195,7 +195,7 @@
</view> </view>
<view class="lf-flex"> <view class="lf-flex">
<view style="width: 220rpx;"></view> <view style="width: 220rpx;"></view>
<view class="btn-confirm">
<view class="btn-confirm" @click="confirmReceiving">
确认收货 确认收货
</view> </view>
</view> </view>
@ -274,6 +274,22 @@
} }
}, },
methods: { methods: {
//
confirmReceiving(){
this.$http.post({
api: 'api/shopping/order/received',
data: {
order_no: this.order_no
},
header: {
Authorization: this.$cookieStorage.get('user_token')
}
}).then(res => {
this.$msg(res.data.message).then(() => {
this.getOrderDetails();
})
})
},
searchLogistics() { searchLogistics() {
this.$http.get({ this.$http.get({
api: 'api/express/query', api: 'api/express/query',

65
pages/shop/goodsdetail.vue

@ -586,28 +586,34 @@
} }
}).then(res => { }).then(res => {
console.log("===---", res); console.log("===---", res);
let meta = res.data.meta;
let goods_detail = res.data.data;
this.goods_detail = goods_detail;
this.pictures = [res.data.data.img];
this.is_collect = Boolean(res.data.data.is_collect) || false;
let type = 'mail';
if(this.$isRight(goods_detail.is_largess)){
type = 'point';
}
if(this.$isRight(meta.seckill)){
type = 'seckill';
this.seckill = meta.seckill;
let currentDate = this.$shared.recordTime();
this.time = new Date(meta.seckill.ends_at).getTime() - new Date(currentDate).getTime()
}
if(type != 'point'){
this.getBrandDetail(goods_detail.brand_id);
}
if(this.$isRight(meta.discounts)){
this.coupons = meta.discounts.coupons;
if(res.data.status){
let meta = res.data.meta;
let goods_detail = res.data.data;
this.goods_detail = goods_detail;
this.pictures = [res.data.data.img];
this.is_collect = Boolean(res.data.data.is_collect) || false;
let type = 'mail';
if(this.$isRight(goods_detail.is_largess)){
type = 'point';
}
if(this.$isRight(meta.seckill)){
type = 'seckill';
this.seckill = meta.seckill;
let currentDate = this.$shared.recordTime();
this.time = new Date(meta.seckill.ends_at).getTime() - new Date(currentDate).getTime()
}
if(type != 'point'){
this.getBrandDetail(goods_detail.brand_id);
}
if(this.$isRight(meta.discounts)){
this.coupons = meta.discounts.coupons;
}
this.type = type;
}else{
this.$msg(res.data.message || '网络繁忙请稍后再试').then(() => {
this.$toBack();
})
} }
this.type = type;
}).catch(err => { }).catch(err => {
console.log("====", err); console.log("====", err);
}) })
@ -1021,7 +1027,8 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.spec-item{ .spec-item{
width: 142rpx;
min-width: 122rpx;
max-width: max-content;
height: 64rpx; height: 64rpx;
border-radius: 33rpx; border-radius: 33rpx;
border: 2rpx solid #555555; border: 2rpx solid #555555;
@ -1031,12 +1038,14 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-right: 20rpx; margin-right: 20rpx;
&:nth-child(4n){
margin-right: 0rpx;
}
&:nth-child(n+5){
margin-top: 20rpx;
}
margin-bottom: 20rpx;
padding: 0 20rpx;
// &:nth-child(4n){
// margin-right: 0rpx;
// }
// &:nth-child(n+5){
// margin-top: 20rpx;
// }
} }
.spec-active{ .spec-active{
border: none; border: none;

72
pages/store/cart/cart.vue

@ -24,12 +24,29 @@
<u-checkbox shape="circle" active-color="#15716E" @change="goodsCheckChange($event, s_index, g_index)" v-model="g_item.checked"></u-checkbox> <u-checkbox shape="circle" active-color="#15716E" @change="goodsCheckChange($event, s_index, g_index)" v-model="g_item.checked"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view class="lf-m-t-30" style="display: flex;"> <view class="lf-m-t-30" style="display: flex;">
<image class="content-img" :src="g_item.img" mode="widthFix" @click="$url('/pages/shop/goodsdetail?id='+ g_item.com_id)"></image>
<image class="content-img" :src="g_item.img" @click="$url('/pages/shop/goodsdetail?id='+ g_item.com_id)"></image>
<view class="lf-m-l-15 content-info"> <view class="lf-m-l-15 content-info">
<view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">{{g_item.name}}</view>
<view class="lf-font-24 lf-color-777 lf-m-t-14 lf-row-between">
<view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">
<text>{{g_item.name}}</text>
<text class="lf-m-l-10">{{g_item.color ? g_item.color+' ' : ''}}</text>
<text>{{g_item.size ? g_item.size : ''}}</text>
</view>
<!-- <view class="lf-font-24 lf-color-777 lf-m-t-14">
<view>{{g_item.qty ? g_item.qty+'件;' : ''}}{{g_item.color ? g_item.color+';' : ''}}{{g_item.size ? g_item.size : ''}}</view> <view>{{g_item.qty ? g_item.qty+'件;' : ''}}{{g_item.color ? g_item.color+';' : ''}}{{g_item.size ? g_item.size : ''}}</view>
<view class="lf-font-32 lf-color-price">{{ g_item.price }}</view>
</view> -->
<view class="lf-row-between">
<view class="lf-font-32 lf-color-price" style="line-height: 1;">{{ g_item.price }}</view>
<view class="lf-flex">
<view class="num-btn" @click="changeNum('less', s_index, g_index)">
<text class="lf-iconfont icon-jian1 lf-font-30"></text>
</view>
<view>
<input class="input" :value="g_item.qty" :disabled="true" />
</view>
<view class="num-btn lf-text-right" @click="changeNum('add', s_index, g_index)">
<text class="lf-iconfont icon-jia lf-font-30"></text>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -114,6 +131,40 @@
this.getCartList(); this.getCartList();
}, },
methods: { methods: {
//
changeNum(type, parentIndex, childIndex){
let goodsItem = this.list[parentIndex].goods[childIndex];
if(type == 'add'){
if(goodsItem.qty < 10){
goodsItem.qty++;
}else{
return;
}
}else if(type == 'less'){
if(goodsItem.qty > 1){
goodsItem.qty--;
}else{
return;
}
}
let __raw_id = goodsItem.__raw_id;
this.$http.ajax({
api: 'api/shopping/cart/'+ __raw_id,
method: 'PUT',
header: {
Authorization: this.token
},
data: {
attributes: {
qty: goodsItem.qty
}
}
}).then(res => {
if(!res.data.status){
this.$msg('购物车更新失败', {icon: 'error'});
}
})
},
getCartList(){ getCartList(){
this.$http.get({ this.$http.get({
api: 'api/cart', api: 'api/cart',
@ -274,6 +325,9 @@
} }
.content-info{ .content-info{
width: 410rpx; width: 410rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
} }
.online-card { .online-card {
width: 686rpx; width: 686rpx;
@ -288,4 +342,14 @@
margin-bottom: 150rpx; margin-bottom: 150rpx;
} }
} }
.num-btn{
width: 36rpx;
}
.input{
width: 40rpx;
height: 45rpx;
border-radius: 2rpx;
background-color: #F3F8F7;
text-align: center;
}
</style> </style>
Loading…
Cancel
Save