This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-04-02 16:37:05 +08:00
parent 4a89a7451a
commit 8c711250b9
7 changed files with 2260 additions and 2230 deletions

View File

@ -100,7 +100,7 @@ export function getCategoryIndexList() {
* 获取产品列表
* @param object data
*/
export function getProductslist(data, enLoad=false) {
export function getProductslist(data, enLoad = false) {
if (data.brand_id && Array.isArray(data.brand_id)) {
data = {
...data
@ -109,7 +109,7 @@ export function getProductslist(data, enLoad=false) {
}
return request.get('product/spu/lst', data, {
noAuth: true,
enLoad: enLoad
enLoad: enLoad
});
}
/**
@ -140,22 +140,22 @@ export function getBrandlist(data) {
* 获取推荐产品
*
*/
export function getProductHot(page, limit, sale_type, rand=0, enLoad=false) {
export function getProductHot(page, limit, sale_type, rand = 0, enLoad = false) {
return request.get("product/spu/recommend", {
page: page === undefined ? 1 : page,
limit: limit === undefined ? 10 : limit,
sale_type: sale_type || null,
rand: rand
sale_type: sale_type || null,
rand: rand
}, {
noAuth: true,
enLoad: enLoad
enLoad: enLoad
});
}
/**
* 获取商户推荐产品
*
*/
export function getMerProductHot(id,data) {
export function getMerProductHot(id, data) {
return request.get(`product/spu/recommend`, {
page: data.page === undefined ? 1 : data.page,
limit: data.limit === undefined ? 10 : data.limit,
@ -559,11 +559,11 @@ export function getParmasValue(id) {
*
*/
export function arrivalNoticeApi(data) {
return request.post('store/product/increase_take',data);
return request.post('store/product/increase_take', data);
}
/*
获取图片验证码
*/
*/
export function getCaptcha() {
return request.get('captcha');
}

View File

@ -57,9 +57,9 @@ module.exports = {
// 聊天长连接地址
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
// #endif
HTTP_REQUEST_URL_SIX: httpSix,
HTTP_REQUEST_URL_SIX: httpSix,
openPlantGrass: openPlantGrass,
ENV: env,
ENV: env,
HEADER: {
'content-type': 'application/json',
//#ifdef H5
@ -76,4 +76,4 @@ module.exports = {
TOKENNAME: 'X-Token',
// 缓存时间 0 永久
EXPIRE: 0,
};
};

View File

@ -210,6 +210,12 @@
title: "请输入付款金额"
})
}
if (!this.merchantInfo || this.merchantInfo.length == 0) {
return this.$util.Tips({
title: "该商家当前价格下,无对应商品!"
})
}
this.loading = true;
if (that.merchantInfo && that.merchantInfo.length > 0) {
//
@ -257,7 +263,7 @@
money: that.cartForm.total_amount
}).then(res => {
this.loading = false;
if (!that.cartForm.total_amount) {
if (!that.cartForm.total_amount && !this.mer_name) {
this.mer_name = res.data.merchant;
} else {
that.merchantInfo = res.data.list;

File diff suppressed because one or more lines are too long

View File

@ -192,7 +192,7 @@
</view>
</view>
<view class="item" v-if="nature_business==1">
<!-- <view class="item" v-if="nature_business==1">
<view class="acea-row row-middle">
<text class="item-name">对公账号</text>
<input type="number" placeholder="请输入对公账号" v-model="merchantData.bank_code"
@ -243,7 +243,7 @@
</view>
</view>
</view>
</view>
</view> -->
<view class="item">
<view class="acea-row row-middle">
@ -266,8 +266,8 @@
<view class="item" v-if="isShowCode">
<view class="acea-row row-middle">
<text class="item-name">验证码</text>
<input type="number" maxlength="4" placeholder="请输入验证码" class="codeIput" v-model="codeVal"
@input="validateBtn" placeholder-class='placeholder' />
<input type="number" maxlength="4" placeholder="请输入验证码" class="codeIput"
v-model="codeVal" @input="validateBtn" placeholder-class='placeholder' />
<view class="imageCode" @click="again">
<image :src="codeUrl" />
</view>
@ -521,7 +521,7 @@
this.getGoodsDetails(options.mer_i_id)
})
} else this.getCity();
this.shoplist('mer_services_agree');
this.shoplist('mer_services_agree');
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 45;
},
@ -699,12 +699,12 @@
this.street_id = resData.street_id
this.village_id = resData.village_id;
const bankInfo = resData.financial_bank ? JSON.parse(resData.financial_bank) : '';
this.$set(this.merchantData, 'bank_code', bankInfo.bank_code);
this.$set(this.merchantData, 'bank_username', bankInfo.bank);
this.$set(this.merchantData, 'bank_opening', bankInfo.bank_branch);
this.$set(this.merchantData, 'bank_card_username', bankInfo.name);
this.bank_front = bankInfo.bank_front[0] ? bankInfo.bank_front[0] : '';
// const bankInfo = resData.financial_bank ? JSON.parse(resData.financial_bank) : '';
// this.$set(this.merchantData, 'bank_code', bankInfo.bank_code);
// this.$set(this.merchantData, 'bank_username', bankInfo.bank);
// this.$set(this.merchantData, 'bank_opening', bankInfo.bank_branch);
// this.$set(this.merchantData, 'bank_card_username', bankInfo.name);
// this.bank_front = bankInfo.bank_front[0] ? bankInfo.bank_front[0] : '';
this.nature_business = resData.is_company == 1 ? 1 : 2;
@ -766,7 +766,7 @@
let idx = e.target.value
this.merchantData.mer_type = this.storeTypeArr[idx]['mer_type_id']
this.mer_storeType = this.storeTypeArr[idx]['type_name']
this.shoplist('mer_services_agree')
this.shoplist('mer_services_agree')
// if (this.storeTypeArr[idx]['type_code'] == 'TypeStore' && this.merchantData.mer_type) {
// this.shoplist('mer_services_agree')
// } else {
@ -1001,15 +1001,15 @@
village_id: this.village_id,
is_nmsc: this.isnum,
images: [this.business_license, ...that.pics],
financial_bank: {
//
bank_code: this.merchantData.bank_code,
bank: this.merchantData.bank_username,
bank_branch: this.merchantData.bank_opening,
name: this.nature_business == 1 ? that.merchantData.company_name : this.merchantData
.bank_card_username,
bank_front: [this.bank_front]
}
// financial_bank: {
// //
// bank_code: this.merchantData.bank_code,
// bank: this.merchantData.bank_username,
// bank_branch: this.merchantData.bank_opening,
// name: this.nature_business == 1 ? that.merchantData.company_name : this.merchantData
// .bank_card_username,
// bank_front: [this.bank_front]
// }
}
that.validate = false;
@ -1138,35 +1138,35 @@
});
if (this.nature_business == 1 && !this.merchantData.bank_code) {
return that.$util.Tips({
title: '请输入对公账号'
});
}
// if (this.nature_business == 1 && !this.merchantData.bank_code) {
// return that.$util.Tips({
// title: ''
// });
// }
if (this.nature_business != 1 && !this.merchantData.bank_code) {
return that.$util.Tips({
title: '请输入银行卡号'
});
}
// if (this.nature_business != 1 && !this.merchantData.bank_code) {
// return that.$util.Tips({
// title: ''
// });
// }
if (!this.merchantData.bank_username) {
return that.$util.Tips({
title: '请输入开户银行'
});
}
// if (!this.merchantData.bank_username) {
// return that.$util.Tips({
// title: ''
// });
// }
if (!this.merchantData.bank_opening) {
return that.$util.Tips({
title: '请输入开户网点'
});
}
// if (!this.merchantData.bank_opening) {
// return that.$util.Tips({
// title: ''
// });
// }
if (this.nature_business == 0 && !this.merchantData.bank_card_username) {
return that.$util.Tips({
title: '请输入持卡人姓名'
});
}
// if (this.nature_business == 0 && !this.merchantData.bank_card_username) {
// return that.$util.Tips({
// title: ''
// });
// }
that.validate = true;
return true;
@ -1614,7 +1614,7 @@
position: fixed;
top: 0;
left: 0;
z-index: 12;
z-index: 12;
background: rgba(0, 0, 0, .5);
}

View File

@ -173,7 +173,7 @@
}).catch((err) => {
that.$util.Tips({
title: err,
icon: 'success'
icon: 'none'
})
})
} else { //
@ -191,7 +191,8 @@
});
}).catch(err => {
return that.$util.Tips({
title: err
title: err,
icon: "none"
});
})
}

