Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
陈轩
9 years ago
Commit
a02e6bebc81c9f428c8b74266760873eb8bd50fb
2 parents
ce1d6664
ae600d18
Merge remote-tracking branch 'origin/feature/home' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
66 additions
and
66 deletions
apps/home/controllers/order.js
apps/home/models/favorite.js
apps/home/models/order.js
config/common.js
public/js/common/vue-filter.js
public/js/home/order-detail.page.js
public/scss/home/_coin.css
public/scss/home/_fav.css
public/vue/component/tool/upload.vue
public/vue/home/order-detail.vue
public/vue/home/order.vue
apps/home/controllers/order.js
View file @
a02e6be
...
...
@@ -127,4 +127,4 @@ const order = {
}
};
module
.
exports
=
order
;
\ No newline at end of file
module
.
exports
=
order
;
...
...
apps/home/models/favorite.js
View file @
a02e6be
...
...
@@ -45,7 +45,7 @@ exports.getFavProductData = (uid, page, limit) => {
title
:
d
.
product_name
,
price
:
'¥'
+
Number
(
Math
.
max
(
d
.
market_price
,
0
)).
toFixed
(
2
),
discountPrice
:
discountPrice
,
sellOut
:
d
.
storage
<
0
,
sellOut
:
d
.
storage
<
=
0
,
invalidGoods
:
d
.
status
===
0
});
});
...
...
apps/home/models/order.js
View file @
a02e6be
...
...
@@ -7,7 +7,7 @@
const
api
=
global
.
yoho
.
API
;
//const serviceAPI = global.yoho.ServiceAPI;
//
const serviceAPI = global.yoho.ServiceAPI;
const
camelCase
=
global
.
yoho
.
camelCase
;
/**
...
...
config/common.js
View file @
a02e6be
...
...
@@ -15,8 +15,8 @@ module.exports = {
port
:
6004
,
siteUrl
:
'//m.yohoblk.com'
,
domains
:
{
api
:
'http://192.168.102.202:8080/gateway/'
,
service
:
'http://192.168.102.202:8080/gateway/'
api
:
'http://devapi.yoho.cn:58078/'
,
service
:
'http://devservice.yoho.cn:58077/'
},
subDomains
:
{
host
:
'.m.yohoblk.com'
,
...
...
public/js/common/vue-filter.js
View file @
a02e6be
...
...
@@ -109,4 +109,4 @@ Vue.filter('convertTime', (value) => {
let
s
=
date
.
getSeconds
();
return
Y
+
M
+
D
+
h
+
m
+
s
;
});
\ No newline at end of file
});
...
...
public/js/home/order-detail.page.js
View file @
a02e6be
...
...
@@ -18,4 +18,4 @@ new Vue({
components
:
{
OrderDetail
}
});
\ No newline at end of file
});
...
...
public/scss/home/_coin.css
View file @
a02e6be
...
...
@@ -43,6 +43,7 @@
border-bottom
:
0
none
;
}
}
.coin-source
{
flex
:
1
;
...
...
public/scss/home/_fav.css
View file @
a02e6be
...
...
@@ -167,7 +167,7 @@
width
:
35px
;
height
:
35px
;
margin-right
:
15px
;
margin-top
:
35
px
;
margin-top
:
50
px
;
background
:
resolve
(
"home/fav/fav-del.png"
);
background-size
:
100%
;
}
...
...
public/vue/component/tool/upload.vue
View file @
a02e6be
<template>
<div class="upload">
<form v-on:change="upload">
<form v-
el:form v-
on:change="upload">
<label class="label-input icon" for="{{inputId}}">
<input id="{{inputId}}" type="file" name="filename">
</label>
...
...
@@ -18,7 +18,7 @@
},
methods: {
upload(e) {
const formData = new FormData(
e.target.closest('form')
);
const formData = new FormData(
this.$els.form
);
formData.append('bucket', this.bucket || '');
$.ajax({
...
...
public/vue/home/order-detail.vue
View file @
a02e6be
...
...
@@ -54,39 +54,34 @@
const $ = require('yoho-jquery');
const tip = require('common/tip');
const modal = require('common/modal');
const overlay = require('common/overlay');
const Modal = require('common/modal');
module.exports = {
data() {
return {
order:{}
order:
{}
};
},
ready(){
ready()
{
this.getOrderData();
},
methods:{
getOrderData(){
// let _that = this;
methods: {
getOrderData() {
$.ajax({
url: '/home/get-order',
data: {
orderCode: this.$parent.$data.orderCode
}
}).then(result => {
if
(result)
{
if
(result)
{
this.$set('order', result.data);
//_that.orderList = result.data.orderList;
} else {
}
}).fail(() => {
tip('网络错误');
});
},
cancelOrder(code){
$.modal.confirm('', '订单取消后不能恢复,确认取消订单吗?', function() {
cancelOrder(code) {
Modal.confirm('订单取消后不能恢复,确认取消订单吗?', '', function() {
$.ajax({
url: '/home/cancel-order',
type: 'post',
...
...
@@ -94,18 +89,18 @@
orderCode: code
}
}).then(result => {
if
(result.code === 200 )
{
if
(result.code === 200)
{
location.href = '/home/orders';
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
tip('操作失敗');
});
});
},
deleteOrder(code){
$.modal.confirm('', '确认删除订单?', function() {
deleteOrder(code) {
Modal.confirm('确认删除订单?', '', function() {
$.ajax({
url: '/home/delete-order',
type: 'post',
...
...
@@ -113,17 +108,17 @@
orderCode: code
}
}).then(result => {
if
(result.code === 200 )
{
if
(result.code === 200)
{
location.href = '/home/orders';
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
tip('操作失敗');
});
});
},
confirmGoods(code){
confirmGoods(code)
{
$.ajax({
url: '/home/confirm-order',
type: 'post',
...
...
@@ -131,20 +126,20 @@
orderCode: code
}
}).then(result => {
if
(result.code === 200 )
{
if
(result.code === 200)
{
location.reload();
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
tip('操作失敗');
});
},
goBuy(){
goBuy() {
location.href = '';
},
see(){
seeExpress() {
location.href = '';
}
}
};
...
...
public/vue/home/order.vue
View file @
a02e6be
...
...
@@ -46,8 +46,7 @@
const $ = require('yoho-jquery');
const tip = require('common/tip');
const modal = require('common/modal');
const overlay = require('common/overlay');
const Modal = require('common/modal');
module.exports = {
data() {
...
...
@@ -59,40 +58,40 @@
busy: false,
};
},
ready(){
ready() {
this.getOrderData();
},
methods:{
getOrderData(){
methods: {
getOrderData() {
let _that = this;
this.busy = true;
$.ajax({
url: '/home/get-orders',
data: {
page : ++ this.page,
limit : this.limit,
page: ++this.page,
limit: this.limit,
type: this.type
}
}).then(result => {
if
(result.code === 200)
{
if
(result.code === 200)
{
if (result.isend) {
_that.busy = true;
} else {
_that.busy = false;
}
if
(result.data.orderList.length > 0)
{
if
(result.data.orderList.length > 0)
{
this.$set('orderList', result.data.orderList);
//_that.orderList = result.data.orderList;
} else {
}
}
}).fail(() => {
tip('网络错误');
});
},
cancelOrder(code){
$.modal.confirm('', '订单取消后不能恢复,确认取消订单吗?', function() {
cancelOrder(code) {
Modal.confirm('订单取消后不能恢复,确认取消订单吗?', '', function() {
$.ajax({
url: '/home/cancel-order',
type: 'post',
...
...
@@ -100,7 +99,7 @@
orderCode: code
}
}).then(result => {
if
(result.code === 200 )
{
if
(result.code === 200)
{
location.reload();
} else {
tip(result.message);
...
...
@@ -110,9 +109,10 @@
});
});
},
deleteOrder(order, index){
var that = this;
$.modal.confirm('', '确认删除订单?', function() {
deleteOrder(order, index) {
let that = this;
Modal.confirm('确认删除订单?', '', function() {
$.ajax({
url: '/home/delete-order',
type: 'post',
...
...
@@ -120,9 +120,8 @@
orderCode: order.orderCode
}
}).then(result => {
if(result.code === 200 ){
//location.reload();
that.$el.querySelectorAll('.order-item')[index].remove()
if (result.code === 200) {
that.$el.querySelectorAll('.order-item')[index].remove();
} else {
tip(result.message);
}
...
...
@@ -131,7 +130,7 @@
});
});
},
confirmGoods(code){
confirmGoods(code)
{
$.ajax({
url: '/home/confirm-order',
type: 'post',
...
...
@@ -139,20 +138,20 @@
orderCode: code
}
}).then(result => {
if
(result.code === 200 )
{
if
(result.code === 200)
{
location.reload();
} else {
tip(result.message);
}
}).fail(() => {
tip('操作失敗');
tip('操作失敗');
});
},
goBuy(){
goBuy() {
location.href = '';
},
see(){
seeExpress() {
location.href = '';
}
}
};
...
...
@@ -160,15 +159,20 @@
</script>
<style>
html,body{height:100%;}
html,
body {
height: 100%;
}
@import "../../scss/home/_order.css";
.order-wrapper {
height: 100%;
ul {
height: 100%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
@import "../../scss/home/_order.css";
</style>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment