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

@ -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;

View File

@ -5,7 +5,8 @@
<view class="head-menu"> <view class="head-menu">
<view class="iconfont icon-xiangzuo" @click="goback" style="color: #fff;"></view> <view class="iconfont icon-xiangzuo" @click="goback" style="color: #fff;"></view>
<navigator :url="'/pages/store/list/index?mer_id='+id" hover-class="none" class="search iconfont icon-xiangyou"> <navigator :url="'/pages/store/list/index?mer_id='+id" hover-class="none"
class="search iconfont icon-xiangyou">
<text class="iconfont icon-sousuo"></text> <text class="iconfont icon-sousuo"></text>
<text class="search-txt">搜索商品名称</text> <text class="search-txt">搜索商品名称</text>
<text class="search-btn">搜索</text> <text class="search-btn">搜索</text>
@ -31,7 +32,8 @@
<view class="star"> <view class="star">
<u-rate readonly count="5" :value="score.star" size="12" activeColor="#FFBC21" <u-rate readonly count="5" :value="score.star" size="12" activeColor="#FFBC21"
inactiveColor="transparent"></u-rate> inactiveColor="transparent"></u-rate>
<text style="color:#FFBC21;font-size: 12px;margin: 0 10rpx 0 4rpx;">{{ score.number.toFixed(1) }}</text> <text
style="color:#FFBC21;font-size: 12px;margin: 0 10rpx 0 4rpx;">{{ score.number.toFixed(1) }}</text>
</view> </view>
<view class="shop-info-sale">月销{{store.sales}}+</view> <view class="shop-info-sale">月销{{store.sales}}+</view>
<view v-if="store.services_type == 0" class="iconfont icon-kefu3" @click="goService"></view> <view v-if="store.services_type == 0" class="iconfont icon-kefu3" @click="goService"></view>
@ -39,7 +41,8 @@
<view v-else class="iconfont icon-kefu3" @click="call(0)"> </view> <view v-else class="iconfont icon-kefu3" @click="call(0)"> </view>
</view> </view>
<view class="shop-info-runtime" v-if="store.mer_info&&store.mer_info.mer_take_time">营业时间 : <view class="shop-info-runtime" v-if="store.mer_info&&store.mer_info.mer_take_time">营业时间 :
{{ store.mer_info.mer_take_time[0] + ' - ' + store.mer_info.mer_take_time[1] }}</view> {{ store.mer_info.mer_take_time[0] + ' - ' + store.mer_info.mer_take_time[1] }}
</view>
<view class="shop-info-runtime" v-else>营业时间 : {{ '00:00 - 00:00' }}</view> <view class="shop-info-runtime" v-else>营业时间 : {{ '00:00 - 00:00' }}</view>
<view class="shop-info-addr iconfont iconfont-xiangyou" @click="showMaoLocation"> <view class="shop-info-addr iconfont iconfont-xiangyou" @click="showMaoLocation">
<text>{{store.mer_address}}</text> <text>{{store.mer_address}}</text>
@ -97,7 +100,8 @@
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<view v-for="(item, index) in styleConfig" :key="index"> <view v-for="(item, index) in styleConfig" :key="index">
<block v-if="item.name != 'headerSerch' && item.name != 'tabNav'"> <block v-if="item.name != 'headerSerch' && item.name != 'tabNav'">
<component :is="item.name" :index="index" :dataConfig="item" :merId="id" @detail="goGoodsDetail"> <component :is="item.name" :index="index" :dataConfig="item" :merId="id"
@detail="goGoodsDetail">
</component> </component>
</block> </block>
</block> </block>
@ -113,7 +117,8 @@
<combination v-if="item.name == 'combination'" :merId="id" :dataConfig="item"></combination> <combination v-if="item.name == 'combination'" :merId="id" :dataConfig="item"></combination>
<topic v-if="item.name == 'topic'" :merId="id" :dataConfig="item"></topic> <topic v-if="item.name == 'topic'" :merId="id" :dataConfig="item"></topic>
<coupon v-if="item.name == 'coupon'" :merId="id" :dataConfig="item"></coupon> <coupon v-if="item.name == 'coupon'" :merId="id" :dataConfig="item"></coupon>
<goodList v-if="item.name == 'goodList'" :merId="id" :dataConfig="item" @detail="goGoodsDetail"> <goodList v-if="item.name == 'goodList'" :merId="id" :dataConfig="item"
@detail="goGoodsDetail">
</goodList> </goodList>
<guide v-if="item.name == 'guide'" :merId="id" :dataConfig="item"></guide> <guide v-if="item.name == 'guide'" :merId="id" :dataConfig="item"></guide>
<liveBroadcast v-if="item.name == 'liveBroadcast'" :merId="id" :dataConfig="item"> <liveBroadcast v-if="item.name == 'liveBroadcast'" :merId="id" :dataConfig="item">
@ -132,11 +137,13 @@
</view> </view>
<!-- 首页 --> <!-- 首页 -->
<view v-show="(tabActive == 3 || tabActive == 7 || diyActive == 1 || diyActive == 2) && tabActive != 5 && tabActive != 2"> <view
v-show="(tabActive == 3 || tabActive == 7 || diyActive == 1 || diyActive == 2) && tabActive != 5 && tabActive != 2">
<!-- 商品 --> <!-- 商品 -->
<view v-if="goods.length" class="goods-wrap" id="goods" @touchmove="onTouchmove"> <view v-if="goods.length" class="goods-wrap" id="goods" @touchmove="onTouchmove">
<view v-if="isColumn" class="goods column"> <view v-if="isColumn" class="goods column">
<view v-for="item in goods" :key="item.product_id" class="item" @click="goGoodsDetail(item)"> <view v-for="item in goods" :key="item.product_id" class="item"
@click="goGoodsDetail(item)">
<view class="image" style="width: 180rpx;height: 180rpx;"> <view class="image" style="width: 180rpx;height: 180rpx;">
<image style="width: 100%;height: 100%;" :src="item.image" lazy-load></image> <image style="width: 100%;height: 100%;" :src="item.image" lazy-load></image>
<view v-if="item.stock == 0" class="sell_out">已售罄</view> <view v-if="item.stock == 0" class="sell_out">已售罄</view>
@ -161,7 +168,8 @@
<view class="price"> <view class="price">
<view class="price-num"> <view class="price-num">
<text class="unit-price">¥{{ item.price }}</text><text class="unit-name">/</text> <text class="unit-price">¥{{ item.price }}</text><text
class="unit-name">/</text>
</view> </view>
<view class="price-icon iconfont icon-gouwuche"></view> <view class="price-icon iconfont icon-gouwuche"></view>
</view> </view>
@ -558,8 +566,7 @@
value: 4, value: 4,
}], }],
// //
tabs3: [ tabs3: [{
{
icon: 'icon-yizhan_o', icon: 'icon-yizhan_o',
name: '云商品', name: '云商品',
value: 7, value: 7,

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>
@ -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;
@ -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;

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

@ -7,6 +7,16 @@ import {
export const initEvent = () => { export const initEvent = () => {
mp.onUniMPEventReceive(async (ret) => { mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', ret); console.log('小程序事件: ', ret);
// 用户如果没有注册商户 从小程序返回 入驻页面
if (ret.event == 'closeAppToOpenShop') {
mp.closeUniMP(ret.fromAppid, (ret) => {
uni.navigateTo({
url: "/pages/store/settled/index"
})
});
}
if (ret.event == 'closeApp') { if (ret.event == 'closeApp') {
mp.closeUniMP(ret.fromAppid, (ret) => { mp.closeUniMP(ret.fromAppid, (ret) => {
console.log('closeUniMP: ' + JSON.stringify(ret)); console.log('closeUniMP: ' + JSON.stringify(ret));
@ -33,7 +43,9 @@ export const initEvent = () => {
// }, {provider:'gps'}); // }, {provider:'gps'});
mp.sendUniMPEvent( mp.sendUniMPEvent(
ret.fromAppid, ret.fromAppid,
'getLocation', {...res}, 'getLocation', {
...res
},
(ret) => { (ret) => {
console.log('Host sendEvent: ' + JSON.stringify(ret)); console.log('Host sendEvent: ' + JSON.stringify(ret));
}); });
@ -45,7 +57,10 @@ export const initEvent = () => {
console.log('测试'); console.log('测试');
mp.sendUniMPEvent( mp.sendUniMPEvent(
ret.fromAppid, ret.fromAppid,
'test', { 'key': 'value', 'name': 'data' }, 'test', {
'key': 'value',
'name': 'data'
},
(ret) => { (ret) => {
console.log('Host sendEvent: ' + JSON.stringify(ret)); console.log('Host sendEvent: ' + JSON.stringify(ret));
}); });
@ -64,7 +79,8 @@ export const initEvent = () => {
// console.log('closeUniMP: ' + JSON.stringify(ret)); // console.log('closeUniMP: ' + JSON.stringify(ret));
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url:'/pages/goods_details/index?id='+arr1.app_goods_id url: '/pages/goods_details/index?id=' + arr1
.app_goods_id
}, 1000) }, 1000)
}) })
}); });