chore(电子表单): 修复电子表单的渲染
This commit is contained in:
@@ -72,6 +72,7 @@ export default {
|
||||
//当前页面语言包(同步加载)
|
||||
let route = _this.route;
|
||||
let langPath = processRoutePath(route);
|
||||
console.log(`当前页面语言包路径: ${langPath}`);
|
||||
|
||||
// 加载当前页面语言包
|
||||
let currentPageLang = loadLangPackSync(locale, langPath);
|
||||
@@ -112,7 +113,7 @@ export default {
|
||||
if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field
|
||||
|
||||
// 多语言调试,注释后可以关闭控制台输出
|
||||
// console.log(`字段: ${field}, 值: ${value}`)
|
||||
console.log(`字段: ${field}, 值: ${value}`)
|
||||
return value;
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -149,11 +149,22 @@ export default {
|
||||
return true;
|
||||
}
|
||||
|
||||
// console.log('diy-bottom-nav verify:', { likkUrl: adaptSubpackageUrl(linkUrl), currentPageRoute: currentPageRoute});
|
||||
|
||||
// 精确匹配当前路径
|
||||
if (adaptSubpackageUrl(linkUrl) === currentPageRoute) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 同属于一个子包的路径,也认为是匹配的
|
||||
try {
|
||||
if (adaptSubpackageUrl(linkUrl).split('/')[1] === currentPageRoute.split('/')[1]) {
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('diy-bottom-nav verify error:', error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text class="unit price-style small">{{ $lang('Make') ? $lang('Make') : '咨询' }}</text>
|
||||
<text class="unit price-style small">{{ $lang('Make') ? $lang('Make') : '询价' }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="member-price-tag"
|
||||
@@ -192,7 +192,7 @@
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text class="unit price-style small">{{ $lang('Make') ? $lang('Make') : '咨询' }}</text>
|
||||
<text class="unit price-style small">{{ $lang('Make') ? $lang('Make') : '询价' }}</text>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
|
||||
1
lang/zh-cn/agreement/contenr.js
Normal file
1
lang/zh-cn/agreement/contenr.js
Normal file
@@ -0,0 +1 @@
|
||||
export const lang = {}
|
||||
@@ -1,6 +1,7 @@
|
||||
export const lang = {
|
||||
//title为每个页面的标题
|
||||
title: '商品分类',
|
||||
search:'商品搜索',
|
||||
seeMore : '查看更多'
|
||||
}
|
||||
export const lang = {
|
||||
//title为每个页面的标题
|
||||
title: '商品分类',
|
||||
search:'商品搜索',
|
||||
seeMore : '查看更多',
|
||||
Make: "询价"
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export const lang = {
|
||||
home:'首页',
|
||||
cart:'购物车',
|
||||
leave:'立即留言',
|
||||
make:'立即咨询',
|
||||
make:'电话询价',
|
||||
|
||||
send:'配送',
|
||||
express:'快递发货',
|
||||
@@ -22,7 +22,7 @@ export const lang = {
|
||||
status:'该商品已下架',
|
||||
sellout:'库存不足',
|
||||
max:'已达最大限购数量',
|
||||
makebtn:'咨询',
|
||||
makebtn:'询价',
|
||||
sales:'销量',
|
||||
stock:'库存',
|
||||
kefu:'客服',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export const lang = {
|
||||
//title为每个页面的标题
|
||||
title: '商品列表',
|
||||
Random:'综合',
|
||||
Sales:'销量',
|
||||
Price:'价格',
|
||||
Filter:'筛选',
|
||||
Search:'请输入您要搜索的商品',
|
||||
Make:'咨询',
|
||||
|
||||
}
|
||||
export const lang = {
|
||||
//title为每个页面的标题
|
||||
title: '商品列表',
|
||||
Random:'综合',
|
||||
Sales:'销量',
|
||||
Price:'价格',
|
||||
Filter:'筛选',
|
||||
Search:'请输入您要搜索的商品',
|
||||
Make:'立即询价',
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ export const lang = {
|
||||
readyDelivery: '待发货',
|
||||
waitDelivery: '待收货',
|
||||
refunding: '退款',
|
||||
getDynacode: '获取动态验证码',
|
||||
|
||||
|
||||
// 会员中心入口
|
||||
sign: '签到',
|
||||
personInfo: '个人资料',
|
||||
|
||||
@@ -855,6 +855,14 @@
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "form/formdata",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "weapp/order_shipping",
|
||||
"style": {
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="discount-price" v-else>
|
||||
<text class="price price-style large">{{langstatus?$lang('Make'):'咨询'}}</text>
|
||||
<text class="price price-style large">{{langstatus?$lang('Make'):'询价'}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="discount-price" v-else>
|
||||
<text class="price price-style large">{{langstatus?$lang('Make'):'咨询'}}</text>
|
||||
<text class="price price-style large">{{langstatus?$lang('Make'):'询价'}}</text>
|
||||
</view>
|
||||
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix"></image>
|
||||
@@ -271,6 +271,11 @@
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -294,6 +294,8 @@
|
||||
}
|
||||
|
||||
.lineheight-clear {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
// 商品列表单列样式
|
||||
@@ -386,12 +388,20 @@
|
||||
line-height: 1;
|
||||
margin-top: 16rpx;
|
||||
|
||||
background-color: var(--main-color);
|
||||
border-radius: 35rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.unit {
|
||||
margin-right: 6rpx;
|
||||
color: var(--price-color);
|
||||
}
|
||||
.price {
|
||||
color: var(--price-color);
|
||||
color: #fff !important;
|
||||
font-size: 15rpx !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="discount-price" v-else>
|
||||
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '咨询' }}</text>
|
||||
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '询价' }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="discount-price" v-else>
|
||||
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '咨询' }}</text>
|
||||
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '询价' }}</text>
|
||||
</view>
|
||||
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix"></image>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
165
pages_tool/form/formdata.vue
Normal file
165
pages_tool/form/formdata.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<view>
|
||||
<block v-if="detail">
|
||||
<view class="page">
|
||||
<view class="system-form-wrap">
|
||||
<view class="form-title" style="text-align:center;padding-top:40rpx;font-weight:600;font-size:30rpx;">
|
||||
请填写表单所需信息
|
||||
</view>
|
||||
<ns-newform ref="form" :data="detail.json_data" @submit="create"></ns-newform>
|
||||
<button class="button mini" style="font-size:32rpx;" type="primary" size="mini" @click="create">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll: true,
|
||||
uniacid: 0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.uniacid) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '参数错误',
|
||||
showCancel: false,
|
||||
success: () => {}
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
this.uniacid = options.uniacid
|
||||
this.id = options.id || 0
|
||||
|
||||
if (options.scene) {
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
const params = scene.split('&')
|
||||
params.length && params.forEach(item => {
|
||||
if (item.indexOf('id') != -1) {
|
||||
this.id = item.split('-')[1]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.getData()
|
||||
},
|
||||
watch: {
|
||||
storeToken(newVal, oldVal) {
|
||||
newVal && this.getData()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.form_name
|
||||
})
|
||||
}
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
},
|
||||
fail: () => {
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
}
|
||||
})
|
||||
},
|
||||
create() {
|
||||
if (!this.$refs.form.verify()) return
|
||||
|
||||
if (this.isRepeat) return
|
||||
|
||||
this.isRepeat = true
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(this.$refs.form.formData),
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '提交成功',
|
||||
showCancel: false,
|
||||
success: () => {}
|
||||
})
|
||||
} else {
|
||||
this.isRepeat = false
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.form-banner {
|
||||
width: 100vw;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.form-banner image {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
padding: 0 12rpx;
|
||||
transform: translateY(-40rpx);
|
||||
}
|
||||
|
||||
.system-form-wrap .form-title {
|
||||
line-height: 100rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.system-form-wrap .button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
margin-top: 30rpx !important;
|
||||
width: 84%;
|
||||
margin-left: 28rpx !important;
|
||||
border-radius: 80rpx;
|
||||
background: #f4391c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.system-form-wrap .form-wrap {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user