小程序编译0.0.0

This commit is contained in:
魏啾
2024-11-13 09:25:34 +08:00
parent 1fbf346aec
commit 2147f86b93
65 changed files with 3745 additions and 852 deletions

365
pages/merchant/index.vue Normal file
View File

@@ -0,0 +1,365 @@
<template>
<view class="Box">
<navseat :opacity='false' :title='"开发票"' :titleshow='true' :namecolor='"#fff"' iconcolor='#fff'></navseat>
<view class="Box_box_O">
<view class="Box_box flex-between" @click="showpopupclick">
<view>*项目名称</view>
<view class=""
style="width: 60%; overflow:hidden; font-size:32rpx;color:grey;text-overflow: ellipsis;white-space: nowrap; "
v-model="form.article">{{ form.article || '选择项目名称' }}
</view>
</view>
<view class="Box_box flex-between">
<view>*金额</view>
<view><input type="digit" v-model="form.price" @input="handleInputChange" placeholder="请填写金额" /></view>
</view>
<view class="Box_box flex-between">
<view>*数量</view>
<view><input type="number" v-model="form.number" @input="handleInputChange" placeholder="请填写数量"
data-key="mobile" /></view>
</view>
<view class="Box_box flex-between" @click="showpicker = true">
<view class="Box_boxlang Box_box_bouttme_item_O">*发票类型</view>
<view class="Box_box_bouttme_item_T">
<text type="text" v-model="form.type">{{ form.type || '请输入发票类型' }}</text>
</view>
</view>
<view class="Box_box flex-between">
<view>*税额</view>
<view><input type="text" disabled='false' v-model="form.tax_amount" placeholder="请填写税额"
data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>*单价</view>
<view><input type="text" disabled='false' v-model="form.d_price" placeholder="请填写单价"
data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>备注</view>
<u--textarea v-model="form.notes" placeholder="请输入内容"></u--textarea>
</view>
</view>
<view class="preservation flex-colum">
<view class="preservation_box" @tap="$u.throttle(saveMerchantBaseInfoV2, 1000)">提交</view>
</view>
<u-popup :show="showpopup" @close="showpopup = false">
<view class="popupshow">
<view class="popupshowone">请选择项目名称</view>
<view class="popupshowone_item" style=" border-bottom: 1rpx solid #E5E5E5;" v-if="keyword">
<view class="popupshowone_itemone" @click="popupshowone_itemone">
{{keyword}}
</view>
</view>
<view class="popupshowonebotton" @click="businesscategory">搜索其他项目名称</view>
</view>
</u-popup>
<u-picker :show="showpicker" @confirm="showpickerconfirm" :columns="columns"
@cancel="showpicker = false"></u-picker>
</view>
</template>
<script>
import navseat from '@/components/navseat.vue'
export default {
components: {
navseat
},
data() {
return {
keyword: uni.getStorageSync('keyword').name ? uni.getStorageSync('keyword').name : '',
showpopup: false,
showpicker: false,
columns: [
[],
[]
],
Uploadurlnumber: '',
namelang: '',
merchantAuditStatus: '',
form: {
store_id: uni.getStorageSync('userId'),
article: '',
type: '',
price: '',
se_amount: '',
number: '',
tax_amount: '',
d_price: '',
notes: ''
}
};
},
// 删除
onNavigationBarButtonTap() {
uni.pro.navigateTo('index/merchant/order');
},
async onLoad(e) {
// #ifdef APP-PLUS
let webView = this.$mp.page.$getAppWebview();
webView.setTitleNViewButtonStyle(0, {
width: '70px'
});
// #endif
let res = await this.api.storedigitalinvoice()
this.columns = res.data
},
onShow() {
uni.$on('businesscategorys', res => {
console.log(res);
this.form.mcc = res.code;
this.form.article = res.name;
this.keyword = uni.cache.get('keyword')
// this.form.contactLine = res.unionpayCode
// this.form.branchName = res.branchName
});
},
methods: {
showpopupclick() {
this.keyword = uni.getStorageSync('keyword').name ? uni.getStorageSync('keyword').name : ''
this.showpopup = true
},
popupshowone_itemone() {
this.showpopup = false
this.form.article = this.keyword
},
handleInputChange() {
if (this.form.price == null || this.form.price == '') {
return false;
}
if (this.form.number == null || this.form.number == '') {
return false;
}
if (this.form.type == null || this.form.type == '') {
return false;
}
uni.$u.debounce(this.showpickerconfirm(), 1000)
},
async showpickerconfirm(e) {
if (this.form.price == null || this.form.price == '') {
uni.showToast({
title: '请输入开票金额',
icon: 'none'
});
return false;
}
if (this.form.number == null || this.form.number == '') {
uni.showToast({
title: '请输入数量',
icon: 'none'
});
return false;
}
try {
if (e.value) {
if (e.value[1] == "1%") {
this.form.se_amount = 1
} else {
this.form.se_amount = 3
}
this.form.type = e.value.toString();
}
} catch (e) {
//TODO handle the exception
}
let res = await this.api.storese({
amount: this.form.price,
se_amount: this.form.se_amount
})
this.form.tax_amount = res.data.tx
this.form.d_price = res.data.d_amount
this.showpicker = false;
},
businesscategory() {
this.showpopup = false
uni.pro.navigateTo('index/businesscategory');
},
async saveMerchantBaseInfoV2() {
if (this.form.article == null || this.form.article == '') {
uni.showToast({
title: '选择项目名称',
icon: 'none'
});
return false;
}
if (this.form.type == null || this.form.type == '') {
uni.showToast({
title: '请选择类型',
icon: 'none'
});
return false;
}
if (this.form.price == null || this.form.price == '') {
uni.showToast({
title: '请输入开票金额',
icon: 'none'
});
return false;
}
if (this.form.number == null || this.form.number == '') {
uni.showToast({
title: '请输入数量',
icon: 'none'
});
return false;
}
if (this.form.tax_amount == null || this.form.tax_amount == '') {
uni.showToast({
title: '请输入税额',
icon: 'none'
});
return false;
}
if (this.form.d_price == null || this.form.d_price == '') {
uni.showToast({
title: '请输入单价',
icon: 'none'
});
return false;
}
let res = await this.api.storesubinvoicing(this.form)
console.log(res)
this.form = {
store_id: uni.getStorageSync('userId'),
article: '',
type: '',
price: '',
number: '',
tax_amount: '',
d_price: '',
notes: '',
se_amount: ''
}
uni.pro.navigateTo('index/wxinvoicing', res.data.invoice_records)
}
}
};
</script>
<style lang="scss">
page {
background: #fff;
}
.Box {
.Box_box_O {
padding: 0 28rpx;
.Box_box {
text-align: right;
padding: 24rpx;
border-bottom: 1px solid #e5e5e5;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
.Box_box_bouttme_item_T {
padding-left: 30rpx;
flex: 1;
text-align: right;
text {
color: #808080;
}
}
}
.Box_box_T {
padding: 0 28rpx;
border-top: 16rpx solid #e5e5e5;
.Box_box_T_o {
margin-top: 16rpx;
}
.flex-colum {
image {
width: 396rpx;
height: 240rpx;
}
padding-bottom: 16rpx;
border-bottom: 1px solid #e5e5e5;
.Box_box_Ts {
width: 396rpx;
height: 240rpx;
background: #ffffff;
border-radius: 8rpx;
border: 2rpx dashed #707070;
background: url(https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/my2.png) no-repeat;
background-position: 50% 50%;
background-size: 50%;
}
}
}
.preservation {
margin-top: 50rpx;
width: 100%;
.preservation_box {
width: 70%;
height: 72rpx;
background: #288efb;
text-align: center;
line-height: 72rpx;
border-radius: 50rpx;
font-size: 36rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
.popupshow {
width: 100%;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0rpx 0rpx;
padding-bottom: 50rpx;
.popupshowone {
margin-top: 22rpx;
text-align: center;
width: 100%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 32rpx;
color: #333333;
}
.popupshowone_item {
padding: 26rpx 52rpx;
.popupshowone_itemone {
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 36rpx;
color: #333333;
}
}
.popupshowonebotton {
margin: 100rpx auto 0 auto;
width: 558rpx;
height: 84rpx;
background: #288EFB;
border-radius: 50rpx 50rpx 50rpx 50rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 36rpx;
color: #FFFFFF;
line-height: 84rpx;
text-align: center;
padding-bottom: 32rpx;
}
}
}
</style>

View File

@@ -0,0 +1,301 @@
<template>
<view class="Box">
<navseat :opacity='false' :title='"完善商户信息"' :titleshow='true' :namecolor='"#fff"' iconcolor='#fff'></navseat>
<view class="Box_box_O">
<view class="Box_box flex-between">
<view>请填写公司名字</view>
<view class="Box_box_input"><input type="text" :disabled="disabled" v-model="form.title"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>请填写法人姓名</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.legal_person_name"
placeholder="请填写" data-key="mobile" /></view>
</view>
<view class="Box_box flex-between">
<view>请填写法人手机号</view>
<view class="Box_box_input"><input type="text" :disabled='disabled' v-model="form.phone"
placeholder="请填写" data-key="mobile" /></view>
</view>
</view>
<view class="Box_box_T">
<view class="Box_box_T_o">请上传法人身份证图片</view>
<view class="flex-colum" style="width: 100%;">
<view class="Box_box_d" v-if="form.id_card_straight" @click="Upload(0)">
<image :src="form.id_card_straight" mode=""></image>
</view>
<view v-else class="Box_box_Ts" @click="Upload(0)"></view>
</view>
<view class="Box_box_T_o">请上传法人国徽身份证图片</view>
<view class="flex-colum" style="width: 100%;">
<view class="Box_box_d" v-if="form.id_card_reverse" @click="Upload(1)">
<image :src="form.id_card_reverse" mode=""></image>
</view>
<view v-else class="Box_box_Ts" @click="Upload(1)"></view>
</view>
<view class="Box_box_T_o">请拍摄并上传你的营业执照</view>
<view class="flex-colum" style="width: 100%;">
<view class="Box_box_d" v-if="form.business_license" @click="Upload(2)">
<image :src="form.business_license" mode=""></image>
</view>
<view v-else class="Box_box_Ts" @click="Upload(2)"></view>
</view>
</view>
<view class="preservation flex-colum">
<view v-if="form.status == '2'" style="color: #FF2B2B; padding: 28rpx 0;">
({{form.no|| ''}})</view>
<view v-if="disabled" class="preservation_boxs">审核中</view>
<view v-else class="preservation_box" @tap="$u.throttle(saveMerchantBaseInfoV2, 1000)">提交</view>
</view>
</view>
</template>
<script>
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
import navseat from '@/components/navseat.vue'
export default {
components: {
navseat
},
data() {
return {
disabled: true,
Uploadurlnumber: '',
namelang: '',
merchantAuditStatus: '',
form: {
store_id: uni.getStorageSync('userId'),
title: '',
id_card_straight: '',
id_card_reverse: '',
business_license: '',
phone: '',
legal_person_name: '',
no: ''
}
};
},
onLoad(e) {
if (e.status == '0') {
this.disabled = true
} else {
this.disabled = false
}
if (e.phone) {
this.form.store_id = uni.getStorageSync('userId')
this.form.title = e.title
this.form.status = e.status
this.form.id_card_straight = e.id_card_straight
this.form.id_card_reverse = e.id_card_reverse
this.form.business_license = e.business_license
this.form.phone = e.phone
this.form.legal_person_name = e.legal_person_name
this.form.no = e.no
}
},
onShow() {},
methods: {
Upload(i) {
if (this.disabled) {
return false;
} else {
uni.showLoading({
title: '上传中',
mask: true
})
this.Uploadurlnumber = i;
uni.chooseImage({
count: 1, //默认9
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择,和摄像头功能,默认二者都有
success: res => {
var thisimgUrlcaca = res.tempFilePaths[0];
uploadImage(thisimgUrlcaca, 'merchantinformation/',
result => {
//将上传后的图片以对象官方要求的格式的形式存入uni-file-picker的value值imageValueimageValue值的结构为数组包对象用于图片回显
console.log(result)
uni.showToast({
title: '上传成功',
icon: 'none',
success: () => {
}
});
if (this.Uploadurlnumber == 0) {
this.form.id_card_straight = result
} else if (this.Uploadurlnumber == 1) {
this.form.id_card_reverse = result
} else {
this.form.business_license = result
}
uni.hideLoading()
}, result => {
uni.hideLoading()
uni.showToast({
title: result.message || result.msg,
icon: 'none',
});
})
}
});
}
},
async saveMerchantBaseInfoV2() {
if (this.form.title == null || this.form.title == '') {
uni.showToast({
title: '请填写公司名字',
icon: 'none'
});
return false;
}
if (this.form.phone == null || this.form.phone == '') {
uni.showToast({
title: '请填写法人手机号',
icon: 'none'
});
return false;
}
if (this.form.legal_person_name == null || this.form.legal_person_name == '') {
uni.showToast({
title: '请填写法人姓名',
icon: 'none'
});
return false;
}
if (this.form.id_card_straight == null || this.form.id_card_straight == '') {
uni.showToast({
title: '请上传身份证人像面',
icon: 'none'
});
return false;
}
if (this.form.id_card_reverse == null || this.form.id_card_reverse == '') {
uni.showToast({
title: '请上传身份证国徽面',
icon: 'none'
});
return false;
}
if (this.form.business_license == null || this.form.business_license == '') {
uni.showToast({
title: '请上传营业执照',
icon: 'none'
});
return false;
}
// if (/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig
// .test(this.form.alias)) {
// uni.showToast({
// title: '请不要输入Emoji!!!',
// icon: 'none'
// });
// return false;
// }
let res = await this.api.storestoreinfo(this.form)
uni.showToast({
title: res.message || res.msg,
icon: 'none',
success: () => {
uni.hideLoading();
}
});
if (res.code == 1) {
setTimeout(() => {
uni.navigateBack();
}, 2000);
}
}
}
};
</script>
<style lang="scss">
page {
background: #fff;
}
.Box {
.Box_box_O {
padding: 0 28rpx;
.Box_box {
text-align: right;
padding: 24rpx;
border-bottom: 1px solid #e5e5e5;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
.Box_box_input {
width: 60%;
}
}
}
.Box_box_T {
padding: 0 28rpx;
border-top: 16rpx solid #e5e5e5;
.Box_box_T_o {
padding: 28rpx 0;
text-align: center;
}
.flex-colum {
image {
width: 396rpx;
height: 240rpx;
}
padding-bottom: 16rpx;
border-bottom: 1px solid #e5e5e5;
.Box_box_Ts {
width: 396rpx;
height: 240rpx;
background: #ffffff;
border-radius: 8rpx;
border: 2rpx dashed #707070;
background: url(https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/my2.png) no-repeat;
background-position: 50% 50%;
background-size: 50%;
}
}
}
.preservation {
width: 100%;
padding-bottom: 50rpx;
.preservation_box {
width: 70%;
height: 72rpx;
background: #288efb;
text-align: center;
line-height: 72rpx;
border-radius: 50rpx;
font-size: 36rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
.preservation_boxs {
width: 70%;
height: 72rpx;
background: #999999;
text-align: center;
line-height: 72rpx;
border-radius: 50rpx;
font-size: 36rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
}
</style>