# Conflicts:
#	pages/product/goods.vue
master
mabo 2021-07-02 15:49:24 +08:00
commit 3294f12268
10 changed files with 183 additions and 109 deletions

31
App.vue
View File

@ -58,6 +58,10 @@ export default {
this.checkArguments(); //
});
// #endif
// #ifdef MP-WEIXIN
this.applyUpdateWeChat();
// #endif
},
onShow() {
@ -66,6 +70,33 @@ export default {
// #endif
},
methods: {
/**
* 微信小程序版本提交更新版本 解决缓存问题
*/
applyUpdateWeChat() {
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
//
});
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: "更新提示",
content: "发现新版本,是否重启应用?",
success(res) {
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(function (res) {
//
});
},
// TODO 广
launch() {
try {

View File

@ -4,10 +4,10 @@
*/
// 开发环境
const dev = {
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
// common: "http://192.168.0.109:8890",
// buyer: "http://192.168.0.109:8888",
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
common: "http://192.168.0.109:8890",
buyer: "http://192.168.0.109:8888",
};
// 生产环境
const prod = {

View File

@ -8,10 +8,16 @@
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
</u-form-item>
<u-form-item label="身份证" prop="idNumber">
<u-input
v-model="ruleForm.idNumber"
placeholder="请输入身份证号码"
/>
<u-input v-model="ruleForm.idNumber" placeholder="请输入身份证号码" />
</u-form-item>
<u-form-item label="银行开户行" prop="settlementBankBranchName">
<u-input v-model="ruleForm.settlementBankBranchName" type="text" placeholder="请输入银行开户行" />
</u-form-item>
<u-form-item label="银行开户名" prop="settlementBankAccountName">
<u-input v-model="ruleForm.settlementBankAccountName" type="text" placeholder="请输入银行开户名" />
</u-form-item>
<u-form-item label="银行账号" prop="settlementBankAccountNum">
<u-input v-model="ruleForm.settlementBankAccountNum" type="text" placeholder="请输入银行账号" />
</u-form-item>
<!-- <u-form-item label="身份证正面照" prop="name">
<u-upload></u-upload>
@ -35,12 +41,16 @@
</template>
<script>
import { applyDistribution } from "@/api/goods";
import { checkBankno } from "@/utils/Foundation";
export default {
data() {
return {
ruleForm: {
name: "",
idNumber: "",
settlementBankBranchName: "", //
settlementBankAccountName: "", //
settlementBankAccountNum: "", //
},
rules: {
name: [
@ -62,6 +72,50 @@ export default {
trigger: ["change", "blur"],
},
],
//
settlementBankBranchName: [
{
required: true,
message: "银行开户行",
//
trigger: "blur",
},
{
validator: (rule, value, callback) => {
// truefalse
// this.$u.test.mobile()truefalse
return this.$u.test.chinese(value);
},
message: "银行开户行不正确",
// blurchange
trigger: ["change", "blur"],
},
], //
settlementBankAccountName: [
{
required: true,
message: "银行开户名",
//
trigger: "blur",
},
],
//
settlementBankAccountNum: [
{
required: true,
message: "银行账号不正确",
//
trigger: "blur",
},
{
validator: (rule, value, callback) => {
// truefalse
// this.$u.test.mobile()truefalse
return checkBankno(value);
},
message: "银行账号不正确",
},
],
idNumber: [
{
required: true,
@ -96,16 +150,14 @@ export default {
icon: "none",
});
setTimeout(()=>{
setTimeout(() => {
uni.navigateBack();
},500)
}
else{
}, 500);
} else {
uni.showToast({
title: res.data.message,
duration: 2000,
icon:"none"
icon: "none",
});
}
});

View File

@ -57,10 +57,7 @@
applyInfo.refundWay == 'ORIGINAL' ? '原路退回' : '账号退款'
" type="text" input-align="right" :disabled="true" />
</u-form-item>
<view v-if="
applyInfo.accountType === 'BANK_TRANSFER' &&
applyInfo.applyRefundPrice != 0
">
<view >
<u-form-item label="银行开户行" :label-width="150">
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
</u-form-item>
@ -100,7 +97,7 @@ import {
import city from "@/components/m-city/m-city";
import { upload } from "@/api/common.js";
import {checkBankno} from '@/utils/Foundation'
import storage from "@/utils/storage.js";
export default {
component: {
@ -278,6 +275,7 @@ export default {
if (!this.handleCheckParams()) {
return;
}
uni.showLoading({
title: "加载中",
});
@ -297,71 +295,6 @@ export default {
}
});
},
/**
* 验证银行卡号
*/
checkBankno(bankno) {
var lastNum = bankno.substr(bankno.length - 1, 1); //luhm
var first15Num = bankno.substr(0, bankno.length - 1); //1518
var newArr = [];
for (var i = first15Num.length - 1; i > -1; i--) {
//1518
newArr.push(first15Num.substr(i, 1));
}
var arrJiShu = []; //*2 <9
var arrJiShu2 = []; //*2 >9
var arrOuShu = []; //
for (var j = 0; j < newArr.length; j++) {
if ((j + 1) % 2 == 1) {
//
if (parseInt(newArr[j]) * 2 < 9)
arrJiShu.push(parseInt(newArr[j]) * 2);
else arrJiShu2.push(parseInt(newArr[j]) * 2);
} //
else arrOuShu.push(newArr[j]);
}
var jishu_child1 = []; //*2 >9
var jishu_child2 = []; //*2 >9
for (var h = 0; h < arrJiShu2.length; h++) {
jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
}
var sumJiShu = 0; //*2 < 9
var sumOuShu = 0; //
var sumJiShuChild1 = 0; //*2 >9
var sumJiShuChild2 = 0; //*2 >9
var sumTotal = 0;
for (var m = 0; m < arrJiShu.length; m++) {
sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
}
for (var n = 0; n < arrOuShu.length; n++) {
sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
}
for (var p = 0; p < jishu_child1.length; p++) {
sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
}
//
sumTotal =
parseInt(sumJiShu) +
parseInt(sumOuShu) +
parseInt(sumJiShuChild1) +
parseInt(sumJiShuChild2);
//Luhm
var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
var luhm = 10 - k;
if (lastNum == luhm) {
return true;
} else {
return false;
}
},
//
handleCheckParams() {
@ -398,7 +331,7 @@ export default {
type: "error",
});
return false;
} else if (this.checkBankno(this.form.bankAccountNumber) === false) {
} else if (checkBankno(this.form.bankAccountNumber) === false) {
this.$refs.uToast.show({
title: "银行卡卡号不正确",
type: "error",

View File

@ -400,9 +400,9 @@ export default {
return {
title: this.goodsDetail.goodsName,
type: 0,
query:`id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`,
query: `id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`,
path: `/pages/product/goods`,
imageUrl:this.goodsDetail.goodsGalleryList[0],
imageUrl: this.goodsDetail.goodsGalleryList[0],
};
},
// #endif
@ -500,13 +500,14 @@ export default {
return true;
}
},
selectSku (idObj) { // sku
this.init(idObj.skuId,idObj.goodsId)
selectSku(idObj) {
this.init(idObj.skuId, idObj.goodsId);
},
/**
* 初始化信息
*/
async init(id, goodsId, distributionId) {
console.log(id, goodsId);
this.isGroup = false; //
this.productId = id; // skuId
//

View File

@ -27,10 +27,8 @@
</div>
</template>
<script>
import uImage from "@/uview-ui/components/u-image/u-image.vue";
export default {
title: "商品分类以及商品",
components: { uImage },
data() {
return {
selected: {
@ -116,12 +114,9 @@ $w_94: 94%;
margin: 0 auto;
// width: 158px;
width: $w_94;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
overflow: hidden;
> img {
width: 100%;
height: 100%;
@ -135,23 +130,19 @@ $w_94: 94%;
background: #fff;
padding: 8rpx 0 8rpx 8rpx;
margin: 0 auto;
> .goods-title {
font-size: 24rpx;
height: 70rpx;
display: -webkit-box;
font-weight: 500;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
> .goods-bottom {
display: flex;
font-weight: bold;
> .goods-price {
line-height: 2;
color: $main-color;

View File

@ -73,7 +73,10 @@ export default {
distribution().then((res) => {
if (res.data.result) {
let type = res.data.result.distributionStatus;
uni.navigateTo({
url: "/pages/mine/distribution/auth",
});
return
if (type == "PASS") {
uni.navigateTo({
url: "/pages/mine/distribution/home",
@ -91,7 +94,7 @@ export default {
}
} else if (!res.data.success && res.data.code == 22000) {
uni.showToast({
title: '分销功能暂未开启',
title: "分销功能暂未开启",
duration: 2000,
icon: "none",
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -9,6 +9,69 @@
* randomString 随机生成指定长度的字符串
*/
/**
* 验证银行卡号
*/
export function checkBankno(bankno) {
var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位与luhm进行比较
var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
var newArr = [];
for (var i = first15Num.length - 1; i > -1; i--) {
//前15或18位倒序存进数组
newArr.push(first15Num.substr(i, 1));
}
var arrJiShu = []; //奇数位*2的积 <9
var arrJiShu2 = []; //奇数位*2的积 >9
var arrOuShu = []; //偶数位数组
for (var j = 0; j < newArr.length; j++) {
if ((j + 1) % 2 == 1) {
//奇数位
if (parseInt(newArr[j]) * 2 < 9) arrJiShu.push(parseInt(newArr[j]) * 2);
else arrJiShu2.push(parseInt(newArr[j]) * 2);
} //偶数位
else arrOuShu.push(newArr[j]);
}
var jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
var jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
for (var h = 0; h < arrJiShu2.length; h++) {
jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
}
var sumJiShu = 0; //奇数位*2 < 9 的数组之和
var sumOuShu = 0; //偶数位数组之和
var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
var sumTotal = 0;
for (var m = 0; m < arrJiShu.length; m++) {
sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
}
for (var n = 0; n < arrOuShu.length; n++) {
sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
}
for (var p = 0; p < jishu_child1.length; p++) {
sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
}
//计算总和
sumTotal =
parseInt(sumJiShu) +
parseInt(sumOuShu) +
parseInt(sumJiShuChild1) +
parseInt(sumJiShuChild2);
//计算Luhm值
var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
var luhm = 10 - k;
if (lastNum == luhm) {
return true;
} else {
return false;
}
}
/**
* 登录后跳转判断
* 计算出当前router路径
@ -154,12 +217,11 @@ export function countTimeDown(seconds) {
};
}
function navigationToBack(type) {
if (type == "wx") {
// console.log(getCurrentPages().length - 3)
uni.navigateBack({
delta: getCurrentPages().length ,
delta: getCurrentPages().length,
});
} else {
uni.switchTab({
@ -194,4 +256,5 @@ module.exports = {
countTimeDown,
theNextDayTime,
whetherNavigate,
checkBankno,
};