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

View File

@ -57,9 +57,9 @@ module.exports = {
// 聊天长连接地址 // 聊天长连接地址
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL, VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
// #endif // #endif
HTTP_REQUEST_URL_SIX: httpSix, HTTP_REQUEST_URL_SIX: httpSix,
openPlantGrass: openPlantGrass, openPlantGrass: openPlantGrass,
ENV: env, ENV: env,
HEADER: { HEADER: {
'content-type': 'application/json', 'content-type': 'application/json',
//#ifdef H5 //#ifdef H5

View File

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

View File

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

View File

@ -1,74 +1,90 @@
const mp = uni.requireNativePlugin('uniMP'); const mp = uni.requireNativePlugin('uniMP');
import { import {
uniMPgetLocation, uniMPgetLocation,
test test
} from "@/utils/uniMPfunction.js" } from "@/utils/uniMPfunction.js"
export const initEvent = () => { export const initEvent = () => {
mp.onUniMPEventReceive(async (ret) => { mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', 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 == 'closeAppToOpenShop') {
mp.closeUniMP(ret.fromAppid, (ret) => {
uni.navigateTo({
url: "/pages/store/settled/index"
})
});
}
//直播小程序跳转商城购买商品 if (ret.event == 'closeApp') {
if (ret.event == 'live_shop') { mp.closeUniMP(ret.fromAppid, (ret) => {
console.log(JSON.stringify(ret)) console.log('closeUniMP: ' + JSON.stringify(ret));
let arr1=ret.data });
mp.closeUniMP(ret.fromAppid, (ret) => { }
// console.log('closeUniMP: ' + JSON.stringify(ret)); if (ret.event == 'getLocation') {
setTimeout(()=>{ try {
uni.navigateTo({ console.log('获取定位');
url:'/pages/goods_details/index?id='+arr1.app_goods_id let res = await uniMPgetLocation();
},1000) console.log(res);
}) // plus.geolocation.getCurrentPosition(function(position) {
}); // console.log('经度:' + position.coords.longitude);
// console.log('收到小程序事件: ' + JSON.stringify(ret)); // 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));
}
});
} }