# 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(); // this.checkArguments(); //
}); });
// #endif // #endif
// #ifdef MP-WEIXIN
this.applyUpdateWeChat();
// #endif
}, },
onShow() { onShow() {
@ -66,6 +70,33 @@ export default {
// #endif // #endif
}, },
methods: { 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 广 // TODO 广
launch() { launch() {
try { try {

View File

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

View File

@ -8,10 +8,16 @@
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" /> <u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
</u-form-item> </u-form-item>
<u-form-item label="身份证" prop="idNumber"> <u-form-item label="身份证" prop="idNumber">
<u-input <u-input v-model="ruleForm.idNumber" placeholder="请输入身份证号码" />
v-model="ruleForm.idNumber" </u-form-item>
placeholder="请输入身份证号码" <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>
<!-- <u-form-item label="身份证正面照" prop="name"> <!-- <u-form-item label="身份证正面照" prop="name">
<u-upload></u-upload> <u-upload></u-upload>
@ -23,7 +29,7 @@
<u-upload></u-upload> <u-upload></u-upload>
</u-form-item> --> </u-form-item> -->
</u-form> </u-form>
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit"></u-button> <u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit"></u-button>
</view> </view>
</view> </view>
@ -35,12 +41,16 @@
</template> </template>
<script> <script>
import { applyDistribution } from "@/api/goods"; import { applyDistribution } from "@/api/goods";
import { checkBankno } from "@/utils/Foundation";
export default { export default {
data() { data() {
return { return {
ruleForm: { ruleForm: {
name: "", name: "",
idNumber: "", idNumber: "",
settlementBankBranchName: "", //
settlementBankAccountName: "", //
settlementBankAccountNum: "", //
}, },
rules: { rules: {
name: [ name: [
@ -62,6 +72,50 @@ export default {
trigger: ["change", "blur"], 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: [ idNumber: [
{ {
required: true, required: true,
@ -96,16 +150,14 @@ export default {
icon: "none", icon: "none",
}); });
setTimeout(()=>{ setTimeout(() => {
uni.navigateBack(); uni.navigateBack();
},500) }, 500);
} else {
}
else{
uni.showToast({ uni.showToast({
title: res.data.message, title: res.data.message,
duration: 2000, duration: 2000,
icon:"none" icon: "none",
}); });
} }
}); });

View File

@ -57,10 +57,7 @@
applyInfo.refundWay == 'ORIGINAL' ? '原路退回' : '账号退款' applyInfo.refundWay == 'ORIGINAL' ? '原路退回' : '账号退款'
" type="text" input-align="right" :disabled="true" /> " type="text" input-align="right" :disabled="true" />
</u-form-item> </u-form-item>
<view v-if=" <view >
applyInfo.accountType === 'BANK_TRANSFER' &&
applyInfo.applyRefundPrice != 0
">
<u-form-item label="银行开户行" :label-width="150"> <u-form-item label="银行开户行" :label-width="150">
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" /> <u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
</u-form-item> </u-form-item>
@ -100,7 +97,7 @@ import {
import city from "@/components/m-city/m-city"; import city from "@/components/m-city/m-city";
import { upload } from "@/api/common.js"; import { upload } from "@/api/common.js";
import {checkBankno} from '@/utils/Foundation'
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
export default { export default {
component: { component: {
@ -278,6 +275,7 @@ export default {
if (!this.handleCheckParams()) { if (!this.handleCheckParams()) {
return; return;
} }
uni.showLoading({ uni.showLoading({
title: "加载中", 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() { handleCheckParams() {
@ -398,7 +331,7 @@ export default {
type: "error", type: "error",
}); });
return false; return false;
} else if (this.checkBankno(this.form.bankAccountNumber) === false) { } else if (checkBankno(this.form.bankAccountNumber) === false) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "银行卡卡号不正确", title: "银行卡卡号不正确",
type: "error", type: "error",

View File

@ -327,7 +327,7 @@ export default {
header: { header: {
top: 0, top: 0,
height: 50, height: 50,
}, },
goodsParams: [], // goodsParams: [], //
headerFlag: false, // headerFlag: false, //
headerList: [ headerList: [
@ -400,9 +400,9 @@ export default {
return { return {
title: this.goodsDetail.goodsName, title: this.goodsDetail.goodsName,
type: 0, type: 0,
query:`id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`, query: `id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`,
path: `/pages/product/goods`, path: `/pages/product/goods`,
imageUrl:this.goodsDetail.goodsGalleryList[0], imageUrl: this.goodsDetail.goodsGalleryList[0],
}; };
}, },
// #endif // #endif
@ -471,7 +471,7 @@ export default {
this.init(data[0], data[1], data[2]); this.init(data[0], data[1], data[2]);
} }
}); });
} else { } else {
this.init( this.init(
this.routerVal.id, this.routerVal.id,
this.routerVal.goodsId, this.routerVal.goodsId,
@ -500,13 +500,14 @@ export default {
return true; return true;
} }
}, },
selectSku (idObj) { // sku selectSku(idObj) {
this.init(idObj.skuId,idObj.goodsId) this.init(idObj.skuId, idObj.goodsId);
}, },
/** /**
* 初始化信息 * 初始化信息
*/ */
async init(id, goodsId, distributionId) { async init(id, goodsId, distributionId) {
console.log(id, goodsId);
this.isGroup = false; // this.isGroup = false; //
this.productId = id; // skuId this.productId = id; // skuId
// //
@ -532,7 +533,7 @@ export default {
/**商品信息以及规格信息存储 */ /**商品信息以及规格信息存储 */
this.goodsDetail = response.data.result.data; this.goodsDetail = response.data.result.data;
this.goodsSpec = response.data.result.specs; this.goodsSpec = response.data.result.specs;
this.PromotionList = response.data.result.promotionMap; this.PromotionList = response.data.result.promotionMap;
this.goodsParams = response.data.result.goodsParamsDTOList || [] this.goodsParams = response.data.result.goodsParamsDTOList || []
// //

View File

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

View File

@ -73,7 +73,10 @@ export default {
distribution().then((res) => { distribution().then((res) => {
if (res.data.result) { if (res.data.result) {
let type = res.data.result.distributionStatus; let type = res.data.result.distributionStatus;
uni.navigateTo({
url: "/pages/mine/distribution/auth",
});
return
if (type == "PASS") { if (type == "PASS") {
uni.navigateTo({ uni.navigateTo({
url: "/pages/mine/distribution/home", url: "/pages/mine/distribution/home",
@ -91,7 +94,7 @@ export default {
} }
} else if (!res.data.success && res.data.code == 22000) { } else if (!res.data.success && res.data.code == 22000) {
uni.showToast({ uni.showToast({
title: '分销功能暂未开启', title: "分销功能暂未开启",
duration: 2000, duration: 2000,
icon: "none", 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 随机生成指定长度的字符串 * 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路径 * 计算出当前router路径
@ -154,12 +217,11 @@ export function countTimeDown(seconds) {
}; };
} }
function navigationToBack(type) { function navigationToBack(type) {
if (type == "wx") { if (type == "wx") {
// console.log(getCurrentPages().length - 3) // console.log(getCurrentPages().length - 3)
uni.navigateBack({ uni.navigateBack({
delta: getCurrentPages().length , delta: getCurrentPages().length,
}); });
} else { } else {
uni.switchTab({ uni.switchTab({
@ -194,4 +256,5 @@ module.exports = {
countTimeDown, countTimeDown,
theNextDayTime, theNextDayTime,
whetherNavigate, whetherNavigate,
checkBankno,
}; };