View File

@ -1,74 +1,90 @@
const mp = uni.requireNativePlugin('uniMP');
import {
uniMPgetLocation,
test
uniMPgetLocation,
test
} from "@/utils/uniMPfunction.js"
export const initEvent = () => {
mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', ret);
if (ret.event == 'closeApp') {
mp.closeUniMP(ret.fromAppid, (ret) => {
console.log('closeUniMP: ' + JSON.stringify(ret));
});
}
if (ret.event == 'getLocation') {
try {
console.log('获取定位');
let res = await uniMPgetLocation();
console.log(res);
// plus.geolocation.getCurrentPosition(function(position) {
// console.log('经度:' + position.coords.longitude);
// console.log('纬度:' + position.coords.latitude);
// // that.markers[1].latitude = position.coords.longitude;
// // that.markers[1].longitude = position.coords.longitude;
// mp.sendUniMPEvent(
// ret.fromAppid,
// 'getLocation', {...position.coords},
// (ret) => {
// console.log('Host sendEvent: ' + JSON.stringify(ret));
// });
// }, function(error) {
// console.error('获取位置失败:', error.message);
// }, {provider:'gps'});
mp.sendUniMPEvent(
ret.fromAppid,
'getLocation', {...res},
(ret) => {
console.log('Host sendEvent: ' + JSON.stringify(ret));
});
} catch (e) {
console.log(e);
}
}
if (ret.event == 'test') {
console.log('测试');
mp.sendUniMPEvent(
ret.fromAppid,
'test', { 'key': 'value', 'name': 'data' },
(ret) => {
console.log('Host sendEvent: ' + JSON.stringify(ret));
});
}
if (ret.event == 'log') {
// console.log('2222222')
console.log('收到小程序事件: ' + JSON.stringify(ret));
}
//直播小程序跳转商城购买商品
if (ret.event == 'live_shop') {
console.log(JSON.stringify(ret))
let arr1=ret.data
mp.closeUniMP(ret.fromAppid, (ret) => {
// console.log('closeUniMP: ' + JSON.stringify(ret));
setTimeout(()=>{
uni.navigateTo({
url:'/pages/goods_details/index?id='+arr1.app_goods_id
},1000)
})
});
// console.log('收到小程序事件: ' + JSON.stringify(ret));
}
});
mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', ret);
// 用户如果没有注册商户 从小程序返回 入驻页面
if (ret.event == 'closeAppToOpenShop') {
mp.closeUniMP(ret.fromAppid, (ret) => {
uni.navigateTo({
url: "/pages/store/settled/index"
})
});
}
if (ret.event == 'closeApp') {
mp.closeUniMP(ret.fromAppid, (ret) => {
console.log('closeUniMP: ' + JSON.stringify(ret));
});
}
if (ret.event == 'getLocation') {
try {
console.log('获取定位');
let res = await uniMPgetLocation();
console.log(res);
// plus.geolocation.getCurrentPosition(function(position) {
// console.log('经度:' + position.coords.longitude);
// console.log('纬度:' + position.coords.latitude);
// // that.markers[1].latitude = position.coords.longitude;
// // that.markers[1].longitude = position.coords.longitude;
// mp.sendUniMPEvent(
// ret.fromAppid,
// 'getLocation', {...position.coords},
// (ret) => {
// console.log('Host sendEvent: ' + JSON.stringify(ret));
// });
// }, function(error) {
// console.error('获取位置失败:', error.message);
// }, {provider:'gps'});
mp.sendUniMPEvent(
ret.fromAppid,
'getLocation', {
...res
},
(ret) => {
console.log('Host sendEvent: ' + JSON.stringify(ret));
});
} catch (e) {
console.log(e);
}
}
if (ret.event == 'test') {
console.log('测试');
mp.sendUniMPEvent(
ret.fromAppid,
'test', {
'key': 'value',
'name': 'data'
},
(ret) => {
console.log('Host sendEvent: ' + JSON.stringify(ret));
});
}
if (ret.event == 'log') {
// console.log('2222222')
console.log('收到小程序事件: ' + JSON.stringify(ret));
}
//直播小程序跳转商城购买商品
if (ret.event == 'live_shop') {
console.log(JSON.stringify(ret))
let arr1 = ret.data
mp.closeUniMP(ret.fromAppid, (ret) => {
// console.log('closeUniMP: ' + JSON.stringify(ret));
setTimeout(() => {
uni.navigateTo({
url: '/pages/goods_details/index?id=' + arr1
.app_goods_id
}, 1000)
})
});
// console.log('收到小程序事件: ' + JSON.stringify(ret));
}
});
}