Commit 7d5c4642 by 肖康

x

parent c6297b57
Showing with 236 additions and 37 deletions
......@@ -91,7 +91,7 @@ export const apis = {
*/
customsrService: productionUrlApi + 'public/customsrservice',
/**
* 获取php常量
* 获取php常量客服qq
*/
getCommonParams: productionUrl + 'getcommonparams',
/**
......@@ -406,6 +406,8 @@ export const apis = {
ucouponLists: productionUrlApi + '/ucoupon/lists',
/***订单列表**/
orderLists: productionUrlApi + 'order/lists',
/**再次购买***/
rebuy: productionUrlApi + 'cart/rebuy',
/***下载订单合同检测**/
checkPdf: productionUrlApi + '/contract/checkPdf',
/***提醒发货**/
......@@ -710,6 +712,10 @@ export const services = {
orderLists(params) {
return axios.post(apis.orderLists, params)
},
rebuy(params) {
return axios.post(apis.rebuy, params)
},
checkPdf(params) {
return axios.post(apis.checkPdf, params)
},
......@@ -723,6 +729,9 @@ export const services = {
return axios.post(apis.orderCancel, params)
},
unbindPhone(params) {
return axios.post(apis.unbindPhone, params)
},
......
......@@ -223,8 +223,15 @@
bottom:0;
left:0;
right:0;
background: rgba(0,0,0,0.4);
z-index: 5;
.mask{
background: rgba(0,0,0,0.4);
position: fixed;
top:0;
bottom:0;
left:0;
right:0;
}
.type1{
width: 7.47rem;
padding-top:1.52rem;
......@@ -234,10 +241,11 @@
margin:0 auto;
position: relative;
top:50%;
margin-top: -3.35rem;
margin-top:-3.33rem;
text-align: center;
i{font-size: 55px;color:#52c41a;display: block;margin-bottom: 0.64rem;}
p{font-size: 14px;color:#333;line-height: 30px;}
.foot-box{
border-top: 1px solid #e5e5e5;
padding:0.24rem 0;
......@@ -261,5 +269,34 @@
}
}
}
.type2{
top:4.5rem;
margin-top:0px;
padding-top: 0.73rem;
i{margin-bottom: 0.44rem;}
.t-hp{
font-size: 12px;
.f-red{color:#F44949;}
}
.t-list{
width: 6.88rem;
background: #F9F9F9;
border: 1px solid #E5E5E5;
border-bottom:0px;
margin:0 auto;
margin-top: 0.35rem;
a{
display: block;
color:#333;
padding: 0.18rem 0.39rem;
text-align: left;
border-bottom:1px solid #e5e5e5;
}
}
}
.type3{
i{color:#e14e4e;}
}
}
}
\ No newline at end of file
import Vue from 'vue'
import { services as Services, productionUrlApi } from '../../../api/index'
import { Dialog, Toast } from 'vant'
import Util from "../../../util"
Vue.use(Dialog);
var qs = require('qs');
......@@ -11,7 +12,8 @@ const state = {
lists: {},
currentList: [],
pdf: "",
isUpdateList:false
isUpdateList: false,
againBuy:{totla:0,isShow:0,data:[]}
}
const mutations = {
......@@ -22,8 +24,43 @@ const mutations = {
}
const actions = {
//取消订单
orderCancel({ commit }, payload) {
//再次购买
rebuy({ commit }, payload) {
state.loading = true;
var params = {
id: payload.order_id
}
Services.rebuy(qs.stringify(params)).then((res) => {
state.loading = false;
if (res.data.err_code == 0) {
var total = Number(res.data.data.count)
var sucCount = Number(res.data.data.success)
if (total == sucCount) {
//全部购买成功
this.againBuy.isShow=1
return
}
if (sucCount == 0) {
//全部购买失败
this.againBuy.isShow=3
return
}
this.againBuy.isShow=2;
this.againBuy.data=res.data.data.fail;
this.againBuy.total=total
}
}).catch(function (err) {
state.loading = false;
});
},
//取消订单
orderCancel({ commit }, payload) {
state.loading = true;
var params = {
id: payload.order_id
......@@ -31,10 +68,10 @@ const actions = {
Services.orderCancel(qs.stringify(params)).then((res) => {
state.loading = false;
Toast(res.data.err_msg)
if(res.data.err_code==0){
state.isUpdateList=true
if (res.data.err_code == 0) {
state.isUpdateList = true
}
}).catch(function (err) {
state.loading = false;
});
......@@ -50,8 +87,8 @@ const actions = {
Services.sureSend(qs.stringify(params)).then((res) => {
state.loading = false;
Toast(res.data.err_msg)
if(res.data.err_code==0){
state.isUpdateList=true
if (res.data.err_code == 0) {
state.isUpdateList = true
}
}).catch(function (err) {
state.loading = false;
......@@ -83,7 +120,7 @@ const actions = {
}
Services.checkPdf(qs.stringify(params)).then((res) => {
state.loading = false;
if (res.data.err_code == 0) {
//可以下载
window.location.href = productionUrlApi + "contract/pdf?id=" + payload.id + "&pf=" + lxpf;
......@@ -132,7 +169,7 @@ const actions = {
Services.orderLists(qs.stringify(params)).then((res) => {
let data = res.data;
state.loading = false;
state.isUpdateList=false
state.isUpdateList = false
commit("orderLists", {
data: data.data.list || [],
status: payload.status,
......
......@@ -13,7 +13,7 @@
<input type="text" v-model="order_sn" />
</div>
<div class="shift fl" @click="shift">筛选</div>
<i class="icon iconfont fr order-kf">&#xe640;</i>
<a :href="phpParams.kfqq_xk"><i class="icon iconfont fr order-kf">&#xe640;</i></a>
</div>
<div class="o-tabnav">
<van-tabs :active="tab" :line-width="lineWidth" @change="tabChange">
......@@ -51,10 +51,11 @@
</div>
<div class="btn-boxs clr">
<div class="btn fr" @click="nowPay(item.order_id)" v-if="item.status==2||item.status==3">立即支付</div>
<div class="btn fr" v-if="item.status==10||item.status==-1">再次购买</div>
<div class="btn fr" v-if="item.status==10||item.status==-1" @click="rebuy(item.order_id)">再次购买</div>
<div class="btn fr" v-if="item.status==4" @click="sendTip(item.order_sn,item.user_id)">提醒发货</div>
<div class="btn btn-lk fr" @click="downpd(item.order_id)" v-if="item.status!=1">下载合同</div>
<div class="btn fr btn-default" v-if="item.status==7||item.status==8||item.status==10" @click="ship(item.order_id)" >查看物流</div>
<div class="btn fr btn-default" v-if="item.status==7||item.status==8||item.status==10"
@click="ship(item.order_id)">查看物流</div>
<div class="btn fr btn-default" v-if="item.status==2||item.status==1"
@click="cancelOrder(item.order_id)">取消订单</div>
<div class="btn fr" v-if="item.status==8" @click="sureSend(item.order_id)">确认收货</div>
......@@ -98,15 +99,44 @@
</div>
</div>
</div>
<div class="again-box">
<div class="again-box" v-show="isMask==1">
<div class="mask"></div>
<div class="type1">
<i class="icon iconfont" @click="submitShift">&#xe641;</i>
<p>全部商品添加购物车成功</p>
<p>您可前往购物车结算~</p>
<div class="foot-box clr">
<a class="btn fl">联系客服确认</a>
<a class="btn carlink fl" href="/h5/view/#/joincart">前往购物车</a>
</div>
<i class="icon iconfont" @click="submitShift">&#xe641;</i>
<p>全部商品添加购物车成功</p>
<p>您可前往购物车结算~</p>
<div class="foot-box clr">
<a class="btn fl" :href="phpParams.kfqq_xk">联系客服确认</a>
<a class="btn carlink fl" href="/h5/view/#/joincart">前往购物车</a>
</div>
</div>
</div>
<div class="again-box" v-show="isMask==2">
<div class="mask" @click="isMaskShow"></div>
<div class="type1 type2">
<i class="icon iconfont">&#xe641;</i>
<p>{{againBuy.total}}个商品添加购物车成功!</p>
<div class="t-hp">以下商品暂时<span class="f-red">库存不足</span> ,请联系客服确定库存价格</div>
<div class="t-list" v-for="item in againBuy.data">
<a :href="'https://m.ichunt.com/goods_'+item.goods_id+'.html'" v-if="item.goods_type == 1 || item.goods_type == 2 ">{{item.goods_name}}</a>
<a :href="'https://m.ichunt.com/item/'+item.goods_id+'.html'" v-else>{{item.goods_name}}</a>
</div>
<div class="foot-box clr">
<a class="btn fl" href="/h5/view/#/joincart">前往购物车</a>
<a class="btn fl carlink" :href="phpParams.kfqq_xk">联系客服确认</a>
</div>
</div>
</div>
<div class="again-box" v-show="isMask==3">
<div class="mask" @click="isMaskShow"></div>
<div class="type1 type3">
<i class="icon iconfont">&#xe645;</i>
<p>非常抱歉当前订单商品暂无库存</p>
<p>请联系客服找料!</p>
<div class="foot-box clr">
<a class="btn fl" href="/h5/view/#/joincart">前往购物车</a>
<a class="btn fl carlink" :href="phpParams.kfqq_xk">联系客服确认</a>
</div>
</div>
</div>
<van-loading type="spinner" color="#000" class="loading-background" v-if="loading" />
......@@ -148,6 +178,7 @@
pickerTimeVal: new Date(),
isPopShow: false, // 弹出层隐藏与显示
copyOrderSn: "", //复制订单号
isMask: 0,
allOrderArr: {
"全部订单": 0,
"待审核": 1,
......@@ -167,6 +198,9 @@
lists: state => state.userOrder.lists,
currentList: state => state.userOrder.currentList,
isUpdateList: state => state.userOrder.isUpdateList,
phpParams: state => state.common.phpParams,
againBuy: state => state.userOrder.againBuy,
}),
listenChange() {
const {
......@@ -188,10 +222,18 @@
this.tabUi();
this.getData()
},
isUpdateList(val){
if(val){
this.isGet=true
this.getData()
againBuy: {
handler(newVal, oldVal) {
this.isShow=newVal.isShow
},
immediate: true,
deep:true
},
isUpdateList(val) {
if (val) {
this.isGet = true
this.getData()
}
},
currentList(item) {
......@@ -204,7 +246,10 @@
},
created() {
this.tabUi();
this.getData()
this.getData();
this.$store.dispatch({
type: "getCommonParams"
})
},
methods: {
tabUi() {
......@@ -245,6 +290,17 @@
Toast('复制成功');
})
},
isMaskShow() {
this.isMask = 0
},
//再次购买
rebuy(order_id) {
var datap = {
type: 'rebuy',
order_id: order_id
}
this.$store.dispatch(datap)
},
//立即支付
nowPay(order_id) {
if (isMiniProgram) {
......@@ -285,16 +341,16 @@
},
//取消订单
cancelOrder(order_id,status) {
cancelOrder(order_id, status) {
var datap = {
type: 'orderCancel',
order_id: order_id,
status:status
status: status
}
this.$store.dispatch(datap)
},
//查看物流
ship(order_id){
ship(order_id) {
this.$router.push({
path: '/Usershipping',
query: {
......@@ -304,11 +360,22 @@
},
//确认收货
sureSend(order_id) {
var datap = {
type: 'sureSend',
order_id: order_id,
}
this.$store.dispatch(datap)
Dialog.confirm({
message: '您要确认收货吗?',
})
.then(() => {
// on confirm
var datap = {
type: 'sureSend',
order_id: order_id,
}
this.$store.dispatch(datap)
})
.catch(() => {
// on cancel
});
},
submitShift() {
this.shiftIsShow = false;
......
{"h":"7ea11976761de1aeea45","c":{"39":true}}
\ No newline at end of file
{"h":"ca31247b28769da5a533","c":{"39":true}}
\ No newline at end of file
{"h":"2dfdba8b602773b4154c","c":{"39":true}}
\ No newline at end of file
{"h":"04ac8d511d2821cd2391","c":{"39":true}}
\ No newline at end of file
{"h":"a6d8edec7e9fdd61c966","c":{"39":true}}
\ No newline at end of file
{"h":"43bb20a001049b16aa2e","c":{}}
\ No newline at end of file
{"h":"c426aa64e14f623667b0","c":{"39":true}}
\ No newline at end of file
{"h":"1b3516eef00af69e3b64","c":{"39":true}}
\ No newline at end of file
{"h":"10d0d65009fb8c862330","c":{"39":true}}
\ No newline at end of file
{"h":"1922e330c926bde08d1b","c":{"39":true}}
\ No newline at end of file
{"h":"776d5452d58996ea60b4","c":{"39":true}}
\ No newline at end of file
{"h":"53c93e59adf81fd06e68","c":{"39":true}}
\ No newline at end of file
{"h":"8fd727c6c23024b177f8","c":{"39":true}}
\ No newline at end of file
{"h":"3154f4a6c2e7ab6b9df8","c":{"39":true}}
\ No newline at end of file
{"h":"c43104fe41a3bba2b211","c":{"39":true}}
\ No newline at end of file
{"h":"834a4cf192d1c3eec809","c":{"39":true}}
\ No newline at end of file
{"h":"4e708a59d07b0c0bc5a8","c":{"39":true}}
\ No newline at end of file
{"h":"0a37fda3385586887b1e","c":{"39":true}}
\ No newline at end of file
{"h":"2d2c530ec2351520681c","c":{"39":true}}
\ No newline at end of file
{"h":"9d0eca6802858b3a29c9","c":{}}
\ No newline at end of file
{"h":"0b112ecdf1ec8d932870","c":{"39":true}}
\ No newline at end of file
{"h":"3328810d55928d0e2c90","c":{"39":true}}
\ No newline at end of file
{"h":"bee8639a25f84e570cd4","c":{"39":true}}
\ No newline at end of file
{"h":"491e667ed4114f026afe","c":{"39":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
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 sign in to comment