Merge branch 'dev' into test

This commit is contained in:
lifizer
2024-07-30 14:17:05 +08:00
5 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ export default {
this.upload_exceeded_list.push(i === 0 ? 1 : i + 1); this.upload_exceeded_list.push(i === 0 ? 1 : i + 1);
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: `第${[...new Set(this.upload_exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`, content: `图片超出限制${this.upload_max}MB,已过滤`,
showCancel: false, showCancel: false,
confirmText: '确认', confirmText: '确认',
success(res) { success(res) {
+17 -15
View File
@@ -47,30 +47,32 @@ Vue.prototype.$validator = function (rule) {
// cookie.set(CACHE_KEY, 1); // cookie.set(CACHE_KEY, 1);
// } // }
// 强制转为几位小数,不足的补0 // 强制转为几位小数,不足的补0
var forceToDecimal = function changeToDecimal(x, len, ignore = false) { const forceToDecimal = function changeToDecimal(value, len = 1) {
var f_x = parseFloat(x); const f_x = parseFloat(value)
if (isNaN(f_x)) { if (isNaN(f_x)) {
return 0; return 0
} }
var f = Math.round(f_x * 100) / 100; let s = f_x.toString()
if (ignore) { let rs = s.indexOf('.')
f = Math.floor(f_x * 100) / 100;
}
var s = f.toString();
var rs = s.indexOf('.');
if (rs < 0) { if (rs < 0) {
rs = s.length; rs = s.length
s += '.'; s += '.'
} }
while (s.length <= rs + len) { while (s.length <= rs + len) {
s += '0'; s += '0'
} }
return s; const tempArr = s.split('.')
const decimalArr = tempArr[1].split('')
let res = tempArr[0] + '.'
for (let i = 0; i < len; i++) {
res += decimalArr[i]
}
return res
} }
// 强制转为2位小数,不足的补0 // 强制转为2位小数,不足的补0
var force2Decimal = function change2Decimal(x, ignore = false) { const force2Decimal = function change2Decimal(value) {
return forceToDecimal(x, 2, false); return forceToDecimal(value, 2)
} }
Vue.prototype.$force2Decimal = force2Decimal Vue.prototype.$force2Decimal = force2Decimal
+2 -2
View File
@@ -757,8 +757,8 @@ export default {
_this.isLike = data.zanVo !== null _this.isLike = data.zanVo !== null
_this.isFavorite = data.hasFavorite _this.isFavorite = data.hasFavorite
_this.favoriteCount = data.favoriteCount _this.favoriteCount = data.favoriteCount
_this.inn.latitude = _this.inn.latitude ? parseFloat(_this.inn.latitude) : 24.993587 _this.inn.latitude = _this.inn.latitude > 0 ? _this.inn.latitude : 24.993587
_this.inn.longitude = _this.inn.longitude ? parseFloat(_this.inn.longitude) : 102.779656 _this.inn.longitude = _this.inn.longitude > 0 ? _this.inn.longitude : 102.779656
// fix bug#1107 // fix bug#1107
if (!_this.isLoad) { if (!_this.isLoad) {
// 该店铺无商品则不显示“精选商品” // 该店铺无商品则不显示“精选商品”
+1
View File
@@ -27,6 +27,7 @@
</template> </template>
<script> <script>
// 景点门票
import {getProducts} from "@/api/store"; import {getProducts} from "@/api/store";
export default { export default {
+1
View File
@@ -36,6 +36,7 @@
</template> </template>
<script> <script>
// 尖货推荐
import {getSharpList, sharpBannar} from "@/api/goods"; import {getSharpList, sharpBannar} from "@/api/goods";
export default { export default {