|
|
@@ -64,7 +64,7 @@
|
|
|
<view class="section_1 flex-col">
|
|
|
<image class="logo" :src="ghsInfo.smallAvatar" @click="enterShop(ghsInfo)" />
|
|
|
</view>
|
|
|
- <view class="text-group_7 flex-col justify-between" @click="enterShop(ghsInfo)">
|
|
|
+ <view class="text-group_7 flex-col justify-center" @click="enterShop(ghsInfo)">
|
|
|
<text class="text_8">{{ghsInfo.name}}</text>
|
|
|
<text class="text_9">
|
|
|
|
|
|
@@ -86,6 +86,7 @@
|
|
|
</block>
|
|
|
|
|
|
</text>
|
|
|
+ <text class="text_distance" v-if="ghsInfo.distance && ghsInfo.distance > 0">{{ Math.round(Number(ghsInfo.distance) / 1000) }}km</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="box_4 flex-col"></view>
|
|
|
@@ -156,7 +157,19 @@
|
|
|
</template>
|
|
|
|
|
|
<block v-else>
|
|
|
- <view style="margin:60upx auto 40upx auto;font-weight:bold;font-size:36upx;text-align: center;">暂无批发店</view>
|
|
|
+ <view v-if="isWithinTwoDays" style="margin:60upx auto 40upx auto;font-weight:bold;font-size:36upx;text-align: center;color:#999;">附近暂无批发店</view>
|
|
|
+ <block v-else>
|
|
|
+ <view v-if="!shopInfo.lat || !shopInfo.long" style="display:flex;flex-direction:column;align-items:center;margin-top:100upx;margin-bottom:100upx;">
|
|
|
+ <zui-svg-icon icon="general-location" :width="40" :height="40" color="#09C567"/>
|
|
|
+ <view style="font-size:36upx;color:#999;font-weight:bold;margin-bottom:40upx;">开启定位,查看附近批发店</view>
|
|
|
+ <button style="background-color:#09C567;color:#fff;width:240upx;border-radius:10upx;" @click="pageTo({url:'/admin/shop/add?id='+loginInfo.shopId+'&openLocation=1'})">开启</button>
|
|
|
+ </view>
|
|
|
+ <view v-else style="display:flex;flex-direction:column;align-items:center;margin-top:100upx;margin-bottom:100upx;">
|
|
|
+ <zui-svg-icon icon="general-location" :width="40" :height="40" color="#09C567"/>
|
|
|
+ <view style="font-size:36upx;color:#999;font-weight:bold;margin-bottom:40upx;">寻找附近批发店</view>
|
|
|
+ <button style="background-color:#09C567;color:#fff;width:240upx;border-radius:10upx;" @click="searchGhs()">寻找</button>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
</block>
|
|
|
|
|
|
<view style="text-align:center;margin-top:50upx;margin-bottom:50upx;color:#827171;font-size:32upx;" @click="toPhone()">
|
|
|
@@ -216,10 +229,9 @@
|
|
|
import { consoleIndex } from "@/api/workbench";
|
|
|
import autoUpdateMixins from "@/mixins/autoUpdate";
|
|
|
import { ghsList } from "@/api/purchase";
|
|
|
- import { changeDelStatus,hasMoreGhs } from "@/api/ghs";
|
|
|
+ import { changeDelStatus,hasMoreGhs,searchNearbyGhs } from "@/api/ghs";
|
|
|
import {currentShop, uploadShopAvatar} from "@/api/shop";
|
|
|
import { clearLogin,hasNotice } from "@/api/admin";
|
|
|
- import { unReadMsgCount } from "@/api/chat";
|
|
|
import { APIHOST } from "@/config";
|
|
|
export default {
|
|
|
name: "workbench",
|
|
|
@@ -251,10 +263,16 @@
|
|
|
shortUrlList:[],
|
|
|
unReadMsgNum:0, //未读消息数
|
|
|
showBoughtTooltip: false, // 是否显示买花记录提示
|
|
|
+ supplierSearchTime: 0, // 查找附近批发店时间
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo",myShopInfo:"getMyShopInfo" })
|
|
|
+ ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo",myShopInfo:"getMyShopInfo" }),
|
|
|
+ isWithinTwoDays() {
|
|
|
+ if (!this.supplierSearchTime) return false;
|
|
|
+ const twoDays = 2 * 24 * 60 * 60 * 1000;
|
|
|
+ return (Date.now() - this.supplierSearchTime) < twoDays;
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
//只需要采购花材的花店不显示底部菜单
|
|
|
@@ -279,14 +297,15 @@
|
|
|
const isClosed = uni.getStorageSync('boughtTooltipClosed');
|
|
|
this.showBoughtTooltip = (isClosed !== true && isClosed !== 'true' && isClosed !== '1');
|
|
|
|
|
|
+ this.supplierSearchTime = uni.getStorageSync('supplier_search_time') || 0;
|
|
|
+
|
|
|
this.init();
|
|
|
|
|
|
// 判断是否登录
|
|
|
if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentShopId > 0){
|
|
|
this.handleLoginStyle()
|
|
|
- this.showShopName()
|
|
|
+ //this.showShopName()
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
if (res.from === 'button') {
|
|
|
@@ -313,7 +332,7 @@
|
|
|
this.showBoughtTooltip = false;
|
|
|
uni.setStorageSync('boughtTooltipClosed', '1');
|
|
|
},
|
|
|
- onChooseAvatar(e){
|
|
|
+ onChooseAvatar(e){
|
|
|
if(this.loginInfo && this.loginInfo.staff && this.loginInfo.staff.founder != 2){
|
|
|
this.$msg('门店LOGO请老板修改')
|
|
|
return
|
|
|
@@ -728,6 +747,18 @@
|
|
|
return false
|
|
|
}
|
|
|
// #endif
|
|
|
+ },
|
|
|
+ searchGhs(){
|
|
|
+ searchNearbyGhs().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ uni.setStorageSync('supplier_search_time', Date.now()) //设置缓存时间--记录当前查找附近批发店的时间
|
|
|
+ //重新刷新列表
|
|
|
+ this.getGHSList()
|
|
|
+ this.$msg('查找成功')
|
|
|
+ }else{
|
|
|
+ this.$msg(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -878,8 +909,10 @@
|
|
|
}
|
|
|
.text-group_7 {
|
|
|
width: 533upx;
|
|
|
- height: 99upx;
|
|
|
+ min-height: 99upx;
|
|
|
+ height: auto;
|
|
|
margin-top: 5upx;
|
|
|
+ justify-content: center;
|
|
|
.text_8 {
|
|
|
display:inline-block;
|
|
|
width: 550upx;
|
|
|
@@ -891,6 +924,7 @@
|
|
|
white-space: nowrap;
|
|
|
line-height:38upx;
|
|
|
overflow:hidden;
|
|
|
+ margin-bottom: 12upx;
|
|
|
}
|
|
|
.text_9 {
|
|
|
width: 533upx;
|
|
|
@@ -901,7 +935,12 @@
|
|
|
text-align: left;
|
|
|
white-space: nowrap;
|
|
|
line-height: 24upx;
|
|
|
- margin-top: 10upx;
|
|
|
+ margin-bottom: 10upx;
|
|
|
+ }
|
|
|
+ .text_distance {
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #666;
|
|
|
+ line-height: 24upx;
|
|
|
}
|
|
|
}
|
|
|
}
|