mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-21 10:25:53 +08:00
B2C代码提交
This commit is contained in:
@@ -10,10 +10,12 @@ import { getBaseSite } from "@/api/common.js";
|
||||
export default {
|
||||
name: "App",
|
||||
mounted() {
|
||||
|
||||
this.init();
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
|
||||
if(!storage.getItem("siteName")||!storage.getItem("logoImg")||!storage.getItem("sitelogo_expiration_time")) {
|
||||
this.getSite();
|
||||
}else{
|
||||
@@ -33,6 +35,7 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
getSite(){
|
||||
//获取基本站点信息
|
||||
getBaseSite().then((res) => {
|
||||
|
||||
@@ -10,6 +10,19 @@ export function getVerifyImg (verificationEnums) {
|
||||
needToken: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function getImSetting(params) {
|
||||
return request({
|
||||
url: `/buyer/other/setting/get/IM_SETTING`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 验证码校验
|
||||
*/
|
||||
|
||||
@@ -527,3 +527,44 @@ export function getGoodsDistribution (distributionId) {
|
||||
needToken: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员发票抬头列表
|
||||
*/
|
||||
export function getMemberReceiptList (params) {
|
||||
return request({
|
||||
url: `/buyer/wallet/receipt`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存会员发票抬头
|
||||
*/
|
||||
export function setMemberReceiptList (params) {
|
||||
return request({
|
||||
url: `/buyer/wallet/receipt`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
data:params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存会员发票抬头
|
||||
*/
|
||||
export function delMemberReceipt(id) {
|
||||
return request({
|
||||
url: `/buyer/wallet/receipt/${id}`,
|
||||
method: Method.DELETE,
|
||||
needToken: true,
|
||||
params:{id},
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
</p>
|
||||
<!-- 普通发票 -->
|
||||
<div class="nav-content">
|
||||
<Form :model="invoiceForm" ref="form" label-position="left" :rules="ruleInline" :label-width="110">
|
||||
<Form :model="invoiceForm" ref="form" label-position="left" :label-width="110">
|
||||
<FormItem label="发票类型">
|
||||
<RadioGroup v-model="invoice" type="button" button-style="solid">
|
||||
<Radio @on-change="changeInvoice" :label="1">电子普通发票</Radio>
|
||||
<Radio :label="2" :disabled="true">增值税专用发票</Radio>
|
||||
<Radio :label="2" >增值税专用发票</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="发票抬头">
|
||||
@@ -24,10 +24,46 @@
|
||||
</FormItem>
|
||||
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle">
|
||||
<i-input v-model="invoiceForm.receiptTitle"></i-input>
|
||||
<Poptip ref="poptip" placement="right" width="300">
|
||||
<div class="global_color">选择其他发票抬头</div>
|
||||
<div slot="content">
|
||||
<Spin fix v-if="delReceiptLoad"></Spin>
|
||||
<div class="receipt-content">
|
||||
<div class="flex receipt-item" v-for="item in receiptList" :key="item.id" >
|
||||
<div @click="chooseReceipt(item)">
|
||||
<div class="receipt-title">{{ item.receiptTitle }}</div>
|
||||
<div>{{ item.taxpayerId }}</div>
|
||||
</div>
|
||||
<div class="global_color" @click="delReceipt(item.id)">
|
||||
删除
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<Page :total="total" @on-change="changePage"
|
||||
:current="searchParams.pageNumber" :page-size="searchParams.pageSize" size="small" />
|
||||
</div>
|
||||
</div>
|
||||
</Poptip>
|
||||
</FormItem>
|
||||
<FormItem label="纳税人识别号" v-if="type === 2" prop="taxpayerId">
|
||||
<i-input v-model="invoiceForm.taxpayerId"></i-input>
|
||||
</FormItem>
|
||||
<div v-if="type === 2" class="more" @click="showMore = !showMore">更多选填项</div>
|
||||
<div v-if="showMore">
|
||||
<FormItem label="单位地址" v-if="type === 2" prop="address">
|
||||
<i-input v-model="invoiceForm.address"></i-input>
|
||||
</FormItem>
|
||||
<FormItem label="单位电话" v-if="type === 2" prop="mobile">
|
||||
<i-input v-model="invoiceForm.mobile"></i-input>
|
||||
</FormItem>
|
||||
<FormItem label="开户银行" v-if="type === 2" prop="bank">
|
||||
<i-input v-model="invoiceForm.bank"></i-input>
|
||||
</FormItem>
|
||||
<FormItem label="银行账号" v-if="type === 2" prop="bankNumber">
|
||||
<i-input v-model="invoiceForm.bankNumber"></i-input>
|
||||
</FormItem>
|
||||
</div>
|
||||
<FormItem label="发票内容">
|
||||
<RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid">
|
||||
<Radio label="商品明细">商品明细</Radio>
|
||||
@@ -36,8 +72,10 @@
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div style="text-align: center">
|
||||
<Button type="primary" :loading="loading" @click="submit">保存发票信息</Button>
|
||||
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
||||
|
||||
<Button type="primary" class="mr_10" :loading="loading" @click="submit">保存发票信息</Button>
|
||||
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
@@ -45,11 +83,15 @@
|
||||
</template>
|
||||
<script>
|
||||
import { receiptSelect } from '@/api/cart.js';
|
||||
import { TINumber } from '@/plugins/RegExp.js';
|
||||
import { getMemberReceiptList ,setMemberReceiptList,delMemberReceipt } from '@/api/member.js';
|
||||
|
||||
export default {
|
||||
name: 'invoiceModal',
|
||||
data () {
|
||||
return {
|
||||
receiptList:[],
|
||||
showMore:false,
|
||||
delReceiptLoad:false,
|
||||
invoice: 1, // 发票类型
|
||||
invoiceAvailable: false, // 模态框显隐
|
||||
loading: false, // 提交状态
|
||||
@@ -59,17 +101,36 @@ export default {
|
||||
taxpayerId: '', // 纳税人识别号
|
||||
receiptContent: '商品明细' // 发票内容
|
||||
},
|
||||
isDefault:false,
|
||||
type: 1, // 1 个人 2 单位
|
||||
ruleInline: {
|
||||
taxpayerId: [
|
||||
{ required: true, message: '请填写纳税人识别号' },
|
||||
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
|
||||
]
|
||||
}
|
||||
searchParams:{
|
||||
|
||||
pageNumber:1,
|
||||
pageSize:5
|
||||
},
|
||||
total:0,
|
||||
};
|
||||
},
|
||||
props: ['invoiceData'],
|
||||
watch: {
|
||||
type(val){
|
||||
if(val === 2 && !this.invoiceForm.receiptTitle){
|
||||
// 查找默认的发票抬头
|
||||
const defaultValue = this.receiptList.find(item => item.isDefault === 1)
|
||||
if(!defaultValue){
|
||||
this.invoiceForm.receiptTitle = this.receiptList[0].receiptTitle
|
||||
this.invoiceForm.taxpayerId = this.receiptList[0].taxpayerId
|
||||
}else{
|
||||
this.invoiceForm.receiptTitle = defaultValue.receiptTitle
|
||||
this.invoiceForm.taxpayerId = defaultValue.taxpayerId
|
||||
}
|
||||
}
|
||||
},
|
||||
invoiceAvailable(val){
|
||||
if(val){
|
||||
this.getReceiptList()
|
||||
}
|
||||
},
|
||||
// 回显的发票信息
|
||||
invoiceData: {
|
||||
handler (val) {
|
||||
@@ -85,7 +146,40 @@ export default {
|
||||
immeadite: true
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getReceiptList()
|
||||
},
|
||||
methods: {
|
||||
changePage(v){
|
||||
this.searchParams.pageNumber = v;
|
||||
this.getReceiptList();
|
||||
},
|
||||
getReceiptList () { // 获取抬头列表
|
||||
getMemberReceiptList(this.searchParams).then(res => {
|
||||
if (res.success) {
|
||||
const list = res.result.records;
|
||||
this.receiptList = list;
|
||||
this.total = res.result.total
|
||||
}
|
||||
})
|
||||
},
|
||||
async delReceipt(id){
|
||||
try {
|
||||
this.delReceiptLoad = true
|
||||
const res = await delMemberReceipt(id)
|
||||
this.delReceiptLoad = false
|
||||
if(res.success){
|
||||
if(this.searchParams.pageNumber !==1 && this.total - 1 < this.searchParams.pageNumber * this.searchParams.pageSize){
|
||||
this.searchParams.pageNumber = this.searchParams.pageNumber - 1
|
||||
}
|
||||
this.$Message.success('删除成功')
|
||||
this.getReceiptList()
|
||||
}
|
||||
} catch (error) {
|
||||
this.delReceiptLoad = false
|
||||
}
|
||||
|
||||
},
|
||||
/**
|
||||
* 选择发票抬头
|
||||
*/
|
||||
@@ -94,12 +188,16 @@ export default {
|
||||
this.type = val;
|
||||
});
|
||||
},
|
||||
|
||||
chooseReceipt(val){
|
||||
this.$refs.poptip.visible = false
|
||||
this.invoiceForm.receiptTitle = val.receiptTitle
|
||||
this.invoiceForm.taxpayerId = val.taxpayerId
|
||||
},
|
||||
/**
|
||||
* 保存判断
|
||||
*/
|
||||
save () {
|
||||
let flage = true;
|
||||
let flag = true;
|
||||
|
||||
// 保存分为两种类型,个人以及企业
|
||||
const { receiptTitle } = JSON.parse(
|
||||
@@ -108,31 +206,35 @@ export default {
|
||||
// 判断是否填写发票抬头
|
||||
if (!receiptTitle) {
|
||||
this.$Message.error('请填写发票抬头!');
|
||||
flage = false;
|
||||
flag = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.type === 2) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) {
|
||||
flage = false;
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
delete this.invoiceForm.taxpayerId;
|
||||
}
|
||||
|
||||
return flage;
|
||||
return flag;
|
||||
},
|
||||
// 保存发票信息
|
||||
async submit () {
|
||||
if (this.save()) {
|
||||
this.loading = true;
|
||||
|
||||
let submit = {
|
||||
way: this.$route.query.way,
|
||||
...this.invoiceForm
|
||||
};
|
||||
// 存储到发票列表中
|
||||
await setMemberReceiptList({...submit,isDefault:this.isDefault ? 1 : 0})
|
||||
this.loading = true;
|
||||
let receipt = await receiptSelect(submit);
|
||||
|
||||
if (receipt.success) {
|
||||
this.$emit('change', true);
|
||||
}
|
||||
@@ -156,9 +258,33 @@ export default {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
.global_color{
|
||||
cursor: pointer;
|
||||
}
|
||||
.receipt-item{
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding:8px 16px;
|
||||
cursor: pointer;
|
||||
line-height: 1.5;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
|
||||
.receipt-content{
|
||||
height: 280px;
|
||||
}
|
||||
|
||||
.nav-content {
|
||||
width: 500px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.more{
|
||||
text-align: center;
|
||||
color: $theme_color;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
/deep/ .ivu-input{
|
||||
width: 280px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getIMDetail } from "@/api/common";
|
||||
import { getIMDetail ,getImSetting} from "@/api/common";
|
||||
import Storage from "@/plugins/storage";
|
||||
import { getMemberMsg } from "@/api/login";
|
||||
export default {
|
||||
@@ -40,9 +40,15 @@ export default {
|
||||
},
|
||||
// 获取im信息
|
||||
async getIMDetailMethods() {
|
||||
let res = await getIMDetail();
|
||||
// 获取pc im
|
||||
// let res = await getImSetting();
|
||||
// if (res.success) {
|
||||
// this.IMLink = res.result.qrCode
|
||||
// }
|
||||
let res = await getImSetting();
|
||||
if (res.success) {
|
||||
this.IMLink = res.result;
|
||||
window.open(res.result.url);
|
||||
// this.IMLink = res.result.qrCode;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="store-collect" v-if="!takeDownSale">
|
||||
<span class="mr_10" v-if="goodsMsg.data">
|
||||
</span>
|
||||
<span class="ml_10" @click="IMService(goodsMsg.data.storeId,goodsMsg.data.goodsId,goodsMsg.data.id)">联系客服</span>
|
||||
<span class="ml_10" @click="getIMDetailMethods()">联系客服</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,6 +29,12 @@
|
||||
<Button size="small" @click="target('goodsList')">返回商品列表</Button>
|
||||
</div>
|
||||
</empty>
|
||||
|
||||
<Modal title="扫码联系客服" hide-footer v-model="showQrCode">
|
||||
<div class="img">
|
||||
<img :src="IMLink" alt="">
|
||||
</div>
|
||||
</Modal>
|
||||
<Spin size="large" fix v-if="isLoading"></Spin>
|
||||
<BaseFooter></BaseFooter>
|
||||
</div>
|
||||
@@ -61,16 +67,19 @@ export default {
|
||||
mixins: [imTalk],
|
||||
data () {
|
||||
return {
|
||||
showQrCode:false,
|
||||
goodsMsg: {}, // 商品信息
|
||||
isLoading: false, // 加载状态
|
||||
categoryBar: [], // 分类
|
||||
storeCollected: false, // 商品收藏
|
||||
storeMsg: {}, // 店铺信息
|
||||
takeDownSale:false, // 是否下架
|
||||
|
||||
IMLink:"",
|
||||
// qrCode:""
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 跳转首页或商品页面
|
||||
target(url){
|
||||
this.$router.push({path: url})
|
||||
@@ -223,4 +232,11 @@ export default {
|
||||
margin:10px 0
|
||||
|
||||
}
|
||||
.img{
|
||||
text-align: center;
|
||||
>img{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="btns">
|
||||
<!-- 订单基础操作 -->
|
||||
<Button @click="goDetail(order.sn)" type="info" size="small">售后详情</Button>
|
||||
<Button @click="openModal(order)"
|
||||
@@ -354,4 +354,10 @@ export default {
|
||||
.modal-goods {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.btns{
|
||||
>*{
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="btns">
|
||||
<!-- 订单基础操作 -->
|
||||
<Button @click="orderDetail(order.sn)" type="info" size="small">订单详情</Button>
|
||||
<Button @click="handleCancelOrder(order.sn)" type="error" v-if="order.allowOperationVO.cancel" size="small">取消订单</Button>
|
||||
@@ -382,4 +382,9 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.btns{
|
||||
>*{
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,6 +9,7 @@ Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
imQrCode: '',
|
||||
navList: [], // 首页快捷导航
|
||||
cartNum: storage.getItem('cartNum') || 0,
|
||||
logoImg: storage.getItem('logoImg') || require('@/assets/images/logo2.png'),
|
||||
|
||||
Reference in New Issue
Block a user